@opexa/portal-sdk 0.0.16 → 0.0.18

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,6 +1,6 @@
1
1
  var be = Object.defineProperty;
2
2
  var ge = (n, e, t) => e in n ? be(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var d = (n, e, t) => ge(n, typeof e != "symbol" ? e + "" : e, t);
3
+ var m = (n, e, t) => ge(n, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { ObjectId as h } from "@opexa/object-id";
5
5
  import { ObjectId as It } from "@opexa/object-id";
6
6
  const w = {
@@ -257,7 +257,7 @@ const Ee = i`
257
257
  ...PromoFragment
258
258
  }
259
259
  }
260
- `, xe = i`
260
+ `, Pe = i`
261
261
  ${v}
262
262
 
263
263
  query AvailablePromos($filter: PromoFilterInput) {
@@ -265,7 +265,7 @@ const Ee = i`
265
265
  ...PromoFragment
266
266
  }
267
267
  }
268
- `, Pe = i`
268
+ `, Ge = i`
269
269
  ${v}
270
270
 
271
271
  query Bonus {
@@ -294,7 +294,7 @@ const Ee = i`
294
294
  dateTimeLastUpdated
295
295
  }
296
296
  }
297
- `, Ge = i`
297
+ `, xe = i`
298
298
  ${he}
299
299
 
300
300
  query CashbackBonuses {
@@ -855,7 +855,7 @@ const Ee = i`
855
855
  }
856
856
  }
857
857
  }
