@opexa/portal-sdk 0.59.113 → 0.59.114
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/README.md +9 -2
- package/dist/index.cjs +44 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +44 -31
- package/dist/index.js.map +1 -1
- package/dist/services/index.d.cts +2 -2
- package/dist/services/index.d.ts +2 -2
- package/dist/{types-ujZqvY5s.d.cts → types-Benm-5jN.d.cts} +4 -3
- package/dist/{types-LlyaAtr8.d.ts → types-qEfyPvCj.d.ts} +4 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1441,12 +1441,19 @@ function Page() {
|
|
|
1441
1441
|
};
|
|
1442
1442
|
```
|
|
1443
1443
|
|
|
1444
|
+
- `gameGroups(input?)` and `gameGroup({ id })` query the Wallet endpoint.
|
|
1445
|
+
Their `games` use the same normalization as `_games__next`, including display
|
|
1446
|
+
names, thumbnail fallbacks, and filtering unavailable or incomplete games.
|
|
1447
|
+
Group metadata, timestamps, game order, and pagination cursors are preserved;
|
|
1448
|
+
no application-side game transformation is needed. Portal `_gameGroups` and
|
|
1449
|
+
`_gameGroup` remain separate APIs.
|
|
1450
|
+
|
|
1444
1451
|
- `_games__next` - Retrieve the Wallet-backed game catalog as normalized `Game`
|
|
1445
1452
|
objects under `data._games`. The optional `search` value is applied to
|
|
1446
|
-
`displayName.contains`.
|
|
1453
|
+
`displayName.contains`.
|
|
1447
1454
|
The SDK transformer excludes hidden, inactive, or incomplete games, uses the
|
|
1448
1455
|
display name when available, and supplies a fallback thumbnail. The game ID
|
|
1449
|
-
|
|
1456
|
+
and Wallet `reference` are preserved, along with pagination metadata.
|
|
1450
1457
|
|
|
1451
1458
|
```ts
|
|
1452
1459
|
_games__next(input?: PlatformGamesInput): Promise<PlatformGamesReturn>
|
package/dist/index.cjs
CHANGED
|
@@ -8721,6 +8721,8 @@ var Transformer = class {
|
|
|
8721
8721
|
transactionRecord: this.transactionRecord.bind(this),
|
|
8722
8722
|
game: this.game.bind(this),
|
|
8723
8723
|
_games: this._games.bind(this),
|
|
8724
|
+
gameGroup: this.gameGroup.bind(this),
|
|
8725
|
+
gameGroups: this.gameGroups.bind(this),
|
|
8724
8726
|
gameSession: this.gameSession.bind(this),
|
|
8725
8727
|
promo: this.promo.bind(this),
|
|
8726
8728
|
cashback: this.cashback.bind(this),
|
|
@@ -9898,29 +9900,28 @@ var Transformer = class {
|
|
|
9898
9900
|
};
|
|
9899
9901
|
return o;
|
|
9900
9902
|
}
|
|
9903
|
+
walletGame(node) {
|
|
9904
|
+
if (node.hidden || node.status !== "ACTIVE" || !node.type || !node.provider) {
|
|
9905
|
+
return null;
|
|
9906
|
+
}
|
|
9907
|
+
const name = node.displayName?.trim() || node.name;
|
|
9908
|
+
if (!name) return null;
|
|
9909
|
+
const fallback = `${ENDPOINTS.production.static}/images/${node.provider.toLowerCase()}/thumbnail-${node.id}.webp`;
|
|
9910
|
+
return {
|
|
9911
|
+
id: node.id,
|
|
9912
|
+
reference: node.reference,
|
|
9913
|
+
name,
|
|
9914
|
+
type: node.type,
|
|
9915
|
+
provider: node.provider,
|
|
9916
|
+
images: [...new Set(node.image ? [node.image, fallback] : [fallback])],
|
|
9917
|
+
tags: [],
|
|
9918
|
+
favorite: false
|
|
9919
|
+
};
|
|
9920
|
+
}
|
|
9901
9921
|
_games(data) {
|
|
9902
9922
|
const games = data.edges.flatMap(({ cursor, node }) => {
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
}
|
|
9906
|
-
const name = node.displayName?.trim() || node.name;
|
|
9907
|
-
if (!name) return [];
|
|
9908
|
-
const fallback = `${ENDPOINTS.production.static}/images/${node.provider.toLowerCase()}/thumbnail-${node.id}.webp`;
|
|
9909
|
-
return [
|
|
9910
|
-
{
|
|
9911
|
-
id: node.id,
|
|
9912
|
-
reference: node.reference,
|
|
9913
|
-
name,
|
|
9914
|
-
type: node.type,
|
|
9915
|
-
provider: node.provider,
|
|
9916
|
-
images: [
|
|
9917
|
-
...new Set(node.image ? [node.image, fallback] : [fallback])
|
|
9918
|
-
],
|
|
9919
|
-
tags: [],
|
|
9920
|
-
favorite: false,
|
|
9921
|
-
cursor
|
|
9922
|
-
}
|
|
9923
|
-
];
|
|
9923
|
+
const game = this.walletGame(node);
|
|
9924
|
+
return game ? [{ ...game, cursor }] : [];
|
|
9924
9925
|
});
|
|
9925
9926
|
return {
|
|
9926
9927
|
_games: games,
|
|
@@ -9929,6 +9930,26 @@ var Transformer = class {
|
|
|
9929
9930
|
endCursor: data.pageInfo.endCursor ?? void 0
|
|
9930
9931
|
};
|
|
9931
9932
|
}
|
|
9933
|
+
gameGroup(data) {
|
|
9934
|
+
return {
|
|
9935
|
+
...data,
|
|
9936
|
+
games: data.games.flatMap((node) => {
|
|
9937
|
+
const game = this.walletGame(node);
|
|
9938
|
+
return game ? [{ ...node, ...game }] : [];
|
|
9939
|
+
})
|
|
9940
|
+
};
|
|
9941
|
+
}
|
|
9942
|
+
gameGroups(data) {
|
|
9943
|
+
return {
|
|
9944
|
+
gameGroups: data.edges.map(({ cursor, node }) => ({
|
|
9945
|
+
...this.gameGroup(node),
|
|
9946
|
+
cursor
|
|
9947
|
+
})),
|
|
9948
|
+
totalCount: data.totalCount,
|
|
9949
|
+
hasNextPage: data.pageInfo.hasNextPage,
|
|
9950
|
+
endCursor: data.pageInfo.endCursor ?? void 0
|
|
9951
|
+
};
|
|
9952
|
+
}
|
|
9932
9953
|
gameSession(data) {
|
|
9933
9954
|
const o = {
|
|
9934
9955
|
id: data.id,
|
|
@@ -12359,15 +12380,7 @@ var Sdk = class {
|
|
|
12359
12380
|
if (!res.ok) return res;
|
|
12360
12381
|
return {
|
|
12361
12382
|
ok: true,
|
|
12362
|
-
data:
|
|
12363
|
-
gameGroups: res.data.edges.map(({ cursor, node }) => ({
|
|
12364
|
-
...node,
|
|
12365
|
-
cursor
|
|
12366
|
-
})),
|
|
12367
|
-
totalCount: res.data.totalCount,
|
|
12368
|
-
hasNextPage: res.data.pageInfo.hasNextPage,
|
|
12369
|
-
endCursor: res.data.pageInfo.endCursor ?? void 0
|
|
12370
|
-
}
|
|
12383
|
+
data: this.transformer.transform.gameGroups(res.data)
|
|
12371
12384
|
};
|
|
12372
12385
|
}
|
|
12373
12386
|
async gameGroup(input) {
|
|
@@ -12375,7 +12388,7 @@ var Sdk = class {
|
|
|
12375
12388
|
if (!res.ok) return res;
|
|
12376
12389
|
return {
|
|
12377
12390
|
ok: true,
|
|
12378
|
-
data: res.data
|
|
12391
|
+
data: res.data ? this.transformer.transform.gameGroup(res.data) : null
|
|
12379
12392
|
};
|
|
12380
12393
|
}
|
|
12381
12394
|
/**
|