ui/audit_log_state.svelte.ts

Reactive state for the audit log viewer.

Supports both fetch-based pagination and realtime SSE streaming. SSE events are prepended to the list; use fetch() for initial load and filters.

Declarations
#

2 declarations

view source

AuditLogFetchOptions
#

AuditLogState
#

ui/audit_log_state.svelte.ts view source

inheritance

extends:

events

type Array<AuditLogEventWithUsernamesJson>

permit_history_events

type Array<PermitHistoryEventJson>

count

readonly

connected

Whether the SSE stream is currently connected.

constructor

type new (stream_url?: string): AuditLogState

stream_url
type string
default '/api/admin/audit-log/stream'

fetch

type (options?: AuditLogFetchOptions | undefined): Promise<void>

options?
type AuditLogFetchOptions | undefined
optional
returns Promise<void>

fetch_permit_history

type (limit?: number | undefined, offset?: number | undefined): Promise<void>

limit?
type number | undefined
optional
offset?
type number | undefined
optional
returns Promise<void>

subscribe

Connect to the SSE stream for realtime audit events.

New events are prepended to events. EventSource auto-reconnects on transient errors; since_seq fills gaps on reconnection.

type (): () => void

returns () => void

cleanup function that closes the connection

disconnect

Close the SSE connection.

type (): void

returns void

Depends on
#

Imported by
#