/** * Alert Manager * * Sends alerts for security and compliance events. * Supports multiple channels: console, file, webhook, email. * * Added by Pantheon Security for enterprise compliance support. */ import type { Alert, AlertConfig, AlertSeverity } from "./types.js"; /** * Alert Manager class */ export declare class AlertManager { private static instance; private config; private alertHistory; private hourlyAlerts; private recentAlerts; private alertsDir; private constructor(); /** * Get singleton instance */ static getInstance(): AlertManager; /** * Check if alert should be sent based on severity */ private meetsMinimumSeverity; /** * Check if alert is within cooldown period */ private isInCooldown; /** * Check if hourly limit is exceeded */ private isHourlyLimitExceeded; /** * Record that an alert was sent. When a severity is provided the alert is * also added to the 24h rolling window used for dashboard metrics; internal * bookkeeping keys (e.g. the rate-limit warning) omit it. */ private recordAlert; /** * Generate a unique key for deduplication */ private generateKey; /** * Send an alert */ sendAlert(severity: AlertSeverity, title: string, message: string, source: string, details?: Record): Promise; /** * Send alert to console */ private sendToConsole; /** * Send alert to file */ private sendToFile; /** * Send alert to webhook */ private sendToWebhook; /** * Format webhook body for common services (Slack, Teams, generic) */ private formatWebhookBody; /** * Get severity icon */ private getSeverityIcon; /** * Get severity color (for webhooks) */ private getSeverityColor; /** * Send a critical alert */ critical(title: string, message: string, source: string, details?: Record): Promise; /** * Send an error alert */ error(title: string, message: string, source: string, details?: Record): Promise; /** * Send a warning alert */ warning(title: string, message: string, source: string, details?: Record): Promise; /** * Send an info alert */ info(title: string, message: string, source: string, details?: Record): Promise; /** * Get alert statistics */ getStats(): { enabled: boolean; min_severity: AlertSeverity; cooldown_seconds: number; max_alerts_per_hour: number; alerts_this_hour: number; alerts_24h: number; critical_24h: number; channels: string[]; }; /** * Update configuration at runtime */ updateConfig(updates: Partial): void; } /** * Get the alert manager instance */ export declare function getAlertManager(): AlertManager; /** * Send an alert */ export declare function sendAlert(severity: AlertSeverity, title: string, message: string, source: string, details?: Record): Promise; /** * Send a critical alert */ export declare function alertCritical(title: string, message: string, source: string, details?: Record): Promise; /** * Send a warning alert */ export declare function alertWarning(title: string, message: string, source: string, details?: Record): Promise;