@opexa/portal-sdk 0.0.70 → 0.0.71
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/README.md +1622 -1622
- package/dist/index.js +12 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +224 -198
- package/dist/index.mjs.map +1 -1
- package/dist/sdk/sdk.d.ts +8 -2
- package/dist/sdk/types.d.ts +2 -1
- package/dist/services/account.service.d.ts +2 -2
- package/dist/services/auth.service.d.ts +5 -0
- package/dist/services/queries.d.ts +1 -1
- package/dist/services/types.d.ts +1 -9
- package/package.json +81 -81
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var Te = (n, e, t) => e in n ?
|
|
3
|
-
var
|
|
4
|
-
import { ObjectId as
|
|
1
|
+
var Ce = Object.defineProperty;
|
|
2
|
+
var Te = (n, e, t) => e in n ? Ce(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var d = (n, e, t) => Te(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { ObjectId as b } from "@opexa/object-id";
|
|
5
5
|
import { ObjectId as Vt } from "@opexa/object-id";
|
|
6
|
-
const
|
|
6
|
+
const A = {
|
|
7
7
|
Account: 8,
|
|
8
8
|
Deposit: 9,
|
|
9
9
|
Withdrawal: 14,
|
|
@@ -139,7 +139,7 @@ const L = o`
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
`,
|
|
142
|
+
`, be = o`
|
|
143
143
|
query GameSession($id: ObjectId!) {
|
|
144
144
|
node(id: $id) {
|
|
145
145
|
... on GameSession {
|
|
@@ -151,7 +151,7 @@ const L = o`
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
`,
|
|
154
|
+
`, Ae = o`
|
|
155
155
|
mutation CreateGameSession($input: CreateGameSessionInput!) {
|
|
156
156
|
createGameSession(input: $input) {
|
|
157
157
|
... on GameDoesNotExistError {
|
|
@@ -639,7 +639,7 @@ const L = o`
|
|
|
639
639
|
...PromoFragment
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
|
-
`,
|
|
642
|
+
`, Ee = o`
|
|
643
643
|
${L}
|
|
644
644
|
|
|
645
645
|
fragment CashbackFragment on Cashback {
|
|
@@ -657,7 +657,7 @@ const L = o`
|
|
|
657
657
|
dateTimeLastUpdated
|
|
658
658
|
}
|
|
659
659
|
`, Ze = o`
|
|
660
|
-
${
|
|
660
|
+
${Ee}
|
|
661
661
|
|
|
662
662
|
query Cashbacks {
|
|
663
663
|
cashbacks {
|
|
@@ -694,7 +694,7 @@ const L = o`
|
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
696
|
`, tt = o`
|
|
697
|
-
${
|
|
697
|
+
${Ee}
|
|
698
698
|
|
|
699
699
|
query CashbackBonuses {
|
|
700
700
|
cashbackBonuses {
|
|
@@ -807,11 +807,14 @@ const L = o`
|
|
|
807
807
|
}
|
|
808
808
|
}
|
|
809
809
|
`, st = o`
|
|
810
|
-
mutation
|
|
810
|
+
mutation RegisterMemberAccount(
|
|
811
811
|
$input: RegisterMemberAccountInput_next!
|
|
812
812
|
$reCAPTCHAResponse: String
|
|
813
813
|
) {
|
|
814
|
-
registerMemberAccount_next(
|
|
814
|
+
registerMemberAccount: registerMemberAccount_next(
|
|
815
|
+
input: $input
|
|
816
|
+
reCAPTCHAResponse: $reCAPTCHAResponse
|
|
817
|
+
) {
|
|
815
818
|
... on AccountNameNotAvailableError {
|
|
816
819
|
__typename
|
|
817
820
|
}
|
|
@@ -843,7 +846,7 @@ const L = o`
|
|
|
843
846
|
}
|
|
844
847
|
}
|
|
845
848
|
}
|
|
846
|
-
`,
|
|
849
|
+
`, dt = o`
|
|
847
850
|
mutation UpdateMemberAccount($input: UpdateMemberAccountInput!) {
|
|
848
851
|
updateMemberAccount(input: $input) {
|
|
849
852
|
... on AccountNameNotAvailableError {
|
|
@@ -869,7 +872,7 @@ const L = o`
|
|
|
869
872
|
}
|
|
870
873
|
}
|
|
871
874
|
}
|
|
872
|
-
`,
|
|
875
|
+
`, mt = o`
|
|
873
876
|
mutation ResetPassword($input: ResetPasswordInput!, $verificationCode: String) {
|
|
874
877
|
resetPassword(input: $input, verificationCode: $verificationCode) {
|
|
875
878
|
... on AccountNotFoundError {
|
|
@@ -1014,7 +1017,7 @@ const L = o`
|
|
|
1014
1017
|
mutation ValidateMayaSession {
|
|
1015
1018
|
validateMayaSession: validMayaSession
|
|
1016
1019
|
}
|
|
1017
|
-
`,
|
|
1020
|
+
`, bt = o`
|
|
1018
1021
|
query ActivityRecords($after: Cursor, $first: Int, $filter: ActivityRecordsFilterInput) {
|
|
1019
1022
|
member {
|
|
1020
1023
|
activityRecords(after: $after, first: $first, filter: $filter) {
|
|
@@ -1039,11 +1042,11 @@ const L = o`
|
|
|
1039
1042
|
}
|
|
1040
1043
|
}
|
|
1041
1044
|
}
|
|
1042
|
-
`,
|
|
1045
|
+
`, At = o`
|
|
1043
1046
|
query ReferralCode {
|
|
1044
1047
|
referralCode
|
|
1045
1048
|
}
|
|
1046
|
-
`,
|
|
1049
|
+
`, Et = o`
|
|
1047
1050
|
mutation UpdateReferralCode($input: UpdateReferralCodeInput!) {
|
|
1048
1051
|
updateReferralCode(input: $input) {
|
|
1049
1052
|
... on ReferralCodeNotAvailableError {
|
|
@@ -1052,7 +1055,7 @@ const L = o`
|
|
|
1052
1055
|
}
|
|
1053
1056
|
}
|
|
1054
1057
|
`;
|
|
1055
|
-
function
|
|
1058
|
+
function m(n) {
|
|
1056
1059
|
return {
|
|
1057
1060
|
name: n,
|
|
1058
1061
|
message: {
|
|
@@ -1109,7 +1112,7 @@ function d(n) {
|
|
|
1109
1112
|
}
|
|
1110
1113
|
class kt {
|
|
1111
1114
|
constructor(e) {
|
|
1112
|
-
|
|
1115
|
+
d(this, "client");
|
|
1113
1116
|
this.client = e;
|
|
1114
1117
|
}
|
|
1115
1118
|
/** aka `Query.self` */
|
|
@@ -1124,25 +1127,25 @@ class kt {
|
|
|
1124
1127
|
const t = await this.client.request(it, e);
|
|
1125
1128
|
return t.ok ? t.data.registerMemberAccount ? {
|
|
1126
1129
|
ok: !1,
|
|
1127
|
-
error:
|
|
1130
|
+
error: m(t.data.registerMemberAccount.__typename)
|
|
1128
1131
|
} : {
|
|
1129
1132
|
ok: !0
|
|
1130
1133
|
} : t;
|
|
1131
1134
|
}
|
|
1132
|
-
async
|
|
1135
|
+
async registerMemberAccount__next(e) {
|
|
1133
1136
|
const t = await this.client.request(st, e);
|
|
1134
|
-
return t.ok ? t.data.
|
|
1137
|
+
return t.ok ? t.data.registerMemberAccount ? {
|
|
1135
1138
|
ok: !1,
|
|
1136
|
-
error:
|
|
1139
|
+
error: m(t.data.registerMemberAccount.__typename)
|
|
1137
1140
|
} : {
|
|
1138
1141
|
ok: !0
|
|
1139
1142
|
} : t;
|
|
1140
1143
|
}
|
|
1141
1144
|
async updateMemberAccount(e) {
|
|
1142
|
-
const t = await this.client.request(
|
|
1145
|
+
const t = await this.client.request(dt, e);
|
|
1143
1146
|
return t.ok ? t.data.updateMemberAccount ? {
|
|
1144
1147
|
ok: !1,
|
|
1145
|
-
error:
|
|
1148
|
+
error: m(t.data.updateMemberAccount.__typename)
|
|
1146
1149
|
} : {
|
|
1147
1150
|
ok: !0
|
|
1148
1151
|
} : t;
|
|
@@ -1161,12 +1164,12 @@ class kt {
|
|
|
1161
1164
|
}
|
|
1162
1165
|
async resetPassword(e) {
|
|
1163
1166
|
const t = await this.client.request(
|
|
1164
|
-
|
|
1167
|
+
mt,
|
|
1165
1168
|
e
|
|
1166
1169
|
);
|
|
1167
1170
|
return t.ok ? t.data.resetPassword ? {
|
|
1168
1171
|
ok: !1,
|
|
1169
|
-
error:
|
|
1172
|
+
error: m(t.data.resetPassword.__typename)
|
|
1170
1173
|
} : {
|
|
1171
1174
|
ok: !0
|
|
1172
1175
|
} : t;
|
|
@@ -1182,7 +1185,7 @@ class kt {
|
|
|
1182
1185
|
const t = await this.client.request(yt, e);
|
|
1183
1186
|
return t.ok ? t.data.sendVerificationCode ? {
|
|
1184
1187
|
ok: !1,
|
|
1185
|
-
error:
|
|
1188
|
+
error: m(t.data.sendVerificationCode.__typename)
|
|
1186
1189
|
} : {
|
|
1187
1190
|
ok: !0
|
|
1188
1191
|
} : t;
|
|
@@ -1191,7 +1194,7 @@ class kt {
|
|
|
1191
1194
|
const t = await this.client.request(lt, e);
|
|
1192
1195
|
return t.ok ? t.data.verifyMobileNumber ? {
|
|
1193
1196
|
ok: !1,
|
|
1194
|
-
error:
|
|
1197
|
+
error: m(t.data.verifyMobileNumber.__typename)
|
|
1195
1198
|
} : {
|
|
1196
1199
|
ok: !0
|
|
1197
1200
|
} : t;
|
|
@@ -1200,7 +1203,7 @@ class kt {
|
|
|
1200
1203
|
const t = await this.client.request(pt, e);
|
|
1201
1204
|
return t.ok ? t.data.createMemberVerification ? {
|
|
1202
1205
|
ok: !1,
|
|
1203
|
-
error:
|
|
1206
|
+
error: m(t.data.createMemberVerification.__typename)
|
|
1204
1207
|
} : {
|
|
1205
1208
|
ok: !0
|
|
1206
1209
|
} : t;
|
|
@@ -1209,7 +1212,7 @@ class kt {
|
|
|
1209
1212
|
const t = await this.client.request(ft, e);
|
|
1210
1213
|
return t.ok ? t.data.updateMemberVerification ? {
|
|
1211
1214
|
ok: !1,
|
|
1212
|
-
error:
|
|
1215
|
+
error: m(t.data.updateMemberVerification.__typename)
|
|
1213
1216
|
} : {
|
|
1214
1217
|
ok: !0
|
|
1215
1218
|
} : t;
|
|
@@ -1235,32 +1238,32 @@ class kt {
|
|
|
1235
1238
|
const t = await this.client.request(ct, e);
|
|
1236
1239
|
return t.ok ? t.data.registerMayaMemberAccount ? {
|
|
1237
1240
|
ok: !1,
|
|
1238
|
-
error:
|
|
1241
|
+
error: m(t.data.registerMayaMemberAccount.__typename)
|
|
1239
1242
|
} : {
|
|
1240
1243
|
ok: !0
|
|
1241
1244
|
} : t;
|
|
1242
1245
|
}
|
|
1243
1246
|
async referralCode() {
|
|
1244
|
-
const e = await this.client.request(
|
|
1247
|
+
const e = await this.client.request(At);
|
|
1245
1248
|
return e.ok ? {
|
|
1246
1249
|
ok: !0,
|
|
1247
1250
|
data: e.data.referralCode
|
|
1248
1251
|
} : e;
|
|
1249
1252
|
}
|
|
1250
1253
|
async updateReferralCode(e) {
|
|
1251
|
-
const t = await this.client.request(
|
|
1254
|
+
const t = await this.client.request(Et, e);
|
|
1252
1255
|
return t.ok ? t.data.updateReferralCode ? {
|
|
1253
1256
|
ok: !1,
|
|
1254
|
-
error:
|
|
1257
|
+
error: m(t.data.updateReferralCode.__typename)
|
|
1255
1258
|
} : {
|
|
1256
1259
|
ok: !0
|
|
1257
1260
|
} : t;
|
|
1258
1261
|
}
|
|
1259
1262
|
}
|
|
1260
|
-
function
|
|
1263
|
+
function E(n) {
|
|
1261
1264
|
return n.startsWith("+63") ? n : n.startsWith("63") ? `+${n}` : n.startsWith("0") ? `+63${n.substring(1)}` : `+63${n}`;
|
|
1262
1265
|
}
|
|
1263
|
-
function
|
|
1266
|
+
function f(n, e) {
|
|
1264
1267
|
const t = V[n] ? V[n] : V[500];
|
|
1265
1268
|
return {
|
|
1266
1269
|
name: t.name,
|
|
@@ -1276,24 +1279,24 @@ const V = {
|
|
|
1276
1279
|
429: { name: "HttpTooManyRequests", message: "Too Many Requests" },
|
|
1277
1280
|
500: { name: "HttpInternalServerError", message: "Internal Server Error" }
|
|
1278
1281
|
};
|
|
1279
|
-
class
|
|
1282
|
+
class _t {
|
|
1280
1283
|
constructor(e) {
|
|
1281
|
-
|
|
1282
|
-
|
|
1284
|
+
d(this, "url");
|
|
1285
|
+
d(this, "platform");
|
|
1283
1286
|
this.url = e.url, this.platform = e.platform;
|
|
1284
1287
|
}
|
|
1288
|
+
get headers() {
|
|
1289
|
+
const e = new Headers();
|
|
1290
|
+
return e.append("Accept", "application/json, text/plain"), e.append("Content-Type", "application/json"), e.append("Platform-Code", this.platform), e.append("Role", "MEMBER"), e;
|
|
1291
|
+
}
|
|
1285
1292
|
async createSession(e) {
|
|
1286
|
-
const t = new Headers(
|
|
1287
|
-
"Content-Type": "application/json",
|
|
1288
|
-
"Platform-Code": this.platform,
|
|
1289
|
-
Role: "MEMBER"
|
|
1290
|
-
});
|
|
1293
|
+
const t = new Headers(this.headers);
|
|
1291
1294
|
if (e.name) {
|
|
1292
1295
|
const r = `${e.name}:${e.password}`, a = Buffer.from(r).toString("base64");
|
|
1293
1296
|
t.set("Authorization", `Basic ${a}`);
|
|
1294
1297
|
}
|
|
1295
1298
|
if (e.mobileNumber) {
|
|
1296
|
-
const a = `${
|
|
1299
|
+
const a = `${E(e.mobileNumber)}:${e.authenticationCode}`, s = Buffer.from(a).toString("base64");
|
|
1297
1300
|
console.log(`MobileNumberOTP ${s}`), t.set("Authorization", `MobileNumberOTP ${s}`);
|
|
1298
1301
|
}
|
|
1299
1302
|
e.sessionId && t.set("Authorization", `MayaSession ${e.sessionId}`);
|
|
@@ -1307,24 +1310,20 @@ class Ct {
|
|
|
1307
1310
|
data: a
|
|
1308
1311
|
} : a.code === "ACCOUNT_BLACKLISTED" ? {
|
|
1309
1312
|
ok: !1,
|
|
1310
|
-
error:
|
|
1313
|
+
error: m("AccountBlacklisted")
|
|
1311
1314
|
} : {
|
|
1312
1315
|
ok: !1,
|
|
1313
|
-
error:
|
|
1316
|
+
error: f(r.status)
|
|
1314
1317
|
};
|
|
1315
1318
|
} catch {
|
|
1316
1319
|
return {
|
|
1317
1320
|
ok: !1,
|
|
1318
|
-
error:
|
|
1321
|
+
error: f(500)
|
|
1319
1322
|
};
|
|
1320
1323
|
}
|
|
1321
1324
|
}
|
|
1322
1325
|
async authenticate(e) {
|
|
1323
|
-
const t = new Headers(
|
|
1324
|
-
"Content-Type": "application/json",
|
|
1325
|
-
"Platform-Code": this.platform,
|
|
1326
|
-
Role: "MEMBER"
|
|
1327
|
-
});
|
|
1326
|
+
const t = new Headers(this.headers);
|
|
1328
1327
|
if (e.type === "SECURITY_QUESTION") {
|
|
1329
1328
|
t.set("Authorization", `Bearer ${e.token}`);
|
|
1330
1329
|
try {
|
|
@@ -1340,114 +1339,133 @@ class Ct {
|
|
|
1340
1339
|
data: a
|
|
1341
1340
|
} : r.status === 401 || r.status === 403 ? {
|
|
1342
1341
|
ok: !1,
|
|
1343
|
-
error:
|
|
1342
|
+
error: m("InvalidTokenOrSecretAnswer")
|
|
1344
1343
|
} : {
|
|
1345
1344
|
ok: !1,
|
|
1346
|
-
error:
|
|
1345
|
+
error: f(r.status)
|
|
1347
1346
|
};
|
|
1348
1347
|
} catch {
|
|
1349
1348
|
return {
|
|
1350
1349
|
ok: !1,
|
|
1351
|
-
error:
|
|
1350
|
+
error: f(500)
|
|
1352
1351
|
};
|
|
1353
1352
|
}
|
|
1354
1353
|
}
|
|
1355
1354
|
throw new Error("Invalid input 'type'");
|
|
1356
1355
|
}
|
|
1357
1356
|
async refreshSession(e) {
|
|
1357
|
+
const t = new Headers(this.headers);
|
|
1358
|
+
t.append("Authorization", `Bearer ${e}`);
|
|
1358
1359
|
try {
|
|
1359
|
-
const
|
|
1360
|
+
const r = await fetch(`${this.url}/session:refresh`, {
|
|
1360
1361
|
method: "POST",
|
|
1361
|
-
headers:
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
Role: "MEMBER",
|
|
1365
|
-
Authorization: `Bearer ${e}`
|
|
1366
|
-
}
|
|
1367
|
-
}), r = await t.json();
|
|
1368
|
-
return t.ok ? {
|
|
1362
|
+
headers: t
|
|
1363
|
+
}), a = await r.json();
|
|
1364
|
+
return r.ok ? {
|
|
1369
1365
|
ok: !0,
|
|
1370
|
-
data:
|
|
1371
|
-
} :
|
|
1366
|
+
data: a
|
|
1367
|
+
} : a.code === "ACCOUNT_BLACKLISTED" ? {
|
|
1372
1368
|
ok: !1,
|
|
1373
|
-
error:
|
|
1374
|
-
} :
|
|
1369
|
+
error: m("AccountBlacklisted")
|
|
1370
|
+
} : r.status === 403 || r.status === 401 ? {
|
|
1375
1371
|
ok: !1,
|
|
1376
|
-
error:
|
|
1372
|
+
error: m("InvalidToken")
|
|
1377
1373
|
} : {
|
|
1378
1374
|
ok: !1,
|
|
1379
|
-
error:
|
|
1375
|
+
error: f(r.status)
|
|
1380
1376
|
};
|
|
1381
1377
|
} catch {
|
|
1382
1378
|
return {
|
|
1383
1379
|
ok: !1,
|
|
1384
|
-
error:
|
|
1380
|
+
error: f(500)
|
|
1385
1381
|
};
|
|
1386
1382
|
}
|
|
1387
1383
|
}
|
|
1388
1384
|
async destroySession(e) {
|
|
1385
|
+
const t = new Headers(this.headers);
|
|
1386
|
+
t.append("Authorization", `Bearer ${e}`);
|
|
1389
1387
|
try {
|
|
1390
|
-
const
|
|
1388
|
+
const r = await fetch(`${this.url}/session`, {
|
|
1391
1389
|
method: "DELETE",
|
|
1392
|
-
headers:
|
|
1393
|
-
"Content-Type": "application/json",
|
|
1394
|
-
"Platform-Code": this.platform,
|
|
1395
|
-
Role: "MEMBER",
|
|
1396
|
-
Authorization: `Bearer ${e}`
|
|
1397
|
-
}
|
|
1390
|
+
headers: t
|
|
1398
1391
|
});
|
|
1399
|
-
return
|
|
1392
|
+
return r.ok ? { ok: !0 } : { ok: !1, error: f(r.status) };
|
|
1400
1393
|
} catch {
|
|
1401
|
-
return { ok: !1, error:
|
|
1394
|
+
return { ok: !1, error: f(500) };
|
|
1402
1395
|
}
|
|
1403
1396
|
}
|
|
1404
1397
|
async verifySession(e) {
|
|
1398
|
+
const t = new Headers(this.headers);
|
|
1399
|
+
t.append("Authorization", `Bearer ${e}`);
|
|
1405
1400
|
try {
|
|
1406
1401
|
return (await fetch(`${this.url}/session`, {
|
|
1407
1402
|
method: "GET",
|
|
1408
|
-
headers:
|
|
1409
|
-
"Content-Type": "application/json",
|
|
1410
|
-
"Platform-Code": this.platform,
|
|
1411
|
-
Role: "MEMBER",
|
|
1412
|
-
Authorization: `Bearer ${e}`
|
|
1413
|
-
}
|
|
1403
|
+
headers: t
|
|
1414
1404
|
})).ok;
|
|
1415
1405
|
} catch {
|
|
1416
1406
|
return !0;
|
|
1417
1407
|
}
|
|
1418
1408
|
}
|
|
1409
|
+
/**
|
|
1410
|
+
* @deprecated use `sendOtp`
|
|
1411
|
+
*/
|
|
1419
1412
|
async sendVerificationCode(e) {
|
|
1420
|
-
const t =
|
|
1413
|
+
const t = E(e);
|
|
1421
1414
|
try {
|
|
1422
1415
|
const r = await fetch(`${this.url}/sendVerificationCode`, {
|
|
1423
1416
|
method: "POST",
|
|
1424
|
-
headers:
|
|
1425
|
-
|
|
1426
|
-
"
|
|
1427
|
-
|
|
1428
|
-
}
|
|
1417
|
+
headers: this.headers,
|
|
1418
|
+
body: JSON.stringify({
|
|
1419
|
+
channel: "SMS",
|
|
1420
|
+
recipient: t
|
|
1421
|
+
})
|
|
1422
|
+
});
|
|
1423
|
+
return r.ok ? { ok: !0 } : {
|
|
1424
|
+
ok: !1,
|
|
1425
|
+
error: f(r.status)
|
|
1426
|
+
};
|
|
1427
|
+
} catch {
|
|
1428
|
+
return {
|
|
1429
|
+
ok: !1,
|
|
1430
|
+
error: f(500)
|
|
1431
|
+
};
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
async sendVerificationCode__next(e) {
|
|
1435
|
+
const t = E(e);
|
|
1436
|
+
try {
|
|
1437
|
+
const r = await fetch(`${this.url}/otps`, {
|
|
1438
|
+
method: "POST",
|
|
1439
|
+
headers: this.headers,
|
|
1429
1440
|
body: JSON.stringify({
|
|
1430
1441
|
channel: "SMS",
|
|
1431
1442
|
recipient: t
|
|
1432
1443
|
})
|
|
1433
1444
|
});
|
|
1445
|
+
if (r.status === 403) {
|
|
1446
|
+
const a = await r.json();
|
|
1447
|
+
return {
|
|
1448
|
+
ok: !1,
|
|
1449
|
+
error: f(r.status, a.message)
|
|
1450
|
+
};
|
|
1451
|
+
}
|
|
1434
1452
|
return r.ok ? { ok: !0 } : {
|
|
1435
1453
|
ok: !1,
|
|
1436
|
-
error:
|
|
1454
|
+
error: f(r.status)
|
|
1437
1455
|
};
|
|
1438
1456
|
} catch {
|
|
1439
1457
|
return {
|
|
1440
1458
|
ok: !1,
|
|
1441
|
-
error:
|
|
1459
|
+
error: f(500)
|
|
1442
1460
|
};
|
|
1443
1461
|
}
|
|
1444
1462
|
}
|
|
1445
1463
|
}
|
|
1446
|
-
class
|
|
1464
|
+
class Ct {
|
|
1447
1465
|
constructor(e) {
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1466
|
+
d(this, "url");
|
|
1467
|
+
d(this, "siteId");
|
|
1468
|
+
d(this, "platformId");
|
|
1451
1469
|
this.url = e.url, this.siteId = e.site, this.platformId = e.platform;
|
|
1452
1470
|
}
|
|
1453
1471
|
async self() {
|
|
@@ -1458,22 +1476,22 @@ class _t {
|
|
|
1458
1476
|
} : e;
|
|
1459
1477
|
}
|
|
1460
1478
|
async games(e) {
|
|
1461
|
-
var a, s, c, u, l,
|
|
1479
|
+
var a, s, c, u, l, h, y, p, T, v, M, N, I, S, R, D, _, P, x, G, C, $, U, O;
|
|
1462
1480
|
const t = new URLSearchParams();
|
|
1463
|
-
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), (
|
|
1481
|
+
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), (h = (l = e == null ? void 0 : e.filter) == null ? void 0 : l.type) != null && h.in && t.set("filter[type][in]", e.filter.type.in.join(",")), (p = (y = e == null ? void 0 : e.filter) == null ? void 0 : y.type) != null && p.notIn && t.set("filter[type][nin]", e.filter.type.notIn.join(",")), (v = (T = e == null ? void 0 : e.filter) == null ? void 0 : T.provider) != null && v.equal && t.set("filter[provider][eq]", e.filter.provider.equal), (N = (M = e == null ? void 0 : e.filter) == null ? void 0 : M.provider) != null && N.notEqual && t.set("filter[provider][neq]", e.filter.provider.notEqual), (S = (I = e == null ? void 0 : e.filter) == null ? void 0 : I.provider) != null && S.in && t.set("filter[provider][in]", e.filter.provider.in.join(",")), (D = (R = e == null ? void 0 : e.filter) == null ? void 0 : R.provider) != null && D.notIn && t.set("filter[provider][nin]", e.filter.provider.notIn.join(",")), (P = (_ = e == null ? void 0 : e.filter) == null ? void 0 : _.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()), ($ = (C = e == null ? void 0 : e.filter) == null ? void 0 : C.tags) != null && $.in && t.set(
|
|
1464
1482
|
"filter[tags][in]",
|
|
1465
|
-
e.filter.tags.in.map((
|
|
1483
|
+
e.filter.tags.in.map((k) => k.toLowerCase()).join(",")
|
|
1466
1484
|
), (O = (U = e == null ? void 0 : e.filter) == null ? void 0 : U.tags) != null && O.notIn && t.set(
|
|
1467
1485
|
"filter[tags][nin]",
|
|
1468
|
-
e.filter.tags.notIn.map((
|
|
1486
|
+
e.filter.tags.notIn.map((k) => k.toLowerCase()).join(",")
|
|
1469
1487
|
);
|
|
1470
1488
|
const r = await this.getJson("/games", t);
|
|
1471
1489
|
return r.ok ? {
|
|
1472
1490
|
ok: !0,
|
|
1473
1491
|
data: {
|
|
1474
|
-
edges: r.data.data.map((
|
|
1475
|
-
node:
|
|
1476
|
-
cursor:
|
|
1492
|
+
edges: r.data.data.map((k) => ({
|
|
1493
|
+
node: k,
|
|
1494
|
+
cursor: k.cursor
|
|
1477
1495
|
})),
|
|
1478
1496
|
totalCount: r.data.totalCount ?? 0,
|
|
1479
1497
|
pageInfo: {
|
|
@@ -1511,19 +1529,19 @@ class _t {
|
|
|
1511
1529
|
data: await a.json()
|
|
1512
1530
|
} : {
|
|
1513
1531
|
ok: !1,
|
|
1514
|
-
error:
|
|
1532
|
+
error: f(a.status)
|
|
1515
1533
|
};
|
|
1516
1534
|
} catch {
|
|
1517
1535
|
return {
|
|
1518
1536
|
ok: !1,
|
|
1519
|
-
error:
|
|
1537
|
+
error: f(500)
|
|
1520
1538
|
};
|
|
1521
1539
|
}
|
|
1522
1540
|
}
|
|
1523
1541
|
}
|
|
1524
1542
|
class Tt {
|
|
1525
1543
|
constructor(e) {
|
|
1526
|
-
|
|
1544
|
+
d(this, "client");
|
|
1527
1545
|
this.client = e;
|
|
1528
1546
|
}
|
|
1529
1547
|
async file(e) {
|
|
@@ -1537,7 +1555,7 @@ class Tt {
|
|
|
1537
1555
|
const t = await this.client.upload(Me, e);
|
|
1538
1556
|
return t.ok ? t.data.uploadPrivateImageFile ? {
|
|
1539
1557
|
ok: !1,
|
|
1540
|
-
error:
|
|
1558
|
+
error: m(t.data.uploadPrivateImageFile.__typename)
|
|
1541
1559
|
} : {
|
|
1542
1560
|
ok: !0
|
|
1543
1561
|
} : t;
|
|
@@ -1545,7 +1563,7 @@ class Tt {
|
|
|
1545
1563
|
}
|
|
1546
1564
|
class vt {
|
|
1547
1565
|
constructor(e) {
|
|
1548
|
-
|
|
1566
|
+
d(this, "client");
|
|
1549
1567
|
this.client = e;
|
|
1550
1568
|
}
|
|
1551
1569
|
/** @deprecated */
|
|
@@ -1563,16 +1581,16 @@ class vt {
|
|
|
1563
1581
|
}
|
|
1564
1582
|
async gameSession(e) {
|
|
1565
1583
|
const t = await this.client.request(
|
|
1566
|
-
|
|
1584
|
+
be,
|
|
1567
1585
|
e
|
|
1568
1586
|
);
|
|
1569
1587
|
return t.ok ? { ok: !0, data: t.data.node } : t;
|
|
1570
1588
|
}
|
|
1571
1589
|
async createGameSession(e) {
|
|
1572
|
-
const t = await this.client.request(
|
|
1590
|
+
const t = await this.client.request(Ae, e);
|
|
1573
1591
|
return t.ok ? t.data.createGameSession ? {
|
|
1574
1592
|
ok: !1,
|
|
1575
|
-
error:
|
|
1593
|
+
error: m(t.data.createGameSession.__typename)
|
|
1576
1594
|
} : {
|
|
1577
1595
|
ok: !0
|
|
1578
1596
|
} : t;
|
|
@@ -1581,7 +1599,7 @@ class vt {
|
|
|
1581
1599
|
const t = await this.client.request(xe, e);
|
|
1582
1600
|
return t.ok ? t.data.endGameSession ? {
|
|
1583
1601
|
ok: !1,
|
|
1584
|
-
error:
|
|
1602
|
+
error: m(t.data.endGameSession.__typename)
|
|
1585
1603
|
} : {
|
|
1586
1604
|
ok: !0
|
|
1587
1605
|
} : t;
|
|
@@ -1589,7 +1607,7 @@ class vt {
|
|
|
1589
1607
|
}
|
|
1590
1608
|
class Mt {
|
|
1591
1609
|
constructor(e) {
|
|
1592
|
-
|
|
1610
|
+
d(this, "client");
|
|
1593
1611
|
this.client = e;
|
|
1594
1612
|
}
|
|
1595
1613
|
async latestBetRecords() {
|
|
@@ -1602,7 +1620,7 @@ class Mt {
|
|
|
1602
1620
|
}
|
|
1603
1621
|
class Nt {
|
|
1604
1622
|
constructor(e) {
|
|
1605
|
-
|
|
1623
|
+
d(this, "client");
|
|
1606
1624
|
this.client = e;
|
|
1607
1625
|
}
|
|
1608
1626
|
async betRecords(e) {
|
|
@@ -1644,7 +1662,7 @@ class Nt {
|
|
|
1644
1662
|
}
|
|
1645
1663
|
async activityRecords(e) {
|
|
1646
1664
|
const t = await this.client.request(
|
|
1647
|
-
|
|
1665
|
+
bt,
|
|
1648
1666
|
e
|
|
1649
1667
|
);
|
|
1650
1668
|
return t.ok ? { ok: t.ok, data: t.data.member.activityRecords } : t;
|
|
@@ -1652,7 +1670,7 @@ class Nt {
|
|
|
1652
1670
|
}
|
|
1653
1671
|
class It {
|
|
1654
1672
|
constructor(e) {
|
|
1655
|
-
|
|
1673
|
+
d(this, "url");
|
|
1656
1674
|
this.url = e.url;
|
|
1657
1675
|
}
|
|
1658
1676
|
gameThumbnails(e) {
|
|
@@ -1664,7 +1682,7 @@ class It {
|
|
|
1664
1682
|
}
|
|
1665
1683
|
class Rt {
|
|
1666
1684
|
constructor(e) {
|
|
1667
|
-
|
|
1685
|
+
d(this, "client");
|
|
1668
1686
|
this.client = e;
|
|
1669
1687
|
}
|
|
1670
1688
|
async promos() {
|
|
@@ -1690,7 +1708,7 @@ class Rt {
|
|
|
1690
1708
|
const t = await this.client.request(rt, e);
|
|
1691
1709
|
return t.ok ? t.data.claimCashbackBonus ? {
|
|
1692
1710
|
ok: !1,
|
|
1693
|
-
error:
|
|
1711
|
+
error: m(t.data.claimCashbackBonus.__typename)
|
|
1694
1712
|
} : {
|
|
1695
1713
|
ok: !0
|
|
1696
1714
|
} : {
|
|
@@ -1717,7 +1735,7 @@ class Rt {
|
|
|
1717
1735
|
const t = await this.client.request(Le, e);
|
|
1718
1736
|
return t.ok ? t.data.createGCashDeposit ? {
|
|
1719
1737
|
ok: !1,
|
|
1720
|
-
error:
|
|
1738
|
+
error: m(t.data.createGCashDeposit.__typename)
|
|
1721
1739
|
} : {
|
|
1722
1740
|
ok: !0
|
|
1723
1741
|
} : t;
|
|
@@ -1726,7 +1744,7 @@ class Rt {
|
|
|
1726
1744
|
const t = await this.client.request(Ve, e);
|
|
1727
1745
|
return t.ok ? t.data.createMayaDeposit ? {
|
|
1728
1746
|
ok: !1,
|
|
1729
|
-
error:
|
|
1747
|
+
error: m(t.data.createMayaDeposit.__typename)
|
|
1730
1748
|
} : {
|
|
1731
1749
|
ok: !0
|
|
1732
1750
|
} : t;
|
|
@@ -1735,7 +1753,7 @@ class Rt {
|
|
|
1735
1753
|
const t = await this.client.request(He, e);
|
|
1736
1754
|
return t.ok ? t.data.createMayaAppDeposit ? {
|
|
1737
1755
|
ok: !1,
|
|
1738
|
-
error:
|
|
1756
|
+
error: m(t.data.createMayaAppDeposit.__typename)
|
|
1739
1757
|
} : {
|
|
1740
1758
|
ok: !0
|
|
1741
1759
|
} : t;
|
|
@@ -1744,7 +1762,7 @@ class Rt {
|
|
|
1744
1762
|
const t = await this.client.request(We, e);
|
|
1745
1763
|
return t.ok ? t.data.createGCashWithdrawal ? {
|
|
1746
1764
|
ok: !1,
|
|
1747
|
-
error:
|
|
1765
|
+
error: m(t.data.createGCashWithdrawal.__typename)
|
|
1748
1766
|
} : {
|
|
1749
1767
|
ok: !0
|
|
1750
1768
|
} : t;
|
|
@@ -1753,7 +1771,7 @@ class Rt {
|
|
|
1753
1771
|
const t = await this.client.request(Ue, e);
|
|
1754
1772
|
return t.ok ? t.data.createMayaWithdrawal ? {
|
|
1755
1773
|
ok: !1,
|
|
1756
|
-
error:
|
|
1774
|
+
error: m(t.data.createMayaWithdrawal.__typename)
|
|
1757
1775
|
} : {
|
|
1758
1776
|
ok: !0
|
|
1759
1777
|
} : t;
|
|
@@ -1762,7 +1780,7 @@ class Rt {
|
|
|
1762
1780
|
const t = await this.client.request(Oe, e);
|
|
1763
1781
|
return t.ok ? t.data.createMayaAppWithdrawal ? {
|
|
1764
1782
|
ok: !1,
|
|
1765
|
-
error:
|
|
1783
|
+
error: m(t.data.createMayaAppWithdrawal.__typename)
|
|
1766
1784
|
} : {
|
|
1767
1785
|
ok: !0
|
|
1768
1786
|
} : t;
|
|
@@ -1771,7 +1789,7 @@ class Rt {
|
|
|
1771
1789
|
const t = await this.client.request(Be, e);
|
|
1772
1790
|
return t.ok ? t.data.createBankWithdrawal ? {
|
|
1773
1791
|
ok: !1,
|
|
1774
|
-
error:
|
|
1792
|
+
error: m(t.data.createBankWithdrawal.__typename)
|
|
1775
1793
|
} : {
|
|
1776
1794
|
ok: !0
|
|
1777
1795
|
} : t;
|
|
@@ -1790,7 +1808,7 @@ class Rt {
|
|
|
1790
1808
|
const t = await this.client.request(Re, e);
|
|
1791
1809
|
return t.ok ? t.data.pointsToCashConversion ? {
|
|
1792
1810
|
ok: !1,
|
|
1793
|
-
error:
|
|
1811
|
+
error: m(t.data.pointsToCashConversion.__typename)
|
|
1794
1812
|
} : {
|
|
1795
1813
|
ok: !0
|
|
1796
1814
|
} : t;
|
|
@@ -1817,16 +1835,16 @@ class Rt {
|
|
|
1817
1835
|
}
|
|
1818
1836
|
async gameSession(e) {
|
|
1819
1837
|
const t = await this.client.request(
|
|
1820
|
-
|
|
1838
|
+
be,
|
|
1821
1839
|
e
|
|
1822
1840
|
);
|
|
1823
1841
|
return t.ok ? { ok: !0, data: t.data.node } : t;
|
|
1824
1842
|
}
|
|
1825
1843
|
async createGameSession(e) {
|
|
1826
|
-
const t = await this.client.request(
|
|
1844
|
+
const t = await this.client.request(Ae, e);
|
|
1827
1845
|
return t.ok ? t.data.createGameSession ? {
|
|
1828
1846
|
ok: !1,
|
|
1829
|
-
error:
|
|
1847
|
+
error: m(t.data.createGameSession.__typename)
|
|
1830
1848
|
} : {
|
|
1831
1849
|
ok: !0
|
|
1832
1850
|
} : t;
|
|
@@ -1885,9 +1903,9 @@ function xt(n) {
|
|
|
1885
1903
|
}
|
|
1886
1904
|
class W {
|
|
1887
1905
|
constructor(e, t) {
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1906
|
+
d(this, "url");
|
|
1907
|
+
d(this, "options");
|
|
1908
|
+
d(this, "middlewares");
|
|
1891
1909
|
var a;
|
|
1892
1910
|
const r = new Headers((a = t == null ? void 0 : t.fetchOptions) == null ? void 0 : a.headers);
|
|
1893
1911
|
this.url = e, this.options = { ...t == null ? void 0 : t.fetchOptions, headers: r }, this.middlewares = (t == null ? void 0 : t.middlewares) ?? [];
|
|
@@ -1924,11 +1942,11 @@ class W {
|
|
|
1924
1942
|
try {
|
|
1925
1943
|
const l = await fetch(e);
|
|
1926
1944
|
if (!l.ok)
|
|
1927
|
-
return { ok: !1, error:
|
|
1928
|
-
const
|
|
1929
|
-
return p ? ((r = p.extensions) == null ? void 0 : r.code) === "FORBIDDEN" || ((a = p.extensions) == null ? void 0 : a.code) === "ACCESS_TOKEN_EXPIRED" ? { ok: !1, error:
|
|
1945
|
+
return { ok: !1, error: f(l.status) };
|
|
1946
|
+
const h = await l.json(), y = h.data, p = (t = h.errors) == null ? void 0 : t.at(0);
|
|
1947
|
+
return p ? ((r = p.extensions) == null ? void 0 : r.code) === "FORBIDDEN" || ((a = p.extensions) == null ? void 0 : a.code) === "ACCESS_TOKEN_EXPIRED" ? { ok: !1, error: f(403, p.message) } : ((s = p.extensions) == null ? void 0 : s.code) === "UNAUTHORIZED" ? { ok: !1, error: f(401, p.message) } : ((c = p.extensions) == null ? void 0 : c.code) === "BAD_USER_INPUT" || ((u = p.extensions) == null ? void 0 : u.code) === "BAD_REQUEST" ? { ok: !1, error: f(400, p.message) } : {
|
|
1930
1948
|
ok: !1,
|
|
1931
|
-
error:
|
|
1949
|
+
error: f(500, p.message)
|
|
1932
1950
|
} : {
|
|
1933
1951
|
ok: !0,
|
|
1934
1952
|
data: y
|
|
@@ -1936,7 +1954,7 @@ class W {
|
|
|
1936
1954
|
} catch {
|
|
1937
1955
|
return {
|
|
1938
1956
|
ok: !1,
|
|
1939
|
-
error:
|
|
1957
|
+
error: f(500)
|
|
1940
1958
|
};
|
|
1941
1959
|
}
|
|
1942
1960
|
}
|
|
@@ -1971,7 +1989,7 @@ async function w(n) {
|
|
|
1971
1989
|
}
|
|
1972
1990
|
class ke {
|
|
1973
1991
|
constructor(e) {
|
|
1974
|
-
|
|
1992
|
+
d(this, "enabled");
|
|
1975
1993
|
this.enabled = (e == null ? void 0 : e.enabled) ?? !0;
|
|
1976
1994
|
}
|
|
1977
1995
|
info(e) {
|
|
@@ -2001,7 +2019,7 @@ function q(n, e) {
|
|
|
2001
2019
|
function ye(n, e) {
|
|
2002
2020
|
return n.getTime() > e.getTime();
|
|
2003
2021
|
}
|
|
2004
|
-
function
|
|
2022
|
+
function _e(n) {
|
|
2005
2023
|
return new Promise((e) => {
|
|
2006
2024
|
setTimeout(e, n);
|
|
2007
2025
|
});
|
|
@@ -2014,8 +2032,8 @@ function we(n, e) {
|
|
|
2014
2032
|
/**/
|
|
2015
2033
|
} = e;
|
|
2016
2034
|
async function s(c, u) {
|
|
2017
|
-
const l = u ?? a,
|
|
2018
|
-
return t(
|
|
2035
|
+
const l = u ?? a, h = await n(...c);
|
|
2036
|
+
return t(h) ? h : l > 1 ? (await _e(r * ((a - l) / 2)), s(c, l - 1)) : h;
|
|
2019
2037
|
}
|
|
2020
2038
|
return async (...c) => await s(c);
|
|
2021
2039
|
}
|
|
@@ -2025,11 +2043,11 @@ function F(n, e) {
|
|
|
2025
2043
|
}
|
|
2026
2044
|
class Gt {
|
|
2027
2045
|
constructor(e) {
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2046
|
+
d(this, "logger");
|
|
2047
|
+
d(this, "storageKey", "session");
|
|
2048
|
+
d(this, "authService");
|
|
2049
|
+
d(this, "walletService");
|
|
2050
|
+
d(this, "_refreshing", !1);
|
|
2033
2051
|
this.authService = e.authService, this.walletService = e.walletService, this.logger = new ke({
|
|
2034
2052
|
enabled: e.logs ?? !1
|
|
2035
2053
|
});
|
|
@@ -2074,13 +2092,13 @@ class Gt {
|
|
|
2074
2092
|
maxAttempt: 5
|
|
2075
2093
|
})();
|
|
2076
2094
|
if (!l.ok) return l;
|
|
2077
|
-
const
|
|
2095
|
+
const h = /* @__PURE__ */ new Date();
|
|
2078
2096
|
return window.localStorage.setItem(
|
|
2079
2097
|
this.storageKey,
|
|
2080
2098
|
JSON.stringify({
|
|
2081
2099
|
...l.data,
|
|
2082
|
-
accessTokenExpiresAt: q(
|
|
2083
|
-
refreshTokenExpiresAt: F(B(
|
|
2100
|
+
accessTokenExpiresAt: q(h, 8).getTime(),
|
|
2101
|
+
refreshTokenExpiresAt: F(B(h, 30), 2).getTime()
|
|
2084
2102
|
})
|
|
2085
2103
|
), {
|
|
2086
2104
|
ok: !0,
|
|
@@ -2149,7 +2167,7 @@ class Gt {
|
|
|
2149
2167
|
data: null
|
|
2150
2168
|
};
|
|
2151
2169
|
if (this.refreshing)
|
|
2152
|
-
return await
|
|
2170
|
+
return await _e(1e3), await this.get();
|
|
2153
2171
|
const e = window.localStorage.getItem(this.storageKey);
|
|
2154
2172
|
if (!e)
|
|
2155
2173
|
return {
|
|
@@ -2252,7 +2270,7 @@ function i(n, e) {
|
|
|
2252
2270
|
}
|
|
2253
2271
|
class $t {
|
|
2254
2272
|
constructor(e) {
|
|
2255
|
-
|
|
2273
|
+
d(this, "staticService");
|
|
2256
2274
|
const t = (e == null ? void 0 : e.environment) === "development";
|
|
2257
2275
|
this.staticService = new It({
|
|
2258
2276
|
url: t ? "https://static.development.opexa.io" : "https://static.opexa.io"
|
|
@@ -2297,7 +2315,7 @@ class $t {
|
|
|
2297
2315
|
return g(t);
|
|
2298
2316
|
}
|
|
2299
2317
|
platform(e) {
|
|
2300
|
-
var t, r, a, s, c, u, l,
|
|
2318
|
+
var t, r, a, s, c, u, l, h, y, p, T, v, M, N, I, S, R, D, _, P, x, G, C, $, U, O, k, Q, K, J, z, X, Z, ee, te, re, ae, ne, oe, ie, se, ce, de, me, ue, le, pe, fe, he;
|
|
2301
2319
|
return {
|
|
2302
2320
|
paymentSettings: {
|
|
2303
2321
|
minimumFirstDepositAmount: i(e.minimumFirstDepositAmount),
|
|
@@ -2313,7 +2331,7 @@ class $t {
|
|
|
2313
2331
|
},
|
|
2314
2332
|
gcash: {
|
|
2315
2333
|
androidEnabled: ((l = e.gcashDepositGatewaySettings) == null ? void 0 : l.androidEnabled) ?? !1,
|
|
2316
|
-
iosEnabled: ((
|
|
2334
|
+
iosEnabled: ((h = e.gcashDepositGatewaySettings) == null ? void 0 : h.iosEnabled) ?? !1,
|
|
2317
2335
|
webEnabled: ((y = e.gcashDepositGatewaySettings) == null ? void 0 : y.webEnabled) ?? !1,
|
|
2318
2336
|
mobileWebEnabled: ((p = e.gcashDepositGatewaySettings) == null ? void 0 : p.mobileWebEnabled) ?? !1,
|
|
2319
2337
|
minimumAmount: i((T = e.gcashDepositGatewaySettings) == null ? void 0 : T.minimumAmount),
|
|
@@ -2328,11 +2346,11 @@ class $t {
|
|
|
2328
2346
|
maximumAmount: i((D = e.mayaDepositGatewaySettings) == null ? void 0 : D.maximumAmount)
|
|
2329
2347
|
},
|
|
2330
2348
|
mayaApp: {
|
|
2331
|
-
androidEnabled: ((
|
|
2349
|
+
androidEnabled: ((_ = e.mayaAppDepositGatewaySettings) == null ? void 0 : _.androidEnabled) ?? !1,
|
|
2332
2350
|
iosEnabled: ((P = e.mayaAppDepositGatewaySettings) == null ? void 0 : P.iosEnabled) ?? !1,
|
|
2333
2351
|
webEnabled: ((x = e.mayaAppDepositGatewaySettings) == null ? void 0 : x.webEnabled) ?? !1,
|
|
2334
2352
|
mobileWebEnabled: ((G = e.mayaAppDepositGatewaySettings) == null ? void 0 : G.mobileWebEnabled) ?? !1,
|
|
2335
|
-
minimumAmount: i((
|
|
2353
|
+
minimumAmount: i((C = e.mayaAppDepositGatewaySettings) == null ? void 0 : C.minimumAmount),
|
|
2336
2354
|
maximumAmount: i(($ = e.mayaAppDepositGatewaySettings) == null ? void 0 : $.maximumAmount)
|
|
2337
2355
|
}
|
|
2338
2356
|
},
|
|
@@ -2340,7 +2358,7 @@ class $t {
|
|
|
2340
2358
|
bank: {
|
|
2341
2359
|
androidEnabled: ((U = e.bankWithdrawalGatewaySettings) == null ? void 0 : U.androidEnabled) ?? !1,
|
|
2342
2360
|
iosEnabled: ((O = e.bankWithdrawalGatewaySettings) == null ? void 0 : O.iosEnabled) ?? !1,
|
|
2343
|
-
webEnabled: ((
|
|
2361
|
+
webEnabled: ((k = e.bankWithdrawalGatewaySettings) == null ? void 0 : k.webEnabled) ?? !1,
|
|
2344
2362
|
mobileWebEnabled: ((Q = e.bankWithdrawalGatewaySettings) == null ? void 0 : Q.mobileWebEnabled) ?? !1,
|
|
2345
2363
|
minimumAmount: i((K = e.bankWithdrawalGatewaySettings) == null ? void 0 : K.minimumAmount),
|
|
2346
2364
|
maximumAmount: i((J = e.bankWithdrawalGatewaySettings) == null ? void 0 : J.maximumAmount)
|
|
@@ -2365,8 +2383,8 @@ class $t {
|
|
|
2365
2383
|
maximumAmount: i((ce = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ce.maximumAmount)
|
|
2366
2384
|
},
|
|
2367
2385
|
mayaApp: {
|
|
2368
|
-
androidEnabled: ((
|
|
2369
|
-
iosEnabled: ((
|
|
2386
|
+
androidEnabled: ((de = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : de.androidEnabled) ?? !1,
|
|
2387
|
+
iosEnabled: ((me = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : me.iosEnabled) ?? !1,
|
|
2370
2388
|
webEnabled: ((ue = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : ue.webEnabled) ?? !1,
|
|
2371
2389
|
mobileWebEnabled: ((le = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : le.mobileWebEnabled) ?? !1,
|
|
2372
2390
|
minimumAmount: i((pe = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : pe.minimumAmount),
|
|
@@ -2699,17 +2717,17 @@ class $t {
|
|
|
2699
2717
|
}
|
|
2700
2718
|
class qt {
|
|
2701
2719
|
constructor(e) {
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2720
|
+
d(this, "cmsPortalService");
|
|
2721
|
+
d(this, "authService");
|
|
2722
|
+
d(this, "gameService");
|
|
2723
|
+
d(this, "fileService");
|
|
2724
|
+
d(this, "walletService");
|
|
2725
|
+
d(this, "accountService");
|
|
2726
|
+
d(this, "reportService");
|
|
2727
|
+
d(this, "portalService");
|
|
2728
|
+
d(this, "sessionManager");
|
|
2729
|
+
d(this, "transformer");
|
|
2730
|
+
d(this, "logger");
|
|
2713
2731
|
const {
|
|
2714
2732
|
/**/
|
|
2715
2733
|
site: t,
|
|
@@ -2723,7 +2741,7 @@ class qt {
|
|
|
2723
2741
|
}), this.logger = new ke({
|
|
2724
2742
|
enabled: c ?? !1
|
|
2725
2743
|
});
|
|
2726
|
-
const l = u ? "https://auth.opexa.io" : "https://auth.development.opexa.io",
|
|
2744
|
+
const l = u ? "https://auth.opexa.io" : "https://auth.development.opexa.io", h = 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", p = u ? "https://account.opexa.io/graphql" : "https://account.development.opexa.io/graphql", T = 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", N = u ? "https://portal-api.opexacms.io/v1" : "https://portal-api.development.opexacms.io/v1", I = new Ct({
|
|
2727
2745
|
url: N,
|
|
2728
2746
|
site: t,
|
|
2729
2747
|
platform: r
|
|
@@ -2735,15 +2753,15 @@ class qt {
|
|
|
2735
2753
|
"Platform-Code": a
|
|
2736
2754
|
}
|
|
2737
2755
|
}
|
|
2738
|
-
}, R = new vt(new W(M, S)), D = new Tt(new W(v, S)),
|
|
2756
|
+
}, R = new vt(new W(M, S)), D = new Tt(new W(v, S)), _ = new Rt(new W(h, S)), P = new kt(new W(p, S)), x = new Nt(new W(y, S)), G = new Mt(new W(T, S)), C = new _t({
|
|
2739
2757
|
url: l,
|
|
2740
2758
|
platform: a
|
|
2741
2759
|
}), $ = new Gt({
|
|
2742
2760
|
logs: c,
|
|
2743
|
-
authService:
|
|
2744
|
-
walletService:
|
|
2761
|
+
authService: C,
|
|
2762
|
+
walletService: _
|
|
2745
2763
|
});
|
|
2746
|
-
this.authService =
|
|
2764
|
+
this.authService = C, this.gameService = R, this.fileService = D, this.walletService = _, this.accountService = P, this.reportService = x, this.portalService = G, this.sessionManager = $, this.cmsPortalService = I;
|
|
2747
2765
|
}
|
|
2748
2766
|
get authMiddleware() {
|
|
2749
2767
|
return async (e) => {
|
|
@@ -2778,6 +2796,9 @@ class qt {
|
|
|
2778
2796
|
}
|
|
2779
2797
|
}
|
|
2780
2798
|
}
|
|
2799
|
+
/**
|
|
2800
|
+
* @deprecated use `sendVerificationCode__next`
|
|
2801
|
+
*/
|
|
2781
2802
|
async sendAuthenticationCode(e) {
|
|
2782
2803
|
return this.authService.sendVerificationCode(e);
|
|
2783
2804
|
}
|
|
@@ -2946,7 +2967,7 @@ class qt {
|
|
|
2946
2967
|
* ```
|
|
2947
2968
|
*/
|
|
2948
2969
|
async createAccount(e) {
|
|
2949
|
-
const t = e.id ??
|
|
2970
|
+
const t = e.id ?? b.generate(A.Account).toString(), r = await this.accountService.registerMemberAccount({
|
|
2950
2971
|
input: {
|
|
2951
2972
|
id: t,
|
|
2952
2973
|
btag: e.btag,
|
|
@@ -2954,7 +2975,7 @@ class qt {
|
|
|
2954
2975
|
domain: e.domain,
|
|
2955
2976
|
birthDay: typeof e.dateOfBirth == "string" ? e.dateOfBirth : e.dateOfBirth.toISOString(),
|
|
2956
2977
|
password: await w(e.password),
|
|
2957
|
-
mobileNumber:
|
|
2978
|
+
mobileNumber: E(e.mobileNumber)
|
|
2958
2979
|
},
|
|
2959
2980
|
referralCode: e.referralCode,
|
|
2960
2981
|
verificationCode: e.verificationCode,
|
|
@@ -2969,7 +2990,9 @@ class qt {
|
|
|
2969
2990
|
* id: ObjectId.generate(ObjectType.Account).toString(),
|
|
2970
2991
|
* name: data.name,
|
|
2971
2992
|
* password: data.password,
|
|
2993
|
+
* dateOfBirth: new Date(data.dateOfBirth),
|
|
2972
2994
|
* mobileNumber: data.mobileNumber,
|
|
2995
|
+
* domain: data.domain,
|
|
2973
2996
|
* reCAPTCHAResponse: data.reCAPTCHAResponse,
|
|
2974
2997
|
* });
|
|
2975
2998
|
*
|
|
@@ -2980,13 +3003,13 @@ class qt {
|
|
|
2980
3003
|
* }
|
|
2981
3004
|
* ```
|
|
2982
3005
|
*/
|
|
2983
|
-
async
|
|
2984
|
-
const t = e.id ??
|
|
3006
|
+
async createAccount__next(e) {
|
|
3007
|
+
const t = e.id ?? b.generate(A.Account).toString(), r = await this.accountService.registerMemberAccount__next({
|
|
2985
3008
|
input: {
|
|
2986
3009
|
id: t,
|
|
2987
3010
|
name: e.name,
|
|
2988
3011
|
password: await w(e.password),
|
|
2989
|
-
mobileNumber: e.mobileNumber ?
|
|
3012
|
+
mobileNumber: e.mobileNumber ? E(e.mobileNumber) : void 0
|
|
2990
3013
|
},
|
|
2991
3014
|
reCAPTCHAResponse: e.reCAPTCHAResponse
|
|
2992
3015
|
});
|
|
@@ -3025,7 +3048,7 @@ class qt {
|
|
|
3025
3048
|
password: t.password ? await w(t.password) : void 0,
|
|
3026
3049
|
transactionPassword: t.transactionPassword ? await w(t.transactionPassword) : void 0,
|
|
3027
3050
|
...t.mobileNumber && {
|
|
3028
|
-
mobileNumber:
|
|
3051
|
+
mobileNumber: E(t.mobileNumber)
|
|
3029
3052
|
},
|
|
3030
3053
|
secretAnswer: t.secretAnswer ? await w(t.secretAnswer) : void 0
|
|
3031
3054
|
}
|
|
@@ -3068,7 +3091,7 @@ class qt {
|
|
|
3068
3091
|
* ```
|
|
3069
3092
|
*/
|
|
3070
3093
|
async submitVerificationDetails(e) {
|
|
3071
|
-
const t = e.id ??
|
|
3094
|
+
const t = e.id ?? b.generate(A.Verification).toString(), r = await this.accountService.createMemberVerification({
|
|
3072
3095
|
input: {
|
|
3073
3096
|
id: t,
|
|
3074
3097
|
...e
|
|
@@ -3104,7 +3127,7 @@ class qt {
|
|
|
3104
3127
|
async resetPassword(e) {
|
|
3105
3128
|
return await this.accountService.resetPassword({
|
|
3106
3129
|
input: {
|
|
3107
|
-
mobileNumber:
|
|
3130
|
+
mobileNumber: E(e.mobileNumber),
|
|
3108
3131
|
newPassword: await w(e.newPassword)
|
|
3109
3132
|
},
|
|
3110
3133
|
verificationCode: e.verificationCode
|
|
@@ -3128,10 +3151,13 @@ class qt {
|
|
|
3128
3151
|
return await this.accountService.sendVerificationCode({
|
|
3129
3152
|
input: {
|
|
3130
3153
|
channel: "SMS",
|
|
3131
|
-
recipient:
|
|
3154
|
+
recipient: E(e)
|
|
3132
3155
|
}
|
|
3133
3156
|
});
|
|
3134
3157
|
}
|
|
3158
|
+
async sendVerificationCode__next(e) {
|
|
3159
|
+
return this.authService.sendVerificationCode__next(e);
|
|
3160
|
+
}
|
|
3135
3161
|
async wallet() {
|
|
3136
3162
|
const e = await this.walletService.wallet();
|
|
3137
3163
|
return e.ok ? {
|
|
@@ -3192,7 +3218,7 @@ class qt {
|
|
|
3192
3218
|
* ```
|
|
3193
3219
|
*/
|
|
3194
3220
|
async createWithdrawal(e) {
|
|
3195
|
-
const t = e.id ??
|
|
3221
|
+
const t = e.id ?? b.generate(A.Withdrawal).toString();
|
|
3196
3222
|
if (e.type === "BANK") {
|
|
3197
3223
|
const r = await this.walletService.createBankWithdrawal({
|
|
3198
3224
|
input: {
|
|
@@ -3209,7 +3235,7 @@ class qt {
|
|
|
3209
3235
|
id: t,
|
|
3210
3236
|
amount: e.amount.toString(),
|
|
3211
3237
|
transactionPassword: await w(e.transactionPassword),
|
|
3212
|
-
recipientMobileNumber:
|
|
3238
|
+
recipientMobileNumber: E(e.recipientMobileNumber)
|
|
3213
3239
|
}
|
|
3214
3240
|
});
|
|
3215
3241
|
if (!r.ok) return r;
|
|
@@ -3220,7 +3246,7 @@ class qt {
|
|
|
3220
3246
|
id: t,
|
|
3221
3247
|
amount: e.amount.toString(),
|
|
3222
3248
|
transactionPassword: await w(e.transactionPassword),
|
|
3223
|
-
recipientMobileNumber:
|
|
3249
|
+
recipientMobileNumber: E(e.recipientMobileNumber)
|
|
3224
3250
|
}
|
|
3225
3251
|
});
|
|
3226
3252
|
if (!r.ok) return r;
|
|
@@ -3278,7 +3304,7 @@ class qt {
|
|
|
3278
3304
|
* ```
|
|
3279
3305
|
*/
|
|
3280
3306
|
async createDeposit(e) {
|
|
3281
|
-
const t = e.id ??
|
|
3307
|
+
const t = e.id ?? b.generate(A.Deposit).toString();
|
|
3282
3308
|
if (e.type === "MAYA") {
|
|
3283
3309
|
const r = await this.walletService.createMayaDeposit({
|
|
3284
3310
|
input: {
|
|
@@ -3564,19 +3590,19 @@ class qt {
|
|
|
3564
3590
|
* ```
|
|
3565
3591
|
*/
|
|
3566
3592
|
async createGameSession(e) {
|
|
3567
|
-
const t = e.id ??
|
|
3593
|
+
const t = e.id ?? b.generate(A.GameSession).toString(), r = await this.walletService.createGameSession({ input: { id: t, game: e.game } });
|
|
3568
3594
|
return r.ok ? { ok: !0, data: { id: t } } : r;
|
|
3569
3595
|
}
|
|
3570
3596
|
/** @deprecated use `createGameSession__next` */
|
|
3571
3597
|
async createGameSession__legacy(e) {
|
|
3572
|
-
const t = e.id ??
|
|
3598
|
+
const t = e.id ?? b.generate(A.GameSession).toString(), r = await this.gameService.createGameSession({ input: { id: t, game: e.game } });
|
|
3573
3599
|
return r.ok ? { ok: !0, data: { id: t } } : r;
|
|
3574
3600
|
}
|
|
3575
3601
|
async createGameSession__next(e) {
|
|
3576
|
-
const t = e.id ??
|
|
3602
|
+
const t = e.id ?? b.generate(A.GameSession).toString();
|
|
3577
3603
|
if (e.game.startsWith("SPORTS:")) {
|
|
3578
|
-
const u = await
|
|
3579
|
-
(
|
|
3604
|
+
const u = await b.generateFromKey(A.Game, e.game).then(
|
|
3605
|
+
(h) => h.toString()
|
|
3580
3606
|
), l = await this.gameService.createGameSession({
|
|
3581
3607
|
input: {
|
|
3582
3608
|
id: t,
|
|
@@ -3641,7 +3667,7 @@ class qt {
|
|
|
3641
3667
|
* ```
|
|
3642
3668
|
*/
|
|
3643
3669
|
async uploadImageFile(e) {
|
|
3644
|
-
const t = e.id ??
|
|
3670
|
+
const t = e.id ?? b.generate(A.File).toString(), r = await this.fileService.uploadPrivateImageFile({
|
|
3645
3671
|
input: {
|
|
3646
3672
|
id: t,
|
|
3647
3673
|
file: e.file
|
|
@@ -3734,7 +3760,7 @@ function Ut(n) {
|
|
|
3734
3760
|
}
|
|
3735
3761
|
export {
|
|
3736
3762
|
Vt as ObjectId,
|
|
3737
|
-
|
|
3763
|
+
A as ObjectType,
|
|
3738
3764
|
qt as Sdk
|
|
3739
3765
|
};
|
|
3740
3766
|
//# sourceMappingURL=index.mjs.map
|