@opexa/portal-sdk 0.52.3 → 0.52.5

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
@@ -850,7 +850,25 @@ var CREATE_MAYA_DEPOSIT_MUTATION = gql`
850
850
  var CREATE_TEST_DEPOSIT_MUTATION = gql`
851
851
  mutation CreateTestDeposit($input: CreateTestDepositInput!) {
852
852
  createTestDeposit(input: $input) {
853
- ... on WalletDoesNotExistError {
853
+ ... on DepositPromoMaximumAmountExceededError {
854
+ __typename
855
+ }
856
+ ... on DepositPromoMinimumAmountNotMetError {
857
+ __typename
858
+ }
859
+ ... on MaximumDepositAmountExceededError {
860
+ __typename
861
+ }
862
+ ... on MinimumDepositAmountNotMetError {
863
+ __typename
864
+ }
865
+ ... on MinimumFirstDepositAmountNotMetError {
866
+ __typename
867
+ }
868
+ ... on PromoNotEnabledError {
869
+ __typename
870
+ }
871
+ ... on WalletDoesNotExistError {
854
872
  __typename
855
873
  }
856
874
  }
@@ -2669,6 +2687,22 @@ var TOP_WINS_QUERY = gql`
2669
2687
  }
2670
2688
  }
2671
2689
  `;
2690
+ var TOP_WINS_NEXT_QUERY = gql`
2691
+ query TopWinsNext {
2692
+ _topWins {
2693
+ id
2694
+ game {
2695
+ id
2696
+ }
2697
+ member {
2698
+ id
2699
+ name
2700
+ }
2701
+ multiplier
2702
+ payout
2703
+ }
2704
+ }
2705
+ `;
2672
2706
  var JACKPOTS_QUERY = gql`
2673
2707
  query Jackpots(
2674
2708
  $first: Int
@@ -2895,6 +2929,17 @@ var TOURNAMENTS_QUERY = gql`
2895
2929
  }
2896
2930
  }
