ReviewsEntityManageRequest reviews.entity-manage-request@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/entity-manage-request.v1.json

reviews.entity-manage-request@1: bodies of reviews.entity.manage on OpenVibe.Reviews (Reviews editors; a service acts for the editor in X-OV-Subject, and every route but POST /api/v1/entities needs that person: 403 reviews.person_required / reviews.editor_required). POST /api/v1/entities { name, kind?, description?, slug?, aliases? } (201; 422 entity.invalid_name, entity.invalid_kind, alias.invalid; 409 entity.slug_taken, alias.taken). PATCH /api/v1/entities/:ref { name?, kind?, description?, slug?, noindex? } (a new slug redirects the old one; 409 entity.not_active). DELETE /api/v1/entities/:ref { note? } (409 entity.has_merges, entity.has_signals). POST /api/v1/entities/:ref/aliases { type, value } (201). POST /api/v1/entities/:ref/links { type, to? | ref?, note? } (to names an entity; an external_ref link carries ref, another service's EntityRef). DELETE /api/v1/entities/:ref/links/:id { note? }. POST /api/v1/trust { scope, scope_id, key, value?, note? } (excluding a source or signal from aggregates needs a note readers see: 422 trust.reason_required). PATCH /api/v1/corrections/:id { status, note?, correction_note?, summary? } (accepting a request about an entity with a published summary corrects it with the public correction_note; a service also needs reviews.summary.publish for that). GET /api/v1/corrections and DELETE /api/v1/entities/:ref/aliases/:id take no body.

Fields

This schema has no named fields.

Examples

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

Valid: accept-correction
{
  "status": "accepted",
  "note": "Checked against the source",
  "correction_note": "The rating count was doubled by an import error and has been fixed."
}
Valid: alias
{
  "type": "sku",
  "value": "LX2-BLK"
}
Valid: create
{
  "name": "Lumen X2 Headphones",
  "kind": "product",
  "aliases": [
    {
      "type": "gtin",
      "value": "0012345678905"
    }
  ]
}
Valid: delete
{
  "note": "Created by mistake"
}
Valid: edit
{
  "slug": "lumen-x2",
  "noindex": false
}
Valid: external-link
{
  "type": "external_ref",
  "ref": {
    "service": "wiki",
    "type": "page",
    "id": "pg_01JAC9P0Q1R2S3T4V5W6X7Y8Z9"
  }
}
Valid: link
{
  "type": "successor_of",
  "to": "lumen-x1-headphones",
  "note": "Second generation"
}
Valid: list-corrections
{}
Valid: trust
{
  "scope": "source",
  "scope_id": "sound-lab",
  "key": "aggregate",
  "value": "exclude",
  "note": "Ratings include paid placements"
}
Rejected: wrong-types
{
  "kind": "planet",
  "note": 5,
  "noindex": "yes"
}

Validate

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