CommunityPasteCreatedPayload community.paste.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.paste.created.v1.json

community.paste.created v1 (OpenVibe.Community server/events.js, queued in the transaction of the change). A paste (text or screenshot) was created. Never the content or title. Envelope: subject { type: paste, id }, visibility public when the item is public else internal, priority low, actor the person or service:community.

Fields

FieldTypeRequiredDescriptionConstraints
paste_idstringyesThe paste's slug.
  • pattern ^[a-z0-9-]{3,64}$
typeenumyes
  • one of "paste", "screenshot"
originenumyesai: written by OpenVibe's AI (Moments); never shown as a person's work.
  • one of "user", "ai", "import"
visibilityenumyes
  • one of "public", "unlisted", "private", "hidden", "deleted"
ownerone ofyes
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
{
  "paste_id": "amber-fox-42",
  "type": "paste",
  "origin": "user",
  "visibility": "public",
  "owner": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "url": "https://openvibe.community/p/amber-fox-42"
}
Rejected: carries-content
{
  "paste_id": "amber-fox-42",
  "type": "paste",
  "origin": "user",
  "visibility": "public",
  "owner": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "url": "https://openvibe.community/p/amber-fox-42",
  "body": "the content never travels"
}

Validate

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