/** * Audit Logging Plugin * Comprehensive audit trail for security and compliance */ import type { IAuditPlugin, AuditEvent, AuditLogExport, PluginState } from '../core/interfaces'; export interface AuditPluginConfig { enabled: boolean; retentionDays: number; logLevel: 'info' | 'warn' | 'error' | 'security'; maxEvents: number; enableCompression: boolean; enableEncryption: boolean; externalEndpoint?: string; batchSize: number; flushInterval: number; } export declare class AuditPlugin implements IAuditPlugin { readonly id = "audit-plugin"; readonly name = "Audit Logging Plugin"; readonly version = "2.0.0"; state: PluginState; private config; private events; private flushTimer; private pendingEvents; private sessionCounter; constructor(config?: Partial); initialize(config?: Partial): Promise; dispose(): Promise; isReady(): boolean; /** * Log an audit event */ logEvent(event: AuditEvent): Promise; /** * Get audit trail for a session */ getAuditTrail(sessionId: string): Promise; /** * Export audit log for a date range */ exportAuditLog(startDate: Date, endDate: Date): Promise; /** * Get audit statistics */ getAuditStats(): { totalEvents: number; eventsByType: Record; eventsBySeverity: Record; oldestEvent: Date | null; newestEvent: Date | null; }; /** * Search audit events */ searchEvents(query: { eventType?: string; severity?: string; sessionId?: string; userId?: string; startDate?: Date; endDate?: Date; }): AuditEvent[]; /** * Clear old events based on retention policy */ cleanupOldEvents(): Promise; /** * Validate audit event */ private validateEvent; /** * Enrich event with additional metadata */ private enrichEvent; /** * Generate unique event ID */ private generateEventId; /** * Flush pending events to storage/external service */ private flushEvents; /** * Save events to local storage */ private saveEventsToStorage; /** * Load events from local storage */ private loadEventsFromStorage; /** * Send events to external service */ private sendToExternalService; /** * Compress data (simple implementation) */ private compressData; /** * Decompress data (simple implementation) */ private decompressData; /** * Start flush timer */ private startFlushTimer; /** * Stop flush timer */ private stopFlushTimer; /** * Get plugin configuration */ getConfig(): Required; /** * Update plugin configuration */ updateConfig(newConfig: Partial): Promise; } //# sourceMappingURL=audit-plugin.d.ts.map