@smartico/public-api 0.0.386 → 0.0.388

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +2 -2
  2. package/dist/Avatars/AvatarCustomizeErrorCode.d.ts +7 -1
  3. package/dist/Avatars/AvatarCustomizeResponse.d.ts +16 -0
  4. package/dist/Avatars/index.d.ts +1 -0
  5. package/dist/CustomSections/AchCustomSection.d.ts +2 -1
  6. package/dist/Missions/UserAchievementTask.d.ts +4 -0
  7. package/dist/SmarticoAPI.d.ts +15 -2
  8. package/dist/WSAPI/WSAPIAvatars.d.ts +103 -0
  9. package/dist/WSAPI/WSAPILeaderBoard.d.ts +76 -10
  10. package/dist/WSAPI/WSAPITypes.d.ts +22 -5
  11. package/dist/index.js +441 -149
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.modern.mjs +280 -29
  14. package/dist/index.modern.mjs.map +1 -1
  15. package/docs/SmarticoObject.md +15 -0
  16. package/docs/api/README.md +2 -0
  17. package/docs/api/classes/WSAPIAvatars.md +135 -0
  18. package/docs/api/classes/WSAPIClans.md +3 -5
  19. package/docs/api/classes/WSAPILeaderBoard.md +86 -10
  20. package/docs/api/documents/SmarticoObject.md +15 -0
  21. package/docs/api/enumerations/AvatarCustomizeErrorCode.md +21 -0
  22. package/docs/api/enumerations/JoinClanErrorCode.md +16 -17
  23. package/docs/api/interfaces/AvatarCustomizeResponse.md +31 -0
  24. package/docs/api/interfaces/LeaderBoardDetailsT.md +19 -0
  25. package/docs/api/interfaces/LeaderBoardUserT.md +14 -2
  26. package/docs/api/interfaces/TAvatarPrompt.md +2 -2
  27. package/docs/api/interfaces/TMissionOrBadgeTask.md +16 -0
  28. package/docs/api/interfaces/UserAchievementTask.md +16 -0
  29. package/docs/native/PROTOCOL.md +37 -7
  30. package/docs/ui/avatars/UIGuide_avatarsCustomize.md +69 -0
  31. package/docs/ui/leaderboard/UIGuide_getLeaderBoard.md +15 -0
  32. package/package.json +1 -1
  33. package/src/Avatars/AvatarCustomizeErrorCode.ts +7 -5
  34. package/src/Avatars/AvatarCustomizeResponse.ts +17 -0
  35. package/src/Avatars/index.ts +1 -0
  36. package/src/CustomSections/AchCustomSection.ts +1 -0
  37. package/src/Leaderboard/LeaderBoards.ts +9 -12
  38. package/src/Missions/UserAchievement.ts +2 -0
  39. package/src/Missions/UserAchievementTask.ts +4 -0
  40. package/src/SmarticoAPI.ts +84 -3
  41. package/src/WSAPI/WSAPIAvatars.ts +121 -0
  42. package/src/WSAPI/WSAPILeaderBoard.ts +91 -14
  43. package/src/WSAPI/WSAPITypes.ts +22 -5
  44. package/tsconfig.json +3 -1
@@ -108,6 +108,14 @@ login payload and (optionally) the language. Both are being consolidated into
108
108
  Logs the current user out, forgets the session, and reconnects as anonymous.
109
109
  Fires the `logout` callback on success.
110
110
 
111
+ ### `checkSuccessfullyIdentify()`
112
+
113
+ Returns `true` once the SDK is initialized **and** a user has been
114
+ successfully identified, `false` otherwise. Use it as a synchronous gate
115
+ before calling user-scoped `_smartico.api.*` methods (e.g. `getUserProfile()`),
116
+ as an alternative to waiting on the `identify` callback. Returns `false` in
117
+ visitor mode.
118
+
111
119
  ### `changeLanguage(language)`
112
120
 
113
121
  Switches the active language. The code is normalized to a 2-letter form
@@ -396,6 +404,13 @@ Returns `true` on mobile user agents.
396
404
  Parse the current page URL / URL hash into an object (helpers for reading
397
405
  query / hash parameters).
398
406
 
407
+ ### `sendServerError(message)` · `sendServerDebug(message)`
408
+
409
+ Forward a client-side message to Smartico's servers for support correlation —
410
+ `sendServerError` for error conditions, `sendServerDebug` for diagnostic
411
+ detail. Useful when reporting an integration issue so the message lands
412
+ alongside your session server-side. No-ops if the SDK isn't initialized.
413
+
399
414
  ---
