@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
@@ -46,27 +46,24 @@ Promise resolving to the current list of
46
46
  #### Remarks
47
47
 
48
48
  **Subscription model (`onUpdate`)**
49
- The callback registered via `onUpdate` is invoked with the FULL refreshed
50
- mission array — never a diff/patch — whenever any of these occur:
51
- - `requestMissionOptIn(...)` resolves (any `err_code`)
52
- - `requestMissionClaimReward(...)` resolves (any `err_code`)
53
- - The server pushes an asynchronous mission-state change — e.g. task
54
- progress advances (for tasks configured to push updates), a mission
55
- completes, or the user's level / gamification visibility tags change
56
-
57
- Each subsequent call to `getMissions({ onUpdate })` REPLACES the prior
58
- callback — there is only one active subscriber at a time. Pass
59
- `onUpdate: undefined` (or omit it) to keep the prior callback in place;
60
- the callback is never auto-cleared.
61
-
62
- **What triggers an asynchronous mission-state refresh** (consumer-relevant)
63
- - A user activity (deposit, bet, login, etc.) advances task progress
64
- on a task configured to push updates, OR the activity completes a
65
- mission.
66
- - The user's level changes, or other gamification visibility tags change.
67
- - Operator-side BO mission-config edits do NOT push to connected clients —
68
- those changes surface only on the next cache miss, or after one of the
69
- other trigger events above fires.
49
+ The callback receives the FULL refreshed mission array (never a
50
+ diff/patch). Each subsequent call to `getMissions({ onUpdate })`
51
+ REPLACES the prior callback — only one active subscriber at a time.
52
+ Pass `onUpdate: undefined` (or omit it) to keep the prior callback in
53
+ place; the callback is never auto-cleared.
54
+
55
+ **Update triggers** — the callback fires when:
56
+ 1. **Mutation responses**: `requestMissionOptIn(...)` or
57
+ `requestMissionClaimReward(...)` resolves (any `err_code`).
58
+ 2. **Asynchronous server pushes**: a user activity (deposit, bet,
59
+ login, etc.) advances task progress on a task configured to push
60
+ updates, or completes a mission.
61
+ 3. **Visibility changes**: the user's level changes, or other
62
+ gamification visibility tags change.
63
+
64
+ Operator-side BO mission-config edits do NOT push to connected
65
+ clients — those changes surface only on the next cache miss (after
66
+ the 30 s TTL) or alongside the next trigger from (1)–(3).
70
67
 
71
68
  **What's in the returned list / what's filtered server-side**
72
69
  The response is pre-filtered by the server. Missions EXCLUDED before
@@ -77,32 +74,37 @@ reaching the SDK:
77
74
  qualifies (configurable per-brand).
78
75
  - `FEATURED_MANUALLY` missions that are still locked — they appear
79
76
  only after the user unlocks them.
80
- - Locked missions whose `ach_public_meta.hide_locked_mission` is
81
- `true` or `null` — UNLESS the mission has
82
- `expose_immediately_on_unlock = true` (then the locked mission is
83
- included as a teaser).
77
+ - Locked missions configured to hide while locked — UNLESS the
78
+ mission is configured to expose immediately on unlock (then the
79
+ locked mission is included as a teaser).
84
80
  - `RECURRING` missions between cycles, until the next cycle starts.
85
81
  - `RECURRING_QUANTITY` missions outside their `active_from_ts` /
86
82
  `active_till_ts` window.
87
83
 
88
- **Field semantics** (non-obvious fields on `TMissionOrBadge`)
89
- - `is_opted_in` does NOT flip optimistically. It flips only after the
90
- opt-in round-trip completes and the auto-refresh lands. Render the
91
- pending state from your own loading flag, not from this field.
92
- - `dt_start` doubles as opt-in timestamp for opt-in missions and as
93
- unlock timestamp for previously-locked missions; for time-limited
94
- missions, expiration is `dt_start + time_limit_ms`.
95
- - `availability_status` is the canonical derived state — see
96
- [AchievementAvailabilityStatus](../enumerations/AchievementAvailabilityStatus.md) for the full enum. Use this
97
- field to drive UI chips ("missed", "coming soon", "needs opt-in",
98
- "in progress", etc.) rather than recomputing from raw timestamps.
99
- - `next_recurrence_date_ts` is populated for `RECURRING` /
100
- `RECURRING_QUANTITY` missions; ignore it when the mission has an
101
- `active_till_ts` that has already passed.
102
- - `only_in_custom_section: true` means the mission should be HIDDEN
103
- from the main missions view and shown only inside its custom
104
- section. The list still includes it — filter it out client-side
105
- for general views.
84
+ Client-side filtering you may still want: missions with
85
+ `only_in_custom_section: true` are intended for their custom-section
86
+ view only and should be hidden from the main mission list.
87
+
88
+ **Reading state from the returned mission**
89
+ Drive availability chips ("missed", "coming soon", "needs opt-in",
90
+ "in progress", "expired") from `availability_status` (enum
91
+ [AchievementAvailabilityStatus](../enumerations/AchievementAvailabilityStatus.md)) — it's the canonical derived
92
+ state and reflects all server-side timing/visibility rules in one
93
+ field. For time-limited and recurring missions, `dt_start` doubles
94
+ as the opt-in timestamp (for opt-in missions) or unlock timestamp
95
+ (for previously-locked missions); the expiration of a time-limited
96
+ mission is `dt_start + time_limit_ms`. `next_recurrence_date_ts`
97
+ is populated for `RECURRING` / `RECURRING_QUANTITY` missions but
98
+ is no longer meaningful once the mission's `active_till_ts` has
99
+ passed.
100
+
101
+ **Refresh after a mutation**
102
+ After `requestMissionOptIn(...)` or `requestMissionClaimReward(...)`
103
+ resolves, the SDK auto-refreshes the mission cache; the `onUpdate`
104
+ callback fires with the new array shortly after. `is_opted_in`,
105
+ `progress`, and `is_completed` flip on the refreshed mission — do
106
+ NOT mutate them optimistically while the round-trip is pending.
107
+ Render any pending state from your own loading flag.
106
108
 
