CommunityPostCreatedPayload community.post.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.post.created.v1.json

community.post.created v1 (OpenVibe.Community server/events.js, queued in the transaction of the change). A reply was posted in a forum thread. Never the body. Envelope: subject { type: post, id }, visibility public when the item is public else internal, priority low, actor the person or service:community.

Fields

FieldTypeRequiredDescriptionConstraints
post_idintegeryes
  • minimum 1
thread_idintegeryes
  • minimum 1
spacestringyes
  • pattern ^[a-z0-9][a-z0-9-]{0,62}$
authorone ofyes
visibilityenumyes
  • one of "public", "members", "hidden"
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
{
  "post_id": 31,
  "thread_id": 7,
  "space": "general",
  "author": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "visibility": "public",
  "url": "https://openvibe.community/s/general/7#p31"
}
Rejected: carries-content
{
  "post_id": 31,
  "thread_id": 7,
  "space": "general",
  "author": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "visibility": "public",
  "url": "https://openvibe.community/s/general/7#p31",
  "body": "the content never travels"
}

Validate

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