34 lines
1.4 KiB
TypeScript
34 lines
1.4 KiB
TypeScript
import type { ApiResponse, 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 + hookUrl + hookToken + expiresIn) */
|
|
session(): Promise<SessionResponse>;
|
|
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
|