@smartico/public-api 0.0.380 → 0.0.382

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 (178) hide show
  1. package/CLAUDE.md +103 -0
  2. package/README.md +32 -10
  3. package/dist/Base/ClassId.d.ts +2 -0
  4. package/dist/Jackpots/JackpotDetails.d.ts +14 -15
  5. package/dist/Jackpots/JackpotPot.d.ts +10 -6
  6. package/dist/MiniGames/SAWGameType.d.ts +3 -1
  7. package/dist/MiniGames/SAWTemplateUI.d.ts +7 -0
  8. package/dist/Raffle/GetRaffleWonPrizesRequest.d.ts +9 -0
  9. package/dist/Raffle/GetRaffleWonPrizesResponse.d.ts +52 -0
  10. package/dist/Raffle/index.d.ts +2 -0
  11. package/dist/SmarticoAPI.d.ts +6 -1
  12. package/dist/SmarticoLib/index.d.ts +5 -1
  13. package/dist/WSAPI/WSAPIAvatars.d.ts +267 -49
  14. package/dist/WSAPI/WSAPIBonuses.d.ts +224 -10
  15. package/dist/WSAPI/WSAPIGamePick.d.ts +538 -253
  16. package/dist/WSAPI/WSAPIGeneral.d.ts +156 -14
  17. package/dist/WSAPI/WSAPIInbox.d.ts +547 -58
  18. package/dist/WSAPI/WSAPIJackpots.d.ts +292 -57
  19. package/dist/WSAPI/WSAPILeaderBoard.d.ts +127 -13
  20. package/dist/WSAPI/WSAPIMiniGames.d.ts +465 -49
  21. package/dist/WSAPI/WSAPIRaffles.d.ts +576 -52
  22. package/dist/WSAPI/WSAPITournaments.d.ts +3 -3
  23. package/dist/WSAPI/WSAPITypes.d.ts +243 -132
  24. package/dist/WSAPI/WSAPIUser.d.ts +193 -43
  25. package/dist/index.js +3412 -616
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.modern.mjs +3395 -609
  28. package/dist/index.modern.mjs.map +1 -1
  29. package/docs/Callbacks.md +162 -0
  30. package/docs/SmarticoObject.md +445 -0
  31. package/docs/Transforms.md +99 -0
  32. package/docs/api/README.md +26 -0
  33. package/docs/api/classes/WSAPIAvatars.md +282 -54
  34. package/docs/api/classes/WSAPIBonuses.md +233 -12
  35. package/docs/api/classes/WSAPIClans.md +380 -10
  36. package/docs/api/classes/WSAPIGamePick.md +555 -26
  37. package/docs/api/classes/WSAPIGeneral.md +165 -16
  38. package/docs/api/classes/WSAPIInbox.md +588 -64
  39. package/docs/api/classes/WSAPIJackpots.md +320 -66
  40. package/docs/api/classes/WSAPILeaderBoard.md +133 -15
  41. package/docs/api/classes/WSAPIMiniGames.md +501 -64
  42. package/docs/api/classes/WSAPIMissions.md +58 -79
  43. package/docs/api/classes/WSAPIRaffles.md +647 -69
  44. package/docs/api/classes/WSAPIStore.md +83 -108
  45. package/docs/api/classes/WSAPITournaments.md +495 -28
  46. package/docs/api/classes/WSAPIUser.md +520 -83
  47. package/docs/api/documents/Callbacks.md +162 -0
  48. package/docs/api/documents/SmarticoObject.md +445 -0
  49. package/docs/api/documents/Transforms.md +99 -0
  50. package/docs/api/enumerations/BonusStatus-1.md +11 -6
  51. package/docs/api/enumerations/JoinClanErrorCode.md +81 -0
  52. package/docs/api/enumerations/TournamentRegistrationError.md +12 -0
  53. package/docs/api/functions/clanTournamentPlayersTransform.md +13 -0
  54. package/docs/api/interfaces/AvatarCustomized.md +25 -0
  55. package/docs/api/interfaces/AvatarDefinition.md +94 -0
  56. package/docs/api/interfaces/AvatarPrompt.md +45 -0
  57. package/docs/api/interfaces/BonusMetaMap-1.md +4 -1
  58. package/docs/api/interfaces/BonusTemplateMetaMap-1.md +9 -4
  59. package/docs/api/interfaces/Clan.md +4 -0
  60. package/docs/api/interfaces/ClanInfo.md +109 -0
  61. package/docs/api/interfaces/ClanMember.md +53 -0
  62. package/docs/api/interfaces/ClanTournamentPlayerRaw.md +67 -0
  63. package/docs/api/interfaces/GemsDiamondsLog.md +43 -0
  64. package/docs/api/interfaces/GetClanInfoResponse.md +61 -0
  65. package/docs/api/interfaces/GetClanTournamentPlayersResponse.md +81 -0
  66. package/docs/api/interfaces/GetRaffleWonPrizesRequest.md +59 -0
  67. package/docs/api/interfaces/GetRaffleWonPrizesResponse.md +95 -0
  68. package/docs/api/interfaces/InboxMarkMessageAction.md +10 -2
  69. package/docs/api/interfaces/JackpotDetails.md +14 -15
  70. package/docs/api/interfaces/JackpotPot.md +9 -6
  71. package/docs/api/interfaces/LeaderBoardDetailsT.md +14 -8
  72. package/docs/api/interfaces/LeaderBoardUserT.md +8 -5
  73. package/docs/api/interfaces/LeaderBoardsRewardsT.md +7 -0
  74. package/docs/api/interfaces/PointsLog.md +43 -0
  75. package/docs/api/interfaces/RaffleWonPrize.md +59 -0
  76. package/docs/api/interfaces/RaffleWonPrizePublicMeta.md +27 -0
  77. package/docs/api/interfaces/RaffleWonPrizeUser.md +43 -0
  78. package/docs/api/interfaces/TAchCategory.md +2 -7
  79. package/docs/api/interfaces/TAvatarCustomized.md +4 -4
  80. package/docs/api/interfaces/TAvatarDefinition.md +13 -14
  81. package/docs/api/interfaces/TAvatarPrompt.md +6 -6
  82. package/docs/api/interfaces/TBonus.md +16 -8
  83. package/docs/api/interfaces/TBuyStoreItemResult.md +4 -29
  84. package/docs/api/interfaces/TClaimBonusResult.md +5 -5
  85. package/docs/api/interfaces/TClan.md +8 -4
  86. package/docs/api/interfaces/TClanInfo.md +47 -0
  87. package/docs/api/interfaces/TClanJoinResult.md +11 -1
  88. package/docs/api/interfaces/TClanTournamentPlayer.md +55 -0
  89. package/docs/api/interfaces/TClanTournamentPlayersResult.md +27 -0
  90. package/docs/api/interfaces/TClans.md +3 -1
  91. package/docs/api/interfaces/TGetTranslations.md +4 -0
  92. package/docs/api/interfaces/TInboxMessage.md +14 -6
  93. package/docs/api/interfaces/TInboxMessageBody.md +18 -12
  94. package/docs/api/interfaces/TLevel.md +17 -20
  95. package/docs/api/interfaces/TLevelCurrent.md +19 -18
  96. package/docs/api/interfaces/TMiniGamePlayBatchResult.md +14 -6
  97. package/docs/api/interfaces/TMiniGamePlayResult.md +9 -4
  98. package/docs/api/interfaces/TMissionClaimRewardResult.md +1 -9
  99. package/docs/api/interfaces/TMissionOptInResult.md +1 -5
  100. package/docs/api/interfaces/TMissionOrBadge.md +4 -7
  101. package/docs/api/interfaces/TRaffleOptinResponse.md +4 -2
  102. package/docs/api/interfaces/TSegmentCheckResult.md +10 -0
  103. package/docs/api/interfaces/TSetAvatarResult.md +3 -3
  104. package/docs/api/interfaces/TStoreItem.md +3 -13
  105. package/docs/api/interfaces/TTournament.md +1 -1
  106. package/docs/api/interfaces/TTournamentDetailed.md +1 -1
  107. package/docs/api/interfaces/TTournamentRegistrationResult.md +4 -2
  108. package/docs/api/interfaces/TUICustomSection.md +23 -19
  109. package/docs/api/interfaces/TUserProfile.md +18 -16
  110. package/docs/api/interfaces/TransformedRaffleClaimPrizeResponse.md +6 -2
  111. package/docs/api/interfaces/UserLevelExtraCountersT.md +9 -2
  112. package/docs/api/type-aliases/ActivityLogEntry.md +3 -0
  113. package/docs/native/ADDING_METHODS.md +7 -2
  114. package/docs/native/PROTOCOL.md +337 -0
  115. package/docs/ui/avatars/UIGuide_getAvatarPrompts.md +100 -0
  116. package/docs/ui/avatars/UIGuide_getAvatarsCustomized.md +90 -0
  117. package/docs/ui/avatars/UIGuide_getAvatarsList.md +105 -0
  118. package/docs/ui/avatars/UIGuide_setAvatar.md +118 -0
  119. package/docs/ui/bonuses/UIGuide_claimBonus.md +144 -0
  120. package/docs/ui/bonuses/UIGuide_getBonuses.md +176 -0
  121. package/docs/ui/gamepick/UIGuide_gamePickGetActiveRound.md +99 -0
  122. package/docs/ui/gamepick/UIGuide_gamePickGetActiveRounds.md +76 -0
  123. package/docs/ui/gamepick/UIGuide_gamePickGetBoard.md +81 -0
  124. package/docs/ui/gamepick/UIGuide_gamePickGetGameInfo.md +78 -0
  125. package/docs/ui/gamepick/UIGuide_gamePickGetHistory.md +55 -0
  126. package/docs/ui/gamepick/UIGuide_gamePickGetRoundInfoForUser.md +71 -0
  127. package/docs/ui/gamepick/UIGuide_gamePickGetUserInfo.md +64 -0
  128. package/docs/ui/gamepick/UIGuide_gamePickSubmitSelection.md +103 -0
  129. package/docs/ui/gamepick/UIGuide_gamePickSubmitSelectionQuiz.md +67 -0
  130. package/docs/ui/general/UIGuide_getCustomSections.md +137 -0
  131. package/docs/ui/general/UIGuide_getRelatedItemsForGame.md +140 -0
  132. package/docs/ui/inbox/UIGuide_deleteInboxMessage.md +135 -0
  133. package/docs/ui/inbox/UIGuide_getInboxMessageBody.md +133 -0
  134. package/docs/ui/inbox/UIGuide_getInboxMessages.md +186 -0
  135. package/docs/ui/inbox/UIGuide_markInboxMessageAsRead.md +122 -0
  136. package/docs/ui/inbox/UIGuide_markUnmarkInboxMessageAsFavorite.md +84 -0
  137. package/docs/ui/jackpots/UIGuide_getJackpotEligibleGames.md +73 -0
  138. package/docs/ui/jackpots/UIGuide_getJackpotWinners.md +83 -0
  139. package/docs/ui/jackpots/UIGuide_jackpotGet.md +138 -0
  140. package/docs/ui/jackpots/UIGuide_jackpotOptIn.md +85 -0
  141. package/docs/ui/jackpots/UIGuide_jackpotOptOut.md +65 -0
  142. package/docs/ui/leaderboard/UIGuide_getLeaderBoard.md +166 -0
  143. package/docs/ui/minigames/UIGuide_getMiniGames.md +153 -0
  144. package/docs/ui/minigames/UIGuide_getMiniGamesHistory.md +90 -0
  145. package/docs/ui/minigames/UIGuide_playMiniGame.md +150 -0
  146. package/docs/ui/minigames/UIGuide_playMiniGameBatch.md +128 -0
  147. package/docs/ui/raffles/UIGuide_claimRafflePrize.md +99 -0
  148. package/docs/ui/raffles/UIGuide_getRaffleDrawRun.md +117 -0
  149. package/docs/ui/raffles/UIGuide_getRaffleDrawRunsHistory.md +92 -0
  150. package/docs/ui/raffles/UIGuide_getRaffleWonPrizes.md +120 -0
  151. package/docs/ui/raffles/UIGuide_getRaffles.md +175 -0
  152. package/docs/ui/raffles/UIGuide_requestRaffleOptin.md +114 -0
  153. package/docs/ui/user/UIGuide_getActivityLog.md +130 -0
  154. package/docs/ui/user/UIGuide_getLevels.md +47 -42
  155. package/package.json +1 -1
  156. package/src/Base/ClassId.ts +2 -0
  157. package/src/Jackpots/JackpotDetails.ts +14 -15
  158. package/src/Jackpots/JackpotPot.ts +10 -6
  159. package/src/MiniGames/SAWGameType.ts +3 -0
  160. package/src/MiniGames/SAWTemplateUI.ts +10 -0
  161. package/src/Raffle/GetRaffleWonPrizesRequest.ts +12 -0
  162. package/src/Raffle/GetRaffleWonPrizesResponse.ts +56 -0
  163. package/src/Raffle/index.ts +3 -1
  164. package/src/SmarticoAPI.ts +14 -1
  165. package/src/SmarticoLib/index.ts +4 -0
  166. package/src/WSAPI/WSAPIAvatars.ts +267 -49
  167. package/src/WSAPI/WSAPIBonuses.ts +224 -10
  168. package/src/WSAPI/WSAPIGamePick.ts +538 -253
  169. package/src/WSAPI/WSAPIGeneral.ts +156 -14
  170. package/src/WSAPI/WSAPIInbox.ts +545 -56
  171. package/src/WSAPI/WSAPIJackpots.ts +297 -61
  172. package/src/WSAPI/WSAPILeaderBoard.ts +127 -13
  173. package/src/WSAPI/WSAPIMiniGames.ts +465 -49
  174. package/src/WSAPI/WSAPIRaffles.ts +592 -64
  175. package/src/WSAPI/WSAPITournaments.ts +3 -3
  176. package/src/WSAPI/WSAPITypes.ts +243 -132
  177. package/src/WSAPI/WSAPIUser.ts +193 -43
  178. package/tsconfig.json +9 -1
