Upgrade octokit to v4.1.2
This commit is contained in:
parent
dbbcbe019d
commit
c1745a9831
1214 changed files with 160765 additions and 0 deletions
16
node_modules/@octokit/oauth-app/dist-src/methods/check-token.js
generated
vendored
Normal file
16
node_modules/@octokit/oauth-app/dist-src/methods/check-token.js
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import * as OAuthMethods from "@octokit/oauth-methods";
|
||||
async function checkTokenWithState(state, options) {
|
||||
const result = await OAuthMethods.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;
|
||||
}
|
||||
export {
|
||||
checkTokenWithState
|
||||
};
|
||||
32
node_modules/@octokit/oauth-app/dist-src/methods/create-token.js
generated
vendored
Normal file
32
node_modules/@octokit/oauth-app/dist-src/methods/create-token.js
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import * as OAuthAppAuth from "@octokit/auth-oauth-app";
|
||||
import { emitEvent } from "../emit-event.js";
|
||||
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 };
|
||||
}
|
||||
export {
|
||||
createTokenWithState
|
||||
};
|
||||
47
node_modules/@octokit/oauth-app/dist-src/methods/delete-authorization.js
generated
vendored
Normal file
47
node_modules/@octokit/oauth-app/dist-src/methods/delete-authorization.js
generated
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import * as OAuthMethods from "@octokit/oauth-methods";
|
||||
import { createUnauthenticatedAuth } from "@octokit/auth-unauthenticated";
|
||||
import { emitEvent } from "../emit-event.js";
|
||||
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 OAuthMethods.deleteAuthorization({
|
||||
clientType: "oauth-app",
|
||||
...optionsWithDefaults
|
||||
}) : (
|
||||
/* v8 ignore next 4 */
|
||||
await OAuthMethods.deleteAuthorization({
|
||||
clientType: "github-app",
|
||||
...optionsWithDefaults
|
||||
})
|
||||
);
|
||||
await emitEvent(state, {
|
||||
name: "token",
|
||||
action: "deleted",
|
||||
token: options.token,
|
||||
octokit: new state.Octokit({
|
||||
authStrategy: 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: createUnauthenticatedAuth,
|
||||
auth: {
|
||||
reason: `Handling "authorization.deleted" event. The access for the app has been revoked.`
|
||||
}
|
||||
})
|
||||
});
|
||||
return response;
|
||||
}
|
||||
export {
|
||||
deleteAuthorizationWithState
|
||||
};
|
||||
36
node_modules/@octokit/oauth-app/dist-src/methods/delete-token.js
generated
vendored
Normal file
36
node_modules/@octokit/oauth-app/dist-src/methods/delete-token.js
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import * as OAuthMethods from "@octokit/oauth-methods";
|
||||
import { createUnauthenticatedAuth } from "@octokit/auth-unauthenticated";
|
||||
import { emitEvent } from "../emit-event.js";
|
||||
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 OAuthMethods.deleteToken({
|
||||
clientType: "oauth-app",
|
||||
...optionsWithDefaults
|
||||
}) : (
|
||||
/* v8 ignore next 4 */
|
||||
await OAuthMethods.deleteToken({
|
||||
clientType: "github-app",
|
||||
...optionsWithDefaults
|
||||
})
|
||||
);
|
||||
await emitEvent(state, {
|
||||
name: "token",
|
||||
action: "deleted",
|
||||
token: options.token,
|
||||
octokit: new state.Octokit({
|
||||
authStrategy: createUnauthenticatedAuth,
|
||||
auth: {
|
||||
reason: `Handling "token.deleted" event. The access for the token has been revoked.`
|
||||
}
|
||||
})
|
||||
});
|
||||
return response;
|
||||
}
|
||||
export {
|
||||
deleteTokenWithState
|
||||
};
|
||||
10
node_modules/@octokit/oauth-app/dist-src/methods/get-oauth-client-code.js
generated
vendored
Normal file
10
node_modules/@octokit/oauth-app/dist-src/methods/get-oauth-client-code.js
generated
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
function getOAuthClientCode() {
|
||||
return `import { Octokit: Core } from "https://esm.sh/@octokit/core";
|
||||
|
||||
export const Octokit = Core.defaults({
|
||||
oauth: {}
|
||||
})`;
|
||||
}
|
||||
export {
|
||||
getOAuthClientCode
|
||||
};
|
||||
29
node_modules/@octokit/oauth-app/dist-src/methods/get-user-octokit.js
generated
vendored
Normal file
29
node_modules/@octokit/oauth-app/dist-src/methods/get-user-octokit.js
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import { createOAuthUserAuth } from "@octokit/auth-oauth-user";
|
||||
import { emitEvent } from "../emit-event.js";
|
||||
async function getUserOctokitWithState(state, options) {
|
||||
return state.octokit.auth({
|
||||
type: "oauth-user",
|
||||
...options,
|
||||
async factory(options2) {
|
||||
const octokit = new state.Octokit({
|
||||
authStrategy: 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;
|
||||
}
|
||||
});
|
||||
}
|
||||
export {
|
||||
getUserOctokitWithState
|
||||
};
|
||||
18
node_modules/@octokit/oauth-app/dist-src/methods/get-web-flow-authorization-url.js
generated
vendored
Normal file
18
node_modules/@octokit/oauth-app/dist-src/methods/get-web-flow-authorization-url.js
generated
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import * as OAuthMethods from "@octokit/oauth-methods";
|
||||
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
|
||||
});
|
||||
}
|
||||
export {
|
||||
getWebFlowAuthorizationUrlWithState
|
||||
};
|
||||
40
node_modules/@octokit/oauth-app/dist-src/methods/refresh-token.js
generated
vendored
Normal file
40
node_modules/@octokit/oauth-app/dist-src/methods/refresh-token.js
generated
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import * as OAuthMethods from "@octokit/oauth-methods";
|
||||
import { emitEvent } from "../emit-event.js";
|
||||
import { createOAuthUserAuth } from "@octokit/auth-oauth-user";
|
||||
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 OAuthMethods.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: createOAuthUserAuth,
|
||||
auth: {
|
||||
clientType: state.clientType,
|
||||
clientId: state.clientId,
|
||||
clientSecret: state.clientSecret,
|
||||
token: response.authentication.token
|
||||
}
|
||||
})
|
||||
});
|
||||
return { ...response, authentication };
|
||||
}
|
||||
export {
|
||||
refreshTokenWithState
|
||||
};
|
||||
66
node_modules/@octokit/oauth-app/dist-src/methods/reset-token.js
generated
vendored
Normal file
66
node_modules/@octokit/oauth-app/dist-src/methods/reset-token.js
generated
vendored
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
import * as OAuthMethods from "@octokit/oauth-methods";
|
||||
import { emitEvent } from "../emit-event.js";
|
||||
import { createOAuthUserAuth } from "@octokit/auth-oauth-user";
|
||||
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 OAuthMethods.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: 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 OAuthMethods.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: createOAuthUserAuth,
|
||||
auth: {
|
||||
clientType: state.clientType,
|
||||
clientId: state.clientId,
|
||||
clientSecret: state.clientSecret,
|
||||
token: response.authentication.token
|
||||
}
|
||||
})
|
||||
});
|
||||
return { ...response, authentication };
|
||||
}
|
||||
export {
|
||||
resetTokenWithState
|
||||
};
|
||||
40
node_modules/@octokit/oauth-app/dist-src/methods/scope-token.js
generated
vendored
Normal file
40
node_modules/@octokit/oauth-app/dist-src/methods/scope-token.js
generated
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import * as OAuthMethods from "@octokit/oauth-methods";
|
||||
import { createOAuthUserAuth } from "@octokit/auth-oauth-user";
|
||||
import { emitEvent } from "../emit-event.js";
|
||||
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 OAuthMethods.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: createOAuthUserAuth,
|
||||
auth: {
|
||||
clientType: state.clientType,
|
||||
clientId: state.clientId,
|
||||
clientSecret: state.clientSecret,
|
||||
token: response.authentication.token
|
||||
}
|
||||
})
|
||||
});
|
||||
return { ...response, authentication };
|
||||
}
|
||||
export {
|
||||
scopeTokenWithState
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue