/** * AIRGen HTTP API client with JWT authentication. * * Handles login, token caching, and automatic refresh. * Persists session tokens to ~/.airgen-session for reuse across CLI invocations. */ export interface ClientConfig { apiUrl: string; email: string; password: string; apiKey?: string; } export declare class AirgenClient { private config; private auth; private loginPromise; constructor(config: ClientConfig); private loadSession; private saveSession; private clearSession; /** The base API URL this client is configured for. */ get apiUrl(): string; get(path: string, query?: Record): Promise; post(path: string, body?: unknown): Promise; patch(path: string, body?: unknown): Promise; delete(path: string, body?: unknown): Promise; /** POST multipart/form-data (for file uploads). */ postMultipart(path: string, fields: Record, file: { fieldName?: string; filename: string; contentType: string; data: Buffer; }): Promise; /** Fetch binary content from an API path (e.g. document file download). */ fetchBinary(path: string): Promise<{ data: Buffer; contentType: string; }>; /** Fetch a static file from the server root (not the /api prefix). */ fetchStaticFile(relativePath: string): Promise<{ data: Buffer; contentType: string; }>; private request; private fetch; private handleResponse; private ensureAuth; private login; private refresh; } export declare class AirgenApiError extends Error { statusCode: number; apiMessage: string; endpoint: string; constructor(statusCode: number, apiMessage: string, endpoint: string); }