LiveTipsDeliveryRequest live.tips-delivery-request@1

Generated at from openvibe-contracts v0.53.0 and openvibe-sdk v0.11.0.

Version
1.0.0
Owner
live
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/live/tips-delivery-request.v1.json

live.tips-delivery-request@1: the body of POST /internal/tips/deliveries on OpenVibe.Live (live.tips_delivery.write; OpenVibe.Tips' live-chat delivery adapter, loopback only). The money already moved in OpenVibe.Billing; this only shows it on the creator's channel. Needs an Idempotency-Key header (<interaction id>:<effect>, 8-200 of A-Z a-z 0-9 _ : . -); a repeat answers the first result. effect chat_line or paid_message: a donation event in the channel room and global chat, saved as a donation chat message, with the alert sound; tts: tts.text spoken on the live stream (or the offline channel room); media_request: media.url into the channel's media queue at cost 0. The creator must have a Live channel (404 otherwise); an unknown effect or a failure is 422.

Fields

FieldTypeRequiredDescriptionConstraints
delivery_idstring
effectenumyes
  • one of "chat_line", "paid_message", "tts", "media_request"
testboolean
creatorobjectyes
creator.typeconst
  • = "user"
creator.idstringyes
  • pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$
supporterobject
supporter.namestringShown (80 characters); Someone when absent.
supporter.subjectstring | null
interactionobject
interaction.idstring
interaction.kindstring
interaction.amountnumber | string
interaction.currencystring
interaction.messagestring | nullCut to 500 characters.
textstringThe chat line to save (1000 characters); a default names the supporter and amount.
ttsobject
tts.textstring
  • minLength 1
  • maxLength 1200
tts.voicestring | null
mediaobject
media.urlstringyes
highlight_secondsnumber | string
targetobjectA live stream of the creator ({ service: live, type: stream, id }); otherwise the creator's current live stream.
target.servicestring
target.typestring
target.idstring | integer

Examples

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

Valid: paid-message
{
  "delivery_id": "dlv_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "effect": "paid_message",
  "test": false,
  "creator": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "supporter": {
    "name": "bob",
    "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "interaction": {
    "id": "int_01JAB2C3D4E5F6G7H8J9K0MNPS",
    "kind": "paid_message",
    "amount": 500,
    "currency": "vibes-bits",
    "message": "love the stream"
  },
  "text": "bob tipped 500 Vibes: love the stream",
  "highlight_seconds": 30
}
Valid: tts
{
  "effect": "tts",
  "creator": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "supporter": {
    "name": "bob"
  },
  "interaction": {
    "id": "int_01JAB2C3D4E5F6G7H8J9K0MNPS"
  },
  "tts": {
    "text": "hello from bob",
    "voice": null
  }
}
Rejected: unknown-effect
{
  "effect": "fireworks",
  "creator": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  }
}

Validate

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