@opexa/portal-sdk 0.59.109 → 0.59.111

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
@@ -3435,7 +3435,7 @@ var WALLET_GAMES_QUERY = gql`
3435
3435
  }
3436
3436
  `;
3437
3437
  var _GAMES_NEXT_QUERY = gql`
3438
- query PlatformGames($first: Int, $after: Cursor, $filter: _GameFilterInput) {
3438
+ query _games($first: Int, $after: Cursor, $filter: _GameFilterInput) {
3439
3439
  _games(first: $first, after: $after, filter: $filter) {
3440
3440
  totalCount
3441
3441
  pageInfo {
@@ -3468,7 +3468,7 @@ var _GAMES_NEXT_QUERY = gql`
3468
3468
  }
3469
3469
  `;
3470
3470
  var _GAMES_NEXT_QUERY__STAGING = gql`
3471
- query PlatformGames($first: Int, $after: Cursor, $filter: _GameFilterInput) {
3471
+ query _games($first: Int, $after: Cursor, $filter: _GameFilterInput) {
3472
3472
  _games(first: $first, after: $after, filter: $filter) {
3473
3473
  totalCount
3474
3474
  pageInfo {
@@ -8720,6 +8720,7 @@ var Transformer = class {
8720
8720
  latestBetRecord: this.latestBetRecord.bind(this),
8721
8721
  transactionRecord: this.transactionRecord.bind(this),
8722
8722
  game: this.game.bind(this),
8723
+ _games: this._games.bind(this),
8723
8724
  gameSession: this.gameSession.bind(this),
8724
8725
  promo: this.promo.bind(this),
8725
8726
  cashback: this.cashback.bind(this),
@@ -9897,6 +9898,39 @@ var Transformer = class {
9897
9898
  };
9898
9899
  return o;
9899
9900
  }
9901
+ _games(data) {
9902
+ const games = data.edges.flatMap(({ cursor, node }) => {
9903
+ if (node.hidden || node.status !== "ACTIVE" || !node.type || !node.provider) {
9904
+ return [];
9905
+ }
9906
+ const name = node.displayName?.trim() || node.name;
9907
+ if (!name) return [];
9908
+ const imageId = objectId.ObjectId.from(node.id).toString("hex");
9909
+ const fallback = `${ENDPOINTS.production.static}/images/${node.provider.toLowerCase()}/thumbnail-${imageId}.webp`;
9910
+ return [
9911
+ {
9912
+ id: node.id,
9913
+ // Wallet's ID is the launch/favorite reference; reference is a provider code.
9914
+ reference: node.id,
9915
+ name,
9916
+ type: node.type,
9917
+ provider: node.provider,
9918
+ images: [
9919
+ ...new Set(node.image ? [node.image, fallback] : [fallback])
9920
+ ],
9921
+ tags: [],
9922
+ favorite: false,
9923
+ cursor
9924
+ }
9925
+ ];
9926
+ });
9927
+ return {
9928
+ _games: games,
9929
+ totalCount: data.totalCount,
9930
+ hasNextPage: data.pageInfo.hasNextPage,
9931
+ endCursor: data.pageInfo.endCursor ?? void 0
9932
+ };
9933
+ }
9900
9934
  gameSession(data) {
9901
9935
  const o = {
9902
9936
  id: data.id,
@@ -12298,7 +12332,11 @@ var Sdk = class {
12298
12332
  }
12299
12333
  };
12300
12334
  }
12301
- async __games__next(input) {
12335
+ /**
12336
+ * Fetches the Wallet-backed platform game catalog with cursor pagination.
12337
+ * Search is applied to `displayName.contains` alongside the supplied filters.
12338
+ */
12339
+ async _games__next(input) {
12302
12340
  let variables;
12303
12341
  if (input) {
12304
12342
  const { search, ...rest } = input;
@@ -12317,15 +12355,7 @@ var Sdk = class {
12317
12355
  if (!res.ok) return res;
12318
12356
  return {
12319
12357
  ok: true,
12320
- data: {
12321
- platformGames: res.data.edges.map(({ cursor, node }) => ({
12322
- ...node,
12323
- cursor
12324
- })),
12325
- totalCount: res.data.totalCount,
12326
- hasNextPage: res.data.pageInfo.hasNextPage,
12327
- endCursor: res.data.pageInfo.endCursor ?? void 0
12328
- }
12358
+ data: this.transformer.transform._games(res.data)
12329
12359
  };
12330
12360
  }
12331
12361
  async gameGroups(input) {