QuestStepTypeRequest quest.step-type-request@1

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

Version
1.0.0
Owner
quest
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/quest/step-type-request.v1.json

A developer app's proposed daily step. Quest accepts only topics in its known Events catalog, verifies the site's host and queues the proposal for staff review.

Fields

FieldTypeRequiredDescriptionConstraints
idstringyes
  • pattern ^[a-z][a-z0-9-]{1,47}$
event_typestringyes
  • minLength 3
  • maxLength 160
sitestringyes
  • format hostname
sentencestringyes
  • minLength 1
  • maxLength 120
hrefstringyes
  • pattern ^https://
  • format uri
weightinteger
  • minimum 1
  • maximum 5

Examples

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

Valid: known-topic
{
  "id": "stream",
  "event_type": "live.stream.started",
  "site": "openvibe.live",
  "sentence": "Go live",
  "href": "https://openvibe.live/",
  "weight": 1
}
Rejected: no-topic
{
  "id": "stream",
  "event_type": "",
  "site": "openvibe.live",
  "sentence": "Go live",
  "href": "https://openvibe.live/",
  "weight": 1
}

Validate

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