@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
|
@@ -193,85 +193,76 @@ export interface TMiniGameTemplate {
|
|
|
193
193
|
* _smartico.on('props_change', () => console.log(_smartico.api.getUserProfile()) );
|
|
194
194
|
*/
|
|
195
195
|
export interface TUserProfile {
|
|
196
|
-
/**
|
|
196
|
+
/** Language code stored server-side for the user (e.g. `"en"`, `"de"`). */
|
|
197
197
|
core_user_language: string;
|
|
198
|
-
/**
|
|
198
|
+
/** Current spendable points balance — decremented by store purchases,
|
|
199
|
+
* tournament buy-ins, and clan entry fees. */
|
|
199
200
|
ach_points_balance: number;
|
|
200
|
-
/**
|
|
201
|
+
/** All-time cumulative points earned. Monotonic — NOT decremented by
|
|
202
|
+
* store purchases or clan/tournament fees. */
|
|
201
203
|
ach_points_ever: number;
|
|
202
|
-
/**
|
|
204
|
+
/** Current gems balance (secondary currency). */
|
|
203
205
|
ach_gems_balance: number;
|
|
204
|
-
/**
|
|
206
|
+
/** Current diamonds balance (tertiary currency). */
|
|
205
207
|
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
|
-
*/
|
|
208
|
+
/** Server-stored public tags on the user (uppercase strings).
|
|
209
|
+
* Modify via `_smartico.updatePublicTags(operation, tags)`. */
|
|
212
210
|
core_public_tags: string[];
|
|
213
|
-
/**
|
|
211
|
+
/** FK into the level ladder; resolve via `getCurrentLevel()` or `getLevels()`. */
|
|
214
212
|
ach_level_current_id?: number;
|
|
215
|
-
/**
|
|
213
|
+
/** `true` when the user is flagged as a test account. */
|
|
216
214
|
core_is_test_account?: boolean;
|
|
217
|
-
/**
|
|
215
|
+
/** Resolved CDN URL for the user's avatar. */
|
|
218
216
|
avatar_url?: string;
|
|
219
|
-
/**
|
|
217
|
+
/** Display username (operator-defined alias). */
|
|
220
218
|
public_username?: string;
|
|
221
|
-
/**
|
|
219
|
+
/** Unread inbox messages count. Push-updated in real time. */
|
|
222
220
|
core_inbox_unread_count?: number;
|
|
223
|
-
/**
|
|
221
|
+
/** AI-recommended deposit amount for this user. Undefined when no
|
|
222
|
+
* recommendation is currently available. */
|
|
224
223
|
core_recommended_deposit_amount?: number;
|
|
225
|
-
/**
|
|
224
|
+
/** AI-recommended casino bet amount for this user. Undefined when no
|
|
225
|
+
* recommendation is currently available. */
|
|
226
226
|
core_recommended_casino_bet_amount?: number;
|
|
227
227
|
}
|
|
228
228
|
/**
|
|
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
|
|
229
|
+
* TLevel describes one level in the label's level ladder.
|
|
230
|
+
* Returned by `_smartico.api.getLevels()` (already sorted by `required_points` ASC).
|
|
233
231
|
*/
|
|
234
232
|
export interface TLevel {
|
|
235
|
-
/**
|
|
233
|
+
/** Stable ID of the level. */
|
|
236
234
|
id: number;
|
|
237
|
-
/**
|
|
235
|
+
/** Display name of the level, pre-translated to the user's language. */
|
|
238
236
|
name: string;
|
|
239
|
-
/**
|
|
237
|
+
/** Display description of the level, pre-translated to the user's language. */
|
|
240
238
|
description: string;
|
|
241
|
-
/**
|
|
239
|
+
/** URL of the level image (256x256 px source). */
|
|
242
240
|
image: string;
|
|
243
|
-
/**
|
|
241
|
+
/** Total `ach_points_ever` required to reach this level. */
|
|
244
242
|
required_points: number;
|
|
245
|
-
/**
|
|
243
|
+
/** Visibility threshold — clients hide the level from the user until
|
|
244
|
+
* `ach_points_ever >= visibility_points`. `null` means always visible. */
|
|
246
245
|
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
|
-
*/
|
|
246
|
+
/** Required value of the first level counter for sliding-window leveling.
|
|
247
|
+
* `null` on points-only labels. See `UserLevelExtraCountersT`. */
|
|
253
248
|
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
|
-
*/
|
|
249
|
+
/** Required value of the second level counter for sliding-window leveling.
|
|
250
|
+
* `null` on points-only labels. */
|
|
260
251
|
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
|
-
*/
|
|
252
|
+
/** Operator-defined custom data. The SDK auto-parses JSON-looking
|
|
253
|
+
* strings, so at runtime this is `any` despite the `string` type. */
|
|
266
254
|
custom_data: string;
|
|
267
|
-
/**
|
|
255
|
+
/** 1-based position in the ladder (matches the order of the returned
|
|
256
|
+
* array, which is sorted by `required_points` ASC). */
|
|
268
257
|
ordinal_position: number;
|
|
269
258
|
}
|
|
270
259
|
/**
|
|
271
|
-
* TLevelCurrent
|
|
260
|
+
* TLevelCurrent extends `TLevel` with the user's progress toward the next level.
|
|
261
|
+
* Returned by `_smartico.api.getCurrentLevel()`.
|
|
272
262
|
*/
|
|
273
263
|
export interface TLevelCurrent extends TLevel {
|
|
274
|
-
/**
|
|
264
|
+
/** Progress to the next level as a 0–100 integer percentage. `100`
|
|
265
|
+
* at the highest level. */
|
|
275
266
|
progress: number;
|
|
276
267
|
}
|
|
277
268
|
/**
|
|
@@ -300,7 +291,7 @@ export interface TTournament {
|
|
|
300
291
|
segment_dont_match_message: string;
|
|
301
292
|
/**
|
|
302
293
|
* 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
|
|
294
|
+
* The list of custom sections can be retrieved using _smartico.api.getCustomSections() method
|
|
304
295
|
*/
|
|
305
296
|
custom_section_id: number;
|
|
306
297
|
/** The custom data of the tournament defined by operator. Can be a JSON object, string or number */
|
|
@@ -535,13 +526,17 @@ export interface TClan {
|
|
|
535
526
|
member_count: number;
|
|
536
527
|
/** Max number of members allowed in clan */
|
|
537
528
|
capacity_limit: number;
|
|
538
|
-
/**
|
|
529
|
+
/** Currency type for `entry_fee_amount`. `0` = points, `1` = gems,
|
|
530
|
+
* `2` = diamonds, `3` = free (no fee). */
|
|
539
531
|
entry_fee_currency_type_id: number;
|
|
540
|
-
/**
|
|
532
|
+
/** Entry fee amount in the currency indicated by `entry_fee_currency_type_id`.
|
|
533
|
+
* `0` (or `entry_fee_currency_type_id === 3`) means the clan is free to join. */
|
|
541
534
|
entry_fee_amount: number;
|
|
542
|
-
/**
|
|
535
|
+
/** Global rank among all active clans in the label, by `rating_score` DESC.
|
|
536
|
+
* `1` = highest-rated. May skip positions when some clans are hidden by
|
|
537
|
+
* per-user visibility (e.g. user sees positions 1, 3, 7). */
|
|
543
538
|
rating_position: number;
|
|
544
|
-
/** Clan rating score */
|
|
539
|
+
/** Clan rating score (higher is better). */
|
|
545
540
|
rating_score: number;
|
|
546
541
|
}
|
|
547
542
|
/**
|
|
@@ -552,45 +547,83 @@ export interface TClans {
|
|
|
552
547
|
clans: TClan[];
|
|
553
548
|
/** The clan ID the current user belongs to; null if clanless */
|
|
554
549
|
user_clan_id: number | null;
|
|
555
|
-
/**
|
|
550
|
+
/** Switch-cooldown expiry as ISO 8601 UTC string ("YYYY-MM-DDTHH:MM:SS"
|
|
551
|
+
* with no timezone suffix; interpret as UTC). `null` when no cooldown.
|
|
552
|
+
* User-level: while set, the user cannot join any clan. */
|
|
556
553
|
cooldown_until: string | null;
|
|
557
554
|
/** Epoch ms when the current user joined their clan; null if clanless */
|
|
558
555
|
join_date: number | null;
|
|
559
556
|
}
|
|
560
557
|
/**
|
|
561
558
|
* TClanInfo describes the detailed info of a single clan including its members.
|
|
559
|
+
* Returned by `_smartico.api.getClanInfo(clanId)`.
|
|
562
560
|
*/
|
|
563
561
|
export interface TClanInfo {
|
|
562
|
+
/** Clan ID. */
|
|
564
563
|
clan_id: number;
|
|
564
|
+
/** Translated clan metadata (name, description, image URL). */
|
|
565
565
|
public_meta: {
|
|
566
566
|
name: string;
|
|
567
567
|
description: string;
|
|
568
568
|
image_url: string;
|
|
569
569
|
};
|
|
570
|
+
/** Current number of members in clan. */
|
|
570
571
|
member_count: number;
|
|
572
|
+
/** Max number of members allowed in clan. */
|
|
571
573
|
capacity_limit: number;
|
|
574
|
+
/** Currency type for `entry_fee_amount`. `0` = points, `1` = gems,
|
|
575
|
+
* `2` = diamonds, `3` = free. */
|
|
572
576
|
entry_fee_currency_type_id: number;
|
|
577
|
+
/** Entry fee amount in the currency indicated by `entry_fee_currency_type_id`. */
|
|
573
578
|
entry_fee_amount: number;
|
|
579
|
+
/** Global rank among all active clans in the label, by `rating_score` DESC.
|
|
580
|
+
* `1` = highest-rated. */
|
|
574
581
|
rating_position: number;
|
|
582
|
+
/** Clan rating score (higher is better). */
|
|
575
583
|
rating_score: number;
|
|
584
|
+
/** User-level switch-cooldown expiry as ISO 8601 UTC string
|
|
585
|
+
* ("YYYY-MM-DDTHH:MM:SS" with no timezone suffix). `null` when no
|
|
586
|
+
* cooldown. Same semantic as `TClans.cooldown_until` but always fresh
|
|
587
|
+
* (the list version may be up to 30 s stale). */
|
|
576
588
|
cooldown_until: string | null;
|
|
589
|
+
/** Members of this clan, server-ordered by `contribution_score` DESC
|
|
590
|
+
* (i.e. `position` ASC). */
|
|
577
591
|
members: {
|
|
592
|
+
/** Member's internal user ID. */
|
|
578
593
|
user_id: number;
|
|
594
|
+
/** Member's display username. */
|
|
579
595
|
public_username: string;
|
|
596
|
+
/** Avatar identifier; resolve via `avatar_url` below or rebuild
|
|
597
|
+
* from `avatar_id` + brand avatar domain. */
|
|
580
598
|
avatar_id: string;
|
|
599
|
+
/** Numeric avatar ID (alternative identifier). */
|
|
581
600
|
avatar_real_id: number;
|
|
601
|
+
/** Pre-resolved CDN URL for the avatar. */
|
|
582
602
|
avatar_url?: string;
|
|
603
|
+
/** Member's rank within this clan; `1` = top contributor. */
|
|
583
604
|
position: number;
|
|
605
|
+
/** Member's contribution to the clan rating score. */
|
|
584
606
|
contribution_score: number;
|
|
607
|
+
/** `true` when this row is the current authenticated user. */
|
|
585
608
|
is_me?: boolean;
|
|
609
|
+
/** External user identifier (operator-provided alias);
|
|
610
|
+
* preferred over `public_username` on some surfaces. */
|
|
586
611
|
clean_ext_user_id?: string;
|
|
587
612
|
}[];
|
|
588
613
|
}
|
|
589
614
|
/**
|
|
590
|
-
* TClanJoinResult describes the result of a join
|
|
615
|
+
* TClanJoinResult describes the result of a join-clan request.
|
|
616
|
+
* Note: this type uses `errCode` / `errMsg` (camelCase) — different
|
|
617
|
+
* from most other SDK result types in this library which use
|
|
618
|
+
* `err_code` / `err_message` (snake_case).
|
|
591
619
|
*/
|
|
592
620
|
export interface TClanJoinResult {
|
|
621
|
+
/** Error code. `0` = success. Typed values are members of
|
|
622
|
+
* {@link JoinClanErrorCode}. See `joinClan` TSDoc for the full
|
|
623
|
+
* table and per-code UI guidance. */
|
|
593
624
|
errCode: number;
|
|
625
|
+
/** Optional server-side error message. Present only on non-zero
|
|
626
|
+
* `errCode`; may be empty even then. */
|
|
594
627
|
errMsg: string;
|
|
595
628
|
}
|
|
596
629
|
/**
|
|
@@ -645,7 +678,9 @@ export interface TStoreItem {
|
|
|
645
678
|
can_buy: boolean;
|
|
646
679
|
/** The list of IDs of the categories where the store item is assigned, information about categories can be retrieved with getStoreCategories method */
|
|
647
680
|
category_ids: number[];
|
|
648
|
-
/**
|
|
681
|
+
/** Items remaining in the pool available for purchase. `null` = unlimited
|
|
682
|
+
* supply. Positive integer = remaining stock. `0` = sold out but still
|
|
683
|
+
* returned (operator may instead hide pool-empty items entirely). */
|
|
649
684
|
pool?: number;
|
|
650
685
|
/** The custom data of the store item defined by operator. Can be a JSON object, string or number */
|
|
651
686
|
custom_data: any;
|
|
@@ -665,6 +700,8 @@ export interface TStoreItem {
|
|
|
665
700
|
purchase_type: 'points' | 'gems' | 'diamonds';
|
|
666
701
|
/** The date when the store item will be available till */
|
|
667
702
|
active_till_date?: number;
|
|
703
|
+
/** Should countdown timer be shown when `active_till_date` is present */
|
|
704
|
+
show_timer?: boolean;
|
|
668
705
|
/** The discounted price of the store item */
|
|
669
706
|
discounted_price?: number;
|
|
670
707
|
/** The ribbon of the discounted price. */
|
|
@@ -681,14 +718,24 @@ export interface TStoreItem {
|
|
|
681
718
|
cant_buy_message?: string;
|
|
682
719
|
}
|
|
683
720
|
/**
|
|
684
|
-
* TAchCategory describes
|
|
721
|
+
* TAchCategory describes a mission/badge category. Categories are
|
|
722
|
+
* operator-defined groupings, configured per-label by the brand operator,
|
|
723
|
+
* shared across BOTH missions and badges — the same list is returned for
|
|
724
|
+
* both entity types. A mission or badge can belong to **zero or more**
|
|
725
|
+
* categories (many-to-many) via its `category_ids: number[]` field on
|
|
726
|
+
* `TMissionOrBadge`.
|
|
727
|
+
*
|
|
728
|
+
* Returned by `_smartico.api.getAchCategories()`. See that method's TSDoc
|
|
729
|
+
* for translation, refresh, and rendering details.
|
|
685
730
|
*/
|
|
686
731
|
export interface TAchCategory {
|
|
687
|
-
/**ID of the
|
|
732
|
+
/** Stable numeric ID of the category. Used as the key when joining to
|
|
733
|
+
* `TMissionOrBadge.category_ids: number[]`. */
|
|
688
734
|
id: number;
|
|
689
|
-
/**
|
|
735
|
+
/** Display name of the category, pre-translated server-side. Never null. */
|
|
690
736
|
name: string;
|
|
691
|
-
/**
|
|
737
|
+
/** Relative display position (lower = appears first). Default 1 when the
|
|
738
|
+
* operator did not configure an explicit order. */
|
|
692
739
|
order: number;
|
|
693
740
|
}
|
|
694
741
|
/**
|
|
@@ -740,8 +787,8 @@ export interface TMissionOrBadge {
|
|
|
740
787
|
/** The text of the CTA button, e.g. 'Make a deposit' */
|
|
741
788
|
cta_text: string;
|
|
742
789
|
/**
|
|
743
|
-
* The ID of the custom section where the mission or badge is assigned
|
|
744
|
-
*
|
|
790
|
+
* The ID of the custom section where the mission or badge is assigned.
|
|
791
|
+
* Resolve to section metadata via `_smartico.api.getCustomSections()`.
|
|
745
792
|
*/
|
|
746
793
|
custom_section_id: number;
|
|
747
794
|
/** 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 +807,8 @@ export interface TMissionOrBadge {
|
|
|
760
807
|
position?: number;
|
|
761
808
|
/** 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
809
|
ribbon?: TRibbon;
|
|
763
|
-
/**
|
|
810
|
+
/** Stable identifier of this specific mission completion. Undefined for
|
|
811
|
+
* badges and for missions that have not yet completed. */
|
|
764
812
|
ach_completed_id?: number;
|
|
765
813
|
/** Flag from achievement if the mission prize will be given only after user claims it */
|
|
766
814
|
requires_prize_claim?: boolean;
|
|
@@ -844,43 +892,47 @@ export interface TMissionOrBadgeTask {
|
|
|
844
892
|
execution_count_actual?: number;
|
|
845
893
|
}
|
|
846
894
|
/**
|
|
847
|
-
*
|
|
895
|
+
* Response of `_smartico.api.requestMissionOptIn(mission_id)`.
|
|
896
|
+
*
|
|
897
|
+
* See `requestMissionOptIn` TSDoc for the full table of `err_code` values
|
|
898
|
+
* and recommended UI handling.
|
|
848
899
|
*/
|
|
849
900
|
export interface TMissionOptInResult {
|
|
850
|
-
/** Error code
|
|
901
|
+
/** Error code. `0` = success. See `requestMissionOptIn` TSDoc for the full table. */
|
|
851
902
|
err_code: number;
|
|
852
|
-
/** Optional error message */
|
|
903
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
853
904
|
err_message: string;
|
|
854
905
|
}
|
|
855
906
|
/**
|
|
856
|
-
*
|
|
907
|
+
* Response of `_smartico.api.requestMissionClaimReward(mission_id, ach_completed_id)`.
|
|
908
|
+
*
|
|
909
|
+
* See `requestMissionClaimReward` TSDoc for the full table of `err_code`
|
|
910
|
+
* values, preconditions, side effects, and recommended UI handling.
|
|
857
911
|
*/
|
|
858
912
|
export interface TMissionClaimRewardResult {
|
|
859
|
-
/** Error code
|
|
913
|
+
/** Error code. `0` = success (rewards credited). See `requestMissionClaimReward` TSDoc for the full table. */
|
|
860
914
|
err_code: number;
|
|
861
|
-
/** Optional error message */
|
|
915
|
+
/** Optional error message; populated on non-zero `err_code`. */
|
|
862
916
|
err_message: string;
|
|
863
917
|
}
|
|
864
918
|
export interface TTournamentRegistrationResult {
|
|
865
|
-
/** Error code
|
|
919
|
+
/** Error code. `0` = success (registration persisted, buy-in
|
|
920
|
+
* deducted). Typed values are members of {@link TournamentRegistrationError};
|
|
921
|
+
* numeric codes `300010` (insufficient gems) and `300011` (insufficient
|
|
922
|
+
* diamonds) may also be returned and are NOT currently in the enum.
|
|
923
|
+
* See `registerInTournament` TSDoc for the full table. */
|
|
866
924
|
err_code: TournamentRegistrationError;
|
|
867
|
-
/** Optional error message
|
|
925
|
+
/** Optional error message. Present only on non-zero `err_code`;
|
|
926
|
+
* may be empty even then. */
|
|
868
927
|
err_message: string;
|
|
869
928
|
}
|
|
870
929
|
export interface TBuyStoreItemResult {
|
|
871
|
-
/** Error code
|
|
872
|
-
*
|
|
873
|
-
*
|
|
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
|
-
*/
|
|
930
|
+
/** Error code. `0` = success (funds debited and reward delivered).
|
|
931
|
+
* Typed values are the named codes in {@link BuyStoreItemErrorCode}.
|
|
932
|
+
* See `buyStoreItem` TSDoc for the full table and per-code UI guidance. */
|
|
882
933
|
err_code: BuyStoreItemErrorCode;
|
|
883
|
-
/** Optional error message
|
|
934
|
+
/** Optional server-side error message. Present only on non-zero
|
|
935
|
+
* `err_code`; may be empty even then. */
|
|
884
936
|
err_message: string;
|
|
885
937
|
}
|
|
886
938
|
export interface TGetTranslations {
|
|
@@ -967,10 +1019,18 @@ export interface LeaderBoardUserT {
|
|
|
967
1019
|
/** The indicator if the participant is current user */
|
|
968
1020
|
is_me: boolean;
|
|
969
1021
|
}
|
|
1022
|
+
/**
|
|
1023
|
+
* UserLevelExtraCountersT exposes the user's current values for the two
|
|
1024
|
+
* label-defined sliding-window level counters. Returned by
|
|
1025
|
+
* `_smartico.api.getUserLevelExtraCounters()`. Both fields are
|
|
1026
|
+
* `undefined` on points-only labels.
|
|
1027
|
+
*/
|
|
970
1028
|
export interface UserLevelExtraCountersT {
|
|
971
|
-
/**
|
|
1029
|
+
/** Current value of the user's first level counter. Operator-defined
|
|
1030
|
+
* semantics per label. `undefined` on points-only labels. */
|
|
972
1031
|
level_counter_1?: number;
|
|
973
|
-
/**
|
|
1032
|
+
/** Current value of the user's second level counter. Operator-defined
|
|
1033
|
+
* semantics per label. `undefined` on points-only labels. */
|
|
974
1034
|
level_counter_2?: number;
|
|
975
1035
|
}
|
|
976
1036
|
export interface TSegmentCheckResult {
|