CommunityCommentCreatedPayload community.comment.created@1

Generated at from openvibe-contracts v0.38.0 and openvibe-sdk v0.5.0.

Version
1.0.0
Owner
community
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/events/payloads/community.comment.created.v1.json

community.comment.created v1 (OpenVibe.Community server/events.js, queued in the transaction of the change). A comment was added to a comment thread attached to something on another service (a Live VOD or clip, a channel) or to a paste. Never the body. Envelope: subject { type: comment, id }, visibility public when the item is public else internal, priority low, actor the person or service:community.

Fields

FieldTypeRequiredDescriptionConstraints
comment_idintegeryes
  • minimum 1
thread_access_idstringyes
  • minLength 1
  • maxLength 64
refobjectyes
  • no other fields
ref.servicestringyes
  • pattern ^[a-z][a-z0-9-]{1,39}$
ref.typestringyes
  • pattern ^[a-z][a-z0-9_]{1,39}$
ref.idstringyes
  • minLength 1
  • maxLength 200
authorone ofyes
visibilityenumyes
  • one of "public", "hidden", "locked"
urlstring | nullyesThe public page, or null when the item is not public.
  • maxLength 500

Examples

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

Valid: example
{
  "comment_id": 20,
  "thread_access_id": "ct_abc123",
  "ref": {
    "service": "live",
    "type": "vod",
    "id": "906"
  },
  "author": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "visibility": "public",
  "url": "https://openvibe.community/c/ct_abc123"
}
Rejected: carries-content
{
  "comment_id": 20,
  "thread_access_id": "ct_abc123",
  "ref": {
    "service": "live",
    "type": "vod",
    "id": "906"
  },
  "author": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "visibility": "public",
  "url": "https://openvibe.community/c/ct_abc123",
  "body": "the content never travels"
}

Validate

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