EventsPublishResult events.publish-result@1

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

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

events.publish-result@1: the answer of POST /api/v1/events on OpenVibe.Events (events.event.publish for services, events.app.publish for developer apps). One envelope → { event_id, seq, duplicate } (201 when stored, 200 when every event was a repeat); a batch { events: [...] } (at most 100, atomic) → { results } in the same order. Refusals are problem+json: 422 events.invalid_envelope / events.invalid_redaction, 403 events.source_mismatch / events.type_not_allowed / events.actor_mismatch, 413 events.payload_too_large / events.batch_too_large, 429 events.quota_exceeded (apps).

Fields

This schema has no named fields.

Examples

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

Valid: batch
{
  "results": [
    {
      "event_id": "evt_01JAB2C3D4E5F6G7H8J9K0MNPQ",
      "seq": 88213,
      "duplicate": false
    },
    {
      "event_id": "evt_01JAB2C3D4E5F6G7H8J9K0MNPR",
      "seq": 70001,
      "duplicate": true
    }
  ]
}
Valid: one
{
  "event_id": "evt_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "seq": 88213,
  "duplicate": false
}
Rejected: no-duplicate-flag
{
  "event_id": "evt_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "seq": 0
}

Validate

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