NewsIndexDocumentDeletedPayload news.index_document.deleted@1

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

Version
1.0.0
Owner
news
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/events/payloads/news.index_document.deleted.v1.json

news.index_document.deleted v1 (OpenVibe.News server/domain/publication.js syncIndex, via openvibe-publishing/index-hooks indexEvent). A Search tombstone: the story is no longer published, public and listable (unpublished, retracted, or hidden by the gate, e.g. an AI revision no person has reviewed), so Search drops it at this revision or older. Only sent for a story Search was sent before. Consumed by OpenVibe.Search ('*.index_document.*'). Envelope: subject { type: story, id, revision }, visibility internal, priority important, actor service:news.

Fields

FieldTypeRequiredDescriptionConstraints
typeconstyes
  • = "story"
idstringyes
  • pattern ^sty_[0-9A-HJKMNP-TV-Z]{26}$
revisionintegeryesIndex revision of the tombstone; wins over any document at the same or an older revision.
  • minimum 1
  • maximum 9007199254740991

Examples

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

Valid: tombstone
{
  "type": "story",
  "id": "sty_01K5S1E4G6J8M0P2R4T6V8X0Z2",
  "revision": 4
}
Rejected: full-tombstone
{
  "owner": "news",
  "type": "story",
  "id": "sty_01K5S1E4G6J8M0P2R4T6V8X0Z2",
  "revision": 4,
  "deleted": true
}
Rejected: revision-zero
{
  "type": "story",
  "id": "sty_01K5S1E4G6J8M0P2R4T6V8X0Z2",
  "revision": 0
}
Rejected: wrong-type
{
  "type": "post",
  "id": "sty_01K5S1E4G6J8M0P2R4T6V8X0Z2",
  "revision": 4
}

Validate

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