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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
revision | integer | string |
| ||
page_enabled | boolean | integer | string | The public page and its indexing. true, 1, "1" and "on" count as yes; anything else as no. | ||
accepting | boolean | integer | string | Take new tips. true, 1, "1" and "on" count as yes; anything else as no. | ||
tts_enabled | boolean | integer | string | Text-to-speech requests. true, 1, "1" and "on" count as yes; anything else as no. | ||
media_requests_enabled | boolean | integer | string | Media requests. true, 1, "1" and "on" count as yes; anything else as no. | ||
min_amount | integer | string | The smallest tip (1 to 1000000 bits). |
| |
paid_message_min | integer | string | The smallest paid message (1 to 1000000 bits). |
| |
tts_min_amount | integer | string | The smallest text-to-speech request (1 to 1000000 bits). |
| |
media_request_min | integer | string | The smallest media request (1 to 1000000 bits). |
| |
media_max_seconds | integer | string | The longest media request (10 to 10800 seconds). |
| |
tts_max_chars | integer | string | At least 20, at most TIPS_TTS_HARD_CAP (1200 by default). |
| |
tts_voice | enum |
| ||
headline | string | null |
| ||
display_name | string |
| ||
page | object | What the public pages show; any other setting is refused. |
| |
page.goal_amounts | boolean | integer | string | |||
page.goal_supporters | boolean | integer | string | |||
page.supporters_page | boolean | integer | string | |||
page.supporters_amounts | boolean | integer | string | |||
page.supporters_messages | boolean | integer | string | |||
filter | object | The word filter for paid messages; any other setting is refused. |
| |
filter.words | one of | Blocked words or phrases: a list, or one string separated by commas or new lines. | ||
filter.action | enum | mask stars them out; hold keeps the paid message back for review. |
| |
filter.links | boolean | integer | string | Links in paid messages shown as [link]. | ||
handle | string | Creating a profile as a service: the creator's handle (their Network username). | ||
avatar_url | string | null | Creating 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 }] }