/** * The shape of a successful OAuth2 token response. */ export declare class OAuthTokenHttpError extends Error { readonly statusCode: number; readonly errorCode?: string; constructor(statusCode: number, body: string); } export interface OAuthTokenResponse { access_token: string; /** RECOMMENDED but not required by OAuth2, and some servers send it as a string. */ expires_in?: number | string; } /** * Requests an access token from an OAuth2 token endpoint using the client credentials flow. * @param tokenEndpoint - The token endpoint URL. * @param clientId - The client identifier. * @param clientSecret - The client secret. * @param skipTlsValidation - Whether to skip TLS certificate chain validation. * @returns The parsed token response; rejects when the request fails or the response is not a valid token. */ export declare function fetchOAuthAccessToken(tokenEndpoint: string, clientId: string, clientSecret: string, skipTlsValidation: boolean): Promise; /** * Describes a request error. Connecting to a host that resolves to several addresses, such as * localhost, fails with an AggregateError whose own message is empty. * @param error - The request error. * @returns A description that names the failure. */ export declare function describeRequestError(error: Error): string; //# sourceMappingURL=fetchOAuthAccessToken.d.ts.map