Files
Snigdha-OS.github.io/node_modules/.vite/deps/octokit.js
2024-12-23 02:19:28 +05:30

10028 lines
360 KiB
JavaScript

import {
__commonJS,
__esm,
__export,
__privateAdd,
__privateGet,
__privateMethod,
__privateSet,
__privateWrapper,
__publicField,
__toCommonJS,
__toESM
} from "./chunk-4B2QHNJT.js";
// node_modules/.pnpm/universal-user-agent@6.0.1/node_modules/universal-user-agent/dist-web/index.js
var dist_web_exports = {};
__export(dist_web_exports, {
getUserAgent: () => getUserAgent
});
function getUserAgent() {
if (typeof navigator === "object" && "userAgent" in navigator) {
return navigator.userAgent;
}
if (typeof process === "object" && process.version !== void 0) {
return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
}
return "<environment undetectable>";
}
var init_dist_web = __esm({
"node_modules/.pnpm/universal-user-agent@6.0.1/node_modules/universal-user-agent/dist-web/index.js"() {
}
});
// node_modules/.pnpm/before-after-hook@2.2.3/node_modules/before-after-hook/lib/register.js
var require_register = __commonJS({
"node_modules/.pnpm/before-after-hook@2.2.3/node_modules/before-after-hook/lib/register.js"(exports, module) {
module.exports = register;
function register(state, name, method, options) {
if (typeof method !== "function") {
throw new Error("method for before hook must be a function");
}
if (!options) {
options = {};
}
if (Array.isArray(name)) {
return name.reverse().reduce(function(callback, name2) {
return register.bind(null, state, name2, callback, options);
}, method)();
}
return Promise.resolve().then(function() {
if (!state.registry[name]) {
return method(options);
}
return state.registry[name].reduce(function(method2, registered) {
return registered.hook.bind(null, method2, options);
}, method)();
});
}
}
});
// node_modules/.pnpm/before-after-hook@2.2.3/node_modules/before-after-hook/lib/add.js
var require_add = __commonJS({
"node_modules/.pnpm/before-after-hook@2.2.3/node_modules/before-after-hook/lib/add.js"(exports, module) {
module.exports = addHook;
function addHook(state, kind, name, hook6) {
var orig = hook6;
if (!state.registry[name]) {
state.registry[name] = [];
}
if (kind === "before") {
hook6 = function(method, options) {
return Promise.resolve().then(orig.bind(null, options)).then(method.bind(null, options));
};
}
if (kind === "after") {
hook6 = function(method, options) {
var result;
return Promise.resolve().then(method.bind(null, options)).then(function(result_) {
result = result_;
return orig(result, options);
}).then(function() {
return result;
});
};
}
if (kind === "error") {
hook6 = function(method, options) {
return Promise.resolve().then(method.bind(null, options)).catch(function(error) {
return orig(error, options);
});
};
}
state.registry[name].push({
hook: hook6,
orig
});
}
}
});
// node_modules/.pnpm/before-after-hook@2.2.3/node_modules/before-after-hook/lib/remove.js
var require_remove = __commonJS({
"node_modules/.pnpm/before-after-hook@2.2.3/node_modules/before-after-hook/lib/remove.js"(exports, module) {
module.exports = removeHook;
function removeHook(state, name, method) {
if (!state.registry[name]) {
return;
}
var index = state.registry[name].map(function(registered) {
return registered.orig;
}).indexOf(method);
if (index === -1) {
return;
}
state.registry[name].splice(index, 1);
}
}
});
// node_modules/.pnpm/before-after-hook@2.2.3/node_modules/before-after-hook/index.js
var require_before_after_hook = __commonJS({
"node_modules/.pnpm/before-after-hook@2.2.3/node_modules/before-after-hook/index.js"(exports, module) {
var register = require_register();
var addHook = require_add();
var removeHook = require_remove();
var bind = Function.bind;
var bindable = bind.bind(bind);
function bindApi(hook6, state, name) {
var removeHookRef = bindable(removeHook, null).apply(
null,
name ? [state, name] : [state]
);
hook6.api = { remove: removeHookRef };
hook6.remove = removeHookRef;
["before", "error", "after", "wrap"].forEach(function(kind) {
var args = name ? [state, kind, name] : [state, kind];
hook6[kind] = hook6.api[kind] = bindable(addHook, null).apply(null, args);
});
}
function HookSingular() {
var singularHookName = "h";
var singularHookState = {
registry: {}
};
var singularHook = register.bind(null, singularHookState, singularHookName);
bindApi(singularHook, singularHookState, singularHookName);
return singularHook;
}
function HookCollection() {
var state = {
registry: {}
};
var hook6 = register.bind(null, state);
bindApi(hook6, state);
return hook6;
}
var collectionHookDeprecationMessageDisplayed = false;
function Hook() {
if (!collectionHookDeprecationMessageDisplayed) {
console.warn(
'[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
);
collectionHookDeprecationMessageDisplayed = true;
}
return HookCollection();
}
Hook.Singular = HookSingular.bind();
Hook.Collection = HookCollection.bind();
module.exports = Hook;
module.exports.Hook = Hook;
module.exports.Singular = Hook.Singular;
module.exports.Collection = Hook.Collection;
}
});
// node_modules/.pnpm/@octokit+endpoint@9.0.5/node_modules/@octokit/endpoint/dist-web/index.js
function lowercaseKeys(object) {
if (!object) {
return {};
}
return Object.keys(object).reduce((newObj, key) => {
newObj[key.toLowerCase()] = object[key];
return newObj;
}, {});
}
function isPlainObject(value) {
if (typeof value !== "object" || value === null)
return false;
if (Object.prototype.toString.call(value) !== "[object Object]")
return false;
const proto = Object.getPrototypeOf(value);
if (proto === null)
return true;
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
}
function mergeDeep(defaults, options) {
const result = Object.assign({}, defaults);
Object.keys(options).forEach((key) => {
if (isPlainObject(options[key])) {
if (!(key in defaults))
Object.assign(result, { [key]: options[key] });
else
result[key] = mergeDeep(defaults[key], options[key]);
} else {
Object.assign(result, { [key]: options[key] });
}
});
return result;
}
function removeUndefinedProperties(obj) {
for (const key in obj) {
if (obj[key] === void 0) {
delete obj[key];
}
}
return obj;
}
function merge(defaults, route, options) {
var _a3;
if (typeof route === "string") {
let [method, url] = route.split(" ");
options = Object.assign(url ? { method, url } : { url: method }, options);
} else {
options = Object.assign({}, route);
}
options.headers = lowercaseKeys(options.headers);
removeUndefinedProperties(options);
removeUndefinedProperties(options.headers);
const mergedOptions = mergeDeep(defaults || {}, options);
if (options.url === "/graphql") {
if (defaults && ((_a3 = defaults.mediaType.previews) == null ? void 0 : _a3.length)) {
mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
(preview) => !mergedOptions.mediaType.previews.includes(preview)
).concat(mergedOptions.mediaType.previews);
}
mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
}
return mergedOptions;
}
function addQueryParameters(url, parameters) {
const separator = /\?/.test(url) ? "&" : "?";
const names = Object.keys(parameters);
if (names.length === 0) {
return url;
}
return url + separator + names.map((name) => {
if (name === "q") {
return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
}
return `${name}=${encodeURIComponent(parameters[name])}`;
}).join("&");
}
function removeNonChars(variableName) {
return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
}
function extractUrlVariableNames(url) {
const matches = url.match(urlVariableRegex);
if (!matches) {
return [];
}
return matches.map(removeNonChars).reduce((a2, b) => a2.concat(b), []);
}
function omit(object, keysToOmit) {
const result = { __proto__: null };
for (const key of Object.keys(object)) {
if (keysToOmit.indexOf(key) === -1) {
result[key] = object[key];
}
}
return result;
}
function encodeReserved(str) {
return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
if (!/%[0-9A-Fa-f]/.test(part)) {
part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
}
return part;
}).join("");
}
function encodeUnreserved(str) {
return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
});
}
function encodeValue(operator, value, key) {
value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
if (key) {
return encodeUnreserved(key) + "=" + value;
} else {
return value;
}
}
function isDefined(value) {
return value !== void 0 && value !== null;
}
function isKeyOperator(operator) {
return operator === ";" || operator === "&" || operator === "?";
}
function getValues(context, operator, key, modifier) {
var value = context[key], result = [];
if (isDefined(value) && value !== "") {
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
value = value.toString();
if (modifier && modifier !== "*") {
value = value.substring(0, parseInt(modifier, 10));
}
result.push(
encodeValue(operator, value, isKeyOperator(operator) ? key : "")
);
} else {
if (modifier === "*") {
if (Array.isArray(value)) {
value.filter(isDefined).forEach(function(value2) {
result.push(
encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
);
});
} else {
Object.keys(value).forEach(function(k) {
if (isDefined(value[k])) {
result.push(encodeValue(operator, value[k], k));
}
});
}
} else {
const tmp = [];
if (Array.isArray(value)) {
value.filter(isDefined).forEach(function(value2) {
tmp.push(encodeValue(operator, value2));
});
} else {
Object.keys(value).forEach(function(k) {
if (isDefined(value[k])) {
tmp.push(encodeUnreserved(k));
tmp.push(encodeValue(operator, value[k].toString()));
}
});
}
if (isKeyOperator(operator)) {
result.push(encodeUnreserved(key) + "=" + tmp.join(","));
} else if (tmp.length !== 0) {
result.push(tmp.join(","));
}
}
}
} else {
if (operator === ";") {
if (isDefined(value)) {
result.push(encodeUnreserved(key));
}
} else if (value === "" && (operator === "&" || operator === "?")) {
result.push(encodeUnreserved(key) + "=");
} else if (value === "") {
result.push("");
}
}
return result;
}
function parseUrl(template) {
return {
expand: expand.bind(null, template)
};
}
function expand(template, context) {
var operators = ["+", "#", ".", "/", ";", "?", "&"];
template = template.replace(
/\{([^\{\}]+)\}|([^\{\}]+)/g,
function(_, expression, literal) {
if (expression) {
let operator = "";
const values = [];
if (operators.indexOf(expression.charAt(0)) !== -1) {
operator = expression.charAt(0);
expression = expression.substr(1);
}
expression.split(/,/g).forEach(function(variable) {
var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
});
if (operator && operator !== "+") {
var separator = ",";
if (operator === "?") {
separator = "&";
} else if (operator !== "#") {
separator = operator;
}
return (values.length !== 0 ? operator : "") + values.join(separator);
} else {
return values.join(",");
}
} else {
return encodeReserved(literal);
}
}
);
if (template === "/") {
return template;
} else {
return template.replace(/\/$/, "");
}
}
function parse(options) {
var _a3;
let method = options.method.toUpperCase();
let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
let headers = Object.assign({}, options.headers);
let body;
let parameters = omit(options, [
"method",
"baseUrl",
"url",
"headers",
"request",
"mediaType"
]);
const urlVariableNames = extractUrlVariableNames(url);
url = parseUrl(url).expand(parameters);
if (!/^http/.test(url)) {
url = options.baseUrl + url;
}
const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
const remainingParameters = omit(parameters, omittedParameters);
const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
if (!isBinaryRequest) {
if (options.mediaType.format) {
headers.accept = headers.accept.split(/,/).map(
(format) => format.replace(
/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
`application/vnd$1$2.${options.mediaType.format}`
)
).join(",");
}
if (url.endsWith("/graphql")) {
if ((_a3 = options.mediaType.previews) == null ? void 0 : _a3.length) {
const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
return `application/vnd.github.${preview}-preview${format}`;
}).join(",");
}
}
}
if (["GET", "HEAD"].includes(method)) {
url = addQueryParameters(url, remainingParameters);
} else {
if ("data" in remainingParameters) {
body = remainingParameters.data;
} else {
if (Object.keys(remainingParameters).length) {
body = remainingParameters;
}
}
}
if (!headers["content-type"] && typeof body !== "undefined") {
headers["content-type"] = "application/json; charset=utf-8";
}
if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
body = "";
}
return Object.assign(
{ method, url, headers },
typeof body !== "undefined" ? { body } : null,
options.request ? { request: options.request } : null
);
}
function endpointWithDefaults(defaults, route, options) {
return parse(merge(defaults, route, options));
}
function withDefaults(oldDefaults, newDefaults) {
const DEFAULTS2 = merge(oldDefaults, newDefaults);
const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
return Object.assign(endpoint2, {
DEFAULTS: DEFAULTS2,
defaults: withDefaults.bind(null, DEFAULTS2),
merge: merge.bind(null, DEFAULTS2),
parse
});
}
var VERSION, userAgent, DEFAULTS, urlVariableRegex, endpoint;
var init_dist_web2 = __esm({
"node_modules/.pnpm/@octokit+endpoint@9.0.5/node_modules/@octokit/endpoint/dist-web/index.js"() {
init_dist_web();
VERSION = "9.0.5";
userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`;
DEFAULTS = {
method: "GET",
baseUrl: "https://api.github.com",
headers: {
accept: "application/vnd.github.v3+json",
"user-agent": userAgent
},
mediaType: {
format: ""
}
};
urlVariableRegex = /\{[^}]+\}/g;
endpoint = withDefaults(null, DEFAULTS);
}
});
// node_modules/.pnpm/deprecation@2.3.1/node_modules/deprecation/dist-web/index.js
var dist_web_exports2 = {};
__export(dist_web_exports2, {
Deprecation: () => Deprecation
});
var Deprecation;
var init_dist_web3 = __esm({
"node_modules/.pnpm/deprecation@2.3.1/node_modules/deprecation/dist-web/index.js"() {
Deprecation = class extends Error {
constructor(message) {
super(message);
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
this.name = "Deprecation";
}
};
}
});
// node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js
var require_wrappy = __commonJS({
"node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js"(exports, module) {
module.exports = wrappy;
function wrappy(fn, cb) {
if (fn && cb) return wrappy(fn)(cb);
if (typeof fn !== "function")
throw new TypeError("need wrapper function");
Object.keys(fn).forEach(function(k) {
wrapper[k] = fn[k];
});
return wrapper;
function wrapper() {
var args = new Array(arguments.length);
for (var i2 = 0; i2 < args.length; i2++) {
args[i2] = arguments[i2];
}
var ret = fn.apply(this, args);
var cb2 = args[args.length - 1];
if (typeof ret === "function" && ret !== cb2) {
Object.keys(cb2).forEach(function(k) {
ret[k] = cb2[k];
});
}
return ret;
}
}
}
});
// node_modules/.pnpm/once@1.4.0/node_modules/once/once.js
var require_once = __commonJS({
"node_modules/.pnpm/once@1.4.0/node_modules/once/once.js"(exports, module) {
var wrappy = require_wrappy();
module.exports = wrappy(once2);
module.exports.strict = wrappy(onceStrict);
once2.proto = once2(function() {
Object.defineProperty(Function.prototype, "once", {
value: function() {
return once2(this);
},
configurable: true
});
Object.defineProperty(Function.prototype, "onceStrict", {
value: function() {
return onceStrict(this);
},
configurable: true
});
});
function once2(fn) {
var f = function() {
if (f.called) return f.value;
f.called = true;
return f.value = fn.apply(this, arguments);
};
f.called = false;
return f;
}
function onceStrict(fn) {
var f = function() {
if (f.called)
throw new Error(f.onceError);
f.called = true;
return f.value = fn.apply(this, arguments);
};
var name = fn.name || "Function wrapped with `once`";
f.onceError = name + " shouldn't be called more than once";
f.called = false;
return f;
}
}
});
// node_modules/.pnpm/@octokit+request-error@5.1.0/node_modules/@octokit/request-error/dist-web/index.js
var dist_web_exports3 = {};
__export(dist_web_exports3, {
RequestError: () => RequestError
});
var import_once, logOnceCode, logOnceHeaders, RequestError;
var init_dist_web4 = __esm({
"node_modules/.pnpm/@octokit+request-error@5.1.0/node_modules/@octokit/request-error/dist-web/index.js"() {
init_dist_web3();
import_once = __toESM(require_once());
logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
RequestError = class extends Error {
constructor(message, statusCode, options) {
super(message);
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
this.name = "HttpError";
this.status = statusCode;
let headers;
if ("headers" in options && typeof options.headers !== "undefined") {
headers = options.headers;
}
if ("response" in options) {
this.response = options.response;
headers = options.response.headers;
}
const requestCopy = Object.assign({}, options.request);
if (options.request.headers.authorization) {
requestCopy.headers = Object.assign({}, options.request.headers, {
authorization: options.request.headers.authorization.replace(
/ .*$/,
" [REDACTED]"
)
});
}
requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
this.request = requestCopy;
Object.defineProperty(this, "code", {
get() {
logOnceCode(
new Deprecation(
"[@octokit/request-error] `error.code` is deprecated, use `error.status`."
)
);
return statusCode;
}
});
Object.defineProperty(this, "headers", {
get() {
logOnceHeaders(
new Deprecation(
"[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
)
);
return headers || {};
}
});
}
};
}
});
// node_modules/.pnpm/@octokit+request@8.4.0/node_modules/@octokit/request/dist-web/index.js
var dist_web_exports4 = {};
__export(dist_web_exports4, {
request: () => request
});
function isPlainObject2(value) {
if (typeof value !== "object" || value === null)
return false;
if (Object.prototype.toString.call(value) !== "[object Object]")
return false;
const proto = Object.getPrototypeOf(value);
if (proto === null)
return true;
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
}
function getBufferResponse(response) {
return response.arrayBuffer();
}
function fetchWrapper(requestOptions) {
var _a3, _b, _c, _d;
const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
const parseSuccessResponseBody = ((_a3 = requestOptions.request) == null ? void 0 : _a3.parseSuccessResponseBody) !== false;
if (isPlainObject2(requestOptions.body) || Array.isArray(requestOptions.body)) {
requestOptions.body = JSON.stringify(requestOptions.body);
}
let headers = {};
let status;
let url;
let { fetch } = globalThis;
if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) {
fetch = requestOptions.request.fetch;
}
if (!fetch) {
throw new Error(
"fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing"
);
}
return fetch(requestOptions.url, {
method: requestOptions.method,
body: requestOptions.body,
redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
headers: requestOptions.headers,
signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
// duplex must be set if request.body is ReadableStream or Async Iterables.
// See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
...requestOptions.body && { duplex: "half" }
}).then(async (response) => {
url = response.url;
status = response.status;
for (const keyAndValue of response.headers) {
headers[keyAndValue[0]] = keyAndValue[1];
}
if ("deprecation" in headers) {
const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/);
const deprecationLink = matches && matches.pop();
log.warn(
`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
);
}
if (status === 204 || status === 205) {
return;
}
if (requestOptions.method === "HEAD") {
if (status < 400) {
return;
}
throw new RequestError(response.statusText, status, {
response: {
url,
status,
headers,
data: void 0
},
request: requestOptions
});
}
if (status === 304) {
throw new RequestError("Not modified", status, {
response: {
url,
status,
headers,
data: await getResponseData(response)
},
request: requestOptions
});
}
if (status >= 400) {
const data = await getResponseData(response);
const error = new RequestError(toErrorMessage(data), status, {
response: {
url,
status,
headers,
data
},
request: requestOptions
});
throw error;
}
return parseSuccessResponseBody ? await getResponseData(response) : response.body;
}).then((data) => {
return {
status,
url,
headers,
data
};
}).catch((error) => {
if (error instanceof RequestError)
throw error;
else if (error.name === "AbortError")
throw error;
let message = error.message;
if (error.name === "TypeError" && "cause" in error) {
if (error.cause instanceof Error) {
message = error.cause.message;
} else if (typeof error.cause === "string") {
message = error.cause;
}
}
throw new RequestError(message, 500, {
request: requestOptions
});
});
}
async function getResponseData(response) {
const contentType = response.headers.get("content-type");
if (/application\/json/.test(contentType)) {
return response.json().catch(() => response.text()).catch(() => "");
}
if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
return response.text();
}
return getBufferResponse(response);
}
function toErrorMessage(data) {
if (typeof data === "string")
return data;
let suffix;
if ("documentation_url" in data) {
suffix = ` - ${data.documentation_url}`;
} else {
suffix = "";
}
if ("message" in data) {
if (Array.isArray(data.errors)) {
return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
}
return `${data.message}${suffix}`;
}
return `Unknown error: ${JSON.stringify(data)}`;
}
function withDefaults2(oldEndpoint, newDefaults) {
const endpoint2 = oldEndpoint.defaults(newDefaults);
const newApi = function(route, parameters) {
const endpointOptions = endpoint2.merge(route, parameters);
if (!endpointOptions.request || !endpointOptions.request.hook) {
return fetchWrapper(endpoint2.parse(endpointOptions));
}
const request2 = (route2, parameters2) => {
return fetchWrapper(
endpoint2.parse(endpoint2.merge(route2, parameters2))
);
};
Object.assign(request2, {
endpoint: endpoint2,
defaults: withDefaults2.bind(null, endpoint2)
});
return endpointOptions.request.hook(request2, endpointOptions);
};
return Object.assign(newApi, {
endpoint: endpoint2,
defaults: withDefaults2.bind(null, endpoint2)
});
}
var VERSION2, request;
var init_dist_web5 = __esm({
"node_modules/.pnpm/@octokit+request@8.4.0/node_modules/@octokit/request/dist-web/index.js"() {
init_dist_web2();
init_dist_web();
init_dist_web4();
VERSION2 = "8.4.0";
request = withDefaults2(endpoint, {
headers: {
"user-agent": `octokit-request.js/${VERSION2} ${getUserAgent()}`
}
});
}
});
// node_modules/.pnpm/@octokit+graphql@7.1.0/node_modules/@octokit/graphql/dist-web/index.js
function _buildMessageForResponseErrors(data) {
return `Request failed due to following response errors:
` + data.errors.map((e2) => ` - ${e2.message}`).join("\n");
}
function graphql(request2, query, options) {
if (options) {
if (typeof query === "string" && "query" in options) {
return Promise.reject(
new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
);
}
for (const key in options) {
if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
continue;
return Promise.reject(
new Error(
`[@octokit/graphql] "${key}" cannot be used as variable name`
)
);
}
}
const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
const requestOptions = Object.keys(
parsedOptions
).reduce((result, key) => {
if (NON_VARIABLE_OPTIONS.includes(key)) {
result[key] = parsedOptions[key];
return result;
}
if (!result.variables) {
result.variables = {};
}
result.variables[key] = parsedOptions[key];
return result;
}, {});
const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
}
return request2(requestOptions).then((response) => {
if (response.data.errors) {
const headers = {};
for (const key of Object.keys(response.headers)) {
headers[key] = response.headers[key];
}
throw new GraphqlResponseError(
requestOptions,
headers,
response.data
);
}
return response.data.data;
});
}
function withDefaults3(request2, newDefaults) {
const newRequest = request2.defaults(newDefaults);
const newApi = (query, options) => {
return graphql(newRequest, query, options);
};
return Object.assign(newApi, {
defaults: withDefaults3.bind(null, newRequest),
endpoint: newRequest.endpoint
});
}
function withCustomRequest(customRequest) {
return withDefaults3(customRequest, {
method: "POST",
url: "/graphql"
});
}
var VERSION3, GraphqlResponseError, NON_VARIABLE_OPTIONS, FORBIDDEN_VARIABLE_OPTIONS, GHES_V3_SUFFIX_REGEX, graphql2;
var init_dist_web6 = __esm({
"node_modules/.pnpm/@octokit+graphql@7.1.0/node_modules/@octokit/graphql/dist-web/index.js"() {
init_dist_web5();
init_dist_web();
init_dist_web5();
init_dist_web5();
VERSION3 = "7.1.0";
GraphqlResponseError = class extends Error {
constructor(request2, headers, response) {
super(_buildMessageForResponseErrors(response));
this.request = request2;
this.headers = headers;
this.response = response;
this.name = "GraphqlResponseError";
this.errors = response.errors;
this.data = response.data;
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
}
};
NON_VARIABLE_OPTIONS = [
"method",
"baseUrl",
"url",
"headers",
"request",
"query",
"mediaType"
];
FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
graphql2 = withDefaults3(request, {
headers: {
"user-agent": `octokit-graphql.js/${VERSION3} ${getUserAgent()}`
},
method: "POST",
url: "/graphql"
});
}
});
// node_modules/.pnpm/@octokit+auth-token@4.0.0/node_modules/@octokit/auth-token/dist-web/index.js
async function auth(token) {
const isApp = token.split(/\./).length === 3;
const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
return {
type: "token",
token,
tokenType
};
}
function withAuthorizationPrefix(token) {
if (token.split(/\./).length === 3) {
return `bearer ${token}`;
}
return `token ${token}`;
}
async function hook(token, request2, route, parameters) {
const endpoint2 = request2.endpoint.merge(
route,
parameters
);
endpoint2.headers.authorization = withAuthorizationPrefix(token);
return request2(endpoint2);
}
var REGEX_IS_INSTALLATION_LEGACY, REGEX_IS_INSTALLATION, REGEX_IS_USER_TO_SERVER, createTokenAuth;
var init_dist_web7 = __esm({
"node_modules/.pnpm/@octokit+auth-token@4.0.0/node_modules/@octokit/auth-token/dist-web/index.js"() {
REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
REGEX_IS_INSTALLATION = /^ghs_/;
REGEX_IS_USER_TO_SERVER = /^ghu_/;
createTokenAuth = function createTokenAuth2(token) {
if (!token) {
throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
}
if (typeof token !== "string") {
throw new Error(
"[@octokit/auth-token] Token passed to createTokenAuth is not a string"
);
}
token = token.replace(/^(token|bearer) +/i, "");
return Object.assign(auth.bind(null, token), {
hook: hook.bind(null, token)
});
};
}
});
// node_modules/.pnpm/@octokit+core@5.2.0/node_modules/@octokit/core/dist-web/index.js
var dist_web_exports5 = {};
__export(dist_web_exports5, {
Octokit: () => Octokit
});
var import_before_after_hook, VERSION4, noop, consoleWarn, consoleError, userAgentTrail, _a, Octokit;
var init_dist_web8 = __esm({
"node_modules/.pnpm/@octokit+core@5.2.0/node_modules/@octokit/core/dist-web/index.js"() {
init_dist_web();
import_before_after_hook = __toESM(require_before_after_hook());
init_dist_web5();
init_dist_web6();
init_dist_web7();
VERSION4 = "5.2.0";
noop = () => {
};
consoleWarn = console.warn.bind(console);
consoleError = console.error.bind(console);
userAgentTrail = `octokit-core.js/${VERSION4} ${getUserAgent()}`;
Octokit = (_a = class {
static defaults(defaults) {
const OctokitWithDefaults = class extends this {
constructor(...args) {
const options = args[0] || {};
if (typeof defaults === "function") {
super(defaults(options));
return;
}
super(
Object.assign(
{},
defaults,
options,
options.userAgent && defaults.userAgent ? {
userAgent: `${options.userAgent} ${defaults.userAgent}`
} : null
)
);
}
};
return OctokitWithDefaults;
}
/**
* Attach a plugin (or many) to your Octokit instance.
*
* @example
* const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
*/
static plugin(...newPlugins) {
var _a3;
const currentPlugins = this.plugins;
const NewOctokit = (_a3 = class extends this {
}, _a3.plugins = currentPlugins.concat(
newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
), _a3);
return NewOctokit;
}
constructor(options = {}) {
const hook6 = new import_before_after_hook.Collection();
const requestDefaults = {
baseUrl: request.endpoint.DEFAULTS.baseUrl,
headers: {},
request: Object.assign({}, options.request, {
// @ts-ignore internal usage only, no need to type
hook: hook6.bind(null, "request")
}),
mediaType: {
previews: [],
format: ""
}
};
requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
if (options.baseUrl) {
requestDefaults.baseUrl = options.baseUrl;
}
if (options.previews) {
requestDefaults.mediaType.previews = options.previews;
}
if (options.timeZone) {
requestDefaults.headers["time-zone"] = options.timeZone;
}
this.request = request.defaults(requestDefaults);
this.graphql = withCustomRequest(this.request).defaults(requestDefaults);
this.log = Object.assign(
{
debug: noop,
info: noop,
warn: consoleWarn,
error: consoleError
},
options.log
);
this.hook = hook6;
if (!options.authStrategy) {
if (!options.auth) {
this.auth = async () => ({
type: "unauthenticated"
});
} else {
const auth6 = createTokenAuth(options.auth);
hook6.wrap("request", auth6.hook);
this.auth = auth6;
}
} else {
const { authStrategy, ...otherOptions } = options;
const auth6 = authStrategy(
Object.assign(
{
request: this.request,
log: this.log,
// we pass the current octokit instance as well as its constructor options
// to allow for authentication strategies that return a new octokit instance
// that shares the same internal state as the current one. The original
// requirement for this was the "event-octokit" authentication strategy
// of https://github.com/probot/octokit-auth-probot.
octokit: this,
octokitOptions: otherOptions
},
options.auth
)
);
hook6.wrap("request", auth6.hook);
this.auth = auth6;
}
const classConstructor = this.constructor;
for (let i2 = 0; i2 < classConstructor.plugins.length; ++i2) {
Object.assign(this, classConstructor.plugins[i2](this, options));
}
}
}, _a.VERSION = VERSION4, _a.plugins = [], _a);
}
});
// node_modules/.pnpm/bottleneck@2.19.5/node_modules/bottleneck/light.js
var require_light = __commonJS({
"node_modules/.pnpm/bottleneck@2.19.5/node_modules/bottleneck/light.js"(exports, module) {
(function(global2, factory) {
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global2.Bottleneck = factory();
})(exports, function() {
"use strict";
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function getCjsExportFromNamespace(n2) {
return n2 && n2["default"] || n2;
}
var load = function(received, defaults, onto = {}) {
var k, ref, v;
for (k in defaults) {
v = defaults[k];
onto[k] = (ref = received[k]) != null ? ref : v;
}
return onto;
};
var overwrite = function(received, defaults, onto = {}) {
var k, v;
for (k in received) {
v = received[k];
if (defaults[k] !== void 0) {
onto[k] = v;
}
}
return onto;
};
var parser = {
load,
overwrite
};
var DLList;
DLList = class DLList {
constructor(incr, decr) {
this.incr = incr;
this.decr = decr;
this._first = null;
this._last = null;
this.length = 0;
}
push(value) {
var node;
this.length++;
if (typeof this.incr === "function") {
this.incr();
}
node = {
value,
prev: this._last,
next: null
};
if (this._last != null) {
this._last.next = node;
this._last = node;
} else {
this._first = this._last = node;
}
return void 0;
}
shift() {
var value;
if (this._first == null) {
return;
} else {
this.length--;
if (typeof this.decr === "function") {
this.decr();
}
}
value = this._first.value;
if ((this._first = this._first.next) != null) {
this._first.prev = null;
} else {
this._last = null;
}
return value;
}
first() {
if (this._first != null) {
return this._first.value;
}
}
getArray() {
var node, ref, results;
node = this._first;
results = [];
while (node != null) {
results.push((ref = node, node = node.next, ref.value));
}
return results;
}
forEachShift(cb) {
var node;
node = this.shift();
while (node != null) {
cb(node), node = this.shift();
}
return void 0;
}
debug() {
var node, ref, ref1, ref2, results;
node = this._first;
results = [];
while (node != null) {
results.push((ref = node, node = node.next, {
value: ref.value,
prev: (ref1 = ref.prev) != null ? ref1.value : void 0,
next: (ref2 = ref.next) != null ? ref2.value : void 0
}));
}
return results;
}
};
var DLList_1 = DLList;
var Events;
Events = class Events {
constructor(instance) {
this.instance = instance;
this._events = {};
if (this.instance.on != null || this.instance.once != null || this.instance.removeAllListeners != null) {
throw new Error("An Emitter already exists for this object");
}
this.instance.on = (name, cb) => {
return this._addListener(name, "many", cb);
};
this.instance.once = (name, cb) => {
return this._addListener(name, "once", cb);
};
this.instance.removeAllListeners = (name = null) => {
if (name != null) {
return delete this._events[name];
} else {
return this._events = {};
}
};
}
_addListener(name, status, cb) {
var base;
if ((base = this._events)[name] == null) {
base[name] = [];
}
this._events[name].push({ cb, status });
return this.instance;
}
listenerCount(name) {
if (this._events[name] != null) {
return this._events[name].length;
} else {
return 0;
}
}
async trigger(name, ...args) {
var e2, promises;
try {
if (name !== "debug") {
this.trigger("debug", `Event triggered: ${name}`, args);
}
if (this._events[name] == null) {
return;
}
this._events[name] = this._events[name].filter(function(listener) {
return listener.status !== "none";
});
promises = this._events[name].map(async (listener) => {
var e3, returned;
if (listener.status === "none") {
return;
}
if (listener.status === "once") {
listener.status = "none";
}
try {
returned = typeof listener.cb === "function" ? listener.cb(...args) : void 0;
if (typeof (returned != null ? returned.then : void 0) === "function") {
return await returned;
} else {
return returned;
}
} catch (error) {
e3 = error;
{
this.trigger("error", e3);
}
return null;
}
});
return (await Promise.all(promises)).find(function(x) {
return x != null;
});
} catch (error) {
e2 = error;
{
this.trigger("error", e2);
}
return null;
}
}
};
var Events_1 = Events;
var DLList$1, Events$1, Queues;
DLList$1 = DLList_1;
Events$1 = Events_1;
Queues = class Queues {
constructor(num_priorities) {
var i2;
this.Events = new Events$1(this);
this._length = 0;
this._lists = (function() {
var j, ref, results;
results = [];
for (i2 = j = 1, ref = num_priorities; 1 <= ref ? j <= ref : j >= ref; i2 = 1 <= ref ? ++j : --j) {
results.push(new DLList$1(() => {
return this.incr();
}, () => {
return this.decr();
}));
}
return results;
}).call(this);
}
incr() {
if (this._length++ === 0) {
return this.Events.trigger("leftzero");
}
}
decr() {
if (--this._length === 0) {
return this.Events.trigger("zero");
}
}
push(job) {
return this._lists[job.options.priority].push(job);
}
queued(priority) {
if (priority != null) {
return this._lists[priority].length;
} else {
return this._length;
}
}
shiftAll(fn) {
return this._lists.forEach(function(list) {
return list.forEachShift(fn);
});
}
getFirst(arr = this._lists) {
var j, len, list;
for (j = 0, len = arr.length; j < len; j++) {
list = arr[j];
if (list.length > 0) {
return list;
}
}
return [];
}
shiftLastFrom(priority) {
return this.getFirst(this._lists.slice(priority).reverse()).shift();
}
};
var Queues_1 = Queues;
var BottleneckError;
BottleneckError = class BottleneckError extends Error {
};
var BottleneckError_1 = BottleneckError;
var BottleneckError$1, DEFAULT_PRIORITY, Job, NUM_PRIORITIES, parser$1;
NUM_PRIORITIES = 10;
DEFAULT_PRIORITY = 5;
parser$1 = parser;
BottleneckError$1 = BottleneckError_1;
Job = class Job {
constructor(task, args, options, jobDefaults, rejectOnDrop, Events2, _states, Promise2) {
this.task = task;
this.args = args;
this.rejectOnDrop = rejectOnDrop;
this.Events = Events2;
this._states = _states;
this.Promise = Promise2;
this.options = parser$1.load(options, jobDefaults);
this.options.priority = this._sanitizePriority(this.options.priority);
if (this.options.id === jobDefaults.id) {
this.options.id = `${this.options.id}-${this._randomIndex()}`;
}
this.promise = new this.Promise((_resolve, _reject) => {
this._resolve = _resolve;
this._reject = _reject;
});
this.retryCount = 0;
}
_sanitizePriority(priority) {
var sProperty;
sProperty = ~~priority !== priority ? DEFAULT_PRIORITY : priority;
if (sProperty < 0) {
return 0;
} else if (sProperty > NUM_PRIORITIES - 1) {
return NUM_PRIORITIES - 1;
} else {
return sProperty;
}
}
_randomIndex() {
return Math.random().toString(36).slice(2);
}
doDrop({ error, message = "This job has been dropped by Bottleneck" } = {}) {
if (this._states.remove(this.options.id)) {
if (this.rejectOnDrop) {
this._reject(error != null ? error : new BottleneckError$1(message));
}
this.Events.trigger("dropped", { args: this.args, options: this.options, task: this.task, promise: this.promise });
return true;
} else {
return false;
}
}
_assertStatus(expected) {
var status;
status = this._states.jobStatus(this.options.id);
if (!(status === expected || expected === "DONE" && status === null)) {
throw new BottleneckError$1(`Invalid job status ${status}, expected ${expected}. Please open an issue at https://github.com/SGrondin/bottleneck/issues`);
}
}
doReceive() {
this._states.start(this.options.id);
return this.Events.trigger("received", { args: this.args, options: this.options });
}
doQueue(reachedHWM, blocked) {
this._assertStatus("RECEIVED");
this._states.next(this.options.id);
return this.Events.trigger("queued", { args: this.args, options: this.options, reachedHWM, blocked });
}
doRun() {
if (this.retryCount === 0) {
this._assertStatus("QUEUED");
this._states.next(this.options.id);
} else {
this._assertStatus("EXECUTING");
}
return this.Events.trigger("scheduled", { args: this.args, options: this.options });
}
async doExecute(chained, clearGlobalState, run, free) {
var error, eventInfo, passed;
if (this.retryCount === 0) {
this._assertStatus("RUNNING");
this._states.next(this.options.id);
} else {
this._assertStatus("EXECUTING");
}
eventInfo = { args: this.args, options: this.options, retryCount: this.retryCount };
this.Events.trigger("executing", eventInfo);
try {
passed = await (chained != null ? chained.schedule(this.options, this.task, ...this.args) : this.task(...this.args));
if (clearGlobalState()) {
this.doDone(eventInfo);
await free(this.options, eventInfo);
this._assertStatus("DONE");
return this._resolve(passed);
}
} catch (error1) {
error = error1;
return this._onFailure(error, eventInfo, clearGlobalState, run, free);
}
}
doExpire(clearGlobalState, run, free) {
var error, eventInfo;
if (this._states.jobStatus(this.options.id === "RUNNING")) {
this._states.next(this.options.id);
}
this._assertStatus("EXECUTING");
eventInfo = { args: this.args, options: this.options, retryCount: this.retryCount };
error = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`);
return this._onFailure(error, eventInfo, clearGlobalState, run, free);
}
async _onFailure(error, eventInfo, clearGlobalState, run, free) {
var retry2, retryAfter;
if (clearGlobalState()) {
retry2 = await this.Events.trigger("failed", error, eventInfo);
if (retry2 != null) {
retryAfter = ~~retry2;
this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo);
this.retryCount++;
return run(retryAfter);
} else {
this.doDone(eventInfo);
await free(this.options, eventInfo);
this._assertStatus("DONE");
return this._reject(error);
}
}
}
doDone(eventInfo) {
this._assertStatus("EXECUTING");
this._states.next(this.options.id);
return this.Events.trigger("done", eventInfo);
}
};
var Job_1 = Job;
var BottleneckError$2, LocalDatastore, parser$2;
parser$2 = parser;
BottleneckError$2 = BottleneckError_1;
LocalDatastore = class LocalDatastore {
constructor(instance, storeOptions, storeInstanceOptions) {
this.instance = instance;
this.storeOptions = storeOptions;
this.clientId = this.instance._randomIndex();
parser$2.load(storeInstanceOptions, storeInstanceOptions, this);
this._nextRequest = this._lastReservoirRefresh = this._lastReservoirIncrease = Date.now();
this._running = 0;
this._done = 0;
this._unblockTime = 0;
this.ready = this.Promise.resolve();
this.clients = {};
this._startHeartbeat();
}
_startHeartbeat() {
var base;
if (this.heartbeat == null && (this.storeOptions.reservoirRefreshInterval != null && this.storeOptions.reservoirRefreshAmount != null || this.storeOptions.reservoirIncreaseInterval != null && this.storeOptions.reservoirIncreaseAmount != null)) {
return typeof (base = this.heartbeat = setInterval(() => {
var amount, incr, maximum, now, reservoir;
now = Date.now();
if (this.storeOptions.reservoirRefreshInterval != null && now >= this._lastReservoirRefresh + this.storeOptions.reservoirRefreshInterval) {
this._lastReservoirRefresh = now;
this.storeOptions.reservoir = this.storeOptions.reservoirRefreshAmount;
this.instance._drainAll(this.computeCapacity());
}
if (this.storeOptions.reservoirIncreaseInterval != null && now >= this._lastReservoirIncrease + this.storeOptions.reservoirIncreaseInterval) {
({
reservoirIncreaseAmount: amount,
reservoirIncreaseMaximum: maximum,
reservoir
} = this.storeOptions);
this._lastReservoirIncrease = now;
incr = maximum != null ? Math.min(amount, maximum - reservoir) : amount;
if (incr > 0) {
this.storeOptions.reservoir += incr;
return this.instance._drainAll(this.computeCapacity());
}
}
}, this.heartbeatInterval)).unref === "function" ? base.unref() : void 0;
} else {
return clearInterval(this.heartbeat);
}
}
async __publish__(message) {
await this.yieldLoop();
return this.instance.Events.trigger("message", message.toString());
}
async __disconnect__(flush) {
await this.yieldLoop();
clearInterval(this.heartbeat);
return this.Promise.resolve();
}
yieldLoop(t2 = 0) {
return new this.Promise(function(resolve, reject) {
return setTimeout(resolve, t2);
});
}
computePenalty() {
var ref;
return (ref = this.storeOptions.penalty) != null ? ref : 15 * this.storeOptions.minTime || 5e3;
}
async __updateSettings__(options) {
await this.yieldLoop();
parser$2.overwrite(options, options, this.storeOptions);
this._startHeartbeat();
this.instance._drainAll(this.computeCapacity());
return true;
}
async __running__() {
await this.yieldLoop();
return this._running;
}
async __queued__() {
await this.yieldLoop();
return this.instance.queued();
}
async __done__() {
await this.yieldLoop();
return this._done;
}
async __groupCheck__(time) {
await this.yieldLoop();
return this._nextRequest + this.timeout < time;
}
computeCapacity() {
var maxConcurrent, reservoir;
({ maxConcurrent, reservoir } = this.storeOptions);
if (maxConcurrent != null && reservoir != null) {
return Math.min(maxConcurrent - this._running, reservoir);
} else if (maxConcurrent != null) {
return maxConcurrent - this._running;
} else if (reservoir != null) {
return reservoir;
} else {
return null;
}
}
conditionsCheck(weight) {
var capacity;
capacity = this.computeCapacity();
return capacity == null || weight <= capacity;
}
async __incrementReservoir__(incr) {
var reservoir;
await this.yieldLoop();
reservoir = this.storeOptions.reservoir += incr;
this.instance._drainAll(this.computeCapacity());
return reservoir;
}
async __currentReservoir__() {
await this.yieldLoop();
return this.storeOptions.reservoir;
}
isBlocked(now) {
return this._unblockTime >= now;
}
check(weight, now) {
return this.conditionsCheck(weight) && this._nextRequest - now <= 0;
}
async __check__(weight) {
var now;
await this.yieldLoop();
now = Date.now();
return this.check(weight, now);
}
async __register__(index, weight, expiration) {
var now, wait2;
await this.yieldLoop();
now = Date.now();
if (this.conditionsCheck(weight)) {
this._running += weight;
if (this.storeOptions.reservoir != null) {
this.storeOptions.reservoir -= weight;
}
wait2 = Math.max(this._nextRequest - now, 0);
this._nextRequest = now + wait2 + this.storeOptions.minTime;
return {
success: true,
wait: wait2,
reservoir: this.storeOptions.reservoir
};
} else {
return {
success: false
};
}
}
strategyIsBlock() {
return this.storeOptions.strategy === 3;
}
async __submit__(queueLength, weight) {
var blocked, now, reachedHWM;
await this.yieldLoop();
if (this.storeOptions.maxConcurrent != null && weight > this.storeOptions.maxConcurrent) {
throw new BottleneckError$2(`Impossible to add a job having a weight of ${weight} to a limiter having a maxConcurrent setting of ${this.storeOptions.maxConcurrent}`);
}
now = Date.now();
reachedHWM = this.storeOptions.highWater != null && queueLength === this.storeOptions.highWater && !this.check(weight, now);
blocked = this.strategyIsBlock() && (reachedHWM || this.isBlocked(now));
if (blocked) {
this._unblockTime = now + this.computePenalty();
this._nextRequest = this._unblockTime + this.storeOptions.minTime;
this.instance._dropAllQueued();
}
return {
reachedHWM,
blocked,
strategy: this.storeOptions.strategy
};
}
async __free__(index, weight) {
await this.yieldLoop();
this._running -= weight;
this._done += weight;
this.instance._drainAll(this.computeCapacity());
return {
running: this._running
};
}
};
var LocalDatastore_1 = LocalDatastore;
var BottleneckError$3, States;
BottleneckError$3 = BottleneckError_1;
States = class States {
constructor(status1) {
this.status = status1;
this._jobs = {};
this.counts = this.status.map(function() {
return 0;
});
}
next(id) {
var current, next;
current = this._jobs[id];
next = current + 1;
if (current != null && next < this.status.length) {
this.counts[current]--;
this.counts[next]++;
return this._jobs[id]++;
} else if (current != null) {
this.counts[current]--;
return delete this._jobs[id];
}
}
start(id) {
var initial;
initial = 0;
this._jobs[id] = initial;
return this.counts[initial]++;
}
remove(id) {
var current;
current = this._jobs[id];
if (current != null) {
this.counts[current]--;
delete this._jobs[id];
}
return current != null;
}
jobStatus(id) {
var ref;
return (ref = this.status[this._jobs[id]]) != null ? ref : null;
}
statusJobs(status) {
var k, pos, ref, results, v;
if (status != null) {
pos = this.status.indexOf(status);
if (pos < 0) {
throw new BottleneckError$3(`status must be one of ${this.status.join(", ")}`);
}
ref = this._jobs;
results = [];
for (k in ref) {
v = ref[k];
if (v === pos) {
results.push(k);
}
}
return results;
} else {
return Object.keys(this._jobs);
}
}
statusCounts() {
return this.counts.reduce((acc, v, i2) => {
acc[this.status[i2]] = v;
return acc;
}, {});
}
};
var States_1 = States;
var DLList$2, Sync;
DLList$2 = DLList_1;
Sync = class Sync {
constructor(name, Promise2) {
this.schedule = this.schedule.bind(this);
this.name = name;
this.Promise = Promise2;
this._running = 0;
this._queue = new DLList$2();
}
isEmpty() {
return this._queue.length === 0;
}
async _tryToRun() {
var args, cb, error, reject, resolve, returned, task;
if (this._running < 1 && this._queue.length > 0) {
this._running++;
({ task, args, resolve, reject } = this._queue.shift());
cb = await async function() {
try {
returned = await task(...args);
return function() {
return resolve(returned);
};
} catch (error1) {
error = error1;
return function() {
return reject(error);
};
}
}();
this._running--;
this._tryToRun();
return cb();
}
}
schedule(task, ...args) {
var promise, reject, resolve;
resolve = reject = null;
promise = new this.Promise(function(_resolve, _reject) {
resolve = _resolve;
return reject = _reject;
});
this._queue.push({ task, args, resolve, reject });
this._tryToRun();
return promise;
}
};
var Sync_1 = Sync;
var version = "2.19.5";
var version$1 = {
version
};
var version$2 = Object.freeze({
version,
default: version$1
});
var require$$2 = () => console.log("You must import the full version of Bottleneck in order to use this feature.");
var require$$3 = () => console.log("You must import the full version of Bottleneck in order to use this feature.");
var require$$4 = () => console.log("You must import the full version of Bottleneck in order to use this feature.");
var Events$2, Group, IORedisConnection$1, RedisConnection$1, Scripts$1, parser$3;
parser$3 = parser;
Events$2 = Events_1;
RedisConnection$1 = require$$2;
IORedisConnection$1 = require$$3;
Scripts$1 = require$$4;
Group = (function() {
class Group2 {
constructor(limiterOptions = {}) {
this.deleteKey = this.deleteKey.bind(this);
this.limiterOptions = limiterOptions;
parser$3.load(this.limiterOptions, this.defaults, this);
this.Events = new Events$2(this);
this.instances = {};
this.Bottleneck = Bottleneck_1;
this._startAutoCleanup();
this.sharedConnection = this.connection != null;
if (this.connection == null) {
if (this.limiterOptions.datastore === "redis") {
this.connection = new RedisConnection$1(Object.assign({}, this.limiterOptions, { Events: this.Events }));
} else if (this.limiterOptions.datastore === "ioredis") {
this.connection = new IORedisConnection$1(Object.assign({}, this.limiterOptions, { Events: this.Events }));
}
}
}
key(key = "") {
var ref;
return (ref = this.instances[key]) != null ? ref : (() => {
var limiter;
limiter = this.instances[key] = new this.Bottleneck(Object.assign(this.limiterOptions, {
id: `${this.id}-${key}`,
timeout: this.timeout,
connection: this.connection
}));
this.Events.trigger("created", limiter, key);
return limiter;
})();
}
async deleteKey(key = "") {
var deleted, instance;
instance = this.instances[key];
if (this.connection) {
deleted = await this.connection.__runCommand__(["del", ...Scripts$1.allKeys(`${this.id}-${key}`)]);
}
if (instance != null) {
delete this.instances[key];
await instance.disconnect();
}
return instance != null || deleted > 0;
}
limiters() {
var k, ref, results, v;
ref = this.instances;
results = [];
for (k in ref) {
v = ref[k];
results.push({
key: k,
limiter: v
});
}
return results;
}
keys() {
return Object.keys(this.instances);
}
async clusterKeys() {
var cursor, end, found, i2, k, keys, len, next, start;
if (this.connection == null) {
return this.Promise.resolve(this.keys());
}
keys = [];
cursor = null;
start = `b_${this.id}-`.length;
end = "_settings".length;
while (cursor !== 0) {
[next, found] = await this.connection.__runCommand__(["scan", cursor != null ? cursor : 0, "match", `b_${this.id}-*_settings`, "count", 1e4]);
cursor = ~~next;
for (i2 = 0, len = found.length; i2 < len; i2++) {
k = found[i2];
keys.push(k.slice(start, -end));
}
}
return keys;
}
_startAutoCleanup() {
var base;
clearInterval(this.interval);
return typeof (base = this.interval = setInterval(async () => {
var e2, k, ref, results, time, v;
time = Date.now();
ref = this.instances;
results = [];
for (k in ref) {
v = ref[k];
try {
if (await v._store.__groupCheck__(time)) {
results.push(this.deleteKey(k));
} else {
results.push(void 0);
}
} catch (error) {
e2 = error;
results.push(v.Events.trigger("error", e2));
}
}
return results;
}, this.timeout / 2)).unref === "function" ? base.unref() : void 0;
}
updateSettings(options = {}) {
parser$3.overwrite(options, this.defaults, this);
parser$3.overwrite(options, options, this.limiterOptions);
if (options.timeout != null) {
return this._startAutoCleanup();
}
}
disconnect(flush = true) {
var ref;
if (!this.sharedConnection) {
return (ref = this.connection) != null ? ref.disconnect(flush) : void 0;
}
}
}
Group2.prototype.defaults = {
timeout: 1e3 * 60 * 5,
connection: null,
Promise,
id: "group-key"
};
return Group2;
}).call(commonjsGlobal);
var Group_1 = Group;
var Batcher, Events$3, parser$4;
parser$4 = parser;
Events$3 = Events_1;
Batcher = (function() {
class Batcher2 {
constructor(options = {}) {
this.options = options;
parser$4.load(this.options, this.defaults, this);
this.Events = new Events$3(this);
this._arr = [];
this._resetPromise();
this._lastFlush = Date.now();
}
_resetPromise() {
return this._promise = new this.Promise((res, rej) => {
return this._resolve = res;
});
}
_flush() {
clearTimeout(this._timeout);
this._lastFlush = Date.now();
this._resolve();
this.Events.trigger("batch", this._arr);
this._arr = [];
return this._resetPromise();
}
add(data) {
var ret;
this._arr.push(data);
ret = this._promise;
if (this._arr.length === this.maxSize) {
this._flush();
} else if (this.maxTime != null && this._arr.length === 1) {
this._timeout = setTimeout(() => {
return this._flush();
}, this.maxTime);
}
return ret;
}
}
Batcher2.prototype.defaults = {
maxTime: null,
maxSize: null,
Promise
};
return Batcher2;
}).call(commonjsGlobal);
var Batcher_1 = Batcher;
var require$$4$1 = () => console.log("You must import the full version of Bottleneck in order to use this feature.");
var require$$8 = getCjsExportFromNamespace(version$2);
var Bottleneck2, DEFAULT_PRIORITY$1, Events$4, Job$1, LocalDatastore$1, NUM_PRIORITIES$1, Queues$1, RedisDatastore$1, States$1, Sync$1, parser$5, splice = [].splice;
NUM_PRIORITIES$1 = 10;
DEFAULT_PRIORITY$1 = 5;
parser$5 = parser;
Queues$1 = Queues_1;
Job$1 = Job_1;
LocalDatastore$1 = LocalDatastore_1;
RedisDatastore$1 = require$$4$1;
Events$4 = Events_1;
States$1 = States_1;
Sync$1 = Sync_1;
Bottleneck2 = (function() {
class Bottleneck3 {
constructor(options = {}, ...invalid) {
var storeInstanceOptions, storeOptions;
this._addToQueue = this._addToQueue.bind(this);
this._validateOptions(options, invalid);
parser$5.load(options, this.instanceDefaults, this);
this._queues = new Queues$1(NUM_PRIORITIES$1);
this._scheduled = {};
this._states = new States$1(["RECEIVED", "QUEUED", "RUNNING", "EXECUTING"].concat(this.trackDoneStatus ? ["DONE"] : []));
this._limiter = null;
this.Events = new Events$4(this);
this._submitLock = new Sync$1("submit", this.Promise);
this._registerLock = new Sync$1("register", this.Promise);
storeOptions = parser$5.load(options, this.storeDefaults, {});
this._store = (function() {
if (this.datastore === "redis" || this.datastore === "ioredis" || this.connection != null) {
storeInstanceOptions = parser$5.load(options, this.redisStoreDefaults, {});
return new RedisDatastore$1(this, storeOptions, storeInstanceOptions);
} else if (this.datastore === "local") {
storeInstanceOptions = parser$5.load(options, this.localStoreDefaults, {});
return new LocalDatastore$1(this, storeOptions, storeInstanceOptions);
} else {
throw new Bottleneck3.prototype.BottleneckError(`Invalid datastore type: ${this.datastore}`);
}
}).call(this);
this._queues.on("leftzero", () => {
var ref;
return (ref = this._store.heartbeat) != null ? typeof ref.ref === "function" ? ref.ref() : void 0 : void 0;
});
this._queues.on("zero", () => {
var ref;
return (ref = this._store.heartbeat) != null ? typeof ref.unref === "function" ? ref.unref() : void 0 : void 0;
});
}
_validateOptions(options, invalid) {
if (!(options != null && typeof options === "object" && invalid.length === 0)) {
throw new Bottleneck3.prototype.BottleneckError("Bottleneck v2 takes a single object argument. Refer to https://github.com/SGrondin/bottleneck#upgrading-to-v2 if you're upgrading from Bottleneck v1.");
}
}
ready() {
return this._store.ready;
}
clients() {
return this._store.clients;
}
channel() {
return `b_${this.id}`;
}
channel_client() {
return `b_${this.id}_${this._store.clientId}`;
}
publish(message) {
return this._store.__publish__(message);
}
disconnect(flush = true) {
return this._store.__disconnect__(flush);
}
chain(_limiter) {
this._limiter = _limiter;
return this;
}
queued(priority) {
return this._queues.queued(priority);
}
clusterQueued() {
return this._store.__queued__();
}
empty() {
return this.queued() === 0 && this._submitLock.isEmpty();
}
running() {
return this._store.__running__();
}
done() {
return this._store.__done__();
}
jobStatus(id) {
return this._states.jobStatus(id);
}
jobs(status) {
return this._states.statusJobs(status);
}
counts() {
return this._states.statusCounts();
}
_randomIndex() {
return Math.random().toString(36).slice(2);
}
check(weight = 1) {
return this._store.__check__(weight);
}
_clearGlobalState(index) {
if (this._scheduled[index] != null) {
clearTimeout(this._scheduled[index].expiration);
delete this._scheduled[index];
return true;
} else {
return false;
}
}
async _free(index, job, options, eventInfo) {
var e2, running;
try {
({ running } = await this._store.__free__(index, options.weight));
this.Events.trigger("debug", `Freed ${options.id}`, eventInfo);
if (running === 0 && this.empty()) {
return this.Events.trigger("idle");
}
} catch (error1) {
e2 = error1;
return this.Events.trigger("error", e2);
}
}
_run(index, job, wait2) {
var clearGlobalState, free, run;
job.doRun();
clearGlobalState = this._clearGlobalState.bind(this, index);
run = this._run.bind(this, index, job);
free = this._free.bind(this, index, job);
return this._scheduled[index] = {
timeout: setTimeout(() => {
return job.doExecute(this._limiter, clearGlobalState, run, free);
}, wait2),
expiration: job.options.expiration != null ? setTimeout(function() {
return job.doExpire(clearGlobalState, run, free);
}, wait2 + job.options.expiration) : void 0,
job
};
}
_drainOne(capacity) {
return this._registerLock.schedule(() => {
var args, index, next, options, queue;
if (this.queued() === 0) {
return this.Promise.resolve(null);
}
queue = this._queues.getFirst();
({ options, args } = next = queue.first());
if (capacity != null && options.weight > capacity) {
return this.Promise.resolve(null);
}
this.Events.trigger("debug", `Draining ${options.id}`, { args, options });
index = this._randomIndex();
return this._store.__register__(index, options.weight, options.expiration).then(({ success, wait: wait2, reservoir }) => {
var empty;
this.Events.trigger("debug", `Drained ${options.id}`, { success, args, options });
if (success) {
queue.shift();
empty = this.empty();
if (empty) {
this.Events.trigger("empty");
}
if (reservoir === 0) {
this.Events.trigger("depleted", empty);
}
this._run(index, next, wait2);
return this.Promise.resolve(options.weight);
} else {
return this.Promise.resolve(null);
}
});
});
}
_drainAll(capacity, total = 0) {
return this._drainOne(capacity).then((drained) => {
var newCapacity;
if (drained != null) {
newCapacity = capacity != null ? capacity - drained : capacity;
return this._drainAll(newCapacity, total + drained);
} else {
return this.Promise.resolve(total);
}
}).catch((e2) => {
return this.Events.trigger("error", e2);
});
}
_dropAllQueued(message) {
return this._queues.shiftAll(function(job) {
return job.doDrop({ message });
});
}
stop(options = {}) {
var done, waitForExecuting;
options = parser$5.load(options, this.stopDefaults);
waitForExecuting = (at) => {
var finished;
finished = () => {
var counts;
counts = this._states.counts;
return counts[0] + counts[1] + counts[2] + counts[3] === at;
};
return new this.Promise((resolve, reject) => {
if (finished()) {
return resolve();
} else {
return this.on("done", () => {
if (finished()) {
this.removeAllListeners("done");
return resolve();
}
});
}
});
};
done = options.dropWaitingJobs ? (this._run = function(index, next) {
return next.doDrop({
message: options.dropErrorMessage
});
}, this._drainOne = () => {
return this.Promise.resolve(null);
}, this._registerLock.schedule(() => {
return this._submitLock.schedule(() => {
var k, ref, v;
ref = this._scheduled;
for (k in ref) {
v = ref[k];
if (this.jobStatus(v.job.options.id) === "RUNNING") {
clearTimeout(v.timeout);
clearTimeout(v.expiration);
v.job.doDrop({
message: options.dropErrorMessage
});
}
}
this._dropAllQueued(options.dropErrorMessage);
return waitForExecuting(0);
});
})) : this.schedule({
priority: NUM_PRIORITIES$1 - 1,
weight: 0
}, () => {
return waitForExecuting(1);
});
this._receive = function(job) {
return job._reject(new Bottleneck3.prototype.BottleneckError(options.enqueueErrorMessage));
};
this.stop = () => {
return this.Promise.reject(new Bottleneck3.prototype.BottleneckError("stop() has already been called"));
};
return done;
}
async _addToQueue(job) {
var args, blocked, error, options, reachedHWM, shifted, strategy;
({ args, options } = job);
try {
({ reachedHWM, blocked, strategy } = await this._store.__submit__(this.queued(), options.weight));
} catch (error1) {
error = error1;
this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error });
job.doDrop({ error });
return false;
}
if (blocked) {
job.doDrop();
return true;
} else if (reachedHWM) {
shifted = strategy === Bottleneck3.prototype.strategy.LEAK ? this._queues.shiftLastFrom(options.priority) : strategy === Bottleneck3.prototype.strategy.OVERFLOW_PRIORITY ? this._queues.shiftLastFrom(options.priority + 1) : strategy === Bottleneck3.prototype.strategy.OVERFLOW ? job : void 0;
if (shifted != null) {
shifted.doDrop();
}
if (shifted == null || strategy === Bottleneck3.prototype.strategy.OVERFLOW) {
if (shifted == null) {
job.doDrop();
}
return reachedHWM;
}
}
job.doQueue(reachedHWM, blocked);
this._queues.push(job);
await this._drainAll();
return reachedHWM;
}
_receive(job) {
if (this._states.jobStatus(job.options.id) != null) {
job._reject(new Bottleneck3.prototype.BottleneckError(`A job with the same id already exists (id=${job.options.id})`));
return false;
} else {
job.doReceive();
return this._submitLock.schedule(this._addToQueue, job);
}
}
submit(...args) {
var cb, fn, job, options, ref, ref1, task;
if (typeof args[0] === "function") {
ref = args, [fn, ...args] = ref, [cb] = splice.call(args, -1);
options = parser$5.load({}, this.jobDefaults);
} else {
ref1 = args, [options, fn, ...args] = ref1, [cb] = splice.call(args, -1);
options = parser$5.load(options, this.jobDefaults);
}
task = (...args2) => {
return new this.Promise(function(resolve, reject) {
return fn(...args2, function(...args3) {
return (args3[0] != null ? reject : resolve)(args3);
});
});
};
job = new Job$1(task, args, options, this.jobDefaults, this.rejectOnDrop, this.Events, this._states, this.Promise);
job.promise.then(function(args2) {
return typeof cb === "function" ? cb(...args2) : void 0;
}).catch(function(args2) {
if (Array.isArray(args2)) {
return typeof cb === "function" ? cb(...args2) : void 0;
} else {
return typeof cb === "function" ? cb(args2) : void 0;
}
});
return this._receive(job);
}
schedule(...args) {
var job, options, task;
if (typeof args[0] === "function") {
[task, ...args] = args;
options = {};
} else {
[options, task, ...args] = args;
}
job = new Job$1(task, args, options, this.jobDefaults, this.rejectOnDrop, this.Events, this._states, this.Promise);
this._receive(job);
return job.promise;
}
wrap(fn) {
var schedule, wrapped;
schedule = this.schedule.bind(this);
wrapped = function(...args) {
return schedule(fn.bind(this), ...args);
};
wrapped.withOptions = function(options, ...args) {
return schedule(options, fn, ...args);
};
return wrapped;
}
async updateSettings(options = {}) {
await this._store.__updateSettings__(parser$5.overwrite(options, this.storeDefaults));
parser$5.overwrite(options, this.instanceDefaults, this);
return this;
}
currentReservoir() {
return this._store.__currentReservoir__();
}
incrementReservoir(incr = 0) {
return this._store.__incrementReservoir__(incr);
}
}
Bottleneck3.default = Bottleneck3;
Bottleneck3.Events = Events$4;
Bottleneck3.version = Bottleneck3.prototype.version = require$$8.version;
Bottleneck3.strategy = Bottleneck3.prototype.strategy = {
LEAK: 1,
OVERFLOW: 2,
OVERFLOW_PRIORITY: 4,
BLOCK: 3
};
Bottleneck3.BottleneckError = Bottleneck3.prototype.BottleneckError = BottleneckError_1;
Bottleneck3.Group = Bottleneck3.prototype.Group = Group_1;
Bottleneck3.RedisConnection = Bottleneck3.prototype.RedisConnection = require$$2;
Bottleneck3.IORedisConnection = Bottleneck3.prototype.IORedisConnection = require$$3;
Bottleneck3.Batcher = Bottleneck3.prototype.Batcher = Batcher_1;
Bottleneck3.prototype.jobDefaults = {
priority: DEFAULT_PRIORITY$1,
weight: 1,
expiration: null,
id: "<no-id>"
};
Bottleneck3.prototype.storeDefaults = {
maxConcurrent: null,
minTime: 0,
highWater: null,
strategy: Bottleneck3.prototype.strategy.LEAK,
penalty: null,
reservoir: null,
reservoirRefreshInterval: null,
reservoirRefreshAmount: null,
reservoirIncreaseInterval: null,
reservoirIncreaseAmount: null,
reservoirIncreaseMaximum: null
};
Bottleneck3.prototype.localStoreDefaults = {
Promise,
timeout: null,
heartbeatInterval: 250
};
Bottleneck3.prototype.redisStoreDefaults = {
Promise,
timeout: null,
heartbeatInterval: 5e3,
clientTimeout: 1e4,
Redis: null,
clientOptions: {},
clusterNodes: null,
clearDatastore: false,
connection: null
};
Bottleneck3.prototype.instanceDefaults = {
datastore: "local",
connection: null,
id: "<no-id>",
rejectOnDrop: true,
trackDoneStatus: false,
Promise
};
Bottleneck3.prototype.stopDefaults = {
enqueueErrorMessage: "This limiter has been stopped and cannot accept new jobs.",
dropWaitingJobs: true,
dropErrorMessage: "This limiter has been stopped."
};
return Bottleneck3;
}).call(commonjsGlobal);
var Bottleneck_1 = Bottleneck2;
var lib = Bottleneck_1;
return lib;
});
}
});
// node_modules/.pnpm/btoa-lite@1.0.0/node_modules/btoa-lite/btoa-browser.js
var require_btoa_browser = __commonJS({
"node_modules/.pnpm/btoa-lite@1.0.0/node_modules/btoa-lite/btoa-browser.js"(exports, module) {
module.exports = function _btoa(str) {
return btoa(str);
};
}
});
// node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/version.js
var VERSION9;
var init_version = __esm({
"node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/version.js"() {
VERSION9 = "4.1.0";
}
});
// node_modules/.pnpm/@octokit+oauth-authorization-url@6.0.2/node_modules/@octokit/oauth-authorization-url/dist-web/index.js
function oauthAuthorizationUrl(options) {
const clientType = options.clientType || "oauth-app";
const baseUrl = options.baseUrl || "https://github.com";
const result = {
clientType,
allowSignup: options.allowSignup === false ? false : true,
clientId: options.clientId,
login: options.login || null,
redirectUrl: options.redirectUrl || null,
state: options.state || Math.random().toString(36).substr(2),
url: ""
};
if (clientType === "oauth-app") {
const scopes = "scopes" in options ? options.scopes : [];
result.scopes = typeof scopes === "string" ? scopes.split(/[,\s]+/).filter(Boolean) : scopes;
}
result.url = urlBuilderAuthorize(`${baseUrl}/login/oauth/authorize`, result);
return result;
}
function urlBuilderAuthorize(base, options) {
const map = {
allowSignup: "allow_signup",
clientId: "client_id",
login: "login",
redirectUrl: "redirect_uri",
scopes: "scope",
state: "state"
};
let url = base;
Object.keys(map).filter((k) => options[k] !== null).filter((k) => {
if (k !== "scopes")
return true;
if (options.clientType === "github-app")
return false;
return !Array.isArray(options[k]) || options[k].length > 0;
}).map((key) => [map[key], `${options[key]}`]).forEach(([key, value], index) => {
url += index === 0 ? `?` : "&";
url += `${key}=${encodeURIComponent(value)}`;
});
return url;
}
var init_dist_web9 = __esm({
"node_modules/.pnpm/@octokit+oauth-authorization-url@6.0.2/node_modules/@octokit/oauth-authorization-url/dist-web/index.js"() {
}
});
// node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/utils.js
function requestToOAuthBaseUrl(request2) {
const endpointDefaults = request2.endpoint.DEFAULTS;
return /^https:\/\/(api\.)?github\.com$/.test(endpointDefaults.baseUrl) ? "https://github.com" : endpointDefaults.baseUrl.replace("/api/v3", "");
}
async function oauthRequest(request2, route, parameters) {
const withOAuthParameters = {
baseUrl: requestToOAuthBaseUrl(request2),
headers: {
accept: "application/json"
},
...parameters
};
const response = await request2(route, withOAuthParameters);
if ("error" in response.data) {
const error = new RequestError(
`${response.data.error_description} (${response.data.error}, ${response.data.error_uri})`,
400,
{
request: request2.endpoint.merge(
route,
withOAuthParameters
),
headers: response.headers
}
);
error.response = response;
throw error;
}
return response;
}
var init_utils = __esm({
"node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/utils.js"() {
init_dist_web4();
}
});
// node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/get-web-flow-authorization-url.js
function getWebFlowAuthorizationUrl({
request: request2 = request,
...options
}) {
const baseUrl = requestToOAuthBaseUrl(request2);
return oauthAuthorizationUrl({
...options,
baseUrl
});
}
var init_get_web_flow_authorization_url = __esm({
"node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/get-web-flow-authorization-url.js"() {
init_dist_web9();
init_dist_web5();
init_utils();
}
});
// node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/exchange-web-flow-code.js
async function exchangeWebFlowCode(options) {
const request2 = options.request || /* istanbul ignore next: we always pass a custom request in tests */
request;
const response = await oauthRequest(
request2,
"POST /login/oauth/access_token",
{
client_id: options.clientId,
client_secret: options.clientSecret,
code: options.code,
redirect_uri: options.redirectUrl
}
);
const authentication = {
clientType: options.clientType,
clientId: options.clientId,
clientSecret: options.clientSecret,
token: response.data.access_token,
scopes: response.data.scope.split(/\s+/).filter(Boolean)
};
if (options.clientType === "github-app") {
if ("refresh_token" in response.data) {
const apiTimeInMs = new Date(response.headers.date).getTime();
authentication.refreshToken = response.data.refresh_token, authentication.expiresAt = toTimestamp(
apiTimeInMs,
response.data.expires_in
), authentication.refreshTokenExpiresAt = toTimestamp(
apiTimeInMs,
response.data.refresh_token_expires_in
);
}
delete authentication.scopes;
}
return { ...response, authentication };
}
function toTimestamp(apiTimeInMs, expirationInSeconds) {
return new Date(apiTimeInMs + expirationInSeconds * 1e3).toISOString();
}
var init_exchange_web_flow_code = __esm({
"node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/exchange-web-flow-code.js"() {
init_dist_web5();
init_utils();
}
});
// node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/create-device-code.js
async function createDeviceCode(options) {
const request2 = options.request || /* istanbul ignore next: we always pass a custom request in tests */
request;
const parameters = {
client_id: options.clientId
};
if ("scopes" in options && Array.isArray(options.scopes)) {
parameters.scope = options.scopes.join(" ");
}
return oauthRequest(request2, "POST /login/device/code", parameters);
}
var init_create_device_code = __esm({
"node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/create-device-code.js"() {
init_dist_web5();
init_utils();
}
});
// node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/exchange-device-code.js
async function exchangeDeviceCode(options) {
const request2 = options.request || /* istanbul ignore next: we always pass a custom request in tests */
request;
const response = await oauthRequest(
request2,
"POST /login/oauth/access_token",
{
client_id: options.clientId,
device_code: options.code,
grant_type: "urn:ietf:params:oauth:grant-type:device_code"
}
);
const authentication = {
clientType: options.clientType,
clientId: options.clientId,
token: response.data.access_token,
scopes: response.data.scope.split(/\s+/).filter(Boolean)
};
if ("clientSecret" in options) {
authentication.clientSecret = options.clientSecret;
}
if (options.clientType === "github-app") {
if ("refresh_token" in response.data) {
const apiTimeInMs = new Date(response.headers.date).getTime();
authentication.refreshToken = response.data.refresh_token, authentication.expiresAt = toTimestamp2(
apiTimeInMs,
response.data.expires_in
), authentication.refreshTokenExpiresAt = toTimestamp2(
apiTimeInMs,
response.data.refresh_token_expires_in
);
}
delete authentication.scopes;
}
return { ...response, authentication };
}
function toTimestamp2(apiTimeInMs, expirationInSeconds) {
return new Date(apiTimeInMs + expirationInSeconds * 1e3).toISOString();
}
var init_exchange_device_code = __esm({
"node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/exchange-device-code.js"() {
init_dist_web5();
init_utils();
}
});
// node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/check-token.js
async function checkToken(options) {
const request2 = options.request || /* istanbul ignore next: we always pass a custom request in tests */
request;
const response = await request2("POST /applications/{client_id}/token", {
headers: {
authorization: `basic ${(0, import_btoa_lite.default)(
`${options.clientId}:${options.clientSecret}`
)}`
},
client_id: options.clientId,
access_token: options.token
});
const authentication = {
clientType: options.clientType,
clientId: options.clientId,
clientSecret: options.clientSecret,
token: options.token,
scopes: response.data.scopes
};
if (response.data.expires_at)
authentication.expiresAt = response.data.expires_at;
if (options.clientType === "github-app") {
delete authentication.scopes;
}
return { ...response, authentication };
}
var import_btoa_lite;
var init_check_token = __esm({
"node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/check-token.js"() {
init_dist_web5();
import_btoa_lite = __toESM(require_btoa_browser());
}
});
// node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/refresh-token.js
async function refreshToken(options) {
const request2 = options.request || /* istanbul ignore next: we always pass a custom request in tests */
request;
const response = await oauthRequest(
request2,
"POST /login/oauth/access_token",
{
client_id: options.clientId,
client_secret: options.clientSecret,
grant_type: "refresh_token",
refresh_token: options.refreshToken
}
);
const apiTimeInMs = new Date(response.headers.date).getTime();
const authentication = {
clientType: "github-app",
clientId: options.clientId,
clientSecret: options.clientSecret,
token: response.data.access_token,
refreshToken: response.data.refresh_token,
expiresAt: toTimestamp3(apiTimeInMs, response.data.expires_in),
refreshTokenExpiresAt: toTimestamp3(
apiTimeInMs,
response.data.refresh_token_expires_in
)
};
return { ...response, authentication };
}
function toTimestamp3(apiTimeInMs, expirationInSeconds) {
return new Date(apiTimeInMs + expirationInSeconds * 1e3).toISOString();
}
var init_refresh_token = __esm({
"node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/refresh-token.js"() {
init_dist_web5();
init_utils();
}
});
// node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/scope-token.js
async function scopeToken(options) {
const {
request: optionsRequest,
clientType,
clientId,
clientSecret,
token,
...requestOptions
} = options;
const request2 = optionsRequest || /* istanbul ignore next: we always pass a custom request in tests */
request;
const response = await request2(
"POST /applications/{client_id}/token/scoped",
{
headers: {
authorization: `basic ${(0, import_btoa_lite2.default)(`${clientId}:${clientSecret}`)}`
},
client_id: clientId,
access_token: token,
...requestOptions
}
);
const authentication = Object.assign(
{
clientType,
clientId,
clientSecret,
token: response.data.token
},
response.data.expires_at ? { expiresAt: response.data.expires_at } : {}
);
return { ...response, authentication };
}
var import_btoa_lite2;
var init_scope_token = __esm({
"node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/scope-token.js"() {
init_dist_web5();
import_btoa_lite2 = __toESM(require_btoa_browser());
}
});
// node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/reset-token.js
async function resetToken(options) {
const request2 = options.request || /* istanbul ignore next: we always pass a custom request in tests */
request;
const auth6 = (0, import_btoa_lite3.default)(`${options.clientId}:${options.clientSecret}`);
const response = await request2(
"PATCH /applications/{client_id}/token",
{
headers: {
authorization: `basic ${auth6}`
},
client_id: options.clientId,
access_token: options.token
}
);
const authentication = {
clientType: options.clientType,
clientId: options.clientId,
clientSecret: options.clientSecret,
token: response.data.token,
scopes: response.data.scopes
};
if (response.data.expires_at)
authentication.expiresAt = response.data.expires_at;
if (options.clientType === "github-app") {
delete authentication.scopes;
}
return { ...response, authentication };
}
var import_btoa_lite3;
var init_reset_token = __esm({
"node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/reset-token.js"() {
init_dist_web5();
import_btoa_lite3 = __toESM(require_btoa_browser());
}
});
// node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/delete-token.js
async function deleteToken(options) {
const request2 = options.request || /* istanbul ignore next: we always pass a custom request in tests */
request;
const auth6 = (0, import_btoa_lite4.default)(`${options.clientId}:${options.clientSecret}`);
return request2(
"DELETE /applications/{client_id}/token",
{
headers: {
authorization: `basic ${auth6}`
},
client_id: options.clientId,
access_token: options.token
}
);
}
var import_btoa_lite4;
var init_delete_token = __esm({
"node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/delete-token.js"() {
init_dist_web5();
import_btoa_lite4 = __toESM(require_btoa_browser());
}
});
// node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/delete-authorization.js
async function deleteAuthorization(options) {
const request2 = options.request || /* istanbul ignore next: we always pass a custom request in tests */
request;
const auth6 = (0, import_btoa_lite5.default)(`${options.clientId}:${options.clientSecret}`);
return request2(
"DELETE /applications/{client_id}/grant",
{
headers: {
authorization: `basic ${auth6}`
},
client_id: options.clientId,
access_token: options.token
}
);
}
var import_btoa_lite5;
var init_delete_authorization = __esm({
"node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/delete-authorization.js"() {
init_dist_web5();
import_btoa_lite5 = __toESM(require_btoa_browser());
}
});
// node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/index.js
var dist_src_exports = {};
__export(dist_src_exports, {
VERSION: () => VERSION9,
checkToken: () => checkToken,
createDeviceCode: () => createDeviceCode,
deleteAuthorization: () => deleteAuthorization,
deleteToken: () => deleteToken,
exchangeDeviceCode: () => exchangeDeviceCode,
exchangeWebFlowCode: () => exchangeWebFlowCode,
getWebFlowAuthorizationUrl: () => getWebFlowAuthorizationUrl,
refreshToken: () => refreshToken,
resetToken: () => resetToken,
scopeToken: () => scopeToken
});
var init_dist_src = __esm({
"node_modules/.pnpm/@octokit+oauth-methods@4.1.0/node_modules/@octokit/oauth-methods/dist-src/index.js"() {
init_version();
init_get_web_flow_authorization_url();
init_exchange_web_flow_code();
init_create_device_code();
init_exchange_device_code();
init_check_token();
init_refresh_token();
init_scope_token();
init_reset_token();
init_delete_token();
init_delete_authorization();
}
});
// node_modules/.pnpm/@octokit+auth-oauth-device@6.1.0/node_modules/@octokit/auth-oauth-device/dist-web/index.js
async function getOAuthAccessToken(state, options) {
const cachedAuthentication = getCachedAuthentication(state, options.auth);
if (cachedAuthentication)
return cachedAuthentication;
const { data: verification } = await createDeviceCode({
clientType: state.clientType,
clientId: state.clientId,
request: options.request || state.request,
// @ts-expect-error the extra code to make TS happy is not worth it
scopes: options.auth.scopes || state.scopes
});
await state.onVerification(verification);
const authentication = await waitForAccessToken(
options.request || state.request,
state.clientId,
state.clientType,
verification
);
state.authentication = authentication;
return authentication;
}
function getCachedAuthentication(state, auth22) {
if (auth22.refresh === true)
return false;
if (!state.authentication)
return false;
if (state.clientType === "github-app") {
return state.authentication;
}
const authentication = state.authentication;
const newScope = ("scopes" in auth22 && auth22.scopes || state.scopes).join(
" "
);
const currentScope = authentication.scopes.join(" ");
return newScope === currentScope ? authentication : false;
}
async function wait(seconds) {
await new Promise((resolve) => setTimeout(resolve, seconds * 1e3));
}
async function waitForAccessToken(request2, clientId, clientType, verification) {
try {
const options = {
clientId,
request: request2,
code: verification.device_code
};
const { authentication } = clientType === "oauth-app" ? await exchangeDeviceCode({
...options,
clientType: "oauth-app"
}) : await exchangeDeviceCode({
...options,
clientType: "github-app"
});
return {
type: "token",
tokenType: "oauth",
...authentication
};
} catch (error) {
if (!error.response)
throw error;
const errorType = error.response.data.error;
if (errorType === "authorization_pending") {
await wait(verification.interval);
return waitForAccessToken(request2, clientId, clientType, verification);
}
if (errorType === "slow_down") {
await wait(verification.interval + 5);
return waitForAccessToken(request2, clientId, clientType, verification);
}
throw error;
}
}
async function auth2(state, authOptions) {
return getOAuthAccessToken(state, {
auth: authOptions
});
}
async function hook2(state, request2, route, parameters) {
let endpoint2 = request2.endpoint.merge(
route,
parameters
);
if (/\/login\/(oauth\/access_token|device\/code)$/.test(endpoint2.url)) {
return request2(endpoint2);
}
const { token } = await getOAuthAccessToken(state, {
request: request2,
auth: { type: "oauth" }
});
endpoint2.headers.authorization = `token ${token}`;
return request2(endpoint2);
}
function createOAuthDeviceAuth(options) {
const requestWithDefaults = options.request || request.defaults({
headers: {
"user-agent": `octokit-auth-oauth-device.js/${VERSION10} ${getUserAgent()}`
}
});
const { request: request2 = requestWithDefaults, ...otherOptions } = options;
const state = options.clientType === "github-app" ? {
...otherOptions,
clientType: "github-app",
request: request2
} : {
...otherOptions,
clientType: "oauth-app",
request: request2,
scopes: options.scopes || []
};
if (!options.clientId) {
throw new Error(
'[@octokit/auth-oauth-device] "clientId" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)'
);
}
if (!options.onVerification) {
throw new Error(
'[@octokit/auth-oauth-device] "onVerification" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)'
);
}
return Object.assign(auth2.bind(null, state), {
hook: hook2.bind(null, state)
});
}
var VERSION10;
var init_dist_web10 = __esm({
"node_modules/.pnpm/@octokit+auth-oauth-device@6.1.0/node_modules/@octokit/auth-oauth-device/dist-web/index.js"() {
init_dist_web();
init_dist_web5();
init_dist_src();
VERSION10 = "6.1.0";
}
});
// node_modules/.pnpm/@octokit+auth-oauth-user@4.1.0/node_modules/@octokit/auth-oauth-user/dist-web/index.js
var dist_web_exports6 = {};
__export(dist_web_exports6, {
createOAuthUserAuth: () => createOAuthUserAuth2,
requiresBasicAuth: () => requiresBasicAuth
});
async function getAuthentication(state) {
if ("code" in state.strategyOptions) {
const { authentication } = await exchangeWebFlowCode({
clientId: state.clientId,
clientSecret: state.clientSecret,
clientType: state.clientType,
onTokenCreated: state.onTokenCreated,
...state.strategyOptions,
request: state.request
});
return {
type: "token",
tokenType: "oauth",
...authentication
};
}
if ("onVerification" in state.strategyOptions) {
const deviceAuth = createOAuthDeviceAuth({
clientType: state.clientType,
clientId: state.clientId,
onTokenCreated: state.onTokenCreated,
...state.strategyOptions,
request: state.request
});
const authentication = await deviceAuth({
type: "oauth"
});
return {
clientSecret: state.clientSecret,
...authentication
};
}
if ("token" in state.strategyOptions) {
return {
type: "token",
tokenType: "oauth",
clientId: state.clientId,
clientSecret: state.clientSecret,
clientType: state.clientType,
onTokenCreated: state.onTokenCreated,
...state.strategyOptions
};
}
throw new Error("[@octokit/auth-oauth-user] Invalid strategy options");
}
async function auth3(state, options = {}) {
var _a3, _b;
if (!state.authentication) {
state.authentication = state.clientType === "oauth-app" ? await getAuthentication(state) : await getAuthentication(state);
}
if (state.authentication.invalid) {
throw new Error("[@octokit/auth-oauth-user] Token is invalid");
}
const currentAuthentication = state.authentication;
if ("expiresAt" in currentAuthentication) {
if (options.type === "refresh" || new Date(currentAuthentication.expiresAt) < /* @__PURE__ */ new Date()) {
const { authentication } = await refreshToken({
clientType: "github-app",
clientId: state.clientId,
clientSecret: state.clientSecret,
refreshToken: currentAuthentication.refreshToken,
request: state.request
});
state.authentication = {
tokenType: "oauth",
type: "token",
...authentication
};
}
}
if (options.type === "refresh") {
if (state.clientType === "oauth-app") {
throw new Error(
"[@octokit/auth-oauth-user] OAuth Apps do not support expiring tokens"
);
}
if (!currentAuthentication.hasOwnProperty("expiresAt")) {
throw new Error("[@octokit/auth-oauth-user] Refresh token missing");
}
await ((_a3 = state.onTokenCreated) == null ? void 0 : _a3.call(state, state.authentication, {
type: options.type
}));
}
if (options.type === "check" || options.type === "reset") {
const method = options.type === "check" ? checkToken : resetToken;
try {
const { authentication } = await method({
// @ts-expect-error making TS happy would require unnecessary code so no
clientType: state.clientType,
clientId: state.clientId,
clientSecret: state.clientSecret,
token: state.authentication.token,
request: state.request
});
state.authentication = {
tokenType: "oauth",
type: "token",
// @ts-expect-error TBD
...authentication
};
if (options.type === "reset") {
await ((_b = state.onTokenCreated) == null ? void 0 : _b.call(state, state.authentication, {
type: options.type
}));
}
return state.authentication;
} catch (error) {
if (error.status === 404) {
error.message = "[@octokit/auth-oauth-user] Token is invalid";
state.authentication.invalid = true;
}
throw error;
}
}
if (options.type === "delete" || options.type === "deleteAuthorization") {
const method = options.type === "delete" ? deleteToken : deleteAuthorization;
try {
await method({
// @ts-expect-error making TS happy would require unnecessary code so no
clientType: state.clientType,
clientId: state.clientId,
clientSecret: state.clientSecret,
token: state.authentication.token,
request: state.request
});
} catch (error) {
if (error.status !== 404)
throw error;
}
state.authentication.invalid = true;
return state.authentication;
}
return state.authentication;
}
function requiresBasicAuth(url) {
return url && ROUTES_REQUIRING_BASIC_AUTH.test(url);
}
async function hook3(state, request2, route, parameters = {}) {
const endpoint2 = request2.endpoint.merge(
route,
parameters
);
if (/\/login\/(oauth\/access_token|device\/code)$/.test(endpoint2.url)) {
return request2(endpoint2);
}
if (requiresBasicAuth(endpoint2.url)) {
const credentials = (0, import_btoa_lite6.default)(`${state.clientId}:${state.clientSecret}`);
endpoint2.headers.authorization = `basic ${credentials}`;
return request2(endpoint2);
}
const { token } = state.clientType === "oauth-app" ? await auth3({ ...state, request: request2 }) : await auth3({ ...state, request: request2 });
endpoint2.headers.authorization = "token " + token;
return request2(endpoint2);
}
function createOAuthUserAuth2({
clientId,
clientSecret,
clientType = "oauth-app",
request: request2 = request.defaults({
headers: {
"user-agent": `octokit-auth-oauth-app.js/${VERSION11} ${getUserAgent()}`
}
}),
onTokenCreated,
...strategyOptions
}) {
const state = Object.assign({
clientType,
clientId,
clientSecret,
onTokenCreated,
strategyOptions,
request: request2
});
return Object.assign(auth3.bind(null, state), {
// @ts-expect-error not worth the extra code needed to appease TS
hook: hook3.bind(null, state)
});
}
var import_btoa_lite6, VERSION11, ROUTES_REQUIRING_BASIC_AUTH;
var init_dist_web11 = __esm({
"node_modules/.pnpm/@octokit+auth-oauth-user@4.1.0/node_modules/@octokit/auth-oauth-user/dist-web/index.js"() {
init_dist_web();
init_dist_web5();
init_dist_web10();
init_dist_src();
init_dist_src();
import_btoa_lite6 = __toESM(require_btoa_browser());
VERSION11 = "4.1.0";
ROUTES_REQUIRING_BASIC_AUTH = /\/applications\/[^/]+\/(token|grant)s?/;
createOAuthUserAuth2.VERSION = VERSION11;
}
});
// node_modules/.pnpm/@octokit+auth-oauth-app@7.1.0/node_modules/@octokit/auth-oauth-app/dist-web/index.js
var dist_web_exports7 = {};
__export(dist_web_exports7, {
createOAuthAppAuth: () => createOAuthAppAuth,
createOAuthUserAuth: () => createOAuthUserAuth2
});
async function auth4(state, authOptions) {
if (authOptions.type === "oauth-app") {
return {
type: "oauth-app",
clientId: state.clientId,
clientSecret: state.clientSecret,
clientType: state.clientType,
headers: {
authorization: `basic ${(0, import_btoa_lite7.default)(
`${state.clientId}:${state.clientSecret}`
)}`
}
};
}
if ("factory" in authOptions) {
const { type, ...options } = {
...authOptions,
...state
};
return authOptions.factory(options);
}
const common = {
clientId: state.clientId,
clientSecret: state.clientSecret,
request: state.request,
...authOptions
};
const userAuth = state.clientType === "oauth-app" ? await createOAuthUserAuth2({
...common,
clientType: state.clientType
}) : await createOAuthUserAuth2({
...common,
clientType: state.clientType
});
return userAuth();
}
async function hook4(state, request2, route, parameters) {
let endpoint2 = request2.endpoint.merge(
route,
parameters
);
if (/\/login\/(oauth\/access_token|device\/code)$/.test(endpoint2.url)) {
return request2(endpoint2);
}
if (state.clientType === "github-app" && !requiresBasicAuth(endpoint2.url)) {
throw new Error(
`[@octokit/auth-oauth-app] GitHub Apps cannot use their client ID/secret for basic authentication for endpoints other than "/applications/{client_id}/**". "${endpoint2.method} ${endpoint2.url}" is not supported.`
);
}
const credentials = (0, import_btoa_lite8.default)(`${state.clientId}:${state.clientSecret}`);
endpoint2.headers.authorization = `basic ${credentials}`;
try {
return await request2(endpoint2);
} catch (error) {
if (error.status !== 401)
throw error;
error.message = `[@octokit/auth-oauth-app] "${endpoint2.method} ${endpoint2.url}" does not support clientId/clientSecret basic authentication.`;
throw error;
}
}
function createOAuthAppAuth(options) {
const state = Object.assign(
{
request: request.defaults({
headers: {
"user-agent": `octokit-auth-oauth-app.js/${VERSION12} ${getUserAgent()}`
}
}),
clientType: "oauth-app"
},
options
);
return Object.assign(auth4.bind(null, state), {
hook: hook4.bind(null, state)
});
}
var import_btoa_lite7, import_btoa_lite8, VERSION12;
var init_dist_web12 = __esm({
"node_modules/.pnpm/@octokit+auth-oauth-app@7.1.0/node_modules/@octokit/auth-oauth-app/dist-web/index.js"() {
init_dist_web();
init_dist_web5();
import_btoa_lite7 = __toESM(require_btoa_browser());
init_dist_web11();
import_btoa_lite8 = __toESM(require_btoa_browser());
init_dist_web11();
init_dist_web11();
VERSION12 = "7.1.0";
}
});
// node_modules/.pnpm/universal-github-app-jwt@1.2.0/node_modules/universal-github-app-jwt/dist-web/index.bundled.js
var index_bundled_exports = {};
__export(index_bundled_exports, {
githubAppJwt: () => o
});
function t(t2, n2, r2, e2, i2, a2, o2) {
try {
var u2 = t2[a2](o2), c = u2.value;
} catch (t3) {
return void r2(t3);
}
u2.done ? n2(c) : Promise.resolve(c).then(e2, i2);
}
function n(n2) {
return function() {
var r2 = this, e2 = arguments;
return new Promise(function(i2, a2) {
var o2 = n2.apply(r2, e2);
function u2(n3) {
t(o2, i2, a2, u2, c, "next", n3);
}
function c(n3) {
t(o2, i2, a2, u2, c, "throw", n3);
}
u2(void 0);
});
};
}
function r(t2) {
for (var n2 = new ArrayBuffer(t2.length), r2 = new Uint8Array(n2), e2 = 0, i2 = t2.length; e2 < i2; e2++) r2[e2] = t2.charCodeAt(e2);
return n2;
}
function e(t2) {
return t2.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
}
function i(t2) {
return e(btoa(JSON.stringify(t2)));
}
function o(t2) {
return u.apply(this, arguments);
}
function u() {
return (u = n(function* (t2) {
var { id: n2, privateKey: r2, now: e2 = Math.floor(Date.now() / 1e3) } = t2, i2 = e2 - 30, o2 = i2 + 600, u2 = { iat: i2, exp: o2, iss: n2 };
return { appId: n2, expiration: o2, token: yield a({ privateKey: r2, payload: u2 }) };
})).apply(this, arguments);
}
var a;
var init_index_bundled = __esm({
"node_modules/.pnpm/universal-github-app-jwt@1.2.0/node_modules/universal-github-app-jwt/dist-web/index.bundled.js"() {
a = function() {
var t2 = n(function* (t3) {
var { privateKey: n2, payload: a2 } = t3;
if (/BEGIN RSA PRIVATE KEY/.test(n2)) throw new Error("[universal-github-app-jwt] Private Key is in PKCS#1 format, but only PKCS#8 is supported. See https://github.com/gr2m/universal-github-app-jwt#readme");
var o2, u2 = { name: "RSASSA-PKCS1-v1_5", hash: { name: "SHA-256" } }, c = (o2 = n2.trim().split("\n").slice(1, -1).join(""), r(atob(o2))), p = yield crypto.subtle.importKey("pkcs8", c, u2, false, ["sign"]), f = function(t4, n3) {
return "".concat(i(t4), ".").concat(i(n3));
}({ alg: "RS256", typ: "JWT" }, a2), l = r(f), s = function(t4) {
for (var n3 = "", r2 = new Uint8Array(t4), i2 = r2.byteLength, a3 = 0; a3 < i2; a3++) n3 += String.fromCharCode(r2[a3]);
return e(btoa(n3));
}(yield crypto.subtle.sign(u2.name, p, l));
return "".concat(f, ".").concat(s);
});
return function(n2) {
return t2.apply(this, arguments);
};
}();
}
});
// node_modules/.pnpm/@wolfy1339+lru-cache@11.0.2-patch.1/node_modules/@wolfy1339/lru-cache/dist/commonjs/index.js
var require_commonjs = __commonJS({
"node_modules/.pnpm/@wolfy1339+lru-cache@11.0.2-patch.1/node_modules/@wolfy1339/lru-cache/dist/commonjs/index.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LRUCache = void 0;
var perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
var warned = /* @__PURE__ */ new Set();
var PROCESS = typeof process === "object" && !!process ? process : {};
var emitWarning = (msg, type, code, fn) => {
typeof PROCESS.emitWarning === "function" ? PROCESS.emitWarning(msg, type, code, fn) : console.error(`[${code}] ${type}: ${msg}`);
};
var AC = globalThis.AbortController;
var AS = globalThis.AbortSignal;
var _a3;
if (typeof AC === "undefined") {
AS = class AbortSignal {
constructor() {
__publicField(this, "onabort");
__publicField(this, "_onabort", []);
__publicField(this, "reason");
__publicField(this, "aborted", false);
}
addEventListener(_, fn) {
this._onabort.push(fn);
}
};
AC = class AbortController {
constructor() {
__publicField(this, "signal", new AS());
warnACPolyfill();
}
abort(reason) {
var _a5, _b2;
if (this.signal.aborted)
return;
this.signal.reason = reason;
this.signal.aborted = true;
for (const fn of this.signal._onabort) {
fn(reason);
}
(_b2 = (_a5 = this.signal).onabort) == null ? void 0 : _b2.call(_a5, reason);
}
};
let printACPolyfillWarning = ((_a3 = PROCESS.env) == null ? void 0 : _a3.LRU_CACHE_IGNORE_AC_WARNING) !== "1";
const warnACPolyfill = () => {
if (!printACPolyfillWarning)
return;
printACPolyfillWarning = false;
emitWarning("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", warnACPolyfill);
};
}
var shouldWarn = (code) => !warned.has(code);
var TYPE = Symbol("type");
var isPosInt = (n2) => n2 && n2 === Math.floor(n2) && n2 > 0 && isFinite(n2);
var getUintArray = (max) => !isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray : null;
var ZeroArray = class extends Array {
constructor(size) {
super(size);
this.fill(0);
}
};
var _constructing;
var _Stack = class _Stack {
constructor(max, HeapCls) {
__publicField(this, "heap");
__publicField(this, "length");
if (!__privateGet(_Stack, _constructing)) {
throw new TypeError("instantiate Stack using Stack.create(n)");
}
this.heap = new HeapCls(max);
this.length = 0;
}
static create(max) {
const HeapCls = getUintArray(max);
if (!HeapCls)
return [];
__privateSet(_Stack, _constructing, true);
const s = new _Stack(max, HeapCls);
__privateSet(_Stack, _constructing, false);
return s;
}
push(n2) {
this.heap[this.length++] = n2;
}
pop() {
return this.heap[--this.length];
}
};
_constructing = new WeakMap();
// private constructor
__privateAdd(_Stack, _constructing, false);
var Stack = _Stack;
var _a4, _b, _max, _maxSize, _dispose, _disposeAfter, _fetchMethod, _memoMethod, _size, _calculatedSize, _keyMap, _keyList, _valList, _next, _prev, _head, _tail, _free, _disposed, _sizes, _starts, _ttls, _hasDispose, _hasFetchMethod, _hasDisposeAfter, _LRUCache_instances, initializeTTLTracking_fn, _updateItemAge, _statusTTL, _setItemTTL, _isStale, initializeSizeTracking_fn, _removeItemSize, _addItemSize, _requireSize, indexes_fn, rindexes_fn, isValidIndex_fn, evict_fn, backgroundFetch_fn, isBackgroundFetch_fn, connect_fn, moveToTail_fn, delete_fn, clear_fn;
var _LRUCache = class _LRUCache {
constructor(options) {
__privateAdd(this, _LRUCache_instances);
// options that cannot be changed without disaster
__privateAdd(this, _max);
__privateAdd(this, _maxSize);
__privateAdd(this, _dispose);
__privateAdd(this, _disposeAfter);
__privateAdd(this, _fetchMethod);
__privateAdd(this, _memoMethod);
/**
* {@link LRUCache.OptionsBase.ttl}
*/
__publicField(this, "ttl");
/**
* {@link LRUCache.OptionsBase.ttlResolution}
*/
__publicField(this, "ttlResolution");
/**
* {@link LRUCache.OptionsBase.ttlAutopurge}
*/
__publicField(this, "ttlAutopurge");
/**
* {@link LRUCache.OptionsBase.updateAgeOnGet}
*/
__publicField(this, "updateAgeOnGet");
/**
* {@link LRUCache.OptionsBase.updateAgeOnHas}
*/
__publicField(this, "updateAgeOnHas");
/**
* {@link LRUCache.OptionsBase.allowStale}
*/
__publicField(this, "allowStale");
/**
* {@link LRUCache.OptionsBase.noDisposeOnSet}
*/
__publicField(this, "noDisposeOnSet");
/**
* {@link LRUCache.OptionsBase.noUpdateTTL}
*/
__publicField(this, "noUpdateTTL");
/**
* {@link LRUCache.OptionsBase.maxEntrySize}
*/
__publicField(this, "maxEntrySize");
/**
* {@link LRUCache.OptionsBase.sizeCalculation}
*/
__publicField(this, "sizeCalculation");
/**
* {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}
*/
__publicField(this, "noDeleteOnFetchRejection");
/**
* {@link LRUCache.OptionsBase.noDeleteOnStaleGet}
*/
__publicField(this, "noDeleteOnStaleGet");
/**
* {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}
*/
__publicField(this, "allowStaleOnFetchAbort");
/**
* {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}
*/
__publicField(this, "allowStaleOnFetchRejection");
/**
* {@link LRUCache.OptionsBase.ignoreFetchAbort}
*/
__publicField(this, "ignoreFetchAbort");
// computed properties
__privateAdd(this, _size);
__privateAdd(this, _calculatedSize);
__privateAdd(this, _keyMap);
__privateAdd(this, _keyList);
__privateAdd(this, _valList);
__privateAdd(this, _next);
__privateAdd(this, _prev);
__privateAdd(this, _head);
__privateAdd(this, _tail);
__privateAdd(this, _free);
__privateAdd(this, _disposed);
__privateAdd(this, _sizes);
__privateAdd(this, _starts);
__privateAdd(this, _ttls);
__privateAdd(this, _hasDispose);
__privateAdd(this, _hasFetchMethod);
__privateAdd(this, _hasDisposeAfter);
// conditionally set private methods related to TTL
__privateAdd(this, _updateItemAge, () => {
});
__privateAdd(this, _statusTTL, () => {
});
__privateAdd(this, _setItemTTL, () => {
});
/* c8 ignore stop */
__privateAdd(this, _isStale, () => false);
__privateAdd(this, _removeItemSize, (_i) => {
});
__privateAdd(this, _addItemSize, (_i, _s, _st) => {
});
__privateAdd(this, _requireSize, (_k, _v, size, sizeCalculation) => {
if (size || sizeCalculation) {
throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
}
return 0;
});
/**
* A String value that is used in the creation of the default string
* description of an object. Called by the built-in method
* `Object.prototype.toString`.
*/
__publicField(this, _a4, "LRUCache");
const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options;
if (max !== 0 && !isPosInt(max)) {
throw new TypeError("max option must be a nonnegative integer");
}
const UintArray = max ? getUintArray(max) : Array;
if (!UintArray) {
throw new Error("invalid max value: " + max);
}
__privateSet(this, _max, max);
__privateSet(this, _maxSize, maxSize);
this.maxEntrySize = maxEntrySize || __privateGet(this, _maxSize);
this.sizeCalculation = sizeCalculation;
if (this.sizeCalculation) {
if (!__privateGet(this, _maxSize) && !this.maxEntrySize) {
throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
}
if (typeof this.sizeCalculation !== "function") {
throw new TypeError("sizeCalculation set to non-function");
}
}
if (memoMethod !== void 0 && typeof memoMethod !== "function") {
throw new TypeError("memoMethod must be a function if defined");
}
__privateSet(this, _memoMethod, memoMethod);
if (fetchMethod !== void 0 && typeof fetchMethod !== "function") {
throw new TypeError("fetchMethod must be a function if specified");
}
__privateSet(this, _fetchMethod, fetchMethod);
__privateSet(this, _hasFetchMethod, !!fetchMethod);
__privateSet(this, _keyMap, /* @__PURE__ */ new Map());
__privateSet(this, _keyList, new Array(max).fill(void 0));
__privateSet(this, _valList, new Array(max).fill(void 0));
__privateSet(this, _next, new UintArray(max));
__privateSet(this, _prev, new UintArray(max));
__privateSet(this, _head, 0);
__privateSet(this, _tail, 0);
__privateSet(this, _free, Stack.create(max));
__privateSet(this, _size, 0);
__privateSet(this, _calculatedSize, 0);
if (typeof dispose === "function") {
__privateSet(this, _dispose, dispose);
}
if (typeof disposeAfter === "function") {
__privateSet(this, _disposeAfter, disposeAfter);
__privateSet(this, _disposed, []);
} else {
__privateSet(this, _disposeAfter, void 0);
__privateSet(this, _disposed, void 0);
}
__privateSet(this, _hasDispose, !!__privateGet(this, _dispose));
__privateSet(this, _hasDisposeAfter, !!__privateGet(this, _disposeAfter));
this.noDisposeOnSet = !!noDisposeOnSet;
this.noUpdateTTL = !!noUpdateTTL;
this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
this.ignoreFetchAbort = !!ignoreFetchAbort;
if (this.maxEntrySize !== 0) {
if (__privateGet(this, _maxSize) !== 0) {
if (!isPosInt(__privateGet(this, _maxSize))) {
throw new TypeError("maxSize must be a positive integer if specified");
}
}
if (!isPosInt(this.maxEntrySize)) {
throw new TypeError("maxEntrySize must be a positive integer if specified");
}
__privateMethod(this, _LRUCache_instances, initializeSizeTracking_fn).call(this);
}
this.allowStale = !!allowStale;
this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
this.updateAgeOnGet = !!updateAgeOnGet;
this.updateAgeOnHas = !!updateAgeOnHas;
this.ttlResolution = isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1;
this.ttlAutopurge = !!ttlAutopurge;
this.ttl = ttl || 0;
if (this.ttl) {
if (!isPosInt(this.ttl)) {
throw new TypeError("ttl must be a positive integer if specified");
}
__privateMethod(this, _LRUCache_instances, initializeTTLTracking_fn).call(this);
}
if (__privateGet(this, _max) === 0 && this.ttl === 0 && __privateGet(this, _maxSize) === 0) {
throw new TypeError("At least one of max, maxSize, or ttl is required");
}
if (!this.ttlAutopurge && !__privateGet(this, _max) && !__privateGet(this, _maxSize)) {
const code = "LRU_CACHE_UNBOUNDED";
if (shouldWarn(code)) {
warned.add(code);
const msg = "TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.";
emitWarning(msg, "UnboundedCacheWarning", code, _LRUCache);
}
}
}
/**
* Do not call this method unless you need to inspect the
* inner workings of the cache. If anything returned by this
* object is modified in any way, strange breakage may occur.
*
* These fields are private for a reason!
*
* @internal
*/
static unsafeExposeInternals(c) {
return {
// properties
starts: __privateGet(c, _starts),
ttls: __privateGet(c, _ttls),
sizes: __privateGet(c, _sizes),
keyMap: __privateGet(c, _keyMap),
keyList: __privateGet(c, _keyList),
valList: __privateGet(c, _valList),
next: __privateGet(c, _next),
prev: __privateGet(c, _prev),
get head() {
return __privateGet(c, _head);
},
get tail() {
return __privateGet(c, _tail);
},
free: __privateGet(c, _free),
// methods
isBackgroundFetch: (p) => {
var _a5;
return __privateMethod(_a5 = c, _LRUCache_instances, isBackgroundFetch_fn).call(_a5, p);
},
backgroundFetch: (k, index, options, context) => {
var _a5;
return __privateMethod(_a5 = c, _LRUCache_instances, backgroundFetch_fn).call(_a5, k, index, options, context);
},
moveToTail: (index) => {
var _a5;
return __privateMethod(_a5 = c, _LRUCache_instances, moveToTail_fn).call(_a5, index);
},
indexes: (options) => {
var _a5;
return __privateMethod(_a5 = c, _LRUCache_instances, indexes_fn).call(_a5, options);
},
rindexes: (options) => {
var _a5;
return __privateMethod(_a5 = c, _LRUCache_instances, rindexes_fn).call(_a5, options);
},
isStale: (index) => {
var _a5;
return __privateGet(_a5 = c, _isStale).call(_a5, index);
}
};
}
// Protected read-only members
/**
* {@link LRUCache.OptionsBase.max} (read-only)
*/
get max() {
return __privateGet(this, _max);
}
/**
* {@link LRUCache.OptionsBase.maxSize} (read-only)
*/
get maxSize() {
return __privateGet(this, _maxSize);
}
/**
* The total computed size of items in the cache (read-only)
*/
get calculatedSize() {
return __privateGet(this, _calculatedSize);
}
/**
* The number of items stored in the cache (read-only)
*/
get size() {
return __privateGet(this, _size);
}
/**
* {@link LRUCache.OptionsBase.fetchMethod} (read-only)
*/
get fetchMethod() {
return __privateGet(this, _fetchMethod);
}
get memoMethod() {
return __privateGet(this, _memoMethod);
}
/**
* {@link LRUCache.OptionsBase.dispose} (read-only)
*/
get dispose() {
return __privateGet(this, _dispose);
}
/**
* {@link LRUCache.OptionsBase.disposeAfter} (read-only)
*/
get disposeAfter() {
return __privateGet(this, _disposeAfter);
}
/**
* Return the number of ms left in the item's TTL. If item is not in cache,
* returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
*/
getRemainingTTL(key) {
return __privateGet(this, _keyMap).has(key) ? Infinity : 0;
}
/**
* Return a generator yielding `[key, value]` pairs,
* in order from most recently used to least recently used.
*/
*entries() {
for (const i2 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) {
if (__privateGet(this, _valList)[i2] !== void 0 && __privateGet(this, _keyList)[i2] !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i2])) {
yield [__privateGet(this, _keyList)[i2], __privateGet(this, _valList)[i2]];
}
}
}
/**
* Inverse order version of {@link LRUCache.entries}
*
* Return a generator yielding `[key, value]` pairs,
* in order from least recently used to most recently used.
*/
*rentries() {
for (const i2 of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this)) {
if (__privateGet(this, _valList)[i2] !== void 0 && __privateGet(this, _keyList)[i2] !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i2])) {
yield [__privateGet(this, _keyList)[i2], __privateGet(this, _valList)[i2]];
}
}
}
/**
* Return a generator yielding the keys in the cache,
* in order from most recently used to least recently used.
*/
*keys() {
for (const i2 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) {
const k = __privateGet(this, _keyList)[i2];
if (k !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i2])) {
yield k;
}
}
}
/**
* Inverse order version of {@link LRUCache.keys}
*
* Return a generator yielding the keys in the cache,
* in order from least recently used to most recently used.
*/
*rkeys() {
for (const i2 of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this)) {
const k = __privateGet(this, _keyList)[i2];
if (k !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i2])) {
yield k;
}
}
}
/**
* Return a generator yielding the values in the cache,
* in order from most recently used to least recently used.
*/
*values() {
for (const i2 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) {
const v = __privateGet(this, _valList)[i2];
if (v !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i2])) {
yield __privateGet(this, _valList)[i2];
}
}
}
/**
* Inverse order version of {@link LRUCache.values}
*
* Return a generator yielding the values in the cache,
* in order from least recently used to most recently used.
*/
*rvalues() {
for (const i2 of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this)) {
const v = __privateGet(this, _valList)[i2];
if (v !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i2])) {
yield __privateGet(this, _valList)[i2];
}
}
}
/**
* Iterating over the cache itself yields the same results as
* {@link LRUCache.entries}
*/
[(_b = Symbol.iterator, _a4 = Symbol.toStringTag, _b)]() {
return this.entries();
}
/**
* Find a value for which the supplied fn method returns a truthy value,
* similar to `Array.find()`. fn is called as `fn(value, key, cache)`.
*/
find(fn, getOptions = {}) {
for (const i2 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) {
const v = __privateGet(this, _valList)[i2];
const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v;
if (value === void 0)
continue;
if (fn(value, __privateGet(this, _keyList)[i2], this)) {
return this.get(__privateGet(this, _keyList)[i2], getOptions);
}
}
}
/**
* Call the supplied function on each item in the cache, in order from most
* recently used to least recently used.
*
* `fn` is called as `fn(value, key, cache)`.
*
* If `thisp` is provided, function will be called in the `this`-context of
* the provided object, or the cache if no `thisp` object is provided.
*
* Does not update age or recenty of use, or iterate over stale values.
*/
forEach(fn, thisp = this) {
for (const i2 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) {
const v = __privateGet(this, _valList)[i2];
const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v;
if (value === void 0)
continue;
fn.call(thisp, value, __privateGet(this, _keyList)[i2], this);
}
}
/**
* The same as {@link LRUCache.forEach} but items are iterated over in
* reverse order. (ie, less recently used items are iterated over first.)
*/
rforEach(fn, thisp = this) {
for (const i2 of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this)) {
const v = __privateGet(this, _valList)[i2];
const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v;
if (value === void 0)
continue;
fn.call(thisp, value, __privateGet(this, _keyList)[i2], this);
}
}
/**
* Delete any stale entries. Returns true if anything was removed,
* false otherwise.
*/
purgeStale() {
let deleted = false;
for (const i2 of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this, { allowStale: true })) {
if (__privateGet(this, _isStale).call(this, i2)) {
__privateMethod(this, _LRUCache_instances, delete_fn).call(this, __privateGet(this, _keyList)[i2], "expire");
deleted = true;
}
}
return deleted;
}
/**
* Get the extended info about a given entry, to get its value, size, and
* TTL info simultaneously. Returns `undefined` if the key is not present.
*
* Unlike {@link LRUCache#dump}, which is designed to be portable and survive
* serialization, the `start` value is always the current timestamp, and the
* `ttl` is a calculated remaining time to live (negative if expired).
*
* Always returns stale values, if their info is found in the cache, so be
* sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})
* if relevant.
*/
info(key) {
const i2 = __privateGet(this, _keyMap).get(key);
if (i2 === void 0)
return void 0;
const v = __privateGet(this, _valList)[i2];
const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v;
if (value === void 0)
return void 0;
const entry = { value };
if (__privateGet(this, _ttls) && __privateGet(this, _starts)) {
const ttl = __privateGet(this, _ttls)[i2];
const start = __privateGet(this, _starts)[i2];
if (ttl && start) {
const remain = ttl - (perf.now() - start);
entry.ttl = remain;
entry.start = Date.now();
}
}
if (__privateGet(this, _sizes)) {
entry.size = __privateGet(this, _sizes)[i2];
}
return entry;
}
/**
* Return an array of [key, {@link LRUCache.Entry}] tuples which can be
* passed to {@link LRUCache#load}.
*
* The `start` fields are calculated relative to a portable `Date.now()`
* timestamp, even if `performance.now()` is available.
*
* Stale entries are always included in the `dump`, even if
* {@link LRUCache.OptionsBase.allowStale} is false.
*
* Note: this returns an actual array, not a generator, so it can be more
* easily passed around.
*/
dump() {
const arr = [];
for (const i2 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this, { allowStale: true })) {
const key = __privateGet(this, _keyList)[i2];
const v = __privateGet(this, _valList)[i2];
const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v;
if (value === void 0 || key === void 0)
continue;
const entry = { value };
if (__privateGet(this, _ttls) && __privateGet(this, _starts)) {
entry.ttl = __privateGet(this, _ttls)[i2];
const age = perf.now() - __privateGet(this, _starts)[i2];
entry.start = Math.floor(Date.now() - age);
}
if (__privateGet(this, _sizes)) {
entry.size = __privateGet(this, _sizes)[i2];
}
arr.unshift([key, entry]);
}
return arr;
}
/**
* Reset the cache and load in the items in entries in the order listed.
*
* The shape of the resulting cache may be different if the same options are
* not used in both caches.
*
* The `start` fields are assumed to be calculated relative to a portable
* `Date.now()` timestamp, even if `performance.now()` is available.
*/
load(arr) {
this.clear();
for (const [key, entry] of arr) {
if (entry.start) {
const age = Date.now() - entry.start;
entry.start = perf.now() - age;
}
this.set(key, entry.value, entry);
}
}
/**
* Add a value to the cache.
*
* Note: if `undefined` is specified as a value, this is an alias for
* {@link LRUCache#delete}
*
* Fields on the {@link LRUCache.SetOptions} options param will override
* their corresponding values in the constructor options for the scope
* of this single `set()` operation.
*
* If `start` is provided, then that will set the effective start
* time for the TTL calculation. Note that this must be a previous
* value of `performance.now()` if supported, or a previous value of
* `Date.now()` if not.
*
* Options object may also include `size`, which will prevent
* calling the `sizeCalculation` function and just use the specified
* number if it is a positive integer, and `noDisposeOnSet` which
* will prevent calling a `dispose` function in the case of
* overwrites.
*
* If the `size` (or return value of `sizeCalculation`) for a given
* entry is greater than `maxEntrySize`, then the item will not be
* added to the cache.
*
* Will update the recency of the entry.
*
* If the value is `undefined`, then this is an alias for
* `cache.delete(key)`. `undefined` is never stored in the cache.
*/
set(k, v, setOptions = {}) {
var _a5, _b2, _c, _d, _e;
if (v === void 0) {
this.delete(k);
return this;
}
const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status } = setOptions;
let { noUpdateTTL = this.noUpdateTTL } = setOptions;
const size = __privateGet(this, _requireSize).call(this, k, v, setOptions.size || 0, sizeCalculation);
if (this.maxEntrySize && size > this.maxEntrySize) {
if (status) {
status.set = "miss";
status.maxEntrySizeExceeded = true;
}
__privateMethod(this, _LRUCache_instances, delete_fn).call(this, k, "set");
return this;
}
let index = __privateGet(this, _size) === 0 ? void 0 : __privateGet(this, _keyMap).get(k);
if (index === void 0) {
index = __privateGet(this, _size) === 0 ? __privateGet(this, _tail) : __privateGet(this, _free).length !== 0 ? __privateGet(this, _free).pop() : __privateGet(this, _size) === __privateGet(this, _max) ? __privateMethod(this, _LRUCache_instances, evict_fn).call(this, false) : __privateGet(this, _size);
__privateGet(this, _keyList)[index] = k;
__privateGet(this, _valList)[index] = v;
__privateGet(this, _keyMap).set(k, index);
__privateGet(this, _next)[__privateGet(this, _tail)] = index;
__privateGet(this, _prev)[index] = __privateGet(this, _tail);
__privateSet(this, _tail, index);
__privateWrapper(this, _size)._++;
__privateGet(this, _addItemSize).call(this, index, size, status);
if (status)
status.set = "add";
noUpdateTTL = false;
} else {
__privateMethod(this, _LRUCache_instances, moveToTail_fn).call(this, index);
const oldVal = __privateGet(this, _valList)[index];
if (v !== oldVal) {
if (__privateGet(this, _hasFetchMethod) && __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, oldVal)) {
oldVal.__abortController.abort(new Error("replaced"));
const { __staleWhileFetching: s } = oldVal;
if (s !== void 0 && !noDisposeOnSet) {
if (__privateGet(this, _hasDispose)) {
(_a5 = __privateGet(this, _dispose)) == null ? void 0 : _a5.call(this, s, k, "set");
}
if (__privateGet(this, _hasDisposeAfter)) {
(_b2 = __privateGet(this, _disposed)) == null ? void 0 : _b2.push([s, k, "set"]);
}
}
} else if (!noDisposeOnSet) {
if (__privateGet(this, _hasDispose)) {
(_c = __privateGet(this, _dispose)) == null ? void 0 : _c.call(this, oldVal, k, "set");
}
if (__privateGet(this, _hasDisposeAfter)) {
(_d = __privateGet(this, _disposed)) == null ? void 0 : _d.push([oldVal, k, "set"]);
}
}
__privateGet(this, _removeItemSize).call(this, index);
__privateGet(this, _addItemSize).call(this, index, size, status);
__privateGet(this, _valList)[index] = v;
if (status) {
status.set = "replace";
const oldValue = oldVal && __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, oldVal) ? oldVal.__staleWhileFetching : oldVal;
if (oldValue !== void 0)
status.oldValue = oldValue;
}
} else if (status) {
status.set = "update";
}
}
if (ttl !== 0 && !__privateGet(this, _ttls)) {
__privateMethod(this, _LRUCache_instances, initializeTTLTracking_fn).call(this);
}
if (__privateGet(this, _ttls)) {
if (!noUpdateTTL) {
__privateGet(this, _setItemTTL).call(this, index, ttl, start);
}
if (status)
__privateGet(this, _statusTTL).call(this, status, index);
}
if (!noDisposeOnSet && __privateGet(this, _hasDisposeAfter) && __privateGet(this, _disposed)) {
const dt = __privateGet(this, _disposed);
let task;
while (task = dt == null ? void 0 : dt.shift()) {
(_e = __privateGet(this, _disposeAfter)) == null ? void 0 : _e.call(this, ...task);
}
}
return this;
}
/**
* Evict the least recently used item, returning its value or
* `undefined` if cache is empty.
*/
pop() {
var _a5;
try {
while (__privateGet(this, _size)) {
const val = __privateGet(this, _valList)[__privateGet(this, _head)];
__privateMethod(this, _LRUCache_instances, evict_fn).call(this, true);
if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, val)) {
if (val.__staleWhileFetching) {
return val.__staleWhileFetching;
}
} else if (val !== void 0) {
return val;
}
}
} finally {
if (__privateGet(this, _hasDisposeAfter) && __privateGet(this, _disposed)) {
const dt = __privateGet(this, _disposed);
let task;
while (task = dt == null ? void 0 : dt.shift()) {
(_a5 = __privateGet(this, _disposeAfter)) == null ? void 0 : _a5.call(this, ...task);
}
}
}
}
/**
* Check if a key is in the cache, without updating the recency of use.
* Will return false if the item is stale, even though it is technically
* in the cache.
*
* Check if a key is in the cache, without updating the recency of
* use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set
* to `true` in either the options or the constructor.
*
* Will return `false` if the item is stale, even though it is technically in
* the cache. The difference can be determined (if it matters) by using a
* `status` argument, and inspecting the `has` field.
*
* Will not update item age unless
* {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
*/
has(k, hasOptions = {}) {
const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;
const index = __privateGet(this, _keyMap).get(k);
if (index !== void 0) {
const v = __privateGet(this, _valList)[index];
if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) && v.__staleWhileFetching === void 0) {
return false;
}
if (!__privateGet(this, _isStale).call(this, index)) {
if (updateAgeOnHas) {
__privateGet(this, _updateItemAge).call(this, index);
}
if (status) {
status.has = "hit";
__privateGet(this, _statusTTL).call(this, status, index);
}
return true;
} else if (status) {
status.has = "stale";
__privateGet(this, _statusTTL).call(this, status, index);
}
} else if (status) {
status.has = "miss";
}
return false;
}
/**
* Like {@link LRUCache#get} but doesn't update recency or delete stale
* items.
*
* Returns `undefined` if the item is stale, unless
* {@link LRUCache.OptionsBase.allowStale} is set.
*/
peek(k, peekOptions = {}) {
const { allowStale = this.allowStale } = peekOptions;
const index = __privateGet(this, _keyMap).get(k);
if (index === void 0 || !allowStale && __privateGet(this, _isStale).call(this, index)) {
return;
}
const v = __privateGet(this, _valList)[index];
return __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v;
}
async fetch(k, fetchOptions = {}) {
const {
// get options
allowStale = this.allowStale,
updateAgeOnGet = this.updateAgeOnGet,
noDeleteOnStaleGet = this.noDeleteOnStaleGet,
// set options
ttl = this.ttl,
noDisposeOnSet = this.noDisposeOnSet,
size = 0,
sizeCalculation = this.sizeCalculation,
noUpdateTTL = this.noUpdateTTL,
// fetch exclusive options
noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,
allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,
ignoreFetchAbort = this.ignoreFetchAbort,
allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,
context,
forceRefresh = false,
status,
signal
} = fetchOptions;
if (!__privateGet(this, _hasFetchMethod)) {
if (status)
status.fetch = "get";
return this.get(k, {
allowStale,
updateAgeOnGet,
noDeleteOnStaleGet,
status
});
}
const options = {
allowStale,
updateAgeOnGet,
noDeleteOnStaleGet,
ttl,
noDisposeOnSet,
size,
sizeCalculation,
noUpdateTTL,
noDeleteOnFetchRejection,
allowStaleOnFetchRejection,
allowStaleOnFetchAbort,
ignoreFetchAbort,
status,
signal
};
let index = __privateGet(this, _keyMap).get(k);
if (index === void 0) {
if (status)
status.fetch = "miss";
const p = __privateMethod(this, _LRUCache_instances, backgroundFetch_fn).call(this, k, index, options, context);
return p.__returned = p;
} else {
const v = __privateGet(this, _valList)[index];
if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
const stale = allowStale && v.__staleWhileFetching !== void 0;
if (status) {
status.fetch = "inflight";
if (stale)
status.returnedStale = true;
}
return stale ? v.__staleWhileFetching : v.__returned = v;
}
const isStale = __privateGet(this, _isStale).call(this, index);
if (!forceRefresh && !isStale) {
if (status)
status.fetch = "hit";
__privateMethod(this, _LRUCache_instances, moveToTail_fn).call(this, index);
if (updateAgeOnGet) {
__privateGet(this, _updateItemAge).call(this, index);
}
if (status)
__privateGet(this, _statusTTL).call(this, status, index);
return v;
}
const p = __privateMethod(this, _LRUCache_instances, backgroundFetch_fn).call(this, k, index, options, context);
const hasStale = p.__staleWhileFetching !== void 0;
const staleVal = hasStale && allowStale;
if (status) {
status.fetch = isStale ? "stale" : "refresh";
if (staleVal && isStale)
status.returnedStale = true;
}
return staleVal ? p.__staleWhileFetching : p.__returned = p;
}
}
async forceFetch(k, fetchOptions = {}) {
const v = await this.fetch(k, fetchOptions);
if (v === void 0)
throw new Error("fetch() returned undefined");
return v;
}
memo(k, memoOptions = {}) {
const memoMethod = __privateGet(this, _memoMethod);
if (!memoMethod) {
throw new Error("no memoMethod provided to constructor");
}
const { context, forceRefresh, ...options } = memoOptions;
const v = this.get(k, options);
if (!forceRefresh && v !== void 0)
return v;
const vv = memoMethod(k, v, {
options,
context
});
this.set(k, vv, options);
return vv;
}
/**
* Return a value from the cache. Will update the recency of the cache
* entry found.
*
* If the key is not found, get() will return `undefined`.
*/
get(k, getOptions = {}) {
const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status } = getOptions;
const index = __privateGet(this, _keyMap).get(k);
if (index !== void 0) {
const value = __privateGet(this, _valList)[index];
const fetching = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, value);
if (status)
__privateGet(this, _statusTTL).call(this, status, index);
if (__privateGet(this, _isStale).call(this, index)) {
if (status)
status.get = "stale";
if (!fetching) {
if (!noDeleteOnStaleGet) {
__privateMethod(this, _LRUCache_instances, delete_fn).call(this, k, "expire");
}
if (status && allowStale)
status.returnedStale = true;
return allowStale ? value : void 0;
} else {
if (status && allowStale && value.__staleWhileFetching !== void 0) {
status.returnedStale = true;
}
return allowStale ? value.__staleWhileFetching : void 0;
}
} else {
if (status)
status.get = "hit";
if (fetching) {
return value.__staleWhileFetching;
}
__privateMethod(this, _LRUCache_instances, moveToTail_fn).call(this, index);
if (updateAgeOnGet) {
__privateGet(this, _updateItemAge).call(this, index);
}
return value;
}
} else if (status) {
status.get = "miss";
}
}
/**
* Deletes a key out of the cache.
*
* Returns true if the key was deleted, false otherwise.
*/
delete(k) {
return __privateMethod(this, _LRUCache_instances, delete_fn).call(this, k, "delete");
}
/**
* Clear the cache entirely, throwing away all values.
*/
clear() {
return __privateMethod(this, _LRUCache_instances, clear_fn).call(this, "delete");
}
};
_max = new WeakMap();
_maxSize = new WeakMap();
_dispose = new WeakMap();
_disposeAfter = new WeakMap();
_fetchMethod = new WeakMap();
_memoMethod = new WeakMap();
_size = new WeakMap();
_calculatedSize = new WeakMap();
_keyMap = new WeakMap();
_keyList = new WeakMap();
_valList = new WeakMap();
_next = new WeakMap();
_prev = new WeakMap();
_head = new WeakMap();
_tail = new WeakMap();
_free = new WeakMap();
_disposed = new WeakMap();
_sizes = new WeakMap();
_starts = new WeakMap();
_ttls = new WeakMap();
_hasDispose = new WeakMap();
_hasFetchMethod = new WeakMap();
_hasDisposeAfter = new WeakMap();
_LRUCache_instances = new WeakSet();
initializeTTLTracking_fn = function() {
const ttls = new ZeroArray(__privateGet(this, _max));
const starts = new ZeroArray(__privateGet(this, _max));
__privateSet(this, _ttls, ttls);
__privateSet(this, _starts, starts);
__privateSet(this, _setItemTTL, (index, ttl, start = perf.now()) => {
starts[index] = ttl !== 0 ? start : 0;
ttls[index] = ttl;
if (ttl !== 0 && this.ttlAutopurge) {
const t2 = setTimeout(() => {
if (__privateGet(this, _isStale).call(this, index)) {
__privateMethod(this, _LRUCache_instances, delete_fn).call(this, __privateGet(this, _keyList)[index], "expire");
}
}, ttl + 1);
if (t2.unref) {
t2.unref();
}
}
});
__privateSet(this, _updateItemAge, (index) => {
starts[index] = ttls[index] !== 0 ? perf.now() : 0;
});
__privateSet(this, _statusTTL, (status, index) => {
if (ttls[index]) {
const ttl = ttls[index];
const start = starts[index];
if (!ttl || !start)
return;
status.ttl = ttl;
status.start = start;
status.now = cachedNow || getNow();
const age = status.now - start;
status.remainingTTL = ttl - age;
}
});
let cachedNow = 0;
const getNow = () => {
const n2 = perf.now();
if (this.ttlResolution > 0) {
cachedNow = n2;
const t2 = setTimeout(() => cachedNow = 0, this.ttlResolution);
if (t2.unref) {
t2.unref();
}
}
return n2;
};
this.getRemainingTTL = (key) => {
const index = __privateGet(this, _keyMap).get(key);
if (index === void 0) {
return 0;
}
const ttl = ttls[index];
const start = starts[index];
if (!ttl || !start) {
return Infinity;
}
const age = (cachedNow || getNow()) - start;
return ttl - age;
};
__privateSet(this, _isStale, (index) => {
const s = starts[index];
const t2 = ttls[index];
return !!t2 && !!s && (cachedNow || getNow()) - s > t2;
});
};
_updateItemAge = new WeakMap();
_statusTTL = new WeakMap();
_setItemTTL = new WeakMap();
_isStale = new WeakMap();
initializeSizeTracking_fn = function() {
const sizes = new ZeroArray(__privateGet(this, _max));
__privateSet(this, _calculatedSize, 0);
__privateSet(this, _sizes, sizes);
__privateSet(this, _removeItemSize, (index) => {
__privateSet(this, _calculatedSize, __privateGet(this, _calculatedSize) - sizes[index]);
sizes[index] = 0;
});
__privateSet(this, _requireSize, (k, v, size, sizeCalculation) => {
if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
return 0;
}
if (!isPosInt(size)) {
if (sizeCalculation) {
if (typeof sizeCalculation !== "function") {
throw new TypeError("sizeCalculation must be a function");
}
size = sizeCalculation(v, k);
if (!isPosInt(size)) {
throw new TypeError("sizeCalculation return invalid (expect positive integer)");
}
} else {
throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
}
}
return size;
});
__privateSet(this, _addItemSize, (index, size, status) => {
sizes[index] = size;
if (__privateGet(this, _maxSize)) {
const maxSize = __privateGet(this, _maxSize) - sizes[index];
while (__privateGet(this, _calculatedSize) > maxSize) {
__privateMethod(this, _LRUCache_instances, evict_fn).call(this, true);
}
}
__privateSet(this, _calculatedSize, __privateGet(this, _calculatedSize) + sizes[index]);
if (status) {
status.entrySize = size;
status.totalCalculatedSize = __privateGet(this, _calculatedSize);
}
});
};
_removeItemSize = new WeakMap();
_addItemSize = new WeakMap();
_requireSize = new WeakMap();
indexes_fn = function* ({ allowStale = this.allowStale } = {}) {
if (__privateGet(this, _size)) {
for (let i2 = __privateGet(this, _tail); true; ) {
if (!__privateMethod(this, _LRUCache_instances, isValidIndex_fn).call(this, i2)) {
break;
}
if (allowStale || !__privateGet(this, _isStale).call(this, i2)) {
yield i2;
}
if (i2 === __privateGet(this, _head)) {
break;
} else {
i2 = __privateGet(this, _prev)[i2];
}
}
}
};
rindexes_fn = function* ({ allowStale = this.allowStale } = {}) {
if (__privateGet(this, _size)) {
for (let i2 = __privateGet(this, _head); true; ) {
if (!__privateMethod(this, _LRUCache_instances, isValidIndex_fn).call(this, i2)) {
break;
}
if (allowStale || !__privateGet(this, _isStale).call(this, i2)) {
yield i2;
}
if (i2 === __privateGet(this, _tail)) {
break;
} else {
i2 = __privateGet(this, _next)[i2];
}
}
}
};
isValidIndex_fn = function(index) {
return index !== void 0 && __privateGet(this, _keyMap).get(__privateGet(this, _keyList)[index]) === index;
};
evict_fn = function(free) {
var _a5, _b2;
const head = __privateGet(this, _head);
const k = __privateGet(this, _keyList)[head];
const v = __privateGet(this, _valList)[head];
if (__privateGet(this, _hasFetchMethod) && __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
v.__abortController.abort(new Error("evicted"));
} else if (__privateGet(this, _hasDispose) || __privateGet(this, _hasDisposeAfter)) {
if (__privateGet(this, _hasDispose)) {
(_a5 = __privateGet(this, _dispose)) == null ? void 0 : _a5.call(this, v, k, "evict");
}
if (__privateGet(this, _hasDisposeAfter)) {
(_b2 = __privateGet(this, _disposed)) == null ? void 0 : _b2.push([v, k, "evict"]);
}
}
__privateGet(this, _removeItemSize).call(this, head);
if (free) {
__privateGet(this, _keyList)[head] = void 0;
__privateGet(this, _valList)[head] = void 0;
__privateGet(this, _free).push(head);
}
if (__privateGet(this, _size) === 1) {
__privateSet(this, _head, __privateSet(this, _tail, 0));
__privateGet(this, _free).length = 0;
} else {
__privateSet(this, _head, __privateGet(this, _next)[head]);
}
__privateGet(this, _keyMap).delete(k);
__privateWrapper(this, _size)._--;
return head;
};
backgroundFetch_fn = function(k, index, options, context) {
const v = index === void 0 ? void 0 : __privateGet(this, _valList)[index];
if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
return v;
}
const ac = new AC();
const { signal } = options;
signal == null ? void 0 : signal.addEventListener("abort", () => ac.abort(signal.reason), {
signal: ac.signal
});
const fetchOpts = {
signal: ac.signal,
options,
context
};
const cb = (v2, updateCache = false) => {
const { aborted } = ac.signal;
const ignoreAbort = options.ignoreFetchAbort && v2 !== void 0;
if (options.status) {
if (aborted && !updateCache) {
options.status.fetchAborted = true;
options.status.fetchError = ac.signal.reason;
if (ignoreAbort)
options.status.fetchAbortIgnored = true;
} else {
options.status.fetchResolved = true;
}
}
if (aborted && !ignoreAbort && !updateCache) {
return fetchFail(ac.signal.reason);
}
const bf2 = p;
if (__privateGet(this, _valList)[index] === p) {
if (v2 === void 0) {
if (bf2.__staleWhileFetching) {
__privateGet(this, _valList)[index] = bf2.__staleWhileFetching;
} else {
__privateMethod(this, _LRUCache_instances, delete_fn).call(this, k, "fetch");
}
} else {
if (options.status)
options.status.fetchUpdated = true;
this.set(k, v2, fetchOpts.options);
}
}
return v2;
};
const eb = (er) => {
if (options.status) {
options.status.fetchRejected = true;
options.status.fetchError = er;
}
return fetchFail(er);
};
const fetchFail = (er) => {
const { aborted } = ac.signal;
const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
const noDelete = allowStale || options.noDeleteOnFetchRejection;
const bf2 = p;
if (__privateGet(this, _valList)[index] === p) {
const del = !noDelete || bf2.__staleWhileFetching === void 0;
if (del) {
__privateMethod(this, _LRUCache_instances, delete_fn).call(this, k, "fetch");
} else if (!allowStaleAborted) {
__privateGet(this, _valList)[index] = bf2.__staleWhileFetching;
}
}
if (allowStale) {
if (options.status && bf2.__staleWhileFetching !== void 0) {
options.status.returnedStale = true;
}
return bf2.__staleWhileFetching;
} else if (bf2.__returned === bf2) {
throw er;
}
};
const pcall = (res, rej) => {
var _a5;
const fmp = (_a5 = __privateGet(this, _fetchMethod)) == null ? void 0 : _a5.call(this, k, v, fetchOpts);
if (fmp && fmp instanceof Promise) {
fmp.then((v2) => res(v2 === void 0 ? void 0 : v2), rej);
}
ac.signal.addEventListener("abort", () => {
if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {
res(void 0);
if (options.allowStaleOnFetchAbort) {
res = (v2) => cb(v2, true);
}
}
});
};
if (options.status)
options.status.fetchDispatched = true;
const p = new Promise(pcall).then(cb, eb);
const bf = Object.assign(p, {
__abortController: ac,
__staleWhileFetching: v,
__returned: void 0
});
if (index === void 0) {
this.set(k, bf, { ...fetchOpts.options, status: void 0 });
index = __privateGet(this, _keyMap).get(k);
} else {
__privateGet(this, _valList)[index] = bf;
}
return bf;
};
isBackgroundFetch_fn = function(p) {
if (!__privateGet(this, _hasFetchMethod))
return false;
const b = p;
return !!b && b instanceof Promise && b.hasOwnProperty("__staleWhileFetching") && b.__abortController instanceof AC;
};
connect_fn = function(p, n2) {
__privateGet(this, _prev)[n2] = p;
__privateGet(this, _next)[p] = n2;
};
moveToTail_fn = function(index) {
if (index !== __privateGet(this, _tail)) {
if (index === __privateGet(this, _head)) {
__privateSet(this, _head, __privateGet(this, _next)[index]);
} else {
__privateMethod(this, _LRUCache_instances, connect_fn).call(this, __privateGet(this, _prev)[index], __privateGet(this, _next)[index]);
}
__privateMethod(this, _LRUCache_instances, connect_fn).call(this, __privateGet(this, _tail), index);
__privateSet(this, _tail, index);
}
};
delete_fn = function(k, reason) {
var _a5, _b2, _c, _d;
let deleted = false;
if (__privateGet(this, _size) !== 0) {
const index = __privateGet(this, _keyMap).get(k);
if (index !== void 0) {
deleted = true;
if (__privateGet(this, _size) === 1) {
__privateMethod(this, _LRUCache_instances, clear_fn).call(this, reason);
} else {
__privateGet(this, _removeItemSize).call(this, index);
const v = __privateGet(this, _valList)[index];
if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
v.__abortController.abort(new Error("deleted"));
} else if (__privateGet(this, _hasDispose) || __privateGet(this, _hasDisposeAfter)) {
if (__privateGet(this, _hasDispose)) {
(_a5 = __privateGet(this, _dispose)) == null ? void 0 : _a5.call(this, v, k, reason);
}
if (__privateGet(this, _hasDisposeAfter)) {
(_b2 = __privateGet(this, _disposed)) == null ? void 0 : _b2.push([v, k, reason]);
}
}
__privateGet(this, _keyMap).delete(k);
__privateGet(this, _keyList)[index] = void 0;
__privateGet(this, _valList)[index] = void 0;
if (index === __privateGet(this, _tail)) {
__privateSet(this, _tail, __privateGet(this, _prev)[index]);
} else if (index === __privateGet(this, _head)) {
__privateSet(this, _head, __privateGet(this, _next)[index]);
} else {
const pi = __privateGet(this, _prev)[index];
__privateGet(this, _next)[pi] = __privateGet(this, _next)[index];
const ni = __privateGet(this, _next)[index];
__privateGet(this, _prev)[ni] = __privateGet(this, _prev)[index];
}
__privateWrapper(this, _size)._--;
__privateGet(this, _free).push(index);
}
}
}
if (__privateGet(this, _hasDisposeAfter) && ((_c = __privateGet(this, _disposed)) == null ? void 0 : _c.length)) {
const dt = __privateGet(this, _disposed);
let task;
while (task = dt == null ? void 0 : dt.shift()) {
(_d = __privateGet(this, _disposeAfter)) == null ? void 0 : _d.call(this, ...task);
}
}
return deleted;
};
clear_fn = function(reason) {
var _a5, _b2, _c;
for (const index of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this, { allowStale: true })) {
const v = __privateGet(this, _valList)[index];
if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
v.__abortController.abort(new Error("deleted"));
} else {
const k = __privateGet(this, _keyList)[index];
if (__privateGet(this, _hasDispose)) {
(_a5 = __privateGet(this, _dispose)) == null ? void 0 : _a5.call(this, v, k, reason);
}
if (__privateGet(this, _hasDisposeAfter)) {
(_b2 = __privateGet(this, _disposed)) == null ? void 0 : _b2.push([v, k, reason]);
}
}
}
__privateGet(this, _keyMap).clear();
__privateGet(this, _valList).fill(void 0);
__privateGet(this, _keyList).fill(void 0);
if (__privateGet(this, _ttls) && __privateGet(this, _starts)) {
__privateGet(this, _ttls).fill(0);
__privateGet(this, _starts).fill(0);
}
if (__privateGet(this, _sizes)) {
__privateGet(this, _sizes).fill(0);
}
__privateSet(this, _head, 0);
__privateSet(this, _tail, 0);
__privateGet(this, _free).length = 0;
__privateSet(this, _calculatedSize, 0);
__privateSet(this, _size, 0);
if (__privateGet(this, _hasDisposeAfter) && __privateGet(this, _disposed)) {
const dt = __privateGet(this, _disposed);
let task;
while (task = dt == null ? void 0 : dt.shift()) {
(_c = __privateGet(this, _disposeAfter)) == null ? void 0 : _c.call(this, ...task);
}
}
};
var LRUCache = _LRUCache;
exports.LRUCache = LRUCache;
}
});
// node_modules/.pnpm/@octokit+auth-app@6.1.3/node_modules/@octokit/auth-app/dist-node/index.js
var require_dist_node = __commonJS({
"node_modules/.pnpm/@octokit+auth-app@6.1.3/node_modules/@octokit/auth-app/dist-node/index.js"(exports, module) {
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export2 = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS2 = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var dist_src_exports2 = {};
__export2(dist_src_exports2, {
createAppAuth: () => createAppAuth4,
createOAuthUserAuth: () => import_auth_oauth_user22.createOAuthUserAuth
});
module.exports = __toCommonJS2(dist_src_exports2);
var import_universal_user_agent8 = (init_dist_web(), __toCommonJS(dist_web_exports));
var import_request18 = (init_dist_web5(), __toCommonJS(dist_web_exports4));
var import_auth_oauth_app = (init_dist_web12(), __toCommonJS(dist_web_exports7));
var import_deprecation2 = (init_dist_web3(), __toCommonJS(dist_web_exports2));
var OAuthAppAuth = __toESM2((init_dist_web12(), __toCommonJS(dist_web_exports7)));
var import_universal_github_app_jwt = (init_index_bundled(), __toCommonJS(index_bundled_exports));
async function getAppAuthentication({
appId,
privateKey,
timeDifference
}) {
try {
const appAuthentication = await (0, import_universal_github_app_jwt.githubAppJwt)({
id: +appId,
privateKey,
now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference
});
return {
type: "app",
token: appAuthentication.token,
appId: appAuthentication.appId,
expiresAt: new Date(appAuthentication.expiration * 1e3).toISOString()
};
} catch (error) {
if (privateKey === "-----BEGIN RSA PRIVATE KEY-----") {
throw new Error(
"The 'privateKey` option contains only the first line '-----BEGIN RSA PRIVATE KEY-----'. If you are setting it using a `.env` file, make sure it is set on a single line with newlines replaced by '\n'"
);
} else {
throw error;
}
}
}
var import_lru_cache = require_commonjs();
function getCache() {
return new import_lru_cache.LRUCache({
// cache max. 15000 tokens, that will use less than 10mb memory
max: 15e3,
// Cache for 1 minute less than GitHub expiry
ttl: 1e3 * 60 * 59
});
}
async function get2(cache, options) {
const cacheKey = optionsToCacheKey(options);
const result = await cache.get(cacheKey);
if (!result) {
return;
}
const [
token,
createdAt,
expiresAt,
repositorySelection,
permissionsString,
singleFileName
] = result.split("|");
const permissions = options.permissions || permissionsString.split(/,/).reduce((permissions2, string) => {
if (/!$/.test(string)) {
permissions2[string.slice(0, -1)] = "write";
} else {
permissions2[string] = "read";
}
return permissions2;
}, {});
return {
token,
createdAt,
expiresAt,
permissions,
repositoryIds: options.repositoryIds,
repositoryNames: options.repositoryNames,
singleFileName,
repositorySelection
};
}
async function set2(cache, options, data) {
const key = optionsToCacheKey(options);
const permissionsString = options.permissions ? "" : Object.keys(data.permissions).map(
(name) => `${name}${data.permissions[name] === "write" ? "!" : ""}`
).join(",");
const value = [
data.token,
data.createdAt,
data.expiresAt,
data.repositorySelection,
permissionsString,
data.singleFileName
].join("|");
await cache.set(key, value);
}
function optionsToCacheKey({
installationId,
permissions = {},
repositoryIds = [],
repositoryNames = []
}) {
const permissionsString = Object.keys(permissions).sort().map((name) => permissions[name] === "read" ? name : `${name}!`).join(",");
const repositoryIdsString = repositoryIds.sort().join(",");
const repositoryNamesString = repositoryNames.join(",");
return [
installationId,
repositoryIdsString,
repositoryNamesString,
permissionsString
].filter(Boolean).join("|");
}
function toTokenAuthentication({
installationId,
token,
createdAt,
expiresAt,
repositorySelection,
permissions,
repositoryIds,
repositoryNames,
singleFileName
}) {
return Object.assign(
{
type: "token",
tokenType: "installation",
token,
installationId,
permissions,
createdAt,
expiresAt,
repositorySelection
},
repositoryIds ? { repositoryIds } : null,
repositoryNames ? { repositoryNames } : null,
singleFileName ? { singleFileName } : null
);
}
async function getInstallationAuthentication(state, options, customRequest) {
const installationId = Number(options.installationId || state.installationId);
if (!installationId) {
throw new Error(
"[@octokit/auth-app] installationId option is required for installation authentication."
);
}
if (options.factory) {
const { type, factory, oauthApp, ...factoryAuthOptions } = {
...state,
...options
};
return factory(factoryAuthOptions);
}
const optionsWithInstallationTokenFromState = Object.assign(
{ installationId },
options
);
if (!options.refresh) {
const result = await get2(
state.cache,
optionsWithInstallationTokenFromState
);
if (result) {
const {
token: token2,
createdAt: createdAt2,
expiresAt: expiresAt2,
permissions: permissions2,
repositoryIds: repositoryIds2,
repositoryNames: repositoryNames2,
singleFileName: singleFileName2,
repositorySelection: repositorySelection2
} = result;
return toTokenAuthentication({
installationId,
token: token2,
createdAt: createdAt2,
expiresAt: expiresAt2,
permissions: permissions2,
repositorySelection: repositorySelection2,
repositoryIds: repositoryIds2,
repositoryNames: repositoryNames2,
singleFileName: singleFileName2
});
}
}
const appAuthentication = await getAppAuthentication(state);
const request2 = customRequest || state.request;
const {
data: {
token,
expires_at: expiresAt,
repositories,
permissions: permissionsOptional,
repository_selection: repositorySelectionOptional,
single_file: singleFileName
}
} = await request2("POST /app/installations/{installation_id}/access_tokens", {
installation_id: installationId,
repository_ids: options.repositoryIds,
repositories: options.repositoryNames,
permissions: options.permissions,
mediaType: {
previews: ["machine-man"]
},
headers: {
authorization: `bearer ${appAuthentication.token}`
}
});
const permissions = permissionsOptional || {};
const repositorySelection = repositorySelectionOptional || "all";
const repositoryIds = repositories ? repositories.map((r2) => r2.id) : void 0;
const repositoryNames = repositories ? repositories.map((repo) => repo.name) : void 0;
const createdAt = (/* @__PURE__ */ new Date()).toISOString();
await set2(state.cache, optionsWithInstallationTokenFromState, {
token,
createdAt,
expiresAt,
repositorySelection,
permissions,
repositoryIds,
repositoryNames,
singleFileName
});
return toTokenAuthentication({
installationId,
token,
createdAt,
expiresAt,
repositorySelection,
permissions,
repositoryIds,
repositoryNames,
singleFileName
});
}
async function auth6(state, authOptions) {
switch (authOptions.type) {
case "app":
return getAppAuthentication(state);
case "oauth":
state.log.warn(
// @ts-expect-error `log.warn()` expects string
new import_deprecation2.Deprecation(
`[@octokit/auth-app] {type: "oauth"} is deprecated. Use {type: "oauth-app"} instead`
)
);
case "oauth-app":
return state.oauthApp({ type: "oauth-app" });
case "installation":
authOptions;
return getInstallationAuthentication(state, {
...authOptions,
type: "installation"
});
case "oauth-user":
return state.oauthApp(authOptions);
default:
throw new Error(`Invalid auth type: ${authOptions.type}`);
}
}
var import_auth_oauth_user4 = (init_dist_web11(), __toCommonJS(dist_web_exports6));
var import_request_error7 = (init_dist_web4(), __toCommonJS(dist_web_exports3));
var PATHS = [
"/app",
"/app/hook/config",
"/app/hook/deliveries",
"/app/hook/deliveries/{delivery_id}",
"/app/hook/deliveries/{delivery_id}/attempts",
"/app/installations",
"/app/installations/{installation_id}",
"/app/installations/{installation_id}/access_tokens",
"/app/installations/{installation_id}/suspended",
"/app/installation-requests",
"/marketplace_listing/accounts/{account_id}",
"/marketplace_listing/plan",
"/marketplace_listing/plans",
"/marketplace_listing/plans/{plan_id}/accounts",
"/marketplace_listing/stubbed/accounts/{account_id}",
"/marketplace_listing/stubbed/plan",
"/marketplace_listing/stubbed/plans",
"/marketplace_listing/stubbed/plans/{plan_id}/accounts",
"/orgs/{org}/installation",
"/repos/{owner}/{repo}/installation",
"/users/{username}/installation"
];
function routeMatcher2(paths) {
const regexes = paths.map(
(p) => p.split("/").map((c) => c.startsWith("{") ? "(?:.+?)" : c).join("/")
);
const regex2 = `^(?:${regexes.map((r2) => `(?:${r2})`).join("|")})$`;
return new RegExp(regex2, "i");
}
var REGEX = routeMatcher2(PATHS);
function requiresAppAuth(url) {
return !!url && REGEX.test(url.split("?")[0]);
}
var FIVE_SECONDS_IN_MS = 5 * 1e3;
function isNotTimeSkewError(error) {
return !(error.message.match(
/'Expiration time' claim \('exp'\) must be a numeric value representing the future time at which the assertion expires/
) || error.message.match(
/'Issued at' claim \('iat'\) must be an Integer representing the time that the assertion was issued/
));
}
async function hook6(state, request2, route, parameters) {
const endpoint2 = request2.endpoint.merge(route, parameters);
const url = endpoint2.url;
if (/\/login\/oauth\/access_token$/.test(url)) {
return request2(endpoint2);
}
if (requiresAppAuth(url.replace(request2.endpoint.DEFAULTS.baseUrl, ""))) {
const { token: token2 } = await getAppAuthentication(state);
endpoint2.headers.authorization = `bearer ${token2}`;
let response;
try {
response = await request2(endpoint2);
} catch (error) {
if (isNotTimeSkewError(error)) {
throw error;
}
if (typeof error.response.headers.date === "undefined") {
throw error;
}
const diff = Math.floor(
(Date.parse(error.response.headers.date) - Date.parse((/* @__PURE__ */ new Date()).toString())) / 1e3
);
state.log.warn(error.message);
state.log.warn(
`[@octokit/auth-app] GitHub API time and system time are different by ${diff} seconds. Retrying request with the difference accounted for.`
);
const { token: token3 } = await getAppAuthentication({
...state,
timeDifference: diff
});
endpoint2.headers.authorization = `bearer ${token3}`;
return request2(endpoint2);
}
return response;
}
if ((0, import_auth_oauth_user4.requiresBasicAuth)(url)) {
const authentication = await state.oauthApp({ type: "oauth-app" });
endpoint2.headers.authorization = authentication.headers.authorization;
return request2(endpoint2);
}
const { token, createdAt } = await getInstallationAuthentication(
state,
// @ts-expect-error TBD
{},
request2.defaults({ baseUrl: endpoint2.baseUrl })
);
endpoint2.headers.authorization = `token ${token}`;
return sendRequestWithRetries(
state,
request2,
endpoint2,
createdAt
);
}
async function sendRequestWithRetries(state, request2, options, createdAt, retries = 0) {
const timeSinceTokenCreationInMs = +/* @__PURE__ */ new Date() - +new Date(createdAt);
try {
return await request2(options);
} catch (error) {
if (error.status !== 401) {
throw error;
}
if (timeSinceTokenCreationInMs >= FIVE_SECONDS_IN_MS) {
if (retries > 0) {
error.message = `After ${retries} retries within ${timeSinceTokenCreationInMs / 1e3}s of creating the installation access token, the response remains 401. At this point, the cause may be an authentication problem or a system outage. Please check https://www.githubstatus.com for status information`;
}
throw error;
}
++retries;
const awaitTime = retries * 1e3;
state.log.warn(
`[@octokit/auth-app] Retrying after 401 response to account for token replication delay (retry: ${retries}, wait: ${awaitTime / 1e3}s)`
);
await new Promise((resolve) => setTimeout(resolve, awaitTime));
return sendRequestWithRetries(state, request2, options, createdAt, retries);
}
}
var VERSION16 = "6.1.3";
var import_auth_oauth_user22 = (init_dist_web11(), __toCommonJS(dist_web_exports6));
function createAppAuth4(options) {
if (!options.appId) {
throw new Error("[@octokit/auth-app] appId option is required");
}
if (!Number.isFinite(+options.appId)) {
throw new Error(
"[@octokit/auth-app] appId option must be a number or numeric string"
);
}
if (!options.privateKey) {
throw new Error("[@octokit/auth-app] privateKey option is required");
}
if ("installationId" in options && !options.installationId) {
throw new Error(
"[@octokit/auth-app] installationId is set to a falsy value"
);
}
const log = Object.assign(
{
warn: console.warn.bind(console)
},
options.log
);
const request2 = options.request || import_request18.request.defaults({
headers: {
"user-agent": `octokit-auth-app.js/${VERSION16} ${(0, import_universal_user_agent8.getUserAgent)()}`
}
});
const state = Object.assign(
{
request: request2,
cache: getCache()
},
options,
options.installationId ? { installationId: Number(options.installationId) } : {},
{
log,
oauthApp: (0, import_auth_oauth_app.createOAuthAppAuth)({
clientType: "github-app",
clientId: options.clientId || "",
clientSecret: options.clientSecret || "",
request: request2
})
}
);
return Object.assign(auth6.bind(null, state), {
hook: hook6.bind(null, state)
});
}
}
});
// node_modules/.pnpm/@octokit+auth-unauthenticated@5.0.1/node_modules/@octokit/auth-unauthenticated/dist-web/index.js
var dist_web_exports8 = {};
__export(dist_web_exports8, {
createUnauthenticatedAuth: () => createUnauthenticatedAuth
});
async function auth5(reason) {
return {
type: "unauthenticated",
reason
};
}
function isRateLimitError(error) {
if (error.status !== 403) {
return false;
}
if (!error.response) {
return false;
}
return error.response.headers["x-ratelimit-remaining"] === "0";
}
function isAbuseLimitError(error) {
if (error.status !== 403) {
return false;
}
return REGEX_ABUSE_LIMIT_MESSAGE.test(error.message);
}
async function hook5(reason, request2, route, parameters) {
const endpoint2 = request2.endpoint.merge(
route,
parameters
);
return request2(endpoint2).catch((error) => {
if (error.status === 404) {
error.message = `Not found. May be due to lack of authentication. Reason: ${reason}`;
throw error;
}
if (isRateLimitError(error)) {
error.message = `API rate limit exceeded. This maybe caused by the lack of authentication. Reason: ${reason}`;
throw error;
}
if (isAbuseLimitError(error)) {
error.message = `You have triggered an abuse detection mechanism. This maybe caused by the lack of authentication. Reason: ${reason}`;
throw error;
}
if (error.status === 401) {
error.message = `Unauthorized. "${endpoint2.method} ${endpoint2.url}" failed most likely due to lack of authentication. Reason: ${reason}`;
throw error;
}
if (error.status >= 400 && error.status < 500) {
error.message = error.message.replace(
/\.?$/,
`. May be caused by lack of authentication (${reason}).`
);
}
throw error;
});
}
var REGEX_ABUSE_LIMIT_MESSAGE, createUnauthenticatedAuth;
var init_dist_web13 = __esm({
"node_modules/.pnpm/@octokit+auth-unauthenticated@5.0.1/node_modules/@octokit/auth-unauthenticated/dist-web/index.js"() {
init_dist_web4();
init_dist_web4();
REGEX_ABUSE_LIMIT_MESSAGE = /\babuse\b/i;
createUnauthenticatedAuth = function createUnauthenticatedAuth2(options) {
if (!options || !options.reason) {
throw new Error(
"[@octokit/auth-unauthenticated] No reason passed to createUnauthenticatedAuth"
);
}
return Object.assign(auth5.bind(null, options.reason), {
hook: hook5.bind(null, options.reason)
});
};
}
});
// node_modules/.pnpm/@octokit+oauth-app@6.1.0/node_modules/@octokit/oauth-app/dist-node/index.js
var require_dist_node2 = __commonJS({
"node_modules/.pnpm/@octokit+oauth-app@6.1.0/node_modules/@octokit/oauth-app/dist-node/index.js"(exports, module) {
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export2 = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS2 = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var dist_src_exports2 = {};
__export2(dist_src_exports2, {
OAuthApp: () => OAuthApp3,
createAWSLambdaAPIGatewayV2Handler: () => createAWSLambdaAPIGatewayV2Handler,
createNodeMiddleware: () => createNodeMiddleware3,
createWebWorkerHandler: () => createWebWorkerHandler,
handleRequest: () => handleRequest,
sendNodeResponse: () => sendResponse,
unknownRouteResponse: () => unknownRouteResponse2
});
module.exports = __toCommonJS2(dist_src_exports2);
var import_auth_oauth_app = (init_dist_web12(), __toCommonJS(dist_web_exports7));
var VERSION16 = "6.1.0";
function addEventHandler(state, eventName, eventHandler) {
if (Array.isArray(eventName)) {
for (const singleEventName of eventName) {
addEventHandler(state, singleEventName, eventHandler);
}
return;
}
if (!state.eventHandlers[eventName]) {
state.eventHandlers[eventName] = [];
}
state.eventHandlers[eventName].push(eventHandler);
}
var import_core5 = (init_dist_web8(), __toCommonJS(dist_web_exports5));
var import_universal_user_agent8 = (init_dist_web(), __toCommonJS(dist_web_exports));
var OAuthAppOctokit = import_core5.Octokit.defaults({
userAgent: `octokit-oauth-app.js/${VERSION16} ${(0, import_universal_user_agent8.getUserAgent)()}`
});
var import_auth_oauth_user4 = (init_dist_web11(), __toCommonJS(dist_web_exports6));
async function emitEvent(state, context) {
const { name, action } = context;
if (state.eventHandlers[`${name}.${action}`]) {
for (const eventHandler of state.eventHandlers[`${name}.${action}`]) {
await eventHandler(context);
}
}
if (state.eventHandlers[name]) {
for (const eventHandler of state.eventHandlers[name]) {
await eventHandler(context);
}
}
}
async function getUserOctokitWithState(state, options) {
return state.octokit.auth({
type: "oauth-user",
...options,
async factory(options2) {
const octokit = new state.Octokit({
authStrategy: import_auth_oauth_user4.createOAuthUserAuth,
auth: options2
});
const authentication = await octokit.auth({
type: "get"
});
await emitEvent(state, {
name: "token",
action: "created",
token: authentication.token,
scopes: authentication.scopes,
authentication,
octokit
});
return octokit;
}
});
}
var OAuthMethods = __toESM2((init_dist_src(), __toCommonJS(dist_src_exports)));
function getWebFlowAuthorizationUrlWithState(state, options) {
const optionsWithDefaults = {
clientId: state.clientId,
request: state.octokit.request,
...options,
allowSignup: state.allowSignup ?? options.allowSignup,
redirectUrl: options.redirectUrl ?? state.redirectUrl,
scopes: options.scopes ?? state.defaultScopes
};
return OAuthMethods.getWebFlowAuthorizationUrl({
clientType: state.clientType,
...optionsWithDefaults
});
}
var OAuthAppAuth = __toESM2((init_dist_web12(), __toCommonJS(dist_web_exports7)));
async function createTokenWithState(state, options) {
const authentication = await state.octokit.auth({
type: "oauth-user",
...options
});
await emitEvent(state, {
name: "token",
action: "created",
token: authentication.token,
scopes: authentication.scopes,
authentication,
octokit: new state.Octokit({
authStrategy: OAuthAppAuth.createOAuthUserAuth,
auth: {
clientType: state.clientType,
clientId: state.clientId,
clientSecret: state.clientSecret,
token: authentication.token,
scopes: authentication.scopes,
refreshToken: authentication.refreshToken,
expiresAt: authentication.expiresAt,
refreshTokenExpiresAt: authentication.refreshTokenExpiresAt
}
})
});
return { authentication };
}
var OAuthMethods2 = __toESM2((init_dist_src(), __toCommonJS(dist_src_exports)));
async function checkTokenWithState(state, options) {
const result = await OAuthMethods2.checkToken({
// @ts-expect-error not worth the extra code to appease TS
clientType: state.clientType,
clientId: state.clientId,
clientSecret: state.clientSecret,
request: state.octokit.request,
...options
});
Object.assign(result.authentication, { type: "token", tokenType: "oauth" });
return result;
}
var OAuthMethods3 = __toESM2((init_dist_src(), __toCommonJS(dist_src_exports)));
var import_auth_oauth_user22 = (init_dist_web11(), __toCommonJS(dist_web_exports6));
async function resetTokenWithState(state, options) {
const optionsWithDefaults = {
clientId: state.clientId,
clientSecret: state.clientSecret,
request: state.octokit.request,
...options
};
if (state.clientType === "oauth-app") {
const response2 = await OAuthMethods3.resetToken({
clientType: "oauth-app",
...optionsWithDefaults
});
const authentication2 = Object.assign(response2.authentication, {
type: "token",
tokenType: "oauth"
});
await emitEvent(state, {
name: "token",
action: "reset",
token: response2.authentication.token,
scopes: response2.authentication.scopes || void 0,
authentication: authentication2,
octokit: new state.Octokit({
authStrategy: import_auth_oauth_user22.createOAuthUserAuth,
auth: {
clientType: state.clientType,
clientId: state.clientId,
clientSecret: state.clientSecret,
token: response2.authentication.token,
scopes: response2.authentication.scopes
}
})
});
return { ...response2, authentication: authentication2 };
}
const response = await OAuthMethods3.resetToken({
clientType: "github-app",
...optionsWithDefaults
});
const authentication = Object.assign(response.authentication, {
type: "token",
tokenType: "oauth"
});
await emitEvent(state, {
name: "token",
action: "reset",
token: response.authentication.token,
authentication,
octokit: new state.Octokit({
authStrategy: import_auth_oauth_user22.createOAuthUserAuth,
auth: {
clientType: state.clientType,
clientId: state.clientId,
clientSecret: state.clientSecret,
token: response.authentication.token
}
})
});
return { ...response, authentication };
}
var OAuthMethods4 = __toESM2((init_dist_src(), __toCommonJS(dist_src_exports)));
var import_auth_oauth_user32 = (init_dist_web11(), __toCommonJS(dist_web_exports6));
async function refreshTokenWithState(state, options) {
if (state.clientType === "oauth-app") {
throw new Error(
"[@octokit/oauth-app] app.refreshToken() is not supported for OAuth Apps"
);
}
const response = await OAuthMethods4.refreshToken({
clientType: "github-app",
clientId: state.clientId,
clientSecret: state.clientSecret,
request: state.octokit.request,
refreshToken: options.refreshToken
});
const authentication = Object.assign(response.authentication, {
type: "token",
tokenType: "oauth"
});
await emitEvent(state, {
name: "token",
action: "refreshed",
token: response.authentication.token,
authentication,
octokit: new state.Octokit({
authStrategy: import_auth_oauth_user32.createOAuthUserAuth,
auth: {
clientType: state.clientType,
clientId: state.clientId,
clientSecret: state.clientSecret,
token: response.authentication.token
}
})
});
return { ...response, authentication };
}
var OAuthMethods5 = __toESM2((init_dist_src(), __toCommonJS(dist_src_exports)));
var import_auth_oauth_user42 = (init_dist_web11(), __toCommonJS(dist_web_exports6));
async function scopeTokenWithState(state, options) {
if (state.clientType === "oauth-app") {
throw new Error(
"[@octokit/oauth-app] app.scopeToken() is not supported for OAuth Apps"
);
}
const response = await OAuthMethods5.scopeToken({
clientType: "github-app",
clientId: state.clientId,
clientSecret: state.clientSecret,
request: state.octokit.request,
...options
});
const authentication = Object.assign(response.authentication, {
type: "token",
tokenType: "oauth"
});
await emitEvent(state, {
name: "token",
action: "scoped",
token: response.authentication.token,
authentication,
octokit: new state.Octokit({
authStrategy: import_auth_oauth_user42.createOAuthUserAuth,
auth: {
clientType: state.clientType,
clientId: state.clientId,
clientSecret: state.clientSecret,
token: response.authentication.token
}
})
});
return { ...response, authentication };
}
var OAuthMethods6 = __toESM2((init_dist_src(), __toCommonJS(dist_src_exports)));
var import_auth_unauthenticated2 = (init_dist_web13(), __toCommonJS(dist_web_exports8));
async function deleteTokenWithState(state, options) {
const optionsWithDefaults = {
clientId: state.clientId,
clientSecret: state.clientSecret,
request: state.octokit.request,
...options
};
const response = state.clientType === "oauth-app" ? await OAuthMethods6.deleteToken({
clientType: "oauth-app",
...optionsWithDefaults
}) : (
// istanbul ignore next
await OAuthMethods6.deleteToken({
clientType: "github-app",
...optionsWithDefaults
})
);
await emitEvent(state, {
name: "token",
action: "deleted",
token: options.token,
octokit: new state.Octokit({
authStrategy: import_auth_unauthenticated2.createUnauthenticatedAuth,
auth: {
reason: `Handling "token.deleted" event. The access for the token has been revoked.`
}
})
});
return response;
}
var OAuthMethods7 = __toESM2((init_dist_src(), __toCommonJS(dist_src_exports)));
var import_auth_unauthenticated22 = (init_dist_web13(), __toCommonJS(dist_web_exports8));
async function deleteAuthorizationWithState(state, options) {
const optionsWithDefaults = {
clientId: state.clientId,
clientSecret: state.clientSecret,
request: state.octokit.request,
...options
};
const response = state.clientType === "oauth-app" ? await OAuthMethods7.deleteAuthorization({
clientType: "oauth-app",
...optionsWithDefaults
}) : (
// istanbul ignore next
await OAuthMethods7.deleteAuthorization({
clientType: "github-app",
...optionsWithDefaults
})
);
await emitEvent(state, {
name: "token",
action: "deleted",
token: options.token,
octokit: new state.Octokit({
authStrategy: import_auth_unauthenticated22.createUnauthenticatedAuth,
auth: {
reason: `Handling "token.deleted" event. The access for the token has been revoked.`
}
})
});
await emitEvent(state, {
name: "authorization",
action: "deleted",
token: options.token,
octokit: new state.Octokit({
authStrategy: import_auth_unauthenticated22.createUnauthenticatedAuth,
auth: {
reason: `Handling "authorization.deleted" event. The access for the app has been revoked.`
}
})
});
return response;
}
function unknownRouteResponse2(request2) {
return {
status: 404,
headers: { "content-type": "application/json" },
text: JSON.stringify({
error: `Unknown route: ${request2.method} ${request2.url}`
})
};
}
async function handleRequest(app, { pathPrefix = "/api/github/oauth" }, request2) {
var _a4, _b, _c, _d, _e, _f;
if (request2.method === "OPTIONS") {
return {
status: 200,
headers: {
"access-control-allow-origin": "*",
"access-control-allow-methods": "*",
"access-control-allow-headers": "Content-Type, User-Agent, Authorization"
}
};
}
let { pathname } = new URL(request2.url, "http://localhost");
if (!pathname.startsWith(`${pathPrefix}/`)) {
return void 0;
}
pathname = pathname.slice(pathPrefix.length + 1);
const route = [request2.method, pathname].join(" ");
const routes = {
getLogin: `GET login`,
getCallback: `GET callback`,
createToken: `POST token`,
getToken: `GET token`,
patchToken: `PATCH token`,
patchRefreshToken: `PATCH refresh-token`,
scopeToken: `POST token/scoped`,
deleteToken: `DELETE token`,
deleteGrant: `DELETE grant`
};
if (!Object.values(routes).includes(route)) {
return unknownRouteResponse2(request2);
}
let json;
try {
const text = await request2.text();
json = text ? JSON.parse(text) : {};
} catch (error) {
return {
status: 400,
headers: {
"content-type": "application/json",
"access-control-allow-origin": "*"
},
text: JSON.stringify({
error: "[@octokit/oauth-app] request error"
})
};
}
const { searchParams } = new URL(request2.url, "http://localhost");
const query = Object.fromEntries(searchParams);
const headers = request2.headers;
try {
if (route === routes.getLogin) {
const { url } = app.getWebFlowAuthorizationUrl({
state: query.state,
scopes: query.scopes ? query.scopes.split(",") : void 0,
allowSignup: query.allowSignup ? query.allowSignup === "true" : void 0,
redirectUrl: query.redirectUrl
});
return { status: 302, headers: { location: url } };
}
if (route === routes.getCallback) {
if (query.error) {
throw new Error(
`[@octokit/oauth-app] ${query.error} ${query.error_description}`
);
}
if (!query.code) {
throw new Error('[@octokit/oauth-app] "code" parameter is required');
}
const {
authentication: { token: token2 }
} = await app.createToken({
code: query.code
});
return {
status: 200,
headers: {
"content-type": "text/html"
},
text: `<h1>Token created successfully</h1>
<p>Your token is: <strong>${token2}</strong>. Copy it now as it cannot be shown again.</p>`
};
}
if (route === routes.createToken) {
const { code, redirectUrl } = json;
if (!code) {
throw new Error('[@octokit/oauth-app] "code" parameter is required');
}
const result = await app.createToken({
code,
redirectUrl
});
delete result.authentication.clientSecret;
return {
status: 201,
headers: {
"content-type": "application/json",
"access-control-allow-origin": "*"
},
text: JSON.stringify(result)
};
}
if (route === routes.getToken) {
const token2 = (_a4 = headers.authorization) == null ? void 0 : _a4.substr("token ".length);
if (!token2) {
throw new Error(
'[@octokit/oauth-app] "Authorization" header is required'
);
}
const result = await app.checkToken({
token: token2
});
delete result.authentication.clientSecret;
return {
status: 200,
headers: {
"content-type": "application/json",
"access-control-allow-origin": "*"
},
text: JSON.stringify(result)
};
}
if (route === routes.patchToken) {
const token2 = (_b = headers.authorization) == null ? void 0 : _b.substr("token ".length);
if (!token2) {
throw new Error(
'[@octokit/oauth-app] "Authorization" header is required'
);
}
const result = await app.resetToken({ token: token2 });
delete result.authentication.clientSecret;
return {
status: 200,
headers: {
"content-type": "application/json",
"access-control-allow-origin": "*"
},
text: JSON.stringify(result)
};
}
if (route === routes.patchRefreshToken) {
const token2 = (_c = headers.authorization) == null ? void 0 : _c.substr("token ".length);
if (!token2) {
throw new Error(
'[@octokit/oauth-app] "Authorization" header is required'
);
}
const { refreshToken: refreshToken2 } = json;
if (!refreshToken2) {
throw new Error(
"[@octokit/oauth-app] refreshToken must be sent in request body"
);
}
const result = await app.refreshToken({ refreshToken: refreshToken2 });
delete result.authentication.clientSecret;
return {
status: 200,
headers: {
"content-type": "application/json",
"access-control-allow-origin": "*"
},
text: JSON.stringify(result)
};
}
if (route === routes.scopeToken) {
const token2 = (_d = headers.authorization) == null ? void 0 : _d.substr("token ".length);
if (!token2) {
throw new Error(
'[@octokit/oauth-app] "Authorization" header is required'
);
}
const result = await app.scopeToken({
token: token2,
...json
});
delete result.authentication.clientSecret;
return {
status: 200,
headers: {
"content-type": "application/json",
"access-control-allow-origin": "*"
},
text: JSON.stringify(result)
};
}
if (route === routes.deleteToken) {
const token2 = (_e = headers.authorization) == null ? void 0 : _e.substr("token ".length);
if (!token2) {
throw new Error(
'[@octokit/oauth-app] "Authorization" header is required'
);
}
await app.deleteToken({
token: token2
});
return {
status: 204,
headers: { "access-control-allow-origin": "*" }
};
}
const token = (_f = headers.authorization) == null ? void 0 : _f.substr("token ".length);
if (!token) {
throw new Error(
'[@octokit/oauth-app] "Authorization" header is required'
);
}
await app.deleteAuthorization({
token
});
return {
status: 204,
headers: { "access-control-allow-origin": "*" }
};
} catch (error) {
return {
status: 400,
headers: {
"content-type": "application/json",
"access-control-allow-origin": "*"
},
text: JSON.stringify({ error: error.message })
};
}
}
function parseRequest(request2) {
const { method, url, headers } = request2;
async function text() {
const text2 = await new Promise((resolve, reject) => {
let bodyChunks = [];
request2.on("error", reject).on("data", (chunk) => bodyChunks.push(chunk)).on("end", () => resolve(Buffer.concat(bodyChunks).toString()));
});
return text2;
}
return { method, url, headers, text };
}
function sendResponse(octokitResponse, response) {
response.writeHead(octokitResponse.status, octokitResponse.headers);
response.end(octokitResponse.text);
}
function createNodeMiddleware3(app, options = {}) {
return async function(request2, response, next) {
const octokitRequest = await parseRequest(request2);
const octokitResponse = await handleRequest(app, options, octokitRequest);
if (octokitResponse) {
sendResponse(octokitResponse, response);
return true;
} else {
next == null ? void 0 : next();
return false;
}
};
}
function parseRequest2(request2) {
const headers = Object.fromEntries(request2.headers.entries());
return {
method: request2.method,
url: request2.url,
headers,
text: () => request2.text()
};
}
function sendResponse2(octokitResponse) {
return new Response(octokitResponse.text, {
status: octokitResponse.status,
headers: octokitResponse.headers
});
}
function createWebWorkerHandler(app, options = {}) {
return async function(request2) {
const octokitRequest = await parseRequest2(request2);
const octokitResponse = await handleRequest(app, options, octokitRequest);
return octokitResponse ? sendResponse2(octokitResponse) : void 0;
};
}
function parseRequest3(request2) {
const { method } = request2.requestContext.http;
let url = request2.rawPath;
const { stage } = request2.requestContext;
if (url.startsWith("/" + stage))
url = url.substring(stage.length + 1);
if (request2.rawQueryString)
url += "?" + request2.rawQueryString;
const headers = request2.headers;
const text = async () => request2.body || "";
return { method, url, headers, text };
}
function sendResponse3(octokitResponse) {
return {
statusCode: octokitResponse.status,
headers: octokitResponse.headers,
body: octokitResponse.text
};
}
function createAWSLambdaAPIGatewayV2Handler(app, options = {}) {
return async function(event) {
const request2 = parseRequest3(event);
const response = await handleRequest(app, options, request2);
return response ? sendResponse3(response) : void 0;
};
}
var _a3;
var OAuthApp3 = (_a3 = class {
static defaults(defaults) {
const OAuthAppWithDefaults = class extends this {
constructor(...args) {
super({
...defaults,
...args[0]
});
}
};
return OAuthAppWithDefaults;
}
constructor(options) {
const Octokit22 = options.Octokit || OAuthAppOctokit;
this.type = options.clientType || "oauth-app";
const octokit = new Octokit22({
authStrategy: import_auth_oauth_app.createOAuthAppAuth,
auth: {
clientType: this.type,
clientId: options.clientId,
clientSecret: options.clientSecret
}
});
const state = {
clientType: this.type,
clientId: options.clientId,
clientSecret: options.clientSecret,
// @ts-expect-error defaultScopes not permitted for GitHub Apps
defaultScopes: options.defaultScopes || [],
allowSignup: options.allowSignup,
baseUrl: options.baseUrl,
redirectUrl: options.redirectUrl,
log: options.log,
Octokit: Octokit22,
octokit,
eventHandlers: {}
};
this.on = addEventHandler.bind(null, state);
this.octokit = octokit;
this.getUserOctokit = getUserOctokitWithState.bind(null, state);
this.getWebFlowAuthorizationUrl = getWebFlowAuthorizationUrlWithState.bind(
null,
state
);
this.createToken = createTokenWithState.bind(
null,
state
);
this.checkToken = checkTokenWithState.bind(
null,
state
);
this.resetToken = resetTokenWithState.bind(
null,
state
);
this.refreshToken = refreshTokenWithState.bind(
null,
state
);
this.scopeToken = scopeTokenWithState.bind(
null,
state
);
this.deleteToken = deleteTokenWithState.bind(null, state);
this.deleteAuthorization = deleteAuthorizationWithState.bind(null, state);
}
}, _a3.VERSION = VERSION16, _a3);
}
});
// node_modules/.pnpm/indent-string@4.0.0/node_modules/indent-string/index.js
var require_indent_string = __commonJS({
"node_modules/.pnpm/indent-string@4.0.0/node_modules/indent-string/index.js"(exports, module) {
"use strict";
module.exports = (string, count = 1, options) => {
options = {
indent: " ",
includeEmptyLines: false,
...options
};
if (typeof string !== "string") {
throw new TypeError(
`Expected \`input\` to be a \`string\`, got \`${typeof string}\``
);
}
if (typeof count !== "number") {
throw new TypeError(
`Expected \`count\` to be a \`number\`, got \`${typeof count}\``
);
}
if (typeof options.indent !== "string") {
throw new TypeError(
`Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\``
);
}
if (count === 0) {
return string;
}
const regex2 = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
return string.replace(regex2, options.indent.repeat(count));
};
}
});
// browser-external:os
var require_os = __commonJS({
"browser-external:os"(exports, module) {
module.exports = Object.create(new Proxy({}, {
get(_, key) {
if (key !== "__esModule" && key !== "__proto__" && key !== "constructor" && key !== "splice") {
console.warn(`Module "os" has been externalized for browser compatibility. Cannot access "os.${key}" in client code. See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.`);
}
}
}));
}
});
// node_modules/.pnpm/clean-stack@2.2.0/node_modules/clean-stack/index.js
var require_clean_stack = __commonJS({
"node_modules/.pnpm/clean-stack@2.2.0/node_modules/clean-stack/index.js"(exports, module) {
"use strict";
var os = require_os();
var extractPathRegex = /\s+at.*(?:\(|\s)(.*)\)?/;
var pathRegex = /^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/;
var homeDir = typeof os.homedir === "undefined" ? "" : os.homedir();
module.exports = (stack, options) => {
options = Object.assign({ pretty: false }, options);
return stack.replace(/\\/g, "/").split("\n").filter((line) => {
const pathMatches = line.match(extractPathRegex);
if (pathMatches === null || !pathMatches[1]) {
return true;
}
const match = pathMatches[1];
if (match.includes(".app/Contents/Resources/electron.asar") || match.includes(".app/Contents/Resources/default_app.asar")) {
return false;
}
return !pathRegex.test(match);
}).filter((line) => line.trim() !== "").map((line) => {
if (options.pretty) {
return line.replace(extractPathRegex, (m, p1) => m.replace(p1, p1.replace(homeDir, "~")));
}
return line;
}).join("\n");
};
}
});
// node_modules/.pnpm/aggregate-error@3.1.0/node_modules/aggregate-error/index.js
var require_aggregate_error = __commonJS({
"node_modules/.pnpm/aggregate-error@3.1.0/node_modules/aggregate-error/index.js"(exports, module) {
"use strict";
var indentString = require_indent_string();
var cleanStack = require_clean_stack();
var cleanInternalStack = (stack) => stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, "");
var AggregateError4 = class extends Error {
constructor(errors) {
if (!Array.isArray(errors)) {
throw new TypeError(`Expected input to be an Array, got ${typeof errors}`);
}
errors = [...errors].map((error) => {
if (error instanceof Error) {
return error;
}
if (error !== null && typeof error === "object") {
return Object.assign(new Error(error.message), error);
}
return new Error(error);
});
let message = errors.map((error) => {
return typeof error.stack === "string" ? cleanInternalStack(cleanStack(error.stack)) : String(error);
}).join("\n");
message = "\n" + indentString(message, 4);
super(message);
this.name = "AggregateError";
Object.defineProperty(this, "_errors", { value: errors });
}
*[Symbol.iterator]() {
for (const error of this._errors) {
yield error;
}
}
};
module.exports = AggregateError4;
}
});
// node_modules/.pnpm/octokit@3.2.1/node_modules/octokit/dist-web/index.js
init_dist_web8();
// node_modules/.pnpm/@octokit+plugin-paginate-rest@11.3.1_@octokit+core@5.2.0/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js
var VERSION5 = "11.3.1";
function normalizePaginatedListResponse(response) {
if (!response.data) {
return {
...response,
data: []
};
}
const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
if (!responseNeedsNormalization)
return response;
const incompleteResults = response.data.incomplete_results;
const repositorySelection = response.data.repository_selection;
const totalCount = response.data.total_count;
delete response.data.incomplete_results;
delete response.data.repository_selection;
delete response.data.total_count;
const namespaceKey = Object.keys(response.data)[0];
const data = response.data[namespaceKey];
response.data = data;
if (typeof incompleteResults !== "undefined") {
response.data.incomplete_results = incompleteResults;
}
if (typeof repositorySelection !== "undefined") {
response.data.repository_selection = repositorySelection;
}
response.data.total_count = totalCount;
return response;
}
function iterator(octokit, route, parameters) {
const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
const requestMethod = typeof route === "function" ? route : octokit.request;
const method = options.method;
const headers = options.headers;
let url = options.url;
return {
[Symbol.asyncIterator]: () => ({
async next() {
if (!url)
return { done: true };
try {
const response = await requestMethod({ method, url, headers });
const normalizedResponse = normalizePaginatedListResponse(response);
url = ((normalizedResponse.headers.link || "").match(
/<([^>]+)>;\s*rel="next"/
) || [])[1];
return { value: normalizedResponse };
} catch (error) {
if (error.status !== 409)
throw error;
url = "";
return {
value: {
status: 200,
headers: {},
data: []
}
};
}
}
})
};
}
function paginate(octokit, route, parameters, mapFn) {
if (typeof parameters === "function") {
mapFn = parameters;
parameters = void 0;
}
return gather(
octokit,
[],
iterator(octokit, route, parameters)[Symbol.asyncIterator](),
mapFn
);
}
function gather(octokit, results, iterator22, mapFn) {
return iterator22.next().then((result) => {
if (result.done) {
return results;
}
let earlyExit = false;
function done() {
earlyExit = true;
}
results = results.concat(
mapFn ? mapFn(result.value, done) : result.value.data
);
if (earlyExit) {
return results;
}
return gather(octokit, results, iterator22, mapFn);
});
}
var composePaginateRest = Object.assign(paginate, {
iterator
});
function paginateRest(octokit) {
return {
paginate: Object.assign(paginate.bind(null, octokit), {
iterator: iterator.bind(null, octokit)
})
};
}
paginateRest.VERSION = VERSION5;
// node_modules/.pnpm/@octokit+plugin-paginate-graphql@4.0.1_@octokit+core@5.2.0/node_modules/@octokit/plugin-paginate-graphql/dist-web/index.js
var generateMessage = (path, cursorValue) => `The cursor at "${path.join(
","
)}" did not change its value "${cursorValue}" after a page transition. Please make sure your that your query is set up correctly.`;
var MissingCursorChange = class extends Error {
constructor(pageInfo, cursorValue) {
super(generateMessage(pageInfo.pathInQuery, cursorValue));
this.pageInfo = pageInfo;
this.cursorValue = cursorValue;
this.name = "MissingCursorChangeError";
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
}
};
var MissingPageInfo = class extends Error {
constructor(response) {
super(
`No pageInfo property found in response. Please make sure to specify the pageInfo in your query. Response-Data: ${JSON.stringify(
response,
null,
2
)}`
);
this.response = response;
this.name = "MissingPageInfo";
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
}
};
var isObject = (value) => Object.prototype.toString.call(value) === "[object Object]";
function findPaginatedResourcePath(responseData) {
const paginatedResourcePath = deepFindPathToProperty(
responseData,
"pageInfo"
);
if (paginatedResourcePath.length === 0) {
throw new MissingPageInfo(responseData);
}
return paginatedResourcePath;
}
var deepFindPathToProperty = (object, searchProp, path = []) => {
for (const key of Object.keys(object)) {
const currentPath = [...path, key];
const currentValue = object[key];
if (currentValue.hasOwnProperty(searchProp)) {
return currentPath;
}
if (isObject(currentValue)) {
const result = deepFindPathToProperty(
currentValue,
searchProp,
currentPath
);
if (result.length > 0) {
return result;
}
}
}
return [];
};
var get = (object, path) => {
return path.reduce((current, nextProperty) => current[nextProperty], object);
};
var set = (object, path, mutator) => {
const lastProperty = path[path.length - 1];
const parentPath = [...path].slice(0, -1);
const parent = get(object, parentPath);
if (typeof mutator === "function") {
parent[lastProperty] = mutator(parent[lastProperty]);
} else {
parent[lastProperty] = mutator;
}
};
var extractPageInfos = (responseData) => {
const pageInfoPath = findPaginatedResourcePath(responseData);
return {
pathInQuery: pageInfoPath,
pageInfo: get(responseData, [...pageInfoPath, "pageInfo"])
};
};
var isForwardSearch = (givenPageInfo) => {
return givenPageInfo.hasOwnProperty("hasNextPage");
};
var getCursorFrom = (pageInfo) => isForwardSearch(pageInfo) ? pageInfo.endCursor : pageInfo.startCursor;
var hasAnotherPage = (pageInfo) => isForwardSearch(pageInfo) ? pageInfo.hasNextPage : pageInfo.hasPreviousPage;
var createIterator = (octokit) => {
return (query, initialParameters = {}) => {
let nextPageExists = true;
let parameters = { ...initialParameters };
return {
[Symbol.asyncIterator]: () => ({
async next() {
if (!nextPageExists)
return { done: true, value: {} };
const response = await octokit.graphql(
query,
parameters
);
const pageInfoContext = extractPageInfos(response);
const nextCursorValue = getCursorFrom(pageInfoContext.pageInfo);
nextPageExists = hasAnotherPage(pageInfoContext.pageInfo);
if (nextPageExists && nextCursorValue === parameters.cursor) {
throw new MissingCursorChange(pageInfoContext, nextCursorValue);
}
parameters = {
...parameters,
cursor: nextCursorValue
};
return { done: false, value: response };
}
})
};
};
};
var mergeResponses = (response1, response2) => {
if (Object.keys(response1).length === 0) {
return Object.assign(response1, response2);
}
const path = findPaginatedResourcePath(response1);
const nodesPath = [...path, "nodes"];
const newNodes = get(response2, nodesPath);
if (newNodes) {
set(response1, nodesPath, (values) => {
return [...values, ...newNodes];
});
}
const edgesPath = [...path, "edges"];
const newEdges = get(response2, edgesPath);
if (newEdges) {
set(response1, edgesPath, (values) => {
return [...values, ...newEdges];
});
}
const pageInfoPath = [...path, "pageInfo"];
set(response1, pageInfoPath, get(response2, pageInfoPath));
return response1;
};
var createPaginate = (octokit) => {
const iterator3 = createIterator(octokit);
return async (query, initialParameters = {}) => {
let mergedResponse = {};
for await (const response of iterator3(
query,
initialParameters
)) {
mergedResponse = mergeResponses(mergedResponse, response);
}
return mergedResponse;
};
};
function paginateGraphql(octokit) {
octokit.graphql;
return {
graphql: Object.assign(octokit.graphql, {
paginate: Object.assign(createPaginate(octokit), {
iterator: createIterator(octokit)
})
})
};
}
// node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@13.2.2_@octokit+core@5.2.0/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js
var VERSION6 = "13.2.2";
var Endpoints = {
actions: {
addCustomLabelsToSelfHostedRunnerForOrg: [
"POST /orgs/{org}/actions/runners/{runner_id}/labels"
],
addCustomLabelsToSelfHostedRunnerForRepo: [
"POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
],
addSelectedRepoToOrgSecret: [
"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
],
addSelectedRepoToOrgVariable: [
"PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
],
approveWorkflowRun: [
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
],
cancelWorkflowRun: [
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
],
createEnvironmentVariable: [
"POST /repos/{owner}/{repo}/environments/{environment_name}/variables"
],
createOrUpdateEnvironmentSecret: [
"PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"
],
createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
createOrUpdateRepoSecret: [
"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
],
createOrgVariable: ["POST /orgs/{org}/actions/variables"],
createRegistrationTokenForOrg: [
"POST /orgs/{org}/actions/runners/registration-token"
],
createRegistrationTokenForRepo: [
"POST /repos/{owner}/{repo}/actions/runners/registration-token"
],
createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
createRemoveTokenForRepo: [
"POST /repos/{owner}/{repo}/actions/runners/remove-token"
],
createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
createWorkflowDispatch: [
"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
],
deleteActionsCacheById: [
"DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
],
deleteActionsCacheByKey: [
"DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
],
deleteArtifact: [
"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
],
deleteEnvironmentSecret: [
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"
],
deleteEnvironmentVariable: [
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"
],
deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
deleteRepoSecret: [
"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
],
deleteRepoVariable: [
"DELETE /repos/{owner}/{repo}/actions/variables/{name}"
],
deleteSelfHostedRunnerFromOrg: [
"DELETE /orgs/{org}/actions/runners/{runner_id}"
],
deleteSelfHostedRunnerFromRepo: [
"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
],
deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
deleteWorkflowRunLogs: [
"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
],
disableSelectedRepositoryGithubActionsOrganization: [
"DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
],
disableWorkflow: [
"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
],
downloadArtifact: [
"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
],
downloadJobLogsForWorkflowRun: [
"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
],
downloadWorkflowRunAttemptLogs: [
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
],
downloadWorkflowRunLogs: [
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
],
enableSelectedRepositoryGithubActionsOrganization: [
"PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
],
enableWorkflow: [
"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
],
forceCancelWorkflowRun: [
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
],
generateRunnerJitconfigForOrg: [
"POST /orgs/{org}/actions/runners/generate-jitconfig"
],
generateRunnerJitconfigForRepo: [
"POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
],
getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
getActionsCacheUsageByRepoForOrg: [
"GET /orgs/{org}/actions/cache/usage-by-repository"
],
getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
getAllowedActionsOrganization: [
"GET /orgs/{org}/actions/permissions/selected-actions"
],
getAllowedActionsRepository: [
"GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
],
getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
getCustomOidcSubClaimForRepo: [
"GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
],
getEnvironmentPublicKey: [
"GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"
],
getEnvironmentSecret: [
"GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"
],
getEnvironmentVariable: [
"GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"
],
getGithubActionsDefaultWorkflowPermissionsOrganization: [
"GET /orgs/{org}/actions/permissions/workflow"
],
getGithubActionsDefaultWorkflowPermissionsRepository: [
"GET /repos/{owner}/{repo}/actions/permissions/workflow"
],
getGithubActionsPermissionsOrganization: [
"GET /orgs/{org}/actions/permissions"
],
getGithubActionsPermissionsRepository: [
"GET /repos/{owner}/{repo}/actions/permissions"
],
getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
getPendingDeploymentsForRun: [
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
],
getRepoPermissions: [
"GET /repos/{owner}/{repo}/actions/permissions",
{},
{ renamed: ["actions", "getGithubActionsPermissionsRepository"] }
],
getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
getReviewsForRun: [
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
],
getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
getSelfHostedRunnerForRepo: [
"GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
],
getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
getWorkflowAccessToRepository: [
"GET /repos/{owner}/{repo}/actions/permissions/access"
],
getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
getWorkflowRunAttempt: [
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
],
getWorkflowRunUsage: [
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
],
getWorkflowUsage: [
"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
],
listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
listEnvironmentSecrets: [
"GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"
],
listEnvironmentVariables: [
"GET /repos/{owner}/{repo}/environments/{environment_name}/variables"
],
listJobsForWorkflowRun: [
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
],
listJobsForWorkflowRunAttempt: [
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
],
listLabelsForSelfHostedRunnerForOrg: [
"GET /orgs/{org}/actions/runners/{runner_id}/labels"
],
listLabelsForSelfHostedRunnerForRepo: [
"GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
],
listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
listOrgVariables: ["GET /orgs/{org}/actions/variables"],
listRepoOrganizationSecrets: [
"GET /repos/{owner}/{repo}/actions/organization-secrets"
],
listRepoOrganizationVariables: [
"GET /repos/{owner}/{repo}/actions/organization-variables"
],
listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
listRunnerApplicationsForRepo: [
"GET /repos/{owner}/{repo}/actions/runners/downloads"
],
listSelectedReposForOrgSecret: [
"GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
],
listSelectedReposForOrgVariable: [
"GET /orgs/{org}/actions/variables/{name}/repositories"
],
listSelectedRepositoriesEnabledGithubActionsOrganization: [
"GET /orgs/{org}/actions/permissions/repositories"
],
listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
listWorkflowRunArtifacts: [
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
],
listWorkflowRuns: [
"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
],
listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
reRunJobForWorkflowRun: [
"POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
],
reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
reRunWorkflowFailedJobs: [
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
],
removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
"DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
],
removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
],
removeCustomLabelFromSelfHostedRunnerForOrg: [
"DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
],
removeCustomLabelFromSelfHostedRunnerForRepo: [
"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
],
removeSelectedRepoFromOrgSecret: [
"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
],
removeSelectedRepoFromOrgVariable: [
"DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
],
reviewCustomGatesForRun: [
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
],
reviewPendingDeploymentsForRun: [
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
],
setAllowedActionsOrganization: [
"PUT /orgs/{org}/actions/permissions/selected-actions"
],
setAllowedActionsRepository: [
"PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
],
setCustomLabelsForSelfHostedRunnerForOrg: [
"PUT /orgs/{org}/actions/runners/{runner_id}/labels"
],
setCustomLabelsForSelfHostedRunnerForRepo: [
"PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
],
setCustomOidcSubClaimForRepo: [
"PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
],
setGithubActionsDefaultWorkflowPermissionsOrganization: [
"PUT /orgs/{org}/actions/permissions/workflow"
],
setGithubActionsDefaultWorkflowPermissionsRepository: [
"PUT /repos/{owner}/{repo}/actions/permissions/workflow"
],
setGithubActionsPermissionsOrganization: [
"PUT /orgs/{org}/actions/permissions"
],
setGithubActionsPermissionsRepository: [
"PUT /repos/{owner}/{repo}/actions/permissions"
],
setSelectedReposForOrgSecret: [
"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
],
setSelectedReposForOrgVariable: [
"PUT /orgs/{org}/actions/variables/{name}/repositories"
],
setSelectedRepositoriesEnabledGithubActionsOrganization: [
"PUT /orgs/{org}/actions/permissions/repositories"
],
setWorkflowAccessToRepository: [
"PUT /repos/{owner}/{repo}/actions/permissions/access"
],
updateEnvironmentVariable: [
"PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"
],
updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
updateRepoVariable: [
"PATCH /repos/{owner}/{repo}/actions/variables/{name}"
]
},
activity: {
checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
deleteThreadSubscription: [
"DELETE /notifications/threads/{thread_id}/subscription"
],
getFeeds: ["GET /feeds"],
getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
getThread: ["GET /notifications/threads/{thread_id}"],
getThreadSubscriptionForAuthenticatedUser: [
"GET /notifications/threads/{thread_id}/subscription"
],
listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
listNotificationsForAuthenticatedUser: ["GET /notifications"],
listOrgEventsForAuthenticatedUser: [
"GET /users/{username}/events/orgs/{org}"
],
listPublicEvents: ["GET /events"],
listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
listPublicEventsForUser: ["GET /users/{username}/events/public"],
listPublicOrgEvents: ["GET /orgs/{org}/events"],
listReceivedEventsForUser: ["GET /users/{username}/received_events"],
listReceivedPublicEventsForUser: [
"GET /users/{username}/received_events/public"
],
listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
listRepoNotificationsForAuthenticatedUser: [
"GET /repos/{owner}/{repo}/notifications"
],
listReposStarredByAuthenticatedUser: ["GET /user/starred"],
listReposStarredByUser: ["GET /users/{username}/starred"],
listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
markNotificationsAsRead: ["PUT /notifications"],
markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
setThreadSubscription: [
"PUT /notifications/threads/{thread_id}/subscription"
],
starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
},
apps: {
addRepoToInstallation: [
"PUT /user/installations/{installation_id}/repositories/{repository_id}",
{},
{ renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
],
addRepoToInstallationForAuthenticatedUser: [
"PUT /user/installations/{installation_id}/repositories/{repository_id}"
],
checkToken: ["POST /applications/{client_id}/token"],
createFromManifest: ["POST /app-manifests/{code}/conversions"],
createInstallationAccessToken: [
"POST /app/installations/{installation_id}/access_tokens"
],
deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
deleteInstallation: ["DELETE /app/installations/{installation_id}"],
deleteToken: ["DELETE /applications/{client_id}/token"],
getAuthenticated: ["GET /app"],
getBySlug: ["GET /apps/{app_slug}"],
getInstallation: ["GET /app/installations/{installation_id}"],
getOrgInstallation: ["GET /orgs/{org}/installation"],
getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
getSubscriptionPlanForAccount: [
"GET /marketplace_listing/accounts/{account_id}"
],
getSubscriptionPlanForAccountStubbed: [
"GET /marketplace_listing/stubbed/accounts/{account_id}"
],
getUserInstallation: ["GET /users/{username}/installation"],
getWebhookConfigForApp: ["GET /app/hook/config"],
getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
listAccountsForPlanStubbed: [
"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
],
listInstallationReposForAuthenticatedUser: [
"GET /user/installations/{installation_id}/repositories"
],
listInstallationRequestsForAuthenticatedApp: [
"GET /app/installation-requests"
],
listInstallations: ["GET /app/installations"],
listInstallationsForAuthenticatedUser: ["GET /user/installations"],
listPlans: ["GET /marketplace_listing/plans"],
listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
listReposAccessibleToInstallation: ["GET /installation/repositories"],
listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
listSubscriptionsForAuthenticatedUserStubbed: [
"GET /user/marketplace_purchases/stubbed"
],
listWebhookDeliveries: ["GET /app/hook/deliveries"],
redeliverWebhookDelivery: [
"POST /app/hook/deliveries/{delivery_id}/attempts"
],
removeRepoFromInstallation: [
"DELETE /user/installations/{installation_id}/repositories/{repository_id}",
{},
{ renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
],
removeRepoFromInstallationForAuthenticatedUser: [
"DELETE /user/installations/{installation_id}/repositories/{repository_id}"
],
resetToken: ["PATCH /applications/{client_id}/token"],
revokeInstallationAccessToken: ["DELETE /installation/token"],
scopeToken: ["POST /applications/{client_id}/token/scoped"],
suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
unsuspendInstallation: [
"DELETE /app/installations/{installation_id}/suspended"
],
updateWebhookConfigForApp: ["PATCH /app/hook/config"]
},
billing: {
getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
getGithubActionsBillingUser: [
"GET /users/{username}/settings/billing/actions"
],
getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
getGithubPackagesBillingUser: [
"GET /users/{username}/settings/billing/packages"
],
getSharedStorageBillingOrg: [
"GET /orgs/{org}/settings/billing/shared-storage"
],
getSharedStorageBillingUser: [
"GET /users/{username}/settings/billing/shared-storage"
]
},
checks: {
create: ["POST /repos/{owner}/{repo}/check-runs"],
createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
listAnnotations: [
"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
],
listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
listForSuite: [
"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
],
listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
rerequestRun: [
"POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
],
rerequestSuite: [
"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
],
setSuitesPreferences: [
"PATCH /repos/{owner}/{repo}/check-suites/preferences"
],
update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
},
codeScanning: {
deleteAnalysis: [
"DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
],
getAlert: [
"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
{},
{ renamedParameters: { alert_id: "alert_number" } }
],
getAnalysis: [
"GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
],
getCodeqlDatabase: [
"GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
],
getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
listAlertInstances: [
"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
],
listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
listAlertsInstances: [
"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
{},
{ renamed: ["codeScanning", "listAlertInstances"] }
],
listCodeqlDatabases: [
"GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
],
listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
updateAlert: [
"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
],
updateDefaultSetup: [
"PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
],
uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
},
codesOfConduct: {
getAllCodesOfConduct: ["GET /codes_of_conduct"],
getConductCode: ["GET /codes_of_conduct/{key}"]
},
codespaces: {
addRepositoryForSecretForAuthenticatedUser: [
"PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
],
addSelectedRepoToOrgSecret: [
"PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
],
checkPermissionsForDevcontainer: [
"GET /repos/{owner}/{repo}/codespaces/permissions_check"
],
codespaceMachinesForAuthenticatedUser: [
"GET /user/codespaces/{codespace_name}/machines"
],
createForAuthenticatedUser: ["POST /user/codespaces"],
createOrUpdateOrgSecret: [
"PUT /orgs/{org}/codespaces/secrets/{secret_name}"
],
createOrUpdateRepoSecret: [
"PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
],
createOrUpdateSecretForAuthenticatedUser: [
"PUT /user/codespaces/secrets/{secret_name}"
],
createWithPrForAuthenticatedUser: [
"POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
],
createWithRepoForAuthenticatedUser: [
"POST /repos/{owner}/{repo}/codespaces"
],
deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
deleteFromOrganization: [
"DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
],
deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
deleteRepoSecret: [
"DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
],
deleteSecretForAuthenticatedUser: [
"DELETE /user/codespaces/secrets/{secret_name}"
],
exportForAuthenticatedUser: [
"POST /user/codespaces/{codespace_name}/exports"
],
getCodespacesForUserInOrg: [
"GET /orgs/{org}/members/{username}/codespaces"
],
getExportDetailsForAuthenticatedUser: [
"GET /user/codespaces/{codespace_name}/exports/{export_id}"
],
getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
getPublicKeyForAuthenticatedUser: [
"GET /user/codespaces/secrets/public-key"
],
getRepoPublicKey: [
"GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
],
getRepoSecret: [
"GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
],
getSecretForAuthenticatedUser: [
"GET /user/codespaces/secrets/{secret_name}"
],
listDevcontainersInRepositoryForAuthenticatedUser: [
"GET /repos/{owner}/{repo}/codespaces/devcontainers"
],
listForAuthenticatedUser: ["GET /user/codespaces"],
listInOrganization: [
"GET /orgs/{org}/codespaces",
{},
{ renamedParameters: { org_id: "org" } }
],
listInRepositoryForAuthenticatedUser: [
"GET /repos/{owner}/{repo}/codespaces"
],
listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
listRepositoriesForSecretForAuthenticatedUser: [
"GET /user/codespaces/secrets/{secret_name}/repositories"
],
listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
listSelectedReposForOrgSecret: [
"GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
],
preFlightWithRepoForAuthenticatedUser: [
"GET /repos/{owner}/{repo}/codespaces/new"
],
publishForAuthenticatedUser: [
"POST /user/codespaces/{codespace_name}/publish"
],
removeRepositoryForSecretForAuthenticatedUser: [
"DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
],
removeSelectedRepoFromOrgSecret: [
"DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
],
repoMachinesForAuthenticatedUser: [
"GET /repos/{owner}/{repo}/codespaces/machines"
],
setRepositoriesForSecretForAuthenticatedUser: [
"PUT /user/codespaces/secrets/{secret_name}/repositories"
],
setSelectedReposForOrgSecret: [
"PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
],
startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
stopInOrganization: [
"POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
],
updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
},
copilot: {
addCopilotSeatsForTeams: [
"POST /orgs/{org}/copilot/billing/selected_teams"
],
addCopilotSeatsForUsers: [
"POST /orgs/{org}/copilot/billing/selected_users"
],
cancelCopilotSeatAssignmentForTeams: [
"DELETE /orgs/{org}/copilot/billing/selected_teams"
],
cancelCopilotSeatAssignmentForUsers: [
"DELETE /orgs/{org}/copilot/billing/selected_users"
],
getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
getCopilotSeatDetailsForUser: [
"GET /orgs/{org}/members/{username}/copilot"
],
listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"],
usageMetricsForEnterprise: ["GET /enterprises/{enterprise}/copilot/usage"],
usageMetricsForOrg: ["GET /orgs/{org}/copilot/usage"],
usageMetricsForTeam: ["GET /orgs/{org}/team/{team_slug}/copilot/usage"]
},
dependabot: {
addSelectedRepoToOrgSecret: [
"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
],
createOrUpdateOrgSecret: [
"PUT /orgs/{org}/dependabot/secrets/{secret_name}"
],
createOrUpdateRepoSecret: [
"PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
],
deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
deleteRepoSecret: [
"DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
],
getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
getRepoPublicKey: [
"GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
],
getRepoSecret: [
"GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
],
listAlertsForEnterprise: [
"GET /enterprises/{enterprise}/dependabot/alerts"
],
listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
listSelectedReposForOrgSecret: [
"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
],
removeSelectedRepoFromOrgSecret: [
"DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
],
setSelectedReposForOrgSecret: [
"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
],
updateAlert: [
"PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
]
},
dependencyGraph: {
createRepositorySnapshot: [
"POST /repos/{owner}/{repo}/dependency-graph/snapshots"
],
diffRange: [
"GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
],
exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
},
emojis: { get: ["GET /emojis"] },
gists: {
checkIsStarred: ["GET /gists/{gist_id}/star"],
create: ["POST /gists"],
createComment: ["POST /gists/{gist_id}/comments"],
delete: ["DELETE /gists/{gist_id}"],
deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
fork: ["POST /gists/{gist_id}/forks"],
get: ["GET /gists/{gist_id}"],
getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
getRevision: ["GET /gists/{gist_id}/{sha}"],
list: ["GET /gists"],
listComments: ["GET /gists/{gist_id}/comments"],
listCommits: ["GET /gists/{gist_id}/commits"],
listForUser: ["GET /users/{username}/gists"],
listForks: ["GET /gists/{gist_id}/forks"],
listPublic: ["GET /gists/public"],
listStarred: ["GET /gists/starred"],
star: ["PUT /gists/{gist_id}/star"],
unstar: ["DELETE /gists/{gist_id}/star"],
update: ["PATCH /gists/{gist_id}"],
updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
},
git: {
createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
createRef: ["POST /repos/{owner}/{repo}/git/refs"],
createTag: ["POST /repos/{owner}/{repo}/git/tags"],
createTree: ["POST /repos/{owner}/{repo}/git/trees"],
deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
},
gitignore: {
getAllTemplates: ["GET /gitignore/templates"],
getTemplate: ["GET /gitignore/templates/{name}"]
},
interactions: {
getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
getRestrictionsForYourPublicRepos: [
"GET /user/interaction-limits",
{},
{ renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
],
removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
removeRestrictionsForRepo: [
"DELETE /repos/{owner}/{repo}/interaction-limits"
],
removeRestrictionsForYourPublicRepos: [
"DELETE /user/interaction-limits",
{},
{ renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
],
setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
setRestrictionsForYourPublicRepos: [
"PUT /user/interaction-limits",
{},
{ renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
]
},
issues: {
addAssignees: [
"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
],
addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
checkUserCanBeAssignedToIssue: [
"GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
],
create: ["POST /repos/{owner}/{repo}/issues"],
createComment: [
"POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
],
createLabel: ["POST /repos/{owner}/{repo}/labels"],
createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
deleteComment: [
"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
],
deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
deleteMilestone: [
"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
],
get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
list: ["GET /issues"],
listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
listEventsForTimeline: [
"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
],
listForAuthenticatedUser: ["GET /user/issues"],
listForOrg: ["GET /orgs/{org}/issues"],
listForRepo: ["GET /repos/{owner}/{repo}/issues"],
listLabelsForMilestone: [
"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
],
listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
listLabelsOnIssue: [
"GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
],
listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
removeAllLabels: [
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
],
removeAssignees: [
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
],
removeLabel: [
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
],
setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
updateMilestone: [
"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
]
},
licenses: {
get: ["GET /licenses/{license}"],
getAllCommonlyUsed: ["GET /licenses"],
getForRepo: ["GET /repos/{owner}/{repo}/license"]
},
markdown: {
render: ["POST /markdown"],
renderRaw: [
"POST /markdown/raw",
{ headers: { "content-type": "text/plain; charset=utf-8" } }
]
},
meta: {
get: ["GET /meta"],
getAllVersions: ["GET /versions"],
getOctocat: ["GET /octocat"],
getZen: ["GET /zen"],
root: ["GET /"]
},
migrations: {
deleteArchiveForAuthenticatedUser: [
"DELETE /user/migrations/{migration_id}/archive"
],
deleteArchiveForOrg: [
"DELETE /orgs/{org}/migrations/{migration_id}/archive"
],
downloadArchiveForOrg: [
"GET /orgs/{org}/migrations/{migration_id}/archive"
],
getArchiveForAuthenticatedUser: [
"GET /user/migrations/{migration_id}/archive"
],
getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
listForAuthenticatedUser: ["GET /user/migrations"],
listForOrg: ["GET /orgs/{org}/migrations"],
listReposForAuthenticatedUser: [
"GET /user/migrations/{migration_id}/repositories"
],
listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
listReposForUser: [
"GET /user/migrations/{migration_id}/repositories",
{},
{ renamed: ["migrations", "listReposForAuthenticatedUser"] }
],
startForAuthenticatedUser: ["POST /user/migrations"],
startForOrg: ["POST /orgs/{org}/migrations"],
unlockRepoForAuthenticatedUser: [
"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
],
unlockRepoForOrg: [
"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
]
},
oidc: {
getOidcCustomSubTemplateForOrg: [
"GET /orgs/{org}/actions/oidc/customization/sub"
],
updateOidcCustomSubTemplateForOrg: [
"PUT /orgs/{org}/actions/oidc/customization/sub"
]
},
orgs: {
addSecurityManagerTeam: [
"PUT /orgs/{org}/security-managers/teams/{team_slug}"
],
assignTeamToOrgRole: [
"PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
],
assignUserToOrgRole: [
"PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
],
blockUser: ["PUT /orgs/{org}/blocks/{username}"],
cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
convertMemberToOutsideCollaborator: [
"PUT /orgs/{org}/outside_collaborators/{username}"
],
createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
createInvitation: ["POST /orgs/{org}/invitations"],
createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
createOrUpdateCustomPropertiesValuesForRepos: [
"PATCH /orgs/{org}/properties/values"
],
createOrUpdateCustomProperty: [
"PUT /orgs/{org}/properties/schema/{custom_property_name}"
],
createWebhook: ["POST /orgs/{org}/hooks"],
delete: ["DELETE /orgs/{org}"],
deleteCustomOrganizationRole: [
"DELETE /orgs/{org}/organization-roles/{role_id}"
],
deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
enableOrDisableSecurityProductOnAllOrgRepos: [
"POST /orgs/{org}/{security_product}/{enablement}"
],
get: ["GET /orgs/{org}"],
getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
getCustomProperty: [
"GET /orgs/{org}/properties/schema/{custom_property_name}"
],
getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
getWebhookDelivery: [
"GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
],
list: ["GET /organizations"],
listAppInstallations: ["GET /orgs/{org}/installations"],
listBlockedUsers: ["GET /orgs/{org}/blocks"],
listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
listForAuthenticatedUser: ["GET /user/orgs"],
listForUser: ["GET /users/{username}/orgs"],
listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
listMembers: ["GET /orgs/{org}/members"],
listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
listOrgRoles: ["GET /orgs/{org}/organization-roles"],
listOrganizationFineGrainedPermissions: [
"GET /orgs/{org}/organization-fine-grained-permissions"
],
listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
listPatGrantRepositories: [
"GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
],
listPatGrantRequestRepositories: [
"GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
],
listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
listPendingInvitations: ["GET /orgs/{org}/invitations"],
listPublicMembers: ["GET /orgs/{org}/public_members"],
listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
listWebhooks: ["GET /orgs/{org}/hooks"],
patchCustomOrganizationRole: [
"PATCH /orgs/{org}/organization-roles/{role_id}"
],
pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
redeliverWebhookDelivery: [
"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
],
removeCustomProperty: [
"DELETE /orgs/{org}/properties/schema/{custom_property_name}"
],
removeMember: ["DELETE /orgs/{org}/members/{username}"],
removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
removeOutsideCollaborator: [
"DELETE /orgs/{org}/outside_collaborators/{username}"
],
removePublicMembershipForAuthenticatedUser: [
"DELETE /orgs/{org}/public_members/{username}"
],
removeSecurityManagerTeam: [
"DELETE /orgs/{org}/security-managers/teams/{team_slug}"
],
reviewPatGrantRequest: [
"POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
],
reviewPatGrantRequestsInBulk: [
"POST /orgs/{org}/personal-access-token-requests"
],
revokeAllOrgRolesTeam: [
"DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
],
revokeAllOrgRolesUser: [
"DELETE /orgs/{org}/organization-roles/users/{username}"
],
revokeOrgRoleTeam: [
"DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
],
revokeOrgRoleUser: [
"DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
],
setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
setPublicMembershipForAuthenticatedUser: [
"PUT /orgs/{org}/public_members/{username}"
],
unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
update: ["PATCH /orgs/{org}"],
updateMembershipForAuthenticatedUser: [
"PATCH /user/memberships/orgs/{org}"
],
updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
},
packages: {
deletePackageForAuthenticatedUser: [
"DELETE /user/packages/{package_type}/{package_name}"
],
deletePackageForOrg: [
"DELETE /orgs/{org}/packages/{package_type}/{package_name}"
],
deletePackageForUser: [
"DELETE /users/{username}/packages/{package_type}/{package_name}"
],
deletePackageVersionForAuthenticatedUser: [
"DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
],
deletePackageVersionForOrg: [
"DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
],
deletePackageVersionForUser: [
"DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
],
getAllPackageVersionsForAPackageOwnedByAnOrg: [
"GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
{},
{ renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
],
getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
"GET /user/packages/{package_type}/{package_name}/versions",
{},
{
renamed: [
"packages",
"getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
]
}
],
getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
"GET /user/packages/{package_type}/{package_name}/versions"
],
getAllPackageVersionsForPackageOwnedByOrg: [
"GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
],
getAllPackageVersionsForPackageOwnedByUser: [
"GET /users/{username}/packages/{package_type}/{package_name}/versions"
],
getPackageForAuthenticatedUser: [
"GET /user/packages/{package_type}/{package_name}"
],
getPackageForOrganization: [
"GET /orgs/{org}/packages/{package_type}/{package_name}"
],
getPackageForUser: [
"GET /users/{username}/packages/{package_type}/{package_name}"
],
getPackageVersionForAuthenticatedUser: [
"GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
],
getPackageVersionForOrganization: [
"GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
],
getPackageVersionForUser: [
"GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
],
listDockerMigrationConflictingPackagesForAuthenticatedUser: [
"GET /user/docker/conflicts"
],
listDockerMigrationConflictingPackagesForOrganization: [
"GET /orgs/{org}/docker/conflicts"
],
listDockerMigrationConflictingPackagesForUser: [
"GET /users/{username}/docker/conflicts"
],
listPackagesForAuthenticatedUser: ["GET /user/packages"],
listPackagesForOrganization: ["GET /orgs/{org}/packages"],
listPackagesForUser: ["GET /users/{username}/packages"],
restorePackageForAuthenticatedUser: [
"POST /user/packages/{package_type}/{package_name}/restore{?token}"
],
restorePackageForOrg: [
"POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
],
restorePackageForUser: [
"POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
],
restorePackageVersionForAuthenticatedUser: [
"POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
],
restorePackageVersionForOrg: [
"POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
],
restorePackageVersionForUser: [
"POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
]
},
projects: {
addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
createCard: ["POST /projects/columns/{column_id}/cards"],
createColumn: ["POST /projects/{project_id}/columns"],
createForAuthenticatedUser: ["POST /user/projects"],
createForOrg: ["POST /orgs/{org}/projects"],
createForRepo: ["POST /repos/{owner}/{repo}/projects"],
delete: ["DELETE /projects/{project_id}"],
deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
deleteColumn: ["DELETE /projects/columns/{column_id}"],
get: ["GET /projects/{project_id}"],
getCard: ["GET /projects/columns/cards/{card_id}"],
getColumn: ["GET /projects/columns/{column_id}"],
getPermissionForUser: [
"GET /projects/{project_id}/collaborators/{username}/permission"
],
listCards: ["GET /projects/columns/{column_id}/cards"],
listCollaborators: ["GET /projects/{project_id}/collaborators"],
listColumns: ["GET /projects/{project_id}/columns"],
listForOrg: ["GET /orgs/{org}/projects"],
listForRepo: ["GET /repos/{owner}/{repo}/projects"],
listForUser: ["GET /users/{username}/projects"],
moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
moveColumn: ["POST /projects/columns/{column_id}/moves"],
removeCollaborator: [
"DELETE /projects/{project_id}/collaborators/{username}"
],
update: ["PATCH /projects/{project_id}"],
updateCard: ["PATCH /projects/columns/cards/{card_id}"],
updateColumn: ["PATCH /projects/columns/{column_id}"]
},
pulls: {
checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
create: ["POST /repos/{owner}/{repo}/pulls"],
createReplyForReviewComment: [
"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
],
createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
createReviewComment: [
"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
],
deletePendingReview: [
"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
],
deleteReviewComment: [
"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
],
dismissReview: [
"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
],
get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
getReview: [
"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
],
getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
list: ["GET /repos/{owner}/{repo}/pulls"],
listCommentsForReview: [
"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
],
listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
listRequestedReviewers: [
"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
],
listReviewComments: [
"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
],
listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
removeRequestedReviewers: [
"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
],
requestReviewers: [
"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
],
submitReview: [
"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
],
update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
updateBranch: [
"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
],
updateReview: [
"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
],
updateReviewComment: [
"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
]
},
rateLimit: { get: ["GET /rate_limit"] },
reactions: {
createForCommitComment: [
"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
],
createForIssue: [
"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
],
createForIssueComment: [
"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
],
createForPullRequestReviewComment: [
"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
],
createForRelease: [
"POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
],
createForTeamDiscussionCommentInOrg: [
"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
],
createForTeamDiscussionInOrg: [
"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
],
deleteForCommitComment: [
"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
],
deleteForIssue: [
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
],
deleteForIssueComment: [
"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
],
deleteForPullRequestComment: [
"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
],
deleteForRelease: [
"DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
],
deleteForTeamDiscussion: [
"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
],
deleteForTeamDiscussionComment: [
"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
],
listForCommitComment: [
"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
],
listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
listForIssueComment: [
"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
],
listForPullRequestReviewComment: [
"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
],
listForRelease: [
"GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
],
listForTeamDiscussionCommentInOrg: [
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
],
listForTeamDiscussionInOrg: [
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
]
},
repos: {
acceptInvitation: [
"PATCH /user/repository_invitations/{invitation_id}",
{},
{ renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
],
acceptInvitationForAuthenticatedUser: [
"PATCH /user/repository_invitations/{invitation_id}"
],
addAppAccessRestrictions: [
"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
{},
{ mapToData: "apps" }
],
addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
addStatusCheckContexts: [
"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
{},
{ mapToData: "contexts" }
],
addTeamAccessRestrictions: [
"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
{},
{ mapToData: "teams" }
],
addUserAccessRestrictions: [
"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
{},
{ mapToData: "users" }
],
cancelPagesDeployment: [
"POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
],
checkAutomatedSecurityFixes: [
"GET /repos/{owner}/{repo}/automated-security-fixes"
],
checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
checkPrivateVulnerabilityReporting: [
"GET /repos/{owner}/{repo}/private-vulnerability-reporting"
],
checkVulnerabilityAlerts: [
"GET /repos/{owner}/{repo}/vulnerability-alerts"
],
codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
compareCommitsWithBasehead: [
"GET /repos/{owner}/{repo}/compare/{basehead}"
],
createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
createCommitComment: [
"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
],
createCommitSignatureProtection: [
"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
],
createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
createDeploymentBranchPolicy: [
"POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
],
createDeploymentProtectionRule: [
"POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
],
createDeploymentStatus: [
"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
],
createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
createForAuthenticatedUser: ["POST /user/repos"],
createFork: ["POST /repos/{owner}/{repo}/forks"],
createInOrg: ["POST /orgs/{org}/repos"],
createOrUpdateCustomPropertiesValues: [
"PATCH /repos/{owner}/{repo}/properties/values"
],
createOrUpdateEnvironment: [
"PUT /repos/{owner}/{repo}/environments/{environment_name}"
],
createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
createOrgRuleset: ["POST /orgs/{org}/rulesets"],
createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
createRelease: ["POST /repos/{owner}/{repo}/releases"],
createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
createUsingTemplate: [
"POST /repos/{template_owner}/{template_repo}/generate"
],
createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
declineInvitation: [
"DELETE /user/repository_invitations/{invitation_id}",
{},
{ renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
],
declineInvitationForAuthenticatedUser: [
"DELETE /user/repository_invitations/{invitation_id}"
],
delete: ["DELETE /repos/{owner}/{repo}"],
deleteAccessRestrictions: [
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
],
deleteAdminBranchProtection: [
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
],
deleteAnEnvironment: [
"DELETE /repos/{owner}/{repo}/environments/{environment_name}"
],
deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
deleteBranchProtection: [
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
],
deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
deleteCommitSignatureProtection: [
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
],
deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
deleteDeployment: [
"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
],
deleteDeploymentBranchPolicy: [
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
],
deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
deleteInvitation: [
"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
],
deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
deletePullRequestReviewProtection: [
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
],
deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
deleteReleaseAsset: [
"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
],
deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
deleteTagProtection: [
"DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
],
deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
disableAutomatedSecurityFixes: [
"DELETE /repos/{owner}/{repo}/automated-security-fixes"
],
disableDeploymentProtectionRule: [
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
],
disablePrivateVulnerabilityReporting: [
"DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
],
disableVulnerabilityAlerts: [
"DELETE /repos/{owner}/{repo}/vulnerability-alerts"
],
downloadArchive: [
"GET /repos/{owner}/{repo}/zipball/{ref}",
{},
{ renamed: ["repos", "downloadZipballArchive"] }
],
downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
enableAutomatedSecurityFixes: [
"PUT /repos/{owner}/{repo}/automated-security-fixes"
],
enablePrivateVulnerabilityReporting: [
"PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
],
enableVulnerabilityAlerts: [
"PUT /repos/{owner}/{repo}/vulnerability-alerts"
],
generateReleaseNotes: [
"POST /repos/{owner}/{repo}/releases/generate-notes"
],
get: ["GET /repos/{owner}/{repo}"],
getAccessRestrictions: [
"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
],
getAdminBranchProtection: [
"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
],
getAllDeploymentProtectionRules: [
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
],
getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
getAllStatusCheckContexts: [
"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
],
getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
getAppsWithAccessToProtectedBranch: [
"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
],
getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
getBranchProtection: [
"GET /repos/{owner}/{repo}/branches/{branch}/protection"
],
getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
getCollaboratorPermissionLevel: [
"GET /repos/{owner}/{repo}/collaborators/{username}/permission"
],
getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
getCommitSignatureProtection: [
"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
],
getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
getCustomDeploymentProtectionRule: [
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
],
getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
getDeploymentBranchPolicy: [
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
],
getDeploymentStatus: [
"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
],
getEnvironment: [
"GET /repos/{owner}/{repo}/environments/{environment_name}"
],
getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
getOrgRulesets: ["GET /orgs/{org}/rulesets"],
getPages: ["GET /repos/{owner}/{repo}/pages"],
getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
getPagesDeployment: [
"GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
],
getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
getPullRequestReviewProtection: [
"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
],
getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
getReadme: ["GET /repos/{owner}/{repo}/readme"],
getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
getRepoRuleSuite: [
"GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
],
getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
getStatusChecksProtection: [
"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
],
getTeamsWithAccessToProtectedBranch: [
"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
],
getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
getUsersWithAccessToProtectedBranch: [
"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
],
getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
getWebhookConfigForRepo: [
"GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
],
getWebhookDelivery: [
"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
],
listActivities: ["GET /repos/{owner}/{repo}/activity"],
listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
listBranches: ["GET /repos/{owner}/{repo}/branches"],
listBranchesForHeadCommit: [
"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
],
listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
listCommentsForCommit: [
"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
],
listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
listCommitStatusesForRef: [
"GET /repos/{owner}/{repo}/commits/{ref}/statuses"
],
listCommits: ["GET /repos/{owner}/{repo}/commits"],
listContributors: ["GET /repos/{owner}/{repo}/contributors"],
listCustomDeploymentRuleIntegrations: [
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
],
listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
listDeploymentBranchPolicies: [
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
],
listDeploymentStatuses: [
"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
],
listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
listForAuthenticatedUser: ["GET /user/repos"],
listForOrg: ["GET /orgs/{org}/repos"],
listForUser: ["GET /users/{username}/repos"],
listForks: ["GET /repos/{owner}/{repo}/forks"],
listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
listLanguages: ["GET /repos/{owner}/{repo}/languages"],
listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
listPublic: ["GET /repositories"],
listPullRequestsAssociatedWithCommit: [
"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
],
listReleaseAssets: [
"GET /repos/{owner}/{repo}/releases/{release_id}/assets"
],
listReleases: ["GET /repos/{owner}/{repo}/releases"],
listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
listTags: ["GET /repos/{owner}/{repo}/tags"],
listTeams: ["GET /repos/{owner}/{repo}/teams"],
listWebhookDeliveries: [
"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
],
listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
merge: ["POST /repos/{owner}/{repo}/merges"],
mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
redeliverWebhookDelivery: [
"POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
],
removeAppAccessRestrictions: [
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
{},
{ mapToData: "apps" }
],
removeCollaborator: [
"DELETE /repos/{owner}/{repo}/collaborators/{username}"
],
removeStatusCheckContexts: [
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
{},
{ mapToData: "contexts" }
],
removeStatusCheckProtection: [
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
],
removeTeamAccessRestrictions: [
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
{},
{ mapToData: "teams" }
],
removeUserAccessRestrictions: [
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
{},
{ mapToData: "users" }
],
renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
setAdminBranchProtection: [
"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
],
setAppAccessRestrictions: [
"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
{},
{ mapToData: "apps" }
],
setStatusCheckContexts: [
"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
{},
{ mapToData: "contexts" }
],
setTeamAccessRestrictions: [
"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
{},
{ mapToData: "teams" }
],
setUserAccessRestrictions: [
"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
{},
{ mapToData: "users" }
],
testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
transfer: ["POST /repos/{owner}/{repo}/transfer"],
update: ["PATCH /repos/{owner}/{repo}"],
updateBranchProtection: [
"PUT /repos/{owner}/{repo}/branches/{branch}/protection"
],
updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
updateDeploymentBranchPolicy: [
"PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
],
updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
updateInvitation: [
"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
],
updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
updatePullRequestReviewProtection: [
"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
],
updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
updateReleaseAsset: [
"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
],
updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
updateStatusCheckPotection: [
"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
{},
{ renamed: ["repos", "updateStatusCheckProtection"] }
],
updateStatusCheckProtection: [
"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
],
updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
updateWebhookConfigForRepo: [
"PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
],
uploadReleaseAsset: [
"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
{ baseUrl: "https://uploads.github.com" }
]
},
search: {
code: ["GET /search/code"],
commits: ["GET /search/commits"],
issuesAndPullRequests: ["GET /search/issues"],
labels: ["GET /search/labels"],
repos: ["GET /search/repositories"],
topics: ["GET /search/topics"],
users: ["GET /search/users"]
},
secretScanning: {
getAlert: [
"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
],
listAlertsForEnterprise: [
"GET /enterprises/{enterprise}/secret-scanning/alerts"
],
listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
listLocationsForAlert: [
"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
],
updateAlert: [
"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
]
},
securityAdvisories: {
createFork: [
"POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
],
createPrivateVulnerabilityReport: [
"POST /repos/{owner}/{repo}/security-advisories/reports"
],
createRepositoryAdvisory: [
"POST /repos/{owner}/{repo}/security-advisories"
],
createRepositoryAdvisoryCveRequest: [
"POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
],
getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
getRepositoryAdvisory: [
"GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
],
listGlobalAdvisories: ["GET /advisories"],
listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
updateRepositoryAdvisory: [
"PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
]
},
teams: {
addOrUpdateMembershipForUserInOrg: [
"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
],
addOrUpdateProjectPermissionsInOrg: [
"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
],
addOrUpdateRepoPermissionsInOrg: [
"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
],
checkPermissionsForProjectInOrg: [
"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
],
checkPermissionsForRepoInOrg: [
"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
],
create: ["POST /orgs/{org}/teams"],
createDiscussionCommentInOrg: [
"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
],
createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
deleteDiscussionCommentInOrg: [
"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
],
deleteDiscussionInOrg: [
"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
],
deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
getByName: ["GET /orgs/{org}/teams/{team_slug}"],
getDiscussionCommentInOrg: [
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
],
getDiscussionInOrg: [
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
],
getMembershipForUserInOrg: [
"GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
],
list: ["GET /orgs/{org}/teams"],
listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
listDiscussionCommentsInOrg: [
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
],
listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
listForAuthenticatedUser: ["GET /user/teams"],
listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
listPendingInvitationsInOrg: [
"GET /orgs/{org}/teams/{team_slug}/invitations"
],
listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
removeMembershipForUserInOrg: [
"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
],
removeProjectInOrg: [
"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
],
removeRepoInOrg: [
"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
],
updateDiscussionCommentInOrg: [
"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
],
updateDiscussionInOrg: [
"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
],
updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
},
users: {
addEmailForAuthenticated: [
"POST /user/emails",
{},
{ renamed: ["users", "addEmailForAuthenticatedUser"] }
],
addEmailForAuthenticatedUser: ["POST /user/emails"],
addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
block: ["PUT /user/blocks/{username}"],
checkBlocked: ["GET /user/blocks/{username}"],
checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
createGpgKeyForAuthenticated: [
"POST /user/gpg_keys",
{},
{ renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
],
createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
createPublicSshKeyForAuthenticated: [
"POST /user/keys",
{},
{ renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
],
createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
deleteEmailForAuthenticated: [
"DELETE /user/emails",
{},
{ renamed: ["users", "deleteEmailForAuthenticatedUser"] }
],
deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
deleteGpgKeyForAuthenticated: [
"DELETE /user/gpg_keys/{gpg_key_id}",
{},
{ renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
],
deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
deletePublicSshKeyForAuthenticated: [
"DELETE /user/keys/{key_id}",
{},
{ renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
],
deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
deleteSshSigningKeyForAuthenticatedUser: [
"DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
],
follow: ["PUT /user/following/{username}"],
getAuthenticated: ["GET /user"],
getByUsername: ["GET /users/{username}"],
getContextForUser: ["GET /users/{username}/hovercard"],
getGpgKeyForAuthenticated: [
"GET /user/gpg_keys/{gpg_key_id}",
{},
{ renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
],
getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
getPublicSshKeyForAuthenticated: [
"GET /user/keys/{key_id}",
{},
{ renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
],
getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
getSshSigningKeyForAuthenticatedUser: [
"GET /user/ssh_signing_keys/{ssh_signing_key_id}"
],
list: ["GET /users"],
listBlockedByAuthenticated: [
"GET /user/blocks",
{},
{ renamed: ["users", "listBlockedByAuthenticatedUser"] }
],
listBlockedByAuthenticatedUser: ["GET /user/blocks"],
listEmailsForAuthenticated: [
"GET /user/emails",
{},
{ renamed: ["users", "listEmailsForAuthenticatedUser"] }
],
listEmailsForAuthenticatedUser: ["GET /user/emails"],
listFollowedByAuthenticated: [
"GET /user/following",
{},
{ renamed: ["users", "listFollowedByAuthenticatedUser"] }
],
listFollowedByAuthenticatedUser: ["GET /user/following"],
listFollowersForAuthenticatedUser: ["GET /user/followers"],
listFollowersForUser: ["GET /users/{username}/followers"],
listFollowingForUser: ["GET /users/{username}/following"],
listGpgKeysForAuthenticated: [
"GET /user/gpg_keys",
{},
{ renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
],
listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
listPublicEmailsForAuthenticated: [
"GET /user/public_emails",
{},
{ renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
],
listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
listPublicKeysForUser: ["GET /users/{username}/keys"],
listPublicSshKeysForAuthenticated: [
"GET /user/keys",
{},
{ renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
],
listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
setPrimaryEmailVisibilityForAuthenticated: [
"PATCH /user/email/visibility",
{},
{ renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
],
setPrimaryEmailVisibilityForAuthenticatedUser: [
"PATCH /user/email/visibility"
],
unblock: ["DELETE /user/blocks/{username}"],
unfollow: ["DELETE /user/following/{username}"],
updateAuthenticated: ["PATCH /user"]
}
};
var endpoints_default = Endpoints;
var endpointMethodsMap = /* @__PURE__ */ new Map();
for (const [scope, endpoints] of Object.entries(endpoints_default)) {
for (const [methodName, endpoint2] of Object.entries(endpoints)) {
const [route, defaults, decorations] = endpoint2;
const [method, url] = route.split(/ /);
const endpointDefaults = Object.assign(
{
method,
url
},
defaults
);
if (!endpointMethodsMap.has(scope)) {
endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
}
endpointMethodsMap.get(scope).set(methodName, {
scope,
methodName,
endpointDefaults,
decorations
});
}
}
var handler = {
has({ scope }, methodName) {
return endpointMethodsMap.get(scope).has(methodName);
},
getOwnPropertyDescriptor(target, methodName) {
return {
value: this.get(target, methodName),
// ensures method is in the cache
configurable: true,
writable: true,
enumerable: true
};
},
defineProperty(target, methodName, descriptor) {
Object.defineProperty(target.cache, methodName, descriptor);
return true;
},
deleteProperty(target, methodName) {
delete target.cache[methodName];
return true;
},
ownKeys({ scope }) {
return [...endpointMethodsMap.get(scope).keys()];
},
set(target, methodName, value) {
return target.cache[methodName] = value;
},
get({ octokit, scope, cache }, methodName) {
if (cache[methodName]) {
return cache[methodName];
}
const method = endpointMethodsMap.get(scope).get(methodName);
if (!method) {
return void 0;
}
const { endpointDefaults, decorations } = method;
if (decorations) {
cache[methodName] = decorate(
octokit,
scope,
methodName,
endpointDefaults,
decorations
);
} else {
cache[methodName] = octokit.request.defaults(endpointDefaults);
}
return cache[methodName];
}
};
function endpointsToMethods(octokit) {
const newMethods = {};
for (const scope of endpointMethodsMap.keys()) {
newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
}
return newMethods;
}
function decorate(octokit, scope, methodName, defaults, decorations) {
const requestWithDefaults = octokit.request.defaults(defaults);
function withDecorations(...args) {
let options = requestWithDefaults.endpoint.merge(...args);
if (decorations.mapToData) {
options = Object.assign({}, options, {
data: options[decorations.mapToData],
[decorations.mapToData]: void 0
});
return requestWithDefaults(options);
}
if (decorations.renamed) {
const [newScope, newMethodName] = decorations.renamed;
octokit.log.warn(
`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
);
}
if (decorations.deprecated) {
octokit.log.warn(decorations.deprecated);
}
if (decorations.renamedParameters) {
const options2 = requestWithDefaults.endpoint.merge(...args);
for (const [name, alias] of Object.entries(
decorations.renamedParameters
)) {
if (name in options2) {
octokit.log.warn(
`"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
);
if (!(alias in options2)) {
options2[alias] = options2[name];
}
delete options2[name];
}
}
return requestWithDefaults(options2);
}
return requestWithDefaults(...args);
}
return Object.assign(withDecorations, requestWithDefaults);
}
function restEndpointMethods(octokit) {
const api = endpointsToMethods(octokit);
return {
rest: api
};
}
restEndpointMethods.VERSION = VERSION6;
function legacyRestEndpointMethods(octokit) {
const api = endpointsToMethods(octokit);
return {
...api,
rest: api
};
}
legacyRestEndpointMethods.VERSION = VERSION6;
// node_modules/.pnpm/@octokit+plugin-retry@6.1.0_@octokit+core@5.2.0/node_modules/@octokit/plugin-retry/dist-web/index.js
init_dist_web8();
var import_light = __toESM(require_light());
init_dist_web4();
async function errorRequest(state, octokit, error, options) {
if (!error.request || !error.request.request) {
throw error;
}
if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {
const retries = options.request.retries != null ? options.request.retries : state.retries;
const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);
throw octokit.retry.retryRequest(error, retries, retryAfter);
}
throw error;
}
async function wrapRequest(state, octokit, request2, options) {
const limiter = new import_light.default();
limiter.on("failed", function(error, info) {
const maxRetries = ~~error.request.request.retries;
const after = ~~error.request.request.retryAfter;
options.request.retryCount = info.retryCount + 1;
if (maxRetries > info.retryCount) {
return after * state.retryAfterBaseValue;
}
});
return limiter.schedule(
requestWithGraphqlErrorHandling.bind(null, state, octokit, request2),
options
);
}
async function requestWithGraphqlErrorHandling(state, octokit, request2, options) {
const response = await request2(request2, options);
if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test(
response.data.errors[0].message
)) {
const error = new RequestError(response.data.errors[0].message, 500, {
request: options,
response
});
return errorRequest(state, octokit, error, options);
}
return response;
}
var VERSION7 = "6.1.0";
function retry(octokit, octokitOptions) {
const state = Object.assign(
{
enabled: true,
retryAfterBaseValue: 1e3,
doNotRetry: [400, 401, 403, 404, 422, 451],
retries: 3
},
octokitOptions.retry
);
if (state.enabled) {
octokit.hook.error("request", errorRequest.bind(null, state, octokit));
octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit));
}
return {
retry: {
retryRequest: (error, retries, retryAfter) => {
error.request.request = Object.assign({}, error.request.request, {
retries,
retryAfter
});
return error;
}
}
};
}
retry.VERSION = VERSION7;
// node_modules/.pnpm/@octokit+plugin-throttling@8.2.0_@octokit+core@5.2.0/node_modules/@octokit/plugin-throttling/dist-web/index.js
var import_light2 = __toESM(require_light());
init_dist_web8();
var VERSION8 = "8.2.0";
var noop2 = () => Promise.resolve();
function wrapRequest2(state, request2, options) {
return state.retryLimiter.schedule(doRequest, state, request2, options);
}
async function doRequest(state, request2, options) {
const isWrite = options.method !== "GET" && options.method !== "HEAD";
const { pathname } = new URL(options.url, "http://github.test");
const isSearch = options.method === "GET" && pathname.startsWith("/search/");
const isGraphQL = pathname.startsWith("/graphql");
const retryCount = ~~request2.retryCount;
const jobOptions = retryCount > 0 ? { priority: 0, weight: 0 } : {};
if (state.clustering) {
jobOptions.expiration = 1e3 * 60;
}
if (isWrite || isGraphQL) {
await state.write.key(state.id).schedule(jobOptions, noop2);
}
if (isWrite && state.triggersNotification(pathname)) {
await state.notifications.key(state.id).schedule(jobOptions, noop2);
}
if (isSearch) {
await state.search.key(state.id).schedule(jobOptions, noop2);
}
const req = state.global.key(state.id).schedule(jobOptions, request2, options);
if (isGraphQL) {
const res = await req;
if (res.data.errors != null && res.data.errors.some((error) => error.type === "RATE_LIMITED")) {
const error = Object.assign(new Error("GraphQL Rate Limit Exceeded"), {
response: res,
data: res.data
});
throw error;
}
}
return req;
}
var triggers_notification_paths_default = [
"/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"
];
function routeMatcher(paths) {
const regexes = paths.map(
(path) => path.split("/").map((c) => c.startsWith("{") ? "(?:.+?)" : c).join("/")
);
const regex2 = `^(?:${regexes.map((r2) => `(?:${r2})`).join("|")})[^/]*$`;
return new RegExp(regex2, "i");
}
var regex = routeMatcher(triggers_notification_paths_default);
var triggersNotification = regex.test.bind(regex);
var groups = {};
var createGroups = function(Bottleneck2, common) {
groups.global = new Bottleneck2.Group({
id: "octokit-global",
maxConcurrent: 10,
...common
});
groups.search = new Bottleneck2.Group({
id: "octokit-search",
maxConcurrent: 1,
minTime: 2e3,
...common
});
groups.write = new Bottleneck2.Group({
id: "octokit-write",
maxConcurrent: 1,
minTime: 1e3,
...common
});
groups.notifications = new Bottleneck2.Group({
id: "octokit-notifications",
maxConcurrent: 1,
minTime: 3e3,
...common
});
};
function throttling(octokit, octokitOptions) {
const {
enabled = true,
Bottleneck: Bottleneck2 = import_light2.default,
id = "no-id",
timeout = 1e3 * 60 * 2,
// Redis TTL: 2 minutes
connection
} = octokitOptions.throttle || {};
if (!enabled) {
return {};
}
const common = { connection, timeout };
if (groups.global == null) {
createGroups(Bottleneck2, common);
}
const state = Object.assign(
{
clustering: connection != null,
triggersNotification,
fallbackSecondaryRateRetryAfter: 60,
retryAfterBaseValue: 1e3,
retryLimiter: new Bottleneck2(),
id,
...groups
},
octokitOptions.throttle
);
if (typeof state.onSecondaryRateLimit !== "function" || typeof state.onRateLimit !== "function") {
throw new Error(`octokit/plugin-throttling error:
You must pass the onSecondaryRateLimit and onRateLimit error handlers.
See https://octokit.github.io/rest.js/#throttling
const octokit = new Octokit({
throttle: {
onSecondaryRateLimit: (retryAfter, options) => {/* ... */},
onRateLimit: (retryAfter, options) => {/* ... */}
}
})
`);
}
const events = {};
const emitter = new Bottleneck2.Events(events);
events.on("secondary-limit", state.onSecondaryRateLimit);
events.on("rate-limit", state.onRateLimit);
events.on(
"error",
(e2) => octokit.log.warn("Error in throttling-plugin limit handler", e2)
);
state.retryLimiter.on("failed", async function(error, info) {
const [state2, request2, options] = info.args;
const { pathname } = new URL(options.url, "http://github.test");
const shouldRetryGraphQL = pathname.startsWith("/graphql") && error.status !== 401;
if (!(shouldRetryGraphQL || error.status === 403)) {
return;
}
const retryCount = ~~request2.retryCount;
request2.retryCount = retryCount;
options.request.retryCount = retryCount;
const { wantRetry, retryAfter = 0 } = await async function() {
var _a3;
if (/\bsecondary rate\b/i.test(error.message)) {
const retryAfter2 = Number(error.response.headers["retry-after"]) || state2.fallbackSecondaryRateRetryAfter;
const wantRetry2 = await emitter.trigger(
"secondary-limit",
retryAfter2,
options,
octokit,
retryCount
);
return { wantRetry: wantRetry2, retryAfter: retryAfter2 };
}
if (error.response.headers != null && error.response.headers["x-ratelimit-remaining"] === "0" || (((_a3 = error.response.data) == null ? void 0 : _a3.errors) ?? []).some(
(error2) => error2.type === "RATE_LIMITED"
)) {
const rateLimitReset = new Date(
~~error.response.headers["x-ratelimit-reset"] * 1e3
).getTime();
const retryAfter2 = Math.max(
// Add one second so we retry _after_ the reset time
// https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#exceeding-the-rate-limit
Math.ceil((rateLimitReset - Date.now()) / 1e3) + 1,
0
);
const wantRetry2 = await emitter.trigger(
"rate-limit",
retryAfter2,
options,
octokit,
retryCount
);
return { wantRetry: wantRetry2, retryAfter: retryAfter2 };
}
return {};
}();
if (wantRetry) {
request2.retryCount++;
return retryAfter * state2.retryAfterBaseValue;
}
});
octokit.hook.wrap("request", wrapRequest2.bind(null, state));
return {};
}
throttling.VERSION = VERSION8;
throttling.triggersNotification = triggersNotification;
// node_modules/.pnpm/octokit@3.2.1/node_modules/octokit/dist-web/index.js
init_dist_web4();
// node_modules/.pnpm/@octokit+app@14.1.0/node_modules/@octokit/app/dist-web/index.js
init_dist_web8();
var import_auth_app = __toESM(require_dist_node());
var import_oauth_app = __toESM(require_dist_node2());
var import_auth_app2 = __toESM(require_dist_node());
init_dist_web13();
// node_modules/.pnpm/@octokit+webhooks@12.3.1/node_modules/@octokit/webhooks/dist-web/index.js
var import_aggregate_error = __toESM(require_aggregate_error());
// node_modules/.pnpm/@octokit+webhooks-methods@4.1.0/node_modules/@octokit/webhooks-methods/dist-web/index.js
var Algorithm = ((Algorithm2) => {
Algorithm2["SHA1"] = "sha1";
Algorithm2["SHA256"] = "sha256";
return Algorithm2;
})(Algorithm || {});
var getAlgorithm = (signature) => {
return signature.startsWith("sha256=") ? "sha256" : "sha1";
};
var enc = new TextEncoder();
function hexToUInt8Array(string) {
const pairs = string.match(/[\dA-F]{2}/gi);
const integers = pairs.map(function(s) {
return parseInt(s, 16);
});
return new Uint8Array(integers);
}
function UInt8ArrayToHex(signature) {
return Array.prototype.map.call(new Uint8Array(signature), (x) => x.toString(16).padStart(2, "0")).join("");
}
function getHMACHashName(algorithm) {
return {
[Algorithm.SHA1]: "SHA-1",
[Algorithm.SHA256]: "SHA-256"
}[algorithm];
}
async function importKey(secret, algorithm) {
return crypto.subtle.importKey(
"raw",
// raw format of the key - should be Uint8Array
enc.encode(secret),
{
// algorithm details
name: "HMAC",
hash: { name: getHMACHashName(algorithm) }
},
false,
// export = false
["sign", "verify"]
// what this key can do
);
}
async function sign(options, payload) {
const { secret, algorithm } = typeof options === "object" ? {
secret: options.secret,
algorithm: options.algorithm || Algorithm.SHA256
} : { secret: options, algorithm: Algorithm.SHA256 };
if (!secret || !payload) {
throw new TypeError(
"[@octokit/webhooks-methods] secret & payload required for sign()"
);
}
if (typeof payload !== "string") {
throw new TypeError("[@octokit/webhooks-methods] payload must be a string");
}
if (!Object.values(Algorithm).includes(algorithm)) {
throw new TypeError(
`[@octokit/webhooks] Algorithm ${algorithm} is not supported. Must be 'sha1' or 'sha256'`
);
}
const signature = await crypto.subtle.sign(
"HMAC",
await importKey(secret, algorithm),
enc.encode(payload)
);
return `${algorithm}=${UInt8ArrayToHex(signature)}`;
}
async function verify(secret, eventPayload, signature) {
if (!secret || !eventPayload || !signature) {
throw new TypeError(
"[@octokit/webhooks-methods] secret, eventPayload & signature required"
);
}
if (typeof eventPayload !== "string") {
throw new TypeError(
"[@octokit/webhooks-methods] eventPayload must be a string"
);
}
const algorithm = getAlgorithm(signature);
return await crypto.subtle.verify(
"HMAC",
await importKey(secret, algorithm),
hexToUInt8Array(signature.replace(`${algorithm}=`, "")),
enc.encode(eventPayload)
);
}
// node_modules/.pnpm/@octokit+webhooks@12.3.1/node_modules/@octokit/webhooks/dist-web/index.js
var import_aggregate_error2 = __toESM(require_aggregate_error());
var import_aggregate_error3 = __toESM(require_aggregate_error());
var createLogger = (logger) => ({
debug: () => {
},
info: () => {
},
warn: console.warn.bind(console),
error: console.error.bind(console),
...logger
});
var emitterEventNames = [
"branch_protection_configuration",
"branch_protection_configuration.disabled",
"branch_protection_configuration.enabled",
"branch_protection_rule",
"branch_protection_rule.created",
"branch_protection_rule.deleted",
"branch_protection_rule.edited",
"check_run",
"check_run.completed",
"check_run.created",
"check_run.requested_action",
"check_run.rerequested",
"check_suite",
"check_suite.completed",
"check_suite.requested",
"check_suite.rerequested",
"code_scanning_alert",
"code_scanning_alert.appeared_in_branch",
"code_scanning_alert.closed_by_user",
"code_scanning_alert.created",
"code_scanning_alert.fixed",
"code_scanning_alert.reopened",
"code_scanning_alert.reopened_by_user",
"commit_comment",
"commit_comment.created",
"create",
"custom_property",
"custom_property.created",
"custom_property.deleted",
"custom_property_values",
"custom_property_values.updated",
"delete",
"dependabot_alert",
"dependabot_alert.created",
"dependabot_alert.dismissed",
"dependabot_alert.fixed",
"dependabot_alert.reintroduced",
"dependabot_alert.reopened",
"deploy_key",
"deploy_key.created",
"deploy_key.deleted",
"deployment",
"deployment.created",
"deployment_protection_rule",
"deployment_protection_rule.requested",
"deployment_review",
"deployment_review.approved",
"deployment_review.rejected",
"deployment_review.requested",
"deployment_status",
"deployment_status.created",
"discussion",
"discussion.answered",
"discussion.category_changed",
"discussion.created",
"discussion.deleted",
"discussion.edited",
"discussion.labeled",
"discussion.locked",
"discussion.pinned",
"discussion.transferred",
"discussion.unanswered",
"discussion.unlabeled",
"discussion.unlocked",
"discussion.unpinned",
"discussion_comment",
"discussion_comment.created",
"discussion_comment.deleted",
"discussion_comment.edited",
"fork",
"github_app_authorization",
"github_app_authorization.revoked",
"gollum",
"installation",
"installation.created",
"installation.deleted",
"installation.new_permissions_accepted",
"installation.suspend",
"installation.unsuspend",
"installation_repositories",
"installation_repositories.added",
"installation_repositories.removed",
"installation_target",
"installation_target.renamed",
"issue_comment",
"issue_comment.created",
"issue_comment.deleted",
"issue_comment.edited",
"issues",
"issues.assigned",
"issues.closed",
"issues.deleted",
"issues.demilestoned",
"issues.edited",
"issues.labeled",
"issues.locked",
"issues.milestoned",
"issues.opened",
"issues.pinned",
"issues.reopened",
"issues.transferred",
"issues.unassigned",
"issues.unlabeled",
"issues.unlocked",
"issues.unpinned",
"label",
"label.created",
"label.deleted",
"label.edited",
"marketplace_purchase",
"marketplace_purchase.cancelled",
"marketplace_purchase.changed",
"marketplace_purchase.pending_change",
"marketplace_purchase.pending_change_cancelled",
"marketplace_purchase.purchased",
"member",
"member.added",
"member.edited",
"member.removed",
"membership",
"membership.added",
"membership.removed",
"merge_group",
"merge_group.checks_requested",
"merge_group.destroyed",
"meta",
"meta.deleted",
"milestone",
"milestone.closed",
"milestone.created",
"milestone.deleted",
"milestone.edited",
"milestone.opened",
"org_block",
"org_block.blocked",
"org_block.unblocked",
"organization",
"organization.deleted",
"organization.member_added",
"organization.member_invited",
"organization.member_removed",
"organization.renamed",
"package",
"package.published",
"package.updated",
"page_build",
"ping",
"project",
"project.closed",
"project.created",
"project.deleted",
"project.edited",
"project.reopened",
"project_card",
"project_card.converted",
"project_card.created",
"project_card.deleted",
"project_card.edited",
"project_card.moved",
"project_column",
"project_column.created",
"project_column.deleted",
"project_column.edited",
"project_column.moved",
"projects_v2_item",
"projects_v2_item.archived",
"projects_v2_item.converted",
"projects_v2_item.created",
"projects_v2_item.deleted",
"projects_v2_item.edited",
"projects_v2_item.reordered",
"projects_v2_item.restored",
"public",
"pull_request",
"pull_request.assigned",
"pull_request.auto_merge_disabled",
"pull_request.auto_merge_enabled",
"pull_request.closed",
"pull_request.converted_to_draft",
"pull_request.demilestoned",
"pull_request.dequeued",
"pull_request.edited",
"pull_request.enqueued",
"pull_request.labeled",
"pull_request.locked",
"pull_request.milestoned",
"pull_request.opened",
"pull_request.ready_for_review",
"pull_request.reopened",
"pull_request.review_request_removed",
"pull_request.review_requested",
"pull_request.synchronize",
"pull_request.unassigned",
"pull_request.unlabeled",
"pull_request.unlocked",
"pull_request_review",
"pull_request_review.dismissed",
"pull_request_review.edited",
"pull_request_review.submitted",
"pull_request_review_comment",
"pull_request_review_comment.created",
"pull_request_review_comment.deleted",
"pull_request_review_comment.edited",
"pull_request_review_thread",
"pull_request_review_thread.resolved",
"pull_request_review_thread.unresolved",
"push",
"registry_package",
"registry_package.published",
"registry_package.updated",
"release",
"release.created",
"release.deleted",
"release.edited",
"release.prereleased",
"release.published",
"release.released",
"release.unpublished",
"repository",
"repository.archived",
"repository.created",
"repository.deleted",
"repository.edited",
"repository.privatized",
"repository.publicized",
"repository.renamed",
"repository.transferred",
"repository.unarchived",
"repository_dispatch",
"repository_import",
"repository_vulnerability_alert",
"repository_vulnerability_alert.create",
"repository_vulnerability_alert.dismiss",
"repository_vulnerability_alert.reopen",
"repository_vulnerability_alert.resolve",
"secret_scanning_alert",
"secret_scanning_alert.created",
"secret_scanning_alert.reopened",
"secret_scanning_alert.resolved",
"secret_scanning_alert.revoked",
"secret_scanning_alert_location",
"secret_scanning_alert_location.created",
"security_advisory",
"security_advisory.performed",
"security_advisory.published",
"security_advisory.updated",
"security_advisory.withdrawn",
"sponsorship",
"sponsorship.cancelled",
"sponsorship.created",
"sponsorship.edited",
"sponsorship.pending_cancellation",
"sponsorship.pending_tier_change",
"sponsorship.tier_changed",
"star",
"star.created",
"star.deleted",
"status",
"team",
"team.added_to_repository",
"team.created",
"team.deleted",
"team.edited",
"team.removed_from_repository",
"team_add",
"watch",
"watch.started",
"workflow_dispatch",
"workflow_job",
"workflow_job.completed",
"workflow_job.in_progress",
"workflow_job.queued",
"workflow_job.waiting",
"workflow_run",
"workflow_run.completed",
"workflow_run.in_progress",
"workflow_run.requested"
];
function handleEventHandlers(state, webhookName, handler2) {
if (!state.hooks[webhookName]) {
state.hooks[webhookName] = [];
}
state.hooks[webhookName].push(handler2);
}
function receiverOn(state, webhookNameOrNames, handler2) {
if (Array.isArray(webhookNameOrNames)) {
webhookNameOrNames.forEach(
(webhookName) => receiverOn(state, webhookName, handler2)
);
return;
}
if (["*", "error"].includes(webhookNameOrNames)) {
const webhookName = webhookNameOrNames === "*" ? "any" : webhookNameOrNames;
const message = `Using the "${webhookNameOrNames}" event with the regular Webhooks.on() function is not supported. Please use the Webhooks.on${webhookName.charAt(0).toUpperCase() + webhookName.slice(1)}() method instead`;
throw new Error(message);
}
if (!emitterEventNames.includes(webhookNameOrNames)) {
state.log.warn(
`"${webhookNameOrNames}" is not a known webhook name (https://developer.github.com/v3/activity/events/types/)`
);
}
handleEventHandlers(state, webhookNameOrNames, handler2);
}
function receiverOnAny(state, handler2) {
handleEventHandlers(state, "*", handler2);
}
function receiverOnError(state, handler2) {
handleEventHandlers(state, "error", handler2);
}
function wrapErrorHandler(handler2, error) {
let returnValue;
try {
returnValue = handler2(error);
} catch (error2) {
console.log('FATAL: Error occurred in "error" event handler');
console.log(error2);
}
if (returnValue && returnValue.catch) {
returnValue.catch((error2) => {
console.log('FATAL: Error occurred in "error" event handler');
console.log(error2);
});
}
}
function getHooks(state, eventPayloadAction, eventName) {
const hooks = [state.hooks[eventName], state.hooks["*"]];
if (eventPayloadAction) {
hooks.unshift(state.hooks[`${eventName}.${eventPayloadAction}`]);
}
return [].concat(...hooks.filter(Boolean));
}
function receiverHandle(state, event) {
const errorHandlers = state.hooks.error || [];
if (event instanceof Error) {
const error = Object.assign(new import_aggregate_error.default([event]), {
event,
errors: [event]
});
errorHandlers.forEach((handler2) => wrapErrorHandler(handler2, error));
return Promise.reject(error);
}
if (!event || !event.name) {
throw new import_aggregate_error.default(["Event name not passed"]);
}
if (!event.payload) {
throw new import_aggregate_error.default(["Event payload not passed"]);
}
const hooks = getHooks(
state,
"action" in event.payload ? event.payload.action : null,
event.name
);
if (hooks.length === 0) {
return Promise.resolve();
}
const errors = [];
const promises = hooks.map((handler2) => {
let promise = Promise.resolve(event);
if (state.transform) {
promise = promise.then(state.transform);
}
return promise.then((event2) => {
return handler2(event2);
}).catch((error) => errors.push(Object.assign(error, { event })));
});
return Promise.all(promises).then(() => {
if (errors.length === 0) {
return;
}
const error = new import_aggregate_error.default(errors);
Object.assign(error, {
event,
errors
});
errorHandlers.forEach((handler2) => wrapErrorHandler(handler2, error));
throw error;
});
}
function removeListener(state, webhookNameOrNames, handler2) {
if (Array.isArray(webhookNameOrNames)) {
webhookNameOrNames.forEach(
(webhookName) => removeListener(state, webhookName, handler2)
);
return;
}
if (!state.hooks[webhookNameOrNames]) {
return;
}
for (let i2 = state.hooks[webhookNameOrNames].length - 1; i2 >= 0; i2--) {
if (state.hooks[webhookNameOrNames][i2] === handler2) {
state.hooks[webhookNameOrNames].splice(i2, 1);
return;
}
}
}
function createEventHandler(options) {
const state = {
hooks: {},
log: createLogger(options && options.log)
};
if (options && options.transform) {
state.transform = options.transform;
}
return {
on: receiverOn.bind(null, state),
onAny: receiverOnAny.bind(null, state),
onError: receiverOnError.bind(null, state),
removeListener: removeListener.bind(null, state),
receive: receiverHandle.bind(null, state)
};
}
async function verifyAndReceive(state, event) {
const matchesSignature = await verify(
state.secret,
event.payload,
event.signature
).catch(() => false);
if (!matchesSignature) {
const error = new Error(
"[@octokit/webhooks] signature does not match event payload and secret"
);
return state.eventHandler.receive(
Object.assign(error, { event, status: 400 })
);
}
let payload;
try {
payload = JSON.parse(event.payload);
} catch (error) {
error.message = "Invalid JSON";
error.status = 400;
throw new import_aggregate_error2.default([error]);
}
return state.eventHandler.receive({
id: event.id,
name: event.name,
payload
});
}
var WEBHOOK_HEADERS = [
"x-github-event",
"x-hub-signature-256",
"x-github-delivery"
];
function getMissingHeaders(request2) {
return WEBHOOK_HEADERS.filter((header) => !(header in request2.headers));
}
function getPayload(request2) {
if ("body" in request2) {
if (typeof request2.body === "object" && "rawBody" in request2 && request2.rawBody instanceof Buffer) {
return Promise.resolve(request2.rawBody.toString("utf8"));
} else {
return Promise.resolve(request2.body);
}
}
return new Promise((resolve, reject) => {
let data = [];
request2.on("error", (error) => reject(new import_aggregate_error3.default([error])));
request2.on("data", (chunk) => data.push(chunk));
request2.on(
"end",
() => (
// setImmediate improves the throughput by reducing the pressure from
// the event loop
setImmediate(
resolve,
data.length === 1 ? data[0].toString("utf8") : Buffer.concat(data).toString("utf8")
)
)
);
});
}
function onUnhandledRequestDefault(request2, response) {
response.writeHead(404, {
"content-type": "application/json"
});
response.end(
JSON.stringify({
error: `Unknown route: ${request2.method} ${request2.url}`
})
);
}
async function middleware(webhooks2, options, request2, response, next) {
let pathname;
try {
pathname = new URL(request2.url, "http://localhost").pathname;
} catch (error) {
response.writeHead(422, {
"content-type": "application/json"
});
response.end(
JSON.stringify({
error: `Request URL could not be parsed: ${request2.url}`
})
);
return true;
}
if (pathname !== options.path) {
next == null ? void 0 : next();
return false;
} else if (request2.method !== "POST") {
onUnhandledRequestDefault(request2, response);
return true;
}
if (!request2.headers["content-type"] || !request2.headers["content-type"].startsWith("application/json")) {
response.writeHead(415, {
"content-type": "application/json",
accept: "application/json"
});
response.end(
JSON.stringify({
error: `Unsupported "Content-Type" header value. Must be "application/json"`
})
);
return true;
}
const missingHeaders = getMissingHeaders(request2).join(", ");
if (missingHeaders) {
response.writeHead(400, {
"content-type": "application/json"
});
response.end(
JSON.stringify({
error: `Required headers missing: ${missingHeaders}`
})
);
return true;
}
const eventName = request2.headers["x-github-event"];
const signatureSHA256 = request2.headers["x-hub-signature-256"];
const id = request2.headers["x-github-delivery"];
options.log.debug(`${eventName} event received (id: ${id})`);
let didTimeout = false;
const timeout = setTimeout(() => {
didTimeout = true;
response.statusCode = 202;
response.end("still processing\n");
}, 9e3).unref();
try {
const payload = await getPayload(request2);
await webhooks2.verifyAndReceive({
id,
name: eventName,
payload,
signature: signatureSHA256
});
clearTimeout(timeout);
if (didTimeout)
return true;
response.end("ok\n");
return true;
} catch (error) {
clearTimeout(timeout);
if (didTimeout)
return true;
const err = Array.from(error)[0];
const errorMessage = err.message ? `${err.name}: ${err.message}` : "Error: An Unspecified error occurred";
response.statusCode = typeof err.status !== "undefined" ? err.status : 500;
options.log.error(error);
response.end(
JSON.stringify({
error: errorMessage
})
);
return true;
}
}
function createNodeMiddleware(webhooks2, {
path = "/api/github/webhooks",
log = createLogger()
} = {}) {
return middleware.bind(null, webhooks2, {
path,
log
});
}
var Webhooks = class {
constructor(options) {
if (!options || !options.secret) {
throw new Error("[@octokit/webhooks] options.secret required");
}
const state = {
eventHandler: createEventHandler(options),
secret: options.secret,
hooks: {},
log: createLogger(options.log)
};
this.sign = sign.bind(null, options.secret);
this.verify = verify.bind(null, options.secret);
this.on = state.eventHandler.on;
this.onAny = state.eventHandler.onAny;
this.onError = state.eventHandler.onError;
this.removeListener = state.eventHandler.removeListener;
this.receive = state.eventHandler.receive;
this.verifyAndReceive = verifyAndReceive.bind(null, state);
}
};
// node_modules/.pnpm/@octokit+plugin-paginate-rest@9.2.1_@octokit+core@5.2.0/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js
var VERSION13 = "9.2.1";
function normalizePaginatedListResponse2(response) {
if (!response.data) {
return {
...response,
data: []
};
}
const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
if (!responseNeedsNormalization)
return response;
const incompleteResults = response.data.incomplete_results;
const repositorySelection = response.data.repository_selection;
const totalCount = response.data.total_count;
delete response.data.incomplete_results;
delete response.data.repository_selection;
delete response.data.total_count;
const namespaceKey = Object.keys(response.data)[0];
const data = response.data[namespaceKey];
response.data = data;
if (typeof incompleteResults !== "undefined") {
response.data.incomplete_results = incompleteResults;
}
if (typeof repositorySelection !== "undefined") {
response.data.repository_selection = repositorySelection;
}
response.data.total_count = totalCount;
return response;
}
function iterator2(octokit, route, parameters) {
const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
const requestMethod = typeof route === "function" ? route : octokit.request;
const method = options.method;
const headers = options.headers;
let url = options.url;
return {
[Symbol.asyncIterator]: () => ({
async next() {
if (!url)
return { done: true };
try {
const response = await requestMethod({ method, url, headers });
const normalizedResponse = normalizePaginatedListResponse2(response);
url = ((normalizedResponse.headers.link || "").match(
/<([^>]+)>;\s*rel="next"/
) || [])[1];
return { value: normalizedResponse };
} catch (error) {
if (error.status !== 409)
throw error;
url = "";
return {
value: {
status: 200,
headers: {},
data: []
}
};
}
}
})
};
}
function paginate2(octokit, route, parameters, mapFn) {
if (typeof parameters === "function") {
mapFn = parameters;
parameters = void 0;
}
return gather2(
octokit,
[],
iterator2(octokit, route, parameters)[Symbol.asyncIterator](),
mapFn
);
}
function gather2(octokit, results, iterator22, mapFn) {
return iterator22.next().then((result) => {
if (result.done) {
return results;
}
let earlyExit = false;
function done() {
earlyExit = true;
}
results = results.concat(
mapFn ? mapFn(result.value, done) : result.value.data
);
if (earlyExit) {
return results;
}
return gather2(octokit, results, iterator22, mapFn);
});
}
var composePaginateRest2 = Object.assign(paginate2, {
iterator: iterator2
});
function paginateRest2(octokit) {
return {
paginate: Object.assign(paginate2.bind(null, octokit), {
iterator: iterator2.bind(null, octokit)
})
};
}
paginateRest2.VERSION = VERSION13;
// node_modules/.pnpm/@octokit+app@14.1.0/node_modules/@octokit/app/dist-web/index.js
var import_auth_app3 = __toESM(require_dist_node());
var import_oauth_app2 = __toESM(require_dist_node2());
var VERSION14 = "14.1.0";
function webhooks(appOctokit, options) {
return new Webhooks({
secret: options.secret,
transform: async (event) => {
if (!("installation" in event.payload) || typeof event.payload.installation !== "object") {
const octokit2 = new appOctokit.constructor({
authStrategy: createUnauthenticatedAuth,
auth: {
reason: `"installation" key missing in webhook event payload`
}
});
return {
...event,
octokit: octokit2
};
}
const installationId = event.payload.installation.id;
const octokit = await appOctokit.auth({
type: "installation",
installationId,
factory(auth6) {
return new auth6.octokit.constructor({
...auth6.octokitOptions,
authStrategy: import_auth_app2.createAppAuth,
...{
auth: {
...auth6,
installationId
}
}
});
}
});
octokit.hook.before("request", (options2) => {
options2.headers["x-github-delivery"] = event.id;
});
return {
...event,
octokit
};
}
});
}
async function getInstallationOctokit(app, installationId) {
return app.octokit.auth({
type: "installation",
installationId,
factory(auth6) {
const options = {
...auth6.octokitOptions,
authStrategy: import_auth_app3.createAppAuth,
...{ auth: { ...auth6, installationId } }
};
return new auth6.octokit.constructor(options);
}
});
}
function eachInstallationFactory(app) {
return Object.assign(eachInstallation.bind(null, app), {
iterator: eachInstallationIterator.bind(null, app)
});
}
async function eachInstallation(app, callback) {
const i2 = eachInstallationIterator(app)[Symbol.asyncIterator]();
let result = await i2.next();
while (!result.done) {
await callback(result.value);
result = await i2.next();
}
}
function eachInstallationIterator(app) {
return {
async *[Symbol.asyncIterator]() {
const iterator3 = composePaginateRest2.iterator(
app.octokit,
"GET /app/installations"
);
for await (const { data: installations } of iterator3) {
for (const installation of installations) {
const installationOctokit = await getInstallationOctokit(
app,
installation.id
);
yield { octokit: installationOctokit, installation };
}
}
}
};
}
function eachRepositoryFactory(app) {
return Object.assign(eachRepository.bind(null, app), {
iterator: eachRepositoryIterator.bind(null, app)
});
}
async function eachRepository(app, queryOrCallback, callback) {
const i2 = eachRepositoryIterator(
app,
callback ? queryOrCallback : void 0
)[Symbol.asyncIterator]();
let result = await i2.next();
while (!result.done) {
if (callback) {
await callback(result.value);
} else {
await queryOrCallback(result.value);
}
result = await i2.next();
}
}
function singleInstallationIterator(app, installationId) {
return {
async *[Symbol.asyncIterator]() {
yield {
octokit: await app.getInstallationOctokit(installationId)
};
}
};
}
function eachRepositoryIterator(app, query) {
return {
async *[Symbol.asyncIterator]() {
const iterator3 = query ? singleInstallationIterator(app, query.installationId) : app.eachInstallation.iterator();
for await (const { octokit } of iterator3) {
const repositoriesIterator = composePaginateRest2.iterator(
octokit,
"GET /installation/repositories"
);
for await (const { data: repositories } of repositoriesIterator) {
for (const repository of repositories) {
yield { octokit, repository };
}
}
}
}
};
}
function noop3() {
}
function createNodeMiddleware2(app, options = {}) {
const log = Object.assign(
{
debug: noop3,
info: noop3,
warn: console.warn.bind(console),
error: console.error.bind(console)
},
options.log
);
const optionsWithDefaults = {
pathPrefix: "/api/github",
...options,
log
};
const webhooksMiddleware = createNodeMiddleware(app.webhooks, {
path: optionsWithDefaults.pathPrefix + "/webhooks",
log
});
const oauthMiddleware = (0, import_oauth_app2.createNodeMiddleware)(app.oauth, {
pathPrefix: optionsWithDefaults.pathPrefix + "/oauth"
});
return middleware2.bind(
null,
optionsWithDefaults.pathPrefix,
webhooksMiddleware,
oauthMiddleware
);
}
async function middleware2(pathPrefix, webhooksMiddleware, oauthMiddleware, request2, response, next) {
const { pathname } = new URL(request2.url, "http://localhost");
if (pathname.startsWith(`${pathPrefix}/`)) {
if (pathname === `${pathPrefix}/webhooks`) {
webhooksMiddleware(request2, response);
} else if (pathname.startsWith(`${pathPrefix}/oauth/`)) {
oauthMiddleware(request2, response);
} else {
(0, import_oauth_app2.sendNodeResponse)((0, import_oauth_app2.unknownRouteResponse)(request2), response);
}
return true;
} else {
next == null ? void 0 : next();
return false;
}
}
var _a2;
var App = (_a2 = class {
static defaults(defaults) {
const AppWithDefaults = class extends this {
constructor(...args) {
super({
...defaults,
...args[0]
});
}
};
return AppWithDefaults;
}
constructor(options) {
const Octokit3 = options.Octokit || Octokit;
const authOptions = Object.assign(
{
appId: options.appId,
privateKey: options.privateKey
},
options.oauth ? {
clientId: options.oauth.clientId,
clientSecret: options.oauth.clientSecret
} : {}
);
this.octokit = new Octokit3({
authStrategy: import_auth_app.createAppAuth,
auth: authOptions,
log: options.log
});
this.log = Object.assign(
{
debug: () => {
},
info: () => {
},
warn: console.warn.bind(console),
error: console.error.bind(console)
},
options.log
);
if (options.webhooks) {
this.webhooks = webhooks(this.octokit, options.webhooks);
} else {
Object.defineProperty(this, "webhooks", {
get() {
throw new Error("[@octokit/app] webhooks option not set");
}
});
}
if (options.oauth) {
this.oauth = new import_oauth_app.OAuthApp({
...options.oauth,
clientType: "github-app",
Octokit: Octokit3
});
} else {
Object.defineProperty(this, "oauth", {
get() {
throw new Error(
"[@octokit/app] oauth.clientId / oauth.clientSecret options are not set"
);
}
});
}
this.getInstallationOctokit = getInstallationOctokit.bind(
null,
this
);
this.eachInstallation = eachInstallationFactory(
this
);
this.eachRepository = eachRepositoryFactory(
this
);
}
}, _a2.VERSION = VERSION14, _a2);
// node_modules/.pnpm/octokit@3.2.1/node_modules/octokit/dist-web/index.js
var import_oauth_app3 = __toESM(require_dist_node2());
var VERSION15 = "3.2.1";
var Octokit2 = Octokit.plugin(
restEndpointMethods,
paginateRest,
paginateGraphql,
retry,
throttling
).defaults({
userAgent: `octokit.js/${VERSION15}`,
throttle: {
onRateLimit,
onSecondaryRateLimit
}
});
function onRateLimit(retryAfter, options, octokit) {
octokit.log.warn(
`Request quota exhausted for request ${options.method} ${options.url}`
);
if (options.request.retryCount === 0) {
octokit.log.info(`Retrying after ${retryAfter} seconds!`);
return true;
}
}
function onSecondaryRateLimit(retryAfter, options, octokit) {
octokit.log.warn(
`SecondaryRateLimit detected for request ${options.method} ${options.url}`
);
if (options.request.retryCount === 0) {
octokit.log.info(`Retrying after ${retryAfter} seconds!`);
return true;
}
}
var App2 = App.defaults({ Octokit: Octokit2 });
var OAuthApp2 = import_oauth_app3.OAuthApp.defaults({ Octokit: Octokit2 });
export {
App2 as App,
OAuthApp2 as OAuthApp,
Octokit2 as Octokit,
RequestError,
createNodeMiddleware2 as createNodeMiddleware
};
//# sourceMappingURL=octokit.js.map