@smartico/public-api 0.0.379 → 0.0.380
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/README.md +31 -2
- 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 +78 -0
- package/dist/WSAPI/WSAPIBase.d.ts +71 -0
- package/dist/WSAPI/WSAPIBonuses.d.ts +26 -0
- package/dist/WSAPI/WSAPIClans.d.ts +388 -0
- package/dist/WSAPI/WSAPIGamePick.d.ts +308 -0
- package/dist/WSAPI/WSAPIGeneral.d.ts +30 -0
- package/dist/WSAPI/WSAPIInbox.d.ts +126 -0
- package/dist/WSAPI/WSAPIJackpots.d.ts +109 -0
- package/dist/WSAPI/WSAPILeaderBoard.d.ts +25 -0
- package/dist/WSAPI/WSAPIMiniGames.d.ts +94 -0
- package/dist/WSAPI/WSAPIMissions.d.ts +517 -0
- package/dist/WSAPI/WSAPIRaffles.d.ts +119 -0
- package/dist/WSAPI/WSAPIStore.d.ts +656 -0
- package/dist/WSAPI/WSAPITournaments.d.ts +501 -0
- package/dist/WSAPI/WSAPITypes.d.ts +145 -85
- package/dist/WSAPI/WSAPIUser.d.ts +383 -0
- package/dist/index.js +3818 -1528
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +3180 -981
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/README.md +56 -2
- package/docs/api/classes/WSAPIAvatars.md +116 -0
- package/docs/api/classes/WSAPIBonuses.md +50 -0
- package/docs/api/classes/WSAPIClans.md +66 -0
- package/docs/api/classes/WSAPIGamePick.md +181 -0
- package/docs/api/classes/WSAPIGeneral.md +63 -0
- package/docs/api/classes/WSAPIInbox.md +277 -0
- package/docs/api/classes/WSAPIJackpots.md +185 -0
- package/docs/api/classes/WSAPILeaderBoard.md +39 -0
- package/docs/api/classes/WSAPIMiniGames.md +175 -0
- package/docs/api/classes/WSAPIMissions.md +611 -0
- package/docs/api/classes/WSAPIRaffles.md +195 -0
- package/docs/api/classes/WSAPIStore.md +744 -0
- package/docs/api/classes/WSAPITournaments.md +104 -0
- package/docs/api/classes/WSAPIUser.md +200 -0
- package/docs/api/enumerations/AchievementClaimPeriodTypeId.md +13 -0
- package/docs/api/enumerations/BuyStoreItemErrorCode.md +32 -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/SAWTemplateUI.md +10 -0
- package/docs/api/interfaces/TAchCategory.md +19 -4
- package/docs/api/interfaces/TBuyStoreItemResult.md +26 -8
- package/docs/api/interfaces/TMissionClaimRewardResult.md +14 -3
- package/docs/api/interfaces/TMissionOptInResult.md +10 -3
- package/docs/api/interfaces/TMissionOrBadge.md +6 -2
- package/docs/api/interfaces/TStoreItem.md +21 -1
- package/docs/api/interfaces/TTournamentDetailed.md +8 -0
- package/docs/api/interfaces/UserAchievement.md +1 -1
- 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/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/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_getLevels.md +162 -0
- package/docs/ui/user/UIGuide_getUserProfile.md +213 -0
- package/package.json +3 -3
- package/scripts/postdoc-cleanup.js +195 -0
- package/src/Missions/MissionsUtils.ts +5 -2
- 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 +127 -0
- package/src/WSAPI/WSAPIBase.ts +93 -0
- package/src/WSAPI/WSAPIBonuses.ts +54 -0
- package/src/WSAPI/WSAPIClans.ts +417 -0
- package/src/WSAPI/WSAPIGamePick.ts +382 -0
- package/src/WSAPI/WSAPIGeneral.ts +57 -0
- package/src/WSAPI/WSAPIInbox.ts +222 -0
- package/src/WSAPI/WSAPIJackpots.ts +212 -0
- package/src/WSAPI/WSAPILeaderBoard.ts +40 -0
- package/src/WSAPI/WSAPIMiniGames.ts +181 -0
- package/src/WSAPI/WSAPIMissions.ts +572 -0
- package/src/WSAPI/WSAPIRaffles.ts +175 -0
- package/src/WSAPI/WSAPIStore.ts +732 -0
- package/src/WSAPI/WSAPITournaments.ts +541 -0
- package/src/WSAPI/WSAPITypes.ts +145 -87
- package/src/WSAPI/WSAPIUser.ts +456 -0
- package/tsconfig.json +17 -1
- package/docs/api/classes/WSAPI.md +0 -1927
package/src/WSAPI/WSAPITypes.ts
CHANGED
|
@@ -212,89 +212,78 @@ export interface TMiniGameTemplate {
|
|
|
212
212
|
*/
|
|
213
213
|
|
|
214
214
|
export interface TUserProfile {
|
|
215
|
-
/**
|
|
215
|
+
/** Language code stored server-side for the user (e.g. `"en"`, `"de"`). */
|
|
216
216
|
core_user_language: string;
|
|
217
|
-
/**
|
|
217
|
+
/** Current spendable points balance — decremented by store purchases,
|
|
218
|
+
* tournament buy-ins, and clan entry fees. */
|
|
218
219
|
ach_points_balance: number;
|
|
219
|
-
/**
|
|
220
|
+
/** All-time cumulative points earned. Monotonic — NOT decremented by
|
|
221
|
+
* store purchases or clan/tournament fees. */
|
|
220
222
|
ach_points_ever: number;
|
|
221
|
-
/**
|
|
223
|
+
/** Current gems balance (secondary currency). */
|
|
222
224
|
ach_gems_balance: number;
|
|
223
|
-
/**
|
|
225
|
+
/** Current diamonds balance (tertiary currency). */
|
|
224
226
|
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
|
-
*/
|
|
227
|
+
/** Server-stored public tags on the user (uppercase strings).
|
|
228
|
+
* Modify via `_smartico.updatePublicTags(operation, tags)`. */
|
|
231
229
|
core_public_tags: string[];
|
|
232
|
-
/**
|
|
230
|
+
/** FK into the level ladder; resolve via `getCurrentLevel()` or `getLevels()`. */
|
|
233
231
|
ach_level_current_id?: number;
|
|
234
|
-
/**
|
|
232
|
+
/** `true` when the user is flagged as a test account. */
|
|
235
233
|
core_is_test_account?: boolean;
|
|
236
|
-
/**
|
|
234
|
+
/** Resolved CDN URL for the user's avatar. */
|
|
237
235
|
avatar_url?: string;
|
|
238
|
-
/**
|
|
236
|
+
/** Display username (operator-defined alias). */
|
|
239
237
|
public_username?: string;
|
|
240
|
-
/**
|
|
238
|
+
/** Unread inbox messages count. Push-updated in real time. */
|
|
241
239
|
core_inbox_unread_count?: number;
|
|
242
|
-
/**
|
|
240
|
+
/** AI-recommended deposit amount for this user. Undefined when no
|
|
241
|
+
* recommendation is currently available. */
|
|
243
242
|
core_recommended_deposit_amount?: number;
|
|
244
|
-
/**
|
|
243
|
+
/** AI-recommended casino bet amount for this user. Undefined when no
|
|
244
|
+
* recommendation is currently available. */
|
|
245
245
|
core_recommended_casino_bet_amount?: number;
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
/**
|
|
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
|
|
249
|
+
* TLevel describes one level in the label's level ladder.
|
|
250
|
+
* Returned by `_smartico.api.getLevels()` (already sorted by `required_points` ASC).
|
|
253
251
|
*/
|
|
254
252
|
export interface TLevel {
|
|
255
|
-
/**
|
|
253
|
+
/** Stable ID of the level. */
|
|
256
254
|
id: number;
|
|
257
|
-
/**
|
|
255
|
+
/** Display name of the level, pre-translated to the user's language. */
|
|
258
256
|
name: string;
|
|
259
|
-
/**
|
|
257
|
+
/** Display description of the level, pre-translated to the user's language. */
|
|
260
258
|
description: string;
|
|
261
|
-
/**
|
|
259
|
+
/** URL of the level image (256x256 px source). */
|
|
262
260
|
image: string;
|
|
263
|
-
/**
|
|
261
|
+
/** Total `ach_points_ever` required to reach this level. */
|
|
264
262
|
required_points: number;
|
|
265
|
-
/**
|
|
263
|
+
/** Visibility threshold — clients hide the level from the user until
|
|
264
|
+
* `ach_points_ever >= visibility_points`. `null` means always visible. */
|
|
266
265
|
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
|
-
*/
|
|
266
|
+
/** Required value of the first level counter for sliding-window leveling.
|
|
267
|
+
* `null` on points-only labels. See `UserLevelExtraCountersT`. */
|
|
273
268
|
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
|
-
*/
|
|
269
|
+
/** Required value of the second level counter for sliding-window leveling.
|
|
270
|
+
* `null` on points-only labels. */
|
|
280
271
|
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
|
-
*/
|
|
272
|
+
/** Operator-defined custom data. The SDK auto-parses JSON-looking
|
|
273
|
+
* strings, so at runtime this is `any` despite the `string` type. */
|
|
287
274
|
custom_data: string;
|
|
288
|
-
/**
|
|
275
|
+
/** 1-based position in the ladder (matches the order of the returned
|
|
276
|
+
* array, which is sorted by `required_points` ASC). */
|
|
289
277
|
ordinal_position: number;
|
|
290
278
|
}
|
|
291
279
|
|
|
292
280
|
/**
|
|
293
|
-
* TLevelCurrent
|
|
281
|
+
* TLevelCurrent extends `TLevel` with the user's progress toward the next level.
|
|
282
|
+
* Returned by `_smartico.api.getCurrentLevel()`.
|
|
294
283
|
*/
|
|
295
|
-
|
|
296
284
|
export interface TLevelCurrent extends TLevel {
|
|
297
|
-
/**
|
|
285
|
+
/** Progress to the next level as a 0–100 integer percentage. `100`
|
|
286
|
+
* at the highest level. */
|
|
298
287
|
progress: number;
|
|
299
288
|
}
|
|
300
289
|
|
|
@@ -326,7 +315,7 @@ export interface TTournament {
|
|
|
326
315
|
segment_dont_match_message: string;
|
|
327
316
|
/**
|
|
328
317
|
* 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
|
|
318
|
+
* The list of custom sections can be retrieved using _smartico.api.getCustomSections() method
|
|
330
319
|
*/
|
|
331
320
|
custom_section_id: number;
|
|
332
321
|
/** The custom data of the tournament defined by operator. Can be a JSON object, string or number */
|
|
@@ -557,13 +546,17 @@ export interface TClan {
|
|
|
557
546
|
member_count: number;
|
|
558
547
|
/** Max number of members allowed in clan */
|
|
559
548
|
capacity_limit: number;
|
|
560
|
-
/**
|
|
549
|
+
/** Currency type for `entry_fee_amount`. `0` = points, `1` = gems,
|
|
550
|
+
* `2` = diamonds, `3` = free (no fee). */
|
|
561
551
|
entry_fee_currency_type_id: number;
|
|
562
|
-
/**
|
|
552
|
+
/** Entry fee amount in the currency indicated by `entry_fee_currency_type_id`.
|
|
553
|
+
* `0` (or `entry_fee_currency_type_id === 3`) means the clan is free to join. */
|
|
563
554
|
entry_fee_amount: number;
|
|
564
|
-
/**
|
|
555
|
+
/** Global rank among all active clans in the label, by `rating_score` DESC.
|
|
556
|
+
* `1` = highest-rated. May skip positions when some clans are hidden by
|
|
557
|
+
* per-user visibility (e.g. user sees positions 1, 3, 7). */
|
|
565
558
|
rating_position: number;
|
|
566
|
-
/** Clan rating score */
|
|
559
|
+
/** Clan rating score (higher is better). */
|
|
567
560
|
rating_score: number;
|
|
568
561
|
}
|
|
569
562
|
|
|
@@ -575,7 +568,9 @@ export interface TClans {
|
|
|
575
568
|
clans: TClan[];
|
|
576
569
|
/** The clan ID the current user belongs to; null if clanless */
|
|
577
570
|
user_clan_id: number | null;
|
|
578
|
-
/**
|
|
571
|
+
/** Switch-cooldown expiry as ISO 8601 UTC string ("YYYY-MM-DDTHH:MM:SS"
|
|
572
|
+
* with no timezone suffix; interpret as UTC). `null` when no cooldown.
|
|
573
|
+
* User-level: while set, the user cannot join any clan. */
|
|
579
574
|
cooldown_until: string | null;
|
|
580
575
|
/** Epoch ms when the current user joined their clan; null if clanless */
|
|
581
576
|
join_date: number | null;
|
|
@@ -583,35 +578,71 @@ export interface TClans {
|
|
|
583
578
|
|
|
584
579
|
/**
|
|
585
580
|
* TClanInfo describes the detailed info of a single clan including its members.
|
|
581
|
+
* Returned by `_smartico.api.getClanInfo(clanId)`.
|
|
586
582
|
*/
|
|
587
583
|
export interface TClanInfo {
|
|
584
|
+
/** Clan ID. */
|
|
588
585
|
clan_id: number;
|
|
586
|
+
/** Translated clan metadata (name, description, image URL). */
|
|
589
587
|
public_meta: { name: string; description: string; image_url: string };
|
|
588
|
+
/** Current number of members in clan. */
|
|
590
589
|
member_count: number;
|
|
590
|
+
/** Max number of members allowed in clan. */
|
|
591
591
|
capacity_limit: number;
|
|
592
|
+
/** Currency type for `entry_fee_amount`. `0` = points, `1` = gems,
|
|
593
|
+
* `2` = diamonds, `3` = free. */
|
|
592
594
|
entry_fee_currency_type_id: number;
|
|
595
|
+
/** Entry fee amount in the currency indicated by `entry_fee_currency_type_id`. */
|
|
593
596
|
entry_fee_amount: number;
|
|
597
|
+
/** Global rank among all active clans in the label, by `rating_score` DESC.
|
|
598
|
+
* `1` = highest-rated. */
|
|
594
599
|
rating_position: number;
|
|
600
|
+
/** Clan rating score (higher is better). */
|
|
595
601
|
rating_score: number;
|
|
602
|
+
/** User-level switch-cooldown expiry as ISO 8601 UTC string
|
|
603
|
+
* ("YYYY-MM-DDTHH:MM:SS" with no timezone suffix). `null` when no
|
|
604
|
+
* cooldown. Same semantic as `TClans.cooldown_until` but always fresh
|
|
605
|
+
* (the list version may be up to 30 s stale). */
|
|
596
606
|
cooldown_until: string | null;
|
|
607
|
+
/** Members of this clan, server-ordered by `contribution_score` DESC
|
|
608
|
+
* (i.e. `position` ASC). */
|
|
597
609
|
members: {
|
|
610
|
+
/** Member's internal user ID. */
|
|
598
611
|
user_id: number;
|
|
612
|
+
/** Member's display username. */
|
|
599
613
|
public_username: string;
|
|
614
|
+
/** Avatar identifier; resolve via `avatar_url` below or rebuild
|
|
615
|
+
* from `avatar_id` + brand avatar domain. */
|
|
600
616
|
avatar_id: string;
|
|
617
|
+
/** Numeric avatar ID (alternative identifier). */
|
|
601
618
|
avatar_real_id: number;
|
|
619
|
+
/** Pre-resolved CDN URL for the avatar. */
|
|
602
620
|
avatar_url?: string;
|
|
621
|
+
/** Member's rank within this clan; `1` = top contributor. */
|
|
603
622
|
position: number;
|
|
623
|
+
/** Member's contribution to the clan rating score. */
|
|
604
624
|
contribution_score: number;
|
|
625
|
+
/** `true` when this row is the current authenticated user. */
|
|
605
626
|
is_me?: boolean;
|
|
627
|
+
/** External user identifier (operator-provided alias);
|
|
628
|
+
* preferred over `public_username` on some surfaces. */
|
|
606
629
|
clean_ext_user_id?: string;
|
|
607
630
|
}[];
|
|
608
631
|
}
|
|
609
632
|
|
|
610
633
|
/**
|
|
611
|
-
* TClanJoinResult describes the result of a join
|
|
634
|
+
* TClanJoinResult describes the result of a join-clan request.
|
|
635
|
+
* Note: this type uses `errCode` / `errMsg` (camelCase) — different
|
|
636
|
+
* from most other SDK result types in this library which use
|
|
637
|
+
* `err_code` / `err_message` (snake_case).
|
|
612
638
|
*/
|
|
613
639
|
export interface TClanJoinResult {
|
|
640
|
+
/** Error code. `0` = success. Typed values are members of
|
|
641
|
+
* {@link JoinClanErrorCode}. See `joinClan` TSDoc for the full
|
|
642
|
+
* table and per-code UI guidance. */
|
|
614
643
|
errCode: number;
|
|
644
|
+
/** Optional server-side error message. Present only on non-zero
|
|
645
|
+
* `errCode`; may be empty even then. */
|
|
615
646
|
errMsg: string;
|
|
616
647
|
}
|
|
617
648
|
|
|
@@ -668,7 +699,9 @@ export interface TStoreItem {
|
|
|
668
699
|
can_buy: boolean;
|
|
669
700
|
/** The list of IDs of the categories where the store item is assigned, information about categories can be retrieved with getStoreCategories method */
|
|
670
701
|
category_ids: number[];
|
|
671
|
-
/**
|
|
702
|
+
/** Items remaining in the pool available for purchase. `null` = unlimited
|
|
703
|
+
* supply. Positive integer = remaining stock. `0` = sold out but still
|
|
704
|
+
* returned (operator may instead hide pool-empty items entirely). */
|
|
672
705
|
pool?: number;
|
|
673
706
|
/** The custom data of the store item defined by operator. Can be a JSON object, string or number */
|
|
674
707
|
custom_data: any;
|
|
@@ -688,6 +721,8 @@ export interface TStoreItem {
|
|
|
688
721
|
purchase_type: 'points' | 'gems' | 'diamonds';
|
|
689
722
|
/** The date when the store item will be available till */
|
|
690
723
|
active_till_date?: number;
|
|
724
|
+
/** Should countdown timer be shown when `active_till_date` is present */
|
|
725
|
+
show_timer?: boolean;
|
|
691
726
|
/** The discounted price of the store item */
|
|
692
727
|
discounted_price?: number;
|
|
693
728
|
/** The ribbon of the discounted price. */
|
|
@@ -705,14 +740,24 @@ export interface TStoreItem {
|
|
|
705
740
|
}
|
|
706
741
|
|
|
707
742
|
/**
|
|
708
|
-
* TAchCategory describes
|
|
743
|
+
* TAchCategory describes a mission/badge category. Categories are
|
|
744
|
+
* operator-defined groupings, configured per-label by the brand operator,
|
|
745
|
+
* shared across BOTH missions and badges — the same list is returned for
|
|
746
|
+
* both entity types. A mission or badge can belong to **zero or more**
|
|
747
|
+
* categories (many-to-many) via its `category_ids: number[]` field on
|
|
748
|
+
* `TMissionOrBadge`.
|
|
749
|
+
*
|
|
750
|
+
* Returned by `_smartico.api.getAchCategories()`. See that method's TSDoc
|
|
751
|
+
* for translation, refresh, and rendering details.
|
|
709
752
|
*/
|
|
710
753
|
export interface TAchCategory {
|
|
711
|
-
/**ID of the
|
|
754
|
+
/** Stable numeric ID of the category. Used as the key when joining to
|
|
755
|
+
* `TMissionOrBadge.category_ids: number[]`. */
|
|
712
756
|
id: number;
|
|
713
|
-
/**
|
|
757
|
+
/** Display name of the category, pre-translated server-side. Never null. */
|
|
714
758
|
name: string;
|
|
715
|
-
/**
|
|
759
|
+
/** Relative display position (lower = appears first). Default 1 when the
|
|
760
|
+
* operator did not configure an explicit order. */
|
|
716
761
|
order: number;
|
|
717
762
|
}
|
|
718
763
|
|
|
@@ -768,8 +813,8 @@ export interface TMissionOrBadge {
|
|
|
768
813
|
/** The text of the CTA button, e.g. 'Make a deposit' */
|
|
769
814
|
cta_text: string;
|
|
770
815
|
/**
|
|
771
|
-
* The ID of the custom section where the mission or badge is assigned
|
|
772
|
-
*
|
|
816
|
+
* The ID of the custom section where the mission or badge is assigned.
|
|
817
|
+
* Resolve to section metadata via `_smartico.api.getCustomSections()`.
|
|
773
818
|
*/
|
|
774
819
|
custom_section_id: number;
|
|
775
820
|
/** 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 +841,8 @@ export interface TMissionOrBadge {
|
|
|
796
841
|
/** 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
842
|
ribbon?: TRibbon;
|
|
798
843
|
|
|
799
|
-
/**
|
|
844
|
+
/** Stable identifier of this specific mission completion. Undefined for
|
|
845
|
+
* badges and for missions that have not yet completed. */
|
|
800
846
|
ach_completed_id?: number;
|
|
801
847
|
|
|
802
848
|
/** Flag from achievement if the mission prize will be given only after user claims it */
|
|
@@ -901,46 +947,50 @@ export interface TMissionOrBadgeTask {
|
|
|
901
947
|
}
|
|
902
948
|
|
|
903
949
|
/**
|
|
904
|
-
*
|
|
950
|
+
* Response of `_smartico.api.requestMissionOptIn(mission_id)`.
|
|
951
|
+
*
|
|
952
|
+
* See `requestMissionOptIn` TSDoc for the full table of `err_code` values
|
|
953
|
+
* and recommended UI handling.
|
|
905
954
|
*/
|
|
906
955
|
export interface TMissionOptInResult {
|
|
907
|
-
/** Error code
|
|
956
|
+
/** Error code. `0` = success. See `requestMissionOptIn` TSDoc for the full table. */
|
|
908
957
|
err_code: number;
|
|
909
|
-
/** Optional error message */
|
|
958
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
910
959
|
err_message: string;
|
|
911
960
|
}
|
|
912
961
|
|
|
913
962
|
/**
|
|
914
|
-
*
|
|
963
|
+
* Response of `_smartico.api.requestMissionClaimReward(mission_id, ach_completed_id)`.
|
|
964
|
+
*
|
|
965
|
+
* See `requestMissionClaimReward` TSDoc for the full table of `err_code`
|
|
966
|
+
* values, preconditions, side effects, and recommended UI handling.
|
|
915
967
|
*/
|
|
916
968
|
export interface TMissionClaimRewardResult {
|
|
917
|
-
/** Error code
|
|
969
|
+
/** Error code. `0` = success (rewards credited). See `requestMissionClaimReward` TSDoc for the full table. */
|
|
918
970
|
err_code: number;
|
|
919
|
-
/** Optional error message */
|
|
971
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
920
972
|
err_message: string;
|
|
921
973
|
}
|
|
922
974
|
|
|
923
975
|
export interface TTournamentRegistrationResult {
|
|
924
|
-
/** Error code
|
|
976
|
+
/** Error code. `0` = success (registration persisted, buy-in
|
|
977
|
+
* deducted). Typed values are members of {@link TournamentRegistrationError};
|
|
978
|
+
* numeric codes `300010` (insufficient gems) and `300011` (insufficient
|
|
979
|
+
* diamonds) may also be returned and are NOT currently in the enum.
|
|
980
|
+
* See `registerInTournament` TSDoc for the full table. */
|
|
925
981
|
err_code: TournamentRegistrationError;
|
|
926
|
-
/** Optional error message
|
|
982
|
+
/** Optional error message. Present only on non-zero `err_code`;
|
|
983
|
+
* may be empty even then. */
|
|
927
984
|
err_message: string;
|
|
928
985
|
}
|
|
929
986
|
|
|
930
987
|
export interface TBuyStoreItemResult {
|
|
931
|
-
/** Error code
|
|
932
|
-
*
|
|
933
|
-
*
|
|
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
|
-
*/
|
|
988
|
+
/** Error code. `0` = success (funds debited and reward delivered).
|
|
989
|
+
* Typed values are the named codes in {@link BuyStoreItemErrorCode}.
|
|
990
|
+
* See `buyStoreItem` TSDoc for the full table and per-code UI guidance. */
|
|
942
991
|
err_code: BuyStoreItemErrorCode;
|
|
943
|
-
/** Optional error message
|
|
992
|
+
/** Optional server-side error message. Present only on non-zero
|
|
993
|
+
* `err_code`; may be empty even then. */
|
|
944
994
|
err_message: string;
|
|
945
995
|
}
|
|
946
996
|
|
|
@@ -1033,10 +1083,18 @@ export interface LeaderBoardUserT {
|
|
|
1033
1083
|
is_me: boolean;
|
|
1034
1084
|
}
|
|
1035
1085
|
|
|
1086
|
+
/**
|
|
1087
|
+
* UserLevelExtraCountersT exposes the user's current values for the two
|
|
1088
|
+
* label-defined sliding-window level counters. Returned by
|
|
1089
|
+
* `_smartico.api.getUserLevelExtraCounters()`. Both fields are
|
|
1090
|
+
* `undefined` on points-only labels.
|
|
1091
|
+
*/
|
|
1036
1092
|
export interface UserLevelExtraCountersT {
|
|
1037
|
-
/**
|
|
1093
|
+
/** Current value of the user's first level counter. Operator-defined
|
|
1094
|
+
* semantics per label. `undefined` on points-only labels. */
|
|
1038
1095
|
level_counter_1?: number;
|
|
1039
|
-
/**
|
|
1096
|
+
/** Current value of the user's second level counter. Operator-defined
|
|
1097
|
+
* semantics per label. `undefined` on points-only labels. */
|
|
1040
1098
|
level_counter_2?: number;
|
|
1041
1099
|
}
|
|
1042
1100
|
|