RunSessionControlResult run.session-control-result@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

Version
1.0.0
Owner
run
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/run/session-control-result.v1.json

run.session-control-result@1 (the Desks plan's D6): the answer to run.session-control-request@1. RESULT is bot.command-result@1's: ack (the desk did it; DATA is its answer, a page as text and refs, a picture, a receipt), nack (the desk refused; CODE is its fault code and REASON says why), refused (OpenVibe.Bot's gate refused it; CODE is Bot's refusal code) or expired (no answer in time). Every answer also says how the session stands now, so a caller sees it end (idle, ttl, host_lost) without asking again.

Fields

FieldTypeRequiredDescriptionConstraints
session_idhttps://openvibe.network/contracts/run/session.v1.json#/$defs/session_idyes
idstringyes
  • minLength 1
  • maxLength 64
resultenumyes
  • one of "ack", "nack", "refused", "expired"
codestring | null
  • maxLength 80
reasonstring | null
  • maxLength 1000
dataobjectThe desk's answer on an ack (bot.command-result@1 data).
deliveryenumWhether the command reached the machine. Absent on older servers means unknown.
  • one of "delivered", "not_delivered", "uncertain"
retryobjectsafe is true only when delivery is not_delivered.
  • no other fields
retry.safebooleanyes
retry.reasonstring
  • minLength 1
  • maxLength 500
statehttps://openvibe.network/contracts/run/session.v1.json#/properties/stateyes

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: picture
{
  "session_id": "ses_01JD2C3D4E5F6G7H8J9K0MNPQR",
  "id": "c-7",
  "result": "ack",
  "code": null,
  "reason": null,
  "data": {
    "format": "jpeg",
    "width": 1024,
    "height": 640,
    "content_b64": "/9j/"
  },
  "state": "running"
}
Valid: refused
{
  "session_id": "ses_01JD2C3D4E5F6G7H8J9K0MNPQR",
  "id": "c-8",
  "result": "refused",
  "code": "bot.device_offline",
  "reason": "the machine is offline",
  "state": "running"
}
Rejected: no-state
{
  "session_id": "ses_01JD2C3D4E5F6G7H8J9K0MNPQR",
  "id": "c-7",
  "result": "ack"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('run.session-control-result@1', value);   // { valid, errors: [{ path, message }] }