@opexa/portal-sdk 0.59.114 → 0.59.116

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/index.cjs CHANGED
@@ -1726,6 +1726,9 @@ var BONUS_QUERY = gql`
1726
1726
  query Bonus {
1727
1727
  bonus {
1728
1728
  id
1729
+ freeBetDrop {
1730
+ id
1731
+ }
1729
1732
  promo {
1730
1733
  ...PromoFragment
1731
1734
  }
@@ -1757,6 +1760,9 @@ var BONUSES_QUERY = gql`
1757
1760
  query Bonuses {
1758
1761
  bonuses {
1759
1762
  id
1763
+ freeBetDrop {
1764
+ id
1765
+ }
1760
1766
  promo {
1761
1767
  ...PromoFragment
1762
1768
  }
@@ -3456,7 +3462,9 @@ var _GAMES_NEXT_QUERY = gql`
3456
3462
  hidden
3457
3463
  hasFreeBet
3458
3464
  hasJackpot
3459
- image
3465
+ image {
3466
+ url
3467
+ }
3460
3468
  groups {
3461
3469
  id
3462
3470
  name
@@ -3492,7 +3500,9 @@ var _GAMES_NEXT_QUERY__STAGING = gql`
3492
3500
  returnToPlayer
3493
3501
  minimumBet
3494
3502
  maximumBet
3495
- image
3503
+ image {
3504
+ url
3505
+ }
3496
3506
  groups {
3497
3507
  id
3498
3508
  name
@@ -3533,6 +3543,7 @@ var GAME_GROUPS_QUERY = gql`
3533
3543
  edges {
3534
3544
  cursor
3535
3545
  node {
3546
+ __typename
3536
3547
  ... on GameGroup {
3537
3548
  id
3538
3549
  name
@@ -3549,7 +3560,9 @@ var GAME_GROUPS_QUERY = gql`
3549
3560
  hidden
3550
3561
  hasFreeBet
3551
3562
  hasJackpot
3552
- image
3563
+ image {
3564
+ url
3565
+ }
3553
3566
  }
3554
3567
  dateTimeLastUpdated
3555
3568
  dateTimeCreated
@@ -3562,6 +3575,7 @@ var GAME_GROUPS_QUERY = gql`
3562
3575
  var GAME_GROUP_QUERY = gql`
3563
3576
  query GameGroup($id: ObjectId!) {
3564
3577
  node(id: $id) {
3578
+ __typename
3565
3579
  ... on GameGroup {
3566
3580
  id
3567
3581
  name
@@ -3576,7 +3590,9 @@ var GAME_GROUP_QUERY = gql`
3576
3590
  hidden
3577
3591
  hasFreeBet
3578
3592
  hasJackpot
3579
- image
3593
+ image {
3594
+ url
3595
+ }
3580
3596
  }
3581
3597
  dateTimeLastUpdated
3582
3598
  dateTimeCreated
@@ -6035,6 +6051,18 @@ var TriggerService = class {
6035
6051
  };
6036
6052
 
6037
6053
  // src/services/wallet.service.ts
6054
+ function isWalletGameGroup(node) {
6055
+ return node.__typename === "GameGroup" && "id" in node && typeof node.id === "string" && "name" in node && typeof node.name === "string" && "games" in node && Array.isArray(node.games) && "dateTimeCreated" in node && typeof node.dateTimeCreated === "string" && "dateTimeLastUpdated" in node && typeof node.dateTimeLastUpdated === "string";
6056
+ }
6057
+ function invalidWalletGameGroup(node) {
6058
+ return {
6059
+ ok: false,
6060
+ error: {
6061
+ name: "UnknownError",
6062
+ message: node.__typename && node.__typename !== "GameGroup" ? `Wallet returned ${node.__typename} instead of GameGroup.` : "Wallet returned invalid GameGroup data."
6063
+ }
6064
+ };
6065
+ }
6038
6066
  var WalletService = class {
6039
6067
  client;
6040
6068
  environment;
@@ -7011,14 +7039,26 @@ var WalletService = class {
7011
7039
  }
7012
7040
  };
7013
7041
  }
7042
+ const edges = [];
7043
+ for (const { cursor, node } of res.data.gameGroups.edges) {
7044
+ if (!isWalletGameGroup(node)) return invalidWalletGameGroup(node);
7045
+ const { __typename, ...group } = node;
7046
+ edges.push({ cursor, node: group });
7047
+ }
7014
7048
  return {
7015
7049
  ok: true,
7016
- data: res.data.gameGroups
7050
+ data: { ...res.data.gameGroups, edges }
7017
7051
  };
7018
7052
  }
7019
7053
  async gameGroup(variables) {
7020
7054
  const res = await this.client.request(GAME_GROUP_QUERY, variables);
7021
- return res.ok ? { ok: res.ok, data: res.data.node } : res;
7055
+ if (!res.ok) return res;
7056
+ if (!res.data.node) return { ok: true, data: res.data.node };
7057
+ if (!isWalletGameGroup(res.data.node)) {
7058
+ return invalidWalletGameGroup(res.data.node);
7059
+ }
7060
+ const { __typename, ...group } = res.data.node;
7061
+ return { ok: true, data: group };
7022
7062
  }
7023
7063
  };
7024
7064
 
@@ -9913,7 +9953,9 @@ var Transformer = class {
9913
9953
  name,
9914
9954
  type: node.type,
9915
9955
  provider: node.provider,
9916
- images: [...new Set(node.image ? [node.image, fallback] : [fallback])],
9956
+ images: [
9957
+ ...new Set(node.image?.url ? [node.image.url, fallback] : [fallback])
9958
+ ],
9917
9959
  tags: [],
9918
9960
  favorite: false
9919
9961
  };
@@ -9935,7 +9977,7 @@ var Transformer = class {
9935
9977
  ...data,
9936
9978
  games: data.games.flatMap((node) => {
9937
9979
  const game = this.walletGame(node);
9938
- return game ? [{ ...node, ...game }] : [];
9980
+ return game ? [{ ...node, ...game, image: node.image?.url ?? null }] : [];
9939
9981
  })
9940
9982
  };
9941
9983
  }
@@ -10006,6 +10048,9 @@ var Transformer = class {
10006
10048
  bonus(data) {
10007
10049
  const o = {
10008
10050
  id: data.id,
10051
+ freeBetDrop: data.freeBetDrop ? {
10052
+ id: data.freeBetDrop.id
10053
+ } : void 0,
10009
10054
  promo: this.promo(data.promo),
10010
10055
  deposit: !data.deposit ? void 0 : {
10011
10056
  type: data.deposit.type,