Skip to content

Commit dbde752

Browse files
committed
fix: add missing build assets
1 parent 1700441 commit dbde752

File tree

1 file changed

+125
-129
lines changed

1 file changed

+125
-129
lines changed

dist/index.mjs

+125-129
Original file line numberDiff line numberDiff line change
@@ -11676,77 +11676,61 @@ retry.VERSION = VERSION;
1167611676
/***/ }),
1167711677

1167811678
/***/ 9968:
11679-
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
11679+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1168011680

1168111681

11682-
var __create = Object.create;
11683-
var __defProp = Object.defineProperty;
11684-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11685-
var __getOwnPropNames = Object.getOwnPropertyNames;
11686-
var __getProtoOf = Object.getPrototypeOf;
11687-
var __hasOwnProp = Object.prototype.hasOwnProperty;
11688-
var __export = (target, all) => {
11689-
for (var name in all)
11690-
__defProp(target, name, { get: all[name], enumerable: true });
11691-
};
11692-
var __copyProps = (to, from, except, desc) => {
11693-
if (from && typeof from === "object" || typeof from === "function") {
11694-
for (let key of __getOwnPropNames(from))
11695-
if (!__hasOwnProp.call(to, key) && key !== except)
11696-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11697-
}
11698-
return to;
11699-
};
11700-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
11701-
// If the importer is in node compatibility mode or this is not an ESM
11702-
// file that has been converted to a CommonJS file using a Babel-
11703-
// compatible transform (i.e. "__esModule" has not been set), then set
11704-
// "default" to the CommonJS "module.exports" for node compatibility.
11705-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
11706-
mod
11707-
));
11708-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1170911682

11710-
// pkg/dist-src/index.js
11711-
var dist_src_exports = {};
11712-
__export(dist_src_exports, {
11713-
throttling: () => throttling
11714-
});
11715-
module.exports = __toCommonJS(dist_src_exports);
11716-
var import_light = __toESM(__nccwpck_require__(1174));
11683+
Object.defineProperty(exports, "__esModule", ({ value: true }));
1171711684

11718-
// pkg/dist-src/version.js
11719-
var VERSION = "6.1.0";
11685+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
1172011686

