NetworkModGrantsChangedPayload network.mod.grants_changed@1
Generated at from
openvibe-contracts v0.76.0 and
openvibe-sdk v0.20.1.
- Version
- 1.0.0
- Owner
- network
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Decision
- ADR-013
- Schema
https://openvibe.network/contracts/events/payloads/network.mod.grants_changed.v1.json
network.mod.grants_changed v1 (OpenVibe.Network; roadmap WS-M task 3, ADR-013): a mod principal's grants changed: registered, a capability approved or revoked, or the whole install revoked. `approved` is the complete approved set after the change, so the owning runtime sets its copy to it (idempotent by revision: an older revision changes nothing). `by` says whether the owning runtime or Network staff made the change; a runtime applies both.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
mod_id | string | yes |
| |
owner | string | yes |
| |
status | enum | yes |
| |
approved | array of string | yes |
| |
pending | array of string |
| ||
revision | integer | yes |
| |
change | object | yes |
| |
change.action | enum | yes |
| |
change.capability | string |
| ||
by | enum | yes |
| |
reason | string |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: staff-revoke
{
"mod_id": "mod_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"owner": "games",
"status": "active",
"approved": [],
"pending": [
"games.prop.place"
],
"revision": 3,
"change": {
"action": "revoke",
"capability": "games.world.announce"
},
"by": "staff",
"reason": "spawned items in a safe zone"
}Rejected: unknown-action
{
"mod_id": "mod_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"owner": "games",
"status": "active",
"approved": [],
"revision": 3,
"change": {
"action": "delete"
},
"by": "staff"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('network.mod.grants_changed@1', value); // { valid, errors: [{ path, message }] }