GamesModGrantsChangedPayload games.mod.grants_changed@1
Generated at from
openvibe-contracts v0.34.2 and
openvibe-sdk v0.5.0.
- Version
- 1.0.0
- Owner
- games
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/events/payloads/games.mod.grants_changed.v1.json
games.mod.grants_changed v1 (OpenVibe.Games apps/server/src/platform/gameEvents.ts modEvent, via ModRegistry.grant and ModRegistry.revokeGrant in mods/registry.ts; POST /api/v1/mods/:id/grants, DELETE /api/v1/mods/:id/grants/:capability). One capability of a non-revoked install was granted (granted: [capability], revoked: []) or one active grant was revoked (granted: [], revoked: [capability]); each call changes exactly one capability today. Not emitted when nothing changed. Revoking the whole install is games.mod.revoked instead. Written to Games' event_outbox in the same SQLite transaction as the registry and mod_audit rows (mods/registry.ts). The manifest, content pack, audit actor string and installer are left out. No consumer yet. Envelope: subject { type: mod, id: <mod.id> }, visibility internal, priority low, actor the staff member who made the change (user:<usr_...>), service:<client> for a principal token carrying games.mod.manage, or service:games (pre-subject staff token, editor key).
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
mod | object | yes | The install, from its validated mods/mod-manifest.v1 manifest. |
|
mod.id | string | yes | Mod id (manifest id). Also the envelope subject id. |
|
mod.name | string | yes |
| |
mod.version | string | yes | Semantic version of the installed release. |
|
mod.target | string | yes | Manifest target. Games only accepts games.browser today (mods/manifest.ts checkForGames). |
|
mod.trust_tier | enum | yes | Install metadata set at install; never consulted by a grant check. |
|
granted | array of string | yes | Capabilities newly granted by this change. |
|
revoked | array of string | yes | Capabilities whose grant this change revoked. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: granted
{
"mod": {
"id": "mod_01JAD3F5G7H9K1M3N5P7Q9R1S3",
"name": "Town Square",
"version": "1.0.0",
"target": "games.browser",
"trust_tier": "unreviewed"
},
"granted": [
"games.world.announce"
],
"revoked": []
}Valid: revoked
{
"mod": {
"id": "mod_01JAD3F5G7H9K1M3N5P7Q9R1S3",
"name": "Town Square",
"version": "1.0.0",
"target": "games.browser",
"trust_tier": "unreviewed"
},
"granted": [],
"revoked": [
"games.prop.place"
]
}Rejected: bad-capability
{
"mod": {
"id": "mod_01JAD3F5G7H9K1M3N5P7Q9R1S3",
"name": "Town Square",
"version": "1.0.0",
"target": "games.browser",
"trust_tier": "unreviewed"
},
"granted": [
"announce"
],
"revoked": []
}Rejected: capability-string
{
"mod": {
"id": "mod_01JAD3F5G7H9K1M3N5P7Q9R1S3",
"name": "Town Square",
"version": "1.0.0",
"target": "games.browser",
"trust_tier": "unreviewed"
},
"granted": "games.world.announce",
"revoked": []
}Rejected: missing-revoked
{
"mod": {
"id": "mod_01JAD3F5G7H9K1M3N5P7Q9R1S3",
"name": "Town Square",
"version": "1.0.0",
"target": "games.browser",
"trust_tier": "unreviewed"
},
"granted": [
"games.world.announce"
]
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('games.mod.grants_changed@1', value); // { valid, errors: [{ path, message }] }