InventoryDefinition inventory.definition@1

Generated at from openvibe-contracts v0.127.0 and openvibe-sdk v0.37.0.

Version
1.0.0
Owner
inventory
Visibility
public
Status
active
Compatibility
backward
Decision
ADR-054
Schema
https://openvibe.network/contracts/inventory/definition.v1.json

An item definition (ADR-054 §2): one item of a kind, issued by a service, an app or a creator, with an honest rarity, attributes valid against the kind and an optional supply cap. Published definitions can be granted; retired ones cannot, and their instances stay.

Fields

FieldTypeRequiredDescriptionConstraints
idstringyes
  • pattern ^itd_[0-9A-HJKMNP-TV-Z]{26}$
kindstringyes
  • pattern ^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$
  • maxLength 64
namestringyes
  • minLength 1
  • maxLength 80
descriptionstring
  • maxLength 500
artobjectyes
  • no other fields
art.media_idstringAn OpenVibe.Media object (an image, an animation).
  • pattern ^med_[0-9A-HJKMNP-TV-Z]{26}$
art.tokenstringA token the kind's renderers know (a CSS class, a speech preset).
  • minLength 1
  • maxLength 80
art.emojistring
  • maxLength 16
rarityenumyesShown as is; any odds that apply are shown with it, never hidden.
  • one of "common", "uncommon", "rare", "epic", "legendary"
attributesobjectyes
issuerstringyes
  • pattern ^(service:[a-z][a-z0-9-]*|app:app_[0-9A-HJKMNP-TV-Z]{26}|user:usr_[0-9A-HJKMNP-TV-Z]{26})$
aliasesarray of stringEarlier ids of the same item (Live's fx_rainbow, hat_crown, …).
  • maxItems 8
  • unique items
  • items: pattern ^[a-z0-9][a-z0-9_.-]{0,63}$
supplyobjectyes
  • no other fields
supply.capinteger | nullyesnull: unlimited.
  • minimum 1
supply.issuedintegeryes
  • minimum 0
statusenumyes
  • one of "draft", "in_review", "published", "retired"
creditobjectThe creator of a community item (ADR-054 §6).
  • no other fields
credit.subjectstring
  • pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$
credit.namestring
  • maxLength 80
created_atstringyes
  • format date-time
updated_atstringyes
  • format date-time
published_atstring
  • format date-time
grantorsarray of stringOther services or apps the issuer lets grant this one item (ADR-054 §3): Quest giving Live's hats as quest rewards. They grant only (origin earned or granted, idempotent per key); defining, editing, consuming and revoking stay the issuer's.
  • maxItems 8
  • unique items
  • items: pattern ^(service:[a-z][a-z0-9-]*|app:app_[0-9A-HJKMNP-TV-Z]{26})$

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: community-capped
{
  "id": "itd_01JZ00000000000000000001T2",
  "kind": "network.profile_frame",
  "name": "Aurora frame",
  "description": "Rainbow cycling colors",
  "art": {
    "media_id": "med_01JZ0000000000000000000MED"
  },
  "rarity": "rare",
  "attributes": {},
  "issuer": "user:usr_01JZ0000000000000000000AAA",
  "aliases": [],
  "supply": {
    "cap": 500,
    "issued": 12
  },
  "status": "published",
  "created_at": "2026-10-09T03:00:00Z",
  "updated_at": "2026-10-09T03:00:00Z",
  "published_at": "2026-10-09T03:00:00Z",
  "credit": {
    "subject": "usr_01JZ0000000000000000000AAA",
    "name": "aurora_artist"
  }
}
Valid: live-name-effect
{
  "id": "itd_01JZ00000000000000000001TD",
  "kind": "live.name_effect",
  "name": "Rainbow Name",
  "description": "Rainbow cycling colors",
  "art": {
    "token": "name-fx-rainbow",
    "emoji": "🌈"
  },
  "rarity": "common",
  "attributes": {
    "css_class": "name-fx-rainbow"
  },
  "issuer": "service:live",
  "aliases": [
    "fx_rainbow"
  ],
  "supply": {
    "cap": null,
    "issued": 4
  },
  "status": "published",
  "created_at": "2026-10-09T03:00:00Z",
  "updated_at": "2026-10-09T03:00:00Z",
  "published_at": "2026-10-09T03:00:00Z"
}
Rejected: bad-issuer
{
  "id": "itd_01JZ00000000000000000001TD",
  "kind": "live.name_effect",
  "name": "Rainbow Name",
  "description": "Rainbow cycling colors",
  "art": {
    "token": "name-fx-rainbow",
    "emoji": "🌈"
  },
  "rarity": "common",
  "attributes": {
    "css_class": "name-fx-rainbow"
  },
  "issuer": "live",
  "aliases": [
    "fx_rainbow"
  ],
  "supply": {
    "cap": null,
    "issued": 4
  },
  "status": "published",
  "created_at": "2026-10-09T03:00:00Z",
  "updated_at": "2026-10-09T03:00:00Z",
  "published_at": "2026-10-09T03:00:00Z"
}
Rejected: bad-rarity
{
  "id": "itd_01JZ00000000000000000001TD",
  "kind": "live.name_effect",
  "name": "Rainbow Name",
  "description": "Rainbow cycling colors",
  "art": {
    "token": "name-fx-rainbow",
    "emoji": "🌈"
  },
  "rarity": "mythic",
  "attributes": {
    "css_class": "name-fx-rainbow"
  },
  "issuer": "service:live",
  "aliases": [
    "fx_rainbow"
  ],
  "supply": {
    "cap": null,
    "issued": 4
  },
  "status": "published",
  "created_at": "2026-10-09T03:00:00Z",
  "updated_at": "2026-10-09T03:00:00Z",
  "published_at": "2026-10-09T03:00:00Z"
}
Rejected: no-art
{
  "id": "itd_01JZ00000000000000000001TD",
  "kind": "live.name_effect",
  "name": "Rainbow Name",
  "description": "Rainbow cycling colors",
  "art": {},
  "rarity": "common",
  "attributes": {
    "css_class": "name-fx-rainbow"
  },
  "issuer": "service:live",
  "aliases": [
    "fx_rainbow"
  ],
  "supply": {
    "cap": null,
    "issued": 4
  },
  "status": "published",
  "created_at": "2026-10-09T03:00:00Z",
  "updated_at": "2026-10-09T03:00:00Z",
  "published_at": "2026-10-09T03:00:00Z"
}

Validate

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