SearchDocumentRemovedPayload search.document.removed@1

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

Version
1.0.0
Owner
search
Visibility
first-party
Status
active
Compatibility
backward
Decision
ADR-018
Schema
https://openvibe.network/contracts/events/payloads/search.document.removed.v1.json

search.document.removed v1 (OpenVibe.Search server/store.js announce). A document's exposure went down: deleted, made draft or unpublished, its visibility changed, or it became noindex. Caches and sitemaps purge canonical_url. Envelope: subject { type: document, id: <owner>/<type>/<id>, revision }, visibility internal, priority important, actor service:search, trace_id of the request or event that caused it.

Fields

FieldTypeRequiredDescriptionConstraints
ownerstringyes
  • pattern ^[a-z][a-z0-9-]{1,39}$
typestringyes
  • pattern ^[a-z][a-z0-9_]{1,39}$
idstringyes
  • pattern ^[A-Za-z0-9][A-Za-z0-9._:~-]{0,127}$
revisionintegeryes
  • minimum 0
  • maximum 9007199254740991
reasonenumyes
  • one of "deleted", "draft", "not_published", "visibility_changed", "noindex"
previous_exposureenumyes
  • one of "restricted", "public_unlisted", "public_listed"
exposureenumyesLower than previous_exposure. none: no longer served to anyone.
  • one of "none", "restricted", "public_unlisted"
canonical_urlstring | nullyesThe URL only when the document was public before (so it must be purged); null otherwise.

Examples

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

Valid: unpublished
{
  "owner": "blog",
  "type": "post",
  "id": "pst_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "revision": 12,
  "reason": "not_published",
  "previous_exposure": "public_listed",
  "exposure": "none",
  "canonical_url": "https://openvibe.blog/alex/hello-world"
}
Rejected: unknown-reason
{
  "owner": "blog",
  "type": "post",
  "id": "pst_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "revision": 12,
  "reason": "spam",
  "previous_exposure": "public_listed",
  "exposure": "none",
  "canonical_url": null
}

Validate

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