@opexa/portal-sdk 0.51.8 → 0.52.0

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.cjs CHANGED
@@ -660,6 +660,20 @@ var CREATE_MANUAL_BANK_WITHDRAWAL_MUTATION = gql`
660
660
  }
661
661
  }
662
662
  `;
663
+ var CREATE_CABINET_WITHDRAWAL_MUTATION = gql`
664
+ mutation CreateCabinetWithdrawal($input: CreateCabinetWithdrawalInput!) {
665
+ createCabinetWithdrawal(input: $input) {
666
+ ... on InsufficientFundsError {
667
+ __typename
668
+ message
669
+ }
670
+ ... on PlatformDoesNotExistError {
671
+ __typename
672
+ message
673
+ }
674
+ }
675
+ }
676
+ `;
663
677
  var INSTAPAY_BANK_LIST_QUERY = gql`
664
678
  query InstapayBankList {
665
679
  instapayBankList {
@@ -5030,6 +5044,32 @@ var WalletService = class {
5030
5044
  }
5031
5045
  };
5032
5046
 
5047
+ // src/services/extension.service.ts
5048
+ var ExtensionService = class {
5049
+ client;
5050
+ constructor(client) {
5051
+ this.client = client;
5052
+ }
5053
+ async createCabinetWithdrawal(variables) {
5054
+ const { ...others } = variables;
5055
+ const res = await this.client.request(CREATE_CABINET_WITHDRAWAL_MUTATION, others, {
5056
+ headers: {}
5057
+ });
5058
+ if (!res.ok) return res;
5059
+ if (res.data.createCabinetWithdrawal) {
5060
+ return {
5061
+ ok: false,
5062
+ error: createOperationError(
5063
+ res.data.createCabinetWithdrawal.__typename
5064
+ )
5065
+ };
5066
+ }
5067
+ return {
5068
+ ok: true
5069
+ };
5070
+ }
5071
+ };
5072
+
5033
5073
  // src/utils/clone-date.ts
5034
5074
  function cloneDate(date) {
5035
5075
  return new Date(date.getTime());
@@ -7770,6 +7810,7 @@ var Sdk = class {
7770
7810
  gameService;
7771
7811
  fileService;
7772
7812
  walletService;
7813
+ extensionService;
7773
7814
  accountService;
7774
7815
  reportService;
7775
7816
  portalService;
@@ -7803,6 +7844,7 @@ var Sdk = class {
7803
7844
  const transformer = new Transformer();
7804
7845
  const authUrl = ENDPOINTS[environment].auth;
7805
7846
  const walletUrl = ENDPOINTS[environment].wallet;
7847
+ const extensionUrl = ENDPOINTS[environment].extension;
7806
7848
  const reportUrl = ENDPOINTS[environment].report;
7807
7849
  const accountUrl = ENDPOINTS[environment].account;
7808
7850
  const portalUrl = ENDPOINTS[environment].portal;
@@ -7837,6 +7879,9 @@ var Sdk = class {
7837
7879
  const gameService = new GameService(
7838
7880
  new GraphQLClient(gameUrl, graphqlClientConfig)
7839
7881
  );
7882
+ const extensionService = new ExtensionService(
7883
+ new GraphQLClient(extensionUrl, graphqlClientConfig)
7884
+ );
7840
7885
  const fileService = new FileService(
7841
7886
  new GraphQLClient(fileUrl, graphqlClientConfig)
7842
7887
  );
@@ -7882,6 +7927,7 @@ var Sdk = class {
7882
7927
  this.transformer = transformer;
7883
7928
  this.authService = authService;
7884
7929
  this.gameService = gameService;
7930
+ this.extensionService = extensionService;
7885
7931
  this.fileService = fileService;
7886
7932
  this.walletService = walletService;
7887
7933
  this.accountService = accountService;
@@ -8545,6 +8591,15 @@ var Sdk = class {
8545
8591
  });
8546
8592
  if (!res.ok) return res;
8547
8593
  }
8594
+ if (input.type === "CABINET") {
8595
+ const res = await this.extensionService.createCabinetWithdrawal({
8596
+ input: {
8597
+ id,
8598
+ amount: input.amount.toString()
8599
+ }
8600
+ });
8601
+ if (!res.ok) return res;
8602
+ }
8548
8603
  if (input.type === "GCASH") {
8549
8604
  const res = await this.walletService.createGCashWithdrawal({
8550
8605
  input: {
@@ -9726,6 +9781,7 @@ var ENDPOINTS = {
9726
9781
  development: {
9727
9782
  auth: "https://auth.development.opexa.io",
9728
9783
  game: "https://game.development.opexa.io/graphql",
9784
+ extension: "https://extension.development.opexa.io/graphql",
9729
9785
  file: "https://file.development.opexa.io/graphql",
9730
9786
  report: "https://report.development.opexa.io/graphql",
9731
9787
  wallet: "https://wallet.development.opexa.io/graphql",
@@ -9739,6 +9795,7 @@ var ENDPOINTS = {
9739
9795
  production: {
9740
9796
  auth: "https://auth.opexa.io",
9741
9797
  game: "https://game.opexa.io/graphql",
9798
+ extension: "https://extension.opexa.io/graphql",
9742
9799
  file: "https://file.opexa.io/graphql",
9743
9800
  report: "https://report.opexa.io/graphql",
9744
9801
  wallet: "https://wallet.opexa.io/graphql",
@@ -9752,6 +9809,7 @@ var ENDPOINTS = {
9752
9809
  staging: {
9753
9810
  auth: "https://auth.staging.atalos.io",
9754
9811
  game: "https://game.staging.atalos.io/graphql",
9812
+ extension: "https://extension.staging.atalos.io/graphql",
9755
9813
  file: "https://file.staging.atalos.io/graphql",
9756
9814
  report: "https://report.staging.atalos.io/graphql",
9757
9815
  wallet: "https://wallet.staging.atalos.io/graphql",