@opexa/portal-sdk 0.0.70 → 0.0.72

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.mjs CHANGED
@@ -1,9 +1,9 @@
1
- var _e = Object.defineProperty;
2
- var Te = (n, e, t) => e in n ? _e(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var m = (n, e, t) => Te(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { ObjectId as E } from "@opexa/object-id";
5
- import { ObjectId as Vt } from "@opexa/object-id";
6
- const b = {
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
+ import { ObjectId as Ht } from "@opexa/object-id";
6
+ const A = {
7
7
  Account: 8,
8
8
  Deposit: 9,
9
9
  Withdrawal: 14,
@@ -38,7 +38,7 @@ const L = o`
38
38
  }
39
39
  }
40
40
  }
41
- `, Me = o`
41
+ `, Ne = o`
42
42
  mutation UploadPrivateImageFile($input: UploadFileInput!) {
43
43
  uploadPrivateImageFile(input: $input) {
44
44
  ... on FileFormatNotSupportedError {
@@ -52,7 +52,7 @@ const L = o`
52
52
  }
53
53
  }
54
54
  }
55
- `, Ne = o`
55
+ `, Me = o`
56
56
  query Wallet {
57
57
  wallet {
58
58
  id
@@ -139,7 +139,7 @@ const L = o`
139
139
  }
140
140
  }
141
141
  }
142
- `, Ee = o`
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
- `, be = o`
154
+ `, Ae = o`
155
155
  mutation CreateGameSession($input: CreateGameSessionInput!) {
156
156
  createGameSession(input: $input) {
157
157
  ... on GameDoesNotExistError {
@@ -270,7 +270,7 @@ const L = o`
270
270
  }
271
271
  }
272
272
  }