11721-
// pkg/dist-src/wrap-request.js
11722-
var noop = () => Promise.resolve();
11687+
var BottleneckLight = _interopDefault(__nccwpck_require__(1174));
11688+
11689+
const VERSION = "5.2.3";
11690+
11691+
const noop = () => Promise.resolve();
11692+
// @ts-expect-error
1172311693
function wrapRequest(state, request, options) {
1172411694
return state.retryLimiter.schedule(doRequest, state, request, options);
1172511695
}
11696+
// @ts-expect-error
1172611697
async function doRequest(state, request, options) {
1172711698
const isWrite = options.method !== "GET" && options.method !== "HEAD";
11728-
const { pathname } = new URL(options.url, "http://github.test");
11699+
const {
11700+
pathname
11701+
} = new URL(options.url, "http://github.test");
1172911702
const isSearch = options.method === "GET" && pathname.startsWith("/search/");
1173011703
const isGraphQL = pathname.startsWith("/graphql");
1173111704
const retryCount = ~~request.retryCount;
11732-
const jobOptions = retryCount > 0 ? { priority: 0, weight: 0 } : {};
11705+
const jobOptions = retryCount > 0 ? {
11706+
priority: 0,
11707+
weight: 0
11708+
} : {};
1173311709
if (state.clustering) {
11734-
jobOptions.expiration = 1e3 * 60;
11710+
// Remove a job from Redis if it has not completed or failed within 60s
11711+
// Examples: Node process terminated, client disconnected, etc.
11712+
// @ts-expect-error
11713+
jobOptions.expiration = 1000 * 60;
1173511714
}
11715+
// Guarantee at least 1000ms between writes
11716+
// GraphQL can also trigger writes
1173611717
if (isWrite || isGraphQL) {
1173711718
await state.write.key(state.id).schedule(jobOptions, noop);
1173811719
}
11720+
// Guarantee at least 3000ms between requests that trigger notifications
1173911721
if (isWrite && state.triggersNotification(pathname)) {
1174011722
await state.notifications.key(state.id).schedule(jobOptions, noop);
1174111723
}
11724+
// Guarantee at least 2000ms between search requests
1174211725
if (isSearch) {
1174311726
await state.search.key(state.id).schedule(jobOptions, noop);
1174411727
}
1174511728
const req = state.global.key(state.id).schedule(jobOptions, request, options);
1174611729
if (isGraphQL) {
1174711730
const res = await req;
11748-
if (res.data.errors != null && // @ts-expect-error
11749-
res.data.errors.some((error) => error.type === "RATE_LIMITED")) {
11731+
if (res.data.errors != null &&
11732+
// @ts-expect-error
11733+
res.data.errors.some(error => error.type === "RATE_LIMITED")) {
1175011734
const error = Object.assign(new Error("GraphQL Rate Limit Exceeded"), {
1175111735
response: res,
1175211736
data: res.data
@@ -11757,41 +11741,37 @@ async function doRequest(state, request, options) {
1175711741
return req;
1175811742
}
1175911743

11760-
// pkg/dist-src/generated/triggers-notification-paths.js
11761-
var triggers_notification_paths_default = [
11762-
"/orgs/{org}/invitations",
11763-
"/orgs/{org}/invitations/{invitation_id}",
11764-
"/orgs/{org}/teams/{team_slug}/discussions",
11765-
"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
11766-
"/repos/{owner}/{repo}/collaborators/{username}",
11767-
"/repos/{owner}/{repo}/commits/{commit_sha}/comments",
11768-
"/repos/{owner}/{repo}/issues",
11769-
"/repos/{owner}/{repo}/issues/{issue_number}/comments",
11770-
"/repos/{owner}/{repo}/pulls",
11771-
"/repos/{owner}/{repo}/pulls/{pull_number}/comments",
11772-
"/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies",
11773-
"/repos/{owner}/{repo}/pulls/{pull_number}/merge",
11774-
"/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers",
11775-
"/repos/{owner}/{repo}/pulls/{pull_number}/reviews",
11776-
"/repos/{owner}/{repo}/releases",
11777-
"/teams/{team_id}/discussions",
11778-
"/teams/{team_id}/discussions/{discussion_number}/comments"
11779-
];
11744+
var triggersNotificationPaths = ["/orgs/{org}/invitations", "/orgs/{org}/invitations/{invitation_id}", "/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"];
1178011745

11781-
// pkg/dist-src/route-matcher.js
1178211746
function routeMatcher(paths) {
11783-
const regexes = paths.map(
11784-
(path) => path.split("/").map((c) => c.startsWith("{") ? "(?:.+?)" : c).join("/")
11785-
);
11786-
const regex2 = `^(?:${regexes.map((r) => `(?:${r})`).join("|")})[^/]*$`;
11787-
return new RegExp(regex2, "i");
11747+
// EXAMPLE. For the following paths:
11748+
/* [
11749+
"/orgs/{org}/invitations",
11750+
"/repos/{owner}/{repo}/collaborators/{username}"
11751+
] */
11752+
const regexes = paths.map(path => path.split("/").map(c => c.startsWith("{") ? "(?:.+?)" : c).join("/"));
11753+
// 'regexes' would contain:
11754+
/* [
11755+
'/orgs/(?:.+?)/invitations',
11756+
'/repos/(?:.+?)/(?:.+?)/collaborators/(?:.+?)'
11757+
] */
11758+
const regex = `^(?:${regexes.map(r => `(?:${r})`).join("|")})[^/]*$`;
11759+
// 'regex' would contain:
11760+
/*
11761+
^(?:(?:\/orgs\/(?:.+?)\/invitations)|(?:\/repos\/(?:.+?)\/(?:.+?)\/collaborators\/(?:.+?)))[^\/]*$
11762+
It may look scary, but paste it into https://www.debuggex.com/
11763+
and it will make a lot more sense!
11764+
*/
11765+
return new RegExp(regex, "i");
1178811766
}
1178911767

11790-
// pkg/dist-src/index.js
11791-
var regex = routeMatcher(triggers_notification_paths_default);
11792-
var triggersNotification = regex.test.bind(regex);
11793-
var groups = {};
11794-
var createGroups = function(Bottleneck, common) {
11768+
// @ts-expect-error
11769+
// Workaround to allow tests to directly access the triggersNotification function.
11770+
const regex = routeMatcher(triggersNotificationPaths);
11771+
const triggersNotification = regex.test.bind(regex);
11772+
const groups = {};
11773+
// @ts-expect-error
11774+
const createGroups = function (Bottleneck, common) {
1179511775
groups.global = new Bottleneck.Group({
1179611776
id: "octokit-global",
1179711777
maxConcurrent: 10,
@@ -11800,50 +11780,62 @@ var createGroups = function(Bottleneck, common) {
1180011780
groups.search = new Bottleneck.Group({
1180111781
id: "octokit-search",
1180211782
maxConcurrent: 1,
11803-
minTime: 2e3,
11783+
minTime: 2000,
1180411784
...common
1180511785
});
1180611786
groups.write = new Bottleneck.Group({
1180711787
id: "octokit-write",
1180811788
maxConcurrent: 1,
11809-
minTime: 1e3,
11789+
minTime: 1000,
1181011790
...common
1181111791
});
1181211792
groups.notifications = new Bottleneck.Group({
1181311793
id: "octokit-notifications",
1181411794
maxConcurrent: 1,
11815-
minTime: 3e3,
11795+
minTime: 3000,
1181611796
...common
1181711797
});
1181811798
};
1181911799
function throttling(octokit, octokitOptions) {
1182011800
const {
1182111801
enabled = true,
11822-
Bottleneck = import_light.default,
11802+
Bottleneck = BottleneckLight,
1182311803
id = "no-id",
11824-
timeout = 1e3 * 60 * 2,
11804+
timeout = 1000 * 60 * 2,
1182511805
// Redis TTL: 2 minutes
1182611806
connection
1182711807
} = octokitOptions.throttle || {};
1182811808
if (!enabled) {
1182911809
return {};
1183011810
}
11831-
const common = { connection, timeout };
11811+
const common = {
11812+
connection,
11813+
timeout
11814+
};
1183211815
if (groups.global == null) {
1183311816
createGroups(Bottleneck, common);
1183411817
}
11835-
const state = Object.assign(
11836-
{
11837-
clustering: connection != null,
11838-
triggersNotification,
11839-
fallbackSecondaryRateRetryAfter: 60,
11840-
retryAfterBaseValue: 1e3,
11841-
retryLimiter: new Bottleneck(),
11842-
id,
11843-
...groups
11844-
},
11845-
octokitOptions.throttle
11846-
);
11818+
if (octokitOptions.throttle && octokitOptions.throttle.minimalSecondaryRateRetryAfter) {
11819+
octokit.log.warn("[@octokit/plugin-throttling] `options.throttle.minimalSecondaryRateRetryAfter` is deprecated, please use `options.throttle.fallbackSecondaryRateRetryAfter` instead");
11820+
octokitOptions.throttle.fallbackSecondaryRateRetryAfter = octokitOptions.throttle.minimalSecondaryRateRetryAfter;
11821+
delete octokitOptions.throttle.minimalSecondaryRateRetryAfter;
11822+
}
11823+
if (octokitOptions.throttle && octokitOptions.throttle.onAbuseLimit) {
11824+
octokit.log.warn("[@octokit/plugin-throttling] `onAbuseLimit()` is deprecated and will be removed in a future release of `@octokit/plugin-throttling`, please use the `onSecondaryRateLimit` handler instead");
11825+
// @ts-ignore types don't allow for both properties to be set
11826+
octokitOptions.throttle.onSecondaryRateLimit = octokitOptions.throttle.onAbuseLimit;
11827+
// @ts-ignore
11828+
delete octokitOptions.throttle.onAbuseLimit;
11829+
}
11830+
const state = Object.assign({
11831+
clustering: connection != null,
11832+
triggersNotification,
11833+
fallbackSecondaryRateRetryAfter: 60,
11834+
retryAfterBaseValue: 1000,
11835+
retryLimiter: new Bottleneck(),
11836+
id,
11837+
...groups
11838+
}, octokitOptions.throttle);
1184711839
if (typeof state.onSecondaryRateLimit !== "function" || typeof state.onRateLimit !== "function") {
1184811840
throw new Error(`octokit/plugin-throttling error:
1184911841
You must pass the onSecondaryRateLimit and onRateLimit error handlers.
@@ -11859,65 +11851,69 @@ function throttling(octokit, octokitOptions) {
1185911851
}
1186011852
const events = {};
1186111853
const emitter = new Bottleneck.Events(events);
11854+
// @ts-expect-error
1186211855
events.on("secondary-limit", state.onSecondaryRateLimit);
11856+
// @ts-expect-error
1186311857
events.on("rate-limit", state.onRateLimit);
11864-
events.on(
11865-
"error",
11866-
(e) => octokit.log.warn("Error in throttling-plugin limit handler", e)
11867-
);
11868-
state.retryLimiter.on("failed", async function(error, info) {
11869-
const [state2, request, options] = info.args;
11870-
const { pathname } = new URL(options.url, "http://github.test");
11858+
// @ts-expect-error
11859+
events.on("error", e => octokit.log.warn("Error in throttling-plugin limit handler", e));
11860+
// @ts-expect-error
11861+
state.retryLimiter.on("failed", async function (error, info) {
11862+
const [state, request, options] = info.args;
11863+
const {
11864+
pathname
11865+
} = new URL(options.url, "http://github.test");
1187111866
const shouldRetryGraphQL = pathname.startsWith("/graphql") && error.status !== 401;
1187211867
if (!(shouldRetryGraphQL || error.status === 403)) {
1187311868
return;
1187411869
}
1187511870
const retryCount = ~~request.retryCount;
1187611871
request.retryCount = retryCount;
11872+
// backward compatibility
1187711873
options.request.retryCount = retryCount;
11878-
const { wantRetry, retryAfter = 0 } = await async function() {
11874+
const {
11875+
wantRetry,
11876+
retryAfter = 0
11877+
} = await async function () {
1187911878
if (/\bsecondary rate\b/i.test(error.message)) {
11880-
const retryAfter2 = Number(error.response.headers["retry-after"]) || state2.fallbackSecondaryRateRetryAfter;
11881-
const wantRetry2 = await emitter.trigger(
11882-
"secondary-limit",
11883-
retryAfter2,
11884-
options,
11885-
octokit,
11886-
retryCount
11887-
);
11888-
return { wantRetry: wantRetry2, retryAfter: retryAfter2 };
11879+
// The user has hit the secondary rate limit. (REST and GraphQL)
11880+
// https://docs.github.com/en/rest/overview/resources-in-the-rest-api#secondary-rate-limits
11881+
// The Retry-After header can sometimes be blank when hitting a secondary rate limit,
11882+
// but is always present after 2-3s, so make sure to set `retryAfter` to at least 5s by default.
11883+
const retryAfter = Number(error.response.headers["retry-after"]) || state.fallbackSecondaryRateRetryAfter;
11884+
const wantRetry = await emitter.trigger("secondary-limit", retryAfter, options, octokit, retryCount);
11885+
return {
11886+
wantRetry,
11887+
retryAfter
11888+
};
1188911889
}
1189011890
if (error.response.headers != null && error.response.headers["x-ratelimit-remaining"] === "0") {
11891-
const rateLimitReset = new Date(
11892-
~~error.response.headers["x-ratelimit-reset"] * 1e3
11893-
).getTime();
11894-
const retryAfter2 = Math.max(
11895-
Math.ceil((rateLimitReset - Date.now()) / 1e3),
11896-
0
11897-
);
11898-
const wantRetry2 = await emitter.trigger(
11899-
"rate-limit",
11900-
retryAfter2,
11901-
options,
11902-
octokit,
11903-
retryCount
11904-
);
11905-
return { wantRetry: wantRetry2, retryAfter: retryAfter2 };
11891+
// The user has used all their allowed calls for the current time period (REST and GraphQL)
11892+
// https://docs.github.com/en/rest/reference/rate-limit (REST)
11893+
// https://docs.github.com/en/graphql/overview/resource-limitations#rate-limit (GraphQL)
11894+
const rateLimitReset = new Date(~~error.response.headers["x-ratelimit-reset"] * 1000).getTime();
11895+
const retryAfter = Math.max(Math.ceil((rateLimitReset - Date.now()) / 1000), 0);
11896+
const wantRetry = await emitter.trigger("rate-limit", retryAfter, options, octokit, retryCount);
11897+
return {
11898+
wantRetry,
11899+
retryAfter
11900+
};
1190611901
}
1190711902
return {};
1190811903
}();
1190911904
if (wantRetry) {
1191011905
request.retryCount++;
11911-
return retryAfter * state2.retryAfterBaseValue;
11906+
return retryAfter * state.retryAfterBaseValue;
1191211907
}
1191311908
});
1191411909
octokit.hook.wrap("request", wrapRequest.bind(null, state));
1191511910
return {};
1191611911
}
1191711912
throttling.VERSION = VERSION;
1191811913
throttling.triggersNotification = triggersNotification;
11919-
// Annotate the CommonJS export names for ESM import in node:
11920-
0 && (0);
11914+
11915+
exports.throttling = throttling;
11916+
//# sourceMappingURL=index.js.map
1192111917

1192211918

1192311919
/***/ }),
@@ -44082,7 +44078,7 @@ var import_plugin_retry = __nccwpck_require__(6298);
4408244078
var import_plugin_throttling = __nccwpck_require__(9968);
4408344079

4408444080
// pkg/dist-src/version.js
44085-
var VERSION = "2.0.21";
44081+
var VERSION = "2.0.22";
4408644082

4408744083
// pkg/dist-src/octokit.js
4408844084
var Octokit = import_core.Octokit.plugin(

0 commit comments

Comments
 (0)