@opexa/portal-sdk 0.59.148 → 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 {
@@ -5800,8 +5815,10 @@ var FileService = class {
5800
5815
  // src/services/game.service.ts
5801
5816
  var GameService = class {
5802
5817
  client;
5803
- constructor(client) {
5818
+ environment;
5819
+ constructor(client, environment = "development") {
5804
5820
  this.client = client;
5821
+ this.environment = environment;
5805
5822
  }
5806
5823
  async gameSession(variables) {
5807
5824
  const res = await this.client.request(GAME_SESSION_QUERY.legacy, variables);
@@ -5814,13 +5831,14 @@ var GameService = class {
5814
5831
  }
5815
5832
  async createGameSession(variables) {
5816
5833
  const { domain, ...others } = variables;
5817
- const res = await this.client.request(CREATE_GAME_SESSION_MUTATION, others, {
5834
+ const requestOptions = {
5818
5835
  headers: {
5819
5836
  ...domain && {
5820
5837
  Domain: domain
5821
5838
  }
5822
5839
  }
5823
- });
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);
5824
5842
  if (!res.ok) return res;
5825
5843
  if (res.data.createGameSession) {
5826
5844
  return {
@@ -7141,13 +7159,14 @@ var WalletService = class {
7141
7159
  }
7142
7160
  async createGameSession(variables) {
7143
7161
  const { domain, ...others } = variables;
7144
- const res = await this.client.request(CREATE_GAME_SESSION_MUTATION, others, {
7162
+ const requestOptions = {
7145
7163
  headers: {
7146
7164
  ...domain && {
7147
7165
  Domain: domain
7148
7166
  }
7149
7167
  }
7150
- });
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);
7151
7170
  if (!res.ok) return res;
7152
7171
  if (res.data.createGameSession) {
7153
7172
  return {
@@ -11377,7 +11396,8 @@ var Sdk = class {
11377
11396
  }
11378
11397
  });
11379
11398
  const gameService = new GameService(
11380
- new GraphQLClient(gameUrl, graphqlClientConfig)
11399
+ new GraphQLClient(gameUrl, graphqlClientConfig),
11400
+ environment
11381
11401
  );
11382
11402
  const extensionService = new ExtensionService(
11383
11403
  new GraphQLClient(extensionUrl, graphqlClientConfig)