polyv-live-cli
Version:
CLI tool for managing PolyV live streaming services.
72 lines • 2.85 kB
TypeScript
import { EventEmitter } from 'events';
import { Alert, AlertHistoryEntry, AlertFilter, AlertLevel, AlertType, AlertStatus, AlertSystemConfig } from '../types/alert';
export declare class AlertHistoryManager extends EventEmitter {
private historyEntries;
private persistenceFilePath;
private maxHistoryEntries;
private persistenceEnabled;
private autoSaveInterval?;
private isDirty;
constructor(config?: Partial<AlertSystemConfig>);
private initializePersistence;
private setupAutoSave;
private loadHistory;
private saveHistory;
addAlert(alert: Alert, action?: string, user?: string, context?: Record<string, any>): void;
recordAction(alertId: string, action: string, user?: string, context?: Record<string, any>): AlertHistoryEntry | null;
updateAlert(updatedAlert: Alert, user?: string): void;
getHistory(filter?: AlertFilter, limit?: number, offset?: number): AlertHistoryEntry[];
getAlertHistory(alertId: string): AlertHistoryEntry[];
getHistoryByAction(action: string): AlertHistoryEntry[];
getHistoryByUser(user: string): AlertHistoryEntry[];
getHistoryByTimeRange(startTime: number, endTime: number): AlertHistoryEntry[];
private applyFilter;
searchHistory(searchText: string, searchFields?: Array<'title' | 'message' | 'source' | 'action' | 'user'>, limit?: number): AlertHistoryEntry[];
getStatistics(): {
totalEntries: number;
uniqueAlerts: number;
actionCounts: Record<string, number>;
userCounts: Record<string, number>;
timeRange: {
earliest: number;
latest: number;
} | null;
levelCounts: Record<AlertLevel, number>;
typeCounts: Record<AlertType, number>;
statusCounts: Record<AlertStatus, number>;
};
getRecentActivity(hours?: number): {
totalAlerts: number;
newAlerts: number;
acknowledgedAlerts: number;
resolvedAlerts: number;
activeUsers: string[];
topAlertTypes: Array<{
type: AlertType;
count: number;
}>;
};
exportHistory(format?: 'json' | 'csv'): string;
private exportToCSV;
importHistory(data: string, format?: 'json', merge?: boolean): {
imported: number;
errors: string[];
};
clearHistory(): void;
clearOldHistory(olderThanMs: number): number;
private enforceMaxSize;
getConfig(): {
maxHistoryEntries: number;
persistenceEnabled: boolean;
persistenceFilePath: string;
currentSize: number;
};
updateConfig(updates: {
maxHistoryEntries?: number;
persistenceEnabled?: boolean;
persistenceFilePath?: string;
}): void;
forceSave(): Promise<void>;
destroy(): Promise<void>;
}
//# sourceMappingURL=alert-history-manager.d.ts.map