All files / web/src/lib/abacus/print ring-events.ts

100% Statements 21/21
100% Branches 0/0
100% Functions 0/0
100% Lines 21/21

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
/**
 * Doorbell event contract (Phase 2a, #8.4) — client-safe: just the event name
 * and payload shape, no server imports, so the browser listener and the
 * server emitter share one definition.
 *
 * Design triad: the ring is a HINT ("something about your print changed"),
 * the authenticated proxy read is truth, and a slow poll is the backstop.
 * The payload therefore carries identifiers only — never job state — and the
 * client responds by invalidating queries and re-reading through the proxy.
 */
 
export const PRINT_JOB_UPDATED_EVENT = 'print-job-updated'
 
export interface PrintJobUpdatedEvent {
  /** The connection the ring arrived on (always known — it's in the ring URL) */
  connectionId: string
  /** Best-effort fields from the service's ring body — may be absent */
  jobId?: string
  printerId?: string
  phase?: string
}