Upgrade octokit to v4.1.2
This commit is contained in:
parent
dbbcbe019d
commit
c1745a9831
1214 changed files with 160765 additions and 0 deletions
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
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue