@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
@@ -84,29 +84,42 @@ export interface TMiniGamePrize {
84
84
  max_give_period_type_id?: AttemptPeriodType;
85
85
  }
86
86
  /**
87
- * TMiniGamePlayResult describes the response of call to _smartico.api.playMiniGame(template_id) method
87
+ * TMiniGamePlayResult describes the response of
88
+ * `_smartico.api.playMiniGame(template_id)`.
88
89
  */
89
90
  export interface TMiniGamePlayResult {
90
- /** Error code that represents outcome of the game play attempt. Game succeed to be played in case err_code is 0 */
91
+ /** Error code. `0` = success ({@link SAWSpinErrorCode.SAW_OK}).
92
+ * See `playMiniGame` TSDoc for the full table. */
91
93
  err_code: SAWSpinErrorCode;
92
- /** Optional error message */
94
+ /** Optional server-side error message. Present only on non-zero
95
+ * `err_code`; may be empty even then. */
93
96
  err_message: string;
94
- /** The prize_id that user won, details of the prize can be found in the mini-game definition */
97
+ /** ID of the won prize. Look up in `template.prizes` to interpret
98
+ * (including `prize_type === 'no-prize'` for a configured loss
99
+ * slot). Always populated, even when `err_code !== 0`. */
95
100
  prize_id: number;
96
101
  }
97
102
  /**
98
- * TMiniGamePlayBatchResult describes the response of call to _smartico.api.playMiniGameBatch(template_id, spin_count) method
103
+ * TMiniGamePlayBatchResult describes one entry in the array returned
104
+ * by `_smartico.api.playMiniGameBatch(template_id, spin_count)`.
105
+ *
106
+ * Note: this type uses `errCode` / `errMessage` (camelCase) —
107
+ * different from `TMiniGamePlayResult` which uses `err_code` /
108
+ * `err_message` (snake_case).
99
109
  */
100
110
  export interface TMiniGamePlayBatchResult {
101
- /** The saw_prize_id that user won, details of the prize can be found in the mini-game definition */
111
+ /** ID of the won prize for this spin. Look up in `template.prizes`. */
102
112
  saw_prize_id: number;
103
- /** Error code that represents outcome of the game play attempt. Game succeed to be played in case err_code is 0 */
113
+ /** Error code. `0` = success. See `playMiniGameBatch` TSDoc for the
114
+ * full table. */
104
115
  errCode: SAWSpinErrorCode;
105
- /** Optional error message */
116
+ /** Optional server-side error message. */
106
117
  errMessage?: string;
107
- /** Jackpot amount what user won */
118
+ /** Jackpot amount the user won, populated when the prize type is
119
+ * `'jackpot'`. */
108
120
  jackpot_amount?: number;
109
- /** Period in miliseconds from last spin */
121
+ /** Epoch ms of the user's first spin in the current cooldown
122
+ * period; populated when `errCode === SAWSpinErrorCode.SAW_FAILED_MAX_SPINS_REACHED`. */
110
123
  first_spin_in_period?: number;
111
124
  }
112
125
  /**
@@ -193,85 +206,76 @@ export interface TMiniGameTemplate {
193
206
  * _smartico.on('props_change', () => console.log(_smartico.api.getUserProfile()) );
194
207
  */
195
208
  export interface TUserProfile {
196
- /** The language of the user */
209
+ /** Language code stored server-side for the user (e.g. `"en"`, `"de"`). */
197
210
  core_user_language: string;
198
- /** The current points balance that user can use in the Store, Mini-games, Tournaments, etc.. */
211
+ /** Current spendable points balance — decremented by store purchases,
212
+ * tournament buy-ins, and clan entry fees. */
199
213
  ach_points_balance: number;
200
- /** The amount of points that user collected in total */
214
+ /** All-time cumulative points earned. Monotonic — NOT decremented by
215
+ * store purchases or clan/tournament fees. */
201
216
  ach_points_ever: number;
202
- /** The current gems balance */
217
+ /** Current gems balance (secondary currency). */
203
218
  ach_gems_balance: number;
204
- /** The current diamonds balance */
219
+ /** Current diamonds balance (tertiary currency). */
205
220
  ach_diamonds_balance: number;
206
- /**
207
- * The array of the public tags set on the user object.
208
- * They can be treated as server-based cookies.
209
- * You can set tags using following method _smartico.event('core_public_tags_update', { core_public_tags: ['A', 'B'] } );
210
- * And then you can check for the tags
211
- */
221
+ /** Server-stored public tags on the user (uppercase strings).
222
+ * Modify via `_smartico.updatePublicTags(operation, tags)`. */
212
223
  core_public_tags: string[];
213
- /** The ID of the current level of the user */
224
+ /** FK into the level ladder; resolve via `getCurrentLevel()` or `getLevels()`. */
214
225
  ach_level_current_id?: number;
215
- /** The indicator if user is marked as test user */
226
+ /** `true` when the user is flagged as a test account. */
216
227
  core_is_test_account?: boolean;
217
- /** The URL to the user avatar */
228
+ /** Resolved CDN URL for the user's avatar. */
218
229
  avatar_url?: string;
219
- /** The username of current user */
230
+ /** Display username (operator-defined alias). */
220
231
  public_username?: string;
221
- /** THe number of unread inbox messages */
232
+ /** Unread inbox messages count. Push-updated in real time. */
222
233
  core_inbox_unread_count?: number;
223
- /** The recommended deposit amount for the user */
234
+ /** AI-recommended deposit amount for this user. Undefined when no
235
+ * recommendation is currently available. */
224
236
  core_recommended_deposit_amount?: number;
225
- /** The recommended casino bet amount for the user */
237
+ /** AI-recommended casino bet amount for this user. Undefined when no
238
+ * recommendation is currently available. */
226
239
  core_recommended_casino_bet_amount?: number;
227
240
  }
228
241
  /**
229
- * TLevel describes the information of each level defined in the system
230
- * There is no order of the levels, but it can be calculated using required_points property
231
- * The current level of user can be taken from the user object using ach_level_current_id property
232
- * The progress to the next level can be calculated using ach_points_ever and required_points properties of next level
242
+ * TLevel describes one level in the label's level ladder.
243
+ * Returned by `_smartico.api.getLevels()` (already sorted by `required_points` ASC).
233
244
  */
