UNPKG

watchtower-node-sdk

Version:

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

40 lines (39 loc) 1.82 kB
import { BaseEndpoint } from '../base'; import { GetLatestRequest, AnalyzeLogsRequest, AnalyzeCurrentRequest, AnalyzeCurrentResponse, AnalysisResult } from './types'; export declare class AnalyzeEndpoint extends BaseEndpoint { constructor(client: any); private validateRequiredKeys; /** * Get the latest analysis for an item * @param data - The request parameters * @returns Promise with the analysis result * @throws {InvalidRequestError} If required fields are missing or invalid * @throws {AuthenticationError} If API keys are invalid * @throws {ServerError} If server encounters an error */ getLatest(data: GetLatestRequest): Promise<AnalysisResult>; /** * Analyze logs for an item within a specified time range * @param data - The request parameters * @returns Promise with the analysis result * @throws {InvalidRequestError} If required fields are missing or invalid * @throws {AuthenticationError} If API keys are invalid * @throws {ServerError} If server encounters an error */ analyzeLogs(data: AnalyzeLogsRequest): Promise<AnalysisResult>; /** * Get the current analysis for an item * @param data - The request parameters * @returns Promise with the current analysis response * @throws {InvalidRequestError} If required fields are missing or invalid * @throws {AuthenticationError} If API keys are invalid * @throws {ServerError} If server encounters an error */ analyzeCurrent(data: AnalyzeCurrentRequest): Promise<AnalyzeCurrentResponse>; /** * Validate if a string is a valid ISO 8601 date * @param dateString - The date string to validate * @returns boolean indicating if the string is a valid ISO 8601 date */ private isValidISODate; }