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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
post_id | integer | yes |
| |
thread_id | integer | yes |
| |
space | string | yes |
| |
author | one of | yes | ||
visibility | enum | yes |
| |
url | string | null | yes | The public page, or null when the item is not public. |
|
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 }] }