NewsStoryCreatedPayload news.story.created@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.created.v1.json
news.story.created v1 (OpenVibe.News server/domain/stories.js create). An editor opened a draft story (news.story.create), in the transaction that created it; when it was opened from a cluster, that cluster's active items (not duplicates, not removed upstream) were attached as its first sources. A first text sent with the request becomes revision 1 in the same transaction and is not announced here. Deliberately left out: the working headline, slug and any text (drafts are not public). Envelope: subject { type: story, id: sty_… }, visibility internal, priority low, actor the editor { type: user } (also when a service acts for a signed-in editor), otherwise the calling service.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
cluster_id | string | null | yes | The cluster it was opened from, followed through merges; null for a story opened without one. |
|
topic | string | null | yes | Slug of the story's topic (news_topics); null when none was given. |
|
sources | integer | yes | How many source items were attached at creation. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: blank
{
"cluster_id": null,
"topic": null,
"sources": 0
}Valid: from-cluster
{
"cluster_id": "clu_01K5RZ3M8R5D1F7H3K9N2Q4S6T",
"topic": "space",
"sources": 3
}Rejected: headline-leaked
{
"cluster_id": "clu_01K5RZ3M8R5D1F7H3K9N2Q4S6T",
"topic": "space",
"sources": 3,
"headline": "Europa Clipper is on its way to Jupiter"
}Rejected: missing-sources
{
"cluster_id": "clu_01K5RZ3M8R5D1F7H3K9N2Q4S6T",
"topic": "space"
}Rejected: negative-sources
{
"cluster_id": "clu_01K5RZ3M8R5D1F7H3K9N2Q4S6T",
"topic": null,
"sources": -1
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('news.story.created@1', value); // { valid, errors: [{ path, message }] }