@opexa/portal-sdk 0.0.33 → 0.0.34
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 +9 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +67 -55
- package/dist/index.mjs.map +1 -1
- package/dist/sdk/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ 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
4
|
import { ObjectId as b } from "@opexa/object-id";
|
|
5
|
-
import { ObjectId as
|
|
5
|
+
import { ObjectId as Bt } from "@opexa/object-id";
|
|
6
6
|
const S = {
|
|
7
7
|
Account: 8,
|
|
8
8
|
Deposit: 9,
|
|
@@ -203,7 +203,7 @@ const x = o`
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
`,
|
|
206
|
+
`, We = o`
|
|
207
207
|
query WithdrawalRecords($first: Int, $after: Cursor, $filter: WithdrawalRecordFilterInput) {
|
|
208
208
|
member {
|
|
209
209
|
withdrawalRecords(first: $first, after: $after, filter: $filter) {
|
|
@@ -270,7 +270,7 @@ const x = o`
|
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
-
`,
|
|
273
|
+
`, $e = o`
|
|
274
274
|
mutation CreateGCashWithdrawal($input: CreateGCashWithdrawalInput!) {
|
|
275
275
|
createGCashWithdrawal(input: $input) {
|
|
276
276
|
... on AccountNotVerifiedError {
|
|
@@ -602,7 +602,7 @@ const x = o`
|
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
|
-
`,
|
|
605
|
+
`, $ = o`
|
|
606
606
|
${x}
|
|
607
607
|
|
|
608
608
|
fragment PromoFragment on Promo {
|
|
@@ -622,7 +622,7 @@ const x = o`
|
|
|
622
622
|
dateTimeLastUpdated
|
|
623
623
|
}
|
|
624
624
|
`, Je = o`
|
|
625
|
-
${
|
|
625
|
+
${$}
|
|
626
626
|
|
|
627
627
|
query Promos {
|
|
628
628
|
promos {
|
|
@@ -630,7 +630,7 @@ const x = o`
|
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
`, Xe = o`
|
|
633
|
-
${
|
|
633
|
+
${$}
|
|
634
634
|
|
|
635
635
|
query AvailablePromos($filter: PromoFilterInput) {
|
|
636
636
|
availablePromos(filter: $filter) {
|
|
@@ -663,7 +663,7 @@ const x = o`
|
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
665
|
`, et = o`
|
|
666
|
-
${
|
|
666
|
+
${$}
|
|
667
667
|
|
|
668
668
|
query Bonus {
|
|
669
669
|
bonus {
|
|
@@ -1168,7 +1168,7 @@ class bt {
|
|
|
1168
1168
|
} : t;
|
|
1169
1169
|
}
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function h(n, e) {
|
|
1172
1172
|
const t = G[n] ? G[n] : G[500];
|
|
1173
1173
|
return {
|
|
1174
1174
|
name: t.name,
|
|
@@ -1218,12 +1218,12 @@ class St {
|
|
|
1218
1218
|
error: m("AccountBlacklisted")
|
|
1219
1219
|
} : {
|
|
1220
1220
|
ok: !1,
|
|
1221
|
-
error:
|
|
1221
|
+
error: h(a.status)
|
|
1222
1222
|
};
|
|
1223
1223
|
} catch {
|
|
1224
1224
|
return {
|
|
1225
1225
|
ok: !1,
|
|
1226
|
-
error:
|
|
1226
|
+
error: h(500)
|
|
1227
1227
|
};
|
|
1228
1228
|
}
|
|
1229
1229
|
}
|
|
@@ -1251,12 +1251,12 @@ class St {
|
|
|
1251
1251
|
error: m("InvalidTokenOrSecretAnswer")
|
|
1252
1252
|
} : {
|
|
1253
1253
|
ok: !1,
|
|
1254
|
-
error:
|
|
1254
|
+
error: h(a.status)
|
|
1255
1255
|
};
|
|
1256
1256
|
} catch {
|
|
1257
1257
|
return {
|
|
1258
1258
|
ok: !1,
|
|
1259
|
-
error:
|
|
1259
|
+
error: h(500)
|
|
1260
1260
|
};
|
|
1261
1261
|
}
|
|
1262
1262
|
}
|
|
@@ -1284,12 +1284,12 @@ class St {
|
|
|
1284
1284
|
error: m("InvalidToken")
|
|
1285
1285
|
} : {
|
|
1286
1286
|
ok: !1,
|
|
1287
|
-
error:
|
|
1287
|
+
error: h(t.status)
|
|
1288
1288
|
};
|
|
1289
1289
|
} catch {
|
|
1290
1290
|
return {
|
|
1291
1291
|
ok: !1,
|
|
1292
|
-
error:
|
|
1292
|
+
error: h(500)
|
|
1293
1293
|
};
|
|
1294
1294
|
}
|
|
1295
1295
|
}
|
|
@@ -1304,9 +1304,9 @@ class St {
|
|
|
1304
1304
|
Authorization: `Bearer ${e}`
|
|
1305
1305
|
}
|
|
1306
1306
|
});
|
|
1307
|
-
return t.ok ? { ok: !0 } : { ok: !1, error:
|
|
1307
|
+
return t.ok ? { ok: !0 } : { ok: !1, error: h(t.status) };
|
|
1308
1308
|
} catch {
|
|
1309
|
-
return { ok: !1, error:
|
|
1309
|
+
return { ok: !1, error: h(500) };
|
|
1310
1310
|
}
|
|
1311
1311
|
}
|
|
1312
1312
|
async verifySession(e) {
|
|
@@ -1365,7 +1365,7 @@ class At {
|
|
|
1365
1365
|
}
|
|
1366
1366
|
async withdrawalRecords(e) {
|
|
1367
1367
|
const t = await this.client.request(
|
|
1368
|
-
|
|
1368
|
+
We,
|
|
1369
1369
|
e
|
|
1370
1370
|
);
|
|
1371
1371
|
return t.ok ? { ok: t.ok, data: t.data.member.withdrawalRecords } : t;
|
|
@@ -1488,7 +1488,7 @@ class Ae {
|
|
|
1488
1488
|
} : t;
|
|
1489
1489
|
}
|
|
1490
1490
|
async createGCashWithdrawal(e) {
|
|
1491
|
-
const t = await this.client.request(
|
|
1491
|
+
const t = await this.client.request($e, e);
|
|
1492
1492
|
return t.ok ? t.data.createGCashWithdrawal ? {
|
|
1493
1493
|
ok: !1,
|
|
1494
1494
|
error: m(t.data.createGCashWithdrawal.__typename)
|
|
@@ -1623,9 +1623,9 @@ class Ct {
|
|
|
1623
1623
|
} : e;
|
|
1624
1624
|
}
|
|
1625
1625
|
async games(e) {
|
|
1626
|
-
var r, s, c, p, u,
|
|
1626
|
+
var r, s, c, p, u, f, w, l, A, k, C, _, T, v, N, M;
|
|
1627
1627
|
const t = new URLSearchParams();
|
|
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), (
|
|
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), (f = (u = e == null ? void 0 : e.filter) == null ? void 0 : u.type) != null && f.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(","));
|
|
1629
1629
|
const a = await this.getJson("/games", t);
|
|
1630
1630
|
return a.ok ? {
|
|
1631
1631
|
ok: !0,
|
|
@@ -1670,12 +1670,12 @@ class Ct {
|
|
|
1670
1670
|
data: await r.json()
|
|
1671
1671
|
} : {
|
|
1672
1672
|
ok: !1,
|
|
1673
|
-
error:
|
|
1673
|
+
error: h(r.status)
|
|
1674
1674
|
};
|
|
1675
1675
|
} catch {
|
|
1676
1676
|
return {
|
|
1677
1677
|
ok: !1,
|
|
1678
|
-
error:
|
|
1678
|
+
error: h(500)
|
|
1679
1679
|
};
|
|
1680
1680
|
}
|
|
1681
1681
|
}
|
|
@@ -1740,7 +1740,7 @@ class Tt {
|
|
|
1740
1740
|
function vt(n, e, t) {
|
|
1741
1741
|
return n < e ? e : n > t ? t : n;
|
|
1742
1742
|
}
|
|
1743
|
-
function
|
|
1743
|
+
function W(n) {
|
|
1744
1744
|
return Object.prototype.toString.call(n) === "[object Object]" && Object(n) === n;
|
|
1745
1745
|
}
|
|
1746
1746
|
function Nt(n) {
|
|
@@ -1748,7 +1748,7 @@ function Nt(n) {
|
|
|
1748
1748
|
function t(a, r = []) {
|
|
1749
1749
|
for (const s in a) {
|
|
1750
1750
|
const c = a[s];
|
|
1751
|
-
|
|
1751
|
+
W(c) ? t(c, [...r, s]) : Array.isArray(c) ? t(Mt(c), [...r, s]) : e.push({
|
|
1752
1752
|
key: [...r, s],
|
|
1753
1753
|
value: c
|
|
1754
1754
|
});
|
|
@@ -1800,11 +1800,11 @@ class E {
|
|
|
1800
1800
|
try {
|
|
1801
1801
|
const u = await fetch(e);
|
|
1802
1802
|
if (!u.ok)
|
|
1803
|
-
return { ok: !1, error:
|
|
1804
|
-
const
|
|
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:
|
|
1803
|
+
return { ok: !1, error: h(u.status) };
|
|
1804
|
+
const f = await u.json(), w = f.data, l = (t = f.errors) == null ? void 0 : t.at(0);
|
|
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: h(403, l.message) } : ((s = l.extensions) == null ? void 0 : s.code) === "UNAUTHORIZED" ? { ok: !1, error: h(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: h(400, l.message) } : {
|
|
1806
1806
|
ok: !1,
|
|
1807
|
-
error:
|
|
1807
|
+
error: h(500, l.message)
|
|
1808
1808
|
} : {
|
|
1809
1809
|
ok: !0,
|
|
1810
1810
|
data: w
|
|
@@ -1812,7 +1812,7 @@ class E {
|
|
|
1812
1812
|
} catch {
|
|
1813
1813
|
return {
|
|
1814
1814
|
ok: !1,
|
|
1815
|
-
error:
|
|
1815
|
+
error: h(500)
|
|
1816
1816
|
};
|
|
1817
1817
|
}
|
|
1818
1818
|
}
|
|
@@ -1890,8 +1890,8 @@ function we(n, e) {
|
|
|
1890
1890
|
/**/
|
|
1891
1891
|
} = e;
|
|
1892
1892
|
async function s(c, p) {
|
|
1893
|
-
const u = p ?? r,
|
|
1894
|
-
return t(
|
|
1893
|
+
const u = p ?? r, f = await n(...c);
|
|
1894
|
+
return t(f) ? f : u > 1 ? (await Ce(a * ((r - u) / 2)), s(c, u - 1)) : f;
|
|
1895
1895
|
}
|
|
1896
1896
|
return async (...c) => await s(c);
|
|
1897
1897
|
}
|
|
@@ -1959,13 +1959,13 @@ class It {
|
|
|
1959
1959
|
maxAttempt: 5
|
|
1960
1960
|
})();
|
|
1961
1961
|
if (!u.ok) return u;
|
|
1962
|
-
const
|
|
1962
|
+
const f = /* @__PURE__ */ new Date();
|
|
1963
1963
|
return window.localStorage.setItem(
|
|
1964
1964
|
this.storageKey,
|
|
1965
1965
|
JSON.stringify({
|
|
1966
1966
|
...u.data,
|
|
1967
|
-
accessTokenExpiresAt: R(
|
|
1968
|
-
refreshTokenExpiresAt: P(D(
|
|
1967
|
+
accessTokenExpiresAt: R(f, 8).getTime(),
|
|
1968
|
+
refreshTokenExpiresAt: P(D(f, 30), 2).getTime()
|
|
1969
1969
|
})
|
|
1970
1970
|
), {
|
|
1971
1971
|
ok: !0,
|
|
@@ -2112,12 +2112,12 @@ function y(n) {
|
|
|
2112
2112
|
for (const t in n) {
|
|
2113
2113
|
const a = n[t];
|
|
2114
2114
|
if (a !== null && a !== void 0) {
|
|
2115
|
-
if (
|
|
2115
|
+
if (W(a)) {
|
|
2116
2116
|
e[t] = y(a);
|
|
2117
2117
|
continue;
|
|
2118
2118
|
}
|
|
2119
2119
|
if (Array.isArray(a)) {
|
|
2120
|
-
e[t] = a.map((r) =>
|
|
2120
|
+
e[t] = a.map((r) => W(r) ? y(r) : r);
|
|
2121
2121
|
continue;
|
|
2122
2122
|
}
|
|
2123
2123
|
e[t] = a;
|
|
@@ -2181,7 +2181,7 @@ class Dt {
|
|
|
2181
2181
|
return y(t);
|
|
2182
2182
|
}
|
|
2183
2183
|
platform(e) {
|
|
2184
|
-
var t, a, r, s, c, p, u,
|
|
2184
|
+
var t, a, r, s, c, p, u, f, 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;
|
|
2185
2185
|
return {
|
|
2186
2186
|
paymentSettings: {
|
|
2187
2187
|
minimumFirstDepositAmount: i(e.minimumFirstDepositAmount),
|
|
@@ -2197,7 +2197,7 @@ class Dt {
|
|
|
2197
2197
|
},
|
|
2198
2198
|
gcash: {
|
|
2199
2199
|
androidEnabled: ((u = e.gcashDepositGatewaySettings) == null ? void 0 : u.androidEnabled) ?? !1,
|
|
2200
|
-
iosEnabled: ((
|
|
2200
|
+
iosEnabled: ((f = e.gcashDepositGatewaySettings) == null ? void 0 : f.iosEnabled) ?? !1,
|
|
2201
2201
|
webEnabled: ((w = e.gcashDepositGatewaySettings) == null ? void 0 : w.webEnabled) ?? !1,
|
|
2202
2202
|
mobileWebEnabled: ((l = e.gcashDepositGatewaySettings) == null ? void 0 : l.mobileWebEnabled) ?? !1,
|
|
2203
2203
|
minimumAmount: i((A = e.gcashDepositGatewaySettings) == null ? void 0 : A.minimumAmount),
|
|
@@ -2565,7 +2565,7 @@ class Dt {
|
|
|
2565
2565
|
};
|
|
2566
2566
|
}
|
|
2567
2567
|
}
|
|
2568
|
-
class
|
|
2568
|
+
class Gt {
|
|
2569
2569
|
constructor(e) {
|
|
2570
2570
|
d(this, "gameService");
|
|
2571
2571
|
d(this, "fileService");
|
|
@@ -3418,8 +3418,20 @@ class xt {
|
|
|
3418
3418
|
return a.ok ? { ok: !0, data: { id: t } } : a;
|
|
3419
3419
|
}
|
|
3420
3420
|
async createGameSession__next(e) {
|
|
3421
|
-
const t =
|
|
3422
|
-
if (
|
|
3421
|
+
const t = e.id ?? b.generate(S.GameSession).toString();
|
|
3422
|
+
if (e.game.startsWith("SPORTS:")) {
|
|
3423
|
+
const p = await b.generateFromKey(S.Game, e.game).then(
|
|
3424
|
+
(f) => f.toString()
|
|
3425
|
+
), u = await this.gameService.createGameSession({
|
|
3426
|
+
input: {
|
|
3427
|
+
id: t,
|
|
3428
|
+
game: p
|
|
3429
|
+
}
|
|
3430
|
+
});
|
|
3431
|
+
return u.ok ? { ok: !0, data: { id: t } } : u;
|
|
3432
|
+
}
|
|
3433
|
+
const a = await this.game__next(e.game);
|
|
3434
|
+
if (!a.data)
|
|
3423
3435
|
return {
|
|
3424
3436
|
ok: !1,
|
|
3425
3437
|
error: {
|
|
@@ -3429,20 +3441,10 @@ class xt {
|
|
|
3429
3441
|
};
|
|
3430
3442
|
const {
|
|
3431
3443
|
/**/
|
|
3432
|
-
type: a,
|
|
3433
3444
|
provider: r,
|
|
3434
3445
|
externalId: s
|
|
3435
|
-
} =
|
|
3436
|
-
|
|
3437
|
-
"RTG",
|
|
3438
|
-
"DARWIN",
|
|
3439
|
-
"DRBINGO",
|
|
3440
|
-
"MEGABALL",
|
|
3441
|
-
"EVOLUTION",
|
|
3442
|
-
"EVOLUTION_NETENT",
|
|
3443
|
-
"EVOLUTION_REDTIGER"
|
|
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;
|
|
3446
|
+
} = a.data, c = Rt.includes(r) ? await this.walletService.createGameSession({ input: { id: t, game: s } }) : await this.gameService.createGameSession({ input: { id: t, game: s } });
|
|
3447
|
+
return c.ok ? { ok: !0, data: { id: t } } : c;
|
|
3446
3448
|
}
|
|
3447
3449
|
/** @deprecated use `endGameSession__next` */
|
|
3448
3450
|
async endGameSession(e) {
|
|
@@ -3550,9 +3552,19 @@ class xt {
|
|
|
3550
3552
|
return e.startsWith("+63") ? e : e.startsWith("63") ? `+${e}` : e.startsWith("0") ? `+63${e.substring(1)}` : `+63${e}`;
|
|
3551
3553
|
}
|
|
3552
3554
|
}
|
|
3555
|
+
const Rt = [
|
|
3556
|
+
/**/
|
|
3557
|
+
"RTG",
|
|
3558
|
+
"DARWIN",
|
|
3559
|
+
"DRBINGO",
|
|
3560
|
+
"MEGABALL",
|
|
3561
|
+
"EVOLUTION",
|
|
3562
|
+
"EVOLUTION_NETENT",
|
|
3563
|
+
"EVOLUTION_REDTIGER"
|
|
3564
|
+
];
|
|
3553
3565
|
export {
|
|
3554
|
-
|
|
3566
|
+
Bt as ObjectId,
|
|
3555
3567
|
S as ObjectType,
|
|
3556
|
-
|
|
3568
|
+
Gt as Sdk
|
|
3557
3569
|
};
|
|
3558
3570
|
//# sourceMappingURL=index.mjs.map
|