import { Readable } from 'node:stream'; import { AuditLogModuleOptions } from '../interfaces/audit-log-options.interface'; import { AuditEntry, AuditCsvOptions, AuditGetByIdOptions, AuditQueryOptions, AuditQueryResult, AuditScanOptions, AuditScanPage, ManualAuditLogInput } from '../interfaces/audit-entry.interface'; import { type ManualAuditTransactionClient, type ManualAuditTransactionHost, type ManualAuditTransactionOptions, type ManualAuditTransactionScope } from './manual-audit-transaction'; import { AuditDatabaseProvider } from '../sql/provider'; export interface AuditPruneOptions { olderThan: Date; mode?: 'drop' | 'detach'; dryRun?: boolean; client?: any; timeoutMs?: number; maxWaitMs?: number; /** * Last ACKed checkpoints for every required stream. Pruning is rejected when * it would pass any checkpoint and remove entries that stream has not ACKed. */ requiredCheckpoints?: readonly string[]; } export interface AuditPruneResult { layout: 'flat' | 'partitioned'; mode: 'drop' | 'detach' | 'delete'; prunedPartitions: string[]; deletedRows: number | null; dryRun: boolean; } export interface AuditServiceCapabilities { readonly provider: AuditDatabaseProvider; readonly manualLogging: true; readonly manualTransactions: true; readonly automaticTracking: boolean; readonly query: true; readonly scan: boolean; readonly exportCsv: boolean; readonly retention: boolean; readonly schemaInspection: boolean; readonly readIndexes: boolean; } export declare class AuditService { private readonly options; private readonly provider; private readonly Prisma; private readonly tableName; private readonly tableRef; private readonly maintenanceService; private readonly queryService; private readonly scanService; constructor(options: AuditLogModuleOptions); log(input: ManualAuditLogInput, tx?: any): Promise; /** Own a transaction and supply a writer that cannot fall back to the base client. */ withManualTransaction(client: TClient, callback: (scope: ManualAuditTransactionScope>) => Promise, options?: ManualAuditTransactionOptions): Promise; getCapabilities(): Readonly; private observeOperation; private writeManualLog; query(options: AuditQueryOptions): Promise; getById(id: string, options?: AuditGetByIdOptions): Promise; scan(options: AuditScanOptions): AsyncIterable; exportCsv(options: AuditCsvOptions): Readable; prune(options: AuditPruneOptions): Promise; private warn; private errorWithCause; } //# sourceMappingURL=audit.service.d.ts.map