InventoryItemRevokedPayload inventory.item.revoked@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.revoked.v1.json

inventory.item.revoked v1 (OpenVibe.Inventory, ADR-054). An issuer or staff revoked an instance (granted in error, abuse). Envelope: subject { type: user, id: owner }, visibility subject.

Fields

FieldTypeRequiredDescriptionConstraints
instance_idstringyes
  • pattern ^inv_[0-9A-HJKMNP-TV-Z]{26}$
definition_idstringyes
  • pattern ^itd_[0-9A-HJKMNP-TV-Z]{26}$
ownerstringyes
  • pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$
reasonstringyes
  • minLength 1
  • maxLength 200

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",
  "owner": "usr_01JZ0000000000000000000AAA",
  "reason": "granted twice by mistake"
}
Rejected: missing-field
{
  "definition_id": "itd_01JZ00000000000000000001TD",
  "owner": "usr_01JZ0000000000000000000AAA",
  "reason": "granted twice by mistake"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('inventory.item.revoked@1', value);   // { valid, errors: [{ path, message }] }