@smartico/public-api 0.0.136 → 0.0.137

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.
Files changed (53) hide show
  1. package/dist/Jackpots/JackpotDetails.d.ts +16 -0
  2. package/dist/Jackpots/JackpotPot.d.ts +6 -0
  3. package/dist/Jackpots/JackpotPublicMeta.d.ts +7 -0
  4. package/dist/MiniGames/SAWTemplateUI.d.ts +2 -2
  5. package/dist/SmarticoAPI.d.ts +2 -2
  6. package/dist/SmarticoLib/index.d.ts +4 -2
  7. package/dist/WSAPI/WSAPI.d.ts +38 -13
  8. package/dist/WSAPI/WSAPITypes.d.ts +1 -0
  9. package/dist/index.js +70 -59
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.modern.mjs +43 -25
  12. package/dist/index.modern.mjs.map +1 -1
  13. package/docs/README.md +19 -1
  14. package/docs/classes/WSAPI.md +91 -11
  15. package/docs/enums/JackpotContributionType.md +13 -0
  16. package/docs/enums/JackpotType.md +7 -0
  17. package/docs/enums/LeaderBoardPeriodType.md +19 -0
  18. package/docs/enums/SAWGameTypeName.md +6 -0
  19. package/docs/interfaces/AchRelatedGame-1.md +28 -0
  20. package/docs/interfaces/AchRelatedGame.md +14 -12
  21. package/docs/interfaces/GetJackpotsPotsRequest.md +43 -0
  22. package/docs/interfaces/GetJackpotsPotsResponse.md +63 -0
  23. package/docs/interfaces/GetJackpotsRequest.md +49 -0
  24. package/docs/interfaces/GetJackpotsResponse.md +63 -0
  25. package/docs/interfaces/JackPotWinner.md +31 -0
  26. package/docs/interfaces/JackpotDetails.md +85 -0
  27. package/docs/interfaces/JackpotHtmlTemplate.md +13 -0
  28. package/docs/interfaces/JackpotPot.md +41 -0
  29. package/docs/interfaces/JackpotPublicMeta.md +57 -0
  30. package/docs/interfaces/JackpotWinPush.md +49 -0
  31. package/docs/interfaces/JackpotsOptinRequest.md +43 -0
  32. package/docs/interfaces/JackpotsOptinResponse.md +57 -0
  33. package/docs/interfaces/JackpotsOptoutRequest.md +43 -0
  34. package/docs/interfaces/JackpotsOptoutResponse.md +57 -0
  35. package/docs/interfaces/LeaderBoardDetailsT.md +1 -1
  36. package/docs/interfaces/TAchCategory.md +6 -0
  37. package/docs/interfaces/TMiniGameTemplate.md +2 -0
  38. package/docs/interfaces/TMissionOrBadge.md +6 -7
  39. package/docs/interfaces/TStoreCategory.md +6 -0
  40. package/docs/interfaces/TTournament.md +6 -0
  41. package/docs/interfaces/TTournamentDetailed.md +11 -1
  42. package/package.json +1 -1
  43. package/src/Base/AchRelatedGame.ts +3 -1
  44. package/src/Jackpots/JackpotDetails.ts +16 -0
  45. package/src/Jackpots/JackpotPot.ts +7 -1
  46. package/src/Jackpots/JackpotPublicMeta.ts +7 -0
  47. package/src/MiniGames/SAWTemplateUI.ts +2 -2
  48. package/src/SmarticoAPI.ts +6 -11
  49. package/src/SmarticoLib/index.ts +4 -2
  50. package/src/Tournaments/Tournament.ts +1 -0
  51. package/src/WSAPI/WSAPI.ts +38 -13
  52. package/src/WSAPI/WSAPITypes.ts +2 -0
  53. package/tsconfig.json +3 -0
@@ -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,16 @@ 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 store purchased items based on the provided parameters. "From" and "to" indicate the range of items to be fetched.
1242
- * The maximum number of messages per request is limited to 20.
1243
- * You can leave this params empty and by default it will return list of purchased items ranging from 0 to 20.
1244
- * This functions return list of purchased items.
1245
- * The "onUpdate" callback will be triggered when the user receives a new purchased item. It will provide an updated list of items, ranging from 0 to 20, to the onUpdate callback function. */
1246
- /**
1247
- * @param params
1242
+ /** Returns all the purchased store items available the current user
1243
+ * Example usage:
1244
+ * ```
1245
+ * _smartico.api.getStorePurchasedItems().then((result) => {
1246
+ * console.log(result);
1247
+ * });
1248
+ * ```
1248
1249
  */