400
415
 
401
416
  ## Setup notes
@@ -10,6 +10,7 @@
10
10
 
11
11
  - [PointChangeSourceType](enumerations/PointChangeSourceType.md)
12
12
  - [UserBalanceType](enumerations/UserBalanceType.md)
13
+ - [AvatarCustomizeErrorCode](enumerations/AvatarCustomizeErrorCode.md)
13
14
  - [BonusStatus](enumerations/BonusStatus.md)
14
15
  - [JoinClanErrorCode](enumerations/JoinClanErrorCode.md)
15
16
  - [ActivityTypeLimited](enumerations/ActivityTypeLimited.md)
@@ -78,6 +79,7 @@
78
79
 
79
80
  - [PointsLog](interfaces/PointsLog.md)
80
81
  - [GemsDiamondsLog](interfaces/GemsDiamondsLog.md)
82
+ - [AvatarCustomizeResponse](interfaces/AvatarCustomizeResponse.md)
81
83
  - [AvatarCustomized](interfaces/AvatarCustomized.md)
82
84
  - [AvatarDefinition](interfaces/AvatarDefinition.md)
83
85
  - [AvatarPrompt](interfaces/AvatarPrompt.md)
@@ -342,3 +342,138 @@ switch (r.err_code) {
342
342
  ```
343
343
 
344
344
  ***
345
+
346
+ ### avatarsCustomize()
347
+
348
+ > **avatarsCustomize**(`props`): `Promise`\<[`AvatarCustomizeResponse`](../interfaces/AvatarCustomizeResponse.md)\>
349
+
350
+ Generates an AI-customized variant of a base avatar by applying an
351
+ operator-defined style prompt, returning the CDN URL of the result.
352
+ This is a paid, generate-only step: it does NOT change the user's
353
+ active avatar — pass the returned `cdn_url` to [setAvatar](#setavatar) to
354
+ activate it.
355
+
356
+ #### Parameters
357
+
358
+ ##### props
359
+
360
+ ###### label_id
361
+
362
+ `number`
363
+
364
+ Numeric Smartico label (brand) ID the user belongs to.
365
+
366
+ ###### user_id
367
+
368
+ `number`
369
+
370
+ Numeric Smartico user ID.
371
+
372
+ ###### prompt_id
373
+
374
+ `number`
375
+
376
+ Style-prompt ID (`prompt_id`) from [getAvatarPrompts](#getavatarprompts).
377
+
378
+ ###### avatar_url
379
+
380
+ `string`
381
+
382
+ CDN URL of the base avatar to customize.
383
+
384
+ ###### avatar_real_id
385
+
386
+ `number`
387
+
388
+ `avatar_real_id` of the base avatar.
389
+
390
+ #### Returns
391
+
392
+ `Promise`\<[`AvatarCustomizeResponse`](../interfaces/AvatarCustomizeResponse.md)\>
393
+
394
+ [AvatarCustomizeResponse](../interfaces/AvatarCustomizeResponse.md) — `cdn_url` set on success;
395
+ `errCode` / `errMessage` set on failure.
396
+
397
+ #### Remarks
398
+
399
+ **Preconditions**
400
+ - Authenticated session required; not available in visitor mode (throws).
401
+ - All five fields are mandatory — the SDK throws synchronously
402
+ (`Error("<field> is required")`) if any is missing or zero.
403
+ - `prompt_id` must be one of the prompts from [getAvatarPrompts](#getavatarprompts);
404
+ `avatar_url` / `avatar_real_id` identify the base avatar to style.
405
+
406
+ **Cost**
407
+ Each generation costs the currency the operator configured on the
408
+ chosen prompt (points, gems, or diamonds — some prompts are free; read
409
+ `cost_currency_type_id` / `cost_value` from the [getAvatarPrompts](#getavatarprompts)
410
+ entry to gate the UI before calling). The cost is charged only on
411
+ success; if the user can't afford it the call fails with `errCode -1`
412
+ and nothing is generated or charged.
413
+
414
+ **Latency**
415
+ Generation runs server-side AI image synthesis and is synchronous from
416
+ the caller's side — expect several seconds (roughly 5–20 s) before the
417
+ promise resolves. There is no SDK cache and no push/subscription; show
418
+ a loading state for the full duration and disable the trigger to
419
+ prevent duplicate submissions.
420
+
421
+ **Result & error codes**
422
+ On success the result has `cdn_url` set; on failure it has `errCode` /
423
+ `errMessage` set and no `cdn_url`. Branch on `errCode` — the generic
424
+ message is fixed text, not cause-specific:
425
+ - `12001` (`AvatarCustomizeErrorCode.AVATAR_USER_LIMIT`) — the user hit
426
+ their monthly per-user generation cap. Nothing is generated or charged.
427
+ - `12002` (`AvatarCustomizeErrorCode.AVATAR_LABEL_LIMIT`) — the brand's
428
+ shared monthly pool is exhausted. Nothing is generated or charged;
429
+ surface a "try again later" message.
430
+ - `-1` — generic failure: insufficient balance, an unavailable prompt,
431
+ or a generation error. Nothing is charged. Allow the user to retry.
432
+
433
+ Both monthly caps are operator-configured and reset at the start of
434
+ each calendar month.
435
+
436
+ **Side effects (on success)**
437
+ The generated variant is persisted to the user's customization history
438
+ and counts toward the monthly caps **whether or not** it is later
439
+ activated — generation is not reversible. The SDK clears the
440
+ [getAvatarsCustomized](#getavatarscustomized) cache so the next call surfaces the new
441
+ variant. The user's active avatar is unchanged until you call
442
+ [setAvatar](#setavatar) with the returned `cdn_url`.
443
+
444
+ **Idempotency**: not idempotent — each successful call generates (and
445
+ charges for) a new variant. Guard the call site against double-clicks.
446
+
447
+ **UI guidance**: see [UI Guide — `avatarsCustomize`](../_media/UIGuide_avatarsCustomize.md).
448
+
449
+ **Visitor mode**: not supported (throws).
450
+
451
+ #### Example
452
+
453
+ ```ts
454
+ // label_id / user_id identify the Smartico user being customized.
455
+ const prompts = await window._smartico.api.getAvatarPrompts();
456
+ const prompt = prompts[0];
457
+
458
+ console.log('[smartico] generating avatar — show a spinner for ~5-20s and disable the Generate button');
459
+ const result = await window._smartico.api.avatarsCustomize({
460
+ label_id,
461
+ user_id,
462
+ prompt_id: prompt.prompt_id,
463
+ avatar_url: baseAvatar.avatar_url,
464
+ avatar_real_id: baseAvatar.avatar_real_id,
465
+ });
466
+
467
+ if (result.cdn_url) {
468
+ console.log('[smartico] generation succeeded — preview this URL, then call setAvatar to apply it:', result.cdn_url);
469
+ // await window._smartico.api.setAvatar({ avatar_url: result.cdn_url, avatar_real_id: baseAvatar.avatar_real_id });
470
+ } else if (result.errCode === 12001) {
471
+ console.error('[smartico] user monthly limit reached — show "you have used all your custom avatars this month"');
472
+ } else if (result.errCode === 12002) {
473
+ console.error('[smartico] brand monthly pool exhausted — show "custom avatars are unavailable right now, try later"');
474
+ } else {
475
+ console.error('[smartico] generation failed (e.g. not enough balance) — let the user retry:', result.errMessage);
476
+ }
477
+ ```
478
+
479
+ ***
@@ -334,12 +334,10 @@ below.
334
334
  tournament requires the user to be in a clan first.
335
335
  - `1006` (`JOIN_CLAN_COOLDOWN_ACTIVE`) — user is inside the
336
336
  switch-cooldown window from a previous clan join (default
337
- 7 days, configurable per label). Surface the
337
+ 7 days, configurable per label). Only reachable when the user is
338
+ already in a *different* clan (this call is then a clan switch);
339
+ a first-time join never returns `1006`. Surface the
338
340
  `TClans.cooldown_until` expiry in the disabled CTA.
339
- - `1007` (`JOIN_CLAN_ARCHIVED`) — defined on the public enum but
340
- the server does NOT emit this code in practice (archived clans
341
- are reported as `1001`). Handle it as a synonym for `1001`
342
- defensively, but do not rely on it.
343
341
  - `1011` (`JOIN_CLAN_JOINED_AFTER_TOURNAMENT_START`) — this
344
342
  method does NOT return `1011` directly. The code fires on
345
343
  [registerInTournament](WSAPITournaments.md#registerintournament) responses when the user joined
@@ -13,7 +13,9 @@ monthly tabs.
13
13
 
14
14
  The leaderboard for each period type is configured separately by
15
15
  the operator. A label may have any combination of DAILY, WEEKLY,
16
- and MONTHLY boards configured (or none).
16
+ and MONTHLY boards configured (or none). To discover which boards
17
+ exist before loading any standings, call [getLeaderBoards](#getleaderboards)
18
+ (metadata only) and drive the tab selector from its `period_type_id`s.
17
19
 
18
20
  #### Parameters
19
21
 
@@ -29,12 +31,13 @@ The board's period type
29
31
 
30
32
  ##### getPreviousPeriod?
31
33
 
32
- `boolean`
34
+ `number` \| `boolean`
33
35
 
34
- When `true`, returns the most recent
35
- finalized snapshot for that period type
36
- (e.g. last week's results). Defaults to
37
- `false` (current in-progress period).
36
+ Which period to fetch. `false` (default)
37
+ = current in-progress period; `true` =
38
+ the most recent finalized snapshot; a
39
+ number `n` = the n-th previous snapshot
40
+ (`1` = previous, `2` = the one before, …).
38
41
 
39
42
  #### Returns
40
43
 
@@ -56,10 +59,13 @@ against that case in consumer code.
56
59
  Pass a `periodType` from [LeaderBoardPeriodType](../enumerations/LeaderBoardPeriodType.md)
57
60
  (`DAILY = 1`, `WEEKLY = 2`, `MONTHLY = 3`). Pass
58
61
  `getPreviousPeriod: true` to fetch the most-recently-ended
59
- period's snapshot (yesterday's results, last week's results,
60
- last month's results) instead of the current live period. The
61
- SDK only exposes one period back — older snapshots are not
62
- reachable through this method.
62
+ period's snapshot (yesterday's / last week's / last month's
63
+ results) instead of the current live period. To reach older
64
+ snapshots, pass a number instead of a boolean: `1` = previous
65
+ period, `2` = the one before that, and so on (`0` / `false` =
66
+ current). Use the snapshot's `create_date` / `version_id` to label
67
+ which historical run a previous-period board is. How far back
68
+ snapshots are retained is operator-configured.
63
69
 
64
70
  **Top-20 cap**
65
71
  The server hard-caps `users[]` at 20 entries, ordered by
@@ -147,3 +153,73 @@ console.log('[smartico] previous-week standings — render with greyed-out "ende
147
153
  ```
148
154
 
149
155
  ***
156
+
157
+ ### getLeaderBoards()
158
+
159
+ > **getLeaderBoards**(): `Promise`\<[`LeaderBoardDetailsT`](../interfaces/LeaderBoardDetailsT.md)[]\>
160
+
161
+ Returns the list of leaderboards the operator has configured for this
162
+ label — **metadata only, without participants**. Use it to discover
163
+ which boards exist (and their period types) so you can render the
164
+ board/tab selector, then load a specific board's standings on demand
165
+ with [getLeaderBoard](#getleaderboard).
166
+
167
+ This is the lightweight discovery counterpart to [getLeaderBoard](#getleaderboard):
168
+ it issues one round-trip that returns every board's identity, name,
169
+ description, rules, `period_type_id`, and prize table, but **not** the
170
+ ranked players. Fetching the full standings for one board (the top-20
171
+ `users[]` and the caller's own `me` entry) is what [getLeaderBoard](#getleaderboard)
172
+ does per period.
173
+
174
+ #### Returns
175
+
176
+ `Promise`\<[`LeaderBoardDetailsT`](../interfaces/LeaderBoardDetailsT.md)[]\>
177
+
178
+ Promise resolving to the array of configured boards
179
+ (metadata only). Empty array when none are configured.
180
+
181
+ #### Remarks
182
+
183
+ **Returned shape**
184
+ An array of `LeaderBoardDetailsT`, one per configured board, ordered by
185
+ `period_type_id` ascending (DAILY, WEEKLY, MONTHLY, …). On every entry
186
+ `users` is an empty array and `me` is `undefined` — this call never
187
+ carries participant data. Read `period_type_id` from each entry and pass
188
+ it to [getLeaderBoard](#getleaderboard) to load that board's standings.
189
+
190
+ **Empty result**
191
+ Resolves to an empty array when the label has no leaderboards configured
192
+ — treat that as "hide the leaderboard surface".
193
+
194
+ **Cache TTL**
195
+ Cached for 30 seconds under a dedicated key (independent of
196
+ [getLeaderBoard](#getleaderboard)'s per-period cache). Repeated calls within the
197
+ window return the cached list without a round-trip.
198
+
199
+ **Refresh model**: one-shot fetch — no subscription, no push. Board
200
+ configuration changes surface on the next cache miss.
201
+
202
+ **Idempotency / Side effects**: safe. Read-only.
203
+
204
+ **Visitor mode**: supported. Returns the brand's public board list.
205
+
206
+ #### Example
207
+
208
+ ```ts
209
+ const boards = await window._smartico.api.getLeaderBoards();
210
+
211
+ if (boards.length === 0) {
212
+ console.log('[smartico] no leaderboards configured — hide the leaderboard surface');
213
+ return;
214
+ }
215
+
216
+ // Render one tab per board from the lightweight list (no players yet).
217
+ console.log('[smartico] render leaderboard tabs:', boards.map(b => b.name));
218
+
219
+ // When the user opens a tab, load that board's standings on demand.
220
+ const first = boards[0];
221
+ const full = await window._smartico.api.getLeaderBoard(first.period_type_id);
222
+ console.log('[smartico] loaded standings for', first.name, '—', full?.users.length ?? 0, 'players');
223
+ ```
224
+
225
+ ***
@@ -108,6 +108,14 @@ login payload and (optionally) the language. Both are being consolidated into
108
108
  Logs the current user out, forgets the session, and reconnects as anonymous.
109
109
  Fires the `logout` callback on success.
110
110
 
111
+ ### `checkSuccessfullyIdentify()`
112
+
113
+ Returns `true` once the SDK is initialized **and** a user has been
114
+ successfully identified, `false` otherwise. Use it as a synchronous gate
115
+ before calling user-scoped `_smartico.api.*` methods (e.g. `getUserProfile()`),
116
+ as an alternative to waiting on the `identify` callback. Returns `false` in
117
+ visitor mode.
118
+
111
119
  ### `changeLanguage(language)`
112
120
 
113
121
  Switches the active language. The code is normalized to a 2-letter form
@@ -396,6 +404,13 @@ Returns `true` on mobile user agents.
396
404
  Parse the current page URL / URL hash into an object (helpers for reading
397
405
  query / hash parameters).
398
406
 
407
+ ### `sendServerError(message)` · `sendServerDebug(message)`
408
+
409
+ Forward a client-side message to Smartico's servers for support correlation —
410
+ `sendServerError` for error conditions, `sendServerDebug` for diagnostic
411
+ detail. Useful when reporting an integration issue so the message lands
412
+ alongside your session server-side. No-ops if the SDK isn't initialized.
413
+
399
414
  ---
400
415
 
401
416
  ## Setup notes
@@ -0,0 +1,21 @@
1
+ # Enumeration: AvatarCustomizeErrorCode
2
+
3
+ Limit error codes returned in `errCode` by the `avatarsCustomize` method.
4
+ See the `avatarsCustomize` TSDoc for the full table (including the generic
5
+ `-1` failure, which has no named member here).
6
+
7
+ ## Enumeration Members
8
+
9
+ ### AVATAR\_USER\_LIMIT
10
+
11
+ > **AVATAR\_USER\_LIMIT**: `12001`
12
+
13
+ The user has reached the operator-configured per-user monthly cap on custom-avatar generations.
14
+
15
+ ***
16
+
17
+ ### AVATAR\_LABEL\_LIMIT
18
+
19
+ > **AVATAR\_LABEL\_LIMIT**: `12002`
20
+
21
+ The brand's operator-configured shared monthly pool of custom-avatar generations is exhausted.
@@ -1,12 +1,17 @@
1
1
  # Enumeration: JoinClanErrorCode
2
2
 
3
+ Error codes returned in `errCode` by the `joinClan` method (also carried
4
+ on `TClanJoinResult`). These are terse value definitions for lookup; the
5
+ full per-code narrative and UI handling lives in the `joinClan` method
6
+ TSDoc, which owns the error table.
7
+
3
8
  ## Enumeration Members
4
9
 
5
10
  ### JOIN\_CLAN\_OK
6
11
 
7
12
  > **JOIN\_CLAN\_OK**: `0`
8
13
 
9
- No error, join completed
14
+ Success — join completed; entry fee (if any) deducted.
10
15
 
11
16
  ***
12
17
 
@@ -14,7 +19,7 @@ No error, join completed
14
19
 
15
20
  > **JOIN\_CLAN\_INVALID\_PARAMETERS**: `1000`
16
21
 
17
- Invalid parameters
22
+ Request was malformed (missing or invalid parameters).
18
23
 
19
24
  ***
20
25
 
@@ -22,7 +27,7 @@ Invalid parameters
22
27
 
23
28
  > **JOIN\_CLAN\_NOT\_FOUND**: `1001`
24
29
 
25
- clan_id doesn't exist for this label
30
+ Clan doesn't exist for this label. Archived clans are also reported as `1001`.
26
31
 
27
32
  ***
28
33
 
@@ -30,7 +35,7 @@ clan_id doesn't exist for this label
30
35
 
31
36
  > **JOIN\_CLAN\_FULL**: `1002`
32
37
 
33
- members_count >= capacity_limit
38
+ Clan is full — member capacity reached.
34
39
 
35
40
  ***
36
41
 
@@ -38,7 +43,7 @@ members_count >= capacity_limit
38
43
 
39
44
  > **JOIN\_CLAN\_INSUFFICIENT\_FUNDS**: `1003`
40
45
 
41
- Not enough Points / Gems / Diamonds for entry fee
46
+ Insufficient balance for the entry fee (points / gems / diamonds).
42
47
 
43
48
  ***
44
49
 
@@ -46,7 +51,7 @@ Not enough Points / Gems / Diamonds for entry fee
46
51
 
47
52
  > **JOIN\_CLAN\_SEGMENT\_MISMATCH**: `1004`
48
53
 
49
- User doesn't satisfy entry_conditions / entry_segment_id
54
+ User doesn't meet the clan's entry segment or conditions.
50
55
 
51
56
  ***
52
57
 
@@ -54,7 +59,8 @@ User doesn't satisfy entry_conditions / entry_segment_id
54
59
 
55
60
  > **JOIN\_CLAN\_USER\_IS\_NOT\_IN\_CLAN**: `1005`
56
61
 
57
- User is not in a clan
62
+ User is not in a clan. Note: a `registerInTournament` response code
63
+ that shares this enum — never returned by `joinClan`.
58
64
 
59
65
  ***
60
66
 
@@ -62,15 +68,7 @@ User is not in a clan
62
68
 
63
69
  > **JOIN\_CLAN\_COOLDOWN\_ACTIVE**: `1006`
64
70
 
65
- User is within the CLAN_COOLDOWN_DAYS window
66
-
67
- ***
68
-
69
- ### JOIN\_CLAN\_ARCHIVED
70
-
71
- > **JOIN\_CLAN\_ARCHIVED**: `1007`
72
-
73
- clan_status_id != 1 (clan is archived)
71
+ User is within the clan-switch cooldown window (switch only).
74
72
 
75
73
  ***
76
74
 
@@ -78,4 +76,5 @@ clan_status_id != 1 (clan is archived)
78
76
 
79
77
  > **JOIN\_CLAN\_JOINED\_AFTER\_TOURNAMENT\_START**: `1011`
80
78
 
81
- Clan joined after tournament start
79
+ Clan joined after tournament start. Note: a `registerInTournament`
80
+ response code that shares this enum — never returned by `joinClan`.
@@ -0,0 +1,31 @@
1
+ # Interface: AvatarCustomizeResponse
2
+
3
+ Result of `_smartico.api.avatarsCustomize()`. On success only `cdn_url` is
4
+ set; on failure only `errCode` / `errMessage`.
5
+
6
+ ## Properties
7
+
8
+ ### cdn\_url?
9
+
10
+ > `optional` **cdn\_url?**: `string`
11
+
12
+ CDN URL of the generated avatar variant. Present on success.
13
+
14
+ ***
15
+
16
+ ### errCode?
17
+
18
+ > `optional` **errCode?**: `number`
19
+
20
+ Error code. Present on failure. Typed values are members of
21
+ [AvatarCustomizeErrorCode](../enumerations/AvatarCustomizeErrorCode.md); `-1` is a generic failure. See the
22
+ `avatarsCustomize` TSDoc for the full table.
23
+
24
+ ***
25
+
26
+ ### errMessage?
27
+
28
+ > `optional` **errMessage?**: `string`
29
+
30
+ Optional error message. Present on failure; the generic (`-1`) message
31
+ is fixed text, so branch on `errCode`, not this string.
@@ -46,6 +46,24 @@ Period type this board is bound to ([LeaderBoardPeriodType](../enumerations/Lead
46
46
 
47
47
  ***
48
48
 
49
+ ### version\_id
50
+
51
+ > **version\_id**: `number`
52
+
53
+ Snapshot version. `0` for the live current period; a positive value
54
+ identifies a finalized previous-period snapshot (see `getPreviousPeriod`).
55
+
56
+ ***
57
+
58
+ ### create\_date
59
+
60
+ > **create\_date**: `number`
61
+
62
+ Snapshot creation timestamp (Unix ms). `0` for the live current period;
63
+ the finalization time for a previous-period snapshot.
64
+
65
+ ***
66
+
49
67
  ### rewards
50
68
 
51
69
  > **rewards**: [`LeaderBoardsRewardsT`](LeaderBoardsRewardsT.md)[]
@@ -59,6 +77,7 @@ Per-place prize table; the array length is the number of paid places.
59
77
  > **users**: [`LeaderBoardUserT`](LeaderBoardUserT.md)[]
60
78
 
61
79
  Top-20 ranked entries (server-capped), sorted by `position` ASC.
80
+ Empty when fetched via `getLeaderBoards()` (metadata-only list).
62
81
 
63
82
  ***
64
83
 
@@ -16,7 +16,18 @@ Display username (operator-defined alias).
16
16
 
17
17
  > **avatar\_url**: `string`
18
18
 
19
- Resolved CDN URL for the participant's avatar.
19
+ Resolved CDN URL for the participant's avatar. May be empty when the
20
+ participant has no custom avatar — fall back to a level-based default
21
+ using `level_id`.
22
+
23
+ ***
24
+
25
+ ### level\_id
26
+
27
+ > **level\_id**: `number`
28
+
29
+ The participant's level id — use it to resolve a level-based default
30
+ avatar when `avatar_url` is empty.
20
31
 
21
32
  ***
22
33
 
@@ -41,4 +52,5 @@ Participant's points for this period.
41
52
 
42
53
  > **is\_me**: `boolean`
43
54
 
44
- `true` when this row is the current authenticated user.
55
+ `true` when this row is the current authenticated user. Always `true`
56
+ on the `me` entry.
@@ -33,7 +33,7 @@ Absolute CDN URL of the prompt's preview icon.
33
33
 
34
34
  > **cost\_currency\_type\_id**: `number`
35
35
 
36
- Currency used to pay for the customization. `0` = points, `1` = gems, `2` = diamonds.
36
+ Currency used to pay for the customization. `0` = points, `1` = gems, `2` = diamonds, `3` = free. A `cost_value` of `0` is also free.
37
37
 
38
38
  ***
39
39
 
@@ -41,4 +41,4 @@ Currency used to pay for the customization. `0` = points, `1` = gems, `2` = diam
41
41
 
42
42
  > **cost\_value**: `number`
43
43
 
44
- Cost amount in the currency named by `cost_currency_type_id`.
44
+ Cost amount in the currency named by `cost_currency_type_id`. `0` = free.
@@ -44,6 +44,22 @@ Reward for completing the task in points
44
44
 
45
45
  ***
46
46
 
47
+ ### gems\_reward?
48
+
49
+ > `optional` **gems\_reward?**: `number`
50
+
51
+ Reward for completing the task in gems
52
+
53
+ ***
54
+
55
+ ### diamonds\_reward?
56
+
57
+ > `optional` **diamonds\_reward?**: `number`
58
+
59
+ Reward for completing the task in diamonds
60
+
61
+ ***
62
+
47
63
  ### execution\_count\_expected?
48
64
 
49
65
  > `optional` **execution\_count\_expected?**: `number`
@@ -20,6 +20,22 @@
20
20
 
21
21
  ***
22
22
 
23
+ ### gems\_reward?
24
+
25
+ > `optional` **gems\_reward?**: `number`
26
+
27
+ Gems awarded when this task is completed.
28
+
29
+ ***
30
+
31
+ ### diamonds\_reward?
32
+
33
+ > `optional` **diamonds\_reward?**: `number`
34
+
35
+ Diamonds awarded when this task is completed.
36
+
37
+ ***
38
+
23
39
  ### task\_type\_id
24
40
 
25
41
  > **task\_type\_id**: [`AchievementTaskType`](../enumerations/AchievementTaskType.md)