NewsStoryFlaggedPayload news.story.flagged@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.story.flagged.v1.json

news.story.flagged v1 (OpenVibe.News server/domain/stories.js flagEvent, from onUpstreamChange). A source item a story cites changed (source_updated) or was removed (source_removed) upstream in OpenVibe.Sources, inside the ingest transaction that applied it: the story has an open editorial flag and, when it has text, a pending system-prepared revision (same paragraphs, refreshed source table) for an editor to check and publish. The published revision does not change. One event per affected story; an open source_updated flag is reused (its pending revision moves on) and announced again, an open source_removed flag is not. Editor flags (correction, update) and retraction flags do not emit this event. Envelope: subject { type: story, id: sty_…, revision: <pending revision, else the published revision, else 0> }, visibility internal, priority important for source_removed and normal for source_updated (normal is not an events.event-envelope@1 priority, so that envelope is refused until News sends low or important), actor service:news.

Fields

FieldTypeRequiredDescriptionConstraints
flag_idstringyesThe news_editorial_flags row.
  • pattern ^flg_[0-9A-HJKMNP-TV-Z]{26}$
kindenumyes
  • one of "source_updated", "source_removed"
statusconstyes
  • = "open"
source_item_idstringyesThe News source item that changed or was removed.
  • pattern ^nsi_[0-9A-HJKMNP-TV-Z]{26}$
pending_revisioninteger | nullyesThe revision News prepared for an editor; null when the story has no text yet or nothing new was prepared.
  • minimum 1
published_revisioninteger | nullyesThe revision readers see; null when the story was never published.
  • minimum 1

Examples

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

Valid: source-removed
{
  "flag_id": "flg_01K5S2G6J8M0P2R4T6V8X0Z2B4",
  "kind": "source_removed",
  "status": "open",
  "source_item_id": "nsi_01K5RZ3M8Q2W7T4XC9V6B1N0JD",
  "pending_revision": 2,
  "published_revision": 1
}
Valid: source-updated-draft
{
  "flag_id": "flg_01K5S2H7K9N1Q3S5V7X9Z1B3D5",
  "kind": "source_updated",
  "status": "open",
  "source_item_id": "nsi_01K5RZ4F0A6H3K8PQ2S5W7Y9ZE",
  "pending_revision": null,
  "published_revision": null
}
Rejected: editor-kind
{
  "flag_id": "flg_01K5S2G6J8M0P2R4T6V8X0Z2B4",
  "kind": "correction",
  "status": "open",
  "source_item_id": "nsi_01K5RZ3M8Q2W7T4XC9V6B1N0JD",
  "pending_revision": null,
  "published_revision": 1
}
Rejected: missing-source-item
{
  "flag_id": "flg_01K5S2G6J8M0P2R4T6V8X0Z2B4",
  "kind": "source_removed",
  "status": "open",
  "source_item_id": null,
  "pending_revision": 2,
  "published_revision": 1
}
Rejected: resolved-status
{
  "flag_id": "flg_01K5S2G6J8M0P2R4T6V8X0Z2B4",
  "kind": "source_updated",
  "status": "resolved",
  "source_item_id": "nsi_01K5RZ3M8Q2W7T4XC9V6B1N0JD",
  "pending_revision": 2,
  "published_revision": 1
}

Validate

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