siputzx-api
Version:
Module Wrapper For Siputzx API
43 lines • 1.14 kB
TypeScript
import { SiputzxAPIConfig, APIListResponse } from '../types';
export declare class SiputzxAPI {
private client;
private baseURL;
private apikey?;
private endpointsLoaded;
private endpointsList;
[key: string]: any;
constructor(config?: SiputzxAPIConfig);
/**
* Make a GET request to the API
*/
get<T = any>(endpoint: string, params?: Record<string, any>): Promise<T>;
/**
* Make a POST request to the API
*/
post<T = any>(endpoint: string, data?: Record<string, any>): Promise<T>;
/**
* Get list of all available API endpoints
*/
getEndpoints(): Promise<APIListResponse>;
/**
* Initialize dynamic endpoints by fetching endpoint list from API
*/
initializeEndpoints(): Promise<void>;
/**
* Setup dynamic endpoints based on API response
*/
private setupDynamicEndpoints;
/**
* Handle API errors
*/
private handleError;
/**
* Set API key
*/
setApiKey(apikey: string): void;
/**
* Set base URL
*/
setBaseURL(baseURL: string): void;
}
//# sourceMappingURL=SiputzxAPI.d.ts.map