Dominevo
ReferenceDevice capabilities

snapshot

A single device snapshot returned as base64 JPEG/PNG.

A single device snapshot returned as base64 JPEG/PNG.

The SnapshotAddon wrapper returns this shape whether the frame came from the device-native provider (onboard capture) or from the stream-broker prebuffer fallback.

At a glance

Capabilitysnapshot
Provided byThe device's own driver can provide it, and an addon can also wrap the device to provide it through the device bindings.
Active providers per deviceone
Device typescamera
Sourcepackages/types/src/capabilities/snapshot.cap.ts

Methods

MethodKindRequired of a providerAccess
getSnapshotqueryyesdefault
invalidateCachemutationyesadmin
getSnapshotOverviewqueryyesdefault
getDebugStatequeryyesdefault
getSnapshotLinksqueryyesdefault

getSnapshot

query

Input

FieldTypeRequiredDescription
deviceIdnumberyes
streamIdstringno
forcebooleannoBypass the cache freshness check and fetch directly from the native (or stream-broker fallback). Triggered by the UI's "refresh" button so an operator can force a fresh frame even when the cache is well within the device's snapshotMaxAgeS window. force is a demand with a named principal, not a freshness preference — an operator button, the scheduled refresh, or a notification rule that left the camera's wake allowed. On a battery camera it is the one thing that walks past the wrapper's sleep gate and wakes the camera, so a poller, a thumbnail or a prestream must NEVER set it. Every such caller gets the cached frame, which on a sleeping battery camera is the correct answer: stale but honest beats woken.

Output

FieldTypeRequiredDescription
base64stringyes
contentTypestringyes

invalidateCache

mutation

Input

FieldTypeRequiredDescription
deviceIdnumberyes

Output

Nothing.

getSnapshotOverview

query

Cache-only batch overview — answers from the wrapper's in-memory cache in O(n) and NEVER triggers a capture. Lets a grid skip requesting images for devices that never produced a frame, and gives it an ETag per device for conditional (304-able) image fetches. lastCapturedAt/cacheAgeMs/etag are null for a device with no cached frame.

Input

FieldTypeRequiredDescription
deviceIdsnumber[]yes

Output

({ deviceId: number; lastCapturedAt: number | null; cacheAgeMs: number | null; etag: string | null })[]

getDebugState

query

The full decision chain for ONE device, for the viewer's debug readout — the answer to "why does this tile show what it shows" in a single poll: the battery slice the state was derived from, the resolved state + its reason, the cached frame's identity/age, whether a wake window is open, and whether a fresh capture is in flight. Cache-only and capture-free: a debug read must never wake a battery camera.

Input

FieldTypeRequiredDescription
deviceIdnumberyes

Output

FieldTypeRequiredDescription
battery{ sleeping: boolean; lastUpdated: number; lastContactAt?: number } | nullyesThe battery slice as read, or null when the device has none.
state{ isBattery: boolean; reason: "disabled" | "offline" | "sleeping" | "unreachable" | "waking" | null }yesThe resolved snapshot state (what the overlay decision used).
frame{ capturedAt: number | null; ageMs: number | null }yesThe cached frame behind the next paint.
wakingbooleanyesA wake window is currently open (the Waking overlay's source).

query

Signed, expiring links to a CLIENT-SIZED frame — and the demand signal that makes those frames current.

Input

FieldTypeRequiredDescription
targets({ deviceId: number; width?: number })[]yesThe tiles a surface is actually rendering. One entry per (device, width) the caller will paint — the width is snapped to the server's ladder and becomes part of the link's SIGNED identity.

Output

({ deviceId: number; url: string | null; capturedAt: number | null; ageMs: number | null; expiresAt: number | null; width: number | null; neverCaptured: boolean; sleeping: boolean; stateReason: "disabled" | "offline" | "…

Status

FieldTypeRequiredDescription
lastCapturedAtnumber | nullyesMs epoch of the last successful capture. Null if none yet.
cacheAgeMsnumber | nullyesAge of the cached image in ms. Null if no cache.
lastBytesnumber | nullyesSize in bytes of the last captured image. Null if no capture.
lastStreamIdstring | nullyesStream id used for the last capture ('high'|'mid'|'low' or custom). Null if via HTTP endpoint.