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
#

4 declarations

AuditStreamAuth
#

auth/audit_log_route_schema.ts view source

AuditStreamAuth import type {AuditStreamAuth} from '@fuzdev/fuz_app/auth/audit_log_route_schema.js';

The audit stream's auth: the gates its handler may itself answer as.

account

type "required"

actor

type "required"

roles

type readonly string[]

credential_types

type readonly string[]

required_scope

type "surface:audit_stream"

AuditStreamQuery
#

auth/audit_log_route_schema.ts view source

value + type

{ acting?: Branded<string, "Uuid"> | undefined; } import {AuditStreamQuery} from '@fuzdev/fuz_app/auth/audit_log_route_schema.js';

Query schema for the audit-log SSE route, a @fuzdev/fuz_schema object that refuses unknown keys — multi-actor admins pass ?acting=<uuid>.

acting?

type Branded

create_audit_log_route_shape
#

auth/audit_log_route_schema.ts view source

(required_role?: string): RouteShape<[], Schema<null, null, "literal", null>, AuditStreamAuth, undefined> 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 attaches the live SSE handler to it (attach_route_handler); cross-process surface builders attach a stub. The output is literal(null) because SSE streams have no JSON response body.

required_role?

role gating the stream (default DEFAULT_AUDIT_STREAM_ROLE)

type string
optional default DEFAULT_AUDIT_STREAM_ROLE

returns

RouteShape

the SSE route shape minus its handler

DEFAULT_AUDIT_STREAM_ROLE
#

Depends on
#

Imported by
#