TipsSimulationRequest tips.simulation-request@1

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

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

tips.simulation-request@1: the body of tips.simulation.run on OpenVibe.Tips. POST /api/v1/simulate: { creator?, kind?, amount?, message?, tts?, media?, goal_id?, supporter_name?, privacy? } runs the full effect path (overlay alert, goal widget, delivery) flagged test, with no Billing call, never counted in any total and never emitted as a durable event. A service names the creator; a person simulates on their own page. The creator's rules apply as for a real request, except that a creator who is not accepting tips can still simulate. kind defaults to tip, amount to the creator's minimum or 100 bits, supporter_name to "Test supporter". Needs an Idempotency-Key header (8-200 of A-Z a-z 0-9 . _ : -; 400 idempotency.key_required): a replay with the same key and body returns the first answer, the same key with another body is 422 idempotency.key_reused. Refusals are problem+json (422 tips.invalid_input, tips.amount_too_small, tips.invalid_media, …; 409 tips.tts_disabled or tips.media_disabled; 404 tips.creator_not_found). Unknown fields are ignored.

Fields

FieldTypeRequiredDescriptionConstraints
creatorone ofThe creator whose overlays show it (default: the signed-in person).
kindenum
  • one of "tip", "paid_message", "tts", "media_request"
amountinteger | stringVibes bits.
  • pattern ^[1-9][0-9]*$
  • minimum 1
  • maximum 10000000
messagestring | null
ttsobjectText-to-speech (kind tts): the text to read (default: message) and the voice.
tts.textstring
tts.voiceenumDefault: the creator's voice.
  • one of "gary", "brian", "amy", "emma", "joey", "justin", "matthew", "salli", "kimberly", "kendra", "ivy", "joanna"
mediaobjectA media request (kind media_request).
media.urlstringyesAn https link on an allowed host (TIPS_MEDIA_HOSTS; YouTube by default).
  • pattern ^https://
  • maxLength 500
goal_idstring
supporter_namestring | null
privacyobjectThe supporter's choices; any other field is refused (422 tips.invalid_input). true, 1, "1", "true" and "on" count as yes.
  • no other fields
privacy.anonymousboolean | integer | stringThe name reads "Anonymous" to everyone but the supporter.
privacy.hide_amountboolean | integer | stringThe amount is left out of overlays, chat lines and public pages.
privacy.private_messageboolean | integer | stringA tip's message is for the creator only (tips only; 422 for the other kinds).

Examples

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

Valid: default
{}
Valid: tts
{
  "kind": "tts",
  "amount": 200,
  "tts": {
    "text": "Testing one two",
    "voice": "brian"
  }
}
Rejected: bad-kind
{
  "kind": "raid"
}

Validate

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