/** * Base service client with common functionality * Provides HTTP operations, error handling, and retry logic */ import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; import { ServiceConfig, SDKError, ErrorHandlingConfig } from '../config'; import { ApiResponse } from '../types'; /** * Base service client class */ export declare abstract class BaseServiceClient { protected client: AxiosInstance; protected config: ServiceConfig; protected errorHandling: ErrorHandlingConfig; protected serviceName: string; constructor(config: ServiceConfig, errorHandling: ErrorHandlingConfig, serviceName: string, certificate?: { cert: string; key: string; }); /** * Setup request and response interceptors */ protected setupInterceptors(): void; /** * Create standardized SDK error from axios error */ protected createSDKError(error: any): SDKError; /** * Handle error with global handlers */ protected handleError(error: SDKError): Promise; /** * Determine if request should be retried */ protected shouldRetry(error: SDKError): boolean; /** * Retry failed request with backoff */ protected retryRequest(config: AxiosRequestConfig, error: SDKError): Promise; /** * Make GET request */ protected get(url: string, params?: Record): Promise>; /** * Make POST request */ protected post(url: string, data?: any, config?: AxiosRequestConfig): Promise>; /** * Make PUT request */ protected put(url: string, data?: any): Promise>; /** * Make DELETE request */ protected delete(url: string, data?: any): Promise>; /** * Make GET request for binary data */ protected getBinary(url: string): Promise>; /** * Make POST request with form data */ protected postForm(url: string, formData: any): Promise>; /** * Create standardized API response */ protected createApiResponse(response: AxiosResponse): ApiResponse; /** * Add authorization header */ protected setAuthorizationHeader(token: string): void; /** * Remove authorization header */ protected removeAuthorizationHeader(): void; } declare module 'axios' { interface AxiosRequestConfig { _retryCount?: number; } }