RunSessionControlRequest run.session-control-request@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-request.v1.json

run.session-control-request@1 (the Desks plan's D6): one command on a session's desk, the body of POST /api/v1/sessions/{id}/commands on OpenVibe.Run (capability run.session.control), answered with run.session-control-result@1. KIND and VALUE are bot.command@1's for that kind (screen: a picture of the page; input: the mouse, wheel and keys on the page; browser: open, click, fill, press, back, read, screenshot) without desk, which is always the session's own: Run carries the command to OpenVibe.Bot on the session's lease (bot.desk-lease@1) and nothing on the machine other than that desk is reachable. A command on a session that is not running is refused 409 run.session.not_running. ID makes a retry safe: the same id within the session answers the first result.

Fields

FieldTypeRequiredDescriptionConstraints
idstring
  • pattern ^[A-Za-z0-9._:-]+$
  • minLength 1
  • maxLength 64
kindenumyes
  • one of "screen", "input", "browser"
valueobjectyesbot.command@1's value for that kind, without desk (refused 422 if it names another desk).

Examples

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

Valid: open
{
  "kind": "browser",
  "value": {
    "action": "open",
    "url": "https://example.org/"
  }
}
Valid: screen
{
  "id": "c-7",
  "kind": "screen",
  "value": {
    "max_width": 1024
  }
}
Rejected: exec
{
  "kind": "exec",
  "value": {
    "argv": [
      "id"
    ]
  }
}
Rejected: names-a-desk
{
  "kind": "browser",
  "value": {
    "action": "read",
    "desk": "desk-other"
  }
}

Validate

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