@opexa/portal-sdk 0.0.80 → 0.0.81

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 Te = Object.defineProperty;
2
- var _e = (n, e, t) => e in n ? Te(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var m = (n, e, t) => _e(n, typeof e != "symbol" ? e + "" : e, t);
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
4
  import { ObjectId as k } from "@opexa/object-id";
5
5
  import { ObjectId as Yt } from "@opexa/object-id";
6
- const T = {
6
+ const _ = {
7
7
  Account: 8,
8
8
  Deposit: 9,
9
9
  Withdrawal: 14,
@@ -52,7 +52,7 @@ const L = o`
52
52
  }
53
53
  }
54
54
  }
55
- `, Ne = o`
55
+ `, Re = o`
56
56
  query Wallet {
57
57
  wallet {
58
58
  id
@@ -62,7 +62,7 @@ const L = o`
62
62
  dateTimeLastUpdated
63
63
  }
64
64
  }
65
- `, Re = o`
65
+ `, Ne = o`
66
66
  query PointsWallet {
67
67
  pointsWallet {
68
68
  id
@@ -72,8 +72,8 @@ const L = o`
72
72
  }
73
73
  }
74
74
  `, Ie = o`
75
- mutation PointsToCashConversion($input: PointsToCashConversionInput!) {
76
- pointsToCashConversion(input: $input) {
75
+ mutation RedeemPointsToCash($input: RedeemPointsToCashInput!) {
76
+ redeemPointsToCash(input: $input) {
77
77
  ... on InsufficientPointsError {
78
78
  __typename
79
79
  }
@@ -326,7 +326,7 @@ const L = o`
326
326
  }
327
327
  }
328
328
  }
