auth-runtime/dist/client.d.ts

36 lines
1.5 KiB
TypeScript

import type { ApiResponse, ClientConfig, SessionResponse } from './types.js';
export interface SkillClientOptions {
/** Override AUTH_BASE (gateway URL for token acquisition) */
authBase?: string;
/** Override CLIENT_KEY */
clientKey?: string;
/** Override base URL for business API calls (defaults to authBase) */
apiBase?: string;
/** Dry run mode — no real HTTP calls */
dryRun?: boolean;
/** Cache directory (default: /tmp/skill-auth-cache) */
cacheDir?: string;
/** Min TTL before token refresh, seconds (default: 60) */
minTtlSec?: number;
}
export declare class SkillClient {
private readonly config;
private readonly apiBase;
private readonly dryRun;
constructor(options?: SkillClientOptions);
/** Fetch raw session info (token + expiresIn) */
session(): Promise<SessionResponse>;
/** Fetch client config (metadata with hook info, provider keys, etc.) */
clientConfig(): Promise<ClientConfig>;
get(path: string): Promise<ApiResponse>;
post(path: string, body?: unknown): Promise<ApiResponse>;
put(path: string, body?: unknown): Promise<ApiResponse>;
patch(path: string, body?: unknown): Promise<ApiResponse>;
delete(path: string, body?: unknown): Promise<ApiResponse>;
private request;
private getToken;
private refreshToken;
private fetchSession;
}
export declare function createSkillClient(options?: SkillClientOptions): SkillClient;
//# sourceMappingURL=client.d.ts.map