@opexa/portal-sdk 0.59.112 → 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 +60 -51
- 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 +60 -51
- 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,31 +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 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
|
-
];
|
|
9923
|
+
const game = this.walletGame(node);
|
|
9924
|
+
return game ? [{ ...game, cursor }] : [];
|
|
9926
9925
|
});
|
|
9927
9926
|
return {
|
|
9928
9927
|
_games: games,
|
|
@@ -9931,6 +9930,26 @@ var Transformer = class {
|
|
|
9931
9930
|
endCursor: data.pageInfo.endCursor ?? void 0
|
|
9932
9931
|
};
|
|
9933
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
|
+
}
|
|
9934
9953
|
gameSession(data) {
|
|
9935
9954
|
const o = {
|
|
9936
9955
|
id: data.id,
|
|
@@ -10079,28 +10098,26 @@ var Transformer = class {
|
|
|
10079
10098
|
name: data.rebateProgram.name,
|
|
10080
10099
|
rebatePercentageMode: data.rebateProgram.rebatePercentageMode ?? void 0,
|
|
10081
10100
|
rebatePercentageSettings: data.rebateProgram.rebatePercentageSettings ? {
|
|
10082
|
-
gameCategories: (data.rebateProgram.rebatePercentageSettings.gameCategories ?? []).map(
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
game: settings.game,
|
|
10092
|
-
percentage: parseDecimal(settings.percentage, 0)
|
|
10093
|
-
})
|
|
10094
|
-
)
|
|
10101
|
+
gameCategories: (data.rebateProgram.rebatePercentageSettings.gameCategories ?? []).map((settings) => ({
|
|
10102
|
+
gameProvider: settings.gameProvider,
|
|
10103
|
+
gameType: settings.gameType,
|
|
10104
|
+
percentage: parseDecimal(settings.percentage, 0)
|
|
10105
|
+
})),
|
|
10106
|
+
games: (data.rebateProgram.rebatePercentageSettings.games ?? []).map((settings) => ({
|
|
10107
|
+
game: settings.game,
|
|
10108
|
+
percentage: parseDecimal(settings.percentage, 0)
|
|
10109
|
+
}))
|
|
10095
10110
|
} : void 0,
|
|
10096
10111
|
rebatePercentageSettingsPerMemberLevel: data.rebateProgram.rebatePercentageSettingsPerMemberLevel?.map(
|
|
10097
10112
|
(settings) => ({
|
|
10098
10113
|
level: settings.level,
|
|
10099
|
-
gameCategories: (settings.gameCategories ?? []).map(
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10114
|
+
gameCategories: (settings.gameCategories ?? []).map(
|
|
10115
|
+
(gameCategory) => ({
|
|
10116
|
+
gameProvider: gameCategory.gameProvider,
|
|
10117
|
+
gameType: gameCategory.gameType,
|
|
10118
|
+
percentage: parseDecimal(gameCategory.percentage, 0)
|
|
10119
|
+
})
|
|
10120
|
+
),
|
|
10104
10121
|
games: (settings.games ?? []).map((game) => ({
|
|
10105
10122
|
game: game.game,
|
|
10106
10123
|
percentage: parseDecimal(game.percentage, 0)
|
|
@@ -12363,15 +12380,7 @@ var Sdk = class {
|
|
|
12363
12380
|
if (!res.ok) return res;
|
|
12364
12381
|
return {
|
|
12365
12382
|
ok: true,
|
|
12366
|
-
data:
|
|
12367
|
-
gameGroups: res.data.edges.map(({ cursor, node }) => ({
|
|
12368
|
-
...node,
|
|
12369
|
-
cursor
|
|
12370
|
-
})),
|
|
12371
|
-
totalCount: res.data.totalCount,
|
|
12372
|
-
hasNextPage: res.data.pageInfo.hasNextPage,
|
|
12373
|
-
endCursor: res.data.pageInfo.endCursor ?? void 0
|
|
12374
|
-
}
|
|
12383
|
+
data: this.transformer.transform.gameGroups(res.data)
|
|
12375
12384
|
};
|
|
12376
12385
|
}
|
|
12377
12386
|
async gameGroup(input) {
|
|
@@ -12379,7 +12388,7 @@ var Sdk = class {
|
|
|
12379
12388
|
if (!res.ok) return res;
|
|
12380
12389
|
return {
|
|
12381
12390
|
ok: true,
|
|
12382
|
-
data: res.data
|
|
12391
|
+
data: res.data ? this.transformer.transform.gameGroup(res.data) : null
|
|
12383
12392
|
};
|
|
12384
12393
|
}
|
|
12385
12394
|
/**
|