@opexa/portal-sdk 0.44.7 → 0.44.8

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.d.cts CHANGED
@@ -878,12 +878,14 @@ interface CreateGameSessionByReferenceInput {
878
878
  game?: never;
879
879
  provider: GameProvider;
880
880
  reference: string;
881
+ homepageUrl?: boolean;
881
882
  }
882
883
  interface CreateGameSessionByIdInput {
883
884
  id?: string;
884
885
  game: `SPORTS:${Extract<GameProvider, 'BTI' | 'SABA' | 'DIGITAIN'>}` | (string & {});
885
886
  provider?: never;
886
887
  reference?: never;
888
+ homepageUrl?: boolean;
887
889
  }
888
890
  type CreateGameSessionInput = CreateGameSessionByReferenceInput | CreateGameSessionByIdInput;
889
891
  type CreateGameSessionError = UnionAlias<CreateGameSessionError$1>;
package/dist/index.d.ts CHANGED
@@ -878,12 +878,14 @@ interface CreateGameSessionByReferenceInput {
878
878
  game?: never;
879
879
  provider: GameProvider;
880
880
  reference: string;
881
+ homepageUrl?: boolean;
881
882
  }
882
883
  interface CreateGameSessionByIdInput {
883
884
  id?: string;
884
885
  game: `SPORTS:${Extract<GameProvider, 'BTI' | 'SABA' | 'DIGITAIN'>}` | (string & {});
885
886
  provider?: never;
886
887
  reference?: never;
888
+ homepageUrl?: boolean;
887
889
  }
888
890
  type CreateGameSessionInput = CreateGameSessionByReferenceInput | CreateGameSessionByIdInput;
889
891
  type CreateGameSessionError = UnionAlias<CreateGameSessionError$1>;
package/dist/index.js CHANGED
@@ -7099,6 +7099,18 @@ var Transformer = class {
7099
7099
  ...data.type === "WAGERING" && {
7100
7100
  stage: data.stage
7101
7101
  },
7102
+ ...data.type === "WAGERING" && data?.stages?.length && {
7103
+ stages: data.stages.map((stage) => ({
7104
+ bonusAmount: parseDecimal(stage.bonusAmount, 0),
7105
+ cleared: stage.cleared ?? false,
7106
+ targetTurnover: parseDecimal(stage.targetTurnover, 0),
7107
+ bonusTurnoverRequirementMultiplier: parseDecimal(
7108
+ stage.bonusTurnoverRequirementMultiplier,
7109
+ 0
7110
+ ),
7111
+ dateTimeCleared: new Date(stage.dateTimeCleared)
7112
+ }))
7113
+ },
7102
7114
  ...data.type === "DAILY_CHECKIN" && {
7103
7115
  seventhDayBonusAmount: parseDecimal(data.seventhDayBonusAmount, 0),
7104
7116
  sixthDayBonusAmount: parseDecimal(data.sixthDayBonusAmount, 0),
@@ -8614,14 +8626,18 @@ var Sdk = class {
8614
8626
  }
8615
8627
  async createGameSession(input) {
8616
8628
  const id = input.id ?? ObjectId.generate(ObjectType.GameSession).toString();
8629
+ const withHomepageUrl = input.homepageUrl ?? true;
8617
8630
  if (input.provider) {
8618
8631
  const res = NEW_GAME_PROVIDERS.includes(input.provider) ? await this.walletService.createGameSession({
8619
- input: { id, game: input.reference }
8632
+ input: {
8633
+ id,
8634
+ game: input.reference
8635
+ }
8620
8636
  }) : await this.gameService.createGameSession({
8621
8637
  input: {
8622
8638
  id,
8623
8639
  game: input.reference,
8624
- homepageUrl: typeof window === "undefined" ? void 0 : window.location.origin
8640
+ homepageUrl: !withHomepageUrl || typeof window === "undefined" ? void 0 : window.location.origin
8625
8641
  }
8626
8642
  });
8627
8643
  return res.ok ? { ok: true, data: { id } } : res;