@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
package/src/WSAPI/WSAPITypes.ts
CHANGED
|
@@ -88,30 +88,43 @@ export interface TMiniGamePrize {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
|
-
* TMiniGamePlayResult describes the response of
|
|
91
|
+
* TMiniGamePlayResult describes the response of
|
|
92
|
+
* `_smartico.api.playMiniGame(template_id)`.
|
|
92
93
|
*/
|
|
93
94
|
export interface TMiniGamePlayResult {
|
|
94
|
-
/** Error code
|
|
95
|
+
/** Error code. `0` = success ({@link SAWSpinErrorCode.SAW_OK}).
|
|
96
|
+
* See `playMiniGame` TSDoc for the full table. */
|
|
95
97
|
err_code: SAWSpinErrorCode;
|
|
96
|
-
/** Optional error message
|
|
98
|
+
/** Optional server-side error message. Present only on non-zero
|
|
99
|
+
* `err_code`; may be empty even then. */
|
|
97
100
|
err_message: string;
|
|
98
|
-
/**
|
|
101
|
+
/** ID of the won prize. Look up in `template.prizes` to interpret
|
|
102
|
+
* (including `prize_type === 'no-prize'` for a configured loss
|
|
103
|
+
* slot). Always populated, even when `err_code !== 0`. */
|
|
99
104
|
prize_id: number;
|
|
100
105
|
}
|
|
101
106
|
|
|
102
107
|
/**
|
|
103
|
-
* TMiniGamePlayBatchResult describes
|
|
108
|
+
* TMiniGamePlayBatchResult describes one entry in the array returned
|
|
109
|
+
* by `_smartico.api.playMiniGameBatch(template_id, spin_count)`.
|
|
110
|
+
*
|
|
111
|
+
* Note: this type uses `errCode` / `errMessage` (camelCase) —
|
|
112
|
+
* different from `TMiniGamePlayResult` which uses `err_code` /
|
|
113
|
+
* `err_message` (snake_case).
|
|
104
114
|
*/
|
|
105
115
|
export interface TMiniGamePlayBatchResult {
|
|
106
|
-
/**
|
|
116
|
+
/** ID of the won prize for this spin. Look up in `template.prizes`. */
|
|
107
117
|
saw_prize_id: number;
|
|
108
|
-
/** Error code
|
|
118
|
+
/** Error code. `0` = success. See `playMiniGameBatch` TSDoc for the
|
|
119
|
+
* full table. */
|
|
109
120
|
errCode: SAWSpinErrorCode;
|
|
110
|
-
/** Optional error message */
|
|
121
|
+
/** Optional server-side error message. */
|
|
111
122
|
errMessage?: string;
|
|
112
|
-
/** Jackpot amount
|
|
123
|
+
/** Jackpot amount the user won, populated when the prize type is
|
|
124
|
+
* `'jackpot'`. */
|
|
113
125
|
jackpot_amount?: number;
|
|
114
|
-
/**
|
|
126
|
+
/** Epoch ms of the user's first spin in the current cooldown
|
|
127
|
+
* period; populated when `errCode === SAWSpinErrorCode.SAW_FAILED_MAX_SPINS_REACHED`. */
|
|
115
128
|
first_spin_in_period?: number,
|
|
116
129
|
}
|
|
117
130
|
|
|
@@ -212,89 +225,78 @@ export interface TMiniGameTemplate {
|
|
|
212
225
|
*/
|
|
213
226
|
|
|
214
227
|
export interface TUserProfile {
|
|
215
|
-
/**
|
|
228
|
+
/** Language code stored server-side for the user (e.g. `"en"`, `"de"`). */
|
|
216
229
|
core_user_language: string;
|
|
217
|
-
/**
|
|
230
|
+
/** Current spendable points balance — decremented by store purchases,
|
|
231
|
+
* tournament buy-ins, and clan entry fees. */
|
|
218
232
|
ach_points_balance: number;
|
|
219
|
-
/**
|
|
233
|
+
/** All-time cumulative points earned. Monotonic — NOT decremented by
|
|
234
|
+
* store purchases or clan/tournament fees. */
|
|
220
235
|
ach_points_ever: number;
|
|
221
|
-
/**
|
|
236
|
+
/** Current gems balance (secondary currency). */
|
|
222
237
|
ach_gems_balance: number;
|
|
223
|
-
/**
|
|
238
|
+
/** Current diamonds balance (tertiary currency). */
|
|
224
239
|
ach_diamonds_balance: number;
|
|
225
|
-
/**
|
|
226
|
-
*
|
|
227
|
-
* They can be treated as server-based cookies.
|
|
228
|
-
* You can set tags using following method _smartico.event('core_public_tags_update', { core_public_tags: ['A', 'B'] } );
|
|
229
|
-
* And then you can check for the tags
|
|
230
|
-
*/
|
|
240
|
+
/** Server-stored public tags on the user (uppercase strings).
|
|
241
|
+
* Modify via `_smartico.updatePublicTags(operation, tags)`. */
|
|
231
242
|
core_public_tags: string[];
|
|
232
|
-
/**
|
|
243
|
+
/** FK into the level ladder; resolve via `getCurrentLevel()` or `getLevels()`. */
|
|
233
244
|
ach_level_current_id?: number;
|
|
234
|
-
/**
|
|
245
|
+
/** `true` when the user is flagged as a test account. */
|
|
235
246
|
core_is_test_account?: boolean;
|
|
236
|
-
/**
|
|
247
|
+
/** Resolved CDN URL for the user's avatar. */
|
|
237
248
|
avatar_url?: string;
|
|
238
|
-
/**
|
|
249
|
+
/** Display username (operator-defined alias). */
|
|
239
250
|
public_username?: string;
|
|
240
|
-
/**
|
|
251
|
+
/** Unread inbox messages count. Push-updated in real time. */
|
|
241
252
|
core_inbox_unread_count?: number;
|
|
242
|
-
/**
|
|
253
|
+
/** AI-recommended deposit amount for this user. Undefined when no
|
|
254
|
+
* recommendation is currently available. */
|
|
243
255
|
core_recommended_deposit_amount?: number;
|
|
244
|
-
/**
|
|
256
|
+
/** AI-recommended casino bet amount for this user. Undefined when no
|
|
257
|
+
* recommendation is currently available. */
|
|
245
258
|
core_recommended_casino_bet_amount?: number;
|
|
246
259
|
}
|
|
247
260
|
|
|
248
261
|
/**
|
|
249
|
-
* TLevel describes
|
|
250
|
-
*
|
|
251
|
-
* The current level of user can be taken from the user object using ach_level_current_id property
|
|
252
|
-
* The progress to the next level can be calculated using ach_points_ever and required_points properties of next level
|
|
262
|
+
* TLevel describes one level in the label's level ladder.
|
|
263
|
+
* Returned by `_smartico.api.getLevels()` (already sorted by `required_points` ASC).
|
|
253
264
|
*/
|
|
254
265
|
export interface TLevel {
|
|
255
|
-
/**
|
|
266
|
+
/** Stable ID of the level. */
|
|
256
267
|
id: number;
|
|
257
|
-
/**
|
|
268
|
+
/** Display name of the level, pre-translated to the user's language. */
|
|
258
269
|
name: string;
|
|
259
|
-
/**
|
|
270
|
+
/** Display description of the level, pre-translated to the user's language. */
|
|
260
271
|
description: string;
|
|
261
|
-
/**
|
|
272
|
+
/** URL of the level image (256x256 px source). */
|
|
262
273
|
image: string;
|
|
263
|
-
/**
|
|
274
|
+
/** Total `ach_points_ever` required to reach this level. */
|
|
264
275
|
required_points: number;
|
|
265
|
-
/**
|
|
276
|
+
/** Visibility threshold — clients hide the level from the user until
|
|
277
|
+
* `ach_points_ever >= visibility_points`. `null` means always visible. */
|
|
266
278
|
visibility_points: number;
|
|
267
|
-
/**
|
|
268
|
-
*
|
|
269
|
-
* Relevant in case of using advanced leveling logic
|
|
270
|
-
* https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
|
|
271
|
-
*
|
|
272
|
-
*/
|
|
279
|
+
/** Required value of the first level counter for sliding-window leveling.
|
|
280
|
+
* `null` on points-only labels. See `UserLevelExtraCountersT`. */
|
|
273
281
|
required_level_counter_1: number;
|
|
274
|
-
/**
|
|
275
|
-
*
|
|
276
|
-
* Relevant in case of using advanced leveling logic
|
|
277
|
-
* https://help.smartico.ai/welcome/more/release-notes/september-2022#new-logic-for-leveling-users
|
|
278
|
-
*
|
|
279
|
-
*/
|
|
282
|
+
/** Required value of the second level counter for sliding-window leveling.
|
|
283
|
+
* `null` on points-only labels. */
|
|
280
284
|
required_level_counter_2: number;
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
* Custom data as string or JSON string that can be used in API to build custom UI
|
|
284
|
-
* You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
|
|
285
|
-
* Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
|
|
286
|
-
*/
|
|
285
|
+
/** Operator-defined custom data. The SDK auto-parses JSON-looking
|
|
286
|
+
* strings, so at runtime this is `any` despite the `string` type. */
|
|
287
287
|
custom_data: string;
|
|
288
|
-
/**
|
|
288
|
+
/** 1-based position in the ladder (matches the order of the returned
|
|
289
|
+
* array, which is sorted by `required_points` ASC). */
|
|
289
290
|
ordinal_position: number;
|
|
290
291
|
}
|
|
291
292
|
|
|
292
293
|
/**
|
|
293
|
-
* TLevelCurrent
|
|
294
|
+
* TLevelCurrent extends `TLevel` with the user's progress toward the next level.
|
|
295
|
+
* Returned by `_smartico.api.getCurrentLevel()`.
|
|
294
296
|
*/
|
|
295
|
-
|
|
296
297
|
export interface TLevelCurrent extends TLevel {
|
|
297
|
-
/**
|
|
298
|
+
/** Progress to the next level as a 0–100 integer percentage. `100`
|
|
299
|
+
* at the highest level. */
|
|
298
300
|
progress: number;
|
|
299
301
|
}
|
|
300
302
|
|
|
@@ -326,7 +328,7 @@ export interface TTournament {
|
|
|
326
328
|
segment_dont_match_message: string;
|
|
327
329
|
/**
|
|
328
330
|
* The ID of the custom section where the tournament is assigned
|
|
329
|
-
* The list of custom sections can be retrieved using _smartico.api.getCustomSections() method
|
|
331
|
+
* The list of custom sections can be retrieved using _smartico.api.getCustomSections() method
|
|
330
332
|
*/
|
|
331
333
|
custom_section_id: number;
|
|
332
334
|
/** The custom data of the tournament defined by operator. Can be a JSON object, string or number */
|
|
@@ -557,13 +559,17 @@ export interface TClan {
|
|
|
557
559
|
member_count: number;
|
|
558
560
|
/** Max number of members allowed in clan */
|
|
559
561
|
capacity_limit: number;
|
|
560
|
-
/**
|
|
562
|
+
/** Currency type for `entry_fee_amount`. `0` = points, `1` = gems,
|
|
563
|
+
* `2` = diamonds, `3` = free (no fee). */
|
|
561
564
|
entry_fee_currency_type_id: number;
|
|
562
|
-
/**
|
|
565
|
+
/** Entry fee amount in the currency indicated by `entry_fee_currency_type_id`.
|
|
566
|
+
* `0` (or `entry_fee_currency_type_id === 3`) means the clan is free to join. */
|
|
563
567
|
entry_fee_amount: number;
|
|
564
|
-
/**
|
|
568
|
+
/** Global rank among all active clans in the label, by `rating_score` DESC.
|
|
569
|
+
* `1` = highest-rated. May skip positions when some clans are hidden by
|
|
570
|
+
* per-user visibility (e.g. user sees positions 1, 3, 7). */
|
|
565
571
|
rating_position: number;
|
|
566
|
-
/** Clan rating score */
|
|
572
|
+
/** Clan rating score (higher is better). */
|
|
567
573
|
rating_score: number;
|
|
568
574
|
}
|
|
569
575
|
|
|
@@ -575,7 +581,9 @@ export interface TClans {
|
|
|
575
581
|
clans: TClan[];
|
|
576
582
|
/** The clan ID the current user belongs to; null if clanless */
|
|
577
583
|
user_clan_id: number | null;
|
|
578
|
-
/**
|
|
584
|
+
/** Switch-cooldown expiry as ISO 8601 UTC string ("YYYY-MM-DDTHH:MM:SS"
|
|
585
|
+
* with no timezone suffix; interpret as UTC). `null` when no cooldown.
|
|
586
|
+
* User-level: while set, the user cannot join any clan. */
|
|
579
587
|
cooldown_until: string | null;
|
|
580
588
|
/** Epoch ms when the current user joined their clan; null if clanless */
|
|
581
589
|
join_date: number | null;
|
|
@@ -583,35 +591,71 @@ export interface TClans {
|
|
|
583
591
|
|
|
584
592
|
/**
|
|
585
593
|
* TClanInfo describes the detailed info of a single clan including its members.
|
|
594
|
+
* Returned by `_smartico.api.getClanInfo(clanId)`.
|
|
586
595
|
*/
|
|
587
596
|
export interface TClanInfo {
|
|
597
|
+
/** Clan ID. */
|
|
588
598
|
clan_id: number;
|
|
599
|
+
/** Translated clan metadata (name, description, image URL). */
|
|
589
600
|
public_meta: { name: string; description: string; image_url: string };
|
|
601
|
+
/** Current number of members in clan. */
|
|
590
602
|
member_count: number;
|
|
603
|
+
/** Max number of members allowed in clan. */
|
|
591
604
|
capacity_limit: number;
|
|
605
|
+
/** Currency type for `entry_fee_amount`. `0` = points, `1` = gems,
|
|
606
|
+
* `2` = diamonds, `3` = free. */
|
|
592
607
|
entry_fee_currency_type_id: number;
|
|
608
|
+
/** Entry fee amount in the currency indicated by `entry_fee_currency_type_id`. */
|
|
593
609
|
entry_fee_amount: number;
|
|
610
|
+
/** Global rank among all active clans in the label, by `rating_score` DESC.
|
|
611
|
+
* `1` = highest-rated. */
|
|
594
612
|
rating_position: number;
|
|
613
|
+
/** Clan rating score (higher is better). */
|
|
595
614
|
rating_score: number;
|
|
615
|
+
/** User-level switch-cooldown expiry as ISO 8601 UTC string
|
|
616
|
+
* ("YYYY-MM-DDTHH:MM:SS" with no timezone suffix). `null` when no
|
|
617
|
+
* cooldown. Same semantic as `TClans.cooldown_until` but always fresh
|
|
618
|
+
* (the list version may be up to 30 s stale). */
|
|
596
619
|
cooldown_until: string | null;
|
|
620
|
+
/** Members of this clan, server-ordered by `contribution_score` DESC
|
|
621
|
+
* (i.e. `position` ASC). */
|
|
597
622
|
members: {
|
|
623
|
+
/** Member's internal user ID. */
|
|
598
624
|
user_id: number;
|
|
625
|
+
/** Member's display username. */
|
|
599
626
|
public_username: string;
|
|
627
|
+
/** Avatar identifier; resolve via `avatar_url` below or rebuild
|
|
628
|
+
* from `avatar_id` + brand avatar domain. */
|
|
600
629
|
avatar_id: string;
|
|
630
|
+
/** Numeric avatar ID (alternative identifier). */
|
|
601
631
|
avatar_real_id: number;
|
|
632
|
+
/** Pre-resolved CDN URL for the avatar. */
|
|
602
633
|
avatar_url?: string;
|
|
634
|
+
/** Member's rank within this clan; `1` = top contributor. */
|
|
603
635
|
position: number;
|
|
636
|
+
/** Member's contribution to the clan rating score. */
|
|
604
637
|
contribution_score: number;
|
|
638
|
+
/** `true` when this row is the current authenticated user. */
|
|
605
639
|
is_me?: boolean;
|
|
640
|
+
/** External user identifier (operator-provided alias);
|
|
641
|
+
* preferred over `public_username` on some surfaces. */
|
|
606
642
|
clean_ext_user_id?: string;
|
|
607
643
|
}[];
|
|
608
644
|
}
|
|
609
645
|
|
|
610
646
|
/**
|
|
611
|
-
* TClanJoinResult describes the result of a join
|
|
647
|
+
* TClanJoinResult describes the result of a join-clan request.
|
|
648
|
+
* Note: this type uses `errCode` / `errMsg` (camelCase) — different
|
|
649
|
+
* from most other SDK result types in this library which use
|
|
650
|
+
* `err_code` / `err_message` (snake_case).
|
|
612
651
|
*/
|
|
613
652
|
export interface TClanJoinResult {
|
|
653
|
+
/** Error code. `0` = success. Typed values are members of
|
|
654
|
+
* {@link JoinClanErrorCode}. See `joinClan` TSDoc for the full
|
|
655
|
+
* table and per-code UI guidance. */
|
|
614
656
|
errCode: number;
|
|
657
|
+
/** Optional server-side error message. Present only on non-zero
|
|
658
|
+
* `errCode`; may be empty even then. */
|
|
615
659
|
errMsg: string;
|
|
616
660
|
}
|
|
617
661
|
|
|
@@ -668,7 +712,9 @@ export interface TStoreItem {
|
|
|
668
712
|
can_buy: boolean;
|
|
669
713
|
/** The list of IDs of the categories where the store item is assigned, information about categories can be retrieved with getStoreCategories method */
|
|
670
714
|
category_ids: number[];
|
|
671
|
-
/**
|
|
715
|
+
/** Items remaining in the pool available for purchase. `null` = unlimited
|
|
716
|
+
* supply. Positive integer = remaining stock. `0` = sold out but still
|
|
717
|
+
* returned (operator may instead hide pool-empty items entirely). */
|
|
672
718
|
pool?: number;
|
|
673
719
|
/** The custom data of the store item defined by operator. Can be a JSON object, string or number */
|
|
674
720
|
custom_data: any;
|
|
@@ -688,6 +734,8 @@ export interface TStoreItem {
|
|
|
688
734
|
purchase_type: 'points' | 'gems' | 'diamonds';
|
|
689
735
|
/** The date when the store item will be available till */
|
|
690
736
|
active_till_date?: number;
|
|
737
|
+
/** Should countdown timer be shown when `active_till_date` is present */
|
|
738
|
+
show_timer?: boolean;
|
|
691
739
|
/** The discounted price of the store item */
|
|
692
740
|
discounted_price?: number;
|
|
693
741
|
/** The ribbon of the discounted price. */
|
|
@@ -705,14 +753,24 @@ export interface TStoreItem {
|
|
|
705
753
|
}
|
|
706
754
|
|
|
707
755
|
/**
|
|
708
|
-
* TAchCategory describes
|
|
756
|
+
* TAchCategory describes a mission/badge category. Categories are
|
|
757
|
+
* operator-defined groupings, configured per-label by the brand operator,
|
|
758
|
+
* shared across BOTH missions and badges — the same list is returned for
|
|
759
|
+
* both entity types. A mission or badge can belong to **zero or more**
|
|
760
|
+
* categories (many-to-many) via its `category_ids: number[]` field on
|
|
761
|
+
* `TMissionOrBadge`.
|
|
762
|
+
*
|
|
763
|
+
* Returned by `_smartico.api.getAchCategories()`. See that method's TSDoc
|
|
764
|
+
* for translation, refresh, and rendering details.
|
|
709
765
|
*/
|
|
710
766
|
export interface TAchCategory {
|
|
711
|
-
/**ID of the
|
|
767
|
+
/** Stable numeric ID of the category. Used as the key when joining to
|
|
768
|
+
* `TMissionOrBadge.category_ids: number[]`. */
|
|
712
769
|
id: number;
|
|
713
|
-
/**
|
|
770
|
+
/** Display name of the category, pre-translated server-side. Never null. */
|
|
714
771
|
name: string;
|
|
715
|
-
/**
|
|
772
|
+
/** Relative display position (lower = appears first). Default 1 when the
|
|
773
|
+
* operator did not configure an explicit order. */
|
|
716
774
|
order: number;
|
|
717
775
|
}
|
|
718
776
|
|
|
@@ -768,8 +826,8 @@ export interface TMissionOrBadge {
|
|
|
768
826
|
/** The text of the CTA button, e.g. 'Make a deposit' */
|
|
769
827
|
cta_text: string;
|
|
770
828
|
/**
|
|
771
|
-
* The ID of the custom section where the mission or badge is assigned
|
|
772
|
-
*
|
|
829
|
+
* The ID of the custom section where the mission or badge is assigned.
|
|
830
|
+
* Resolve to section metadata via `_smartico.api.getCustomSections()`.
|
|
773
831
|
*/
|
|
774
832
|
custom_section_id: number;
|
|
775
833
|
/** 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 */
|
|
@@ -796,7 +854,8 @@ export interface TMissionOrBadge {
|
|
|
796
854
|
/** The ribbon of the mission/badge item. Can be 'sale', 'hot', 'new', 'vip' or URL to the image in case of custom ribbon, 250x300px */
|
|
797
855
|
ribbon?: TRibbon;
|
|
798
856
|
|
|
799
|
-
/**
|
|
857
|
+
/** Stable identifier of this specific mission completion. Undefined for
|
|
858
|
+
* badges and for missions that have not yet completed. */
|
|
800
859
|
ach_completed_id?: number;
|
|
801
860
|
|
|
802
861
|
/** Flag from achievement if the mission prize will be given only after user claims it */
|
|
@@ -901,248 +960,345 @@ export interface TMissionOrBadgeTask {
|
|
|
901
960
|
}
|
|
902
961
|
|
|
903
962
|
/**
|
|
904
|
-
*
|
|
963
|
+
* Response of `_smartico.api.requestMissionOptIn(mission_id)`.
|
|
964
|
+
*
|
|
965
|
+
* See `requestMissionOptIn` TSDoc for the full table of `err_code` values
|
|
966
|
+
* and recommended UI handling.
|
|
905
967
|
*/
|
|
906
968
|
export interface TMissionOptInResult {
|
|
907
|
-
/** Error code
|
|
969
|
+
/** Error code. `0` = success. See `requestMissionOptIn` TSDoc for the full table. */
|
|
908
970
|
err_code: number;
|
|
909
|
-
/** Optional error message */
|
|
971
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
910
972
|
err_message: string;
|
|
911
973
|
}
|
|
912
974
|
|
|
913
975
|
/**
|
|
914
|
-
*
|
|
976
|
+
* Response of `_smartico.api.requestMissionClaimReward(mission_id, ach_completed_id)`.
|
|
977
|
+
*
|
|
978
|
+
* See `requestMissionClaimReward` TSDoc for the full table of `err_code`
|
|
979
|
+
* values, preconditions, side effects, and recommended UI handling.
|
|
915
980
|
*/
|
|
916
981
|
export interface TMissionClaimRewardResult {
|
|
917
|
-
/** Error code
|
|
982
|
+
/** Error code. `0` = success (rewards credited). See `requestMissionClaimReward` TSDoc for the full table. */
|
|
918
983
|
err_code: number;
|
|
919
|
-
/** Optional error message */
|
|
984
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
920
985
|
err_message: string;
|
|
921
986
|
}
|
|
922
987
|
|
|
988
|
+
/**
|
|
989
|
+
* Result of `_smartico.api.registerInTournament(tournament_id)`.
|
|
990
|
+
*/
|
|
923
991
|
export interface TTournamentRegistrationResult {
|
|
924
|
-
/** Error code
|
|
992
|
+
/** Error code. `0` = success. See `registerInTournament` TSDoc for the full table. */
|
|
925
993
|
err_code: TournamentRegistrationError;
|
|
926
|
-
/** Optional error message */
|
|
994
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
927
995
|
err_message: string;
|
|
928
996
|
}
|
|
929
997
|
|
|
998
|
+
/**
|
|
999
|
+
* Result of `_smartico.api.buyStoreItem(store_item_id)`.
|
|
1000
|
+
*/
|
|
930
1001
|
export interface TBuyStoreItemResult {
|
|
931
|
-
/** Error code
|
|
932
|
-
*
|
|
933
|
-
* Example for error handling:
|
|
934
|
-
* ```javascript
|
|
935
|
-
* SmarticoAPI.buyStoreItem(item_id).then(res => {
|
|
936
|
-
* if (res.err_code !== 0) {
|
|
937
|
-
* // YOUR LOGIC HERE, you can use res.err_message, but it's optional and not always present
|
|
938
|
-
* }
|
|
939
|
-
* });
|
|
940
|
-
* ```
|
|
941
|
-
*/
|
|
1002
|
+
/** Error code. `0` = success. See `buyStoreItem` TSDoc for the full table. */
|
|
942
1003
|
err_code: BuyStoreItemErrorCode;
|
|
943
|
-
/** Optional error message */
|
|
1004
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
944
1005
|
err_message: string;
|
|
945
1006
|
}
|
|
946
1007
|
|
|
1008
|
+
/**
|
|
1009
|
+
* Result of `getTranslations(lang_code)`.
|
|
1010
|
+
*/
|
|
947
1011
|
export interface TGetTranslations {
|
|
1012
|
+
/** Flat dictionary of operator-defined translation key → translated string. */
|
|
948
1013
|
translations: { [key: string]: string };
|
|
949
1014
|
}
|
|
950
1015
|
|
|
1016
|
+
/**
|
|
1017
|
+
* TInboxMessage is the lightweight envelope returned by
|
|
1018
|
+
* `_smartico.api.getInboxMessages()`. Fetch the rich body (title,
|
|
1019
|
+
* preview, icon, html_body, buttons) separately via
|
|
1020
|
+
* `_smartico.api.getInboxMessageBody(message_guid)`.
|
|
1021
|
+
*/
|
|
951
1022
|
export interface TInboxMessage {
|
|
952
|
-
/**
|
|
1023
|
+
/** Unique identifier of the message. Pass to `getInboxMessageBody`
|
|
1024
|
+
* and the mark / favorite / delete mutations. */
|
|
953
1025
|
message_guid: string;
|
|
954
|
-
/** Date when the message was sent */
|
|
1026
|
+
/** Date when the message was sent (server timestamp). */
|
|
955
1027
|
sent_date: string;
|
|
956
|
-
/**
|
|
1028
|
+
/** `true` when the message has been marked read. */
|
|
957
1029
|
read: boolean;
|
|
958
|
-
/**
|
|
1030
|
+
/** `true` when the message has been starred (favorited). */
|
|
959
1031
|
favorite: boolean;
|
|
960
|
-
/**
|
|
1032
|
+
/** Operator-assigned category ({@link InboxCategories}). */
|
|
961
1033
|
category_id?: InboxCategories;
|
|
962
|
-
/**
|
|
1034
|
+
/** Expiry timestamp as Unix-ms epoch. Server filters out expired
|
|
1035
|
+
* messages from list responses — consumers rarely see this set
|
|
1036
|
+
* unless the expiry is upcoming. */
|
|
963
1037
|
expire_on_dt?: number;
|
|
964
1038
|
}
|
|
965
1039
|
|
|
1040
|
+
/**
|
|
1041
|
+
* TInboxMessageBody is the rich body of one inbox message.
|
|
1042
|
+
* Returned by `_smartico.api.getInboxMessageBody(message_guid)`.
|
|
1043
|
+
* Fetched from a CDN (not over WebSocket).
|
|
1044
|
+
*/
|
|
966
1045
|
export interface TInboxMessageBody {
|
|
967
|
-
/**
|
|
1046
|
+
/** Display title. */
|
|
968
1047
|
title: string;
|
|
969
|
-
/** Short preview
|
|
1048
|
+
/** Short preview text (typically rendered alongside the title in list items). */
|
|
970
1049
|
preview_body: string;
|
|
971
|
-
/** Message icon
|
|
1050
|
+
/** Message icon URL (128×128 px recommended). */
|
|
972
1051
|
icon: string;
|
|
973
|
-
/**
|
|
974
|
-
*
|
|
975
|
-
*
|
|
976
|
-
*
|
|
977
|
-
*/
|
|
1052
|
+
/** Click-action — either a deep-link (e.g. `'dp:deposit'`) or a
|
|
1053
|
+
* plain URL. The literal `'dp:inbox'` indicates the message has a
|
|
1054
|
+
* rich `html_body`; for any other value `html_body` and `buttons`
|
|
1055
|
+
* are absent. Pass to `_smartico.dp(action)` for safe execution. */
|
|
978
1056
|
action: string;
|
|
979
|
-
/** Rich HTML body
|
|
1057
|
+
/** Rich HTML body. Populated only when `action === 'dp:inbox'`. */
|
|
980
1058
|
html_body?: string;
|
|
981
|
-
/**
|
|
1059
|
+
/** Up to 2 additional action buttons. Populated only when
|
|
1060
|
+
* `action === 'dp:inbox'`. */
|
|
982
1061
|
buttons?: {
|
|
983
|
-
/**
|
|
1062
|
+
/** Button click-action (deep-link or URL). */
|
|
984
1063
|
action: string;
|
|
985
|
-
/** Button
|
|
1064
|
+
/** Button label. */
|
|
986
1065
|
text: string;
|
|
987
1066
|
}[];
|
|
988
|
-
/**
|
|
1067
|
+
/** Operator-defined custom data. The SDK auto-parses JSON-looking
|
|
1068
|
+
* strings, so at runtime this is `any` despite the `string` type. */
|
|
989
1069
|
custom_data?: string;
|
|
990
1070
|
}
|
|
991
1071
|
|
|
1072
|
+
/**
|
|
1073
|
+
* InboxMarkMessageAction is the response of the five inbox mutation
|
|
1074
|
+
* methods (`markInboxMessageAsRead`, `markAllInboxMessagesAsRead`,
|
|
1075
|
+
* `markUnmarkInboxMessageAsFavorite`, `deleteInboxMessage`,
|
|
1076
|
+
* `deleteAllInboxMessages`).
|
|
1077
|
+
*/
|
|
992
1078
|
export interface InboxMarkMessageAction {
|
|
993
|
-
/**
|
|
1079
|
+
/** Error code. `0` = success. See the calling method's TSDoc for
|
|
1080
|
+
* the full error semantics (server returns generic codes; the
|
|
1081
|
+
* five inbox mutations share the same shape). */
|
|
994
1082
|
err_code: number;
|
|
995
|
-
/** Optional error message
|
|
1083
|
+
/** Optional server-side error message. Present only on non-zero
|
|
1084
|
+
* `err_code`; may be empty even then. */
|
|
996
1085
|
err_message: string;
|
|
997
1086
|
}
|
|
998
1087
|
|
|
1088
|
+
/**
|
|
1089
|
+
* LeaderBoardDetailsT describes one period's leaderboard.
|
|
1090
|
+
* Returned by `_smartico.api.getLeaderBoard(periodType, getPreviousPeriod?)`.
|
|
1091
|
+
* May be `undefined` at runtime when no board is configured for the requested period.
|
|
1092
|
+
*/
|
|
999
1093
|
export interface LeaderBoardDetailsT {
|
|
1000
|
-
/** ID of the leaderboard */
|
|
1094
|
+
/** Stable ID of the leaderboard. */
|
|
1001
1095
|
board_id: number;
|
|
1002
|
-
/**
|
|
1096
|
+
/** Operator-defined display name. */
|
|
1003
1097
|
name: string;
|
|
1004
|
-
/**
|
|
1098
|
+
/** Operator-defined description (HTML allowed). */
|
|
1005
1099
|
description: string;
|
|
1006
|
-
/**
|
|
1100
|
+
/** Operator-defined rules / terms (HTML allowed). */
|
|
1007
1101
|
rules: string;
|
|
1008
|
-
/**
|
|
1102
|
+
/** Period type this board is bound to ({@link LeaderBoardPeriodType}). */
|
|
1009
1103
|
period_type_id: LeaderBoardPeriodType;
|
|
1010
|
-
/**
|
|
1104
|
+
/** Per-place prize table; the array length is the number of paid places. */
|
|
1011
1105
|
rewards: LeaderBoardsRewardsT[];
|
|
1012
|
-
/**
|
|
1106
|
+
/** Top-20 ranked entries (server-capped), sorted by `position` ASC. */
|
|
1013
1107
|
users: LeaderBoardUserT[];
|
|
1014
|
-
/**
|
|
1108
|
+
/** Current user's own entry. `undefined` for visitor sessions.
|
|
1109
|
+
* For authenticated users, `position === -1` means the user is
|
|
1110
|
+
* unranked / outside the ranked window. */
|
|
1015
1111
|
me?: LeaderBoardUserT;
|
|
1016
1112
|
}
|
|
1017
1113
|
|
|
1114
|
+
/**
|
|
1115
|
+
* LeaderBoardsRewardsT describes one place's prize on a leaderboard.
|
|
1116
|
+
* Leaderboard prizes are always gamification points (never gems / diamonds / items).
|
|
1117
|
+
*/
|
|
1018
1118
|
export interface LeaderBoardsRewardsT {
|
|
1119
|
+
/** Place number (1-based). */
|
|
1019
1120
|
place: number;
|
|
1121
|
+
/** Gamification points awarded to the user occupying this place at period finalization. */
|
|
1020
1122
|
points: number;
|
|
1021
1123
|
}
|
|
1022
1124
|
|
|
1125
|
+
/**
|
|
1126
|
+
* LeaderBoardUserT describes one participant row on a leaderboard.
|
|
1127
|
+
*/
|
|
1023
1128
|
export interface LeaderBoardUserT {
|
|
1024
|
-
/**
|
|
1129
|
+
/** Display username (operator-defined alias). */
|
|
1025
1130
|
public_username: string;
|
|
1026
|
-
/**
|
|
1131
|
+
/** Resolved CDN URL for the participant's avatar. */
|
|
1027
1132
|
avatar_url: string;
|
|
1028
|
-
/**
|
|
1133
|
+
/** Rank in the leaderboard (DENSE_RANK over all participants).
|
|
1134
|
+
* `-1` on the `me` entry signals "unranked / outside the window". */
|
|
1029
1135
|
position: number;
|
|
1030
|
-
/**
|
|
1136
|
+
/** Participant's points for this period. */
|
|
1031
1137
|
points: number;
|
|
1032
|
-
/**
|
|
1138
|
+
/** `true` when this row is the current authenticated user. */
|
|
1033
1139
|
is_me: boolean;
|
|
1034
1140
|
}
|
|
1035
1141
|
|
|
1142
|
+
/**
|
|
1143
|
+
* UserLevelExtraCountersT exposes the user's current values for the two
|
|
1144
|
+
* label-defined sliding-window level counters. Returned by
|
|
1145
|
+
* `_smartico.api.getUserLevelExtraCounters()`. Both fields are
|
|
1146
|
+
* `undefined` on points-only labels.
|
|
1147
|
+
*/
|
|
1036
1148
|
export interface UserLevelExtraCountersT {
|
|
1037
|
-
/**
|
|
1149
|
+
/** Current value of the user's first level counter. Operator-defined
|
|
1150
|
+
* semantics per label. `undefined` on points-only labels. */
|
|
1038
1151
|
level_counter_1?: number;
|
|
1039
|
-
/**
|
|
1152
|
+
/** Current value of the user's second level counter. Operator-defined
|
|
1153
|
+
* semantics per label. `undefined` on points-only labels. */
|
|
1040
1154
|
level_counter_2?: number;
|
|
1041
1155
|
}
|
|
1042
1156
|
|
|
1157
|
+
/**
|
|
1158
|
+
* TSegmentCheckResult describes one segment-membership outcome.
|
|
1159
|
+
* Returned by `_smartico.api.checkSegmentListMatch()` (and used
|
|
1160
|
+
* internally by `checkSegmentMatch()`).
|
|
1161
|
+
*/
|
|
1043
1162
|
export interface TSegmentCheckResult {
|
|
1163
|
+
/** The segment ID this result refers to (label-scoped). */
|
|
1044
1164
|
segment_id: number;
|
|
1165
|
+
/** `true` if the user currently matches this segment. `false` also
|
|
1166
|
+
* covers the case where the segment doesn't exist for the label —
|
|
1167
|
+
* the two are not distinguishable. */
|
|
1045
1168
|
is_matching: boolean;
|
|
1046
1169
|
}
|
|
1047
1170
|
|
|
1171
|
+
/**
|
|
1172
|
+
* One operator-configured navigation entry. Returned by `getCustomSections()`.
|
|
1173
|
+
* `section_type_id` is the dispatch key — it determines which page component the
|
|
1174
|
+
* consumer mounts when the user opens this section.
|
|
1175
|
+
*/
|
|
1048
1176
|
export interface TUICustomSection {
|
|
1049
|
-
/**
|
|
1177
|
+
/** Stable numeric ID of the section. */
|
|
1050
1178
|
id: number;
|
|
1051
|
-
/**
|
|
1179
|
+
/** Raw HTML body for `HTML_PAGE` sections; Liquid template body for `LEVELS` (Liquid) sections. */
|
|
1052
1180
|
body?: string;
|
|
1053
|
-
/**
|
|
1181
|
+
/** CDN URL of the section's nav icon, 64x64 px square. */
|
|
1054
1182
|
menu_img?: string;
|
|
1055
|
-
/**
|
|
1183
|
+
/** Display name shown next to the nav icon. Pre-translated server-side. */
|
|
1056
1184
|
menu_name?: string;
|
|
1057
|
-
/**
|
|
1185
|
+
/** JSON-serialized list of skin image overrides for themed sections (e.g. `MISSION_CUSTOM_LAYOUT`). */
|
|
1058
1186
|
custom_skin_images?: string;
|
|
1059
|
-
/**
|
|
1187
|
+
/** Dispatch key — see {@link AchCustomSectionType}. */
|
|
1060
1188
|
section_type_id?: AchCustomSectionType;
|
|
1061
|
-
/**
|
|
1189
|
+
/** Themed-layout name for `MISSION_CUSTOM_LAYOUT` sections; see {@link AchCustomLayoutTheme}. */
|
|
1062
1190
|
theme?: AchCustomLayoutTheme;
|
|
1063
|
-
/** Custom
|
|
1191
|
+
/** Custom CSS for themed layouts. */
|
|
1064
1192
|
generic_custom_css?: string;
|
|
1065
|
-
/**
|
|
1193
|
+
/** Which tabs to render for `MISSIONS_CATEGORY` sections; see {@link AchMissionsTabsOptions}. */
|
|
1066
1194
|
mission_tabs_options?: AchMissionsTabsOptions;
|
|
1067
|
-
/**
|
|
1195
|
+
/** Mission-filter rule for the Overview tab; see {@link AchOverviewMissionsFilter}. */
|
|
1068
1196
|
overview_missions_filter?: AchOverviewMissionsFilter;
|
|
1069
|
-
/**
|
|
1197
|
+
/** Maximum number of missions shown in the Overview tab. */
|
|
1070
1198
|
overview_missions_count?: number;
|
|
1071
|
-
/**
|
|
1199
|
+
/** Click target for `REDIRECT_LINK` sections — either a Smartico DP string (`dp:…`) or an external URL. */
|
|
1072
1200
|
url_or_dp?: string;
|
|
1073
|
-
/** Data
|
|
1201
|
+
/** Data-context selectors for Liquid templates; see {@link LiquidEntityData}. */
|
|
1074
1202
|
liquid_entity_data?: LiquidEntityData[];
|
|
1075
|
-
/** Tournament ID
|
|
1203
|
+
/** Tournament ID for a single-tournament Liquid template (`LiquidEntityData.Tournament`). */
|
|
1076
1204
|
ach_tournament_id?: number;
|
|
1077
|
-
/**
|
|
1205
|
+
/** Operator debug flag — when `true`, Liquid renders raw context data instead of the templated HTML. */
|
|
1078
1206
|
show_raw_data?: boolean;
|
|
1079
|
-
/** Liquid template
|
|
1207
|
+
/** Liquid template ID resolved server-side; the rendered body is delivered in `body`. */
|
|
1080
1208
|
liquid_template?: number;
|
|
1081
|
-
/**
|
|
1209
|
+
/** Category IDs the section filters badges by — correlate with `getAchCategories()`. */
|
|
1082
1210
|
ach_category_ids?: number[];
|
|
1083
|
-
/**
|
|
1211
|
+
/** Category IDs the section filters store items by — correlate with `getStoreCategories()`. */
|
|
1084
1212
|
shop_category_ids?: number[];
|
|
1085
|
-
/** ID
|
|
1213
|
+
/** Raffle ID for `RAFFLE` sections (and `LiquidEntityData.SingleRaffle` Liquid templates). */
|
|
1086
1214
|
raffle_id?: number;
|
|
1087
1215
|
}
|
|
1088
1216
|
|
|
1217
|
+
/**
|
|
1218
|
+
* TBonus describes one bonus awarded to the user.
|
|
1219
|
+
* Returned by `_smartico.api.getBonuses()`.
|
|
1220
|
+
*/
|
|
1089
1221
|
export interface TBonus {
|
|
1090
|
-
/** ID of the bonus */
|
|
1222
|
+
/** Stable ID of the bonus. */
|
|
1091
1223
|
bonus_id: number;
|
|
1092
|
-
/**
|
|
1224
|
+
/** `true` when the bonus is in a player-claim-required state.
|
|
1225
|
+
* Gate the Claim button on this; see `claimBonus` TSDoc. */
|
|
1093
1226
|
is_redeemable?: boolean;
|
|
1094
|
-
/**
|
|
1227
|
+
/** Bonus creation timestamp as ISO 8601 UTC string
|
|
1228
|
+
* ("YYYY-MM-DDTHH:MM:SS", no timezone suffix). */
|
|
1095
1229
|
create_date?: string;
|
|
1096
|
-
/**
|
|
1230
|
+
/** Bonus redemption timestamp as ISO 8601 UTC string. Absent until
|
|
1231
|
+
* the bonus reaches `BonusStatus.REDEEMED`. */
|
|
1097
1232
|
redeem_date?: string;
|
|
1098
|
-
/** ID of template used */
|
|
1233
|
+
/** ID of the bonus template used to issue this bonus. */
|
|
1099
1234
|
label_bonus_template_id?: number;
|
|
1100
|
-
/**
|
|
1235
|
+
/** Lifecycle status; see {@link BonusStatus}. */
|
|
1101
1236
|
bonus_status_id?: BonusStatus;
|
|
1102
|
-
/**
|
|
1237
|
+
/** Template-level display metadata (operator-configured, identical
|
|
1238
|
+
* across all bonuses from the same template). */
|
|
1103
1239
|
label_bonus_template_meta_map?: BonusTemplateMetaMap;
|
|
1104
|
-
/**
|
|
1240
|
+
/** Instance-level display metadata (per-issuance; carries the
|
|
1241
|
+
* dynamic amount computed at award time). */
|
|
1105
1242
|
bonus_meta_map?: BonusMetaMap;
|
|
1106
1243
|
}
|
|
1107
1244
|
|
|
1245
|
+
/**
|
|
1246
|
+
* BonusStatus describes the lifecycle stage of a bonus on `TBonus.bonus_status_id`.
|
|
1247
|
+
* Operator widget configuration typically filters out internal statuses
|
|
1248
|
+
* (`New`, `COUPON_ISSUE_FAILED`, `EXPIRED`); consumers usually see
|
|
1249
|
+
* `COUPON_ISSUED`, `REDEEMED`, and `REDEEM_FAILED`.
|
|
1250
|
+
*/
|
|
1108
1251
|
export enum BonusStatus {
|
|
1109
|
-
/**
|
|
1252
|
+
/** Newly created, not yet processed (internal). */
|
|
1110
1253
|
New = 1,
|
|
1111
|
-
/**
|
|
1254
|
+
/** Issued and awaiting player claim. */
|
|
1112
1255
|
COUPON_ISSUED = 2,
|
|
1113
|
-
/**
|
|
1256
|
+
/** Successfully redeemed. */
|
|
1114
1257
|
REDEEMED = 3,
|
|
1115
|
-
/**
|
|
1258
|
+
/** Previous redemption attempt failed; still valid and re-claimable. */
|
|
1116
1259
|
REDEEM_FAILED = 4,
|
|
1117
|
-
/**
|
|
1260
|
+
/** Coupon issuance failed (internal). */
|
|
1118
1261
|
COUPON_ISSUE_FAILED = 5,
|
|
1119
|
-
/**
|
|
1262
|
+
/** Issued but expired before redemption (internal). */
|
|
1120
1263
|
EXPIRED = 6,
|
|
1121
1264
|
}
|
|
1265
|
+
/**
|
|
1266
|
+
* Template-level bonus display metadata (operator-configured at the
|
|
1267
|
+
* bonus template; identical for every bonus issued from the same template).
|
|
1268
|
+
*/
|
|
1122
1269
|
export interface BonusTemplateMetaMap {
|
|
1123
|
-
/**
|
|
1270
|
+
/** Operator-set description / display text. May include HTML. */
|
|
1124
1271
|
description: string;
|
|
1125
|
-
/**
|
|
1272
|
+
/** Operator-set additional message shown to the player at claim
|
|
1273
|
+
* time (e.g. wagering terms). May include deep-links. */
|
|
1126
1274
|
acknowledge: string;
|
|
1127
|
-
/**
|
|
1275
|
+
/** Bonus icon URL (1:1 aspect ratio recommended). */
|
|
1128
1276
|
image_url: string;
|
|
1129
|
-
/**
|
|
1277
|
+
/** Optional redirect — external HTTP URL (opens in new tab) or
|
|
1278
|
+
* internal deep-link (handled by the SDK's deep-link router). */
|
|
1130
1279
|
redirect_url?: string;
|
|
1131
1280
|
}
|
|
1281
|
+
/**
|
|
1282
|
+
* Instance-level bonus display metadata (set per-issuance, may carry
|
|
1283
|
+
* a dynamically-computed amount).
|
|
1284
|
+
*/
|
|
1132
1285
|
export interface BonusMetaMap {
|
|
1133
|
-
/**
|
|
1286
|
+
/** Display-ready amount string (e.g. "€50", "100 free spins"). */
|
|
1134
1287
|
uiAmount?: string;
|
|
1135
1288
|
}
|
|
1136
1289
|
|
|
1137
1290
|
/**
|
|
1138
|
-
* TClaimBonusResult describes the response of
|
|
1291
|
+
* TClaimBonusResult describes the response of `_smartico.api.claimBonus(bonus_id)`.
|
|
1292
|
+
*/
|
|
1293
|
+
/**
|
|
1294
|
+
* Result of `_smartico.api.claimBonus(bonus_id)`.
|
|
1139
1295
|
*/
|
|
1140
1296
|
export interface TClaimBonusResult {
|
|
1141
|
-
/** Error code
|
|
1142
|
-
err_code:
|
|
1143
|
-
/** Optional error message */
|
|
1297
|
+
/** Error code. `0` = success. See `claimBonus` TSDoc for the full table. */
|
|
1298
|
+
err_code: number;
|
|
1299
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
1144
1300
|
err_message: string;
|
|
1145
|
-
/**
|
|
1301
|
+
/** Unreliable on the wire — prefer `err_code === 0` as the success check. */
|
|
1146
1302
|
success?: boolean;
|
|
1147
1303
|
}
|
|
1148
1304
|
|
|
@@ -1518,10 +1674,23 @@ export interface TRaffleDrawRun {
|
|
|
1518
1674
|
|
|
1519
1675
|
}
|
|
1520
1676
|
|
|
1677
|
+
/**
|
|
1678
|
+
* TransformedRaffleClaimPrizeResponse describes the response of
|
|
1679
|
+
* `_smartico.api.claimRafflePrize({won_id})`.
|
|
1680
|
+
*
|
|
1681
|
+
* Note: this type uses `errorCode` / `errorMessage` (camelCase
|
|
1682
|
+
* full-word) — different from most other SDK wrapper-result types in
|
|
1683
|
+
* this library which use `err_code` / `err_message` (snake_case).
|
|
1684
|
+
*/
|
|
1685
|
+
/**
|
|
1686
|
+
* Result of `_smartico.api.claimRafflePrize({raffle_id, draw_id, raffle_run_id})`.
|
|
1687
|
+
* Uses camelCase `errorCode` / `errorMessage` — distinct from most other SDK
|
|
1688
|
+
* result wrappers which use snake_case `err_code` / `err_message`.
|
|
1689
|
+
*/
|
|
1521
1690
|
export interface TransformedRaffleClaimPrizeResponse {
|
|
1522
|
-
/** Error code
|
|
1691
|
+
/** Error code. `0` = success. See `claimRafflePrize` TSDoc for the full table. */
|
|
1523
1692
|
errorCode: number
|
|
1524
|
-
/**
|
|
1693
|
+
/** Optional error message; populated on non-zero `errorCode`. */
|
|
1525
1694
|
errorMessage?: string
|
|
1526
1695
|
}
|
|
1527
1696
|
/**
|
|
@@ -1548,10 +1717,13 @@ export interface TActivityLog {
|
|
|
1548
1717
|
}
|
|
1549
1718
|
|
|
1550
1719
|
|
|
1720
|
+
/**
|
|
1721
|
+
* Result of `_smartico.api.requestRaffleOptin({raffle_id, draw_id, raffle_run_id})`.
|
|
1722
|
+
*/
|
|
1551
1723
|
export interface TRaffleOptinResponse {
|
|
1552
|
-
/** Error code
|
|
1724
|
+
/** Error code. `0` = success. See `requestRaffleOptin` TSDoc for the full table. */
|
|
1553
1725
|
err_code: number;
|
|
1554
|
-
/** Optional error message */
|
|
1726
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
1555
1727
|
err_message?: string;
|
|
1556
1728
|
}
|
|
1557
1729
|
|
|
@@ -2024,75 +2196,72 @@ export interface GamePickRoundRequestParams extends GamePickRequestParams {
|
|
|
2024
2196
|
}
|
|
2025
2197
|
|
|
2026
2198
|
/**
|
|
2027
|
-
*
|
|
2199
|
+
* One avatar in the user's catalog. Returned by `getAvatarsList()`.
|
|
2028
2200
|
* Fields from the raw `public_meta` object are flattened to the top level.
|
|
2029
2201
|
*/
|
|
2030
2202
|
export interface TAvatarDefinition {
|
|
2031
|
-
/**
|
|
2203
|
+
/** Stable numeric identifier of the avatar. Primary key passed to `setAvatar()`. */
|
|
2032
2204
|
avatar_real_id: number;
|
|
2033
|
-
/**
|
|
2205
|
+
/** True when this is the system default avatar for the label. */
|
|
2034
2206
|
is_default: boolean;
|
|
2035
|
-
/**
|
|
2207
|
+
/** When true and `is_given === false`, the avatar should be hidden from the user (surprise unlock). */
|
|
2036
2208
|
hide_until_achieved: boolean;
|
|
2037
|
-
/** Display
|
|
2209
|
+
/** Display position; lower = earlier in the grid. */
|
|
2038
2210
|
priority: number;
|
|
2039
|
-
/** Optional description
|
|
2211
|
+
/** Optional description shown alongside the avatar in detail views. */
|
|
2040
2212
|
description?: string;
|
|
2041
|
-
/** Raw image path
|
|
2213
|
+
/** Raw image path as returned by the server (relative or absolute). */
|
|
2042
2214
|
url: string;
|
|
2043
|
-
/**
|
|
2215
|
+
/** Absolute CDN URL of the avatar image; built from the configured avatar domain + `url`. */
|
|
2044
2216
|
avatar_url: string;
|
|
2045
|
-
/**
|
|
2046
|
-
* Source type of the avatar.
|
|
2047
|
-
* 0 = free (always available to all users), other values = earned/purchased
|
|
2048
|
-
*/
|
|
2217
|
+
/** Source type. `0` = free / always available; non-zero = earned or purchased. */
|
|
2049
2218
|
avatar_source_type_id: number;
|
|
2050
|
-
/** ISO date string from which the avatar becomes available */
|
|
2219
|
+
/** ISO date string from which the avatar becomes available; undefined when no start window. */
|
|
2051
2220
|
active_from_date?: string;
|
|
2052
|
-
/** ISO date string until which the avatar is available */
|
|
2221
|
+
/** ISO date string until which the avatar is available; undefined when no end window. */
|
|
2053
2222
|
active_till_date?: string;
|
|
2054
|
-
/**
|
|
2223
|
+
/** True when the user owns / has unlocked this avatar. */
|
|
2055
2224
|
is_given: boolean;
|
|
2056
|
-
/**
|
|
2225
|
+
/** True when this avatar is the user's currently active profile avatar. */
|
|
2057
2226
|
is_in_use?: boolean;
|
|
2058
2227
|
}
|
|
2059
2228
|
|
|
2060
2229
|
/**
|
|
2061
|
-
*
|
|
2230
|
+
* One AI-generated variant of a base avatar. Returned by `getAvatarsCustomized()`.
|
|
2062
2231
|
*/
|
|
2063
2232
|
export interface TAvatarCustomized {
|
|
2064
|
-
/**
|
|
2233
|
+
/** `avatar_real_id` of the base avatar this variant was generated from. */
|
|
2065
2234
|
avatar_real_id: number;
|
|
2066
|
-
/**
|
|
2235
|
+
/** Absolute CDN URL of the AI-generated image. Can be passed as `avatar_url` to `setAvatar()`. */
|
|
2067
2236
|
url: string;
|
|
2068
|
-
/** ISO date string when the
|
|
2237
|
+
/** ISO date string of when the variant was generated. */
|
|
2069
2238
|
dt_created: string;
|
|
2070
2239
|
}
|
|
2071
2240
|
|
|
2072
2241
|
/**
|
|
2073
|
-
*
|
|
2242
|
+
* One AI style prompt for avatar customization. Returned by `getAvatarPrompts()`.
|
|
2074
2243
|
* Fields from the raw `public_meta` object are flattened to the top level.
|
|
2075
2244
|
*/
|
|
2076
2245
|
export interface TAvatarPrompt {
|
|
2077
|
-
/**
|
|
2246
|
+
/** Stable numeric identifier of the prompt. */
|
|
2078
2247
|
prompt_id: number;
|
|
2079
|
-
/** Display name of the
|
|
2248
|
+
/** Display name of the style, e.g. "Cartoon", "Watercolor". */
|
|
2080
2249
|
name: string;
|
|
2081
|
-
/**
|
|
2250
|
+
/** Absolute CDN URL of the prompt's preview icon. */
|
|
2082
2251
|
icon_url: string;
|
|
2083
|
-
/** Currency
|
|
2252
|
+
/** Currency used to pay for the customization. `0` = points, `1` = gems, `2` = diamonds. */
|
|
2084
2253
|
cost_currency_type_id: number;
|
|
2085
|
-
/** Cost amount in the
|
|
2254
|
+
/** Cost amount in the currency named by `cost_currency_type_id`. */
|
|
2086
2255
|
cost_value: number;
|
|
2087
2256
|
}
|
|
2088
2257
|
|
|
2089
2258
|
/**
|
|
2090
|
-
*
|
|
2259
|
+
* Result of `_smartico.api.setAvatar()`.
|
|
2091
2260
|
*/
|
|
2092
2261
|
export interface TSetAvatarResult {
|
|
2093
|
-
/** Error code
|
|
2262
|
+
/** Error code. `0` = success. See `setAvatar` TSDoc for the full table. */
|
|
2094
2263
|
err_code: number;
|
|
2095
|
-
/** Optional error message */
|
|
2264
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
2096
2265
|
err_message?: string;
|
|
2097
2266
|
}
|
|
2098
2267
|
|