858
- `, mt = i`
858
+ `, dt = i`
859
859
  mutation CreateGCashWithdrawal($input: CreateGCashWithdrawalInput!) {
860
860
  createGCashWithdrawal(input: $input) {
861
861
  ... on AccountNotVerifiedError {
@@ -878,7 +878,7 @@ const Ee = i`
878
878
  }
879
879
  }
880
880
  }
881
- `, dt = i`
881
+ `, mt = i`
882
882
  mutation CreateMayaWithdrawal($input: CreateMayaWithdrawalInput!) {
883
883
  createMayaWithdrawal(input: $input) {
884
884
  ... on AccountNotVerifiedError {
@@ -1002,7 +1002,7 @@ function c(n) {
1002
1002
  }
1003
1003
  class pt {
1004
1004
  constructor(e) {
1005
- d(this, "client");
1005
+ m(this, "client");
1006
1006
  this.client = e;
1007
1007
  }
1008
1008
  /** aka `Query.self` */
@@ -1134,8 +1134,8 @@ const _ = {
1134
1134
  };
1135
1135
  class ft {
1136
1136
  constructor(e) {
1137
- d(this, "url");
1138
- d(this, "platform");
1137
+ m(this, "url");
1138
+ m(this, "platform");
1139
1139
  this.url = e.url, this.platform = e.platform;
1140
1140
  }
1141
1141
  async createSession(e) {
@@ -1282,7 +1282,7 @@ class ft {
1282
1282
  }
1283
1283
  class ht {
1284
1284
  constructor(e) {
1285
- d(this, "client");
1285
+ m(this, "client");
1286
1286
  this.client = e;
1287
1287
  }
1288
1288
  async file(e) {
@@ -1304,7 +1304,7 @@ class ht {
1304
1304
  }
1305
1305
  class we {
1306
1306
  constructor(e) {
1307
- d(this, "client");
1307
+ m(this, "client");
1308
1308
  this.client = e;
1309
1309
  }
1310
1310
  async game(e) {
@@ -1356,7 +1356,7 @@ class we {
1356
1356
  }
1357
1357
  class wt {
1358
1358
  constructor(e) {
1359
- d(this, "client");
1359
+ m(this, "client");
1360
1360
  this.client = e;
1361
1361
  }
1362
1362
  async betRecords(e) {
@@ -1395,7 +1395,7 @@ class wt {
1395
1395
  }
1396
1396
  class yt {
1397
1397
  constructor(e) {
1398
- d(this, "url");
1398
+ m(this, "url");
1399
1399
  this.url = e.url;
1400
1400
  }
1401
1401
  gameThumbnails(e) {
@@ -1416,13 +1416,13 @@ class bt extends we {
1416
1416
  }
1417
1417
  async availablePromos(e) {
1418
1418
  const t = await this.client.request(
1419
- xe,
1419
+ Pe,
1420
1420
  e
1421
1421
  );
1422
1422
  return t.ok ? { ok: t.ok, data: t.data.availablePromos } : t;
1423
1423
  }
1424
1424
  async cashbackBonuses() {
1425
- const e = await this.client.request(Ge);
1425
+ const e = await this.client.request(xe);
1426
1426
  return e.ok ? { ok: e.ok, data: e.data.cashbackBonuses } : e;
1427
1427
  }
1428
1428
  async claimCashbackBonus(e) {
@@ -1438,7 +1438,7 @@ class bt extends we {
1438
1438
  };
1439
1439
  }
1440
1440
  async bonus() {
1441
- const e = await this.client.request(Pe);
1441
+ const e = await this.client.request(Ge);
1442
1442
  return e.ok ? { ok: e.ok, data: e.data.bonus } : e;
1443
1443
  }
1444
1444
  async wallet() {
@@ -1480,7 +1480,7 @@ class bt extends we {
1480
1480
  } : t;
1481
1481
  }
1482
1482
  async createGCashWithdrawal(e) {
1483
- const t = await this.client.request(mt, e);
1483
+ const t = await this.client.request(dt, e);
1484
1484
  return t.ok ? t.data.createGCashWithdrawal ? {
1485
1485
  ok: !1,
1486
1486
  error: c(t.data.createGCashWithdrawal.__typename)
@@ -1489,7 +1489,7 @@ class bt extends we {
1489
1489
  } : t;
1490
1490
  }
1491
1491
  async createMayaWithdrawal(e) {
1492
- const t = await this.client.request(dt, e);
1492
+ const t = await this.client.request(mt, e);
1493
1493
  return t.ok ? t.data.createMayaWithdrawal ? {
1494
1494
  ok: !1,
1495
1495
  error: c(t.data.createMayaWithdrawal.__typename)
@@ -1544,7 +1544,7 @@ class bt extends we {
1544
1544
  }
1545
1545
  class gt {
1546
1546
  constructor(e) {
1547
- d(this, "client");
1547
+ m(this, "client");
1548
1548
  this.client = e;
1549
1549
  }
1550
1550
  async latestBetRecords() {
@@ -1562,10 +1562,10 @@ function At(n) {
1562
1562
  const e = [];
1563
1563
  function t(a, r = []) {
1564
1564
  for (const s in a) {
1565
- const m = a[s];
1566
- Et(m) ? t(m, [...r, s]) : Array.isArray(m) ? t(St(m), [...r, s]) : e.push({
1565
+ const d = a[s];
1566
+ Et(d) ? t(d, [...r, s]) : Array.isArray(d) ? t(St(d), [...r, s]) : e.push({
1567
1567
  key: [...r, s],
1568
- value: m
1568
+ value: d
1569
1569
  });
1570
1570
  }
1571
1571
  }
@@ -1576,9 +1576,9 @@ function St(n) {
1576
1576
  }
1577
1577
  class b {
1578
1578
  constructor(e, t) {
1579
- d(this, "url");
1580
- d(this, "options");
1581
- d(this, "middlewares");
1579
+ m(this, "url");
1580
+ m(this, "options");
1581
+ m(this, "middlewares");
1582
1582
  var r;
1583
1583
  const a = new Headers((r = t == null ? void 0 : t.fetchOptions) == null ? void 0 : r.headers);
1584
1584
  this.url = e, this.options = { ...t == null ? void 0 : t.fetchOptions, headers: a }, this.middlewares = (t == null ? void 0 : t.middlewares) ?? [];
@@ -1611,13 +1611,13 @@ class b {
1611
1611
  return await this.exec(s);
1612
1612
  }
1613
1613
  async exec(e) {
1614
- var t, a, r, s, m, f;
1614
+ var t, a, r, s, d, f;
1615
1615
  try {
1616
1616
  const y = await fetch(e);
1617
1617
  if (!y.ok)
1618
1618
  return { ok: !1, error: u(y.status) };
1619
1619
  const g = await y.json(), C = g.data, l = (t = g.errors) == null ? void 0 : t.at(0);
1620
- return l ? ((a = l.extensions) == null ? void 0 : a.code) === "FORBIDDEN" || ((r = l.extensions) == null ? void 0 : r.code) === "ACCESS_TOKEN_EXPIRED" ? { ok: !1, error: u(403, l.message) } : ((s = l.extensions) == null ? void 0 : s.code) === "UNAUTHORIZED" ? { ok: !1, error: u(401, l.message) } : ((m = l.extensions) == null ? void 0 : m.code) === "BAD_USER_INPUT" || ((f = l.extensions) == null ? void 0 : f.code) === "BAD_REQUEST" ? { ok: !1, error: u(400, l.message) } : {
1620
+ return l ? ((a = l.extensions) == null ? void 0 : a.code) === "FORBIDDEN" || ((r = l.extensions) == null ? void 0 : r.code) === "ACCESS_TOKEN_EXPIRED" ? { ok: !1, error: u(403, l.message) } : ((s = l.extensions) == null ? void 0 : s.code) === "UNAUTHORIZED" ? { ok: !1, error: u(401, l.message) } : ((d = l.extensions) == null ? void 0 : d.code) === "BAD_USER_INPUT" || ((f = l.extensions) == null ? void 0 : f.code) === "BAD_REQUEST" ? { ok: !1, error: u(400, l.message) } : {
1621
1621
  ok: !1,
1622
1622
  error: u(500, l.message)
1623
1623
  } : {
@@ -1639,7 +1639,7 @@ class b {
1639
1639
  }
1640
1640
  createUploadBody(e, t) {
1641
1641
  const a = At(t).filter(
1642
- (m) => m.value instanceof File || m.value instanceof Blob
1642
+ (d) => d.value instanceof File || d.value instanceof Blob
1643
1643
  ), r = new FormData();
1644
1644
  r.append(
1645
1645
  "operations",
@@ -1649,10 +1649,10 @@ class b {
1649
1649
  })
1650
1650
  );
1651
1651
  const s = {};
1652
- return a.forEach((m, f) => {
1653
- s[f.toString()] = [`variables.${m.key.join(".")}`];
1654
- }), r.append("map", JSON.stringify(s)), a.forEach((m, f) => {
1655
- r.append(f.toString(), m.value);
1652
+ return a.forEach((d, f) => {
1653
+ s[f.toString()] = [`variables.${d.key.join(".")}`];
1654
+ }), r.append("map", JSON.stringify(s)), a.forEach((d, f) => {
1655
+ r.append(f.toString(), d.value);
1656
1656
  }), r;
1657
1657
  }
1658
1658
  }
@@ -1662,7 +1662,7 @@ async function p(n) {
1662
1662
  }
1663
1663
  class ye {
1664
1664
  constructor(e) {
1665
- d(this, "enabled");
1665
+ m(this, "enabled");
1666
1666
  this.enabled = (e == null ? void 0 : e.enabled) ?? !0;
1667
1667
  }
1668
1668
  info(e) {
@@ -1703,10 +1703,10 @@ function S(n, e) {
1703
1703
  }
1704
1704
  class Ct {
1705
1705
  constructor(e) {
1706
- d(this, "logger");
1707
- d(this, "storageKey", "session");
1708
- d(this, "authService");
1709
- d(this, "_refreshing", !1);
1706
+ m(this, "logger");
1707
+ m(this, "storageKey", "session");
1708
+ m(this, "authService");
1709
+ m(this, "_refreshing", !1);
1710
1710
  this.authService = new ft(e), this.logger = new ye({
1711
1711
  enabled: e.log ?? !1
1712
1712
  });
@@ -1827,18 +1827,18 @@ class Ct {
1827
1827
  };
1828
1828
  if (fe(a, r)) {
1829
1829
  this.logger.info("Refreshing session..."), this.refreshing = !0;
1830
- const m = await this.authService.refreshSession(t.refreshToken);
1831
- if (this.refreshing = !1, !m.ok)
1832
- return this.logger.error(`Failed to refresh session: ${m.error.message}`), m.error.name === "InvalidToken" || m.error.name === "AccountBlacklisted" ? (window.localStorage.removeItem(this.storageKey), {
1830
+ const d = await this.authService.refreshSession(t.refreshToken);
1831
+ if (this.refreshing = !1, !d.ok)
1832
+ return this.logger.error(`Failed to refresh session: ${d.error.message}`), d.error.name === "InvalidToken" || d.error.name === "AccountBlacklisted" ? (window.localStorage.removeItem(this.storageKey), {
1833
1833
  ok: !1,
1834
- error: m.error
1834
+ error: d.error
1835
1835
  }) : (this.logger.warn("Old session returned."), {
1836
1836
  ok: !0,
1837
1837
  data: t
1838
1838
  });
1839
1839
  this.logger.success("Session refreshed!"), a = /* @__PURE__ */ new Date(), t = {
1840
1840
  ...t,
1841
- ...m.data,
1841
+ ...d.data,
1842
1842
  accessTokenExpiresAt: A(a, 8).getTime(),
1843
1843
  refreshTokenExpiresAt: S(E(a, 30), 2).getTime()
1844
1844
  }, window.localStorage.setItem(this.storageKey, JSON.stringify(t));
@@ -1892,7 +1892,7 @@ function o(n, e) {
1892
1892
  }
1893
1893
  class Tt {
1894
1894
  constructor(e) {
1895
- d(this, "staticService");
1895
+ m(this, "staticService");
1896
1896
  const t = (e == null ? void 0 : e.environment) === "development";
1897
1897
  this.staticService = new yt({
1898
1898
  url: t ? "https://static.development.opexa.io" : "https://static.opexa.io"
@@ -1923,7 +1923,7 @@ class Tt {
1923
1923
  };
1924
1924
  }
1925
1925
  platform(e) {
1926
- var t, a, r, s, m, f, y, g, C, l, D, N, I, R, x, P, G, $, B, W, U, O, q, F, L, V, Y, H, j, Q, K, z, J, X, Z, ee, te, ae, re, ne, oe, ie, se, me, de, ce, ue, le, pe;
1926
+ var t, a, r, s, d, f, y, g, C, l, D, N, I, R, P, G, x, $, B, W, U, O, q, F, L, V, Y, H, j, Q, K, z, J, X, Z, ee, te, ae, re, ne, oe, ie, se, de, me, ce, ue, le, pe;
1927
1927
  return {
1928
1928
  paymentSettings: {
1929
1929
  minimumFirstDepositAmount: o(e.minimumFirstDepositAmount),
@@ -1934,7 +1934,7 @@ class Tt {
1934
1934
  iosEnabled: ((a = e.bankDepositGatewaySettings) == null ? void 0 : a.iosEnabled) ?? !1,
1935
1935
  webEnabled: ((r = e.bankDepositGatewaySettings) == null ? void 0 : r.webEnabled) ?? !1,
1936
1936
  mobileWebEnabled: ((s = e.bankDepositGatewaySettings) == null ? void 0 : s.mobileWebEnabled) ?? !1,
1937
- minimumAmount: o((m = e.bankDepositGatewaySettings) == null ? void 0 : m.minimumAmount),
1937
+ minimumAmount: o((d = e.bankDepositGatewaySettings) == null ? void 0 : d.minimumAmount),
1938
1938
  maximumAmount: o((f = e.bankDepositGatewaySettings) == null ? void 0 : f.maximumAmount)
1939
1939
  },
1940
1940
  gcash: {
@@ -1948,9 +1948,9 @@ class Tt {
1948
1948
  maya: {
1949
1949
  androidEnabled: ((I = e.mayaDepositGatewaySettings) == null ? void 0 : I.androidEnabled) ?? !1,
1950
1950
  iosEnabled: ((R = e.mayaDepositGatewaySettings) == null ? void 0 : R.iosEnabled) ?? !1,
1951
- webEnabled: ((x = e.mayaDepositGatewaySettings) == null ? void 0 : x.webEnabled) ?? !1,
1952
- mobileWebEnabled: ((P = e.mayaDepositGatewaySettings) == null ? void 0 : P.mobileWebEnabled) ?? !1,
1953
- minimumAmount: o((G = e.mayaDepositGatewaySettings) == null ? void 0 : G.minimumAmount),
1951
+ webEnabled: ((P = e.mayaDepositGatewaySettings) == null ? void 0 : P.webEnabled) ?? !1,
1952
+ mobileWebEnabled: ((G = e.mayaDepositGatewaySettings) == null ? void 0 : G.mobileWebEnabled) ?? !1,
1953
+ minimumAmount: o((x = e.mayaDepositGatewaySettings) == null ? void 0 : x.minimumAmount),
1954
1954
  maximumAmount: o(($ = e.mayaDepositGatewaySettings) == null ? void 0 : $.maximumAmount)
1955
1955
  },
1956
1956
  mayaApp: {
@@ -1992,8 +1992,8 @@ class Tt {
1992
1992
  },
1993
1993
  mayaApp: {
1994
1994
  androidEnabled: ((se = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : se.androidEnabled) ?? !1,
1995
- iosEnabled: ((me = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : me.iosEnabled) ?? !1,
1996
- webEnabled: ((de = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : de.webEnabled) ?? !1,
1995
+ iosEnabled: ((de = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : de.iosEnabled) ?? !1,
1996
+ webEnabled: ((me = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : me.webEnabled) ?? !1,
1997
1997
  mobileWebEnabled: ((ce = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : ce.mobileWebEnabled) ?? !1,
1998
1998
  minimumAmount: o((ue = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : ue.minimumAmount),
1999
1999
  maximumAmount: o(
@@ -2247,15 +2247,15 @@ class Tt {
2247
2247
  }
2248
2248
  class Mt {
2249
2249
  constructor(e) {
2250
- d(this, "gameService");
2251
- d(this, "fileService");
2252
- d(this, "walletService");
2253
- d(this, "reportService");
2254
- d(this, "portalService");
2255
- d(this, "accountService");
2256
- d(this, "sessionManager");
2257
- d(this, "transformer");
2258
- d(this, "logger");
2250
+ m(this, "gameService");
2251
+ m(this, "fileService");
2252
+ m(this, "walletService");
2253
+ m(this, "reportService");
2254
+ m(this, "portalService");
2255
+ m(this, "accountService");
2256
+ m(this, "sessionManager");
2257
+ m(this, "transformer");
2258
+ m(this, "logger");
2259
2259
  const t = e.environment === "development";
2260
2260
  this.sessionManager = new Ct({
2261
2261
  ...e,
@@ -2665,7 +2665,7 @@ class Mt {
2665
2665
  cursor: a
2666
2666
  })),
2667
2667
  totalCount: t.data.totalCount,
2668
- nextCursor: t.data.pageInfo.endCursor ?? void 0,
2668
+ endCursor: t.data.pageInfo.endCursor ?? void 0,
2669
2669
  hasNextPage: t.data.pageInfo.hasNextPage
2670
2670
  }
2671
2671
  } : t;
@@ -2748,7 +2748,7 @@ class Mt {
2748
2748
  cursor: a
2749
2749
  })),
2750
2750
  totalCount: t.data.totalCount,
2751
- nextCursor: t.data.pageInfo.endCursor ?? void 0,
2751
+ endCursor: t.data.pageInfo.endCursor ?? void 0,
2752
2752
  hasNextPage: t.data.pageInfo.hasNextPage
2753
2753
  }
2754
2754
  } : t;
@@ -2829,7 +2829,7 @@ class Mt {
2829
2829
  cursor: a
2830
2830
  })),
2831
2831
  totalCount: t.data.totalCount,
2832
- nextCursor: t.data.pageInfo.endCursor ?? void 0,
2832
+ endCursor: t.data.pageInfo.endCursor ?? void 0,
2833
2833
  hasNextPage: t.data.pageInfo.hasNextPage
2834
2834
  }
2835
2835
  } : t;
@@ -2852,7 +2852,7 @@ class Mt {
2852
2852
  cursor: a
2853
2853
  })),
2854
2854
  totalCount: t.data.totalCount,
2855
- nextCursor: t.data.pageInfo.endCursor ?? void 0,
2855
+ endCursor: t.data.pageInfo.endCursor ?? void 0,
2856
2856
  hasNextPage: t.data.pageInfo.hasNextPage
2857
2857
  }
2858
2858
  } : t;
@@ -2879,7 +2879,7 @@ class Mt {
2879
2879
  cursor: a
2880
2880
  })),
2881
2881
  totalCount: t.data.totalCount,
2882
- nextCursor: t.data.pageInfo.endCursor ?? void 0,
2882
+ endCursor: t.data.pageInfo.endCursor ?? void 0,
2883
2883
  hasNextPage: t.data.pageInfo.hasNextPage
2884
2884
  }
2885
2885
  } : t;
@@ -2942,8 +2942,8 @@ class Mt {
2942
2942
  cursor: a
2943
2943
  })),
2944
2944
  totalCount: t.data.totalCount,
2945
- nextCursor: t.data.pageInfo.endCursor ?? void 0,
2946
- hasNextPage: t.data.pageInfo.hasNextPage
2945
+ hasNextPage: t.data.pageInfo.hasNextPage,
2946
+ endCursor: t.data.pageInfo.endCursor ?? void 0
2947
2947
  }
2948
2948
  } : t;
2949
2949
  }
@@ -2971,7 +2971,7 @@ class Mt {
2971
2971
  cursor: a
2972
2972
  })),
2973
2973
  totalCount: t.data.totalCount,
2974
- nextCursor: t.data.pageInfo.endCursor ?? void 0,
2974
+ endCursor: t.data.pageInfo.endCursor ?? void 0,
2975
2975
  hasNextPage: t.data.pageInfo.hasNextPage
2976
2976
  }
2977
2977
  } : t;