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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
stream_id | integer | yes |
| |
channel | object | yes | ||
channel.subject | string | null | yes | ||
followers | array of object | yes |
| |
followers[].subject | string | null | yes |
| |
followers[].network_user_id | integer | null | yes | ||
next | integer | null | yes |
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 }] }