build: update distribution (#3898)
This commit is contained in:
parent
e89bd69e40
commit
a7b20e1da2
17
dist/index.js
vendored
17
dist/index.js
vendored
@ -36090,8 +36090,9 @@ function wrapRequest(state, request, options) {
|
|||||||
return state.retryLimiter.schedule(doRequest, state, request, options);
|
return state.retryLimiter.schedule(doRequest, state, request, options);
|
||||||
}
|
}
|
||||||
async function doRequest(state, request, options) {
|
async function doRequest(state, request, options) {
|
||||||
const isWrite = options.method !== "GET" && options.method !== "HEAD";
|
|
||||||
const { pathname } = new URL(options.url, "http://github.test");
|
const { pathname } = new URL(options.url, "http://github.test");
|
||||||
|
const isAuth = isAuthRequest(options.method, pathname);
|
||||||
|
const isWrite = !isAuth && options.method !== "GET" && options.method !== "HEAD";
|
||||||
const isSearch = options.method === "GET" && pathname.startsWith("/search/");
|
const isSearch = options.method === "GET" && pathname.startsWith("/search/");
|
||||||
const isGraphQL = pathname.startsWith("/graphql");
|
const isGraphQL = pathname.startsWith("/graphql");
|
||||||
const retryCount = ~~request.retryCount;
|
const retryCount = ~~request.retryCount;
|
||||||
@ -36108,7 +36109,7 @@ async function doRequest(state, request, options) {
|
|||||||
if (isSearch) {
|
if (isSearch) {
|
||||||
await state.search.key(state.id).schedule(jobOptions, noop);
|
await state.search.key(state.id).schedule(jobOptions, noop);
|
||||||
}
|
}
|
||||||
const req = state.global.key(state.id).schedule(jobOptions, request, options);
|
const req = (isAuth ? state.auth : state.global).key(state.id).schedule(jobOptions, request, options);
|
||||||
if (isGraphQL) {
|
if (isGraphQL) {
|
||||||
const res = await req;
|
const res = await req;
|
||||||
if (res.data.errors != null && res.data.errors.some((error) => error.type === "RATE_LIMITED")) {
|
if (res.data.errors != null && res.data.errors.some((error) => error.type === "RATE_LIMITED")) {
|
||||||
@ -36121,6 +36122,13 @@ async function doRequest(state, request, options) {
|
|||||||
}
|
}
|
||||||
return req;
|
return req;
|
||||||
}
|
}
|
||||||
|
function isAuthRequest(method, pathname) {
|
||||||
|
return method === "PATCH" && // https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#create-a-scoped-access-token
|
||||||
|
/^\/applications\/[^/]+\/token\/scoped$/.test(pathname) || method === "POST" && // https://docs.github.com/en/rest/apps/oauth-applications?apiVersion=2022-11-28#reset-a-token
|
||||||
|
(/^\/applications\/[^/]+\/token$/.test(pathname) || // https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app
|
||||||
|
/^\/app\/installations\/[^/]+\/access_tokens$/.test(pathname) || // https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps
|
||||||
|
pathname === "/login/oauth/access_token");
|
||||||
|
}
|
||||||
|
|
||||||
// pkg/dist-src/generated/triggers-notification-paths.js
|
// pkg/dist-src/generated/triggers-notification-paths.js
|
||||||
var triggers_notification_paths_default = [
|
var triggers_notification_paths_default = [
|
||||||
@ -36164,6 +36172,11 @@ var createGroups = function(Bottleneck, common) {
|
|||||||
maxConcurrent: 10,
|
maxConcurrent: 10,
|
||||||
...common
|
...common
|
||||||
});
|
});
|
||||||
|
groups.auth = new Bottleneck.Group({
|
||||||
|
id: "octokit-auth",
|
||||||
|
maxConcurrent: 1,
|
||||||
|
...common
|
||||||
|
});
|
||||||
groups.search = new Bottleneck.Group({
|
groups.search = new Bottleneck.Group({
|
||||||
id: "octokit-search",
|
id: "octokit-search",
|
||||||
maxConcurrent: 1,
|
maxConcurrent: 1,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user