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
#

4 declarations

CellAuditMetadata
#

auth/cell_audit_metadata.ts view source

value + type

{ cell_id: Branded<string, "Uuid">; kind?: string | undefined; path?: string | undefined; } & Record<string, unknown>

type { cell_id: Branded<string, "Uuid">; kind?: string | undefined; path?: string | undefined; } & Record<string, unknown>

import {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.

cell_id

type Branded

kind?

type string

path?

type string

[key: string]

type unknown

CellCloneAuditMetadata
#

auth/cell_audit_metadata.ts view source

value + type

{ source_id: Branded<string, "Uuid">; deep: boolean; new_id: Branded<string, "Uuid">; item_count: number; kind?: string | undefined; } & Record<string, unknown>

type { source_id: Branded<string, "Uuid">; deep: boolean; new_id: Branded<string, "Uuid">; item_count: number; kind?: string | undefined; } & Record<string, unknown>

import {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).

source_id

type Branded

deep

type boolean

new_id

type Branded

item_count

type number

kind?

type string

[key: string]

type unknown

CellModerateAuditMetadata
#

auth/cell_audit_metadata.ts view source

value + type

{ root_id: Branded<string, "Uuid">; moderation: "approved" | "rejected"; cell_id: Branded<string, "Uuid">; } & Record<string, unknown>

type { root_id: Branded<string, "Uuid">; moderation: "approved" | "rejected"; cell_id: Branded<string, "Uuid">; } & Record<string, unknown>

import {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').

root_id

type Branded

moderation

type "approved" | "rejected"

cell_id

type Branded

[key: string]

type unknown

CellPolicySetAuditMetadata
#

auth/cell_audit_metadata.ts view source

value + type

{ policy: ({} & Record<string, unknown>) | null; cell_id: Branded<string, "Uuid">; previous_policy: ({} & Record<string, unknown>) | null; } & Record<string, unknown>

type { policy: ({} & Record<string, unknown>) | null; cell_id: Branded<string, "Uuid">; previous_policy: ({} & Record<string, unknown>) | null; } & Record<string, unknown>

import {CellPolicySetAuditMetadata} from '@fuzdev/fuz_app/auth/cell_audit_metadata.js';

Metadata envelope for cell_policy_set. cell_id is the root; policy is the policy written (null when cleared) and previous_policy the one it replaced, so the audit trail carries every policy a root has had.

policy

type CellPolicy | null

cell_id

type Branded

previous_policy

type CellPolicy | null

[key: string]

type unknown

Depends on
#

Imported by
#