BotEstopSetPayload bot.estop.set@1

Generated at from openvibe-contracts v0.97.0 and openvibe-sdk v0.26.0.

Version
1.0.0
Owner
bot
Visibility
first-party
Status
active
Compatibility
backward
Decision
ADR-043
Schema
https://openvibe.network/contracts/events/payloads/bot.estop.set.v1.json

bot.estop.set v1 (OpenVibe.Bot server/domain/index.js writeEstop). The e-stop latched. by is the user subject, the service token's sub or the device id that set it; principal_kind says which. Envelope: subject { type: robot, id: <robot id> }, visibility internal, priority important, actor service:bot.

Fields

FieldTypeRequiredDescriptionConstraints
robot_idstringyes
  • pattern ^rob_[0-9A-HJKMNP-TV-Z]{26}$
bystring | nullyes
principal_kindenumyes
  • one of "user", "service", "device"

Examples

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

Valid: by-device
{
  "robot_id": "rob_01J8Z4M2Q0R7T9YV3K6N8P1W2X",
  "by": "dev_01J8Z4N5S2V8X0ZB4M7Q9R3T5W",
  "principal_kind": "device"
}
Valid: by-operator
{
  "robot_id": "rob_01J8Z4M2Q0R7T9YV3K6N8P1W2X",
  "by": "usr_01J8Z4P7T3W9Y1AC5N8R0S4V6X",
  "principal_kind": "user"
}
Rejected: unknown-principal
{
  "robot_id": "rob_01J8Z4M2Q0R7T9YV3K6N8P1W2X",
  "by": "usr_01J8Z4P7T3W9Y1AC5N8R0S4V6X",
  "principal_kind": "robot"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('bot.estop.set@1', value);   // { valid, errors: [{ path, message }] }