107
109
  **UI guidance**: see [UI Guide — `getMissions`](../../ui/missions/UIGuide_getMissions.md).
108
110
 
@@ -186,42 +188,19 @@ setInterval(async () => {
186
188
  Alternatively, re-fetch on a domain event your app already handles
187
189
  (e.g. after the user finishes a game round or claims a bonus).
188
190
 
189
- **Field semantics — badges vs. missions** (same `TMissionOrBadge` type,
190
- different feature semantics; mission-only fields are present on badge
191
- objects but should be ignored by badge UI):
192
- - `is_requires_optin` — always `false` for badges in practice; the BO
193
- badge editor does not expose this field, so live badge rows never
194
- have it set to `true`.
195
- - `is_opted_in` — irrelevant for badges; do not gate badge UI on it.
196
- - `time_limit_ms` — NOT used for badges (no opt-in time to count from).
197
- Badges express their time window with `active_from_ts` and
198
- `active_till_ts` (absolute calendar timestamps) instead.
199
- - `badgeTimeLimitState` — badge-only computed field, injected by the
200
- SDK before returning. Enum `BadgesTimeLimitStates`:
201
- `BeforeStartDate` (0), `AfterStartDateNoProgress` (1),
202
- `AfterStartDateNoProgressAndEndDate` (2),
203
- `AfterStartDateWithProgressAndEndDate` (3),
204
- `AfterEndDateNotStarted` (4), `AfterEndDateWithProgress` (5).
205
- Use this — not `time_limit_ms` — to drive badge availability chips.
206
- - `is_locked` — for badges this is only meaningful when
207
- `badgeTimeLimitState === BeforeStartDate` (time window not started).
208
- Badges have no prerequisite-mission lock concept, so
209
- `unlock_mission_description` is not used in badge UIs.
210
- - `tasks[]` — present, but badge UIs deliberately hide task
211
- descriptions ("surprise mechanics"): show only `name`, not
212
- `description`. Display stage count (`completed_tasks` / total) rather
213
- than a percentage progress bar.
214
- - `requires_prize_claim`, `prize_claimed_date_ts`, `claim_button_title`,
215
- `claim_button_action`, `prize_claim_expiration_date` — defined on
216
- the type but not used in badge flows (no claim workflow for badges).
217
- - `max_completion_count`, `completion_count`, `next_recurrence_date_ts`,
218
- `milliseconds_till_available` — recurring-mission fields; not used in
219
- badge UIs.
220
- - `category_ids` — primary navigation field for badges. Call
221
- [getAchCategories](#getachcategories) to resolve category metadata and group
222
- badges by category (badge UIs typically show all categories
223
- simultaneously as collapsible sections, each labeled with
224
- "completed / total").
191
+ **Differences from missions** (same `TMissionOrBadge` shape, different
192
+ feature)
193
+ The opt-in, claim, recurring-cycle, and unlock-description fields on
194
+ the returned objects are not populated for badges; treat their values
195
+ as undefined / default. Time windows are absolute calendar timestamps
196
+ (`active_from_ts` / `active_till_ts`), not opt-in-relative durations —
197
+ drive availability chips from the SDK-computed `badgeTimeLimitState`
198
+ (enum [BadgesTimeLimitStates](../enumerations/BadgesTimeLimitStates.md)), not `time_limit_ms`. Locking for
199
+ badges is purely time-based: `is_locked` is `true` only when
200
+ `badgeTimeLimitState === BadgesTimeLimitStates.BeforeStartDate` (the
201
+ time window hasn't started yet). The primary navigation field is
202
+ `category_ids` — call [getAchCategories](#getachcategories) to resolve category
203
+ metadata and group badges by category.
225
204
 
226
205
  **Idempotency / Side effects**: fetch-only; safe to call repeatedly.
227
206
  The cache layer deduplicates concurrent calls within the TTL window.