export declare function getAccessToken(): Promise; export declare class ClioApiError extends Error { readonly statusCode: number; constructor(statusCode: number, message: string); } export declare function getClioBaseUrl(): string; export interface ClioClientConfig { requestsPerSecond: number; maxAttempts: number; timeoutMs: number; signal?: AbortSignal; baseDelayMs?: number; } export type ClioFailureKind = "rate_limit" | "server" | "network" | "timeout"; export declare class ClioAuthExpiredError extends Error { constructor(); } export declare class ClioAbortedError extends Error { constructor(); } export declare class ClioRequestFailure extends Error { readonly status: number | null; readonly kind: ClioFailureKind; readonly attempts: number; constructor(status: number | null, kind: ClioFailureKind, attempts: number); } /** * Opt-in hardening for long-running readers (the export). With no config the client behaves * exactly as before; with one, every request waits for a rate slot and failed GETs are retried. */ export declare function configureClioClient(config: ClioClientConfig | null): void; export declare function sleepAbortable(ms: number, signal?: AbortSignal): Promise; export declare function acquireRequestSlot(): Promise; export declare function pauseRequests(ms: number): void; export declare function retryDelayMs(attempt: number, retryAfterHeader: string | null): number; /** Authenticated GET to the Clio API host only; the bearer token never leaves that host. */ export declare function clioRawGet(target: string, opts?: { redirect?: RequestInit["redirect"]; }): Promise; export declare function clioGet(path: string, params?: Record): Promise; /** * Follows Clio cursor pagination to completion and returns the concatenated `data` array. * Use for correctness-critical reads (existence checks, dedup) — not for interactive * "browse" tools, where returning a single manual page keeps LLM payloads small. */ export declare function clioGetAllPages(path: string, params: Record, opts?: { maxPages?: number; }): Promise; export declare function clioPost(path: string, body: unknown, params?: Record): Promise; export declare function clioPatch(path: string, body: unknown, params?: Record): Promise; export declare function extractNextPageToken(meta: any): string | null; export declare function clioPut(path: string, body: unknown): Promise; /** Result of a read that may have had to drop optional field expansions. */ export interface FieldFallbackResult { body: any; /** Present only when the first attempt was rejected and the reduced selection was used. */ fields_warning?: string; } /** * GET with one retry on Clio rejecting the `fields` selection. * * Clio validates `fields` strictly and answers an unknown or badly nested entry * with a 400 for the whole request. Because one shared field string is embedded * in every matter and contact read, a single wrong association name takes out * all of them at once — which is exactly what 2.2.0 shipped. This turns that * class of mistake into a degraded response with a warning attached, so a bad * field selection costs one column instead of the connector. * * Only used for reads whose result is displayed. Reads whose result feeds a * WRITE must not use it: silently dropping expansions there would change what * gets written, so those keep failing loudly. */ export declare function clioGetWithFieldFallback(path: string, params: Record, fallbackFields: string): Promise; //# sourceMappingURL=clioClient.d.ts.map