ReviewsSummary reviews.summary@1

Generated at from openvibe-contracts v0.53.0 and openvibe-sdk v0.11.0.

Version
1.0.0
Owner
reviews
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/reviews/summary.v1.json

reviews.summary@1: the editorial summary of one entity on OpenVibe.Reviews (the review_summaries row the summary routes answer with): its publication state, the published revision, and the flag set when a cited signal left (the published text stays up, flagged, until an editor approves the pending revision). Timestamps are epoch milliseconds; flagged is 0 or 1.

Fields

FieldTypeRequiredDescriptionConstraints
idstringyes
  • pattern ^sum_[0-9A-HJKMNP-TV-Z]{26}$
entity_idstringyes
  • pattern ^ent_[0-9A-HJKMNP-TV-Z]{26}$
stateenumyes
  • one of "draft", "published", "unpublished"
published_revisioninteger | nullyes
published_atinteger | nullyesEpoch milliseconds, or null.
revision_published_atinteger | nullyesEpoch milliseconds, or null.
flaggedenumyes
  • one of 0, 1
flag_reasonstring | nullyes
flagged_atinteger | nullyesEpoch milliseconds, or null.
created_atintegeryesEpoch milliseconds.
updated_atintegeryesEpoch milliseconds.

Examples

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

Valid: published
{
  "id": "sum_01JAC6S7T8V9W0X1Y2Z3A4B5C6",
  "entity_id": "ent_01JAC1E2N3T4V5W6X7Y8Z9A0B1",
  "state": "published",
  "published_revision": 2,
  "published_at": 1790237700000,
  "revision_published_at": 1790243000000,
  "flagged": 0,
  "flag_reason": null,
  "flagged_at": null,
  "created_at": 1790237000000,
  "updated_at": 1790243000000
}
Rejected: flagged-boolean
{
  "id": "sum_01JAC6S7T8V9W0X1Y2Z3A4B5C6",
  "entity_id": "ent_01JAC1E2N3T4V5W6X7Y8Z9A0B1",
  "state": "published",
  "published_revision": 2,
  "published_at": 1790237700000,
  "revision_published_at": 1790243000000,
  "flagged": false,
  "flag_reason": null,
  "flagged_at": null,
  "created_at": 1790237000000,
  "updated_at": 1790243000000
}

Validate

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