NetworkBlocksResult network.blocks-result@1
Generated at from
openvibe-contracts v0.53.0 and
openvibe-sdk v0.11.0.
- Version
- 1.0.0
- Owner
- network
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/network/blocks-result.v1.json
network.blocks-result@1: the answer of network.blocks.read on OpenVibe.Network. GET /internal/blocks?subject=usr_… (a service token holding network.blocks.read; the shared internal key is refused) → { subject, blocks, blocked_by }: the people the subject has blocked and the people who have blocked the subject, as usr_ subjects in subject order, active blocks only (a person may hold at most 5000). Answered with Cache-Control: no-store. A subject that is not a usr_ id is refused with 400 blocks.bad_subject (problem+json).
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
subject | string | yes | The person asked about. |
|
blocks | array of string | yes | Whom the subject blocked. |
|
blocked_by | array of string | yes | Who blocked the subject. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: both-ways
{
"subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"blocks": [
"usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
],
"blocked_by": [
"usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
"usr_01JAB2C3D4E5F6G7H8J9K0MNPS"
]
}Valid: none
{
"subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"blocks": [],
"blocked_by": []
}Rejected: integer-ids
{
"subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"blocks": [
42
],
"blocked_by": []
}Rejected: missing-blocked-by
{
"subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"blocks": []
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('network.blocks-result@1', value); // { valid, errors: [{ path, message }] }