@opexa/portal-sdk 0.0.12 → 0.0.13
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.js +8 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -28
- package/dist/index.mjs.map +1 -1
- package/dist/sdk/types.d.ts +0 -1
- package/dist/services/game.d.ts +0 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -46,7 +46,7 @@ const Ae = o`
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
`,
|
|
49
|
+
`, k = o`
|
|
50
50
|
fragment GameFragment on Game {
|
|
51
51
|
id
|
|
52
52
|
type
|
|
@@ -54,7 +54,7 @@ const Ae = o`
|
|
|
54
54
|
provider
|
|
55
55
|
}
|
|
56
56
|
`, Se = o`
|
|
57
|
-
${
|
|
57
|
+
${k}
|
|
58
58
|
|
|
59
59
|
query Game($id: ObjectId!) {
|
|
60
60
|
node(id: $id) {
|
|
@@ -64,7 +64,7 @@ const Ae = o`
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
`, ke = o`
|
|
67
|
-
${
|
|
67
|
+
${k}
|
|
68
68
|
|
|
69
69
|
query Games($after: Cursor, $first: Int, $filter: GameFilterInput) {
|
|
70
70
|
games(after: $after, first: $first, filter: $filter) {
|
|
@@ -84,7 +84,7 @@ const Ae = o`
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
`, Ce = o`
|
|
87
|
-
${
|
|
87
|
+
${k}
|
|
88
88
|
|
|
89
89
|
query GamesByName($search: String!, $filter: GameFilterInput, $first: Int) {
|
|
90
90
|
gamesByName(search: $search, filter: $filter, first: $first) {
|
|
@@ -92,15 +92,10 @@ const Ae = o`
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
`, Te = o`
|
|
95
|
-
${g}
|
|
96
|
-
|
|
97
95
|
query GameSession($id: ObjectId!) {
|
|
98
96
|
node(id: $id) {
|
|
99
97
|
... on GameSession {
|
|
100
98
|
id
|
|
101
|
-
game {
|
|
102
|
-
...GameFragment
|
|
103
|
-
}
|
|
104
99
|
status
|
|
105
100
|
launchUrl
|
|
106
101
|
dateTimeCreated
|
|
@@ -121,7 +116,7 @@ const Ae = o`
|
|
|
121
116
|
endGameSession(input: $input)
|
|
122
117
|
}
|
|
123
118
|
`, Me = o`
|
|
124
|
-
${
|
|
119
|
+
${k}
|
|
125
120
|
|
|
126
121
|
query BetRecords($first: Int, $after: Cursor, $filter: BetRecordFilterInput) {
|
|
127
122
|
member {
|
|
@@ -179,7 +174,7 @@ const Ae = o`
|
|
|
179
174
|
}
|
|
180
175
|
}
|
|
181
176
|
|
|
182
|
-
${
|
|
177
|
+
${k}
|
|
183
178
|
`, T = o`
|
|
184
179
|
fragment FileFragment on File {
|
|
185
180
|
id
|
|
@@ -1604,7 +1599,7 @@ class b {
|
|
|
1604
1599
|
const p = await fetch(e);
|
|
1605
1600
|
if (!p.ok)
|
|
1606
1601
|
return { ok: !1, error: u(p.status) };
|
|
1607
|
-
const
|
|
1602
|
+
const g = await p.json(), C = g.data, l = (t = g.errors) == null ? void 0 : t.at(0);
|
|
1608
1603
|
return l ? ((a = l.extensions) == null ? void 0 : a.code) === "FORBIDDEN" || ((r = l.extensions) == null ? void 0 : r.code) === "ACCESS_TOKEN_EXPIRED" ? { ok: !1, error: u(403, l.message) } : ((s = l.extensions) == null ? void 0 : s.code) === "UNAUTHORIZED" ? { ok: !1, error: u(401, l.message) } : ((c = l.extensions) == null ? void 0 : c.code) === "BAD_USER_INPUT" || ((h = l.extensions) == null ? void 0 : h.code) === "BAD_REQUEST" ? { ok: !1, error: u(400, l.message) } : {
|
|
1609
1604
|
ok: !1,
|
|
1610
1605
|
error: u(500, l.message)
|
|
@@ -1678,11 +1673,11 @@ class be {
|
|
|
1678
1673
|
function M(i) {
|
|
1679
1674
|
return new Date(i.getTime());
|
|
1680
1675
|
}
|
|
1681
|
-
function
|
|
1676
|
+
function E(i, e) {
|
|
1682
1677
|
const t = M(i);
|
|
1683
1678
|
return t.setDate(t.getDate() + e), t;
|
|
1684
1679
|
}
|
|
1685
|
-
function
|
|
1680
|
+
function A(i, e) {
|
|
1686
1681
|
const t = M(i);
|
|
1687
1682
|
return t.setMinutes(t.getMinutes() + e), t;
|
|
1688
1683
|
}
|
|
@@ -1694,7 +1689,7 @@ function gt(i) {
|
|
|
1694
1689
|
setTimeout(e, i);
|
|
1695
1690
|
});
|
|
1696
1691
|
}
|
|
1697
|
-
function
|
|
1692
|
+
function S(i, e) {
|
|
1698
1693
|
const t = M(i);
|
|
1699
1694
|
return t.setMinutes(t.getMinutes() - e), t;
|
|
1700
1695
|
}
|
|
@@ -1732,8 +1727,8 @@ class Et {
|
|
|
1732
1727
|
JSON.stringify({
|
|
1733
1728
|
...r.data,
|
|
1734
1729
|
maya: !0,
|
|
1735
|
-
accessTokenExpiresAt:
|
|
1736
|
-
refreshTokenExpiresAt:
|
|
1730
|
+
accessTokenExpiresAt: A(s, 8).getTime(),
|
|
1731
|
+
refreshTokenExpiresAt: S(E(s, 30), 2).getTime()
|
|
1737
1732
|
})
|
|
1738
1733
|
), {
|
|
1739
1734
|
ok: !0,
|
|
@@ -1750,8 +1745,8 @@ class Et {
|
|
|
1750
1745
|
this.storageKey,
|
|
1751
1746
|
JSON.stringify({
|
|
1752
1747
|
...r.data,
|
|
1753
|
-
accessTokenExpiresAt:
|
|
1754
|
-
refreshTokenExpiresAt:
|
|
1748
|
+
accessTokenExpiresAt: A(s, 8).getTime(),
|
|
1749
|
+
refreshTokenExpiresAt: S(E(s, 30), 2).getTime()
|
|
1755
1750
|
})
|
|
1756
1751
|
), {
|
|
1757
1752
|
ok: !0,
|
|
@@ -1774,8 +1769,8 @@ class Et {
|
|
|
1774
1769
|
this.storageKey,
|
|
1775
1770
|
JSON.stringify({
|
|
1776
1771
|
...t.data,
|
|
1777
|
-
accessTokenExpiresAt:
|
|
1778
|
-
refreshTokenExpiresAt:
|
|
1772
|
+
accessTokenExpiresAt: A(a, 8).getTime(),
|
|
1773
|
+
refreshTokenExpiresAt: S(E(a, 30), 2).getTime()
|
|
1779
1774
|
})
|
|
1780
1775
|
), {
|
|
1781
1776
|
ok: !0,
|
|
@@ -1790,8 +1785,8 @@ class Et {
|
|
|
1790
1785
|
this.storageKey,
|
|
1791
1786
|
JSON.stringify({
|
|
1792
1787
|
...t.data,
|
|
1793
|
-
accessTokenExpiresAt:
|
|
1794
|
-
refreshTokenExpiresAt:
|
|
1788
|
+
accessTokenExpiresAt: A(a, 8).getTime(),
|
|
1789
|
+
refreshTokenExpiresAt: S(E(a, 30), 2).getTime()
|
|
1795
1790
|
})
|
|
1796
1791
|
), { ok: !0 };
|
|
1797
1792
|
} else
|
|
@@ -1836,8 +1831,8 @@ class Et {
|
|
|
1836
1831
|
this.logger.success("Session refreshed!"), a = /* @__PURE__ */ new Date(), t = {
|
|
1837
1832
|
...t,
|
|
1838
1833
|
...c.data,
|
|
1839
|
-
accessTokenExpiresAt:
|
|
1840
|
-
refreshTokenExpiresAt:
|
|
1834
|
+
accessTokenExpiresAt: A(a, 8).getTime(),
|
|
1835
|
+
refreshTokenExpiresAt: S(E(a, 30), 2).getTime()
|
|
1841
1836
|
}, window.localStorage.setItem(this.storageKey, JSON.stringify(t));
|
|
1842
1837
|
}
|
|
1843
1838
|
return {
|
|
@@ -1920,7 +1915,7 @@ class At {
|
|
|
1920
1915
|
};
|
|
1921
1916
|
}
|
|
1922
1917
|
platform(e) {
|
|
1923
|
-
var t, a, r, s, c, h, p,
|
|
1918
|
+
var t, a, r, s, c, h, p, g, C, l, D, N, I, R, x, P, G, $, B, W, U, O, q, F, L, V, Y, H, j, Q, K, z, J, X, Z, ee, te, ae, re, ne, oe, ie, se, me, de, ce, ue, le, pe;
|
|
1924
1919
|
return {
|
|
1925
1920
|
paymentSettings: {
|
|
1926
1921
|
minimumFirstDepositAmount: n(e.minimumFirstDepositAmount),
|
|
@@ -1936,7 +1931,7 @@ class At {
|
|
|
1936
1931
|
},
|
|
1937
1932
|
gcash: {
|
|
1938
1933
|
androidEnabled: ((p = e.gcashDepositGatewaySettings) == null ? void 0 : p.androidEnabled) ?? !1,
|
|
1939
|
-
iosEnabled: ((
|
|
1934
|
+
iosEnabled: ((g = e.gcashDepositGatewaySettings) == null ? void 0 : g.iosEnabled) ?? !1,
|
|
1940
1935
|
webEnabled: ((C = e.gcashDepositGatewaySettings) == null ? void 0 : C.webEnabled) ?? !1,
|
|
1941
1936
|
mobileWebEnabled: ((l = e.gcashDepositGatewaySettings) == null ? void 0 : l.mobileWebEnabled) ?? !1,
|
|
1942
1937
|
minimumAmount: n((D = e.gcashDepositGatewaySettings) == null ? void 0 : D.minimumAmount),
|
|
@@ -2155,7 +2150,6 @@ class At {
|
|
|
2155
2150
|
gameSession(e) {
|
|
2156
2151
|
return {
|
|
2157
2152
|
...e,
|
|
2158
|
-
game: this.game(e.game),
|
|
2159
2153
|
dateTimeCreated: new Date(e.dateTimeCreated),
|
|
2160
2154
|
dateTimeLastUpdated: new Date(e.dateTimeLastUpdated)
|
|
2161
2155
|
};
|