ChatSoundsResult chat.sounds-result@1

Generated at from openvibe-contracts v0.97.0 and openvibe-sdk v0.26.0.

Version
1.0.0
Owner
chat
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/chat/sounds-result.v1.json

chat.sounds-result@1: the answer of GET /internal/chat/sounds on OpenVibe.Chat (capability chat.sounds.read). ?channel_owner_id answers { count } (a channel's custom sounds, for Live's channel readiness); ?pending_asset=1 answers { sounds } (rows with no media_asset_id yet, which Live's asset sync uploads to OpenVibe.Media and writes back with POST /internal/chat/sounds/asset). A failure is chat.ingress-ack@1's error.

Fields

This schema has no named fields.

Examples

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

Valid: count
{
  "count": 14
}
Valid: pending-asset
{
  "sounds": [
    {
      "id": 904,
      "channel_owner_id": 77,
      "command": "airhorn",
      "url": "/sounds/77/airhorn.mp3",
      "mime": "audio/mpeg",
      "duration_seconds": 2.4,
      "created_by": 512,
      "created_by_name": "pixelfox",
      "media_url": null,
      "media_asset_id": null
    }
  ]
}
Rejected: negative-count
{
  "count": -2
}
Rejected: sound-without-url
{
  "sounds": [
    {
      "id": 904,
      "channel_owner_id": 77,
      "command": "airhorn",
      "mime": "audio/mpeg",
      "duration_seconds": 2.4,
      "created_by": 512,
      "created_by_name": "pixelfox",
      "media_url": null,
      "media_asset_id": null
    }
  ]
}

Validate

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