LiveFollowerPage live.follower-page@1

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

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

live.follower-page@1: the answer of GET /internal/followers?stream_id=&limit=&after= on OpenVibe.Live (live.follower.read, service token, loopback): the followers of the channel that streams stream_id, for Network's go-live notifications. A follower is named by their Network subject when Live knows it, else their Network user id. next is the cursor for the following page (null on the last). 400 without stream_id, 404 for an unknown stream.

Fields

FieldTypeRequiredDescriptionConstraints
stream_idintegeryes
  • minimum 1
channelobjectyes
channel.subjectstring | nullyes
followersarray of objectyes
  • maxItems 5000
followers[].subjectstring | nullyes
  • pattern ^usr_
followers[].network_user_idinteger | nullyes
nextinteger | nullyes

Examples

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

Valid: page
{
  "stream_id": 812,
  "channel": {
    "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "followers": [
    {
      "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
      "network_user_id": 1042
    },
    {
      "subject": null,
      "network_user_id": 77
    }
  ],
  "next": null
}
Rejected: bad-follower
{
  "stream_id": 812,
  "channel": {
    "subject": null
  },
  "followers": [
    {
      "subject": "alice"
    }
  ],
  "next": null
}

Validate

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