2897
2931
  `;
2932
+ var MEMBER_CABINET_SITE_MACHINE_QUERY = gql`
2933
+ query MemberCabinetSiteMachine {
2934
+ memberCabinetSiteMachine {
2935
+ id
2936
+ name
2937
+ fingerprint
2938
+ status
2939
+ dateTimeCreated
2940
+ }
2941
+ }
2942
+ `;
2898
2943
 
2899
2944
  // src/services/utils.ts
2900
2945
  function createOperationError(code) {
@@ -2960,7 +3005,8 @@ function createOperationError(code) {
2960
3005
  VerificationDataIncompleteError: "Verification data is incomplete",
2961
3006
  TurnoverRequirementNotYetFulfilledError: "Turnover requirement not yet fulfilled",
2962
3007
  FirstDepositRequiredError: "First deposit is required",
2963
- VerificationLockedError: "Verification is locked"
3008
+ VerificationLockedError: "Verification is locked",
3009
+ MachineNotFound: "Machine not found"
2964
3010
  };
2965
3011
  return {
2966
3012
  name: code,
@@ -4056,6 +4102,14 @@ var PortalService = class {
4056
4102
  data: res.data.topWins
4057
4103
  };
4058
4104
  }
4105
+ async topWinsNext() {
4106
+ const res = await this.client.request(TOP_WINS_NEXT_QUERY);
4107
+ if (!res.ok) return res;
4108
+ return {
4109
+ ok: true,
4110
+ data: res.data._topWins
4111
+ };
4112
+ }
4059
4113
  };
4060
4114
 
4061
4115
  // src/services/report.service.ts
@@ -5081,6 +5135,10 @@ var ExtensionService = class {
5081
5135
  ok: true
5082
5136
  };
5083
5137
  }
5138
+ async memberCabinetSiteMachine() {
5139
+ const res = await this.client.request(MEMBER_CABINET_SITE_MACHINE_QUERY);
5140
+ return res.ok ? { ok: res.ok, data: res.data.memberCabinetSiteMachine } : res;
5141
+ }
5084
5142
  };
5085
5143
 
5086
5144
  // src/utils/clone-date.ts
@@ -5523,8 +5581,8 @@ function pollable(func, config) {
5523
5581
  };
5524
5582
  }
5525
5583
 
5526
- // src/sdk/session-manager.ts
5527
- var SessionManager = class {
5584
+ // src/sdk/session-manager-cookie.ts
5585
+ var SessionManagerCookie = class {
5528
5586
  logger;
5529
5587
  storageKey = "session";
5530
5588
  platformStorageKey = "session/platform";
@@ -5535,10 +5593,6 @@ var SessionManager = class {
5535
5593
  this.authService = config.authService;
5536
5594
  this.walletService = config.walletService;
5537
5595
  this.logger = config.logger;
5538
- if (config.sessionPrefix) {
5539
- this.storageKey = `${config.sessionPrefix}/${this.storageKey}`;
5540
- this.platformStorageKey = `${config.sessionPrefix}/${this.platformStorageKey}`;
5541
- }
5542
5596
  }
5543
5597
  get refreshing() {
5544
5598
  return this._refreshing;
@@ -5547,16 +5601,6 @@ var SessionManager = class {
5547
5601
  this._refreshing = value;
5548
5602
  }
5549
5603
  async create(input) {
5550
- if (this.isServer) {
5551
- this.logger.warn("'localStorage' is not available on the server.");
5552
- return {
5553
- ok: false,
5554
- error: {
5555
- name: "UnknownError",
5556
- message: "Server sign in is not supported."
5557
- }
5558
- };
5559
- }
5560
5604
  if (input.type === "MAYA") {
5561
5605
  localStorage.setItem(this.platformStorageKey, "MAYA");
5562
5606
  const f0 = () => this.walletService.mayaSession({ id: input.sessionId });
@@ -5583,13 +5627,14 @@ var SessionManager = class {
5583
5627
  })();
5584
5628
  if (!r1.ok) return r1;
5585
5629
  const now2 = /* @__PURE__ */ new Date();
5586
- localStorage.setItem(
5630
+ cookies__default.default.set(
5587
5631
  this.storageKey,
5588
5632
  JSON.stringify({
5589
5633
  ...r1.data,
5590
5634
  accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
5591
5635
  refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
5592
- })
5636
+ }),
5637
+ { expires: subMinutes(addDays(now2, 30), 2).getTime() }
5593
5638
  );
5594
5639
  return {
5595
5640
  ok: true,
@@ -5600,13 +5645,16 @@ var SessionManager = class {
5600
5645
  const res2 = await this.authService.createSession(input);
5601
5646
  if (res2.ok) {
5602
5647
  const now2 = /* @__PURE__ */ new Date();
5603
- localStorage.setItem(
5648
+ cookies__default.default.set(
5604
5649
  this.storageKey,
5605
5650
  JSON.stringify({
5606
5651
  ...res2.data,
5607
5652
  accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
5608
5653
  refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
5609
- })
5654
+ }),
5655
+ {
5656
+ expires: subMinutes(addDays(now2, 30), 2).getTime()
5657
+ }
5610
5658
  );
5611
5659
  return {
5612
5660
  ok: true,
@@ -5618,18 +5666,18 @@ var SessionManager = class {
5618
5666
  if (input.type === "SOCIALS" || input.type === "TOKEN") {
5619
5667
  const res2 = await this.authService.createSession({
5620
5668
  type: "SOCIALS",
5621
- token: input.token,
5622
- channel: input.channel
5669
+ token: input.token
5623
5670
  });
5624
5671
  if (res2.ok) {
5625
5672
  const now2 = /* @__PURE__ */ new Date();
5626
- localStorage.setItem(
5673
+ cookies__default.default.set(
5627
5674
  this.storageKey,
5628
5675
  JSON.stringify({
5629
5676
  ...res2.data,
5630
5677
  accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
5631
5678
  refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
5632
- })
5679
+ }),
5680
+ { expires: subMinutes(addDays(now2, 30), 2).getTime() }
5633
5681
  );
5634
5682
  return {
5635
5683
  ok: true,
@@ -5643,13 +5691,14 @@ var SessionManager = class {
5643
5691
  const res2 = await this.authService.createSession(input);
5644
5692
  if (res2.ok) {
5645
5693
  const now2 = /* @__PURE__ */ new Date();
5646
- localStorage.setItem(
5694
+ cookies__default.default.set(
5647
5695
  this.storageKey,
5648
5696
  JSON.stringify({
5649
5697
  ...res2.data,
5650
5698
  accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
5651
5699
  refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
5652
- })
5700
+ }),
5701
+ { expires: subMinutes(addDays(now2, 30), 2).getTime() }
5653
5702
  );
5654
5703
  return {
5655
5704
  ok: true,
@@ -5669,13 +5718,14 @@ var SessionManager = class {
5669
5718
  };
5670
5719
  }
5671
5720
  const now = /* @__PURE__ */ new Date();
5672
- localStorage.setItem(
5721
+ cookies__default.default.set(
5673
5722
  this.storageKey,
5674
5723
  JSON.stringify({
5675
5724
  ...res.data,
5676
5725
  accessTokenExpiresAt: addMinutes(now, 8).getTime(),
5677
5726
  refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
5678
- })
5727
+ }),
5728
+ {}
5679
5729
  );
5680
5730
  return {
5681
5731
  ok: true,
@@ -5687,15 +5737,18 @@ var SessionManager = class {
5687
5737
  if (res.ok) {
5688
5738
  const now = /* @__PURE__ */ new Date();
5689
5739
  if (this.isServer) {
5690
- this.logger.warn("'localStorage' is not available on the server.");
5740
+ this.logger.warn("'client cookies' is not available on the server.");
5691
5741
  } else {
5692
- localStorage.setItem(
5742
+ cookies__default.default.set(
5693
5743
  this.storageKey,
5694
5744
  JSON.stringify({
5695
5745
  ...res.data,
5696
5746
  accessTokenExpiresAt: addMinutes(now, 8).getTime(),
5697
5747
  refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
5698
- })
5748
+ }),
5749
+ {
5750
+ expires: subMinutes(addDays(now, 30), 2).getTime()
5751
+ }
5699
5752
  );
5700
5753
  }
5701
5754
  return { ok: true };
@@ -5705,7 +5758,7 @@ var SessionManager = class {
5705
5758
  }
5706
5759
  async get() {
5707
5760
  if (this.isServer) {
5708
- this.logger.warn("'localStorage' is not available on the server.");
5761
+ this.logger.warn("'client cookies' is not available on the server.");
5709
5762
  return {
5710
5763
  ok: true,
5711
5764
  data: null
@@ -5715,7 +5768,7 @@ var SessionManager = class {
5715
5768
  await sleep(1e3);
5716
5769
  return await this.get();
5717
5770
  }
5718
- const val = localStorage.getItem(this.storageKey);
5771
+ const val = cookies__default.default.get(this.storageKey);
5719
5772
  if (!val) {
5720
5773
  return {
5721
5774
  ok: true,
@@ -5729,7 +5782,7 @@ var SessionManager = class {
5729
5782
  const refreshTokenExpiresAt = new Date(obj.refreshTokenExpiresAt);
5730
5783
  if (isAfter(now, refreshTokenExpiresAt)) {
5731
5784
  this.logger.warn("Session expired. Logging out..");
5732
- localStorage.removeItem(this.storageKey);
5785
+ cookies__default.default.remove(this.storageKey);
5733
5786
  return {
5734
5787
  ok: false,
5735
5788
  error: {
@@ -5746,7 +5799,7 @@ var SessionManager = class {
5746
5799
  if (!res.ok) {
5747
5800
  this.logger.error(`Failed to refresh session: ${res.error.message}`);
5748
5801
  if (res.error.name === "InvalidTokenError" || res.error.name === "AccountBlacklistedError" || res.error.name === "VerificationLockedError") {
5749
- localStorage.removeItem(this.storageKey);
5802
+ cookies__default.default.remove(this.storageKey);
5750
5803
  return {
5751
5804
  ok: false,
5752
5805
  error: res.error
@@ -5767,7 +5820,9 @@ var SessionManager = class {
5767
5820
  accessTokenExpiresAt: addMinutes(now, 8).getTime(),
5768
5821
  refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
5769
5822
  };
5770
- localStorage.setItem(this.storageKey, JSON.stringify(obj));
5823
+ cookies__default.default.set(this.storageKey, JSON.stringify(obj), {
5824
+ expires: subMinutes(addDays(now, 30), 2).getTime()
5825
+ });
5771
5826
  }
5772
5827
  return {
5773
5828
  ok: true,
@@ -5785,13 +5840,13 @@ var SessionManager = class {
5785
5840
  }
5786
5841
  async refresh() {
5787
5842
  if (this.isServer) {
5788
- this.logger.warn("'localStorage' is not available on the server.");
5843
+ this.logger.warn("'client cookies' is not available on the server.");
5789
5844
  return {
5790
5845
  ok: true,
5791
5846
  data: null
5792
5847
  };
5793
5848
  }
5794
- const val = localStorage.getItem(this.storageKey);
5849
+ const val = cookies__default.default.get(this.storageKey);
5795
5850
  if (!val) {
5796
5851
  return {
5797
5852
  ok: true,
@@ -5808,7 +5863,7 @@ var SessionManager = class {
5808
5863
  if (!res.ok) {
5809
5864
  this.logger.error(`Failed to refresh session: ${res.error.message}`);
5810
5865
  if (res.error.name === "InvalidTokenError" || res.error.name === "AccountBlacklistedError" || res.error.name === "VerificationLockedError") {
5811
- localStorage.removeItem(this.storageKey);
5866
+ cookies__default.default.remove(this.storageKey);
5812
5867
  return {
5813
5868
  ok: false,
5814
5869
  error: res.error
@@ -5829,7 +5884,9 @@ var SessionManager = class {
5829
5884
  accessTokenExpiresAt: addMinutes(now, 8).getTime(),
5830
5885
  refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
5831
5886
  };
5832
- localStorage.setItem(this.storageKey, JSON.stringify(obj));
5887
+ cookies__default.default.set(this.storageKey, JSON.stringify(obj), {
5888
+ expires: subMinutes(addDays(now, 30), 2).getTime()
5889
+ });
5833
5890
  return {
5834
5891
  ok: true,
5835
5892
  data: obj
@@ -5846,18 +5903,18 @@ var SessionManager = class {
5846
5903
  }
5847
5904
  async destroy() {
5848
5905
  if (this.isServer) {
5849
- this.logger.warn("'localStorage' is not available on the server.");
5906
+ this.logger.warn("'client cookies' is not available on the server.");
5850
5907
  return;
5851
5908
  }
5852
5909
  const res = await this.get();
5853
5910
  if (res.data?.accessToken) {
5854
5911
  await this.authService.destroySession(res.data.accessToken);
5855
5912
  }
5856
- localStorage.removeItem(this.storageKey);
5913
+ cookies__default.default.remove(this.storageKey);
5857
5914
  }
5858
5915
  async verify() {
5859
5916
  if (this.isServer) {
5860
- this.logger.warn("'localStorage' is not available on the server.");
5917
+ this.logger.warn("'client cookies' is not available on the server.");
5861
5918
  return true;
5862
5919
  }
5863
5920
  const s = await this.get();
@@ -5867,13 +5924,13 @@ var SessionManager = class {
5867
5924
  if (!s.data) return true;
5868
5925
  const v = await this.authService.verifySession(s.data.accessToken);
5869
5926
  if (!v) {
5870
- localStorage.removeItem(this.storageKey);
5927
+ cookies__default.default.remove(this.storageKey);
5871
5928
  }
5872
5929
  return v;
5873
5930
  }
5874
5931
  get onMaya() {
5875
5932
  if (this.isServer) {
5876
- this.logger.warn("'localStorage' is not available on the server.");
5933
+ this.logger.warn("'client cookies' is not available on the server.");
5877
5934
  return false;
5878
5935
  }
5879
5936
  return localStorage.getItem(this.platformStorageKey) === "MAYA";
@@ -5889,7 +5946,9 @@ var SessionManager = class {
5889
5946
  return typeof window === "undefined";
5890
5947
  }
5891
5948
  };
5892
- var SessionManagerCookie = class {
5949
+
5950
+ // src/sdk/session-manager.ts
5951
+ var SessionManager = class {
5893
5952
  logger;
5894
5953
  storageKey = "session";
5895
5954
  platformStorageKey = "session/platform";
@@ -5900,6 +5959,10 @@ var SessionManagerCookie = class {
5900
5959
  this.authService = config.authService;
5901
5960
  this.walletService = config.walletService;
5902
5961
  this.logger = config.logger;
5962
+ if (config.sessionPrefix) {
5963
+ this.storageKey = `${config.sessionPrefix}/${this.storageKey}`;
5964
+ this.platformStorageKey = `${config.sessionPrefix}/${this.platformStorageKey}`;
5965
+ }
5903
5966
  }
5904
5967
  get refreshing() {
5905
5968
  return this._refreshing;
@@ -5908,6 +5971,16 @@ var SessionManagerCookie = class {
5908
5971
  this._refreshing = value;
5909
5972
  }
5910
5973
  async create(input) {
5974
+ if (this.isServer) {
5975
+ this.logger.warn("'localStorage' is not available on the server.");
5976
+ return {
5977
+ ok: false,
5978
+ error: {
5979
+ name: "UnknownError",
5980
+ message: "Server sign in is not supported."
5981
+ }
5982
+ };
5983
+ }
5911
5984
  if (input.type === "MAYA") {
5912
5985
  localStorage.setItem(this.platformStorageKey, "MAYA");
5913
5986
  const f0 = () => this.walletService.mayaSession({ id: input.sessionId });
@@ -5934,14 +6007,13 @@ var SessionManagerCookie = class {
5934
6007
  })();
5935
6008
  if (!r1.ok) return r1;
5936
6009
  const now2 = /* @__PURE__ */ new Date();
5937
- cookies__default.default.set(
6010
+ localStorage.setItem(
5938
6011
  this.storageKey,
5939
6012
  JSON.stringify({
5940
6013
  ...r1.data,
5941
6014
  accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
5942
6015
  refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
5943
- }),
5944
- { expires: subMinutes(addDays(now2, 30), 2).getTime() }
6016
+ })
5945
6017
  );
5946
6018
  return {
5947
6019
  ok: true,
@@ -5952,16 +6024,13 @@ var SessionManagerCookie = class {
5952
6024
  const res2 = await this.authService.createSession(input);
5953
6025
  if (res2.ok) {
5954
6026
  const now2 = /* @__PURE__ */ new Date();
5955
- cookies__default.default.set(
6027
+ localStorage.setItem(
5956
6028
  this.storageKey,
5957
6029
  JSON.stringify({
5958
6030
  ...res2.data,
5959
6031
  accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
5960
6032
  refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
5961
- }),
5962
- {
5963
- expires: subMinutes(addDays(now2, 30), 2).getTime()
5964
- }
6033
+ })
5965
6034
  );
5966
6035
  return {
5967
6036
  ok: true,
@@ -5973,18 +6042,18 @@ var SessionManagerCookie = class {
5973
6042
  if (input.type === "SOCIALS" || input.type === "TOKEN") {
5974
6043
  const res2 = await this.authService.createSession({
5975
6044
  type: "SOCIALS",
5976
- token: input.token
6045
+ token: input.token,
6046
+ channel: input.channel
5977
6047
  });
5978
6048
  if (res2.ok) {
5979
6049
  const now2 = /* @__PURE__ */ new Date();
5980
- cookies__default.default.set(
6050
+ localStorage.setItem(
5981
6051
  this.storageKey,
5982
6052
  JSON.stringify({
5983
6053
  ...res2.data,
5984
6054
  accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
5985
6055
  refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
5986
- }),
5987
- { expires: subMinutes(addDays(now2, 30), 2).getTime() }
6056
+ })
5988
6057
  );
5989
6058
  return {
5990
6059
  ok: true,
@@ -5998,14 +6067,13 @@ var SessionManagerCookie = class {
5998
6067
  const res2 = await this.authService.createSession(input);
5999
6068
  if (res2.ok) {
6000
6069
  const now2 = /* @__PURE__ */ new Date();
6001
- cookies__default.default.set(
6070
+ localStorage.setItem(
6002
6071
  this.storageKey,
6003
6072
  JSON.stringify({
6004
6073
  ...res2.data,
6005
6074
  accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
6006
6075
  refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
6007
- }),
6008
- { expires: subMinutes(addDays(now2, 30), 2).getTime() }
6076
+ })
6009
6077
  );
6010
6078
  return {
6011
6079
  ok: true,
@@ -6025,14 +6093,13 @@ var SessionManagerCookie = class {
6025
6093
  };
6026
6094
  }
6027
6095
  const now = /* @__PURE__ */ new Date();
6028
- cookies__default.default.set(
6096
+ localStorage.setItem(
6029
6097
  this.storageKey,
6030
6098
  JSON.stringify({
6031
6099
  ...res.data,
6032
6100
  accessTokenExpiresAt: addMinutes(now, 8).getTime(),
6033
6101
  refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
6034
- }),
6035
- {}
6102
+ })
6036
6103
  );
6037
6104
  return {
6038
6105
  ok: true,
@@ -6044,18 +6111,15 @@ var SessionManagerCookie = class {
6044
6111
  if (res.ok) {
6045
6112
  const now = /* @__PURE__ */ new Date();
6046
6113
  if (this.isServer) {
6047
- this.logger.warn("'client cookies' is not available on the server.");
6114
+ this.logger.warn("'localStorage' is not available on the server.");
6048
6115
  } else {
6049
- cookies__default.default.set(
6116
+ localStorage.setItem(
6050
6117
  this.storageKey,
6051
6118
  JSON.stringify({
6052
6119
  ...res.data,
6053
6120
  accessTokenExpiresAt: addMinutes(now, 8).getTime(),
6054
6121
  refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
6055
- }),
6056
- {
6057
- expires: subMinutes(addDays(now, 30), 2).getTime()
6058
- }
6122
+ })
6059
6123
  );
6060
6124
  }
6061
6125
  return { ok: true };
@@ -6065,7 +6129,7 @@ var SessionManagerCookie = class {
6065
6129
  }
6066
6130
  async get() {
6067
6131
  if (this.isServer) {
6068
- this.logger.warn("'client cookies' is not available on the server.");
6132
+ this.logger.warn("'localStorage' is not available on the server.");
6069
6133
  return {
6070
6134
  ok: true,
6071
6135
  data: null
@@ -6075,7 +6139,7 @@ var SessionManagerCookie = class {
6075
6139
  await sleep(1e3);
6076
6140
  return await this.get();
6077
6141
  }
6078
- const val = cookies__default.default.get(this.storageKey);
6142
+ const val = localStorage.getItem(this.storageKey);
6079
6143
  if (!val) {
6080
6144
  return {
6081
6145
  ok: true,
@@ -6089,7 +6153,7 @@ var SessionManagerCookie = class {
6089
6153
  const refreshTokenExpiresAt = new Date(obj.refreshTokenExpiresAt);
6090
6154
  if (isAfter(now, refreshTokenExpiresAt)) {
6091
6155
  this.logger.warn("Session expired. Logging out..");
6092
- cookies__default.default.remove(this.storageKey);
6156
+ localStorage.removeItem(this.storageKey);
6093
6157
  return {
6094
6158
  ok: false,
6095
6159
  error: {
@@ -6106,7 +6170,7 @@ var SessionManagerCookie = class {
6106
6170
  if (!res.ok) {
6107
6171
  this.logger.error(`Failed to refresh session: ${res.error.message}`);
6108
6172
  if (res.error.name === "InvalidTokenError" || res.error.name === "AccountBlacklistedError" || res.error.name === "VerificationLockedError") {
6109
- cookies__default.default.remove(this.storageKey);
6173
+ localStorage.removeItem(this.storageKey);
6110
6174
  return {
6111
6175
  ok: false,
6112
6176
  error: res.error
@@ -6127,9 +6191,7 @@ var SessionManagerCookie = class {
6127
6191
  accessTokenExpiresAt: addMinutes(now, 8).getTime(),
6128
6192
  refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
6129
6193
  };
6130
- cookies__default.default.set(this.storageKey, JSON.stringify(obj), {
6131
- expires: subMinutes(addDays(now, 30), 2).getTime()
6132
- });
6194
+ localStorage.setItem(this.storageKey, JSON.stringify(obj));
6133
6195
  }
6134
6196
  return {
6135
6197
  ok: true,
@@ -6147,13 +6209,13 @@ var SessionManagerCookie = class {
6147
6209
  }
6148
6210
  async refresh() {
6149
6211
  if (this.isServer) {
6150
- this.logger.warn("'client cookies' is not available on the server.");
6212
+ this.logger.warn("'localStorage' is not available on the server.");
6151
6213
  return {
6152
6214
  ok: true,
6153
6215
  data: null
6154
6216
  };
6155
6217
  }
6156
- const val = cookies__default.default.get(this.storageKey);
6218
+ const val = localStorage.getItem(this.storageKey);
6157
6219
  if (!val) {
6158
6220
  return {
6159
6221
  ok: true,
@@ -6170,7 +6232,7 @@ var SessionManagerCookie = class {
6170
6232
  if (!res.ok) {
6171
6233
  this.logger.error(`Failed to refresh session: ${res.error.message}`);
6172
6234
  if (res.error.name === "InvalidTokenError" || res.error.name === "AccountBlacklistedError" || res.error.name === "VerificationLockedError") {
6173
- cookies__default.default.remove(this.storageKey);
6235
+ localStorage.removeItem(this.storageKey);
6174
6236
  return {
6175
6237
  ok: false,
6176
6238
  error: res.error
@@ -6191,9 +6253,7 @@ var SessionManagerCookie = class {
6191
6253
  accessTokenExpiresAt: addMinutes(now, 8).getTime(),
6192
6254
  refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
6193
6255
  };
6194
- cookies__default.default.set(this.storageKey, JSON.stringify(obj), {
6195
- expires: subMinutes(addDays(now, 30), 2).getTime()
6196
- });
6256
+ localStorage.setItem(this.storageKey, JSON.stringify(obj));
6197
6257
  return {
6198
6258
  ok: true,
6199
6259
  data: obj
@@ -6210,18 +6270,18 @@ var SessionManagerCookie = class {
6210
6270
  }
6211
6271
  async destroy() {
6212
6272
  if (this.isServer) {
6213
- this.logger.warn("'client cookies' is not available on the server.");
6273
+ this.logger.warn("'localStorage' is not available on the server.");
6214
6274
  return;
6215
6275
  }
6216
6276
  const res = await this.get();
6217
6277
  if (res.data?.accessToken) {
6218
6278
  await this.authService.destroySession(res.data.accessToken);
6219
6279
  }
6220
- cookies__default.default.remove(this.storageKey);
6280
+ localStorage.removeItem(this.storageKey);
6221
6281
  }
6222
6282
  async verify() {
6223
6283
  if (this.isServer) {
6224
- this.logger.warn("'client cookies' is not available on the server.");
6284
+ this.logger.warn("'localStorage' is not available on the server.");
6225
6285
  return true;
6226
6286
  }
6227
6287
  const s = await this.get();
@@ -6231,13 +6291,13 @@ var SessionManagerCookie = class {
6231
6291
  if (!s.data) return true;
6232
6292
  const v = await this.authService.verifySession(s.data.accessToken);
6233
6293
  if (!v) {
6234
- cookies__default.default.remove(this.storageKey);
6294
+ localStorage.removeItem(this.storageKey);
6235
6295
  }
6236
6296
  return v;
6237
6297
  }
6238
6298
  get onMaya() {
6239
6299
  if (this.isServer) {
6240
- this.logger.warn("'client cookies' is not available on the server.");
6300
+ this.logger.warn("'localStorage' is not available on the server.");
6241
6301
  return false;
6242
6302
  }
6243
6303
  return localStorage.getItem(this.platformStorageKey) === "MAYA";
@@ -6353,6 +6413,7 @@ var Transformer = class {
6353
6413
  cashback: this.cashback.bind(this),
6354
6414
  bonus: this.bonus.bind(this),
6355
6415
  cashbackBonus: this.cashbackBonus.bind(this),
6416
+ memberCabinetSiteMachine: this.memberCabinetSiteMachine.bind(this),
6356
6417
  file: this.file.bind(this),
6357
6418
  pointsWallet: this.pointsWallet.bind(this),
6358
6419
  pointsWalletTransaction: this.pointsWalletTransaction.bind(this),
@@ -7458,6 +7519,16 @@ var Transformer = class {
7458
7519
  };
7459
7520
  return o;
7460
7521
  }
7522
+ memberCabinetSiteMachine(data) {
7523
+ const o = {
7524
+ id: data.id,
7525
+ name: data.name,
7526
+ fingerprint: data.fingerprint,
7527
+ status: data.status,
7528
+ dateTimeCreated: new Date(data.dateTimeCreated)
7529
+ };
7530
+ return o;
7531
+ }
7461
7532
  file(data) {
7462
7533
  const o = {
7463
7534
  id: data.id,
@@ -8245,6 +8316,19 @@ var Sdk = class {
8245
8316
  data: this.transformer.transform.site(res.data)
8246
8317
  };
8247
8318
  }
8319
+ /*
8320
+ *=============================================
8321
+ * MACHINE EXTENSION
8322
+ *=============================================
8323
+ */
8324
+ async memberCabinetSiteMachine() {
8325
+ const res = await this.extensionService.memberCabinetSiteMachine();
8326
+ if (!res.ok) return res;
8327
+ return {
8328
+ ok: true,
8329
+ data: res.data ? this.transformer.transform.memberCabinetSiteMachine(res.data) : null
8330
+ };
8331
+ }
8248
8332
  /*
8249
8333
  *=============================================
8250
8334
  * PLATFORM
@@ -9665,6 +9749,36 @@ var Sdk = class {
9665
9749
  })
9666
9750
  };
9667
9751
  }
9752
+ async topWinsNext() {
9753
+ const res0 = await this.portalService.topWinsNext();
9754
+ const ids = res0.data?.length ? [...new Set(res0.data.map((e) => e.game.id))] : [];
9755
+ if (ids.length <= 0) {
9756
+ return {
9757
+ ok: true,
9758
+ data: []
9759
+ };
9760
+ }
9761
+ const res1 = await this.cmsPortalService.games({
9762
+ filter: {
9763
+ reference: {
9764
+ in: ids
9765
+ }
9766
+ }
9767
+ });
9768
+ if (!res1.ok) return res1;
9769
+ return {
9770
+ ok: true,
9771
+ data: res0?.data?.map((o) => {
9772
+ const game = res1.data.edges.find(
9773
+ (e) => e.node.reference === o.game.id
9774
+ )?.node;
9775
+ return this.transformer.transform.topWin({
9776
+ ...o,
9777
+ game
9778
+ });
9779
+ })
9780
+ };
9781
+ }
9668
9782
  /*
9669
9783
  *=============================================
9670
9784
  * JACKPOT
@@ -9818,7 +9932,7 @@ var ENDPOINTS = {
9818
9932
  opexapay: "https://external.opexapay.opexa.io"
9819
9933
  },
9820
9934
  staging: {
9821
- auth: "https://auth.staging.atalos.io",
9935
+ auth: "https://auth.staging.opexacms.io",
9822
9936
  game: "https://game.staging.atalos.io/graphql",
9823
9937
  extension: "https://extension.staging.atalos.io/graphql",
9824
9938
  file: "https://file.staging.atalos.io/graphql",