@opexa/portal-sdk 0.59.81 → 0.59.84

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
@@ -3438,6 +3438,75 @@ var PLATFORM_GAMES_QUERY = gql`
3438
3438
  }
3439
3439
  }
3440
3440
  `;
3441
+ var GAME_GROUPS_QUERY = gql`
3442
+ query GameGroups(
3443
+ $first: Int
3444
+ $after: Cursor
3445
+ $filter: GameGroupFilterInput
3446
+ $sort: GameGroupSortInput
3447
+ $limit: Int,
3448
+ $offset: Int,
3449
+ ) {
3450
+ gameGroups(first: $first, after: $after, filter: $filter, sort: $sort) {
3451
+ totalCount
3452
+ pageInfo {
3453
+ hasNextPage
3454
+ endCursor
3455
+ }
3456
+ edges {
3457
+ cursor
3458
+ node {
3459
+ ... on GameGroup {
3460
+ id
3461
+ name
3462
+
3463
+ games(limit: $limit, offset: $offset) {
3464
+ id
3465
+ reference
3466
+ name
3467
+ displayName
3468
+ type
3469
+ provider
3470
+
3471
+ status
3472
+ hidden
3473
+ hasFreeBet
3474
+ hasJackpot
3475
+ image
3476
+ }
3477
+ dateTimeLastUpdated
3478
+ dateTimeCreated
3479
+ }
3480
+ }
3481
+ }
3482
+ }
3483
+ }
3484
+ `;
3485
+ var GAME_GROUP_QUERY = gql`
3486
+ query GameGroup($id: ObjectId!) {
3487
+ node(id: $id) {
3488
+ ... on GameGroup {
3489
+ id
3490
+ name
3491
+ games {
3492
+ id
3493
+ reference
3494
+ name
3495
+ displayName
3496
+ type
3497
+ provider
3498
+ status
3499
+ hidden
3500
+ hasFreeBet
3501
+ hasJackpot
3502
+ image
3503
+ }
3504
+ dateTimeLastUpdated
3505
+ dateTimeCreated
3506
+ }
3507
+ }
3508
+ }
3509
+ `;
3441
3510
  var GOOGLE_CLIEND_ID_QUERY = gql`
3442
3511
  query GoogleClientId {
3443
3512
  googleClientId
@@ -6555,6 +6624,27 @@ var WalletService = class {
6555
6624
  ok: true
6556
6625
  };
6557
6626
  }
6627
+ async gameGroups(variables) {
6628
+ const res = await this.client.request(GAME_GROUPS_QUERY, variables);
6629
+ if (!res.ok) return res;
6630
+ if (!res.data.gameGroups) {
6631
+ return {
6632
+ ok: false,
6633
+ error: {
6634
+ name: "UnknownError",
6635
+ message: "Something went wrong."
6636
+ }
6637
+ };
6638
+ }
6639
+ return {
6640
+ ok: true,
6641
+ data: res.data.gameGroups
6642
+ };
6643
+ }
6644
+ async gameGroup(variables) {
6645
+ const res = await this.client.request(GAME_GROUP_QUERY, variables);
6646
+ return res.ok ? { ok: res.ok, data: res.data.node } : res;
6647
+ }
6558
6648
  };
6559
6649
 
6560
6650
  // src/services/extension.service.ts
@@ -7512,7 +7602,7 @@ var SessionManagerCookie = class {
7512
7602
  if (val) {
7513
7603
  try {
7514
7604
  const stored = JSON.parse(val);
7515
- if (stored.version === 4) return await this.verifyV4();
7605
+ if (stored.version === 4) return await this.verifyV4(stored.session);
7516
7606
  } catch {
7517
7607
  }
7518
7608
  }
@@ -7527,9 +7617,10 @@ var SessionManagerCookie = class {
7527
7617
  }
7528
7618
  return v;
7529
7619
  }
7530
- async verifyV4() {
7620
+ async verifyV4(session) {
7531
7621
  if (!this.v4AccessToken || !this.v4AccessTokenExpiresAt || isAfter(/* @__PURE__ */ new Date(), new Date(this.v4AccessTokenExpiresAt))) {
7532
- return true;
7622
+ const res = await this.refreshV4(session);
7623
+ return res.ok;
7533
7624
  }
7534
7625
  const v = await this.authService.verifySession(this.v4AccessToken);
7535
7626
  if (!v) {
@@ -7979,7 +8070,7 @@ var SessionManager = class {
7979
8070
  if (val) {
7980
8071
  try {
7981
8072
  const stored = JSON.parse(val);
7982
- if (stored.version === 4) return await this.verifyV4();
8073
+ if (stored.version === 4) return await this.verifyV4(stored.session);
7983
8074
  } catch {
7984
8075
  }
7985
8076
  }
@@ -7994,9 +8085,10 @@ var SessionManager = class {
7994
8085
  }
7995
8086
  return v;
7996
8087
  }
7997
- async verifyV4() {
8088
+ async verifyV4(session) {
7998
8089
  if (!this.v4AccessToken || !this.v4AccessTokenExpiresAt || isAfter(/* @__PURE__ */ new Date(), new Date(this.v4AccessTokenExpiresAt))) {
7999
- return true;
8090
+ const res = await this.refreshV4(session);
8091
+ return res.ok;
8000
8092
  }
8001
8093
  const v = await this.authService.verifySession(this.v4AccessToken);
8002
8094
  if (!v) {
@@ -11650,6 +11742,30 @@ var Sdk = class {
11650
11742
  }
11651
11743
  };
11652
11744
  }
11745
+ async gameGroups(input) {
11746
+ const res = await this.walletService.gameGroups(input);
11747
+ if (!res.ok) return res;
11748
+ return {
11749
+ ok: true,
11750
+ data: {
11751
+ gameGroups: res.data.edges.map(({ cursor, node }) => ({
11752
+ ...node,
11753
+ cursor
11754
+ })),
11755
+ totalCount: res.data.totalCount,
11756
+ hasNextPage: res.data.pageInfo.hasNextPage,
11757
+ endCursor: res.data.pageInfo.endCursor ?? void 0
11758
+ }
11759
+ };
11760
+ }
11761
+ async gameGroup(input) {
11762
+ const res = await this.walletService.gameGroup(input);
11763
+ if (!res.ok) return res;
11764
+ return {
11765
+ ok: true,
11766
+ data: res.data ?? null
11767
+ };
11768
+ }
11653
11769
  async games__next(input) {
11654
11770
  const res = await this.cmsPortalService.games__next(input);
11655
11771
  if (!res.ok) return res;