@smartico/public-api 0.0.136 → 0.0.138
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/Jackpots/JackpotDetails.d.ts +16 -0
- package/dist/Jackpots/JackpotPot.d.ts +6 -0
- package/dist/Jackpots/JackpotPublicMeta.d.ts +7 -0
- package/dist/MiniGames/SAWTemplateUI.d.ts +2 -2
- package/dist/SmarticoAPI.d.ts +1 -1
- package/dist/SmarticoLib/index.d.ts +4 -2
- package/dist/Store/GetStoreHistoryRequest.d.ts +1 -1
- package/dist/Store/GetStoreHistoryResponse.d.ts +1 -1
- package/dist/WSAPI/WSAPI.d.ts +42 -11
- package/dist/WSAPI/WSAPITypes.d.ts +1 -0
- package/dist/index.js +51 -22
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +43 -13
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +19 -1
- package/docs/classes/WSAPI.md +93 -11
- package/docs/enums/JackpotContributionType.md +13 -0
- package/docs/enums/JackpotType.md +7 -0
- package/docs/enums/LeaderBoardPeriodType.md +19 -0
- package/docs/enums/SAWGameTypeName.md +6 -0
- package/docs/interfaces/AchRelatedGame-1.md +28 -0
- package/docs/interfaces/AchRelatedGame.md +14 -12
- package/docs/interfaces/GetJackpotsPotsRequest.md +43 -0
- package/docs/interfaces/GetJackpotsPotsResponse.md +63 -0
- package/docs/interfaces/GetJackpotsRequest.md +49 -0
- package/docs/interfaces/GetJackpotsResponse.md +63 -0
- package/docs/interfaces/JackPotWinner.md +31 -0
- package/docs/interfaces/JackpotDetails.md +85 -0
- package/docs/interfaces/JackpotHtmlTemplate.md +13 -0
- package/docs/interfaces/JackpotPot.md +41 -0
- package/docs/interfaces/JackpotPublicMeta.md +57 -0
- package/docs/interfaces/JackpotWinPush.md +49 -0
- package/docs/interfaces/JackpotsOptinRequest.md +43 -0
- package/docs/interfaces/JackpotsOptinResponse.md +57 -0
- package/docs/interfaces/JackpotsOptoutRequest.md +43 -0
- package/docs/interfaces/JackpotsOptoutResponse.md +57 -0
- package/docs/interfaces/LeaderBoardDetailsT.md +1 -1
- package/docs/interfaces/TAchCategory.md +6 -0
- package/docs/interfaces/TMiniGameTemplate.md +2 -0
- package/docs/interfaces/TMissionOrBadge.md +6 -7
- package/docs/interfaces/TStoreCategory.md +6 -0
- package/docs/interfaces/TTournament.md +6 -0
- package/docs/interfaces/TTournamentDetailed.md +11 -1
- package/package.json +1 -1
- package/src/Base/AchRelatedGame.ts +3 -1
- package/src/Jackpots/JackpotDetails.ts +16 -0
- package/src/Jackpots/JackpotPot.ts +7 -1
- package/src/Jackpots/JackpotPublicMeta.ts +7 -0
- package/src/MiniGames/SAWTemplateUI.ts +2 -2
- package/src/SmarticoAPI.ts +5 -6
- package/src/SmarticoLib/index.ts +4 -2
- package/src/Store/GetStoreHistoryRequest.ts +1 -1
- package/src/Store/GetStoreHistoryResponse.ts +1 -1
- package/src/Tournaments/Tournament.ts +1 -0
- package/src/WSAPI/WSAPI.ts +42 -13
- package/src/WSAPI/WSAPITypes.ts +2 -0
- package/tsconfig.json +3 -0
package/dist/index.modern.mjs
CHANGED
|
@@ -874,6 +874,7 @@ const TournamentItemsTransform = items => {
|
|
|
874
874
|
segment_dont_match_message: r.publicMeta.segment_dont_match_message,
|
|
875
875
|
image1: r.publicMeta.image_url,
|
|
876
876
|
image2: r.publicMeta.image_url2,
|
|
877
|
+
image2_mobile: r.publicMeta.image_url2_mobile,
|
|
877
878
|
prize_pool_short: r.publicMeta.prize_pool_short,
|
|
878
879
|
custom_price_text: r.publicMeta.custom_price_text,
|
|
879
880
|
custom_section_id: r.publicMeta.custom_section_id,
|
|
@@ -1238,23 +1239,25 @@ class WSAPI {
|
|
|
1238
1239
|
async getStoreCategories() {
|
|
1239
1240
|
return OCache.use(onUpdateContextKey.StoreCategories, ECacheContext.WSAPI, () => this.api.storeGetCategoriesT(null), CACHE_DATA_SEC);
|
|
1240
1241
|
}
|
|
1241
|
-
/** Returns
|
|
1242
|
-
* The maximum number of
|
|
1242
|
+
/** Returns purchased items based on the provided parameters. "Limit" and "offset" indicate the range of items to be fetched.
|
|
1243
|
+
* The maximum number of items per request is limited to 20.
|
|
1243
1244
|
* You can leave this params empty and by default it will return list of purchased items ranging from 0 to 20.
|
|
1244
|
-
*
|
|
1245
|
-
*
|
|
1246
|
-
|
|
1247
|
-
*
|
|
1245
|
+
* Example usage:
|
|
1246
|
+
* ```
|
|
1247
|
+
* _smartico.api.getStorePurchasedItems().then((result) => {
|
|
1248
|
+
* console.log(result);
|
|
1249
|
+
* });
|
|
1250
|
+
* ```
|
|
1248
1251
|
*/
|
|
1249
|
-
async
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
+
async getStorePurchasedItems({
|
|
1253
|
+
limit,
|
|
1254
|
+
offset,
|
|
1252
1255
|
onUpdate
|
|
1253
1256
|
} = {}) {
|
|
1254
1257
|
if (onUpdate) {
|
|
1255
1258
|
this.onUpdateCallback.set(onUpdateContextKey.StoreHistory, onUpdate);
|
|
1256
1259
|
}
|
|
1257
|
-
return
|
|
1260
|
+
return OCache.use(onUpdateContextKey.StoreHistory, ECacheContext.WSAPI, () => this.api.storeGetPurchasedItemsT(null, limit, offset), CACHE_DATA_SEC);
|
|
1258
1261
|
}
|
|
1259
1262
|
/** Returns missions & badges categories */
|
|
1260
1263
|
async getAchCategories() {
|
|
@@ -1454,6 +1457,17 @@ class WSAPI {
|
|
|
1454
1457
|
OCache.clear(ECacheContext.WSAPI, onUpdateContextKey.Jackpots);
|
|
1455
1458
|
OCache.clear(ECacheContext.WSAPI, onUpdateContextKey.Pots);
|
|
1456
1459
|
}
|
|
1460
|
+
/** Returns list of Jackpots that are active in the systen and matching to the filter definition.
|
|
1461
|
+
* If filter is not provided, all active jackpots will be returned.
|
|
1462
|
+
* Filter can be used to get jackpots related to specific game or specific jackpot template.
|
|
1463
|
+
* 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
|
|
1464
|
+
* Example usage:
|
|
1465
|
+
* ```
|
|
1466
|
+
* _smartico.api.jackpotGet({ related_game_id: 'wooko-slot' }).then((result) => {
|
|
1467
|
+
* console.log(result);
|
|
1468
|
+
* });
|
|
1469
|
+
* ```
|
|
1470
|
+
*/
|
|
1457
1471
|
async jackpotGet(filter) {
|
|
1458
1472
|
var _this = this;
|
|
1459
1473
|
const signature = `${filter == null ? void 0 : filter.jp_template_id}:${filter == null ? void 0 : filter.related_game_id}`;
|
|
@@ -1484,6 +1498,15 @@ class WSAPI {
|
|
|
1484
1498
|
return _jp;
|
|
1485
1499
|
});
|
|
1486
1500
|
}
|
|
1501
|
+
/** Opt-in currently logged in user to the jackpot with the specified jp_template_id.
|
|
1502
|
+
* You may call jackpotGet method after doing optin to see that user is opted in to the jackpot.
|
|
1503
|
+
* Example usage:
|
|
1504
|
+
* ```
|
|
1505
|
+
* _smartico.api.jackpotOptIn({ jp_template_id: 123 }).then((result) => {
|
|
1506
|
+
* console.log('Opted in to the jackpot');
|
|
1507
|
+
* });
|
|
1508
|
+
* ```
|
|
1509
|
+
*/
|
|
1487
1510
|
async jackpotOptIn(filter) {
|
|
1488
1511
|
if (!filter.jp_template_id) {
|
|
1489
1512
|
throw new Error('jp_template_id is required in jackpotOptIn');
|
|
@@ -1492,6 +1515,15 @@ class WSAPI {
|
|
|
1492
1515
|
this.jackpotClearCache();
|
|
1493
1516
|
return result;
|
|
1494
1517
|
}
|
|
1518
|
+
/** Opt-out currently logged in user from the jackpot with the specified jp_template_id.
|
|
1519
|
+
* You may call jackpotGet method after doing optout to see that user is not opted in to the jackpot.
|
|
1520
|
+
* Example usage:
|
|
1521
|
+
* ```
|
|
1522
|
+
* _smartico.api.jackpotOptOut({ jp_template_id: 123 }).then((result) => {
|
|
1523
|
+
* console.log('Opted out from the jackpot');
|
|
1524
|
+
* });
|
|
1525
|
+
* ```
|
|
1526
|
+
*/
|
|
1495
1527
|
async jackpotOptOut(filter) {
|
|
1496
1528
|
if (!filter.jp_template_id) {
|
|
1497
1529
|
throw new Error('jp_template_id is required in jackpotOptOut');
|
|
@@ -1890,9 +1922,7 @@ class SmarticoAPI {
|
|
|
1890
1922
|
});
|
|
1891
1923
|
return await this.send(message, ClassId.ACH_SHOP_ITEM_HISTORY_RESPONSE);
|
|
1892
1924
|
}
|
|
1893
|
-
async storeGetPurchasedItemsT(user_ext_id,
|
|
1894
|
-
const limit = to - from > 20 ? 20 : to - from;
|
|
1895
|
-
const offset = from;
|
|
1925
|
+
async storeGetPurchasedItemsT(user_ext_id, limit, offset) {
|
|
1896
1926
|
return StoreItemPurchasedTransform((await this.storeGetPurchasedItems(user_ext_id, limit, offset)).items);
|
|
1897
1927
|
}
|
|
1898
1928
|
async missionsGetItems(user_ext_id) {
|