diff --git a/index.d.ts b/index.d.ts index 190bd8c..85017a2 100644 --- a/index.d.ts +++ b/index.d.ts @@ -272,6 +272,33 @@ declare global { | "bulkUpdate" | "bulkDelete" > + /** + * Document paths (dot notation, e.g. `security.twoFactor.secret`) whose + * values are never written to the audit history. The values are dropped, + * not replaced: the paths are recorded in `AuditEntry.redactedFields` + * instead, so a client-side audit restore cannot write a placeholder into + * the document. Snapshot backups (`snapshotPath`) are not affected. + */ + excludeFields?: string[] + } + + /** One audit history entry as returned by `GET /api/v1/audit`. */ + export interface AuditEntry { + id?: string + projectNamespace?: string + projectName?: string + collection: string + action: string + documentId?: string + snapshot?: Record + changes?: Record + filter?: Record + /** + * Paths removed from `snapshot`/`changes` because the collection lists + * them in `audit.excludeFields`. Metadata only — the values are gone. + */ + redactedFields?: string[] + [key: string]: any } export interface UploadConfig { diff --git a/schemas/config/collection.schema.json b/schemas/config/collection.schema.json index 623a0c6..8cad41c 100644 --- a/schemas/config/collection.schema.json +++ b/schemas/config/collection.schema.json @@ -124,6 +124,14 @@ "bulkDelete" ] } + }, + "excludeFields": { + "description": "Document paths (dot notation) whose values are never stored in the audit history. The paths are recorded in AuditLog.redactedFields; snapshot backups are not affected.", + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } },