@opexa/portal-sdk 0.59.78 → 0.59.80

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.
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var core = require('@capacitor/core');
3
4
  var thumbmarkjs = require('@thumbmarkjs/thumbmarkjs');
4
5
 
5
6
  // src/utils/gql.ts
@@ -3359,13 +3360,13 @@ var RECENT_GAMES_QUERY = gql`
3359
3360
  }
3360
3361
  `;
3361
3362
  var ADD_FAVORITE_GAME_MUTATION = gql`
3362
- mutation AddFavoriteGame($game: ObjectId!) {
3363
- addFavoriteGame(input: { game: $game })
3363
+ mutation AddFavoriteGame($input: AddFavoriteGameInput!) {
3364
+ addFavoriteGame(input: $input)
3364
3365
  }
3365
3366
  `;
3366
3367
  var REMOVE_FAVORITE_GAME_MUTATION = gql`
3367
- mutation RemoveFavoriteGame($game: ObjectId!) {
3368
- removeFavoriteGame(input: { game: $game })
3368
+ mutation RemoveFavoriteGame($input: RemoveFavoriteGameInput!) {
3369
+ removeFavoriteGame(input: $input)
3369
3370
  }
3370
3371
  `;
3371
3372
  var WALLET_GAMES_QUERY = gql`
@@ -4464,6 +4465,13 @@ var ERROR_MAP = {
4464
4465
  };
4465
4466
 
4466
4467
  // src/services/auth.service.ts
4468
+ function isWebPlatform() {
4469
+ try {
4470
+ return core.Capacitor.getPlatform() === "web";
4471
+ } catch {
4472
+ return false;
4473
+ }
4474
+ }
4467
4475
  var AuthService = class {
4468
4476
  url;
4469
4477
  options;
@@ -4517,7 +4525,9 @@ var AuthService = class {
4517
4525
  headers.set("test-pass", input.testPass);
4518
4526
  }
4519
4527
  try {
4520
- const res = await fetch(`${this.url}${version !== 1 ? `/v${version}/sessions` : "/sessions"}`, {
4528
+ const isWeb = isWebPlatform();
4529
+ const queryParam = isWeb && version === 4 ? "?type=web" : "";
4530
+ const res = await fetch(`${this.url}${version !== 1 ? `/v${version}/sessions` : "/sessions"}${queryParam}`, {
4521
4531
  method: "POST",
4522
4532
  headers,
4523
4533
  body: JSON.stringify(input),
@@ -4615,8 +4625,10 @@ var AuthService = class {
4615
4625
  }
4616
4626
  }
4617
4627
  try {
4628
+ const isWeb = isWebPlatform();
4629
+ const queryParam = isWeb && version === 4 ? "?type=web" : "";
4618
4630
  const res = await fetch(
4619
- `${this.url}${version !== 1 ? `/v${version}/session/refresh` : "/session:refresh"}`,
4631
+ `${this.url}${version !== 1 ? `/v${version}/session/refresh` : "/session:refresh"}${queryParam}`,
4620
4632
  {
4621
4633
  method: "POST",
4622
4634
  headers,
@@ -4662,6 +4674,12 @@ var AuthService = class {
4662
4674
  async destroySession(accessToken, version = 1) {
4663
4675
  const headers = new Headers(this.headers);
4664
4676
  headers.append("Authorization", `Bearer ${accessToken}`);
4677
+ if (version === 3 || version === 4) {
4678
+ const fingerprint = await getFingerPrint();
4679
+ if (fingerprint) {
4680
+ headers.append("Fingerprint", fingerprint);
4681
+ }
4682
+ }
4665
4683
  try {
4666
4684
  const res = await fetch(
4667
4685
  `${this.url}${version !== 1 ? `/v${version}/session` : "/session"}`,