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

FieldTypeRequiredDescriptionConstraints
blogobjectyes
  • no other fields
blog.idstringyes
  • pattern ^blg_[0-9A-HJKMNP-TV-Z]{26}$
blog.handlestringyes
  • pattern ^[a-z0-9][a-z0-9_-]{1,39}$
stateconstyes
  • = "draft"
visibilityenumyes
  • one of "public", "unlisted", "members", "private"
authorshipenumyesopenvibe-publishing authorship mode (not Search's vocabulary).
  • one of "human", "ai", "hybrid", "imported"
workflowobjectThe OpenVibe.AI workflow and run behind ai and hybrid posts; absent for human posts.
  • no other fields
workflow.idstringyes
  • pattern ^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+$
workflow.runIdstringyes
  • minLength 1
workflow.versioninteger | string
workflow.modelstring

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 }] }