Infrastructure medium complexity backend
1
Dependencies
0
Dependents
1
Entities
0
Integrations

Description

Handles streaming serialization of audit log entries to CSV and JSON formats for download. Processes large datasets as a stream to avoid memory exhaustion on high-volume exports. Applies column mapping and field sanitization appropriate to each export format.

Feature: Audit Log

audit-log-export-adapter

Responsibilities

  • Stream-serialize audit log entries to CSV with proper escaping
  • Stream-serialize audit log entries to JSON (newline-delimited or array format)
  • Apply field-level sanitization and column header mapping per format
  • Set appropriate HTTP response headers for file download

Interfaces

streamToCsv(logStream: AsyncIterable<AuditLogEntry>, res: Response): Promise<void>
streamToJson(logStream: AsyncIterable<AuditLogEntry>, res: Response): Promise<void>
buildCsvHeaders(): string[]
serializeEntry(entry: AuditLogEntry, format: ExportFormat): string

Relationships

Dependencies (1)

Components this component depends on

Related Data Entities (1)

Data entities managed by this component