@opexa/portal-sdk 0.0.26 → 0.0.28

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,7 +1,7 @@
1
- var Te = Object.defineProperty;
2
- var Ce = (o, e, t) => e in o ? Te(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
- var m = (o, e, t) => Ce(o, typeof e != "symbol" ? e + "" : e, t);
4
- import { ObjectId as E } from "@opexa/object-id";
1
+ var Ce = Object.defineProperty;
2
+ var Te = (o, e, t) => e in o ? Ce(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
+ var m = (o, e, t) => Te(o, typeof e != "symbol" ? e + "" : e, t);
4
+ import { ObjectId as b } from "@opexa/object-id";
5
5
  import { ObjectId as Gt } from "@opexa/object-id";
6
6
  const S = {
7
7
  Account: 8,
@@ -21,7 +21,7 @@ function n(o, ...e) {
21
21
  }
22
22
  return t.trim();
23
23
  }
24
- const x = n`
24
+ const G = n`
25
25
  fragment FileFragment on File {
26
26
  id
27
27
  url
@@ -29,7 +29,7 @@ const x = n`
29
29
  dateTimeCreated
30
30
  }
31
31
  `, ve = n`
32
- ${x}
32
+ ${G}
33
33
 
34
34
  query File($id: ObjectId!) {
35
35
  node(id: $id) {
@@ -52,7 +52,7 @@ const x = n`
52
52
  }
53
53
  }
54
54
  }
55
- `, Ie = n`
55
+ `, Me = n`
56
56
  query Wallet {
57
57
  wallet {
58
58
  id
@@ -62,7 +62,7 @@ const x = n`
62
62
  dateTimeLastUpdated
63
63
  }
64
64
  }
65
- `, Me = n`
65
+ `, De = n`
66
66
  query PointsWallet {
67
67
  pointsWallet {
68
68
  id
@@ -71,7 +71,7 @@ const x = n`
71
71
  dateTimeCreated
72
72
  }
73
73
  }
74
- `, De = n`
74
+ `, Ie = n`
75
75
  mutation PointsToCashConversion($input: PointsToCashConversionInput!) {
76
76
  pointsToCashConversion(input: $input) {
77
77
  ... on InsufficientPointsError {
@@ -111,7 +111,7 @@ const x = n`
111
111
  }
112
112
  }
113
113
  }
114
- `, Ee = n`
114
+ `, be = n`
115
115
  query GameSession($id: ObjectId!) {
116
116
  node(id: $id) {
117
117
  ... on GameSession {
@@ -149,7 +149,7 @@ const x = n`
149
149
  }
150
150
  }
151
151
  }
152
- `, xe = n`
152
+ `, Ge = n`
153
153
  query Announcements($first: Int, $after: Cursor, $filter: AnnouncementFilterInput) {
154
154
  announcements(first: $first, after: $after, filter: $filter) {
155
155
  edges {
@@ -175,7 +175,7 @@ const x = n`
175
175
  }
176
176
  }
177
177
  }
178
- `, Ge = n`
178
+ `, xe = n`
179
179
  query WithdrawalRecords($first: Int, $after: Cursor, $filter: WithdrawalRecordFilterInput) {
180
180
  member {
181
181
  withdrawalRecords(first: $first, after: $after, filter: $filter) {
@@ -242,7 +242,7 @@ const x = n`
242
242
  }
243
243
  }
244
244
  }
245
- `, Oe = n`
245
+ `, Be = n`
246
246
  mutation CreateGCashWithdrawal($input: CreateGCashWithdrawalInput!) {
247
247
  createGCashWithdrawal(input: $input) {
248
248
  ... on AccountNotVerifiedError {
@@ -265,7 +265,7 @@ const x = n`
265
265
  }
266
266
  }
267
267
  }
268
- `, Ue = n`
268
+ `, $e = n`
269
269
  mutation CreateMayaWithdrawal($input: CreateMayaWithdrawalInput!) {
270
270
  createMayaWithdrawal(input: $input) {
271
271
  ... on AccountNotVerifiedError {
@@ -288,7 +288,7 @@ const x = n`
288
288
  }
289
289
  }
290
290
  }
291
- `, Be = n`
291
+ `, We = n`
292
292
  mutation CreateMayaAppWithdrawal($input: CreateMayaAppWithdrawalInput!) {
293
293
  createMayaAppWithdrawal(input: $input) {
294
294
  ... on AccountNotVerifiedError {
@@ -308,7 +308,7 @@ const x = n`
308
308
  }
309
309
  }
310
310
  }
311
- `, $e = n`
311
+ `, Ue = n`
312
312
  mutation CreateBankWithdrawal($input: CreateBankWithdrawalInput!) {
313
313
  createBankWithdrawal(input: $input) {
314
314
  ... on MobileNumberNotVerifiedError {
@@ -331,7 +331,7 @@ const x = n`
331
331
  }
332
332
  }
333
333
  }
334
- `, We = n`
334
+ `, Oe = n`
335
335
  query RemainingDailyWithdrawalsCount {
336
336
  remainingDailyWithdrawalsCount
337
337
  }
@@ -364,7 +364,7 @@ const x = n`
364
364
  }
365
365
  }
366
366
  }
367
- `, Le = n`
367
+ `, Fe = n`
368
368
  mutation CreateGCashDeposit($input: CreateGCashDepositInput!) {
369
369
  createGCashDeposit(input: $input) {
370
370
  ... on DepositPromoMaximumAmountExceededError {
@@ -393,7 +393,7 @@ const x = n`
393
393
  }
394
394
  }
395
395
  }
