@octokit/oauth-methods
Version:
Set of stateless request methods to create, check, reset, refresh, and delete user access tokens for OAuth and GitHub Apps
25 lines (24 loc) • 1.17 kB
TypeScript
import type { RequestInterface, Endpoints } from "@octokit/types";
import type { OAuthAppAuthentication, GitHubAppAuthenticationWithExpirationEnabled, GitHubAppAuthenticationWithExpirationDisabled } from "./types.js";
export type CheckTokenOAuthAppOptions = {
clientType: "oauth-app";
clientId: string;
clientSecret: string;
token: string;
request?: RequestInterface;
};
export type CheckTokenGitHubAppOptions = {
clientType: "github-app";
clientId: string;
clientSecret: string;
token: string;
request?: RequestInterface;
};
export type CheckTokenOAuthAppResponse = Endpoints["POST /applications/{client_id}/token"]["response"] & {
authentication: OAuthAppAuthentication;
};
export type CheckTokenGitHubAppResponse = Endpoints["POST /applications/{client_id}/token"]["response"] & {
authentication: GitHubAppAuthenticationWithExpirationEnabled | GitHubAppAuthenticationWithExpirationDisabled;
};
export declare function checkToken(options: CheckTokenOAuthAppOptions): Promise<CheckTokenOAuthAppResponse>;
export declare function checkToken(options: CheckTokenGitHubAppOptions): Promise<CheckTokenGitHubAppResponse>;