BlogPostCreatedPayload blog.post.created@1
Generated at from
openvibe-contracts v0.33.0 and
openvibe-sdk v0.5.0.
- Version
- 1.0.0
- Owner
- blog
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/events/payloads/blog.post.created.v1.json
blog.post.created v1 (OpenVibe.Blog server/domain/posts.js create). A post exists as a draft (its first revision). Envelope: subject { type: post, id: pst_…, revision: 1 }, visibility internal, priority low, actor the person or the calling service.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
blog | object | yes |
| |
blog.id | string | yes |
| |
blog.handle | string | yes |
| |
state | const | yes |
| |
visibility | enum | yes |
| |
authorship | enum | yes | openvibe-publishing authorship mode (not Search's vocabulary). |
|
workflow | object | The OpenVibe.AI workflow and run behind ai and hybrid posts; absent for human posts. |
| |
workflow.id | string | yes |
| |
workflow.runId | string | yes |
| |
workflow.version | integer | string | |||
workflow.model | string |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: ai
{
"blog": {
"id": "blg_01JAB2C3D4E5F6G7H8J9K0MNPT",
"handle": "alex"
},
"state": "draft",
"visibility": "public",
"authorship": "ai",
"workflow": {
"id": "blog.draft_post",
"runId": "run_01JAB2C3D4E5F6G7H8J9K0MNPY",
"version": 2
}
}Valid: human
{
"blog": {
"id": "blg_01JAB2C3D4E5F6G7H8J9K0MNPT",
"handle": "alex"
},
"state": "draft",
"visibility": "public",
"authorship": "human"
}Rejected: published-state
{
"blog": {
"id": "blg_01JAB2C3D4E5F6G7H8J9K0MNPT",
"handle": "alex"
},
"state": "published",
"visibility": "public",
"authorship": "human"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('blog.post.created@1', value); // { valid, errors: [{ path, message }] }