UNPKG

@altus4/sdk

Version:

Official TypeScript SDK for Altus 4 - AI-Enhanced MySQL Full-Text Search Engine

53 lines 1.61 kB
/** * Base HTTP client for the Altus 4 SDK * * Handles authentication, error formatting, CORS debugging, and common HTTP operations. */ import { type AxiosInstance, type AxiosRequestConfig } from 'axios'; import type { ClientConfig } from './config'; import type { ApiResponse } from '../types/common'; /** * Base client class that provides HTTP request functionality */ export declare class BaseClient { protected client: AxiosInstance; protected baseURL: string; protected token: string | null; private refreshInProgress; private refreshQueue; constructor(config?: ClientConfig); /** * Attempt to refresh the access token using server-side HttpOnly refresh cookie * and retry the original request. Ensures only one refresh request is in-flight. */ private attemptRefreshAndRetry; /** * Make an authenticated HTTP request */ protected request<T = unknown>(endpoint: string, options?: AxiosRequestConfig): Promise<ApiResponse<T>>; /** * Initialize token from persistent storage on SDK instantiation */ private initializeTokenFromStorage; /** * Get stored authentication token */ protected getToken(): string | null; /** * Store authentication token */ protected setToken(token: string, expiresIn?: number): void; /** * Clear authentication token */ protected clearToken(): void; /** * Get the base URL */ getBaseURL(): string; /** * Set the base URL */ setBaseURL(baseURL: string): void; } //# sourceMappingURL=base-client.d.ts.map