mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-06-28 22:26:02 +00:00
node_modules
This commit is contained in:
parent
5e3f23f92c
commit
806116bda4
734 changed files with 224451 additions and 0 deletions
21
node_modules/@octokit/plugin-throttling/LICENSE
generated
vendored
Normal file
21
node_modules/@octokit/plugin-throttling/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
149
node_modules/@octokit/plugin-throttling/README.md
generated
vendored
Normal file
149
node_modules/@octokit/plugin-throttling/README.md
generated
vendored
Normal file
|
@ -0,0 +1,149 @@
|
|||
# plugin-throttling.js
|
||||
|
||||
> Octokit plugin for GitHub’s recommended request throttling
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/plugin-throttling)
|
||||
[](https://github.com/octokit/plugin-throttling.js/actions?workflow=Test)
|
||||
|
||||
Implements all [recommended best practises](https://developer.github.com/v3/guides/best-practices-for-integrators/) to prevent hitting abuse rate limits.
|
||||
|
||||
## Usage
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
|
||||
Load `@octokit/plugin-throttling` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.pika.dev](https://cdn.pika.dev)
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { Octokit } from "https://cdn.pika.dev/@octokit/core";
|
||||
import { throttling } from "https://cdn.pika.dev/@octokit/plugin-throttling";
|
||||
</script>
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Node
|
||||
</th><td>
|
||||
|
||||
Install with `npm install @octokit/core @octokit/plugin-throttling`. Optionally replace `@octokit/core` with a core-compatible module.
|
||||
|
||||
**Note**: If you use it with `@octokit/rest` v16, install `@octokit/core` as a devDependency. This is only temporary and will no longer be necessary with `@octokit/rest` v17.
|
||||
|
||||
```js
|
||||
const { Octokit } = require("@octokit/core");
|
||||
const { throttling } = require("@octokit/plugin-throttling");
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
The code below creates a "Hello, world!" issue on every repository in a given organization. Without the throttling plugin it would send many requests in parallel and would hit rate limits very quickly. But the `@octokit/plugin-throttling` slows down your requests according to the official guidelines, so you don't get blocked before your quota is exhausted.
|
||||
|
||||
The `throttle.onAbuseLimit` and `throttle.onRateLimit` options are required. Return `true` to automatically retry the request after `retryAfter` seconds.
|
||||
|
||||
```js
|
||||
const MyOctokit = Octokit.plugin(throttling);
|
||||
|
||||
const octokit = new MyOctokit({
|
||||
auth: `secret123`,
|
||||
throttle: {
|
||||
onRateLimit: (retryAfter, options) => {
|
||||
console.warn(`Request quota exhausted for request ${options.method} ${options.url}`)
|
||||
|
||||
if (options.request.retryCount === 0) { // only retries once
|
||||
console.log(`Retrying after ${retryAfter} seconds!`)
|
||||
return true
|
||||
}
|
||||
},
|
||||
onAbuseLimit: (retryAfter, options) => {
|
||||
// does not retry, only logs a warning
|
||||
console.warn(`Abuse detected for request ${options.method} ${options.url}`)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
async function createIssueOnAllRepos (org) {
|
||||
const repos = await octokit.paginate(octokit.repos.listForOrg.endpoint({ org }))
|
||||
return Promise.all(repos.forEach(({ name } => {
|
||||
octokit.issues.create({
|
||||
owner,
|
||||
repo: name,
|
||||
title: 'Hello, world!'
|
||||
})
|
||||
})))
|
||||
}
|
||||
```
|
||||
|
||||
Pass `{ throttle: { enabled: false } }` to disable this plugin.
|
||||
|
||||
### Clustering
|
||||
|
||||
Enabling Clustering support ensures that your application will not go over rate limits **across Octokit instances and across Nodejs processes**.
|
||||
|
||||
First install either `redis` or `ioredis`:
|
||||
|
||||
```
|
||||
# NodeRedis (https://github.com/NodeRedis/node_redis)
|
||||
npm install --save redis
|
||||
|
||||
# or ioredis (https://github.com/luin/ioredis)
|
||||
npm install --save ioredis
|
||||
```
|
||||
|
||||
Then in your application:
|
||||
|
||||
```js
|
||||
const Bottleneck = require("bottleneck");
|
||||
const Redis = require("redis");
|
||||
|
||||
const client = Redis.createClient({
|
||||
/* options */
|
||||
});
|
||||
const connection = new Bottleneck.RedisConnection({ client });
|
||||
connection.on("error", err => console.error(err));
|
||||
|
||||
const octokit = new MyOctokit({
|
||||
auth: 'secret123'
|
||||
throttle: {
|
||||
onAbuseLimit: (retryAfter, options) => {
|
||||
/* ... */
|
||||
},
|
||||
onRateLimit: (retryAfter, options) => {
|
||||
/* ... */
|
||||
},
|
||||
|
||||
// The Bottleneck connection object
|
||||
connection,
|
||||
|
||||
// A "throttling ID". All octokit instances with the same ID
|
||||
// using the same Redis server will share the throttling.
|
||||
id: "my-super-app",
|
||||
|
||||
// Otherwise the plugin uses a lighter version of Bottleneck without Redis support
|
||||
Bottleneck
|
||||
}
|
||||
});
|
||||
|
||||
// To close the connection and allow your application to exit cleanly:
|
||||
await connection.disconnect();
|
||||
```
|
||||
|
||||
To use the `ioredis` library instead:
|
||||
|
||||
```js
|
||||
const Redis = require("ioredis");
|
||||
const client = new Redis({
|
||||
/* options */
|
||||
});
|
||||
const connection = new Bottleneck.IORedisConnection({ client });
|
||||
connection.on("error", (err) => console.error(err));
|
||||
```
|
||||
|
||||
## LICENSE
|
||||
|
||||
[MIT](LICENSE)
|
289
node_modules/@octokit/plugin-throttling/dist-node/index.js
generated
vendored
Normal file
289
node_modules/@octokit/plugin-throttling/dist-node/index.js
generated
vendored
Normal file
|
@ -0,0 +1,289 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||
|
||||
var BottleneckLight = _interopDefault(require('bottleneck/light'));
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function 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;
|
||||
}
|
||||
|
||||
const VERSION = "3.2.1";
|
||||
|
||||
const noop = () => Promise.resolve(); // @ts-ignore
|
||||
|
||||
|
||||
function wrapRequest(state, request, options) {
|
||||
return state.retryLimiter.schedule(doRequest, state, request, options);
|
||||
} // @ts-ignore
|
||||
|
||||
async function doRequest(state, request, options) {
|
||||
const isWrite = options.method !== "GET" && options.method !== "HEAD";
|
||||
const isSearch = options.method === "GET" && options.url.startsWith("/search/");
|
||||
const isGraphQL = options.url.startsWith("/graphql");
|
||||
const retryCount = ~~options.request.retryCount;
|
||||
const jobOptions = retryCount > 0 ? {
|
||||
priority: 0,
|
||||
weight: 0
|
||||
} : {};
|
||||
|
||||
if (state.clustering) {
|
||||
// Remove a job from Redis if it has not completed or failed within 60s
|
||||
// Examples: Node process terminated, client disconnected, etc.
|
||||
// @ts-ignore
|
||||
jobOptions.expiration = 1000 * 60;
|
||||
} // Guarantee at least 1000ms between writes
|
||||
// GraphQL can also trigger writes
|
||||
|
||||
|
||||
if (isWrite || isGraphQL) {
|
||||
await state.write.key(state.id).schedule(jobOptions, noop);
|
||||
} // Guarantee at least 3000ms between requests that trigger notifications
|
||||
|
||||
|
||||
if (isWrite && state.triggersNotification(options.url)) {
|
||||
await state.notifications.key(state.id).schedule(jobOptions, noop);
|
||||
} // Guarantee at least 2000ms between search requests
|
||||
|
||||
|
||||
if (isSearch) {
|
||||
await state.search.key(state.id).schedule(jobOptions, noop);
|
||||
}
|
||||
|
||||
const req = state.global.key(state.id).schedule(jobOptions, request, options);
|
||||
|
||||
if (isGraphQL) {
|
||||
const res = await req;
|
||||
|
||||
if (res.data.errors != null && // @ts-ignore
|
||||
res.data.errors.some(error => error.type === "RATE_LIMITED")) {
|
||||
const error = Object.assign(new Error("GraphQL Rate Limit Exceeded"), {
|
||||
headers: res.headers,
|
||||
data: res.data
|
||||
});
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
return req;
|
||||
}
|
||||
|
||||
var triggersNotificationPaths = ["/orgs/:org/invitations", "/orgs/:org/teams/:team_slug/discussions", "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments", "/repos/:owner/:repo/collaborators/:username", "/repos/:owner/:repo/commits/:commit_sha/comments", "/repos/:owner/:repo/issues", "/repos/:owner/:repo/issues/:issue_number/comments", "/repos/:owner/:repo/pulls", "/repos/:owner/:repo/pulls/:pull_number/comments", "/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies", "/repos/:owner/:repo/pulls/:pull_number/merge", "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers", "/repos/:owner/:repo/pulls/:pull_number/reviews", "/repos/:owner/:repo/releases", "/teams/:team_id/discussions", "/teams/:team_id/discussions/:discussion_number/comments"];
|
||||
|
||||
// @ts-ignore
|
||||
function routeMatcher(paths) {
|
||||
// EXAMPLE. For the following paths:
|
||||
|
||||
/* [
|
||||
"/orgs/:org/invitations",
|
||||
"/repos/:owner/:repo/collaborators/:username"
|
||||
] */
|
||||
// @ts-ignore
|
||||
const regexes = paths.map(path => path.split("/") // @ts-ignore
|
||||
.map(c => c.startsWith(":") ? "(?:.+?)" : c).join("/")); // 'regexes' would contain:
|
||||
|
||||
/* [
|
||||
'/orgs/(?:.+?)/invitations',
|
||||
'/repos/(?:.+?)/(?:.+?)/collaborators/(?:.+?)'
|
||||
] */
|
||||
// @ts-ignore
|
||||
|
||||
const regex = `^(?:${regexes.map(r => `(?:${r})`).join("|")})[^/]*$`; // 'regex' would contain:
|
||||
|
||||
/*
|
||||
^(?:(?:\/orgs\/(?:.+?)\/invitations)|(?:\/repos\/(?:.+?)\/(?:.+?)\/collaborators\/(?:.+?)))[^\/]*$
|
||||
It may look scary, but paste it into https://www.debuggex.com/
|
||||
and it will make a lot more sense!
|
||||
*/
|
||||
|
||||
return new RegExp(regex, "i");
|
||||
}
|
||||
|
||||
const regex = routeMatcher(triggersNotificationPaths);
|
||||
const triggersNotification = regex.test.bind(regex);
|
||||
const groups = {}; // @ts-ignore
|
||||
|
||||
const createGroups = function (Bottleneck, common) {
|
||||
// @ts-ignore
|
||||
groups.global = new Bottleneck.Group(_objectSpread2({
|
||||
id: "octokit-global",
|
||||
maxConcurrent: 10
|
||||
}, common)); // @ts-ignore
|
||||
|
||||
groups.search = new Bottleneck.Group(_objectSpread2({
|
||||
id: "octokit-search",
|
||||
maxConcurrent: 1,
|
||||
minTime: 2000
|
||||
}, common)); // @ts-ignore
|
||||
|
||||
groups.write = new Bottleneck.Group(_objectSpread2({
|
||||
id: "octokit-write",
|
||||
maxConcurrent: 1,
|
||||
minTime: 1000
|
||||
}, common)); // @ts-ignore
|
||||
|
||||
groups.notifications = new Bottleneck.Group(_objectSpread2({
|
||||
id: "octokit-notifications",
|
||||
maxConcurrent: 1,
|
||||
minTime: 3000
|
||||
}, common));
|
||||
};
|
||||
|
||||
function throttling(octokit, octokitOptions = {}) {
|
||||
const {
|
||||
enabled = true,
|
||||
Bottleneck = BottleneckLight,
|
||||
id = "no-id",
|
||||
timeout = 1000 * 60 * 2,
|
||||
// Redis TTL: 2 minutes
|
||||
connection
|
||||
} = octokitOptions.throttle || {};
|
||||
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const common = {
|
||||
connection,
|
||||
timeout
|
||||
}; // @ts-ignore
|
||||
|
||||
if (groups.global == null) {
|
||||
createGroups(Bottleneck, common);
|
||||
}
|
||||
|
||||
const state = Object.assign(_objectSpread2({
|
||||
clustering: connection != null,
|
||||
triggersNotification,
|
||||
minimumAbuseRetryAfter: 5,
|
||||
retryAfterBaseValue: 1000,
|
||||
retryLimiter: new Bottleneck(),
|
||||
id
|
||||
}, groups), // @ts-ignore
|
||||
octokitOptions.throttle);
|
||||
|
||||
if (typeof state.onAbuseLimit !== "function" || typeof state.onRateLimit !== "function") {
|
||||
throw new Error(`octokit/plugin-throttling error:
|
||||
You must pass the onAbuseLimit and onRateLimit error handlers.
|
||||
See https://github.com/octokit/rest.js#throttling
|
||||
|
||||
const octokit = new Octokit({
|
||||
throttle: {
|
||||
onAbuseLimit: (retryAfter, options) => {/* ... */},
|
||||
onRateLimit: (retryAfter, options) => {/* ... */}
|
||||
}
|
||||
})
|
||||
`);
|
||||
}
|
||||
|
||||
const events = {};
|
||||
const emitter = new Bottleneck.Events(events); // @ts-ignore
|
||||
|
||||
events.on("abuse-limit", state.onAbuseLimit); // @ts-ignore
|
||||
|
||||
events.on("rate-limit", state.onRateLimit); // @ts-ignore
|
||||
|
||||
events.on("error", e => console.warn("Error in throttling-plugin limit handler", e)); // @ts-ignore
|
||||
|
||||
state.retryLimiter.on("failed", async function (error, info) {
|
||||
const options = info.args[info.args.length - 1];
|
||||
const isGraphQL = options.url.startsWith("/graphql");
|
||||
|
||||
if (!(isGraphQL || error.status === 403)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const retryCount = ~~options.request.retryCount;
|
||||
options.request.retryCount = retryCount;
|
||||
const {
|
||||
wantRetry,
|
||||
retryAfter
|
||||
} = await async function () {
|
||||
if (/\babuse\b/i.test(error.message)) {
|
||||
// The user has hit the abuse rate limit. (REST only)
|
||||
// https://developer.github.com/v3/#abuse-rate-limits
|
||||
// The Retry-After header can sometimes be blank when hitting an abuse limit,
|
||||
// but is always present after 2-3s, so make sure to set `retryAfter` to at least 5s by default.
|
||||
const retryAfter = Math.max(~~error.headers["retry-after"], state.minimumAbuseRetryAfter);
|
||||
const wantRetry = await emitter.trigger("abuse-limit", retryAfter, options);
|
||||
return {
|
||||
wantRetry,
|
||||
retryAfter
|
||||
};
|
||||
}
|
||||
|
||||
if (error.headers != null && error.headers["x-ratelimit-remaining"] === "0") {
|
||||
// The user has used all their allowed calls for the current time period (REST and GraphQL)
|
||||
// https://developer.github.com/v3/#rate-limiting
|
||||
const rateLimitReset = new Date(~~error.headers["x-ratelimit-reset"] * 1000).getTime();
|
||||
const retryAfter = Math.max(Math.ceil((rateLimitReset - Date.now()) / 1000), 0);
|
||||
const wantRetry = await emitter.trigger("rate-limit", retryAfter, options);
|
||||
return {
|
||||
wantRetry,
|
||||
retryAfter
|
||||
};
|
||||
}
|
||||
|
||||
return {};
|
||||
}();
|
||||
|
||||
if (wantRetry) {
|
||||
options.request.retryCount++; // @ts-ignore
|
||||
|
||||
return retryAfter * state.retryAfterBaseValue;
|
||||
}
|
||||
});
|
||||
octokit.hook.wrap("request", wrapRequest.bind(null, state));
|
||||
}
|
||||
throttling.VERSION = VERSION;
|
||||
throttling.triggersNotification = triggersNotification;
|
||||
|
||||
exports.throttling = throttling;
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/@octokit/plugin-throttling/dist-node/index.js.map
generated
vendored
Normal file
1
node_modules/@octokit/plugin-throttling/dist-node/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
18
node_modules/@octokit/plugin-throttling/dist-src/generated/triggers-notification-paths.js
generated
vendored
Normal file
18
node_modules/@octokit/plugin-throttling/dist-src/generated/triggers-notification-paths.js
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
export default [
|
||||
"/orgs/:org/invitations",
|
||||
"/orgs/:org/teams/:team_slug/discussions",
|
||||
"/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments",
|
||||
"/repos/:owner/:repo/collaborators/:username",
|
||||
"/repos/:owner/:repo/commits/:commit_sha/comments",
|
||||
"/repos/:owner/:repo/issues",
|
||||
"/repos/:owner/:repo/issues/:issue_number/comments",
|
||||
"/repos/:owner/:repo/pulls",
|
||||
"/repos/:owner/:repo/pulls/:pull_number/comments",
|
||||
"/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies",
|
||||
"/repos/:owner/:repo/pulls/:pull_number/merge",
|
||||
"/repos/:owner/:repo/pulls/:pull_number/requested_reviewers",
|
||||
"/repos/:owner/:repo/pulls/:pull_number/reviews",
|
||||
"/repos/:owner/:repo/releases",
|
||||
"/teams/:team_id/discussions",
|
||||
"/teams/:team_id/discussions/:discussion_number/comments",
|
||||
];
|
124
node_modules/@octokit/plugin-throttling/dist-src/index.js
generated
vendored
Normal file
124
node_modules/@octokit/plugin-throttling/dist-src/index.js
generated
vendored
Normal file
|
@ -0,0 +1,124 @@
|
|||
// @ts-ignore
|
||||
import BottleneckLight from "bottleneck/light";
|
||||
import { VERSION } from "./version";
|
||||
import { wrapRequest } from "./wrap-request";
|
||||
import triggersNotificationPaths from "./generated/triggers-notification-paths";
|
||||
import { routeMatcher } from "./route-matcher";
|
||||
// Workaround to allow tests to directly access the triggersNotification function.
|
||||
const regex = routeMatcher(triggersNotificationPaths);
|
||||
const triggersNotification = regex.test.bind(regex);
|
||||
const groups = {};
|
||||
// @ts-ignore
|
||||
const createGroups = function (Bottleneck, common) {
|
||||
// @ts-ignore
|
||||
groups.global = new Bottleneck.Group({
|
||||
id: "octokit-global",
|
||||
maxConcurrent: 10,
|
||||
...common,
|
||||
});
|
||||
// @ts-ignore
|
||||
groups.search = new Bottleneck.Group({
|
||||
id: "octokit-search",
|
||||
maxConcurrent: 1,
|
||||
minTime: 2000,
|
||||
...common,
|
||||
});
|
||||
// @ts-ignore
|
||||
groups.write = new Bottleneck.Group({
|
||||
id: "octokit-write",
|
||||
maxConcurrent: 1,
|
||||
minTime: 1000,
|
||||
...common,
|
||||
});
|
||||
// @ts-ignore
|
||||
groups.notifications = new Bottleneck.Group({
|
||||
id: "octokit-notifications",
|
||||
maxConcurrent: 1,
|
||||
minTime: 3000,
|
||||
...common,
|
||||
});
|
||||
};
|
||||
export function throttling(octokit, octokitOptions = {}) {
|
||||
const { enabled = true, Bottleneck = BottleneckLight, id = "no-id", timeout = 1000 * 60 * 2, // Redis TTL: 2 minutes
|
||||
connection, } = octokitOptions.throttle || {};
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
const common = { connection, timeout };
|
||||
// @ts-ignore
|
||||
if (groups.global == null) {
|
||||
createGroups(Bottleneck, common);
|
||||
}
|
||||
const state = Object.assign({
|
||||
clustering: connection != null,
|
||||
triggersNotification,
|
||||
minimumAbuseRetryAfter: 5,
|
||||
retryAfterBaseValue: 1000,
|
||||
retryLimiter: new Bottleneck(),
|
||||
id,
|
||||
...groups,
|
||||
},
|
||||
// @ts-ignore
|
||||
octokitOptions.throttle);
|
||||
if (typeof state.onAbuseLimit !== "function" ||
|
||||
typeof state.onRateLimit !== "function") {
|
||||
throw new Error(`octokit/plugin-throttling error:
|
||||
You must pass the onAbuseLimit and onRateLimit error handlers.
|
||||
See https://github.com/octokit/rest.js#throttling
|
||||
|
||||
const octokit = new Octokit({
|
||||
throttle: {
|
||||
onAbuseLimit: (retryAfter, options) => {/* ... */},
|
||||
onRateLimit: (retryAfter, options) => {/* ... */}
|
||||
}
|
||||
})
|
||||
`);
|
||||
}
|
||||
const events = {};
|
||||
const emitter = new Bottleneck.Events(events);
|
||||
// @ts-ignore
|
||||
events.on("abuse-limit", state.onAbuseLimit);
|
||||
// @ts-ignore
|
||||
events.on("rate-limit", state.onRateLimit);
|
||||
// @ts-ignore
|
||||
events.on("error", (e) => console.warn("Error in throttling-plugin limit handler", e));
|
||||
// @ts-ignore
|
||||
state.retryLimiter.on("failed", async function (error, info) {
|
||||
const options = info.args[info.args.length - 1];
|
||||
const isGraphQL = options.url.startsWith("/graphql");
|
||||
if (!(isGraphQL || error.status === 403)) {
|
||||
return;
|
||||
}
|
||||
const retryCount = ~~options.request.retryCount;
|
||||
options.request.retryCount = retryCount;
|
||||
const { wantRetry, retryAfter } = await (async function () {
|
||||
if (/\babuse\b/i.test(error.message)) {
|
||||
// The user has hit the abuse rate limit. (REST only)
|
||||
// https://developer.github.com/v3/#abuse-rate-limits
|
||||
// The Retry-After header can sometimes be blank when hitting an abuse limit,
|
||||
// but is always present after 2-3s, so make sure to set `retryAfter` to at least 5s by default.
|
||||
const retryAfter = Math.max(~~error.headers["retry-after"], state.minimumAbuseRetryAfter);
|
||||
const wantRetry = await emitter.trigger("abuse-limit", retryAfter, options);
|
||||
return { wantRetry, retryAfter };
|
||||
}
|
||||
if (error.headers != null &&
|
||||
error.headers["x-ratelimit-remaining"] === "0") {
|
||||
// The user has used all their allowed calls for the current time period (REST and GraphQL)
|
||||
// https://developer.github.com/v3/#rate-limiting
|
||||
const rateLimitReset = new Date(~~error.headers["x-ratelimit-reset"] * 1000).getTime();
|
||||
const retryAfter = Math.max(Math.ceil((rateLimitReset - Date.now()) / 1000), 0);
|
||||
const wantRetry = await emitter.trigger("rate-limit", retryAfter, options);
|
||||
return { wantRetry, retryAfter };
|
||||
}
|
||||
return {};
|
||||
})();
|
||||
if (wantRetry) {
|
||||
options.request.retryCount++;
|
||||
// @ts-ignore
|
||||
return retryAfter * state.retryAfterBaseValue;
|
||||
}
|
||||
});
|
||||
octokit.hook.wrap("request", wrapRequest.bind(null, state));
|
||||
}
|
||||
throttling.VERSION = VERSION;
|
||||
throttling.triggersNotification = triggersNotification;
|
29
node_modules/@octokit/plugin-throttling/dist-src/route-matcher.js
generated
vendored
Normal file
29
node_modules/@octokit/plugin-throttling/dist-src/route-matcher.js
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
// @ts-ignore
|
||||
export function routeMatcher(paths) {
|
||||
// EXAMPLE. For the following paths:
|
||||
/* [
|
||||
"/orgs/:org/invitations",
|
||||
"/repos/:owner/:repo/collaborators/:username"
|
||||
] */
|
||||
// @ts-ignore
|
||||
const regexes = paths.map((path) => path
|
||||
.split("/")
|
||||
// @ts-ignore
|
||||
.map((c) => (c.startsWith(":") ? "(?:.+?)" : c))
|
||||
.join("/"));
|
||||
// 'regexes' would contain:
|
||||
/* [
|
||||
'/orgs/(?:.+?)/invitations',
|
||||
'/repos/(?:.+?)/(?:.+?)/collaborators/(?:.+?)'
|
||||
] */
|
||||
// @ts-ignore
|
||||
const regex = `^(?:${regexes.map((r) => `(?:${r})`).join("|")})[^/]*$`;
|
||||
// 'regex' would contain:
|
||||
/*
|
||||
^(?:(?:\/orgs\/(?:.+?)\/invitations)|(?:\/repos\/(?:.+?)\/(?:.+?)\/collaborators\/(?:.+?)))[^\/]*$
|
||||
|
||||
It may look scary, but paste it into https://www.debuggex.com/
|
||||
and it will make a lot more sense!
|
||||
*/
|
||||
return new RegExp(regex, "i");
|
||||
}
|
1
node_modules/@octokit/plugin-throttling/dist-src/version.js
generated
vendored
Normal file
1
node_modules/@octokit/plugin-throttling/dist-src/version.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export const VERSION = "3.2.1";
|
46
node_modules/@octokit/plugin-throttling/dist-src/wrap-request.js
generated
vendored
Normal file
46
node_modules/@octokit/plugin-throttling/dist-src/wrap-request.js
generated
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
const noop = () => Promise.resolve();
|
||||
// @ts-ignore
|
||||
export function wrapRequest(state, request, options) {
|
||||
return state.retryLimiter.schedule(doRequest, state, request, options);
|
||||
}
|
||||
// @ts-ignore
|
||||
async function doRequest(state, request, options) {
|
||||
const isWrite = options.method !== "GET" && options.method !== "HEAD";
|
||||
const isSearch = options.method === "GET" && options.url.startsWith("/search/");
|
||||
const isGraphQL = options.url.startsWith("/graphql");
|
||||
const retryCount = ~~options.request.retryCount;
|
||||
const jobOptions = retryCount > 0 ? { priority: 0, weight: 0 } : {};
|
||||
if (state.clustering) {
|
||||
// Remove a job from Redis if it has not completed or failed within 60s
|
||||
// Examples: Node process terminated, client disconnected, etc.
|
||||
// @ts-ignore
|
||||
jobOptions.expiration = 1000 * 60;
|
||||
}
|
||||
// Guarantee at least 1000ms between writes
|
||||
// GraphQL can also trigger writes
|
||||
if (isWrite || isGraphQL) {
|
||||
await state.write.key(state.id).schedule(jobOptions, noop);
|
||||
}
|
||||
// Guarantee at least 3000ms between requests that trigger notifications
|
||||
if (isWrite && state.triggersNotification(options.url)) {
|
||||
await state.notifications.key(state.id).schedule(jobOptions, noop);
|
||||
}
|
||||
// Guarantee at least 2000ms between search requests
|
||||
if (isSearch) {
|
||||
await state.search.key(state.id).schedule(jobOptions, noop);
|
||||
}
|
||||
const req = state.global.key(state.id).schedule(jobOptions, request, options);
|
||||
if (isGraphQL) {
|
||||
const res = await req;
|
||||
if (res.data.errors != null &&
|
||||
// @ts-ignore
|
||||
res.data.errors.some((error) => error.type === "RATE_LIMITED")) {
|
||||
const error = Object.assign(new Error("GraphQL Rate Limit Exceeded"), {
|
||||
headers: res.headers,
|
||||
data: res.data,
|
||||
});
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return req;
|
||||
}
|
2
node_modules/@octokit/plugin-throttling/dist-types/generated/triggers-notification-paths.d.ts
generated
vendored
Normal file
2
node_modules/@octokit/plugin-throttling/dist-types/generated/triggers-notification-paths.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
declare const _default: string[];
|
||||
export default _default;
|
6
node_modules/@octokit/plugin-throttling/dist-types/index.d.ts
generated
vendored
Normal file
6
node_modules/@octokit/plugin-throttling/dist-types/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
import { Octokit } from "@octokit/core";
|
||||
export declare function throttling(octokit: Octokit, octokitOptions?: {}): void;
|
||||
export declare namespace throttling {
|
||||
var VERSION: string;
|
||||
var triggersNotification: (string: string) => boolean;
|
||||
}
|
1
node_modules/@octokit/plugin-throttling/dist-types/route-matcher.d.ts
generated
vendored
Normal file
1
node_modules/@octokit/plugin-throttling/dist-types/route-matcher.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export declare function routeMatcher(paths: any): RegExp;
|
1
node_modules/@octokit/plugin-throttling/dist-types/version.d.ts
generated
vendored
Normal file
1
node_modules/@octokit/plugin-throttling/dist-types/version.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export declare const VERSION = "3.2.1";
|
1
node_modules/@octokit/plugin-throttling/dist-types/wrap-request.d.ts
generated
vendored
Normal file
1
node_modules/@octokit/plugin-throttling/dist-types/wrap-request.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export declare function wrapRequest(state: any, request: any, options: any): any;
|
222
node_modules/@octokit/plugin-throttling/dist-web/index.js
generated
vendored
Normal file
222
node_modules/@octokit/plugin-throttling/dist-web/index.js
generated
vendored
Normal file
|
@ -0,0 +1,222 @@
|
|||
import BottleneckLight from 'bottleneck/light';
|
||||
|
||||
const VERSION = "3.2.1";
|
||||
|
||||
const noop = () => Promise.resolve();
|
||||
// @ts-ignore
|
||||
function wrapRequest(state, request, options) {
|
||||
return state.retryLimiter.schedule(doRequest, state, request, options);
|
||||
}
|
||||
// @ts-ignore
|
||||
async function doRequest(state, request, options) {
|
||||
const isWrite = options.method !== "GET" && options.method !== "HEAD";
|
||||
const isSearch = options.method === "GET" && options.url.startsWith("/search/");
|
||||
const isGraphQL = options.url.startsWith("/graphql");
|
||||
const retryCount = ~~options.request.retryCount;
|
||||
const jobOptions = retryCount > 0 ? { priority: 0, weight: 0 } : {};
|
||||
if (state.clustering) {
|
||||
// Remove a job from Redis if it has not completed or failed within 60s
|
||||
// Examples: Node process terminated, client disconnected, etc.
|
||||
// @ts-ignore
|
||||
jobOptions.expiration = 1000 * 60;
|
||||
}
|
||||
// Guarantee at least 1000ms between writes
|
||||
// GraphQL can also trigger writes
|
||||
if (isWrite || isGraphQL) {
|
||||
await state.write.key(state.id).schedule(jobOptions, noop);
|
||||
}
|
||||
// Guarantee at least 3000ms between requests that trigger notifications
|
||||
if (isWrite && state.triggersNotification(options.url)) {
|
||||
await state.notifications.key(state.id).schedule(jobOptions, noop);
|
||||
}
|
||||
// Guarantee at least 2000ms between search requests
|
||||
if (isSearch) {
|
||||
await state.search.key(state.id).schedule(jobOptions, noop);
|
||||
}
|
||||
const req = state.global.key(state.id).schedule(jobOptions, request, options);
|
||||
if (isGraphQL) {
|
||||
const res = await req;
|
||||
if (res.data.errors != null &&
|
||||
// @ts-ignore
|
||||
res.data.errors.some((error) => error.type === "RATE_LIMITED")) {
|
||||
const error = Object.assign(new Error("GraphQL Rate Limit Exceeded"), {
|
||||
headers: res.headers,
|
||||
data: res.data,
|
||||
});
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return req;
|
||||
}
|
||||
|
||||
var triggersNotificationPaths = [
|
||||
"/orgs/:org/invitations",
|
||||
"/orgs/:org/teams/:team_slug/discussions",
|
||||
"/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments",
|
||||
"/repos/:owner/:repo/collaborators/:username",
|
||||
"/repos/:owner/:repo/commits/:commit_sha/comments",
|
||||
"/repos/:owner/:repo/issues",
|
||||
"/repos/:owner/:repo/issues/:issue_number/comments",
|
||||
"/repos/:owner/:repo/pulls",
|
||||
"/repos/:owner/:repo/pulls/:pull_number/comments",
|
||||
"/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies",
|
||||
"/repos/:owner/:repo/pulls/:pull_number/merge",
|
||||
"/repos/:owner/:repo/pulls/:pull_number/requested_reviewers",
|
||||
"/repos/:owner/:repo/pulls/:pull_number/reviews",
|
||||
"/repos/:owner/:repo/releases",
|
||||
"/teams/:team_id/discussions",
|
||||
"/teams/:team_id/discussions/:discussion_number/comments",
|
||||
];
|
||||
|
||||
// @ts-ignore
|
||||
function routeMatcher(paths) {
|
||||
// EXAMPLE. For the following paths:
|
||||
/* [
|
||||
"/orgs/:org/invitations",
|
||||
"/repos/:owner/:repo/collaborators/:username"
|
||||
] */
|
||||
// @ts-ignore
|
||||
const regexes = paths.map((path) => path
|
||||
.split("/")
|
||||
// @ts-ignore
|
||||
.map((c) => (c.startsWith(":") ? "(?:.+?)" : c))
|
||||
.join("/"));
|
||||
// 'regexes' would contain:
|
||||
/* [
|
||||
'/orgs/(?:.+?)/invitations',
|
||||
'/repos/(?:.+?)/(?:.+?)/collaborators/(?:.+?)'
|
||||
] */
|
||||
// @ts-ignore
|
||||
const regex = `^(?:${regexes.map((r) => `(?:${r})`).join("|")})[^/]*$`;
|
||||
// 'regex' would contain:
|
||||
/*
|
||||
^(?:(?:\/orgs\/(?:.+?)\/invitations)|(?:\/repos\/(?:.+?)\/(?:.+?)\/collaborators\/(?:.+?)))[^\/]*$
|
||||
|
||||
It may look scary, but paste it into https://www.debuggex.com/
|
||||
and it will make a lot more sense!
|
||||
*/
|
||||
return new RegExp(regex, "i");
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
// Workaround to allow tests to directly access the triggersNotification function.
|
||||
const regex = routeMatcher(triggersNotificationPaths);
|
||||
const triggersNotification = regex.test.bind(regex);
|
||||
const groups = {};
|
||||
// @ts-ignore
|
||||
const createGroups = function (Bottleneck, common) {
|
||||
// @ts-ignore
|
||||
groups.global = new Bottleneck.Group({
|
||||
id: "octokit-global",
|
||||
maxConcurrent: 10,
|
||||
...common,
|
||||
});
|
||||
// @ts-ignore
|
||||
groups.search = new Bottleneck.Group({
|
||||
id: "octokit-search",
|
||||
maxConcurrent: 1,
|
||||
minTime: 2000,
|
||||
...common,
|
||||
});
|
||||
// @ts-ignore
|
||||
groups.write = new Bottleneck.Group({
|
||||
id: "octokit-write",
|
||||
maxConcurrent: 1,
|
||||
minTime: 1000,
|
||||
...common,
|
||||
});
|
||||
// @ts-ignore
|
||||
groups.notifications = new Bottleneck.Group({
|
||||
id: "octokit-notifications",
|
||||
maxConcurrent: 1,
|
||||
minTime: 3000,
|
||||
...common,
|
||||
});
|
||||
};
|
||||
function throttling(octokit, octokitOptions = {}) {
|
||||
const { enabled = true, Bottleneck = BottleneckLight, id = "no-id", timeout = 1000 * 60 * 2, // Redis TTL: 2 minutes
|
||||
connection, } = octokitOptions.throttle || {};
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
const common = { connection, timeout };
|
||||
// @ts-ignore
|
||||
if (groups.global == null) {
|
||||
createGroups(Bottleneck, common);
|
||||
}
|
||||
const state = Object.assign({
|
||||
clustering: connection != null,
|
||||
triggersNotification,
|
||||
minimumAbuseRetryAfter: 5,
|
||||
retryAfterBaseValue: 1000,
|
||||
retryLimiter: new Bottleneck(),
|
||||
id,
|
||||
...groups,
|
||||
},
|
||||
// @ts-ignore
|
||||
octokitOptions.throttle);
|
||||
if (typeof state.onAbuseLimit !== "function" ||
|
||||
typeof state.onRateLimit !== "function") {
|
||||
throw new Error(`octokit/plugin-throttling error:
|
||||
You must pass the onAbuseLimit and onRateLimit error handlers.
|
||||
See https://github.com/octokit/rest.js#throttling
|
||||
|
||||
const octokit = new Octokit({
|
||||
throttle: {
|
||||
onAbuseLimit: (retryAfter, options) => {/* ... */},
|
||||
onRateLimit: (retryAfter, options) => {/* ... */}
|
||||
}
|
||||
})
|
||||
`);
|
||||
}
|
||||
const events = {};
|
||||
const emitter = new Bottleneck.Events(events);
|
||||
// @ts-ignore
|
||||
events.on("abuse-limit", state.onAbuseLimit);
|
||||
// @ts-ignore
|
||||
events.on("rate-limit", state.onRateLimit);
|
||||
// @ts-ignore
|
||||
events.on("error", (e) => console.warn("Error in throttling-plugin limit handler", e));
|
||||
// @ts-ignore
|
||||
state.retryLimiter.on("failed", async function (error, info) {
|
||||
const options = info.args[info.args.length - 1];
|
||||
const isGraphQL = options.url.startsWith("/graphql");
|
||||
if (!(isGraphQL || error.status === 403)) {
|
||||
return;
|
||||
}
|
||||
const retryCount = ~~options.request.retryCount;
|
||||
options.request.retryCount = retryCount;
|
||||
const { wantRetry, retryAfter } = await (async function () {
|
||||
if (/\babuse\b/i.test(error.message)) {
|
||||
// The user has hit the abuse rate limit. (REST only)
|
||||
// https://developer.github.com/v3/#abuse-rate-limits
|
||||
// The Retry-After header can sometimes be blank when hitting an abuse limit,
|
||||
// but is always present after 2-3s, so make sure to set `retryAfter` to at least 5s by default.
|
||||
const retryAfter = Math.max(~~error.headers["retry-after"], state.minimumAbuseRetryAfter);
|
||||
const wantRetry = await emitter.trigger("abuse-limit", retryAfter, options);
|
||||
return { wantRetry, retryAfter };
|
||||
}
|
||||
if (error.headers != null &&
|
||||
error.headers["x-ratelimit-remaining"] === "0") {
|
||||
// The user has used all their allowed calls for the current time period (REST and GraphQL)
|
||||
// https://developer.github.com/v3/#rate-limiting
|
||||
const rateLimitReset = new Date(~~error.headers["x-ratelimit-reset"] * 1000).getTime();
|
||||
const retryAfter = Math.max(Math.ceil((rateLimitReset - Date.now()) / 1000), 0);
|
||||
const wantRetry = await emitter.trigger("rate-limit", retryAfter, options);
|
||||
return { wantRetry, retryAfter };
|
||||
}
|
||||
return {};
|
||||
})();
|
||||
if (wantRetry) {
|
||||
options.request.retryCount++;
|
||||
// @ts-ignore
|
||||
return retryAfter * state.retryAfterBaseValue;
|
||||
}
|
||||
});
|
||||
octokit.hook.wrap("request", wrapRequest.bind(null, state));
|
||||
}
|
||||
throttling.VERSION = VERSION;
|
||||
throttling.triggersNotification = triggersNotification;
|
||||
|
||||
export { throttling };
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/@octokit/plugin-throttling/dist-web/index.js.map
generated
vendored
Normal file
1
node_modules/@octokit/plugin-throttling/dist-web/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/LICENSE
generated
vendored
Normal file
7
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
MIT License Copyright (c) 2019 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
65
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/README.md
generated
vendored
Normal file
65
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/README.md
generated
vendored
Normal file
|
@ -0,0 +1,65 @@
|
|||
# types.ts
|
||||
|
||||
> Shared TypeScript definitions for Octokit projects
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/types)
|
||||
[](https://github.com/octokit/types.ts/actions?workflow=Test)
|
||||
[](https://greenkeeper.io/)
|
||||
|
||||
<!-- toc -->
|
||||
|
||||
- [Usage](#usage)
|
||||
- [Examples](#examples)
|
||||
- [Get parameter and response data types for a REST API endpoint](#get-parameter-and-response-data-types-for-a-rest-api-endpoint)
|
||||
- [Get response types from endpoint methods](#get-response-types-from-endpoint-methods)
|
||||
- [Contributing](#contributing)
|
||||
- [License](#license)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
## Usage
|
||||
|
||||
See all exported types at https://octokit.github.io/types.ts
|
||||
|
||||
## Examples
|
||||
|
||||
### Get parameter and response data types for a REST API endpoint
|
||||
|
||||
```ts
|
||||
import { Endpoints } from "./src";
|
||||
|
||||
type listUserReposParameters = Endpoints["GET /repos/:owner/:repo"]["parameters"];
|
||||
type listUserReposResponse = Endpoints["GET /repos/:owner/:repo"]["response"];
|
||||
|
||||
async function listRepos(
|
||||
options: listUserReposParameters
|
||||
): listUserReposResponse["data"] {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Get response types from endpoint methods
|
||||
|
||||
```ts
|
||||
import {
|
||||
GetResponseTypeFromEndpointMethod,
|
||||
GetResponseDataTypeFromEndpointMethod,
|
||||
} from "@octokit/types";
|
||||
import { Octokit } from "@octokit/rest";
|
||||
|
||||
const octokit = new Octokit();
|
||||
type CreateLabelResponseType = GetResponseTypeFromEndpointMethod<
|
||||
typeof octokit.issues.createLabel
|
||||
>;
|
||||
type CreateLabelResponseDataType = GetResponseDataTypeFromEndpointMethod<
|
||||
typeof octokit.issues.createLabel
|
||||
>;
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
8
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-node/index.js
generated
vendored
Normal file
8
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-node/index.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
const VERSION = "4.0.1";
|
||||
|
||||
exports.VERSION = VERSION;
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-node/index.js.map
generated
vendored
Normal file
1
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-node/index.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.js","sources":["../dist-src/VERSION.js"],"sourcesContent":["export const VERSION = \"0.0.0-development\";\n"],"names":["VERSION"],"mappings":";;;;MAAaA,OAAO,GAAG;;;;"}
|
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/AuthInterface.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/AuthInterface.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/EndpointDefaults.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/EndpointDefaults.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/EndpointInterface.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/EndpointInterface.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/EndpointOptions.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/EndpointOptions.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/Fetch.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/Fetch.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/GetResponseTypeFromEndpointMethod.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/GetResponseTypeFromEndpointMethod.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/OctokitResponse.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/OctokitResponse.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/RequestHeaders.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/RequestHeaders.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/RequestInterface.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/RequestInterface.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/RequestMethod.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/RequestMethod.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/RequestOptions.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/RequestOptions.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/RequestParameters.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/RequestParameters.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/RequestRequestOptions.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/RequestRequestOptions.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/ResponseHeaders.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/ResponseHeaders.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/Route.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/Route.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/Signal.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/Signal.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/StrategyInterface.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/StrategyInterface.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/Url.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/Url.js
generated
vendored
Normal file
1
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/VERSION.js
generated
vendored
Normal file
1
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/VERSION.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export const VERSION = "4.0.1";
|
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/generated/Endpoints.js
generated
vendored
Normal file
0
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/generated/Endpoints.js
generated
vendored
Normal file
1
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/index.js
generated
vendored
Normal file
1
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-src/index.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export * from "./VERSION";
|
31
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/AuthInterface.d.ts
generated
vendored
Normal file
31
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/AuthInterface.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
import { EndpointOptions } from "./EndpointOptions";
|
||||
import { OctokitResponse } from "./OctokitResponse";
|
||||
import { RequestInterface } from "./RequestInterface";
|
||||
import { RequestParameters } from "./RequestParameters";
|
||||
import { Route } from "./Route";
|
||||
/**
|
||||
* Interface to implement complex authentication strategies for Octokit.
|
||||
* An object Implementing the AuthInterface can directly be passed as the
|
||||
* `auth` option in the Octokit constructor.
|
||||
*
|
||||
* For the official implementations of the most common authentication
|
||||
* strategies, see https://github.com/octokit/auth.js
|
||||
*/
|
||||
export interface AuthInterface<AuthOptions extends any[], Authentication extends any> {
|
||||
(...args: AuthOptions): Promise<Authentication>;
|
||||
hook: {
|
||||
/**
|
||||
* Sends a request using the passed `request` instance
|
||||
*
|
||||
* @param {object} endpoint Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<T = any>(request: RequestInterface, options: EndpointOptions): Promise<OctokitResponse<T>>;
|
||||
/**
|
||||
* Sends a request using the passed `request` 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`.
|
||||
*/
|
||||
<T = any>(request: RequestInterface, route: Route, parameters?: RequestParameters): Promise<OctokitResponse<T>>;
|
||||
};
|
||||
}
|
21
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/EndpointDefaults.d.ts
generated
vendored
Normal file
21
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/EndpointDefaults.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
import { RequestHeaders } from "./RequestHeaders";
|
||||
import { RequestMethod } from "./RequestMethod";
|
||||
import { RequestParameters } from "./RequestParameters";
|
||||
import { Url } from "./Url";
|
||||
/**
|
||||
* The `.endpoint()` method is guaranteed to set all keys defined by RequestParameters
|
||||
* as well as the method property.
|
||||
*/
|
||||
export declare type EndpointDefaults = RequestParameters & {
|
||||
baseUrl: Url;
|
||||
method: RequestMethod;
|
||||
url?: Url;
|
||||
headers: RequestHeaders & {
|
||||
accept: string;
|
||||
"user-agent": string;
|
||||
};
|
||||
mediaType: {
|
||||
format: string;
|
||||
previews: string[];
|
||||
};
|
||||
};
|
65
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/EndpointInterface.d.ts
generated
vendored
Normal file
65
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/EndpointInterface.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,65 @@
|
|||
import { EndpointDefaults } from "./EndpointDefaults";
|
||||
import { RequestOptions } from "./RequestOptions";
|
||||
import { RequestParameters } from "./RequestParameters";
|
||||
import { Route } from "./Route";
|
||||
import { Endpoints } from "./generated/Endpoints";
|
||||
export interface EndpointInterface<D extends object = object> {
|
||||
/**
|
||||
* Transforms a GitHub REST API endpoint into generic request options
|
||||
*
|
||||
* @param {object} endpoint Must set `url` unless it's set defaults. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<O extends RequestParameters = RequestParameters>(options: O & {
|
||||
method?: string;
|
||||
} & ("url" extends keyof D ? {
|
||||
url?: string;
|
||||
} : {
|
||||
url: string;
|
||||
})): RequestOptions & Pick<D & O, keyof RequestOptions>;
|
||||
/**
|
||||
* Transforms a GitHub REST API endpoint into generic request options
|
||||
*
|
||||
* @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`.
|
||||
*/
|
||||
<R extends Route, P extends RequestParameters = R extends keyof Endpoints ? Endpoints[R]["parameters"] & RequestParameters : RequestParameters>(route: keyof Endpoints | R, parameters?: P): (R extends keyof Endpoints ? Endpoints[R]["request"] : RequestOptions) & Pick<P, keyof RequestOptions>;
|
||||
/**
|
||||
* Object with current default route and parameters
|
||||
*/
|
||||
DEFAULTS: D & EndpointDefaults;
|
||||
/**
|
||||
* Returns a new `endpoint` interface with new defaults
|
||||
*/
|
||||
defaults: <O extends RequestParameters = RequestParameters>(newDefaults: O) => EndpointInterface<D & O>;
|
||||
merge: {
|
||||
/**
|
||||
* 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 {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
|
||||
*
|
||||
*/
|
||||
<R extends Route, P extends RequestParameters = R extends keyof Endpoints ? Endpoints[R]["parameters"] & RequestParameters : RequestParameters>(route: keyof Endpoints | R, parameters?: P): D & (R extends keyof Endpoints ? Endpoints[R]["request"] & Endpoints[R]["parameters"] : EndpointDefaults) & P;
|
||||
/**
|
||||
* Merges current endpoint defaults with passed route and parameters,
|
||||
* without transforming them into request 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`.
|
||||
*/
|
||||
<P extends RequestParameters = RequestParameters>(options: P): EndpointDefaults & D & P;
|
||||
/**
|
||||
* Returns current default options.
|
||||
*
|
||||
* @deprecated use endpoint.DEFAULTS instead
|
||||
*/
|
||||
(): D & EndpointDefaults;
|
||||
};
|
||||
/**
|
||||
* Stateless method to turn endpoint options into request options.
|
||||
* Calling `endpoint(options)` is the same as calling `endpoint.parse(endpoint.merge(options))`.
|
||||
*
|
||||
* @param {object} options `method`, `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
|
||||
*/
|
||||
parse: <O extends EndpointDefaults = EndpointDefaults>(options: O) => RequestOptions & Pick<O, keyof RequestOptions>;
|
||||
}
|
7
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/EndpointOptions.d.ts
generated
vendored
Normal file
7
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/EndpointOptions.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
import { RequestMethod } from "./RequestMethod";
|
||||
import { Url } from "./Url";
|
||||
import { RequestParameters } from "./RequestParameters";
|
||||
export declare type EndpointOptions = RequestParameters & {
|
||||
method: RequestMethod;
|
||||
url: Url;
|
||||
};
|
4
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/Fetch.d.ts
generated
vendored
Normal file
4
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/Fetch.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
/**
|
||||
* Browser's fetch method (or compatible such as fetch-mock)
|
||||
*/
|
||||
export declare type Fetch = any;
|
5
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/GetResponseTypeFromEndpointMethod.d.ts
generated
vendored
Normal file
5
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/GetResponseTypeFromEndpointMethod.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
declare type Unwrap<T> = T extends Promise<infer U> ? U : T;
|
||||
declare type AnyFunction = (...args: any[]) => any;
|
||||
export declare type GetResponseTypeFromEndpointMethod<T extends AnyFunction> = Unwrap<ReturnType<T>>;
|
||||
export declare type GetResponseDataTypeFromEndpointMethod<T extends AnyFunction> = Unwrap<ReturnType<T>>["data"];
|
||||
export {};
|
17
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/OctokitResponse.d.ts
generated
vendored
Normal file
17
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/OctokitResponse.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { ResponseHeaders } from "./ResponseHeaders";
|
||||
import { Url } from "./Url";
|
||||
export declare type OctokitResponse<T> = {
|
||||
headers: ResponseHeaders;
|
||||
/**
|
||||
* http response code
|
||||
*/
|
||||
status: number;
|
||||
/**
|
||||
* URL of response after all redirects
|
||||
*/
|
||||
url: Url;
|
||||
/**
|
||||
* This is the data you would see in https://developer.Octokit.com/v3/
|
||||
*/
|
||||
data: T;
|
||||
};
|
15
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/RequestHeaders.d.ts
generated
vendored
Normal file
15
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/RequestHeaders.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
export declare type RequestHeaders = {
|
||||
/**
|
||||
* Avoid setting `headers.accept`, use `mediaType.{format|previews}` option instead.
|
||||
*/
|
||||
accept?: string;
|
||||
/**
|
||||
* Use `authorization` to send authenticated request, remember `token ` / `bearer ` prefixes. Example: `token 1234567890abcdef1234567890abcdef12345678`
|
||||
*/
|
||||
authorization?: string;
|
||||
/**
|
||||
* `user-agent` is set do a default and can be overwritten as needed.
|
||||
*/
|
||||
"user-agent"?: string;
|
||||
[header: string]: string | number | undefined;
|
||||
};
|
34
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/RequestInterface.d.ts
generated
vendored
Normal file
34
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/RequestInterface.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
import { EndpointInterface } from "./EndpointInterface";
|
||||
import { OctokitResponse } from "./OctokitResponse";
|
||||
import { RequestParameters } from "./RequestParameters";
|
||||
import { Route } from "./Route";
|
||||
import { Endpoints } from "./generated/Endpoints";
|
||||
export interface RequestInterface<D extends object = object> {
|
||||
/**
|
||||
* Sends a request based on 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`.
|
||||
*/
|
||||
<T = any, O extends RequestParameters = RequestParameters>(options: O & {
|
||||
method?: string;
|
||||
} & ("url" extends keyof D ? {
|
||||
url?: string;
|
||||
} : {
|
||||
url: string;
|
||||
})): Promise<OctokitResponse<T>>;
|
||||
/**
|
||||
* Sends a request based on endpoint options
|
||||
*
|
||||
* @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`.
|
||||
*/
|
||||
<R extends Route>(route: keyof Endpoints | R, options?: R extends keyof Endpoints ? Endpoints[R]["parameters"] & RequestParameters : RequestParameters): R extends keyof Endpoints ? Promise<Endpoints[R]["response"]> : Promise<OctokitResponse<any>>;
|
||||
/**
|
||||
* Returns a new `request` with updated route and parameters
|
||||
*/
|
||||
defaults: <O extends RequestParameters = RequestParameters>(newDefaults: O) => RequestInterface<D & O>;
|
||||
/**
|
||||
* Octokit endpoint API, see {@link https://github.com/octokit/endpoint.js|@octokit/endpoint}
|
||||
*/
|
||||
endpoint: EndpointInterface<D>;
|
||||
}
|
4
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/RequestMethod.d.ts
generated
vendored
Normal file
4
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/RequestMethod.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
/**
|
||||
* HTTP Verb supported by GitHub's REST API
|
||||
*/
|
||||
export declare type RequestMethod = "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT";
|
14
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/RequestOptions.d.ts
generated
vendored
Normal file
14
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/RequestOptions.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
import { RequestHeaders } from "./RequestHeaders";
|
||||
import { RequestMethod } from "./RequestMethod";
|
||||
import { RequestRequestOptions } from "./RequestRequestOptions";
|
||||
import { Url } from "./Url";
|
||||
/**
|
||||
* Generic request options as they are returned by the `endpoint()` method
|
||||
*/
|
||||
export declare type RequestOptions = {
|
||||
method: RequestMethod;
|
||||
url: Url;
|
||||
headers: RequestHeaders;
|
||||
body?: any;
|
||||
request?: RequestRequestOptions;
|
||||
};
|
45
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/RequestParameters.d.ts
generated
vendored
Normal file
45
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/RequestParameters.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
import { RequestRequestOptions } from "./RequestRequestOptions";
|
||||
import { RequestHeaders } from "./RequestHeaders";
|
||||
import { Url } from "./Url";
|
||||
/**
|
||||
* Parameters that can be passed into `request(route, parameters)` or `endpoint(route, parameters)` methods
|
||||
*/
|
||||
export declare type RequestParameters = {
|
||||
/**
|
||||
* 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`.
|
||||
*/
|
||||
baseUrl?: Url;
|
||||
/**
|
||||
* HTTP headers. Use lowercase keys.
|
||||
*/
|
||||
headers?: RequestHeaders;
|
||||
/**
|
||||
* Media type options, see {@link https://developer.github.com/v3/media/|GitHub Developer Guide}
|
||||
*/
|
||||
mediaType?: {
|
||||
/**
|
||||
* `json` by default. Can be `raw`, `text`, `html`, `full`, `diff`, `patch`, `sha`, `base64`. Depending on endpoint
|
||||
*/
|
||||
format?: string;
|
||||
/**
|
||||
* Custom media type names of {@link https://developer.github.com/v3/media/|API Previews} without the `-preview` suffix.
|
||||
* Example for single preview: `['squirrel-girl']`.
|
||||
* Example for multiple previews: `['squirrel-girl', 'mister-fantastic']`.
|
||||
*/
|
||||
previews?: string[];
|
||||
};
|
||||
/**
|
||||
* Pass custom meta information for the request. The `request` object will be returned as is.
|
||||
*/
|
||||
request?: RequestRequestOptions;
|
||||
/**
|
||||
* Any additional parameter will be passed as follows
|
||||
* 1. URL parameter if `':parameter'` or `{parameter}` is part of `url`
|
||||
* 2. Query parameter if `method` is `'GET'` or `'HEAD'`
|
||||
* 3. Request body if `parameter` is `'data'`
|
||||
* 4. JSON in the request body in the form of `body[parameter]` unless `parameter` key is `'data'`
|
||||
*/
|
||||
[parameter: string]: unknown;
|
||||
};
|
26
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/RequestRequestOptions.d.ts
generated
vendored
Normal file
26
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/RequestRequestOptions.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
/// <reference types="node" />
|
||||
import { Agent } from "http";
|
||||
import { Fetch } from "./Fetch";
|
||||
import { Signal } from "./Signal";
|
||||
/**
|
||||
* Octokit-specific request options which are ignored for the actual request, but can be used by Octokit or plugins to manipulate how the request is sent or how a response is handled
|
||||
*/
|
||||
export declare type RequestRequestOptions = {
|
||||
/**
|
||||
* Node only. Useful for custom proxy, certificate, or dns lookup.
|
||||
*/
|
||||
agent?: Agent;
|
||||
/**
|
||||
* Custom replacement for built-in fetch method. Useful for testing or request hooks.
|
||||
*/
|
||||
fetch?: Fetch;
|
||||
/**
|
||||
* Use an `AbortController` instance to cancel a request. In node you can only cancel streamed requests.
|
||||
*/
|
||||
signal?: Signal;
|
||||
/**
|
||||
* Node only. Request/response timeout in ms, it resets on redirect. 0 to disable (OS limit applies). `options.request.signal` is recommended instead.
|
||||
*/
|
||||
timeout?: number;
|
||||
[option: string]: any;
|
||||
};
|
20
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/ResponseHeaders.d.ts
generated
vendored
Normal file
20
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/ResponseHeaders.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
export declare type ResponseHeaders = {
|
||||
"cache-control"?: string;
|
||||
"content-length"?: number;
|
||||
"content-type"?: string;
|
||||
date?: string;
|
||||
etag?: string;
|
||||
"last-modified"?: string;
|
||||
link?: string;
|
||||
location?: string;
|
||||
server?: string;
|
||||
status?: string;
|
||||
vary?: string;
|
||||
"x-github-mediatype"?: string;
|
||||
"x-github-request-id"?: string;
|
||||
"x-oauth-scopes"?: string;
|
||||
"x-ratelimit-limit"?: string;
|
||||
"x-ratelimit-remaining"?: string;
|
||||
"x-ratelimit-reset"?: string;
|
||||
[header: string]: string | number | undefined;
|
||||
};
|
4
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/Route.d.ts
generated
vendored
Normal file
4
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/Route.d.ts
generated
vendored
Normal file
|
@ -0,0 +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`
|
||||
*/
|
||||
export declare type Route = string;
|
6
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/Signal.d.ts
generated
vendored
Normal file
6
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/Signal.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
/**
|
||||
* Abort signal
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
|
||||
*/
|
||||
export declare type Signal = any;
|
4
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/StrategyInterface.d.ts
generated
vendored
Normal file
4
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/StrategyInterface.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
import { AuthInterface } from "./AuthInterface";
|
||||
export interface StrategyInterface<StrategyOptions extends any[], AuthOptions extends any[], Authentication extends object> {
|
||||
(...args: StrategyOptions): AuthInterface<AuthOptions, Authentication>;
|
||||
}
|
4
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/Url.d.ts
generated
vendored
Normal file
4
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/Url.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
/**
|
||||
* Relative or absolute URL. Examples: `'/orgs/:org'`, `https://example.com/foo/bar`
|
||||
*/
|
||||
export declare type Url = string;
|
1
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/VERSION.d.ts
generated
vendored
Normal file
1
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/VERSION.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export declare const VERSION = "4.0.1";
|
36955
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/generated/Endpoints.d.ts
generated
vendored
Normal file
36955
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/generated/Endpoints.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
20
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/index.d.ts
generated
vendored
Normal file
20
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-types/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
export * from "./AuthInterface";
|
||||
export * from "./EndpointDefaults";
|
||||
export * from "./EndpointInterface";
|
||||
export * from "./EndpointOptions";
|
||||
export * from "./Fetch";
|
||||
export * from "./OctokitResponse";
|
||||
export * from "./RequestHeaders";
|
||||
export * from "./RequestInterface";
|
||||
export * from "./RequestMethod";
|
||||
export * from "./RequestOptions";
|
||||
export * from "./RequestParameters";
|
||||
export * from "./RequestRequestOptions";
|
||||
export * from "./ResponseHeaders";
|
||||
export * from "./Route";
|
||||
export * from "./Signal";
|
||||
export * from "./StrategyInterface";
|
||||
export * from "./Url";
|
||||
export * from "./VERSION";
|
||||
export * from "./GetResponseTypeFromEndpointMethod";
|
||||
export * from "./generated/Endpoints";
|
4
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-web/index.js
generated
vendored
Normal file
4
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-web/index.js
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
const VERSION = "4.0.1";
|
||||
|
||||
export { VERSION };
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-web/index.js.map
generated
vendored
Normal file
1
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/dist-web/index.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.js","sources":["../dist-src/VERSION.js"],"sourcesContent":["export const VERSION = \"0.0.0-development\";\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
|
49
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/package.json
generated
vendored
Normal file
49
node_modules/@octokit/plugin-throttling/node_modules/@octokit/types/package.json
generated
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"name": "@octokit/types",
|
||||
"description": "Shared TypeScript definitions for Octokit projects",
|
||||
"version": "4.0.1",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"dist-*/",
|
||||
"bin/"
|
||||
],
|
||||
"pika": true,
|
||||
"sideEffects": false,
|
||||
"keywords": [
|
||||
"github",
|
||||
"api",
|
||||
"sdk",
|
||||
"toolkit",
|
||||
"typescript"
|
||||
],
|
||||
"repository": "https://github.com/octokit/types.ts",
|
||||
"dependencies": {
|
||||
"@types/node": ">= 8"
|
||||
},
|
||||
"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",
|
||||
"handlebars": "^4.7.6",
|
||||
"json-schema-to-typescript": "^9.1.0",
|
||||
"lodash.set": "^4.3.2",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"pascal-case": "^3.1.1",
|
||||
"prettier": "^2.0.0",
|
||||
"semantic-release": "^17.0.0",
|
||||
"semantic-release-plugin-update-version-in-files": "^1.0.0",
|
||||
"sort-keys": "^4.0.0",
|
||||
"string-to-jsdoc-comment": "^1.0.0",
|
||||
"typedoc": "^0.17.0",
|
||||
"typescript": "^3.6.4"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"source": "dist-src/index.js",
|
||||
"types": "dist-types/index.d.ts",
|
||||
"main": "dist-node/index.js",
|
||||
"module": "dist-web/index.js"
|
||||
}
|
50
node_modules/@octokit/plugin-throttling/package.json
generated
vendored
Normal file
50
node_modules/@octokit/plugin-throttling/package.json
generated
vendored
Normal file
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"name": "@octokit/plugin-throttling",
|
||||
"description": "Octokit plugin for GitHub’s recommended request throttling",
|
||||
"version": "3.2.1",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"dist-*/",
|
||||
"bin/"
|
||||
],
|
||||
"pika": true,
|
||||
"sideEffects": false,
|
||||
"homepage": "https://github.com/octokit/plugin-throttling.js#readme",
|
||||
"bugs": {
|
||||
"url": "https://github.com/octokit/plugin-throttling.js/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/octokit/plugin-throttling.js.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"bottleneck": "^2.15.3",
|
||||
"@octokit/types": "^4.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@octokit/core": "^2.0.0",
|
||||
"@octokit/request-error": "^2.0.0",
|
||||
"@pika/pack": "^0.5.0",
|
||||
"@pika/plugin-build-node": "^0.9.1",
|
||||
"@pika/plugin-build-web": "^0.9.1",
|
||||
"@pika/plugin-ts-standard-pkg": "^0.9.1",
|
||||
"@types/fetch-mock": "^7.3.1",
|
||||
"@types/jest": "^25.1.0",
|
||||
"@types/node": "^14.0.1",
|
||||
"fetch-mock": "^9.0.0",
|
||||
"jest": "^26.0.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.0.1",
|
||||
"semantic-release": "^17.0.0",
|
||||
"semantic-release-plugin-update-version-in-files": "^1.0.0",
|
||||
"ts-jest": "^26.0.0",
|
||||
"typescript": "^3.7.2"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"source": "dist-src/index.js",
|
||||
"types": "dist-types/index.d.ts",
|
||||
"main": "dist-node/index.js",
|
||||
"module": "dist-web/index.js"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue