UNPKG

smart-track

Version:

A TypeScript SDK for integrating with tracking services using the Beckn protocol. Provides adapters for package tracking with built-in error handling, retry logic, and type safety.

22 lines 897 B
import { RequestOptions } from "https"; import { AdapterConfig, HttpMethod } from "../types/adapter.types"; import { BecknMetadataSchemaType } from "../types/payload.types"; export declare abstract class BaseAdapter { protected readonly baseUrl: string; protected readonly timeout: number; protected readonly headers: Record<string, string>; protected readonly retryAttempts: number; protected readonly beckn_metadata: BecknMetadataSchemaType; constructor(config: AdapterConfig); protected request<T = any>(method: HttpMethod, endpoint: string, data?: any, options?: RequestOptions): Promise<T>; private cleanHeaders; private makeRequest; private handleErrorResponse; private parseResponse; private executeWithRetry; healthCheck(): Promise<{ status: string; timestamp: string; }>; } //# sourceMappingURL=base.adapter.d.ts.map