234
245
  export interface TLevel {
235
- /** The ID of the Level */
246
+ /** Stable ID of the level. */
236
247
  id: number;
237
- /** The name of the Level, translated to the user language */
248
+ /** Display name of the level, pre-translated to the user's language. */
238
249
  name: string;
239
- /** The description of the Level, translated to the user language */
250
+ /** Display description of the level, pre-translated to the user's language. */
240
251
  description: string;
241
- /** The URL of the image of the Level, 256x256px */
252
+ /** URL of the level image (256x256 px source). */
242
253
  image: string;
243
- /** The amount of points required to reach the Level */
254
+ /** Total `ach_points_ever` required to reach this level. */
244
255
  required_points: number;
245
- /** Number of points that user should collect in order to see this level */
256
+ /** Visibility threshold — clients hide the level from the user until
257
+ * `ach_points_ever >= visibility_points`. `null` means always visible. */
246
258
  visibility_points: number;
247
- /**
248
- * The counter of 1st metric used to reach the Level.
249
- * Relevant in case of using advanced leveling logic
250
- * https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
251
- *
252
- */
259
+ /** Required value of the first level counter for sliding-window leveling.
260
+ * `null` on points-only labels. See `UserLevelExtraCountersT`. */
253
261
  required_level_counter_1: number;
254
- /**
255
- * The counter of 2nd metric used to reach the Level.
256
- * Relevant in case of using advanced leveling logic
257
- * https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
258
- *
259
- */
262
+ /** Required value of the second level counter for sliding-window leveling.
263
+ * `null` on points-only labels. */
260
264
  required_level_counter_2: number;
261
- /**
262
- * Custom data as string or JSON string that can be used in API to build custom UI
263
- * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
264
- * Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
265
- */
265
+ /** Operator-defined custom data. The SDK auto-parses JSON-looking
266
+ * strings, so at runtime this is `any` despite the `string` type. */
266
267
  custom_data: string;
267
- /** The ordinal position of the level */
268
+ /** 1-based position in the ladder (matches the order of the returned
269
+ * array, which is sorted by `required_points` ASC). */
268
270
  ordinal_position: number;
269
271
  }
270
272
  /**
271
- * TLevelCurrent describes the information of each level defined in the system along with ordinal position and progress of the current level
273
+ * TLevelCurrent extends `TLevel` with the user's progress toward the next level.
274
+ * Returned by `_smartico.api.getCurrentLevel()`.
272
275
  */
273
276
  export interface TLevelCurrent extends TLevel {
274
- /** The progress of the user towards next level in the percents to complete */
277
+ /** Progress to the next level as a 0–100 integer percentage. `100`
278
+ * at the highest level. */
275
279
  progress: number;
276
280
  }
277
281
  /**
@@ -300,7 +304,7 @@ export interface TTournament {
300
304
  segment_dont_match_message: string;
301
305
  /**
302
306
  * The ID of the custom section where the tournament is assigned
303
- * The list of custom sections can be retrieved using _smartico.api.getCustomSections() method (TODO-API)
307
+ * The list of custom sections can be retrieved using _smartico.api.getCustomSections() method
304
308
  */
305
309
  custom_section_id: number;
306
310
  /** The custom data of the tournament defined by operator. Can be a JSON object, string or number */
@@ -535,13 +539,17 @@ export interface TClan {
535
539
  member_count: number;
536
540
  /** Max number of members allowed in clan */
537
541
  capacity_limit: number;
538
- /** ShopPurchaseType: 0=Points, 1=Gems, 2=Diamonds, 3=Free */
542
+ /** Currency type for `entry_fee_amount`. `0` = points, `1` = gems,
543
+ * `2` = diamonds, `3` = free (no fee). */
539
544
  entry_fee_currency_type_id: number;
540
- /** Numeric value for entry fee */
545
+ /** Entry fee amount in the currency indicated by `entry_fee_currency_type_id`.
546
+ * `0` (or `entry_fee_currency_type_id === 3`) means the clan is free to join. */
541
547
  entry_fee_amount: number;
542
- /** F1 rank ASC, 1=best */
548
+ /** Global rank among all active clans in the label, by `rating_score` DESC.
549
+ * `1` = highest-rated. May skip positions when some clans are hidden by
550
+ * per-user visibility (e.g. user sees positions 1, 3, 7). */
543
551
  rating_position: number;
544
- /** Clan rating score */
552
+ /** Clan rating score (higher is better). */
545
553
  rating_score: number;
546
554
  }
547
555
  /**
@@ -552,45 +560,83 @@ export interface TClans {
552
560
  clans: TClan[];
553
561
  /** The clan ID the current user belongs to; null if clanless */
554
562
  user_clan_id: number | null;
555
- /** Cooldown-until date string; null if no cooldown */
563
+ /** Switch-cooldown expiry as ISO 8601 UTC string ("YYYY-MM-DDTHH:MM:SS"
564
+ * with no timezone suffix; interpret as UTC). `null` when no cooldown.
565
+ * User-level: while set, the user cannot join any clan. */
556
566
  cooldown_until: string | null;
557
567
  /** Epoch ms when the current user joined their clan; null if clanless */
558
568
  join_date: number | null;
559
569
  }
560
570
  /**
561
571
  * TClanInfo describes the detailed info of a single clan including its members.
572
+ * Returned by `_smartico.api.getClanInfo(clanId)`.
562
573
  */