@@ -3,27 +3,169 @@ import { GetRelatedAchTourResponse } from '../Missions/GetRelatedAchTourResponse
3
3
  import { WSAPIUser } from './WSAPIUser';
4
4
  /** @group General */
5
5
  export declare class WSAPIGeneral extends WSAPIUser {
6
+ /**
7
+ * Returns the operator-configured "custom sections" the current user is eligible
8
+ * to see. Custom sections are nav-level entries the operator builds in the BO —
9
+ * HTML pages, themed mission grids, store / raffle / tournament category pages,
10
+ * lootbox calendars, redirect links, and Liquid-templated dashboards — each
11
+ * surfaced with its own icon and label.
12
+ *
13
+ * Use the response to build the side menu / bottom-bar / nav grid of a
14
+ * gamification widget. Each section's `section_type_id` (see
15
+ * {@link AchCustomSectionType}) tells the consumer which page component to mount
16
+ * when the user opens the section.
17
+ *
18
+ * @remarks
19
+ * **Preconditions**
20
+ * - No prerequisite calls. Typically fetched once at app boot to build the
21
+ * navigation skeleton.
22
+ *
23
+ * **Server-side eligibility filtering**
24
+ * Sections are filtered server-side by the user's segments / level / brand and
25
+ * the section's `active_from_date` / `active_till_date` window. Sections the
26
+ * user is ineligible for are omitted from the response entirely — there is no
27
+ * "locked" state to render.
28
+ *
29
+ * **Ordering**
30
+ * Response is server-ordered. Render in the order received; do NOT re-sort
31
+ * client-side (the operator's order is the intended nav order).
32
+ *
33
+ * **Refresh**
34
+ * - The SDK caches results for 30 seconds.
35
+ * - No push subscription. Re-call after a segment / level change might
36
+ * make new sections eligible, or just rely on the 30 s cache turnover.
37
+ *
38
+ * **Visitor mode**: supported.
39
+ *
40
+ * **UI guidance**: see [UI Guide — `getCustomSections`](../../docs/ui/general/UIGuide_getCustomSections.md).
41
+ *
42
+ * @returns Array of {@link TUICustomSection} — empty if the label has no
43
+ * active custom sections or the user is ineligible for all of them.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const sections = await window._smartico.api.getCustomSections();
48
+ *
49
+ * for (const s of sections) {
50
+ * console.log('[smartico] nav entry', s.menu_name, 'type', s.section_type_id, '→ mount the matching page component');
51
+ * // Render s.menu_img (64x64) as the nav icon and s.menu_name as the label.
52
+ * // For section_type_id === AchCustomSectionType.REDIRECT_LINK, do NOT mount a page —
53
+ * // resolve s.url_or_dp on click (DP string or external URL).
54
+ * }
55
+ * ```
56
+ */
6
57
  getCustomSections(): Promise<TUICustomSection[]>;
7
58
  /**
8
- * Requests translations for the given language. Returns the object including translation key/translation value pairs. All possible translation keys defined in the back office.
59
+ * Returns the full set of operator-defined translation key/value pairs for the
60
+ * label, merged across the requested language and the English baseline.
61
+ *
62
+ * Translation keys are free-form strings defined by the operator in the BO. The
63
+ * SDK consumer treats the result as a flat dictionary: `translations[key]`. If
64
+ * the key is missing entirely, do NOT trust `undefined` semantics — defensively
65
+ * fall back to the key string itself or a hardcoded literal.
66
+ *
67
+ * @remarks
68
+ * **Preconditions**
69
+ * - No prerequisite calls.
70
+ * - `lang_code` is the ISO language code the operator uses in the BO
71
+ * (e.g. `"EN"`, `"FR"`, `"ES"`). Case is not normalised — match what the
72
+ * operator configured.
73
+ *
74
+ * **EN fallback**
75
+ * The SDK issues an English-baseline fetch first, then overlays the
76
+ * `lang_code` translations on top. Any key the operator has only defined in
77
+ * English (i.e. missing in the requested language) is returned with the
78
+ * English value. Keys missing in both are absent from the map — the consumer
79
+ * must handle missing keys (the default Smartico UI returns the key string
80
+ * itself as the fallback text).
81
+ *
82
+ * **What's included**
83
+ * The SDK passes an empty `areas` filter to the server, which returns ALL
84
+ * translation namespaces configured for the label (Gamification, Casino,
85
+ * Trading, Affiliation, etc. — whichever are populated). For a Gamification-
86
+ * only widget, the consumer can ignore unused namespaces — keys are flat
87
+ * strings, not nested.
88
+ *
89
+ * **Refresh**
90
+ * - Cached internally per `(lang_code, label, brand)` for ~30 seconds.
91
+ * - No push subscription. Operators editing translations in the BO will see
92
+ * the change after the cache window expires.
93
+ *
94
+ * **Visitor mode**: supported. Translations are label-scoped, not user-
95
+ * scoped — `lang_code` is the sole language selector and is independent of
96
+ * the `vapi(lang)` argument used elsewhere.
97
+ *
98
+ * @param lang_code ISO language code (e.g. `"EN"`, `"FR"`). Defaults to
99
+ * `"EN"` server-side if empty.
100
+ * @returns {@link TGetTranslations} — `{ translations: { [key]: string } }`.
101
+ *
102
+ * @example
103
+ * ```ts
104
+ * const r = await window._smartico.api.getTranslations('FR');
105
+ *
106
+ * // Defensive lookup: fall back to the key itself if the operator hasn't
107
+ * // defined the string.
108
+ * const t = (k: string) => r.translations[k] ?? k;
109
+ *
110
+ * console.log('[smartico] localized label "missions_title" →', t('missions_title'));
111
+ * ```
9
112
  */
10
113
  getTranslations(lang_code: string): Promise<TGetTranslations>;
11
114
  /**
12
- * Returns all the related tournaments and missions for the provided game id for the current user
13
- * The provided Game ID should correspond to the ID from the Games Catalog - https://help.smartico.ai/welcome/technical-guides/games-catalog-api
115
+ * Returns the missions and tournaments associated with a casino / sportsbook
116
+ * game in the operator's games catalog — the reverse of "given this mission,
117
+ * which games count for it" — so you can surface "play this game to progress
118
+ * mission X" / "tournament Y features this game" badges on game tiles or
119
+ * detail screens.
14
120
  *
15
- * **Example**:
16
- * ```
17
- * _smartico.api.getRelatedItemsForGame('gold-slot2').then((result) => {
18
- * console.log(result);
19
- * });
20
- * ```
121
+ * The shape mirrors `getMissions` (`UserAchievement[]`) and `getTournamentsList`
122
+ * (`Tournament[]`) — same wire types, no reduced subset.
21
123
  *
22
- * **Example in the Visitor mode**:
23
- * ```
24
- * _smartico.vapi('EN').getRelatedItemsForGame('gold-slot2').then((result) => {
25
- * console.log(result);
26
- * });
124
+ * @remarks
125
+ * **Preconditions**
126
+ * - `related_game_id` must be a Games Catalog ID (the same external string the
127
+ * operator uses in the catalog at
128
+ * {@link https://help.smartico.ai/welcome/technical-guides/games-catalog-api}).
129
+ *
130
+ * **Server-side eligibility filtering**
131
+ * Missions and tournaments are filtered by the user's segments / level / brand
132
+ * before being returned. A user who is ineligible for a mission segment will
133
+ * NOT see that mission in the result even if it lists the game. The same
134
+ * filtering applies to tournaments. Treat the response as "what this user
135
+ * should see" — no client-side eligibility pass needed.
136
+ *
137
+ * **No cache**
138
+ * Every call is a live server round-trip. Missions/tournaments are operator-
139
+ * mutated state (opt-in, completion, expiry) that changes during a session;
140
+ * caching staler than the user's last action would mis-render eligibility.
141
+ * Avoid building a consumer-side cache for UI-critical paths.
142
+ *
143
+ * **Refresh**
144
+ * - Re-call when the user navigates to a new game tile / detail surface.
145
+ * - Re-call after the user opts into / completes a related mission to refresh
146
+ * the "play this game" badge.
147
+ *
148
+ * **Visitor mode**: supported via `_smartico.vapi(lang).getRelatedItemsForGame(...)`.
149
+ *
150
+ * **UI guidance**: see [UI Guide — `getRelatedItemsForGame`](../../docs/ui/general/UIGuide_getRelatedItemsForGame.md).
151
+ *
152
+ * @param related_game_id External Games Catalog ID of the game (e.g. `"gold-slot2"`).
153
+ * @returns {@link GetRelatedAchTourResponse} — `{ achievements, tournaments? }`.
154
+ * `tournaments` may be `undefined` (treat as empty); both arrays may be empty
155
+ * when no eligible entities reference the game.
156
+ *
157
+ * @example
158
+ * ```ts
159
+ * const r = await window._smartico.api.getRelatedItemsForGame('gold-slot2');
160
+ *
161
+ * const missions = r.achievements ?? [];
162
+ * const tournaments = r.tournaments ?? [];
163
+ *
164
+ * if (missions.length === 0 && tournaments.length === 0) {
165
+ * console.log('[smartico] no related missions / tournaments — hide the related badge on the game tile');
166
+ * } else {
167
+ * console.log('[smartico] related entities:', missions.length, 'missions /', tournaments.length, 'tournaments — show a "X missions / Y tournaments" badge');
168
+ * }
27
169
  * ```
28
170
  */
29
171
  getRelatedItemsForGame(related_game_id: string): Promise<GetRelatedAchTourResponse>;