@opexa/portal-sdk 0.0.85 → 0.0.87
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 +63 -63
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +115 -115
- package/dist/index.mjs.map +1 -1
- package/dist/sdk/types.d.ts +2 -2
- package/dist/services/types.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var m = (o, e, t) =>
|
|
1
|
+
var Te = Object.defineProperty;
|
|
2
|
+
var _e = (o, e, t) => e in o ? Te(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var m = (o, e, t) => _e(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import { ObjectId as k } from "@opexa/object-id";
|
|
5
|
-
import { ObjectId as
|
|
6
|
-
const
|
|
5
|
+
import { ObjectId as Vt } from "@opexa/object-id";
|
|
6
|
+
const T = {
|
|
7
7
|
Account: 8,
|
|
8
8
|
Deposit: 9,
|
|
9
9
|
Withdrawal: 14,
|
|
@@ -283,7 +283,7 @@ const L = i`
|
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
`,
|
|
286
|
+
`, Ue = i`
|
|
287
287
|
mutation CreateMayaWithdrawal($input: CreateMayaWithdrawalInput!) {
|
|
288
288
|
createMayaWithdrawal(input: $input) {
|
|
289
289
|
... on AccountNotVerifiedError {
|
|
@@ -306,7 +306,7 @@ const L = i`
|
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
`,
|
|
309
|
+
`, Ge = i`
|
|
310
310
|
mutation CreateMayaAppWithdrawal($input: CreateMayaAppWithdrawalInput!) {
|
|
311
311
|
createMayaAppWithdrawal(input: $input) {
|
|
312
312
|
... on AccountNotVerifiedError {
|
|
@@ -951,7 +951,7 @@ const tt = i`
|
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
953
|
}
|
|
954
|
-
`,
|
|
954
|
+
`, pt = i`
|
|
955
955
|
query ProfileCompletion {
|
|
956
956
|
profileCompletion {
|
|
957
957
|
completionPercentage
|
|
@@ -962,7 +962,7 @@ const tt = i`
|
|
|
962
962
|
accountPassword
|
|
963
963
|
}
|
|
964
964
|
}
|
|
965
|
-
`,
|
|
965
|
+
`, ft = i`
|
|
966
966
|
mutation SendVerificationCode($input: SendVerificationCodeInput!) {
|
|
967
967
|
sendVerificationCode(input: $input) {
|
|
968
968
|
... on InvalidPlatformError {
|
|
@@ -1029,7 +1029,7 @@ const tt = i`
|
|
|
1029
1029
|
multiplier
|
|
1030
1030
|
}
|
|
1031
1031
|
}
|
|
1032
|
-
`,
|
|
1032
|
+
`, wt = i`
|
|
1033
1033
|
query MayaSession($id: ObjectId!) {
|
|
1034
1034
|
mayaSession(id: $id) {
|
|
1035
1035
|
id
|
|
@@ -1037,7 +1037,7 @@ const tt = i`
|
|
|
1037
1037
|
dateTimeCreated
|
|
1038
1038
|
}
|
|
1039
1039
|
}
|
|
1040
|
-
`,
|
|
1040
|
+
`, yt = i`
|
|
1041
1041
|
mutation ValidateMayaSession {
|
|
1042
1042
|
validateMayaSession: validMayaSession
|
|
1043
1043
|
}
|
|
@@ -1209,7 +1209,7 @@ function d(o) {
|
|
|
1209
1209
|
}[o]
|
|
1210
1210
|
};
|
|
1211
1211
|
}
|
|
1212
|
-
class
|
|
1212
|
+
class Tt {
|
|
1213
1213
|
constructor(e) {
|
|
1214
1214
|
m(this, "client");
|
|
1215
1215
|
this.client = e;
|
|
@@ -1283,7 +1283,7 @@ class _t {
|
|
|
1283
1283
|
} : t;
|
|
1284
1284
|
}
|
|
1285
1285
|
async profileCompletion() {
|
|
1286
|
-
const e = await this.client.request(
|
|
1286
|
+
const e = await this.client.request(pt);
|
|
1287
1287
|
return e.ok ? { ok: !0, data: e.data.profileCompletion } : e;
|
|
1288
1288
|
}
|
|
1289
1289
|
async platform() {
|
|
@@ -1291,7 +1291,7 @@ class _t {
|
|
|
1291
1291
|
}
|
|
1292
1292
|
/** @deprecated */
|
|
1293
1293
|
async sendVerificationCode(e) {
|
|
1294
|
-
const t = await this.client.request(
|
|
1294
|
+
const t = await this.client.request(ft, e);
|
|
1295
1295
|
return t.ok ? t.data.sendVerificationCode ? {
|
|
1296
1296
|
ok: !1,
|
|
1297
1297
|
error: d(t.data.sendVerificationCode.__typename)
|
|
@@ -1388,7 +1388,7 @@ const V = {
|
|
|
1388
1388
|
429: { name: "HttpTooManyRequests", message: "Too Many Requests" },
|
|
1389
1389
|
500: { name: "HttpInternalServerError", message: "Internal Server Error" }
|
|
1390
1390
|
};
|
|
1391
|
-
class
|
|
1391
|
+
class _t {
|
|
1392
1392
|
constructor(e) {
|
|
1393
1393
|
m(this, "url");
|
|
1394
1394
|
m(this, "platform");
|
|
@@ -1518,8 +1518,16 @@ class Tt {
|
|
|
1518
1518
|
async sendVerificationCode(e) {
|
|
1519
1519
|
if (e.channel === "EMAIL") throw new Error("Email channel is not yet supported");
|
|
1520
1520
|
function t(r) {
|
|
1521
|
-
|
|
1522
|
-
|
|
1521
|
+
switch (r) {
|
|
1522
|
+
case "MEMBER_NOT_FOUND":
|
|
1523
|
+
return "AccountNotFoundError";
|
|
1524
|
+
case "RATE_LIMIT_REACH":
|
|
1525
|
+
return "RateLimitExceededError";
|
|
1526
|
+
case "NOT_READY_TO_SEND_VERIFICATION_ERROR":
|
|
1527
|
+
return "NotReadyToSendVerficationCodeError";
|
|
1528
|
+
default:
|
|
1529
|
+
return null;
|
|
1530
|
+
}
|
|
1523
1531
|
}
|
|
1524
1532
|
try {
|
|
1525
1533
|
const r = await fetch(`${this.url}/otps`, {
|
|
@@ -1564,9 +1572,9 @@ class vt {
|
|
|
1564
1572
|
} : e;
|
|
1565
1573
|
}
|
|
1566
1574
|
async games(e) {
|
|
1567
|
-
var a, s, c, u,
|
|
1575
|
+
var a, s, c, u, p, f, w, l, _, v, M, R, N, E, I, D, S, P, $, x, C, U, O, W;
|
|
1568
1576
|
const t = new URLSearchParams();
|
|
1569
|
-
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), (u = (c = e == null ? void 0 : e.filter) == null ? void 0 : c.type) != null && u.notEqual && t.set("filter[type][neq]", e.filter.type.notEqual), (
|
|
1577
|
+
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), (u = (c = e == null ? void 0 : e.filter) == null ? void 0 : c.type) != null && u.notEqual && t.set("filter[type][neq]", e.filter.type.notEqual), (f = (p = e == null ? void 0 : e.filter) == null ? void 0 : p.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(",")), (v = (_ = e == null ? void 0 : e.filter) == null ? void 0 : _.provider) != null && v.equal && t.set("filter[provider][eq]", e.filter.provider.equal), (R = (M = e == null ? void 0 : e.filter) == null ? void 0 : M.provider) != null && R.notEqual && t.set("filter[provider][neq]", e.filter.provider.notEqual), (E = (N = e == null ? void 0 : e.filter) == null ? void 0 : N.provider) != null && E.in && t.set("filter[provider][in]", e.filter.provider.in.join(",")), (D = (I = e == null ? void 0 : e.filter) == null ? void 0 : I.provider) != null && D.notIn && t.set("filter[provider][nin]", e.filter.provider.notIn.join(",")), (P = (S = e == null ? void 0 : e.filter) == null ? void 0 : S.tags) != null && P.equal && t.set("filter[tags][eq]", e.filter.tags.equal.toLowerCase()), (x = ($ = e == null ? void 0 : e.filter) == null ? void 0 : $.tags) != null && x.notEqual && t.set("filter[tags][neq]", e.filter.tags.notEqual.toLowerCase()), (U = (C = e == null ? void 0 : e.filter) == null ? void 0 : C.tags) != null && U.in && t.set(
|
|
1570
1578
|
"filter[tags][in]",
|
|
1571
1579
|
e.filter.tags.in.map((A) => A.toLowerCase()).join(",")
|
|
1572
1580
|
), (W = (O = e == null ? void 0 : e.filter) == null ? void 0 : O.tags) != null && W.notIn && t.set(
|
|
@@ -1870,7 +1878,7 @@ class Pt {
|
|
|
1870
1878
|
} : t;
|
|
1871
1879
|
}
|
|
1872
1880
|
async createMayaWithdrawal(e) {
|
|
1873
|
-
const t = await this.client.request(
|
|
1881
|
+
const t = await this.client.request(Ue, e);
|
|
1874
1882
|
return t.ok ? t.data.createMayaWithdrawal ? {
|
|
1875
1883
|
ok: !1,
|
|
1876
1884
|
error: d(t.data.createMayaWithdrawal.__typename)
|
|
@@ -1879,7 +1887,7 @@ class Pt {
|
|
|
1879
1887
|
} : t;
|
|
1880
1888
|
}
|
|
1881
1889
|
async createMayaAppWithdrawal(e) {
|
|
1882
|
-
const t = await this.client.request(
|
|
1890
|
+
const t = await this.client.request(Ge, e);
|
|
1883
1891
|
return t.ok ? t.data.createMayaAppWithdrawal ? {
|
|
1884
1892
|
ok: !1,
|
|
1885
1893
|
error: d(t.data.createMayaAppWithdrawal.__typename)
|
|
@@ -1917,7 +1925,7 @@ class Pt {
|
|
|
1917
1925
|
}
|
|
1918
1926
|
async mayaSession(e) {
|
|
1919
1927
|
const t = await this.client.request(
|
|
1920
|
-
|
|
1928
|
+
wt,
|
|
1921
1929
|
e
|
|
1922
1930
|
);
|
|
1923
1931
|
return t.ok ? { ok: t.ok, data: t.data.mayaSession } : t;
|
|
@@ -1955,7 +1963,7 @@ class Pt {
|
|
|
1955
1963
|
}
|
|
1956
1964
|
async validateMayaSession() {
|
|
1957
1965
|
const e = await this.client.request(
|
|
1958
|
-
|
|
1966
|
+
yt
|
|
1959
1967
|
);
|
|
1960
1968
|
return e.ok ? e.data.validateMayaSession ? {
|
|
1961
1969
|
ok: !0
|
|
@@ -1979,7 +1987,7 @@ function xt(o) {
|
|
|
1979
1987
|
function t(r, a = []) {
|
|
1980
1988
|
for (const s in r) {
|
|
1981
1989
|
const c = r[s];
|
|
1982
|
-
H(c) ? t(c, [...a, s]) : Array.isArray(c) ? t(
|
|
1990
|
+
H(c) ? t(c, [...a, s]) : Array.isArray(c) ? t(Ut(c), [...a, s]) : e.push({
|
|
1983
1991
|
key: [...a, s],
|
|
1984
1992
|
value: c
|
|
1985
1993
|
});
|
|
@@ -1987,10 +1995,10 @@ function xt(o) {
|
|
|
1987
1995
|
}
|
|
1988
1996
|
return t(o), e;
|
|
1989
1997
|
}
|
|
1990
|
-
function
|
|
1998
|
+
function Ut(o) {
|
|
1991
1999
|
return o.reduce((e, t, r) => (e[r] = t, e), {});
|
|
1992
2000
|
}
|
|
1993
|
-
class
|
|
2001
|
+
class G {
|
|
1994
2002
|
constructor(e, t) {
|
|
1995
2003
|
m(this, "url");
|
|
1996
2004
|
m(this, "options");
|
|
@@ -2029,16 +2037,16 @@ class U {
|
|
|
2029
2037
|
async exec(e) {
|
|
2030
2038
|
var t, r, a, s, c, u;
|
|
2031
2039
|
try {
|
|
2032
|
-
const
|
|
2033
|
-
if (!
|
|
2034
|
-
return { ok: !1, error: h(
|
|
2035
|
-
const
|
|
2036
|
-
return
|
|
2040
|
+
const p = await fetch(e);
|
|
2041
|
+
if (!p.ok)
|
|
2042
|
+
return { ok: !1, error: h(p.status) };
|
|
2043
|
+
const f = await p.json(), w = f.data, l = (t = f.errors) == null ? void 0 : t.at(0);
|
|
2044
|
+
return l ? ((r = l.extensions) == null ? void 0 : r.code) === "FORBIDDEN" || ((a = l.extensions) == null ? void 0 : a.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" || ((u = l.extensions) == null ? void 0 : u.code) === "BAD_REQUEST" ? { ok: !1, error: h(400, l.message) } : {
|
|
2037
2045
|
ok: !1,
|
|
2038
|
-
error: h(500,
|
|
2046
|
+
error: h(500, l.message)
|
|
2039
2047
|
} : {
|
|
2040
2048
|
ok: !0,
|
|
2041
|
-
data:
|
|
2049
|
+
data: w
|
|
2042
2050
|
};
|
|
2043
2051
|
} catch {
|
|
2044
2052
|
return {
|
|
@@ -2072,7 +2080,7 @@ class U {
|
|
|
2072
2080
|
}), a;
|
|
2073
2081
|
}
|
|
2074
2082
|
}
|
|
2075
|
-
async function
|
|
2083
|
+
async function y(o) {
|
|
2076
2084
|
const e = new TextEncoder().encode(o), t = await crypto.subtle.digest("SHA-256", e);
|
|
2077
2085
|
return Array.from(new Uint8Array(t)).map((s) => s.toString(16).padStart(2, "0")).join("");
|
|
2078
2086
|
}
|
|
@@ -2105,7 +2113,7 @@ function q(o, e) {
|
|
|
2105
2113
|
const t = Q(o);
|
|
2106
2114
|
return t.setMinutes(t.getMinutes() + e), t;
|
|
2107
2115
|
}
|
|
2108
|
-
function
|
|
2116
|
+
function ye(o, e) {
|
|
2109
2117
|
return o.getTime() > e.getTime();
|
|
2110
2118
|
}
|
|
2111
2119
|
function ke(o) {
|
|
@@ -2121,8 +2129,8 @@ function ge(o, e) {
|
|
|
2121
2129
|
/**/
|
|
2122
2130
|
} = e;
|
|
2123
2131
|
async function s(c, u) {
|
|
2124
|
-
const
|
|
2125
|
-
return t(
|
|
2132
|
+
const p = u ?? a, f = await o(...c);
|
|
2133
|
+
return t(f) ? f : p > 1 ? (await ke(r * ((a - p) / 2)), s(c, p - 1)) : f;
|
|
2126
2134
|
}
|
|
2127
2135
|
return async (...c) => await s(c);
|
|
2128
2136
|
}
|
|
@@ -2130,7 +2138,7 @@ function F(o, e) {
|
|
|
2130
2138
|
const t = Q(o);
|
|
2131
2139
|
return t.setMinutes(t.getMinutes() - e), t;
|
|
2132
2140
|
}
|
|
2133
|
-
class
|
|
2141
|
+
class Gt {
|
|
2134
2142
|
constructor(e) {
|
|
2135
2143
|
m(this, "logger");
|
|
2136
2144
|
m(this, "storageKey", "session");
|
|
@@ -2159,9 +2167,9 @@ class Ut {
|
|
|
2159
2167
|
};
|
|
2160
2168
|
if (e.type === "MAYA") {
|
|
2161
2169
|
const c = await ge(() => this.walletService.mayaSession({ id: e.sessionId }), {
|
|
2162
|
-
until: (
|
|
2163
|
-
var
|
|
2164
|
-
return
|
|
2170
|
+
until: (w) => {
|
|
2171
|
+
var l;
|
|
2172
|
+
return w.ok && ((l = w.data) == null ? void 0 : l.member) != null;
|
|
2165
2173
|
},
|
|
2166
2174
|
interval: 1e3,
|
|
2167
2175
|
maxAttempt: 5
|
|
@@ -2175,19 +2183,19 @@ class Ut {
|
|
|
2175
2183
|
message: "Forbidden"
|
|
2176
2184
|
}
|
|
2177
2185
|
};
|
|
2178
|
-
const
|
|
2179
|
-
until: (
|
|
2186
|
+
const p = await ge(() => this.authService.createSession(e), {
|
|
2187
|
+
until: (w) => w.ok,
|
|
2180
2188
|
interval: 1e3,
|
|
2181
2189
|
maxAttempt: 5
|
|
2182
2190
|
})();
|
|
2183
|
-
if (!
|
|
2184
|
-
const
|
|
2191
|
+
if (!p.ok) return p;
|
|
2192
|
+
const f = /* @__PURE__ */ new Date();
|
|
2185
2193
|
return window.localStorage.setItem(
|
|
2186
2194
|
this.storageKey,
|
|
2187
2195
|
JSON.stringify({
|
|
2188
|
-
...
|
|
2189
|
-
accessTokenExpiresAt: q(
|
|
2190
|
-
refreshTokenExpiresAt: F(B(
|
|
2196
|
+
...p.data,
|
|
2197
|
+
accessTokenExpiresAt: q(f, 8).getTime(),
|
|
2198
|
+
refreshTokenExpiresAt: F(B(f, 30), 2).getTime()
|
|
2191
2199
|
})
|
|
2192
2200
|
), {
|
|
2193
2201
|
ok: !0,
|
|
@@ -2266,7 +2274,7 @@ class Ut {
|
|
|
2266
2274
|
try {
|
|
2267
2275
|
let t = JSON.parse(e), r = /* @__PURE__ */ new Date();
|
|
2268
2276
|
const a = new Date(t.accessTokenExpiresAt), s = new Date(t.refreshTokenExpiresAt);
|
|
2269
|
-
if (
|
|
2277
|
+
if (ye(r, s))
|
|
2270
2278
|
return this.logger.warn("Session expired. Logging out.."), window.localStorage.removeItem(this.storageKey), {
|
|
2271
2279
|
ok: !1,
|
|
2272
2280
|
error: {
|
|
@@ -2274,7 +2282,7 @@ class Ut {
|
|
|
2274
2282
|
message: "Session expired."
|
|
2275
2283
|
}
|
|
2276
2284
|
};
|
|
2277
|
-
if (
|
|
2285
|
+
if (ye(r, a)) {
|
|
2278
2286
|
this.logger.info("Refreshing session..."), this.refreshing = !0;
|
|
2279
2287
|
const c = await this.authService.refreshSession(t.refreshToken);
|
|
2280
2288
|
if (this.refreshing = !1, !c.ok)
|
|
@@ -2404,7 +2412,7 @@ class Ot {
|
|
|
2404
2412
|
return g(t);
|
|
2405
2413
|
}
|
|
2406
2414
|
platform(e) {
|
|
2407
|
-
var t, r, a, s, c, u,
|
|
2415
|
+
var t, r, a, s, c, u, p, f, w, l, _, v, M, R, N, E, I, D, S, P, $, x, C, U, O, W, A, K, z, J, X, Z, ee, te, re, ae, oe, ne, ie, se, ce, me, de, ue, le, pe, fe, he, we;
|
|
2408
2416
|
return {
|
|
2409
2417
|
timezone: e.timezone,
|
|
2410
2418
|
currency: e.currency,
|
|
@@ -2421,11 +2429,11 @@ class Ot {
|
|
|
2421
2429
|
maximumAmount: n((u = e.bankDepositGatewaySettings) == null ? void 0 : u.maximumAmount)
|
|
2422
2430
|
},
|
|
2423
2431
|
gcash: {
|
|
2424
|
-
androidEnabled: ((
|
|
2425
|
-
iosEnabled: ((
|
|
2426
|
-
webEnabled: ((
|
|
2427
|
-
mobileWebEnabled: ((
|
|
2428
|
-
minimumAmount: n((
|
|
2432
|
+
androidEnabled: ((p = e.gcashDepositGatewaySettings) == null ? void 0 : p.androidEnabled) ?? !1,
|
|
2433
|
+
iosEnabled: ((f = e.gcashDepositGatewaySettings) == null ? void 0 : f.iosEnabled) ?? !1,
|
|
2434
|
+
webEnabled: ((w = e.gcashDepositGatewaySettings) == null ? void 0 : w.webEnabled) ?? !1,
|
|
2435
|
+
mobileWebEnabled: ((l = e.gcashDepositGatewaySettings) == null ? void 0 : l.mobileWebEnabled) ?? !1,
|
|
2436
|
+
minimumAmount: n((_ = e.gcashDepositGatewaySettings) == null ? void 0 : _.minimumAmount),
|
|
2429
2437
|
maximumAmount: n((v = e.gcashDepositGatewaySettings) == null ? void 0 : v.maximumAmount)
|
|
2430
2438
|
},
|
|
2431
2439
|
maya: {
|
|
@@ -2442,7 +2450,7 @@ class Ot {
|
|
|
2442
2450
|
webEnabled: (($ = e.mayaAppDepositGatewaySettings) == null ? void 0 : $.webEnabled) ?? !1,
|
|
2443
2451
|
mobileWebEnabled: ((x = e.mayaAppDepositGatewaySettings) == null ? void 0 : x.mobileWebEnabled) ?? !1,
|
|
2444
2452
|
minimumAmount: n((C = e.mayaAppDepositGatewaySettings) == null ? void 0 : C.minimumAmount),
|
|
2445
|
-
maximumAmount: n((
|
|
2453
|
+
maximumAmount: n((U = e.mayaAppDepositGatewaySettings) == null ? void 0 : U.maximumAmount)
|
|
2446
2454
|
}
|
|
2447
2455
|
},
|
|
2448
2456
|
withdrawalGateway: {
|
|
@@ -2477,8 +2485,8 @@ class Ot {
|
|
|
2477
2485
|
androidEnabled: ((de = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : de.androidEnabled) ?? !1,
|
|
2478
2486
|
iosEnabled: ((ue = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : ue.iosEnabled) ?? !1,
|
|
2479
2487
|
webEnabled: ((le = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : le.webEnabled) ?? !1,
|
|
2480
|
-
mobileWebEnabled: ((
|
|
2481
|
-
minimumAmount: n((
|
|
2488
|
+
mobileWebEnabled: ((pe = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : pe.mobileWebEnabled) ?? !1,
|
|
2489
|
+
minimumAmount: n((fe = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : fe.minimumAmount),
|
|
2482
2490
|
maximumAmount: n(
|
|
2483
2491
|
(he = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : he.maximumAmount,
|
|
2484
2492
|
1e6
|
|
@@ -2487,7 +2495,7 @@ class Ot {
|
|
|
2487
2495
|
}
|
|
2488
2496
|
},
|
|
2489
2497
|
pointsClubSettings: {
|
|
2490
|
-
multiplier: n((
|
|
2498
|
+
multiplier: n((we = e.pointsClubSettings) == null ? void 0 : we.multiplier, 0)
|
|
2491
2499
|
}
|
|
2492
2500
|
};
|
|
2493
2501
|
}
|
|
@@ -2801,7 +2809,7 @@ class Ot {
|
|
|
2801
2809
|
upline: e.upline,
|
|
2802
2810
|
downline: e.downline,
|
|
2803
2811
|
turnover: n(e.turnover, 0),
|
|
2804
|
-
|
|
2812
|
+
commission: n(e.commission, 0),
|
|
2805
2813
|
dateTimeCreated: new Date(e.dateTimeCreated)
|
|
2806
2814
|
};
|
|
2807
2815
|
}
|
|
@@ -2822,7 +2830,7 @@ class Ot {
|
|
|
2822
2830
|
};
|
|
2823
2831
|
}
|
|
2824
2832
|
}
|
|
2825
|
-
class
|
|
2833
|
+
class qt {
|
|
2826
2834
|
constructor(e) {
|
|
2827
2835
|
m(this, "cmsPortalService");
|
|
2828
2836
|
m(this, "authService");
|
|
@@ -2848,7 +2856,7 @@ class Lt {
|
|
|
2848
2856
|
}), this.logger = new Ce({
|
|
2849
2857
|
enabled: c ?? !1
|
|
2850
2858
|
});
|
|
2851
|
-
const
|
|
2859
|
+
const p = u ? "https://auth.opexa.io" : "https://auth.development.opexa.io", f = u ? "https://wallet.opexa.io/graphql" : "https://wallet.development.opexa.io/graphql", w = u ? "https://report.opexa.io/graphql" : "https://report.development.opexa.io/graphql", l = u ? "https://account.opexa.io/graphql" : "https://account.development.opexa.io/graphql", _ = u ? "https://portal.opexa.io/graphql" : "https://portal.development.opexa.io/graphql", v = u ? "https://file.opexa.io/graphql" : "https://file.development.opexa.io/graphql", M = u ? "https://game.opexa.io/graphql" : "https://game.development.opexa.io/graphql", R = "https://portal-api.opexacms.io/v1", N = new vt({
|
|
2852
2860
|
url: R,
|
|
2853
2861
|
site: t,
|
|
2854
2862
|
platform: r
|
|
@@ -2860,15 +2868,15 @@ class Lt {
|
|
|
2860
2868
|
"Platform-Code": a
|
|
2861
2869
|
}
|
|
2862
2870
|
}
|
|
2863
|
-
}, I = new Rt(new
|
|
2864
|
-
url:
|
|
2871
|
+
}, I = new Rt(new G(M, E)), D = new Mt(new G(v, E)), S = new Pt(new G(f, E)), P = new Tt(new G(l, E)), $ = new It(new G(w, E)), x = new Nt(new G(_, E)), C = new _t({
|
|
2872
|
+
url: p,
|
|
2865
2873
|
platform: a
|
|
2866
|
-
}),
|
|
2874
|
+
}), U = new Gt({
|
|
2867
2875
|
logs: c,
|
|
2868
2876
|
authService: C,
|
|
2869
2877
|
walletService: S
|
|
2870
2878
|
});
|
|
2871
|
-
this.authService = C, this.gameService = I, this.fileService = D, this.walletService = S, this.accountService = P, this.reportService = $, this.portalService = x, this.sessionManager =
|
|
2879
|
+
this.authService = C, this.gameService = I, this.fileService = D, this.walletService = S, this.accountService = P, this.reportService = $, this.portalService = x, this.sessionManager = U, this.cmsPortalService = N;
|
|
2872
2880
|
}
|
|
2873
2881
|
get authMiddleware() {
|
|
2874
2882
|
return async (e) => {
|
|
@@ -2882,7 +2890,7 @@ class Lt {
|
|
|
2882
2890
|
case "NAME_AND_PASSWORD": {
|
|
2883
2891
|
const t = await this.sessionManager.create({
|
|
2884
2892
|
...e,
|
|
2885
|
-
password: await
|
|
2893
|
+
password: await y(e.password)
|
|
2886
2894
|
});
|
|
2887
2895
|
return t.ok ? t.data ? {
|
|
2888
2896
|
ok: !0,
|
|
@@ -2909,7 +2917,7 @@ class Lt {
|
|
|
2909
2917
|
return await this.sessionManager.createFromAuthenticator({
|
|
2910
2918
|
type: "SECURITY_QUESTION",
|
|
2911
2919
|
token: e.token,
|
|
2912
|
-
secretAnswer: await
|
|
2920
|
+
secretAnswer: await y(e.secretAnswer)
|
|
2913
2921
|
});
|
|
2914
2922
|
default:
|
|
2915
2923
|
return {
|
|
@@ -2987,14 +2995,14 @@ class Lt {
|
|
|
2987
2995
|
* @deprecated use `createAccount__next`
|
|
2988
2996
|
*/
|
|
2989
2997
|
async createAccount(e) {
|
|
2990
|
-
const t = e.id ?? k.generate(
|
|
2998
|
+
const t = e.id ?? k.generate(T.Account).toString(), r = await this.accountService.registerMemberAccount({
|
|
2991
2999
|
input: {
|
|
2992
3000
|
id: t,
|
|
2993
3001
|
btag: e.btag,
|
|
2994
3002
|
name: e.name,
|
|
2995
3003
|
domain: e.domain,
|
|
2996
3004
|
birthDay: typeof e.dateOfBirth == "string" ? e.dateOfBirth : e.dateOfBirth.toISOString(),
|
|
2997
|
-
password: await
|
|
3005
|
+
password: await y(e.password),
|
|
2998
3006
|
mobileNumber: b(e.mobileNumber)
|
|
2999
3007
|
},
|
|
3000
3008
|
referralCode: e.referralCode,
|
|
@@ -3004,7 +3012,7 @@ class Lt {
|
|
|
3004
3012
|
return r.ok ? { ok: !0, data: { id: t } } : r;
|
|
3005
3013
|
}
|
|
3006
3014
|
async createAccount__next(e) {
|
|
3007
|
-
const t = e.id ?? k.generate(
|
|
3015
|
+
const t = e.id ?? k.generate(T.Account).toString();
|
|
3008
3016
|
if (e.type === "MOBILE_NUMBER") {
|
|
3009
3017
|
const a = await this.accountService.registerMemberAccountViaMobile({
|
|
3010
3018
|
input: {
|
|
@@ -3021,7 +3029,7 @@ class Lt {
|
|
|
3021
3029
|
input: {
|
|
3022
3030
|
id: t,
|
|
3023
3031
|
name: e.name,
|
|
3024
|
-
password: await
|
|
3032
|
+
password: await y(e.password),
|
|
3025
3033
|
mobileNumber: e.mobileNumber ? b(e.mobileNumber) : void 0
|
|
3026
3034
|
},
|
|
3027
3035
|
reCAPTCHAResponse: e.reCAPTCHAResponse
|
|
@@ -3032,7 +3040,7 @@ class Lt {
|
|
|
3032
3040
|
return await this.accountService.registerMayaMemberAccount({
|
|
3033
3041
|
input: {
|
|
3034
3042
|
name: e.name,
|
|
3035
|
-
password: await
|
|
3043
|
+
password: await y(e.password),
|
|
3036
3044
|
domain: e.domain
|
|
3037
3045
|
}
|
|
3038
3046
|
});
|
|
@@ -3043,12 +3051,12 @@ class Lt {
|
|
|
3043
3051
|
id: e,
|
|
3044
3052
|
data: {
|
|
3045
3053
|
...t,
|
|
3046
|
-
password: t.password ? await
|
|
3047
|
-
transactionPassword: t.transactionPassword ? await
|
|
3054
|
+
password: t.password ? await y(t.password) : void 0,
|
|
3055
|
+
transactionPassword: t.transactionPassword ? await y(t.transactionPassword) : void 0,
|
|
3048
3056
|
...t.mobileNumber && {
|
|
3049
3057
|
mobileNumber: b(t.mobileNumber)
|
|
3050
3058
|
},
|
|
3051
|
-
secretAnswer: t.secretAnswer ? await
|
|
3059
|
+
secretAnswer: t.secretAnswer ? await y(t.secretAnswer) : void 0
|
|
3052
3060
|
}
|
|
3053
3061
|
}
|
|
3054
3062
|
});
|
|
@@ -3068,7 +3076,7 @@ class Lt {
|
|
|
3068
3076
|
} : e;
|
|
3069
3077
|
}
|
|
3070
3078
|
async submitVerificationDetails(e) {
|
|
3071
|
-
const t = e.id ?? k.generate(
|
|
3079
|
+
const t = e.id ?? k.generate(T.Verification).toString(), r = await this.accountService.createMemberVerification({
|
|
3072
3080
|
input: {
|
|
3073
3081
|
id: t,
|
|
3074
3082
|
...e
|
|
@@ -3090,7 +3098,7 @@ class Lt {
|
|
|
3090
3098
|
return await this.accountService.resetPassword({
|
|
3091
3099
|
input: {
|
|
3092
3100
|
mobileNumber: b(e.mobileNumber),
|
|
3093
|
-
newPassword: await
|
|
3101
|
+
newPassword: await y(e.newPassword)
|
|
3094
3102
|
},
|
|
3095
3103
|
verificationCode: e.verificationCode
|
|
3096
3104
|
});
|
|
@@ -3174,13 +3182,13 @@ class Lt {
|
|
|
3174
3182
|
/*+----------------------------------------+*/
|
|
3175
3183
|
/**/
|
|
3176
3184
|
async createWithdrawal(e) {
|
|
3177
|
-
const t = e.id ?? k.generate(
|
|
3185
|
+
const t = e.id ?? k.generate(T.Withdrawal).toString();
|
|
3178
3186
|
if (e.type === "BANK") {
|
|
3179
3187
|
const r = await this.walletService.createBankWithdrawal({
|
|
3180
3188
|
input: {
|
|
3181
3189
|
id: t,
|
|
3182
3190
|
amount: e.amount.toString(),
|
|
3183
|
-
transactionPassword: await
|
|
3191
|
+
transactionPassword: await y(e.transactionPassword)
|
|
3184
3192
|
}
|
|
3185
3193
|
});
|
|
3186
3194
|
if (!r.ok) return r;
|
|
@@ -3190,7 +3198,7 @@ class Lt {
|
|
|
3190
3198
|
input: {
|
|
3191
3199
|
id: t,
|
|
3192
3200
|
amount: e.amount.toString(),
|
|
3193
|
-
transactionPassword: await
|
|
3201
|
+
transactionPassword: await y(e.transactionPassword),
|
|
3194
3202
|
recipientMobileNumber: b(e.recipientMobileNumber)
|
|
3195
3203
|
}
|
|
3196
3204
|
});
|
|
@@ -3201,7 +3209,7 @@ class Lt {
|
|
|
3201
3209
|
input: {
|
|
3202
3210
|
id: t,
|
|
3203
3211
|
amount: e.amount.toString(),
|
|
3204
|
-
transactionPassword: await
|
|
3212
|
+
transactionPassword: await y(e.transactionPassword),
|
|
3205
3213
|
recipientMobileNumber: b(e.recipientMobileNumber)
|
|
3206
3214
|
}
|
|
3207
3215
|
});
|
|
@@ -3212,7 +3220,7 @@ class Lt {
|
|
|
3212
3220
|
input: {
|
|
3213
3221
|
id: t,
|
|
3214
3222
|
amount: e.amount.toString(),
|
|
3215
|
-
transactionPassword: await
|
|
3223
|
+
transactionPassword: await y(e.transactionPassword)
|
|
3216
3224
|
}
|
|
3217
3225
|
});
|
|
3218
3226
|
if (!r.ok) return r;
|
|
@@ -3243,7 +3251,7 @@ class Lt {
|
|
|
3243
3251
|
/*+----------------------------------------+*/
|
|
3244
3252
|
/**/
|
|
3245
3253
|
async createDeposit(e) {
|
|
3246
|
-
const t = e.id ?? k.generate(
|
|
3254
|
+
const t = e.id ?? k.generate(T.Deposit).toString();
|
|
3247
3255
|
if (e.type === "MAYA") {
|
|
3248
3256
|
const r = await this.walletService.createMayaDeposit({
|
|
3249
3257
|
input: {
|
|
@@ -3457,20 +3465,20 @@ class Lt {
|
|
|
3457
3465
|
} : r;
|
|
3458
3466
|
}
|
|
3459
3467
|
async createGameSession(e) {
|
|
3460
|
-
const t = e.id ?? k.generate(
|
|
3468
|
+
const t = e.id ?? k.generate(T.GameSession).toString();
|
|
3461
3469
|
if (e.game.startsWith("SPORTS:")) {
|
|
3462
|
-
const
|
|
3463
|
-
(
|
|
3464
|
-
),
|
|
3470
|
+
const f = await k.generateFromKey(T.Game, e.game).then(
|
|
3471
|
+
(l) => l.toString()
|
|
3472
|
+
), w = await this.gameService.createGameSession({
|
|
3465
3473
|
input: {
|
|
3466
3474
|
id: t,
|
|
3467
|
-
game:
|
|
3475
|
+
game: f
|
|
3468
3476
|
}
|
|
3469
3477
|
});
|
|
3470
|
-
return
|
|
3478
|
+
return w.ok ? { ok: !0, data: { id: t } } : w;
|
|
3471
3479
|
}
|
|
3472
|
-
const
|
|
3473
|
-
if (!
|
|
3480
|
+
const a = await this.game(e.game);
|
|
3481
|
+
if (!a.data)
|
|
3474
3482
|
return {
|
|
3475
3483
|
ok: !1,
|
|
3476
3484
|
error: {
|
|
@@ -3478,12 +3486,17 @@ class Lt {
|
|
|
3478
3486
|
message: "Game does not exist"
|
|
3479
3487
|
}
|
|
3480
3488
|
};
|
|
3481
|
-
const {
|
|
3489
|
+
const { provider: s, reference: c } = a.data, p = [
|
|
3482
3490
|
/**/
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3491
|
+
"RTG",
|
|
3492
|
+
"DARWIN",
|
|
3493
|
+
"DRBINGO",
|
|
3494
|
+
"MEGABALL",
|
|
3495
|
+
"EVOLUTION",
|
|
3496
|
+
"EVOLUTION_NETENT",
|
|
3497
|
+
"EVOLUTION_REDTIGER"
|
|
3498
|
+
].includes(s) ? await this.walletService.createGameSession({ input: { id: t, game: c } }) : await this.gameService.createGameSession({ input: { id: t, game: c } });
|
|
3499
|
+
return p.ok ? { ok: !0, data: { id: t } } : p;
|
|
3487
3500
|
}
|
|
3488
3501
|
async endGameSession(e) {
|
|
3489
3502
|
const t = await this.walletService.endGameSession({ input: { id: e } });
|
|
@@ -3502,7 +3515,7 @@ class Lt {
|
|
|
3502
3515
|
} : t;
|
|
3503
3516
|
}
|
|
3504
3517
|
async uploadImageFile(e) {
|
|
3505
|
-
const t = e.id ?? k.generate(
|
|
3518
|
+
const t = e.id ?? k.generate(T.File).toString(), r = await this.fileService.uploadPrivateImageFile({
|
|
3506
3519
|
input: {
|
|
3507
3520
|
id: t,
|
|
3508
3521
|
file: e.file
|
|
@@ -3616,22 +3629,9 @@ class Lt {
|
|
|
3616
3629
|
} : t;
|
|
3617
3630
|
}
|
|
3618
3631
|
}
|
|
3619
|
-
const Wt = [
|
|
3620
|
-
/**/
|
|
3621
|
-
"RTG",
|
|
3622
|
-
"DARWIN",
|
|
3623
|
-
"DRBINGO",
|
|
3624
|
-
"MEGABALL",
|
|
3625
|
-
"EVOLUTION",
|
|
3626
|
-
"EVOLUTION_NETENT",
|
|
3627
|
-
"EVOLUTION_REDTIGER"
|
|
3628
|
-
];
|
|
3629
|
-
function Bt(o) {
|
|
3630
|
-
return Wt.some((e) => e === o);
|
|
3631
|
-
}
|
|
3632
3632
|
export {
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3633
|
+
Vt as ObjectId,
|
|
3634
|
+
T as ObjectType,
|
|
3635
|
+
qt as Sdk
|
|
3636
3636
|
};
|
|
3637
3637
|
//# sourceMappingURL=index.mjs.map
|