UNPKG

watchtower-node-sdk

Version:

A TypeScript Node.js SDK for the Watchtower API, providing API key management, connection string generation, and more

59 lines (58 loc) 2.36 kB
import { AxiosInstance, AxiosRequestConfig } from 'axios'; import { HealthEndpoint } from './endpoints/health/handler'; import { APIKeyEndpoint } from './endpoints/apikey/handler'; import { LogsEndpoint } from './endpoints/logs/handler'; import { MetricsEndpoint } from './endpoints/metrics/handler'; import { ItemsEndpoint } from './endpoints/items/handler'; import { IntelligenceEndpoint } from './endpoints/intelligence/handler'; import { AnalyzeEndpoint } from './endpoints/analyze/handler'; import { AppEndpoint } from './endpoints/app/handler'; import { ConnectionStringEndpoint } from './endpoints/connectionstring/handler'; export declare class WatchtowerSDK { private client; readonly health: HealthEndpoint; readonly apikey: APIKeyEndpoint; readonly logs: LogsEndpoint; readonly metrics: MetricsEndpoint; readonly items: ItemsEndpoint; readonly intelligence: IntelligenceEndpoint; readonly analyze: AnalyzeEndpoint; readonly app: AppEndpoint; readonly connectionstring: ConnectionStringEndpoint; constructor(config?: AxiosRequestConfig); /** * Make a GET request * @param url - The endpoint URL * @param config - Optional Axios request configuration * @returns Promise with the response data */ get<T = any>(url: string, config?: AxiosRequestConfig): Promise<T>; /** * Make a POST request * @param url - The endpoint URL * @param data - The data to send * @param config - Optional Axios request configuration * @returns Promise with the response data */ post<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>; /** * Make a PUT request * @param url - The endpoint URL * @param data - The data to send * @param config - Optional Axios request configuration * @returns Promise with the response data */ put<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>; /** * Make a DELETE request * @param url - The endpoint URL * @param config - Optional Axios request configuration * @returns Promise with the response data */ delete<T = any>(url: string, config?: AxiosRequestConfig): Promise<T>; /** * Get the underlying Axios instance * @returns The Axios instance */ getClient(): AxiosInstance; }