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

21
node_modules/@octokit/auth-oauth-app/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License
Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

1059
node_modules/@octokit/auth-oauth-app/README.md generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,94 @@
// pkg/dist-src/index.js
import { getUserAgent } from "universal-user-agent";
import { request } from "@octokit/request";
// pkg/dist-src/auth.js
import { createOAuthUserAuth } from "@octokit/auth-oauth-user";
async function auth(state, authOptions) {
if (authOptions.type === "oauth-app") {
return {
type: "oauth-app",
clientId: state.clientId,
clientSecret: state.clientSecret,
clientType: state.clientType,
headers: {
authorization: `basic ${btoa(
`${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 createOAuthUserAuth({
...common,
clientType: state.clientType
}) : await createOAuthUserAuth({
...common,
clientType: state.clientType
});
return userAuth();
}
// pkg/dist-src/hook.js
import { requiresBasicAuth } from "@octokit/auth-oauth-user";
async function hook(state, request2, route, parameters) {
let endpoint = request2.endpoint.merge(
route,
parameters
);
if (/\/login\/(oauth\/access_token|device\/code)$/.test(endpoint.url)) {
return request2(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 request2(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;
}
}
// pkg/dist-src/version.js
var VERSION = "0.0.0-development";
// pkg/dist-src/index.js
import { createOAuthUserAuth as createOAuthUserAuth2 } from "@octokit/auth-oauth-user";
function createOAuthAppAuth(options) {
const state = Object.assign(
{
request: request.defaults({
headers: {
"user-agent": `octokit-auth-oauth-app.js/${VERSION} ${getUserAgent()}`
}
}),
clientType: "oauth-app"
},
options
);
return Object.assign(auth.bind(null, state), {
hook: hook.bind(null, state)
});
}
export {
createOAuthAppAuth,
createOAuthUserAuth2 as createOAuthUserAuth
};

View File

@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../dist-src/index.js", "../dist-src/auth.js", "../dist-src/hook.js", "../dist-src/version.js"],
"sourcesContent": ["import { getUserAgent } from \"universal-user-agent\";\nimport { request } from \"@octokit/request\";\nimport { auth } from \"./auth.js\";\nimport { hook } from \"./hook.js\";\nimport { VERSION } from \"./version.js\";\nimport { createOAuthUserAuth } from \"@octokit/auth-oauth-user\";\nfunction createOAuthAppAuth(options) {\n const state = Object.assign(\n {\n request: request.defaults({\n headers: {\n \"user-agent\": `octokit-auth-oauth-app.js/${VERSION} ${getUserAgent()}`\n }\n }),\n clientType: \"oauth-app\"\n },\n options\n );\n return Object.assign(auth.bind(null, state), {\n hook: hook.bind(null, state)\n });\n}\nexport {\n createOAuthAppAuth,\n createOAuthUserAuth\n};\n", "import { createOAuthUserAuth } from \"@octokit/auth-oauth-user\";\nasync function auth(state, authOptions) {\n if (authOptions.type === \"oauth-app\") {\n return {\n type: \"oauth-app\",\n clientId: state.clientId,\n clientSecret: state.clientSecret,\n clientType: state.clientType,\n headers: {\n authorization: `basic ${btoa(\n `${state.clientId}:${state.clientSecret}`\n )}`\n }\n };\n }\n if (\"factory\" in authOptions) {\n const { type, ...options } = {\n ...authOptions,\n ...state\n };\n return authOptions.factory(options);\n }\n const common = {\n clientId: state.clientId,\n clientSecret: state.clientSecret,\n request: state.request,\n ...authOptions\n };\n const userAuth = state.clientType === \"oauth-app\" ? await createOAuthUserAuth({\n ...common,\n clientType: state.clientType\n }) : await createOAuthUserAuth({\n ...common,\n clientType: state.clientType\n });\n return userAuth();\n}\nexport {\n auth\n};\n", "import { requiresBasicAuth } from \"@octokit/auth-oauth-user\";\nasync function hook(state, request, route, parameters) {\n let endpoint = request.endpoint.merge(\n route,\n parameters\n );\n if (/\\/login\\/(oauth\\/access_token|device\\/code)$/.test(endpoint.url)) {\n return request(endpoint);\n }\n if (state.clientType === \"github-app\" && !requiresBasicAuth(endpoint.url)) {\n throw new Error(\n `[@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.`\n );\n }\n const credentials = btoa(`${state.clientId}:${state.clientSecret}`);\n endpoint.headers.authorization = `basic ${credentials}`;\n try {\n return await request(endpoint);\n } catch (error) {\n if (error.status !== 401) throw error;\n error.message = `[@octokit/auth-oauth-app] \"${endpoint.method} ${endpoint.url}\" does not support clientId/clientSecret basic authentication.`;\n throw error;\n }\n}\nexport {\n hook\n};\n", "const VERSION = \"0.0.0-development\";\nexport {\n VERSION\n};\n"],
"mappings": ";AAAA,SAAS,oBAAoB;AAC7B,SAAS,eAAe;;;ACDxB,SAAS,2BAA2B;AACpC,eAAe,KAAK,OAAO,aAAa;AACtC,MAAI,YAAY,SAAS,aAAa;AACpC,WAAO;AAAA,MACL,MAAM;AAAA,MACN,UAAU,MAAM;AAAA,MAChB,cAAc,MAAM;AAAA,MACpB,YAAY,MAAM;AAAA,MAClB,SAAS;AAAA,QACP,eAAe,SAAS;AAAA,UACtB,GAAG,MAAM,QAAQ,IAAI,MAAM,YAAY;AAAA,QACzC,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACA,MAAI,aAAa,aAAa;AAC5B,UAAM,EAAE,MAAM,GAAG,QAAQ,IAAI;AAAA,MAC3B,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AACA,WAAO,YAAY,QAAQ,OAAO;AAAA,EACpC;AACA,QAAM,SAAS;AAAA,IACb,UAAU,MAAM;AAAA,IAChB,cAAc,MAAM;AAAA,IACpB,SAAS,MAAM;AAAA,IACf,GAAG;AAAA,EACL;AACA,QAAM,WAAW,MAAM,eAAe,cAAc,MAAM,oBAAoB;AAAA,IAC5E,GAAG;AAAA,IACH,YAAY,MAAM;AAAA,EACpB,CAAC,IAAI,MAAM,oBAAoB;AAAA,IAC7B,GAAG;AAAA,IACH,YAAY,MAAM;AAAA,EACpB,CAAC;AACD,SAAO,SAAS;AAClB;;;ACpCA,SAAS,yBAAyB;AAClC,eAAe,KAAK,OAAOA,UAAS,OAAO,YAAY;AACrD,MAAI,WAAWA,SAAQ,SAAS;AAAA,IAC9B;AAAA,IACA;AAAA,EACF;AACA,MAAI,+CAA+C,KAAK,SAAS,GAAG,GAAG;AACrE,WAAOA,SAAQ,QAAQ;AAAA,EACzB;AACA,MAAI,MAAM,eAAe,gBAAgB,CAAC,kBAAkB,SAAS,GAAG,GAAG;AACzE,UAAM,IAAI;AAAA,MACR,8JAA8J,SAAS,MAAM,IAAI,SAAS,GAAG;AAAA,IAC/L;AAAA,EACF;AACA,QAAM,cAAc,KAAK,GAAG,MAAM,QAAQ,IAAI,MAAM,YAAY,EAAE;AAClE,WAAS,QAAQ,gBAAgB,SAAS,WAAW;AACrD,MAAI;AACF,WAAO,MAAMA,SAAQ,QAAQ;AAAA,EAC/B,SAAS,OAAO;AACd,QAAI,MAAM,WAAW,IAAK,OAAM;AAChC,UAAM,UAAU,8BAA8B,SAAS,MAAM,IAAI,SAAS,GAAG;AAC7E,UAAM;AAAA,EACR;AACF;;;ACvBA,IAAM,UAAU;;;AHKhB,SAAS,uBAAAC,4BAA2B;AACpC,SAAS,mBAAmB,SAAS;AACnC,QAAM,QAAQ,OAAO;AAAA,IACnB;AAAA,MACE,SAAS,QAAQ,SAAS;AAAA,QACxB,SAAS;AAAA,UACP,cAAc,6BAA6B,OAAO,IAAI,aAAa,CAAC;AAAA,QACtE;AAAA,MACF,CAAC;AAAA,MACD,YAAY;AAAA,IACd;AAAA,IACA;AAAA,EACF;AACA,SAAO,OAAO,OAAO,KAAK,KAAK,MAAM,KAAK,GAAG;AAAA,IAC3C,MAAM,KAAK,KAAK,MAAM,KAAK;AAAA,EAC7B,CAAC;AACH;",
"names": ["request", "createOAuthUserAuth"]
}

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

@@ -0,0 +1,40 @@
import { createOAuthUserAuth } from "@octokit/auth-oauth-user";
async function auth(state, authOptions) {
if (authOptions.type === "oauth-app") {
return {
type: "oauth-app",
clientId: state.clientId,
clientSecret: state.clientSecret,
clientType: state.clientType,
headers: {
authorization: `basic ${btoa(
`${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 createOAuthUserAuth({
...common,
clientType: state.clientType
}) : await createOAuthUserAuth({
...common,
clientType: state.clientType
});
return userAuth();
}
export {
auth
};

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
};

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

@@ -0,0 +1,26 @@
import { getUserAgent } from "universal-user-agent";
import { request } from "@octokit/request";
import { auth } from "./auth.js";
import { hook } from "./hook.js";
import { VERSION } from "./version.js";
import { createOAuthUserAuth } from "@octokit/auth-oauth-user";
function createOAuthAppAuth(options) {
const state = Object.assign(
{
request: request.defaults({
headers: {
"user-agent": `octokit-auth-oauth-app.js/${VERSION} ${getUserAgent()}`
}
}),
clientType: "oauth-app"
},
options
);
return Object.assign(auth.bind(null, state), {
hook: hook.bind(null, state)
});
}
export {
createOAuthAppAuth,
createOAuthUserAuth
};

View File

@@ -0,0 +1,4 @@
const VERSION = "9.0.3";
export {
VERSION
};

View File

@@ -0,0 +1,18 @@
import type { OAuthAppState, GitHubAppState, AppAuthOptions, WebFlowAuthOptions, OAuthAppDeviceFlowAuthOptions, GitHubAppDeviceFlowAuthOptions, FactoryOAuthAppWebFlow, FactoryOAuthAppDeviceFlow, FactoryGitHubWebFlow, FactoryGitHubDeviceFlow, AppAuthentication, OAuthAppUserAuthentication, GitHubAppUserAuthentication, GitHubAppUserAuthenticationWithExpiration } from "./types.js";
export declare function auth(state: OAuthAppState | GitHubAppState, authOptions: AppAuthOptions): Promise<AppAuthentication>;
export declare function auth(state: OAuthAppState, authOptions: WebFlowAuthOptions): Promise<OAuthAppUserAuthentication>;
export declare function auth<T = unknown>(state: OAuthAppState, authOptions: WebFlowAuthOptions & {
factory: FactoryOAuthAppWebFlow<T>;
}): Promise<T>;
export declare function auth(state: OAuthAppState, authOptions: OAuthAppDeviceFlowAuthOptions): Promise<OAuthAppUserAuthentication>;
export declare function auth<T = unknown>(state: OAuthAppState, authOptions: OAuthAppDeviceFlowAuthOptions & {
factory: FactoryOAuthAppDeviceFlow<T>;
}): Promise<T>;
export declare function auth(state: GitHubAppState, authOptions: WebFlowAuthOptions): Promise<GitHubAppUserAuthentication | GitHubAppUserAuthenticationWithExpiration>;
export declare function auth<T = unknown>(state: GitHubAppState, authOptions: WebFlowAuthOptions & {
factory: FactoryGitHubWebFlow<T>;
}): Promise<T>;
export declare function auth(state: GitHubAppState, authOptions: GitHubAppDeviceFlowAuthOptions): Promise<GitHubAppUserAuthentication | GitHubAppUserAuthenticationWithExpiration>;
export declare function auth<T = unknown>(state: GitHubAppState, authOptions: GitHubAppDeviceFlowAuthOptions & {
factory: FactoryGitHubDeviceFlow<T>;
}): Promise<T>;

View File

@@ -0,0 +1,3 @@
import type { EndpointOptions, RequestParameters, Route, RequestInterface, OctokitResponse } from "@octokit/types";
import type { OAuthAppState, GitHubAppState } from "./types.js";
export declare function hook(state: OAuthAppState | GitHubAppState, request: RequestInterface, route: Route | EndpointOptions, parameters?: RequestParameters): Promise<OctokitResponse<any>>;

View File

@@ -0,0 +1,5 @@
import type { OAuthAppStrategyOptions, GitHubAppStrategyOptions, OAuthAppAuthInterface, GitHubAuthInterface } from "./types.js";
export type { OAuthAppStrategyOptions, GitHubAppStrategyOptions, AppAuthOptions, WebFlowAuthOptions, OAuthAppDeviceFlowAuthOptions, GitHubAppDeviceFlowAuthOptions, OAuthAppAuthInterface, GitHubAuthInterface, AppAuthentication, OAuthAppUserAuthentication, GitHubAppUserAuthentication, GitHubAppUserAuthenticationWithExpiration, FactoryGitHubWebFlow, FactoryGitHubDeviceFlow, } from "./types.js";
export { createOAuthUserAuth } from "@octokit/auth-oauth-user";
export declare function createOAuthAppAuth(options: OAuthAppStrategyOptions): OAuthAppAuthInterface;
export declare function createOAuthAppAuth(options: GitHubAppStrategyOptions): GitHubAuthInterface;

View File

@@ -0,0 +1,98 @@
import type { EndpointOptions, RequestParameters, Route, RequestInterface, OctokitResponse } from "@octokit/types";
import type * as AuthOAuthUser from "@octokit/auth-oauth-user";
import type * as DeviceTypes from "@octokit/auth-oauth-device";
export type ClientType = "oauth-app" | "github-app";
export type OAuthAppStrategyOptions = {
clientType?: "oauth-app";
clientId: string;
clientSecret: string;
request?: RequestInterface;
};
export type GitHubAppStrategyOptions = {
clientType: "github-app";
clientId: string;
clientSecret: string;
request?: RequestInterface;
};
export type AppAuthOptions = {
type: "oauth-app";
};
export type WebFlowAuthOptions = {
type: "oauth-user";
code: string;
redirectUrl?: string;
state?: string;
};
export type OAuthAppDeviceFlowAuthOptions = {
type: "oauth-user";
onVerification: DeviceTypes.OAuthAppStrategyOptions["onVerification"];
scopes?: string[];
};
export type GitHubAppDeviceFlowAuthOptions = {
type: "oauth-user";
onVerification: DeviceTypes.OAuthAppStrategyOptions["onVerification"];
};
export type AppAuthentication = {
type: "oauth-app";
clientId: string;
clientSecret: string;
clientType: ClientType;
headers: {
authorization: string;
};
};
export type OAuthAppUserAuthentication = AuthOAuthUser.OAuthAppAuthentication;
export type GitHubAppUserAuthentication = AuthOAuthUser.GitHubAppAuthentication;
export type GitHubAppUserAuthenticationWithExpiration = AuthOAuthUser.GitHubAppAuthenticationWithExpiration;
export type FactoryOAuthAppWebFlowOptions = OAuthAppStrategyOptions & Omit<WebFlowAuthOptions, "type"> & {
clientType: "oauth-app";
};
export type FactoryOAuthAppDeviceFlowOptions = OAuthAppStrategyOptions & Omit<OAuthAppDeviceFlowAuthOptions, "type"> & {
clientType: "oauth-app";
};
export type FactoryGitHubAppWebFlowOptions = GitHubAppStrategyOptions & Omit<WebFlowAuthOptions, "type">;
export type FactoryGitHubAppDeviceFlowOptions = GitHubAppStrategyOptions & Omit<GitHubAppDeviceFlowAuthOptions, "type">;
export interface FactoryOAuthAppWebFlow<T> {
(options: FactoryOAuthAppWebFlowOptions): T;
}
export interface FactoryOAuthAppDeviceFlow<T> {
(options: FactoryOAuthAppDeviceFlowOptions): T;
}
export interface FactoryGitHubWebFlow<T> {
(options: FactoryGitHubAppWebFlowOptions): T;
}
export interface FactoryGitHubDeviceFlow<T> {
(options: FactoryGitHubAppDeviceFlowOptions): T;
}
export interface OAuthAppAuthInterface {
(options: AppAuthOptions): Promise<AppAuthentication>;
<T = unknown>(options: WebFlowAuthOptions & {
factory: FactoryOAuthAppWebFlow<T>;
}): Promise<T>;
<T = unknown>(options: OAuthAppDeviceFlowAuthOptions & {
factory: FactoryOAuthAppDeviceFlow<T>;
}): Promise<T>;
(options: WebFlowAuthOptions): Promise<OAuthAppUserAuthentication>;
(options: OAuthAppDeviceFlowAuthOptions): Promise<OAuthAppUserAuthentication>;
hook(request: RequestInterface, route: Route | EndpointOptions, parameters?: RequestParameters): Promise<OctokitResponse<any>>;
}
export interface GitHubAuthInterface {
(options?: AppAuthOptions): Promise<AppAuthentication>;
<T = unknown>(options: WebFlowAuthOptions & {
factory: FactoryGitHubWebFlow<T>;
}): Promise<T>;
<T = unknown>(options: GitHubAppDeviceFlowAuthOptions & {
factory: FactoryGitHubDeviceFlow<T>;
}): Promise<T>;
(options?: WebFlowAuthOptions): Promise<GitHubAppUserAuthentication | GitHubAppUserAuthenticationWithExpiration>;
(options?: GitHubAppDeviceFlowAuthOptions): Promise<GitHubAppUserAuthentication | GitHubAppUserAuthenticationWithExpiration>;
hook(request: RequestInterface, route: Route | EndpointOptions, parameters?: RequestParameters): Promise<OctokitResponse<any>>;
}
export type OAuthAppState = OAuthAppStrategyOptions & {
clientType: "oauth-app";
request: RequestInterface;
};
export type GitHubAppState = GitHubAppStrategyOptions & {
clientType: "github-app";
request: RequestInterface;
};

View File

@@ -0,0 +1 @@
export declare const VERSION = "9.0.3";

56
node_modules/@octokit/auth-oauth-app/package.json generated vendored Normal file
View File

@@ -0,0 +1,56 @@
{
"name": "@octokit/auth-oauth-app",
"publishConfig": {
"access": "public",
"provenance": true
},
"type": "module",
"version": "9.0.3",
"description": "GitHub OAuth App authentication for JavaScript",
"repository": "github:octokit/auth-oauth-app.js",
"keywords": [
"github",
"octokit",
"authentication",
"oauth",
"api"
],
"author": "Gregor Martynus (https://github.com/gr2m)",
"license": "MIT",
"dependencies": {
"@octokit/auth-oauth-device": "^8.0.3",
"@octokit/auth-oauth-user": "^6.0.2",
"@octokit/request": "^10.0.6",
"@octokit/types": "^16.0.0",
"universal-user-agent": "^7.0.0"
},
"devDependencies": {
"@octokit/core": "^7.0.6",
"@octokit/tsconfig": "^4.0.0",
"@types/node": "^22.13.1",
"@vitest/coverage-v8": "^3.0.5",
"esbuild": "^0.25.0",
"fetch-mock": "^12.0.0",
"prettier": "3.5.3",
"semantic-release-plugin-update-version-in-files": "^2.0.0",
"tinyglobby": "^0.2.13",
"typescript": "^5.3.0",
"vitest": "^3.0.5"
},
"engines": {
"node": ">= 20"
},
"files": [
"dist-*/**",
"bin/**"
],
"types": "./dist-types/index.d.ts",
"exports": {
".": {
"types": "./dist-types/index.d.ts",
"import": "./dist-bundle/index.js",
"default": "./dist-bundle/index.js"
}
},
"sideEffects": false
}