auth/cell_audit_metadata.ts

Audit-log metadata schemas for the cell layer's mutation events.

Apps register these via extra_events: on create_audit_log_config alongside any app-defined event types.

view source

Declarations
#

3 declarations

CellAuditMetadata
#

auth/cell_audit_metadata.ts view source

ZodObject<{ cell_id: $ZodBranded<ZodUUID, "Uuid", "out">; kind: ZodOptional<ZodString>; path: ZodOptional<ZodNullable<ZodString>>; }, $loose> import type {CellAuditMetadata} from '@fuzdev/fuz_app/auth/cell_audit_metadata.js';

Shared metadata envelope for cell mutations. kind and path are captured at emit-time so the audit-log viewer can show useful context for soft-deleted rows even after the cell snapshot is gone. Relation membership is tracked independently via the cell_item_* / cell_field_* per-row audit events.

Loose object: per-kind handlers may extend the metadata without spec churn.

CellCloneAuditMetadata
#

auth/cell_audit_metadata.ts view source

ZodObject<{ source_id: $ZodBranded<ZodUUID, "Uuid", "out">; new_id: $ZodBranded<ZodUUID, "Uuid", "out">; deep: ZodBoolean; item_count: ZodNumber; kind: ZodOptional<...>; }, $loose> import type {CellCloneAuditMetadata} from '@fuzdev/fuz_app/auth/cell_audit_metadata.js';

Metadata envelope for cell_clone.

source_id and new_id capture the parent → clone edge. deep flags whether children were walked. item_count reports the number of children actually cloned (post-skip). kind is captured at emit-time so an operator can filter the audit log by source shape (e.g., "every collection clone").

No skipped-child count is recorded: surfacing how many children the caller couldn't view would leak the source's hidden-child count to the cloner (who owns — and can audit — the clone). Non-viewable children are dropped silently (D8).

CellModerateAuditMetadata
#

auth/cell_audit_metadata.ts view source

ZodObject<{ cell_id: $ZodBranded<ZodUUID, "Uuid", "out">; root_id: $ZodBranded<ZodUUID, "Uuid", "out">; moderation: ZodEnum<{ approved: "approved"; rejected: "rejected"; }>; }, $loose> import type {CellModerateAuditMetadata} from '@fuzdev/fuz_app/auth/cell_audit_metadata.js';

Metadata envelope for cell_moderate. cell_id is the moderated contribution; root_id is its governing root (the container whose moderation authority gated the call); moderation is the terminal decision applied ('approved' | 'rejected').

Imported by
#