@opexa/portal-sdk 0.1.0 → 0.3.0

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
@@ -1968,6 +1968,25 @@ var UNREGISTER_FCM_DEVICE = gql`
1968
1968
  unregisterFCMDevice(input: $input)
1969
1969
  }
1970
1970
  `;
1971
+ var MARK_GAME_AS_FAVORITE = gql`
1972
+ mutation MarkGameAsFavorite($input: MarkGameAsFavoriteInput!) {
1973
+ markGameAsFavorite(input: $input)
1974
+ }
1975
+ `;
1976
+ var UNMARK_GAME_AS_FAVORITE = gql`
1977
+ mutation UnmarkGameAsFavorite($input: UnmarkGameAsFavoriteInput!) {
1978
+ unmarkGameAsFavorite(input: $input)
1979
+ }
1980
+ `;
1981
+ var FAVORITE_GAMES_QUERY = gql`
1982
+ query favoriteGames {
1983
+ id
1984
+ name
1985
+ type
1986
+ provider
1987
+ favorite
1988
+ }
1989
+ `;
1971
1990
 
1972
1991
  // src/services/utils.ts
1973
1992
  function createOperationError(code) {
@@ -3630,6 +3649,55 @@ var WalletService = class {
3630
3649
  ok: true
3631
3650
  };
3632
3651
  }
3652
+ async markGameAsFavorite(variables) {
3653
+ const res = await this.client.request(MARK_GAME_AS_FAVORITE, variables);
3654
+ if (!res.ok) return res;
3655
+ if (!res.data.markGameAsFavorite) {
3656
+ return {
3657
+ ok: false,
3658
+ error: {
3659
+ name: "UnknownError",
3660
+ message: "Something went wrong."
3661
+ }
3662
+ };
3663
+ }
3664
+ return {
3665
+ ok: true
3666
+ };
3667
+ }
3668
+ async unmarkGameAsFavorite(variables) {
3669
+ const res = await this.client.request(UNMARK_GAME_AS_FAVORITE, variables);
3670
+ if (!res.ok) return res;
3671
+ if (!res.data.unmarkGameAsFavorite) {
3672
+ return {
3673
+ ok: false,
3674
+ error: {
3675
+ name: "UnknownError",
3676
+ message: "Something went wrong."
3677
+ }
3678
+ };
3679
+ }
3680
+ return {
3681
+ ok: true
3682
+ };
3683
+ }
3684
+ async favoriteGames() {
3685
+ const res = await this.client.request(FAVORITE_GAMES_QUERY);
3686
+ if (!res.ok) return res;
3687
+ if (!res.data.favoriteGames) {
3688
+ return {
3689
+ ok: false,
3690
+ error: {
3691
+ name: "UnknownError",
3692
+ message: "Something went wrong."
3693
+ }
3694
+ };
3695
+ }
3696
+ return {
3697
+ ok: true,
3698
+ data: res.data.favoriteGames
3699
+ };
3700
+ }
3633
3701
  };
3634
3702
 
3635
3703
  // src/utils/clone-date.ts
@@ -4845,7 +4913,8 @@ var Transformer = class {
4845
4913
  name: data.name,
4846
4914
  images,
4847
4915
  provider: data.provider,
4848
- reference: data.reference
4916
+ reference: data.reference,
4917
+ favorite: data.favorite
4849
4918
  };
4850
4919
  return o;
4851
4920
  }
@@ -6238,6 +6307,15 @@ var Sdk = class {
6238
6307
  const res1 = await this.gameService.endGameSession({ input: { id } });
6239
6308
  return res1;
6240
6309
  }
6310
+ async markGameAsFavorite(input) {
6311
+ return await this.walletService.markGameAsFavorite({ input });
6312
+ }
6313
+ async unmarkGameAsFavorite(input) {
6314
+ return await this.walletService.unmarkGameAsFavorite({ input });
6315
+ }
6316
+ async favoriteGames() {
6317
+ return await this.walletService.favoriteGames();
6318
+ }
6241
6319
  /**/
6242
6320
  /*+----------------------------------------+*/
6243
6321
  /*+ FILE +*/