import { Socket } from 'socket.io-client'; import type { LoggingLevel } from '@modelcontextprotocol/sdk/types.js'; import type { MonitorBaseWithExtendedData, MonitorWithExtendedData, ApiResponse, LoginResponse, MonitorList, MonitorSummary, Heartbeat, GetSettingsResponse } from './types/index.js'; /** * Uptime Kuma Socket.io API Client */ export declare class UptimeKumaClient { private socket; private url; private monitorListCache; private heartbeatListCache; private uptimeCache; private avgPingCache; private server?; private shouldLog; private mockMode; constructor(url: string, server?: { sendLoggingMessage: (params: { level: LoggingLevel; data: unknown; }) => Promise; }, shouldLog?: (level: LoggingLevel) => boolean); /** * Helper to safely log messages - only logs if server is available, connected, and level is enabled */ private safeLog; /** * Initialize mock data for testing mode */ private initializeMockData; /** * Connect to the Uptime Kuma server */ connect(): Promise; /** * Disconnect from the Uptime Kuma server */ disconnect(): void; /** * Login using username and password, or JWT token * * @param username - Username (can be empty string) * @param password - Password/API key * @param token - Optional 2FA token if required * @param jwtToken - Optional JWT token for token-based authentication * @returns Promise resolving to the login response */ login(username: string | undefined, password: string | undefined, token?: string, jwtToken?: string): Promise; getSettings(): Promise; /** * Pause a monitor * * @param monitorID - The ID of the monitor to pause * @returns Promise resolving to the API response */ pauseMonitor(monitorID: number): Promise; /** * Resume a monitor * * @param monitorID - The ID of the monitor to resume * @returns Promise resolving to the API response */ resumeMonitor(monitorID: number): Promise; /** * Set up event listeners for monitor list updates * These listeners keep the cached monitor list in sync with the server */ private setupMonitorListListeners; /** * Set up event listeners for heartbeat updates * These listeners keep the cached heartbeat list in sync with the server */ private setupHeartbeatListeners; /** * Set up event listeners for uptime updates * These listeners keep the cached uptime data in sync with the server */ private setupUptimeListeners; /** * Set up event listeners for average ping updates * These listeners keep the cached average ping data in sync with the server */ private setupAvgPingListeners; /** * Get a specific monitor by ID from the cache * * @param monitorID - The ID of the monitor to retrieve * @param includeTypeSpecificFields - If true, returns MonitorWithExtendedData with type-specific fields. If false, returns only MonitorBaseWithExtendedData (common fields + runtime data). * @returns The monitor data, or undefined if not found */ getMonitor(monitorID: number, includeTypeSpecificFields?: T): T extends true ? MonitorWithExtendedData | undefined : MonitorBaseWithExtendedData | undefined; /** * Get the cached full list of monitors the user has access to * The list is populated after login and kept up-to-date via server events * * @param filters - Optional filter criteria * @returns The cached monitor list */ getMonitorList(filters?: { keywords?: string; type?: string; active?: boolean; maintenance?: boolean; tags?: string; includeTypeSpecificFields?: T; }): MonitorList; /** * Get the cached heartbeat list * The list is populated after login and kept up-to-date via server events * * @param maxHeartbeats - Maximum number of heartbeats to return per monitor (default: 1) * @returns The cached heartbeat list with arrays of heartbeats */ getHeartbeatList(maxHeartbeats?: number): { [monitorID: string]: Heartbeat[]; }; /** * Get heartbeats for a specific monitor from the cache * * @param monitorID - The ID of the monitor * @param maxHeartbeats - Maximum number of heartbeats to return (default: 1) * @returns Array of heartbeats for the monitor, or empty array if none exist */ getHeartbeatsForMonitor(monitorID: number, maxHeartbeats?: number): Heartbeat[]; /** * Get a summarized list of all monitors with their most recent heartbeat status * * @param filters - Optional filter criteria * @returns Array of monitor summaries containing essential info and latest heartbeat status */ getMonitorSummary(filters?: { keywords?: string; type?: string; active?: boolean; maintenance?: boolean; tags?: string; status?: string; }): MonitorSummary[]; /** * Get the socket instance (for advanced usage) */ getSocket(): Socket | null; } //# sourceMappingURL=uptime-kuma-client.d.ts.map