26 lines
1.1 KiB
TypeScript
26 lines
1.1 KiB
TypeScript
|
|
import type { ApiResponse, EnvConfig, HttpMethod, SessionResponse } from './types.js';
|
||
|
|
/**
|
||
|
|
* Create environment configuration from process.env
|
||
|
|
*/
|
||
|
|
export declare function createEnvConfig(): EnvConfig;
|
||
|
|
/**
|
||
|
|
* Fetch session JSON from auth endpoint
|
||
|
|
*/
|
||
|
|
export declare function fetchSessionJson(dryRun: boolean, config: EnvConfig): Promise<SessionResponse>;
|
||
|
|
/**
|
||
|
|
* Get access token with caching
|
||
|
|
*/
|
||
|
|
export declare function getAccessToken(dryRun: boolean, config: EnvConfig): Promise<string>;
|
||
|
|
/**
|
||
|
|
* Refresh access token (bypass cache)
|
||
|
|
*/
|
||
|
|
export declare function refreshAccessToken(dryRun: boolean, config: EnvConfig): Promise<string>;
|
||
|
|
/**
|
||
|
|
* Check whether response likely indicates expired/invalid runtime session.
|
||
|
|
*/
|
||
|
|
export declare function isRetryableSessionError(response: ApiResponse): boolean;
|
||
|
|
/**
|
||
|
|
* Make API request with automatic runtime token refresh and one retry.
|
||
|
|
*/
|
||
|
|
export declare function requestApiWithAutoRefresh(method: HttpMethod, url: string, dryRun: boolean, config: EnvConfig, body?: string, accessToken?: string): Promise<ApiResponse>;
|
||
|
|
//# sourceMappingURL=auth.d.ts.map
|