WikiRevisionCreatedPayload wiki.revision.created@1

Generated at from openvibe-contracts v0.33.0 and openvibe-sdk v0.5.0.

Version
1.0.0
Owner
wiki
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/events/payloads/wiki.revision.created.v1.json

wiki.revision.created v1 (OpenVibe.Wiki server/wiki/service.js revisionEvent). Emitted when a page gets a new immutable revision: an edit, a revert or an AI proposal. A new revision is a draft until it is published (then wiki.page.published|updated follows). Envelope: subject { type: page, id: pg_…, revision: <number> }, visibility internal, priority important, actor the person or service.

Fields

FieldTypeRequiredDescriptionConstraints
space_idstringyes
  • pattern ^spc_[0-9A-HJKMNP-TV-Z]{26}$
spacestringyesSpace slug.
  • pattern ^[a-z0-9][a-z0-9-]{1,62}$
slugstringyesPage slug.
  • minLength 1
  • maxLength 80
numberintegeryesThe new revision number.
  • minimum 1
kindenumyes
  • one of "edit", "revert", "import"
parent_numberinteger | nullyes
  • minimum 1
reverted_tointeger | nullyesThe revision a revert restored; null otherwise.
  • minimum 1
authorshipenumyesSearch's authorship vocabulary; null when the revision has no authorship record.
  • one of "human", "ai_assisted", "ai_generated", "imported", null
authorstring | nullyesWho wrote it: a subject id (usr_…) or a service (svc:<id>).
  • maxLength 200
messagestring | nullyes
  • maxLength 2000
proposal_idstringPresent when the revision is an AI proposal awaiting a person's approval.
  • pattern ^prp_[0-9A-HJKMNP-TV-Z]{26}$

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: ai-proposal
{
  "space_id": "spc_01JAB2C3D4E5F6G7H8J9K0MNPV",
  "space": "food",
  "slug": "ramen",
  "number": 3,
  "kind": "edit",
  "parent_number": 2,
  "reverted_to": null,
  "authorship": "ai_generated",
  "author": "svc:ai",
  "message": "AI proposal",
  "proposal_id": "prp_01JAB2C3D4E5F6G7H8J9K0MNPW"
}
Valid: edit
{
  "space_id": "spc_01JAB2C3D4E5F6G7H8J9K0MNPV",
  "space": "food",
  "slug": "ramen",
  "number": 2,
  "kind": "edit",
  "parent_number": 1,
  "reverted_to": null,
  "authorship": "human",
  "author": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "message": "Add broth section"
}
Rejected: carries-content
{
  "space_id": "spc_01JAB2C3D4E5F6G7H8J9K0MNPV",
  "space": "food",
  "slug": "ramen",
  "number": 2,
  "kind": "edit",
  "parent_number": 1,
  "reverted_to": null,
  "authorship": "human",
  "author": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "message": null,
  "content": "# Ramen"
}

Validate

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