ResourceSummary common.resource-summary@1

Generated at from openvibe-contracts v0.114.0 and openvibe-sdk v0.35.1.

Version
1.1.0
Owner
contracts
Visibility
public
Status
active
Compatibility
backward
Decision
ADR-034
Schema
https://openvibe.network/contracts/common/resource-summary.v1.json

One resource of any service, as the resource index lists it (roadmap WS-Z7): every service answers GET /api/v1/resources with these, so OpenVibe.Services shows any resource without owning its data.

Fields

FieldTypeRequiredDescriptionConstraints
idstringyes
kindstringyesservice.kind, e.g. watch.watch, actor.actor, media.object, events.subscription
servicestringyes
project_idstring
  • pattern ^prj_[0-9A-HJKMNP-TV-Z]{26}$
ovrnstringOptional resource name (ADR-034 section 2), the name grants, audit, events, usage records and bills use: ovrn:<service>:<project_id>:<type>/<id>, e.g. ovrn:watch:<project_id>:watch/<wch_id>, with the pattern of common.usage-recorded@1 resource. Its service, project and id are this summary's service, project_id and id. Added in 1.1.0.
  • pattern ^ovrn:[a-z][a-z0-9-]{0,31}:prj_[0-9A-HJKMNP-TV-Z]{26}:[a-z][a-z0-9-]{0,39}/[a-z]{3}_[0-9A-HJKMNP-TV-Z]{26}$
  • maxLength 200
owneridentity.subject-ref
namestring
statestringyes
created_atstringyes
  • format date-time
updated_atstring
  • format date-time
usageobjectcost units by name (WS-Z1)
linksobject
  • no other fields
links.selfstring
  • format uri
links.consolestring
  • format uri
links.docsstring
  • format uri

Examples

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

Valid: watch
{
  "id": "wch_01J0000000000000000000000A",
  "kind": "watch.watch",
  "service": "watch",
  "project_id": "prj_01J0000000000000000000000A",
  "owner": {
    "type": "user",
    "id": "usr_01J0000000000000000000000A"
  },
  "name": "Price of a camera",
  "state": "active",
  "created_at": "2026-09-28T23:00:00Z",
  "usage": {
    "watch-check": 120
  },
  "links": {
    "self": "https://openvibe.watch/api/v1/watches/wch_01J0000000000000000000000A"
  }
}
Valid: with-ovrn
{
  "id": "wch_01J0000000000000000000000A",
  "kind": "watch.watch",
  "service": "watch",
  "project_id": "prj_01J0000000000000000000000A",
  "ovrn": "ovrn:watch:prj_01J0000000000000000000000A:watch/wch_01J0000000000000000000000A",
  "owner": {
    "type": "user",
    "id": "usr_01J0000000000000000000000A"
  },
  "name": "Price of a camera",
  "state": "active",
  "created_at": "2026-09-28T23:00:00Z",
  "usage": {
    "watch-check": 120
  },
  "links": {
    "self": "https://openvibe.watch/api/v1/watches/wch_01J0000000000000000000000A"
  }
}
Rejected: no-state
{
  "id": "x",
  "kind": "watch.watch",
  "service": "watch",
  "created_at": "2026-09-28T23:00:00Z"
}
Rejected: ovrn-without-project
{
  "id": "wch_01J0000000000000000000000A",
  "kind": "watch.watch",
  "service": "watch",
  "project_id": "prj_01J0000000000000000000000A",
  "ovrn": "ovrn:watch:watch/wch_01J0000000000000000000000A",
  "owner": {
    "type": "user",
    "id": "usr_01J0000000000000000000000A"
  },
  "name": "Price of a camera",
  "state": "active",
  "created_at": "2026-09-28T23:00:00Z",
  "usage": {
    "watch-check": 120
  },
  "links": {
    "self": "https://openvibe.watch/api/v1/watches/wch_01J0000000000000000000000A"
  }
}

Validate

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