ChatViewPreference chat.view-pref@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
- Version
- 1.0.0
- Owner
- chat
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Decision
- ADR-001
- Schema
https://openvibe.network/contracts/chat/view-pref.v1.json
chat.view-pref@1: saved rendering choice for a conversation, or the default for a conversation kind. Conversation choices override the matching default.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
view | enum | yes |
| |
kind | enum |
| ||
conversation_id | string | integer | Omit for a kind default; otherwise the preference is scoped to this conversation. |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: direct-message
{
"view": "bubbles",
"kind": "one_to_one",
"conversation_id": 123
}Rejected: unknown-view
{
"view": "cards",
"kind": "one_to_one",
"conversation_id": 123
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('chat.view-pref@1', value); // { valid, errors: [{ path, message }] }