BotDeskLeaseCreateRequest bot.desk-lease-create-request@1

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

Version
1.0.0
Owner
bot
Visibility
first-party
Status
active
Compatibility
backward
Decision
ADR-043
Schema
https://openvibe.network/contracts/bot/desk-lease-create-request.v1.json

bot.desk-lease-create-request@1 (the Desks plan's D6): the body of POST /api/v1/machines/{id}/desk-leases on OpenVibe.Bot (capability bot.desk.session), answered 201 with bot.desk-lease@1. DESK is the name Run chose for the session (unique per session); a desk already leased to another session, or running for the machine's owner, is refused 409 bot.desk_busy, and a repeat for the same session answers its lease (200). A machine with no room (its max_desks) is refused 409 bot.machine_busy, one that is offline 409 bot.device_offline, and one the person may not use 404 bot.device_not_found.

Fields

FieldTypeRequiredDescriptionConstraints
sessionhttps://openvibe.network/contracts/run/session.v1.json#/$defs/session_idyes
deskhttps://openvibe.network/contracts/bot/desk-lease.v1.json#/properties/deskyes
kindconstyes
  • = "browser"
widthhttps://openvibe.network/contracts/bot/desk-lease.v1.json#/properties/widthDefault 1280.
heighthttps://openvibe.network/contracts/bot/desk-lease.v1.json#/properties/heightDefault 800.
originsarray of stringThe session's exact browser origins, fixed for this lease. Empty allows no network origin; absent keeps the legacy policy. A shared desk that cannot enforce the list is refused.
  • maxItems 32
  • items: pattern ^https?://
  • items: minLength 8
  • items: maxLength 2048

Examples

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

Valid: browser
{
  "session": "ses_01JD2C3D4E5F6G7H8J9K0MNPQR",
  "desk": "desk-s0mnpqr",
  "kind": "browser",
  "width": 1280,
  "height": 800
}
Rejected: desktop
{
  "session": "ses_01JD2C3D4E5F6G7H8J9K0MNPQR",
  "desk": "desk-s0mnpqr",
  "kind": "desktop"
}
Rejected: main
{
  "session": "ses_01JD2C3D4E5F6G7H8J9K0MNPQR",
  "desk": "main",
  "kind": "browser"
}

Validate

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