@smartico/public-api 0.0.379 → 0.0.381

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 (219) hide show
  1. package/.nvmrc +1 -1
  2. package/CLAUDE.md +103 -0
  3. package/README.md +53 -2
  4. package/dist/Base/ClassId.d.ts +2 -0
  5. package/dist/Jackpots/JackpotDetails.d.ts +14 -15
  6. package/dist/Jackpots/JackpotPot.d.ts +10 -6
  7. package/dist/Raffle/GetRaffleWonPrizesRequest.d.ts +9 -0
  8. package/dist/Raffle/GetRaffleWonPrizesResponse.d.ts +52 -0
  9. package/dist/Raffle/index.d.ts +2 -0
  10. package/dist/SmarticoAPI.d.ts +6 -1
  11. package/dist/SmarticoLib/index.d.ts +5 -1
  12. package/dist/Store/BuyStoreItemErrorCode.d.ts +9 -1
  13. package/dist/Tournaments/TournamentRegistrationError.d.ts +3 -1
  14. package/dist/WSAPI/WSAPI.d.ts +13 -1235
  15. package/dist/WSAPI/WSAPIAvatars.d.ts +296 -0
  16. package/dist/WSAPI/WSAPIBase.d.ts +71 -0
  17. package/dist/WSAPI/WSAPIBonuses.d.ts +240 -0
  18. package/dist/WSAPI/WSAPIClans.d.ts +388 -0
  19. package/dist/WSAPI/WSAPIGamePick.d.ts +593 -0
  20. package/dist/WSAPI/WSAPIGeneral.d.ts +172 -0
  21. package/dist/WSAPI/WSAPIInbox.d.ts +615 -0
  22. package/dist/WSAPI/WSAPIJackpots.d.ts +344 -0
  23. package/dist/WSAPI/WSAPILeaderBoard.d.ts +139 -0
  24. package/dist/WSAPI/WSAPIMiniGames.d.ts +510 -0
  25. package/dist/WSAPI/WSAPIMissions.d.ts +517 -0
  26. package/dist/WSAPI/WSAPIRaffles.d.ts +643 -0
  27. package/dist/WSAPI/WSAPIStore.d.ts +656 -0
  28. package/dist/WSAPI/WSAPITournaments.d.ts +501 -0
  29. package/dist/WSAPI/WSAPITypes.d.ts +376 -205
  30. package/dist/WSAPI/WSAPIUser.d.ts +533 -0
  31. package/dist/index.js +6745 -1661
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.modern.mjs +6324 -1342
  34. package/dist/index.modern.mjs.map +1 -1
  35. package/docs/Callbacks.md +162 -0
  36. package/docs/SmarticoObject.md +445 -0
  37. package/docs/Transforms.md +99 -0
  38. package/docs/api/README.md +82 -2
  39. package/docs/api/classes/WSAPIAvatars.md +344 -0
  40. package/docs/api/classes/WSAPIBonuses.md +271 -0
  41. package/docs/api/classes/WSAPIClans.md +436 -0
  42. package/docs/api/classes/WSAPIGamePick.md +710 -0
  43. package/docs/api/classes/WSAPIGeneral.md +212 -0
  44. package/docs/api/classes/WSAPIInbox.md +801 -0
  45. package/docs/api/classes/WSAPIJackpots.md +439 -0
  46. package/docs/api/classes/WSAPILeaderBoard.md +157 -0
  47. package/docs/api/classes/WSAPIMiniGames.md +612 -0
  48. package/docs/api/classes/WSAPIMissions.md +590 -0
  49. package/docs/api/classes/WSAPIRaffles.md +773 -0
  50. package/docs/api/classes/WSAPIStore.md +719 -0
  51. package/docs/api/classes/WSAPITournaments.md +571 -0
  52. package/docs/api/classes/WSAPIUser.md +637 -0
  53. package/docs/api/documents/Callbacks.md +162 -0
  54. package/docs/api/documents/SmarticoObject.md +445 -0
  55. package/docs/api/documents/Transforms.md +99 -0
  56. package/docs/api/enumerations/AchievementClaimPeriodTypeId.md +13 -0
  57. package/docs/api/enumerations/BonusStatus-1.md +11 -6
  58. package/docs/api/enumerations/BuyStoreItemErrorCode.md +32 -0
  59. package/docs/api/enumerations/JoinClanErrorCode.md +81 -0
  60. package/docs/api/enumerations/TournamentRegistrationError.md +12 -0
  61. package/docs/api/functions/clanTournamentPlayersTransform.md +13 -0
  62. package/docs/api/interfaces/AvatarCustomized.md +25 -0
  63. package/docs/api/interfaces/AvatarDefinition.md +94 -0
  64. package/docs/api/interfaces/AvatarPrompt.md +45 -0
  65. package/docs/api/interfaces/BonusMetaMap-1.md +4 -1
  66. package/docs/api/interfaces/BonusTemplateMetaMap-1.md +9 -4
  67. package/docs/api/interfaces/Clan.md +4 -0
  68. package/docs/api/interfaces/ClanInfo.md +109 -0
  69. package/docs/api/interfaces/ClanMember.md +53 -0
  70. package/docs/api/interfaces/ClanPrizePublicMeta.md +41 -0
  71. package/docs/api/interfaces/ClanPrizeStructureEntry.md +7 -1
  72. package/docs/api/interfaces/ClanPublicMeta.md +4 -0
  73. package/docs/api/interfaces/ClanTournamentPlayerRaw.md +67 -0
  74. package/docs/api/interfaces/GemsDiamondsLog.md +43 -0
  75. package/docs/api/interfaces/GetClanInfoResponse.md +61 -0
  76. package/docs/api/interfaces/GetClanTournamentPlayersResponse.md +81 -0
  77. package/docs/api/interfaces/GetRaffleWonPrizesRequest.md +59 -0
  78. package/docs/api/interfaces/GetRaffleWonPrizesResponse.md +95 -0
  79. package/docs/api/interfaces/InboxMarkMessageAction.md +10 -2
  80. package/docs/api/interfaces/JackpotDetails.md +14 -15
  81. package/docs/api/interfaces/JackpotPot.md +9 -6
  82. package/docs/api/interfaces/LeaderBoardDetailsT.md +14 -8
  83. package/docs/api/interfaces/LeaderBoardUserT.md +8 -5
  84. package/docs/api/interfaces/LeaderBoardsRewardsT.md +7 -0
  85. package/docs/api/interfaces/PointsLog.md +43 -0
  86. package/docs/api/interfaces/RaffleWonPrize.md +59 -0
  87. package/docs/api/interfaces/RaffleWonPrizePublicMeta.md +27 -0
  88. package/docs/api/interfaces/RaffleWonPrizeUser.md +43 -0
  89. package/docs/api/interfaces/SAWTemplateUI.md +10 -0
  90. package/docs/api/interfaces/TAchCategory.md +14 -4
  91. package/docs/api/interfaces/TAvatarCustomized.md +4 -4
  92. package/docs/api/interfaces/TAvatarDefinition.md +13 -14
  93. package/docs/api/interfaces/TAvatarPrompt.md +6 -6
  94. package/docs/api/interfaces/TBonus.md +16 -8
  95. package/docs/api/interfaces/TBuyStoreItemResult.md +4 -11
  96. package/docs/api/interfaces/TClaimBonusResult.md +5 -5
  97. package/docs/api/interfaces/TClan.md +8 -4
  98. package/docs/api/interfaces/TClanInfo.md +47 -0
  99. package/docs/api/interfaces/TClanJoinResult.md +11 -1
  100. package/docs/api/interfaces/TClanTournamentPlayer.md +55 -0
  101. package/docs/api/interfaces/TClanTournamentPlayersResult.md +27 -0
  102. package/docs/api/interfaces/TClans.md +3 -1
  103. package/docs/api/interfaces/TGetTranslations.md +4 -0
  104. package/docs/api/interfaces/TInboxMessage.md +14 -6
  105. package/docs/api/interfaces/TInboxMessageBody.md +18 -12
  106. package/docs/api/interfaces/TLevel.md +17 -20
  107. package/docs/api/interfaces/TLevelCurrent.md +19 -18
  108. package/docs/api/interfaces/TMiniGamePlayBatchResult.md +14 -6
  109. package/docs/api/interfaces/TMiniGamePlayResult.md +9 -4
  110. package/docs/api/interfaces/TMissionClaimRewardResult.md +6 -3
  111. package/docs/api/interfaces/TMissionOptInResult.md +6 -3
  112. package/docs/api/interfaces/TMissionOrBadge.md +5 -4
  113. package/docs/api/interfaces/TRaffleOptinResponse.md +4 -2
  114. package/docs/api/interfaces/TSegmentCheckResult.md +10 -0
  115. package/docs/api/interfaces/TSetAvatarResult.md +3 -3
  116. package/docs/api/interfaces/TStoreItem.md +11 -1
  117. package/docs/api/interfaces/TTournament.md +1 -1
  118. package/docs/api/interfaces/TTournamentDetailed.md +9 -1
  119. package/docs/api/interfaces/TTournamentRegistrationResult.md +4 -2
  120. package/docs/api/interfaces/TUICustomSection.md +23 -19
  121. package/docs/api/interfaces/TUserProfile.md +18 -16
  122. package/docs/api/interfaces/TransformedRaffleClaimPrizeResponse.md +6 -2
  123. package/docs/api/interfaces/UserAchievement.md +1 -1
  124. package/docs/api/interfaces/UserLevelExtraCountersT.md +9 -2
  125. package/docs/api/type-aliases/ActivityLogEntry.md +3 -0
  126. package/docs/native/ADDING_METHODS.md +7 -2
  127. package/docs/native/PROTOCOL.md +337 -0
  128. package/docs/ui/avatars/UIGuide_getAvatarPrompts.md +100 -0
  129. package/docs/ui/avatars/UIGuide_getAvatarsCustomized.md +90 -0
  130. package/docs/ui/avatars/UIGuide_getAvatarsList.md +105 -0
  131. package/docs/ui/avatars/UIGuide_setAvatar.md +118 -0
  132. package/docs/ui/bonuses/UIGuide_claimBonus.md +144 -0
  133. package/docs/ui/bonuses/UIGuide_getBonuses.md +176 -0
  134. package/docs/ui/clans/UIGuide_getClanInfo.md +153 -0
  135. package/docs/ui/clans/UIGuide_getClans.md +172 -0
  136. package/docs/ui/clans/UIGuide_joinClan.md +196 -0
  137. package/docs/ui/gamepick/UIGuide_gamePickGetActiveRound.md +99 -0
  138. package/docs/ui/gamepick/UIGuide_gamePickGetActiveRounds.md +76 -0
  139. package/docs/ui/gamepick/UIGuide_gamePickGetBoard.md +81 -0
  140. package/docs/ui/gamepick/UIGuide_gamePickGetGameInfo.md +78 -0
  141. package/docs/ui/gamepick/UIGuide_gamePickGetHistory.md +55 -0
  142. package/docs/ui/gamepick/UIGuide_gamePickGetRoundInfoForUser.md +71 -0
  143. package/docs/ui/gamepick/UIGuide_gamePickGetUserInfo.md +64 -0
  144. package/docs/ui/gamepick/UIGuide_gamePickSubmitSelection.md +103 -0
  145. package/docs/ui/gamepick/UIGuide_gamePickSubmitSelectionQuiz.md +67 -0
  146. package/docs/ui/general/UIGuide_getCustomSections.md +137 -0
  147. package/docs/ui/general/UIGuide_getRelatedItemsForGame.md +140 -0
  148. package/docs/ui/inbox/UIGuide_deleteInboxMessage.md +135 -0
  149. package/docs/ui/inbox/UIGuide_getInboxMessageBody.md +133 -0
  150. package/docs/ui/inbox/UIGuide_getInboxMessages.md +186 -0
  151. package/docs/ui/inbox/UIGuide_markInboxMessageAsRead.md +122 -0
  152. package/docs/ui/inbox/UIGuide_markUnmarkInboxMessageAsFavorite.md +84 -0
  153. package/docs/ui/jackpots/UIGuide_getJackpotEligibleGames.md +73 -0
  154. package/docs/ui/jackpots/UIGuide_getJackpotWinners.md +83 -0
  155. package/docs/ui/jackpots/UIGuide_jackpotGet.md +138 -0
  156. package/docs/ui/jackpots/UIGuide_jackpotOptIn.md +85 -0
  157. package/docs/ui/jackpots/UIGuide_jackpotOptOut.md +65 -0
  158. package/docs/ui/leaderboard/UIGuide_getLeaderBoard.md +166 -0
  159. package/docs/ui/minigames/UIGuide_getMiniGames.md +153 -0
  160. package/docs/ui/minigames/UIGuide_getMiniGamesHistory.md +90 -0
  161. package/docs/ui/minigames/UIGuide_playMiniGame.md +150 -0
  162. package/docs/ui/minigames/UIGuide_playMiniGameBatch.md +128 -0
  163. package/docs/ui/missions/UIGuide_getAchCategories.md +17 -0
  164. package/docs/ui/missions/UIGuide_getBadges.md +237 -0
  165. package/docs/ui/missions/UIGuide_getMissions.md +268 -0
  166. package/docs/ui/missions/UIGuide_requestMissionClaimReward.md +21 -0
  167. package/docs/ui/missions/UIGuide_requestMissionOptIn.md +16 -0
  168. package/docs/ui/raffles/UIGuide_claimRafflePrize.md +99 -0
  169. package/docs/ui/raffles/UIGuide_getRaffleDrawRun.md +117 -0
  170. package/docs/ui/raffles/UIGuide_getRaffleDrawRunsHistory.md +92 -0
  171. package/docs/ui/raffles/UIGuide_getRaffleWonPrizes.md +120 -0
  172. package/docs/ui/raffles/UIGuide_getRaffles.md +175 -0
  173. package/docs/ui/raffles/UIGuide_requestRaffleOptin.md +114 -0
  174. package/docs/ui/store/UIGuide_buyStoreItem.md +133 -0
  175. package/docs/ui/store/UIGuide_getStoreCategories.md +19 -0
  176. package/docs/ui/store/UIGuide_getStoreItems.md +264 -0
  177. package/docs/ui/store/UIGuide_getStorePurchasedItems.md +122 -0
  178. package/docs/ui/tournaments/UIGuide_getClanTournamentPlayers.md +140 -0
  179. package/docs/ui/tournaments/UIGuide_getTournamentInstanceInfo.md +265 -0
  180. package/docs/ui/tournaments/UIGuide_getTournamentsList.md +236 -0
  181. package/docs/ui/tournaments/UIGuide_registerInTournament.md +156 -0
  182. package/docs/ui/user/UIGuide_getActivityLog.md +130 -0
  183. package/docs/ui/user/UIGuide_getLevels.md +167 -0
  184. package/docs/ui/user/UIGuide_getUserProfile.md +213 -0
  185. package/package.json +3 -3
  186. package/scripts/postdoc-cleanup.js +195 -0
  187. package/src/Base/ClassId.ts +2 -0
  188. package/src/Jackpots/JackpotDetails.ts +14 -15
  189. package/src/Jackpots/JackpotPot.ts +10 -6
  190. package/src/Missions/MissionsUtils.ts +5 -2
  191. package/src/Raffle/GetRaffleWonPrizesRequest.ts +12 -0
  192. package/src/Raffle/GetRaffleWonPrizesResponse.ts +56 -0
  193. package/src/Raffle/index.ts +3 -1
  194. package/src/SmarticoAPI.ts +14 -1
  195. package/src/SmarticoLib/index.ts +4 -0
  196. package/src/Store/BuyStoreItemErrorCode.ts +8 -0
  197. package/src/Store/StoreItem.ts +1 -0
  198. package/src/Store/StoreItemPurchased.ts +1 -0
  199. package/src/Store/StoreItemType.ts +1 -1
  200. package/src/Tournaments/TournamentRegistrationError.ts +4 -0
  201. package/src/WSAPI/WSAPI.ts +27 -2007
  202. package/src/WSAPI/WSAPIAvatars.ts +345 -0
  203. package/src/WSAPI/WSAPIBase.ts +93 -0
  204. package/src/WSAPI/WSAPIBonuses.ts +268 -0
  205. package/src/WSAPI/WSAPIClans.ts +417 -0
  206. package/src/WSAPI/WSAPIGamePick.ts +667 -0
  207. package/src/WSAPI/WSAPIGeneral.ts +199 -0
  208. package/src/WSAPI/WSAPIInbox.ts +711 -0
  209. package/src/WSAPI/WSAPIJackpots.ts +448 -0
  210. package/src/WSAPI/WSAPILeaderBoard.ts +154 -0
  211. package/src/WSAPI/WSAPIMiniGames.ts +597 -0
  212. package/src/WSAPI/WSAPIMissions.ts +572 -0
  213. package/src/WSAPI/WSAPIRaffles.ts +703 -0
  214. package/src/WSAPI/WSAPIStore.ts +732 -0
  215. package/src/WSAPI/WSAPITournaments.ts +541 -0
  216. package/src/WSAPI/WSAPITypes.ts +376 -207
  217. package/src/WSAPI/WSAPIUser.ts +606 -0
  218. package/tsconfig.json +26 -2
  219. package/docs/api/classes/WSAPI.md +0 -1927
