First upload version 0.0.1

This commit is contained in:
Neyra
2026-02-05 15:27:49 +08:00
commit 8e9b7201ed
4182 changed files with 593136 additions and 0 deletions

27
node_modules/@octokit/auth-oauth-app/dist-src/hook.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
import { requiresBasicAuth } from "@octokit/auth-oauth-user";
async function hook(state, request, route, parameters) {
let endpoint = request.endpoint.merge(
route,
parameters
);
if (/\/login\/(oauth\/access_token|device\/code)$/.test(endpoint.url)) {
return request(endpoint);
}
if (state.clientType === "github-app" && !requiresBasicAuth(endpoint.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}/**". "${endpoint.method} ${endpoint.url}" is not supported.`
);
}
const credentials = btoa(`${state.clientId}:${state.clientSecret}`);
endpoint.headers.authorization = `basic ${credentials}`;
try {
return await request(endpoint);
} catch (error) {
if (error.status !== 401) throw error;
error.message = `[@octokit/auth-oauth-app] "${endpoint.method} ${endpoint.url}" does not support clientId/clientSecret basic authentication.`;
throw error;
}
}
export {
hook
};