Dominevo
ReferenceHTTP API

scriptRunner

The scriptRunner router: 3 methods of the script-runner capability, with tier, scope, input and output.

Capability script-runner · scope device · mode singleton · source packages/types/src/capabilities/script-runner.cap.ts:34.

Every method is called at /trpc/scriptRunner.<method> — queries with GET, mutations with POST. See How to call and Authorization. Device methods take deviceId in their input.

MethodKindTierToken scopeViewer
getStatusqueryprotectedviewyes
runmutationadminadmin onlyno
stopmutationadminadmin onlyno

scriptRunner.getStatus

  • Kind: query — GET /trpc/scriptRunner.getStatus (added by the framework)
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability script-runner, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=scriptRunner.getStatus on your hub

Input

{ deviceId: number }

Output

ScriptRunnerStatusSchema

Shapes: ScriptRunnerStatusSchema

scriptRunner.run

  • Kind: mutation — POST /trpc/scriptRunner.run
  • 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=scriptRunner.run on your hub

Input

{ deviceId: number; variables?: Record<string, unknown> }

Output

void

scriptRunner.stop

  • Kind: mutation — POST /trpc/scriptRunner.stop
  • 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=scriptRunner.stop on your hub

Input

{ deviceId: number }

Output

void