export type AuditLogStatus = "success" | "failed"; export type AuditLogSeverity = "low" | "medium" | "high" | "critical"; export type PIIStrategy = "mask" | "hash" | "remove"; export interface AuditLogEntry { id: string; userId: string | null; action: string; status: AuditLogStatus; severity: AuditLogSeverity; ipAddress: string | null; userAgent: string | null; metadata: Record; createdAt: Date; } export interface StorageReadOptions { userId?: string; action?: string; status?: AuditLogStatus; from?: Date; to?: Date; limit: number; offset: number; } export interface StorageReadResult { entries: AuditLogEntry[]; total: number; } export interface AuditLogStorage { write(entry: AuditLogEntry): Promise; read?(options: StorageReadOptions): Promise; readById?(id: string): Promise; deleteOlderThan?(date: Date): Promise; } export interface PIIRedactionOptions { enabled: boolean; fields?: string[]; strategy?: PIIStrategy; } export interface CaptureOptions { ipAddress?: boolean; userAgent?: boolean; requestBody?: boolean; } export interface PathConfig { severity?: AuditLogSeverity; capture?: CaptureOptions; } export interface RetentionConfig { enabled: boolean; days: number; } export interface MetadataLimitsConfig { maxBytes?: number; maxDepth?: number; } export interface AuditLogOptions { enabled?: boolean; nonBlocking?: boolean; storage?: AuditLogStorage; paths?: (string | { path: string; config?: PathConfig; })[]; beforePaths?: string[]; piiRedaction?: PIIRedactionOptions; capture?: CaptureOptions; retention?: RetentionConfig; metadataLimits?: MetadataLimitsConfig | false; schema?: { auditLog?: { modelName?: string; fields?: Record; }; }; beforeLog?: (entry: Omit) => Promise | null>; afterLog?: (entry: AuditLogEntry) => Promise; onWriteError?: (error: unknown, entry: Omit) => void; } export interface ResolvedMetadataLimits { maxBytes: number; maxDepth: number; } export interface ResolvedOptions { enabled: boolean; nonBlocking: boolean; storage: AuditLogStorage | undefined; capture: Required; piiRedaction: { enabled: boolean; fields?: string[]; strategy: PIIStrategy; }; retention: RetentionConfig | undefined; metadataLimits: ResolvedMetadataLimits | false; beforePaths: readonly string[]; beforeLog: AuditLogOptions["beforeLog"]; afterLog: AuditLogOptions["afterLog"]; onWriteError: AuditLogOptions["onWriteError"]; shouldCapture: (path: string) => boolean; getPathConfig: (path: string) => PathConfig | undefined; } //# sourceMappingURL=types.d.ts.map