563
574
  export interface TClanInfo {
575
+ /** Clan ID. */
564
576
  clan_id: number;
577
+ /** Translated clan metadata (name, description, image URL). */
565
578
  public_meta: {
566
579
  name: string;
567
580
  description: string;
568
581
  image_url: string;
569
582
  };
583
+ /** Current number of members in clan. */
570
584
  member_count: number;
585
+ /** Max number of members allowed in clan. */
571
586
  capacity_limit: number;
587
+ /** Currency type for `entry_fee_amount`. `0` = points, `1` = gems,
588
+ * `2` = diamonds, `3` = free. */
572
589
  entry_fee_currency_type_id: number;
590
+ /** Entry fee amount in the currency indicated by `entry_fee_currency_type_id`. */
573
591
  entry_fee_amount: number;
592
+ /** Global rank among all active clans in the label, by `rating_score` DESC.
593
+ * `1` = highest-rated. */
574
594
  rating_position: number;
595
+ /** Clan rating score (higher is better). */
575
596
  rating_score: number;
597
+ /** User-level switch-cooldown expiry as ISO 8601 UTC string
598
+ * ("YYYY-MM-DDTHH:MM:SS" with no timezone suffix). `null` when no
599
+ * cooldown. Same semantic as `TClans.cooldown_until` but always fresh
600
+ * (the list version may be up to 30 s stale). */
576
601
  cooldown_until: string | null;
602
+ /** Members of this clan, server-ordered by `contribution_score` DESC
603
+ * (i.e. `position` ASC). */
577
604
  members: {
605
+ /** Member's internal user ID. */
578
606
  user_id: number;
607
+ /** Member's display username. */
579
608
  public_username: string;
609
+ /** Avatar identifier; resolve via `avatar_url` below or rebuild
610
+ * from `avatar_id` + brand avatar domain. */
580
611
  avatar_id: string;
612
+ /** Numeric avatar ID (alternative identifier). */
581
613
  avatar_real_id: number;
614
+ /** Pre-resolved CDN URL for the avatar. */
582
615
  avatar_url?: string;
616
+ /** Member's rank within this clan; `1` = top contributor. */
583
617
  position: number;
618
+ /** Member's contribution to the clan rating score. */
584
619
  contribution_score: number;
620
+ /** `true` when this row is the current authenticated user. */
585
621
  is_me?: boolean;
622
+ /** External user identifier (operator-provided alias);
623
+ * preferred over `public_username` on some surfaces. */
586
624
  clean_ext_user_id?: string;
587
625
  }[];
588
626
  }
589
627
  /**
590
- * TClanJoinResult describes the result of a join clan request.
628
+ * TClanJoinResult describes the result of a join-clan request.
629
+ * Note: this type uses `errCode` / `errMsg` (camelCase) — different
630
+ * from most other SDK result types in this library which use
631
+ * `err_code` / `err_message` (snake_case).
591
632
  */
592
633
  export interface TClanJoinResult {
634
+ /** Error code. `0` = success. Typed values are members of
635
+ * {@link JoinClanErrorCode}. See `joinClan` TSDoc for the full
636
+ * table and per-code UI guidance. */
593
637
  errCode: number;
638
+ /** Optional server-side error message. Present only on non-zero
639
+ * `errCode`; may be empty even then. */
594
640
  errMsg: string;
595
641
  }
596
642
  /**
@@ -645,7 +691,9 @@ export interface TStoreItem {
645
691
  can_buy: boolean;
646
692
  /** The list of IDs of the categories where the store item is assigned, information about categories can be retrieved with getStoreCategories method */
647
693
  category_ids: number[];
648
- /** Number of items in the pool avaliable for the purchase.*/
694
+ /** Items remaining in the pool available for purchase. `null` = unlimited
695
+ * supply. Positive integer = remaining stock. `0` = sold out but still
696
+ * returned (operator may instead hide pool-empty items entirely). */
649
697
  pool?: number;
650
698
  /** The custom data of the store item defined by operator. Can be a JSON object, string or number */
651
699
  custom_data: any;
