NewsStoryReadResult news.story-read-result@1
Generated at from
openvibe-contracts v0.53.0 and
openvibe-sdk v0.11.0.
- Version
- 1.0.0
- Owner
- news
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/news/story-read-result.v1.json
news.story-read-result@1: answers of news.story.read on OpenVibe.News (editors, or a service holding news.story.read). GET /api/v1/stories/:id → { story, published } (the editor view with drafts, and the public model of the published revision or null; a caller without the capability gets only { published } of a published or retracted story, else 404 story.not_found). GET /api/v1/stories/:id/revisions?limit=&before= → { revisions } newest first. GET /api/v1/stories/:id/revisions/:n → { revision, citations, problems } (404 revision.not_found). GET /api/v1/stories/:id/diff?from=&to=&mode=line|word → { diff } of the text and a field-by-field comparison.
Fields
This schema has no named fields.
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: diff
{
"diff": {
"entityId": "sty_01JAB3DEF4GH5JK6MN7PQ8RS9T",
"from": 1,
"to": 2,
"content": {
"mode": "line",
"ops": [
{
"op": "equal",
"text": "The harbour bridge closed. [1]\n"
},
{
"op": "insert",
"text": "The council expects two weeks. [2]\n"
}
],
"added": 1,
"removed": 0,
"approximate": false
},
"fields": [
{
"field": "headline",
"from": "Bridge closes",
"to": "Harbour bridge closes for inspection"
}
]
}
}Valid: revision
{
"revision": {
"id": "rev_01JAB4R5S6T7V8W9X0Y1Z2A3B4",
"entityId": "sty_01JAB3DEF4GH5JK6MN7PQ8RS9T",
"number": 1,
"parentId": null,
"parentNumber": null,
"kind": "edit",
"revertedTo": null,
"content": "The harbour bridge closed on Tuesday morning after inspectors found cracks in a support. [1]",
"fields": {
"headline": "Harbour bridge closes for inspection",
"paragraphs": [
{
"text": "The harbour bridge closed on Tuesday morning after inspectors found cracks in a support.",
"sources": [
1
]
}
],
"sources": [],
"timeline": [],
"perspectives": []
},
"meta": {
"authorship": {
"mode": "human",
"authors": [
"usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
]
}
},
"contentHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"author": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"message": "First draft",
"createdAt": "2026-09-24T09:40:12.000Z"
},
"citations": [
{
"id": 1,
"entityId": "sty_01JAB3DEF4GH5JK6MN7PQ8RS9T",
"revision": 1,
"anchor": "p1",
"sourceItemId": "itm_01JAB2Y8K9M1N2P3Q4R5S6T7VW",
"url": "https://harbourgazette.example/bridge-closure",
"title": "Harbour bridge closes for inspection after cracks found",
"retrievedAt": "2026-09-24T08:15:00.000Z",
"quote": null,
"licenseNote": null,
"carriedFrom": null,
"attachedBy": "svc:news",
"attachedAt": "2026-09-24T09:40:12.000Z"
}
],
"problems": [
{
"code": "story.unsourced",
"detail": "A story with zero sources cannot be published: attach the source items it rests on"
}
]
}Valid: revisions
{
"revisions": [
{
"revision": 1,
"kind": "edit",
"author": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"message": "First draft",
"created_at": "2026-09-24T09:40:12.000Z",
"headline": "Harbour bridge closes for inspection",
"authorship": {
"mode": "human",
"authors": [
"usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
]
},
"system": null
}
]
}Valid: story
{
"story": {
"id": "sty_01JAB3DEF4GH5JK6MN7PQ8RS9T",
"slug": "harbour-bridge-closes-for-inspection",
"url": "https://openvibe.news/s/harbour-bridge-closes-for-inspection",
"state": "draft",
"cluster_id": "clu_01JAB2X3C4D5E6F7G8H9J0KMNP",
"topic": "local",
"working_headline": "Harbour bridge closes for inspection",
"noindex": false,
"published_revision": null,
"first_published_at": null,
"published_at": null,
"retracted_at": null,
"head": {
"revision": 1,
"headline": "Harbour bridge closes for inspection",
"paragraphs": [
{
"text": "The harbour bridge closed on Tuesday morning after inspectors found cracks in a support.",
"sources": [
1
]
},
{
"text": "The council expects the inspection to take two weeks.",
"sources": [
2
]
}
],
"authorship": {
"mode": "human",
"authors": [
"usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
]
},
"system": null,
"gaps": null,
"author": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"created_at": "2026-09-24T09:40:12.000Z"
},
"publishable": [],
"indexability": null,
"sources": [
{
"n": 1,
"perspective_id": null,
"detached_at": null,
"item": {
"id": "nsi_01JAB2Z7Y6X5W4V3T2S1R0QPNM",
"sources_item": {
"service": "sources",
"type": "item",
"id": "itm_01JAB2Y8K9M1N2P3Q4R5S6T7VW",
"revision": 1
},
"source_key": "harbour-gazette",
"headline": "Harbour bridge closes for inspection after cracks found",
"url": "https://harbourgazette.example/bridge-closure",
"outlet": "Harbour Gazette",
"authors": [
"M. Okafor"
],
"published_at": "2026-09-24T07:30:00+01:00",
"summary": null,
"summary_basis": "terms do not allow a stored summary",
"license_note": null,
"terms_note": "Headline and link only",
"status": "active",
"duplicate_of": null,
"dedupe": null,
"cluster_id": "clu_01JAB2X3C4D5E6F7G8H9J0KMNP",
"cluster_reason": {
"rule": "new_cluster",
"cluster": "clu_01JAB2X3C4D5E6F7G8H9J0KMNP",
"terms": [
"bridge",
"harbour",
"inspection"
],
"entities": [
"Harbour Bridge"
]
},
"retrieved_at": "2026-09-24T08:15:00.000Z",
"first_seen_at": "2026-09-24T08:15:00.000Z",
"upstream_updated_at": null,
"removed": null
}
},
{
"n": 2,
"perspective_id": null,
"detached_at": null,
"item": {
"id": "nsi_01JAB2Z8Y6X5W4V3T2S1R0QPNM",
"sources_item": {
"service": "sources",
"type": "item",
"id": "itm_01JAB2Y9K9M1N2P3Q4R5S6T7VW",
"revision": 1
},
"source_key": "coastal-wire",
"headline": "Bridge inspection to take two weeks, council says",
"url": "https://coastalwire.example/news/bridge-inspection",
"outlet": "Coastal Wire",
"authors": [
"M. Okafor"
],
"published_at": "2026-09-24T07:30:00+01:00",
"summary": null,
"summary_basis": "terms do not allow a stored summary",
"license_note": null,
"terms_note": "Headline and link only",
"status": "active",
"duplicate_of": null,
"dedupe": null,
"cluster_id": "clu_01JAB2X3C4D5E6F7G8H9J0KMNP",
"cluster_reason": {
"rule": "shared_terms",
"cluster": "clu_01JAB2X3C4D5E6F7G8H9J0KMNP",
"shared_entities": [
"Harbour Bridge"
],
"shared_terms": [
"bridge",
"inspection"
],
"score": 4,
"window_hours": 72
},
"retrieved_at": "2026-09-24T08:15:00.000Z",
"first_seen_at": "2026-09-24T08:15:00.000Z",
"upstream_updated_at": null,
"removed": null
}
}
],
"timeline": [
{
"id": "tle_01JAB4T5V6W7X8Y9Z0A1B2C3D4",
"occurred_on": "2026-09-23",
"text": "Inspectors report cracks in a bridge support.",
"source_item_id": "nsi_01JAB2Z7Y6X5W4V3T2S1R0QPNM"
}
],
"perspectives": [
{
"id": "per_01JAB4P5Q6R7S8T9V0W1X2Y3Z4",
"label": "Council statements",
"description": null
}
],
"flags": []
},
"published": null
}Rejected: bad-diff-mode
{
"diff": {
"entityId": "sty_01JAB3DEF4GH5JK6MN7PQ8RS9T",
"from": 1,
"to": 2,
"content": {
"mode": "char",
"ops": [],
"added": 0,
"removed": 0,
"approximate": false
},
"fields": []
}
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('news.story-read-result@1', value); // { valid, errors: [{ path, message }] }