Dominevo
ReferenceHTTP API

deviceState

The deviceState router: 9 methods of the device-state capability, with tier, scope, input and output.

Capability device-state · scope system · mode singleton · source packages/types/src/capabilities/device-state.cap.ts:84.

Every method is called at /trpc/deviceState.<method> — queries with GET, mutations with POST. See How to call and Authorization.

MethodKindTierToken scopeViewer
getSnapshotqueryprotectedviewno
getCapSlicequeryprotectedviewno
getAllSnapshotsqueryprotectedviewno
setCapSlicemutationprotectedcreateno
claimFieldsmutationadminadmin onlyno
patchOwnedFieldsmutationadminadmin onlyno
releaseClaimmutationadminadmin onlyno
listClaimsqueryadminadmin onlyno
getNativeCapSlicequeryadminadmin onlyno

deviceState.getSnapshot

  • Kind: query — GET /trpc/deviceState.getSnapshot
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability device-state, or category system
  • Viewer: no
  • Try it: open /system/api-explorer?method=deviceState.getSnapshot on your hub

Input

{ deviceId: number }

Output

Record<string, Record<string, unknown>>

deviceState.getCapSlice

  • Kind: query — GET /trpc/deviceState.getCapSlice
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability device-state, or category system
  • Viewer: no
  • Try it: open /system/api-explorer?method=deviceState.getCapSlice on your hub

Input

{ deviceId: number; capName: string; confirmed?: boolean }

Output

Record<string, unknown> | null

deviceState.getAllSnapshots

  • Kind: query — GET /trpc/deviceState.getAllSnapshots
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability device-state, or category system
  • Viewer: no
  • Try it: open /system/api-explorer?method=deviceState.getAllSnapshots on your hub

Input

{ confirmed?: boolean }

Output

Record<string, Record<string, Record<string, unknown>>>

deviceState.setCapSlice

  • Kind: mutation — POST /trpc/deviceState.setCapSlice
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: create on capability device-state, or category system
  • Viewer: no
  • Try it: open /system/api-explorer?method=deviceState.setCapSlice on your hub

Input

{ deviceId: number; capName: string; slice: Record<string, unknown> }

Output

void

deviceState.claimFields

  • Kind: mutation — POST /trpc/deviceState.claimFields
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=deviceState.claimFields on your hub

Input

{ deviceId: number; capName: string; owner: string; mode: FieldClaimModeSchema; fields: string[]; values: Record<string, unknown> }

Output

ClaimOutcomeSchema

Shapes: FieldClaimModeSchema · ClaimOutcomeSchema

deviceState.patchOwnedFields

  • Kind: mutation — POST /trpc/deviceState.patchOwnedFields
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=deviceState.patchOwnedFields on your hub

Input

{ deviceId: number; capName: string; owner: string; values: Record<string, unknown> }

Output

ClaimOutcomeSchema

Shapes: ClaimOutcomeSchema

deviceState.releaseClaim

  • Kind: mutation — POST /trpc/deviceState.releaseClaim
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=deviceState.releaseClaim on your hub

Input

{ deviceId: number; capName: string; owner: string }

Output

ClaimOutcomeSchema

Shapes: ClaimOutcomeSchema

deviceState.listClaims

  • Kind: query — GET /trpc/deviceState.listClaims
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=deviceState.listClaims on your hub

Input

{ ownerPrefix?: string }

Output

ClaimsListingSchema

Shapes: ClaimsListingSchema

deviceState.getNativeCapSlice

  • Kind: query — GET /trpc/deviceState.getNativeCapSlice
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=deviceState.getNativeCapSlice on your hub

Input

{ deviceId: number; capName: string }

Output

Record<string, unknown> | null