NetworkStaffListResult network.staff-list-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/staff-list-result.v1.json
network.staff-list-result@1: the answer of network.staff.read on OpenVibe.Network. GET /api/v1/staff/moderators[?service=chat|live|community|pastes|calls] (a service token holding network.staff.read, or a signed-in person holding staff.moderation.logs) → { service, staff }: the network's global moderators, admins and the owner who are not banned, with the staff capabilities their role holds in the contracts staff map; ?service keeps those holding the capability that moderates that service (another service name keeps those holding staff.content.moderate; an invalid value is ignored and answered as null). Answered with Cache-Control: private, no-store; a person without staff.moderation.logs gets 403 { error: forbidden }.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
service | string | null | yes | The service filter applied, or null. | |
staff | array of object | yes | ||
staff[].subject | string | null | yes | null for an account that has no subject yet. |
|
staff[].username | string | yes | ||
staff[].display_name | string | yes | ||
staff[].role | enum | yes |
| |
staff[].is_owner | boolean | yes | ||
staff[].capabilities | array of string | yes | Staff capability ids, sorted. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: chat
{
"service": "chat",
"staff": [
{
"subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPS",
"username": "nightmod",
"display_name": "Night Mod",
"role": "global_mod",
"is_owner": false,
"capabilities": [
"staff.console.access",
"staff.content.hide",
"staff.content.moderate",
"staff.content.view_private",
"staff.moderation.bans",
"staff.moderation.bypass",
"staff.moderation.calls",
"staff.moderation.channels",
"staff.moderation.chat",
"staff.moderation.discussions",
"staff.moderation.ip",
"staff.moderation.logs",
"staff.moderation.pastes"
]
}
]
}Valid: nobody
{
"service": null,
"staff": []
}Rejected: user-role
{
"service": null,
"staff": [
{
"subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
"username": "viewer",
"display_name": "Viewer",
"role": "user",
"is_owner": false,
"capabilities": []
}
]
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('network.staff-list-result@1', value); // { valid, errors: [{ path, message }] }