@smartico/public-api 0.0.105 → 0.0.107

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/README.md CHANGED
@@ -43,7 +43,8 @@ See the [API documentation](docs/classes/WSAPI.md) for all available methods and
43
43
 
44
44
  ## Backend usage (NodeJS context)
45
45
 
46
- Note: access to the API is not provided by default and is topic for a separate agreement with Smartico
46
+ Note: access to the server-to-server API is not provided by default and is a topic for a separate agreement with Smartico.
47
+ We recommend using a front-end API approach in most cases.
47
48
 
48
49
  ### Installation
49
50
 
@@ -6,5 +6,6 @@ export declare enum BuyStoreItemErrorCode {
6
6
  SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION = 11003,
7
7
  SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE = 11004,
8
8
  SHOP_FAILED_TO_BUY_MATCHING_BONUS = 11005,
9
- SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED = 11006
9
+ SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED = 11006,
10
+ SHOP_FAILED_POOL_EMPTY = 11009
10
11
  }
@@ -7,5 +7,6 @@ export interface StoreItem {
7
7
  itemPublicMeta: StoreItemPublicMeta;
8
8
  categoryIds?: number[];
9
9
  canBuy?: boolean;
10
+ shopPool: number;
10
11
  }
11
12
  export declare const StoreItemTransform: (items: StoreItem[]) => TStoreItem[];
@@ -319,6 +319,8 @@ export interface TStoreItem {
319
319
  can_buy: boolean;
320
320
  /** The list of IDs of the categories where the store item is assigned, information about categories can be retrievend with getStoreCategories method */
321
321
  category_ids: number[];
322
+ /** Number of items in the pool avaliable for the purchase.*/
323
+ pool?: number;
322
324
  }
323
325
  /**
324
326
  * TMissionOrBadge describes the information of mission or badge defined in the system
package/dist/index.js CHANGED
@@ -535,6 +535,7 @@ exports.BuyStoreItemErrorCode = void 0;
535
535
  BuyStoreItemErrorCode[BuyStoreItemErrorCode["SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE"] = 11004] = "SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE";
536
536
  BuyStoreItemErrorCode[BuyStoreItemErrorCode["SHOP_FAILED_TO_BUY_MATCHING_BONUS"] = 11005] = "SHOP_FAILED_TO_BUY_MATCHING_BONUS";
537
537
  BuyStoreItemErrorCode[BuyStoreItemErrorCode["SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED"] = 11006] = "SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED";
538
+ BuyStoreItemErrorCode[BuyStoreItemErrorCode["SHOP_FAILED_POOL_EMPTY"] = 11009] = "SHOP_FAILED_POOL_EMPTY";
538
539
  })(exports.BuyStoreItemErrorCode || (exports.BuyStoreItemErrorCode = {}));
539
540
 
540
541
  var StoreCategoryTransform = function StoreCategoryTransform(items) {
@@ -572,7 +573,8 @@ var StoreItemTransform = function StoreItemTransform(items) {
572
573
  related_item_ids: r.itemPublicMeta.related_items,
573
574
  type: (_StoreItemType$Bonus$ = {}, _StoreItemType$Bonus$[exports.StoreItemType.Bonus] = 'bonus', _StoreItemType$Bonus$[exports.StoreItemType.Manual] = 'manual', _StoreItemType$Bonus$)[r.itemTypeId],
574
575
  can_buy: r.canBuy,
575
- category_ids: (_r$categoryIds = r.categoryIds) != null ? _r$categoryIds : []
576
+ category_ids: (_r$categoryIds = r.categoryIds) != null ? _r$categoryIds : [],
577
+ pool: r.shopPool
576
578
  };
577
579
  return x;
578
580
  });
@@ -855,6 +857,11 @@ var tournamentInfoItemTransform = function tournamentInfoItemTransform(t) {
855
857
  return TournamentUtils.getPlayerTransformed(p);
856
858
  })
857
859
  });
860
+ if (t.prizeStructure) {
861
+ response.prizes = t.prizeStructure.prizes.map(function (p) {
862
+ return TournamentUtils.getPrizeTransformed(p);
863
+ });
864
+ }
858
865
  if (t.userPosition) {
859
866
  response.me = TournamentUtils.getPlayerTransformed(t.userPosition, true);
860
867
  }