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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
session_id | https://openvibe.network/contracts/run/session.v1.json#/$defs/session_id | yes | ||
id | string | yes |
| |
result | enum | yes |
| |
code | string | null |
| ||
reason | string | null |
| ||
data | object | The desk's answer on an ack (bot.command-result@1 data). | ||
delivery | enum | Whether the command reached the machine. Absent on older servers means unknown. |
| |
retry | object | safe is true only when delivery is not_delivered. |
| |
retry.safe | boolean | yes | ||
retry.reason | string |
| ||
state | https://openvibe.network/contracts/run/session.v1.json#/properties/state | yes |
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 }] }