NetworkDockTimerRequest network.dock-timer-request@1

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

Version
1.0.0
Owner
network
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/network/dock-timer-request.v1.json

network.dock-timer-request@1: the body of PUT /api/v1/people/:subject/dock/timer on OpenVibe.Network (network.dock.timer.write): a first-party service sets or clears ONE person's Dock timer. { minutes } starts one (1 to 180 minutes), { clear: true } stops it. The service writes the timer and nothing else: the rest of the person's Dock state is never touched.

Fields

FieldTypeRequiredDescriptionConstraints
minutesintegerHow long the timer runs, in minutes.
  • minimum 1
  • maximum 180
kindenumA plain timer (the default), or a focus block, which alternates a focus round and a break by itself.
  • one of "timer", "focus"
labelstringWhat it is for, in the person's own words.
  • maxLength 60
roundsintegerHow many focus rounds in all (a focus timer only; 4 by default).
  • minimum 1
  • maximum 12
clearbooleantrue stops the timer: there is none afterwards.

Examples

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

Valid: focus
{
  "minutes": 25,
  "kind": "focus",
  "label": "Write the post",
  "rounds": 4
}
Valid: plain
{
  "minutes": 10
}
Valid: stop
{
  "clear": true
}
Rejected: both
{
  "minutes": 25,
  "clear": true
}
Rejected: empty
{}
Rejected: too-many-minutes
{
  "minutes": 200
}
Rejected: unknown-field
{
  "minutes": 25,
  "colour": "blue"
}
Rejected: zero-minutes
{
  "minutes": 0
}

Validate

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