import { auditRecord } from '../schema/audit-record.js'; /** * Inferred row shape from the `audit_record` definition. The query result is * typed against this — re-exported so consumers don't have to reach into * `src/audit/schema/`. */ export type AuditRecordRow = typeof auditRecord.Select; export interface AuditQueryFilters { /** Match audit rows whose `entity` is in this set. Single string accepted as shorthand. */ readonly entity?: string | readonly string[]; /** Match audit rows whose `verb` is in this set. Single string accepted as shorthand. */ readonly verb?: string | readonly string[]; /** Match audit rows whose `actorId` equals this. `null` matches system-actor rows. */ readonly actorId?: string | null; /** Match audit rows emitted under this trace. */ readonly traceId?: string; /** Match audit rows emitted under this specific flow step. */ readonly traceStepId?: string; /** Inclusive lower bound on `traceDay`. The partition-pruning hint Postgres uses to skip irrelevant partitions. */ readonly traceDayFrom?: string; /** Inclusive upper bound on `traceDay`. */ readonly traceDayTo?: string; /** Inclusive lower bound on `occurredAt`. */ readonly occurredFrom?: Date; /** Exclusive upper bound on `occurredAt`. */ readonly occurredTo?: Date; } export interface AuditQueryOptions { /** Max rows to return. Default 50, hard cap 500 — exceeding it throws. */ readonly limit?: number; /** Opaque cursor from a previous page's result. */ readonly cursor?: string; /** `false` (default) returns newest-first; `true` returns oldest-first. */ readonly asc?: boolean; } export interface AuditQueryResult { readonly rows: readonly AuditRecordRow[]; /** Opaque cursor for the next page; `null` when this page is the last. */ readonly cursor: string | null; /** `true` when more rows exist past this page. */ readonly hasMore: boolean; } /** * Returns a page of `audit_record` rows matching `filters`, ordered by * `(occurredAt, id)`. Pass `result.cursor` back as `options.cursor` to get * the next page; stop when `cursor` is `null`. */ export declare function query(filters?: AuditQueryFilters, options?: AuditQueryOptions): Promise; //# sourceMappingURL=query.d.ts.map