@@ -665,6 +713,8 @@ export interface TStoreItem {
665
713
  purchase_type: 'points' | 'gems' | 'diamonds';
666
714
  /** The date when the store item will be available till */
667
715
  active_till_date?: number;
716
+ /** Should countdown timer be shown when `active_till_date` is present */
717
+ show_timer?: boolean;
668
718
  /** The discounted price of the store item */
669
719
  discounted_price?: number;
670
720
  /** The ribbon of the discounted price. */
@@ -681,14 +731,24 @@ export interface TStoreItem {
681
731
  cant_buy_message?: string;
682
732
  }
683
733
  /**
684
- * TAchCategory describes the badge category item. Each badge item can be assigned to 1 or more categories
734
+ * TAchCategory describes a mission/badge category. Categories are
735
+ * operator-defined groupings, configured per-label by the brand operator,
736
+ * shared across BOTH missions and badges — the same list is returned for
737
+ * both entity types. A mission or badge can belong to **zero or more**
738
+ * categories (many-to-many) via its `category_ids: number[]` field on
739
+ * `TMissionOrBadge`.
740
+ *
741
+ * Returned by `_smartico.api.getAchCategories()`. See that method's TSDoc
742
+ * for translation, refresh, and rendering details.
685
743
  */
686
744
  export interface TAchCategory {
687
- /**ID of the badge category */
745
+ /** Stable numeric ID of the category. Used as the key when joining to
746
+ * `TMissionOrBadge.category_ids: number[]`. */
688
747
  id: number;
689
- /**Name of the badge category */
748
+ /** Display name of the category, pre-translated server-side. Never null. */
690
749
  name: string;
691
- /**Order of the badge category among other categories. Default value is 1 */
750
+ /** Relative display position (lower = appears first). Default 1 when the
751
+ * operator did not configure an explicit order. */
692
752
  order: number;
693
753
  }
694
754
  /**
@@ -740,8 +800,8 @@ export interface TMissionOrBadge {
740
800
  /** The text of the CTA button, e.g. 'Make a deposit' */
741
801
  cta_text: string;
742
802
  /**
743
- * The ID of the custom section where the mission or badge is assigned
744
- * The list of custom sections can be retrieved using _smartico.api.getCustomSections() method (TODO-API)
803
+ * The ID of the custom section where the mission or badge is assigned.
804
+ * Resolve to section metadata via `_smartico.api.getCustomSections()`.
745
805
  */
746
806
  custom_section_id: number;
747
807
  /** 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 */
@@ -760,7 +820,8 @@ export interface TMissionOrBadge {
760
820
  position?: number;
761
821
  /** The ribbon of the mission/badge item. Can be 'sale', 'hot', 'new', 'vip' or URL to the image in case of custom ribbon, 250x300px */
762
822
  ribbon?: TRibbon;
763
- /** ID of the completion fact from ach_completed or ach_completed_recurring tables */
823
+ /** Stable identifier of this specific mission completion. Undefined for
824
+ * badges and for missions that have not yet completed. */
764
825
  ach_completed_id?: number;
765
826
  /** Flag from achievement if the mission prize will be given only after user claims it */
766
827
  requires_prize_claim?: boolean;
@@ -844,234 +905,331 @@ export interface TMissionOrBadgeTask {
844
905
  execution_count_actual?: number;
845
906
  }
846
907
  /**
847
- * TMissionOptInResult describes the response of call to _smartico.api.requestMissionOptIn(mission_id) method
908
+ * Response of `_smartico.api.requestMissionOptIn(mission_id)`.
909
+ *
910
+ * See `requestMissionOptIn` TSDoc for the full table of `err_code` values
911
+ * and recommended UI handling.
848
912
  */
849
913
  export interface TMissionOptInResult {
850
- /** Error code that represents outcome of the opt-in request. Successful opt-in in case err_code is 0 */
914
+ /** Error code. `0` = success. See `requestMissionOptIn` TSDoc for the full table. */
851
915
  err_code: number;
852
- /** Optional error message */
916
+ /** Optional error message; populated on non-zero `err_code`. */
853
917
  err_message: string;
854
918
  }
855
919
  /**
856
- * TMissionClaimRewardResult describes the response of call to _smartico.api.requestMissionClaimReward(mission_id, ach_completed_id) method
920
+ * Response of `_smartico.api.requestMissionClaimReward(mission_id, ach_completed_id)`.
921
+ *
922
+ * See `requestMissionClaimReward` TSDoc for the full table of `err_code`
923
+ * values, preconditions, side effects, and recommended UI handling.
857
924
  */
858
925
  export interface TMissionClaimRewardResult {
859
- /** Error code that represents outcome of the claim request. Successful claim reward in case err_code is 0 */
926
+ /** Error code. `0` = success (rewards credited). See `requestMissionClaimReward` TSDoc for the full table. */
860
927
  err_code: number;
861
- /** Optional error message */
928
+ /** Optional error message; populated on non-zero `err_code`. */
862
929
  err_message: string;
863
930
  }
931
+ /**
932
+ * Result of `_smartico.api.registerInTournament(tournament_id)`.
933
+ */
864
934
  export interface TTournamentRegistrationResult {
865
- /** Error code that represents outcome of the tournament registration request. Successful registration in case err_code is 0 */
935
+ /** Error code. `0` = success. See `registerInTournament` TSDoc for the full table. */
866
936
  err_code: TournamentRegistrationError;
867
- /** Optional error message */
937
+ /** Optional error message; populated on non-zero `err_code`. */
868
938
  err_message: string;
869
939
  }
940
+ /**
941
+ * Result of `_smartico.api.buyStoreItem(store_item_id)`.
942
+ */
870
943
  export interface TBuyStoreItemResult {
871
- /** Error code representing the result of the purchase of the shop item. Successful purchase if err_code is 0
872
- *
873
- * Example for error handling:
874
- * ```javascript
875
- * SmarticoAPI.buyStoreItem(item_id).then(res => {
876
- * if (res.err_code !== 0) {
877
- * // YOUR LOGIC HERE, you can use res.err_message, but it's optional and not always present
878
- * }
879
- * });
880
- * ```
881
- */
944
+ /** Error code. `0` = success. See `buyStoreItem` TSDoc for the full table. */
882
945
  err_code: BuyStoreItemErrorCode;
883
- /** Optional error message */
946
+ /** Optional error message; populated on non-zero `err_code`. */
884
947
  err_message: string;
885
948
  }
949
+ /**
950
+ * Result of `getTranslations(lang_code)`.
951
+ */
886
952
  export interface TGetTranslations {
953
+ /** Flat dictionary of operator-defined translation key → translated string. */
887
954
  translations: {
888
955
  [key: string]: string;
889
956
  };
890
957
  }
958
+ /**
959
+ * TInboxMessage is the lightweight envelope returned by
960
+ * `_smartico.api.getInboxMessages()`. Fetch the rich body (title,
961
+ * preview, icon, html_body, buttons) separately via
962
+ * `_smartico.api.getInboxMessageBody(message_guid)`.
963
+ */
891
964
  export interface TInboxMessage {
892
- /** Uniq identifier of the message. It is needed to request the message body, mark the message as read/deleted/favorite. */
965
+ /** Unique identifier of the message. Pass to `getInboxMessageBody`
966
+ * and the mark / favorite / delete mutations. */
893
967
  message_guid: string;
894
- /** Date when the message was sent */
968
+ /** Date when the message was sent (server timestamp). */
895
969
  sent_date: string;
896
- /** Indicator if a message is read */
970
+ /** `true` when the message has been marked read. */
897
971
  read: boolean;
898
- /** Indicator if a message is added to favorites */
972
+ /** `true` when the message has been starred (favorited). */
899
973
  favorite: boolean;
900
- /** Category id per inbox message, can be part of System inboxes, Personal inboxes or General inbox messages */
974
+ /** Operator-assigned category ({@link InboxCategories}). */
901
975
  category_id?: InboxCategories;
902
- /** The epoch timestamp, with milliseconds, when the message is going to be expired */
976
+ /** Expiry timestamp as Unix-ms epoch. Server filters out expired
977
+ * messages from list responses — consumers rarely see this set
978
+ * unless the expiry is upcoming. */
903
979
  expire_on_dt?: number;
904
980
  }
981
+ /**
982
+ * TInboxMessageBody is the rich body of one inbox message.
983
+ * Returned by `_smartico.api.getInboxMessageBody(message_guid)`.
984
+ * Fetched from a CDN (not over WebSocket).
985
+ */
905
986
  export interface TInboxMessageBody {
906
- /** Message title */
987
+ /** Display title. */
907
988
  title: string;
908
- /** Short preview body of the message */
989
+ /** Short preview text (typically rendered alongside the title in list items). */
909
990
  preview_body: string;
910
- /** Message icon, 128x128px */
991
+ /** Message icon URL (128×128 px recommended). */
911
992
  icon: string;
912
- /** The action that should be performed when user clicks on the message.
913
- * 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);
914
- * The 'dp' function will handle the CTA and will execute it in the most safe way.
915
- * If the message has a rich html body - the action will always be 'dp:inbox' which will open the inbox widget when triggered.
916
- */
993
+ /** Click-action — either a deep-link (e.g. `'dp:deposit'`) or a
994
+ * plain URL. The literal `'dp:inbox'` indicates the message has a
995
+ * rich `html_body`; for any other value `html_body` and `buttons`
996
+ * are absent. Pass to `_smartico.dp(action)` for safe execution. */
917
997
  action: string;
918
- /** Rich HTML body of the message. */
998
+ /** Rich HTML body. Populated only when `action === 'dp:inbox'`. */
919
999
  html_body?: string;
920
- /** Optional additional buttons to show in the message, available only if message has rich HTML body. Max count - 2. */
1000
+ /** Up to 2 additional action buttons. Populated only when
1001
+ * `action === 'dp:inbox'`. */
921
1002
  buttons?: {
922
- /** The action that should be performed when user clicks on the button. The logic is the same as for message actions */
1003
+ /** Button click-action (deep-link or URL). */
923
1004
  action: string;
924
- /** Button text */
1005
+ /** Button label. */
925
1006
  text: string;
926
1007
  }[];
927
- /** The custom data of the inbox message defined by operator. Can be a JSON object, string or number */
1008
+ /** Operator-defined custom data. The SDK auto-parses JSON-looking
1009
+ * strings, so at runtime this is `any` despite the `string` type. */
928
1010
  custom_data?: string;
929
1011
  }
1012
+ /**
1013
+ * InboxMarkMessageAction is the response of the five inbox mutation
1014
+ * methods (`markInboxMessageAsRead`, `markAllInboxMessagesAsRead`,
1015
+ * `markUnmarkInboxMessageAsFavorite`, `deleteInboxMessage`,
1016
+ * `deleteAllInboxMessages`).
1017
+ */
930
1018
  export interface InboxMarkMessageAction {
931
- /** An error code representing the result of marking a message as deleted, favorite or read. Successful marking action if err_code is 0 */
1019
+ /** Error code. `0` = success. See the calling method's TSDoc for
1020
+ * the full error semantics (server returns generic codes; the
1021
+ * five inbox mutations share the same shape). */
932
1022
  err_code: number;
933
- /** Optional error message */
1023
+ /** Optional server-side error message. Present only on non-zero
1024
+ * `err_code`; may be empty even then. */
934
1025
  err_message: string;
935
1026
  }
1027
+ /**
1028
+ * LeaderBoardDetailsT describes one period's leaderboard.
1029
+ * Returned by `_smartico.api.getLeaderBoard(periodType, getPreviousPeriod?)`.
1030
+ * May be `undefined` at runtime when no board is configured for the requested period.
1031
+ */
936
1032
  export interface LeaderBoardDetailsT {
937
- /** ID of the leaderboard */
1033
+ /** Stable ID of the leaderboard. */
938
1034
  board_id: number;
939
- /** Name of the leaderboard */
1035
+ /** Operator-defined display name. */
940
1036
  name: string;
941
- /** Description of the leaderboard */
1037
+ /** Operator-defined description (HTML allowed). */
942
1038
  description: string;
943
- /** Rules of the leaderboard */
1039
+ /** Operator-defined rules / terms (HTML allowed). */
944
1040
  rules: string;
945
- /** Leaderboard period type ID */
1041
+ /** Period type this board is bound to ({@link LeaderBoardPeriodType}). */
946
1042
  period_type_id: LeaderBoardPeriodType;
947
- /** Leaderboard points rewards */
1043
+ /** Per-place prize table; the array length is the number of paid places. */
948
1044
  rewards: LeaderBoardsRewardsT[];
949
- /** Leaderboard users */
1045
+ /** Top-20 ranked entries (server-capped), sorted by `position` ASC. */
950
1046
  users: LeaderBoardUserT[];
951
- /** Info about current user in leaderboard */
1047
+ /** Current user's own entry. `undefined` for visitor sessions.
1048
+ * For authenticated users, `position === -1` means the user is
1049
+ * unranked / outside the ranked window. */
952
1050
  me?: LeaderBoardUserT;
953
1051
  }
1052
+ /**
1053
+ * LeaderBoardsRewardsT describes one place's prize on a leaderboard.
1054
+ * Leaderboard prizes are always gamification points (never gems / diamonds / items).
1055
+ */
954
1056
  export interface LeaderBoardsRewardsT {
1057
+ /** Place number (1-based). */
955
1058
  place: number;
1059
+ /** Gamification points awarded to the user occupying this place at period finalization. */
956
1060
  points: number;
957
1061
  }
1062
+ /**
1063
+ * LeaderBoardUserT describes one participant row on a leaderboard.
1064
+ */
958
1065
  export interface LeaderBoardUserT {
959
- /** The username of the participant */
1066
+ /** Display username (operator-defined alias). */
960
1067
  public_username: string;
961
- /** The URL to the avatar of the participant */
1068
+ /** Resolved CDN URL for the participant's avatar. */
962
1069
  avatar_url: string;
963
- /** The position of the participant in the leaderboard */
1070
+ /** Rank in the leaderboard (DENSE_RANK over all participants).
1071
+ * `-1` on the `me` entry signals "unranked / outside the window". */
964
1072
  position: number;
965
- /** The points of the participant in the leaderboard */
1073
+ /** Participant's points for this period. */
966
1074
  points: number;
967
- /** The indicator if the participant is current user */
1075
+ /** `true` when this row is the current authenticated user. */
968
1076
  is_me: boolean;
969
1077
  }
1078
+ /**
1079
+ * UserLevelExtraCountersT exposes the user's current values for the two
1080
+ * label-defined sliding-window level counters. Returned by
1081
+ * `_smartico.api.getUserLevelExtraCounters()`. Both fields are
1082
+ * `undefined` on points-only labels.
1083
+ */
970
1084
  export interface UserLevelExtraCountersT {
971
- /** The counter of 1st metric used to reach the level. */
1085
+ /** Current value of the user's first level counter. Operator-defined
1086
+ * semantics per label. `undefined` on points-only labels. */
972
1087
  level_counter_1?: number;
973
- /** The counter of 2nd metric used to reach the level. */
1088
+ /** Current value of the user's second level counter. Operator-defined
1089
+ * semantics per label. `undefined` on points-only labels. */
974
1090
  level_counter_2?: number;
975
1091
  }
1092
+ /**
1093
+ * TSegmentCheckResult describes one segment-membership outcome.
1094
+ * Returned by `_smartico.api.checkSegmentListMatch()` (and used
1095
+ * internally by `checkSegmentMatch()`).
1096
+ */
976
1097
  export interface TSegmentCheckResult {
1098
+ /** The segment ID this result refers to (label-scoped). */
977
1099
  segment_id: number;
1100
+ /** `true` if the user currently matches this segment. `false` also
1101
+ * covers the case where the segment doesn't exist for the label —
1102
+ * the two are not distinguishable. */
978
1103
  is_matching: boolean;
979
1104
  }
1105
+ /**
1106
+ * One operator-configured navigation entry. Returned by `getCustomSections()`.
1107
+ * `section_type_id` is the dispatch key — it determines which page component the
1108
+ * consumer mounts when the user opens this section.
1109
+ */
980
1110
  export interface TUICustomSection {
981
- /** The ID of the custom section */
1111
+ /** Stable numeric ID of the section. */
982
1112
  id: number;
983
- /** The body of the custom section */
1113
+ /** Raw HTML body for `HTML_PAGE` sections; Liquid template body for `LEVELS` (Liquid) sections. */
984
1114
  body?: string;
985
- /** The image of the custom section, 64x64px */
1115
+ /** CDN URL of the section's nav icon, 64x64 px square. */
986
1116
  menu_img?: string;
987
- /** The name of the custom section */
1117
+ /** Display name shown next to the nav icon. Pre-translated server-side. */
988
1118
  menu_name?: string;
989
- /** Custom images for custom section */
1119
+ /** JSON-serialized list of skin image overrides for themed sections (e.g. `MISSION_CUSTOM_LAYOUT`). */
990
1120
  custom_skin_images?: string;
991
- /** The particular type of custom section, can be Missions, Tournaments, Lootbox and etc */
1121
+ /** Dispatch key — see {@link AchCustomSectionType}. */
992
1122
  section_type_id?: AchCustomSectionType;
993
- /** Theme of the custom section */
1123
+ /** Themed-layout name for `MISSION_CUSTOM_LAYOUT` sections; see {@link AchCustomLayoutTheme}. */
994
1124
  theme?: AchCustomLayoutTheme;
995
- /** Custom css for the custom section */
1125
+ /** Custom CSS for themed layouts. */
996
1126
  generic_custom_css?: string;
997
- /** Tabs that can be shown in custom section, e.g Overview, No Overview, All tabs */
1127
+ /** Which tabs to render for `MISSIONS_CATEGORY` sections; see {@link AchMissionsTabsOptions}. */
998
1128
  mission_tabs_options?: AchMissionsTabsOptions;
999
- /** Filter that allow to show missions by criteria */
1129
+ /** Mission-filter rule for the Overview tab; see {@link AchOverviewMissionsFilter}. */
1000
1130
  overview_missions_filter?: AchOverviewMissionsFilter;
1001
- /** Quantity of missions to be shown in overview */
1131
+ /** Maximum number of missions shown in the Overview tab. */
1002
1132
  overview_missions_count?: number;
1003
- /** URL or DP to be used for custom section */
1133
+ /** Click target for `REDIRECT_LINK` sections — either a Smartico DP string (`dp:…`) or an external URL. */
1004
1134
  url_or_dp?: string;
1005
- /** Data to be used for Liquid templates */
1135
+ /** Data-context selectors for Liquid templates; see {@link LiquidEntityData}. */
1006
1136
  liquid_entity_data?: LiquidEntityData[];
1007
- /** Tournament ID to be used for Liquid templates */
1137
+ /** Tournament ID for a single-tournament Liquid template (`LiquidEntityData.Tournament`). */
1008
1138
  ach_tournament_id?: number;
1009
- /** Indicates if the data should be shown as raw data (for Liquid templates) */
1139
+ /** Operator debug flag — when `true`, Liquid renders raw context data instead of the templated HTML. */
1010
1140
  show_raw_data?: boolean;
1011
- /** Liquid template id to be used for Liquid templates */
1141
+ /** Liquid template ID resolved server-side; the rendered body is delivered in `body`. */
1012
1142
  liquid_template?: number;
1013
- /** List of IDs of the categories where the badge item is assigned, information about categories can be retrieved with getAchCategories method */
1143
+ /** Category IDs the section filters badges by — correlate with `getAchCategories()`. */
1014
1144
  ach_category_ids?: number[];
1015
- /** List of IDs of the categories where the store item is assigned, information about categories can be retrieved with getShopCategories method */
1145
+ /** Category IDs the section filters store items by — correlate with `getStoreCategories()`. */
1016
1146
  shop_category_ids?: number[];
1017
- /** ID of the raffle to be used for Liquid templates */
1147
+ /** Raffle ID for `RAFFLE` sections (and `LiquidEntityData.SingleRaffle` Liquid templates). */
1018
1148
  raffle_id?: number;
1019
1149
  }
1150
+ /**
1151
+ * TBonus describes one bonus awarded to the user.
1152
+ * Returned by `_smartico.api.getBonuses()`.
1153
+ */
1020
1154
  export interface TBonus {
1021
- /** ID of the bonus */
1155
+ /** Stable ID of the bonus. */
1022
1156
  bonus_id: number;
1023
- /** Can the bonus be redeemed (if bonus is redeemable the user needs to claim it) */
1157
+ /** `true` when the bonus is in a player-claim-required state.
1158
+ * Gate the Claim button on this; see `claimBonus` TSDoc. */
1024
1159
  is_redeemable?: boolean;
1025
- /** Date of creation */
1160
+ /** Bonus creation timestamp as ISO 8601 UTC string
1161
+ * ("YYYY-MM-DDTHH:MM:SS", no timezone suffix). */
1026
1162
  create_date?: string;
1027
- /** Date of redemption */
1163
+ /** Bonus redemption timestamp as ISO 8601 UTC string. Absent until
1164
+ * the bonus reaches `BonusStatus.REDEEMED`. */
1028
1165
  redeem_date?: string;
1029
- /** ID of template used */
1166
+ /** ID of the bonus template used to issue this bonus. */
1030
1167
  label_bonus_template_id?: number;
1031
- /** ID of the bonus status */
1168
+ /** Lifecycle status; see {@link BonusStatus}. */
1032
1169
  bonus_status_id?: BonusStatus;
1033
- /** Additional information about the bonus(edscription, image,name, acknowledge) */
1170
+ /** Template-level display metadata (operator-configured, identical
1171
+ * across all bonuses from the same template). */
1034
1172
  label_bonus_template_meta_map?: BonusTemplateMetaMap;
1035
- /** Additional information presented to the player when the bonus is redeemed */
1173
+ /** Instance-level display metadata (per-issuance; carries the
1174
+ * dynamic amount computed at award time). */
1036
1175
  bonus_meta_map?: BonusMetaMap;
1037
1176
  }
1177
+ /**
1178
+ * BonusStatus describes the lifecycle stage of a bonus on `TBonus.bonus_status_id`.
1179
+ * Operator widget configuration typically filters out internal statuses
1180
+ * (`New`, `COUPON_ISSUE_FAILED`, `EXPIRED`); consumers usually see
1181
+ * `COUPON_ISSUED`, `REDEEMED`, and `REDEEM_FAILED`.
1182
+ */
1038
1183
  export declare enum BonusStatus {
1039
- /** The bonus is newly created (shouldn't be shown to the client) */
1184
+ /** Newly created, not yet processed (internal). */
1040
1185
  New = 1,
1041
- /** The bonus is issued and available for redemption but has not been redeemed yet */
1186
+ /** Issued and awaiting player claim. */
1042
1187
  COUPON_ISSUED = 2,
1043
- /** The bonus has been successfully redeemed */
1188
+ /** Successfully redeemed. */
1044
1189
  REDEEMED = 3,
1045
- /** The bonus is still valid, but a previous redemption attempt failed */
1190
+ /** Previous redemption attempt failed; still valid and re-claimable. */
1046
1191
  REDEEM_FAILED = 4,
1047
- /** Failed to issue the bonus (shouldn't be shown to the client) */
1192
+ /** Coupon issuance failed (internal). */
1048
1193
  COUPON_ISSUE_FAILED = 5,
1049
- /** The bonus was issued but has expired and can no longer be redeemed (shouldn't be shown to the client) */
1194
+ /** Issued but expired before redemption (internal). */
1050
1195
  EXPIRED = 6
1051
1196
  }
1197
+ /**
1198
+ * Template-level bonus display metadata (operator-configured at the
1199
+ * bonus template; identical for every bonus issued from the same template).
1200
+ */
1052
1201
  export interface BonusTemplateMetaMap {
1053
- /** Description of the bonus template*/
1202
+ /** Operator-set description / display text. May include HTML. */
1054
1203
  description: string;
1055
- /** Acknowledge message setup in the bonus template*/
1204
+ /** Operator-set additional message shown to the player at claim
1205
+ * time (e.g. wagering terms). May include deep-links. */
1056
1206
  acknowledge: string;
1057
- /** Image URL of the bonus template, 1:1 aspect ratio */
1207
+ /** Bonus icon URL (1:1 aspect ratio recommended). */
1058
1208
  image_url: string;
1059
- /** Redirect URL of the bonus template*/
1209
+ /** Optional redirect — external HTTP URL (opens in new tab) or
1210
+ * internal deep-link (handled by the SDK's deep-link router). */
1060
1211
  redirect_url?: string;
1061
1212
  }
1213
+ /**
1214
+ * Instance-level bonus display metadata (set per-issuance, may carry
1215
+ * a dynamically-computed amount).
1216
+ */
1062
1217
  export interface BonusMetaMap {
1063
- /** Label and description of the bonus sent to the player*/
1218
+ /** Display-ready amount string (e.g. "€50", "100 free spins"). */
1064
1219
  uiAmount?: string;
1065
1220
  }
1066
1221
  /**
1067
- * TClaimBonusResult describes the response of call to _smartico.api.claimBonus(bonus_id) method
1222
+ * TClaimBonusResult describes the response of `_smartico.api.claimBonus(bonus_id)`.
1223
+ */
1224
+ /**
1225
+ * Result of `_smartico.api.claimBonus(bonus_id)`.
1068
1226
  */
1069
1227
  export interface TClaimBonusResult {
1070
- /** Error code that represents outcome of the game play attempt. Game succeed to be played in case err_code is 0 */
1071
- err_code: SAWSpinErrorCode;
1072
- /** Optional error message */
1228
+ /** Error code. `0` = success. See `claimBonus` TSDoc for the full table. */
1229
+ err_code: number;
1230
+ /** Optional error message; populated on non-zero `err_code`. */
1073
1231
  err_message: string;
1074
- /** If the bonus was claimed successfully, then success is true */
1232
+ /** Unreliable on the wire — prefer `err_code === 0` as the success check. */
1075
1233
  success?: boolean;
1076
1234
  }
1077
1235
  export interface TSawHistory {
@@ -1415,10 +1573,23 @@ export interface TRaffleDrawRun {
1415
1573
  */
1416
1574
  has_unclaimed_prize: boolean;
1417
1575
  }
1576
+ /**
1577
+ * TransformedRaffleClaimPrizeResponse describes the response of
1578
+ * `_smartico.api.claimRafflePrize({won_id})`.
1579
+ *
1580
+ * Note: this type uses `errorCode` / `errorMessage` (camelCase
1581
+ * full-word) — different from most other SDK wrapper-result types in
1582
+ * this library which use `err_code` / `err_message` (snake_case).
1583
+ */
1584
+ /**
1585
+ * Result of `_smartico.api.claimRafflePrize({raffle_id, draw_id, raffle_run_id})`.
1586
+ * Uses camelCase `errorCode` / `errorMessage` — distinct from most other SDK
1587
+ * result wrappers which use snake_case `err_code` / `err_message`.
1588
+ */
1418
1589
  export interface TransformedRaffleClaimPrizeResponse {
1419
- /** Error code, 0 means no error */
1590
+ /** Error code. `0` = success. See `claimRafflePrize` TSDoc for the full table. */
1420
1591
  errorCode: number;
1421
- /** Error message, will be exposed only if ErrorCode is not 0 */
1592
+ /** Optional error message; populated on non-zero `errorCode`. */
1422
1593
  errorMessage?: string;
1423
1594
  }
1424
1595
  /**
@@ -1443,10 +1614,13 @@ export interface TActivityLog {
1443
1614
  /** Source type ID indicating what triggered this change */
1444
1615
  source_type_id: PointChangeSourceType;
1445
1616
  }
1617
+ /**
1618
+ * Result of `_smartico.api.requestRaffleOptin({raffle_id, draw_id, raffle_run_id})`.
1619
+ */
1446
1620
  export interface TRaffleOptinResponse {
1447
- /** Error code that represents outcome of the opt-in attempt. Opt-in succeed in case err_code is 0 */
1621
+ /** Error code. `0` = success. See `requestRaffleOptin` TSDoc for the full table. */
1448
1622
  err_code: number;
1449
- /** Optional error message */
1623
+ /** Optional error message; populated on non-zero `err_code`. */
1450
1624
  err_message?: string;
1451
1625
  }
1452
1626
  /**
@@ -1908,72 +2082,69 @@ export interface GamePickRoundRequestParams extends GamePickRequestParams {
1908
2082
  round_id: number;
1909
2083
  }
1910
2084
  /**
1911
- * TAvatarDefinition describes a single avatar available in the avatar catalog.
2085
+ * One avatar in the user's catalog. Returned by `getAvatarsList()`.
1912
2086
  * Fields from the raw `public_meta` object are flattened to the top level.
1913
2087
  */
1914
2088
  export interface TAvatarDefinition {
1915
- /** Unique identifier of the avatar */
2089
+ /** Stable numeric identifier of the avatar. Primary key passed to `setAvatar()`. */
1916
2090
  avatar_real_id: number;
1917
- /** Whether this avatar is the default one */
2091
+ /** True when this is the system default avatar for the label. */
1918
2092
  is_default: boolean;
1919
- /** If true, avatar is hidden until user achieves/unlocks it */
2093
+ /** When true and `is_given === false`, the avatar should be hidden from the user (surprise unlock). */
1920
2094
  hide_until_achieved: boolean;
1921
- /** Display priority — lower value means higher position in the grid */
2095
+ /** Display position; lower = earlier in the grid. */
1922
2096
  priority: number;
1923
- /** Optional description of the avatar (from public_meta) */
2097
+ /** Optional description shown alongside the avatar in detail views. */
1924
2098
  description?: string;
1925
- /** Raw image path/URL of the avatar as returned by the server (from public_meta) */
2099
+ /** Raw image path as returned by the server (relative or absolute). */
1926
2100
  url: string;
1927
- /** Full CDN URL of the avatar image, built from avatar_domain + url */
2101
+ /** Absolute CDN URL of the avatar image; built from the configured avatar domain + `url`. */
1928
2102
  avatar_url: string;
1929
- /**
1930
- * Source type of the avatar.
1931
- * 0 = free (always available to all users), other values = earned/purchased
1932
- */
2103
+ /** Source type. `0` = free / always available; non-zero = earned or purchased. */
1933
2104
  avatar_source_type_id: number;
1934
- /** ISO date string from which the avatar becomes available */
2105
+ /** ISO date string from which the avatar becomes available; undefined when no start window. */
1935
2106
  active_from_date?: string;
1936
- /** ISO date string until which the avatar is available */
2107
+ /** ISO date string until which the avatar is available; undefined when no end window. */
1937
2108
  active_till_date?: string;
1938
- /** Whether the avatar has been granted/given to the current user */
2109
+ /** True when the user owns / has unlocked this avatar. */
1939
2110
  is_given: boolean;
1940
- /** Whether this avatar is currently in use by the user */
2111
+ /** True when this avatar is the user's currently active profile avatar. */
1941
2112
  is_in_use?: boolean;
1942
2113
  }
1943
2114
  /**
1944
- * TAvatarCustomized describes an AI-customized version of a base avatar
2115
+ * One AI-generated variant of a base avatar. Returned by `getAvatarsCustomized()`.
1945
2116
  */
1946
2117
  export interface TAvatarCustomized {
1947
- /** The avatar_real_id of the base avatar this customization was generated from */
2118
+ /** `avatar_real_id` of the base avatar this variant was generated from. */
1948
2119
  avatar_real_id: number;
1949
- /** Full CDN URL of the AI-generated customized avatar image */
2120
+ /** Absolute CDN URL of the AI-generated image. Can be passed as `avatar_url` to `setAvatar()`. */
1950
2121
  url: string;
1951
- /** ISO date string when the customization was created */
2122
+ /** ISO date string of when the variant was generated. */
1952
2123
  dt_created: string;
1953
2124
  }
1954
2125
  /**
1955
- * TAvatarPrompt describes an AI style prompt available for avatar customization.
2126
+ * One AI style prompt for avatar customization. Returned by `getAvatarPrompts()`.
1956
2127
  * Fields from the raw `public_meta` object are flattened to the top level.
1957
2128
  */
1958
2129
  export interface TAvatarPrompt {
1959
- /** Unique identifier of the AI customization prompt */
2130
+ /** Stable numeric identifier of the prompt. */
1960
2131
  prompt_id: number;
1961
- /** Display name of the prompt style, e.g. "Cartoon", "Watercolor" (from public_meta) */
2132
+ /** Display name of the style, e.g. "Cartoon", "Watercolor". */
1962
2133
  name: string;
1963
- /** Full CDN URL of the prompt style icon image (from public_meta) */
2134
+ /** Absolute CDN URL of the prompt's preview icon. */
1964
2135
  icon_url: string;
1965
- /** Currency type used to pay for this customization (0=points, 1=gems, 2=diamonds) */
2136
+ /** Currency used to pay for the customization. `0` = points, `1` = gems, `2` = diamonds. */
1966
2137
  cost_currency_type_id: number;
1967
- /** Cost amount in the given currency */
2138
+ /** Cost amount in the currency named by `cost_currency_type_id`. */
1968
2139
  cost_value: number;
1969
2140
  }
1970
2141
  /**
1971
- * TSetAvatarResult describes the response of call to _smartico.api.setAvatar() method
2142
+ * Result of `_smartico.api.setAvatar()`.
1972
2143
  */
1973
2144
  export interface TSetAvatarResult {
1974
- /** Error code that represents outcome of the set avatar request. Successful if err_code is 0 */
2145
+ /** Error code. `0` = success. See `setAvatar` TSDoc for the full table. */
1975
2146
  err_code: number;
1976
- /** Optional error message */
2147
+ /** Optional error message; populated on non-zero `err_code`. */
1977
2148
  err_message?: string;
1978
2149
  }
1979
2150
  export { SAWAcknowledgeTypeName, PrizeModifiers, SAWTemplateUI, InboxCategories, AchCustomSectionType, SAWAskForUsername, SAWGameLayout, PointChangeSourceType, UserBalanceType, SAWGPMarketType, QuizAnswersValueType };