@opexa/portal-sdk 0.0.85 → 0.0.86
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 +78 -86
- package/dist/index.mjs.map +1 -1
- package/dist/sdk/types.d.ts +1 -1
- package/dist/services/types.d.ts +1 -1
- 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 {
|
|
@@ -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");
|
|
@@ -1564,9 +1564,9 @@ class vt {
|
|
|
1564
1564
|
} : e;
|
|
1565
1565
|
}
|
|
1566
1566
|
async games(e) {
|
|
1567
|
-
var a, s, c, u,
|
|
1567
|
+
var a, s, c, u, p, f, y, l, _, v, M, R, N, E, I, D, S, P, $, x, C, U, O, W;
|
|
1568
1568
|
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), (
|
|
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), (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 = (y = e == null ? void 0 : e.filter) == null ? void 0 : y.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
1570
|
"filter[tags][in]",
|
|
1571
1571
|
e.filter.tags.in.map((A) => A.toLowerCase()).join(",")
|
|
1572
1572
|
), (W = (O = e == null ? void 0 : e.filter) == null ? void 0 : O.tags) != null && W.notIn && t.set(
|
|
@@ -1870,7 +1870,7 @@ class Pt {
|
|
|
1870
1870
|
} : t;
|
|
1871
1871
|
}
|
|
1872
1872
|
async createMayaWithdrawal(e) {
|
|
1873
|
-
const t = await this.client.request(
|
|
1873
|
+
const t = await this.client.request(Ue, e);
|
|
1874
1874
|
return t.ok ? t.data.createMayaWithdrawal ? {
|
|
1875
1875
|
ok: !1,
|
|
1876
1876
|
error: d(t.data.createMayaWithdrawal.__typename)
|
|
@@ -1879,7 +1879,7 @@ class Pt {
|
|
|
1879
1879
|
} : t;
|
|
1880
1880
|
}
|
|
1881
1881
|
async createMayaAppWithdrawal(e) {
|
|
1882
|
-
const t = await this.client.request(
|
|
1882
|
+
const t = await this.client.request(Ge, e);
|
|
1883
1883
|
return t.ok ? t.data.createMayaAppWithdrawal ? {
|
|
1884
1884
|
ok: !1,
|
|
1885
1885
|
error: d(t.data.createMayaAppWithdrawal.__typename)
|
|
@@ -1979,7 +1979,7 @@ function xt(o) {
|
|
|
1979
1979
|
function t(r, a = []) {
|
|
1980
1980
|
for (const s in r) {
|
|
1981
1981
|
const c = r[s];
|
|
1982
|
-
H(c) ? t(c, [...a, s]) : Array.isArray(c) ? t(
|
|
1982
|
+
H(c) ? t(c, [...a, s]) : Array.isArray(c) ? t(Ut(c), [...a, s]) : e.push({
|
|
1983
1983
|
key: [...a, s],
|
|
1984
1984
|
value: c
|
|
1985
1985
|
});
|
|
@@ -1987,10 +1987,10 @@ function xt(o) {
|
|
|
1987
1987
|
}
|
|
1988
1988
|
return t(o), e;
|
|
1989
1989
|
}
|
|
1990
|
-
function
|
|
1990
|
+
function Ut(o) {
|
|
1991
1991
|
return o.reduce((e, t, r) => (e[r] = t, e), {});
|
|
1992
1992
|
}
|
|
1993
|
-
class
|
|
1993
|
+
class G {
|
|
1994
1994
|
constructor(e, t) {
|
|
1995
1995
|
m(this, "url");
|
|
1996
1996
|
m(this, "options");
|
|
@@ -2029,13 +2029,13 @@ class U {
|
|
|
2029
2029
|
async exec(e) {
|
|
2030
2030
|
var t, r, a, s, c, u;
|
|
2031
2031
|
try {
|
|
2032
|
-
const
|
|
2033
|
-
if (!
|
|
2034
|
-
return { ok: !1, error: h(
|
|
2035
|
-
const
|
|
2036
|
-
return
|
|
2032
|
+
const p = await fetch(e);
|
|
2033
|
+
if (!p.ok)
|
|
2034
|
+
return { ok: !1, error: h(p.status) };
|
|
2035
|
+
const f = await p.json(), y = f.data, l = (t = f.errors) == null ? void 0 : t.at(0);
|
|
2036
|
+
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
2037
|
ok: !1,
|
|
2038
|
-
error: h(500,
|
|
2038
|
+
error: h(500, l.message)
|
|
2039
2039
|
} : {
|
|
2040
2040
|
ok: !0,
|
|
2041
2041
|
data: y
|
|
@@ -2121,8 +2121,8 @@ function ge(o, e) {
|
|
|
2121
2121
|
/**/
|
|
2122
2122
|
} = e;
|
|
2123
2123
|
async function s(c, u) {
|
|
2124
|
-
const
|
|
2125
|
-
return t(
|
|
2124
|
+
const p = u ?? a, f = await o(...c);
|
|
2125
|
+
return t(f) ? f : p > 1 ? (await ke(r * ((a - p) / 2)), s(c, p - 1)) : f;
|
|
2126
2126
|
}
|
|
2127
2127
|
return async (...c) => await s(c);
|
|
2128
2128
|
}
|
|
@@ -2130,7 +2130,7 @@ function F(o, e) {
|
|
|
2130
2130
|
const t = Q(o);
|
|
2131
2131
|
return t.setMinutes(t.getMinutes() - e), t;
|
|
2132
2132
|
}
|
|
2133
|
-
class
|
|
2133
|
+
class Gt {
|
|
2134
2134
|
constructor(e) {
|
|
2135
2135
|
m(this, "logger");
|
|
2136
2136
|
m(this, "storageKey", "session");
|
|
@@ -2160,8 +2160,8 @@ class Ut {
|
|
|
2160
2160
|
if (e.type === "MAYA") {
|
|
2161
2161
|
const c = await ge(() => this.walletService.mayaSession({ id: e.sessionId }), {
|
|
2162
2162
|
until: (y) => {
|
|
2163
|
-
var
|
|
2164
|
-
return y.ok && ((
|
|
2163
|
+
var l;
|
|
2164
|
+
return y.ok && ((l = y.data) == null ? void 0 : l.member) != null;
|
|
2165
2165
|
},
|
|
2166
2166
|
interval: 1e3,
|
|
2167
2167
|
maxAttempt: 5
|
|
@@ -2175,19 +2175,19 @@ class Ut {
|
|
|
2175
2175
|
message: "Forbidden"
|
|
2176
2176
|
}
|
|
2177
2177
|
};
|
|
2178
|
-
const
|
|
2178
|
+
const p = await ge(() => this.authService.createSession(e), {
|
|
2179
2179
|
until: (y) => y.ok,
|
|
2180
2180
|
interval: 1e3,
|
|
2181
2181
|
maxAttempt: 5
|
|
2182
2182
|
})();
|
|
2183
|
-
if (!
|
|
2184
|
-
const
|
|
2183
|
+
if (!p.ok) return p;
|
|
2184
|
+
const f = /* @__PURE__ */ new Date();
|
|
2185
2185
|
return window.localStorage.setItem(
|
|
2186
2186
|
this.storageKey,
|
|
2187
2187
|
JSON.stringify({
|
|
2188
|
-
...
|
|
2189
|
-
accessTokenExpiresAt: q(
|
|
2190
|
-
refreshTokenExpiresAt: F(B(
|
|
2188
|
+
...p.data,
|
|
2189
|
+
accessTokenExpiresAt: q(f, 8).getTime(),
|
|
2190
|
+
refreshTokenExpiresAt: F(B(f, 30), 2).getTime()
|
|
2191
2191
|
})
|
|
2192
2192
|
), {
|
|
2193
2193
|
ok: !0,
|
|
@@ -2404,7 +2404,7 @@ class Ot {
|
|
|
2404
2404
|
return g(t);
|
|
2405
2405
|
}
|
|
2406
2406
|
platform(e) {
|
|
2407
|
-
var t, r, a, s, c, u,
|
|
2407
|
+
var t, r, a, s, c, u, p, f, y, 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, ye;
|
|
2408
2408
|
return {
|
|
2409
2409
|
timezone: e.timezone,
|
|
2410
2410
|
currency: e.currency,
|
|
@@ -2421,11 +2421,11 @@ class Ot {
|
|
|
2421
2421
|
maximumAmount: n((u = e.bankDepositGatewaySettings) == null ? void 0 : u.maximumAmount)
|
|
2422
2422
|
},
|
|
2423
2423
|
gcash: {
|
|
2424
|
-
androidEnabled: ((
|
|
2425
|
-
iosEnabled: ((
|
|
2424
|
+
androidEnabled: ((p = e.gcashDepositGatewaySettings) == null ? void 0 : p.androidEnabled) ?? !1,
|
|
2425
|
+
iosEnabled: ((f = e.gcashDepositGatewaySettings) == null ? void 0 : f.iosEnabled) ?? !1,
|
|
2426
2426
|
webEnabled: ((y = e.gcashDepositGatewaySettings) == null ? void 0 : y.webEnabled) ?? !1,
|
|
2427
|
-
mobileWebEnabled: ((
|
|
2428
|
-
minimumAmount: n((
|
|
2427
|
+
mobileWebEnabled: ((l = e.gcashDepositGatewaySettings) == null ? void 0 : l.mobileWebEnabled) ?? !1,
|
|
2428
|
+
minimumAmount: n((_ = e.gcashDepositGatewaySettings) == null ? void 0 : _.minimumAmount),
|
|
2429
2429
|
maximumAmount: n((v = e.gcashDepositGatewaySettings) == null ? void 0 : v.maximumAmount)
|
|
2430
2430
|
},
|
|
2431
2431
|
maya: {
|
|
@@ -2442,7 +2442,7 @@ class Ot {
|
|
|
2442
2442
|
webEnabled: (($ = e.mayaAppDepositGatewaySettings) == null ? void 0 : $.webEnabled) ?? !1,
|
|
2443
2443
|
mobileWebEnabled: ((x = e.mayaAppDepositGatewaySettings) == null ? void 0 : x.mobileWebEnabled) ?? !1,
|
|
2444
2444
|
minimumAmount: n((C = e.mayaAppDepositGatewaySettings) == null ? void 0 : C.minimumAmount),
|
|
2445
|
-
maximumAmount: n((
|
|
2445
|
+
maximumAmount: n((U = e.mayaAppDepositGatewaySettings) == null ? void 0 : U.maximumAmount)
|
|
2446
2446
|
}
|
|
2447
2447
|
},
|
|
2448
2448
|
withdrawalGateway: {
|
|
@@ -2477,8 +2477,8 @@ class Ot {
|
|
|
2477
2477
|
androidEnabled: ((de = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : de.androidEnabled) ?? !1,
|
|
2478
2478
|
iosEnabled: ((ue = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : ue.iosEnabled) ?? !1,
|
|
2479
2479
|
webEnabled: ((le = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : le.webEnabled) ?? !1,
|
|
2480
|
-
mobileWebEnabled: ((
|
|
2481
|
-
minimumAmount: n((
|
|
2480
|
+
mobileWebEnabled: ((pe = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : pe.mobileWebEnabled) ?? !1,
|
|
2481
|
+
minimumAmount: n((fe = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : fe.minimumAmount),
|
|
2482
2482
|
maximumAmount: n(
|
|
2483
2483
|
(he = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : he.maximumAmount,
|
|
2484
2484
|
1e6
|
|
@@ -2822,7 +2822,7 @@ class Ot {
|
|
|
2822
2822
|
};
|
|
2823
2823
|
}
|
|
2824
2824
|
}
|
|
2825
|
-
class
|
|
2825
|
+
class qt {
|
|
2826
2826
|
constructor(e) {
|
|
2827
2827
|
m(this, "cmsPortalService");
|
|
2828
2828
|
m(this, "authService");
|
|
@@ -2848,7 +2848,7 @@ class Lt {
|
|
|
2848
2848
|
}), this.logger = new Ce({
|
|
2849
2849
|
enabled: c ?? !1
|
|
2850
2850
|
});
|
|
2851
|
-
const
|
|
2851
|
+
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", y = 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
2852
|
url: R,
|
|
2853
2853
|
site: t,
|
|
2854
2854
|
platform: r
|
|
@@ -2860,15 +2860,15 @@ class Lt {
|
|
|
2860
2860
|
"Platform-Code": a
|
|
2861
2861
|
}
|
|
2862
2862
|
}
|
|
2863
|
-
}, I = new Rt(new
|
|
2864
|
-
url:
|
|
2863
|
+
}, 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(y, E)), x = new Nt(new G(_, E)), C = new _t({
|
|
2864
|
+
url: p,
|
|
2865
2865
|
platform: a
|
|
2866
|
-
}),
|
|
2866
|
+
}), U = new Gt({
|
|
2867
2867
|
logs: c,
|
|
2868
2868
|
authService: C,
|
|
2869
2869
|
walletService: S
|
|
2870
2870
|
});
|
|
2871
|
-
this.authService = C, this.gameService = I, this.fileService = D, this.walletService = S, this.accountService = P, this.reportService = $, this.portalService = x, this.sessionManager =
|
|
2871
|
+
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
2872
|
}
|
|
2873
2873
|
get authMiddleware() {
|
|
2874
2874
|
return async (e) => {
|
|
@@ -2987,7 +2987,7 @@ class Lt {
|
|
|
2987
2987
|
* @deprecated use `createAccount__next`
|
|
2988
2988
|
*/
|
|
2989
2989
|
async createAccount(e) {
|
|
2990
|
-
const t = e.id ?? k.generate(
|
|
2990
|
+
const t = e.id ?? k.generate(T.Account).toString(), r = await this.accountService.registerMemberAccount({
|
|
2991
2991
|
input: {
|
|
2992
2992
|
id: t,
|
|
2993
2993
|
btag: e.btag,
|
|
@@ -3004,7 +3004,7 @@ class Lt {
|
|
|
3004
3004
|
return r.ok ? { ok: !0, data: { id: t } } : r;
|
|
3005
3005
|
}
|
|
3006
3006
|
async createAccount__next(e) {
|
|
3007
|
-
const t = e.id ?? k.generate(
|
|
3007
|
+
const t = e.id ?? k.generate(T.Account).toString();
|
|
3008
3008
|
if (e.type === "MOBILE_NUMBER") {
|
|
3009
3009
|
const a = await this.accountService.registerMemberAccountViaMobile({
|
|
3010
3010
|
input: {
|
|
@@ -3068,7 +3068,7 @@ class Lt {
|
|
|
3068
3068
|
} : e;
|
|
3069
3069
|
}
|
|
3070
3070
|
async submitVerificationDetails(e) {
|
|
3071
|
-
const t = e.id ?? k.generate(
|
|
3071
|
+
const t = e.id ?? k.generate(T.Verification).toString(), r = await this.accountService.createMemberVerification({
|
|
3072
3072
|
input: {
|
|
3073
3073
|
id: t,
|
|
3074
3074
|
...e
|
|
@@ -3174,7 +3174,7 @@ class Lt {
|
|
|
3174
3174
|
/*+----------------------------------------+*/
|
|
3175
3175
|
/**/
|
|
3176
3176
|
async createWithdrawal(e) {
|
|
3177
|
-
const t = e.id ?? k.generate(
|
|
3177
|
+
const t = e.id ?? k.generate(T.Withdrawal).toString();
|
|
3178
3178
|
if (e.type === "BANK") {
|
|
3179
3179
|
const r = await this.walletService.createBankWithdrawal({
|
|
3180
3180
|
input: {
|
|
@@ -3243,7 +3243,7 @@ class Lt {
|
|
|
3243
3243
|
/*+----------------------------------------+*/
|
|
3244
3244
|
/**/
|
|
3245
3245
|
async createDeposit(e) {
|
|
3246
|
-
const t = e.id ?? k.generate(
|
|
3246
|
+
const t = e.id ?? k.generate(T.Deposit).toString();
|
|
3247
3247
|
if (e.type === "MAYA") {
|
|
3248
3248
|
const r = await this.walletService.createMayaDeposit({
|
|
3249
3249
|
input: {
|
|
@@ -3457,20 +3457,20 @@ class Lt {
|
|
|
3457
3457
|
} : r;
|
|
3458
3458
|
}
|
|
3459
3459
|
async createGameSession(e) {
|
|
3460
|
-
const t = e.id ?? k.generate(
|
|
3460
|
+
const t = e.id ?? k.generate(T.GameSession).toString();
|
|
3461
3461
|
if (e.game.startsWith("SPORTS:")) {
|
|
3462
|
-
const
|
|
3463
|
-
(
|
|
3464
|
-
),
|
|
3462
|
+
const f = await k.generateFromKey(T.Game, e.game).then(
|
|
3463
|
+
(l) => l.toString()
|
|
3464
|
+
), y = await this.gameService.createGameSession({
|
|
3465
3465
|
input: {
|
|
3466
3466
|
id: t,
|
|
3467
|
-
game:
|
|
3467
|
+
game: f
|
|
3468
3468
|
}
|
|
3469
3469
|
});
|
|
3470
|
-
return
|
|
3470
|
+
return y.ok ? { ok: !0, data: { id: t } } : y;
|
|
3471
3471
|
}
|
|
3472
|
-
const
|
|
3473
|
-
if (!
|
|
3472
|
+
const a = await this.game(e.game);
|
|
3473
|
+
if (!a.data)
|
|
3474
3474
|
return {
|
|
3475
3475
|
ok: !1,
|
|
3476
3476
|
error: {
|
|
@@ -3478,12 +3478,17 @@ class Lt {
|
|
|
3478
3478
|
message: "Game does not exist"
|
|
3479
3479
|
}
|
|
3480
3480
|
};
|
|
3481
|
-
const {
|
|
3481
|
+
const { provider: s, reference: c } = a.data, p = [
|
|
3482
3482
|
/**/
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3483
|
+
"RTG",
|
|
3484
|
+
"DARWIN",
|
|
3485
|
+
"DRBINGO",
|
|
3486
|
+
"MEGABALL",
|
|
3487
|
+
"EVOLUTION",
|
|
3488
|
+
"EVOLUTION_NETENT",
|
|
3489
|
+
"EVOLUTION_REDTIGER"
|
|
3490
|
+
].includes(s) ? await this.walletService.createGameSession({ input: { id: t, game: c } }) : await this.gameService.createGameSession({ input: { id: t, game: c } });
|
|
3491
|
+
return p.ok ? { ok: !0, data: { id: t } } : p;
|
|
3487
3492
|
}
|
|
3488
3493
|
async endGameSession(e) {
|
|
3489
3494
|
const t = await this.walletService.endGameSession({ input: { id: e } });
|
|
@@ -3502,7 +3507,7 @@ class Lt {
|
|
|
3502
3507
|
} : t;
|
|
3503
3508
|
}
|
|
3504
3509
|
async uploadImageFile(e) {
|
|
3505
|
-
const t = e.id ?? k.generate(
|
|
3510
|
+
const t = e.id ?? k.generate(T.File).toString(), r = await this.fileService.uploadPrivateImageFile({
|
|
3506
3511
|
input: {
|
|
3507
3512
|
id: t,
|
|
3508
3513
|
file: e.file
|
|
@@ -3616,22 +3621,9 @@ class Lt {
|
|
|
3616
3621
|
} : t;
|
|
3617
3622
|
}
|
|
3618
3623
|
}
|
|
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
3624
|
export {
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3625
|
+
Vt as ObjectId,
|
|
3626
|
+
T as ObjectType,
|
|
3627
|
+
qt as Sdk
|
|
3636
3628
|
};
|
|
3637
3629
|
//# sourceMappingURL=index.mjs.map
|