@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.
- package/CLAUDE.md +103 -0
- package/README.md +32 -10
- package/dist/Base/ClassId.d.ts +2 -0
- package/dist/Jackpots/JackpotDetails.d.ts +14 -15
- package/dist/Jackpots/JackpotPot.d.ts +10 -6
- package/dist/Raffle/GetRaffleWonPrizesRequest.d.ts +9 -0
- package/dist/Raffle/GetRaffleWonPrizesResponse.d.ts +52 -0
- package/dist/Raffle/index.d.ts +2 -0
- package/dist/SmarticoAPI.d.ts +6 -1
- package/dist/SmarticoLib/index.d.ts +5 -1
- package/dist/WSAPI/WSAPIAvatars.d.ts +267 -49
- package/dist/WSAPI/WSAPIBonuses.d.ts +224 -10
- package/dist/WSAPI/WSAPIGamePick.d.ts +538 -253
- package/dist/WSAPI/WSAPIGeneral.d.ts +156 -14
- package/dist/WSAPI/WSAPIInbox.d.ts +547 -58
- package/dist/WSAPI/WSAPIJackpots.d.ts +292 -57
- package/dist/WSAPI/WSAPILeaderBoard.d.ts +127 -13
- package/dist/WSAPI/WSAPIMiniGames.d.ts +465 -49
- package/dist/WSAPI/WSAPIRaffles.d.ts +576 -52
- package/dist/WSAPI/WSAPITournaments.d.ts +3 -3
- package/dist/WSAPI/WSAPITypes.d.ts +243 -132
- package/dist/WSAPI/WSAPIUser.d.ts +193 -43
- package/dist/index.js +3409 -615
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +3391 -608
- package/dist/index.modern.mjs.map +1 -1
- package/docs/Callbacks.md +162 -0
- package/docs/SmarticoObject.md +445 -0
- package/docs/Transforms.md +99 -0
- package/docs/api/README.md +26 -0
- package/docs/api/classes/WSAPIAvatars.md +282 -54
- package/docs/api/classes/WSAPIBonuses.md +233 -12
- package/docs/api/classes/WSAPIClans.md +380 -10
- package/docs/api/classes/WSAPIGamePick.md +555 -26
- package/docs/api/classes/WSAPIGeneral.md +165 -16
- package/docs/api/classes/WSAPIInbox.md +588 -64
- package/docs/api/classes/WSAPIJackpots.md +320 -66
- package/docs/api/classes/WSAPILeaderBoard.md +133 -15
- package/docs/api/classes/WSAPIMiniGames.md +501 -64
- package/docs/api/classes/WSAPIMissions.md +58 -79
- package/docs/api/classes/WSAPIRaffles.md +647 -69
- package/docs/api/classes/WSAPIStore.md +83 -108
- package/docs/api/classes/WSAPITournaments.md +495 -28
- package/docs/api/classes/WSAPIUser.md +520 -83
- package/docs/api/documents/Callbacks.md +162 -0
- package/docs/api/documents/SmarticoObject.md +445 -0
- package/docs/api/documents/Transforms.md +99 -0
- package/docs/api/enumerations/BonusStatus-1.md +11 -6
- package/docs/api/enumerations/JoinClanErrorCode.md +81 -0
- package/docs/api/enumerations/TournamentRegistrationError.md +12 -0
- package/docs/api/functions/clanTournamentPlayersTransform.md +13 -0
- package/docs/api/interfaces/AvatarCustomized.md +25 -0
- package/docs/api/interfaces/AvatarDefinition.md +94 -0
- package/docs/api/interfaces/AvatarPrompt.md +45 -0
- package/docs/api/interfaces/BonusMetaMap-1.md +4 -1
- package/docs/api/interfaces/BonusTemplateMetaMap-1.md +9 -4
- package/docs/api/interfaces/Clan.md +4 -0
- package/docs/api/interfaces/ClanInfo.md +109 -0
- package/docs/api/interfaces/ClanMember.md +53 -0
- package/docs/api/interfaces/ClanTournamentPlayerRaw.md +67 -0
- package/docs/api/interfaces/GemsDiamondsLog.md +43 -0
- package/docs/api/interfaces/GetClanInfoResponse.md +61 -0
- package/docs/api/interfaces/GetClanTournamentPlayersResponse.md +81 -0
- package/docs/api/interfaces/GetRaffleWonPrizesRequest.md +59 -0
- package/docs/api/interfaces/GetRaffleWonPrizesResponse.md +95 -0
- package/docs/api/interfaces/InboxMarkMessageAction.md +10 -2
- package/docs/api/interfaces/JackpotDetails.md +14 -15
- package/docs/api/interfaces/JackpotPot.md +9 -6
- package/docs/api/interfaces/LeaderBoardDetailsT.md +14 -8
- package/docs/api/interfaces/LeaderBoardUserT.md +8 -5
- package/docs/api/interfaces/LeaderBoardsRewardsT.md +7 -0
- package/docs/api/interfaces/PointsLog.md +43 -0
- package/docs/api/interfaces/RaffleWonPrize.md +59 -0
- package/docs/api/interfaces/RaffleWonPrizePublicMeta.md +27 -0
- package/docs/api/interfaces/RaffleWonPrizeUser.md +43 -0
- package/docs/api/interfaces/TAchCategory.md +2 -7
- package/docs/api/interfaces/TAvatarCustomized.md +4 -4
- package/docs/api/interfaces/TAvatarDefinition.md +13 -14
- package/docs/api/interfaces/TAvatarPrompt.md +6 -6
- package/docs/api/interfaces/TBonus.md +16 -8
- package/docs/api/interfaces/TBuyStoreItemResult.md +4 -29
- package/docs/api/interfaces/TClaimBonusResult.md +5 -5
- package/docs/api/interfaces/TClan.md +8 -4
- package/docs/api/interfaces/TClanInfo.md +47 -0
- package/docs/api/interfaces/TClanJoinResult.md +11 -1
- package/docs/api/interfaces/TClanTournamentPlayer.md +55 -0
- package/docs/api/interfaces/TClanTournamentPlayersResult.md +27 -0
- package/docs/api/interfaces/TClans.md +3 -1
- package/docs/api/interfaces/TGetTranslations.md +4 -0
- package/docs/api/interfaces/TInboxMessage.md +14 -6
- package/docs/api/interfaces/TInboxMessageBody.md +18 -12
- package/docs/api/interfaces/TLevel.md +17 -20
- package/docs/api/interfaces/TLevelCurrent.md +19 -18
- package/docs/api/interfaces/TMiniGamePlayBatchResult.md +14 -6
- package/docs/api/interfaces/TMiniGamePlayResult.md +9 -4
- package/docs/api/interfaces/TMissionClaimRewardResult.md +1 -9
- package/docs/api/interfaces/TMissionOptInResult.md +1 -5
- package/docs/api/interfaces/TMissionOrBadge.md +4 -7
- package/docs/api/interfaces/TRaffleOptinResponse.md +4 -2
- package/docs/api/interfaces/TSegmentCheckResult.md +10 -0
- package/docs/api/interfaces/TSetAvatarResult.md +3 -3
- package/docs/api/interfaces/TStoreItem.md +3 -13
- package/docs/api/interfaces/TTournament.md +1 -1
- package/docs/api/interfaces/TTournamentDetailed.md +1 -1
- package/docs/api/interfaces/TTournamentRegistrationResult.md +4 -2
- package/docs/api/interfaces/TUICustomSection.md +23 -19
- package/docs/api/interfaces/TUserProfile.md +18 -16
- package/docs/api/interfaces/TransformedRaffleClaimPrizeResponse.md +6 -2
- package/docs/api/interfaces/UserLevelExtraCountersT.md +9 -2
- package/docs/api/type-aliases/ActivityLogEntry.md +3 -0
- package/docs/native/ADDING_METHODS.md +7 -2
- package/docs/native/PROTOCOL.md +337 -0
- package/docs/ui/avatars/UIGuide_getAvatarPrompts.md +100 -0
- package/docs/ui/avatars/UIGuide_getAvatarsCustomized.md +90 -0
- package/docs/ui/avatars/UIGuide_getAvatarsList.md +105 -0
- package/docs/ui/avatars/UIGuide_setAvatar.md +118 -0
- package/docs/ui/bonuses/UIGuide_claimBonus.md +144 -0
- package/docs/ui/bonuses/UIGuide_getBonuses.md +176 -0
- package/docs/ui/gamepick/UIGuide_gamePickGetActiveRound.md +99 -0
- package/docs/ui/gamepick/UIGuide_gamePickGetActiveRounds.md +76 -0
- package/docs/ui/gamepick/UIGuide_gamePickGetBoard.md +81 -0
- package/docs/ui/gamepick/UIGuide_gamePickGetGameInfo.md +78 -0
- package/docs/ui/gamepick/UIGuide_gamePickGetHistory.md +55 -0
- package/docs/ui/gamepick/UIGuide_gamePickGetRoundInfoForUser.md +71 -0
- package/docs/ui/gamepick/UIGuide_gamePickGetUserInfo.md +64 -0
- package/docs/ui/gamepick/UIGuide_gamePickSubmitSelection.md +103 -0
- package/docs/ui/gamepick/UIGuide_gamePickSubmitSelectionQuiz.md +67 -0
- package/docs/ui/general/UIGuide_getCustomSections.md +137 -0
- package/docs/ui/general/UIGuide_getRelatedItemsForGame.md +140 -0
- package/docs/ui/inbox/UIGuide_deleteInboxMessage.md +135 -0
- package/docs/ui/inbox/UIGuide_getInboxMessageBody.md +133 -0
- package/docs/ui/inbox/UIGuide_getInboxMessages.md +186 -0
- package/docs/ui/inbox/UIGuide_markInboxMessageAsRead.md +122 -0
- package/docs/ui/inbox/UIGuide_markUnmarkInboxMessageAsFavorite.md +84 -0
- package/docs/ui/jackpots/UIGuide_getJackpotEligibleGames.md +73 -0
- package/docs/ui/jackpots/UIGuide_getJackpotWinners.md +83 -0
- package/docs/ui/jackpots/UIGuide_jackpotGet.md +138 -0
- package/docs/ui/jackpots/UIGuide_jackpotOptIn.md +85 -0
- package/docs/ui/jackpots/UIGuide_jackpotOptOut.md +65 -0
- package/docs/ui/leaderboard/UIGuide_getLeaderBoard.md +166 -0
- package/docs/ui/minigames/UIGuide_getMiniGames.md +153 -0
- package/docs/ui/minigames/UIGuide_getMiniGamesHistory.md +90 -0
- package/docs/ui/minigames/UIGuide_playMiniGame.md +150 -0
- package/docs/ui/minigames/UIGuide_playMiniGameBatch.md +128 -0
- package/docs/ui/raffles/UIGuide_claimRafflePrize.md +99 -0
- package/docs/ui/raffles/UIGuide_getRaffleDrawRun.md +117 -0
- package/docs/ui/raffles/UIGuide_getRaffleDrawRunsHistory.md +92 -0
- package/docs/ui/raffles/UIGuide_getRaffleWonPrizes.md +120 -0
- package/docs/ui/raffles/UIGuide_getRaffles.md +175 -0
- package/docs/ui/raffles/UIGuide_requestRaffleOptin.md +114 -0
- package/docs/ui/user/UIGuide_getActivityLog.md +130 -0
- package/docs/ui/user/UIGuide_getLevels.md +47 -42
- package/package.json +1 -1
- package/src/Base/ClassId.ts +2 -0
- package/src/Jackpots/JackpotDetails.ts +14 -15
- package/src/Jackpots/JackpotPot.ts +10 -6
- package/src/Raffle/GetRaffleWonPrizesRequest.ts +12 -0
- package/src/Raffle/GetRaffleWonPrizesResponse.ts +56 -0
- package/src/Raffle/index.ts +3 -1
- package/src/SmarticoAPI.ts +14 -1
- package/src/SmarticoLib/index.ts +4 -0
- package/src/WSAPI/WSAPIAvatars.ts +267 -49
- package/src/WSAPI/WSAPIBonuses.ts +224 -10
- package/src/WSAPI/WSAPIGamePick.ts +538 -253
- package/src/WSAPI/WSAPIGeneral.ts +156 -14
- package/src/WSAPI/WSAPIInbox.ts +545 -56
- package/src/WSAPI/WSAPIJackpots.ts +297 -61
- package/src/WSAPI/WSAPILeaderBoard.ts +127 -13
- package/src/WSAPI/WSAPIMiniGames.ts +465 -49
- package/src/WSAPI/WSAPIRaffles.ts +592 -64
- package/src/WSAPI/WSAPITournaments.ts +3 -3
- package/src/WSAPI/WSAPITypes.ts +243 -132
- package/src/WSAPI/WSAPIUser.ts +193 -43
- 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
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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
|
-
**
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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.
|