1249
- async storeGetPurchasedItems({
1250
- from,
1251
- to,
1252
- onUpdate
1253
- } = {}) {
1254
- if (onUpdate) {
1255
- this.onUpdateCallback.set(onUpdateContextKey.StoreHistory, onUpdate);
1256
- }
1257
- return await this.api.storeGetPurchasedItemsT(null, from, to);
1250
+ async getStorePurchasedItems() {
1251
+ return OCache.use(onUpdateContextKey.StoreItems, ECacheContext.WSAPI, () => this.api.storeGetPurchasedItemsT(null), CACHE_DATA_SEC);
1258
1252
  }
1259
1253
  /** Returns missions & badges categories */
1260
1254
  async getAchCategories() {
@@ -1454,6 +1448,17 @@ class WSAPI {
1454
1448
  OCache.clear(ECacheContext.WSAPI, onUpdateContextKey.Jackpots);
1455
1449
  OCache.clear(ECacheContext.WSAPI, onUpdateContextKey.Pots);
1456
1450
  }
1451
+ /** Returns list of Jackpots that are active in the systen and matching to the filter definition.
1452
+ * If filter is not provided, all active jackpots will be returned.
1453
+ * Filter can be used to get jackpots related to specific game or specific jackpot template.
1454
+ * 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
1455
+ * Example usage:
1456
+ * ```
1457
+ * _smartico.api.jackpotGet({ related_game_id: 'wooko-slot' }).then((result) => {
1458
+ * console.log(result);
1459
+ * });
1460
+ * ```
1461
+ */
1457
1462
  async jackpotGet(filter) {
1458
1463
  var _this = this;
1459
1464
  const signature = `${filter == null ? void 0 : filter.jp_template_id}:${filter == null ? void 0 : filter.related_game_id}`;
@@ -1484,6 +1489,15 @@ class WSAPI {
1484
1489
  return _jp;
1485
1490
  });
1486
1491
  }
1492
+ /** Opt-in currently logged in user to the jackpot with the specified jp_template_id.
1493
+ * You may call jackpotGet method after doing optin to see that user is opted in to the jackpot.
1494
+ * Example usage:
1495
+ * ```
1496
+ * _smartico.api.jackpotOptIn({ jp_template_id: 123 }).then((result) => {
1497
+ * console.log('Opted in to the jackpot');
1498
+ * });
1499
+ * ```
1500
+ */
1487
1501
  async jackpotOptIn(filter) {
1488
1502
  if (!filter.jp_template_id) {
1489
1503
  throw new Error('jp_template_id is required in jackpotOptIn');
@@ -1492,6 +1506,15 @@ class WSAPI {
1492
1506
  this.jackpotClearCache();
1493
1507
  return result;
1494
1508
  }
1509
+ /** Opt-out currently logged in user from the jackpot with the specified jp_template_id.
1510
+ * You may call jackpotGet method after doing optout to see that user is not opted in to the jackpot.
1511
+ * Example usage:
1512
+ * ```
1513
+ * _smartico.api.jackpotOptOut({ jp_template_id: 123 }).then((result) => {
1514
+ * console.log('Opted out from the jackpot');
1515
+ * });
1516
+ * ```
1517
+ */
1495
1518
  async jackpotOptOut(filter) {
1496
1519
  if (!filter.jp_template_id) {
1497
1520
  throw new Error('jp_template_id is required in jackpotOptOut');
@@ -1883,17 +1906,12 @@ class SmarticoAPI {
1883
1906
  async storeGetCategoriesT(user_ext_id) {
1884
1907
  return StoreCategoryTransform((await this.storeGetCategories(user_ext_id)).categories);
1885
1908
  }
1886
- async storeGetPurchasedItems(user_ext_id, limit = 20, offset = 0) {
1887
- const message = this.buildMessage(user_ext_id, ClassId.ACH_SHOP_ITEM_HISTORY_REQUEST, {
1888
- limit,
1889
- offset
1890
- });
1909
+ async storeGetPurchasedItems(user_ext_id) {
1910
+ const message = this.buildMessage(user_ext_id, ClassId.ACH_SHOP_ITEM_HISTORY_REQUEST);
1891
1911
  return await this.send(message, ClassId.ACH_SHOP_ITEM_HISTORY_RESPONSE);
1892
1912
  }
1893
- async storeGetPurchasedItemsT(user_ext_id, from = 0, to = 20) {
1894
- const limit = to - from > 20 ? 20 : to - from;
1895
- const offset = from;
1896
- return StoreItemPurchasedTransform((await this.storeGetPurchasedItems(user_ext_id, limit, offset)).items);
1913
+ async storeGetPurchasedItemsT(user_ext_id) {
1914
+ return StoreItemPurchasedTransform((await this.storeGetPurchasedItems(user_ext_id)).items);
1897
1915
  }
1898
1916
  async missionsGetItems(user_ext_id) {
1899
1917
  const message = this.buildMessage(user_ext_id, ClassId.GET_ACHIEVEMENT_MAP_REQUEST);