@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.
- package/.nvmrc +1 -1
- package/CLAUDE.md +103 -0
- package/README.md +53 -2
- 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/Store/BuyStoreItemErrorCode.d.ts +9 -1
- package/dist/Tournaments/TournamentRegistrationError.d.ts +3 -1
- package/dist/WSAPI/WSAPI.d.ts +13 -1235
- package/dist/WSAPI/WSAPIAvatars.d.ts +296 -0
- package/dist/WSAPI/WSAPIBase.d.ts +71 -0
- package/dist/WSAPI/WSAPIBonuses.d.ts +240 -0
- package/dist/WSAPI/WSAPIClans.d.ts +388 -0
- package/dist/WSAPI/WSAPIGamePick.d.ts +593 -0
- package/dist/WSAPI/WSAPIGeneral.d.ts +172 -0
- package/dist/WSAPI/WSAPIInbox.d.ts +615 -0
- package/dist/WSAPI/WSAPIJackpots.d.ts +344 -0
- package/dist/WSAPI/WSAPILeaderBoard.d.ts +139 -0
- package/dist/WSAPI/WSAPIMiniGames.d.ts +510 -0
- package/dist/WSAPI/WSAPIMissions.d.ts +517 -0
- package/dist/WSAPI/WSAPIRaffles.d.ts +643 -0
- package/dist/WSAPI/WSAPIStore.d.ts +656 -0
- package/dist/WSAPI/WSAPITournaments.d.ts +501 -0
- package/dist/WSAPI/WSAPITypes.d.ts +376 -205
- package/dist/WSAPI/WSAPIUser.d.ts +533 -0
- package/dist/index.js +6745 -1661
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +6324 -1342
- 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 +82 -2
- package/docs/api/classes/WSAPIAvatars.md +344 -0
- package/docs/api/classes/WSAPIBonuses.md +271 -0
- package/docs/api/classes/WSAPIClans.md +436 -0
- package/docs/api/classes/WSAPIGamePick.md +710 -0
- package/docs/api/classes/WSAPIGeneral.md +212 -0
- package/docs/api/classes/WSAPIInbox.md +801 -0
- package/docs/api/classes/WSAPIJackpots.md +439 -0
- package/docs/api/classes/WSAPILeaderBoard.md +157 -0
- package/docs/api/classes/WSAPIMiniGames.md +612 -0
- package/docs/api/classes/WSAPIMissions.md +590 -0
- package/docs/api/classes/WSAPIRaffles.md +773 -0
- package/docs/api/classes/WSAPIStore.md +719 -0
- package/docs/api/classes/WSAPITournaments.md +571 -0
- package/docs/api/classes/WSAPIUser.md +637 -0
- 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/AchievementClaimPeriodTypeId.md +13 -0
- package/docs/api/enumerations/BonusStatus-1.md +11 -6
- package/docs/api/enumerations/BuyStoreItemErrorCode.md +32 -0
- 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/ClanPrizePublicMeta.md +41 -0
- package/docs/api/interfaces/ClanPrizeStructureEntry.md +7 -1
- package/docs/api/interfaces/ClanPublicMeta.md +4 -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/SAWTemplateUI.md +10 -0
- package/docs/api/interfaces/TAchCategory.md +14 -4
- 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 -11
- 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 +6 -3
- package/docs/api/interfaces/TMissionOptInResult.md +6 -3
- package/docs/api/interfaces/TMissionOrBadge.md +5 -4
- 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 +11 -1
- package/docs/api/interfaces/TTournament.md +1 -1
- package/docs/api/interfaces/TTournamentDetailed.md +9 -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/UserAchievement.md +1 -1
- 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/clans/UIGuide_getClanInfo.md +153 -0
- package/docs/ui/clans/UIGuide_getClans.md +172 -0
- package/docs/ui/clans/UIGuide_joinClan.md +196 -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/missions/UIGuide_getAchCategories.md +17 -0
- package/docs/ui/missions/UIGuide_getBadges.md +237 -0
- package/docs/ui/missions/UIGuide_getMissions.md +268 -0
- package/docs/ui/missions/UIGuide_requestMissionClaimReward.md +21 -0
- package/docs/ui/missions/UIGuide_requestMissionOptIn.md +16 -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/store/UIGuide_buyStoreItem.md +133 -0
- package/docs/ui/store/UIGuide_getStoreCategories.md +19 -0
- package/docs/ui/store/UIGuide_getStoreItems.md +264 -0
- package/docs/ui/store/UIGuide_getStorePurchasedItems.md +122 -0
- package/docs/ui/tournaments/UIGuide_getClanTournamentPlayers.md +140 -0
- package/docs/ui/tournaments/UIGuide_getTournamentInstanceInfo.md +265 -0
- package/docs/ui/tournaments/UIGuide_getTournamentsList.md +236 -0
- package/docs/ui/tournaments/UIGuide_registerInTournament.md +156 -0
- package/docs/ui/user/UIGuide_getActivityLog.md +130 -0
- package/docs/ui/user/UIGuide_getLevels.md +167 -0
- package/docs/ui/user/UIGuide_getUserProfile.md +213 -0
- package/package.json +3 -3
- package/scripts/postdoc-cleanup.js +195 -0
- package/src/Base/ClassId.ts +2 -0
- package/src/Jackpots/JackpotDetails.ts +14 -15
- package/src/Jackpots/JackpotPot.ts +10 -6
- package/src/Missions/MissionsUtils.ts +5 -2
- 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/Store/BuyStoreItemErrorCode.ts +8 -0
- package/src/Store/StoreItem.ts +1 -0
- package/src/Store/StoreItemPurchased.ts +1 -0
- package/src/Store/StoreItemType.ts +1 -1
- package/src/Tournaments/TournamentRegistrationError.ts +4 -0
- package/src/WSAPI/WSAPI.ts +27 -2007
- package/src/WSAPI/WSAPIAvatars.ts +345 -0
- package/src/WSAPI/WSAPIBase.ts +93 -0
- package/src/WSAPI/WSAPIBonuses.ts +268 -0
- package/src/WSAPI/WSAPIClans.ts +417 -0
- package/src/WSAPI/WSAPIGamePick.ts +667 -0
- package/src/WSAPI/WSAPIGeneral.ts +199 -0
- package/src/WSAPI/WSAPIInbox.ts +711 -0
- package/src/WSAPI/WSAPIJackpots.ts +448 -0
- package/src/WSAPI/WSAPILeaderBoard.ts +154 -0
- package/src/WSAPI/WSAPIMiniGames.ts +597 -0
- package/src/WSAPI/WSAPIMissions.ts +572 -0
- package/src/WSAPI/WSAPIRaffles.ts +703 -0
- package/src/WSAPI/WSAPIStore.ts +732 -0
- package/src/WSAPI/WSAPITournaments.ts +541 -0
- package/src/WSAPI/WSAPITypes.ts +376 -207
- package/src/WSAPI/WSAPIUser.ts +606 -0
- package/tsconfig.json +26 -2
- package/docs/api/classes/WSAPI.md +0 -1927
|
@@ -84,29 +84,42 @@ export interface TMiniGamePrize {
|
|
|
84
84
|
max_give_period_type_id?: AttemptPeriodType;
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
|
-
* TMiniGamePlayResult describes the response of
|
|
87
|
+
* TMiniGamePlayResult describes the response of
|
|
88
|
+
* `_smartico.api.playMiniGame(template_id)`.
|
|
88
89
|
*/
|
|
89
90
|
export interface TMiniGamePlayResult {
|
|
90
|
-
/** Error code
|
|
91
|
+
/** Error code. `0` = success ({@link SAWSpinErrorCode.SAW_OK}).
|
|
92
|
+
* See `playMiniGame` TSDoc for the full table. */
|
|
91
93
|
err_code: SAWSpinErrorCode;
|
|
92
|
-
/** Optional error message
|
|
94
|
+
/** Optional server-side error message. Present only on non-zero
|
|
95
|
+
* `err_code`; may be empty even then. */
|
|
93
96
|
err_message: string;
|
|
94
|
-
/**
|
|
97
|
+
/** ID of the won prize. Look up in `template.prizes` to interpret
|
|
98
|
+
* (including `prize_type === 'no-prize'` for a configured loss
|
|
99
|
+
* slot). Always populated, even when `err_code !== 0`. */
|
|
95
100
|
prize_id: number;
|
|
96
101
|
}
|
|
97
102
|
/**
|
|
98
|
-
* TMiniGamePlayBatchResult describes
|
|
103
|
+
* TMiniGamePlayBatchResult describes one entry in the array returned
|
|
104
|
+
* by `_smartico.api.playMiniGameBatch(template_id, spin_count)`.
|
|
105
|
+
*
|
|
106
|
+
* Note: this type uses `errCode` / `errMessage` (camelCase) —
|
|
107
|
+
* different from `TMiniGamePlayResult` which uses `err_code` /
|
|
108
|
+
* `err_message` (snake_case).
|
|
99
109
|
*/
|
|
100
110
|
export interface TMiniGamePlayBatchResult {
|
|
101
|
-
/**
|
|
111
|
+
/** ID of the won prize for this spin. Look up in `template.prizes`. */
|
|
102
112
|
saw_prize_id: number;
|
|
103
|
-
/** Error code
|
|
113
|
+
/** Error code. `0` = success. See `playMiniGameBatch` TSDoc for the
|
|
114
|
+
* full table. */
|
|
104
115
|
errCode: SAWSpinErrorCode;
|
|
105
|
-
/** Optional error message */
|
|
116
|
+
/** Optional server-side error message. */
|
|
106
117
|
errMessage?: string;
|
|
107
|
-
/** Jackpot amount
|
|
118
|
+
/** Jackpot amount the user won, populated when the prize type is
|
|
119
|
+
* `'jackpot'`. */
|
|
108
120
|
jackpot_amount?: number;
|
|
109
|
-
/**
|
|
121
|
+
/** Epoch ms of the user's first spin in the current cooldown
|
|
122
|
+
* period; populated when `errCode === SAWSpinErrorCode.SAW_FAILED_MAX_SPINS_REACHED`. */
|
|
110
123
|
first_spin_in_period?: number;
|
|
111
124
|
}
|
|
112
125
|
/**
|
|
@@ -193,85 +206,76 @@ export interface TMiniGameTemplate {
|
|
|
193
206
|
* _smartico.on('props_change', () => console.log(_smartico.api.getUserProfile()) );
|
|
194
207
|
*/
|
|
195
208
|
export interface TUserProfile {
|
|
196
|
-
/**
|
|
209
|
+
/** Language code stored server-side for the user (e.g. `"en"`, `"de"`). */
|
|
197
210
|
core_user_language: string;
|
|
198
|
-
/**
|
|
211
|
+
/** Current spendable points balance — decremented by store purchases,
|
|
212
|
+
* tournament buy-ins, and clan entry fees. */
|
|
199
213
|
ach_points_balance: number;
|
|
200
|
-
/**
|
|
214
|
+
/** All-time cumulative points earned. Monotonic — NOT decremented by
|
|
215
|
+
* store purchases or clan/tournament fees. */
|
|
201
216
|
ach_points_ever: number;
|
|
202
|
-
/**
|
|
217
|
+
/** Current gems balance (secondary currency). */
|
|
203
218
|
ach_gems_balance: number;
|
|
204
|
-
/**
|
|
219
|
+
/** Current diamonds balance (tertiary currency). */
|
|
205
220
|
ach_diamonds_balance: number;
|
|
206
|
-
/**
|
|
207
|
-
*
|
|
208
|
-
* They can be treated as server-based cookies.
|
|
209
|
-
* You can set tags using following method _smartico.event('core_public_tags_update', { core_public_tags: ['A', 'B'] } );
|
|
210
|
-
* And then you can check for the tags
|
|
211
|
-
*/
|
|
221
|
+
/** Server-stored public tags on the user (uppercase strings).
|
|
222
|
+
* Modify via `_smartico.updatePublicTags(operation, tags)`. */
|
|
212
223
|
core_public_tags: string[];
|
|
213
|
-
/**
|
|
224
|
+
/** FK into the level ladder; resolve via `getCurrentLevel()` or `getLevels()`. */
|
|
214
225
|
ach_level_current_id?: number;
|
|
215
|
-
/**
|
|
226
|
+
/** `true` when the user is flagged as a test account. */
|
|
216
227
|
core_is_test_account?: boolean;
|
|
217
|
-
/**
|
|
228
|
+
/** Resolved CDN URL for the user's avatar. */
|
|
218
229
|
avatar_url?: string;
|
|
219
|
-
/**
|
|
230
|
+
/** Display username (operator-defined alias). */
|
|
220
231
|
public_username?: string;
|
|
221
|
-
/**
|
|
232
|
+
/** Unread inbox messages count. Push-updated in real time. */
|
|
222
233
|
core_inbox_unread_count?: number;
|
|
223
|
-
/**
|
|
234
|
+
/** AI-recommended deposit amount for this user. Undefined when no
|
|
235
|
+
* recommendation is currently available. */
|
|
224
236
|
core_recommended_deposit_amount?: number;
|
|
225
|
-
/**
|
|
237
|
+
/** AI-recommended casino bet amount for this user. Undefined when no
|
|
238
|
+
* recommendation is currently available. */
|
|
226
239
|
core_recommended_casino_bet_amount?: number;
|
|
227
240
|
}
|
|
228
241
|
/**
|
|
229
|
-
* TLevel describes
|
|
230
|
-
*
|
|
231
|
-
* The current level of user can be taken from the user object using ach_level_current_id property
|
|
232
|
-
* The progress to the next level can be calculated using ach_points_ever and required_points properties of next level
|
|
242
|
+
* TLevel describes one level in the label's level ladder.
|
|
243
|
+
* Returned by `_smartico.api.getLevels()` (already sorted by `required_points` ASC).
|
|
233
244
|
*/
|
|
234
245
|
export interface TLevel {
|
|
235
|
-
/**
|
|
246
|
+
/** Stable ID of the level. */
|
|
236
247
|
id: number;
|
|
237
|
-
/**
|
|
248
|
+
/** Display name of the level, pre-translated to the user's language. */
|
|
238
249
|
name: string;
|
|
239
|
-
/**
|
|
250
|
+
/** Display description of the level, pre-translated to the user's language. */
|
|
240
251
|
description: string;
|
|
241
|
-
/**
|
|
252
|
+
/** URL of the level image (256x256 px source). */
|
|
242
253
|
image: string;
|
|
243
|
-
/**
|
|
254
|
+
/** Total `ach_points_ever` required to reach this level. */
|
|
244
255
|
required_points: number;
|
|
245
|
-
/**
|
|
256
|
+
/** Visibility threshold — clients hide the level from the user until
|
|
257
|
+
* `ach_points_ever >= visibility_points`. `null` means always visible. */
|
|
246
258
|
visibility_points: number;
|
|
247
|
-
/**
|
|
248
|
-
*
|
|
249
|
-
* Relevant in case of using advanced leveling logic
|
|
250
|
-
* https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
|
|
251
|
-
*
|
|
252
|
-
*/
|
|
259
|
+
/** Required value of the first level counter for sliding-window leveling.
|
|
260
|
+
* `null` on points-only labels. See `UserLevelExtraCountersT`. */
|
|
253
261
|
required_level_counter_1: number;
|
|
254
|
-
/**
|
|
255
|
-
*
|
|
256
|
-
* Relevant in case of using advanced leveling logic
|
|
257
|
-
* https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
|
|
258
|
-
*
|
|
259
|
-
*/
|
|
262
|
+
/** Required value of the second level counter for sliding-window leveling.
|
|
263
|
+
* `null` on points-only labels. */
|
|
260
264
|
required_level_counter_2: number;
|
|
261
|
-
/**
|
|
262
|
-
*
|
|
263
|
-
* You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
|
|
264
|
-
* Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
|
|
265
|
-
*/
|
|
265
|
+
/** Operator-defined custom data. The SDK auto-parses JSON-looking
|
|
266
|
+
* strings, so at runtime this is `any` despite the `string` type. */
|
|
266
267
|
custom_data: string;
|
|
267
|
-
/**
|
|
268
|
+
/** 1-based position in the ladder (matches the order of the returned
|
|
269
|
+
* array, which is sorted by `required_points` ASC). */
|
|
268
270
|
ordinal_position: number;
|
|
269
271
|
}
|
|
270
272
|
/**
|
|
271
|
-
* TLevelCurrent
|
|
273
|
+
* TLevelCurrent extends `TLevel` with the user's progress toward the next level.
|
|
274
|
+
* Returned by `_smartico.api.getCurrentLevel()`.
|
|
272
275
|
*/
|
|
273
276
|
export interface TLevelCurrent extends TLevel {
|
|
274
|
-
/**
|
|
277
|
+
/** Progress to the next level as a 0–100 integer percentage. `100`
|
|
278
|
+
* at the highest level. */
|
|
275
279
|
progress: number;
|
|
276
280
|
}
|
|
277
281
|
/**
|
|
@@ -300,7 +304,7 @@ export interface TTournament {
|
|
|
300
304
|
segment_dont_match_message: string;
|
|
301
305
|
/**
|
|
302
306
|
* The ID of the custom section where the tournament is assigned
|
|
303
|
-
* The list of custom sections can be retrieved using _smartico.api.getCustomSections() method
|
|
307
|
+
* The list of custom sections can be retrieved using _smartico.api.getCustomSections() method
|
|
304
308
|
*/
|
|
305
309
|
custom_section_id: number;
|
|
306
310
|
/** The custom data of the tournament defined by operator. Can be a JSON object, string or number */
|
|
@@ -535,13 +539,17 @@ export interface TClan {
|
|
|
535
539
|
member_count: number;
|
|
536
540
|
/** Max number of members allowed in clan */
|
|
537
541
|
capacity_limit: number;
|
|
538
|
-
/**
|
|
542
|
+
/** Currency type for `entry_fee_amount`. `0` = points, `1` = gems,
|
|
543
|
+
* `2` = diamonds, `3` = free (no fee). */
|
|
539
544
|
entry_fee_currency_type_id: number;
|
|
540
|
-
/**
|
|
545
|
+
/** Entry fee amount in the currency indicated by `entry_fee_currency_type_id`.
|
|
546
|
+
* `0` (or `entry_fee_currency_type_id === 3`) means the clan is free to join. */
|
|
541
547
|
entry_fee_amount: number;
|
|
542
|
-
/**
|
|
548
|
+
/** Global rank among all active clans in the label, by `rating_score` DESC.
|
|
549
|
+
* `1` = highest-rated. May skip positions when some clans are hidden by
|
|
550
|
+
* per-user visibility (e.g. user sees positions 1, 3, 7). */
|
|
543
551
|
rating_position: number;
|
|
544
|
-
/** Clan rating score */
|
|
552
|
+
/** Clan rating score (higher is better). */
|
|
545
553
|
rating_score: number;
|
|
546
554
|
}
|
|
547
555
|
/**
|
|
@@ -552,45 +560,83 @@ export interface TClans {
|
|
|
552
560
|
clans: TClan[];
|
|
553
561
|
/** The clan ID the current user belongs to; null if clanless */
|
|
554
562
|
user_clan_id: number | null;
|
|
555
|
-
/**
|
|
563
|
+
/** Switch-cooldown expiry as ISO 8601 UTC string ("YYYY-MM-DDTHH:MM:SS"
|
|
564
|
+
* with no timezone suffix; interpret as UTC). `null` when no cooldown.
|
|
565
|
+
* User-level: while set, the user cannot join any clan. */
|
|
556
566
|
cooldown_until: string | null;
|
|
557
567
|
/** Epoch ms when the current user joined their clan; null if clanless */
|
|
558
568
|
join_date: number | null;
|
|
559
569
|
}
|
|
560
570
|
/**
|
|
561
571
|
* TClanInfo describes the detailed info of a single clan including its members.
|
|
572
|
+
* Returned by `_smartico.api.getClanInfo(clanId)`.
|
|
562
573
|
*/
|
|
563
574
|
export interface TClanInfo {
|
|
575
|
+
/** Clan ID. */
|
|
564
576
|
clan_id: number;
|
|
577
|
+
/** Translated clan metadata (name, description, image URL). */
|
|
565
578
|
public_meta: {
|
|
566
579
|
name: string;
|
|
567
580
|
description: string;
|
|
568
581
|
image_url: string;
|
|
569
582
|
};
|
|
583
|
+
/** Current number of members in clan. */
|
|
570
584
|
member_count: number;
|
|
585
|
+
/** Max number of members allowed in clan. */
|
|
571
586
|
capacity_limit: number;
|
|
587
|
+
/** Currency type for `entry_fee_amount`. `0` = points, `1` = gems,
|
|
588
|
+
* `2` = diamonds, `3` = free. */
|
|
572
589
|
entry_fee_currency_type_id: number;
|
|
590
|
+
/** Entry fee amount in the currency indicated by `entry_fee_currency_type_id`. */
|
|
573
591
|
entry_fee_amount: number;
|
|
592
|
+
/** Global rank among all active clans in the label, by `rating_score` DESC.
|
|
593
|
+
* `1` = highest-rated. */
|
|
574
594
|
rating_position: number;
|
|
595
|
+
/** Clan rating score (higher is better). */
|
|
575
596
|
rating_score: number;
|
|
597
|
+
/** User-level switch-cooldown expiry as ISO 8601 UTC string
|
|
598
|
+
* ("YYYY-MM-DDTHH:MM:SS" with no timezone suffix). `null` when no
|
|
599
|
+
* cooldown. Same semantic as `TClans.cooldown_until` but always fresh
|
|
600
|
+
* (the list version may be up to 30 s stale). */
|
|
576
601
|
cooldown_until: string | null;
|
|
602
|
+
/** Members of this clan, server-ordered by `contribution_score` DESC
|
|
603
|
+
* (i.e. `position` ASC). */
|
|
577
604
|
members: {
|
|
605
|
+
/** Member's internal user ID. */
|
|
578
606
|
user_id: number;
|
|
607
|
+
/** Member's display username. */
|
|
579
608
|
public_username: string;
|
|
609
|
+
/** Avatar identifier; resolve via `avatar_url` below or rebuild
|
|
610
|
+
* from `avatar_id` + brand avatar domain. */
|
|
580
611
|
avatar_id: string;
|
|
612
|
+
/** Numeric avatar ID (alternative identifier). */
|
|
581
613
|
avatar_real_id: number;
|
|
614
|
+
/** Pre-resolved CDN URL for the avatar. */
|
|
582
615
|
avatar_url?: string;
|
|
616
|
+
/** Member's rank within this clan; `1` = top contributor. */
|
|
583
617
|
position: number;
|
|
618
|
+
/** Member's contribution to the clan rating score. */
|
|
584
619
|
contribution_score: number;
|
|
620
|
+
/** `true` when this row is the current authenticated user. */
|
|
585
621
|
is_me?: boolean;
|
|
622
|
+
/** External user identifier (operator-provided alias);
|
|
623
|
+
* preferred over `public_username` on some surfaces. */
|
|
586
624
|
clean_ext_user_id?: string;
|
|
587
625
|
}[];
|
|
588
626
|
}
|
|
589
627
|
/**
|
|
590
|
-
* TClanJoinResult describes the result of a join
|
|
628
|
+
* TClanJoinResult describes the result of a join-clan request.
|
|
629
|
+
* Note: this type uses `errCode` / `errMsg` (camelCase) — different
|
|
630
|
+
* from most other SDK result types in this library which use
|
|
631
|
+
* `err_code` / `err_message` (snake_case).
|
|
591
632
|
*/
|
|
592
633
|
export interface TClanJoinResult {
|
|
634
|
+
/** Error code. `0` = success. Typed values are members of
|
|
635
|
+
* {@link JoinClanErrorCode}. See `joinClan` TSDoc for the full
|
|
636
|
+
* table and per-code UI guidance. */
|
|
593
637
|
errCode: number;
|
|
638
|
+
/** Optional server-side error message. Present only on non-zero
|
|
639
|
+
* `errCode`; may be empty even then. */
|
|
594
640
|
errMsg: string;
|
|
595
641
|
}
|
|
596
642
|
/**
|
|
@@ -645,7 +691,9 @@ export interface TStoreItem {
|
|
|
645
691
|
can_buy: boolean;
|
|
646
692
|
/** The list of IDs of the categories where the store item is assigned, information about categories can be retrieved with getStoreCategories method */
|
|
647
693
|
category_ids: number[];
|
|
648
|
-
/**
|
|
694
|
+
/** Items remaining in the pool available for purchase. `null` = unlimited
|
|
695
|
+
* supply. Positive integer = remaining stock. `0` = sold out but still
|
|
696
|
+
* returned (operator may instead hide pool-empty items entirely). */
|
|
649
697
|
pool?: number;
|
|
650
698
|
/** The custom data of the store item defined by operator. Can be a JSON object, string or number */
|
|
651
699
|
custom_data: any;
|
|
@@ -665,6 +713,8 @@ export interface TStoreItem {
|
|
|
665
713
|
purchase_type: 'points' | 'gems' | 'diamonds';
|
|
666
714
|
/** The date when the store item will be available till */
|
|
667
715
|
active_till_date?: number;
|
|
716
|
+
/** Should countdown timer be shown when `active_till_date` is present */
|
|
717
|
+
show_timer?: boolean;
|
|
668
718
|
/** The discounted price of the store item */
|
|
669
719
|
discounted_price?: number;
|
|
670
720
|
/** The ribbon of the discounted price. */
|
|
@@ -681,14 +731,24 @@ export interface TStoreItem {
|
|
|
681
731
|
cant_buy_message?: string;
|
|
682
732
|
}
|
|
683
733
|
/**
|
|
684
|
-
* TAchCategory describes
|
|
734
|
+
* TAchCategory describes a mission/badge category. Categories are
|
|
735
|
+
* operator-defined groupings, configured per-label by the brand operator,
|
|
736
|
+
* shared across BOTH missions and badges — the same list is returned for
|
|
737
|
+
* both entity types. A mission or badge can belong to **zero or more**
|
|
738
|
+
* categories (many-to-many) via its `category_ids: number[]` field on
|
|
739
|
+
* `TMissionOrBadge`.
|
|
740
|
+
*
|
|
741
|
+
* Returned by `_smartico.api.getAchCategories()`. See that method's TSDoc
|
|
742
|
+
* for translation, refresh, and rendering details.
|
|
685
743
|
*/
|
|
686
744
|
export interface TAchCategory {
|
|
687
|
-
/**ID of the
|
|
745
|
+
/** Stable numeric ID of the category. Used as the key when joining to
|
|
746
|
+
* `TMissionOrBadge.category_ids: number[]`. */
|
|
688
747
|
id: number;
|
|
689
|
-
/**
|
|
748
|
+
/** Display name of the category, pre-translated server-side. Never null. */
|
|
690
749
|
name: string;
|
|
691
|
-
/**
|
|
750
|
+
/** Relative display position (lower = appears first). Default 1 when the
|
|
751
|
+
* operator did not configure an explicit order. */
|
|
692
752
|
order: number;
|
|
693
753
|
}
|
|
694
754
|
/**
|
|
@@ -740,8 +800,8 @@ export interface TMissionOrBadge {
|
|
|
740
800
|
/** The text of the CTA button, e.g. 'Make a deposit' */
|
|
741
801
|
cta_text: string;
|
|
742
802
|
/**
|
|
743
|
-
* The ID of the custom section where the mission or badge is assigned
|
|
744
|
-
*
|
|
803
|
+
* The ID of the custom section where the mission or badge is assigned.
|
|
804
|
+
* Resolve to section metadata via `_smartico.api.getCustomSections()`.
|
|
745
805
|
*/
|
|
746
806
|
custom_section_id: number;
|
|
747
807
|
/** The indicator if the mission or badge is visible only in the custom section and should be hidden from the main overview of missions/badges */
|
|
@@ -760,7 +820,8 @@ export interface TMissionOrBadge {
|
|
|
760
820
|
position?: number;
|
|
761
821
|
/** The ribbon of the mission/badge item. Can be 'sale', 'hot', 'new', 'vip' or URL to the image in case of custom ribbon, 250x300px */
|
|
762
822
|
ribbon?: TRibbon;
|
|
763
|
-
/**
|
|
823
|
+
/** Stable identifier of this specific mission completion. Undefined for
|
|
824
|
+
* badges and for missions that have not yet completed. */
|
|
764
825
|
ach_completed_id?: number;
|
|
765
826
|
/** Flag from achievement if the mission prize will be given only after user claims it */
|
|
766
827
|
requires_prize_claim?: boolean;
|
|
@@ -844,234 +905,331 @@ export interface TMissionOrBadgeTask {
|
|
|
844
905
|
execution_count_actual?: number;
|
|
845
906
|
}
|
|
846
907
|
/**
|
|
847
|
-
*
|
|
908
|
+
* Response of `_smartico.api.requestMissionOptIn(mission_id)`.
|
|
909
|
+
*
|
|
910
|
+
* See `requestMissionOptIn` TSDoc for the full table of `err_code` values
|
|
911
|
+
* and recommended UI handling.
|
|
848
912
|
*/
|
|
849
913
|
export interface TMissionOptInResult {
|
|
850
|
-
/** Error code
|
|
914
|
+
/** Error code. `0` = success. See `requestMissionOptIn` TSDoc for the full table. */
|
|
851
915
|
err_code: number;
|
|
852
|
-
/** Optional error message */
|
|
916
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
853
917
|
err_message: string;
|
|
854
918
|
}
|
|
855
919
|
/**
|
|
856
|
-
*
|
|
920
|
+
* Response of `_smartico.api.requestMissionClaimReward(mission_id, ach_completed_id)`.
|
|
921
|
+
*
|
|
922
|
+
* See `requestMissionClaimReward` TSDoc for the full table of `err_code`
|
|
923
|
+
* values, preconditions, side effects, and recommended UI handling.
|
|
857
924
|
*/
|
|
858
925
|
export interface TMissionClaimRewardResult {
|
|
859
|
-
/** Error code
|
|
926
|
+
/** Error code. `0` = success (rewards credited). See `requestMissionClaimReward` TSDoc for the full table. */
|
|
860
927
|
err_code: number;
|
|
861
|
-
/** Optional error message */
|
|
928
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
862
929
|
err_message: string;
|
|
863
930
|
}
|
|
931
|
+
/**
|
|
932
|
+
* Result of `_smartico.api.registerInTournament(tournament_id)`.
|
|
933
|
+
*/
|
|
864
934
|
export interface TTournamentRegistrationResult {
|
|
865
|
-
/** Error code
|
|
935
|
+
/** Error code. `0` = success. See `registerInTournament` TSDoc for the full table. */
|
|
866
936
|
err_code: TournamentRegistrationError;
|
|
867
|
-
/** Optional error message */
|
|
937
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
868
938
|
err_message: string;
|
|
869
939
|
}
|
|
940
|
+
/**
|
|
941
|
+
* Result of `_smartico.api.buyStoreItem(store_item_id)`.
|
|
942
|
+
*/
|
|
870
943
|
export interface TBuyStoreItemResult {
|
|
871
|
-
/** Error code
|
|
872
|
-
*
|
|
873
|
-
* Example for error handling:
|
|
874
|
-
* ```javascript
|
|
875
|
-
* SmarticoAPI.buyStoreItem(item_id).then(res => {
|
|
876
|
-
* if (res.err_code !== 0) {
|
|
877
|
-
* // YOUR LOGIC HERE, you can use res.err_message, but it's optional and not always present
|
|
878
|
-
* }
|
|
879
|
-
* });
|
|
880
|
-
* ```
|
|
881
|
-
*/
|
|
944
|
+
/** Error code. `0` = success. See `buyStoreItem` TSDoc for the full table. */
|
|
882
945
|
err_code: BuyStoreItemErrorCode;
|
|
883
|
-
/** Optional error message */
|
|
946
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
884
947
|
err_message: string;
|
|
885
948
|
}
|
|
949
|
+
/**
|
|
950
|
+
* Result of `getTranslations(lang_code)`.
|
|
951
|
+
*/
|
|
886
952
|
export interface TGetTranslations {
|
|
953
|
+
/** Flat dictionary of operator-defined translation key → translated string. */
|
|
887
954
|
translations: {
|
|
888
955
|
[key: string]: string;
|
|
889
956
|
};
|
|
890
957
|
}
|
|
958
|
+
/**
|
|
959
|
+
* TInboxMessage is the lightweight envelope returned by
|
|
960
|
+
* `_smartico.api.getInboxMessages()`. Fetch the rich body (title,
|
|
961
|
+
* preview, icon, html_body, buttons) separately via
|
|
962
|
+
* `_smartico.api.getInboxMessageBody(message_guid)`.
|
|
963
|
+
*/
|
|
891
964
|
export interface TInboxMessage {
|
|
892
|
-
/**
|
|
965
|
+
/** Unique identifier of the message. Pass to `getInboxMessageBody`
|
|
966
|
+
* and the mark / favorite / delete mutations. */
|
|
893
967
|
message_guid: string;
|
|
894
|
-
/** Date when the message was sent */
|
|
968
|
+
/** Date when the message was sent (server timestamp). */
|
|
895
969
|
sent_date: string;
|
|
896
|
-
/**
|
|
970
|
+
/** `true` when the message has been marked read. */
|
|
897
971
|
read: boolean;
|
|
898
|
-
/**
|
|
972
|
+
/** `true` when the message has been starred (favorited). */
|
|
899
973
|
favorite: boolean;
|
|
900
|
-
/**
|
|
974
|
+
/** Operator-assigned category ({@link InboxCategories}). */
|
|
901
975
|
category_id?: InboxCategories;
|
|
902
|
-
/**
|
|
976
|
+
/** Expiry timestamp as Unix-ms epoch. Server filters out expired
|
|
977
|
+
* messages from list responses — consumers rarely see this set
|
|
978
|
+
* unless the expiry is upcoming. */
|
|
903
979
|
expire_on_dt?: number;
|
|
904
980
|
}
|
|
981
|
+
/**
|
|
982
|
+
* TInboxMessageBody is the rich body of one inbox message.
|
|
983
|
+
* Returned by `_smartico.api.getInboxMessageBody(message_guid)`.
|
|
984
|
+
* Fetched from a CDN (not over WebSocket).
|
|
985
|
+
*/
|
|
905
986
|
export interface TInboxMessageBody {
|
|
906
|
-
/**
|
|
987
|
+
/** Display title. */
|
|
907
988
|
title: string;
|
|
908
|
-
/** Short preview
|
|
989
|
+
/** Short preview text (typically rendered alongside the title in list items). */
|
|
909
990
|
preview_body: string;
|
|
910
|
-
/** Message icon
|
|
991
|
+
/** Message icon URL (128×128 px recommended). */
|
|
911
992
|
icon: string;
|
|
912
|
-
/**
|
|
913
|
-
*
|
|
914
|
-
*
|
|
915
|
-
*
|
|
916
|
-
*/
|
|
993
|
+
/** Click-action — either a deep-link (e.g. `'dp:deposit'`) or a
|
|
994
|
+
* plain URL. The literal `'dp:inbox'` indicates the message has a
|
|
995
|
+
* rich `html_body`; for any other value `html_body` and `buttons`
|
|
996
|
+
* are absent. Pass to `_smartico.dp(action)` for safe execution. */
|
|
917
997
|
action: string;
|
|
918
|
-
/** Rich HTML body
|
|
998
|
+
/** Rich HTML body. Populated only when `action === 'dp:inbox'`. */
|
|
919
999
|
html_body?: string;
|
|
920
|
-
/**
|
|
1000
|
+
/** Up to 2 additional action buttons. Populated only when
|
|
1001
|
+
* `action === 'dp:inbox'`. */
|
|
921
1002
|
buttons?: {
|
|
922
|
-
/**
|
|
1003
|
+
/** Button click-action (deep-link or URL). */
|
|
923
1004
|
action: string;
|
|
924
|
-
/** Button
|
|
1005
|
+
/** Button label. */
|
|
925
1006
|
text: string;
|
|
926
1007
|
}[];
|
|
927
|
-
/**
|
|
1008
|
+
/** Operator-defined custom data. The SDK auto-parses JSON-looking
|
|
1009
|
+
* strings, so at runtime this is `any` despite the `string` type. */
|
|
928
1010
|
custom_data?: string;
|
|
929
1011
|
}
|
|
1012
|
+
/**
|
|
1013
|
+
* InboxMarkMessageAction is the response of the five inbox mutation
|
|
1014
|
+
* methods (`markInboxMessageAsRead`, `markAllInboxMessagesAsRead`,
|
|
1015
|
+
* `markUnmarkInboxMessageAsFavorite`, `deleteInboxMessage`,
|
|
1016
|
+
* `deleteAllInboxMessages`).
|
|
1017
|
+
*/
|
|
930
1018
|
export interface InboxMarkMessageAction {
|
|
931
|
-
/**
|
|
1019
|
+
/** Error code. `0` = success. See the calling method's TSDoc for
|
|
1020
|
+
* the full error semantics (server returns generic codes; the
|
|
1021
|
+
* five inbox mutations share the same shape). */
|
|
932
1022
|
err_code: number;
|
|
933
|
-
/** Optional error message
|
|
1023
|
+
/** Optional server-side error message. Present only on non-zero
|
|
1024
|
+
* `err_code`; may be empty even then. */
|
|
934
1025
|
err_message: string;
|
|
935
1026
|
}
|
|
1027
|
+
/**
|
|
1028
|
+
* LeaderBoardDetailsT describes one period's leaderboard.
|
|
1029
|
+
* Returned by `_smartico.api.getLeaderBoard(periodType, getPreviousPeriod?)`.
|
|
1030
|
+
* May be `undefined` at runtime when no board is configured for the requested period.
|
|
1031
|
+
*/
|
|
936
1032
|
export interface LeaderBoardDetailsT {
|
|
937
|
-
/** ID of the leaderboard */
|
|
1033
|
+
/** Stable ID of the leaderboard. */
|
|
938
1034
|
board_id: number;
|
|
939
|
-
/**
|
|
1035
|
+
/** Operator-defined display name. */
|
|
940
1036
|
name: string;
|
|
941
|
-
/**
|
|
1037
|
+
/** Operator-defined description (HTML allowed). */
|
|
942
1038
|
description: string;
|
|
943
|
-
/**
|
|
1039
|
+
/** Operator-defined rules / terms (HTML allowed). */
|
|
944
1040
|
rules: string;
|
|
945
|
-
/**
|
|
1041
|
+
/** Period type this board is bound to ({@link LeaderBoardPeriodType}). */
|
|
946
1042
|
period_type_id: LeaderBoardPeriodType;
|
|
947
|
-
/**
|
|
1043
|
+
/** Per-place prize table; the array length is the number of paid places. */
|
|
948
1044
|
rewards: LeaderBoardsRewardsT[];
|
|
949
|
-
/**
|
|
1045
|
+
/** Top-20 ranked entries (server-capped), sorted by `position` ASC. */
|
|
950
1046
|
users: LeaderBoardUserT[];
|
|
951
|
-
/**
|
|
1047
|
+
/** Current user's own entry. `undefined` for visitor sessions.
|
|
1048
|
+
* For authenticated users, `position === -1` means the user is
|
|
1049
|
+
* unranked / outside the ranked window. */
|
|
952
1050
|
me?: LeaderBoardUserT;
|
|
953
1051
|
}
|
|
1052
|
+
/**
|
|
1053
|
+
* LeaderBoardsRewardsT describes one place's prize on a leaderboard.
|
|
1054
|
+
* Leaderboard prizes are always gamification points (never gems / diamonds / items).
|
|
1055
|
+
*/
|
|
954
1056
|
export interface LeaderBoardsRewardsT {
|
|
1057
|
+
/** Place number (1-based). */
|
|
955
1058
|
place: number;
|
|
1059
|
+
/** Gamification points awarded to the user occupying this place at period finalization. */
|
|
956
1060
|
points: number;
|
|
957
1061
|
}
|
|
1062
|
+
/**
|
|
1063
|
+
* LeaderBoardUserT describes one participant row on a leaderboard.
|
|
1064
|
+
*/
|
|
958
1065
|
export interface LeaderBoardUserT {
|
|
959
|
-
/**
|
|
1066
|
+
/** Display username (operator-defined alias). */
|
|
960
1067
|
public_username: string;
|
|
961
|
-
/**
|
|
1068
|
+
/** Resolved CDN URL for the participant's avatar. */
|
|
962
1069
|
avatar_url: string;
|
|
963
|
-
/**
|
|
1070
|
+
/** Rank in the leaderboard (DENSE_RANK over all participants).
|
|
1071
|
+
* `-1` on the `me` entry signals "unranked / outside the window". */
|
|
964
1072
|
position: number;
|
|
965
|
-
/**
|
|
1073
|
+
/** Participant's points for this period. */
|
|
966
1074
|
points: number;
|
|
967
|
-
/**
|
|
1075
|
+
/** `true` when this row is the current authenticated user. */
|
|
968
1076
|
is_me: boolean;
|
|
969
1077
|
}
|
|
1078
|
+
/**
|
|
1079
|
+
* UserLevelExtraCountersT exposes the user's current values for the two
|
|
1080
|
+
* label-defined sliding-window level counters. Returned by
|
|
1081
|
+
* `_smartico.api.getUserLevelExtraCounters()`. Both fields are
|
|
1082
|
+
* `undefined` on points-only labels.
|
|
1083
|
+
*/
|
|
970
1084
|
export interface UserLevelExtraCountersT {
|
|
971
|
-
/**
|
|
1085
|
+
/** Current value of the user's first level counter. Operator-defined
|
|
1086
|
+
* semantics per label. `undefined` on points-only labels. */
|
|
972
1087
|
level_counter_1?: number;
|
|
973
|
-
/**
|
|
1088
|
+
/** Current value of the user's second level counter. Operator-defined
|
|
1089
|
+
* semantics per label. `undefined` on points-only labels. */
|
|
974
1090
|
level_counter_2?: number;
|
|
975
1091
|
}
|
|
1092
|
+
/**
|
|
1093
|
+
* TSegmentCheckResult describes one segment-membership outcome.
|
|
1094
|
+
* Returned by `_smartico.api.checkSegmentListMatch()` (and used
|
|
1095
|
+
* internally by `checkSegmentMatch()`).
|
|
1096
|
+
*/
|
|
976
1097
|
export interface TSegmentCheckResult {
|
|
1098
|
+
/** The segment ID this result refers to (label-scoped). */
|
|
977
1099
|
segment_id: number;
|
|
1100
|
+
/** `true` if the user currently matches this segment. `false` also
|
|
1101
|
+
* covers the case where the segment doesn't exist for the label —
|
|
1102
|
+
* the two are not distinguishable. */
|
|
978
1103
|
is_matching: boolean;
|
|
979
1104
|
}
|
|
1105
|
+
/**
|
|
1106
|
+
* One operator-configured navigation entry. Returned by `getCustomSections()`.
|
|
1107
|
+
* `section_type_id` is the dispatch key — it determines which page component the
|
|
1108
|
+
* consumer mounts when the user opens this section.
|
|
1109
|
+
*/
|
|
980
1110
|
export interface TUICustomSection {
|
|
981
|
-
/**
|
|
1111
|
+
/** Stable numeric ID of the section. */
|
|
982
1112
|
id: number;
|
|
983
|
-
/**
|
|
1113
|
+
/** Raw HTML body for `HTML_PAGE` sections; Liquid template body for `LEVELS` (Liquid) sections. */
|
|
984
1114
|
body?: string;
|
|
985
|
-
/**
|
|
1115
|
+
/** CDN URL of the section's nav icon, 64x64 px square. */
|
|
986
1116
|
menu_img?: string;
|
|
987
|
-
/**
|
|
1117
|
+
/** Display name shown next to the nav icon. Pre-translated server-side. */
|
|
988
1118
|
menu_name?: string;
|
|
989
|
-
/**
|
|
1119
|
+
/** JSON-serialized list of skin image overrides for themed sections (e.g. `MISSION_CUSTOM_LAYOUT`). */
|
|
990
1120
|
custom_skin_images?: string;
|
|
991
|
-
/**
|
|
1121
|
+
/** Dispatch key — see {@link AchCustomSectionType}. */
|
|
992
1122
|
section_type_id?: AchCustomSectionType;
|
|
993
|
-
/**
|
|
1123
|
+
/** Themed-layout name for `MISSION_CUSTOM_LAYOUT` sections; see {@link AchCustomLayoutTheme}. */
|
|
994
1124
|
theme?: AchCustomLayoutTheme;
|
|
995
|
-
/** Custom
|
|
1125
|
+
/** Custom CSS for themed layouts. */
|
|
996
1126
|
generic_custom_css?: string;
|
|
997
|
-
/**
|
|
1127
|
+
/** Which tabs to render for `MISSIONS_CATEGORY` sections; see {@link AchMissionsTabsOptions}. */
|
|
998
1128
|
mission_tabs_options?: AchMissionsTabsOptions;
|
|
999
|
-
/**
|
|
1129
|
+
/** Mission-filter rule for the Overview tab; see {@link AchOverviewMissionsFilter}. */
|
|
1000
1130
|
overview_missions_filter?: AchOverviewMissionsFilter;
|
|
1001
|
-
/**
|
|
1131
|
+
/** Maximum number of missions shown in the Overview tab. */
|
|
1002
1132
|
overview_missions_count?: number;
|
|
1003
|
-
/**
|
|
1133
|
+
/** Click target for `REDIRECT_LINK` sections — either a Smartico DP string (`dp:…`) or an external URL. */
|
|
1004
1134
|
url_or_dp?: string;
|
|
1005
|
-
/** Data
|
|
1135
|
+
/** Data-context selectors for Liquid templates; see {@link LiquidEntityData}. */
|
|
1006
1136
|
liquid_entity_data?: LiquidEntityData[];
|
|
1007
|
-
/** Tournament ID
|
|
1137
|
+
/** Tournament ID for a single-tournament Liquid template (`LiquidEntityData.Tournament`). */
|
|
1008
1138
|
ach_tournament_id?: number;
|
|
1009
|
-
/**
|
|
1139
|
+
/** Operator debug flag — when `true`, Liquid renders raw context data instead of the templated HTML. */
|
|
1010
1140
|
show_raw_data?: boolean;
|
|
1011
|
-
/** Liquid template
|
|
1141
|
+
/** Liquid template ID resolved server-side; the rendered body is delivered in `body`. */
|
|
1012
1142
|
liquid_template?: number;
|
|
1013
|
-
/**
|
|
1143
|
+
/** Category IDs the section filters badges by — correlate with `getAchCategories()`. */
|
|
1014
1144
|
ach_category_ids?: number[];
|
|
1015
|
-
/**
|
|
1145
|
+
/** Category IDs the section filters store items by — correlate with `getStoreCategories()`. */
|
|
1016
1146
|
shop_category_ids?: number[];
|
|
1017
|
-
/** ID
|
|
1147
|
+
/** Raffle ID for `RAFFLE` sections (and `LiquidEntityData.SingleRaffle` Liquid templates). */
|
|
1018
1148
|
raffle_id?: number;
|
|
1019
1149
|
}
|
|
1150
|
+
/**
|
|
1151
|
+
* TBonus describes one bonus awarded to the user.
|
|
1152
|
+
* Returned by `_smartico.api.getBonuses()`.
|
|
1153
|
+
*/
|
|
1020
1154
|
export interface TBonus {
|
|
1021
|
-
/** ID of the bonus */
|
|
1155
|
+
/** Stable ID of the bonus. */
|
|
1022
1156
|
bonus_id: number;
|
|
1023
|
-
/**
|
|
1157
|
+
/** `true` when the bonus is in a player-claim-required state.
|
|
1158
|
+
* Gate the Claim button on this; see `claimBonus` TSDoc. */
|
|
1024
1159
|
is_redeemable?: boolean;
|
|
1025
|
-
/**
|
|
1160
|
+
/** Bonus creation timestamp as ISO 8601 UTC string
|
|
1161
|
+
* ("YYYY-MM-DDTHH:MM:SS", no timezone suffix). */
|
|
1026
1162
|
create_date?: string;
|
|
1027
|
-
/**
|
|
1163
|
+
/** Bonus redemption timestamp as ISO 8601 UTC string. Absent until
|
|
1164
|
+
* the bonus reaches `BonusStatus.REDEEMED`. */
|
|
1028
1165
|
redeem_date?: string;
|
|
1029
|
-
/** ID of template used */
|
|
1166
|
+
/** ID of the bonus template used to issue this bonus. */
|
|
1030
1167
|
label_bonus_template_id?: number;
|
|
1031
|
-
/**
|
|
1168
|
+
/** Lifecycle status; see {@link BonusStatus}. */
|
|
1032
1169
|
bonus_status_id?: BonusStatus;
|
|
1033
|
-
/**
|
|
1170
|
+
/** Template-level display metadata (operator-configured, identical
|
|
1171
|
+
* across all bonuses from the same template). */
|
|
1034
1172
|
label_bonus_template_meta_map?: BonusTemplateMetaMap;
|
|
1035
|
-
/**
|
|
1173
|
+
/** Instance-level display metadata (per-issuance; carries the
|
|
1174
|
+
* dynamic amount computed at award time). */
|
|
1036
1175
|
bonus_meta_map?: BonusMetaMap;
|
|
1037
1176
|
}
|
|
1177
|
+
/**
|
|
1178
|
+
* BonusStatus describes the lifecycle stage of a bonus on `TBonus.bonus_status_id`.
|
|
1179
|
+
* Operator widget configuration typically filters out internal statuses
|
|
1180
|
+
* (`New`, `COUPON_ISSUE_FAILED`, `EXPIRED`); consumers usually see
|
|
1181
|
+
* `COUPON_ISSUED`, `REDEEMED`, and `REDEEM_FAILED`.
|
|
1182
|
+
*/
|
|
1038
1183
|
export declare enum BonusStatus {
|
|
1039
|
-
/**
|
|
1184
|
+
/** Newly created, not yet processed (internal). */
|
|
1040
1185
|
New = 1,
|
|
1041
|
-
/**
|
|
1186
|
+
/** Issued and awaiting player claim. */
|
|
1042
1187
|
COUPON_ISSUED = 2,
|
|
1043
|
-
/**
|
|
1188
|
+
/** Successfully redeemed. */
|
|
1044
1189
|
REDEEMED = 3,
|
|
1045
|
-
/**
|
|
1190
|
+
/** Previous redemption attempt failed; still valid and re-claimable. */
|
|
1046
1191
|
REDEEM_FAILED = 4,
|
|
1047
|
-
/**
|
|
1192
|
+
/** Coupon issuance failed (internal). */
|
|
1048
1193
|
COUPON_ISSUE_FAILED = 5,
|
|
1049
|
-
/**
|
|
1194
|
+
/** Issued but expired before redemption (internal). */
|
|
1050
1195
|
EXPIRED = 6
|
|
1051
1196
|
}
|
|
1197
|
+
/**
|
|
1198
|
+
* Template-level bonus display metadata (operator-configured at the
|
|
1199
|
+
* bonus template; identical for every bonus issued from the same template).
|
|
1200
|
+
*/
|
|
1052
1201
|
export interface BonusTemplateMetaMap {
|
|
1053
|
-
/**
|
|
1202
|
+
/** Operator-set description / display text. May include HTML. */
|
|
1054
1203
|
description: string;
|
|
1055
|
-
/**
|
|
1204
|
+
/** Operator-set additional message shown to the player at claim
|
|
1205
|
+
* time (e.g. wagering terms). May include deep-links. */
|
|
1056
1206
|
acknowledge: string;
|
|
1057
|
-
/**
|
|
1207
|
+
/** Bonus icon URL (1:1 aspect ratio recommended). */
|
|
1058
1208
|
image_url: string;
|
|
1059
|
-
/**
|
|
1209
|
+
/** Optional redirect — external HTTP URL (opens in new tab) or
|
|
1210
|
+
* internal deep-link (handled by the SDK's deep-link router). */
|
|
1060
1211
|
redirect_url?: string;
|
|
1061
1212
|
}
|
|
1213
|
+
/**
|
|
1214
|
+
* Instance-level bonus display metadata (set per-issuance, may carry
|
|
1215
|
+
* a dynamically-computed amount).
|
|
1216
|
+
*/
|
|
1062
1217
|
export interface BonusMetaMap {
|
|
1063
|
-
/**
|
|
1218
|
+
/** Display-ready amount string (e.g. "€50", "100 free spins"). */
|
|
1064
1219
|
uiAmount?: string;
|
|
1065
1220
|
}
|
|
1066
1221
|
/**
|
|
1067
|
-
* TClaimBonusResult describes the response of
|
|
1222
|
+
* TClaimBonusResult describes the response of `_smartico.api.claimBonus(bonus_id)`.
|
|
1223
|
+
*/
|
|
1224
|
+
/**
|
|
1225
|
+
* Result of `_smartico.api.claimBonus(bonus_id)`.
|
|
1068
1226
|
*/
|
|
1069
1227
|
export interface TClaimBonusResult {
|
|
1070
|
-
/** Error code
|
|
1071
|
-
err_code:
|
|
1072
|
-
/** Optional error message */
|
|
1228
|
+
/** Error code. `0` = success. See `claimBonus` TSDoc for the full table. */
|
|
1229
|
+
err_code: number;
|
|
1230
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
1073
1231
|
err_message: string;
|
|
1074
|
-
/**
|
|
1232
|
+
/** Unreliable on the wire — prefer `err_code === 0` as the success check. */
|
|
1075
1233
|
success?: boolean;
|
|
1076
1234
|
}
|
|
1077
1235
|
export interface TSawHistory {
|
|
@@ -1415,10 +1573,23 @@ export interface TRaffleDrawRun {
|
|
|
1415
1573
|
*/
|
|
1416
1574
|
has_unclaimed_prize: boolean;
|
|
1417
1575
|
}
|
|
1576
|
+
/**
|
|
1577
|
+
* TransformedRaffleClaimPrizeResponse describes the response of
|
|
1578
|
+
* `_smartico.api.claimRafflePrize({won_id})`.
|
|
1579
|
+
*
|
|
1580
|
+
* Note: this type uses `errorCode` / `errorMessage` (camelCase
|
|
1581
|
+
* full-word) — different from most other SDK wrapper-result types in
|
|
1582
|
+
* this library which use `err_code` / `err_message` (snake_case).
|
|
1583
|
+
*/
|
|
1584
|
+
/**
|
|
1585
|
+
* Result of `_smartico.api.claimRafflePrize({raffle_id, draw_id, raffle_run_id})`.
|
|
1586
|
+
* Uses camelCase `errorCode` / `errorMessage` — distinct from most other SDK
|
|
1587
|
+
* result wrappers which use snake_case `err_code` / `err_message`.
|
|
1588
|
+
*/
|
|
1418
1589
|
export interface TransformedRaffleClaimPrizeResponse {
|
|
1419
|
-
/** Error code
|
|
1590
|
+
/** Error code. `0` = success. See `claimRafflePrize` TSDoc for the full table. */
|
|
1420
1591
|
errorCode: number;
|
|
1421
|
-
/**
|
|
1592
|
+
/** Optional error message; populated on non-zero `errorCode`. */
|
|
1422
1593
|
errorMessage?: string;
|
|
1423
1594
|
}
|
|
1424
1595
|
/**
|
|
@@ -1443,10 +1614,13 @@ export interface TActivityLog {
|
|
|
1443
1614
|
/** Source type ID indicating what triggered this change */
|
|
1444
1615
|
source_type_id: PointChangeSourceType;
|
|
1445
1616
|
}
|
|
1617
|
+
/**
|
|
1618
|
+
* Result of `_smartico.api.requestRaffleOptin({raffle_id, draw_id, raffle_run_id})`.
|
|
1619
|
+
*/
|
|
1446
1620
|
export interface TRaffleOptinResponse {
|
|
1447
|
-
/** Error code
|
|
1621
|
+
/** Error code. `0` = success. See `requestRaffleOptin` TSDoc for the full table. */
|
|
1448
1622
|
err_code: number;
|
|
1449
|
-
/** Optional error message */
|
|
1623
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
1450
1624
|
err_message?: string;
|
|
1451
1625
|
}
|
|
1452
1626
|
/**
|
|
@@ -1908,72 +2082,69 @@ export interface GamePickRoundRequestParams extends GamePickRequestParams {
|
|
|
1908
2082
|
round_id: number;
|
|
1909
2083
|
}
|
|
1910
2084
|
/**
|
|
1911
|
-
*
|
|
2085
|
+
* One avatar in the user's catalog. Returned by `getAvatarsList()`.
|
|
1912
2086
|
* Fields from the raw `public_meta` object are flattened to the top level.
|
|
1913
2087
|
*/
|
|
1914
2088
|
export interface TAvatarDefinition {
|
|
1915
|
-
/**
|
|
2089
|
+
/** Stable numeric identifier of the avatar. Primary key passed to `setAvatar()`. */
|
|
1916
2090
|
avatar_real_id: number;
|
|
1917
|
-
/**
|
|
2091
|
+
/** True when this is the system default avatar for the label. */
|
|
1918
2092
|
is_default: boolean;
|
|
1919
|
-
/**
|
|
2093
|
+
/** When true and `is_given === false`, the avatar should be hidden from the user (surprise unlock). */
|
|
1920
2094
|
hide_until_achieved: boolean;
|
|
1921
|
-
/** Display
|
|
2095
|
+
/** Display position; lower = earlier in the grid. */
|
|
1922
2096
|
priority: number;
|
|
1923
|
-
/** Optional description
|
|
2097
|
+
/** Optional description shown alongside the avatar in detail views. */
|
|
1924
2098
|
description?: string;
|
|
1925
|
-
/** Raw image path
|
|
2099
|
+
/** Raw image path as returned by the server (relative or absolute). */
|
|
1926
2100
|
url: string;
|
|
1927
|
-
/**
|
|
2101
|
+
/** Absolute CDN URL of the avatar image; built from the configured avatar domain + `url`. */
|
|
1928
2102
|
avatar_url: string;
|
|
1929
|
-
/**
|
|
1930
|
-
* Source type of the avatar.
|
|
1931
|
-
* 0 = free (always available to all users), other values = earned/purchased
|
|
1932
|
-
*/
|
|
2103
|
+
/** Source type. `0` = free / always available; non-zero = earned or purchased. */
|
|
1933
2104
|
avatar_source_type_id: number;
|
|
1934
|
-
/** ISO date string from which the avatar becomes available */
|
|
2105
|
+
/** ISO date string from which the avatar becomes available; undefined when no start window. */
|
|
1935
2106
|
active_from_date?: string;
|
|
1936
|
-
/** ISO date string until which the avatar is available */
|
|
2107
|
+
/** ISO date string until which the avatar is available; undefined when no end window. */
|
|
1937
2108
|
active_till_date?: string;
|
|
1938
|
-
/**
|
|
2109
|
+
/** True when the user owns / has unlocked this avatar. */
|
|
1939
2110
|
is_given: boolean;
|
|
1940
|
-
/**
|
|
2111
|
+
/** True when this avatar is the user's currently active profile avatar. */
|
|
1941
2112
|
is_in_use?: boolean;
|
|
1942
2113
|
}
|
|
1943
2114
|
/**
|
|
1944
|
-
*
|
|
2115
|
+
* One AI-generated variant of a base avatar. Returned by `getAvatarsCustomized()`.
|
|
1945
2116
|
*/
|
|
1946
2117
|
export interface TAvatarCustomized {
|
|
1947
|
-
/**
|
|
2118
|
+
/** `avatar_real_id` of the base avatar this variant was generated from. */
|
|
1948
2119
|
avatar_real_id: number;
|
|
1949
|
-
/**
|
|
2120
|
+
/** Absolute CDN URL of the AI-generated image. Can be passed as `avatar_url` to `setAvatar()`. */
|
|
1950
2121
|
url: string;
|
|
1951
|
-
/** ISO date string when the
|
|
2122
|
+
/** ISO date string of when the variant was generated. */
|
|
1952
2123
|
dt_created: string;
|
|
1953
2124
|
}
|
|
1954
2125
|
/**
|
|
1955
|
-
*
|
|
2126
|
+
* One AI style prompt for avatar customization. Returned by `getAvatarPrompts()`.
|
|
1956
2127
|
* Fields from the raw `public_meta` object are flattened to the top level.
|
|
1957
2128
|
*/
|
|
1958
2129
|
export interface TAvatarPrompt {
|
|
1959
|
-
/**
|
|
2130
|
+
/** Stable numeric identifier of the prompt. */
|
|
1960
2131
|
prompt_id: number;
|
|
1961
|
-
/** Display name of the
|
|
2132
|
+
/** Display name of the style, e.g. "Cartoon", "Watercolor". */
|
|
1962
2133
|
name: string;
|
|
1963
|
-
/**
|
|
2134
|
+
/** Absolute CDN URL of the prompt's preview icon. */
|
|
1964
2135
|
icon_url: string;
|
|
1965
|
-
/** Currency
|
|
2136
|
+
/** Currency used to pay for the customization. `0` = points, `1` = gems, `2` = diamonds. */
|
|
1966
2137
|
cost_currency_type_id: number;
|
|
1967
|
-
/** Cost amount in the
|
|
2138
|
+
/** Cost amount in the currency named by `cost_currency_type_id`. */
|
|
1968
2139
|
cost_value: number;
|
|
1969
2140
|
}
|
|
1970
2141
|
/**
|
|
1971
|
-
*
|
|
2142
|
+
* Result of `_smartico.api.setAvatar()`.
|
|
1972
2143
|
*/
|
|
1973
2144
|
export interface TSetAvatarResult {
|
|
1974
|
-
/** Error code
|
|
2145
|
+
/** Error code. `0` = success. See `setAvatar` TSDoc for the full table. */
|
|
1975
2146
|
err_code: number;
|
|
1976
|
-
/** Optional error message */
|
|
2147
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
1977
2148
|
err_message?: string;
|
|
1978
2149
|
}
|
|
1979
2150
|
export { SAWAcknowledgeTypeName, PrizeModifiers, SAWTemplateUI, InboxCategories, AchCustomSectionType, SAWAskForUsername, SAWGameLayout, PointChangeSourceType, UserBalanceType, SAWGPMarketType, QuizAnswersValueType };
|