@opexa/portal-sdk 0.0.32 → 0.0.33
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 +5 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +86 -82
- package/dist/index.mjs.map +1 -1
- package/dist/sdk/types.d.ts +1 -0
- package/dist/services/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var _e = Object.defineProperty;
|
|
2
2
|
var Te = (n, e, t) => e in n ? _e(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
3
|
var d = (n, e, t) => Te(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { ObjectId as
|
|
4
|
+
import { ObjectId as b } from "@opexa/object-id";
|
|
5
5
|
import { ObjectId as Wt } from "@opexa/object-id";
|
|
6
|
-
const
|
|
6
|
+
const S = {
|
|
7
7
|
Account: 8,
|
|
8
8
|
Deposit: 9,
|
|
9
9
|
Withdrawal: 14,
|
|
@@ -16,8 +16,8 @@ const b = {
|
|
|
16
16
|
function o(n, ...e) {
|
|
17
17
|
let t = "";
|
|
18
18
|
for (const [a, r] of n.entries()) {
|
|
19
|
-
const
|
|
20
|
-
t = `${t}${r}${
|
|
19
|
+
const s = e.at(a) ?? "";
|
|
20
|
+
t = `${t}${r}${s}`;
|
|
21
21
|
}
|
|
22
22
|
return t.trim();
|
|
23
23
|
}
|
|
@@ -139,7 +139,7 @@ const x = o`
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
`,
|
|
142
|
+
`, be = o`
|
|
143
143
|
query GameSession($id: ObjectId!) {
|
|
144
144
|
node(id: $id) {
|
|
145
145
|
... on GameSession {
|
|
@@ -151,7 +151,7 @@ const x = o`
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
`,
|
|
154
|
+
`, Se = o`
|
|
155
155
|
mutation CreateGameSession($input: CreateGameSessionInput!) {
|
|
156
156
|
createGameSession(input: $input) {
|
|
157
157
|
... on GameDoesNotExistError {
|
|
@@ -316,7 +316,7 @@ const x = o`
|
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
`,
|
|
319
|
+
`, Oe = o`
|
|
320
320
|
mutation CreateMayaAppWithdrawal($input: CreateMayaAppWithdrawalInput!) {
|
|
321
321
|
createMayaAppWithdrawal(input: $input) {
|
|
322
322
|
... on AccountNotVerifiedError {
|
|
@@ -336,7 +336,7 @@ const x = o`
|
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
`,
|
|
339
|
+
`, Ue = o`
|
|
340
340
|
mutation CreateBankWithdrawal($input: CreateBankWithdrawalInput!) {
|
|
341
341
|
createBankWithdrawal(input: $input) {
|
|
342
342
|
... on MobileNumberNotVerifiedError {
|
|
@@ -650,6 +650,7 @@ const x = o`
|
|
|
650
650
|
description
|
|
651
651
|
activationStartDateTime
|
|
652
652
|
activationEndDateTime
|
|
653
|
+
turnoverContributionPercentagePerGameProvider
|
|
653
654
|
dateTimeCreated
|
|
654
655
|
dateTimeLastUpdated
|
|
655
656
|
}
|
|
@@ -1051,7 +1052,7 @@ function m(n) {
|
|
|
1051
1052
|
}[n]
|
|
1052
1053
|
};
|
|
1053
1054
|
}
|
|
1054
|
-
class
|
|
1055
|
+
class bt {
|
|
1055
1056
|
constructor(e) {
|
|
1056
1057
|
d(this, "client");
|
|
1057
1058
|
this.client = e;
|
|
@@ -1183,7 +1184,7 @@ const G = {
|
|
|
1183
1184
|
429: { name: "HttpTooManyRequests", message: "Too Many Requests" },
|
|
1184
1185
|
500: { name: "HttpInternalServerError", message: "Internal Server Error" }
|
|
1185
1186
|
};
|
|
1186
|
-
class
|
|
1187
|
+
class St {
|
|
1187
1188
|
constructor(e) {
|
|
1188
1189
|
d(this, "url");
|
|
1189
1190
|
d(this, "platform");
|
|
@@ -1505,7 +1506,7 @@ class Ae {
|
|
|
1505
1506
|
} : t;
|
|
1506
1507
|
}
|
|
1507
1508
|
async createMayaAppWithdrawal(e) {
|
|
1508
|
-
const t = await this.client.request(
|
|
1509
|
+
const t = await this.client.request(Oe, e);
|
|
1509
1510
|
return t.ok ? t.data.createMayaAppWithdrawal ? {
|
|
1510
1511
|
ok: !1,
|
|
1511
1512
|
error: m(t.data.createMayaAppWithdrawal.__typename)
|
|
@@ -1514,7 +1515,7 @@ class Ae {
|
|
|
1514
1515
|
} : t;
|
|
1515
1516
|
}
|
|
1516
1517
|
async createBankWithdrawal(e) {
|
|
1517
|
-
const t = await this.client.request(
|
|
1518
|
+
const t = await this.client.request(Ue, e);
|
|
1518
1519
|
return t.ok ? t.data.createBankWithdrawal ? {
|
|
1519
1520
|
ok: !1,
|
|
1520
1521
|
error: m(t.data.createBankWithdrawal.__typename)
|
|
@@ -1563,13 +1564,13 @@ class Ae {
|
|
|
1563
1564
|
}
|
|
1564
1565
|
async gameSession(e) {
|
|
1565
1566
|
const t = await this.client.request(
|
|
1566
|
-
|
|
1567
|
+
be,
|
|
1567
1568
|
e
|
|
1568
1569
|
);
|
|
1569
1570
|
return t.ok ? { ok: !0, data: t.data.node } : t;
|
|
1570
1571
|
}
|
|
1571
1572
|
async createGameSession(e) {
|
|
1572
|
-
const t = await this.client.request(
|
|
1573
|
+
const t = await this.client.request(Se, e);
|
|
1573
1574
|
return t.ok ? t.data.createGameSession ? {
|
|
1574
1575
|
ok: !1,
|
|
1575
1576
|
error: m(t.data.createGameSession.__typename)
|
|
@@ -1622,9 +1623,9 @@ class Ct {
|
|
|
1622
1623
|
} : e;
|
|
1623
1624
|
}
|
|
1624
1625
|
async games(e) {
|
|
1625
|
-
var r,
|
|
1626
|
+
var r, s, c, p, u, h, w, l, A, k, C, _, T, v, N, M;
|
|
1626
1627
|
const t = new URLSearchParams();
|
|
1627
|
-
e != null && e.first && t.set("first", e.first.toString()), e != null && e.after && t.set("after", e.after), e != null && e.search && t.set("search", e.search), (
|
|
1628
|
+
e != null && e.first && t.set("first", e.first.toString()), e != null && e.after && t.set("after", e.after), e != null && e.search && t.set("search", e.search), (s = (r = e == null ? void 0 : e.filter) == null ? void 0 : r.type) != null && s.equal && t.set("filter[type][eq]", e.filter.type.equal), (p = (c = e == null ? void 0 : e.filter) == null ? void 0 : c.type) != null && p.notEqual && t.set("filter[type][neq]", e.filter.type.notEqual), (h = (u = e == null ? void 0 : e.filter) == null ? void 0 : u.type) != null && h.in && t.set("filter[type][in]", e.filter.type.in.join(",")), (l = (w = e == null ? void 0 : e.filter) == null ? void 0 : w.type) != null && l.notIn && t.set("filter[type][nin]", e.filter.type.notIn.join(",")), (k = (A = e == null ? void 0 : e.filter) == null ? void 0 : A.provider) != null && k.equal && t.set("filter[provider][eq]", e.filter.provider.equal), (_ = (C = e == null ? void 0 : e.filter) == null ? void 0 : C.provider) != null && _.notEqual && t.set("filter[provider][neq]", e.filter.provider.notEqual), (v = (T = e == null ? void 0 : e.filter) == null ? void 0 : T.provider) != null && v.in && t.set("filter[provider][in]", e.filter.provider.in.join(",")), (M = (N = e == null ? void 0 : e.filter) == null ? void 0 : N.provider) != null && M.notIn && t.set("filter[provider][nin]", e.filter.provider.notIn.join(","));
|
|
1628
1629
|
const a = await this.getJson("/games", t);
|
|
1629
1630
|
return a.ok ? {
|
|
1630
1631
|
ok: !0,
|
|
@@ -1699,13 +1700,13 @@ class _t {
|
|
|
1699
1700
|
}
|
|
1700
1701
|
async gameSession(e) {
|
|
1701
1702
|
const t = await this.client.request(
|
|
1702
|
-
|
|
1703
|
+
be,
|
|
1703
1704
|
e
|
|
1704
1705
|
);
|
|
1705
1706
|
return t.ok ? { ok: !0, data: t.data.node } : t;
|
|
1706
1707
|
}
|
|
1707
1708
|
async createGameSession(e) {
|
|
1708
|
-
const t = await this.client.request(
|
|
1709
|
+
const t = await this.client.request(Se, e);
|
|
1709
1710
|
return t.ok ? t.data.createGameSession ? {
|
|
1710
1711
|
ok: !1,
|
|
1711
1712
|
error: m(t.data.createGameSession.__typename)
|
|
@@ -1745,11 +1746,11 @@ function $(n) {
|
|
|
1745
1746
|
function Nt(n) {
|
|
1746
1747
|
const e = [];
|
|
1747
1748
|
function t(a, r = []) {
|
|
1748
|
-
for (const
|
|
1749
|
-
const
|
|
1750
|
-
$(
|
|
1751
|
-
key: [...r,
|
|
1752
|
-
value:
|
|
1749
|
+
for (const s in a) {
|
|
1750
|
+
const c = a[s];
|
|
1751
|
+
$(c) ? t(c, [...r, s]) : Array.isArray(c) ? t(Mt(c), [...r, s]) : e.push({
|
|
1752
|
+
key: [...r, s],
|
|
1753
|
+
value: c
|
|
1753
1754
|
});
|
|
1754
1755
|
}
|
|
1755
1756
|
}
|
|
@@ -1770,7 +1771,7 @@ class E {
|
|
|
1770
1771
|
async request(e, t) {
|
|
1771
1772
|
const a = JSON.stringify({ query: e, variables: t }), r = new Headers(this.options.headers);
|
|
1772
1773
|
r.set("Content-Type", "application/json"), r.set("Accept", "application/json");
|
|
1773
|
-
const
|
|
1774
|
+
const s = await this.runMiddlewares(
|
|
1774
1775
|
new Request(this.url, {
|
|
1775
1776
|
...this.options,
|
|
1776
1777
|
body: a,
|
|
@@ -1778,13 +1779,13 @@ class E {
|
|
|
1778
1779
|
method: "POST"
|
|
1779
1780
|
})
|
|
1780
1781
|
);
|
|
1781
|
-
return await this.exec(
|
|
1782
|
+
return await this.exec(s);
|
|
1782
1783
|
}
|
|
1783
1784
|
/** Single file upload */
|
|
1784
1785
|
async upload(e, t) {
|
|
1785
1786
|
const a = this.createUploadBody(e, t), r = new Headers(this.options.headers);
|
|
1786
1787
|
r.delete("Content-Type");
|
|
1787
|
-
const
|
|
1788
|
+
const s = await this.runMiddlewares(
|
|
1788
1789
|
new Request(this.url, {
|
|
1789
1790
|
...this.options,
|
|
1790
1791
|
body: a,
|
|
@@ -1792,16 +1793,16 @@ class E {
|
|
|
1792
1793
|
method: "POST"
|
|
1793
1794
|
})
|
|
1794
1795
|
);
|
|
1795
|
-
return await this.exec(
|
|
1796
|
+
return await this.exec(s);
|
|
1796
1797
|
}
|
|
1797
1798
|
async exec(e) {
|
|
1798
|
-
var t, a, r,
|
|
1799
|
+
var t, a, r, s, c, p;
|
|
1799
1800
|
try {
|
|
1800
1801
|
const u = await fetch(e);
|
|
1801
1802
|
if (!u.ok)
|
|
1802
1803
|
return { ok: !1, error: f(u.status) };
|
|
1803
1804
|
const h = await u.json(), w = h.data, l = (t = h.errors) == null ? void 0 : t.at(0);
|
|
1804
|
-
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: f(403, l.message) } : ((
|
|
1805
|
+
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: f(403, l.message) } : ((s = l.extensions) == null ? void 0 : s.code) === "UNAUTHORIZED" ? { ok: !1, error: f(401, l.message) } : ((c = l.extensions) == null ? void 0 : c.code) === "BAD_USER_INPUT" || ((p = l.extensions) == null ? void 0 : p.code) === "BAD_REQUEST" ? { ok: !1, error: f(400, l.message) } : {
|
|
1805
1806
|
ok: !1,
|
|
1806
1807
|
error: f(500, l.message)
|
|
1807
1808
|
} : {
|
|
@@ -1823,7 +1824,7 @@ class E {
|
|
|
1823
1824
|
}
|
|
1824
1825
|
createUploadBody(e, t) {
|
|
1825
1826
|
const a = Nt(t).filter(
|
|
1826
|
-
(
|
|
1827
|
+
(c) => c.value instanceof File || c.value instanceof Blob
|
|
1827
1828
|
), r = new FormData();
|
|
1828
1829
|
r.append(
|
|
1829
1830
|
"operations",
|
|
@@ -1832,17 +1833,17 @@ class E {
|
|
|
1832
1833
|
variables: t
|
|
1833
1834
|
})
|
|
1834
1835
|
);
|
|
1835
|
-
const
|
|
1836
|
-
return a.forEach((
|
|
1837
|
-
|
|
1838
|
-
}), r.append("map", JSON.stringify(
|
|
1839
|
-
r.append(p.toString(),
|
|
1836
|
+
const s = {};
|
|
1837
|
+
return a.forEach((c, p) => {
|
|
1838
|
+
s[p.toString()] = [`variables.${c.key.join(".")}`];
|
|
1839
|
+
}), r.append("map", JSON.stringify(s)), a.forEach((c, p) => {
|
|
1840
|
+
r.append(p.toString(), c.value);
|
|
1840
1841
|
}), r;
|
|
1841
1842
|
}
|
|
1842
1843
|
}
|
|
1843
1844
|
async function g(n) {
|
|
1844
1845
|
const e = new TextEncoder().encode(n), t = await crypto.subtle.digest("SHA-256", e);
|
|
1845
|
-
return Array.from(new Uint8Array(t)).map((
|
|
1846
|
+
return Array.from(new Uint8Array(t)).map((s) => s.toString(16).padStart(2, "0")).join("");
|
|
1846
1847
|
}
|
|
1847
1848
|
class ke {
|
|
1848
1849
|
constructor(e) {
|
|
@@ -1888,11 +1889,11 @@ function we(n, e) {
|
|
|
1888
1889
|
maxAttempt: r = 3
|
|
1889
1890
|
/**/
|
|
1890
1891
|
} = e;
|
|
1891
|
-
async function c
|
|
1892
|
-
const u = p ?? r, h = await n(...
|
|
1893
|
-
return t(h) ? h : u > 1 ? (await Ce(a * ((r - u) / 2)), c
|
|
1892
|
+
async function s(c, p) {
|
|
1893
|
+
const u = p ?? r, h = await n(...c);
|
|
1894
|
+
return t(h) ? h : u > 1 ? (await Ce(a * ((r - u) / 2)), s(c, u - 1)) : h;
|
|
1894
1895
|
}
|
|
1895
|
-
return async (...
|
|
1896
|
+
return async (...c) => await s(c);
|
|
1896
1897
|
}
|
|
1897
1898
|
function P(n, e) {
|
|
1898
1899
|
const t = B(n);
|
|
@@ -1905,7 +1906,7 @@ class It {
|
|
|
1905
1906
|
d(this, "authService");
|
|
1906
1907
|
d(this, "walletService");
|
|
1907
1908
|
d(this, "_refreshing", !1);
|
|
1908
|
-
this.authService = new
|
|
1909
|
+
this.authService = new St({
|
|
1909
1910
|
url: e.authUrl,
|
|
1910
1911
|
platform: e.platform
|
|
1911
1912
|
}), this.walletService = new Ae(
|
|
@@ -1935,7 +1936,7 @@ class It {
|
|
|
1935
1936
|
}
|
|
1936
1937
|
};
|
|
1937
1938
|
if (e.type === "MAYA") {
|
|
1938
|
-
const
|
|
1939
|
+
const c = await we(() => this.walletService.mayaSession({ id: e.sessionId }), {
|
|
1939
1940
|
until: (w) => {
|
|
1940
1941
|
var l;
|
|
1941
1942
|
return w.ok && ((l = w.data) == null ? void 0 : l.member) != null;
|
|
@@ -1943,8 +1944,8 @@ class It {
|
|
|
1943
1944
|
interval: 1e3,
|
|
1944
1945
|
maxAttempt: 5
|
|
1945
1946
|
})();
|
|
1946
|
-
if (!
|
|
1947
|
-
if (!((r =
|
|
1947
|
+
if (!c.ok) return c;
|
|
1948
|
+
if (!((r = c.data) != null && r.member))
|
|
1948
1949
|
return {
|
|
1949
1950
|
ok: !1,
|
|
1950
1951
|
error: {
|
|
@@ -1972,22 +1973,22 @@ class It {
|
|
|
1972
1973
|
};
|
|
1973
1974
|
}
|
|
1974
1975
|
if (e.type === "MOBILE_NUMBER") {
|
|
1975
|
-
const
|
|
1976
|
-
if (
|
|
1977
|
-
const
|
|
1976
|
+
const s = await this.authService.createSession(e);
|
|
1977
|
+
if (s.ok) {
|
|
1978
|
+
const c = /* @__PURE__ */ new Date();
|
|
1978
1979
|
return window.localStorage.setItem(
|
|
1979
1980
|
this.storageKey,
|
|
1980
1981
|
JSON.stringify({
|
|
1981
|
-
...
|
|
1982
|
-
accessTokenExpiresAt: R(
|
|
1983
|
-
refreshTokenExpiresAt: P(D(
|
|
1982
|
+
...s.data,
|
|
1983
|
+
accessTokenExpiresAt: R(c, 8).getTime(),
|
|
1984
|
+
refreshTokenExpiresAt: P(D(c, 30), 2).getTime()
|
|
1984
1985
|
})
|
|
1985
1986
|
), {
|
|
1986
1987
|
ok: !0,
|
|
1987
1988
|
data: null
|
|
1988
1989
|
};
|
|
1989
1990
|
}
|
|
1990
|
-
return
|
|
1991
|
+
return s;
|
|
1991
1992
|
}
|
|
1992
1993
|
const t = await this.authService.createSession(e);
|
|
1993
1994
|
if (!t.ok) return t;
|
|
@@ -2042,8 +2043,8 @@ class It {
|
|
|
2042
2043
|
};
|
|
2043
2044
|
try {
|
|
2044
2045
|
let t = JSON.parse(e), a = /* @__PURE__ */ new Date();
|
|
2045
|
-
const r = new Date(t.accessTokenExpiresAt),
|
|
2046
|
-
if (he(a,
|
|
2046
|
+
const r = new Date(t.accessTokenExpiresAt), s = new Date(t.refreshTokenExpiresAt);
|
|
2047
|
+
if (he(a, s))
|
|
2047
2048
|
return this.logger.warn("Session expired. Logging out.."), window.localStorage.removeItem(this.storageKey), {
|
|
2048
2049
|
ok: !1,
|
|
2049
2050
|
error: {
|
|
@@ -2053,18 +2054,18 @@ class It {
|
|
|
2053
2054
|
};
|
|
2054
2055
|
if (he(a, r)) {
|
|
2055
2056
|
this.logger.info("Refreshing session..."), this.refreshing = !0;
|
|
2056
|
-
const
|
|
2057
|
-
if (this.refreshing = !1, !
|
|
2058
|
-
return this.logger.error(`Failed to refresh session: ${
|
|
2057
|
+
const c = await this.authService.refreshSession(t.refreshToken);
|
|
2058
|
+
if (this.refreshing = !1, !c.ok)
|
|
2059
|
+
return this.logger.error(`Failed to refresh session: ${c.error.message}`), c.error.name === "InvalidToken" || c.error.name === "AccountBlacklisted" ? (window.localStorage.removeItem(this.storageKey), {
|
|
2059
2060
|
ok: !1,
|
|
2060
|
-
error:
|
|
2061
|
+
error: c.error
|
|
2061
2062
|
}) : (this.logger.warn("Old session returned."), {
|
|
2062
2063
|
ok: !0,
|
|
2063
2064
|
data: t
|
|
2064
2065
|
});
|
|
2065
2066
|
this.logger.success("Session refreshed!"), a = /* @__PURE__ */ new Date(), t = {
|
|
2066
2067
|
...t,
|
|
2067
|
-
...
|
|
2068
|
+
...c.data,
|
|
2068
2069
|
accessTokenExpiresAt: R(a, 8).getTime(),
|
|
2069
2070
|
refreshTokenExpiresAt: P(D(a, 30), 2).getTime()
|
|
2070
2071
|
}, window.localStorage.setItem(this.storageKey, JSON.stringify(t));
|
|
@@ -2093,11 +2094,11 @@ class It {
|
|
|
2093
2094
|
(t = e.data) != null && t.accessToken && await this.authService.destroySession(e.data.accessToken), window.localStorage.removeItem(this.storageKey);
|
|
2094
2095
|
}
|
|
2095
2096
|
async verify() {
|
|
2096
|
-
var a, r,
|
|
2097
|
+
var a, r, s;
|
|
2097
2098
|
if (this.isServer)
|
|
2098
2099
|
return this.logger.warn("'localStorage' is not available on the server."), !0;
|
|
2099
2100
|
const e = await this.get();
|
|
2100
|
-
if (((a = e.error) == null ? void 0 : a.name) === "InvalidToken" || ((r = e.error) == null ? void 0 : r.name) === "SessionExpired" || ((
|
|
2101
|
+
if (((a = e.error) == null ? void 0 : a.name) === "InvalidToken" || ((r = e.error) == null ? void 0 : r.name) === "SessionExpired" || ((s = e.error) == null ? void 0 : s.name) === "AccountBlacklisted") return !1;
|
|
2101
2102
|
if (!e.data) return !0;
|
|
2102
2103
|
const t = await this.authService.verifySession(e.data.accessToken);
|
|
2103
2104
|
return t || window.localStorage.removeItem(this.storageKey), t;
|
|
@@ -2180,7 +2181,7 @@ class Dt {
|
|
|
2180
2181
|
return y(t);
|
|
2181
2182
|
}
|
|
2182
2183
|
platform(e) {
|
|
2183
|
-
var t, a, r,
|
|
2184
|
+
var t, a, r, s, c, p, u, h, w, l, A, k, C, _, T, v, N, M, I, O, U, q, F, L, V, Y, H, j, Q, K, z, J, X, Z, ee, te, ae, re, ne, oe, ie, se, ce, de, me, ue, le, pe, fe;
|
|
2184
2185
|
return {
|
|
2185
2186
|
paymentSettings: {
|
|
2186
2187
|
minimumFirstDepositAmount: i(e.minimumFirstDepositAmount),
|
|
@@ -2190,8 +2191,8 @@ class Dt {
|
|
|
2190
2191
|
androidEnabled: ((t = e.bankDepositGatewaySettings) == null ? void 0 : t.androidEnabled) ?? !1,
|
|
2191
2192
|
iosEnabled: ((a = e.bankDepositGatewaySettings) == null ? void 0 : a.iosEnabled) ?? !1,
|
|
2192
2193
|
webEnabled: ((r = e.bankDepositGatewaySettings) == null ? void 0 : r.webEnabled) ?? !1,
|
|
2193
|
-
mobileWebEnabled: ((
|
|
2194
|
-
minimumAmount: i((
|
|
2194
|
+
mobileWebEnabled: ((s = e.bankDepositGatewaySettings) == null ? void 0 : s.mobileWebEnabled) ?? !1,
|
|
2195
|
+
minimumAmount: i((c = e.bankDepositGatewaySettings) == null ? void 0 : c.minimumAmount),
|
|
2195
2196
|
maximumAmount: i((p = e.bankDepositGatewaySettings) == null ? void 0 : p.maximumAmount)
|
|
2196
2197
|
},
|
|
2197
2198
|
gcash: {
|
|
@@ -2212,8 +2213,8 @@ class Dt {
|
|
|
2212
2213
|
},
|
|
2213
2214
|
mayaApp: {
|
|
2214
2215
|
androidEnabled: ((I = e.mayaAppDepositGatewaySettings) == null ? void 0 : I.androidEnabled) ?? !1,
|
|
2215
|
-
iosEnabled: ((
|
|
2216
|
-
webEnabled: ((
|
|
2216
|
+
iosEnabled: ((O = e.mayaAppDepositGatewaySettings) == null ? void 0 : O.iosEnabled) ?? !1,
|
|
2217
|
+
webEnabled: ((U = e.mayaAppDepositGatewaySettings) == null ? void 0 : U.webEnabled) ?? !1,
|
|
2217
2218
|
mobileWebEnabled: ((q = e.mayaAppDepositGatewaySettings) == null ? void 0 : q.mobileWebEnabled) ?? !1,
|
|
2218
2219
|
minimumAmount: i((F = e.mayaAppDepositGatewaySettings) == null ? void 0 : F.minimumAmount),
|
|
2219
2220
|
maximumAmount: i((L = e.mayaAppDepositGatewaySettings) == null ? void 0 : L.maximumAmount)
|
|
@@ -2483,7 +2484,10 @@ class Dt {
|
|
|
2483
2484
|
activationEndDateTime: new Date(e.activationEndDateTime),
|
|
2484
2485
|
activationStartDateTime: new Date(e.activationStartDateTime),
|
|
2485
2486
|
dateTimeCreated: new Date(e.dateTimeCreated),
|
|
2486
|
-
dateTimeLastUpdated: new Date(e.dateTimeLastUpdated)
|
|
2487
|
+
dateTimeLastUpdated: new Date(e.dateTimeLastUpdated),
|
|
2488
|
+
turnoverContributionPercentagePerGameProvider: Object.entries(
|
|
2489
|
+
e.turnoverContributionPercentagePerGameProvider
|
|
2490
|
+
).reduce((a, [r, s]) => (a[r] = i(s, 0), a), {})
|
|
2487
2491
|
};
|
|
2488
2492
|
}
|
|
2489
2493
|
bonus(e) {
|
|
@@ -2613,7 +2617,7 @@ class xt {
|
|
|
2613
2617
|
t ? "https://report.development.opexa.io/graphql" : "https://report.opexa.io/graphql",
|
|
2614
2618
|
a
|
|
2615
2619
|
)
|
|
2616
|
-
), this.accountService = new
|
|
2620
|
+
), this.accountService = new bt(
|
|
2617
2621
|
new E(
|
|
2618
2622
|
t ? "https://account.development.opexa.io/graphql" : "https://account.opexa.io/graphql",
|
|
2619
2623
|
a
|
|
@@ -2825,7 +2829,7 @@ class xt {
|
|
|
2825
2829
|
* ```
|
|
2826
2830
|
*/
|
|
2827
2831
|
async createAccount(e) {
|
|
2828
|
-
const t = e.id ??
|
|
2832
|
+
const t = e.id ?? b.generate(S.Account).toString(), a = await this.accountService.registerMemberAccount({
|
|
2829
2833
|
input: {
|
|
2830
2834
|
id: t,
|
|
2831
2835
|
name: e.name,
|
|
@@ -2907,7 +2911,7 @@ class xt {
|
|
|
2907
2911
|
* ```
|
|
2908
2912
|
*/
|
|
2909
2913
|
async submitVerificationDetails(e) {
|
|
2910
|
-
const t = e.id ??
|
|
2914
|
+
const t = e.id ?? b.generate(S.Verification).toString(), a = await this.accountService.createMemberVerification({
|
|
2911
2915
|
input: {
|
|
2912
2916
|
id: t,
|
|
2913
2917
|
...e
|
|
@@ -3031,7 +3035,7 @@ class xt {
|
|
|
3031
3035
|
* ```
|
|
3032
3036
|
*/
|
|
3033
3037
|
async createWithdrawal(e) {
|
|
3034
|
-
const t = e.id ??
|
|
3038
|
+
const t = e.id ?? b.generate(S.Withdrawal).toString();
|
|
3035
3039
|
if (e.type === "BANK") {
|
|
3036
3040
|
const a = await this.walletService.createBankWithdrawal({
|
|
3037
3041
|
input: {
|
|
@@ -3117,7 +3121,7 @@ class xt {
|
|
|
3117
3121
|
* ```
|
|
3118
3122
|
*/
|
|
3119
3123
|
async createDeposit(e) {
|
|
3120
|
-
const t = e.id ??
|
|
3124
|
+
const t = e.id ?? b.generate(S.Deposit).toString();
|
|
3121
3125
|
if (e.type === "MAYA") {
|
|
3122
3126
|
const a = await this.walletService.createMayaDeposit({
|
|
3123
3127
|
input: {
|
|
@@ -3199,9 +3203,9 @@ class xt {
|
|
|
3199
3203
|
return t.ok ? {
|
|
3200
3204
|
ok: !0,
|
|
3201
3205
|
data: {
|
|
3202
|
-
betRecords: t.data.edges.map(({ cursor:
|
|
3203
|
-
...this.transformer.transform.betRecord(
|
|
3204
|
-
cursor:
|
|
3206
|
+
betRecords: t.data.edges.map(({ cursor: s, node: c }) => ({
|
|
3207
|
+
...this.transformer.transform.betRecord(c),
|
|
3208
|
+
cursor: s
|
|
3205
3209
|
})),
|
|
3206
3210
|
totalCount: t.data.totalCount,
|
|
3207
3211
|
endCursor: t.data.pageInfo.endCursor ?? void 0,
|
|
@@ -3405,12 +3409,12 @@ class xt {
|
|
|
3405
3409
|
* ```
|
|
3406
3410
|
*/
|
|
3407
3411
|
async createGameSession(e) {
|
|
3408
|
-
const t = e.id ??
|
|
3412
|
+
const t = e.id ?? b.generate(S.GameSession).toString(), a = await this.walletService.createGameSession({ input: { id: t, game: e.game } });
|
|
3409
3413
|
return a.ok ? { ok: !0, data: { id: t } } : a;
|
|
3410
3414
|
}
|
|
3411
3415
|
/** @deprecated use `createGameSession__next` */
|
|
3412
3416
|
async createGameSession__legacy(e) {
|
|
3413
|
-
const t = e.id ??
|
|
3417
|
+
const t = e.id ?? b.generate(S.GameSession).toString(), a = await this.gameService.createGameSession({ input: { id: t, game: e.game } });
|
|
3414
3418
|
return a.ok ? { ok: !0, data: { id: t } } : a;
|
|
3415
3419
|
}
|
|
3416
3420
|
async createGameSession__next(e) {
|
|
@@ -3427,8 +3431,8 @@ class xt {
|
|
|
3427
3431
|
/**/
|
|
3428
3432
|
type: a,
|
|
3429
3433
|
provider: r,
|
|
3430
|
-
externalId:
|
|
3431
|
-
} = t.data,
|
|
3434
|
+
externalId: s
|
|
3435
|
+
} = t.data, c = a === "SPORTS" ? e.id ?? (await b.generateFromKey(S.Game, `SPORTS:${r}`)).toString() : e.id ?? b.generate(S.GameSession).toString(), u = [
|
|
3432
3436
|
/**/
|
|
3433
3437
|
"RTG",
|
|
3434
3438
|
"DARWIN",
|
|
@@ -3437,8 +3441,8 @@ class xt {
|
|
|
3437
3441
|
"EVOLUTION",
|
|
3438
3442
|
"EVOLUTION_NETENT",
|
|
3439
3443
|
"EVOLUTION_REDTIGER"
|
|
3440
|
-
].includes(r) ? await this.walletService.createGameSession({ input: { id:
|
|
3441
|
-
return u.ok ? { ok: !0, data: { id:
|
|
3444
|
+
].includes(r) ? await this.walletService.createGameSession({ input: { id: c, game: s } }) : await this.gameService.createGameSession({ input: { id: c, game: s } });
|
|
3445
|
+
return u.ok ? { ok: !0, data: { id: c } } : u;
|
|
3442
3446
|
}
|
|
3443
3447
|
/** @deprecated use `endGameSession__next` */
|
|
3444
3448
|
async endGameSession(e) {
|
|
@@ -3480,7 +3484,7 @@ class xt {
|
|
|
3480
3484
|
* ```
|
|
3481
3485
|
*/
|
|
3482
3486
|
async uploadImageFile(e) {
|
|
3483
|
-
const t = e.id ??
|
|
3487
|
+
const t = e.id ?? b.generate(S.File).toString(), a = await this.fileService.uploadPrivateImageFile({
|
|
3484
3488
|
input: {
|
|
3485
3489
|
id: t,
|
|
3486
3490
|
file: e.file
|
|
@@ -3548,7 +3552,7 @@ class xt {
|
|
|
3548
3552
|
}
|
|
3549
3553
|
export {
|
|
3550
3554
|
Wt as ObjectId,
|
|
3551
|
-
|
|
3555
|
+
S as ObjectType,
|
|
3552
3556
|
xt as Sdk
|
|
3553
3557
|
};
|
|
3554
3558
|
//# sourceMappingURL=index.mjs.map
|