db/cell_audit_queries.ts

Audit-log query for the per-cell timeline. Matches rows whose metadata jsonb names the cell on any of the keys used by cell-domain event envelopes — cell_id (cell mutations + grants), source_id / new_id (clone), source_id / target_id (cell_field events), parent_id / child_id (cell_item events).

Each metadata @> '{...}'::jsonb clause hits the existing GIN on audit_log.metadata; Postgres bitmap-ORs the index scans together.

view source

Declarations
#

2 declarations

CellAuditListOptions
#

db/cell_audit_queries.ts view source

CellAuditListOptions import type {CellAuditListOptions} from '@fuzdev/fuz_app/db/cell_audit_queries.js';

limit

type number

before?

Cursor — return rows with seq < before.

type number

query_audit_log_list_by_cell
#

db/cell_audit_queries.ts view source

(deps: QueryDeps, cell_id: string & $brand<"Uuid">, options: CellAuditListOptions): Promise<AuditLogEvent[]> import {query_audit_log_list_by_cell} from '@fuzdev/fuz_app/db/cell_audit_queries.js';

Fetch audit rows mentioning cell_id on any cell-domain metadata key. Ordered newest-first by seq for cursor pagination through before.

deps

cell_id

type string & $brand<"Uuid">

options

returns

Promise<AuditLogEvent[]>

Depends on
#

Imported by
#