@smartico/public-api 0.0.360 → 0.0.361

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.
@@ -44,6 +44,6 @@ ___
44
44
 
45
45
  ___
46
46
 
47
- ### related\_games
47
+ ### relatedGames
48
48
 
49
- • `Optional` **related\_games**: [`AchRelatedGame`](AchRelatedGame.md)[]
49
+ • `Optional` **relatedGames**: [`AchRelatedGame`](AchRelatedGame.md)[]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.360",
3
+ "version": "0.0.361",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,7 +13,7 @@ export interface StoreItem {
13
13
  canBuy?: boolean;
14
14
  shopPool: number;
15
15
  activeTillDate?: number;
16
- related_games?: AchRelatedGame[];
16
+ relatedGames?: AchRelatedGame[];
17
17
  }
18
18
 
19
19
  const mapPurchaseType = (purchaseType: StoreItemPurchaseType) => {
@@ -59,7 +59,7 @@ export const StoreItemTransform = (items: StoreItem[]): TStoreItem[] => {
59
59
  only_in_custom_section: r.itemPublicMeta.only_in_custom_section,
60
60
  custom_section_type_id: r.itemPublicMeta.custom_section_type_id,
61
61
  ...(r.itemPublicMeta.cant_buy_message ? { cant_buy_message: r.itemPublicMeta.cant_buy_message } : {}),
62
- related_games: (r.related_games || []).map((g, i) => ({
62
+ related_games: (r.relatedGames?.filter((g) => g.game_public_meta.enabled) || []).map((g, i) => ({
63
63
  ext_game_id: g.ext_game_id,
64
64
  game_public_meta: {
65
65
  name: g.game_public_meta.name,
@@ -54,7 +54,20 @@ export const StoreItemPurchasedTransform = (items: StoreItemPurchased[]): TStore
54
54
  purchased_today: purchasedToday,
55
55
  purchased_this_week: purchasedThisWeek,
56
56
  purchased_this_month: purchasedThisMonth,
57
- custom_data: r.itemPublicMeta.custom_data
57
+ custom_data: r.itemPublicMeta.custom_data,
58
+ related_games: (r.relatedGames?.filter((g) => g.game_public_meta.enabled) || []).map((g, i) => ({
59
+ ext_game_id: g.ext_game_id,
60
+ game_public_meta: {
61
+ name: g.game_public_meta.name,
62
+ link: g.game_public_meta.link,
63
+ image: g.game_public_meta.image,
64
+ enabled: g.game_public_meta.enabled,
65
+ game_categories: g.game_public_meta.game_categories,
66
+ game_provider: g.game_public_meta.game_provider,
67
+ mobile_spec_link: g.game_public_meta.mobile_spec_link,
68
+ priority: i + 1,
69
+ },
70
+ })),
58
71
  };
59
72
 
60
73
  return x;