import { AxiosInstance } from "axios"; import { Instance } from "../types"; import { GreenApiLogger } from "../utils/logger"; /** * Base client for GREEN-API interactions. * Provides common HTTP request methods and URL building. */ export declare abstract class BaseClient { protected instance: Instance; protected client: AxiosInstance; protected readonly baseUrl = "https://api.green-api.com"; protected readonly logger: GreenApiLogger; /** * Creates a new BaseClient instance. * * @param instance - GREEN-API instance credentials */ protected constructor(instance: Instance); /** * Builds the base URL for the GREEN-API instance. * * @returns The complete base URL */ protected buildUrl(): string; /** * Builds an endpoint path with the API token. * * @param endpoint - API endpoint name * @returns Complete endpoint path */ protected buildEndpoint(endpoint: string): string; /** * Makes an HTTP request to the GREEN-API. * * @param method - HTTP method (get, post or delete) * @param endpoint - API endpoint * @param data - Request body data (for POST) * @param queryParams - Query parameters (for GET/DELETE) * @param config - Additional Axios config * @param pathAfterToken - Additional path segment to append after the API token * @returns Promise resolving to the response data * @throws Error on failure */ protected makeRequest(method: "get" | "post" | "delete", endpoint: string, data?: any, queryParams?: Record, config?: any, pathAfterToken?: string): Promise; /** * Makes a file upload request to the GREEN-API. * * @param endpoint - API endpoint * @param formData - Form data with file * @param headers - Additional headers * @returns Promise resolving to the response data */ protected makeFileUploadRequest(endpoint: string, formData: FormData, headers?: Record): Promise; }