UNPKG

altair-graphql-core

Version:

Several of the core logic for altair graphql client

81 lines 2.65 kB
import { output } from 'zod/v4'; import { accessTokenErrorResponseSchema, accessTokenResponseSchema } from './schema'; export declare enum OAuth2Type { AUTHORIZATION_CODE = "auth_code", AUTHORIZATION_CODE_PKCE = "auth_code_pkce", CLIENT_CREDENTIALS = "client_credentials" } export declare enum AuthFormat { BASIC_AUTH = "basic", IN_BODY = "body" } export declare enum RequestFormat { JSON = "json", FORM = "form" } export interface SimpleAuthorizationRequestParams extends Record<string, string> { response_type: 'code'; /** * The client ID of your application */ client_id: string; /** * The URL in your app where users will be sent after authorization */ redirect_uri: string; /** * A random string generated by your application, which you'll verify later */ state: string; /** * A space-separated list of scopes */ scope: string; } export interface CodeChallengeAuthorizationRequestParams extends SimpleAuthorizationRequestParams { code_challenge: string; code_challenge_method: 'S256'; } export type AuthorizationRequestParams = SimpleAuthorizationRequestParams | CodeChallengeAuthorizationRequestParams; export interface AuthorizationRedirectResponse { /** * The authorization code received from the authorization server */ code: string; /** * The exact value of the state parameter passed by the client in the authorization request */ state: string; } export interface AuthorizationRedirectErrorResponse { error: string; state: string; error_description?: string; error_uri?: string; } export interface AuthorizationCode_AccessTokenRequest { grant_type: 'authorization_code'; /** * The authorization code received from the authorization server */ code: string; /** * The redirect URI used in the initial request */ redirect_uri: string; client_id: string; client_secret: string; } export interface AuthorizationCodePKCE_AccessTokenRequest extends AuthorizationCode_AccessTokenRequest { code_verifier: string; } export interface ClientCredentials_AccessTokenRequest { grant_type: 'client_credentials'; client_id: string; client_secret: string; scope?: string; } export type AccessTokenRequest = AuthorizationCode_AccessTokenRequest | AuthorizationCodePKCE_AccessTokenRequest | ClientCredentials_AccessTokenRequest; export type AccessTokenResponse = output<typeof accessTokenResponseSchema>; export type AccessTokenErrorResponse = output<typeof accessTokenErrorResponseSchema>; //# sourceMappingURL=types.d.ts.map