TipsProfileUpdateRequest tips.profile-update-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/profile-update-request.v1.json

tips.profile-update-request@1: the body of tips.profile.update on OpenVibe.Tips. PATCH /api/v1/profiles/:creator (a usr_ id or handle; me for the signed-in person, creating their profile on first use): any of the settings below; revision, when given, must be the profile's current revision (409 tips.revision_conflict). A service opening a profile for a creator Tips has not seen (a usr_ id in the path) must give handle (and may give display_name and avatar_url). 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 (a value out of range, an unknown voice, an unknown page or filter setting, an empty display_name, no handle when creating) or tips.text_too_long; 404 tips.creator_not_found; 403 capability.denied or tips.forbidden. Unknown top-level fields are ignored.

Fields

FieldTypeRequiredDescriptionConstraints
revisioninteger | string
  • pattern ^[1-9][0-9]*$
  • minimum 1
page_enabledboolean | integer | stringThe public page and its indexing. true, 1, "1" and "on" count as yes; anything else as no.
acceptingboolean | integer | stringTake new tips. true, 1, "1" and "on" count as yes; anything else as no.
tts_enabledboolean | integer | stringText-to-speech requests. true, 1, "1" and "on" count as yes; anything else as no.
media_requests_enabledboolean | integer | stringMedia requests. true, 1, "1" and "on" count as yes; anything else as no.
min_amountinteger | stringThe smallest tip (1 to 1000000 bits).
  • pattern ^[1-9][0-9]*$
  • minimum 1
  • maximum 1000000
paid_message_mininteger | stringThe smallest paid message (1 to 1000000 bits).
  • pattern ^[1-9][0-9]*$
  • minimum 1
  • maximum 1000000
tts_min_amountinteger | stringThe smallest text-to-speech request (1 to 1000000 bits).
  • pattern ^[1-9][0-9]*$
  • minimum 1
  • maximum 1000000
media_request_mininteger | stringThe smallest media request (1 to 1000000 bits).
  • pattern ^[1-9][0-9]*$
  • minimum 1
  • maximum 1000000
media_max_secondsinteger | stringThe longest media request (10 to 10800 seconds).
  • pattern ^[1-9][0-9]*$
  • minimum 10
  • maximum 10800
tts_max_charsinteger | stringAt least 20, at most TIPS_TTS_HARD_CAP (1200 by default).
  • pattern ^[1-9][0-9]*$
  • minimum 20
tts_voiceenum
  • one of "gary", "brian", "amy", "emma", "joey", "justin", "matthew", "salli", "kimberly", "kendra", "ivy", "joanna"
headlinestring | null
  • maxLength 280
display_namestring
  • minLength 1
  • maxLength 80
pageobjectWhat the public pages show; any other setting is refused.
  • no other fields
page.goal_amountsboolean | integer | string
page.goal_supportersboolean | integer | string
page.supporters_pageboolean | integer | string
page.supporters_amountsboolean | integer | string
page.supporters_messagesboolean | integer | string
filterobjectThe word filter for paid messages; any other setting is refused.
  • no other fields
filter.wordsone ofBlocked words or phrases: a list, or one string separated by commas or new lines.
filter.actionenummask stars them out; hold keeps the paid message back for review.
  • one of "mask", "hold"
filter.linksboolean | integer | stringLinks in paid messages shown as [link].
handlestringCreating a profile as a service: the creator's handle (their Network username).
avatar_urlstring | nullCreating a profile as a service: an https URL.

Examples

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

Valid: service-create
{
  "handle": "moosefan",
  "display_name": "Moose Fan",
  "avatar_url": "https://openvibe.media/avatar/moosefan",
  "accepting": true
}
Valid: settings
{
  "revision": 4,
  "page_enabled": true,
  "tts_enabled": true,
  "tts_min_amount": 100,
  "tts_voice": "amy",
  "page": {
    "supporters_page": true,
    "supporters_messages": true
  },
  "filter": {
    "words": [
      "spoiler",
      "ending"
    ],
    "action": "hold"
  }
}
Rejected: bad-voice
{
  "tts_voice": "robot"
}
Rejected: unknown-page-setting
{
  "page": {
    "theme": "dark"
  }
}

Validate

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