auth/audit_log_route_schema.ts

Hono-free wire schemas + route shape for the audit-log SSE stream.

Split from audit_log_routes.ts (whose handler pulls hono/streaming via realtime/sse) so cross-process test suites can build the audit-stream route shape without dragging the in-process SSE handler, and its optional hono peer, onto a backend-spawning consumer. audit_log_routes.ts imports these back and attaches the live SSE handler; single source of truth for the wire shape.

view source

Declarations
#

3 declarations

AuditStreamQuery
#

auth/audit_log_route_schema.ts view source

ZodObject<{ acting: ZodOptional<$ZodBranded<ZodUUID, "Uuid", "out">>; }, $strict> import type {AuditStreamQuery} from '@fuzdev/fuz_app/auth/audit_log_route_schema.js';

Query schema for the audit-log SSE route — multi-actor admins pass ?acting=<uuid>.

create_audit_log_route_shape
#

auth/audit_log_route_schema.ts view source

(required_role?: string): Omit<RouteSpec, "handler"> import {create_audit_log_route_shape} from '@fuzdev/fuz_app/auth/audit_log_route_schema.js';

The GET /audit/stream SSE route shape minus its handler — pure hono-free data. create_audit_log_route_specs spreads this and attaches the live SSE handler; cross-process surface builders spread it with a stub handler. The output is z.null() because SSE streams have no JSON response body.

required_role

role gating the stream (default DEFAULT_AUDIT_STREAM_ROLE)

type string
default DEFAULT_AUDIT_STREAM_ROLE

returns

Omit<RouteSpec, "handler">

the SSE route shape minus its handler

DEFAULT_AUDIT_STREAM_ROLE
#

Depends on
#

Imported by
#