@@ -88,30 +88,43 @@ export interface TMiniGamePrize {
88
88
  }
89
89
 
90
90
  /**
91
- * TMiniGamePlayResult describes the response of call to _smartico.api.playMiniGame(template_id) method
91
+ * TMiniGamePlayResult describes the response of
92
+ * `_smartico.api.playMiniGame(template_id)`.
92
93
  */
93
94
  export interface TMiniGamePlayResult {
94
- /** Error code that represents outcome of the game play attempt. Game succeed to be played in case err_code is 0 */
95
+ /** Error code. `0` = success ({@link SAWSpinErrorCode.SAW_OK}).
96
+ * See `playMiniGame` TSDoc for the full table. */
95
97
  err_code: SAWSpinErrorCode;
96
- /** Optional error message */
98
+ /** Optional server-side error message. Present only on non-zero
99
+ * `err_code`; may be empty even then. */
97
100
  err_message: string;
98
- /** The prize_id that user won, details of the prize can be found in the mini-game definition */
101
+ /** ID of the won prize. Look up in `template.prizes` to interpret
102
+ * (including `prize_type === 'no-prize'` for a configured loss
103
+ * slot). Always populated, even when `err_code !== 0`. */
99
104
  prize_id: number;
100
105
  }
101
106
 
102
107
  /**
103
- * TMiniGamePlayBatchResult describes the response of call to _smartico.api.playMiniGameBatch(template_id, spin_count) method
108
+ * TMiniGamePlayBatchResult describes one entry in the array returned
109
+ * by `_smartico.api.playMiniGameBatch(template_id, spin_count)`.
110
+ *
111
+ * Note: this type uses `errCode` / `errMessage` (camelCase) —
112
+ * different from `TMiniGamePlayResult` which uses `err_code` /
113
+ * `err_message` (snake_case).
104
114
  */
