/** Raw JSON response from the API before envelope unwrapping. */ export interface RawAPIResponse { success: boolean; data: unknown; total?: number; page?: number; page_size?: number; has_next?: boolean; has_prev?: boolean; comparison?: unknown; totals?: unknown; [key: string]: unknown; } export declare class SealMetricsClient { /** * Read-only api_key (X-API-Key). Optional + mutable so the server can start in * setup-only mode without a key (RF-3202) and adopt the key returned by * provision_site at runtime to enable the read-only tools (RF-3202b). Held in * memory only — never echoed to the model or logs (VAL-3201). */ private apiKey; private readonly baseUrl; constructor(apiKey: string | undefined, baseUrl: string); /** True once a read-only api_key is available (env at boot or post-provision). */ hasApiKey(): boolean; /** Return the in-memory api_key (for setup-core verify). Never logged by callers. */ getApiKey(): string | undefined; /** Adopt the api_key returned by provision_site so read-only tools work (RF-3202b). */ setApiKey(apiKey: string): void; /** * Authenticated POST (RF-3201). The client was GET-only in v1.2.0; the * write-path needs it. NOT auto-retried — POST is not idempotent (a blind retry * of /provision could create duplicate accounts). Authenticates with the * publishable provision key (`provisionKey`) for provisioning, or X-API-Key * otherwise. On 2xx returns the parsed JSON; on non-2xx / network throws * SealMetricsAPIError carrying the status code for the caller to map. */ post(path: string, body: unknown, opts?: { provisionKey?: string; }): Promise; /** * Authenticated PATCH (PRD-035 CHG-014: channel-rule draft edits). * Same contract as post(): no auto-retry, throws SealMetricsAPIError. */ patch(path: string, body: unknown): Promise; /** * Authenticated DELETE (PRD-035 CHG-014: channel-rule draft deletion). * Tolerates empty 204 bodies. */ del(path: string): Promise; private send; /** * Send an authenticated GET request. Unwraps the API envelope * and returns just the `data` field. */ request(path: string, params?: Record): Promise; /** * Send an authenticated GET request and return the full JSON body * without unwrapping. Use this for endpoints that don't use the * standard APIResponse envelope (e.g. alerts, webhooks). */ requestDirect(path: string, params?: Record): Promise; /** * Send an authenticated GET request and return the full response * including pagination fields (total, page, has_next, etc.). * Use this for paginated endpoints. */ requestPaginated(path: string, params?: Record): Promise<{ data: T[]; total: number; page: number; page_size: number; has_next: boolean; comparison?: unknown; totals?: unknown; }>; private requestRaw; } //# sourceMappingURL=client.d.ts.map