@limitly/limitly-js
Version:
Official Node.js SDK for Limitly - API Key management, plans, users and request validation
49 lines • 1.83 kB
TypeScript
import { LimitlyConfig, RequestOptions } from './types';
/**
* HTTP client for making requests to the Limitly API
*/
export declare class HttpClient {
private readonly apiKey;
private readonly baseUrl;
private readonly timeout;
constructor(config: LimitlyConfig);
/**
* Makes an HTTP request to the Limitly API
* @param endpoint - The API endpoint to call
* @param options - Axios request configuration
* @param requestOptions - Additional request options
* @returns Promise with the response data
*/
private makeRequest;
/**
* Makes a GET request to the API
* @param endpoint - The API endpoint
* @param requestOptions - Additional request options
* @returns Promise with the response data
*/
get<T>(endpoint: string, requestOptions?: RequestOptions): Promise<T>;
/**
* Makes a POST request to the API
* @param endpoint - The API endpoint
* @param body - Request body data
* @param requestOptions - Additional request options
* @returns Promise with the response data
*/
post<T>(endpoint: string, body?: any, requestOptions?: RequestOptions): Promise<T>;
/**
* Makes a PUT request to the API
* @param endpoint - The API endpoint
* @param body - Request body data
* @param requestOptions - Additional request options
* @returns Promise with the response data
*/
put<T>(endpoint: string, body?: any, requestOptions?: RequestOptions): Promise<T>;
/**
* Makes a DELETE request to the API
* @param endpoint - The API endpoint
* @param requestOptions - Additional request options
* @returns Promise with the response data
*/
delete<T>(endpoint: string, requestOptions?: RequestOptions): Promise<T>;
}
//# sourceMappingURL=client.d.ts.map