@octokit/oauth-methods
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -12,3 +12,3 @@ 'use strict'; | ||
const VERSION = "1.1.0"; | ||
const VERSION = "1.2.0"; | ||
@@ -15,0 +15,0 @@ function _defineProperty(obj, key, value) { |
export { VERSION } from "./version"; | ||
export { getWebFlowAuthorizationUrl } from "./get-web-flow-authorization-url"; | ||
export { exchangeWebFlowCode } from "./exchange-web-flow-code"; | ||
export { createDeviceCode } from "./create-device-code"; | ||
export { exchangeDeviceCode } from "./exchange-device-code"; | ||
export { checkToken } from "./check-token"; | ||
export { refreshToken } from "./refresh-token"; | ||
export { scopeToken } from "./scope-token"; | ||
export { resetToken } from "./reset-token"; | ||
export { deleteToken } from "./delete-token"; | ||
export { deleteAuthorization } from "./delete-authorization"; | ||
export * from "./get-web-flow-authorization-url"; | ||
export * from "./exchange-web-flow-code"; | ||
export * from "./create-device-code"; | ||
export * from "./exchange-device-code"; | ||
export * from "./check-token"; | ||
export * from "./refresh-token"; | ||
export * from "./scope-token"; | ||
export * from "./reset-token"; | ||
export * from "./delete-token"; | ||
export * from "./delete-authorization"; |
@@ -1,1 +0,1 @@ | ||
export const VERSION = "1.1.0"; | ||
export const VERSION = "1.2.0"; |
import { RequestInterface, Endpoints } from "@octokit/types"; | ||
import { OAuthAppAuthentication, GitHubAppAuthentication } from "./types"; | ||
declare type OAuthAppOptions = { | ||
export declare type CheckTokenOAuthAppOptions = { | ||
clientType: "oauth-app"; | ||
@@ -10,3 +10,3 @@ clientId: string; | ||
}; | ||
declare type GitHubAppOptions = { | ||
export declare type CheckTokenGitHubAppOptions = { | ||
clientType: "github-app"; | ||
@@ -18,10 +18,9 @@ clientId: string; | ||
}; | ||
declare type OAuthAppResult = Endpoints["POST /applications/{client_id}/token"]["response"] & { | ||
export declare type CheckTokenOAuthAppResponse = Endpoints["POST /applications/{client_id}/token"]["response"] & { | ||
authentication: OAuthAppAuthentication; | ||
}; | ||
declare type GitHubAppResult = Endpoints["POST /applications/{client_id}/token"]["response"] & { | ||
export declare type CheckTokenGitHubAppResponse = Endpoints["POST /applications/{client_id}/token"]["response"] & { | ||
authentication: GitHubAppAuthentication; | ||
}; | ||
export declare function checkToken(options: OAuthAppOptions): Promise<OAuthAppResult>; | ||
export declare function checkToken(options: GitHubAppOptions): Promise<GitHubAppResult>; | ||
export {}; | ||
export declare function checkToken(options: CheckTokenOAuthAppOptions): Promise<CheckTokenOAuthAppResponse>; | ||
export declare function checkToken(options: CheckTokenGitHubAppOptions): Promise<CheckTokenGitHubAppResponse>; |
import { OctokitResponse, RequestInterface } from "@octokit/types"; | ||
declare type OAuthAppOptions = { | ||
export declare type CreateDeviceCodeOAuthAppOptions = { | ||
clientType: "oauth-app"; | ||
@@ -8,3 +8,3 @@ clientId: string; | ||
}; | ||
declare type GitHubAppOptions = { | ||
export declare type CreateDeviceCodeGitHubAppOptions = { | ||
clientType: "github-app"; | ||
@@ -14,3 +14,3 @@ clientId: string; | ||
}; | ||
declare type DeviceTokenResponse = { | ||
export declare type CreateDeviceCodeDeviceTokenResponse = OctokitResponse<{ | ||
device_code: string; | ||
@@ -21,4 +21,3 @@ user_code: string; | ||
interval: number; | ||
}; | ||
export declare function createDeviceCode(options: OAuthAppOptions | GitHubAppOptions): Promise<OctokitResponse<DeviceTokenResponse>>; | ||
export {}; | ||
}>; | ||
export declare function createDeviceCode(options: CreateDeviceCodeOAuthAppOptions | CreateDeviceCodeGitHubAppOptions): Promise<CreateDeviceCodeDeviceTokenResponse>; |
import { RequestInterface, Endpoints } from "@octokit/types"; | ||
declare type OAuthAppOptions = { | ||
export declare type DeleteAuthorizationOAuthAppOptions = { | ||
clientType: "oauth-app"; | ||
@@ -9,3 +9,3 @@ clientId: string; | ||
}; | ||
declare type GitHubAppOptions = { | ||
export declare type DeleteAuthorizationGitHubAppOptions = { | ||
clientType: "github-app"; | ||
@@ -17,4 +17,4 @@ clientId: string; | ||
}; | ||
export declare function deleteAuthorization(options: OAuthAppOptions): Promise<Endpoints["DELETE /applications/{client_id}/grant"]["response"]>; | ||
export declare function deleteAuthorization(options: GitHubAppOptions): Promise<Endpoints["DELETE /applications/{client_id}/grant"]["response"]>; | ||
export {}; | ||
export declare type DeleteAuthorizationResponse = Endpoints["DELETE /applications/{client_id}/grant"]["response"]; | ||
export declare function deleteAuthorization(options: DeleteAuthorizationOAuthAppOptions): Promise<DeleteAuthorizationResponse>; | ||
export declare function deleteAuthorization(options: DeleteAuthorizationGitHubAppOptions): Promise<DeleteAuthorizationResponse>; |
import { RequestInterface, Endpoints } from "@octokit/types"; | ||
declare type OAuthAppOptions = { | ||
export declare type DeleteTokenOAuthAppOptions = { | ||
clientType: "oauth-app"; | ||
@@ -9,3 +9,3 @@ clientId: string; | ||
}; | ||
declare type GitHubAppOptions = { | ||
export declare type DeleteTokenGitHubAppOptions = { | ||
clientType: "github-app"; | ||
@@ -17,4 +17,4 @@ clientId: string; | ||
}; | ||
export declare function deleteToken(options: OAuthAppOptions): Promise<Endpoints["DELETE /applications/{client_id}/token"]["response"]>; | ||
export declare function deleteToken(options: GitHubAppOptions): Promise<Endpoints["DELETE /applications/{client_id}/token"]["response"]>; | ||
export {}; | ||
export declare type DeleteTokenResponse = Endpoints["DELETE /applications/{client_id}/token"]["response"]; | ||
export declare function deleteToken(options: DeleteTokenOAuthAppOptions): Promise<DeleteTokenResponse>; | ||
export declare function deleteToken(options: DeleteTokenGitHubAppOptions): Promise<DeleteTokenResponse>; |
import { OctokitResponse, RequestInterface } from "@octokit/types"; | ||
import { OAuthAppAuthentication, GitHubAppAuthentication, GitHubAppAuthenticationWithExpiration, OAuthAppCreateTokenResponseData, GitHubAppCreateTokenResponseData, GitHubAppCreateTokenWithExpirationResponseData } from "./types"; | ||
declare type OAuthAppOptionsWithoutClientSecret = { | ||
export declare type ExchangeDeviceCodeOAuthAppOptionsWithoutClientSecret = { | ||
clientType: "oauth-app"; | ||
@@ -11,6 +11,6 @@ clientId: string; | ||
}; | ||
declare type OAuthAppOptions = OAuthAppOptionsWithoutClientSecret & { | ||
export declare type ExchangeDeviceCodeOAuthAppOptions = ExchangeDeviceCodeOAuthAppOptionsWithoutClientSecret & { | ||
clientSecret: string; | ||
}; | ||
declare type GitHubAppOptionsWithoutClientSecret = { | ||
export declare type ExchangeDeviceCodeGitHubAppOptionsWithoutClientSecret = { | ||
clientType: "github-app"; | ||
@@ -23,3 +23,3 @@ clientId: string; | ||
}; | ||
declare type GitHubAppOptions = GitHubAppOptionsWithoutClientSecret & { | ||
export declare type ExchangeDeviceCodeGitHubAppOptions = ExchangeDeviceCodeGitHubAppOptionsWithoutClientSecret & { | ||
clientSecret: string; | ||
@@ -30,26 +30,30 @@ }; | ||
declare type GitHubAppAuthenticationWithExpirationWithoutClientSecret = Omit<GitHubAppAuthenticationWithExpiration, "clientSecret">; | ||
export declare type ExchangeDeviceCodeOAuthAppResponse = OctokitResponse<OAuthAppCreateTokenResponseData> & { | ||
authentication: OAuthAppAuthentication; | ||
}; | ||
export declare type ExchangeDeviceCodeOAuthAppResponseWithoutClientSecret = OctokitResponse<OAuthAppCreateTokenResponseData> & { | ||
authentication: OAuthAppAuthenticationWithoutClientSecret; | ||
}; | ||
export declare type ExchangeDeviceCodeGitHubAppResponse = OctokitResponse<GitHubAppCreateTokenResponseData | GitHubAppCreateTokenWithExpirationResponseData> & { | ||
authentication: GitHubAppAuthentication | GitHubAppAuthenticationWithExpiration; | ||
}; | ||
export declare type ExchangeDeviceCodeGitHubAppResponseWithoutClientSecret = OctokitResponse<GitHubAppCreateTokenResponseData | GitHubAppCreateTokenWithExpirationResponseData> & { | ||
authentication: GitHubAppAuthenticationWithoutClientSecret | GitHubAppAuthenticationWithExpirationWithoutClientSecret; | ||
}; | ||
/** | ||
* Exchange the code from GitHub's OAuth Web flow for OAuth Apps. | ||
*/ | ||
export declare function exchangeDeviceCode(options: OAuthAppOptions): Promise<OctokitResponse<OAuthAppCreateTokenResponseData> & { | ||
authentication: OAuthAppAuthentication; | ||
}>; | ||
export declare function exchangeDeviceCode(options: ExchangeDeviceCodeOAuthAppOptions): Promise<ExchangeDeviceCodeOAuthAppResponse>; | ||
/** | ||
* Exchange the code from GitHub's OAuth Web flow for OAuth Apps without clientSecret | ||
*/ | ||
export declare function exchangeDeviceCode(options: OAuthAppOptionsWithoutClientSecret): Promise<OctokitResponse<OAuthAppCreateTokenResponseData> & { | ||
authentication: OAuthAppAuthenticationWithoutClientSecret; | ||
}>; | ||
export declare function exchangeDeviceCode(options: ExchangeDeviceCodeOAuthAppOptionsWithoutClientSecret): Promise<ExchangeDeviceCodeOAuthAppResponseWithoutClientSecret>; | ||
/** | ||
* Exchange the code from GitHub's OAuth Web flow for GitHub Apps. `scopes` are not supported by GitHub Apps. | ||
*/ | ||
export declare function exchangeDeviceCode(options: GitHubAppOptions): Promise<OctokitResponse<GitHubAppCreateTokenResponseData | GitHubAppCreateTokenWithExpirationResponseData> & { | ||
authentication: GitHubAppAuthentication | GitHubAppAuthenticationWithExpiration; | ||
}>; | ||
export declare function exchangeDeviceCode(options: ExchangeDeviceCodeGitHubAppOptions): Promise<ExchangeDeviceCodeGitHubAppResponse>; | ||
/** | ||
* Exchange the code from GitHub's OAuth Web flow for GitHub Apps without using `clientSecret`. `scopes` are not supported by GitHub Apps. | ||
*/ | ||
export declare function exchangeDeviceCode(options: GitHubAppOptionsWithoutClientSecret): Promise<OctokitResponse<GitHubAppCreateTokenResponseData | GitHubAppCreateTokenWithExpirationResponseData> & { | ||
authentication: GitHubAppAuthenticationWithoutClientSecret | GitHubAppAuthenticationWithExpirationWithoutClientSecret; | ||
}>; | ||
export declare function exchangeDeviceCode(options: ExchangeDeviceCodeGitHubAppOptionsWithoutClientSecret): Promise<ExchangeDeviceCodeGitHubAppResponseWithoutClientSecret>; | ||
export {}; |
import { OctokitResponse, RequestInterface } from "@octokit/types"; | ||
import { OAuthAppAuthentication, GitHubAppAuthentication, GitHubAppAuthenticationWithExpiration, OAuthAppCreateTokenResponseData, GitHubAppCreateTokenResponseData, GitHubAppCreateTokenWithExpirationResponseData } from "./types"; | ||
declare type OAuthAppOptions = { | ||
export declare type ExchangeWebFlowCodeOAuthAppOptions = { | ||
clientType: "oauth-app"; | ||
@@ -12,3 +12,3 @@ clientId: string; | ||
}; | ||
declare type GitHubAppOptions = { | ||
export declare type ExchangeWebFlowCodeGitHubAppOptions = { | ||
clientType: "github-app"; | ||
@@ -22,14 +22,15 @@ clientId: string; | ||
}; | ||
export declare type ExchangeWebFlowCodeOAuthAppResponse = OctokitResponse<OAuthAppCreateTokenResponseData> & { | ||
authentication: OAuthAppAuthentication; | ||
}; | ||
export declare type ExchangeWebFlowCodeGitHubAppResponse = OctokitResponse<GitHubAppCreateTokenResponseData | GitHubAppCreateTokenWithExpirationResponseData> & { | ||
authentication: GitHubAppAuthentication | GitHubAppAuthenticationWithExpiration; | ||
}; | ||
/** | ||
* Exchange the code from GitHub's OAuth Web flow for OAuth Apps. | ||
*/ | ||
export declare function exchangeWebFlowCode(options: OAuthAppOptions): Promise<OctokitResponse<OAuthAppCreateTokenResponseData> & { | ||
authentication: OAuthAppAuthentication; | ||
}>; | ||
export declare function exchangeWebFlowCode(options: ExchangeWebFlowCodeOAuthAppOptions): Promise<ExchangeWebFlowCodeOAuthAppResponse>; | ||
/** | ||
* Exchange the code from GitHub's OAuth Web flow for GitHub Apps. Note that `scopes` are not supported by GitHub Apps. | ||
*/ | ||
export declare function exchangeWebFlowCode(options: GitHubAppOptions): Promise<OctokitResponse<GitHubAppCreateTokenResponseData | GitHubAppCreateTokenWithExpirationResponseData> & { | ||
authentication: GitHubAppAuthentication | GitHubAppAuthenticationWithExpiration; | ||
}>; | ||
export {}; | ||
export declare function exchangeWebFlowCode(options: ExchangeWebFlowCodeGitHubAppOptions): Promise<ExchangeWebFlowCodeGitHubAppResponse>; |
import { OAuthAppResult, GitHubAppResult } from "@octokit/oauth-authorization-url"; | ||
import { RequestInterface } from "@octokit/types"; | ||
declare type OAuthAppOptions = { | ||
export declare type GetWebFlowAuthorizationUrlOAuthAppOptions = { | ||
clientType: "oauth-app"; | ||
clientId: string; | ||
clientType?: "oauth-app"; | ||
allowSignup?: boolean; | ||
@@ -13,5 +13,5 @@ login?: string; | ||
}; | ||
declare type GitHubAppOptions = { | ||
export declare type GetWebFlowAuthorizationUrlGitHubAppOptions = { | ||
clientType: "github-app"; | ||
clientId: string; | ||
clientType: "github-app"; | ||
allowSignup?: boolean; | ||
@@ -23,4 +23,5 @@ login?: string; | ||
}; | ||
export declare function getWebFlowAuthorizationUrl(options: OAuthAppOptions): OAuthAppResult; | ||
export declare function getWebFlowAuthorizationUrl(options: GitHubAppOptions): GitHubAppResult; | ||
export {}; | ||
export declare type GetWebFlowAuthorizationUrlOAuthAppResult = OAuthAppResult; | ||
export declare type GetWebFlowAuthorizationUrlGitHubAppResult = GitHubAppResult; | ||
export declare function getWebFlowAuthorizationUrl(options: GetWebFlowAuthorizationUrlOAuthAppOptions): OAuthAppResult; | ||
export declare function getWebFlowAuthorizationUrl(options: GetWebFlowAuthorizationUrlGitHubAppOptions): GitHubAppResult; |
export { VERSION } from "./version"; | ||
export { getWebFlowAuthorizationUrl } from "./get-web-flow-authorization-url"; | ||
export { exchangeWebFlowCode } from "./exchange-web-flow-code"; | ||
export { createDeviceCode } from "./create-device-code"; | ||
export { exchangeDeviceCode } from "./exchange-device-code"; | ||
export { checkToken } from "./check-token"; | ||
export { refreshToken } from "./refresh-token"; | ||
export { scopeToken } from "./scope-token"; | ||
export { resetToken } from "./reset-token"; | ||
export { deleteToken } from "./delete-token"; | ||
export { deleteAuthorization } from "./delete-authorization"; | ||
export * from "./get-web-flow-authorization-url"; | ||
export * from "./exchange-web-flow-code"; | ||
export * from "./create-device-code"; | ||
export * from "./exchange-device-code"; | ||
export * from "./check-token"; | ||
export * from "./refresh-token"; | ||
export * from "./scope-token"; | ||
export * from "./reset-token"; | ||
export * from "./delete-token"; | ||
export * from "./delete-authorization"; | ||
export { OAuthAppAuthentication, GitHubAppAuthentication, GitHubAppAuthenticationWithExpiration, } from "./types"; |
import { OctokitResponse, RequestInterface } from "@octokit/types"; | ||
import { GitHubAppAuthenticationWithExpiration, GitHubAppCreateTokenWithExpirationResponseData } from "./types"; | ||
declare type Options = { | ||
export declare type RefreshTokenOptions = { | ||
clientType: "github-app"; | ||
@@ -10,5 +10,5 @@ clientId: string; | ||
}; | ||
export declare function refreshToken(options: Options): Promise<OctokitResponse<GitHubAppCreateTokenWithExpirationResponseData> & { | ||
export declare type RefreshTokenResponse = OctokitResponse<GitHubAppCreateTokenWithExpirationResponseData> & { | ||
authentication: GitHubAppAuthenticationWithExpiration; | ||
}>; | ||
export {}; | ||
}; | ||
export declare function refreshToken(options: RefreshTokenOptions): Promise<RefreshTokenResponse>; |
import { RequestInterface, Endpoints } from "@octokit/types"; | ||
import { OAuthAppAuthentication, GitHubAppAuthentication } from "./types"; | ||
declare type OAuthAppOptions = { | ||
export declare type ResetTokenOAuthAppOptions = { | ||
clientType: "oauth-app"; | ||
@@ -10,3 +10,3 @@ clientId: string; | ||
}; | ||
declare type GitHubAppOptions = { | ||
export declare type ResetTokenGitHubAppOptions = { | ||
clientType: "github-app"; | ||
@@ -18,10 +18,9 @@ clientId: string; | ||
}; | ||
declare type OAuthAppResult = Endpoints["PATCH /applications/{client_id}/token"]["response"] & { | ||
export declare type ResetTokenOAuthAppResponse = Endpoints["PATCH /applications/{client_id}/token"]["response"] & { | ||
authentication: OAuthAppAuthentication; | ||
}; | ||
declare type GitHubAppResult = Endpoints["PATCH /applications/{client_id}/token"]["response"] & { | ||
export declare type ResetTokenGitHubAppResponse = Endpoints["PATCH /applications/{client_id}/token"]["response"] & { | ||
authentication: GitHubAppAuthentication; | ||
}; | ||
export declare function resetToken(options: OAuthAppOptions): Promise<OAuthAppResult>; | ||
export declare function resetToken(options: GitHubAppOptions): Promise<GitHubAppResult>; | ||
export {}; | ||
export declare function resetToken(options: ResetTokenOAuthAppOptions): Promise<ResetTokenOAuthAppResponse>; | ||
export declare function resetToken(options: ResetTokenGitHubAppOptions): Promise<ResetTokenGitHubAppResponse>; |
@@ -13,3 +13,4 @@ import { RequestInterface, Endpoints } from "@octokit/types"; | ||
}; | ||
declare type Options = { | ||
declare type Endpoint = Endpoints["POST /applications/{client_id}/token/scoped"]; | ||
export declare type ScopeTokenOptions = { | ||
clientType: "github-app"; | ||
@@ -22,7 +23,6 @@ clientId: string; | ||
} & TargetOption & RepositoriesOption; | ||
declare type Endpoint = Endpoints["POST /applications/{client_id}/token/scoped"]; | ||
declare type Result = Endpoint["response"] & { | ||
export declare type ScopeTokenResponse = Endpoint["response"] & { | ||
authentication: GitHubAppAuthentication; | ||
}; | ||
export declare function scopeToken(options: Options): Promise<Result>; | ||
export declare function scopeToken(options: ScopeTokenOptions): Promise<ScopeTokenResponse>; | ||
export {}; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "1.1.0"; | ||
export declare const VERSION = "1.2.0"; |
{ | ||
"name": "@octokit/oauth-methods", | ||
"description": "Set of stateless request methods to create, check, reset, refresh, and delete user access tokens for OAuth and GitHub Apps", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "files": [ |
@@ -28,2 +28,3 @@ # oauth-methods.js | ||
- [GitHub App with expiring user authentication](#github-app-with-expiring-user-authentication) | ||
- [Types](#types) | ||
- [Contributing](#contributing) | ||
@@ -1572,2 +1573,39 @@ - [License](#license) | ||
GitHubAppAuthenticationWithExpiration, | ||
GetWebFlowAuthorizationUrlOAuthAppOptions, | ||
GetWebFlowAuthorizationUrlGitHubAppOptions, | ||
GetWebFlowAuthorizationUrlOAuthAppResult, | ||
GetWebFlowAuthorizationUrlGitHubAppResult, | ||
CheckTokenOAuthAppOptions, | ||
CheckTokenGitHubAppOptions, | ||
CheckTokenOAuthAppResponse, | ||
CheckTokenGitHubAppResponse, | ||
ExchangeWebFlowCodeOAuthAppOptions, | ||
ExchangeWebFlowCodeGitHubAppOptions, | ||
ExchangeWebFlowCodeOAuthAppResponse, | ||
ExchangeWebFlowCodeGitHubAppResponse, | ||
CreateDeviceCodeOAuthAppOptions, | ||
CreateDeviceCodeGitHubAppOptions, | ||
CreateDeviceCodeDeviceTokenResponse, | ||
ExchangeDeviceCodeOAuthAppOptionsWithoutClientSecret, | ||
ExchangeDeviceCodeOAuthAppOptions, | ||
ExchangeDeviceCodeGitHubAppOptionsWithoutClientSecret, | ||
ExchangeDeviceCodeGitHubAppOptions, | ||
ExchangeDeviceCodeOAuthAppResponse, | ||
ExchangeDeviceCodeOAuthAppResponseWithoutClientSecret, | ||
ExchangeDeviceCodeGitHubAppResponse, | ||
ExchangeDeviceCodeGitHubAppResponseWithoutClientSecret, | ||
RefreshTokenOptions, | ||
RefreshTokenResponse, | ||
ScopeTokenOptions, | ||
ScopeTokenResponse, | ||
ResetTokenOAuthAppOptions, | ||
ResetTokenGitHubAppOptions, | ||
ResetTokenOAuthAppResponse, | ||
ResetTokenGitHubAppResponse, | ||
DeleteTokenOAuthAppOptions, | ||
DeleteTokenGitHubAppOptions, | ||
DeleteTokenResponse, | ||
DeleteAuthorizationOAuthAppOptions, | ||
DeleteAuthorizationGitHubAppOptions, | ||
DeleteAuthorizationResponse, | ||
} from "@octokit/oauth-methods"; | ||
@@ -1574,0 +1612,0 @@ ``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
100005
902
1619