@opexa/portal-sdk 0.59.114 → 0.59.115

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.
@@ -3425,7 +3425,9 @@ var _GAMES_NEXT_QUERY = gql`
3425
3425
  hidden
3426
3426
  hasFreeBet
3427
3427
  hasJackpot
3428
- image
3428
+ image {
3429
+ url
3430
+ }
3429
3431
  groups {
3430
3432
  id
3431
3433
  name
@@ -3461,7 +3463,9 @@ var _GAMES_NEXT_QUERY__STAGING = gql`
3461
3463
  returnToPlayer
3462
3464
  minimumBet
3463
3465
  maximumBet
3464
- image
3466
+ image {
3467
+ url
3468
+ }
3465
3469
  groups {
3466
3470
  id
3467
3471
  name
@@ -3502,6 +3506,7 @@ var GAME_GROUPS_QUERY = gql`
3502
3506
  edges {
3503
3507
  cursor
3504
3508
  node {
3509
+ __typename
3505
3510
  ... on GameGroup {
3506
3511
  id
3507
3512
  name
@@ -3518,7 +3523,9 @@ var GAME_GROUPS_QUERY = gql`
3518
3523
  hidden
3519
3524
  hasFreeBet
3520
3525
  hasJackpot
3521
- image
3526
+ image {
3527
+ url
3528
+ }
3522
3529
  }
3523
3530
  dateTimeLastUpdated
3524
3531
  dateTimeCreated
@@ -3531,6 +3538,7 @@ var GAME_GROUPS_QUERY = gql`
3531
3538
  var GAME_GROUP_QUERY = gql`
3532
3539
  query GameGroup($id: ObjectId!) {
3533
3540
  node(id: $id) {
3541
+ __typename
3534
3542
  ... on GameGroup {
3535
3543
  id
3536
3544
  name
@@ -3545,7 +3553,9 @@ var GAME_GROUP_QUERY = gql`
3545
3553
  hidden
3546
3554
  hasFreeBet
3547
3555
  hasJackpot
3548
- image
3556
+ image {
3557
+ url
3558
+ }
3549
3559
  }
3550
3560
  dateTimeLastUpdated
3551
3561
  dateTimeCreated
@@ -5974,6 +5984,18 @@ var TriggerService = class {
5974
5984
  };
5975
5985
 
5976
5986
  // src/services/wallet.service.ts
5987
+ function isWalletGameGroup(node) {
5988
+ 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";
5989
+ }
5990
+ function invalidWalletGameGroup(node) {
5991
+ return {
5992
+ ok: false,
5993
+ error: {
5994
+ name: "UnknownError",
5995
+ message: node.__typename && node.__typename !== "GameGroup" ? `Wallet returned ${node.__typename} instead of GameGroup.` : "Wallet returned invalid GameGroup data."
5996
+ }
5997
+ };
5998
+ }
5977
5999
  var WalletService = class {
5978
6000
  client;
5979
6001
  environment;
@@ -6950,14 +6972,26 @@ var WalletService = class {
6950
6972
  }
6951
6973
  };
6952
6974
  }
6975
+ const edges = [];
6976
+ for (const { cursor, node } of res.data.gameGroups.edges) {
6977
+ if (!isWalletGameGroup(node)) return invalidWalletGameGroup(node);
6978
+ const { __typename, ...group } = node;
6979
+ edges.push({ cursor, node: group });
6980
+ }
6953
6981
  return {
6954
6982
  ok: true,
6955
- data: res.data.gameGroups
6983
+ data: { ...res.data.gameGroups, edges }
6956
6984
  };
6957
6985
  }
6958
6986
  async gameGroup(variables) {
6959
6987
  const res = await this.client.request(GAME_GROUP_QUERY, variables);
6960
- return res.ok ? { ok: res.ok, data: res.data.node } : res;
6988
+ if (!res.ok) return res;
6989
+ if (!res.data.node) return { ok: true, data: res.data.node };
6990
+ if (!isWalletGameGroup(res.data.node)) {
6991
+ return invalidWalletGameGroup(res.data.node);
6992
+ }
6993
+ const { __typename, ...group } = res.data.node;
6994
+ return { ok: true, data: group };
6961
6995
  }
6962
6996
  };
6963
6997
 
@@ -6994,5 +7028,5 @@ var ExtensionService = class {
6994
7028
  };
6995
7029
 
6996
7030
  export { AccountService, AuthService, CmsPortalService, ExtensionService, FileService, GameService, PortalService, ReportService, TriggerService, WalletService, getFingerPrint, isIOSPlatform };
6997
- //# sourceMappingURL=chunk-DSBYVM5T.js.map
6998
- //# sourceMappingURL=chunk-DSBYVM5T.js.map
7031
+ //# sourceMappingURL=chunk-CXHE7ISP.js.map
7032
+ //# sourceMappingURL=chunk-CXHE7ISP.js.map