watchtower-node-sdk
Version:
A TypeScript Node.js SDK for the Watchtower API, providing API key management, connection string generation, and more
55 lines (54 loc) • 2.59 kB
TypeScript
import { BaseEndpoint } from '../base';
import { CreateLogRequest, BatchLogRequest, BatchLogResponse, GetLogsRequest, PaginatedLogResponse, GetLatestLogsRequest, LatestLogsResponse, GetLogByIdRequest, LogResponse } from './types';
export declare class LogsEndpoint extends BaseEndpoint {
constructor(client: any);
private validateRequiredKeys;
private validateTimestamp;
/**
* Create a log entry
* @param data - The log creation request
* @returns Promise that resolves if the log is created (201)
* @throws {InvalidRequestError} If required fields are missing or invalid
* @throws {AuthenticationError} If API keys are invalid
* @throws {ServerError} If server encounters an error
*/
createLog(data: CreateLogRequest): Promise<void>;
/**
* Create a batch of log entries
* @param data - The batch log creation request
* @returns Promise with the batch log response
* @throws {InvalidRequestError} If batch size exceeds limit or required fields are missing
* @throws {AuthenticationError} If API keys are invalid
* @throws {ServerError} If server encounters an error
*/
createBatchLogs(data: BatchLogRequest): Promise<BatchLogResponse>;
/**
* Get logs for a specific item
* @param data - The get logs request parameters
* @returns Promise with the paginated log response
* @throws {InvalidRequestError} If required fields are missing
* @throws {AuthenticationError} If API keys are invalid
* @throws {ServerError} If server encounters an error
*/
getLogs(data: GetLogsRequest): Promise<PaginatedLogResponse>;
/**
* Get the latest logs for a specific item
* @param data - The get latest logs request parameters
* @returns Promise with the latest logs response
* @throws {InvalidRequestError} If required fields are missing
* @throws {AuthenticationError} If API keys are invalid
* @throws {ServerError} If server encounters an error
*/
getLatestLogs(data: GetLatestLogsRequest): Promise<LatestLogsResponse>;
/**
* Get a specific log by ID
* @param id - The log ID
* @param data - The get log by ID request parameters
* @returns Promise with the log response
* @throws {InvalidRequestError} If required fields are missing
* @throws {AuthenticationError} If API keys are invalid
* @throws {NotFoundError} If log is not found
* @throws {ServerError} If server encounters an error
*/
getLogById(id: number, data: GetLogByIdRequest): Promise<LogResponse>;
}