@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
@@ -0,0 +1,195 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Post-process step after `typedoc` runs.
4
+ *
5
+ * Fixes three cosmetic issues typedoc / typedoc-plugin-markdown produce
6
+ * that have no config flag to disable:
7
+ *
8
+ * 1. **"Extends" / "Extended by" blocks** on every class doc are pure
9
+ * inheritance-chain plumbing that consumers don't need to see. We
10
+ * strip them.
11
+ *
12
+ * 2. **Inherited methods duplicated on every subclass doc.** Each class
13
+ * .md re-lists every method from every ancestor in the inheritance
14
+ * chain (e.g. `WSAPIInbox.md` ends up with all 65+ methods even
15
+ * though only ~8 are its own). We detect inherited methods via the
16
+ * `#### Inherited from` marker typedoc emits, strip those method
17
+ * blocks, and leave each class doc focused on the methods that
18
+ * class actually declares.
19
+ *
20
+ * 3. **`docs/api/_media/` duplication** of UI guides. The TSDoc UI link
21
+ * uses a relative path `[label](../../docs/ui/<domain>/UIGuide_X.md)`
22
+ * which typedoc treats as a local "media" reference — it copies the
23
+ * file into `docs/api/_media/` and rewrites the link to point there.
24
+ * We delete `_media/` and rewrite the links back to the original
25
+ * `docs/ui/<domain>/UIGuide_X.md` so there's a single source of
26
+ * truth (in `docs/ui/`).
27
+ *
28
+ * Run via `npm run doc` (chained after typedoc) — see `package.json`.
29
+ */
30
+ const fs = require('fs');
31
+ const path = require('path');
32
+
33
+ const DOCS_API = path.join(__dirname, '..', 'docs', 'api');
34
+ const DOCS_API_CLASSES = path.join(DOCS_API, 'classes');
35
+ const DOCS_API_MEDIA = path.join(DOCS_API, '_media');
36
+
37
+ let mdFilesProcessed = 0;
38
+ let mediaLinksRewritten = 0;
39
+ let extendsBlocksRemoved = 0;
40
+ let inheritedMethodsStripped = 0;
41
+
42
+ /** Recursively list all `.md` files under a directory. */
43
+ function walkMd(dir) {
44
+ const out = [];
45
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
46
+ const p = path.join(dir, entry.name);
47
+ if (entry.isDirectory()) {
48
+ out.push(...walkMd(p));
49
+ } else if (entry.isFile() && entry.name.endsWith('.md')) {
50
+ out.push(p);
51
+ }
52
+ }
53
+ return out;
54
+ }
55
+
56
+ /**
57
+ * Strip `## Extends\n\n- [Foo](...)` and `## Extended by\n\n- [...]` sections.
58
+ * The block ends at the next `## ` heading (or end of file).
59
+ */
60
+ function stripExtendsBlocks(text) {
61
+ const lines = text.split('\n');
62
+ const out = [];
63
+ let i = 0;
64
+ let removed = 0;
65
+ while (i < lines.length) {
66
+ const ln = lines[i];
67
+ if (ln === '## Extends' || ln === '## Extended by') {
68
+ // Skip until the next `## ` heading or EOF
69
+ let j = i + 1;
70
+ while (j < lines.length && !lines[j].startsWith('## ')) {
71
+ j++;
72
+ }
73
+ // Also drop one trailing blank line if present right before the
74
+ // `## Extends` line to avoid leaving a double-blank gap.
75
+ while (out.length > 0 && out[out.length - 1] === '') {
76
+ out.pop();
77
+ }
78
+ i = j;
79
+ removed++;
80
+ continue;
81
+ }
82
+ out.push(ln);
83
+ i++;
84
+ }
85
+ return { text: out.join('\n'), removed };
86
+ }
87
+
88
+ /**
89
+ * Rewrite `(../_media/UIGuide_X.md)` → `(../../docs/ui/<domain>/UIGuide_X.md)`.
90
+ * Domain is inferred from the filename prefix when possible; otherwise we
91
+ * map known UI guides to their domain.
92
+ */
93
+ const UI_GUIDE_DOMAIN = {
94
+ UIGuide_getMissions: 'missions',
95
+ UIGuide_getBadges: 'missions',
96
+ UIGuide_getAchCategories: 'missions',
97
+ UIGuide_requestMissionOptIn: 'missions',
98
+ UIGuide_requestMissionClaimReward: 'missions',
99
+ UIGuide_getStoreItems: 'store',
100
+ UIGuide_buyStoreItem: 'store',
101
+ UIGuide_getStoreCategories: 'store',
102
+ UIGuide_getStorePurchasedItems: 'store',
103
+ };
104
+
105
+ function rewriteMediaLinks(text) {
106
+ let count = 0;
107
+ // Pattern: `(../_media/<filename>.md)` (when generated inside docs/api/classes/).
108
+ // Rewrite to `(../../ui/<domain>/<filename>.md)` — correct relative from
109
+ // `docs/api/classes/` to `docs/ui/<domain>/`. Going through `docs/` once is
110
+ // enough; an extra `docs/` in the path would resolve to `docs/docs/ui/...`.
111
+ const out = text.replace(/\(\.\.\/_media\/([A-Za-z0-9_]+)\.md\)/g, (m, name) => {
112
+ const domain = UI_GUIDE_DOMAIN[name];
113
+ if (!domain) return m; // unknown media file — leave it
114
+ count++;
115
+ return `(../../ui/${domain}/${name}.md)`;
116
+ });
117
+ return { text: out, count };
118
+ }
119
+
120
+ /**
121
+ * Strip inherited method blocks. A method block:
122
+ * - Starts at `### methodName()`
123
+ * - Ends just before the next `### ` (next method) or `## ` (next major
124
+ * section), whichever comes first
125
+ * A method is "inherited" if its block contains `#### Inherited from`.
126
+ *
127
+ * After stripping, the file's `## Methods` section may be empty — that's
128
+ * OK: it means the class has no own methods (which shouldn't happen for
129
+ * the domain classes, but is graceful for edge cases).
130
+ */
131
+ function stripInheritedMethods(text) {
132
+ const lines = text.split('\n');
133
+ const out = [];
134
+ let i = 0;
135
+ let removed = 0;
136
+ while (i < lines.length) {
137
+ const ln = lines[i];
138
+ // Detect method-block start
139
+ if (ln.startsWith('### ')) {
140
+ // Find block end
141
+ let j = i + 1;
142
+ while (
143
+ j < lines.length &&
144
+ !lines[j].startsWith('### ') &&
145
+ !lines[j].startsWith('## ')
146
+ ) {
147
+ j++;
148
+ }
149
+ const block = lines.slice(i, j);
150
+ const isInherited = block.some((l) => l === '#### Inherited from');
151
+ if (isInherited) {
152
+ removed++;
153
+ i = j;
154
+ continue;
155
+ }
156
+ // Keep the block
157
+ out.push(...block);
158
+ i = j;
159
+ continue;
160
+ }
161
+ out.push(ln);
162
+ i++;
163
+ }
164
+ return { text: out.join('\n'), removed };
165
+ }
166
+
167
+ // 1. Process every class .md
168
+ if (fs.existsSync(DOCS_API_CLASSES)) {
169
+ for (const file of walkMd(DOCS_API_CLASSES)) {
170
+ const orig = fs.readFileSync(file, 'utf8');
171
+ const a = stripExtendsBlocks(orig);
172
+ const b = stripInheritedMethods(a.text);
173
+ const c = rewriteMediaLinks(b.text);
174
+ if (c.text !== orig) {
175
+ fs.writeFileSync(file, c.text);
176
+ mdFilesProcessed++;
177
+ extendsBlocksRemoved += a.removed;
178
+ inheritedMethodsStripped += b.removed;
179
+ mediaLinksRewritten += c.count;
180
+ }
181
+ }
182
+ }
183
+
184
+ // 2. Delete _media/ (UI guides now linked from docs/ui/; any non-UI media
185
+ // like images would also be wiped — none expected in this project)
186
+ if (fs.existsSync(DOCS_API_MEDIA)) {
187
+ const count = fs.readdirSync(DOCS_API_MEDIA).length;
188
+ fs.rmSync(DOCS_API_MEDIA, { recursive: true, force: true });
189
+ console.log(`Removed docs/api/_media/ (${count} duplicate file(s))`);
190
+ }
191
+
192
+ console.log(`Processed ${mdFilesProcessed} .md files`);
193
+ console.log(`Removed ${extendsBlocksRemoved} Extends/Extended-by block(s)`);
194
+ console.log(`Stripped ${inheritedMethodsStripped} inherited-method block(s)`);
195
+ console.log(`Rewrote ${mediaLinksRewritten} _media link(s) → docs/ui/`);
@@ -185,6 +185,8 @@ export enum ClassId {
185
185
  RAF_CLAIM_PRIZE_RESPONSE = 909,
186
186
  RAF_OPTIN_REQUEST = 916,
187
187
  RAF_OPTIN_RESPONSE = 917,
188
+ RAF_GET_WON_PRIZES_REQUEST = 920,
189
+ RAF_GET_WON_PRIZES_RESPONSE = 921,
188
190
  /*
189
191
  RAF_GET_TICKETS_REQUEST = 902,
190
192
  RAF_GET_TICKETS_RESPONSE = 903,
@@ -4,34 +4,33 @@ import { JackpotPublicMeta } from './JackpotPublicMeta';
4
4
  import { JackpotType } from './JackpotType';
5
5
 
6
6
  /**
7
- * JackpotDetails the information about Jackpot template
8
- * It also includes JackpotPot object that holds the current value of the jackpot
9
- * Flag is_opted_in indicates if the current user is opted in to the jackpot
7
+ * One jackpot template the user is eligible for, with its live pot snapshot.
8
+ * Returned by `jackpotGet()`.
10
9
  */
11
10
  interface JackpotDetails {
12
- /** ID of the jackpot template */
11
+ /** Stable numeric ID of the template; pass to opt-in / opt-out / winners / eligible-games methods. */
13
12
  jp_template_id: number;
14
- /** Type of jackpot logic */
13
+ /** Whether the jackpot has a shared pot or one independent per user; see {@link JackpotType}. */
15
14
  jp_type_id: JackpotType;
16
- /** UI information of jackpot, like name, description, etc. */
15
+ /** Display data: name, description, image_url, winner / not-winner HTML templates, custom_data (JSON-parsed). */
17
16
  jp_public_meta: JackpotPublicMeta;
18
- /** Base currency of the jackpot */
17
+ /** Native jackpot currency (ISO 4217). Used for winner-history amounts. */
19
18
  jp_currency: string;
20
- /** Wallet currency of currently logged in user */
19
+ /** Current user's wallet currency. Used to display the pot via `pot.current_pot_amount_user_currency`. */
21
20
  user_currency: string;
22
- /** Type of the user contribution to the jackpot */
21
+ /** Whether the contribution is a fixed amount or a percentage of the bet; see {@link JackpotContributionType}. */
23
22
  contribution_type: JackpotContributionType;
24
- /** Value of the user contribution. Fixed amount or percentage of bet depending on the contribution type */
23
+ /** Amount of contribution per qualifying bet — fixed value or percentage depending on `contribution_type`. */
25
24
  contribution_value: number;
26
- /** Information of current value of the jackpot */
25
+ /** Live pot snapshot (amount, temperature, last explosion timestamp). */
27
26
  pot: JackpotPot;
28
- /** Indication if the current user is opted in to the jackpot */
27
+ /** `true` when the current user is currently opted in. */
29
28
  is_opted_in: boolean;
30
- /** Indicates whether all games are eligible for the jackpot */
29
+ /** `true` when every game in the operator catalog contributes; if `true`, skip `getJackpotEligibleGames`. */
31
30
  ach_related_game_allow_all: boolean;
32
- /** The number of users who have opted in to participate in the jackpot */
31
+ /** Number of users currently opted in; always `1` for `JackpotType.Personal`. */
33
32
  registration_count: number;
34
- /** Show winners in widget and over API */
33
+ /** Operator flag: whether the winners list should be displayed. Enforced client-side only — gate `getJackpotWinners` calls on this. */
35
34
  expose_winners_over_api: boolean;
36
35
  }
37
36
 
@@ -9,18 +9,22 @@ enum JackPotTemparature {
9
9
  BURNING = 3,
10
10
  }
11
11
 
12
+ /**
13
+ * Live snapshot of one jackpot pot's value and temperature.
14
+ * Embedded on `JackpotDetails.pot`; refreshed at the 1 s SDK cache TTL.
15
+ */
12
16
  interface JackpotPot {
13
- /** ID of the jackpot template */
17
+ /** Template ID this pot belongs to. */
14
18
  jp_template_id: number;
15
- /** ID of the jackpot pot */
19
+ /** Stable numeric ID of the current pot instance (rotates when the pot explodes). */
16
20
  jp_pot_id: number;
17
- /** currency of the jackpot pot in the Jackput base currency */
21
+ /** Current pot amount in the jackpot's native currency (`jp_currency`). */
18
22
  current_pot_amount: number;
19
- /** currency of the jackpot pot in the user wallet currency */
23
+ /** Current pot amount converted to the user's wallet currency (`user_currency`). */
20
24
  current_pot_amount_user_currency: number;
21
- /** the date/time when this pot exploded */
25
+ /** Unix ms timestamp of when this pot last exploded; `0` if it has never exploded. */
22
26
  explode_date_ts: number;
23
- /** current pot temperature */
27
+ /** Heat band of the pot relative to its explosion range; see {@link JackPotTemparature}. */
24
28
  current_pot_temperature: JackPotTemparature;
25
29
  }
26
30
 
@@ -5,9 +5,12 @@ import { UserAchievement } from "./UserAchievement";
5
5
  import { UserAchievementTask } from "./UserAchievementTask";
6
6
  import { BadgesTimeLimitStates } from "./BadgesTimeLimitStates";
7
7
 
8
- type UserStateParamsKeys = 'core_fav_game_top3' | 'core_fav_game_type_top3' | 'core_fav_game_provider_top3' | 'core_recommended_deposit_amount' | 'core_recommended_casino_bet_amount' | 'casino_last_bet_amount' | 'casino_last_bet_amount_real' | 'casino_last_bet_amount_bonus' | 'acc_last_deposit_amount';
8
+ type UserStateParamsKeys = 'core_fav_game_top3' | 'core_fav_game_type_top3' | 'core_fav_game_provider_top3' | 'core_recommended_deposit_amount' | 'core_recommended_casino_bet_amount';
9
9
  const USER_STATE_PARAMS_KEYS_GAMES: UserStateParamsKeys[] = ['core_fav_game_top3', 'core_fav_game_type_top3', 'core_fav_game_provider_top3'];
10
- const USER_STATE_PARAMS_KEYS_BET_AMOUNT: UserStateParamsKeys[] = ['core_recommended_deposit_amount', 'core_recommended_casino_bet_amount', 'casino_last_bet_amount', 'casino_last_bet_amount_real', 'casino_last_bet_amount_bonus', 'acc_last_deposit_amount'];
10
+ const USER_STATE_PARAMS_KEYS_BET_AMOUNT: UserStateParamsKeys[] = [
11
+ 'core_recommended_deposit_amount',
12
+ 'core_recommended_casino_bet_amount',
13
+ ];
11
14
 
12
15
  const MINOR_WORDS = new Set([
13
16
  'of', 'at', 'in', 'on', 'to', 'up', 'as', 'by', 'for',
@@ -0,0 +1,12 @@
1
+ import { ProtocolMessage } from "../Base/ProtocolMessage";
2
+
3
+ export interface GetRaffleWonPrizesRequest extends ProtocolMessage {
4
+ /** ID of the raffle to fetch the current user's won prizes for. */
5
+ raffle_id: number;
6
+
7
+ /** Zero-based index of the first won-prize row to return (pagination). */
8
+ offset: number;
9
+
10
+ /** Maximum number of won-prize rows to return (pagination). */
11
+ limit: number;
12
+ }
@@ -0,0 +1,56 @@
1
+ import { ProtocolResponse } from '../Base/ProtocolResponse';
2
+
3
+ /** Presentation meta for a won prize. */
4
+ export interface RaffleWonPrizePublicMeta {
5
+ /** Name of the prize, e.g. '1 $'. */
6
+ name: string;
7
+ /** Indicates whether the chance to win should be hidden in the UI. */
8
+ hide_chance_to_win: boolean;
9
+ /** URL of the image that represents the prize. */
10
+ image_url: string;
11
+ }
12
+
13
+ /** A single prize the user won within the raffle. */
14
+ export interface RaffleWonPrize {
15
+ /** Unique ID of the winning row (pass to `claimRafflePrize` when `requires_claim` is `true`). */
16
+ raf_won_id: number;
17
+ /** ID of the prize definition. */
18
+ prize_id: number;
19
+ /** Run-instance ID of the draw that awarded this prize. */
20
+ raffle_run_id: number;
21
+ /** Schedule ID of the draw that awarded this prize. */
22
+ draw_id: number;
23
+ /** Presentation meta (name / image). */
24
+ public_meta: RaffleWonPrizePublicMeta;
25
+ /** Whether this prize requires a claim action from the user. */
26
+ requires_claim: boolean;
27
+ /** Epoch ms when the prize was claimed; `null` when not yet claimed. */
28
+ claimed_date: number | null;
29
+ }
30
+
31
+ /** The user the won-prizes list belongs to. */
32
+ export interface RaffleWonPrizeUser {
33
+ /** Internal user ID. */
34
+ user_id: number;
35
+ /** Avatar image: a full URL for a system avatar, otherwise an avatar token to resolve against the widget's avatar domain. */
36
+ avatar_id: string;
37
+ /** Numeric ID of the user's selected avatar definition. */
38
+ avatar_real_id: number;
39
+ /** Public username; server-masked for other users (e.g. `"32:r*****"`). */
40
+ public_username?: string;
41
+ /** Always `null` on the wire — use `avatar_id`. */
42
+ avatar_url?: string | null;
43
+ }
44
+
45
+ export interface GetRaffleWonPrizesResponse extends ProtocolResponse {
46
+ /** The user the won prizes belong to; `null` when `won_prizes` is empty. */
47
+ user: RaffleWonPrizeUser | null;
48
+ /** Page of won prizes for the requested raffle, newest-first. */
49
+ won_prizes: RaffleWonPrize[];
50
+ /** Total number of won prizes for this user/raffle across all draws (for pagination). */
51
+ total: number;
52
+ /** Zero-based offset of this page (echoes the resolved request). */
53
+ offset: number;
54
+ /** Page size (echoes the resolved request). */
55
+ limit: number;
56
+ }
@@ -14,4 +14,6 @@ export * from './RaffleClaimPrizeRequest';
14
14
  export * from './RaffleClaimPrizeResponse';
15
15
  export * from './RaffleDrawPublicMeta';
16
16
  export * from './RaffleOptinRequest';
17
- export * from './RaffleOptinResponse';
17
+ export * from './RaffleOptinResponse';
18
+ export * from './GetRaffleWonPrizesRequest';
19
+ export * from './GetRaffleWonPrizesResponse';
@@ -139,7 +139,7 @@ import { GetRafflesRequest } from './Raffle/GetRafflesRequest';
139
139
  import { GetActivityLogRequest, GetActivityLogResponse, ActivityLogTransform } from './ActivityLog';
140
140
  import { GetClanListRequest, GetClanListResponse, GetClanInfoRequest, GetClanInfoResponse, JoinClanRequest, JoinClanResponse } from './Clans';
141
141
  import { InboxCategories } from './Inbox/InboxCategories';
142
- import { GetDrawRunRequest, GetDrawRunResponse, GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse, RaffleClaimPrizeRequest, RaffleClaimPrizeResponse, RaffleOptinRequest, RaffleOptinResponse, drawRunTransform } from './Raffle';
142
+ import { GetDrawRunRequest, GetDrawRunResponse, GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse, RaffleClaimPrizeRequest, RaffleClaimPrizeResponse, RaffleOptinRequest, RaffleOptinResponse, drawRunTransform, GetRaffleWonPrizesRequest, GetRaffleWonPrizesResponse } from './Raffle';
143
143
  import { GetAvatarsListResponse, avatarDefinitionTransform } from './Avatars/GetAvatarsListResponse';
144
144
  import { GetAvatarsCustomizedResponse, avatarCustomizedTransform } from './Avatars/GetAvatarsCustomizedResponse';
145
145
  import { GetAvatarPromptsResponse, avatarPromptTransform } from './Avatars/GetAvatarPromptsResponse';
@@ -1641,6 +1641,19 @@ class SmarticoAPI {
1641
1641
 
1642
1642
  }
1643
1643
 
1644
+ public async getRaffleWonPrizes(
1645
+ user_ext_id: string,
1646
+ props: { raffle_id: number; offset: number; limit: number },
1647
+ ): Promise<GetRaffleWonPrizesResponse> {
1648
+ const message = this.buildMessage<GetRaffleWonPrizesRequest, GetRaffleWonPrizesResponse>(
1649
+ user_ext_id,
1650
+ ClassId.RAF_GET_WON_PRIZES_REQUEST,
1651
+ props,
1652
+ );
1653
+
1654
+ return await this.send<GetRaffleWonPrizesResponse>(message, ClassId.RAF_GET_WON_PRIZES_RESPONSE);
1655
+ }
1656
+
1644
1657
  public async getActivityLog(
1645
1658
  user_ext_id: string,
1646
1659
  startTimeSeconds: number,
@@ -2127,10 +2127,12 @@ declare enum EWidgetType {
2127
2127
  }
2128
2128
  declare enum EXTERNAL_CALLBACK_KEY {
2129
2129
  INIT = 'init',
2130
+ LABEL_INIT_COMPLETED = 'label_init_completed',
2130
2131
  IDENTIFY = 'identify',
2131
2132
  LOGIN = 'login',
2132
2133
  LOGOUT = 'logout',
2133
2134
  USER_PROPS_CHANGE = 'props_change',
2135
+ PAGE_NAVIGATION = 'page_navigation',
2134
2136
  SESSION_BASED_DP_DETECTED = 'session_based_dp_detected',
2135
2137
  GF_CLOSING = 'gf_closing',
2136
2138
  GF_STARTING = 'gf_starting',
@@ -2140,6 +2142,8 @@ declare enum EXTERNAL_CALLBACK_KEY {
2140
2142
  PROTOCOL_ERROR = 'protocol_error',
2141
2143
  MNIGAME_WIN = 'mini_game_win',
2142
2144
  ACH_GAME_OPENING = 'ach_game_opening',
2145
+ JACKPOT_WIN = 'jackpot_win',
2146
+ GF_UX = 'gf_ux',
2143
2147
  }
2144
2148
  declare enum DpType {
2145
2149
  AskPushPermissions = 'ask_push_permissions',
@@ -1,4 +1,8 @@
1
1
  export enum BuyStoreItemErrorCode {
2
+ /** Generic server error / control-group rejection */
3
+ SHOP_FAILED_GENERIC = 1,
4
+ /** Label mismatch detected before purchase transaction */
5
+ SHOP_WRONG_LABEL_PRECHECK = 106,
2
6
  /** User don't have enough points on balance */
3
7
  SHOP_NO_BALANCE = 11000,
4
8
  /** Wrong shop item id */
@@ -13,6 +17,8 @@ export enum BuyStoreItemErrorCode {
13
17
  SHOP_FAILED_TO_BUY_MATCHING_BONUS = 11005,
14
18
  /** Failed to buy item because of limit of max items is reached */
15
19
  SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED = 11006,
20
+ /** Bonus was issued but a follow-up redemption step failed */
21
+ SHOP_FAILED_BONUS_REDEMPTION = 11007,
16
22
  /** Failed to buy item because no more items are available */
17
23
  SHOP_FAILED_POOL_EMPTY = 11009,
18
24
  /** User doesn't have enough gems on balance */
@@ -21,4 +27,6 @@ export enum BuyStoreItemErrorCode {
21
27
  SHOP_NO_BALANCE_DIAMONDS = 11012,
22
28
  /** Failed to buy item because of purchase limitation */
23
29
  SHOP_FAILED_PURCHASE_LIMITATION = 11014,
30
+ /** Uncaught server exception */
31
+ SHOP_UNEXPECTED_EXCEPTION = 9999,
24
32
  }
@@ -52,6 +52,7 @@ export const StoreItemTransform = (items: StoreItem[]): TStoreItem[] => {
52
52
  pool: r.shopPool,
53
53
  custom_data: IntUtils.JsonOrText(r.itemPublicMeta.custom_data),
54
54
  active_till_date: r.activeTillDate,
55
+ show_timer: r.itemPublicMeta.show_timer,
55
56
  discounted_price: r.itemPublicMeta.discount_prize,
56
57
  discount_price_ribbon: r.itemPublicMeta.discount_prize_ribbon,
57
58
  custom_ribbon_image: r.itemPublicMeta.custom_ribbon_image,
@@ -55,6 +55,7 @@ export const StoreItemPurchasedTransform = (items: StoreItemPurchased[]): TStore
55
55
  purchased_this_week: purchasedThisWeek,
56
56
  purchased_this_month: purchasedThisMonth,
57
57
  custom_data: r.itemPublicMeta.custom_data,
58
+ show_timer: r.itemPublicMeta.show_timer,
58
59
  related_games: (r.relatedGames?.filter((g) => g.game_public_meta.enabled) || []).map((g, i) => ({
59
60
  ext_game_id: g.ext_game_id,
60
61
  game_public_meta: {
@@ -21,7 +21,7 @@ export const StoreItemTypeNamed = (type: StoreItemType): StoreItemTypeName => {
21
21
  return (
22
22
  {
23
23
  [StoreItemType.Bonus]: StoreItemTypeName.Bonus,
24
- [StoreItemType.Tangible]: StoreItemTypeName.Bonus,
24
+ [StoreItemType.Tangible]: StoreItemTypeName.Tangible,
25
25
  [StoreItemType.MiniGameSpin]: StoreItemTypeName.MiniGameSpin,
26
26
  [StoreItemType.ChangeLevel]: StoreItemTypeName.ChangeLevel,
27
27
  [StoreItemType.PrizeDrop]: StoreItemTypeName.PrizeDrop,
@@ -9,4 +9,8 @@ export enum TournamentRegistrationError {
9
9
  TOURNAMENT_USER_NOT_REGISTERED = 30006,
10
10
  TOURNAMENT_CANT_CHANGE_REGISTRATION_STATUS = 30007,
11
11
  TOURNAMENT_MAX_REGISTRATIONS_REACHED = 30008,
12
+ TOURNAMENT_REGISTRATION_NOT_ENOUGH_GEMS = 30010,
13
+ TOURNAMENT_REGISTRATION_NOT_ENOUGH_DIAMONDS = 30011,
14
+
15
+
12
16
  }