@opexa/portal-sdk 0.4.0 → 0.5.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
@@ -382,9 +382,6 @@ var CREATE_MAYA_WITHDRAWAL_MUTATION = gql`
382
382
  ... on WithdrawalDailyLimitExceededError {
383
383
  __typename
384
384
  }
385
- ... on WalletDoesNotExistError {
386
- __typename
387
- }
388
385
  }
389
386
  }
390
387
  `;
@@ -1998,11 +1995,9 @@ var UNMARK_GAME_AS_FAVORITE = gql`
1998
1995
  `;
1999
1996
  var FAVORITE_GAMES_QUERY = gql`
2000
1997
  query favoriteGames {
2001
- id
2002
- name
2003
- type
2004
- provider
2005
- favorite
1998
+ favoriteGames {
1999
+ id
2000
+ }
2006
2001
  }
2007
2002
  `;
2008
2003
 
@@ -6332,7 +6327,29 @@ var Sdk = class {
6332
6327
  return await this.walletService.unmarkGameAsFavorite({ input });
6333
6328
  }
6334
6329
  async favoriteGames() {
6335
- return await this.walletService.favoriteGames();
6330
+ const res0 = await this.walletService.favoriteGames();
6331
+ const ids = res0.data?.length ? [...new Set(res0.data.map((e) => e.id))] : [];
6332
+ if (ids.length <= 0) {
6333
+ return {
6334
+ ok: true,
6335
+ data: []
6336
+ };
6337
+ }
6338
+ const res1 = await this.cmsPortalService.games({
6339
+ filter: {
6340
+ reference: {
6341
+ in: ids
6342
+ }
6343
+ }
6344
+ });
6345
+ if (!res1.ok) return res1;
6346
+ return {
6347
+ ok: true,
6348
+ data: res0.data?.map(({ id }) => {
6349
+ const game = res1.data.edges.find((e) => id === e.node.reference)?.node;
6350
+ return game ? this.transformer.transform.game(game) : null;
6351
+ }).filter(Boolean) ?? []
6352
+ };
6336
6353
  }
6337
6354
  /**/
6338
6355
  /*+----------------------------------------+*/