@scalar/api-client
Version:
the open source API testing client
20 lines • 952 B
TypeScript
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
import type { ErrorResponse } from '../../../../libs/errors.js';
import type { OAuthFlowsObjectSecret } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/secret-types';
export type OAuth2Tokens = {
accessToken: string;
refreshToken?: string;
};
/**
* Authorize oauth2 flow
*
* @returns the resolved oauth2 tokens
*/
export declare const authorizeOauth2: (flows: OAuthFlowsObjectSecret, type: keyof OAuthFlowsObjectSecret, selectedScopes: string[],
/** We use the active server to set a base for relative redirect uris */
activeServer: ServerObject | null,
/** If we want to use the proxy */
proxyUrl: string,
/** Flattened environment variables used to resolve server URL templates like `{protocol}` */
environmentVariables?: Record<string, string>) => Promise<ErrorResponse<OAuth2Tokens>>;
//# sourceMappingURL=oauth.d.ts.map