NewsStoryPublishedPayload news.story.published@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.published.v1.json

news.story.published v1 (OpenVibe.News server/domain/publication.js afterChange, via openvibe-publishing/index-hooks publicationEvent). An editor published a story that was a draft or unpublished (news.story.publish, stories.js publish), in the transaction of the change. For subscribers other than Search: canonical URL, publication state and Search-shaped indexability, never the text (Search gets that from news.index_document.*). A story resting on fewer independent sources than NEWS_MIN_INDEPENDENT_SOURCES (default 2) is still published, with indexability noindex (unsourced). Envelope: subject { type: story, id: sty_…, revision: <published revision> }, visibility public when the gate lets the story be listed, otherwise internal, priority important (the envelope default; News sets none), actor the editor { type: user } (also when a service acts for a signed-in editor), otherwise the calling service.

Fields

FieldTypeRequiredDescriptionConstraints
canonical_urlstringyes
  • pattern ^https?://
  • format uri
  • maxLength 2048
publication_stateconstyes
  • = "published"
indexabilityobjectyes
  • no other fields
indexability.decisionenumyes
  • one of "index", "noindex"
indexability.reasonsarray of stringyes
  • maxItems 20
  • unique items
  • items: pattern ^[a-z][a-z0-9_]{1,63}$
topicstringSlug of the story's topic (news_topics); absent when it has none.
  • minLength 1
  • maxLength 60

Examples

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

Valid: indexed
{
  "canonical_url": "https://openvibe.news/stories/europa-clipper-launches-for-jupiter",
  "publication_state": "published",
  "indexability": {
    "decision": "index",
    "reasons": []
  },
  "topic": "space"
}
Valid: unsourced-no-topic
{
  "canonical_url": "https://openvibe.news/stories/valley-water-restrictions-to-end",
  "publication_state": "published",
  "indexability": {
    "decision": "noindex",
    "reasons": [
      "unsourced"
    ]
  }
}
Rejected: body-leaked
{
  "canonical_url": "https://openvibe.news/stories/europa-clipper-launches-for-jupiter",
  "publication_state": "published",
  "indexability": {
    "decision": "index",
    "reasons": []
  },
  "body": "NASA launched the Europa Clipper spacecraft."
}
Rejected: relative-url
{
  "canonical_url": "/stories/europa-clipper-launches-for-jupiter",
  "publication_state": "published",
  "indexability": {
    "decision": "index",
    "reasons": []
  }
}
Rejected: wrong-state
{
  "canonical_url": "https://openvibe.news/stories/europa-clipper-launches-for-jupiter",
  "publication_state": "unpublished",
  "indexability": {
    "decision": "index",
    "reasons": []
  }
}

Validate

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