QuestStepType quest.step-type@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.v1.json

quest.step-type@1: a verified Events action that may be selected for a daily quest. A contributed type stays pending until staff review.

Fields

FieldTypeRequiredDescriptionConstraints
idstringyes
  • minLength 2
  • maxLength 90
event_typestringyes
  • minLength 3
  • maxLength 160
sitestringyes
  • format hostname
sentencestringyes
  • minLength 1
  • maxLength 120
hrefstringyes
  • pattern ^https://
  • format uri
weightintegeryes
  • minimum 1
  • maximum 5
countconst
  • = 1
verificationstring
statusenumyes
  • one of "pending", "approved", "rejected"
sourcestring
project_idstring
created_atstring
  • format date-time
reviewed_atstring | null
  • format date-time

Examples

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

Valid: built-in
{
  "id": "stream",
  "event_type": "live.stream.started",
  "site": "openvibe.live",
  "sentence": "Do something on openvibe.live",
  "href": "https://openvibe.live/",
  "weight": 1,
  "count": 1,
  "verification": "event subject, count within the person's local day",
  "status": "approved",
  "source": "quest"
}
Rejected: no-topic
{
  "id": "broken",
  "site": "openvibe.live",
  "sentence": "Go live",
  "href": "https://openvibe.live/",
  "weight": 1,
  "status": "pending"
}

Validate

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