273
- `, We = o`
273
+ `, Ue = o`
274
274
  mutation CreateGCashWithdrawal($input: CreateGCashWithdrawalInput!) {
275
275
  createGCashWithdrawal(input: $input) {
276
276
  ... on AccountNotVerifiedError {
@@ -293,7 +293,7 @@ const L = o`
293
293
  }
294
294
  }
295
295
  }
296
- `, Ue = o`
296
+ `, We = o`
297
297
  mutation CreateMayaWithdrawal($input: CreateMayaWithdrawalInput!) {
298
298
  createMayaWithdrawal(input: $input) {
299
299
  ... on AccountNotVerifiedError {
@@ -639,7 +639,7 @@ const L = o`
639
639
  ...PromoFragment
640
640
  }
641
641
  }
642
- `, Ae = o`
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
- ${Ae}
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
- ${Ae}
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 RegisterMemberAccountNext(
810
+ mutation RegisterMemberAccount(
811
811
  $input: RegisterMemberAccountInput_next!
812
812
  $reCAPTCHAResponse: String
813
813
  ) {
814
- registerMemberAccount_next(input: $input, reCAPTCHAResponse: $reCAPTCHAResponse) {
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
- `, mt = o`
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
- `, dt = o`
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
- `, Et = o`
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
- `, bt = o`
1045
+ `, At = o`
1043
1046
  query ReferralCode {
1044
1047
  referralCode
1045
1048
  }
1046
- `, At = o`
1049
+ `, Et = o`
1047
1050
  mutation UpdateReferralCode($input: UpdateReferralCodeInput!) {
1048
1051
  updateReferralCode(input: $input) {
1049
1052
  ... on ReferralCodeNotAvailableError {
@@ -1051,8 +1054,42 @@ const L = o`
1051
1054
  }
1052
1055
  }
1053
1056
  }
1057
+ `, kt = o`
1058
+ query Referrals($first: Int, $after: Cursor, $filter: ReferralFilterInput) {
1059
+ member {
1060
+ referrals(first: $first, after: $after, filter: $filter) {
1061
+ edges {
1062
+ cursor
1063
+ node {
1064
+ ... on Referral {
1065
+ id
1066
+ upline {
1067
+ id
1068
+ name
1069
+ realName
1070
+ }
1071
+ downline {
1072
+ id
1073
+ name
1074
+ realName
1075
+ }
1076
+ level
1077
+ turnover
1078
+ commission
1079
+ dateTimeCreated
1080
+ }
1081
+ }
1082
+ }
1083
+ totalCount
1084
+ pageInfo {
1085
+ hasNextPage
1086
+ endCursor
1087
+ }
1088
+ }
1089
+ }
1090
+ }
1054
1091
  `;
1055
- function d(n) {
1092
+ function m(n) {
1056
1093
  return {
1057
1094
  name: n,
1058
1095
  message: {
@@ -1107,9 +1144,9 @@ function d(n) {
1107
1144
  }[n]
1108
1145
  };
1109
1146
  }
1110
- class kt {
1147
+ class _t {
1111
1148
  constructor(e) {
1112
- m(this, "client");
1149
+ d(this, "client");
1113
1150
  this.client = e;
1114
1151
  }
1115
1152
  /** aka `Query.self` */
@@ -1124,25 +1161,25 @@ class kt {
1124
1161
  const t = await this.client.request(it, e);
1125
1162
  return t.ok ? t.data.registerMemberAccount ? {
1126
1163
  ok: !1,
1127
- error: d(t.data.registerMemberAccount.__typename)
1164
+ error: m(t.data.registerMemberAccount.__typename)
1128
1165
  } : {
1129
1166
  ok: !0
1130
1167
  } : t;
1131
1168
  }
1132
- async registerMemberAccountNext(e) {
1169
+ async registerMemberAccount__next(e) {
1133
1170
  const t = await this.client.request(st, e);
1134
- return t.ok ? t.data.registerMemberAccount_next ? {
1171
+ return t.ok ? t.data.registerMemberAccount ? {
1135
1172
  ok: !1,
1136
- error: d(t.data.registerMemberAccount_next.__typename)
1173
+ error: m(t.data.registerMemberAccount.__typename)
1137
1174
  } : {
1138
1175
  ok: !0
1139
1176
  } : t;
1140
1177
  }
1141
1178
  async updateMemberAccount(e) {
1142
- const t = await this.client.request(mt, e);
1179
+ const t = await this.client.request(dt, e);
1143
1180
  return t.ok ? t.data.updateMemberAccount ? {
1144
1181
  ok: !1,
1145
- error: d(t.data.updateMemberAccount.__typename)
1182
+ error: m(t.data.updateMemberAccount.__typename)
1146
1183
  } : {
1147
1184
  ok: !0
1148
1185
  } : t;
@@ -1161,12 +1198,12 @@ class kt {
1161
1198
  }
1162
1199
  async resetPassword(e) {
1163
1200
  const t = await this.client.request(
1164
- dt,
1201
+ mt,
1165
1202
  e
1166
1203
  );
1167
1204
  return t.ok ? t.data.resetPassword ? {
1168
1205
  ok: !1,
1169
- error: d(t.data.resetPassword.__typename)
1206
+ error: m(t.data.resetPassword.__typename)
1170
1207
  } : {
1171
1208
  ok: !0
1172
1209
  } : t;
@@ -1182,7 +1219,7 @@ class kt {
1182
1219
  const t = await this.client.request(yt, e);
1183
1220
  return t.ok ? t.data.sendVerificationCode ? {
1184
1221
  ok: !1,
1185
- error: d(t.data.sendVerificationCode.__typename)
1222
+ error: m(t.data.sendVerificationCode.__typename)
1186
1223
  } : {
1187
1224
  ok: !0
1188
1225
  } : t;
@@ -1191,7 +1228,7 @@ class kt {
1191
1228
  const t = await this.client.request(lt, e);
1192
1229
  return t.ok ? t.data.verifyMobileNumber ? {
1193
1230
  ok: !1,
1194
- error: d(t.data.verifyMobileNumber.__typename)
1231
+ error: m(t.data.verifyMobileNumber.__typename)
1195
1232
  } : {
1196
1233
  ok: !0
1197
1234
  } : t;
@@ -1200,7 +1237,7 @@ class kt {
1200
1237
  const t = await this.client.request(pt, e);
1201
1238
  return t.ok ? t.data.createMemberVerification ? {
1202
1239
  ok: !1,
1203
- error: d(t.data.createMemberVerification.__typename)
1240
+ error: m(t.data.createMemberVerification.__typename)
1204
1241
  } : {
1205
1242
  ok: !0
1206
1243
  } : t;
@@ -1209,7 +1246,7 @@ class kt {
1209
1246
  const t = await this.client.request(ft, e);
1210
1247
  return t.ok ? t.data.updateMemberVerification ? {
1211
1248
  ok: !1,
1212
- error: d(t.data.updateMemberVerification.__typename)
1249
+ error: m(t.data.updateMemberVerification.__typename)
1213
1250
  } : {
1214
1251
  ok: !0
1215
1252
  } : t;
@@ -1235,32 +1272,32 @@ class kt {
1235
1272
  const t = await this.client.request(ct, e);
1236
1273
  return t.ok ? t.data.registerMayaMemberAccount ? {
1237
1274
  ok: !1,
1238
- error: d(t.data.registerMayaMemberAccount.__typename)
1275
+ error: m(t.data.registerMayaMemberAccount.__typename)
1239
1276
  } : {
1240
1277
  ok: !0
1241
1278
  } : t;
1242
1279
  }
1243
1280
  async referralCode() {
1244
- const e = await this.client.request(bt);
1281
+ const e = await this.client.request(At);
1245
1282
  return e.ok ? {
1246
1283
  ok: !0,
1247
1284
  data: e.data.referralCode
1248
1285
  } : e;
1249
1286
  }
1250
1287
  async updateReferralCode(e) {
1251
- const t = await this.client.request(At, e);
1288
+ const t = await this.client.request(Et, e);
1252
1289
  return t.ok ? t.data.updateReferralCode ? {
1253
1290
  ok: !1,
1254
- error: d(t.data.updateReferralCode.__typename)
1291
+ error: m(t.data.updateReferralCode.__typename)
1255
1292
  } : {
1256
1293
  ok: !0
1257
1294
  } : t;
1258
1295
  }
1259
1296
  }
1260
- function k(n) {
1297
+ function E(n) {
1261
1298
  return n.startsWith("+63") ? n : n.startsWith("63") ? `+${n}` : n.startsWith("0") ? `+63${n.substring(1)}` : `+63${n}`;
1262
1299
  }
1263
- function h(n, e) {
1300
+ function f(n, e) {
1264
1301
  const t = V[n] ? V[n] : V[500];
1265
1302
  return {
1266
1303
  name: t.name,
@@ -1278,22 +1315,22 @@ const V = {
1278
1315
  };
1279
1316
  class Ct {
1280
1317
  constructor(e) {
1281
- m(this, "url");
1282
- m(this, "platform");
1318
+ d(this, "url");
1319
+ d(this, "platform");
1283
1320
  this.url = e.url, this.platform = e.platform;
1284
1321
  }
1322
+ get headers() {
1323
+ const e = new Headers();
1324
+ 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;
1325
+ }
1285
1326
  async createSession(e) {
1286
- const t = new Headers({
1287
- "Content-Type": "application/json",
1288
- "Platform-Code": this.platform,
1289
- Role: "MEMBER"
1290
- });
1327
+ const t = new Headers(this.headers);
1291
1328
  if (e.name) {
1292
1329
  const r = `${e.name}:${e.password}`, a = Buffer.from(r).toString("base64");
1293
1330
  t.set("Authorization", `Basic ${a}`);
1294
1331
  }
1295
1332
  if (e.mobileNumber) {
1296
- const a = `${k(e.mobileNumber)}:${e.authenticationCode}`, s = Buffer.from(a).toString("base64");
1333
+ const a = `${E(e.mobileNumber)}:${e.authenticationCode}`, s = Buffer.from(a).toString("base64");
1297
1334
  console.log(`MobileNumberOTP ${s}`), t.set("Authorization", `MobileNumberOTP ${s}`);
1298
1335
  }
1299
1336
  e.sessionId && t.set("Authorization", `MayaSession ${e.sessionId}`);
@@ -1307,24 +1344,20 @@ class Ct {
1307
1344
  data: a
1308
1345
  } : a.code === "ACCOUNT_BLACKLISTED" ? {
1309
1346
  ok: !1,
1310
- error: d("AccountBlacklisted")
1347
+ error: m("AccountBlacklisted")
1311
1348
  } : {
1312
1349
  ok: !1,
1313
- error: h(r.status)
1350
+ error: f(r.status)
1314
1351
  };
1315
1352
  } catch {
1316
1353
  return {
1317
1354
  ok: !1,
1318
- error: h(500)
1355
+ error: f(500)
1319
1356
  };
1320
1357
  }
1321
1358
  }
1322
1359
  async authenticate(e) {
1323
- const t = new Headers({
1324
- "Content-Type": "application/json",
1325
- "Platform-Code": this.platform,
1326
- Role: "MEMBER"
1327
- });
1360
+ const t = new Headers(this.headers);
1328
1361
  if (e.type === "SECURITY_QUESTION") {
1329
1362
  t.set("Authorization", `Bearer ${e.token}`);
1330
1363
  try {
@@ -1340,92 +1373,82 @@ class Ct {
1340
1373
  data: a
1341
1374
  } : r.status === 401 || r.status === 403 ? {
1342
1375
  ok: !1,
1343
- error: d("InvalidTokenOrSecretAnswer")
1376
+ error: m("InvalidTokenOrSecretAnswer")
1344
1377
  } : {
1345
1378
  ok: !1,
1346
- error: h(r.status)
1379
+ error: f(r.status)
1347
1380
  };
1348
1381
  } catch {
1349
1382
  return {
1350
1383
  ok: !1,
1351
- error: h(500)
1384
+ error: f(500)
1352
1385
  };
1353
1386
  }
1354
1387
  }
1355
1388
  throw new Error("Invalid input 'type'");
1356
1389
  }
1357
1390
  async refreshSession(e) {
1391
+ const t = new Headers(this.headers);
1392
+ t.append("Authorization", `Bearer ${e}`);
1358
1393
  try {
1359
- const t = await fetch(`${this.url}/session:refresh`, {
1394
+ const r = await fetch(`${this.url}/session:refresh`, {
1360
1395
  method: "POST",
1361
- headers: {
1362
- "Content-Type": "application/json",
1363
- "Platform-Code": this.platform,
1364
- Role: "MEMBER",
1365
- Authorization: `Bearer ${e}`
1366
- }
1367
- }), r = await t.json();
1368
- return t.ok ? {
1396
+ headers: t
1397
+ }), a = await r.json();
1398
+ return r.ok ? {
1369
1399
  ok: !0,
1370
- data: r
1371
- } : r.code === "ACCOUNT_BLACKLISTED" ? {
1400
+ data: a
1401
+ } : a.code === "ACCOUNT_BLACKLISTED" ? {
1372
1402
  ok: !1,
1373
- error: d("AccountBlacklisted")
1374
- } : t.status === 403 || t.status === 401 ? {
1403
+ error: m("AccountBlacklisted")
1404
+ } : r.status === 403 || r.status === 401 ? {
1375
1405
  ok: !1,
1376
- error: d("InvalidToken")
1406
+ error: m("InvalidToken")
1377
1407
  } : {
1378
1408
  ok: !1,
1379
- error: h(t.status)
1409
+ error: f(r.status)
1380
1410
  };
1381
1411
  } catch {
1382
1412
  return {
1383
1413
  ok: !1,
1384
- error: h(500)
1414
+ error: f(500)
1385
1415
  };
1386
1416
  }
1387
1417
  }
1388
1418
  async destroySession(e) {
1419
+ const t = new Headers(this.headers);
1420
+ t.append("Authorization", `Bearer ${e}`);
1389
1421
  try {
1390
- const t = await fetch(`${this.url}/session`, {
1422
+ const r = await fetch(`${this.url}/session`, {
1391
1423
  method: "DELETE",
1392
- headers: {
1393
- "Content-Type": "application/json",
1394
- "Platform-Code": this.platform,
1395
- Role: "MEMBER",
1396
- Authorization: `Bearer ${e}`
1397
- }
1424
+ headers: t
1398
1425
  });
1399
- return t.ok ? { ok: !0 } : { ok: !1, error: h(t.status) };
1426
+ return r.ok ? { ok: !0 } : { ok: !1, error: f(r.status) };
1400
1427
  } catch {
1401
- return { ok: !1, error: h(500) };
1428
+ return { ok: !1, error: f(500) };
1402
1429
  }
1403
1430
  }
1404
1431
  async verifySession(e) {
1432
+ const t = new Headers(this.headers);
1433
+ t.append("Authorization", `Bearer ${e}`);
1405
1434
  try {
1406
1435
  return (await fetch(`${this.url}/session`, {
1407
1436
  method: "GET",
1408
- headers: {
1409
- "Content-Type": "application/json",
1410
- "Platform-Code": this.platform,
1411
- Role: "MEMBER",
1412
- Authorization: `Bearer ${e}`
1413
- }
1437
+ headers: t
1414
1438
  })).ok;
1415
1439
  } catch {
1416
1440
  return !0;
1417
1441
  }
1418
1442
  }
1443
+ /**
1444
+ * @deprecated use `sendOtp`
1445
+ */
1419
1446
  async sendVerificationCode(e) {
1420
- const t = k(e);
1447
+ const t = E(e);
1421
1448
  try {
1422
1449
  const r = await fetch(`${this.url}/sendVerificationCode`, {
1423
1450
  method: "POST",
1424
- headers: {
1425
- "Content-Type": "application/json",
1426
- "Platform-Code": this.platform,
1427
- Role: "MEMBER"
1428
- },
1451
+ headers: this.headers,
1429
1452
  body: JSON.stringify({
1430
1453
  channel: "SMS",
1431
1454
  recipient: t
@@ -1433,21 +1456,50 @@ class Ct {
1433
1456
  });
1434
1457
  return r.ok ? { ok: !0 } : {
1435
1458
  ok: !1,
1436
- error: h(r.status)
1459
+ error: f(r.status)
1437
1460
  };
1438
1461
  } catch {
1439
1462
  return {
1440
1463
  ok: !1,
1441
- error: h(500)
1464
+ error: f(500)
1465
+ };
1466
+ }
1467
+ }
1468
+ async sendVerificationCode__next(e) {
1469
+ const t = E(e);
1470
+ try {
1471
+ const r = await fetch(`${this.url}/otps`, {
1472
+ method: "POST",
1473
+ headers: this.headers,
1474
+ body: JSON.stringify({
1475
+ channel: "SMS",
1476
+ recipient: t
1477
+ })
1478
+ });
1479
+ if (r.status === 403) {
1480
+ const a = await r.json();
1481
+ return {
1482
+ ok: !1,
1483
+ error: f(r.status, a.message)
1484
+ };
1485
+ }
1486
+ return r.ok ? { ok: !0 } : {
1487
+ ok: !1,
1488
+ error: f(r.status)
1489
+ };
1490
+ } catch {
1491
+ return {
1492
+ ok: !1,
1493
+ error: f(500)
1442
1494
  };
1443
1495
  }
1444
1496
  }
1445
1497
  }
1446
- class _t {
1498
+ class Tt {
1447
1499
  constructor(e) {
1448
- m(this, "url");
1449
- m(this, "siteId");
1450
- m(this, "platformId");
1500
+ d(this, "url");
1501
+ d(this, "siteId");
1502
+ d(this, "platformId");
1451
1503
  this.url = e.url, this.siteId = e.site, this.platformId = e.platform;
1452
1504
  }
1453
1505
  async self() {
@@ -1458,22 +1510,22 @@ class _t {
1458
1510
  } : e;
1459
1511
  }
1460
1512
  async games(e) {
1461
- var a, s, c, u, l, f, y, p, T, v, M, N, I, S, R, D, C, P, x, G, _, $, U, O;
1513
+ var a, s, c, u, l, h, y, p, T, v, N, M, I, S, R, D, _, P, x, G, C, $, W, O;
1462
1514
  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), (f = (l = e == null ? void 0 : e.filter) == null ? void 0 : l.type) != null && f.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 = (C = e == null ? void 0 : e.filter) == null ? void 0 : C.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()), ($ = (_ = e == null ? void 0 : e.filter) == null ? void 0 : _.tags) != null && $.in && t.set(
1515
+ 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), (M = (N = e == null ? void 0 : e.filter) == null ? void 0 : N.provider) != null && M.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
1516
  "filter[tags][in]",
1465
- e.filter.tags.in.map((A) => A.toLowerCase()).join(",")
1466
- ), (O = (U = e == null ? void 0 : e.filter) == null ? void 0 : U.tags) != null && O.notIn && t.set(
1517
+ e.filter.tags.in.map((k) => k.toLowerCase()).join(",")
1518
+ ), (O = (W = e == null ? void 0 : e.filter) == null ? void 0 : W.tags) != null && O.notIn && t.set(
1467
1519
  "filter[tags][nin]",
1468
- e.filter.tags.notIn.map((A) => A.toLowerCase()).join(",")
1520
+ e.filter.tags.notIn.map((k) => k.toLowerCase()).join(",")
1469
1521
  );
1470
1522
  const r = await this.getJson("/games", t);
1471
1523
  return r.ok ? {
1472
1524
  ok: !0,
1473
1525
  data: {
1474
- edges: r.data.data.map((A) => ({
1475
- node: A,
1476
- cursor: A.cursor
1526
+ edges: r.data.data.map((k) => ({
1527
+ node: k,
1528
+ cursor: k.cursor
1477
1529
  })),
1478
1530
  totalCount: r.data.totalCount ?? 0,
1479
1531
  pageInfo: {
@@ -1511,19 +1563,19 @@ class _t {
1511
1563
  data: await a.json()
1512
1564
  } : {
1513
1565
  ok: !1,
1514
- error: h(a.status)
1566
+ error: f(a.status)
1515
1567
  };
1516
1568
  } catch {
1517
1569
  return {
1518
1570
  ok: !1,
1519
- error: h(500)
1571
+ error: f(500)
1520
1572
  };
1521
1573
  }
1522
1574
  }
1523
1575
  }
1524
- class Tt {
1576
+ class vt {
1525
1577
  constructor(e) {
1526
- m(this, "client");
1578
+ d(this, "client");
1527
1579
  this.client = e;
1528
1580
  }
1529
1581
  async file(e) {
@@ -1534,18 +1586,18 @@ class Tt {
1534
1586
  } : t;
1535
1587
  }
1536
1588
  async uploadPrivateImageFile(e) {
1537
- const t = await this.client.upload(Me, e);
1589
+ const t = await this.client.upload(Ne, e);
1538
1590
  return t.ok ? t.data.uploadPrivateImageFile ? {
1539
1591
  ok: !1,
1540
- error: d(t.data.uploadPrivateImageFile.__typename)
1592
+ error: m(t.data.uploadPrivateImageFile.__typename)
1541
1593
  } : {
1542
1594
  ok: !0
1543
1595
  } : t;
1544
1596
  }
1545
1597
  }
1546
- class vt {
1598
+ class Nt {
1547
1599
  constructor(e) {
1548
- m(this, "client");
1600
+ d(this, "client");
1549
1601
  this.client = e;
1550
1602
  }
1551
1603
  /** @deprecated */
@@ -1563,16 +1615,16 @@ class vt {
1563
1615
  }
1564
1616
  async gameSession(e) {
1565
1617
  const t = await this.client.request(
1566
- Ee,
1618
+ be,
1567
1619
  e
1568
1620
  );
1569
1621
  return t.ok ? { ok: !0, data: t.data.node } : t;
1570
1622
  }
1571
1623
  async createGameSession(e) {
1572
- const t = await this.client.request(be, e);
1624
+ const t = await this.client.request(Ae, e);
1573
1625
  return t.ok ? t.data.createGameSession ? {
1574
1626
  ok: !1,
1575
- error: d(t.data.createGameSession.__typename)
1627
+ error: m(t.data.createGameSession.__typename)
1576
1628
  } : {
1577
1629
  ok: !0
1578
1630
  } : t;
@@ -1581,7 +1633,7 @@ class vt {
1581
1633
  const t = await this.client.request(xe, e);
1582
1634
  return t.ok ? t.data.endGameSession ? {
1583
1635
  ok: !1,
1584
- error: d(t.data.endGameSession.__typename)
1636
+ error: m(t.data.endGameSession.__typename)
1585
1637
  } : {
1586
1638
  ok: !0
1587
1639
  } : t;
@@ -1589,7 +1641,7 @@ class vt {
1589
1641
  }
1590
1642
  class Mt {
1591
1643
  constructor(e) {
1592
- m(this, "client");
1644
+ d(this, "client");
1593
1645
  this.client = e;
1594
1646
  }
1595
1647
  async latestBetRecords() {
@@ -1600,9 +1652,9 @@ class Mt {
1600
1652
  } : e;
1601
1653
  }
1602
1654
  }
1603
- class Nt {
1655
+ class It {
1604
1656
  constructor(e) {
1605
- m(this, "client");
1657
+ d(this, "client");
1606
1658
  this.client = e;
1607
1659
  }
1608
1660
  async betRecords(e) {
@@ -1644,15 +1696,22 @@ class Nt {
1644
1696
  }
1645
1697
  async activityRecords(e) {
1646
1698
  const t = await this.client.request(
1647
- Et,
1699
+ bt,
1648
1700
  e
1649
1701
  );
1650
1702
  return t.ok ? { ok: t.ok, data: t.data.member.activityRecords } : t;
1651
1703
  }
1704
+ async referrals(e) {
1705
+ const t = await this.client.request(
1706
+ kt,
1707
+ e
1708
+ );
1709
+ return t.ok ? { ok: t.ok, data: t.data.member.referrals } : t;
1710
+ }
1652
1711
  }
1653
- class It {
1712
+ class Rt {
1654
1713
  constructor(e) {
1655
- m(this, "url");
1714
+ d(this, "url");
1656
1715
  this.url = e.url;
1657
1716
  }
1658
1717
  gameThumbnails(e) {
@@ -1662,9 +1721,9 @@ class It {
1662
1721
  ];
1663
1722
  }
1664
1723
  }
1665
- class Rt {
1724
+ class Dt {
1666
1725
  constructor(e) {
1667
- m(this, "client");
1726
+ d(this, "client");
1668
1727
  this.client = e;
1669
1728
  }
1670
1729
  async promos() {
@@ -1690,7 +1749,7 @@ class Rt {
1690
1749
  const t = await this.client.request(rt, e);
1691
1750
  return t.ok ? t.data.claimCashbackBonus ? {
1692
1751
  ok: !1,
1693
- error: d(t.data.claimCashbackBonus.__typename)
1752
+ error: m(t.data.claimCashbackBonus.__typename)
1694
1753
  } : {
1695
1754
  ok: !0
1696
1755
  } : {
@@ -1703,7 +1762,7 @@ class Rt {
1703
1762
  return e.ok ? { ok: e.ok, data: e.data.bonus } : e;
1704
1763
  }
1705
1764
  async wallet() {
1706
- const e = await this.client.request(Ne);
1765
+ const e = await this.client.request(Me);
1707
1766
  return e.ok ? { ok: e.ok, data: e.data.wallet } : e;
1708
1767
  }
1709
1768
  async deposit(e) {
@@ -1717,7 +1776,7 @@ class Rt {
1717
1776
  const t = await this.client.request(Le, e);
1718
1777
  return t.ok ? t.data.createGCashDeposit ? {
1719
1778
  ok: !1,
1720
- error: d(t.data.createGCashDeposit.__typename)
1779
+ error: m(t.data.createGCashDeposit.__typename)
1721
1780
  } : {
1722
1781
  ok: !0
1723
1782
  } : t;
@@ -1726,7 +1785,7 @@ class Rt {
1726
1785
  const t = await this.client.request(Ve, e);
1727
1786
  return t.ok ? t.data.createMayaDeposit ? {
1728
1787
  ok: !1,
1729
- error: d(t.data.createMayaDeposit.__typename)
1788
+ error: m(t.data.createMayaDeposit.__typename)
1730
1789
  } : {
1731
1790
  ok: !0
1732
1791
  } : t;
@@ -1735,25 +1794,25 @@ class Rt {
1735
1794
  const t = await this.client.request(He, e);
1736
1795
  return t.ok ? t.data.createMayaAppDeposit ? {
1737
1796
  ok: !1,
1738
- error: d(t.data.createMayaAppDeposit.__typename)
1797
+ error: m(t.data.createMayaAppDeposit.__typename)
1739
1798
  } : {
1740
1799
  ok: !0
1741
1800
  } : t;
1742
1801
  }
1743
1802
  async createGCashWithdrawal(e) {
1744
- const t = await this.client.request(We, e);
1803
+ const t = await this.client.request(Ue, e);
1745
1804
  return t.ok ? t.data.createGCashWithdrawal ? {
1746
1805
  ok: !1,
1747
- error: d(t.data.createGCashWithdrawal.__typename)
1806
+ error: m(t.data.createGCashWithdrawal.__typename)
1748
1807
  } : {
1749
1808
  ok: !0
1750
1809
  } : t;
1751
1810
  }
1752
1811
  async createMayaWithdrawal(e) {
1753
- const t = await this.client.request(Ue, e);
1812
+ const t = await this.client.request(We, e);
1754
1813
  return t.ok ? t.data.createMayaWithdrawal ? {
1755
1814
  ok: !1,
1756
- error: d(t.data.createMayaWithdrawal.__typename)
1815
+ error: m(t.data.createMayaWithdrawal.__typename)
1757
1816
  } : {
1758
1817
  ok: !0
1759
1818
  } : t;
@@ -1762,7 +1821,7 @@ class Rt {
1762
1821
  const t = await this.client.request(Oe, e);
1763
1822
  return t.ok ? t.data.createMayaAppWithdrawal ? {
1764
1823
  ok: !1,
1765
- error: d(t.data.createMayaAppWithdrawal.__typename)
1824
+ error: m(t.data.createMayaAppWithdrawal.__typename)
1766
1825
  } : {
1767
1826
  ok: !0
1768
1827
  } : t;
@@ -1771,7 +1830,7 @@ class Rt {
1771
1830
  const t = await this.client.request(Be, e);
1772
1831
  return t.ok ? t.data.createBankWithdrawal ? {
1773
1832
  ok: !1,
1774
- error: d(t.data.createBankWithdrawal.__typename)
1833
+ error: m(t.data.createBankWithdrawal.__typename)
1775
1834
  } : {
1776
1835
  ok: !0
1777
1836
  } : t;
@@ -1790,7 +1849,7 @@ class Rt {
1790
1849
  const t = await this.client.request(Re, e);
1791
1850
  return t.ok ? t.data.pointsToCashConversion ? {
1792
1851
  ok: !1,
1793
- error: d(t.data.pointsToCashConversion.__typename)
1852
+ error: m(t.data.pointsToCashConversion.__typename)
1794
1853
  } : {
1795
1854
  ok: !0
1796
1855
  } : t;
@@ -1817,16 +1876,16 @@ class Rt {
1817
1876
  }
1818
1877
  async gameSession(e) {
1819
1878
  const t = await this.client.request(
1820
- Ee,
1879
+ be,
1821
1880
  e
1822
1881
  );
1823
1882
  return t.ok ? { ok: !0, data: t.data.node } : t;
1824
1883
  }
1825
1884
  async createGameSession(e) {
1826
- const t = await this.client.request(be, e);
1885
+ const t = await this.client.request(Ae, e);
1827
1886
  return t.ok ? t.data.createGameSession ? {
1828
1887
  ok: !1,
1829
- error: d(t.data.createGameSession.__typename)
1888
+ error: m(t.data.createGameSession.__typename)
1830
1889
  } : {
1831
1890
  ok: !0
1832
1891
  } : t;
@@ -1861,18 +1920,18 @@ class Rt {
1861
1920
  } : e;
1862
1921
  }
1863
1922
  }
1864
- function Dt(n, e, t) {
1923
+ function Pt(n, e, t) {
1865
1924
  return n < e ? e : n > t ? t : n;
1866
1925
  }
1867
1926
  function H(n) {
1868
1927
  return Object.prototype.toString.call(n) === "[object Object]" && Object(n) === n;
1869
1928
  }
1870
- function Pt(n) {
1929
+ function xt(n) {
1871
1930
  const e = [];
1872
1931
  function t(r, a = []) {
1873
1932
  for (const s in r) {
1874
1933
  const c = r[s];
1875
- H(c) ? t(c, [...a, s]) : Array.isArray(c) ? t(xt(c), [...a, s]) : e.push({
1934
+ H(c) ? t(c, [...a, s]) : Array.isArray(c) ? t(Gt(c), [...a, s]) : e.push({
1876
1935
  key: [...a, s],
1877
1936
  value: c
1878
1937
  });
@@ -1880,14 +1939,14 @@ function Pt(n) {
1880
1939
  }
1881
1940
  return t(n), e;
1882
1941
  }
1883
- function xt(n) {
1942
+ function Gt(n) {
1884
1943
  return n.reduce((e, t, r) => (e[r] = t, e), {});
1885
1944
  }
1886
- class W {
1945
+ class U {
1887
1946
  constructor(e, t) {
1888
- m(this, "url");
1889
- m(this, "options");
1890
- m(this, "middlewares");
1947
+ d(this, "url");
1948
+ d(this, "options");
1949
+ d(this, "middlewares");
1891
1950
  var a;
1892
1951
  const r = new Headers((a = t == null ? void 0 : t.fetchOptions) == null ? void 0 : a.headers);
1893
1952
  this.url = e, this.options = { ...t == null ? void 0 : t.fetchOptions, headers: r }, this.middlewares = (t == null ? void 0 : t.middlewares) ?? [];
@@ -1924,11 +1983,11 @@ class W {
1924
1983
  try {
1925
1984
  const l = await fetch(e);
1926
1985
  if (!l.ok)
1927
- return { ok: !1, error: h(l.status) };
1928
- const f = await l.json(), y = f.data, p = (t = f.errors) == null ? void 0 : t.at(0);
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: h(403, p.message) } : ((s = p.extensions) == null ? void 0 : s.code) === "UNAUTHORIZED" ? { ok: !1, error: h(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: h(400, p.message) } : {
1986
+ return { ok: !1, error: f(l.status) };
1987
+ const h = await l.json(), y = h.data, p = (t = h.errors) == null ? void 0 : t.at(0);
1988
+ 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
1989
  ok: !1,
1931
- error: h(500, p.message)
1990
+ error: f(500, p.message)
1932
1991
  } : {
1933
1992
  ok: !0,
1934
1993
  data: y
@@ -1936,7 +1995,7 @@ class W {
1936
1995
  } catch {
1937
1996
  return {
1938
1997
  ok: !1,
1939
- error: h(500)
1998
+ error: f(500)
1940
1999
  };
1941
2000
  }
1942
2001
  }
@@ -1947,7 +2006,7 @@ class W {
1947
2006
  return t;
1948
2007
  }
1949
2008
  createUploadBody(e, t) {
1950
- const r = Pt(t).filter(
2009
+ const r = xt(t).filter(
1951
2010
  (c) => c.value instanceof File || c.value instanceof Blob
1952
2011
  ), a = new FormData();
1953
2012
  a.append(
@@ -1971,7 +2030,7 @@ async function w(n) {
1971
2030
  }
1972
2031
  class ke {
1973
2032
  constructor(e) {
1974
- m(this, "enabled");
2033
+ d(this, "enabled");
1975
2034
  this.enabled = (e == null ? void 0 : e.enabled) ?? !0;
1976
2035
  }
1977
2036
  info(e) {
@@ -2001,7 +2060,7 @@ function q(n, e) {
2001
2060
  function ye(n, e) {
2002
2061
  return n.getTime() > e.getTime();
2003
2062
  }
2004
- function Ce(n) {
2063
+ function _e(n) {
2005
2064
  return new Promise((e) => {
2006
2065
  setTimeout(e, n);
2007
2066
  });
@@ -2014,8 +2073,8 @@ function we(n, e) {
2014
2073
  /**/
2015
2074
  } = e;
2016
2075
  async function s(c, u) {
2017
- const l = u ?? a, f = await n(...c);
2018
- return t(f) ? f : l > 1 ? (await Ce(r * ((a - l) / 2)), s(c, l - 1)) : f;
2076
+ const l = u ?? a, h = await n(...c);
2077
+ return t(h) ? h : l > 1 ? (await _e(r * ((a - l) / 2)), s(c, l - 1)) : h;
2019
2078
  }
2020
2079
  return async (...c) => await s(c);
2021
2080
  }
@@ -2023,13 +2082,13 @@ function F(n, e) {
2023
2082
  const t = j(n);
2024
2083
  return t.setMinutes(t.getMinutes() - e), t;
2025
2084
  }
2026
- class Gt {
2085
+ class $t {
2027
2086
  constructor(e) {
2028
- m(this, "logger");
2029
- m(this, "storageKey", "session");
2030
- m(this, "authService");
2031
- m(this, "walletService");
2032
- m(this, "_refreshing", !1);
2087
+ d(this, "logger");
2088
+ d(this, "storageKey", "session");
2089
+ d(this, "authService");
2090
+ d(this, "walletService");
2091
+ d(this, "_refreshing", !1);
2033
2092
  this.authService = e.authService, this.walletService = e.walletService, this.logger = new ke({
2034
2093
  enabled: e.logs ?? !1
2035
2094
  });
@@ -2074,13 +2133,13 @@ class Gt {
2074
2133
  maxAttempt: 5
2075
2134
  })();
2076
2135
  if (!l.ok) return l;
2077
- const f = /* @__PURE__ */ new Date();
2136
+ const h = /* @__PURE__ */ new Date();
2078
2137
  return window.localStorage.setItem(
2079
2138
  this.storageKey,
2080
2139
  JSON.stringify({
2081
2140
  ...l.data,
2082
- accessTokenExpiresAt: q(f, 8).getTime(),
2083
- refreshTokenExpiresAt: F(B(f, 30), 2).getTime()
2141
+ accessTokenExpiresAt: q(h, 8).getTime(),
2142
+ refreshTokenExpiresAt: F(B(h, 30), 2).getTime()
2084
2143
  })
2085
2144
  ), {
2086
2145
  ok: !0,
@@ -2149,7 +2208,7 @@ class Gt {
2149
2208
  data: null
2150
2209
  };
2151
2210
  if (this.refreshing)
2152
- return await Ce(1e3), await this.get();
2211
+ return await _e(1e3), await this.get();
2153
2212
  const e = window.localStorage.getItem(this.storageKey);
2154
2213
  if (!e)
2155
2214
  return {
@@ -2250,11 +2309,11 @@ function i(n, e) {
2250
2309
  }
2251
2310
  return e;
2252
2311
  }
2253
- class $t {
2312
+ class Ut {
2254
2313
  constructor(e) {
2255
- m(this, "staticService");
2314
+ d(this, "staticService");
2256
2315
  const t = (e == null ? void 0 : e.environment) === "development";
2257
- this.staticService = new It({
2316
+ this.staticService = new Rt({
2258
2317
  url: t ? "https://static.development.opexa.io" : "https://static.opexa.io"
2259
2318
  });
2260
2319
  }
@@ -2284,7 +2343,8 @@ class $t {
2284
2343
  file: this.file.bind(this),
2285
2344
  pointsWallet: this.pointsWallet.bind(this),
2286
2345
  pointsWalletTransaction: this.pointsWalletTransaction.bind(this),
2287
- activityRecord: this.activityRecord.bind(this)
2346
+ activityRecord: this.activityRecord.bind(this),
2347
+ referrals: this.referrals.bind(this)
2288
2348
  };
2289
2349
  }
2290
2350
  site(e) {
@@ -2297,7 +2357,7 @@ class $t {
2297
2357
  return g(t);
2298
2358
  }
2299
2359
  platform(e) {
2300
- var t, r, a, s, c, u, l, f, y, p, T, v, M, N, I, S, R, D, C, P, x, G, _, $, U, O, A, Q, K, J, z, X, Z, ee, te, re, ae, ne, oe, ie, se, ce, me, de, ue, le, pe, fe, he;
2360
+ var t, r, a, s, c, u, l, h, y, p, T, v, N, M, I, S, R, D, _, P, x, G, C, $, W, 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
2361
  return {
2302
2362
  paymentSettings: {
2303
2363
  minimumFirstDepositAmount: i(e.minimumFirstDepositAmount),
@@ -2313,34 +2373,34 @@ class $t {
2313
2373
  },
2314
2374
  gcash: {
2315
2375
  androidEnabled: ((l = e.gcashDepositGatewaySettings) == null ? void 0 : l.androidEnabled) ?? !1,
2316
- iosEnabled: ((f = e.gcashDepositGatewaySettings) == null ? void 0 : f.iosEnabled) ?? !1,
2376
+ iosEnabled: ((h = e.gcashDepositGatewaySettings) == null ? void 0 : h.iosEnabled) ?? !1,
2317
2377
  webEnabled: ((y = e.gcashDepositGatewaySettings) == null ? void 0 : y.webEnabled) ?? !1,
2318
2378
  mobileWebEnabled: ((p = e.gcashDepositGatewaySettings) == null ? void 0 : p.mobileWebEnabled) ?? !1,
2319
2379
  minimumAmount: i((T = e.gcashDepositGatewaySettings) == null ? void 0 : T.minimumAmount),
2320
2380
  maximumAmount: i((v = e.gcashDepositGatewaySettings) == null ? void 0 : v.maximumAmount)
2321
2381
  },
2322
2382
  maya: {
2323
- androidEnabled: ((M = e.mayaDepositGatewaySettings) == null ? void 0 : M.androidEnabled) ?? !1,
2324
- iosEnabled: ((N = e.mayaDepositGatewaySettings) == null ? void 0 : N.iosEnabled) ?? !1,
2383
+ androidEnabled: ((N = e.mayaDepositGatewaySettings) == null ? void 0 : N.androidEnabled) ?? !1,
2384
+ iosEnabled: ((M = e.mayaDepositGatewaySettings) == null ? void 0 : M.iosEnabled) ?? !1,
2325
2385
  webEnabled: ((I = e.mayaDepositGatewaySettings) == null ? void 0 : I.webEnabled) ?? !1,
2326
2386
  mobileWebEnabled: ((S = e.mayaDepositGatewaySettings) == null ? void 0 : S.mobileWebEnabled) ?? !1,
2327
2387
  minimumAmount: i((R = e.mayaDepositGatewaySettings) == null ? void 0 : R.minimumAmount),
2328
2388
  maximumAmount: i((D = e.mayaDepositGatewaySettings) == null ? void 0 : D.maximumAmount)
2329
2389
  },
2330
2390
  mayaApp: {
2331
- androidEnabled: ((C = e.mayaAppDepositGatewaySettings) == null ? void 0 : C.androidEnabled) ?? !1,
2391
+ androidEnabled: ((_ = e.mayaAppDepositGatewaySettings) == null ? void 0 : _.androidEnabled) ?? !1,
2332
2392
  iosEnabled: ((P = e.mayaAppDepositGatewaySettings) == null ? void 0 : P.iosEnabled) ?? !1,
2333
2393
  webEnabled: ((x = e.mayaAppDepositGatewaySettings) == null ? void 0 : x.webEnabled) ?? !1,
2334
2394
  mobileWebEnabled: ((G = e.mayaAppDepositGatewaySettings) == null ? void 0 : G.mobileWebEnabled) ?? !1,
2335
- minimumAmount: i((_ = e.mayaAppDepositGatewaySettings) == null ? void 0 : _.minimumAmount),
2395
+ minimumAmount: i((C = e.mayaAppDepositGatewaySettings) == null ? void 0 : C.minimumAmount),
2336
2396
  maximumAmount: i(($ = e.mayaAppDepositGatewaySettings) == null ? void 0 : $.maximumAmount)
2337
2397
  }
2338
2398
  },
2339
2399
  withdrawalGateway: {
2340
2400
  bank: {
2341
- androidEnabled: ((U = e.bankWithdrawalGatewaySettings) == null ? void 0 : U.androidEnabled) ?? !1,
2401
+ androidEnabled: ((W = e.bankWithdrawalGatewaySettings) == null ? void 0 : W.androidEnabled) ?? !1,
2342
2402
  iosEnabled: ((O = e.bankWithdrawalGatewaySettings) == null ? void 0 : O.iosEnabled) ?? !1,
2343
- webEnabled: ((A = e.bankWithdrawalGatewaySettings) == null ? void 0 : A.webEnabled) ?? !1,
2403
+ webEnabled: ((k = e.bankWithdrawalGatewaySettings) == null ? void 0 : k.webEnabled) ?? !1,
2344
2404
  mobileWebEnabled: ((Q = e.bankWithdrawalGatewaySettings) == null ? void 0 : Q.mobileWebEnabled) ?? !1,
2345
2405
  minimumAmount: i((K = e.bankWithdrawalGatewaySettings) == null ? void 0 : K.minimumAmount),
2346
2406
  maximumAmount: i((J = e.bankWithdrawalGatewaySettings) == null ? void 0 : J.maximumAmount)
@@ -2365,8 +2425,8 @@ class $t {
2365
2425
  maximumAmount: i((ce = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ce.maximumAmount)
2366
2426
  },
2367
2427
  mayaApp: {
2368
- androidEnabled: ((me = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : me.androidEnabled) ?? !1,
2369
- iosEnabled: ((de = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : de.iosEnabled) ?? !1,
2428
+ androidEnabled: ((de = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : de.androidEnabled) ?? !1,
2429
+ iosEnabled: ((me = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : me.iosEnabled) ?? !1,
2370
2430
  webEnabled: ((ue = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : ue.webEnabled) ?? !1,
2371
2431
  mobileWebEnabled: ((le = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : le.mobileWebEnabled) ?? !1,
2372
2432
  minimumAmount: i((pe = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : pe.minimumAmount),
@@ -2696,20 +2756,31 @@ class $t {
2696
2756
  };
2697
2757
  return g(t);
2698
2758
  }
2759
+ referrals(e) {
2760
+ return {
2761
+ id: e.id,
2762
+ level: e.level,
2763
+ upline: e.upline,
2764
+ downline: e.downline,
2765
+ turnover: i(e.turnover, 0),
2766
+ commision: i(e.commision, 0),
2767
+ dateTimeCreated: new Date(e.dateTimeCreated)
2768
+ };
2769
+ }
2699
2770
  }
2700
- class qt {
2771
+ class Ft {
2701
2772
  constructor(e) {
2702
- m(this, "cmsPortalService");
2703
- m(this, "authService");
2704
- m(this, "gameService");
2705
- m(this, "fileService");
2706
- m(this, "walletService");
2707
- m(this, "accountService");
2708
- m(this, "reportService");
2709
- m(this, "portalService");
2710
- m(this, "sessionManager");
2711
- m(this, "transformer");
2712
- m(this, "logger");
2773
+ d(this, "cmsPortalService");
2774
+ d(this, "authService");
2775
+ d(this, "gameService");
2776
+ d(this, "fileService");
2777
+ d(this, "walletService");
2778
+ d(this, "accountService");
2779
+ d(this, "reportService");
2780
+ d(this, "portalService");
2781
+ d(this, "sessionManager");
2782
+ d(this, "transformer");
2783
+ d(this, "logger");
2713
2784
  const {
2714
2785
  /**/
2715
2786
  site: t,
@@ -2718,13 +2789,13 @@ class qt {
2718
2789
  environment: s,
2719
2790
  logs: c
2720
2791
  } = e, u = s === "production";
2721
- this.transformer = new $t({
2792
+ this.transformer = new Ut({
2722
2793
  environment: s
2723
2794
  }), this.logger = new ke({
2724
2795
  enabled: c ?? !1
2725
2796
  });
2726
- const l = u ? "https://auth.opexa.io" : "https://auth.development.opexa.io", f = u ? "https://wallet.opexa.io/graphql" : "https://wallet.development.opexa.io/graphql", y = u ? "https://report.opexa.io/graphql" : "https://report.development.opexa.io/graphql", 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 _t({
2727
- url: N,
2797
+ 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", N = u ? "https://game.opexa.io/graphql" : "https://game.development.opexa.io/graphql", M = u ? "https://portal-api.opexacms.io/v1" : "https://portal-api.development.opexacms.io/v1", I = new Tt({
2798
+ url: M,
2728
2799
  site: t,
2729
2800
  platform: r
2730
2801
  }), S = {
@@ -2735,15 +2806,15 @@ class qt {
2735
2806
  "Platform-Code": a
2736
2807
  }
2737
2808
  }
2738
- }, R = new vt(new W(M, S)), D = new Tt(new W(v, S)), C = new Rt(new W(f, S)), P = new kt(new W(p, S)), x = new Nt(new W(y, S)), G = new Mt(new W(T, S)), _ = new Ct({
2809
+ }, R = new Nt(new U(N, S)), D = new vt(new U(v, S)), _ = new Dt(new U(h, S)), P = new _t(new U(p, S)), x = new It(new U(y, S)), G = new Mt(new U(T, S)), C = new Ct({
2739
2810
  url: l,
2740
2811
  platform: a
2741
- }), $ = new Gt({
2812
+ }), $ = new $t({
2742
2813
  logs: c,
2743
- authService: _,
2744
- walletService: C
2814
+ authService: C,
2815
+ walletService: _
2745
2816
  });
2746
- this.authService = _, this.gameService = R, this.fileService = D, this.walletService = C, this.accountService = P, this.reportService = x, this.portalService = G, this.sessionManager = $, this.cmsPortalService = I;
2817
+ 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
2818
  }
2748
2819
  get authMiddleware() {
2749
2820
  return async (e) => {
@@ -2778,6 +2849,9 @@ class qt {
2778
2849
  }
2779
2850
  }
2780
2851
  }
2852
+ /**
2853
+ * @deprecated use `sendVerificationCode__next`
2854
+ */
2781
2855
  async sendAuthenticationCode(e) {
2782
2856
  return this.authService.sendVerificationCode(e);
2783
2857
  }
@@ -2860,7 +2934,7 @@ class qt {
2860
2934
  * ```
2861
2935
  */
2862
2936
  watchSession(e) {
2863
- const t = Dt(e.interval ?? 3e4, 3e4, 6e4);
2937
+ const t = Pt(e.interval ?? 3e4, 3e4, 6e4);
2864
2938
  let r = null;
2865
2939
  const a = () => setTimeout(async () => {
2866
2940
  await this.sessionManager.verify() || await e.onInvalid(), r = a();
@@ -2946,7 +3020,7 @@ class qt {
2946
3020
  * ```
2947
3021
  */
2948
3022
  async createAccount(e) {
2949
- const t = e.id ?? E.generate(b.Account).toString(), r = await this.accountService.registerMemberAccount({
3023
+ const t = e.id ?? b.generate(A.Account).toString(), r = await this.accountService.registerMemberAccount({
2950
3024
  input: {
2951
3025
  id: t,
2952
3026
  btag: e.btag,
@@ -2954,7 +3028,7 @@ class qt {
2954
3028
  domain: e.domain,
2955
3029
  birthDay: typeof e.dateOfBirth == "string" ? e.dateOfBirth : e.dateOfBirth.toISOString(),
2956
3030
  password: await w(e.password),
2957
- mobileNumber: k(e.mobileNumber)
3031
+ mobileNumber: E(e.mobileNumber)
2958
3032
  },
2959
3033
  referralCode: e.referralCode,
2960
3034
  verificationCode: e.verificationCode,
@@ -2969,7 +3043,9 @@ class qt {
2969
3043
  * id: ObjectId.generate(ObjectType.Account).toString(),
2970
3044
  * name: data.name,
2971
3045
  * password: data.password,
3046
+ * dateOfBirth: new Date(data.dateOfBirth),
2972
3047
  * mobileNumber: data.mobileNumber,
3048
+ * domain: data.domain,
2973
3049
  * reCAPTCHAResponse: data.reCAPTCHAResponse,
2974
3050
  * });
2975
3051
  *
@@ -2980,13 +3056,13 @@ class qt {
2980
3056
  * }
2981
3057
  * ```
2982
3058
  */
2983
- async createAccountNext(e) {
2984
- const t = e.id ?? E.generate(b.Account).toString(), r = await this.accountService.registerMemberAccountNext({
3059
+ async createAccount__next(e) {
3060
+ const t = e.id ?? b.generate(A.Account).toString(), r = await this.accountService.registerMemberAccount__next({
2985
3061
  input: {
2986
3062
  id: t,
2987
3063
  name: e.name,
2988
3064
  password: await w(e.password),
2989
- mobileNumber: e.mobileNumber ? k(e.mobileNumber) : void 0
3065
+ mobileNumber: e.mobileNumber ? E(e.mobileNumber) : void 0
2990
3066
  },
2991
3067
  reCAPTCHAResponse: e.reCAPTCHAResponse
2992
3068
  });
@@ -3025,7 +3101,7 @@ class qt {
3025
3101
  password: t.password ? await w(t.password) : void 0,
3026
3102
  transactionPassword: t.transactionPassword ? await w(t.transactionPassword) : void 0,
3027
3103
  ...t.mobileNumber && {
3028
- mobileNumber: k(t.mobileNumber)
3104
+ mobileNumber: E(t.mobileNumber)
3029
3105
  },
3030
3106
  secretAnswer: t.secretAnswer ? await w(t.secretAnswer) : void 0
3031
3107
  }
@@ -3068,7 +3144,7 @@ class qt {
3068
3144
  * ```
3069
3145
  */
3070
3146
  async submitVerificationDetails(e) {
3071
- const t = e.id ?? E.generate(b.Verification).toString(), r = await this.accountService.createMemberVerification({
3147
+ const t = e.id ?? b.generate(A.Verification).toString(), r = await this.accountService.createMemberVerification({
3072
3148
  input: {
3073
3149
  id: t,
3074
3150
  ...e
@@ -3104,7 +3180,7 @@ class qt {
3104
3180
  async resetPassword(e) {
3105
3181
  return await this.accountService.resetPassword({
3106
3182
  input: {
3107
- mobileNumber: k(e.mobileNumber),
3183
+ mobileNumber: E(e.mobileNumber),
3108
3184
  newPassword: await w(e.newPassword)
3109
3185
  },
3110
3186
  verificationCode: e.verificationCode
@@ -3128,10 +3204,13 @@ class qt {
3128
3204
  return await this.accountService.sendVerificationCode({
3129
3205
  input: {
3130
3206
  channel: "SMS",
3131
- recipient: k(e)
3207
+ recipient: E(e)
3132
3208
  }
3133
3209
  });
3134
3210
  }
3211
+ async sendVerificationCode__next(e) {
3212
+ return this.authService.sendVerificationCode__next(e);
3213
+ }
3135
3214
  async wallet() {
3136
3215
  const e = await this.walletService.wallet();
3137
3216
  return e.ok ? {
@@ -3192,7 +3271,7 @@ class qt {
3192
3271
  * ```
3193
3272
  */
3194
3273
  async createWithdrawal(e) {
3195
- const t = e.id ?? E.generate(b.Withdrawal).toString();
3274
+ const t = e.id ?? b.generate(A.Withdrawal).toString();
3196
3275
  if (e.type === "BANK") {
3197
3276
  const r = await this.walletService.createBankWithdrawal({
3198
3277
  input: {
@@ -3209,7 +3288,7 @@ class qt {
3209
3288
  id: t,
3210
3289
  amount: e.amount.toString(),
3211
3290
  transactionPassword: await w(e.transactionPassword),
3212
- recipientMobileNumber: k(e.recipientMobileNumber)
3291
+ recipientMobileNumber: E(e.recipientMobileNumber)
3213
3292
  }
3214
3293
  });
3215
3294
  if (!r.ok) return r;
@@ -3220,7 +3299,7 @@ class qt {
3220
3299
  id: t,
3221
3300
  amount: e.amount.toString(),
3222
3301
  transactionPassword: await w(e.transactionPassword),
3223
- recipientMobileNumber: k(e.recipientMobileNumber)
3302
+ recipientMobileNumber: E(e.recipientMobileNumber)
3224
3303
  }
3225
3304
  });
3226
3305
  if (!r.ok) return r;
@@ -3278,7 +3357,7 @@ class qt {
3278
3357
  * ```
3279
3358
  */
3280
3359
  async createDeposit(e) {
3281
- const t = e.id ?? E.generate(b.Deposit).toString();
3360
+ const t = e.id ?? b.generate(A.Deposit).toString();
3282
3361
  if (e.type === "MAYA") {
3283
3362
  const r = await this.walletService.createMayaDeposit({
3284
3363
  input: {
@@ -3564,19 +3643,19 @@ class qt {
3564
3643
  * ```
3565
3644
  */
3566
3645
  async createGameSession(e) {
3567
- const t = e.id ?? E.generate(b.GameSession).toString(), r = await this.walletService.createGameSession({ input: { id: t, game: e.game } });
3646
+ const t = e.id ?? b.generate(A.GameSession).toString(), r = await this.walletService.createGameSession({ input: { id: t, game: e.game } });
3568
3647
  return r.ok ? { ok: !0, data: { id: t } } : r;
3569
3648
  }
3570
3649
  /** @deprecated use `createGameSession__next` */
3571
3650
  async createGameSession__legacy(e) {
3572
- const t = e.id ?? E.generate(b.GameSession).toString(), r = await this.gameService.createGameSession({ input: { id: t, game: e.game } });
3651
+ const t = e.id ?? b.generate(A.GameSession).toString(), r = await this.gameService.createGameSession({ input: { id: t, game: e.game } });
3573
3652
  return r.ok ? { ok: !0, data: { id: t } } : r;
3574
3653
  }
3575
3654
  async createGameSession__next(e) {
3576
- const t = e.id ?? E.generate(b.GameSession).toString();
3655
+ const t = e.id ?? b.generate(A.GameSession).toString();
3577
3656
  if (e.game.startsWith("SPORTS:")) {
3578
- const u = await E.generateFromKey(b.Game, e.game).then(
3579
- (f) => f.toString()
3657
+ const u = await b.generateFromKey(A.Game, e.game).then(
3658
+ (h) => h.toString()
3580
3659
  ), l = await this.gameService.createGameSession({
3581
3660
  input: {
3582
3661
  id: t,
@@ -3598,7 +3677,7 @@ class qt {
3598
3677
  /**/
3599
3678
  provider: a,
3600
3679
  reference: s
3601
- } = r.data, c = Ut(a) ? await this.walletService.createGameSession({ input: { id: t, game: s } }) : await this.gameService.createGameSession({ input: { id: t, game: s } });
3680
+ } = r.data, c = Ot(a) ? await this.walletService.createGameSession({ input: { id: t, game: s } }) : await this.gameService.createGameSession({ input: { id: t, game: s } });
3602
3681
  return c.ok ? { ok: !0, data: { id: t } } : c;
3603
3682
  }
3604
3683
  /** @deprecated use `endGameSession__next` */
@@ -3641,7 +3720,7 @@ class qt {
3641
3720
  * ```
3642
3721
  */
3643
3722
  async uploadImageFile(e) {
3644
- const t = e.id ?? E.generate(b.File).toString(), r = await this.fileService.uploadPrivateImageFile({
3723
+ const t = e.id ?? b.generate(A.File).toString(), r = await this.fileService.uploadPrivateImageFile({
3645
3724
  input: {
3646
3725
  id: t,
3647
3726
  file: e.file
@@ -3718,6 +3797,21 @@ class qt {
3718
3797
  async updateReferralCode(e) {
3719
3798
  return await this.accountService.updateReferralCode({ input: e });
3720
3799
  }
3800
+ async referrals(e) {
3801
+ const t = await this.reportService.referrals(e);
3802
+ return t.ok ? {
3803
+ ok: !0,
3804
+ data: {
3805
+ referrals: t.data.edges.map(({ cursor: r, node: a }) => ({
3806
+ ...this.transformer.transform.referrals(a),
3807
+ cursor: r
3808
+ })),
3809
+ totalCount: t.data.totalCount,
3810
+ hasNextPage: t.data.pageInfo.hasNextPage,
3811
+ endCursor: t.data.pageInfo.endCursor ?? void 0
3812
+ }
3813
+ } : t;
3814
+ }
3721
3815
  }
3722
3816
  const Wt = [
3723
3817
  /**/
@@ -3729,12 +3823,12 @@ const Wt = [
3729
3823
  "EVOLUTION_NETENT",
3730
3824
  "EVOLUTION_REDTIGER"
3731
3825
  ];
3732
- function Ut(n) {
3826
+ function Ot(n) {
3733
3827
  return Wt.some((e) => e === n);
3734
3828
  }
3735
3829
  export {
3736
- Vt as ObjectId,
3737
- b as ObjectType,
3738
- qt as Sdk
3830
+ Ht as ObjectId,
3831
+ A as ObjectType,
3832
+ Ft as Sdk
3739
3833
  };
3740
3834
  //# sourceMappingURL=index.mjs.map