TradeIndexDocumentDeletedPayload trade.index_document.deleted@1

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

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

trade.index_document.deleted v1 (OpenVibe.Trade server/domain/indexing.js refresh, via openvibe-publishing/index-hooks indexEvent). A Search tombstone for an instrument page: the instrument was archived, or the page stopped being listable (e.g. its reviewed context was retracted). Only sent for a page Search was sent before, and only when the tombstone's revision moved. Consumed by OpenVibe.Search ('*.index_document.*'). Envelope: subject { type: instrument, id, revision }, visibility internal, priority important, actor service:trade.

Fields

FieldTypeRequiredDescriptionConstraints
typeconstyes
  • = "instrument"
idstringyes
  • pattern ^ins_[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": "instrument",
  "id": "ins_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "revision": 3
}
Rejected: full-document
{
  "owner": "trade",
  "type": "instrument",
  "id": "ins_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "revision": 3,
  "deleted": true
}
Rejected: symbol-as-id
{
  "type": "instrument",
  "id": "ACME",
  "revision": 3
}

Validate

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