InventoryItemGrantedPayload inventory.item.granted@1
Generated at from
openvibe-contracts v0.127.0 and
openvibe-sdk v0.37.0.
- Version
- 1.0.0
- Owner
- inventory
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Decision
- ADR-054
- Schema
https://openvibe.network/contracts/events/payloads/inventory.item.granted.v1.json
inventory.item.granted v1 (OpenVibe.Inventory, ADR-054). An instance was granted or earned (ADR-054 §4). Envelope: subject { type: user, id: owner }, visibility subject, actor the issuer.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
instance_id | string | yes |
| |
definition_id | string | yes |
| |
kind | string | yes |
| |
owner | string | yes |
| |
origin | enum | yes |
| |
issuer | string | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: example
{
"instance_id": "inv_01JZ00000000000000000001NV",
"definition_id": "itd_01JZ00000000000000000001TD",
"kind": "live.name_effect",
"owner": "usr_01JZ0000000000000000000AAA",
"origin": "earned",
"issuer": "service:quest"
}Rejected: missing-field
{
"definition_id": "itd_01JZ00000000000000000001TD",
"kind": "live.name_effect",
"owner": "usr_01JZ0000000000000000000AAA",
"origin": "earned",
"issuer": "service:quest"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('inventory.item.granted@1', value); // { valid, errors: [{ path, message }] }