@opexa/portal-sdk 0.0.183 → 0.0.184
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 +27 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -4
- package/dist/index.d.ts +1 -4
- package/dist/index.js +27 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1756,7 +1756,6 @@ var TOP_WINS_QUERY = gql`
|
|
|
1756
1756
|
id
|
|
1757
1757
|
game {
|
|
1758
1758
|
id
|
|
1759
|
-
name
|
|
1760
1759
|
}
|
|
1761
1760
|
member {
|
|
1762
1761
|
id
|
|
@@ -4654,12 +4653,9 @@ var Transformer = class {
|
|
|
4654
4653
|
};
|
|
4655
4654
|
}
|
|
4656
4655
|
topWin(data) {
|
|
4657
|
-
|
|
4656
|
+
const o = {
|
|
4658
4657
|
id: data.id,
|
|
4659
|
-
game:
|
|
4660
|
-
id: data.game.id,
|
|
4661
|
-
name: data.game.name
|
|
4662
|
-
},
|
|
4658
|
+
game: data.game ? this.game(data.game) : void 0,
|
|
4663
4659
|
member: {
|
|
4664
4660
|
id: data.member.id,
|
|
4665
4661
|
name: data.member.name
|
|
@@ -4667,6 +4663,7 @@ var Transformer = class {
|
|
|
4667
4663
|
multiplier: parseDecimal(data.multiplier, 0),
|
|
4668
4664
|
payout: parseDecimal(data.payout, 0)
|
|
4669
4665
|
};
|
|
4666
|
+
return o;
|
|
4670
4667
|
}
|
|
4671
4668
|
};
|
|
4672
4669
|
|
|
@@ -5913,11 +5910,32 @@ var Sdk = class {
|
|
|
5913
5910
|
/*+----------------------------------------+*/
|
|
5914
5911
|
/**/
|
|
5915
5912
|
async topWins() {
|
|
5916
|
-
const
|
|
5917
|
-
if (!
|
|
5913
|
+
const res0 = await this.portalService.topWins();
|
|
5914
|
+
if (!res0.ok) return res0;
|
|
5915
|
+
const ids = [...new Set(res0.data.map((o) => o.game.id))];
|
|
5916
|
+
if (ids.length <= 0) {
|
|
5917
|
+
return {
|
|
5918
|
+
ok: true,
|
|
5919
|
+
data: []
|
|
5920
|
+
};
|
|
5921
|
+
}
|
|
5922
|
+
const res1 = await this.cmsPortalService.games({
|
|
5923
|
+
filter: {
|
|
5924
|
+
reference: {
|
|
5925
|
+
in: ids
|
|
5926
|
+
}
|
|
5927
|
+
}
|
|
5928
|
+
});
|
|
5929
|
+
if (!res1.ok) return res1;
|
|
5918
5930
|
return {
|
|
5919
5931
|
ok: true,
|
|
5920
|
-
data:
|
|
5932
|
+
data: res0.data.map((o) => {
|
|
5933
|
+
const game = res1.data.edges.find((e) => e.node.id === o.game.id)?.node;
|
|
5934
|
+
return this.transformer.transform.topWin({
|
|
5935
|
+
...o,
|
|
5936
|
+
game
|
|
5937
|
+
});
|
|
5938
|
+
})
|
|
5921
5939
|
};
|
|
5922
5940
|
}
|
|
5923
5941
|
/**/
|