@opexa/portal-sdk 0.59.147 → 0.59.149

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
@@ -377,6 +377,21 @@ var GAME_SESSION_QUERY = {
377
377
  `
378
378
  };
379
379
  var CREATE_GAME_SESSION_MUTATION = gql`
380
+ mutation CreateGameSession($input: CreateGameSessionInput!) {
381
+ createGameSession(input: $input) {
382
+ ... on GameDoesNotExistError {
383
+ __typename
384
+ }
385
+ ... on GameProviderNotEnabledError {
386
+ __typename
387
+ }
388
+ ... on GameTypeNotEnabledError {
389
+ __typename
390
+ }
391
+ }
392
+ }
393
+ `;
394
+ var CREATE_GAME_SESSION_MUTATION_NEXT = gql`
380
395
  mutation CreateGameSession($input: CreateGameSessionInput!) {
381
396
  createGameSession(input: $input) {
382
397
  ... on BetLimitExceededError {
@@ -1087,6 +1102,9 @@ var CREATE_MAYA_DEPOSIT_MUTATION = gql`
1087
1102
  var CREATE_TEST_DEPOSIT_MUTATION = gql`
1088
1103
  mutation CreateTestDeposit($input: CreateTestDepositInput!) {
1089
1104
  createTestDeposit(input: $input) {
1105
+ ... on DepositLimitReachedError {
1106
+ __typename
1107
+ }
1090
1108
  ... on DepositPromoMaximumAmountExceededError {
1091
1109
  __typename
1092
1110
  }
@@ -5797,8 +5815,10 @@ var FileService = class {
5797
5815
  // src/services/game.service.ts
5798
5816
  var GameService = class {
5799
5817
  client;
5800
- constructor(client) {
5818
+ environment;
5819
+ constructor(client, environment = "development") {
5801
5820
  this.client = client;
5821
+ this.environment = environment;
5802
5822
  }
5803
5823
  async gameSession(variables) {
5804
5824
  const res = await this.client.request(GAME_SESSION_QUERY.legacy, variables);
@@ -5811,13 +5831,14 @@ var GameService = class {
5811
5831
  }
5812
5832
  async createGameSession(variables) {
5813
5833
  const { domain, ...others } = variables;
5814
- const res = await this.client.request(CREATE_GAME_SESSION_MUTATION, others, {
5834
+ const requestOptions = {
5815
5835
  headers: {
5816
5836
  ...domain && {
5817
5837
  Domain: domain
5818
5838
  }
5819
5839
  }
5820
- });
5840
+ };
5841
+ const res = this.environment === "staging" ? await this.client.request(CREATE_GAME_SESSION_MUTATION_NEXT, others, requestOptions) : await this.client.request(CREATE_GAME_SESSION_MUTATION, others, requestOptions);
5821
5842
  if (!res.ok) return res;
5822
5843
  if (res.data.createGameSession) {
5823
5844
  return {
@@ -7138,13 +7159,14 @@ var WalletService = class {
7138
7159
  }
7139
7160
  async createGameSession(variables) {
7140
7161
  const { domain, ...others } = variables;
7141
- const res = await this.client.request(CREATE_GAME_SESSION_MUTATION, others, {
7162
+ const requestOptions = {
7142
7163
  headers: {
7143
7164
  ...domain && {
7144
7165
  Domain: domain
7145
7166
  }
7146
7167
  }
7147
- });
7168
+ };
7169
+ const res = this.environment === "staging" ? await this.client.request(CREATE_GAME_SESSION_MUTATION_NEXT, others, requestOptions) : await this.client.request(CREATE_GAME_SESSION_MUTATION, others, requestOptions);
7148
7170
  if (!res.ok) return res;
7149
7171
  if (res.data.createGameSession) {
7150
7172
  return {
@@ -11374,7 +11396,8 @@ var Sdk = class {
11374
11396
  }
11375
11397
  });
11376
11398
  const gameService = new GameService(
11377
- new GraphQLClient(gameUrl, graphqlClientConfig)
11399
+ new GraphQLClient(gameUrl, graphqlClientConfig),
11400
+ environment
11378
11401
  );
11379
11402
  const extensionService = new ExtensionService(
11380
11403
  new GraphQLClient(extensionUrl, graphqlClientConfig)