@smartico/public-api 0.0.357 → 0.0.359
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/dist/WSAPI/WSAPI.d.ts +24 -19
- package/dist/index.js +27 -20
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +27 -20
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/README.md +58 -3
- package/docs/api/classes/WSAPI.md +24 -22
- package/docs/api/enums/AchievementStatus.md +49 -0
- package/docs/api/enums/AchievementTaskType.md +13 -0
- package/docs/api/enums/AchievementType.md +13 -0
- package/docs/api/enums/ActivityTypeLimited.md +115 -0
- package/docs/api/enums/BadgesTimeLimitStates.md +49 -0
- package/docs/api/enums/InboxMessageType.md +55 -0
- package/docs/api/enums/InboxReadStatus.md +13 -0
- package/docs/api/enums/OpenLinksType.md +13 -0
- package/docs/api/enums/ScheduledMissionType.md +19 -0
- package/docs/api/enums/StoreItemPurchaseType.md +19 -0
- package/docs/api/enums/StoreItemType.md +37 -0
- package/docs/api/enums/StoreItemTypeName.md +43 -0
- package/docs/api/enums/TournamentInstanceStatus.md +43 -0
- package/docs/api/enums/TournamentRegistrationError.md +55 -0
- package/docs/api/enums/TournamentType.md +19 -0
- package/docs/api/interfaces/AchievementTaskPublicMeta.md +35 -0
- package/docs/api/interfaces/AffectsProgress.md +25 -0
- package/docs/api/interfaces/Bonus.md +2 -2
- package/docs/api/interfaces/BonusMetaMap-1.md +9 -0
- package/docs/api/interfaces/BonusMetaMap.md +0 -2
- package/docs/api/interfaces/BonusTemplateMetaMap-1.md +33 -0
- package/docs/api/interfaces/BonusTemplateMetaMap.md +0 -8
- package/docs/api/interfaces/GetCustomSectionsResponse.md +67 -0
- package/docs/api/interfaces/GetRelatedAchTourResponse.md +69 -0
- package/docs/api/interfaces/InboxMessageBody.md +2 -2
- package/docs/api/interfaces/StoreItem.md +2 -2
- package/docs/api/interfaces/StoreItemPublicMeta.md +127 -0
- package/docs/api/interfaces/TBonus.md +2 -2
- package/docs/api/interfaces/TMissionOrBadge.md +1 -1
- package/docs/api/interfaces/TTournamentRegistrationResult.md +1 -1
- package/docs/api/interfaces/Tournament.md +3 -3
- package/docs/api/interfaces/TournamentPrize.md +1 -1
- package/docs/api/interfaces/TournamentPublicMeta.md +115 -0
- package/docs/api/interfaces/UserAchievement.md +4 -4
- package/docs/api/interfaces/UserAchievementTask.md +3 -3
- package/package.json +1 -1
- package/src/Missions/MissionsUtils.ts +6 -3
- package/src/SmarticoAPI.ts +1 -1
- package/src/WSAPI/WSAPI.ts +29 -23
- package/tsconfig.json +23 -1
package/dist/index.modern.mjs
CHANGED
|
@@ -1207,6 +1207,8 @@ var BadgesTimeLimitStates;
|
|
|
1207
1207
|
})(BadgesTimeLimitStates || (BadgesTimeLimitStates = {}));
|
|
1208
1208
|
|
|
1209
1209
|
var _MissionUtils;
|
|
1210
|
+
const USER_STATE_PARAMS_KEYS_GAMES = ['core_fav_game_top3', 'core_fav_game_type_top3', 'core_fav_game_provider_top3'];
|
|
1211
|
+
const USER_STATE_PARAMS_KEYS_BET_AMOUNT = ['core_recommended_deposit_amount', 'core_recommended_casino_bet_amount', 'casino_last_bet_amount', 'casino_last_bet_amount_real', 'casino_last_bet_amount_bonus', 'acc_last_deposit_amount'];
|
|
1210
1212
|
class MissionUtils {}
|
|
1211
1213
|
_MissionUtils = MissionUtils;
|
|
1212
1214
|
MissionUtils.getAvailabilityStatus = mission => {
|
|
@@ -1376,7 +1378,7 @@ MissionUtils.replaceTagsFavMissionTask = ({
|
|
|
1376
1378
|
userStateParamsKeys.forEach(k => {
|
|
1377
1379
|
var _userStateOperator$k;
|
|
1378
1380
|
const operator = (_userStateOperator$k = userStateOperator[k]) == null ? void 0 : _userStateOperator$k.op;
|
|
1379
|
-
if (k
|
|
1381
|
+
if (USER_STATE_PARAMS_KEYS_GAMES.includes(k)) {
|
|
1380
1382
|
if (operatorsMulti.includes(operator)) {
|
|
1381
1383
|
var _userStateParams$k;
|
|
1382
1384
|
const value = (_userStateParams$k = userStateParams[k]) == null ? void 0 : _userStateParams$k.filter(v => Boolean(v));
|
|
@@ -1399,7 +1401,7 @@ MissionUtils.replaceTagsFavMissionTask = ({
|
|
|
1399
1401
|
}
|
|
1400
1402
|
}
|
|
1401
1403
|
}
|
|
1402
|
-
if (k
|
|
1404
|
+
if (USER_STATE_PARAMS_KEYS_BET_AMOUNT.includes(k)) {
|
|
1403
1405
|
suggestedValue = userStateParams[k];
|
|
1404
1406
|
if (suggestedValue) {
|
|
1405
1407
|
const currencyFromTheTask = userStateParams == null ? void 0 : userStateParams.core_wallet_currency;
|
|
@@ -2260,7 +2262,7 @@ class WSAPI {
|
|
|
2260
2262
|
* Pay attention that this method is synchronous and returns the user profile object immediately, not a promise.
|
|
2261
2263
|
* **Example**:
|
|
2262
2264
|
* ```
|
|
2263
|
-
* var p = _smartico.api.getUserProfile);
|
|
2265
|
+
* var p = _smartico.api.getUserProfile();
|
|
2264
2266
|
* console.log(p);
|
|
2265
2267
|
* ```
|
|
2266
2268
|
* **Visitor mode: not supported**
|
|
@@ -2304,7 +2306,7 @@ class WSAPI {
|
|
|
2304
2306
|
async checkSegmentListMatch(segment_ids) {
|
|
2305
2307
|
return await this.api.coreCheckSegments(this.userExtId, Array.isArray(segment_ids) ? segment_ids : [segment_ids]);
|
|
2306
2308
|
}
|
|
2307
|
-
/** Returns all the levels available the current user
|
|
2309
|
+
/** Returns all the levels available to the current user
|
|
2308
2310
|
* **Example**:
|
|
2309
2311
|
* ```
|
|
2310
2312
|
* _smartico.api.getLevels().then((result) => {
|
|
@@ -2365,7 +2367,7 @@ class WSAPI {
|
|
|
2365
2367
|
return OCache.use(onUpdateContextKey.Missions, ECacheContext.WSAPI, () => this.api.missionsGetItemsT(this.userExtId), CACHE_DATA_SEC);
|
|
2366
2368
|
}
|
|
2367
2369
|
/**
|
|
2368
|
-
* Returns all the badges available the current user
|
|
2370
|
+
* Returns all the badges available to the current user
|
|
2369
2371
|
*
|
|
2370
2372
|
* **Visitor mode: not supported**
|
|
2371
2373
|
*/
|
|
@@ -2374,7 +2376,7 @@ class WSAPI {
|
|
|
2374
2376
|
}
|
|
2375
2377
|
/**
|
|
2376
2378
|
* Returns all the bonuses for the current user
|
|
2377
|
-
* The returned
|
|
2379
|
+
* The returned bonuses are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
|
|
2378
2380
|
* Note that each time you call getBonuses with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
2379
2381
|
* The onUpdate callback will be called on bonus claimed and the updated bonuses will be passed to it.
|
|
2380
2382
|
*
|
|
@@ -2407,7 +2409,7 @@ class WSAPI {
|
|
|
2407
2409
|
}
|
|
2408
2410
|
/**
|
|
2409
2411
|
* Returns the extra counters for the current user level.
|
|
2410
|
-
* These are counters that are configured for each Smartico client
|
|
2412
|
+
* These are counters that are configured for each Smartico client separately by request.
|
|
2411
2413
|
* For example 1st counter could be total wagering amount, 2nd counter could be total deposit amount, etc.
|
|
2412
2414
|
*
|
|
2413
2415
|
* **Example**:
|
|
@@ -2424,7 +2426,7 @@ class WSAPI {
|
|
|
2424
2426
|
}
|
|
2425
2427
|
/**
|
|
2426
2428
|
*
|
|
2427
|
-
* Returns all the store items available the current user
|
|
2429
|
+
* Returns all the store items available to the current user
|
|
2428
2430
|
* The returned store items are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
|
|
2429
2431
|
* Note that each time you call getStoreItems with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
2430
2432
|
* The onUpdate callback will be called on purchase of the store item.
|
|
@@ -2564,7 +2566,7 @@ class WSAPI {
|
|
|
2564
2566
|
/**
|
|
2565
2567
|
* Returns the list of mini-games configured for the current user (not filtered by spin availability or Widget visibility).
|
|
2566
2568
|
* The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getMiniGames with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
2567
|
-
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or
|
|
2569
|
+
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or won prize is spin/jackpot and if max count of the available user spins equals one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback.
|
|
2568
2570
|
*
|
|
2569
2571
|
* **Example**:
|
|
2570
2572
|
* ```
|
|
@@ -2614,7 +2616,7 @@ class WSAPI {
|
|
|
2614
2616
|
/**
|
|
2615
2617
|
* Plays the specified by template_id mini-game on behalf of user and returns prize_id or err_code
|
|
2616
2618
|
* After playMiniGame is called, you can call getMiniGames to get the list of mini-games.The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call playMiniGame with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
2617
|
-
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or
|
|
2619
|
+
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or won prize is spin/jackpot and if max count of the available user spins equals one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback.
|
|
2618
2620
|
*
|
|
2619
2621
|
* **Example**:
|
|
2620
2622
|
* ```
|
|
@@ -2655,7 +2657,7 @@ class WSAPI {
|
|
|
2655
2657
|
/**
|
|
2656
2658
|
* Plays the specified by template_id mini-game on behalf of user spin_count times and returns array of the prizes
|
|
2657
2659
|
* After playMiniGameBatch is called, you can call getMiniGames to get the list of mini-games. The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call playMiniGameBatch with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
2658
|
-
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or
|
|
2660
|
+
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or won prize is spin/jackpot and if max count of the available user spins equals one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback.
|
|
2659
2661
|
*
|
|
2660
2662
|
* **Example**:
|
|
2661
2663
|
* ```
|
|
@@ -2736,7 +2738,7 @@ class WSAPI {
|
|
|
2736
2738
|
return OCache.use(onUpdateContextKey.TournamentList, ECacheContext.WSAPI, () => this.api.tournamentsGetLobbyT(this.userExtId), CACHE_DATA_SEC);
|
|
2737
2739
|
}
|
|
2738
2740
|
/**
|
|
2739
|
-
* Returns
|
|
2741
|
+
* Returns detailed information for a specific tournament instance; the response includes tournament info and the leaderboard of players
|
|
2740
2742
|
*
|
|
2741
2743
|
* **Example**:
|
|
2742
2744
|
* ```
|
|
@@ -2802,7 +2804,7 @@ class WSAPI {
|
|
|
2802
2804
|
* An indicator "onlyFavorite" can be passed to get only messages marked as favorites.
|
|
2803
2805
|
* An indicator "read_status" can be passed to get only messages marked as read or unread.
|
|
2804
2806
|
* You can leave this params empty and by default it will return list of messages ranging from 0 to 20.
|
|
2805
|
-
* This
|
|
2807
|
+
* This function returns a list of messages without the body of each message.
|
|
2806
2808
|
* To get the body of the message you need to call getInboxMessageBody function and pass the message guid contained in each message of this request.
|
|
2807
2809
|
* All other action like mark as read, favorite, delete, etc. can be done using this message GUID.
|
|
2808
2810
|
* The "onUpdate" callback will be triggered when the user receives a new message. It will provide an updated list of messages, ranging from 0 to 20, to the onUpdate callback function.
|
|
@@ -2859,7 +2861,7 @@ class WSAPI {
|
|
|
2859
2861
|
};
|
|
2860
2862
|
}
|
|
2861
2863
|
/**
|
|
2862
|
-
* Requests to mark all inbox messages as
|
|
2864
|
+
* Requests to mark all inbox messages as read
|
|
2863
2865
|
*
|
|
2864
2866
|
* **Visitor mode: not supported**
|
|
2865
2867
|
*/
|
|
@@ -2949,7 +2951,7 @@ class WSAPI {
|
|
|
2949
2951
|
* ```
|
|
2950
2952
|
* _smartico.api.reportClickEvent({
|
|
2951
2953
|
* engagement_uid: 'abc123-def456',
|
|
2952
|
-
* activityType: 31 // Inbox
|
|
2954
|
+
* activityType: 31 // Inbox
|
|
2953
2955
|
* action: 'dp:gf_missions'
|
|
2954
2956
|
* });
|
|
2955
2957
|
* ```
|
|
@@ -3431,7 +3433,7 @@ class WSAPI {
|
|
|
3431
3433
|
OCache.clear(ECacheContext.WSAPI, onUpdateContextKey.Pots);
|
|
3432
3434
|
OCache.clear(ECacheContext.WSAPI, onUpdateContextKey.JackpotWinners);
|
|
3433
3435
|
}
|
|
3434
|
-
/** Returns list of Jackpots that are active in the
|
|
3436
|
+
/** Returns list of Jackpots that are active in the system and matching to the filter definition.
|
|
3435
3437
|
* If filter is not provided, all active jackpots will be returned.
|
|
3436
3438
|
* Filter can be used to get jackpots related to specific game or specific jackpot template.
|
|
3437
3439
|
* You can call this method every second in order to get up to date information about current value of the jackpot(s) and present them to the end-users
|
|
@@ -3526,7 +3528,9 @@ class WSAPI {
|
|
|
3526
3528
|
return result;
|
|
3527
3529
|
}
|
|
3528
3530
|
/**
|
|
3529
|
-
* Returns
|
|
3531
|
+
* Returns jackpot winners for the given `jp_template_id` (paginated on the server).
|
|
3532
|
+
* Default page size on the wire is 20; use `limit`, `offset`, and repeated calls to load more.
|
|
3533
|
+
* The full protocol response also includes `has_more`; this method returns only the `winners` array.
|
|
3530
3534
|
*
|
|
3531
3535
|
* **Example**:
|
|
3532
3536
|
* ```
|
|
@@ -3539,6 +3543,9 @@ class WSAPI {
|
|
|
3539
3543
|
*
|
|
3540
3544
|
* **Visitor mode: not supported**
|
|
3541
3545
|
*
|
|
3546
|
+
* @param params.jp_template_id - Jackpot template id (required; throws if missing)
|
|
3547
|
+
* @param params.limit - Page size (server default 20 when omitted)
|
|
3548
|
+
* @param params.offset - Offset into the winner list
|
|
3542
3549
|
*/
|
|
3543
3550
|
async getJackpotWinners({
|
|
3544
3551
|
limit,
|
|
@@ -3659,7 +3666,7 @@ class WSAPI {
|
|
|
3659
3666
|
* **Example**:
|
|
3660
3667
|
*
|
|
3661
3668
|
* ```javascript
|
|
3662
|
-
* _smartico.api.
|
|
3669
|
+
* _smartico.api.getRaffleDrawRunsHistory({ raffle_id: 156, draw_id: 432 }).then((result) => {
|
|
3663
3670
|
* console.log(result);
|
|
3664
3671
|
* });
|
|
3665
3672
|
* ```
|
|
@@ -3667,7 +3674,7 @@ class WSAPI {
|
|
|
3667
3674
|
* **Example in the Visitor mode**:
|
|
3668
3675
|
*
|
|
3669
3676
|
* ```javascript
|
|
3670
|
-
* _smartico.vapi('EN').
|
|
3677
|
+
* _smartico.vapi('EN').getRaffleDrawRunsHistory({ raffle_id: 156, draw_id: 432 }).then((result) => {
|
|
3671
3678
|
* console.log(result);
|
|
3672
3679
|
* });
|
|
3673
3680
|
* ```
|
|
@@ -3681,7 +3688,7 @@ class WSAPI {
|
|
|
3681
3688
|
return drawRunHistoryTransform(res);
|
|
3682
3689
|
}
|
|
3683
3690
|
/**
|
|
3684
|
-
* Returns
|
|
3691
|
+
* Returns `err_code` and `err_message` after the call; `err_code` 0 means the request succeeded.
|
|
3685
3692
|
*
|
|
3686
3693
|
*
|
|
3687
3694
|
* **Example**:
|