first commit

This commit is contained in:
2025-10-26 23:10:15 +08:00
commit 8f0345b7be
14961 changed files with 2356381 additions and 0 deletions

15
node_modules/@octokit/auth-token/dist-src/auth.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
import { isJWT } from "./is-jwt.js";
async function auth(token) {
const isApp = isJWT(token);
const isInstallation = token.startsWith("v1.") || token.startsWith("ghs_");
const isUserToServer = token.startsWith("ghu_");
const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
return {
type: "token",
token,
tokenType
};
}
export {
auth
};

12
node_modules/@octokit/auth-token/dist-src/hook.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import { withAuthorizationPrefix } from "./with-authorization-prefix.js";
async function hook(token, request, route, parameters) {
const endpoint = request.endpoint.merge(
route,
parameters
);
endpoint.headers.authorization = withAuthorizationPrefix(token);
return request(endpoint);
}
export {
hook
};

19
node_modules/@octokit/auth-token/dist-src/index.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import { auth } from "./auth.js";
import { hook } from "./hook.js";
const 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)
});
};
export {
createTokenAuth
};

7
node_modules/@octokit/auth-token/dist-src/is-jwt.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
const b64url = "(?:[a-zA-Z0-9_-]+)";
const sep = "\\.";
const jwtRE = new RegExp(`^${b64url}${sep}${b64url}${sep}${b64url}$`);
const isJWT = jwtRE.test.bind(jwtRE);
export {
isJWT
};

View File

@@ -0,0 +1,9 @@
function withAuthorizationPrefix(token) {
if (token.split(/\./).length === 3) {
return `bearer ${token}`;
}
return `token ${token}`;
}
export {
withAuthorizationPrefix
};