396
- `, Ve = n`
396
+ `, Le = n`
397
397
  mutation CreateMayaDeposit($input: CreateMayaDepositInput!) {
398
398
  createMayaDeposit(input: $input) {
399
399
  ... on DepositPromoMaximumAmountExceededError {
@@ -422,7 +422,7 @@ const x = n`
422
422
  }
423
423
  }
424
424
  }
425
- `, Fe = n`
425
+ `, Ve = n`
426
426
  mutation CreateMayaAppDeposit($input: CreateMayaAppDepositInput!) {
427
427
  createMayaAppDeposit(input: $input) {
428
428
  ... on DepositPromoMaximumAmountExceededError {
@@ -534,7 +534,6 @@ const x = n`
534
534
  latestBetRecords {
535
535
  id
536
536
  member {
537
- id
538
537
  name
539
538
  }
540
539
  game {
@@ -575,8 +574,8 @@ const x = n`
575
574
  }
576
575
  }
577
576
  }
578
- `, U = n`
579
- ${x}
577
+ `, $ = n`
578
+ ${G}
580
579
 
581
580
  fragment PromoFragment on Promo {
582
581
  id
@@ -595,7 +594,7 @@ const x = n`
595
594
  dateTimeLastUpdated
596
595
  }
597
596
  `, ze = n`
598
- ${U}
597
+ ${$}
599
598
 
600
599
  query Promos {
601
600
  promos {
@@ -603,15 +602,15 @@ const x = n`
603
602
  }
604
603
  }
605
604
  `, Je = n`
606
- ${U}
605
+ ${$}
607
606
 
608
607
  query AvailablePromos($filter: PromoFilterInput) {
609
608
  availablePromos(filter: $filter) {
610
609
  ...PromoFragment
611
610
  }
612
611
  }
613
- `, be = n`
614
- ${x}
612
+ `, Ee = n`
613
+ ${G}
615
614
 
616
615
  fragment CashbackFragment on Cashback {
617
616
  id
@@ -627,7 +626,7 @@ const x = n`
627
626
  dateTimeLastUpdated
628
627
  }
629
628
  `, Xe = n`
630
- ${be}
629
+ ${Ee}
631
630
 
632
631
  query Cashbacks {
633
632
  cashbacks {
@@ -635,7 +634,7 @@ const x = n`
635
634
  }
636
635
  }
637
636
  `, Ze = n`
638
- ${U}
637
+ ${$}
639
638
 
640
639
  query Bonus {
641
640
  bonus {
@@ -664,7 +663,7 @@ const x = n`
664
663
  }
665
664
  }
666
665
  `, et = n`
667
- ${be}
666
+ ${Ee}
668
667
 
669
668
  query CashbackBonuses {
670
669
  cashbackBonuses {
@@ -716,7 +715,7 @@ const x = n`
716
715
  }
717
716
  }
718
717
  `, ot = n`
719
- ${x}
718
+ ${G}
720
719
 
721
720
  query MemberVerification {
722
721
  memberAccount: self {
@@ -1104,7 +1103,7 @@ class wt {
1104
1103
  }
1105
1104
  async announcements(e) {
1106
1105
  const t = await this.client.request(
1107
- xe,
1106
+ Ge,
1108
1107
  e
1109
1108
  );
1110
1109
  return t.ok ? {
@@ -1114,13 +1113,13 @@ class wt {
1114
1113
  }
1115
1114
  }
1116
1115
  function h(o, e) {
1117
- const t = G[o] ? G[o] : G[500];
1116
+ const t = x[o] ? x[o] : x[500];
1118
1117
  return {
1119
1118
  name: t.name,
1120
1119
  message: e ?? t.message
1121
1120
  };
1122
1121
  }
1123
- const G = {
1122
+ const x = {
1124
1123
  400: { name: "HttpBadRequest", message: "Bad Request" },
1125
1124
  401: { name: "HttpUnauthorized", message: "Unauthorized" },
1126
1125
  403: { name: "HttpForbidden", message: "Forbidden" },
@@ -1292,7 +1291,7 @@ class gt {
1292
1291
  } : t;
1293
1292
  }
1294
1293
  }
1295
- class Et {
1294
+ class bt {
1296
1295
  constructor(e) {
1297
1296
  m(this, "client");
1298
1297
  this.client = e;
@@ -1310,7 +1309,7 @@ class Et {
1310
1309
  }
1311
1310
  async withdrawalRecords(e) {
1312
1311
  const t = await this.client.request(
1313
- Ge,
1312
+ xe,
1314
1313
  e
1315
1314
  );
1316
1315
  return t.ok ? { ok: t.ok, data: t.data.member.withdrawalRecords } : t;
@@ -1384,7 +1383,7 @@ class Ae {
1384
1383
  return e.ok ? { ok: e.ok, data: e.data.bonus } : e;
1385
1384
  }
1386
1385
  async wallet() {
1387
- const e = await this.client.request(Ie);
1386
+ const e = await this.client.request(Me);
1388
1387
  return e.ok ? { ok: e.ok, data: e.data.wallet } : e;
1389
1388
  }
1390
1389
  async deposit(e) {
@@ -1395,7 +1394,7 @@ class Ae {
1395
1394
  return t.ok ? { ok: t.ok, data: t.data.node } : t;
1396
1395
  }
1397
1396
  async createGCashDeposit(e) {
1398
- const t = await this.client.request(Le, e);
1397
+ const t = await this.client.request(Fe, e);
1399
1398
  return t.ok ? t.data.createGCashDeposit ? {
1400
1399
  ok: !1,
1401
1400
  error: d(t.data.createGCashDeposit.__typename)
@@ -1404,7 +1403,7 @@ class Ae {
1404
1403
  } : t;
1405
1404
  }
1406
1405
  async createMayaDeposit(e) {
1407
- const t = await this.client.request(Ve, e);
1406
+ const t = await this.client.request(Le, e);
1408
1407
  return t.ok ? t.data.createMayaDeposit ? {
1409
1408
  ok: !1,
1410
1409
  error: d(t.data.createMayaDeposit.__typename)
@@ -1413,7 +1412,7 @@ class Ae {
1413
1412
  } : t;
1414
1413
  }
1415
1414
  async createMayaAppDeposit(e) {
1416
- const t = await this.client.request(Fe, e);
1415
+ const t = await this.client.request(Ve, e);
1417
1416
  return t.ok ? t.data.createMayaAppDeposit ? {
1418
1417
  ok: !1,
1419
1418
  error: d(t.data.createMayaAppDeposit.__typename)
@@ -1422,7 +1421,7 @@ class Ae {
1422
1421
  } : t;
1423
1422
  }
1424
1423
  async createGCashWithdrawal(e) {
1425
- const t = await this.client.request(Oe, e);
1424
+ const t = await this.client.request(Be, e);
1426
1425
  return t.ok ? t.data.createGCashWithdrawal ? {
1427
1426
  ok: !1,
1428
1427
  error: d(t.data.createGCashWithdrawal.__typename)
@@ -1431,7 +1430,7 @@ class Ae {
1431
1430
  } : t;
1432
1431
  }
1433
1432
  async createMayaWithdrawal(e) {
1434
- const t = await this.client.request(Ue, e);
1433
+ const t = await this.client.request($e, e);
1435
1434
  return t.ok ? t.data.createMayaWithdrawal ? {
1436
1435
  ok: !1,
1437
1436
  error: d(t.data.createMayaWithdrawal.__typename)
@@ -1440,7 +1439,7 @@ class Ae {
1440
1439
  } : t;
1441
1440
  }
1442
1441
  async createMayaAppWithdrawal(e) {
1443
- const t = await this.client.request(Be, e);
1442
+ const t = await this.client.request(We, e);
1444
1443
  return t.ok ? t.data.createMayaAppWithdrawal ? {
1445
1444
  ok: !1,
1446
1445
  error: d(t.data.createMayaAppWithdrawal.__typename)
@@ -1449,7 +1448,7 @@ class Ae {
1449
1448
  } : t;
1450
1449
  }
1451
1450
  async createBankWithdrawal(e) {
1452
- const t = await this.client.request($e, e);
1451
+ const t = await this.client.request(Ue, e);
1453
1452
  return t.ok ? t.data.createBankWithdrawal ? {
1454
1453
  ok: !1,
1455
1454
  error: d(t.data.createBankWithdrawal.__typename)
@@ -1459,16 +1458,16 @@ class Ae {
1459
1458
  }
1460
1459
  async remainingDailyWithdrawalsCount() {
1461
1460
  const e = await this.client.request(
1462
- We
1461
+ Oe
1463
1462
  );
1464
1463
  return e.ok ? { ok: e.ok, data: e.data.remainingDailyWithdrawalsCount } : e;
1465
1464
  }
1466
1465
  async pointsWallet() {
1467
- const e = await this.client.request(Me);
1466
+ const e = await this.client.request(De);
1468
1467
  return e.ok ? { ok: e.ok, data: e.data.pointsWallet } : e;
1469
1468
  }
1470
1469
  async pointsToCashConversion(e) {
1471
- const t = await this.client.request(De, e);
1470
+ const t = await this.client.request(Ie, e);
1472
1471
  return t.ok ? t.data.pointsToCashConversion ? {
1473
1472
  ok: !1,
1474
1473
  error: d(t.data.pointsToCashConversion.__typename)
@@ -1498,7 +1497,7 @@ class Ae {
1498
1497
  }
1499
1498
  async gameSession(e) {
1500
1499
  const t = await this.client.request(
1501
- Ee,
1500
+ be,
1502
1501
  e
1503
1502
  );
1504
1503
  return t.ok ? { ok: !0, data: t.data.node } : t;
@@ -1528,7 +1527,7 @@ class Ae {
1528
1527
  } : t;
1529
1528
  }
1530
1529
  }
1531
- class bt {
1530
+ class Et {
1532
1531
  constructor(e) {
1533
1532
  m(this, "url");
1534
1533
  m(this, "siteId");
@@ -1543,18 +1542,18 @@ class bt {
1543
1542
  } : e;
1544
1543
  }
1545
1544
  async games(e) {
1546
- var r, s, c, u, l, p, y, f, A, _, k, T, C, v, N, I;
1545
+ var r, s, c, u, l, p, y, f, A, k, _, C, T, v, N, M;
1547
1546
  const t = new URLSearchParams();
1548
- 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 = (r = e == null ? void 0 : e.filter) == null ? void 0 : r.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), (p = (l = e == null ? void 0 : e.filter) == null ? void 0 : l.type) != null && p.in && t.set("filter[type][in]", e.filter.type.in.join(",")), (f = (y = e == null ? void 0 : e.filter) == null ? void 0 : y.type) != null && f.notIn && t.set("filter[type][nin]", e.filter.type.notIn.join(",")), (_ = (A = e == null ? void 0 : e.filter) == null ? void 0 : A.provider) != null && _.equal && t.set("filter[provider][eq]", e.filter.provider.equal), (T = (k = e == null ? void 0 : e.filter) == null ? void 0 : k.provider) != null && T.notEqual && t.set("filter[provider][neq]", e.filter.provider.notEqual), (v = (C = e == null ? void 0 : e.filter) == null ? void 0 : C.provider) != null && v.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(","));
1547
+ 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 = (r = e == null ? void 0 : e.filter) == null ? void 0 : r.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), (p = (l = e == null ? void 0 : e.filter) == null ? void 0 : l.type) != null && p.in && t.set("filter[type][in]", e.filter.type.in.join(",")), (f = (y = e == null ? void 0 : e.filter) == null ? void 0 : y.type) != null && f.notIn && t.set("filter[type][nin]", e.filter.type.notIn.join(",")), (k = (A = e == null ? void 0 : e.filter) == null ? void 0 : A.provider) != null && k.equal && t.set("filter[provider][eq]", e.filter.provider.equal), (C = (_ = e == null ? void 0 : e.filter) == null ? void 0 : _.provider) != null && C.notEqual && t.set("filter[provider][neq]", e.filter.provider.notEqual), (v = (T = e == null ? void 0 : e.filter) == null ? void 0 : T.provider) != null && v.in && t.set("filter[provider][in]", e.filter.provider.in.join(",")), (M = (N = e == null ? void 0 : e.filter) == null ? void 0 : N.provider) != null && M.notIn && t.set("filter[provider][nin]", e.filter.provider.notIn.join(","));
1549
1548
  const a = await this.getJson("/games", t);
1550
1549
  return a.ok ? {
1551
1550
  ok: !0,
1552
1551
  data: {
1553
- edges: a.data.data.map((M) => ({
1554
- node: M,
1555
- cursor: M.cursor
1552
+ edges: a.data.data.map((D) => ({
1553
+ node: D,
1554
+ cursor: D.cursor
1556
1555
  })),
1557
- totalCount: a.data.totalCount,
1556
+ totalCount: a.data.totalCount ?? 0,
1558
1557
  pageInfo: {
1559
1558
  hasNextPage: !!a.data.next,
1560
1559
  endCursor: a.data.next
@@ -1620,7 +1619,7 @@ class At {
1620
1619
  }
1621
1620
  async gameSession(e) {
1622
1621
  const t = await this.client.request(
1623
- Ee,
1622
+ be,
1624
1623
  e
1625
1624
  );
1626
1625
  return t.ok ? { ok: !0, data: t.data.node } : t;
@@ -1644,7 +1643,7 @@ class At {
1644
1643
  } : t;
1645
1644
  }
1646
1645
  }
1647
- class _t {
1646
+ class kt {
1648
1647
  constructor(e) {
1649
1648
  m(this, "client");
1650
1649
  this.client = e;
@@ -1657,18 +1656,18 @@ class _t {
1657
1656
  } : e;
1658
1657
  }
1659
1658
  }
1660
- function kt(o, e, t) {
1659
+ function _t(o, e, t) {
1661
1660
  return o < e ? e : o > t ? t : o;
1662
1661
  }
1663
- function O(o) {
1662
+ function B(o) {
1664
1663
  return Object.prototype.toString.call(o) === "[object Object]" && Object(o) === o;
1665
1664
  }
1666
- function Tt(o) {
1665
+ function Ct(o) {
1667
1666
  const e = [];
1668
1667
  function t(a, r = []) {
1669
1668
  for (const s in a) {
1670
1669
  const c = a[s];
1671
- O(c) ? t(c, [...r, s]) : Array.isArray(c) ? t(Ct(c), [...r, s]) : e.push({
1670
+ B(c) ? t(c, [...r, s]) : Array.isArray(c) ? t(Tt(c), [...r, s]) : e.push({
1672
1671
  key: [...r, s],
1673
1672
  value: c
1674
1673
  });
@@ -1676,10 +1675,10 @@ function Tt(o) {
1676
1675
  }
1677
1676
  return t(o), e;
1678
1677
  }
1679
- function Ct(o) {
1678
+ function Tt(o) {
1680
1679
  return o.reduce((e, t, a) => (e[a] = t, e), {});
1681
1680
  }
1682
- class b {
1681
+ class E {
1683
1682
  constructor(e, t) {
1684
1683
  m(this, "url");
1685
1684
  m(this, "options");
@@ -1743,7 +1742,7 @@ class b {
1743
1742
  return t;
1744
1743
  }
1745
1744
  createUploadBody(e, t) {
1746
- const a = Tt(t).filter(
1745
+ const a = Ct(t).filter(
1747
1746
  (c) => c.value instanceof File || c.value instanceof Blob
1748
1747
  ), r = new FormData();
1749
1748
  r.append(
@@ -1765,7 +1764,7 @@ async function g(o) {
1765
1764
  const e = new TextEncoder().encode(o), t = await crypto.subtle.digest("SHA-256", e);
1766
1765
  return Array.from(new Uint8Array(t)).map((s) => s.toString(16).padStart(2, "0")).join("");
1767
1766
  }
1768
- class _e {
1767
+ class ke {
1769
1768
  constructor(e) {
1770
1769
  m(this, "enabled");
1771
1770
  this.enabled = (e == null ? void 0 : e.enabled) ?? !0;
@@ -1783,21 +1782,21 @@ class _e {
1783
1782
  this.enabled && console.log(`\x1B[32m[success] ${e}`);
1784
1783
  }
1785
1784
  }
1786
- function B(o) {
1785
+ function W(o) {
1787
1786
  return new Date(o.getTime());
1788
1787
  }
1789
- function D(o, e) {
1790
- const t = B(o);
1788
+ function I(o, e) {
1789
+ const t = W(o);
1791
1790
  return t.setDate(t.getDate() + e), t;
1792
1791
  }
1793
1792
  function R(o, e) {
1794
- const t = B(o);
1793
+ const t = W(o);
1795
1794
  return t.setMinutes(t.getMinutes() + e), t;
1796
1795
  }
1797
1796
  function he(o, e) {
1798
1797
  return o.getTime() > e.getTime();
1799
1798
  }
1800
- function ke(o) {
1799
+ function _e(o) {
1801
1800
  return new Promise((e) => {
1802
1801
  setTimeout(e, o);
1803
1802
  });
@@ -1811,12 +1810,12 @@ function we(o, e) {
1811
1810
  } = e;
1812
1811
  async function s(c, u) {
1813
1812
  const l = u ?? r, p = await o(...c);
1814
- return t(p) ? p : l > 1 ? (await ke(a * ((r - l) / 2)), s(c, l - 1)) : p;
1813
+ return t(p) ? p : l > 1 ? (await _e(a * ((r - l) / 2)), s(c, l - 1)) : p;
1815
1814
  }
1816
1815
  return async (...c) => await s(c);
1817
1816
  }
1818
1817
  function P(o, e) {
1819
- const t = B(o);
1818
+ const t = W(o);
1820
1819
  return t.setMinutes(t.getMinutes() - e), t;
1821
1820
  }
1822
1821
  class vt {
@@ -1830,12 +1829,12 @@ class vt {
1830
1829
  url: e.authUrl,
1831
1830
  platform: e.platform
1832
1831
  }), this.walletService = new Ae(
1833
- new b(e.walletUrl, {
1832
+ new E(e.walletUrl, {
1834
1833
  middlewares: [
1835
1834
  (t) => (t.headers.set("Platform", e.platform), t.headers.set("Role", "MEMBER"), t)
1836
1835
  ]
1837
1836
  })
1838
- ), this.logger = new _e({
1837
+ ), this.logger = new ke({
1839
1838
  enabled: e.log ?? !1
1840
1839
  });
1841
1840
  }
@@ -1876,7 +1875,7 @@ class vt {
1876
1875
  JSON.stringify({
1877
1876
  ...u.data,
1878
1877
  accessTokenExpiresAt: R(l, 8).getTime(),
1879
- refreshTokenExpiresAt: P(D(l, 30), 2).getTime()
1878
+ refreshTokenExpiresAt: P(I(l, 30), 2).getTime()
1880
1879
  })
1881
1880
  ), {
1882
1881
  ok: !0,
@@ -1892,7 +1891,7 @@ class vt {
1892
1891
  JSON.stringify({
1893
1892
  ...r.data,
1894
1893
  accessTokenExpiresAt: R(s, 8).getTime(),
1895
- refreshTokenExpiresAt: P(D(s, 30), 2).getTime()
1894
+ refreshTokenExpiresAt: P(I(s, 30), 2).getTime()
1896
1895
  })
1897
1896
  ), {
1898
1897
  ok: !0,
@@ -1916,7 +1915,7 @@ class vt {
1916
1915
  JSON.stringify({
1917
1916
  ...t.data,
1918
1917
  accessTokenExpiresAt: R(a, 8).getTime(),
1919
- refreshTokenExpiresAt: P(D(a, 30), 2).getTime()
1918
+ refreshTokenExpiresAt: P(I(a, 30), 2).getTime()
1920
1919
  })
1921
1920
  ), {
1922
1921
  ok: !0,
@@ -1932,7 +1931,7 @@ class vt {
1932
1931
  JSON.stringify({
1933
1932
  ...t.data,
1934
1933
  accessTokenExpiresAt: R(a, 8).getTime(),
1935
- refreshTokenExpiresAt: P(D(a, 30), 2).getTime()
1934
+ refreshTokenExpiresAt: P(I(a, 30), 2).getTime()
1936
1935
  })
1937
1936
  ), { ok: !0 };
1938
1937
  } else
@@ -1945,7 +1944,7 @@ class vt {
1945
1944
  data: null
1946
1945
  };
1947
1946
  if (this.refreshing)
1948
- return await ke(1e3), await this.get();
1947
+ return await _e(1e3), await this.get();
1949
1948
  const e = window.localStorage.getItem(this.storageKey);
1950
1949
  if (!e)
1951
1950
  return {
@@ -1978,7 +1977,7 @@ class vt {
1978
1977
  ...t,
1979
1978
  ...c.data,
1980
1979
  accessTokenExpiresAt: R(a, 8).getTime(),
1981
- refreshTokenExpiresAt: P(D(a, 30), 2).getTime()
1980
+ refreshTokenExpiresAt: P(I(a, 30), 2).getTime()
1982
1981
  }, window.localStorage.setItem(this.storageKey, JSON.stringify(t));
1983
1982
  }
1984
1983
  return {
@@ -2023,12 +2022,12 @@ function w(o) {
2023
2022
  for (const t in o) {
2024
2023
  const a = o[t];
2025
2024
  if (a !== null && a !== void 0) {
2026
- if (O(a)) {
2025
+ if (B(a)) {
2027
2026
  e[t] = w(a);
2028
2027
  continue;
2029
2028
  }
2030
2029
  if (Array.isArray(a)) {
2031
- e[t] = a.map((r) => O(r) ? w(r) : r);
2030
+ e[t] = a.map((r) => B(r) ? w(r) : r);
2032
2031
  continue;
2033
2032
  }
2034
2033
  e[t] = a;
@@ -2090,7 +2089,7 @@ class Nt {
2090
2089
  return w(t);
2091
2090
  }
2092
2091
  platform(e) {
2093
- var t, a, r, s, c, u, l, p, y, f, A, _, k, T, C, v, N, I, M, $, W, q, L, V, F, H, Y, j, Q, K, z, J, X, Z, ee, te, ae, re, oe, ne, ie, se, ce, me, de, ue, le, pe, fe;
2092
+ var t, a, r, s, c, u, l, p, y, f, A, k, _, C, T, v, N, M, D, U, O, q, F, L, V, H, Y, j, Q, K, z, J, X, Z, ee, te, ae, re, oe, ne, ie, se, ce, me, de, ue, le, pe, fe;
2094
2093
  return {
2095
2094
  paymentSettings: {
2096
2095
  minimumFirstDepositAmount: i(e.minimumFirstDepositAmount),
@@ -2110,28 +2109,28 @@ class Nt {
2110
2109
  webEnabled: ((y = e.gcashDepositGatewaySettings) == null ? void 0 : y.webEnabled) ?? !1,
2111
2110
  mobileWebEnabled: ((f = e.gcashDepositGatewaySettings) == null ? void 0 : f.mobileWebEnabled) ?? !1,
2112
2111
  minimumAmount: i((A = e.gcashDepositGatewaySettings) == null ? void 0 : A.minimumAmount),
2113
- maximumAmount: i((_ = e.gcashDepositGatewaySettings) == null ? void 0 : _.maximumAmount)
2112
+ maximumAmount: i((k = e.gcashDepositGatewaySettings) == null ? void 0 : k.maximumAmount)
2114
2113
  },
2115
2114
  maya: {
2116
- androidEnabled: ((k = e.mayaDepositGatewaySettings) == null ? void 0 : k.androidEnabled) ?? !1,
2117
- iosEnabled: ((T = e.mayaDepositGatewaySettings) == null ? void 0 : T.iosEnabled) ?? !1,
2118
- webEnabled: ((C = e.mayaDepositGatewaySettings) == null ? void 0 : C.webEnabled) ?? !1,
2115
+ androidEnabled: ((_ = e.mayaDepositGatewaySettings) == null ? void 0 : _.androidEnabled) ?? !1,
2116
+ iosEnabled: ((C = e.mayaDepositGatewaySettings) == null ? void 0 : C.iosEnabled) ?? !1,
2117
+ webEnabled: ((T = e.mayaDepositGatewaySettings) == null ? void 0 : T.webEnabled) ?? !1,
2119
2118
  mobileWebEnabled: ((v = e.mayaDepositGatewaySettings) == null ? void 0 : v.mobileWebEnabled) ?? !1,
2120
2119
  minimumAmount: i((N = e.mayaDepositGatewaySettings) == null ? void 0 : N.minimumAmount),
2121
- maximumAmount: i((I = e.mayaDepositGatewaySettings) == null ? void 0 : I.maximumAmount)
2120
+ maximumAmount: i((M = e.mayaDepositGatewaySettings) == null ? void 0 : M.maximumAmount)
2122
2121
  },
2123
2122
  mayaApp: {
2124
- androidEnabled: ((M = e.mayaAppDepositGatewaySettings) == null ? void 0 : M.androidEnabled) ?? !1,
2125
- iosEnabled: (($ = e.mayaAppDepositGatewaySettings) == null ? void 0 : $.iosEnabled) ?? !1,
2126
- webEnabled: ((W = e.mayaAppDepositGatewaySettings) == null ? void 0 : W.webEnabled) ?? !1,
2123
+ androidEnabled: ((D = e.mayaAppDepositGatewaySettings) == null ? void 0 : D.androidEnabled) ?? !1,
2124
+ iosEnabled: ((U = e.mayaAppDepositGatewaySettings) == null ? void 0 : U.iosEnabled) ?? !1,
2125
+ webEnabled: ((O = e.mayaAppDepositGatewaySettings) == null ? void 0 : O.webEnabled) ?? !1,
2127
2126
  mobileWebEnabled: ((q = e.mayaAppDepositGatewaySettings) == null ? void 0 : q.mobileWebEnabled) ?? !1,
2128
- minimumAmount: i((L = e.mayaAppDepositGatewaySettings) == null ? void 0 : L.minimumAmount),
2129
- maximumAmount: i((V = e.mayaAppDepositGatewaySettings) == null ? void 0 : V.maximumAmount)
2127
+ minimumAmount: i((F = e.mayaAppDepositGatewaySettings) == null ? void 0 : F.minimumAmount),
2128
+ maximumAmount: i((L = e.mayaAppDepositGatewaySettings) == null ? void 0 : L.maximumAmount)
2130
2129
  }
2131
2130
  },
2132
2131
  withdrawalGateway: {
2133
2132
  bank: {
2134
- androidEnabled: ((F = e.bankWithdrawalGatewaySettings) == null ? void 0 : F.androidEnabled) ?? !1,
2133
+ androidEnabled: ((V = e.bankWithdrawalGatewaySettings) == null ? void 0 : V.androidEnabled) ?? !1,
2135
2134
  iosEnabled: ((H = e.bankWithdrawalGatewaySettings) == null ? void 0 : H.iosEnabled) ?? !1,
2136
2135
  webEnabled: ((Y = e.bankWithdrawalGatewaySettings) == null ? void 0 : Y.webEnabled) ?? !1,
2137
2136
  mobileWebEnabled: ((j = e.bankWithdrawalGatewaySettings) == null ? void 0 : j.mobileWebEnabled) ?? !1,
@@ -2454,8 +2453,7 @@ class Nt {
2454
2453
  };
2455
2454
  }
2456
2455
  }
2457
- var It = { VITE_AUTH_DEVELOPMENT_URL: "https://auth.development.opexa.io", VITE_AUTH_PRODUCTION_URL: "https://auth.opexa.io", VITE_GAME_DEVELOPMENT_URL: "https://game.development.opexa.io/graphql", VITE_GAME_PRODUCTION_URL: "https://game.opexa.io/graphql", VITE_FILE_DEVELOPMENT_URL: "https://file.development.opexa.io/graphql", VITE_FILE_PRODUCTION_URL: "https://file.opexa.io/graphql", VITE_REPORT_DEVELOPMENT_URL: "https://report.development.opexa.io/graphql", VITE_REPORT_PRODUCTION_URL: "https://report.opexa.io/graphql", VITE_WALLET_DEVELOPMENT_URL: "https://wallet.development.opexa.io/graphql", VITE_WALLET_PRODUCTION_URL: "https://wallet.opexa.io/graphql", VITE_ACCOUNT_DEVELOPMENT_URL: "https://account.development.opexa.io/graphql", VITE_ACCOUNT_PRODUCTION_URL: "https://account.opexa.io/graphql", VITE_PORTAL_DEVELOPMENT_URL: "https://portal.development.opexa.io/graphql", VITE_PORTAL_PRODUCTION_URL: "https://portal.opexa.io/graphql", VITE_STATIC_DEVELOPMENT_URL: "https://static.development.opexa.io", VITE_STATIC_PRODUCTION_URL: "https://static.opexa.io", VITE_CMS_PORTAL_DEVELOPMENT_URL: "https://portal-api.opexacms.io/v1", BASE_URL: "/", MODE: "library", DEV: !1, PROD: !0, SSR: !1 };
2458
- class Rt {
2456
+ class It {
2459
2457
  constructor(e) {
2460
2458
  m(this, "gameService");
2461
2459
  m(this, "fileService");
@@ -2473,8 +2471,8 @@ class Rt {
2473
2471
  walletUrl: t ? "https://wallet.development.opexa.io/graphql" : "https://wallet.opexa.io/graphql",
2474
2472
  platform: e.platform,
2475
2473
  log: e.log
2476
- }), this.cmsPortalService = new bt({
2477
- url: t ? "https://portal-api.opexacms.io/v1" : It.VITE_CMS_PORTAL_PRODUCTION_URL,
2474
+ }), this.cmsPortalService = new Et({
2475
+ url: "https://portal-api.opexacms.io/v1",
2478
2476
  site: e.site,
2479
2477
  platform: e.sitePlatform
2480
2478
  });
@@ -2488,36 +2486,36 @@ class Rt {
2488
2486
  }
2489
2487
  };
2490
2488
  this.gameService = new At(
2491
- new b(
2489
+ new E(
2492
2490
  t ? "https://game.development.opexa.io/graphql" : "https://game.opexa.io/graphql",
2493
2491
  a
2494
2492
  )
2495
2493
  ), this.fileService = new gt(
2496
- new b(
2494
+ new E(
2497
2495
  t ? "https://file.development.opexa.io/graphql" : "https://file.opexa.io/graphql",
2498
2496
  a
2499
2497
  )
2500
2498
  ), this.walletService = new Ae(
2501
- new b(
2499
+ new E(
2502
2500
  t ? "https://wallet.development.opexa.io/graphql" : "https://wallet.opexa.io/graphql",
2503
2501
  a
2504
2502
  )
2505
- ), this.reportService = new Et(
2506
- new b(
2503
+ ), this.reportService = new bt(
2504
+ new E(
2507
2505
  t ? "https://report.development.opexa.io/graphql" : "https://report.opexa.io/graphql",
2508
2506
  a
2509
2507
  )
2510
2508
  ), this.accountService = new wt(
2511
- new b(
2509
+ new E(
2512
2510
  t ? "https://account.development.opexa.io/graphql" : "https://account.opexa.io/graphql",
2513
2511
  a
2514
2512
  )
2515
- ), this.portalService = new _t(
2516
- new b(
2513
+ ), this.portalService = new kt(
2514
+ new E(
2517
2515
  t ? "https://portal.development.opexa.io/graphql" : "https://portal.opexa.io/graphql",
2518
2516
  a
2519
2517
  )
2520
- ), this.transformer = new Nt(e), this.logger = new _e({
2518
+ ), this.transformer = new Nt(e), this.logger = new ke({
2521
2519
  enabled: e.log ?? !1
2522
2520
  });
2523
2521
  }
@@ -2633,7 +2631,7 @@ class Rt {
2633
2631
  * ```
2634
2632
  */
2635
2633
  watchSession(e) {
2636
- const t = kt(e.interval ?? 3e4, 3e4, 6e4);
2634
+ const t = _t(e.interval ?? 3e4, 3e4, 6e4);
2637
2635
  let a = null;
2638
2636
  const r = () => setTimeout(async () => {
2639
2637
  await this.sessionManager.verify() || await e.onInvalid(), a = r();
@@ -2716,7 +2714,7 @@ class Rt {
2716
2714
  * ```
2717
2715
  */
2718
2716
  async createAccount(e) {
2719
- const t = e.id ?? E.generate(S.Account).toString(), a = await this.accountService.registerMemberAccount({
2717
+ const t = e.id ?? b.generate(S.Account).toString(), a = await this.accountService.registerMemberAccount({
2720
2718
  input: {
2721
2719
  id: t,
2722
2720
  name: e.name,
@@ -2798,7 +2796,7 @@ class Rt {
2798
2796
  * ```
2799
2797
  */
2800
2798
  async submitVerificationDetails(e) {
2801
- const t = e.id ?? E.generate(S.Verification).toString(), a = await this.accountService.createMemberVerification({
2799
+ const t = e.id ?? b.generate(S.Verification).toString(), a = await this.accountService.createMemberVerification({
2802
2800
  input: {
2803
2801
  id: t,
2804
2802
  ...e
@@ -2922,7 +2920,7 @@ class Rt {
2922
2920
  * ```
2923
2921
  */
2924
2922
  async createWithdrawal(e) {
2925
- const t = e.id ?? E.generate(S.Withdrawal).toString();
2923
+ const t = e.id ?? b.generate(S.Withdrawal).toString();
2926
2924
  if (e.type === "BANK") {
2927
2925
  const a = await this.walletService.createBankWithdrawal({
2928
2926
  input: {
@@ -3008,7 +3006,7 @@ class Rt {
3008
3006
  * ```
3009
3007
  */
3010
3008
  async createDeposit(e) {
3011
- const t = e.id ?? E.generate(S.Deposit).toString();
3009
+ const t = e.id ?? b.generate(S.Deposit).toString();
3012
3010
  if (e.type === "MAYA") {
3013
3011
  const a = await this.walletService.createMayaDeposit({
3014
3012
  input: {
@@ -3072,13 +3070,27 @@ class Rt {
3072
3070
  /*+----------------------------------------+*/
3073
3071
  /**/
3074
3072
  async betRecords(e) {
3075
- const t = await this.reportService.betRecords(e);
3073
+ var a, r;
3074
+ const t = await this.reportService.betRecords({
3075
+ ...e,
3076
+ ...(e == null ? void 0 : e.filter) && {
3077
+ filter: {
3078
+ ...e.filter,
3079
+ ...((a = e.filter) == null ? void 0 : a.gameType) && {
3080
+ game__type: e.filter.gameType
3081
+ },
3082
+ ...((r = e.filter) == null ? void 0 : r.gameProvider) && {
3083
+ game__provider: e.filter.gameProvider
3084
+ }
3085
+ }
3086
+ }
3087
+ });
3076
3088
  return t.ok ? {
3077
3089
  ok: !0,
3078
3090
  data: {
3079
- betRecords: t.data.edges.map(({ cursor: a, node: r }) => ({
3080
- ...this.transformer.transform.betRecord(r),
3081
- cursor: a
3091
+ betRecords: t.data.edges.map(({ cursor: s, node: c }) => ({
3092
+ ...this.transformer.transform.betRecord(c),
3093
+ cursor: s
3082
3094
  })),
3083
3095
  totalCount: t.data.totalCount,
3084
3096
  endCursor: t.data.pageInfo.endCursor ?? void 0,
@@ -3282,12 +3294,12 @@ class Rt {
3282
3294
  * ```
3283
3295
  */
3284
3296
  async createGameSession(e) {
3285
- const t = e.id ?? E.generate(S.GameSession).toString(), a = await this.walletService.createGameSession({ input: { id: t, game: e.game } });
3297
+ const t = e.id ?? b.generate(S.GameSession).toString(), a = await this.walletService.createGameSession({ input: { id: t, game: e.game } });
3286
3298
  return a.ok ? { ok: !0, data: { id: t } } : a;
3287
3299
  }
3288
3300
  /** @deprecated use `createGameSession__next` */
3289
3301
  async createGameSession__legacy(e) {
3290
- const t = e.id ?? E.generate(S.GameSession).toString(), a = await this.gameService.createGameSession({ input: { id: t, game: e.game } });
3302
+ const t = e.id ?? b.generate(S.GameSession).toString(), a = await this.gameService.createGameSession({ input: { id: t, game: e.game } });
3291
3303
  return a.ok ? { ok: !0, data: { id: t } } : a;
3292
3304
  }
3293
3305
  async createGameSession__next(e) {
@@ -3305,7 +3317,7 @@ class Rt {
3305
3317
  type: a,
3306
3318
  provider: r,
3307
3319
  externalId: s
3308
- } = t.data, c = a === "SPORTS" ? e.id ?? (await E.generateFromKey(S.Game, `SPORTS:${r}`)).toString() : e.id ?? E.generate(S.GameSession).toString(), l = [
3320
+ } = t.data, c = a === "SPORTS" ? e.id ?? (await b.generateFromKey(S.Game, `SPORTS:${r}`)).toString() : e.id ?? b.generate(S.GameSession).toString(), l = [
3309
3321
  /**/
3310
3322
  "RTG",
3311
3323
  "DARWIN",
@@ -3357,7 +3369,7 @@ class Rt {
3357
3369
  * ```
3358
3370
  */
3359
3371
  async uploadImageFile(e) {
3360
- const t = e.id ?? E.generate(S.File).toString(), a = await this.fileService.uploadPrivateImageFile({
3372
+ const t = e.id ?? b.generate(S.File).toString(), a = await this.fileService.uploadPrivateImageFile({
3361
3373
  input: {
3362
3374
  id: t,
3363
3375
  file: e.file
@@ -3391,6 +3403,6 @@ class Rt {
3391
3403
  export {
3392
3404
  Gt as ObjectId,
3393
3405
  S as ObjectType,
3394
- Rt as Sdk
3406
+ It as Sdk
3395
3407
  };
3396
3408
  //# sourceMappingURL=index.mjs.map