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