@opexa/portal-sdk 0.0.48 → 0.0.50
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 +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +196 -194
- package/dist/index.mjs.map +1 -1
- package/dist/sdk/types.d.ts +24 -2
- package/dist/services/types.d.ts +64 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -15,9 +15,9 @@ const S = {
|
|
|
15
15
|
};
|
|
16
16
|
function o(n, ...e) {
|
|
17
17
|
let t = "";
|
|
18
|
-
for (const [
|
|
19
|
-
const s = e.at(
|
|
20
|
-
t = `${t}${
|
|
18
|
+
for (const [r, a] of n.entries()) {
|
|
19
|
+
const s = e.at(r) ?? "";
|
|
20
|
+
t = `${t}${a}${s}`;
|
|
21
21
|
}
|
|
22
22
|
return t.trim();
|
|
23
23
|
}
|
|
@@ -52,7 +52,7 @@ const L = o`
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
`,
|
|
55
|
+
`, De = o`
|
|
56
56
|
query Wallet {
|
|
57
57
|
wallet {
|
|
58
58
|
id
|
|
@@ -62,7 +62,7 @@ const L = o`
|
|
|
62
62
|
dateTimeLastUpdated
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
`,
|
|
65
|
+
`, Ie = o`
|
|
66
66
|
query PointsWallet {
|
|
67
67
|
pointsWallet {
|
|
68
68
|
id
|
|
@@ -705,7 +705,7 @@ const L = o`
|
|
|
705
705
|
dateTimeCreated
|
|
706
706
|
dateTimeLastUpdated
|
|
707
707
|
}
|
|
708
|
-
`,
|
|
708
|
+
`, rt = o`
|
|
709
709
|
${be}
|
|
710
710
|
|
|
711
711
|
query Cashbacks {
|
|
@@ -713,7 +713,7 @@ const L = o`
|
|
|
713
713
|
...CashbackFragment
|
|
714
714
|
}
|
|
715
715
|
}
|
|
716
|
-
`,
|
|
716
|
+
`, at = o`
|
|
717
717
|
${H}
|
|
718
718
|
|
|
719
719
|
query Bonus {
|
|
@@ -1267,28 +1267,28 @@ class _t {
|
|
|
1267
1267
|
Role: "MEMBER"
|
|
1268
1268
|
});
|
|
1269
1269
|
if (e.name) {
|
|
1270
|
-
const
|
|
1271
|
-
t.set("Authorization", `Basic ${
|
|
1270
|
+
const r = `${e.name}:${e.password}`, a = Buffer.from(r).toString("base64");
|
|
1271
|
+
t.set("Authorization", `Basic ${a}`);
|
|
1272
1272
|
}
|
|
1273
1273
|
if (e.mobileNumber) {
|
|
1274
|
-
const
|
|
1275
|
-
t.set("Authorization", `MobileNumberOTP ${
|
|
1274
|
+
const r = `${e.mobileNumber}:${e.verificationCode}`, a = Buffer.from(r).toString("base64");
|
|
1275
|
+
t.set("Authorization", `MobileNumberOTP ${a}`);
|
|
1276
1276
|
}
|
|
1277
1277
|
e.sessionId && t.set("Authorization", `mayasession ${e.sessionId}`);
|
|
1278
1278
|
try {
|
|
1279
|
-
const
|
|
1279
|
+
const r = await fetch(`${this.url}/sessions`, {
|
|
1280
1280
|
method: "POST",
|
|
1281
1281
|
headers: t
|
|
1282
|
-
}),
|
|
1283
|
-
return
|
|
1282
|
+
}), a = await r.json();
|
|
1283
|
+
return r.ok ? {
|
|
1284
1284
|
ok: !0,
|
|
1285
|
-
data:
|
|
1286
|
-
} :
|
|
1285
|
+
data: a
|
|
1286
|
+
} : a.code === "ACCOUNT_BLACKLISTED" ? {
|
|
1287
1287
|
ok: !1,
|
|
1288
1288
|
error: u("AccountBlacklisted")
|
|
1289
1289
|
} : {
|
|
1290
1290
|
ok: !1,
|
|
1291
|
-
error: h(
|
|
1291
|
+
error: h(r.status)
|
|
1292
1292
|
};
|
|
1293
1293
|
} catch {
|
|
1294
1294
|
return {
|
|
@@ -1306,22 +1306,22 @@ class _t {
|
|
|
1306
1306
|
if (e.type === "SECURITY_QUESTION") {
|
|
1307
1307
|
t.set("Authorization", `Bearer ${e.token}`);
|
|
1308
1308
|
try {
|
|
1309
|
-
const
|
|
1309
|
+
const r = await fetch(`${this.url}/session/${e.token}/authenticate`, {
|
|
1310
1310
|
method: "POST",
|
|
1311
1311
|
headers: t,
|
|
1312
1312
|
body: JSON.stringify({
|
|
1313
1313
|
secretAnswer: e.secretAnswer
|
|
1314
1314
|
})
|
|
1315
|
-
}),
|
|
1316
|
-
return
|
|
1315
|
+
}), a = await r.json();
|
|
1316
|
+
return r.ok ? {
|
|
1317
1317
|
ok: !0,
|
|
1318
|
-
data:
|
|
1319
|
-
} :
|
|
1318
|
+
data: a
|
|
1319
|
+
} : r.status === 401 || r.status === 403 ? {
|
|
1320
1320
|
ok: !1,
|
|
1321
1321
|
error: u("InvalidTokenOrSecretAnswer")
|
|
1322
1322
|
} : {
|
|
1323
1323
|
ok: !1,
|
|
1324
|
-
error: h(
|
|
1324
|
+
error: h(r.status)
|
|
1325
1325
|
};
|
|
1326
1326
|
} catch {
|
|
1327
1327
|
return {
|
|
@@ -1342,11 +1342,11 @@ class _t {
|
|
|
1342
1342
|
Role: "MEMBER",
|
|
1343
1343
|
Authorization: `Bearer ${e}`
|
|
1344
1344
|
}
|
|
1345
|
-
}),
|
|
1345
|
+
}), r = await t.json();
|
|
1346
1346
|
return t.ok ? {
|
|
1347
1347
|
ok: !0,
|
|
1348
|
-
data:
|
|
1349
|
-
} :
|
|
1348
|
+
data: r
|
|
1349
|
+
} : r.code === "ACCOUNT_BLACKLISTED" ? {
|
|
1350
1350
|
ok: !1,
|
|
1351
1351
|
error: u("AccountBlacklisted")
|
|
1352
1352
|
} : t.status === 403 || t.status === 401 ? {
|
|
@@ -1410,35 +1410,35 @@ class Tt {
|
|
|
1410
1410
|
} : e;
|
|
1411
1411
|
}
|
|
1412
1412
|
async games(e) {
|
|
1413
|
-
var
|
|
1413
|
+
var a, s, c, p, l, f, y, d, _, T, C, v, M, N, D, I, R, P, x, G, W, $, U, B;
|
|
1414
1414
|
const t = new URLSearchParams();
|
|
1415
|
-
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 = (
|
|
1415
|
+
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 = (a = e == null ? void 0 : e.filter) == null ? void 0 : a.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), (f = (l = e == null ? void 0 : e.filter) == null ? void 0 : l.type) != null && f.in && t.set("filter[type][in]", e.filter.type.in.join(",")), (d = (y = e == null ? void 0 : e.filter) == null ? void 0 : y.type) != null && d.notIn && t.set("filter[type][nin]", e.filter.type.notIn.join(",")), (T = (_ = e == null ? void 0 : e.filter) == null ? void 0 : _.provider) != null && T.equal && t.set("filter[provider][eq]", e.filter.provider.equal), (v = (C = e == null ? void 0 : e.filter) == null ? void 0 : C.provider) != null && v.notEqual && t.set("filter[provider][neq]", e.filter.provider.notEqual), (N = (M = e == null ? void 0 : e.filter) == null ? void 0 : M.provider) != null && N.in && t.set("filter[provider][in]", e.filter.provider.in.join(",")), (I = (D = e == null ? void 0 : e.filter) == null ? void 0 : D.provider) != null && I.notIn && t.set("filter[provider][nin]", e.filter.provider.notIn.join(",")), (P = (R = e == null ? void 0 : e.filter) == null ? void 0 : R.tags) != null && P.equal && t.set("filter[tags][eq]", e.filter.tags.equal.toLowerCase()), (G = (x = e == null ? void 0 : e.filter) == null ? void 0 : x.tags) != null && G.notEqual && t.set("filter[tags][neq]", e.filter.tags.notEqual.toLowerCase()), ($ = (W = e == null ? void 0 : e.filter) == null ? void 0 : W.tags) != null && $.in && t.set(
|
|
1416
1416
|
"filter[tags][in]",
|
|
1417
1417
|
e.filter.tags.in.map((E) => E.toLowerCase()).join(",")
|
|
1418
1418
|
), (B = (U = e == null ? void 0 : e.filter) == null ? void 0 : U.tags) != null && B.notIn && t.set(
|
|
1419
1419
|
"filter[tags][nin]",
|
|
1420
1420
|
e.filter.tags.notIn.map((E) => E.toLowerCase()).join(",")
|
|
1421
1421
|
);
|
|
1422
|
-
const
|
|
1423
|
-
return
|
|
1422
|
+
const r = await this.getJson("/games", t);
|
|
1423
|
+
return r.ok ? {
|
|
1424
1424
|
ok: !0,
|
|
1425
1425
|
data: {
|
|
1426
|
-
edges:
|
|
1426
|
+
edges: r.data.data.map((E) => ({
|
|
1427
1427
|
node: E,
|
|
1428
1428
|
cursor: E.cursor
|
|
1429
1429
|
})),
|
|
1430
|
-
totalCount:
|
|
1430
|
+
totalCount: r.data.totalCount ?? 0,
|
|
1431
1431
|
pageInfo: {
|
|
1432
|
-
hasNextPage: !!
|
|
1433
|
-
endCursor:
|
|
1432
|
+
hasNextPage: !!r.data.next,
|
|
1433
|
+
endCursor: r.data.next
|
|
1434
1434
|
}
|
|
1435
1435
|
}
|
|
1436
|
-
} :
|
|
1436
|
+
} : r;
|
|
1437
1437
|
}
|
|
1438
1438
|
async game(e) {
|
|
1439
|
-
var
|
|
1439
|
+
var r;
|
|
1440
1440
|
const t = await this.getJson(`/games/${e}`);
|
|
1441
|
-
return ((
|
|
1441
|
+
return ((r = t.error) == null ? void 0 : r.name) === "HttpNotFound" ? {
|
|
1442
1442
|
ok: !0,
|
|
1443
1443
|
data: null
|
|
1444
1444
|
} : t.ok ? {
|
|
@@ -1447,7 +1447,7 @@ class Tt {
|
|
|
1447
1447
|
} : t;
|
|
1448
1448
|
}
|
|
1449
1449
|
async getJson(e, t) {
|
|
1450
|
-
const
|
|
1450
|
+
const r = new Request(`${this.url}${e}?${(t == null ? void 0 : t.toString()) ?? ""}`, {
|
|
1451
1451
|
method: "GET",
|
|
1452
1452
|
headers: {
|
|
1453
1453
|
Accept: "application/json",
|
|
@@ -1457,13 +1457,13 @@ class Tt {
|
|
|
1457
1457
|
}
|
|
1458
1458
|
});
|
|
1459
1459
|
try {
|
|
1460
|
-
const
|
|
1461
|
-
return
|
|
1460
|
+
const a = await fetch(r);
|
|
1461
|
+
return a.ok ? {
|
|
1462
1462
|
ok: !0,
|
|
1463
|
-
data: await
|
|
1463
|
+
data: await a.json()
|
|
1464
1464
|
} : {
|
|
1465
1465
|
ok: !1,
|
|
1466
|
-
error: h(
|
|
1466
|
+
error: h(a.status)
|
|
1467
1467
|
};
|
|
1468
1468
|
} catch {
|
|
1469
1469
|
return {
|
|
@@ -1602,7 +1602,7 @@ class Nt {
|
|
|
1602
1602
|
return t.ok ? { ok: t.ok, data: t.data.member.activityRecords } : t;
|
|
1603
1603
|
}
|
|
1604
1604
|
}
|
|
1605
|
-
class
|
|
1605
|
+
class Dt {
|
|
1606
1606
|
constructor(e) {
|
|
1607
1607
|
m(this, "url");
|
|
1608
1608
|
this.url = e.url;
|
|
@@ -1624,7 +1624,7 @@ class ke {
|
|
|
1624
1624
|
return e.ok ? { ok: e.ok, data: e.data.promos } : e;
|
|
1625
1625
|
}
|
|
1626
1626
|
async cashbacks() {
|
|
1627
|
-
const e = await this.client.request(
|
|
1627
|
+
const e = await this.client.request(rt);
|
|
1628
1628
|
return e.ok ? { ok: e.ok, data: e.data.cashbacks } : e;
|
|
1629
1629
|
}
|
|
1630
1630
|
async availablePromos(e) {
|
|
@@ -1651,11 +1651,11 @@ class ke {
|
|
|
1651
1651
|
};
|
|
1652
1652
|
}
|
|
1653
1653
|
async bonus() {
|
|
1654
|
-
const e = await this.client.request(
|
|
1654
|
+
const e = await this.client.request(at);
|
|
1655
1655
|
return e.ok ? { ok: e.ok, data: e.data.bonus } : e;
|
|
1656
1656
|
}
|
|
1657
1657
|
async wallet() {
|
|
1658
|
-
const e = await this.client.request(
|
|
1658
|
+
const e = await this.client.request(De);
|
|
1659
1659
|
return e.ok ? { ok: e.ok, data: e.data.wallet } : e;
|
|
1660
1660
|
}
|
|
1661
1661
|
async deposit(e) {
|
|
@@ -1753,7 +1753,7 @@ class ke {
|
|
|
1753
1753
|
return e.ok ? { ok: e.ok, data: e.data.remainingDailyWithdrawalsCount } : e;
|
|
1754
1754
|
}
|
|
1755
1755
|
async pointsWallet() {
|
|
1756
|
-
const e = await this.client.request(
|
|
1756
|
+
const e = await this.client.request(Ie);
|
|
1757
1757
|
return e.ok ? { ok: e.ok, data: e.data.pointsWallet } : e;
|
|
1758
1758
|
}
|
|
1759
1759
|
async pointsToCashConversion(e) {
|
|
@@ -1831,7 +1831,7 @@ class ke {
|
|
|
1831
1831
|
} : e;
|
|
1832
1832
|
}
|
|
1833
1833
|
}
|
|
1834
|
-
function
|
|
1834
|
+
function It(n, e, t) {
|
|
1835
1835
|
return n < e ? e : n > t ? t : n;
|
|
1836
1836
|
}
|
|
1837
1837
|
function Y(n) {
|
|
@@ -1839,11 +1839,11 @@ function Y(n) {
|
|
|
1839
1839
|
}
|
|
1840
1840
|
function Rt(n) {
|
|
1841
1841
|
const e = [];
|
|
1842
|
-
function t(
|
|
1843
|
-
for (const s in
|
|
1844
|
-
const c =
|
|
1845
|
-
Y(c) ? t(c, [...
|
|
1846
|
-
key: [...
|
|
1842
|
+
function t(r, a = []) {
|
|
1843
|
+
for (const s in r) {
|
|
1844
|
+
const c = r[s];
|
|
1845
|
+
Y(c) ? t(c, [...a, s]) : Array.isArray(c) ? t(Pt(c), [...a, s]) : e.push({
|
|
1846
|
+
key: [...a, s],
|
|
1847
1847
|
value: c
|
|
1848
1848
|
});
|
|
1849
1849
|
}
|
|
@@ -1851,25 +1851,25 @@ function Rt(n) {
|
|
|
1851
1851
|
return t(n), e;
|
|
1852
1852
|
}
|
|
1853
1853
|
function Pt(n) {
|
|
1854
|
-
return n.reduce((e, t,
|
|
1854
|
+
return n.reduce((e, t, r) => (e[r] = t, e), {});
|
|
1855
1855
|
}
|
|
1856
1856
|
class b {
|
|
1857
1857
|
constructor(e, t) {
|
|
1858
1858
|
m(this, "url");
|
|
1859
1859
|
m(this, "options");
|
|
1860
1860
|
m(this, "middlewares");
|
|
1861
|
-
var
|
|
1862
|
-
const
|
|
1863
|
-
this.url = e, this.options = { ...t == null ? void 0 : t.fetchOptions, headers:
|
|
1861
|
+
var a;
|
|
1862
|
+
const r = new Headers((a = t == null ? void 0 : t.fetchOptions) == null ? void 0 : a.headers);
|
|
1863
|
+
this.url = e, this.options = { ...t == null ? void 0 : t.fetchOptions, headers: r }, this.middlewares = (t == null ? void 0 : t.middlewares) ?? [];
|
|
1864
1864
|
}
|
|
1865
1865
|
async request(e, t) {
|
|
1866
|
-
const
|
|
1867
|
-
|
|
1866
|
+
const r = JSON.stringify({ query: e, variables: t }), a = new Headers(this.options.headers);
|
|
1867
|
+
a.set("Content-Type", "application/json"), a.set("Accept", "application/json");
|
|
1868
1868
|
const s = await this.runMiddlewares(
|
|
1869
1869
|
new Request(this.url, {
|
|
1870
1870
|
...this.options,
|
|
1871
|
-
body:
|
|
1872
|
-
headers:
|
|
1871
|
+
body: r,
|
|
1872
|
+
headers: a,
|
|
1873
1873
|
method: "POST"
|
|
1874
1874
|
})
|
|
1875
1875
|
);
|
|
@@ -1877,26 +1877,26 @@ class b {
|
|
|
1877
1877
|
}
|
|
1878
1878
|
/** Single file upload */
|
|
1879
1879
|
async upload(e, t) {
|
|
1880
|
-
const
|
|
1881
|
-
|
|
1880
|
+
const r = this.createUploadBody(e, t), a = new Headers(this.options.headers);
|
|
1881
|
+
a.delete("Content-Type");
|
|
1882
1882
|
const s = await this.runMiddlewares(
|
|
1883
1883
|
new Request(this.url, {
|
|
1884
1884
|
...this.options,
|
|
1885
|
-
body:
|
|
1886
|
-
headers:
|
|
1885
|
+
body: r,
|
|
1886
|
+
headers: a,
|
|
1887
1887
|
method: "POST"
|
|
1888
1888
|
})
|
|
1889
1889
|
);
|
|
1890
1890
|
return await this.exec(s);
|
|
1891
1891
|
}
|
|
1892
1892
|
async exec(e) {
|
|
1893
|
-
var t,
|
|
1893
|
+
var t, r, a, s, c, p;
|
|
1894
1894
|
try {
|
|
1895
1895
|
const l = await fetch(e);
|
|
1896
1896
|
if (!l.ok)
|
|
1897
1897
|
return { ok: !1, error: h(l.status) };
|
|
1898
1898
|
const f = await l.json(), y = f.data, d = (t = f.errors) == null ? void 0 : t.at(0);
|
|
1899
|
-
return d ? ((
|
|
1899
|
+
return d ? ((r = d.extensions) == null ? void 0 : r.code) === "FORBIDDEN" || ((a = d.extensions) == null ? void 0 : a.code) === "ACCESS_TOKEN_EXPIRED" ? { ok: !1, error: h(403, d.message) } : ((s = d.extensions) == null ? void 0 : s.code) === "UNAUTHORIZED" ? { ok: !1, error: h(401, d.message) } : ((c = d.extensions) == null ? void 0 : c.code) === "BAD_USER_INPUT" || ((p = d.extensions) == null ? void 0 : p.code) === "BAD_REQUEST" ? { ok: !1, error: h(400, d.message) } : {
|
|
1900
1900
|
ok: !1,
|
|
1901
1901
|
error: h(500, d.message)
|
|
1902
1902
|
} : {
|
|
@@ -1912,15 +1912,15 @@ class b {
|
|
|
1912
1912
|
}
|
|
1913
1913
|
async runMiddlewares(e) {
|
|
1914
1914
|
let t = e.clone();
|
|
1915
|
-
for (const
|
|
1916
|
-
t = await
|
|
1915
|
+
for (const r of this.middlewares)
|
|
1916
|
+
t = await r(t);
|
|
1917
1917
|
return t;
|
|
1918
1918
|
}
|
|
1919
1919
|
createUploadBody(e, t) {
|
|
1920
|
-
const
|
|
1920
|
+
const r = Rt(t).filter(
|
|
1921
1921
|
(c) => c.value instanceof File || c.value instanceof Blob
|
|
1922
|
-
),
|
|
1923
|
-
|
|
1922
|
+
), a = new FormData();
|
|
1923
|
+
a.append(
|
|
1924
1924
|
"operations",
|
|
1925
1925
|
JSON.stringify({
|
|
1926
1926
|
query: e,
|
|
@@ -1928,11 +1928,11 @@ class b {
|
|
|
1928
1928
|
})
|
|
1929
1929
|
);
|
|
1930
1930
|
const s = {};
|
|
1931
|
-
return
|
|
1931
|
+
return r.forEach((c, p) => {
|
|
1932
1932
|
s[p.toString()] = [`variables.${c.key.join(".")}`];
|
|
1933
|
-
}),
|
|
1934
|
-
|
|
1935
|
-
}),
|
|
1933
|
+
}), a.append("map", JSON.stringify(s)), r.forEach((c, p) => {
|
|
1934
|
+
a.append(p.toString(), c.value);
|
|
1935
|
+
}), a;
|
|
1936
1936
|
}
|
|
1937
1937
|
}
|
|
1938
1938
|
function k(n) {
|
|
@@ -1982,13 +1982,13 @@ function Te(n) {
|
|
|
1982
1982
|
function we(n, e) {
|
|
1983
1983
|
const {
|
|
1984
1984
|
until: t,
|
|
1985
|
-
interval:
|
|
1986
|
-
maxAttempt:
|
|
1985
|
+
interval: r = 1e3,
|
|
1986
|
+
maxAttempt: a = 3
|
|
1987
1987
|
/**/
|
|
1988
1988
|
} = e;
|
|
1989
1989
|
async function s(c, p) {
|
|
1990
|
-
const l = p ??
|
|
1991
|
-
return t(f) ? f : l > 1 ? (await Te(
|
|
1990
|
+
const l = p ?? a, f = await n(...c);
|
|
1991
|
+
return t(f) ? f : l > 1 ? (await Te(r * ((a - l) / 2)), s(c, l - 1)) : f;
|
|
1992
1992
|
}
|
|
1993
1993
|
return async (...c) => await s(c);
|
|
1994
1994
|
}
|
|
@@ -2023,7 +2023,7 @@ class xt {
|
|
|
2023
2023
|
this._refreshing = e;
|
|
2024
2024
|
}
|
|
2025
2025
|
async create(e) {
|
|
2026
|
-
var
|
|
2026
|
+
var a;
|
|
2027
2027
|
if (this.isServer)
|
|
2028
2028
|
return this.logger.warn("'localStorage' is not available on the server."), {
|
|
2029
2029
|
ok: !1,
|
|
@@ -2042,7 +2042,7 @@ class xt {
|
|
|
2042
2042
|
maxAttempt: 5
|
|
2043
2043
|
})();
|
|
2044
2044
|
if (!c.ok) return c;
|
|
2045
|
-
if (!((
|
|
2045
|
+
if (!((a = c.data) != null && a.member))
|
|
2046
2046
|
return {
|
|
2047
2047
|
ok: !1,
|
|
2048
2048
|
error: {
|
|
@@ -2096,13 +2096,13 @@ class xt {
|
|
|
2096
2096
|
authenticator: t.data.authenticator
|
|
2097
2097
|
}
|
|
2098
2098
|
};
|
|
2099
|
-
const
|
|
2099
|
+
const r = /* @__PURE__ */ new Date();
|
|
2100
2100
|
return window.localStorage.setItem(
|
|
2101
2101
|
this.storageKey,
|
|
2102
2102
|
JSON.stringify({
|
|
2103
2103
|
...t.data,
|
|
2104
|
-
accessTokenExpiresAt: q(
|
|
2105
|
-
refreshTokenExpiresAt: F(O(
|
|
2104
|
+
accessTokenExpiresAt: q(r, 8).getTime(),
|
|
2105
|
+
refreshTokenExpiresAt: F(O(r, 30), 2).getTime()
|
|
2106
2106
|
})
|
|
2107
2107
|
), {
|
|
2108
2108
|
ok: !0,
|
|
@@ -2112,13 +2112,13 @@ class xt {
|
|
|
2112
2112
|
async createFromAuthenticator(e) {
|
|
2113
2113
|
const t = await this.authService.authenticate(e);
|
|
2114
2114
|
if (t.ok) {
|
|
2115
|
-
const
|
|
2115
|
+
const r = /* @__PURE__ */ new Date();
|
|
2116
2116
|
return this.isServer ? this.logger.warn("'localStorage' is not available on the server.") : window.localStorage.setItem(
|
|
2117
2117
|
this.storageKey,
|
|
2118
2118
|
JSON.stringify({
|
|
2119
2119
|
...t.data,
|
|
2120
|
-
accessTokenExpiresAt: q(
|
|
2121
|
-
refreshTokenExpiresAt: F(O(
|
|
2120
|
+
accessTokenExpiresAt: q(r, 8).getTime(),
|
|
2121
|
+
refreshTokenExpiresAt: F(O(r, 30), 2).getTime()
|
|
2122
2122
|
})
|
|
2123
2123
|
), { ok: !0 };
|
|
2124
2124
|
} else
|
|
@@ -2139,9 +2139,9 @@ class xt {
|
|
|
2139
2139
|
data: null
|
|
2140
2140
|
};
|
|
2141
2141
|
try {
|
|
2142
|
-
let t = JSON.parse(e),
|
|
2143
|
-
const
|
|
2144
|
-
if (ye(
|
|
2142
|
+
let t = JSON.parse(e), r = /* @__PURE__ */ new Date();
|
|
2143
|
+
const a = new Date(t.accessTokenExpiresAt), s = new Date(t.refreshTokenExpiresAt);
|
|
2144
|
+
if (ye(r, s))
|
|
2145
2145
|
return this.logger.warn("Session expired. Logging out.."), window.localStorage.removeItem(this.storageKey), {
|
|
2146
2146
|
ok: !1,
|
|
2147
2147
|
error: {
|
|
@@ -2149,7 +2149,7 @@ class xt {
|
|
|
2149
2149
|
message: "Session expired."
|
|
2150
2150
|
}
|
|
2151
2151
|
};
|
|
2152
|
-
if (ye(
|
|
2152
|
+
if (ye(r, a)) {
|
|
2153
2153
|
this.logger.info("Refreshing session..."), this.refreshing = !0;
|
|
2154
2154
|
const c = await this.authService.refreshSession(t.refreshToken);
|
|
2155
2155
|
if (this.refreshing = !1, !c.ok)
|
|
@@ -2160,11 +2160,11 @@ class xt {
|
|
|
2160
2160
|
ok: !0,
|
|
2161
2161
|
data: t
|
|
2162
2162
|
});
|
|
2163
|
-
this.logger.success("Session refreshed!"),
|
|
2163
|
+
this.logger.success("Session refreshed!"), r = /* @__PURE__ */ new Date(), t = {
|
|
2164
2164
|
...t,
|
|
2165
2165
|
...c.data,
|
|
2166
|
-
accessTokenExpiresAt: q(
|
|
2167
|
-
refreshTokenExpiresAt: F(O(
|
|
2166
|
+
accessTokenExpiresAt: q(r, 8).getTime(),
|
|
2167
|
+
refreshTokenExpiresAt: F(O(r, 30), 2).getTime()
|
|
2168
2168
|
}, window.localStorage.setItem(this.storageKey, JSON.stringify(t));
|
|
2169
2169
|
}
|
|
2170
2170
|
return {
|
|
@@ -2191,11 +2191,11 @@ class xt {
|
|
|
2191
2191
|
(t = e.data) != null && t.accessToken && await this.authService.destroySession(e.data.accessToken), window.localStorage.removeItem(this.storageKey);
|
|
2192
2192
|
}
|
|
2193
2193
|
async verify() {
|
|
2194
|
-
var
|
|
2194
|
+
var r, a, s;
|
|
2195
2195
|
if (this.isServer)
|
|
2196
2196
|
return this.logger.warn("'localStorage' is not available on the server."), !0;
|
|
2197
2197
|
const e = await this.get();
|
|
2198
|
-
if (((
|
|
2198
|
+
if (((r = e.error) == null ? void 0 : r.name) === "InvalidToken" || ((a = e.error) == null ? void 0 : a.name) === "SessionExpired" || ((s = e.error) == null ? void 0 : s.name) === "AccountBlacklisted") return !1;
|
|
2199
2199
|
if (!e.data) return !0;
|
|
2200
2200
|
const t = await this.authService.verifySession(e.data.accessToken);
|
|
2201
2201
|
return t || window.localStorage.removeItem(this.storageKey), t;
|
|
@@ -2207,17 +2207,17 @@ class xt {
|
|
|
2207
2207
|
function g(n) {
|
|
2208
2208
|
const e = {};
|
|
2209
2209
|
for (const t in n) {
|
|
2210
|
-
const
|
|
2211
|
-
if (
|
|
2212
|
-
if (Y(
|
|
2213
|
-
e[t] = g(
|
|
2210
|
+
const r = n[t];
|
|
2211
|
+
if (r !== null && r !== void 0) {
|
|
2212
|
+
if (Y(r)) {
|
|
2213
|
+
e[t] = g(r);
|
|
2214
2214
|
continue;
|
|
2215
2215
|
}
|
|
2216
|
-
if (Array.isArray(
|
|
2217
|
-
e[t] =
|
|
2216
|
+
if (Array.isArray(r)) {
|
|
2217
|
+
e[t] = r.map((a) => Y(a) ? g(a) : a);
|
|
2218
2218
|
continue;
|
|
2219
2219
|
}
|
|
2220
|
-
e[t] =
|
|
2220
|
+
e[t] = r;
|
|
2221
2221
|
}
|
|
2222
2222
|
}
|
|
2223
2223
|
return e;
|
|
@@ -2236,7 +2236,7 @@ class Gt {
|
|
|
2236
2236
|
constructor(e) {
|
|
2237
2237
|
m(this, "staticService");
|
|
2238
2238
|
const t = (e == null ? void 0 : e.environment) === "development";
|
|
2239
|
-
this.staticService = new
|
|
2239
|
+
this.staticService = new Dt({
|
|
2240
2240
|
url: t ? "https://static.development.opexa.io" : "https://static.opexa.io"
|
|
2241
2241
|
});
|
|
2242
2242
|
}
|
|
@@ -2273,12 +2273,13 @@ class Gt {
|
|
|
2273
2273
|
const t = {
|
|
2274
2274
|
id: e.id,
|
|
2275
2275
|
name: e.name,
|
|
2276
|
-
logo: e.logo ?? void 0
|
|
2276
|
+
logo: e.logo ?? void 0,
|
|
2277
|
+
fields: e.config.fields
|
|
2277
2278
|
};
|
|
2278
2279
|
return g(t);
|
|
2279
2280
|
}
|
|
2280
2281
|
platform(e) {
|
|
2281
|
-
var t,
|
|
2282
|
+
var t, r, a, s, c, p, l, f, y, d, _, T, C, v, M, N, D, I, R, P, x, G, W, $, U, B, E, Q, K, z, J, X, Z, ee, te, re, ae, ne, oe, ie, se, ce, me, ue, de, le, pe, fe, he;
|
|
2282
2283
|
return {
|
|
2283
2284
|
paymentSettings: {
|
|
2284
2285
|
minimumFirstDepositAmount: i(e.minimumFirstDepositAmount),
|
|
@@ -2286,8 +2287,8 @@ class Gt {
|
|
|
2286
2287
|
depositGateway: {
|
|
2287
2288
|
bank: {
|
|
2288
2289
|
androidEnabled: ((t = e.bankDepositGatewaySettings) == null ? void 0 : t.androidEnabled) ?? !1,
|
|
2289
|
-
iosEnabled: ((
|
|
2290
|
-
webEnabled: ((
|
|
2290
|
+
iosEnabled: ((r = e.bankDepositGatewaySettings) == null ? void 0 : r.iosEnabled) ?? !1,
|
|
2291
|
+
webEnabled: ((a = e.bankDepositGatewaySettings) == null ? void 0 : a.webEnabled) ?? !1,
|
|
2291
2292
|
mobileWebEnabled: ((s = e.bankDepositGatewaySettings) == null ? void 0 : s.mobileWebEnabled) ?? !1,
|
|
2292
2293
|
minimumAmount: i((c = e.bankDepositGatewaySettings) == null ? void 0 : c.minimumAmount),
|
|
2293
2294
|
maximumAmount: i((p = e.bankDepositGatewaySettings) == null ? void 0 : p.maximumAmount)
|
|
@@ -2305,8 +2306,8 @@ class Gt {
|
|
|
2305
2306
|
iosEnabled: ((v = e.mayaDepositGatewaySettings) == null ? void 0 : v.iosEnabled) ?? !1,
|
|
2306
2307
|
webEnabled: ((M = e.mayaDepositGatewaySettings) == null ? void 0 : M.webEnabled) ?? !1,
|
|
2307
2308
|
mobileWebEnabled: ((N = e.mayaDepositGatewaySettings) == null ? void 0 : N.mobileWebEnabled) ?? !1,
|
|
2308
|
-
minimumAmount: i((
|
|
2309
|
-
maximumAmount: i((
|
|
2309
|
+
minimumAmount: i((D = e.mayaDepositGatewaySettings) == null ? void 0 : D.minimumAmount),
|
|
2310
|
+
maximumAmount: i((I = e.mayaDepositGatewaySettings) == null ? void 0 : I.maximumAmount)
|
|
2310
2311
|
},
|
|
2311
2312
|
mayaApp: {
|
|
2312
2313
|
androidEnabled: ((R = e.mayaAppDepositGatewaySettings) == null ? void 0 : R.androidEnabled) ?? !1,
|
|
@@ -2333,12 +2334,12 @@ class Gt {
|
|
|
2333
2334
|
mobileWebEnabled: ((ee = e.gcashWithdrawalGatewaySettings) == null ? void 0 : ee.mobileWebEnabled) ?? !1,
|
|
2334
2335
|
minimumAmount: i((te = e.gcashWithdrawalGatewaySettings) == null ? void 0 : te.minimumAmount),
|
|
2335
2336
|
maximumAmount: i(
|
|
2336
|
-
(
|
|
2337
|
+
(re = e.gcashWithdrawalGatewaySettings) == null ? void 0 : re.maximumAmount,
|
|
2337
2338
|
1e6
|
|
2338
2339
|
)
|
|
2339
2340
|
},
|
|
2340
2341
|
maya: {
|
|
2341
|
-
androidEnabled: ((
|
|
2342
|
+
androidEnabled: ((ae = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ae.androidEnabled) ?? !1,
|
|
2342
2343
|
iosEnabled: ((ne = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ne.iosEnabled) ?? !1,
|
|
2343
2344
|
webEnabled: ((oe = e.mayaWithdrawalGatewaySettings) == null ? void 0 : oe.webEnabled) ?? !1,
|
|
2344
2345
|
mobileWebEnabled: ((ie = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ie.mobileWebEnabled) ?? !1,
|
|
@@ -2474,7 +2475,7 @@ class Gt {
|
|
|
2474
2475
|
return g(t);
|
|
2475
2476
|
}
|
|
2476
2477
|
betRecord(e) {
|
|
2477
|
-
var
|
|
2478
|
+
var r;
|
|
2478
2479
|
const t = {
|
|
2479
2480
|
id: e.id,
|
|
2480
2481
|
bet: i(e.bet, 0),
|
|
@@ -2499,7 +2500,7 @@ class Gt {
|
|
|
2499
2500
|
contestName: e.contestName ?? void 0,
|
|
2500
2501
|
externalCategory: e.externalCategory ?? void 0,
|
|
2501
2502
|
metadata: {
|
|
2502
|
-
odds: ((
|
|
2503
|
+
odds: ((r = e.metadata) == null ? void 0 : r.odds) ?? void 0
|
|
2503
2504
|
}
|
|
2504
2505
|
};
|
|
2505
2506
|
return g(t);
|
|
@@ -2552,10 +2553,11 @@ class Gt {
|
|
|
2552
2553
|
tags: e.tags ?? [],
|
|
2553
2554
|
name: e.name,
|
|
2554
2555
|
images: this.staticService.gameThumbnails({
|
|
2555
|
-
id: e.
|
|
2556
|
+
id: e.reference,
|
|
2556
2557
|
provider: e.provider
|
|
2557
2558
|
}),
|
|
2558
2559
|
provider: e.provider,
|
|
2560
|
+
reference: e.reference,
|
|
2559
2561
|
externalId: e.externalId
|
|
2560
2562
|
};
|
|
2561
2563
|
}
|
|
@@ -2598,7 +2600,7 @@ class Gt {
|
|
|
2598
2600
|
dateTimeLastUpdated: new Date(e.dateTimeLastUpdated),
|
|
2599
2601
|
turnoverContributionPercentagePerGameProvider: Object.entries(
|
|
2600
2602
|
e.turnoverContributionPercentagePerGameProvider
|
|
2601
|
-
).reduce((
|
|
2603
|
+
).reduce((r, [a, s]) => (r[a] = i(s, 0), r), {})
|
|
2602
2604
|
};
|
|
2603
2605
|
}
|
|
2604
2606
|
bonus(e) {
|
|
@@ -2695,14 +2697,14 @@ class Ot {
|
|
|
2695
2697
|
this.transformer = new Gt(e), this.logger = new _e({
|
|
2696
2698
|
enabled: e.logs ?? !1
|
|
2697
2699
|
});
|
|
2698
|
-
const
|
|
2700
|
+
const r = t ? "https://auth.opexa.io" : "https://auth.development.opexa.io", a = t ? "https://wallet.opexa.io/graphql" : "https://wallet.development.opexa.io/graphql", s = t ? "https://report.opexa.io/graphql" : "https://report.development.opexa.io/graphql", c = t ? "https://account.opexa.io/graphql" : "https://account.development.opexa.io/graphql", p = t ? "https://portal.opexa.io/graphql" : "https://portal.development.opexa.io/graphql", l = t ? "https://file.opexa.io/graphql" : "https://file.development.opexa.io/graphql", f = t ? "https://game.opexa.io/graphql" : "https://game.development.opexa.io/graphql", y = t ? "https://portal-api.opexacms.io/v1" : "https://portal-api.development.opexacms.io/v1";
|
|
2699
2701
|
this.cmsPortalService = new Tt({
|
|
2700
2702
|
url: y,
|
|
2701
2703
|
site: e.site,
|
|
2702
2704
|
platform: e.sitePlatform
|
|
2703
2705
|
}), this.sessionManager = new xt({
|
|
2704
|
-
authUrl:
|
|
2705
|
-
walletUrl:
|
|
2706
|
+
authUrl: r,
|
|
2707
|
+
walletUrl: a,
|
|
2706
2708
|
platform: e.platform,
|
|
2707
2709
|
logs: e.logs
|
|
2708
2710
|
});
|
|
@@ -2715,7 +2717,7 @@ class Ot {
|
|
|
2715
2717
|
}
|
|
2716
2718
|
}
|
|
2717
2719
|
};
|
|
2718
|
-
this.gameService = new vt(new b(f, d)), this.fileService = new Ct(new b(l, d)), this.walletService = new ke(new b(
|
|
2720
|
+
this.gameService = new vt(new b(f, d)), this.fileService = new Ct(new b(l, d)), this.walletService = new ke(new b(a, d)), this.accountService = new kt(new b(c, d)), this.reportService = new Nt(new b(s, d)), this.portalService = new Mt(new b(p, d));
|
|
2719
2721
|
}
|
|
2720
2722
|
get authMiddleware() {
|
|
2721
2723
|
return async (e) => {
|
|
@@ -2829,13 +2831,13 @@ class Ot {
|
|
|
2829
2831
|
* ```
|
|
2830
2832
|
*/
|
|
2831
2833
|
watchSession(e) {
|
|
2832
|
-
const t =
|
|
2833
|
-
let
|
|
2834
|
-
const
|
|
2835
|
-
await this.sessionManager.verify() || await e.onInvalid(),
|
|
2834
|
+
const t = It(e.interval ?? 3e4, 3e4, 6e4);
|
|
2835
|
+
let r = null;
|
|
2836
|
+
const a = () => setTimeout(async () => {
|
|
2837
|
+
await this.sessionManager.verify() || await e.onInvalid(), r = a();
|
|
2836
2838
|
}, t);
|
|
2837
|
-
return
|
|
2838
|
-
|
|
2839
|
+
return r = a(), function() {
|
|
2840
|
+
r && clearTimeout(r);
|
|
2839
2841
|
};
|
|
2840
2842
|
}
|
|
2841
2843
|
async session() {
|
|
@@ -2915,7 +2917,7 @@ class Ot {
|
|
|
2915
2917
|
* ```
|
|
2916
2918
|
*/
|
|
2917
2919
|
async createAccount(e) {
|
|
2918
|
-
const t = e.id ?? A.generate(S.Account).toString(),
|
|
2920
|
+
const t = e.id ?? A.generate(S.Account).toString(), r = await this.accountService.registerMemberAccount({
|
|
2919
2921
|
input: {
|
|
2920
2922
|
id: t,
|
|
2921
2923
|
name: e.name,
|
|
@@ -2928,7 +2930,7 @@ class Ot {
|
|
|
2928
2930
|
verificationCode: e.verificationCode,
|
|
2929
2931
|
reCAPTCHAResponse: e.reCAPTCHAResponse
|
|
2930
2932
|
});
|
|
2931
|
-
return
|
|
2933
|
+
return r.ok ? { ok: !0, data: { id: t } } : r;
|
|
2932
2934
|
}
|
|
2933
2935
|
async registerMayaAccount(e) {
|
|
2934
2936
|
return await this.accountService.registerMayaMemberAccount({
|
|
@@ -3006,13 +3008,13 @@ class Ot {
|
|
|
3006
3008
|
* ```
|
|
3007
3009
|
*/
|
|
3008
3010
|
async submitVerificationDetails(e) {
|
|
3009
|
-
const t = e.id ?? A.generate(S.Verification).toString(),
|
|
3011
|
+
const t = e.id ?? A.generate(S.Verification).toString(), r = await this.accountService.createMemberVerification({
|
|
3010
3012
|
input: {
|
|
3011
3013
|
id: t,
|
|
3012
3014
|
...e
|
|
3013
3015
|
}
|
|
3014
3016
|
});
|
|
3015
|
-
return
|
|
3017
|
+
return r.ok ? { ok: !0, data: { id: t } } : r;
|
|
3016
3018
|
}
|
|
3017
3019
|
/**
|
|
3018
3020
|
* @example
|
|
@@ -3097,9 +3099,9 @@ class Ot {
|
|
|
3097
3099
|
return t.ok ? {
|
|
3098
3100
|
ok: !0,
|
|
3099
3101
|
data: {
|
|
3100
|
-
announcements: t.data.edges.map(({ cursor:
|
|
3101
|
-
...this.transformer.transform.announcement(
|
|
3102
|
-
cursor:
|
|
3102
|
+
announcements: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3103
|
+
...this.transformer.transform.announcement(a),
|
|
3104
|
+
cursor: r
|
|
3103
3105
|
})),
|
|
3104
3106
|
totalCount: t.data.totalCount,
|
|
3105
3107
|
endCursor: t.data.pageInfo.endCursor ?? void 0,
|
|
@@ -3132,17 +3134,17 @@ class Ot {
|
|
|
3132
3134
|
async createWithdrawal(e) {
|
|
3133
3135
|
const t = e.id ?? A.generate(S.Withdrawal).toString();
|
|
3134
3136
|
if (e.type === "BANK") {
|
|
3135
|
-
const
|
|
3137
|
+
const r = await this.walletService.createBankWithdrawal({
|
|
3136
3138
|
input: {
|
|
3137
3139
|
id: t,
|
|
3138
3140
|
amount: e.amount.toString(),
|
|
3139
3141
|
transactionPassword: await w(e.transactionPassword)
|
|
3140
3142
|
}
|
|
3141
3143
|
});
|
|
3142
|
-
if (!
|
|
3144
|
+
if (!r.ok) return r;
|
|
3143
3145
|
}
|
|
3144
3146
|
if (e.type === "GCASH") {
|
|
3145
|
-
const
|
|
3147
|
+
const r = await this.walletService.createGCashWithdrawal({
|
|
3146
3148
|
input: {
|
|
3147
3149
|
id: t,
|
|
3148
3150
|
amount: e.amount.toString(),
|
|
@@ -3150,10 +3152,10 @@ class Ot {
|
|
|
3150
3152
|
recipientMobileNumber: k(e.recipientMobileNumber)
|
|
3151
3153
|
}
|
|
3152
3154
|
});
|
|
3153
|
-
if (!
|
|
3155
|
+
if (!r.ok) return r;
|
|
3154
3156
|
}
|
|
3155
3157
|
if (e.type === "MAYA") {
|
|
3156
|
-
const
|
|
3158
|
+
const r = await this.walletService.createMayaWithdrawal({
|
|
3157
3159
|
input: {
|
|
3158
3160
|
id: t,
|
|
3159
3161
|
amount: e.amount.toString(),
|
|
@@ -3161,27 +3163,27 @@ class Ot {
|
|
|
3161
3163
|
recipientMobileNumber: k(e.recipientMobileNumber)
|
|
3162
3164
|
}
|
|
3163
3165
|
});
|
|
3164
|
-
if (!
|
|
3166
|
+
if (!r.ok) return r;
|
|
3165
3167
|
}
|
|
3166
3168
|
if (e.type === "MAYA_APP") {
|
|
3167
|
-
const
|
|
3169
|
+
const r = await this.walletService.createMayaAppWithdrawal({
|
|
3168
3170
|
input: {
|
|
3169
3171
|
id: t,
|
|
3170
3172
|
amount: e.amount.toString(),
|
|
3171
3173
|
transactionPassword: await w(e.transactionPassword)
|
|
3172
3174
|
}
|
|
3173
3175
|
});
|
|
3174
|
-
if (!
|
|
3176
|
+
if (!r.ok) return r;
|
|
3175
3177
|
}
|
|
3176
3178
|
if (e.type === "MAYA_APP [NEXT]") {
|
|
3177
|
-
const
|
|
3179
|
+
const r = await this.walletService.createMayaAppWithdrawal__next({
|
|
3178
3180
|
input: {
|
|
3179
3181
|
id: t,
|
|
3180
3182
|
amount: e.amount.toString(),
|
|
3181
3183
|
transactionPassword: await w(e.transactionPassword)
|
|
3182
3184
|
}
|
|
3183
3185
|
});
|
|
3184
|
-
if (!
|
|
3186
|
+
if (!r.ok) return r;
|
|
3185
3187
|
}
|
|
3186
3188
|
return { ok: !0, data: { id: t } };
|
|
3187
3189
|
}
|
|
@@ -3190,9 +3192,9 @@ class Ot {
|
|
|
3190
3192
|
return t.ok ? {
|
|
3191
3193
|
ok: !0,
|
|
3192
3194
|
data: {
|
|
3193
|
-
withdrawalRecords: t.data.edges.map(({ cursor:
|
|
3194
|
-
...this.transformer.transform.withdrawalRecord(
|
|
3195
|
-
cursor:
|
|
3195
|
+
withdrawalRecords: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3196
|
+
...this.transformer.transform.withdrawalRecord(a),
|
|
3197
|
+
cursor: r
|
|
3196
3198
|
})),
|
|
3197
3199
|
totalCount: t.data.totalCount,
|
|
3198
3200
|
endCursor: t.data.pageInfo.endCursor ?? void 0,
|
|
@@ -3228,44 +3230,44 @@ class Ot {
|
|
|
3228
3230
|
async createDeposit(e) {
|
|
3229
3231
|
const t = e.id ?? A.generate(S.Deposit).toString();
|
|
3230
3232
|
if (e.type === "MAYA") {
|
|
3231
|
-
const
|
|
3233
|
+
const r = await this.walletService.createMayaDeposit({
|
|
3232
3234
|
input: {
|
|
3233
3235
|
id: t,
|
|
3234
3236
|
amount: e.amount.toString(),
|
|
3235
3237
|
promo: e.promo
|
|
3236
3238
|
}
|
|
3237
3239
|
});
|
|
3238
|
-
if (!
|
|
3240
|
+
if (!r.ok) return r;
|
|
3239
3241
|
}
|
|
3240
3242
|
if (e.type === "MAYA_APP") {
|
|
3241
|
-
const
|
|
3243
|
+
const r = await this.walletService.createMayaAppDeposit({
|
|
3242
3244
|
input: {
|
|
3243
3245
|
id: t,
|
|
3244
3246
|
amount: e.amount.toString(),
|
|
3245
3247
|
promo: e.promo
|
|
3246
3248
|
}
|
|
3247
3249
|
});
|
|
3248
|
-
if (!
|
|
3250
|
+
if (!r.ok) return r;
|
|
3249
3251
|
}
|
|
3250
3252
|
if (e.type === "MAYA_APP [NEXT]") {
|
|
3251
|
-
const
|
|
3253
|
+
const r = await this.walletService.createMayaAppDeposit__next({
|
|
3252
3254
|
input: {
|
|
3253
3255
|
id: t,
|
|
3254
3256
|
amount: e.amount.toString(),
|
|
3255
3257
|
promo: e.promo
|
|
3256
3258
|
}
|
|
3257
3259
|
});
|
|
3258
|
-
if (!
|
|
3260
|
+
if (!r.ok) return r;
|
|
3259
3261
|
}
|
|
3260
3262
|
if (e.type === "GCASH") {
|
|
3261
|
-
const
|
|
3263
|
+
const r = await this.walletService.createGCashDeposit({
|
|
3262
3264
|
input: {
|
|
3263
3265
|
id: t,
|
|
3264
3266
|
amount: e.amount.toString(),
|
|
3265
3267
|
promo: e.promo
|
|
3266
3268
|
}
|
|
3267
3269
|
});
|
|
3268
|
-
if (!
|
|
3270
|
+
if (!r.ok) return r;
|
|
3269
3271
|
}
|
|
3270
3272
|
return { ok: !0, data: { id: t } };
|
|
3271
3273
|
}
|
|
@@ -3281,9 +3283,9 @@ class Ot {
|
|
|
3281
3283
|
return t.ok ? {
|
|
3282
3284
|
ok: !0,
|
|
3283
3285
|
data: {
|
|
3284
|
-
depositRecords: t.data.edges.map(({ cursor:
|
|
3285
|
-
...this.transformer.transform.depositRecord(
|
|
3286
|
-
cursor:
|
|
3286
|
+
depositRecords: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3287
|
+
...this.transformer.transform.depositRecord(a),
|
|
3288
|
+
cursor: r
|
|
3287
3289
|
})),
|
|
3288
3290
|
totalCount: t.data.totalCount,
|
|
3289
3291
|
endCursor: t.data.pageInfo.endCursor ?? void 0,
|
|
@@ -3300,16 +3302,16 @@ class Ot {
|
|
|
3300
3302
|
/*+----------------------------------------+*/
|
|
3301
3303
|
/**/
|
|
3302
3304
|
async betRecords(e) {
|
|
3303
|
-
var
|
|
3305
|
+
var r, a;
|
|
3304
3306
|
const t = await this.reportService.betRecords({
|
|
3305
3307
|
...e,
|
|
3306
3308
|
...(e == null ? void 0 : e.filter) && {
|
|
3307
3309
|
filter: {
|
|
3308
3310
|
...e.filter,
|
|
3309
|
-
...((
|
|
3311
|
+
...((r = e.filter) == null ? void 0 : r.gameType) && {
|
|
3310
3312
|
game__type: e.filter.gameType
|
|
3311
3313
|
},
|
|
3312
|
-
...((
|
|
3314
|
+
...((a = e.filter) == null ? void 0 : a.gameProvider) && {
|
|
3313
3315
|
game__provider: e.filter.gameProvider
|
|
3314
3316
|
}
|
|
3315
3317
|
}
|
|
@@ -3345,9 +3347,9 @@ class Ot {
|
|
|
3345
3347
|
return t.ok ? {
|
|
3346
3348
|
ok: !0,
|
|
3347
3349
|
data: {
|
|
3348
|
-
transactionRecords: t.data.edges.map(({ cursor:
|
|
3349
|
-
...this.transformer.transform.transactionRecord(
|
|
3350
|
-
cursor:
|
|
3350
|
+
transactionRecords: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3351
|
+
...this.transformer.transform.transactionRecord(a),
|
|
3352
|
+
cursor: r
|
|
3351
3353
|
})),
|
|
3352
3354
|
totalCount: t.data.totalCount,
|
|
3353
3355
|
endCursor: t.data.pageInfo.endCursor ?? void 0,
|
|
@@ -3420,9 +3422,9 @@ class Ot {
|
|
|
3420
3422
|
return t.ok ? {
|
|
3421
3423
|
ok: !0,
|
|
3422
3424
|
data: {
|
|
3423
|
-
games: t.data.edges.map(({ cursor:
|
|
3424
|
-
...this.transformer.transform.game(
|
|
3425
|
-
cursor:
|
|
3425
|
+
games: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3426
|
+
...this.transformer.transform.game(a),
|
|
3427
|
+
cursor: r
|
|
3426
3428
|
})),
|
|
3427
3429
|
totalCount: t.data.totalCount,
|
|
3428
3430
|
hasNextPage: t.data.pageInfo.hasNextPage,
|
|
@@ -3435,9 +3437,9 @@ class Ot {
|
|
|
3435
3437
|
return t.ok ? {
|
|
3436
3438
|
ok: !0,
|
|
3437
3439
|
data: {
|
|
3438
|
-
games: t.data.edges.map(({ cursor:
|
|
3439
|
-
...this.transformer.transform.game__next(
|
|
3440
|
-
cursor:
|
|
3440
|
+
games: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3441
|
+
...this.transformer.transform.game__next(a),
|
|
3442
|
+
cursor: r
|
|
3441
3443
|
})),
|
|
3442
3444
|
totalCount: t.data.totalCount,
|
|
3443
3445
|
hasNextPage: t.data.pageInfo.hasNextPage,
|
|
@@ -3451,9 +3453,9 @@ class Ot {
|
|
|
3451
3453
|
return t.ok ? {
|
|
3452
3454
|
ok: !0,
|
|
3453
3455
|
data: {
|
|
3454
|
-
games: t.data.edges.map(({ cursor:
|
|
3455
|
-
...this.transformer.transform.game(
|
|
3456
|
-
cursor:
|
|
3456
|
+
games: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3457
|
+
...this.transformer.transform.game(a),
|
|
3458
|
+
cursor: r
|
|
3457
3459
|
})),
|
|
3458
3460
|
totalCount: t.data.totalCount,
|
|
3459
3461
|
hasNextPage: t.data.pageInfo.hasNextPage,
|
|
@@ -3501,11 +3503,11 @@ class Ot {
|
|
|
3501
3503
|
ok: !0,
|
|
3502
3504
|
data: this.transformer.transform.gameSession(t.data)
|
|
3503
3505
|
};
|
|
3504
|
-
const
|
|
3505
|
-
return
|
|
3506
|
+
const r = await this.gameService.gameSession({ id: e });
|
|
3507
|
+
return r.ok ? {
|
|
3506
3508
|
ok: !0,
|
|
3507
|
-
data:
|
|
3508
|
-
} :
|
|
3509
|
+
data: r.data ? this.transformer.transform.gameSession(r.data) : null
|
|
3510
|
+
} : r;
|
|
3509
3511
|
}
|
|
3510
3512
|
/**
|
|
3511
3513
|
* @deprecated use `createGameSession__next`
|
|
@@ -3524,13 +3526,13 @@ class Ot {
|
|
|
3524
3526
|
* ```
|
|
3525
3527
|
*/
|
|
3526
3528
|
async createGameSession(e) {
|
|
3527
|
-
const t = e.id ?? A.generate(S.GameSession).toString(),
|
|
3528
|
-
return
|
|
3529
|
+
const t = e.id ?? A.generate(S.GameSession).toString(), r = await this.walletService.createGameSession({ input: { id: t, game: e.game } });
|
|
3530
|
+
return r.ok ? { ok: !0, data: { id: t } } : r;
|
|
3529
3531
|
}
|
|
3530
3532
|
/** @deprecated use `createGameSession__next` */
|
|
3531
3533
|
async createGameSession__legacy(e) {
|
|
3532
|
-
const t = e.id ?? A.generate(S.GameSession).toString(),
|
|
3533
|
-
return
|
|
3534
|
+
const t = e.id ?? A.generate(S.GameSession).toString(), r = await this.gameService.createGameSession({ input: { id: t, game: e.game } });
|
|
3535
|
+
return r.ok ? { ok: !0, data: { id: t } } : r;
|
|
3534
3536
|
}
|
|
3535
3537
|
async createGameSession__next(e) {
|
|
3536
3538
|
const t = e.id ?? A.generate(S.GameSession).toString();
|
|
@@ -3545,8 +3547,8 @@ class Ot {
|
|
|
3545
3547
|
});
|
|
3546
3548
|
return l.ok ? { ok: !0, data: { id: t } } : l;
|
|
3547
3549
|
}
|
|
3548
|
-
const
|
|
3549
|
-
if (!
|
|
3550
|
+
const r = await this.game__next(e.game);
|
|
3551
|
+
if (!r.data)
|
|
3550
3552
|
return {
|
|
3551
3553
|
ok: !1,
|
|
3552
3554
|
error: {
|
|
@@ -3556,9 +3558,9 @@ class Ot {
|
|
|
3556
3558
|
};
|
|
3557
3559
|
const {
|
|
3558
3560
|
/**/
|
|
3559
|
-
provider:
|
|
3560
|
-
|
|
3561
|
-
} =
|
|
3561
|
+
provider: a,
|
|
3562
|
+
reference: s
|
|
3563
|
+
} = r.data, c = $t(a) ? await this.walletService.createGameSession({ input: { id: t, game: s } }) : await this.gameService.createGameSession({ input: { id: t, game: s } });
|
|
3562
3564
|
return c.ok ? { ok: !0, data: { id: t } } : c;
|
|
3563
3565
|
}
|
|
3564
3566
|
/** @deprecated use `endGameSession__next` */
|
|
@@ -3601,13 +3603,13 @@ class Ot {
|
|
|
3601
3603
|
* ```
|
|
3602
3604
|
*/
|
|
3603
3605
|
async uploadImageFile(e) {
|
|
3604
|
-
const t = e.id ?? A.generate(S.File).toString(),
|
|
3606
|
+
const t = e.id ?? A.generate(S.File).toString(), r = await this.fileService.uploadPrivateImageFile({
|
|
3605
3607
|
input: {
|
|
3606
3608
|
id: t,
|
|
3607
3609
|
file: e.file
|
|
3608
3610
|
}
|
|
3609
3611
|
});
|
|
3610
|
-
return
|
|
3612
|
+
return r.ok ? { ok: !0, data: { id: t } } : r;
|
|
3611
3613
|
}
|
|
3612
3614
|
/**/
|
|
3613
3615
|
/*+----------------------------------------+*/
|
|
@@ -3633,9 +3635,9 @@ class Ot {
|
|
|
3633
3635
|
return t.ok ? {
|
|
3634
3636
|
ok: !0,
|
|
3635
3637
|
data: {
|
|
3636
|
-
pointsWalletTransactions: t.data.edges.map(({ cursor:
|
|
3637
|
-
...this.transformer.transform.pointsWalletTransaction(
|
|
3638
|
-
cursor:
|
|
3638
|
+
pointsWalletTransactions: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3639
|
+
...this.transformer.transform.pointsWalletTransaction(a),
|
|
3640
|
+
cursor: r
|
|
3639
3641
|
})),
|
|
3640
3642
|
totalCount: t.data.totalCount,
|
|
3641
3643
|
hasNextPage: t.data.pageInfo.hasNextPage,
|
|
@@ -3653,9 +3655,9 @@ class Ot {
|
|
|
3653
3655
|
return t.ok ? {
|
|
3654
3656
|
ok: !0,
|
|
3655
3657
|
data: {
|
|
3656
|
-
activityRecords: t.data.edges.map(({ cursor:
|
|
3657
|
-
...this.transformer.transform.activityRecord(
|
|
3658
|
-
cursor:
|
|
3658
|
+
activityRecords: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3659
|
+
...this.transformer.transform.activityRecord(a),
|
|
3660
|
+
cursor: r
|
|
3659
3661
|
})),
|
|
3660
3662
|
totalCount: t.data.totalCount,
|
|
3661
3663
|
hasNextPage: t.data.pageInfo.hasNextPage,
|