import { LogDataResponse } from '../types/logs.types.js'; interface RetryConfig { maxRetries: number; initialDelayMs: number; maxDelayMs: number; retryableStatuses: number[]; } export declare enum NetworkErrorType { TIMEOUT = "TIMEOUT", CONNECTION_REFUSED = "CONNECTION_REFUSED", NETWORK_ERROR = "NETWORK_ERROR", SERVER_ERROR = "SERVER_ERROR", RATЕ_LIMITED = "RATE_LIMITED", UNKNOWN = "UNKNOWN" } export declare class NetworkError extends Error { readonly errorType: NetworkErrorType; readonly statusCode?: number | undefined; readonly isRetryable: boolean; constructor(message: string, errorType: NetworkErrorType, statusCode?: number | undefined, isRetryable?: boolean); } export declare class ApiClient { private client; private cache; private cacheTtl; private refreshToken?; private isRefreshing; private apiBaseUrl; private retryConfig; constructor(retryConfig?: Partial); /** * Attempt to refresh the access token using the refresh token * Uses the device-specific refresh endpoint which accepts refresh_token in body * (The protected /auth/refresh endpoint expects httpOnly cookies from browsers) */ private refreshAccessToken; /** * Update the token file with new access and refresh tokens */ private updateTokenFile; /** * Classify an Axios error into a NetworkError with proper type */ private classifyError; /** * Execute a request with retry logic and exponential backoff */ private executeWithRetry; /** * Fetch and transform log data from the Logspace API * * Data Flow: * 1. Chrome Extension: Collects logs as flat LogEntry[] array with { type, timestamp, data } * 2. Backend API: Stores gzipped LogEntry[] in database, returns in log_json field * 3. MCP Server: Transforms flat array into nested structure for log analysis tools * * This transformation groups logs by type (network, console, error, etc.) and extracts * session metadata for easier analysis by the log parser. */ fetchLogData(bugId: number): Promise; clearCache(bugId?: number): void; getCacheStats(): { size: number; entries: number[]; }; } /** * Returns the ApiClient singleton, recreating it if the token file * has changed since the last creation (e.g. VS Code extension refreshed tokens). */ export declare function getApiClient(): ApiClient; /** * Reset the ApiClient singleton so the next call to getApiClient() * creates a fresh instance that re-reads tokens from disk. * Call this after login/logout/token refresh. */ export declare function resetApiClient(): void; export {}; //# sourceMappingURL=apiClient.d.ts.map