CommunityCommentThread community.comment-thread@1

Generated at from openvibe-contracts v0.53.0 and openvibe-sdk v0.11.0.

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

community.comment-thread@1: one embeddable comment thread on OpenVibe.Community (server/comments/service.js shapeThread): the entity it belongs to, its visibility and comment count. id is the sequential id for services and the access id (cth_…) for everyone else; a hidden thread shows moderators its count, others only that it is hidden.

Fields

FieldTypeRequiredDescriptionConstraints
idinteger | stringyes
access_idstringyes
  • pattern ^cth_
refcommon.entity-refyes
visibilityenumyes
  • one of "public", "hidden", "locked"
comment_countinteger | nullyes
created_atstring | null
  • format date-time
updated_atstring | null
  • format date-time

Examples

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

Valid: vod
{
  "id": "cth_Ab3dE5gH7jK9mN1pQ3sT5v",
  "access_id": "cth_Ab3dE5gH7jK9mN1pQ3sT5v",
  "ref": {
    "service": "live",
    "type": "vod",
    "id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "visibility": "public",
  "comment_count": 3,
  "created_at": "2026-09-20T10:00:00.000Z",
  "updated_at": "2026-09-25T18:00:00.000Z"
}
Rejected: bad-visibility
{
  "id": "cth_Ab3dE5gH7jK9mN1pQ3sT5v",
  "access_id": "cth_Ab3dE5gH7jK9mN1pQ3sT5v",
  "ref": {
    "service": "live",
    "type": "vod",
    "id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "visibility": "archived",
  "comment_count": 3,
  "created_at": "2026-09-20T10:00:00.000Z",
  "updated_at": "2026-09-25T18:00:00.000Z"
}

Validate

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