105
115
  export interface TMiniGamePlayBatchResult {
106
- /** The saw_prize_id that user won, details of the prize can be found in the mini-game definition */
116
+ /** ID of the won prize for this spin. Look up in `template.prizes`. */
107
117
  saw_prize_id: number;
108
- /** Error code that represents outcome of the game play attempt. Game succeed to be played in case err_code is 0 */
118
+ /** Error code. `0` = success. See `playMiniGameBatch` TSDoc for the
119
+ * full table. */
109
120
  errCode: SAWSpinErrorCode;
110
- /** Optional error message */
121
+ /** Optional server-side error message. */
111
122
  errMessage?: string;
112
- /** Jackpot amount what user won */
123
+ /** Jackpot amount the user won, populated when the prize type is
124
+ * `'jackpot'`. */
113
125
  jackpot_amount?: number;
114
- /** Period in miliseconds from last spin */
126
+ /** Epoch ms of the user's first spin in the current cooldown
127
+ * period; populated when `errCode === SAWSpinErrorCode.SAW_FAILED_MAX_SPINS_REACHED`. */
115
128
  first_spin_in_period?: number,
116
129
  }
117
130
 
@@ -212,89 +225,78 @@ export interface TMiniGameTemplate {
212
225
  */
213
226
 
214
227
  export interface TUserProfile {
215
- /** The language of the user */
228
+ /** Language code stored server-side for the user (e.g. `"en"`, `"de"`). */
216
229
  core_user_language: string;
217
- /** The current points balance that user can use in the Store, Mini-games, Tournaments, etc.. */
230
+ /** Current spendable points balance — decremented by store purchases,
231
+ * tournament buy-ins, and clan entry fees. */
218
232
  ach_points_balance: number;
219
- /** The amount of points that user collected in total */
233
+ /** All-time cumulative points earned. Monotonic — NOT decremented by
234
+ * store purchases or clan/tournament fees. */
220
235
  ach_points_ever: number;
221
- /** The current gems balance */
236
+ /** Current gems balance (secondary currency). */
222
237
  ach_gems_balance: number;
223
- /** The current diamonds balance */
238
+ /** Current diamonds balance (tertiary currency). */
224
239
  ach_diamonds_balance: number;
225
- /**
226
- * The array of the public tags set on the user object.
227
- * They can be treated as server-based cookies.
228
- * You can set tags using following method _smartico.event('core_public_tags_update', { core_public_tags: ['A', 'B'] } );
229
- * And then you can check for the tags
230
- */
240
+ /** Server-stored public tags on the user (uppercase strings).
241
+ * Modify via `_smartico.updatePublicTags(operation, tags)`. */
231
242
  core_public_tags: string[];
232
- /** The ID of the current level of the user */
243
+ /** FK into the level ladder; resolve via `getCurrentLevel()` or `getLevels()`. */
233
244
  ach_level_current_id?: number;
234
- /** The indicator if user is marked as test user */
245
+ /** `true` when the user is flagged as a test account. */
235
246
  core_is_test_account?: boolean;
236
- /** The URL to the user avatar */
247
+ /** Resolved CDN URL for the user's avatar. */
237
248
  avatar_url?: string;
238
- /** The username of current user */
249
+ /** Display username (operator-defined alias). */
239
250
  public_username?: string;
240
- /** THe number of unread inbox messages */
251
+ /** Unread inbox messages count. Push-updated in real time. */
241
252
  core_inbox_unread_count?: number;
242
- /** The recommended deposit amount for the user */
253
+ /** AI-recommended deposit amount for this user. Undefined when no
254
+ * recommendation is currently available. */
243
255
  core_recommended_deposit_amount?: number;
244
- /** The recommended casino bet amount for the user */
256
+ /** AI-recommended casino bet amount for this user. Undefined when no
257
+ * recommendation is currently available. */
245
258
  core_recommended_casino_bet_amount?: number;
246
259
  }
247
260
 
248
261
  /**
249
- * TLevel describes the information of each level defined in the system
250
- * There is no order of the levels, but it can be calculated using required_points property
251
- * The current level of user can be taken from the user object using ach_level_current_id property
252
- * The progress to the next level can be calculated using ach_points_ever and required_points properties of next level
262
+ * TLevel describes one level in the label's level ladder.
263
+ * Returned by `_smartico.api.getLevels()` (already sorted by `required_points` ASC).
253
264
  */
254
265
  export interface TLevel {
255
- /** The ID of the Level */
266
+ /** Stable ID of the level. */
256
267
  id: number;
257
- /** The name of the Level, translated to the user language */
268
+ /** Display name of the level, pre-translated to the user's language. */
258
269
  name: string;
259
- /** The description of the Level, translated to the user language */
270
+ /** Display description of the level, pre-translated to the user's language. */
260
271
  description: string;
261
- /** The URL of the image of the Level, 256x256px */
272
+ /** URL of the level image (256x256 px source). */
262
273
  image: string;
263
- /** The amount of points required to reach the Level */
274
+ /** Total `ach_points_ever` required to reach this level. */
264
275
  required_points: number;
265
- /** Number of points that user should collect in order to see this level */
276
+ /** Visibility threshold — clients hide the level from the user until
277
+ * `ach_points_ever >= visibility_points`. `null` means always visible. */
266
278
  visibility_points: number;
267
- /**
268
- * The counter of 1st metric used to reach the Level.
269
- * Relevant in case of using advanced leveling logic
270
- * https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
271
- *
272
- */
279
+ /** Required value of the first level counter for sliding-window leveling.
280
+ * `null` on points-only labels. See `UserLevelExtraCountersT`. */
273
281
  required_level_counter_1: number;
274
- /**
275
- * The counter of 2nd metric used to reach the Level.
276
- * Relevant in case of using advanced leveling logic
277
- * https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
278
- *
279
- */
282
+ /** Required value of the second level counter for sliding-window leveling.
283
+ * `null` on points-only labels. */
280
284
  required_level_counter_2: number;
281
-
282
- /**
283
- * Custom data as string or JSON string that can be used in API to build custom UI
284
- * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
285
- * Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
286
- */
285
+ /** Operator-defined custom data. The SDK auto-parses JSON-looking
286
+ * strings, so at runtime this is `any` despite the `string` type. */
287
287
  custom_data: string;
288
- /** The ordinal position of the level */
288
+ /** 1-based position in the ladder (matches the order of the returned
289
+ * array, which is sorted by `required_points` ASC). */
289
290
  ordinal_position: number;
290
291
  }
291
292
 
292
293
  /**
293
- * TLevelCurrent describes the information of each level defined in the system along with ordinal position and progress of the current level
294
+ * TLevelCurrent extends `TLevel` with the user's progress toward the next level.
295
+ * Returned by `_smartico.api.getCurrentLevel()`.
294
296
  */
295
-
296
297
  export interface TLevelCurrent extends TLevel {
297
- /** The progress of the user towards next level in the percents to complete */
298
+ /** Progress to the next level as a 0–100 integer percentage. `100`
299
+ * at the highest level. */
298
300
  progress: number;
299
301
  }
300
302
 
@@ -326,7 +328,7 @@ export interface TTournament {
326
328
  segment_dont_match_message: string;
327
329
  /**
328
330
  * The ID of the custom section where the tournament is assigned
329
- * The list of custom sections can be retrieved using _smartico.api.getCustomSections() method (TODO-API)
331
+ * The list of custom sections can be retrieved using _smartico.api.getCustomSections() method
330
332
  */
331
333
  custom_section_id: number;
332
334
  /** The custom data of the tournament defined by operator. Can be a JSON object, string or number */
@@ -557,13 +559,17 @@ export interface TClan {
557
559
  member_count: number;
558
560
  /** Max number of members allowed in clan */
559
561
  capacity_limit: number;
560
- /** ShopPurchaseType: 0=Points, 1=Gems, 2=Diamonds, 3=Free */
562
+ /** Currency type for `entry_fee_amount`. `0` = points, `1` = gems,
563
+ * `2` = diamonds, `3` = free (no fee). */
561
564
  entry_fee_currency_type_id: number;
562
- /** Numeric value for entry fee */
565
+ /** Entry fee amount in the currency indicated by `entry_fee_currency_type_id`.
566
+ * `0` (or `entry_fee_currency_type_id === 3`) means the clan is free to join. */
563
567
  entry_fee_amount: number;
564
- /** F1 rank ASC, 1=best */
568
+ /** Global rank among all active clans in the label, by `rating_score` DESC.
569
+ * `1` = highest-rated. May skip positions when some clans are hidden by
570
+ * per-user visibility (e.g. user sees positions 1, 3, 7). */
565
571
  rating_position: number;
566
- /** Clan rating score */
572
+ /** Clan rating score (higher is better). */
567
573
  rating_score: number;
568
574
  }
569
575
 
@@ -575,7 +581,9 @@ export interface TClans {
575
581
  clans: TClan[];
576
582
  /** The clan ID the current user belongs to; null if clanless */
577
583
  user_clan_id: number | null;
578
- /** Cooldown-until date string; null if no cooldown */
584
+ /** Switch-cooldown expiry as ISO 8601 UTC string ("YYYY-MM-DDTHH:MM:SS"
585
+ * with no timezone suffix; interpret as UTC). `null` when no cooldown.
586
+ * User-level: while set, the user cannot join any clan. */
579
587
  cooldown_until: string | null;
580
588
  /** Epoch ms when the current user joined their clan; null if clanless */
581
589
  join_date: number | null;
@@ -583,35 +591,71 @@ export interface TClans {
583
591
 
584
592
  /**
585
593
  * TClanInfo describes the detailed info of a single clan including its members.
594
+ * Returned by `_smartico.api.getClanInfo(clanId)`.
586
595
  */
587
596
  export interface TClanInfo {
597
+ /** Clan ID. */
588
598
  clan_id: number;
599
+ /** Translated clan metadata (name, description, image URL). */
589
600
  public_meta: { name: string; description: string; image_url: string };
601
+ /** Current number of members in clan. */
590
602
  member_count: number;
603
+ /** Max number of members allowed in clan. */
591
604
  capacity_limit: number;
605
+ /** Currency type for `entry_fee_amount`. `0` = points, `1` = gems,
606
+ * `2` = diamonds, `3` = free. */
592
607
  entry_fee_currency_type_id: number;
608
+ /** Entry fee amount in the currency indicated by `entry_fee_currency_type_id`. */
593
609
  entry_fee_amount: number;
610
+ /** Global rank among all active clans in the label, by `rating_score` DESC.
611
+ * `1` = highest-rated. */
594
612
  rating_position: number;
613
+ /** Clan rating score (higher is better). */
595
614
  rating_score: number;
615
+ /** User-level switch-cooldown expiry as ISO 8601 UTC string
616
+ * ("YYYY-MM-DDTHH:MM:SS" with no timezone suffix). `null` when no
617
+ * cooldown. Same semantic as `TClans.cooldown_until` but always fresh
618
+ * (the list version may be up to 30 s stale). */
596
619
  cooldown_until: string | null;
620
+ /** Members of this clan, server-ordered by `contribution_score` DESC
621
+ * (i.e. `position` ASC). */
597
622
  members: {
623
+ /** Member's internal user ID. */
598
624
  user_id: number;
625
+ /** Member's display username. */
599
626
  public_username: string;
627
+ /** Avatar identifier; resolve via `avatar_url` below or rebuild
628
+ * from `avatar_id` + brand avatar domain. */
600
629
  avatar_id: string;
630
+ /** Numeric avatar ID (alternative identifier). */
601
631
  avatar_real_id: number;
632
+ /** Pre-resolved CDN URL for the avatar. */
602
633
  avatar_url?: string;
634
+ /** Member's rank within this clan; `1` = top contributor. */
603
635
  position: number;
636
+ /** Member's contribution to the clan rating score. */
604
637
  contribution_score: number;
638
+ /** `true` when this row is the current authenticated user. */
605
639
  is_me?: boolean;
640
+ /** External user identifier (operator-provided alias);
641
+ * preferred over `public_username` on some surfaces. */
606
642
  clean_ext_user_id?: string;
607
643
  }[];
608
644
  }
609
645
 
610
646
  /**
611
- * TClanJoinResult describes the result of a join clan request.
647
+ * TClanJoinResult describes the result of a join-clan request.
648
+ * Note: this type uses `errCode` / `errMsg` (camelCase) — different
649
+ * from most other SDK result types in this library which use
650
+ * `err_code` / `err_message` (snake_case).
612
651
  */
613
652
  export interface TClanJoinResult {
653
+ /** Error code. `0` = success. Typed values are members of
654
+ * {@link JoinClanErrorCode}. See `joinClan` TSDoc for the full
655
+ * table and per-code UI guidance. */
614
656
  errCode: number;
657
+ /** Optional server-side error message. Present only on non-zero
658
+ * `errCode`; may be empty even then. */
615
659
  errMsg: string;
616
660
  }
617
661
 
@@ -668,7 +712,9 @@ export interface TStoreItem {
668
712
  can_buy: boolean;
669
713
  /** The list of IDs of the categories where the store item is assigned, information about categories can be retrieved with getStoreCategories method */
670
714
  category_ids: number[];
671
- /** Number of items in the pool avaliable for the purchase.*/
715
+ /** Items remaining in the pool available for purchase. `null` = unlimited
716
+ * supply. Positive integer = remaining stock. `0` = sold out but still
717
+ * returned (operator may instead hide pool-empty items entirely). */
672
718
  pool?: number;
673
719
  /** The custom data of the store item defined by operator. Can be a JSON object, string or number */
674
720
  custom_data: any;
@@ -688,6 +734,8 @@ export interface TStoreItem {
688
734
  purchase_type: 'points' | 'gems' | 'diamonds';
689
735
  /** The date when the store item will be available till */
690
736
  active_till_date?: number;
737
+ /** Should countdown timer be shown when `active_till_date` is present */
738
+ show_timer?: boolean;
691
739
  /** The discounted price of the store item */
692
740
  discounted_price?: number;
693
741
  /** The ribbon of the discounted price. */
@@ -705,14 +753,24 @@ export interface TStoreItem {
705
753
  }
706
754
 
707
755
  /**
708
- * TAchCategory describes the badge category item. Each badge item can be assigned to 1 or more categories
756
+ * TAchCategory describes a mission/badge category. Categories are
757
+ * operator-defined groupings, configured per-label by the brand operator,
758
+ * shared across BOTH missions and badges — the same list is returned for
759
+ * both entity types. A mission or badge can belong to **zero or more**
760
+ * categories (many-to-many) via its `category_ids: number[]` field on
761
+ * `TMissionOrBadge`.
762
+ *
763
+ * Returned by `_smartico.api.getAchCategories()`. See that method's TSDoc
764
+ * for translation, refresh, and rendering details.
709
765
  */
710
766
  export interface TAchCategory {
711
- /**ID of the badge category */
767
+ /** Stable numeric ID of the category. Used as the key when joining to
768
+ * `TMissionOrBadge.category_ids: number[]`. */
712
769
  id: number;
713
- /**Name of the badge category */
770
+ /** Display name of the category, pre-translated server-side. Never null. */
714
771
  name: string;
715
- /**Order of the badge category among other categories. Default value is 1 */
772
+ /** Relative display position (lower = appears first). Default 1 when the
773
+ * operator did not configure an explicit order. */
716
774
  order: number;
717
775
  }
718
776
 
@@ -768,8 +826,8 @@ export interface TMissionOrBadge {
768
826
  /** The text of the CTA button, e.g. 'Make a deposit' */
769
827
  cta_text: string;
770
828
  /**
771
- * The ID of the custom section where the mission or badge is assigned
772
- * The list of custom sections can be retrieved using _smartico.api.getCustomSections() method (TODO-API)
829
+ * The ID of the custom section where the mission or badge is assigned.
830
+ * Resolve to section metadata via `_smartico.api.getCustomSections()`.
773
831
  */
774
832
  custom_section_id: number;
775
833
  /** The indicator if the mission or badge is visible only in the custom section and should be hidden from the main overview of missions/badges */
@@ -796,7 +854,8 @@ export interface TMissionOrBadge {
796
854
  /** The ribbon of the mission/badge item. Can be 'sale', 'hot', 'new', 'vip' or URL to the image in case of custom ribbon, 250x300px */
797
855
  ribbon?: TRibbon;
798
856
 
799
- /** ID of the completion fact from ach_completed or ach_completed_recurring tables */
857
+ /** Stable identifier of this specific mission completion. Undefined for
858
+ * badges and for missions that have not yet completed. */
800
859
  ach_completed_id?: number;
801
860
 
802
861
  /** Flag from achievement if the mission prize will be given only after user claims it */
@@ -901,248 +960,345 @@ export interface TMissionOrBadgeTask {
901
960
  }
902
961
 
903
962
  /**
904
- * TMissionOptInResult describes the response of call to _smartico.api.requestMissionOptIn(mission_id) method
963
+ * Response of `_smartico.api.requestMissionOptIn(mission_id)`.
964
+ *
965
+ * See `requestMissionOptIn` TSDoc for the full table of `err_code` values
966
+ * and recommended UI handling.
905
967
  */
906
968
  export interface TMissionOptInResult {
907
- /** Error code that represents outcome of the opt-in request. Successful opt-in in case err_code is 0 */
969
+ /** Error code. `0` = success. See `requestMissionOptIn` TSDoc for the full table. */
908
970
  err_code: number;
909
- /** Optional error message */
971
+ /** Optional error message; populated on non-zero `err_code`. */
910
972
  err_message: string;
911
973
  }
912
974
 
913
975
  /**
914
- * TMissionClaimRewardResult describes the response of call to _smartico.api.requestMissionClaimReward(mission_id, ach_completed_id) method
976
+ * Response of `_smartico.api.requestMissionClaimReward(mission_id, ach_completed_id)`.
977
+ *
978
+ * See `requestMissionClaimReward` TSDoc for the full table of `err_code`
979
+ * values, preconditions, side effects, and recommended UI handling.
915
980
  */
916
981
  export interface TMissionClaimRewardResult {
917
- /** Error code that represents outcome of the claim request. Successful claim reward in case err_code is 0 */
982
+ /** Error code. `0` = success (rewards credited). See `requestMissionClaimReward` TSDoc for the full table. */
918
983
  err_code: number;
919
- /** Optional error message */
984
+ /** Optional error message; populated on non-zero `err_code`. */
920
985
  err_message: string;
921
986
  }
922
987
 
988
+ /**
989
+ * Result of `_smartico.api.registerInTournament(tournament_id)`.
990
+ */
923
991
  export interface TTournamentRegistrationResult {
924
- /** Error code that represents outcome of the tournament registration request. Successful registration in case err_code is 0 */
992
+ /** Error code. `0` = success. See `registerInTournament` TSDoc for the full table. */
925
993
  err_code: TournamentRegistrationError;
926
- /** Optional error message */
994
+ /** Optional error message; populated on non-zero `err_code`. */
927
995
  err_message: string;
928
996
  }
929
997
 
998
+ /**
999
+ * Result of `_smartico.api.buyStoreItem(store_item_id)`.
1000
+ */
930
1001
  export interface TBuyStoreItemResult {
931
- /** Error code representing the result of the purchase of the shop item. Successful purchase if err_code is 0
932
- *
933
- * Example for error handling:
934
- * ```javascript
935
- * SmarticoAPI.buyStoreItem(item_id).then(res => {
936
- * if (res.err_code !== 0) {
937
- * // YOUR LOGIC HERE, you can use res.err_message, but it's optional and not always present
938
- * }
939
- * });
940
- * ```
941
- */
1002
+ /** Error code. `0` = success. See `buyStoreItem` TSDoc for the full table. */
942
1003
  err_code: BuyStoreItemErrorCode;
943
- /** Optional error message */
1004
+ /** Optional error message; populated on non-zero `err_code`. */
944
1005
  err_message: string;
945
1006
  }
946
1007
 
1008
+ /**
1009
+ * Result of `getTranslations(lang_code)`.
1010
+ */
947
1011
  export interface TGetTranslations {
1012
+ /** Flat dictionary of operator-defined translation key → translated string. */
948
1013
  translations: { [key: string]: string };
949
1014
  }
950
1015
 
1016
+ /**
1017
+ * TInboxMessage is the lightweight envelope returned by
1018
+ * `_smartico.api.getInboxMessages()`. Fetch the rich body (title,
1019
+ * preview, icon, html_body, buttons) separately via
1020
+ * `_smartico.api.getInboxMessageBody(message_guid)`.
1021
+ */
951
1022
  export interface TInboxMessage {
952
- /** Uniq identifier of the message. It is needed to request the message body, mark the message as read/deleted/favorite. */
1023
+ /** Unique identifier of the message. Pass to `getInboxMessageBody`
1024
+ * and the mark / favorite / delete mutations. */
953
1025
  message_guid: string;
954
- /** Date when the message was sent */
1026
+ /** Date when the message was sent (server timestamp). */
955
1027
  sent_date: string;
956
- /** Indicator if a message is read */
1028
+ /** `true` when the message has been marked read. */
957
1029
  read: boolean;
958
- /** Indicator if a message is added to favorites */
1030
+ /** `true` when the message has been starred (favorited). */
959
1031
  favorite: boolean;
960
- /** Category id per inbox message, can be part of System inboxes, Personal inboxes or General inbox messages */
1032
+ /** Operator-assigned category ({@link InboxCategories}). */
961
1033
  category_id?: InboxCategories;
962
- /** The epoch timestamp, with milliseconds, when the message is going to be expired */
1034
+ /** Expiry timestamp as Unix-ms epoch. Server filters out expired
1035
+ * messages from list responses — consumers rarely see this set
1036
+ * unless the expiry is upcoming. */
963
1037
  expire_on_dt?: number;
964
1038
  }
965
1039
 
1040
+ /**
1041
+ * TInboxMessageBody is the rich body of one inbox message.
1042
+ * Returned by `_smartico.api.getInboxMessageBody(message_guid)`.
1043
+ * Fetched from a CDN (not over WebSocket).
1044
+ */
966
1045
  export interface TInboxMessageBody {
967
- /** Message title */
1046
+ /** Display title. */
968
1047
  title: string;
969
- /** Short preview body of the message */
1048
+ /** Short preview text (typically rendered alongside the title in list items). */
970
1049
  preview_body: string;
971
- /** Message icon, 128x128px */
1050
+ /** Message icon URL (128×128 px recommended). */
972
1051
  icon: string;
973
- /** The action that should be performed when user clicks on the message.
974
- * Can be URL or deep link, e.g. 'dp:deposit'. The most safe to execute CTA is to pass it to _smartico.dp(cta_action);
975
- * The 'dp' function will handle the CTA and will execute it in the most safe way.
976
- * If the message has a rich html body - the action will always be 'dp:inbox' which will open the inbox widget when triggered.
977
- */
1052
+ /** Click-action — either a deep-link (e.g. `'dp:deposit'`) or a
1053
+ * plain URL. The literal `'dp:inbox'` indicates the message has a
1054
+ * rich `html_body`; for any other value `html_body` and `buttons`
1055
+ * are absent. Pass to `_smartico.dp(action)` for safe execution. */
978
1056
  action: string;
979
- /** Rich HTML body of the message. */
1057
+ /** Rich HTML body. Populated only when `action === 'dp:inbox'`. */
980
1058
  html_body?: string;
981
- /** Optional additional buttons to show in the message, available only if message has rich HTML body. Max count - 2. */
1059
+ /** Up to 2 additional action buttons. Populated only when
1060
+ * `action === 'dp:inbox'`. */
982
1061
  buttons?: {
983
- /** The action that should be performed when user clicks on the button. The logic is the same as for message actions */
1062
+ /** Button click-action (deep-link or URL). */
984
1063
  action: string;
985
- /** Button text */
1064
+ /** Button label. */
986
1065
  text: string;
987
1066
  }[];
988
- /** The custom data of the inbox message defined by operator. Can be a JSON object, string or number */
1067
+ /** Operator-defined custom data. The SDK auto-parses JSON-looking
1068
+ * strings, so at runtime this is `any` despite the `string` type. */
989
1069
  custom_data?: string;
990
1070
  }
991
1071
 
1072
+ /**
1073
+ * InboxMarkMessageAction is the response of the five inbox mutation
1074
+ * methods (`markInboxMessageAsRead`, `markAllInboxMessagesAsRead`,
1075
+ * `markUnmarkInboxMessageAsFavorite`, `deleteInboxMessage`,
1076
+ * `deleteAllInboxMessages`).
1077
+ */
992
1078
  export interface InboxMarkMessageAction {
993
- /** An error code representing the result of marking a message as deleted, favorite or read. Successful marking action if err_code is 0 */
1079
+ /** Error code. `0` = success. See the calling method's TSDoc for
1080
+ * the full error semantics (server returns generic codes; the
1081
+ * five inbox mutations share the same shape). */
994
1082
  err_code: number;
995
- /** Optional error message */
1083
+ /** Optional server-side error message. Present only on non-zero
1084
+ * `err_code`; may be empty even then. */
996
1085
  err_message: string;
997
1086
  }
998
1087
 
1088
+ /**
1089
+ * LeaderBoardDetailsT describes one period's leaderboard.
1090
+ * Returned by `_smartico.api.getLeaderBoard(periodType, getPreviousPeriod?)`.
1091
+ * May be `undefined` at runtime when no board is configured for the requested period.
1092
+ */
999
1093
  export interface LeaderBoardDetailsT {
1000
- /** ID of the leaderboard */
1094
+ /** Stable ID of the leaderboard. */
1001
1095
  board_id: number;
1002
- /** Name of the leaderboard */
1096
+ /** Operator-defined display name. */
1003
1097
  name: string;
1004
- /** Description of the leaderboard */
1098
+ /** Operator-defined description (HTML allowed). */
1005
1099
  description: string;
1006
- /** Rules of the leaderboard */
1100
+ /** Operator-defined rules / terms (HTML allowed). */
1007
1101
  rules: string;
1008
- /** Leaderboard period type ID */
1102
+ /** Period type this board is bound to ({@link LeaderBoardPeriodType}). */
1009
1103
  period_type_id: LeaderBoardPeriodType;
1010
- /** Leaderboard points rewards */
1104
+ /** Per-place prize table; the array length is the number of paid places. */
1011
1105
  rewards: LeaderBoardsRewardsT[];
1012
- /** Leaderboard users */
1106
+ /** Top-20 ranked entries (server-capped), sorted by `position` ASC. */
1013
1107
  users: LeaderBoardUserT[];
1014
- /** Info about current user in leaderboard */
1108
+ /** Current user's own entry. `undefined` for visitor sessions.
1109
+ * For authenticated users, `position === -1` means the user is
1110
+ * unranked / outside the ranked window. */
1015
1111
  me?: LeaderBoardUserT;
1016
1112
  }
1017
1113
 
1114
+ /**
1115
+ * LeaderBoardsRewardsT describes one place's prize on a leaderboard.
1116
+ * Leaderboard prizes are always gamification points (never gems / diamonds / items).
1117
+ */
1018
1118
  export interface LeaderBoardsRewardsT {
1119
+ /** Place number (1-based). */
1019
1120
  place: number;
1121
+ /** Gamification points awarded to the user occupying this place at period finalization. */
1020
1122
  points: number;
1021
1123
  }
1022
1124
 
1125
+ /**
1126
+ * LeaderBoardUserT describes one participant row on a leaderboard.
1127
+ */
1023
1128
  export interface LeaderBoardUserT {
1024
- /** The username of the participant */
1129
+ /** Display username (operator-defined alias). */
1025
1130
  public_username: string;
1026
- /** The URL to the avatar of the participant */
1131
+ /** Resolved CDN URL for the participant's avatar. */
1027
1132
  avatar_url: string;
1028
- /** The position of the participant in the leaderboard */
1133
+ /** Rank in the leaderboard (DENSE_RANK over all participants).
1134
+ * `-1` on the `me` entry signals "unranked / outside the window". */
1029
1135
  position: number;
1030
- /** The points of the participant in the leaderboard */
1136
+ /** Participant's points for this period. */
1031
1137
  points: number;
1032
- /** The indicator if the participant is current user */
1138
+ /** `true` when this row is the current authenticated user. */
1033
1139
  is_me: boolean;
1034
1140
  }
1035
1141
 
1142
+ /**
1143
+ * UserLevelExtraCountersT exposes the user's current values for the two
1144
+ * label-defined sliding-window level counters. Returned by
1145
+ * `_smartico.api.getUserLevelExtraCounters()`. Both fields are
1146
+ * `undefined` on points-only labels.
1147
+ */
1036
1148
  export interface UserLevelExtraCountersT {
1037
- /** The counter of 1st metric used to reach the level. */
1149
+ /** Current value of the user's first level counter. Operator-defined
1150
+ * semantics per label. `undefined` on points-only labels. */
1038
1151
  level_counter_1?: number;
1039
- /** The counter of 2nd metric used to reach the level. */
1152
+ /** Current value of the user's second level counter. Operator-defined
1153
+ * semantics per label. `undefined` on points-only labels. */
1040
1154
  level_counter_2?: number;
1041
1155
  }
1042
1156
 
1157
+ /**
1158
+ * TSegmentCheckResult describes one segment-membership outcome.
1159
+ * Returned by `_smartico.api.checkSegmentListMatch()` (and used
1160
+ * internally by `checkSegmentMatch()`).
1161
+ */
1043
1162
  export interface TSegmentCheckResult {
1163
+ /** The segment ID this result refers to (label-scoped). */
1044
1164
  segment_id: number;
1165
+ /** `true` if the user currently matches this segment. `false` also
1166
+ * covers the case where the segment doesn't exist for the label —
1167
+ * the two are not distinguishable. */
1045
1168
  is_matching: boolean;
1046
1169
  }
1047
1170
 
1171
+ /**
1172
+ * One operator-configured navigation entry. Returned by `getCustomSections()`.
1173
+ * `section_type_id` is the dispatch key — it determines which page component the
1174
+ * consumer mounts when the user opens this section.
1175
+ */
1048
1176
  export interface TUICustomSection {
1049
- /** The ID of the custom section */
1177
+ /** Stable numeric ID of the section. */
1050
1178
  id: number;
1051
- /** The body of the custom section */
1179
+ /** Raw HTML body for `HTML_PAGE` sections; Liquid template body for `LEVELS` (Liquid) sections. */
1052
1180
  body?: string;
1053
- /** The image of the custom section, 64x64px */
1181
+ /** CDN URL of the section's nav icon, 64x64 px square. */
1054
1182
  menu_img?: string;
1055
- /** The name of the custom section */
1183
+ /** Display name shown next to the nav icon. Pre-translated server-side. */
1056
1184
  menu_name?: string;
1057
- /** Custom images for custom section */
1185
+ /** JSON-serialized list of skin image overrides for themed sections (e.g. `MISSION_CUSTOM_LAYOUT`). */
1058
1186
  custom_skin_images?: string;
1059
- /** The particular type of custom section, can be Missions, Tournaments, Lootbox and etc */
1187
+ /** Dispatch key — see {@link AchCustomSectionType}. */
1060
1188
  section_type_id?: AchCustomSectionType;
1061
- /** Theme of the custom section */
1189
+ /** Themed-layout name for `MISSION_CUSTOM_LAYOUT` sections; see {@link AchCustomLayoutTheme}. */
1062
1190
  theme?: AchCustomLayoutTheme;
1063
- /** Custom css for the custom section */
1191
+ /** Custom CSS for themed layouts. */
1064
1192
  generic_custom_css?: string;
1065
- /** Tabs that can be shown in custom section, e.g Overview, No Overview, All tabs */
1193
+ /** Which tabs to render for `MISSIONS_CATEGORY` sections; see {@link AchMissionsTabsOptions}. */
1066
1194
  mission_tabs_options?: AchMissionsTabsOptions;
1067
- /** Filter that allow to show missions by criteria */
1195
+ /** Mission-filter rule for the Overview tab; see {@link AchOverviewMissionsFilter}. */
1068
1196
  overview_missions_filter?: AchOverviewMissionsFilter;
1069
- /** Quantity of missions to be shown in overview */
1197
+ /** Maximum number of missions shown in the Overview tab. */
1070
1198
  overview_missions_count?: number;
1071
- /** URL or DP to be used for custom section */
1199
+ /** Click target for `REDIRECT_LINK` sections — either a Smartico DP string (`dp:…`) or an external URL. */
1072
1200
  url_or_dp?: string;
1073
- /** Data to be used for Liquid templates */
1201
+ /** Data-context selectors for Liquid templates; see {@link LiquidEntityData}. */
1074
1202
  liquid_entity_data?: LiquidEntityData[];
1075
- /** Tournament ID to be used for Liquid templates */
1203
+ /** Tournament ID for a single-tournament Liquid template (`LiquidEntityData.Tournament`). */
1076
1204
  ach_tournament_id?: number;
1077
- /** Indicates if the data should be shown as raw data (for Liquid templates) */
1205
+ /** Operator debug flag — when `true`, Liquid renders raw context data instead of the templated HTML. */
1078
1206
  show_raw_data?: boolean;
1079
- /** Liquid template id to be used for Liquid templates */
1207
+ /** Liquid template ID resolved server-side; the rendered body is delivered in `body`. */
1080
1208
  liquid_template?: number;
1081
- /** List of IDs of the categories where the badge item is assigned, information about categories can be retrieved with getAchCategories method */
1209
+ /** Category IDs the section filters badges by — correlate with `getAchCategories()`. */
1082
1210
  ach_category_ids?: number[];
1083
- /** List of IDs of the categories where the store item is assigned, information about categories can be retrieved with getShopCategories method */
1211
+ /** Category IDs the section filters store items by — correlate with `getStoreCategories()`. */
1084
1212
  shop_category_ids?: number[];
1085
- /** ID of the raffle to be used for Liquid templates */
1213
+ /** Raffle ID for `RAFFLE` sections (and `LiquidEntityData.SingleRaffle` Liquid templates). */
1086
1214
  raffle_id?: number;
1087
1215
  }
1088
1216
 
1217
+ /**
1218
+ * TBonus describes one bonus awarded to the user.
1219
+ * Returned by `_smartico.api.getBonuses()`.
1220
+ */
1089
1221
  export interface TBonus {
1090
- /** ID of the bonus */
1222
+ /** Stable ID of the bonus. */
1091
1223
  bonus_id: number;
1092
- /** Can the bonus be redeemed (if bonus is redeemable the user needs to claim it) */
1224
+ /** `true` when the bonus is in a player-claim-required state.
1225
+ * Gate the Claim button on this; see `claimBonus` TSDoc. */
1093
1226
  is_redeemable?: boolean;
1094
- /** Date of creation */
1227
+ /** Bonus creation timestamp as ISO 8601 UTC string
1228
+ * ("YYYY-MM-DDTHH:MM:SS", no timezone suffix). */
1095
1229
  create_date?: string;
1096
- /** Date of redemption */
1230
+ /** Bonus redemption timestamp as ISO 8601 UTC string. Absent until
1231
+ * the bonus reaches `BonusStatus.REDEEMED`. */
1097
1232
  redeem_date?: string;
1098
- /** ID of template used */
1233
+ /** ID of the bonus template used to issue this bonus. */
1099
1234
  label_bonus_template_id?: number;
1100
- /** ID of the bonus status */
1235
+ /** Lifecycle status; see {@link BonusStatus}. */
1101
1236
  bonus_status_id?: BonusStatus;
1102
- /** Additional information about the bonus(edscription, image,name, acknowledge) */
1237
+ /** Template-level display metadata (operator-configured, identical
1238
+ * across all bonuses from the same template). */
1103
1239
  label_bonus_template_meta_map?: BonusTemplateMetaMap;
1104
- /** Additional information presented to the player when the bonus is redeemed */
1240
+ /** Instance-level display metadata (per-issuance; carries the
1241
+ * dynamic amount computed at award time). */
1105
1242
  bonus_meta_map?: BonusMetaMap;
1106
1243
  }
1107
1244
 
1245
+ /**
1246
+ * BonusStatus describes the lifecycle stage of a bonus on `TBonus.bonus_status_id`.
1247
+ * Operator widget configuration typically filters out internal statuses
1248
+ * (`New`, `COUPON_ISSUE_FAILED`, `EXPIRED`); consumers usually see
1249
+ * `COUPON_ISSUED`, `REDEEMED`, and `REDEEM_FAILED`.
1250
+ */
1108
1251
  export enum BonusStatus {
1109
- /** The bonus is newly created (shouldn't be shown to the client) */
1252
+ /** Newly created, not yet processed (internal). */
1110
1253
  New = 1,
1111
- /** The bonus is issued and available for redemption but has not been redeemed yet */
1254
+ /** Issued and awaiting player claim. */
1112
1255
  COUPON_ISSUED = 2,
1113
- /** The bonus has been successfully redeemed */
1256
+ /** Successfully redeemed. */
1114
1257
  REDEEMED = 3,
1115
- /** The bonus is still valid, but a previous redemption attempt failed */
1258
+ /** Previous redemption attempt failed; still valid and re-claimable. */
1116
1259
  REDEEM_FAILED = 4,
1117
- /** Failed to issue the bonus (shouldn't be shown to the client) */
1260
+ /** Coupon issuance failed (internal). */
1118
1261
  COUPON_ISSUE_FAILED = 5,
1119
- /** The bonus was issued but has expired and can no longer be redeemed (shouldn't be shown to the client) */
1262
+ /** Issued but expired before redemption (internal). */
1120
1263
  EXPIRED = 6,
1121
1264
  }
1265
+ /**
1266
+ * Template-level bonus display metadata (operator-configured at the
1267
+ * bonus template; identical for every bonus issued from the same template).
1268
+ */
1122
1269
  export interface BonusTemplateMetaMap {
1123
- /** Description of the bonus template*/
1270
+ /** Operator-set description / display text. May include HTML. */
1124
1271
  description: string;
1125
- /** Acknowledge message setup in the bonus template*/
1272
+ /** Operator-set additional message shown to the player at claim
1273
+ * time (e.g. wagering terms). May include deep-links. */
1126
1274
  acknowledge: string;
1127
- /** Image URL of the bonus template, 1:1 aspect ratio */
1275
+ /** Bonus icon URL (1:1 aspect ratio recommended). */
1128
1276
  image_url: string;
1129
- /** Redirect URL of the bonus template*/
1277
+ /** Optional redirect — external HTTP URL (opens in new tab) or
1278
+ * internal deep-link (handled by the SDK's deep-link router). */
1130
1279
  redirect_url?: string;
1131
1280
  }
1281
+ /**
1282
+ * Instance-level bonus display metadata (set per-issuance, may carry
1283
+ * a dynamically-computed amount).
1284
+ */
1132
1285
  export interface BonusMetaMap {
1133
- /** Label and description of the bonus sent to the player*/
1286
+ /** Display-ready amount string (e.g. "€50", "100 free spins"). */
1134
1287
  uiAmount?: string;
1135
1288
  }
1136
1289
 
1137
1290
  /**
1138
- * TClaimBonusResult describes the response of call to _smartico.api.claimBonus(bonus_id) method
1291
+ * TClaimBonusResult describes the response of `_smartico.api.claimBonus(bonus_id)`.
1292
+ */
1293
+ /**
1294
+ * Result of `_smartico.api.claimBonus(bonus_id)`.
1139
1295
  */
1140
1296
  export interface TClaimBonusResult {
1141
- /** Error code that represents outcome of the game play attempt. Game succeed to be played in case err_code is 0 */
1142
- err_code: SAWSpinErrorCode;
1143
- /** Optional error message */
1297
+ /** Error code. `0` = success. See `claimBonus` TSDoc for the full table. */
1298
+ err_code: number;
1299
+ /** Optional error message; populated on non-zero `err_code`. */
1144
1300
  err_message: string;
1145
- /** If the bonus was claimed successfully, then success is true */
1301
+ /** Unreliable on the wire — prefer `err_code === 0` as the success check. */
1146
1302
  success?: boolean;
1147
1303
  }
1148
1304
 
@@ -1518,10 +1674,23 @@ export interface TRaffleDrawRun {
1518
1674
 
1519
1675
  }
1520
1676
 
1677
+ /**
1678
+ * TransformedRaffleClaimPrizeResponse describes the response of
1679
+ * `_smartico.api.claimRafflePrize({won_id})`.
1680
+ *
1681
+ * Note: this type uses `errorCode` / `errorMessage` (camelCase
1682
+ * full-word) — different from most other SDK wrapper-result types in
1683
+ * this library which use `err_code` / `err_message` (snake_case).
1684
+ */
1685
+ /**
1686
+ * Result of `_smartico.api.claimRafflePrize({raffle_id, draw_id, raffle_run_id})`.
1687
+ * Uses camelCase `errorCode` / `errorMessage` — distinct from most other SDK
1688
+ * result wrappers which use snake_case `err_code` / `err_message`.
1689
+ */
1521
1690
  export interface TransformedRaffleClaimPrizeResponse {
1522
- /** Error code, 0 means no error */
1691
+ /** Error code. `0` = success. See `claimRafflePrize` TSDoc for the full table. */
1523
1692
  errorCode: number
1524
- /** Error message, will be exposed only if ErrorCode is not 0 */
1693
+ /** Optional error message; populated on non-zero `errorCode`. */
1525
1694
  errorMessage?: string
1526
1695
  }
1527
1696
  /**
@@ -1548,10 +1717,13 @@ export interface TActivityLog {
1548
1717
  }
1549
1718
 
1550
1719
 
1720
+ /**
1721
+ * Result of `_smartico.api.requestRaffleOptin({raffle_id, draw_id, raffle_run_id})`.
1722
+ */
1551
1723
  export interface TRaffleOptinResponse {
1552
- /** Error code that represents outcome of the opt-in attempt. Opt-in succeed in case err_code is 0 */
1724
+ /** Error code. `0` = success. See `requestRaffleOptin` TSDoc for the full table. */
1553
1725
  err_code: number;
1554
- /** Optional error message */
1726
+ /** Optional error message; populated on non-zero `err_code`. */
1555
1727
  err_message?: string;
1556
1728
  }
1557
1729
 
@@ -2024,75 +2196,72 @@ export interface GamePickRoundRequestParams extends GamePickRequestParams {
2024
2196
  }
2025
2197
 
2026
2198
  /**
2027
- * TAvatarDefinition describes a single avatar available in the avatar catalog.
2199
+ * One avatar in the user's catalog. Returned by `getAvatarsList()`.
2028
2200
  * Fields from the raw `public_meta` object are flattened to the top level.
2029
2201
  */
2030
2202
  export interface TAvatarDefinition {
2031
- /** Unique identifier of the avatar */
2203
+ /** Stable numeric identifier of the avatar. Primary key passed to `setAvatar()`. */
2032
2204
  avatar_real_id: number;
2033
- /** Whether this avatar is the default one */
2205
+ /** True when this is the system default avatar for the label. */
2034
2206
  is_default: boolean;
2035
- /** If true, avatar is hidden until user achieves/unlocks it */
2207
+ /** When true and `is_given === false`, the avatar should be hidden from the user (surprise unlock). */
2036
2208
  hide_until_achieved: boolean;
2037
- /** Display priority — lower value means higher position in the grid */
2209
+ /** Display position; lower = earlier in the grid. */
2038
2210
  priority: number;
2039
- /** Optional description of the avatar (from public_meta) */
2211
+ /** Optional description shown alongside the avatar in detail views. */
2040
2212
  description?: string;
2041
- /** Raw image path/URL of the avatar as returned by the server (from public_meta) */
2213
+ /** Raw image path as returned by the server (relative or absolute). */
2042
2214
  url: string;
2043
- /** Full CDN URL of the avatar image, built from avatar_domain + url */
2215
+ /** Absolute CDN URL of the avatar image; built from the configured avatar domain + `url`. */
2044
2216
  avatar_url: string;
2045
- /**
2046
- * Source type of the avatar.
2047
- * 0 = free (always available to all users), other values = earned/purchased
2048
- */
2217
+ /** Source type. `0` = free / always available; non-zero = earned or purchased. */
2049
2218
  avatar_source_type_id: number;
2050
- /** ISO date string from which the avatar becomes available */
2219
+ /** ISO date string from which the avatar becomes available; undefined when no start window. */
2051
2220
  active_from_date?: string;
2052
- /** ISO date string until which the avatar is available */
2221
+ /** ISO date string until which the avatar is available; undefined when no end window. */
2053
2222
  active_till_date?: string;
2054
- /** Whether the avatar has been granted/given to the current user */
2223
+ /** True when the user owns / has unlocked this avatar. */
2055
2224
  is_given: boolean;
2056
- /** Whether this avatar is currently in use by the user */
2225
+ /** True when this avatar is the user's currently active profile avatar. */
2057
2226
  is_in_use?: boolean;
2058
2227
  }
2059
2228
 
2060
2229
  /**
2061
- * TAvatarCustomized describes an AI-customized version of a base avatar
2230
+ * One AI-generated variant of a base avatar. Returned by `getAvatarsCustomized()`.
2062
2231
  */
2063
2232
  export interface TAvatarCustomized {
2064
- /** The avatar_real_id of the base avatar this customization was generated from */
2233
+ /** `avatar_real_id` of the base avatar this variant was generated from. */
2065
2234
  avatar_real_id: number;
2066
- /** Full CDN URL of the AI-generated customized avatar image */
2235
+ /** Absolute CDN URL of the AI-generated image. Can be passed as `avatar_url` to `setAvatar()`. */
2067
2236
  url: string;
2068
- /** ISO date string when the customization was created */
2237
+ /** ISO date string of when the variant was generated. */
2069
2238
  dt_created: string;
2070
2239
  }
2071
2240
 
2072
2241
  /**
2073
- * TAvatarPrompt describes an AI style prompt available for avatar customization.
2242
+ * One AI style prompt for avatar customization. Returned by `getAvatarPrompts()`.
2074
2243
  * Fields from the raw `public_meta` object are flattened to the top level.
2075
2244
  */
2076
2245
  export interface TAvatarPrompt {
2077
- /** Unique identifier of the AI customization prompt */
2246
+ /** Stable numeric identifier of the prompt. */
2078
2247
  prompt_id: number;
2079
- /** Display name of the prompt style, e.g. "Cartoon", "Watercolor" (from public_meta) */
2248
+ /** Display name of the style, e.g. "Cartoon", "Watercolor". */
2080
2249
  name: string;
2081
- /** Full CDN URL of the prompt style icon image (from public_meta) */
2250
+ /** Absolute CDN URL of the prompt's preview icon. */
2082
2251
  icon_url: string;
2083
- /** Currency type used to pay for this customization (0=points, 1=gems, 2=diamonds) */
2252
+ /** Currency used to pay for the customization. `0` = points, `1` = gems, `2` = diamonds. */
2084
2253
  cost_currency_type_id: number;
2085
- /** Cost amount in the given currency */
2254
+ /** Cost amount in the currency named by `cost_currency_type_id`. */
2086
2255
  cost_value: number;
2087
2256
  }
2088
2257
 
2089
2258
  /**
2090
- * TSetAvatarResult describes the response of call to _smartico.api.setAvatar() method
2259
+ * Result of `_smartico.api.setAvatar()`.
2091
2260
  */
2092
2261
  export interface TSetAvatarResult {
2093
- /** Error code that represents outcome of the set avatar request. Successful if err_code is 0 */
2262
+ /** Error code. `0` = success. See `setAvatar` TSDoc for the full table. */
2094
2263
  err_code: number;
2095
- /** Optional error message */
2264
+ /** Optional error message; populated on non-zero `err_code`. */
2096
2265
  err_message?: string;
2097
2266
  }
2098
2267