ChatInboxResult chat.inbox-result@1
Generated at from
openvibe-contracts v0.221.0 and
openvibe-sdk v0.65.0.
- Version
- 1.0.0
- Owner
- chat
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/chat/inbox-result.v1.json
chat.inbox-result@1: a support inbox as its people see it ({ inbox, members?, embed? }: the widget snippet and panel address), or the inboxes a person works in ({ inboxes }, each with their role and how many conversations wait and are open). Secrets (the identity secret, webhook and action secrets) appear only on the answer that made them.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
inbox | object | |||
inbox.id | string | yes |
| |
inbox.name | string | yes | ||
inboxes | array of object | |||
inboxes[].id | string | yes | ||
inboxes[].name | string | yes | ||
inboxes[].role | enum | yes |
| |
inboxes[].waiting | integer | |||
inboxes[].open | integer | |||
members | array of object | |||
embed | object | |||
embed.script | string | |||
embed.panel | string |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: an-inbox
{
"inbox": {
"id": "inb_01J9ZQ3M5K8V2R4T6Y8W0X2C4B",
"name": "Pixel Lamp Co."
},
"embed": {
"script": "<script src=\"https://openvibe.chat/widget.js\" data-inbox=\"inb_01J9ZQ3M5K8V2R4T6Y8W0X2C4B\" async></script>",
"panel": "https://openvibe.chat/embed/inbox/inb_01J9ZQ3M5K8V2R4T6Y8W0X2C4B"
}
}Valid: my-inboxes
{
"inboxes": [
{
"id": "inb_01J9ZQ3M5K8V2R4T6Y8W0X2C4B",
"name": "Pixel Lamp Co.",
"role": "owner",
"waiting": 2,
"open": 5
}
]
}Rejected: bad-role
{
"inboxes": [
{
"id": "inb_01J9ZQ3M5K8V2R4T6Y8W0X2C4B",
"name": "x",
"role": "boss"
}
]
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('chat.inbox-result@1', value); // { valid, errors: [{ path, message }] }