329
- `, Oe = o`
329
+ `, We = o`
330
330
  mutation CreateBankWithdrawal($input: CreateBankWithdrawalInput!) {
331
331
  createBankWithdrawal(input: $input) {
332
332
  ... on MobileNumberNotVerifiedError {
@@ -349,7 +349,7 @@ const L = o`
349
349
  }
350
350
  }
351
351
  }
352
- `, We = o`
352
+ `, Oe = o`
353
353
  query RemainingDailyWithdrawalsCount {
354
354
  remainingDailyWithdrawalsCount
355
355
  }
@@ -1204,7 +1204,7 @@ function d(n) {
1204
1204
  }[n]
1205
1205
  };
1206
1206
  }
1207
- class Tt {
1207
+ class _t {
1208
1208
  constructor(e) {
1209
1209
  m(this, "client");
1210
1210
  this.client = e;
@@ -1382,7 +1382,7 @@ const V = {
1382
1382
  429: { name: "HttpTooManyRequests", message: "Too Many Requests" },
1383
1383
  500: { name: "HttpInternalServerError", message: "Internal Server Error" }
1384
1384
  };
1385
- class _t {
1385
+ class Tt {
1386
1386
  constructor(e) {
1387
1387
  m(this, "url");
1388
1388
  m(this, "platform");
@@ -1551,12 +1551,12 @@ class vt {
1551
1551
  } : e;
1552
1552
  }
1553
1553
  async games(e) {
1554
- var a, s, c, u, l, f, w, p, _, v, M, N, R, b, I, D, S, P, $, x, C, G, O, W;
1554
+ var a, s, c, u, l, f, w, p, T, v, M, R, N, b, I, D, S, P, $, x, C, G, W, O;
1555
1555
  const t = new URLSearchParams();
1556
- 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 = (w = e == null ? void 0 : e.filter) == null ? void 0 : w.type) != null && p.notIn && t.set("filter[type][nin]", e.filter.type.notIn.join(",")), (v = (_ = e == null ? void 0 : e.filter) == null ? void 0 : _.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), (b = (R = e == null ? void 0 : e.filter) == null ? void 0 : R.provider) != null && b.in && t.set("filter[provider][in]", e.filter.provider.in.join(",")), (D = (I = e == null ? void 0 : e.filter) == null ? void 0 : I.provider) != null && D.notIn && t.set("filter[provider][nin]", e.filter.provider.notIn.join(",")), (P = (S = e == null ? void 0 : e.filter) == null ? void 0 : S.tags) != null && P.equal && t.set("filter[tags][eq]", e.filter.tags.equal.toLowerCase()), (x = ($ = e == null ? void 0 : e.filter) == null ? void 0 : $.tags) != null && x.notEqual && t.set("filter[tags][neq]", e.filter.tags.notEqual.toLowerCase()), (G = (C = e == null ? void 0 : e.filter) == null ? void 0 : C.tags) != null && G.in && t.set(
1556
+ 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 = (w = e == null ? void 0 : e.filter) == null ? void 0 : w.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), (R = (M = e == null ? void 0 : e.filter) == null ? void 0 : M.provider) != null && R.notEqual && t.set("filter[provider][neq]", e.filter.provider.notEqual), (b = (N = e == null ? void 0 : e.filter) == null ? void 0 : N.provider) != null && b.in && t.set("filter[provider][in]", e.filter.provider.in.join(",")), (D = (I = e == null ? void 0 : e.filter) == null ? void 0 : I.provider) != null && D.notIn && t.set("filter[provider][nin]", e.filter.provider.notIn.join(",")), (P = (S = e == null ? void 0 : e.filter) == null ? void 0 : S.tags) != null && P.equal && t.set("filter[tags][eq]", e.filter.tags.equal.toLowerCase()), (x = ($ = e == null ? void 0 : e.filter) == null ? void 0 : $.tags) != null && x.notEqual && t.set("filter[tags][neq]", e.filter.tags.notEqual.toLowerCase()), (G = (C = e == null ? void 0 : e.filter) == null ? void 0 : C.tags) != null && G.in && t.set(
1557
1557
  "filter[tags][in]",
1558
1558
  e.filter.tags.in.map((E) => E.toLowerCase()).join(",")
1559
- ), (W = (O = e == null ? void 0 : e.filter) == null ? void 0 : O.tags) != null && W.notIn && t.set(
1559
+ ), (O = (W = e == null ? void 0 : e.filter) == null ? void 0 : W.tags) != null && O.notIn && t.set(
1560
1560
  "filter[tags][nin]",
1561
1561
  e.filter.tags.notIn.map((E) => E.toLowerCase()).join(",")
1562
1562
  );
@@ -1636,7 +1636,7 @@ class Mt {
1636
1636
  } : t;
1637
1637
  }
1638
1638
  }
1639
- class Nt {
1639
+ class Rt {
1640
1640
  constructor(e) {
1641
1641
  m(this, "client");
1642
1642
  this.client = e;
@@ -1673,7 +1673,7 @@ class Nt {
1673
1673
  } : t;
1674
1674
  }
1675
1675
  }
1676
- class Rt {
1676
+ class Nt {
1677
1677
  constructor(e) {
1678
1678
  m(this, "client");
1679
1679
  this.client = e;
@@ -1810,7 +1810,7 @@ class Pt {
1810
1810
  return e.ok ? { ok: e.ok, data: e.data.bonus } : e;
1811
1811
  }
1812
1812
  async wallet() {
1813
- const e = await this.client.request(Ne);
1813
+ const e = await this.client.request(Re);
1814
1814
  return e.ok ? { ok: e.ok, data: e.data.wallet } : e;
1815
1815
  }
1816
1816
  async deposit(e) {
@@ -1875,7 +1875,7 @@ class Pt {
1875
1875
  } : t;
1876
1876
  }
1877
1877
  async createBankWithdrawal(e) {
1878
- const t = await this.client.request(Oe, e);
1878
+ const t = await this.client.request(We, e);
1879
1879
  return t.ok ? t.data.createBankWithdrawal ? {
1880
1880
  ok: !1,
1881
1881
  error: d(t.data.createBankWithdrawal.__typename)
@@ -1885,19 +1885,19 @@ class Pt {
1885
1885
  }
1886
1886
  async remainingDailyWithdrawalsCount() {
1887
1887
  const e = await this.client.request(
1888
- We
1888
+ Oe
1889
1889
  );
1890
1890
  return e.ok ? { ok: e.ok, data: e.data.remainingDailyWithdrawalsCount } : e;
1891
1891
  }
1892
1892
  async pointsWallet() {
1893
- const e = await this.client.request(Re);
1893
+ const e = await this.client.request(Ne);
1894
1894
  return e.ok ? { ok: e.ok, data: e.data.pointsWallet } : e;
1895
1895
  }
1896
- async pointsToCashConversion(e) {
1896
+ async redeemPointsToCash(e) {
1897
1897
  const t = await this.client.request(Ie, e);
1898
- return t.ok ? t.data.pointsToCashConversion ? {
1898
+ return t.ok ? t.data.redeemPointsToCash ? {
1899
1899
  ok: !1,
1900
- error: d(t.data.pointsToCashConversion.__typename)
1900
+ error: d(t.data.redeemPointsToCash.__typename)
1901
1901
  } : {
1902
1902
  ok: !0
1903
1903
  } : t;
@@ -2344,7 +2344,7 @@ function i(n, e) {
2344
2344
  }
2345
2345
  return e;
2346
2346
  }
2347
- class Ot {
2347
+ class Wt {
2348
2348
  constructor(e) {
2349
2349
  m(this, "staticService");
2350
2350
  const t = (e == null ? void 0 : e.environment) === "development";
@@ -2391,7 +2391,7 @@ class Ot {
2391
2391
  return g(t);
2392
2392
  }
2393
2393
  platform(e) {
2394
- var t, r, a, s, c, u, l, f, w, p, _, v, M, N, R, b, I, D, S, P, $, x, C, G, O, W, E, K, J, z, X, Z, ee, te, re, ae, ne, oe, ie, se, ce, me, de, ue, le, pe, fe, he, we;
2394
+ var t, r, a, s, c, u, l, f, w, p, T, v, M, R, N, b, I, D, S, P, $, x, C, G, W, O, E, K, J, z, X, Z, ee, te, re, ae, ne, oe, ie, se, ce, me, de, ue, le, pe, fe, he, we;
2395
2395
  return {
2396
2396
  paymentSettings: {
2397
2397
  minimumFirstDepositAmount: i(e.minimumFirstDepositAmount),
@@ -2410,13 +2410,13 @@ class Ot {
2410
2410
  iosEnabled: ((f = e.gcashDepositGatewaySettings) == null ? void 0 : f.iosEnabled) ?? !1,
2411
2411
  webEnabled: ((w = e.gcashDepositGatewaySettings) == null ? void 0 : w.webEnabled) ?? !1,
2412
2412
  mobileWebEnabled: ((p = e.gcashDepositGatewaySettings) == null ? void 0 : p.mobileWebEnabled) ?? !1,
2413
- minimumAmount: i((_ = e.gcashDepositGatewaySettings) == null ? void 0 : _.minimumAmount),
2413
+ minimumAmount: i((T = e.gcashDepositGatewaySettings) == null ? void 0 : T.minimumAmount),
2414
2414
  maximumAmount: i((v = e.gcashDepositGatewaySettings) == null ? void 0 : v.maximumAmount)
2415
2415
  },
2416
2416
  maya: {
2417
2417
  androidEnabled: ((M = e.mayaDepositGatewaySettings) == null ? void 0 : M.androidEnabled) ?? !1,
2418
- iosEnabled: ((N = e.mayaDepositGatewaySettings) == null ? void 0 : N.iosEnabled) ?? !1,
2419
- webEnabled: ((R = e.mayaDepositGatewaySettings) == null ? void 0 : R.webEnabled) ?? !1,
2418
+ iosEnabled: ((R = e.mayaDepositGatewaySettings) == null ? void 0 : R.iosEnabled) ?? !1,
2419
+ webEnabled: ((N = e.mayaDepositGatewaySettings) == null ? void 0 : N.webEnabled) ?? !1,
2420
2420
  mobileWebEnabled: ((b = e.mayaDepositGatewaySettings) == null ? void 0 : b.mobileWebEnabled) ?? !1,
2421
2421
  minimumAmount: i((I = e.mayaDepositGatewaySettings) == null ? void 0 : I.minimumAmount),
2422
2422
  maximumAmount: i((D = e.mayaDepositGatewaySettings) == null ? void 0 : D.maximumAmount)
@@ -2432,8 +2432,8 @@ class Ot {
2432
2432
  },
2433
2433
  withdrawalGateway: {
2434
2434
  bank: {
2435
- androidEnabled: ((O = e.bankWithdrawalGatewaySettings) == null ? void 0 : O.androidEnabled) ?? !1,
2436
- iosEnabled: ((W = e.bankWithdrawalGatewaySettings) == null ? void 0 : W.iosEnabled) ?? !1,
2435
+ androidEnabled: ((W = e.bankWithdrawalGatewaySettings) == null ? void 0 : W.androidEnabled) ?? !1,
2436
+ iosEnabled: ((O = e.bankWithdrawalGatewaySettings) == null ? void 0 : O.iosEnabled) ?? !1,
2437
2437
  webEnabled: ((E = e.bankWithdrawalGatewaySettings) == null ? void 0 : E.webEnabled) ?? !1,
2438
2438
  mobileWebEnabled: ((K = e.bankWithdrawalGatewaySettings) == null ? void 0 : K.mobileWebEnabled) ?? !1,
2439
2439
  minimumAmount: i((J = e.bankWithdrawalGatewaySettings) == null ? void 0 : J.minimumAmount),
@@ -2825,13 +2825,13 @@ class Lt {
2825
2825
  environment: s,
2826
2826
  logs: c
2827
2827
  } = e, u = s === "production";
2828
- this.transformer = new Ot({
2828
+ this.transformer = new Wt({
2829
2829
  environment: s
2830
2830
  }), this.logger = new Ce({
2831
2831
  enabled: c ?? !1
2832
2832
  });
2833
- 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", w = 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", _ = 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 = "https://portal-api.opexacms.io/v1", R = new vt({
2834
- url: N,
2833
+ 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", w = 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", R = "https://portal-api.opexacms.io/v1", N = new vt({
2834
+ url: R,
2835
2835
  site: t,
2836
2836
  platform: r
2837
2837
  }), b = {
@@ -2842,7 +2842,7 @@ class Lt {
2842
2842
  "Platform-Code": a
2843
2843
  }
2844
2844
  }
2845
- }, I = new Nt(new U(M, b)), D = new Mt(new U(v, b)), S = new Pt(new U(f, b)), P = new Tt(new U(p, b)), $ = new It(new U(w, b)), x = new Rt(new U(_, b)), C = new _t({
2845
+ }, I = new Rt(new U(M, b)), D = new Mt(new U(v, b)), S = new Pt(new U(f, b)), P = new _t(new U(p, b)), $ = new It(new U(w, b)), x = new Nt(new U(T, b)), C = new Tt({
2846
2846
  url: l,
2847
2847
  platform: a
2848
2848
  }), G = new Ut({
@@ -2850,7 +2850,7 @@ class Lt {
2850
2850
  authService: C,
2851
2851
  walletService: S
2852
2852
  });
2853
- this.authService = C, this.gameService = I, this.fileService = D, this.walletService = S, this.accountService = P, this.reportService = $, this.portalService = x, this.sessionManager = G, this.cmsPortalService = R;
2853
+ this.authService = C, this.gameService = I, this.fileService = D, this.walletService = S, this.accountService = P, this.reportService = $, this.portalService = x, this.sessionManager = G, this.cmsPortalService = N;
2854
2854
  }
2855
2855
  get authMiddleware() {
2856
2856
  return async (e) => {
@@ -2969,7 +2969,7 @@ class Lt {
2969
2969
  * @deprecated use `createAccount__next`
2970
2970
  */
2971
2971
  async createAccount(e) {
2972
- const t = e.id ?? k.generate(T.Account).toString(), r = await this.accountService.registerMemberAccount({
2972
+ const t = e.id ?? k.generate(_.Account).toString(), r = await this.accountService.registerMemberAccount({
2973
2973
  input: {
2974
2974
  id: t,
2975
2975
  btag: e.btag,
@@ -2986,7 +2986,7 @@ class Lt {
2986
2986
  return r.ok ? { ok: !0, data: { id: t } } : r;
2987
2987
  }
2988
2988
  async createAccount__next(e) {
2989
- const t = e.id ?? k.generate(T.Account).toString();
2989
+ const t = e.id ?? k.generate(_.Account).toString();
2990
2990
  if (e.type === "MOBILE_NUMBER") {
2991
2991
  const a = await this.accountService.registerMemberAccountViaMobile({
2992
2992
  input: {
@@ -3050,7 +3050,7 @@ class Lt {
3050
3050
  } : e;
3051
3051
  }
3052
3052
  async submitVerificationDetails(e) {
3053
- const t = e.id ?? k.generate(T.Verification).toString(), r = await this.accountService.createMemberVerification({
3053
+ const t = e.id ?? k.generate(_.Verification).toString(), r = await this.accountService.createMemberVerification({
3054
3054
  input: {
3055
3055
  id: t,
3056
3056
  ...e
@@ -3151,7 +3151,7 @@ class Lt {
3151
3151
  /*+----------------------------------------+*/
3152
3152
  /**/
3153
3153
  async createWithdrawal(e) {
3154
- const t = e.id ?? k.generate(T.Withdrawal).toString();
3154
+ const t = e.id ?? k.generate(_.Withdrawal).toString();
3155
3155
  if (e.type === "BANK") {
3156
3156
  const r = await this.walletService.createBankWithdrawal({
3157
3157
  input: {
@@ -3220,7 +3220,7 @@ class Lt {
3220
3220
  /*+----------------------------------------+*/
3221
3221
  /**/
3222
3222
  async createDeposit(e) {
3223
- const t = e.id ?? k.generate(T.Deposit).toString();
3223
+ const t = e.id ?? k.generate(_.Deposit).toString();
3224
3224
  if (e.type === "MAYA") {
3225
3225
  const r = await this.walletService.createMayaDeposit({
3226
3226
  input: {
@@ -3422,9 +3422,9 @@ class Lt {
3422
3422
  } : r;
3423
3423
  }
3424
3424
  async createGameSession(e) {
3425
- const t = e.id ?? k.generate(T.GameSession).toString();
3425
+ const t = e.id ?? k.generate(_.GameSession).toString();
3426
3426
  if (e.game.startsWith("SPORTS:")) {
3427
- const u = await k.generateFromKey(T.Game, e.game).then(
3427
+ const u = await k.generateFromKey(_.Game, e.game).then(
3428
3428
  (f) => f.toString()
3429
3429
  ), l = await this.gameService.createGameSession({
3430
3430
  input: {
@@ -3467,7 +3467,7 @@ class Lt {
3467
3467
  } : t;
3468
3468
  }
3469
3469
  async uploadImageFile(e) {
3470
- const t = e.id ?? k.generate(T.File).toString(), r = await this.fileService.uploadPrivateImageFile({
3470
+ const t = e.id ?? k.generate(_.File).toString(), r = await this.fileService.uploadPrivateImageFile({
3471
3471
  input: {
3472
3472
  id: t,
3473
3473
  file: e.file
@@ -3487,10 +3487,10 @@ class Lt {
3487
3487
  data: e.data ? this.transformer.transform.pointsWallet(e.data) : null
3488
3488
  } : e;
3489
3489
  }
3490
- async pointsToCashConversion(e) {
3491
- return await this.walletService.pointsToCashConversion({
3490
+ async redeemPoints(e) {
3491
+ return await this.walletService.redeemPointsToCash({
3492
3492
  input: {
3493
- amount: e.toString()
3493
+ amount: e.amount.toString()
3494
3494
  }
3495
3495
  });
3496
3496
  }
@@ -3581,7 +3581,7 @@ class Lt {
3581
3581
  } : t;
3582
3582
  }
3583
3583
  }
3584
- const Wt = [
3584
+ const Ot = [
3585
3585
  /**/
3586
3586
  "RTG",
3587
3587
  "DARWIN",
@@ -3592,11 +3592,11 @@ const Wt = [
3592
3592
  "EVOLUTION_REDTIGER"
3593
3593
  ];
3594
3594
  function Bt(n) {
3595
- return Wt.some((e) => e === n);
3595
+ return Ot.some((e) => e === n);
3596
3596
  }
3597
3597
  export {
3598
3598
  Yt as ObjectId,
3599
- T as ObjectType,
3599
+ _ as ObjectType,
3600
3600
  Lt as Sdk
3601
3601
  };
3602
3602
  //# sourceMappingURL=index.mjs.map