@opexa/portal-sdk 0.0.39 → 0.0.41
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 +19 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +308 -301
- package/dist/index.mjs.map +1 -1
- package/dist/sdk/types.d.ts +2 -0
- package/dist/services/types.d.ts +4 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var Ce = Object.defineProperty;
|
|
2
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
|
|
4
|
-
import { ObjectId as
|
|
3
|
+
var d = (n, e, t) => Te(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { ObjectId as S } from "@opexa/object-id";
|
|
5
5
|
import { ObjectId as Ot } from "@opexa/object-id";
|
|
6
|
-
const
|
|
6
|
+
const b = {
|
|
7
7
|
Account: 8,
|
|
8
8
|
Deposit: 9,
|
|
9
9
|
Withdrawal: 14,
|
|
@@ -15,13 +15,13 @@ const E = {
|
|
|
15
15
|
};
|
|
16
16
|
function o(n, ...e) {
|
|
17
17
|
let t = "";
|
|
18
|
-
for (const [
|
|
19
|
-
const s = e.at(
|
|
20
|
-
t = `${t}${
|
|
18
|
+
for (const [r, a] of n.entries()) {
|
|
19
|
+
const s = e.at(r) ?? "";
|
|
20
|
+
t = `${t}${a}${s}`;
|
|
21
21
|
}
|
|
22
22
|
return t.trim();
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const F = o`
|
|
25
25
|
fragment FileFragment on File {
|
|
26
26
|
id
|
|
27
27
|
url
|
|
@@ -29,7 +29,7 @@ const G = o`
|
|
|
29
29
|
dateTimeCreated
|
|
30
30
|
}
|
|
31
31
|
`, ve = o`
|
|
32
|
-
${
|
|
32
|
+
${F}
|
|
33
33
|
|
|
34
34
|
query File($id: ObjectId!) {
|
|
35
35
|
node(id: $id) {
|
|
@@ -139,7 +139,7 @@ const G = o`
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
`,
|
|
142
|
+
`, Ee = o`
|
|
143
143
|
query GameSession($id: ObjectId!) {
|
|
144
144
|
node(id: $id) {
|
|
145
145
|
... on GameSession {
|
|
@@ -151,7 +151,7 @@ const G = o`
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
`,
|
|
154
|
+
`, Se = o`
|
|
155
155
|
mutation CreateGameSession($input: CreateGameSessionInput!) {
|
|
156
156
|
createGameSession(input: $input) {
|
|
157
157
|
... on GameDoesNotExistError {
|
|
@@ -602,8 +602,8 @@ const G = o`
|
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
|
-
`,
|
|
606
|
-
${
|
|
605
|
+
`, Y = o`
|
|
606
|
+
${F}
|
|
607
607
|
|
|
608
608
|
fragment PromoFragment on Promo {
|
|
609
609
|
id
|
|
@@ -622,7 +622,7 @@ const G = o`
|
|
|
622
622
|
dateTimeLastUpdated
|
|
623
623
|
}
|
|
624
624
|
`, Je = o`
|
|
625
|
-
${
|
|
625
|
+
${Y}
|
|
626
626
|
|
|
627
627
|
query Promos {
|
|
628
628
|
promos {
|
|
@@ -630,15 +630,15 @@ const G = o`
|
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
`, Xe = o`
|
|
633
|
-
${
|
|
633
|
+
${Y}
|
|
634
634
|
|
|
635
635
|
query AvailablePromos($filter: PromoFilterInput) {
|
|
636
636
|
availablePromos(filter: $filter) {
|
|
637
637
|
...PromoFragment
|
|
638
638
|
}
|
|
639
639
|
}
|
|
640
|
-
`,
|
|
641
|
-
${
|
|
640
|
+
`, be = o`
|
|
641
|
+
${F}
|
|
642
642
|
|
|
643
643
|
fragment CashbackFragment on Cashback {
|
|
644
644
|
id
|
|
@@ -655,7 +655,7 @@ const G = o`
|
|
|
655
655
|
dateTimeLastUpdated
|
|
656
656
|
}
|
|
657
657
|
`, Ze = o`
|
|
658
|
-
${
|
|
658
|
+
${be}
|
|
659
659
|
|
|
660
660
|
query Cashbacks {
|
|
661
661
|
cashbacks {
|
|
@@ -663,7 +663,7 @@ const G = o`
|
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
665
|
`, et = o`
|
|
666
|
-
${
|
|
666
|
+
${Y}
|
|
667
667
|
|
|
668
668
|
query Bonus {
|
|
669
669
|
bonus {
|
|
@@ -692,7 +692,7 @@ const G = o`
|
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
694
|
`, tt = o`
|
|
695
|
-
${
|
|
695
|
+
${be}
|
|
696
696
|
|
|
697
697
|
query CashbackBonuses {
|
|
698
698
|
cashbackBonuses {
|
|
@@ -705,7 +705,7 @@ const G = o`
|
|
|
705
705
|
dateTimeLastUpdated
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
|
-
`,
|
|
708
|
+
`, rt = o`
|
|
709
709
|
mutation ClaimCashbackBonus($input: ClaimCashbackBonusInput!) {
|
|
710
710
|
claimCashbackBonus(input: $input) {
|
|
711
711
|
... on CashbackBonusDoesNotExistError {
|
|
@@ -713,7 +713,7 @@ const G = o`
|
|
|
713
713
|
}
|
|
714
714
|
}
|
|
715
715
|
}
|
|
716
|
-
`,
|
|
716
|
+
`, at = o`
|
|
717
717
|
query Member {
|
|
718
718
|
member {
|
|
719
719
|
dateTimeLastActive
|
|
@@ -744,7 +744,7 @@ const G = o`
|
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
746
|
`, ot = o`
|
|
747
|
-
${
|
|
747
|
+
${F}
|
|
748
748
|
|
|
749
749
|
query MemberVerification {
|
|
750
750
|
memberAccount: self {
|
|
@@ -837,7 +837,7 @@ const G = o`
|
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
839
|
}
|
|
840
|
-
`,
|
|
840
|
+
`, mt = o`
|
|
841
841
|
mutation ResetPassword($input: ResetPasswordInput!, $verificationCode: String) {
|
|
842
842
|
resetPassword(input: $input, verificationCode: $verificationCode) {
|
|
843
843
|
... on AccountNotFoundError {
|
|
@@ -848,7 +848,7 @@ const G = o`
|
|
|
848
848
|
}
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
|
-
`,
|
|
851
|
+
`, dt = o`
|
|
852
852
|
mutation DeleteMemberAccount($input: DeleteMemberAccountInput!) {
|
|
853
853
|
deleteMemberAccount(input: $input)
|
|
854
854
|
}
|
|
@@ -982,7 +982,7 @@ const G = o`
|
|
|
982
982
|
mutation ValidateMayaSession {
|
|
983
983
|
validateMayaSession: validMayaSession
|
|
984
984
|
}
|
|
985
|
-
`,
|
|
985
|
+
`, Et = o`
|
|
986
986
|
query ActivityRecords($after: Cursor, $first: Int, $filter: ActivityRecordsFilterInput) {
|
|
987
987
|
member {
|
|
988
988
|
activityRecords(after: $after, first: $first, filter: $filter) {
|
|
@@ -1008,7 +1008,7 @@ const G = o`
|
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
1010
|
`;
|
|
1011
|
-
function
|
|
1011
|
+
function m(n) {
|
|
1012
1012
|
return {
|
|
1013
1013
|
name: n,
|
|
1014
1014
|
message: {
|
|
@@ -1062,9 +1062,9 @@ function d(n) {
|
|
|
1062
1062
|
}[n]
|
|
1063
1063
|
};
|
|
1064
1064
|
}
|
|
1065
|
-
class
|
|
1065
|
+
class St {
|
|
1066
1066
|
constructor(e) {
|
|
1067
|
-
|
|
1067
|
+
d(this, "client");
|
|
1068
1068
|
this.client = e;
|
|
1069
1069
|
}
|
|
1070
1070
|
/** aka `Query.self` */
|
|
@@ -1079,7 +1079,7 @@ class Et {
|
|
|
1079
1079
|
const t = await this.client.request(it, e);
|
|
1080
1080
|
return t.ok ? t.data.registerMemberAccount ? {
|
|
1081
1081
|
ok: !1,
|
|
1082
|
-
error:
|
|
1082
|
+
error: m(t.data.registerMemberAccount.__typename)
|
|
1083
1083
|
} : {
|
|
1084
1084
|
ok: !0
|
|
1085
1085
|
} : t;
|
|
@@ -1088,13 +1088,13 @@ class Et {
|
|
|
1088
1088
|
const t = await this.client.request(ct, e);
|
|
1089
1089
|
return t.ok ? t.data.updateMemberAccount ? {
|
|
1090
1090
|
ok: !1,
|
|
1091
|
-
error:
|
|
1091
|
+
error: m(t.data.updateMemberAccount.__typename)
|
|
1092
1092
|
} : {
|
|
1093
1093
|
ok: !0
|
|
1094
1094
|
} : t;
|
|
1095
1095
|
}
|
|
1096
1096
|
async deleteMemberAccount(e) {
|
|
1097
|
-
const t = await this.client.request(
|
|
1097
|
+
const t = await this.client.request(dt, e);
|
|
1098
1098
|
return t.ok ? t.data.deleteMemberAccount ? {
|
|
1099
1099
|
ok: !0
|
|
1100
1100
|
} : {
|
|
@@ -1107,12 +1107,12 @@ class Et {
|
|
|
1107
1107
|
}
|
|
1108
1108
|
async resetPassword(e) {
|
|
1109
1109
|
const t = await this.client.request(
|
|
1110
|
-
|
|
1110
|
+
mt,
|
|
1111
1111
|
e
|
|
1112
1112
|
);
|
|
1113
1113
|
return t.ok ? t.data.resetPassword ? {
|
|
1114
1114
|
ok: !1,
|
|
1115
|
-
error:
|
|
1115
|
+
error: m(t.data.resetPassword.__typename)
|
|
1116
1116
|
} : {
|
|
1117
1117
|
ok: !0
|
|
1118
1118
|
} : t;
|
|
@@ -1128,7 +1128,7 @@ class Et {
|
|
|
1128
1128
|
const t = await this.client.request(ht, e);
|
|
1129
1129
|
return t.ok ? t.data.sendVerificationCode ? {
|
|
1130
1130
|
ok: !1,
|
|
1131
|
-
error:
|
|
1131
|
+
error: m(t.data.sendVerificationCode.__typename)
|
|
1132
1132
|
} : {
|
|
1133
1133
|
ok: !0
|
|
1134
1134
|
} : t;
|
|
@@ -1137,7 +1137,7 @@ class Et {
|
|
|
1137
1137
|
const t = await this.client.request(ut, e);
|
|
1138
1138
|
return t.ok ? t.data.verifyMobileNumber ? {
|
|
1139
1139
|
ok: !1,
|
|
1140
|
-
error:
|
|
1140
|
+
error: m(t.data.verifyMobileNumber.__typename)
|
|
1141
1141
|
} : {
|
|
1142
1142
|
ok: !0
|
|
1143
1143
|
} : t;
|
|
@@ -1146,7 +1146,7 @@ class Et {
|
|
|
1146
1146
|
const t = await this.client.request(lt, e);
|
|
1147
1147
|
return t.ok ? t.data.createMemberVerification ? {
|
|
1148
1148
|
ok: !1,
|
|
1149
|
-
error:
|
|
1149
|
+
error: m(t.data.createMemberVerification.__typename)
|
|
1150
1150
|
} : {
|
|
1151
1151
|
ok: !0
|
|
1152
1152
|
} : t;
|
|
@@ -1155,7 +1155,7 @@ class Et {
|
|
|
1155
1155
|
const t = await this.client.request(pt, e);
|
|
1156
1156
|
return t.ok ? t.data.updateMemberVerification ? {
|
|
1157
1157
|
ok: !1,
|
|
1158
|
-
error:
|
|
1158
|
+
error: m(t.data.updateMemberVerification.__typename)
|
|
1159
1159
|
} : {
|
|
1160
1160
|
ok: !0
|
|
1161
1161
|
} : t;
|
|
@@ -1181,20 +1181,20 @@ class Et {
|
|
|
1181
1181
|
const t = await this.client.request(st, e);
|
|
1182
1182
|
return t.ok ? t.data.registerMayaMemberAccount ? {
|
|
1183
1183
|
ok: !1,
|
|
1184
|
-
error:
|
|
1184
|
+
error: m(t.data.registerMayaMemberAccount.__typename)
|
|
1185
1185
|
} : {
|
|
1186
1186
|
ok: !0
|
|
1187
1187
|
} : t;
|
|
1188
1188
|
}
|
|
1189
1189
|
}
|
|
1190
1190
|
function h(n, e) {
|
|
1191
|
-
const t =
|
|
1191
|
+
const t = L[n] ? L[n] : L[500];
|
|
1192
1192
|
return {
|
|
1193
1193
|
name: t.name,
|
|
1194
1194
|
message: e ?? t.message
|
|
1195
1195
|
};
|
|
1196
1196
|
}
|
|
1197
|
-
const
|
|
1197
|
+
const L = {
|
|
1198
1198
|
400: { name: "HttpBadRequest", message: "Bad Request" },
|
|
1199
1199
|
401: { name: "HttpUnauthorized", message: "Unauthorized" },
|
|
1200
1200
|
403: { name: "HttpForbidden", message: "Forbidden" },
|
|
@@ -1203,10 +1203,10 @@ const x = {
|
|
|
1203
1203
|
429: { name: "HttpTooManyRequests", message: "Too Many Requests" },
|
|
1204
1204
|
500: { name: "HttpInternalServerError", message: "Internal Server Error" }
|
|
1205
1205
|
};
|
|
1206
|
-
class
|
|
1206
|
+
class bt {
|
|
1207
1207
|
constructor(e) {
|
|
1208
|
-
|
|
1209
|
-
|
|
1208
|
+
d(this, "url");
|
|
1209
|
+
d(this, "platform");
|
|
1210
1210
|
this.url = e.url, this.platform = e.platform;
|
|
1211
1211
|
}
|
|
1212
1212
|
async createSession(e) {
|
|
@@ -1216,28 +1216,28 @@ class St {
|
|
|
1216
1216
|
Role: "MEMBER"
|
|
1217
1217
|
});
|
|
1218
1218
|
if (e.name) {
|
|
1219
|
-
const
|
|
1220
|
-
t.set("Authorization", `Basic ${
|
|
1219
|
+
const r = `${e.name}:${e.password}`, a = Buffer.from(r).toString("base64");
|
|
1220
|
+
t.set("Authorization", `Basic ${a}`);
|
|
1221
1221
|
}
|
|
1222
1222
|
if (e.mobileNumber) {
|
|
1223
|
-
const
|
|
1224
|
-
t.set("Authorization", `MobileNumberOTP ${
|
|
1223
|
+
const r = `${e.mobileNumber}:${e.verificationCode}`, a = Buffer.from(r).toString("base64");
|
|
1224
|
+
t.set("Authorization", `MobileNumberOTP ${a}`);
|
|
1225
1225
|
}
|
|
1226
1226
|
e.sessionId && t.set("Authorization", `Maya ${e.sessionId}`);
|
|
1227
1227
|
try {
|
|
1228
|
-
const
|
|
1228
|
+
const r = await fetch(`${this.url}/sessions`, {
|
|
1229
1229
|
method: "POST",
|
|
1230
1230
|
headers: t
|
|
1231
|
-
}),
|
|
1232
|
-
return
|
|
1231
|
+
}), a = await r.json();
|
|
1232
|
+
return r.ok ? {
|
|
1233
1233
|
ok: !0,
|
|
1234
|
-
data:
|
|
1235
|
-
} :
|
|
1234
|
+
data: a
|
|
1235
|
+
} : a.code === "ACCOUNT_BLACKLISTED" ? {
|
|
1236
1236
|
ok: !1,
|
|
1237
|
-
error:
|
|
1237
|
+
error: m("AccountBlacklisted")
|
|
1238
1238
|
} : {
|
|
1239
1239
|
ok: !1,
|
|
1240
|
-
error: h(
|
|
1240
|
+
error: h(r.status)
|
|
1241
1241
|
};
|
|
1242
1242
|
} catch {
|
|
1243
1243
|
return {
|
|
@@ -1255,22 +1255,22 @@ class St {
|
|
|
1255
1255
|
if (e.type === "SECURITY_QUESTION") {
|
|
1256
1256
|
t.set("Authorization", `Bearer ${e.token}`);
|
|
1257
1257
|
try {
|
|
1258
|
-
const
|
|
1258
|
+
const r = await fetch(`${this.url}/session/${e.token}/authenticate`, {
|
|
1259
1259
|
method: "POST",
|
|
1260
1260
|
headers: t,
|
|
1261
1261
|
body: JSON.stringify({
|
|
1262
1262
|
secretAnswer: e.secretAnswer
|
|
1263
1263
|
})
|
|
1264
|
-
}),
|
|
1265
|
-
return
|
|
1264
|
+
}), a = await r.json();
|
|
1265
|
+
return r.ok ? {
|
|
1266
1266
|
ok: !0,
|
|
1267
|
-
data:
|
|
1268
|
-
} :
|
|
1267
|
+
data: a
|
|
1268
|
+
} : r.status === 401 || r.status === 403 ? {
|
|
1269
1269
|
ok: !1,
|
|
1270
|
-
error:
|
|
1270
|
+
error: m("InvalidTokenOrSecretAnswer")
|
|
1271
1271
|
} : {
|
|
1272
1272
|
ok: !1,
|
|
1273
|
-
error: h(
|
|
1273
|
+
error: h(r.status)
|
|
1274
1274
|
};
|
|
1275
1275
|
} catch {
|
|
1276
1276
|
return {
|
|
@@ -1291,16 +1291,16 @@ class St {
|
|
|
1291
1291
|
Role: "MEMBER",
|
|
1292
1292
|
Authorization: `Bearer ${e}`
|
|
1293
1293
|
}
|
|
1294
|
-
}),
|
|
1294
|
+
}), r = await t.json();
|
|
1295
1295
|
return t.ok ? {
|
|
1296
1296
|
ok: !0,
|
|
1297
|
-
data:
|
|
1298
|
-
} :
|
|
1297
|
+
data: r
|
|
1298
|
+
} : r.code === "ACCOUNT_BLACKLISTED" ? {
|
|
1299
1299
|
ok: !1,
|
|
1300
|
-
error:
|
|
1300
|
+
error: m("AccountBlacklisted")
|
|
1301
1301
|
} : t.status === 403 || t.status === 401 ? {
|
|
1302
1302
|
ok: !1,
|
|
1303
|
-
error:
|
|
1303
|
+
error: m("InvalidToken")
|
|
1304
1304
|
} : {
|
|
1305
1305
|
ok: !1,
|
|
1306
1306
|
error: h(t.status)
|
|
@@ -1346,7 +1346,7 @@ class St {
|
|
|
1346
1346
|
}
|
|
1347
1347
|
class At {
|
|
1348
1348
|
constructor(e) {
|
|
1349
|
-
|
|
1349
|
+
d(this, "client");
|
|
1350
1350
|
this.client = e;
|
|
1351
1351
|
}
|
|
1352
1352
|
async file(e) {
|
|
@@ -1360,7 +1360,7 @@ class At {
|
|
|
1360
1360
|
const t = await this.client.upload(Me, e);
|
|
1361
1361
|
return t.ok ? t.data.uploadPrivateImageFile ? {
|
|
1362
1362
|
ok: !1,
|
|
1363
|
-
error:
|
|
1363
|
+
error: m(t.data.uploadPrivateImageFile.__typename)
|
|
1364
1364
|
} : {
|
|
1365
1365
|
ok: !0
|
|
1366
1366
|
} : t;
|
|
@@ -1368,7 +1368,7 @@ class At {
|
|
|
1368
1368
|
}
|
|
1369
1369
|
class kt {
|
|
1370
1370
|
constructor(e) {
|
|
1371
|
-
|
|
1371
|
+
d(this, "client");
|
|
1372
1372
|
this.client = e;
|
|
1373
1373
|
}
|
|
1374
1374
|
async betRecords(e) {
|
|
@@ -1401,7 +1401,7 @@ class kt {
|
|
|
1401
1401
|
return e.ok ? { ok: e.ok, data: e.data.member.depositsCount } : e;
|
|
1402
1402
|
}
|
|
1403
1403
|
async member() {
|
|
1404
|
-
const e = await this.client.request(
|
|
1404
|
+
const e = await this.client.request(at);
|
|
1405
1405
|
return e.ok ? { ok: e.ok, data: e.data.member } : e;
|
|
1406
1406
|
}
|
|
1407
1407
|
async pointsWalletTransactions(e) {
|
|
@@ -1410,7 +1410,7 @@ class kt {
|
|
|
1410
1410
|
}
|
|
1411
1411
|
async activityRecords(e) {
|
|
1412
1412
|
const t = await this.client.request(
|
|
1413
|
-
|
|
1413
|
+
Et,
|
|
1414
1414
|
e
|
|
1415
1415
|
);
|
|
1416
1416
|
return t.ok ? { ok: t.ok, data: t.data.member.activityRecords } : t;
|
|
@@ -1418,7 +1418,7 @@ class kt {
|
|
|
1418
1418
|
}
|
|
1419
1419
|
class _t {
|
|
1420
1420
|
constructor(e) {
|
|
1421
|
-
|
|
1421
|
+
d(this, "url");
|
|
1422
1422
|
this.url = e.url;
|
|
1423
1423
|
}
|
|
1424
1424
|
gameThumbnails(e) {
|
|
@@ -1430,7 +1430,7 @@ class _t {
|
|
|
1430
1430
|
}
|
|
1431
1431
|
class Ae {
|
|
1432
1432
|
constructor(e) {
|
|
1433
|
-
|
|
1433
|
+
d(this, "client");
|
|
1434
1434
|
this.client = e;
|
|
1435
1435
|
}
|
|
1436
1436
|
async promos() {
|
|
@@ -1453,10 +1453,10 @@ class Ae {
|
|
|
1453
1453
|
return e.ok ? { ok: e.ok, data: e.data.cashbackBonuses } : e;
|
|
1454
1454
|
}
|
|
1455
1455
|
async claimCashbackBonus(e) {
|
|
1456
|
-
const t = await this.client.request(
|
|
1456
|
+
const t = await this.client.request(rt, e);
|
|
1457
1457
|
return t.ok ? t.data.claimCashbackBonus ? {
|
|
1458
1458
|
ok: !1,
|
|
1459
|
-
error:
|
|
1459
|
+
error: m(t.data.claimCashbackBonus.__typename)
|
|
1460
1460
|
} : {
|
|
1461
1461
|
ok: !0
|
|
1462
1462
|
} : {
|
|
@@ -1483,7 +1483,7 @@ class Ae {
|
|
|
1483
1483
|
const t = await this.client.request(Le, e);
|
|
1484
1484
|
return t.ok ? t.data.createGCashDeposit ? {
|
|
1485
1485
|
ok: !1,
|
|
1486
|
-
error:
|
|
1486
|
+
error: m(t.data.createGCashDeposit.__typename)
|
|
1487
1487
|
} : {
|
|
1488
1488
|
ok: !0
|
|
1489
1489
|
} : t;
|
|
@@ -1492,7 +1492,7 @@ class Ae {
|
|
|
1492
1492
|
const t = await this.client.request(Ve, e);
|
|
1493
1493
|
return t.ok ? t.data.createMayaDeposit ? {
|
|
1494
1494
|
ok: !1,
|
|
1495
|
-
error:
|
|
1495
|
+
error: m(t.data.createMayaDeposit.__typename)
|
|
1496
1496
|
} : {
|
|
1497
1497
|
ok: !0
|
|
1498
1498
|
} : t;
|
|
@@ -1501,7 +1501,7 @@ class Ae {
|
|
|
1501
1501
|
const t = await this.client.request(Ye, e);
|
|
1502
1502
|
return t.ok ? t.data.createMayaAppDeposit ? {
|
|
1503
1503
|
ok: !1,
|
|
1504
|
-
error:
|
|
1504
|
+
error: m(t.data.createMayaAppDeposit.__typename)
|
|
1505
1505
|
} : {
|
|
1506
1506
|
ok: !0
|
|
1507
1507
|
} : t;
|
|
@@ -1510,7 +1510,7 @@ class Ae {
|
|
|
1510
1510
|
const t = await this.client.request(We, e);
|
|
1511
1511
|
return t.ok ? t.data.createGCashWithdrawal ? {
|
|
1512
1512
|
ok: !1,
|
|
1513
|
-
error:
|
|
1513
|
+
error: m(t.data.createGCashWithdrawal.__typename)
|
|
1514
1514
|
} : {
|
|
1515
1515
|
ok: !0
|
|
1516
1516
|
} : t;
|
|
@@ -1519,7 +1519,7 @@ class Ae {
|
|
|
1519
1519
|
const t = await this.client.request(Be, e);
|
|
1520
1520
|
return t.ok ? t.data.createMayaWithdrawal ? {
|
|
1521
1521
|
ok: !1,
|
|
1522
|
-
error:
|
|
1522
|
+
error: m(t.data.createMayaWithdrawal.__typename)
|
|
1523
1523
|
} : {
|
|
1524
1524
|
ok: !0
|
|
1525
1525
|
} : t;
|
|
@@ -1528,7 +1528,7 @@ class Ae {
|
|
|
1528
1528
|
const t = await this.client.request(Oe, e);
|
|
1529
1529
|
return t.ok ? t.data.createMayaAppWithdrawal ? {
|
|
1530
1530
|
ok: !1,
|
|
1531
|
-
error:
|
|
1531
|
+
error: m(t.data.createMayaAppWithdrawal.__typename)
|
|
1532
1532
|
} : {
|
|
1533
1533
|
ok: !0
|
|
1534
1534
|
} : t;
|
|
@@ -1537,7 +1537,7 @@ class Ae {
|
|
|
1537
1537
|
const t = await this.client.request(Ue, e);
|
|
1538
1538
|
return t.ok ? t.data.createBankWithdrawal ? {
|
|
1539
1539
|
ok: !1,
|
|
1540
|
-
error:
|
|
1540
|
+
error: m(t.data.createBankWithdrawal.__typename)
|
|
1541
1541
|
} : {
|
|
1542
1542
|
ok: !0
|
|
1543
1543
|
} : t;
|
|
@@ -1556,7 +1556,7 @@ class Ae {
|
|
|
1556
1556
|
const t = await this.client.request(De, e);
|
|
1557
1557
|
return t.ok ? t.data.pointsToCashConversion ? {
|
|
1558
1558
|
ok: !1,
|
|
1559
|
-
error:
|
|
1559
|
+
error: m(t.data.pointsToCashConversion.__typename)
|
|
1560
1560
|
} : {
|
|
1561
1561
|
ok: !0
|
|
1562
1562
|
} : t;
|
|
@@ -1583,16 +1583,16 @@ class Ae {
|
|
|
1583
1583
|
}
|
|
1584
1584
|
async gameSession(e) {
|
|
1585
1585
|
const t = await this.client.request(
|
|
1586
|
-
|
|
1586
|
+
Ee,
|
|
1587
1587
|
e
|
|
1588
1588
|
);
|
|
1589
1589
|
return t.ok ? { ok: !0, data: t.data.node } : t;
|
|
1590
1590
|
}
|
|
1591
1591
|
async createGameSession(e) {
|
|
1592
|
-
const t = await this.client.request(
|
|
1592
|
+
const t = await this.client.request(Se, e);
|
|
1593
1593
|
return t.ok ? t.data.createGameSession ? {
|
|
1594
1594
|
ok: !1,
|
|
1595
|
-
error:
|
|
1595
|
+
error: m(t.data.createGameSession.__typename)
|
|
1596
1596
|
} : {
|
|
1597
1597
|
ok: !0
|
|
1598
1598
|
} : t;
|
|
@@ -1629,9 +1629,9 @@ class Ae {
|
|
|
1629
1629
|
}
|
|
1630
1630
|
class Ct {
|
|
1631
1631
|
constructor(e) {
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1632
|
+
d(this, "url");
|
|
1633
|
+
d(this, "siteId");
|
|
1634
|
+
d(this, "platformId");
|
|
1635
1635
|
this.url = e.url, this.siteId = e.site, this.platformId = e.platform;
|
|
1636
1636
|
}
|
|
1637
1637
|
async self() {
|
|
@@ -1642,29 +1642,35 @@ class Ct {
|
|
|
1642
1642
|
} : e;
|
|
1643
1643
|
}
|
|
1644
1644
|
async games(e) {
|
|
1645
|
-
var
|
|
1645
|
+
var a, s, c, p, u, f, w, l, k, _, C, T, v, M, N, I, D, R, P, G, x, $, W, B;
|
|
1646
1646
|
const t = new URLSearchParams();
|
|
1647
|
-
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 = (
|
|
1648
|
-
|
|
1649
|
-
|
|
1647
|
+
e != null && e.first && t.set("first", e.first.toString()), e != null && e.after && t.set("after", e.after), e != null && e.search && t.set("search", e.search), (s = (a = e == null ? void 0 : e.filter) == null ? void 0 : a.type) != null && s.equal && t.set("filter[type][eq]", e.filter.type.equal), (p = (c = e == null ? void 0 : e.filter) == null ? void 0 : c.type) != null && p.notEqual && t.set("filter[type][neq]", e.filter.type.notEqual), (f = (u = e == null ? void 0 : e.filter) == null ? void 0 : u.type) != null && f.in && t.set("filter[type][in]", e.filter.type.in.join(",")), (l = (w = e == null ? void 0 : e.filter) == null ? void 0 : w.type) != null && l.notIn && t.set("filter[type][nin]", e.filter.type.notIn.join(",")), (_ = (k = e == null ? void 0 : e.filter) == null ? void 0 : k.provider) != null && _.equal && t.set("filter[provider][eq]", e.filter.provider.equal), (T = (C = e == null ? void 0 : e.filter) == null ? void 0 : C.provider) != null && T.notEqual && t.set("filter[provider][neq]", e.filter.provider.notEqual), (M = (v = e == null ? void 0 : e.filter) == null ? void 0 : v.provider) != null && M.in && t.set("filter[provider][in]", e.filter.provider.in.join(",")), (I = (N = e == null ? void 0 : e.filter) == null ? void 0 : N.provider) != null && I.notIn && t.set("filter[provider][nin]", e.filter.provider.notIn.join(",")), (R = (D = e == null ? void 0 : e.filter) == null ? void 0 : D.tags) != null && R.equal && t.set("filter[tags][eq]", e.filter.tags.equal.toLowerCase()), (G = (P = e == null ? void 0 : e.filter) == null ? void 0 : P.tags) != null && G.notEqual && t.set("filter[tags][neq]", e.filter.tags.notEqual.toLowerCase()), ($ = (x = e == null ? void 0 : e.filter) == null ? void 0 : x.tags) != null && $.in && t.set(
|
|
1648
|
+
"filter[tags][in]",
|
|
1649
|
+
e.filter.tags.in.map((E) => E.toLowerCase()).join(",")
|
|
1650
|
+
), (B = (W = e == null ? void 0 : e.filter) == null ? void 0 : W.tags) != null && B.notIn && t.set(
|
|
1651
|
+
"filter[tags][nin]",
|
|
1652
|
+
e.filter.tags.notIn.map((E) => E.toLowerCase()).join(",")
|
|
1653
|
+
);
|
|
1654
|
+
const r = await this.getJson("/games", t);
|
|
1655
|
+
return r.ok ? {
|
|
1650
1656
|
ok: !0,
|
|
1651
1657
|
data: {
|
|
1652
|
-
edges:
|
|
1653
|
-
node:
|
|
1654
|
-
cursor:
|
|
1658
|
+
edges: r.data.data.map((E) => ({
|
|
1659
|
+
node: E,
|
|
1660
|
+
cursor: E.cursor
|
|
1655
1661
|
})),
|
|
1656
|
-
totalCount:
|
|
1662
|
+
totalCount: r.data.totalCount ?? 0,
|
|
1657
1663
|
pageInfo: {
|
|
1658
|
-
hasNextPage: !!
|
|
1659
|
-
endCursor:
|
|
1664
|
+
hasNextPage: !!r.data.next,
|
|
1665
|
+
endCursor: r.data.next
|
|
1660
1666
|
}
|
|
1661
1667
|
}
|
|
1662
|
-
} :
|
|
1668
|
+
} : r;
|
|
1663
1669
|
}
|
|
1664
1670
|
async game(e) {
|
|
1665
|
-
var
|
|
1671
|
+
var r;
|
|
1666
1672
|
const t = await this.getJson(`/games/${e}`);
|
|
1667
|
-
return ((
|
|
1673
|
+
return ((r = t.error) == null ? void 0 : r.name) === "HttpNotFound" ? {
|
|
1668
1674
|
ok: !0,
|
|
1669
1675
|
data: null
|
|
1670
1676
|
} : t.ok ? {
|
|
@@ -1673,7 +1679,7 @@ class Ct {
|
|
|
1673
1679
|
} : t;
|
|
1674
1680
|
}
|
|
1675
1681
|
async getJson(e, t) {
|
|
1676
|
-
const
|
|
1682
|
+
const r = new Request(`${this.url}${e}?${(t == null ? void 0 : t.toString()) ?? ""}`, {
|
|
1677
1683
|
method: "GET",
|
|
1678
1684
|
headers: {
|
|
1679
1685
|
Accept: "application/json",
|
|
@@ -1683,13 +1689,13 @@ class Ct {
|
|
|
1683
1689
|
}
|
|
1684
1690
|
});
|
|
1685
1691
|
try {
|
|
1686
|
-
const
|
|
1687
|
-
return
|
|
1692
|
+
const a = await fetch(r);
|
|
1693
|
+
return a.ok ? {
|
|
1688
1694
|
ok: !0,
|
|
1689
|
-
data: await
|
|
1695
|
+
data: await a.json()
|
|
1690
1696
|
} : {
|
|
1691
1697
|
ok: !1,
|
|
1692
|
-
error: h(
|
|
1698
|
+
error: h(a.status)
|
|
1693
1699
|
};
|
|
1694
1700
|
} catch {
|
|
1695
1701
|
return {
|
|
@@ -1701,7 +1707,7 @@ class Ct {
|
|
|
1701
1707
|
}
|
|
1702
1708
|
class Tt {
|
|
1703
1709
|
constructor(e) {
|
|
1704
|
-
|
|
1710
|
+
d(this, "client");
|
|
1705
1711
|
this.client = e;
|
|
1706
1712
|
}
|
|
1707
1713
|
/** @deprecated */
|
|
@@ -1719,16 +1725,16 @@ class Tt {
|
|
|
1719
1725
|
}
|
|
1720
1726
|
async gameSession(e) {
|
|
1721
1727
|
const t = await this.client.request(
|
|
1722
|
-
|
|
1728
|
+
Ee,
|
|
1723
1729
|
e
|
|
1724
1730
|
);
|
|
1725
1731
|
return t.ok ? { ok: !0, data: t.data.node } : t;
|
|
1726
1732
|
}
|
|
1727
1733
|
async createGameSession(e) {
|
|
1728
|
-
const t = await this.client.request(
|
|
1734
|
+
const t = await this.client.request(Se, e);
|
|
1729
1735
|
return t.ok ? t.data.createGameSession ? {
|
|
1730
1736
|
ok: !1,
|
|
1731
|
-
error:
|
|
1737
|
+
error: m(t.data.createGameSession.__typename)
|
|
1732
1738
|
} : {
|
|
1733
1739
|
ok: !0
|
|
1734
1740
|
} : t;
|
|
@@ -1737,7 +1743,7 @@ class Tt {
|
|
|
1737
1743
|
const t = await this.client.request(Ge, e);
|
|
1738
1744
|
return t.ok ? t.data.endGameSession ? {
|
|
1739
1745
|
ok: !1,
|
|
1740
|
-
error:
|
|
1746
|
+
error: m(t.data.endGameSession.__typename)
|
|
1741
1747
|
} : {
|
|
1742
1748
|
ok: !0
|
|
1743
1749
|
} : t;
|
|
@@ -1745,7 +1751,7 @@ class Tt {
|
|
|
1745
1751
|
}
|
|
1746
1752
|
class vt {
|
|
1747
1753
|
constructor(e) {
|
|
1748
|
-
|
|
1754
|
+
d(this, "client");
|
|
1749
1755
|
this.client = e;
|
|
1750
1756
|
}
|
|
1751
1757
|
async latestBetRecords() {
|
|
@@ -1759,16 +1765,16 @@ class vt {
|
|
|
1759
1765
|
function Mt(n, e, t) {
|
|
1760
1766
|
return n < e ? e : n > t ? t : n;
|
|
1761
1767
|
}
|
|
1762
|
-
function
|
|
1768
|
+
function V(n) {
|
|
1763
1769
|
return Object.prototype.toString.call(n) === "[object Object]" && Object(n) === n;
|
|
1764
1770
|
}
|
|
1765
1771
|
function Nt(n) {
|
|
1766
1772
|
const e = [];
|
|
1767
|
-
function t(
|
|
1768
|
-
for (const s in
|
|
1769
|
-
const c =
|
|
1770
|
-
|
|
1771
|
-
key: [...
|
|
1773
|
+
function t(r, a = []) {
|
|
1774
|
+
for (const s in r) {
|
|
1775
|
+
const c = r[s];
|
|
1776
|
+
V(c) ? t(c, [...a, s]) : Array.isArray(c) ? t(It(c), [...a, s]) : e.push({
|
|
1777
|
+
key: [...a, s],
|
|
1772
1778
|
value: c
|
|
1773
1779
|
});
|
|
1774
1780
|
}
|
|
@@ -1776,25 +1782,25 @@ function Nt(n) {
|
|
|
1776
1782
|
return t(n), e;
|
|
1777
1783
|
}
|
|
1778
1784
|
function It(n) {
|
|
1779
|
-
return n.reduce((e, t,
|
|
1785
|
+
return n.reduce((e, t, r) => (e[r] = t, e), {});
|
|
1780
1786
|
}
|
|
1781
|
-
class
|
|
1787
|
+
class A {
|
|
1782
1788
|
constructor(e, t) {
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
var
|
|
1787
|
-
const
|
|
1788
|
-
this.url = e, this.options = { ...t == null ? void 0 : t.fetchOptions, headers:
|
|
1789
|
+
d(this, "url");
|
|
1790
|
+
d(this, "options");
|
|
1791
|
+
d(this, "middlewares");
|
|
1792
|
+
var a;
|
|
1793
|
+
const r = new Headers((a = t == null ? void 0 : t.fetchOptions) == null ? void 0 : a.headers);
|
|
1794
|
+
this.url = e, this.options = { ...t == null ? void 0 : t.fetchOptions, headers: r }, this.middlewares = (t == null ? void 0 : t.middlewares) ?? [];
|
|
1789
1795
|
}
|
|
1790
1796
|
async request(e, t) {
|
|
1791
|
-
const
|
|
1792
|
-
|
|
1797
|
+
const r = JSON.stringify({ query: e, variables: t }), a = new Headers(this.options.headers);
|
|
1798
|
+
a.set("Content-Type", "application/json"), a.set("Accept", "application/json");
|
|
1793
1799
|
const s = await this.runMiddlewares(
|
|
1794
1800
|
new Request(this.url, {
|
|
1795
1801
|
...this.options,
|
|
1796
|
-
body:
|
|
1797
|
-
headers:
|
|
1802
|
+
body: r,
|
|
1803
|
+
headers: a,
|
|
1798
1804
|
method: "POST"
|
|
1799
1805
|
})
|
|
1800
1806
|
);
|
|
@@ -1802,26 +1808,26 @@ class S {
|
|
|
1802
1808
|
}
|
|
1803
1809
|
/** Single file upload */
|
|
1804
1810
|
async upload(e, t) {
|
|
1805
|
-
const
|
|
1806
|
-
|
|
1811
|
+
const r = this.createUploadBody(e, t), a = new Headers(this.options.headers);
|
|
1812
|
+
a.delete("Content-Type");
|
|
1807
1813
|
const s = await this.runMiddlewares(
|
|
1808
1814
|
new Request(this.url, {
|
|
1809
1815
|
...this.options,
|
|
1810
|
-
body:
|
|
1811
|
-
headers:
|
|
1816
|
+
body: r,
|
|
1817
|
+
headers: a,
|
|
1812
1818
|
method: "POST"
|
|
1813
1819
|
})
|
|
1814
1820
|
);
|
|
1815
1821
|
return await this.exec(s);
|
|
1816
1822
|
}
|
|
1817
1823
|
async exec(e) {
|
|
1818
|
-
var t,
|
|
1824
|
+
var t, r, a, s, c, p;
|
|
1819
1825
|
try {
|
|
1820
1826
|
const u = await fetch(e);
|
|
1821
1827
|
if (!u.ok)
|
|
1822
1828
|
return { ok: !1, error: h(u.status) };
|
|
1823
1829
|
const f = await u.json(), w = f.data, l = (t = f.errors) == null ? void 0 : t.at(0);
|
|
1824
|
-
return l ? ((
|
|
1830
|
+
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" || ((p = l.extensions) == null ? void 0 : p.code) === "BAD_REQUEST" ? { ok: !1, error: h(400, l.message) } : {
|
|
1825
1831
|
ok: !1,
|
|
1826
1832
|
error: h(500, l.message)
|
|
1827
1833
|
} : {
|
|
@@ -1837,15 +1843,15 @@ class S {
|
|
|
1837
1843
|
}
|
|
1838
1844
|
async runMiddlewares(e) {
|
|
1839
1845
|
let t = e.clone();
|
|
1840
|
-
for (const
|
|
1841
|
-
t = await
|
|
1846
|
+
for (const r of this.middlewares)
|
|
1847
|
+
t = await r(t);
|
|
1842
1848
|
return t;
|
|
1843
1849
|
}
|
|
1844
1850
|
createUploadBody(e, t) {
|
|
1845
|
-
const
|
|
1851
|
+
const r = Nt(t).filter(
|
|
1846
1852
|
(c) => c.value instanceof File || c.value instanceof Blob
|
|
1847
|
-
),
|
|
1848
|
-
|
|
1853
|
+
), a = new FormData();
|
|
1854
|
+
a.append(
|
|
1849
1855
|
"operations",
|
|
1850
1856
|
JSON.stringify({
|
|
1851
1857
|
query: e,
|
|
@@ -1853,11 +1859,11 @@ class S {
|
|
|
1853
1859
|
})
|
|
1854
1860
|
);
|
|
1855
1861
|
const s = {};
|
|
1856
|
-
return
|
|
1862
|
+
return r.forEach((c, p) => {
|
|
1857
1863
|
s[p.toString()] = [`variables.${c.key.join(".")}`];
|
|
1858
|
-
}),
|
|
1859
|
-
|
|
1860
|
-
}),
|
|
1864
|
+
}), a.append("map", JSON.stringify(s)), r.forEach((c, p) => {
|
|
1865
|
+
a.append(p.toString(), c.value);
|
|
1866
|
+
}), a;
|
|
1861
1867
|
}
|
|
1862
1868
|
}
|
|
1863
1869
|
async function g(n) {
|
|
@@ -1866,7 +1872,7 @@ async function g(n) {
|
|
|
1866
1872
|
}
|
|
1867
1873
|
class ke {
|
|
1868
1874
|
constructor(e) {
|
|
1869
|
-
|
|
1875
|
+
d(this, "enabled");
|
|
1870
1876
|
this.enabled = (e == null ? void 0 : e.enabled) ?? !0;
|
|
1871
1877
|
}
|
|
1872
1878
|
info(e) {
|
|
@@ -1882,15 +1888,15 @@ class ke {
|
|
|
1882
1888
|
this.enabled && console.log(`\x1B[32m[success] ${e}`);
|
|
1883
1889
|
}
|
|
1884
1890
|
}
|
|
1885
|
-
function
|
|
1891
|
+
function H(n) {
|
|
1886
1892
|
return new Date(n.getTime());
|
|
1887
1893
|
}
|
|
1888
|
-
function
|
|
1889
|
-
const t =
|
|
1894
|
+
function O(n, e) {
|
|
1895
|
+
const t = H(n);
|
|
1890
1896
|
return t.setDate(t.getDate() + e), t;
|
|
1891
1897
|
}
|
|
1892
|
-
function
|
|
1893
|
-
const t =
|
|
1898
|
+
function U(n, e) {
|
|
1899
|
+
const t = H(n);
|
|
1894
1900
|
return t.setMinutes(t.getMinutes() + e), t;
|
|
1895
1901
|
}
|
|
1896
1902
|
function he(n, e) {
|
|
@@ -1904,32 +1910,32 @@ function _e(n) {
|
|
|
1904
1910
|
function we(n, e) {
|
|
1905
1911
|
const {
|
|
1906
1912
|
until: t,
|
|
1907
|
-
interval:
|
|
1908
|
-
maxAttempt:
|
|
1913
|
+
interval: r = 1e3,
|
|
1914
|
+
maxAttempt: a = 3
|
|
1909
1915
|
/**/
|
|
1910
1916
|
} = e;
|
|
1911
1917
|
async function s(c, p) {
|
|
1912
|
-
const u = p ??
|
|
1913
|
-
return t(f) ? f : u > 1 ? (await _e(
|
|
1918
|
+
const u = p ?? a, f = await n(...c);
|
|
1919
|
+
return t(f) ? f : u > 1 ? (await _e(r * ((a - u) / 2)), s(c, u - 1)) : f;
|
|
1914
1920
|
}
|
|
1915
1921
|
return async (...c) => await s(c);
|
|
1916
1922
|
}
|
|
1917
|
-
function
|
|
1918
|
-
const t =
|
|
1923
|
+
function q(n, e) {
|
|
1924
|
+
const t = H(n);
|
|
1919
1925
|
return t.setMinutes(t.getMinutes() - e), t;
|
|
1920
1926
|
}
|
|
1921
1927
|
class Dt {
|
|
1922
1928
|
constructor(e) {
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
this.authService = new
|
|
1929
|
+
d(this, "logger");
|
|
1930
|
+
d(this, "storageKey", "session");
|
|
1931
|
+
d(this, "authService");
|
|
1932
|
+
d(this, "walletService");
|
|
1933
|
+
d(this, "_refreshing", !1);
|
|
1934
|
+
this.authService = new bt({
|
|
1929
1935
|
url: e.authUrl,
|
|
1930
1936
|
platform: e.platform
|
|
1931
1937
|
}), this.walletService = new Ae(
|
|
1932
|
-
new
|
|
1938
|
+
new A(e.walletUrl, {
|
|
1933
1939
|
middlewares: [
|
|
1934
1940
|
(t) => (t.headers.set("Platform", e.platform), t.headers.set("Role", "MEMBER"), t)
|
|
1935
1941
|
]
|
|
@@ -1945,7 +1951,7 @@ class Dt {
|
|
|
1945
1951
|
this._refreshing = e;
|
|
1946
1952
|
}
|
|
1947
1953
|
async create(e) {
|
|
1948
|
-
var
|
|
1954
|
+
var a;
|
|
1949
1955
|
if (this.isServer)
|
|
1950
1956
|
return this.logger.warn("'localStorage' is not available on the server."), {
|
|
1951
1957
|
ok: !1,
|
|
@@ -1964,7 +1970,7 @@ class Dt {
|
|
|
1964
1970
|
maxAttempt: 5
|
|
1965
1971
|
})();
|
|
1966
1972
|
if (!c.ok) return c;
|
|
1967
|
-
if (!((
|
|
1973
|
+
if (!((a = c.data) != null && a.member))
|
|
1968
1974
|
return {
|
|
1969
1975
|
ok: !1,
|
|
1970
1976
|
error: {
|
|
@@ -1983,8 +1989,8 @@ class Dt {
|
|
|
1983
1989
|
this.storageKey,
|
|
1984
1990
|
JSON.stringify({
|
|
1985
1991
|
...u.data,
|
|
1986
|
-
accessTokenExpiresAt:
|
|
1987
|
-
refreshTokenExpiresAt:
|
|
1992
|
+
accessTokenExpiresAt: U(f, 8).getTime(),
|
|
1993
|
+
refreshTokenExpiresAt: q(O(f, 30), 2).getTime()
|
|
1988
1994
|
})
|
|
1989
1995
|
), {
|
|
1990
1996
|
ok: !0,
|
|
@@ -1999,8 +2005,8 @@ class Dt {
|
|
|
1999
2005
|
this.storageKey,
|
|
2000
2006
|
JSON.stringify({
|
|
2001
2007
|
...s.data,
|
|
2002
|
-
accessTokenExpiresAt:
|
|
2003
|
-
refreshTokenExpiresAt:
|
|
2008
|
+
accessTokenExpiresAt: U(c, 8).getTime(),
|
|
2009
|
+
refreshTokenExpiresAt: q(O(c, 30), 2).getTime()
|
|
2004
2010
|
})
|
|
2005
2011
|
), {
|
|
2006
2012
|
ok: !0,
|
|
@@ -2018,13 +2024,13 @@ class Dt {
|
|
|
2018
2024
|
authenticator: t.data.authenticator
|
|
2019
2025
|
}
|
|
2020
2026
|
};
|
|
2021
|
-
const
|
|
2027
|
+
const r = /* @__PURE__ */ new Date();
|
|
2022
2028
|
return window.localStorage.setItem(
|
|
2023
2029
|
this.storageKey,
|
|
2024
2030
|
JSON.stringify({
|
|
2025
2031
|
...t.data,
|
|
2026
|
-
accessTokenExpiresAt:
|
|
2027
|
-
refreshTokenExpiresAt:
|
|
2032
|
+
accessTokenExpiresAt: U(r, 8).getTime(),
|
|
2033
|
+
refreshTokenExpiresAt: q(O(r, 30), 2).getTime()
|
|
2028
2034
|
})
|
|
2029
2035
|
), {
|
|
2030
2036
|
ok: !0,
|
|
@@ -2034,13 +2040,13 @@ class Dt {
|
|
|
2034
2040
|
async createFromAuthenticator(e) {
|
|
2035
2041
|
const t = await this.authService.authenticate(e);
|
|
2036
2042
|
if (t.ok) {
|
|
2037
|
-
const
|
|
2043
|
+
const r = /* @__PURE__ */ new Date();
|
|
2038
2044
|
return this.isServer ? this.logger.warn("'localStorage' is not available on the server.") : window.localStorage.setItem(
|
|
2039
2045
|
this.storageKey,
|
|
2040
2046
|
JSON.stringify({
|
|
2041
2047
|
...t.data,
|
|
2042
|
-
accessTokenExpiresAt:
|
|
2043
|
-
refreshTokenExpiresAt:
|
|
2048
|
+
accessTokenExpiresAt: U(r, 8).getTime(),
|
|
2049
|
+
refreshTokenExpiresAt: q(O(r, 30), 2).getTime()
|
|
2044
2050
|
})
|
|
2045
2051
|
), { ok: !0 };
|
|
2046
2052
|
} else
|
|
@@ -2061,9 +2067,9 @@ class Dt {
|
|
|
2061
2067
|
data: null
|
|
2062
2068
|
};
|
|
2063
2069
|
try {
|
|
2064
|
-
let t = JSON.parse(e),
|
|
2065
|
-
const
|
|
2066
|
-
if (he(
|
|
2070
|
+
let t = JSON.parse(e), r = /* @__PURE__ */ new Date();
|
|
2071
|
+
const a = new Date(t.accessTokenExpiresAt), s = new Date(t.refreshTokenExpiresAt);
|
|
2072
|
+
if (he(r, s))
|
|
2067
2073
|
return this.logger.warn("Session expired. Logging out.."), window.localStorage.removeItem(this.storageKey), {
|
|
2068
2074
|
ok: !1,
|
|
2069
2075
|
error: {
|
|
@@ -2071,7 +2077,7 @@ class Dt {
|
|
|
2071
2077
|
message: "Session expired."
|
|
2072
2078
|
}
|
|
2073
2079
|
};
|
|
2074
|
-
if (he(
|
|
2080
|
+
if (he(r, a)) {
|
|
2075
2081
|
this.logger.info("Refreshing session..."), this.refreshing = !0;
|
|
2076
2082
|
const c = await this.authService.refreshSession(t.refreshToken);
|
|
2077
2083
|
if (this.refreshing = !1, !c.ok)
|
|
@@ -2082,11 +2088,11 @@ class Dt {
|
|
|
2082
2088
|
ok: !0,
|
|
2083
2089
|
data: t
|
|
2084
2090
|
});
|
|
2085
|
-
this.logger.success("Session refreshed!"),
|
|
2091
|
+
this.logger.success("Session refreshed!"), r = /* @__PURE__ */ new Date(), t = {
|
|
2086
2092
|
...t,
|
|
2087
2093
|
...c.data,
|
|
2088
|
-
accessTokenExpiresAt:
|
|
2089
|
-
refreshTokenExpiresAt:
|
|
2094
|
+
accessTokenExpiresAt: U(r, 8).getTime(),
|
|
2095
|
+
refreshTokenExpiresAt: q(O(r, 30), 2).getTime()
|
|
2090
2096
|
}, window.localStorage.setItem(this.storageKey, JSON.stringify(t));
|
|
2091
2097
|
}
|
|
2092
2098
|
return {
|
|
@@ -2113,11 +2119,11 @@ class Dt {
|
|
|
2113
2119
|
(t = e.data) != null && t.accessToken && await this.authService.destroySession(e.data.accessToken), window.localStorage.removeItem(this.storageKey);
|
|
2114
2120
|
}
|
|
2115
2121
|
async verify() {
|
|
2116
|
-
var
|
|
2122
|
+
var r, a, s;
|
|
2117
2123
|
if (this.isServer)
|
|
2118
2124
|
return this.logger.warn("'localStorage' is not available on the server."), !0;
|
|
2119
2125
|
const e = await this.get();
|
|
2120
|
-
if (((
|
|
2126
|
+
if (((r = e.error) == null ? void 0 : r.name) === "InvalidToken" || ((a = e.error) == null ? void 0 : a.name) === "SessionExpired" || ((s = e.error) == null ? void 0 : s.name) === "AccountBlacklisted") return !1;
|
|
2121
2127
|
if (!e.data) return !0;
|
|
2122
2128
|
const t = await this.authService.verifySession(e.data.accessToken);
|
|
2123
2129
|
return t || window.localStorage.removeItem(this.storageKey), t;
|
|
@@ -2129,17 +2135,17 @@ class Dt {
|
|
|
2129
2135
|
function y(n) {
|
|
2130
2136
|
const e = {};
|
|
2131
2137
|
for (const t in n) {
|
|
2132
|
-
const
|
|
2133
|
-
if (
|
|
2134
|
-
if (
|
|
2135
|
-
e[t] = y(
|
|
2138
|
+
const r = n[t];
|
|
2139
|
+
if (r !== null && r !== void 0) {
|
|
2140
|
+
if (V(r)) {
|
|
2141
|
+
e[t] = y(r);
|
|
2136
2142
|
continue;
|
|
2137
2143
|
}
|
|
2138
|
-
if (Array.isArray(
|
|
2139
|
-
e[t] =
|
|
2144
|
+
if (Array.isArray(r)) {
|
|
2145
|
+
e[t] = r.map((a) => V(a) ? y(a) : a);
|
|
2140
2146
|
continue;
|
|
2141
2147
|
}
|
|
2142
|
-
e[t] =
|
|
2148
|
+
e[t] = r;
|
|
2143
2149
|
}
|
|
2144
2150
|
}
|
|
2145
2151
|
return e;
|
|
@@ -2156,7 +2162,7 @@ function i(n, e) {
|
|
|
2156
2162
|
}
|
|
2157
2163
|
class Rt {
|
|
2158
2164
|
constructor(e) {
|
|
2159
|
-
|
|
2165
|
+
d(this, "staticService");
|
|
2160
2166
|
const t = (e == null ? void 0 : e.environment) === "development";
|
|
2161
2167
|
this.staticService = new _t({
|
|
2162
2168
|
url: t ? "https://static.development.opexa.io" : "https://static.opexa.io"
|
|
@@ -2200,7 +2206,7 @@ class Rt {
|
|
|
2200
2206
|
return y(t);
|
|
2201
2207
|
}
|
|
2202
2208
|
platform(e) {
|
|
2203
|
-
var t,
|
|
2209
|
+
var t, r, a, s, c, p, u, f, w, l, k, _, C, T, v, M, N, I, D, R, P, G, x, $, W, B, E, j, Q, K, z, J, X, Z, ee, te, re, ae, ne, oe, ie, se, ce, me, de, ue, le, pe, fe;
|
|
2204
2210
|
return {
|
|
2205
2211
|
paymentSettings: {
|
|
2206
2212
|
minimumFirstDepositAmount: i(e.minimumFirstDepositAmount),
|
|
@@ -2208,8 +2214,8 @@ class Rt {
|
|
|
2208
2214
|
depositGateway: {
|
|
2209
2215
|
bank: {
|
|
2210
2216
|
androidEnabled: ((t = e.bankDepositGatewaySettings) == null ? void 0 : t.androidEnabled) ?? !1,
|
|
2211
|
-
iosEnabled: ((
|
|
2212
|
-
webEnabled: ((
|
|
2217
|
+
iosEnabled: ((r = e.bankDepositGatewaySettings) == null ? void 0 : r.iosEnabled) ?? !1,
|
|
2218
|
+
webEnabled: ((a = e.bankDepositGatewaySettings) == null ? void 0 : a.webEnabled) ?? !1,
|
|
2213
2219
|
mobileWebEnabled: ((s = e.bankDepositGatewaySettings) == null ? void 0 : s.mobileWebEnabled) ?? !1,
|
|
2214
2220
|
minimumAmount: i((c = e.bankDepositGatewaySettings) == null ? void 0 : c.minimumAmount),
|
|
2215
2221
|
maximumAmount: i((p = e.bankDepositGatewaySettings) == null ? void 0 : p.maximumAmount)
|
|
@@ -2219,31 +2225,31 @@ class Rt {
|
|
|
2219
2225
|
iosEnabled: ((f = e.gcashDepositGatewaySettings) == null ? void 0 : f.iosEnabled) ?? !1,
|
|
2220
2226
|
webEnabled: ((w = e.gcashDepositGatewaySettings) == null ? void 0 : w.webEnabled) ?? !1,
|
|
2221
2227
|
mobileWebEnabled: ((l = e.gcashDepositGatewaySettings) == null ? void 0 : l.mobileWebEnabled) ?? !1,
|
|
2222
|
-
minimumAmount: i((
|
|
2223
|
-
maximumAmount: i((
|
|
2228
|
+
minimumAmount: i((k = e.gcashDepositGatewaySettings) == null ? void 0 : k.minimumAmount),
|
|
2229
|
+
maximumAmount: i((_ = e.gcashDepositGatewaySettings) == null ? void 0 : _.maximumAmount)
|
|
2224
2230
|
},
|
|
2225
2231
|
maya: {
|
|
2226
|
-
androidEnabled: ((
|
|
2227
|
-
iosEnabled: ((
|
|
2228
|
-
webEnabled: ((
|
|
2229
|
-
mobileWebEnabled: ((
|
|
2230
|
-
minimumAmount: i((
|
|
2231
|
-
maximumAmount: i((
|
|
2232
|
+
androidEnabled: ((C = e.mayaDepositGatewaySettings) == null ? void 0 : C.androidEnabled) ?? !1,
|
|
2233
|
+
iosEnabled: ((T = e.mayaDepositGatewaySettings) == null ? void 0 : T.iosEnabled) ?? !1,
|
|
2234
|
+
webEnabled: ((v = e.mayaDepositGatewaySettings) == null ? void 0 : v.webEnabled) ?? !1,
|
|
2235
|
+
mobileWebEnabled: ((M = e.mayaDepositGatewaySettings) == null ? void 0 : M.mobileWebEnabled) ?? !1,
|
|
2236
|
+
minimumAmount: i((N = e.mayaDepositGatewaySettings) == null ? void 0 : N.minimumAmount),
|
|
2237
|
+
maximumAmount: i((I = e.mayaDepositGatewaySettings) == null ? void 0 : I.maximumAmount)
|
|
2232
2238
|
},
|
|
2233
2239
|
mayaApp: {
|
|
2234
|
-
androidEnabled: ((
|
|
2235
|
-
iosEnabled: ((
|
|
2236
|
-
webEnabled: ((
|
|
2237
|
-
mobileWebEnabled: ((
|
|
2238
|
-
minimumAmount: i((
|
|
2239
|
-
maximumAmount: i((
|
|
2240
|
+
androidEnabled: ((D = e.mayaAppDepositGatewaySettings) == null ? void 0 : D.androidEnabled) ?? !1,
|
|
2241
|
+
iosEnabled: ((R = e.mayaAppDepositGatewaySettings) == null ? void 0 : R.iosEnabled) ?? !1,
|
|
2242
|
+
webEnabled: ((P = e.mayaAppDepositGatewaySettings) == null ? void 0 : P.webEnabled) ?? !1,
|
|
2243
|
+
mobileWebEnabled: ((G = e.mayaAppDepositGatewaySettings) == null ? void 0 : G.mobileWebEnabled) ?? !1,
|
|
2244
|
+
minimumAmount: i((x = e.mayaAppDepositGatewaySettings) == null ? void 0 : x.minimumAmount),
|
|
2245
|
+
maximumAmount: i(($ = e.mayaAppDepositGatewaySettings) == null ? void 0 : $.maximumAmount)
|
|
2240
2246
|
}
|
|
2241
2247
|
},
|
|
2242
2248
|
withdrawalGateway: {
|
|
2243
2249
|
bank: {
|
|
2244
|
-
androidEnabled: ((
|
|
2245
|
-
iosEnabled: ((
|
|
2246
|
-
webEnabled: ((
|
|
2250
|
+
androidEnabled: ((W = e.bankWithdrawalGatewaySettings) == null ? void 0 : W.androidEnabled) ?? !1,
|
|
2251
|
+
iosEnabled: ((B = e.bankWithdrawalGatewaySettings) == null ? void 0 : B.iosEnabled) ?? !1,
|
|
2252
|
+
webEnabled: ((E = e.bankWithdrawalGatewaySettings) == null ? void 0 : E.webEnabled) ?? !1,
|
|
2247
2253
|
mobileWebEnabled: ((j = e.bankWithdrawalGatewaySettings) == null ? void 0 : j.mobileWebEnabled) ?? !1,
|
|
2248
2254
|
minimumAmount: i((Q = e.bankWithdrawalGatewaySettings) == null ? void 0 : Q.minimumAmount),
|
|
2249
2255
|
maximumAmount: i((K = e.bankWithdrawalGatewaySettings) == null ? void 0 : K.maximumAmount)
|
|
@@ -2260,8 +2266,8 @@ class Rt {
|
|
|
2260
2266
|
)
|
|
2261
2267
|
},
|
|
2262
2268
|
maya: {
|
|
2263
|
-
androidEnabled: ((
|
|
2264
|
-
iosEnabled: ((
|
|
2269
|
+
androidEnabled: ((re = e.mayaWithdrawalGatewaySettings) == null ? void 0 : re.androidEnabled) ?? !1,
|
|
2270
|
+
iosEnabled: ((ae = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ae.iosEnabled) ?? !1,
|
|
2265
2271
|
webEnabled: ((ne = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ne.webEnabled) ?? !1,
|
|
2266
2272
|
mobileWebEnabled: ((oe = e.mayaWithdrawalGatewaySettings) == null ? void 0 : oe.mobileWebEnabled) ?? !1,
|
|
2267
2273
|
minimumAmount: i((ie = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ie.minimumAmount),
|
|
@@ -2269,8 +2275,8 @@ class Rt {
|
|
|
2269
2275
|
},
|
|
2270
2276
|
mayaApp: {
|
|
2271
2277
|
androidEnabled: ((ce = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : ce.androidEnabled) ?? !1,
|
|
2272
|
-
iosEnabled: ((
|
|
2273
|
-
webEnabled: ((
|
|
2278
|
+
iosEnabled: ((me = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : me.iosEnabled) ?? !1,
|
|
2279
|
+
webEnabled: ((de = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : de.webEnabled) ?? !1,
|
|
2274
2280
|
mobileWebEnabled: ((ue = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : ue.mobileWebEnabled) ?? !1,
|
|
2275
2281
|
minimumAmount: i((le = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : le.minimumAmount),
|
|
2276
2282
|
maximumAmount: i(
|
|
@@ -2396,7 +2402,7 @@ class Rt {
|
|
|
2396
2402
|
return y(t);
|
|
2397
2403
|
}
|
|
2398
2404
|
betRecord(e) {
|
|
2399
|
-
var
|
|
2405
|
+
var r;
|
|
2400
2406
|
const t = {
|
|
2401
2407
|
id: e.id,
|
|
2402
2408
|
bet: i(e.bet, 0),
|
|
@@ -2416,7 +2422,7 @@ class Rt {
|
|
|
2416
2422
|
contestName: e.contestName ?? void 0,
|
|
2417
2423
|
externalCategory: e.externalCategory ?? void 0,
|
|
2418
2424
|
metadata: {
|
|
2419
|
-
odds: ((
|
|
2425
|
+
odds: ((r = e.metadata) == null ? void 0 : r.odds) ?? void 0
|
|
2420
2426
|
}
|
|
2421
2427
|
};
|
|
2422
2428
|
return y(t);
|
|
@@ -2458,6 +2464,7 @@ class Rt {
|
|
|
2458
2464
|
return {
|
|
2459
2465
|
id: e.id,
|
|
2460
2466
|
type: e.type,
|
|
2467
|
+
tags: e.tags ?? [],
|
|
2461
2468
|
name: e.name,
|
|
2462
2469
|
images: this.staticService.gameThumbnails({
|
|
2463
2470
|
id: e.externalId,
|
|
@@ -2506,7 +2513,7 @@ class Rt {
|
|
|
2506
2513
|
dateTimeLastUpdated: new Date(e.dateTimeLastUpdated),
|
|
2507
2514
|
turnoverContributionPercentagePerGameProvider: Object.entries(
|
|
2508
2515
|
e.turnoverContributionPercentagePerGameProvider
|
|
2509
|
-
).reduce((
|
|
2516
|
+
).reduce((r, [a, s]) => (r[a] = i(s, 0), r), {})
|
|
2510
2517
|
};
|
|
2511
2518
|
}
|
|
2512
2519
|
bonus(e) {
|
|
@@ -2589,7 +2596,7 @@ class Rt {
|
|
|
2589
2596
|
}
|
|
2590
2597
|
class $t {
|
|
2591
2598
|
constructor(e) {
|
|
2592
|
-
|
|
2599
|
+
d(this, "_config");
|
|
2593
2600
|
this._config = {
|
|
2594
2601
|
...e,
|
|
2595
2602
|
logs: e.logs ?? !1,
|
|
@@ -2630,7 +2637,7 @@ class $t {
|
|
|
2630
2637
|
}
|
|
2631
2638
|
get gameService() {
|
|
2632
2639
|
return new Tt(
|
|
2633
|
-
new
|
|
2640
|
+
new A(
|
|
2634
2641
|
this.config.environment === "development" ? "https://game.development.opexa.io/graphql" : "https://game.opexa.io/graphql",
|
|
2635
2642
|
{
|
|
2636
2643
|
middlewares: [this.authMiddleware],
|
|
@@ -2646,7 +2653,7 @@ class $t {
|
|
|
2646
2653
|
}
|
|
2647
2654
|
get fileService() {
|
|
2648
2655
|
return new At(
|
|
2649
|
-
new
|
|
2656
|
+
new A(
|
|
2650
2657
|
this.config.environment === "development" ? "https://file.development.opexa.io/graphql" : "https://file.opexa.io/graphql",
|
|
2651
2658
|
{
|
|
2652
2659
|
middlewares: [this.authMiddleware],
|
|
@@ -2662,7 +2669,7 @@ class $t {
|
|
|
2662
2669
|
}
|
|
2663
2670
|
get walletService() {
|
|
2664
2671
|
return new Ae(
|
|
2665
|
-
new
|
|
2672
|
+
new A(
|
|
2666
2673
|
this.config.environment === "development" ? "https://wallet.development.opexa.io/graphql" : "https://wallet.opexa.io/graphql",
|
|
2667
2674
|
{
|
|
2668
2675
|
middlewares: [this.authMiddleware],
|
|
@@ -2677,8 +2684,8 @@ class $t {
|
|
|
2677
2684
|
);
|
|
2678
2685
|
}
|
|
2679
2686
|
get accountService() {
|
|
2680
|
-
return new
|
|
2681
|
-
new
|
|
2687
|
+
return new St(
|
|
2688
|
+
new A(
|
|
2682
2689
|
this.config.environment === "development" ? "https://account.development.opexa.io/graphql" : "https://account.opexa.io/graphql",
|
|
2683
2690
|
{
|
|
2684
2691
|
middlewares: [this.authMiddleware],
|
|
@@ -2694,7 +2701,7 @@ class $t {
|
|
|
2694
2701
|
}
|
|
2695
2702
|
get reportService() {
|
|
2696
2703
|
return new kt(
|
|
2697
|
-
new
|
|
2704
|
+
new A(
|
|
2698
2705
|
this.config.environment === "development" ? "https://report.development.opexa.io/graphql" : "https://report.opexa.io/graphql",
|
|
2699
2706
|
{
|
|
2700
2707
|
middlewares: [this.authMiddleware],
|
|
@@ -2710,7 +2717,7 @@ class $t {
|
|
|
2710
2717
|
}
|
|
2711
2718
|
get portalService() {
|
|
2712
2719
|
return new vt(
|
|
2713
|
-
new
|
|
2720
|
+
new A(
|
|
2714
2721
|
this.config.environment === "development" ? "https://portal.development.opexa.io/graphql" : "https://portal.opexa.io/graphql",
|
|
2715
2722
|
{
|
|
2716
2723
|
middlewares: [this.authMiddleware],
|
|
@@ -2837,12 +2844,12 @@ class $t {
|
|
|
2837
2844
|
*/
|
|
2838
2845
|
watchSession(e) {
|
|
2839
2846
|
const t = Mt(e.interval ?? 3e4, 3e4, 6e4);
|
|
2840
|
-
let
|
|
2841
|
-
const
|
|
2842
|
-
await this.sessionManager.verify() || await e.onInvalid(),
|
|
2847
|
+
let r = null;
|
|
2848
|
+
const a = () => setTimeout(async () => {
|
|
2849
|
+
await this.sessionManager.verify() || await e.onInvalid(), r = a();
|
|
2843
2850
|
}, t);
|
|
2844
|
-
return
|
|
2845
|
-
|
|
2851
|
+
return r = a(), function() {
|
|
2852
|
+
r && clearTimeout(r);
|
|
2846
2853
|
};
|
|
2847
2854
|
}
|
|
2848
2855
|
async session() {
|
|
@@ -2922,7 +2929,7 @@ class $t {
|
|
|
2922
2929
|
* ```
|
|
2923
2930
|
*/
|
|
2924
2931
|
async createAccount(e) {
|
|
2925
|
-
const t = e.id ??
|
|
2932
|
+
const t = e.id ?? S.generate(b.Account).toString(), r = await this.accountService.registerMemberAccount({
|
|
2926
2933
|
input: {
|
|
2927
2934
|
id: t,
|
|
2928
2935
|
name: e.name,
|
|
@@ -2935,7 +2942,7 @@ class $t {
|
|
|
2935
2942
|
verificationCode: e.verificationCode,
|
|
2936
2943
|
reCAPTCHAResponse: e.reCAPTCHAResponse
|
|
2937
2944
|
});
|
|
2938
|
-
return
|
|
2945
|
+
return r.ok ? { ok: !0, data: { id: t } } : r;
|
|
2939
2946
|
}
|
|
2940
2947
|
async registerMayaAccount(e) {
|
|
2941
2948
|
return await this.accountService.registerMayaMemberAccount({
|
|
@@ -3013,13 +3020,13 @@ class $t {
|
|
|
3013
3020
|
* ```
|
|
3014
3021
|
*/
|
|
3015
3022
|
async submitVerificationDetails(e) {
|
|
3016
|
-
const t = e.id ??
|
|
3023
|
+
const t = e.id ?? S.generate(b.Verification).toString(), r = await this.accountService.createMemberVerification({
|
|
3017
3024
|
input: {
|
|
3018
3025
|
id: t,
|
|
3019
3026
|
...e
|
|
3020
3027
|
}
|
|
3021
3028
|
});
|
|
3022
|
-
return
|
|
3029
|
+
return r.ok ? { ok: !0, data: { id: t } } : r;
|
|
3023
3030
|
}
|
|
3024
3031
|
/**
|
|
3025
3032
|
* @example
|
|
@@ -3104,9 +3111,9 @@ class $t {
|
|
|
3104
3111
|
return t.ok ? {
|
|
3105
3112
|
ok: !0,
|
|
3106
3113
|
data: {
|
|
3107
|
-
announcements: t.data.edges.map(({ cursor:
|
|
3108
|
-
...this.transformer.transform.announcement(
|
|
3109
|
-
cursor:
|
|
3114
|
+
announcements: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3115
|
+
...this.transformer.transform.announcement(a),
|
|
3116
|
+
cursor: r
|
|
3110
3117
|
})),
|
|
3111
3118
|
totalCount: t.data.totalCount,
|
|
3112
3119
|
endCursor: t.data.pageInfo.endCursor ?? void 0,
|
|
@@ -3137,19 +3144,19 @@ class $t {
|
|
|
3137
3144
|
* ```
|
|
3138
3145
|
*/
|
|
3139
3146
|
async createWithdrawal(e) {
|
|
3140
|
-
const t = e.id ??
|
|
3147
|
+
const t = e.id ?? S.generate(b.Withdrawal).toString();
|
|
3141
3148
|
if (e.type === "BANK") {
|
|
3142
|
-
const
|
|
3149
|
+
const r = await this.walletService.createBankWithdrawal({
|
|
3143
3150
|
input: {
|
|
3144
3151
|
id: t,
|
|
3145
3152
|
amount: e.amount.toString(),
|
|
3146
3153
|
transactionPassword: await g(e.transactionPassword)
|
|
3147
3154
|
}
|
|
3148
3155
|
});
|
|
3149
|
-
if (!
|
|
3156
|
+
if (!r.ok) return r;
|
|
3150
3157
|
}
|
|
3151
3158
|
if (e.type === "GCASH") {
|
|
3152
|
-
const
|
|
3159
|
+
const r = await this.walletService.createGCashWithdrawal({
|
|
3153
3160
|
input: {
|
|
3154
3161
|
id: t,
|
|
3155
3162
|
amount: e.amount.toString(),
|
|
@@ -3157,10 +3164,10 @@ class $t {
|
|
|
3157
3164
|
recipientMobileNumber: this.addAreaCode(e.recipientMobileNumber)
|
|
3158
3165
|
}
|
|
3159
3166
|
});
|
|
3160
|
-
if (!
|
|
3167
|
+
if (!r.ok) return r;
|
|
3161
3168
|
}
|
|
3162
3169
|
if (e.type === "MAYA") {
|
|
3163
|
-
const
|
|
3170
|
+
const r = await this.walletService.createMayaWithdrawal({
|
|
3164
3171
|
input: {
|
|
3165
3172
|
id: t,
|
|
3166
3173
|
amount: e.amount.toString(),
|
|
@@ -3168,17 +3175,17 @@ class $t {
|
|
|
3168
3175
|
recipientMobileNumber: this.addAreaCode(e.recipientMobileNumber)
|
|
3169
3176
|
}
|
|
3170
3177
|
});
|
|
3171
|
-
if (!
|
|
3178
|
+
if (!r.ok) return r;
|
|
3172
3179
|
}
|
|
3173
3180
|
if (e.type === "MAYA_APP") {
|
|
3174
|
-
const
|
|
3181
|
+
const r = await this.walletService.createMayaAppWithdrawal({
|
|
3175
3182
|
input: {
|
|
3176
3183
|
id: t,
|
|
3177
3184
|
amount: e.amount.toString(),
|
|
3178
3185
|
transactionPassword: await g(e.transactionPassword)
|
|
3179
3186
|
}
|
|
3180
3187
|
});
|
|
3181
|
-
if (!
|
|
3188
|
+
if (!r.ok) return r;
|
|
3182
3189
|
}
|
|
3183
3190
|
return { ok: !0, data: { id: t } };
|
|
3184
3191
|
}
|
|
@@ -3187,9 +3194,9 @@ class $t {
|
|
|
3187
3194
|
return t.ok ? {
|
|
3188
3195
|
ok: !0,
|
|
3189
3196
|
data: {
|
|
3190
|
-
withdrawalRecords: t.data.edges.map(({ cursor:
|
|
3191
|
-
...this.transformer.transform.withdrawalRecord(
|
|
3192
|
-
cursor:
|
|
3197
|
+
withdrawalRecords: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3198
|
+
...this.transformer.transform.withdrawalRecord(a),
|
|
3199
|
+
cursor: r
|
|
3193
3200
|
})),
|
|
3194
3201
|
totalCount: t.data.totalCount,
|
|
3195
3202
|
endCursor: t.data.pageInfo.endCursor ?? void 0,
|
|
@@ -3223,36 +3230,36 @@ class $t {
|
|
|
3223
3230
|
* ```
|
|
3224
3231
|
*/
|
|
3225
3232
|
async createDeposit(e) {
|
|
3226
|
-
const t = e.id ??
|
|
3233
|
+
const t = e.id ?? S.generate(b.Deposit).toString();
|
|
3227
3234
|
if (e.type === "MAYA") {
|
|
3228
|
-
const
|
|
3235
|
+
const r = await this.walletService.createMayaDeposit({
|
|
3229
3236
|
input: {
|
|
3230
3237
|
id: t,
|
|
3231
3238
|
amount: e.amount.toString(),
|
|
3232
3239
|
promo: e.promo
|
|
3233
3240
|
}
|
|
3234
3241
|
});
|
|
3235
|
-
if (!
|
|
3242
|
+
if (!r.ok) return r;
|
|
3236
3243
|
}
|
|
3237
3244
|
if (e.type === "MAYA_APP") {
|
|
3238
|
-
const
|
|
3245
|
+
const r = await this.walletService.createMayaAppDeposit({
|
|
3239
3246
|
input: {
|
|
3240
3247
|
id: t,
|
|
3241
3248
|
amount: e.amount.toString(),
|
|
3242
3249
|
promo: e.promo
|
|
3243
3250
|
}
|
|
3244
3251
|
});
|
|
3245
|
-
if (!
|
|
3252
|
+
if (!r.ok) return r;
|
|
3246
3253
|
}
|
|
3247
3254
|
if (e.type === "GCASH") {
|
|
3248
|
-
const
|
|
3255
|
+
const r = await this.walletService.createGCashDeposit({
|
|
3249
3256
|
input: {
|
|
3250
3257
|
id: t,
|
|
3251
3258
|
amount: e.amount.toString(),
|
|
3252
3259
|
promo: e.promo
|
|
3253
3260
|
}
|
|
3254
3261
|
});
|
|
3255
|
-
if (!
|
|
3262
|
+
if (!r.ok) return r;
|
|
3256
3263
|
}
|
|
3257
3264
|
return { ok: !0, data: { id: t } };
|
|
3258
3265
|
}
|
|
@@ -3268,9 +3275,9 @@ class $t {
|
|
|
3268
3275
|
return t.ok ? {
|
|
3269
3276
|
ok: !0,
|
|
3270
3277
|
data: {
|
|
3271
|
-
depositRecords: t.data.edges.map(({ cursor:
|
|
3272
|
-
...this.transformer.transform.depositRecord(
|
|
3273
|
-
cursor:
|
|
3278
|
+
depositRecords: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3279
|
+
...this.transformer.transform.depositRecord(a),
|
|
3280
|
+
cursor: r
|
|
3274
3281
|
})),
|
|
3275
3282
|
totalCount: t.data.totalCount,
|
|
3276
3283
|
endCursor: t.data.pageInfo.endCursor ?? void 0,
|
|
@@ -3287,16 +3294,16 @@ class $t {
|
|
|
3287
3294
|
/*+----------------------------------------+*/
|
|
3288
3295
|
/**/
|
|
3289
3296
|
async betRecords(e) {
|
|
3290
|
-
var
|
|
3297
|
+
var r, a;
|
|
3291
3298
|
const t = await this.reportService.betRecords({
|
|
3292
3299
|
...e,
|
|
3293
3300
|
...(e == null ? void 0 : e.filter) && {
|
|
3294
3301
|
filter: {
|
|
3295
3302
|
...e.filter,
|
|
3296
|
-
...((
|
|
3303
|
+
...((r = e.filter) == null ? void 0 : r.gameType) && {
|
|
3297
3304
|
game__type: e.filter.gameType
|
|
3298
3305
|
},
|
|
3299
|
-
...((
|
|
3306
|
+
...((a = e.filter) == null ? void 0 : a.gameProvider) && {
|
|
3300
3307
|
game__provider: e.filter.gameProvider
|
|
3301
3308
|
}
|
|
3302
3309
|
}
|
|
@@ -3332,9 +3339,9 @@ class $t {
|
|
|
3332
3339
|
return t.ok ? {
|
|
3333
3340
|
ok: !0,
|
|
3334
3341
|
data: {
|
|
3335
|
-
transactionRecords: t.data.edges.map(({ cursor:
|
|
3336
|
-
...this.transformer.transform.transactionRecord(
|
|
3337
|
-
cursor:
|
|
3342
|
+
transactionRecords: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3343
|
+
...this.transformer.transform.transactionRecord(a),
|
|
3344
|
+
cursor: r
|
|
3338
3345
|
})),
|
|
3339
3346
|
totalCount: t.data.totalCount,
|
|
3340
3347
|
endCursor: t.data.pageInfo.endCursor ?? void 0,
|
|
@@ -3407,9 +3414,9 @@ class $t {
|
|
|
3407
3414
|
return t.ok ? {
|
|
3408
3415
|
ok: !0,
|
|
3409
3416
|
data: {
|
|
3410
|
-
games: t.data.edges.map(({ cursor:
|
|
3411
|
-
...this.transformer.transform.game(
|
|
3412
|
-
cursor:
|
|
3417
|
+
games: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3418
|
+
...this.transformer.transform.game(a),
|
|
3419
|
+
cursor: r
|
|
3413
3420
|
})),
|
|
3414
3421
|
totalCount: t.data.totalCount,
|
|
3415
3422
|
hasNextPage: t.data.pageInfo.hasNextPage,
|
|
@@ -3422,9 +3429,9 @@ class $t {
|
|
|
3422
3429
|
return t.ok ? {
|
|
3423
3430
|
ok: !0,
|
|
3424
3431
|
data: {
|
|
3425
|
-
games: t.data.edges.map(({ cursor:
|
|
3426
|
-
...this.transformer.transform.game__next(
|
|
3427
|
-
cursor:
|
|
3432
|
+
games: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3433
|
+
...this.transformer.transform.game__next(a),
|
|
3434
|
+
cursor: r
|
|
3428
3435
|
})),
|
|
3429
3436
|
totalCount: t.data.totalCount,
|
|
3430
3437
|
hasNextPage: t.data.pageInfo.hasNextPage,
|
|
@@ -3438,9 +3445,9 @@ class $t {
|
|
|
3438
3445
|
return t.ok ? {
|
|
3439
3446
|
ok: !0,
|
|
3440
3447
|
data: {
|
|
3441
|
-
games: t.data.edges.map(({ cursor:
|
|
3442
|
-
...this.transformer.transform.game(
|
|
3443
|
-
cursor:
|
|
3448
|
+
games: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3449
|
+
...this.transformer.transform.game(a),
|
|
3450
|
+
cursor: r
|
|
3444
3451
|
})),
|
|
3445
3452
|
totalCount: t.data.totalCount,
|
|
3446
3453
|
hasNextPage: t.data.pageInfo.hasNextPage,
|
|
@@ -3488,11 +3495,11 @@ class $t {
|
|
|
3488
3495
|
ok: !0,
|
|
3489
3496
|
data: this.transformer.transform.gameSession(t.data)
|
|
3490
3497
|
};
|
|
3491
|
-
const
|
|
3492
|
-
return
|
|
3498
|
+
const r = await this.gameService.gameSession({ id: e });
|
|
3499
|
+
return r.ok ? {
|
|
3493
3500
|
ok: !0,
|
|
3494
|
-
data:
|
|
3495
|
-
} :
|
|
3501
|
+
data: r.data ? this.transformer.transform.gameSession(r.data) : null
|
|
3502
|
+
} : r;
|
|
3496
3503
|
}
|
|
3497
3504
|
/**
|
|
3498
3505
|
* @deprecated use `createGameSession__next`
|
|
@@ -3511,18 +3518,18 @@ class $t {
|
|
|
3511
3518
|
* ```
|
|
3512
3519
|
*/
|
|
3513
3520
|
async createGameSession(e) {
|
|
3514
|
-
const t = e.id ??
|
|
3515
|
-
return
|
|
3521
|
+
const t = e.id ?? S.generate(b.GameSession).toString(), r = await this.walletService.createGameSession({ input: { id: t, game: e.game } });
|
|
3522
|
+
return r.ok ? { ok: !0, data: { id: t } } : r;
|
|
3516
3523
|
}
|
|
3517
3524
|
/** @deprecated use `createGameSession__next` */
|
|
3518
3525
|
async createGameSession__legacy(e) {
|
|
3519
|
-
const t = e.id ??
|
|
3520
|
-
return
|
|
3526
|
+
const t = e.id ?? S.generate(b.GameSession).toString(), r = await this.gameService.createGameSession({ input: { id: t, game: e.game } });
|
|
3527
|
+
return r.ok ? { ok: !0, data: { id: t } } : r;
|
|
3521
3528
|
}
|
|
3522
3529
|
async createGameSession__next(e) {
|
|
3523
|
-
const t = e.id ??
|
|
3530
|
+
const t = e.id ?? S.generate(b.GameSession).toString();
|
|
3524
3531
|
if (e.game.startsWith("SPORTS:")) {
|
|
3525
|
-
const p = await
|
|
3532
|
+
const p = await S.generateFromKey(b.Game, e.game).then(
|
|
3526
3533
|
(f) => f.toString()
|
|
3527
3534
|
), u = await this.gameService.createGameSession({
|
|
3528
3535
|
input: {
|
|
@@ -3532,8 +3539,8 @@ class $t {
|
|
|
3532
3539
|
});
|
|
3533
3540
|
return u.ok ? { ok: !0, data: { id: t } } : u;
|
|
3534
3541
|
}
|
|
3535
|
-
const
|
|
3536
|
-
if (!
|
|
3542
|
+
const r = await this.game__next(e.game);
|
|
3543
|
+
if (!r.data)
|
|
3537
3544
|
return {
|
|
3538
3545
|
ok: !1,
|
|
3539
3546
|
error: {
|
|
@@ -3543,9 +3550,9 @@ class $t {
|
|
|
3543
3550
|
};
|
|
3544
3551
|
const {
|
|
3545
3552
|
/**/
|
|
3546
|
-
provider:
|
|
3553
|
+
provider: a,
|
|
3547
3554
|
externalId: s
|
|
3548
|
-
} =
|
|
3555
|
+
} = r.data, c = Pt.includes(a) ? await this.walletService.createGameSession({ input: { id: t, game: s } }) : await this.gameService.createGameSession({ input: { id: t, game: s } });
|
|
3549
3556
|
return c.ok ? { ok: !0, data: { id: t } } : c;
|
|
3550
3557
|
}
|
|
3551
3558
|
/** @deprecated use `endGameSession__next` */
|
|
@@ -3588,13 +3595,13 @@ class $t {
|
|
|
3588
3595
|
* ```
|
|
3589
3596
|
*/
|
|
3590
3597
|
async uploadImageFile(e) {
|
|
3591
|
-
const t = e.id ??
|
|
3598
|
+
const t = e.id ?? S.generate(b.File).toString(), r = await this.fileService.uploadPrivateImageFile({
|
|
3592
3599
|
input: {
|
|
3593
3600
|
id: t,
|
|
3594
3601
|
file: e.file
|
|
3595
3602
|
}
|
|
3596
3603
|
});
|
|
3597
|
-
return
|
|
3604
|
+
return r.ok ? { ok: !0, data: { id: t } } : r;
|
|
3598
3605
|
}
|
|
3599
3606
|
/**/
|
|
3600
3607
|
/*+----------------------------------------+*/
|
|
@@ -3620,9 +3627,9 @@ class $t {
|
|
|
3620
3627
|
return t.ok ? {
|
|
3621
3628
|
ok: !0,
|
|
3622
3629
|
data: {
|
|
3623
|
-
pointsWalletTransactions: t.data.edges.map(({ cursor:
|
|
3624
|
-
...this.transformer.transform.pointsWalletTransaction(
|
|
3625
|
-
cursor:
|
|
3630
|
+
pointsWalletTransactions: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3631
|
+
...this.transformer.transform.pointsWalletTransaction(a),
|
|
3632
|
+
cursor: r
|
|
3626
3633
|
})),
|
|
3627
3634
|
totalCount: t.data.totalCount,
|
|
3628
3635
|
hasNextPage: t.data.pageInfo.hasNextPage,
|
|
@@ -3640,9 +3647,9 @@ class $t {
|
|
|
3640
3647
|
return t.ok ? {
|
|
3641
3648
|
ok: !0,
|
|
3642
3649
|
data: {
|
|
3643
|
-
activityRecords: t.data.edges.map(({ cursor:
|
|
3644
|
-
...this.transformer.transform.activityRecord(
|
|
3645
|
-
cursor:
|
|
3650
|
+
activityRecords: t.data.edges.map(({ cursor: r, node: a }) => ({
|
|
3651
|
+
...this.transformer.transform.activityRecord(a),
|
|
3652
|
+
cursor: r
|
|
3646
3653
|
})),
|
|
3647
3654
|
totalCount: t.data.totalCount,
|
|
3648
3655
|
hasNextPage: t.data.pageInfo.hasNextPage,
|
|
@@ -3666,7 +3673,7 @@ const Pt = [
|
|
|
3666
3673
|
];
|
|
3667
3674
|
export {
|
|
3668
3675
|
Ot as ObjectId,
|
|
3669
|
-
|
|
3676
|
+
b as ObjectType,
|
|
3670
3677
|
$t as Sdk
|
|
3671
3678
|
};
|
|
3672
3679
|
//# sourceMappingURL=index.mjs.map
|