@cuenca-mx/cuenca-js 1.1.0-dev0 → 1.1.1-dev1

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/build/index.cjs CHANGED
@@ -7,8 +7,8 @@ var Buffer = require('buffer');
7
7
  var errors_index = require('./errors/index.cjs');
8
8
  var jwt_index = require('./jwt/index.cjs');
9
9
  var data = require('./data-5a8f0772.cjs');
10
- var vulnerableActivity = require('./vulnerableActivity-d94f9fba.cjs');
11
- var walletTransactionRequest = require('./walletTransactionRequest-828de982.cjs');
10
+ var vulnerableActivity = require('./vulnerableActivity-ee25810d.cjs');
11
+ var walletTransactionRequest = require('./walletTransactionRequest-a184c79e.cjs');
12
12
 
13
13
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
14
 
@@ -26,7 +26,7 @@ const isNode =
26
26
 
27
27
  const runtimeEnv = { isBrowser, isNode };
28
28
 
29
- const name="@cuenca-mx/cuenca-js";const version="1.1.0-dev0";const description="Cuenca client for JS";const main="./build/index.cjs";const module$1="./build/index.mjs";const types="./typings/index.d.ts";const browser="./build/umd/cuenca.umd.js";const files=["build/**/*","typings/**/*"];const exports$1={".":{types:"./typings/index.d.ts","import":"./build/index.mjs",require:"./build/index.cjs"},"./errors":{types:"./typings/errors/index.d.ts","import":"./build/errors/index.mjs",require:"./build/errors/index.cjs"},"./jwt":{"import":"./build/jwt/index.mjs",require:"./build/jwt/index.cjs"},"./requests":{"import":"./build/requests/index.mjs",require:"./build/requests/index.cjs"},"./types":{types:"./typings/types/index.d.ts","import":"./build/types/index.mjs",require:"./build/types/index.cjs"}};const packageManager="yarn@3.0.2";const type="module";const repository={type:"git",url:"https://github.com/cuenca-mx/cuenca-js.git",directory:"packages/cuenca-js"};const keywords=["cuenca"];const license="MIT";const bugs={url:"https://github.com/cuenca-mx/cuenca-js/issues"};const homepage="https://cuenca.com";const scripts={build:"rm -rf build/ && yarn rollup --config",test:"yarn node --experimental-vm-modules $(yarn bin jest)",publish:"yarn build && yarn npm publish",dev:"rm -rf build/ && yarn rollup --config && yarn node ../example.cjs",example:"yarn node ../example.cjs"};const devDependencies={"@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.1.1",jest:"^27.4.5",rollup:"^2.61.1","rollup-plugin-terser":"^7.0.2"};const dependencies={axios:"^0.24.0",buffer:"^6.0.3"};var pkg = {name:name,version:version,description:description,main:main,module:module$1,types:types,browser:browser,files:files,exports:exports$1,packageManager:packageManager,type:type,repository:repository,keywords:keywords,license:license,bugs:bugs,homepage:homepage,scripts:scripts,devDependencies:devDependencies,dependencies:dependencies};
29
+ const name="@cuenca-mx/cuenca-js";const version="1.1.1-dev1";const description="Cuenca client for JS";const main="./build/index.cjs";const module$1="./build/index.mjs";const browser="./build/umd/cuenca.umd.js";const files=["build/**/*"];const exports$1={".":{"import":"./build/index.mjs",require:"./build/index.cjs"},"./errors":{"import":"./build/errors/index.mjs",require:"./build/errors/index.cjs"},"./jwt":{"import":"./build/jwt/index.mjs",require:"./build/jwt/index.cjs"},"./requests":{"import":"./build/requests/index.mjs",require:"./build/requests/index.cjs"},"./types":{"import":"./build/types/index.mjs",require:"./build/types/index.cjs"}};const packageManager="yarn@3.0.2";const type="module";const repository={type:"git",url:"https://github.com/cuenca-mx/cuenca-js.git",directory:"packages/cuenca-js"};const keywords=["cuenca"];const license="MIT";const bugs={url:"https://github.com/cuenca-mx/cuenca-js/issues"};const homepage="https://cuenca.com";const scripts={build:"rm -rf build/ && yarn rollup --config",test:"yarn node --experimental-vm-modules $(yarn bin jest)",publish:"yarn build && yarn npm publish",dev:"rm -rf build/ && yarn rollup --config && yarn node ../example.cjs",example:"yarn node ../example.cjs"};const devDependencies={"@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.1.1",jest:"^27.4.5",rollup:"^2.61.1","rollup-plugin-terser":"^7.0.2"};const dependencies={axios:"^0.24.0",buffer:"^6.0.3"};var pkg = {name:name,version:version,description:description,main:main,module:module$1,browser:browser,files:files,exports:exports$1,packageManager:packageManager,type:type,repository:repository,keywords:keywords,license:license,bugs:bugs,homepage:homepage,scripts:scripts,devDependencies:devDependencies,dependencies:dependencies};
30
30
 
31
31
  class Client {
32
32
  constructor({
@@ -1021,6 +1021,69 @@ class File {
1021
1021
  new File({ extension, type, url, userId: obj.user_id });
1022
1022
  }
1023
1023
 
1024
+ class FraudFundsTransfer {
1025
+ constructor({
1026
+ id,
1027
+ requestId,
1028
+ createdAt,
1029
+ updatedAt,
1030
+ requestedAt,
1031
+ userId,
1032
+ amount,
1033
+ concepto,
1034
+ clabe,
1035
+ status,
1036
+ transactionId,
1037
+ claveRastreo,
1038
+ reasonCode,
1039
+ message,
1040
+ completedAt,
1041
+ }) {
1042
+ this.id = id;
1043
+ this.requestId = requestId;
1044
+ this.createdAt = data.dateToUTC(createdAt);
1045
+ this.updatedAt = data.dateToUTC(updatedAt);
1046
+ this.requestedAt = data.dateToUTC(requestedAt);
1047
+ this.userId = userId;
1048
+ this.amount = amount;
1049
+ this.concepto = concepto;
1050
+ this.clabe = clabe;
1051
+ this.status = data.enumValueFromString(data.TransactionStatus, status);
1052
+ this.transactionId = transactionId;
1053
+ this.claveRastreo = claveRastreo;
1054
+ this.reasonCode = reasonCode;
1055
+ this.message = message;
1056
+ this.completedAt = data.dateToUTC(completedAt);
1057
+ }
1058
+
1059
+ static fromObject = ({
1060
+ id,
1061
+ amount,
1062
+ concepto,
1063
+ clabe,
1064
+ status,
1065
+ message,
1066
+ ...obj
1067
+ }) =>
1068
+ new FraudFundsTransfer({
1069
+ id,
1070
+ amount,
1071
+ concepto,
1072
+ clabe,
1073
+ status,
1074
+ message,
1075
+ requestId: obj.request_id,
1076
+ createdAt: obj.created_at,
1077
+ updatedAt: obj.updated_at,
1078
+ requestedAt: obj.requested_at,
1079
+ userId: obj.user_id,
1080
+ transactionId: obj.transaction_id,
1081
+ claveRastreo: obj.clave_rastreo,
1082
+ reasonCode: obj.reason_code,
1083
+ completedAt: obj.completed_at,
1084
+ });
1085
+ }
1086
+
1024
1087
  class KYCValidations {
1025
1088
  constructor({
1026
1089
  id,
@@ -1999,6 +2062,7 @@ const getModelFromPath = (path, obj) => {
1999
2062
  commissions: () => Commission.fromObject(obj),
2000
2063
  deposits: () => Deposit.fromObject(obj),
2001
2064
  files: () => File.fromObject(obj),
2065
+ fraud_funds_transfers: () => FraudFundsTransfer.fromObject(obj),
2002
2066
  kyc_validations: () => KYCValidations.fromObject(obj),
2003
2067
  login_tokens: () => LoginToken.fromObject(obj),
2004
2068
  partners: () => Partner.fromObject(obj),
@@ -2473,6 +2537,29 @@ class FileResource extends mix(Resource).with(Downlodable, Uploadable) {
2473
2537
  }
2474
2538
  }
2475
2539
 
2540
+ class FraudFundsTransferResource extends mix(Resource).with(
2541
+ Creatable,
2542
+ Queryable,
2543
+ Retrievable,
2544
+ ) {
2545
+ constructor(client) {
2546
+ super('fraud_funds_transfers', vulnerableActivity.FraudFundsTransferQuery, client);
2547
+ }
2548
+
2549
+ async create({ requestId, userId, amount, concepto, clabe, reason }) {
2550
+ const request = new walletTransactionRequest.FraudFundsTransferRequest({
2551
+ requestId,
2552
+ userId,
2553
+ amount,
2554
+ concepto,
2555
+ clabe,
2556
+ reason,
2557
+ });
2558
+ const fraudFundsTransfer = await this._create(request.toObject());
2559
+ return fraudFundsTransfer;
2560
+ }
2561
+ }
2562
+
2476
2563
  class KYCValidationsResource extends mix(Resource).with(
2477
2564
  Creatable,
2478
2565
  Retrievable,
@@ -2868,6 +2955,7 @@ class Cuenca {
2868
2955
  this.commissions = new CommissionResource(client);
2869
2956
  this.deposits = new DepositResource(client);
2870
2957
  this.files = new FileResource(client);
2958
+ this.fraudFundsTransfers = new FraudFundsTransferResource(client);
2871
2959
  this.kycValidations = new KYCValidationsResource(client);
2872
2960
  this.loginTokens = new LoginTokenResource(client);
2873
2961
  this.partners = new PartnerResource(client);
package/build/index.mjs CHANGED
@@ -3,8 +3,8 @@ import Buffer from 'buffer';
3
3
  import { CuencaResponseException, CuencaException, NoResultFound, MultipleResultsFound, InvalidPassword } from './errors/index.mjs';
4
4
  import { Jwt } from './jwt/index.mjs';
5
5
  import { P as Phase, F as FileFormat, d as dateToUTC, e as enumValueFromString, M as MLIndicatorLevel, a as MLIndicatorPeriod, A as AlertStatus, S as SourceAlertType, b as MLIndicatorType, c as PLDFilterType, E as EntryType, T as TransactionStatus, B as BridgeAccountStatus, f as BridgeBankAccountStatus, C as Currency, N as Network, g as BridgeTransactionType, h as CardFundingType, i as CardIssuer, j as CardStatus, k as CardType, l as CardErrorType, m as CardTransactionType, n as CommissionType, D as DepositNetwork, K as KYCFileType, V as VerificationStatus, o as KYCValidationSource, U as UserStatus, p as State, q as Country, r as SavingCategory, s as ServiceProviderCategory, t as SessionType, u as TransferNetwork, v as VerificationType, W as WalletTransactionType } from './data-519413b2.mjs';
6
- import { A as AlertLog, a as Address, K as KYCFile, T as TOSAgreements, b as TransactionalProfileServices, S as ShareholderMoral, L as LegalRepresentatives, E as ExternalAccount, V as VulnerableActivity, c as Audit, d as License, B as BusinessDetails, e as AccountQuery, f as AlertQuery, g as ApiKeyQuery, h as BalanceEntryQuery, i as BillPaymentQuery, j as BridgeAccountQuery, k as BridgeBankAccountQuery, l as BridgeQuery, m as BridgeTransactionQuery, C as CardsQuery, n as CardTransactionQuery, Q as QueryParams, D as DepositQuery, P as PartnerQuery, o as PostalCodeQuery, W as WalletQuery, p as StatementQuery, q as TransferQuery, U as UserQuery, r as WalletTransactionQuery } from './vulnerableActivity-0f22cc8e.mjs';
7
- import { A as AlertUpdateRequest, a as ApiKeyUpdateRequest, b as ArpcRequest, U as UserUpdateRequest, C as CardActivationRequest, c as CardRequest, d as CardUpdateRequest, e as CardValidationRequest, K as KYCValidationsRequest, P as PartnerUserRequest, S as SavingRequest, f as SessionRequest, T as TransferRequest, g as UserCredentialRequest, h as UserCredentialUpdateRequest, i as UserLoginRequest, V as VerificationRequest, j as VerificationAttemptRequest, W as WalletTransactionRequest } from './walletTransactionRequest-6a795cea.mjs';
6
+ import { A as AlertLog, a as Address, K as KYCFile, T as TOSAgreements, b as TransactionalProfileServices, S as ShareholderMoral, L as LegalRepresentatives, E as ExternalAccount, V as VulnerableActivity, c as Audit, d as License, B as BusinessDetails, e as AccountQuery, f as AlertQuery, g as ApiKeyQuery, h as BalanceEntryQuery, i as BillPaymentQuery, j as BridgeAccountQuery, k as BridgeBankAccountQuery, l as BridgeQuery, m as BridgeTransactionQuery, C as CardsQuery, n as CardTransactionQuery, Q as QueryParams, D as DepositQuery, F as FraudFundsTransferQuery, P as PartnerQuery, o as PostalCodeQuery, W as WalletQuery, p as StatementQuery, q as TransferQuery, U as UserQuery, r as WalletTransactionQuery } from './vulnerableActivity-8650ee9e.mjs';
7
+ import { A as AlertUpdateRequest, a as ApiKeyUpdateRequest, b as ArpcRequest, U as UserUpdateRequest, C as CardActivationRequest, c as CardRequest, d as CardUpdateRequest, e as CardValidationRequest, F as FraudFundsTransferRequest, K as KYCValidationsRequest, P as PartnerUserRequest, S as SavingRequest, f as SessionRequest, T as TransferRequest, g as UserCredentialRequest, h as UserCredentialUpdateRequest, i as UserLoginRequest, V as VerificationRequest, j as VerificationAttemptRequest, W as WalletTransactionRequest } from './walletTransactionRequest-b3f3f832.mjs';
8
8
 
9
9
  /* global window */
10
10
 
@@ -17,7 +17,7 @@ const isNode =
17
17
 
18
18
  const runtimeEnv = { isBrowser, isNode };
19
19
 
20
- const name="@cuenca-mx/cuenca-js";const version="1.1.0-dev0";const description="Cuenca client for JS";const main="./build/index.cjs";const module="./build/index.mjs";const types="./typings/index.d.ts";const browser="./build/umd/cuenca.umd.js";const files=["build/**/*","typings/**/*"];const exports={".":{types:"./typings/index.d.ts","import":"./build/index.mjs",require:"./build/index.cjs"},"./errors":{types:"./typings/errors/index.d.ts","import":"./build/errors/index.mjs",require:"./build/errors/index.cjs"},"./jwt":{"import":"./build/jwt/index.mjs",require:"./build/jwt/index.cjs"},"./requests":{"import":"./build/requests/index.mjs",require:"./build/requests/index.cjs"},"./types":{types:"./typings/types/index.d.ts","import":"./build/types/index.mjs",require:"./build/types/index.cjs"}};const packageManager="yarn@3.0.2";const type="module";const repository={type:"git",url:"https://github.com/cuenca-mx/cuenca-js.git",directory:"packages/cuenca-js"};const keywords=["cuenca"];const license="MIT";const bugs={url:"https://github.com/cuenca-mx/cuenca-js/issues"};const homepage="https://cuenca.com";const scripts={build:"rm -rf build/ && yarn rollup --config",test:"yarn node --experimental-vm-modules $(yarn bin jest)",publish:"yarn build && yarn npm publish",dev:"rm -rf build/ && yarn rollup --config && yarn node ../example.cjs",example:"yarn node ../example.cjs"};const devDependencies={"@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.1.1",jest:"^27.4.5",rollup:"^2.61.1","rollup-plugin-terser":"^7.0.2"};const dependencies={axios:"^0.24.0",buffer:"^6.0.3"};var pkg = {name:name,version:version,description:description,main:main,module:module,types:types,browser:browser,files:files,exports:exports,packageManager:packageManager,type:type,repository:repository,keywords:keywords,license:license,bugs:bugs,homepage:homepage,scripts:scripts,devDependencies:devDependencies,dependencies:dependencies};
20
+ const name="@cuenca-mx/cuenca-js";const version="1.1.1-dev1";const description="Cuenca client for JS";const main="./build/index.cjs";const module="./build/index.mjs";const browser="./build/umd/cuenca.umd.js";const files=["build/**/*"];const exports={".":{"import":"./build/index.mjs",require:"./build/index.cjs"},"./errors":{"import":"./build/errors/index.mjs",require:"./build/errors/index.cjs"},"./jwt":{"import":"./build/jwt/index.mjs",require:"./build/jwt/index.cjs"},"./requests":{"import":"./build/requests/index.mjs",require:"./build/requests/index.cjs"},"./types":{"import":"./build/types/index.mjs",require:"./build/types/index.cjs"}};const packageManager="yarn@3.0.2";const type="module";const repository={type:"git",url:"https://github.com/cuenca-mx/cuenca-js.git",directory:"packages/cuenca-js"};const keywords=["cuenca"];const license="MIT";const bugs={url:"https://github.com/cuenca-mx/cuenca-js/issues"};const homepage="https://cuenca.com";const scripts={build:"rm -rf build/ && yarn rollup --config",test:"yarn node --experimental-vm-modules $(yarn bin jest)",publish:"yarn build && yarn npm publish",dev:"rm -rf build/ && yarn rollup --config && yarn node ../example.cjs",example:"yarn node ../example.cjs"};const devDependencies={"@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.1.1",jest:"^27.4.5",rollup:"^2.61.1","rollup-plugin-terser":"^7.0.2"};const dependencies={axios:"^0.24.0",buffer:"^6.0.3"};var pkg = {name:name,version:version,description:description,main:main,module:module,browser:browser,files:files,exports:exports,packageManager:packageManager,type:type,repository:repository,keywords:keywords,license:license,bugs:bugs,homepage:homepage,scripts:scripts,devDependencies:devDependencies,dependencies:dependencies};
21
21
 
22
22
  class Client {
23
23
  constructor({
@@ -1012,6 +1012,69 @@ class File {
1012
1012
  new File({ extension, type, url, userId: obj.user_id });
1013
1013
  }
1014
1014
 
1015
+ class FraudFundsTransfer {
1016
+ constructor({
1017
+ id,
1018
+ requestId,
1019
+ createdAt,
1020
+ updatedAt,
1021
+ requestedAt,
1022
+ userId,
1023
+ amount,
1024
+ concepto,
1025
+ clabe,
1026
+ status,
1027
+ transactionId,
1028
+ claveRastreo,
1029
+ reasonCode,
1030
+ message,
1031
+ completedAt,
1032
+ }) {
1033
+ this.id = id;
1034
+ this.requestId = requestId;
1035
+ this.createdAt = dateToUTC(createdAt);
1036
+ this.updatedAt = dateToUTC(updatedAt);
1037
+ this.requestedAt = dateToUTC(requestedAt);
1038
+ this.userId = userId;
1039
+ this.amount = amount;
1040
+ this.concepto = concepto;
1041
+ this.clabe = clabe;
1042
+ this.status = enumValueFromString(TransactionStatus, status);
1043
+ this.transactionId = transactionId;
1044
+ this.claveRastreo = claveRastreo;
1045
+ this.reasonCode = reasonCode;
1046
+ this.message = message;
1047
+ this.completedAt = dateToUTC(completedAt);
1048
+ }
1049
+
1050
+ static fromObject = ({
1051
+ id,
1052
+ amount,
1053
+ concepto,
1054
+ clabe,
1055
+ status,
1056
+ message,
1057
+ ...obj
1058
+ }) =>
1059
+ new FraudFundsTransfer({
1060
+ id,
1061
+ amount,
1062
+ concepto,
1063
+ clabe,
1064
+ status,
1065
+ message,
1066
+ requestId: obj.request_id,
1067
+ createdAt: obj.created_at,
1068
+ updatedAt: obj.updated_at,
1069
+ requestedAt: obj.requested_at,
1070
+ userId: obj.user_id,
1071
+ transactionId: obj.transaction_id,
1072
+ claveRastreo: obj.clave_rastreo,
1073
+ reasonCode: obj.reason_code,
1074
+ completedAt: obj.completed_at,
1075
+ });
1076
+ }
1077
+
1015
1078
  class KYCValidations {
1016
1079
  constructor({
1017
1080
  id,
@@ -1990,6 +2053,7 @@ const getModelFromPath = (path, obj) => {
1990
2053
  commissions: () => Commission.fromObject(obj),
1991
2054
  deposits: () => Deposit.fromObject(obj),
1992
2055
  files: () => File.fromObject(obj),
2056
+ fraud_funds_transfers: () => FraudFundsTransfer.fromObject(obj),
1993
2057
  kyc_validations: () => KYCValidations.fromObject(obj),
1994
2058
  login_tokens: () => LoginToken.fromObject(obj),
1995
2059
  partners: () => Partner.fromObject(obj),
@@ -2464,6 +2528,29 @@ class FileResource extends mix(Resource).with(Downlodable, Uploadable) {
2464
2528
  }
2465
2529
  }
2466
2530
 
2531
+ class FraudFundsTransferResource extends mix(Resource).with(
2532
+ Creatable,
2533
+ Queryable,
2534
+ Retrievable,
2535
+ ) {
2536
+ constructor(client) {
2537
+ super('fraud_funds_transfers', FraudFundsTransferQuery, client);
2538
+ }
2539
+
2540
+ async create({ requestId, userId, amount, concepto, clabe, reason }) {
2541
+ const request = new FraudFundsTransferRequest({
2542
+ requestId,
2543
+ userId,
2544
+ amount,
2545
+ concepto,
2546
+ clabe,
2547
+ reason,
2548
+ });
2549
+ const fraudFundsTransfer = await this._create(request.toObject());
2550
+ return fraudFundsTransfer;
2551
+ }
2552
+ }
2553
+
2467
2554
  class KYCValidationsResource extends mix(Resource).with(
2468
2555
  Creatable,
2469
2556
  Retrievable,
@@ -2859,6 +2946,7 @@ class Cuenca {
2859
2946
  this.commissions = new CommissionResource(client);
2860
2947
  this.deposits = new DepositResource(client);
2861
2948
  this.files = new FileResource(client);
2949
+ this.fraudFundsTransfers = new FraudFundsTransferResource(client);
2862
2950
  this.kycValidations = new KYCValidationsResource(client);
2863
2951
  this.loginTokens = new LoginTokenResource(client);
2864
2952
  this.partners = new PartnerResource(client);
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var walletTransactionRequest = require('../walletTransactionRequest-828de982.cjs');
5
+ var walletTransactionRequest = require('../walletTransactionRequest-a184c79e.cjs');
6
6
  require('../errors/index.cjs');
7
7
  require('../data-5a8f0772.cjs');
8
8
 
@@ -35,6 +35,7 @@ exports.CardActivationRequest = walletTransactionRequest.CardActivationRequest;
35
35
  exports.CardRequest = walletTransactionRequest.CardRequest;
36
36
  exports.CardUpdateRequest = walletTransactionRequest.CardUpdateRequest;
37
37
  exports.CardValidationRequest = walletTransactionRequest.CardValidationRequest;
38
+ exports.FraudFundsTransferRequest = walletTransactionRequest.FraudFundsTransferRequest;
38
39
  exports.KYCValidationsRequest = walletTransactionRequest.KYCValidationsRequest;
39
40
  exports.PartnerUserRequest = walletTransactionRequest.PartnerUserRequest;
40
41
  exports.SavingRequest = walletTransactionRequest.SavingRequest;
@@ -1,5 +1,5 @@
1
- import { B as BaseRequest } from '../walletTransactionRequest-6a795cea.mjs';
2
- export { k as AddressUpdateRequest, A as AlertUpdateRequest, a as ApiKeyUpdateRequest, b as ArpcRequest, C as CardActivationRequest, c as CardRequest, d as CardUpdateRequest, e as CardValidationRequest, K as KYCValidationsRequest, P as PartnerUserRequest, S as SavingRequest, f as SessionRequest, T as TransferRequest, g as UserCredentialRequest, h as UserCredentialUpdateRequest, i as UserLoginRequest, U as UserUpdateRequest, j as VerificationAttemptRequest, V as VerificationRequest, W as WalletTransactionRequest } from '../walletTransactionRequest-6a795cea.mjs';
1
+ import { B as BaseRequest } from '../walletTransactionRequest-b3f3f832.mjs';
2
+ export { k as AddressUpdateRequest, A as AlertUpdateRequest, a as ApiKeyUpdateRequest, b as ArpcRequest, C as CardActivationRequest, c as CardRequest, d as CardUpdateRequest, e as CardValidationRequest, F as FraudFundsTransferRequest, K as KYCValidationsRequest, P as PartnerUserRequest, S as SavingRequest, f as SessionRequest, T as TransferRequest, g as UserCredentialRequest, h as UserCredentialUpdateRequest, i as UserLoginRequest, U as UserUpdateRequest, j as VerificationAttemptRequest, V as VerificationRequest, W as WalletTransactionRequest } from '../walletTransactionRequest-b3f3f832.mjs';
3
3
  import '../errors/index.mjs';
4
4
  import '../data-519413b2.mjs';
5
5
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var data = require('../data-5a8f0772.cjs');
6
- var vulnerableActivity = require('../vulnerableActivity-d94f9fba.cjs');
6
+ var vulnerableActivity = require('../vulnerableActivity-ee25810d.cjs');
7
7
  require('../errors/index.cjs');
8
8
 
9
9
  class PageSize {
@@ -92,6 +92,7 @@ exports.CardTransactionQuery = vulnerableActivity.CardTransactionQuery;
92
92
  exports.CardsQuery = vulnerableActivity.CardsQuery;
93
93
  exports.DepositQuery = vulnerableActivity.DepositQuery;
94
94
  exports.ExternalAccount = vulnerableActivity.ExternalAccount;
95
+ exports.FraudFundsTransferQuery = vulnerableActivity.FraudFundsTransferQuery;
95
96
  exports.KYCFile = vulnerableActivity.KYCFile;
96
97
  exports.LegalRepresentatives = vulnerableActivity.LegalRepresentatives;
97
98
  exports.License = vulnerableActivity.License;
@@ -1,5 +1,5 @@
1
1
  export { A as AlertStatus, B as BridgeAccountStatus, f as BridgeBankAccountStatus, g as BridgeTransactionType, l as CardErrorType, h as CardFundingType, i as CardIssuer, j as CardStatus, m as CardTransactionType, k as CardType, n as CommissionType, q as Country, C as Currency, D as DepositNetwork, E as EntryType, F as FileFormat, K as KYCFileType, o as KYCValidationSource, M as MLIndicatorLevel, a as MLIndicatorPeriod, b as MLIndicatorType, N as Network, c as PLDFilterType, P as Phase, r as SavingCategory, s as ServiceProviderCategory, t as SessionType, S as SourceAlertType, p as State, w as TrackDataMethod, T as TransactionStatus, u as TransferNetwork, U as UserStatus, x as UserType, V as VerificationStatus, v as VerificationType, W as WalletTransactionType } from '../data-519413b2.mjs';
2
- export { e as AccountQuery, a as Address, A as AlertLog, f as AlertQuery, g as ApiKeyQuery, c as Audit, h as BalanceEntryQuery, i as BillPaymentQuery, j as BridgeAccountQuery, k as BridgeBankAccountQuery, l as BridgeQuery, m as BridgeTransactionQuery, B as BusinessDetails, n as CardTransactionQuery, C as CardsQuery, D as DepositQuery, E as ExternalAccount, K as KYCFile, L as LegalRepresentatives, d as License, P as PartnerQuery, o as PostalCodeQuery, Q as QueryParams, S as ShareholderMoral, p as StatementQuery, T as TOSAgreements, s as TransactionQuery, b as TransactionalProfileServices, q as TransferQuery, U as UserQuery, t as VerificationError, V as VulnerableActivity, W as WalletQuery, r as WalletTransactionQuery } from '../vulnerableActivity-0f22cc8e.mjs';
2
+ export { e as AccountQuery, a as Address, A as AlertLog, f as AlertQuery, g as ApiKeyQuery, c as Audit, h as BalanceEntryQuery, i as BillPaymentQuery, j as BridgeAccountQuery, k as BridgeBankAccountQuery, l as BridgeQuery, m as BridgeTransactionQuery, B as BusinessDetails, n as CardTransactionQuery, C as CardsQuery, D as DepositQuery, E as ExternalAccount, F as FraudFundsTransferQuery, K as KYCFile, L as LegalRepresentatives, d as License, P as PartnerQuery, o as PostalCodeQuery, Q as QueryParams, S as ShareholderMoral, p as StatementQuery, T as TOSAgreements, s as TransactionQuery, b as TransactionalProfileServices, q as TransferQuery, U as UserQuery, t as VerificationError, V as VulnerableActivity, W as WalletQuery, r as WalletTransactionQuery } from '../vulnerableActivity-8650ee9e.mjs';
3
3
  import '../errors/index.mjs';
4
4
 
5
5
  class PageSize {
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("axios"),require("buffer")):"function"==typeof define&&define.amd?define(["exports","axios","buffer"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).cuenca={},t.axios,t.Buffer)}(this,(function(t,e,s){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=i(e),r=i(s);class n extends Error{constructor(t){super(t),Object.setPrototypeOf(this,n.prototype)}}class c extends n{constructor(t,e){super(`Cuenca Response Error: ${e}`),this.name="CuencaResponseError",this.data=t,this.status=e,Object.setPrototypeOf(this,c.prototype)}}class o extends n{constructor(){super("No results were found"),this.name="NoResultFound",Object.setPrototypeOf(this,o.prototype)}}class d extends n{constructor(){super("One result was expected but multiple were found"),this.name="MultipleResultsFound",Object.setPrototypeOf(this,d.prototype)}}class u extends n{constructor(){super("An invalid JWT token was obtained during authentication"),this.name="MalformedJwtToken",Object.setPrototypeOf(this,u.prototype)}}class h extends n{constructor(){super("Invalid password"),this.name="InvalidPassword",Object.setPrototypeOf(this,h.prototype)}}class l extends Error{constructor(t){super(t),Object.setPrototypeOf(this,l.prototype)}}const p="undefined"!=typeof window&&void 0!==window.document,m="undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process),w=p,_=m;class f{constructor(t,e){this.expiresAt=t,this.token=e}get isExpired(){const t=new Date;return(this.expiresAt.valueOf()-t.valueOf())/6e4<=5}static getExpirationDate=t=>{let e;try{const[,s]=t.split(".");e=JSON.parse(r.default.Buffer.from(`${s}==`,"base64").toString())}catch(t){throw new u}const{exp:s}=e;return new Date(new Date(1e3*s).toUTCString())};static create=async t=>{const e=t;e.jwtToken=null;const s=e.deleteRequestHeader("X-Cuenca-Token"),{token:i}=await t.post("token",{});s.eject();const a=f.getExpirationDate(i);return new f(a,i)}}class b{static Created=new b("created");static ReadyForAnalysis=new b("ready_for_analysis");static Analysis=new b("analysis");static Dictum=new b("dictum");static Justified=new b("justified");static Unusual=new b("unusual");static Reported=new b("reported");static Questionary=new b("questionary");static JustifiedByTime=new b("justified_by_time");static AdditionalInformation=new b("additional_information");static Documentation=new b("documentation");static Xml=new b("xml");constructor(t){this.value=t}}class y{static Succeeded=new y("succeeded");static NotValidated=new y("not_validated");static Failed=new y("failed");static OnWaitList=new y("on_wait_list");constructor(t){this.value=t}}class g{static Created=new g("created");static Failed=new g("failed");static Pending=new g("pending");static Succeeded=new g("succeeded");constructor(t){this.value=t}}class v{static Blocked=new v("blocked");static Comunication=new v("comunication");static ContactlesAmountLimit=new v("contactles_amount_limit");static FraudDetection=new v("fraud_detection");static FraudDetectionUncertain=new v("fraud_detection_uncertain");static InsufficientFounds=new v("insufficient_founds");static InvalidPin=new v("invalid_pin");static Notification=new v("notification");static NotificationDeactivatedCard=new v("notification_deactivated_card");constructor(t){this.value=t}}class A{static Credit=new A("credit");static Debit=new A("debit");constructor(t){this.value=t}}class O{static Accendo=new O("accendo");static Cuenca=new O("cuenca");constructor(t){this.value=t}}class j{static Buy=new j("buy");static Sell=new j("sell");constructor(t){this.value=t}}class I{static Active=new I("active");static Blocked=new I("blocked");static Created=new I("created");static Deactivated=new I("deactivated");static Printing=new I("printing");constructor(t){this.value=t}}class S{static Auth=new S("auth");static Capture=new S("capture");static Chargeback=new S("chargeback");static Expiration=new S("expiration");static Refund=new S("refund");static Void=new S("void");constructor(t){this.value=t}}class x{static Mxn=new x("mxn");static Usdc=new x("usdc");static Sol=new x("sol");constructor(t){this.value=t}}class T{static Physical=new T("physical");static Virtual=new T("virtual");constructor(t){this.value=t}}class C{static CardRequest=new C("card_request");static CashDeposit=new C("cash_deposit");static OutgoingSpei=new C("outgoing_spei");constructor(t){this.value=t}}class N{static Cash=new N("cash");static Internal=new N("internal");static Spei=new N("spei");constructor(t){this.value=t}}class k{static Credit=new k("credit");static Debit=new k("debit");constructor(t){this.value=t}}class D{static Pdf=new D("application/pdf");static Xml=new D("application/xml");static Json=new D("application/json");static Any=new D("*/*");constructor(t){this.value=t}}class U{static Curp=new U("curp");static Dni=new U("dni");static Ine=new U("ine");static Passport=new U("passport");static Residency=new U("residency");static MatriculaConsular=new U("matricula_consular");static ProofOfLiveness=new U("proof_of_liveness");static ProofOfAddress=new U("proof_of_address");constructor(t){this.value=t}}class M{static Client=new M("client");static Server=new M("server");constructor(t){this.value=t}}class R{static Low=new R("low");static Medium=new R("medium");static High=new R("high");constructor(t){this.value=t}}class P{static Deposit=new P("deposit");static Withdrawal=new P("withdrawal");constructor(t){this.value=t}}class B{static Bimester=new B("bimester");static Trimester=new B("trimester");static Semester=new B("semester");constructor(t){this.value=t}}class L{static Polygon=new L("polygon");static Solana=new L("solana");constructor(t){this.value=t}}class q{static Sandbox=new q("sandbox-api");static Stage=new q("stage-api");static Api=new q("api");constructor(t){this.value=t}}class E{static Amount=new E("amount");static Volume=new E("volume");constructor(t){this.value=t}}class K{static AW=new K("AW");static AF=new K("AF");static AO=new K("AO");static AI=new K("AI");static AX=new K("AX");static AL=new K("AL");static AD=new K("AD");static AE=new K("AE");static AR=new K("AR");static AM=new K("AM");static AS=new K("AS");static AQ=new K("AQ");static TF=new K("TF");static AG=new K("AG");static AU=new K("AU");static AT=new K("AT");static AZ=new K("AZ");static BI=new K("BI");static BE=new K("BE");static BJ=new K("BJ");static BQ=new K("BQ");static BF=new K("BF");static BD=new K("BD");static BG=new K("BG");static BH=new K("BH");static BS=new K("BS");static BA=new K("BA");static BL=new K("BL");static BY=new K("BY");static BZ=new K("BZ");static BM=new K("BM");static BO=new K("BO");static BR=new K("BR");static BB=new K("BB");static BN=new K("BN");static BT=new K("BT");static BV=new K("BV");static BW=new K("BW");static CF=new K("CF");static CA=new K("CA");static CC=new K("CC");static CH=new K("CH");static CL=new K("CL");static CN=new K("CN");static CI=new K("CI");static CM=new K("CM");static CD=new K("CD");static CG=new K("CG");static CK=new K("CK");static CO=new K("CO");static KM=new K("KM");static CV=new K("CV");static CR=new K("CR");static CU=new K("CU");static CW=new K("CW");static CX=new K("CX");static KY=new K("KY");static CY=new K("CY");static CZ=new K("CZ");static DE=new K("DE");static DJ=new K("DJ");static DM=new K("DM");static DK=new K("DK");static DO=new K("DO");static DZ=new K("DZ");static EC=new K("EC");static EG=new K("EG");static ER=new K("ER");static EH=new K("EH");static ES=new K("ES");static EE=new K("EE");static ET=new K("ET");static FI=new K("FI");static FJ=new K("FJ");static FK=new K("FK");static FR=new K("FR");static FO=new K("FO");static FM=new K("FM");static GA=new K("GA");static GB=new K("GB");static GE=new K("GE");static GG=new K("GG");static GH=new K("GH");static GI=new K("GI");static GN=new K("GN");static GP=new K("GP");static GM=new K("GM");static GW=new K("GW");static GQ=new K("GQ");static GR=new K("GR");static GD=new K("GD");static GL=new K("GL");static GT=new K("GT");static GF=new K("GF");static GU=new K("GU");static GY=new K("GY");static HK=new K("HK");static HM=new K("HM");static HN=new K("HN");static HR=new K("HR");static HT=new K("HT");static HU=new K("HU");static ID=new K("ID");static IM=new K("IM");static IN=new K("IN");static IO=new K("IO");static IE=new K("IE");static IR=new K("IR");static IQ=new K("IQ");static IS=new K("IS");static IL=new K("IL");static IT=new K("IT");static JM=new K("JM");static JE=new K("JE");static JO=new K("JO");static JP=new K("JP");static KZ=new K("KZ");static KE=new K("KE");static KG=new K("KG");static KH=new K("KH");static KI=new K("KI");static KN=new K("KN");static KR=new K("KR");static KW=new K("KW");static LA=new K("LA");static LB=new K("LB");static LC=new K("LC");static LI=new K("LI");static LK=new K("LK");static LR=new K("LR");static LS=new K("LS");static LT=new K("LT");static LU=new K("LU");static LV=new K("LV");static LY=new K("LY");static MA=new K("MA");static MC=new K("MC");static MD=new K("MD");static MG=new K("MG");static MV=new K("MV");static MX=new K("MX");static MH=new K("MH");static MK=new K("MK");static ML=new K("ML");static MT=new K("MT");static MM=new K("MM");static ME=new K("ME");static MN=new K("MN");static MP=new K("MP");static MZ=new K("MZ");static MR=new K("MR");static MS=new K("MS");static MQ=new K("MQ");static MU=new K("MU");static MW=new K("MW");static MY=new K("MY");static YT=new K("YT");static NA=new K("NA");static NC=new K("NC");static NE=new K("NE");static NF=new K("NF");static NG=new K("NG");static NI=new K("NI");static NU=new K("NU");static NL=new K("NL");static NO=new K("NO");static NP=new K("NP");static NR=new K("NR");static NZ=new K("NZ");static OM=new K("OM");static PK=new K("PK");static PA=new K("PA");static PN=new K("PN");static PE=new K("PE");static PH=new K("PH");static PW=new K("PW");static PG=new K("PG");static PL=new K("PL");static PR=new K("PR");static KP=new K("KP");static PT=new K("PT");static PY=new K("PY");static PS=new K("PS");static PF=new K("PF");static QA=new K("QA");static RE=new K("RE");static RO=new K("RO");static RU=new K("RU");static RW=new K("RW");static SA=new K("SA");static SD=new K("SD");static SN=new K("SN");static SG=new K("SG");static GS=new K("GS");static SH=new K("SH");static SJ=new K("SJ");static SB=new K("SB");static SL=new K("SL");static SV=new K("SV");static SM=new K("SM");static SO=new K("SO");static PM=new K("PM");static RS=new K("RS");static SS=new K("SS");static ST=new K("ST");static SR=new K("SR");static SK=new K("SK");static SI=new K("SI");static SE=new K("SE");static SZ=new K("SZ");static SX=new K("SX");static SC=new K("SC");static SY=new K("SY");static TC=new K("TC");static TD=new K("TD");static TG=new K("TG");static TH=new K("TH");static TJ=new K("TJ");static TK=new K("TK");static TM=new K("TM");static TL=new K("TL");static TO=new K("TO");static TT=new K("TT");static TN=new K("TN");static TR=new K("TR");static TV=new K("TV");static TW=new K("TW");static TZ=new K("TZ");static UG=new K("UG");static UA=new K("UA");static UM=new K("UM");static UY=new K("UY");static US=new K("US");static UZ=new K("UZ");static VA=new K("VA");static VC=new K("VC");static VE=new K("VE");static VG=new K("VG");static VI=new K("VI");static VN=new K("VN");static VU=new K("VU");static WF=new K("WF");static WS=new K("WS");static YE=new K("YE");static ZA=new K("ZA");static ZM=new K("ZM");static ZW=new K("ZW");static XA=new K("XA");constructor(t){this.value=t}}class G{static NE=new G("NE");static AS=new G("AS");static BC=new G("BC");static BS=new G("BS");static CC=new G("CC");static CS=new G("CS");static CH=new G("CH");static CL=new G("CL");static CM=new G("CM");static DF=new G("DF");static DG=new G("DG");static GT=new G("GT");static GR=new G("GR");static HG=new G("HG");static JC=new G("JC");static MC=new G("MC");static MN=new G("MN");static MS=new G("MS");static NT=new G("NT");static NL=new G("NL");static OC=new G("OC");static PL=new G("PL");static QT=new G("QT");static QR=new G("QR");static SP=new G("SP");static SL=new G("SL");static SR=new G("SR");static TC=new G("TC");static TL=new G("TL");static TS=new G("TS");static VZ=new G("VZ");static YN=new G("YN");static ZS=new G("ZS");constructor(t){this.value=t}}class F{static Cable=new F("cable");static CreditCard=new F("credit_card");static Electricity=new F("electricity");static Gas=new F("gas");static Internet=new F("internet");static LandlineTelephone=new F("landline_telephone");static MobileTelephonePostpaid=new F("mobile_telephone_postpaid");static MobileTelephonePrepaid=new F("mobile_telephone_prepaid");static SateliteTelevision=new F("satelite_television");static Water=new F("water");constructor(t){this.value=t}}class V{static General=new V("general");static Home=new V("home");static Vehicle=new V("vehicle");static Travel=new V("travel");static Clothing=new V("clothing");static Other=new V("other");static Medical=new V("medical");static Accident=new V("accident");static Education=new V("education");constructor(t){this.value=t}}class H{static AccountEntries=new H("session.account_entries");static DownloadFile=new H("session.download_file");static Registration=new H("session.registration");static ShowCard=new H("session.show_card");static UploadFile=new H("session.upload_file");constructor(t){this.value=t}}class Y{static Chester=new Y("chester");static External=new Y("external");static Manual=new Y("manual");constructor(t){this.value=t}}class ${static NotSet=new $("not_set");static Terminal=new $("terminal");static Manual=new $("manual");static Unknown=new $("unknown");static Contactless=new $("contactless");static FallBack=new $("fall_back");static MagneticStripe=new $("magnetic_stripe");static RecurringCharge=new $("recurring_charge");constructor(t){this.value=t}}class W{static Created=new W("created");static Failed=new W("failed");static InReview=new W("in_review");static Submitted=new W("submitted");static Succeeded=new W("succeeded");constructor(t){this.value=t}}class Z{static Internal=new Z("internal");static Spei=new Z("spei");constructor(t){this.value=t}}class Q{static Active=new Q("active");static Deactivated=new Q("deactivated");static InReview=new Q("in_review");static Fraud=new Q("fraud");static PldBlocked=new Q("pld_blocked");static UserBlocked=new Q("user_blocked");static Inactive=new Q("inactive");constructor(t){this.value=t}}class J{static Moral=new J("moral");static Physical=new J("physical");constructor(t){this.value=t}}class X{static Created=new X("created");static NotVerified=new X("not_verified");static Rejected=new X("rejected");static ReviewNeeded=new X("review_needed");static Submitted=new X("submitted");static Succeeded=new X("succeeded");static UploadAgain=new X("upload_again");constructor(t){this.value=t}}class z{static Phone=new z("phone");static Email=new z("email");constructor(t){this.value=t}}class tt{static Deposit=new tt("deposit");static Withdrawal=new tt("withdrawal");constructor(t){this.value=t}}class et{constructor({createdAfter:t,createdBefore:e,limit:s,pageSize:i,relatedTransaction:a,userId:r,count:n=!1}){this.createdAfter=t,this.createdBefore=e,this._lmt=s,this.relatedTransaction=a,this.userId=r,this.count=n,this.pageSize=i}get limit(){return this._limit}set _lmt(t){let e=null;"number"==typeof t&&t>=0&&(e=t),this._limit=e}toObject(){return{created_after:this.createdAfter,created_before:this.createdBefore,limit:this.limit,related_transaction:this.relatedTransaction,user_id:this.userId,page_size:this.pageSize&&this.pageSize.size}}toParams(){const t={...this.toObject()};return this.count&&(t.count=1),Object.keys(t).forEach((e=>{null==t[e]&&delete t[e]})),t}toQueryString(){return new URLSearchParams(this.toParams()).toString()}}class st extends et{constructor({accountNumber:t,...e}){super(e),this.accountNumber=t}toObject(){return Object.assign(super.toObject(),{account_number:this.accountNumber})}}class it extends et{constructor({agent:t,comments:e,committeeMeetingDate:s,count:i,hasQuestionnaire:a,inProcess:r,status:n,typeOfFilter:c,transactionDate:o,...d}){super(d),this.agent=t,this.comments=e,this.committeeMeetingDate=s,this.count=i,this.hasQuestionnaire=a,this.inProcess=r,this.status=n,this.typeOfFilter=c,this.transactionDate=o}toObject(){return Object.assign(super.toObject(),{agent:this.agent,comments:this.comments,committee_meeting_date:this.committeeMeetingDate,count:this.count,has_questionnaire:this.hasQuestionnaire,in_process:this.inProcess,status:this.status,transaction_date:this.transactionDate,type_of_filter:this.typeOfFilter})}}class at extends et{constructor({active:t,...e}){super(e),this.active=t}toObject(){return Object.assign(super.toObject(),{active:this.active})}}class rt extends et{constructor({fundingInstrumentUri:t,count:e=!1,walletId:s="default",...i}){super(i),this.fundingInstrumentUri=t,this.count=e,this.walletId=s}toObject(){return Object.assign(super.toObject(),{wallet_id:this.walletId,funding_instrument_uri:this.fundingInstrumentUri,count:this.count})}}class nt extends et{constructor({accountNumber:t,...e}){super(e),this.accountNumber=t}toObject(){return Object.assign(super.toObject(),{account_number:this.accountNumber})}}class ct extends et{constructor({emailAddress:t,...e}){super(e),this.emailAddress=t}toObject(){return Object.assign(super.toObject(),{email_address:this.emailAddress})}}class ot extends et{constructor({accountId:t,...e}){super(e),this.accountId=t}toObject(){return Object.assign(super.toObject(),{account_id:this.accountId})}}class dt extends et{constructor({accountId:t,...e}){super(e),this.accountId=t}toObject(){return Object.assign(super.toObject(),{account:this.accountId})}}class ut extends dt{constructor({status:t,type:e,...s}){super(s),this.status=t,this.type=e}toObject(){return Object.assign(super.toObject(),{status:this.status,type:this.type})}}class ht extends et{constructor({cardUri:t,count:e=!1,...s}={}){super(s),this.cardUri=t,this.count=e}toObject(){return Object.assign(super.toObject(),{card_uri:this.cardUri,count:this.count})}}class lt extends et{constructor({cardUri:t,...e}){super(e),this.cardUri=t}toObject(){return Object.assign(super.toObject(),{card_uri:this.cardUri})}}class pt extends et{constructor({status:t,...e}){super(e),this.status=t}toObject(){return Object.assign(super.toObject(),{status:this.status})}}class mt extends pt{constructor({trackingKey:t,network:e,...s}){super(s),this.trackingKey=t,this.network=e}toObject(){return Object.assign(super.toObject(),{tracking_key:this.trackingKey,network:this.network})}}class wt extends et{constructor({emailAddress:t,...e}){super(e),this.emailAddress=t}toObject(){return Object.assign(super.toObject(),{email_address:this.emailAddress})}}class _t extends et{constructor({postalCode:t,...e}){super(e),this.postalCode=t}toObject(){return Object.assign(super.toObject(),{postal_code:this.postalCode})}}class ft extends et{constructor({month:t,year:e,...s}={}){super(s),void 0!==t&&void 0!==e&&(this.d={month:t,year:e})}get month(){return this._date?.month}get year(){return this._date?.year}set d({month:t,year:e}){const s=Number(t),i=Number(e);if(!Number.isInteger(s)||s<1||s>12)throw new l("month must be an integer between 1 and 12");if(!Number.isInteger(i)||i<1900||i>9999)throw new l("year must be an integer between 1900 and 9999");const a=new Date(Date.UTC(i,s-1,1)),r=new Date,n=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),1));if(a.getTime()>=n.getTime()){const t=String(s).padStart(2,"0");throw new l(`${i}-${t} is not a valid year-month pair`)}this._date={month:s,year:i}}toObject(){return Object.assign(super.toObject(),{month:this.month,year:this.year})}}class bt extends pt{constructor({accountNumber:t,idempotencyKey:e,trackingKey:s,network:i,...a}){super(a),this.accountNumber=t,this.idempotencyKey=e,this.trackingKey=s,this.network=i}toObject(){return Object.assign(super.toObject(),{account_number:this.accountNumber,idempotency_key:this.idempotencyKey,tracking_key:this.trackingKey,network:this.network})}}class yt extends et{constructor({clabe:t,curp:e,emailAddress:s,hasCurpDocument:i,name:a,phoneNumber:r,status:n,...c}={}){super(c),this.clabe=t,this.curp=e,this.emailAddress=s,this.hasCurpDocument=i,this.name=a,this.phoneNumber=r,this.status=n}toObject(){return Object.assign(super.toObject(),{clabe:this.clabe,curp:this.curp,email_address:this.emailAddress,has_curp_document:this.hasCurpDocument,name:this.name,phone_number:this.phoneNumber,status:this.status})}}class gt extends et{constructor({active:t,...e}){super(e),this.active=t}toObject(){return Object.assign(super.toObject(),{active:this.active})}}class vt extends et{constructor({walletUri:t,...e}){super(e),this.walletUri=t}toObject(){return Object.assign(super.toObject(),{wallet_uri:this.walletUri})}}const At=t=>{if(!t)return null;const e=new Date(t);return new Date(e.getTime())},Ot=(t,e)=>Object.values(t).find((t=>t.value===e));class jt{constructor({city:t,colonia:e,country:s,createdAt:i,extNumber:a,fullName:r,intNumber:n,postalCode:c,state:o,street:d}){this.city=t,this.colonia=e,this.country=s,this.createdAt=At(i),this.extNumber=a,this.fullName=r,this.intNumber=n,this.postalCode=c,this.state=o,this.street=d}static fromObject=({city:t,colonia:e,country:s,state:i,street:a,...r})=>new jt({city:t,colonia:e,country:s,state:i,street:a,createdAt:r.created_at,extNumber:r.ext_number,fullName:r.full_name,intNumber:r.int_number,postalCode:r.postal_code})}class It{constructor({agent:t,createdAt:e,status:s,updatedAt:i,comments:a}){this.agent=t,this.comments=a,this.createdAt=At(e),this.updatedAt=At(i),this.status=Ot(b,s)}static fromObject=({agent:t,comments:e,status:s,...i})=>new It({agent:t,comments:e,status:s,createdAt:i.created_at,updatedAt:i.updated_at})}class St{constructor({hasAudit:t,auditProvider:e,auditDate:s,auditComments:i}){this.hasAudit=t,this.auditProvider=e,this.auditDate=At(s),this.auditComments=i}static fromObject=({...t})=>new St({hasAudit:t.has_audit,auditProvider:t.audit_provider,auditDate:t.audit_date,auditComments:t.audit_comments})}class xt{constructor({accountUsageDescription:t=null,businessDescription:e=null}={}){this.accountUsageDescription=t,this.businessDescription=e}static fromObject=({...t}={})=>new xt({accountUsageDescription:t.account_usage_description,businessDescription:t.business_description});toObject(){return{account_usage_description:this.accountUsageDescription,business_description:this.businessDescription}}}class Tt{constructor({bank:t,account:e}){this.bank=t,this.account=e}static fromObject=({account:t,bank:e})=>new Tt({bank:e,account:t})}class Ct{constructor({code:t,error:e,identifier:s,message:i}){this.code=t,this.error=e,this.identifier=s,this.message=i}static fromObject=({code:t,error:e,identifier:s,message:i})=>new Ct({code:t,error:e,identifier:s,message:i})}class Nt{constructor({data:t,errors:e,isMx:s,status:i,type:a,uriBack:r,uriFront:n}){this.data=t,this.isMx=s,this.status=Ot(X,i),this.type=Ot(U,a),this.uriBack=r,this.uriFront=n,e&&e.length>0&&(this.errors=e.map((t=>Ct.fromObject(t))))}static fromObject=({data:t,errors:e,status:s,type:i,...a})=>new Nt({data:t,errors:e,status:s,type:i,isMx:a.is_mx,uriBack:a.uri_back,uriFront:a.uri_front})}class kt{constructor({licenseRequired:t=!1,supervisoryEntity:e=null,licenseType:s=null,licenseDate:i=null}={}){this.licenseRequired=t,this.supervisoryEntity=e,this.licenseType=s,this.licenseDate=i?At(i):null}static fromObject=({...t}={})=>new kt({licenseRequired:t.license_required,supervisoryEntity:t.supervisory_entity,licenseType:t.license_type,licenseDate:t.license_date})}class Dt{constructor({names:t,curp:e,rfc:s,firstSurname:i,secondSurname:a}){this.names=t,this.curp=e,this.rfc=s,this.firstSurname=i,this.secondSurname=a}static fromObject=({names:t,curp:e,rfc:s,...i})=>new Dt({names:t,curp:e,rfc:s,firstSurname:i.first_surname,secondSurname:i.second_surname});toObject(){return{names:this.names,curp:this.curp,rfc:this.rfc,first_surname:this.firstSurname,second_surname:this.secondSurname}}}class Ut extends Dt{constructor({names:t,curp:e,rfc:s,firstSurname:i,secondSurname:a,job:r,phoneNumber:n,emailAddress:c,address:o}){super({names:t,curp:e,rfc:s,firstSurname:i,secondSurname:a}),this.job=r,this.phoneNumber=n,this.emailAddress=c,this.address=o}get address(){return this._address}set address(t){t&&(this._address=jt.fromObject(t))}static fromObject=({job:t,address:e,...s})=>new Ut({address:e,job:t,phoneNumber:s.phone_number,emailAddress:s.email_address,...Dt.fromObject(s)})}class Mt extends Dt{constructor({names:t,curp:e,rfc:s,firstSurname:i,secondSurname:a,shareCapital:r,percentage:n}){super({names:t,curp:e,rfc:s,firstSurname:i,secondSurname:a}),this.shareCapital=r,this.percentage=n}static fromObject=({percentage:t,...e})=>new Mt({percentage:t,shareCapital:e.share_capital,...Dt.fromObject(e)})}class Rt{constructor({name:t,percentage:e,shareholders:s,legalRepresentatives:i}){this.name=t,this.percentage=e,this.shareholders=s,this.legalRepresentatives=i}get shareholders(){return this._shareholders}set shareholders(t){t&&(this._shareholders=t.map((t=>Mt.fromObject(t))))}get legalRepresentatives(){return this._legalRepresentatives}set legalRepresentatives(t){t&&(this._legalRepresentatives=t.map((t=>Ut.fromObject(t))))}static fromObject=({name:t,percentage:e,shareholders:s,...i})=>new Rt({name:t,percentage:e,shareholders:s||[],legalRepresentatives:i.legal_representatives||[]})}class Pt{constructor({speiTransfersNum:t,speiTransfersAmount:e,internalTransfersNum:s,internalTransfersAmount:i}={}){this.speiTransfersNum=t,this.speiTransfersAmount=e,this.internalTransfersNum=s,this.internalTransfersAmount=i}static fromObject=({...t}={})=>new Pt({speiTransfersNum:t.spei_transfers_num,speiTransfersAmount:t.spei_transfers_amount,internalTransfersNum:t.internal_transfers_num,internalTransfersAmount:t.internal_transfers_amount})}class Bt{constructor({ip:t,location:e,type:s,version:i}){this.ip=t,this.location=e,this.type=s,this.version=i}static fromObject=({ip:t,location:e,type:s,version:i})=>new Bt({ip:t,location:e,type:s,version:i})}class Lt{constructor({isVulnerableActivity:t,hasSatRegister:e,satRegisteredDate:s,isInCompliance:i}){this.isVulnerableActivity=t,this.hasSatRegister=e,this.satRegisteredDate=At(s),this.isInCompliance=i}static fromObject=({...t})=>new Lt({isVulnerableActivity:t.is_vulnerable_activity,hasSatRegister:t.has_sat_register,satRegisteredDate:t.sat_registered_date,isInCompliance:t.is_in_compliance})}var qt="1.1.0-dev0";class Et{constructor({apiKey:t,apiSecret:e,language:s="en",phase:i=q.Sandbox}={}){this.phase=i,this.basicAuth={apiKey:t,apiSecret:e},this.jwtToken=null,this._session=a.default.create({headers:{"Accept-Language":s},timeout:45e3})}get session(){return this._session}get origin(){return`https://${this.phase.value}.arteria.xyz`}get authHeader(){const{apiKey:t,apiSecret:e}=this.basicAuth;return t&&e?`Basic ${r.default.Buffer.from(`${t}:${e}`,"utf-8").toString("base64")}`:""}addHeadersToRequest(t){const e=this._session.interceptors.request.use((e=>{const s=e,{headers:{common:i}}=s;return Object.keys(t).forEach((e=>i[e]=t[e])),s}));return{interceptorId:e,eject:()=>this._session.interceptors.request.eject(e)}}deleteRequestHeader(t){const e=this._session.interceptors.request.use((e=>{const s=e,{headers:{common:i}}=s;return delete i[t],s}));return{interceptorId:e,eject:()=>this._session.interceptors.request.eject(e)}}addConfigToRequest(t){const e=this._session.interceptors.request.use((e=>{const s=e;return Object.keys(t).forEach((e=>s[e]=t[e])),s}));return{interceptorId:e,eject:()=>this._session.interceptors.request.eject(e)}}async configure({apiKey:t,apiSecret:e,loginToken:s,phase:i,sessionId:a,useJwt:r=!1}){this.basicAuth={apiKey:t||this.basicAuth.apiKey,apiSecret:e||this.basicAuth.apiSecret},i&&(this.phase=i),r&&(this.jwtToken=await f.create(this)),s&&this.addHeadersToRequest({"X-Cuenca-LoginToken":s}),a&&this.addHeadersToRequest({"X-Cuenca-SessionId":a})}async get({endpoint:t,format:e,params:s}){return this.request({endpoint:t,format:e,params:s})}async post({endpoint:t,data:e,multipart:s}){return this.request({method:"POST",endpoint:t,data:e,multipart:s})}async patch({endpoint:t,data:e}){return this.request({method:"PATCH",endpoint:t,data:e})}async delete({endpoint:t,data:e}){return this.request({method:"DELETE",endpoint:t,data:e})}async request({endpoint:t,data:e=null,format:s=D.Json,method:i="GET",multipart:a=!1,params:r=null}){let o={};a||(o={"Content-Type":"application/json",Accept:`application/${s.value}`}),this.authHeader&&(o.Authorization=this.authHeader),_?o["User-Agent"]=`cuenca-js/${qt}`:w&&(o["X-User-Agent"]=`cuenca-js/${qt}`),this.jwtToken&&(this.jwtToken.isExpired&&(this.jwtToken=await f.create(this)),o["X-Cuenca-Token"]=this.jwtToken.token);const d=this.addHeadersToRequest(o),u=e;u&&!a&&Object.keys(u).forEach((t=>{u[t]instanceof Date&&(u[t]=u[t].toISOString())}));const h=this.addConfigToRequest({method:i,params:r,data:u,url:t});let l;try{l=await this._session.request({baseURL:this.origin})}catch(t){throw t.response?new c(t.response.data,t.response.status):t.request?new n(`No response received: ${t.errno}: ${t.code}`):new n(t.message)}finally{d.eject(),h.eject()}return l.data}}class Kt{constructor({accountNumber:t,createdAt:e,id:s,institutionName:i,name:a,userId:r}){this.accountNumber=t,this.createdAt=At(e),this.id=s,this.institutionName=i,this.name=a,this.userId=r}static fromObject=({id:t,name:e,...s})=>new Kt({id:t,name:e,accountNumber:s.account_number,createdAt:s.created_at,institutionName:s.institution_name,userId:s.user_id})}class Gt{constructor({agent:t,accountNumber:e,actualPeriodCount:s,actualPeriodSum:i,aggregationType:a,changeLog:r,comments:n,committeeMeetingDate:c,createdAt:o,questionnaireId:d,description:u,hasQuestionnaire:h,id:l,institutionName:p,level:m,name:w,period:_,periodNumber:f,status:y,sourceType:g,transactionDate:v,type:A,typeOfFilter:O,userId:j,updatedAt:I}){this.accountNumber=e,this.actualPeriodCount=s,this.actualPeriodSum=i,this.agent=t,this.aggregationType=a,this.comments=n,this.committeeMeetingDate=At(c),this.createdAt=At(o),this.questionnaireId=d,this.description=u,this.hasQuestionnaire=h,this.id=l,this.institutionName=p,this.level=Ot(R,m),this.name=w,this.period=Ot(B,_),this.periodNumber=f,this.status=Ot(b,y),this.sourceType=Ot(Y,g),this.transactionDate=At(v),this.type=Ot(P,A),this.typeOfFilter=Ot(E,O),this.updatedAt=At(I),this.userId=j,this.changeLog=r}static fromObject=({agent:t,comments:e,description:s,id:i,level:a,name:r,period:n,status:c,type:o,...d})=>new Gt({agent:t,comments:e,description:s,id:i,level:a,name:r,period:n,status:c,type:o,accountNumber:d.account_number,actualPeriodCount:d.actual_period_count,actualPeriodSum:d.actual_period_sum,aggregationType:d.aggregation_type,changeLog:d.change_log,committeeMeetingDate:d.committee_meeting_date,createdAt:d.created_at,questionnaireId:d.questionnaire_id,hasQuestionnaire:d.has_questionnaire,institutionName:d.institution_name,periodNumber:d.period_number,sourceType:d.source_type,transactionDate:d.transaction_date,typeOfFilter:d.type_of_filter,updatedAt:d.updated_at,userId:d.user_id});get changeLog(){return this._changeLog}set changeLog(t){t&&Array.isArray(t)&&0!==t.length&&(this._changeLog=t.map((t=>It.fromObject(t))))}}class Ft{constructor({createdAt:t,deactivatedAt:e,id:s,secret:i,userId:a,updatedAt:r}){this.createdAt=At(t),this.deactivatedAt=At(e),this.id=s,this.secret=i,this.userId=a,this.updatedAt=At(r)}static fromObject=({id:t,secret:e,...s})=>new Ft({id:t,secret:e,createdAt:s.created_at,deactivatedAt:s.deactivated_at,userId:s.user_id,updatedAt:s.updated_at});get isActive(){const t=At(Date.now());return!this.deactivatedAt||this.deactivatedAt.getTime()>t.getTime()}}class Vt{constructor({arpc:t,createdAt:e,cardUri:s,isValidArqc:i}){this.arpc=t,this.createdAt=At(e),this.cardUri=s,this.isValidArqc=i}static fromObject=({arpc:t,...e})=>new Vt({arpc:t,createdAt:e.created_at,cardUri:e.card_uri,isValidArqc:e.is_valid_arqc})}class Ht{constructor({amount:t,createdAt:e,descriptor:s,entryType:i,fundingInstrumentUri:a,id:r,name:n,relatedTransactionUri:c,rollingBalance:o}){this.amount=t,this.createdAt=At(e),this.descriptor=s,this.entryType=Ot(k,i),this.fundingInstrumentUri=a,this.id=r,this.name=n,this.relatedTransactionUri=c,this.rollingBalance=o}static fromObject=({amount:t,descriptor:e,id:s,name:i,type:a,...r})=>new Ht({amount:t,descriptor:e,name:i,id:s,createdAt:r.created_at,entryType:a,fundingInstrumentUri:r.funding_instrument_uri,relatedTransactionUri:r.related_transaction_uri,rollingBalance:r.rolling_balance})}class Yt{constructor({amount:t,createdAt:e,descriptor:s,status:i,userId:a}){this.amount=t,this.createdAt=At(e),this.descriptor=s,this.status=Ot(W,i),this.userId=a}}class $t extends Yt{constructor({amount:t,accountNumber:e,createdAt:s,descriptor:i,id:a,providerUri:r,status:n,userId:c}){super({amount:t,createdAt:s,descriptor:i,status:n,userId:c}),this.accountNumber=e,this.id=a,this.providerUri=r}static fromObject=({amount:t,descriptor:e,id:s,status:i,...a})=>new $t({amount:t,descriptor:e,id:s,status:i,accountNumber:a.account_number,createdAt:a.created_at,providerUri:a.provider_uri,userId:a.user_id})}class Wt{constructor({id:t,createdAt:e,updatedAt:s,names:i,firstSurname:a,secondSurname:r,dateOfBirth:n,countryOfBirth:c,rfc:o,curp:d,userId:u,gender:h,phoneNumber:l,emailAddress:p,clientClabe:m,govtId:w,proofOfAddress:_,status:f,termsOfService:b,address:g}){this.id=t,this.createdAt=At(e),this.updatedAt=At(s),this.emailAddress=p,this.clientClabe=m,this.govtId=w,this.names=i,this.firstSurname=a,this.secondSurname=r,this.dateOfBirth=n,this.countryOfBirth=c,this.rfc=o,this.curp=d,this.userId=u,this.gender=h,this.phoneNumber=l,this.proofOfAddress=_,this.status=Ot(y,f),this.termsOfService=b,this.address=g}static fromObject=({status:t,address:e,...s})=>new Wt({address:e,status:t,id:s.id,createdAt:s.created_at,updatedAt:s.updated_at,clientClabe:s.client_clabe,names:s.names,firstSurname:s.first_surname,secondSurname:s.second_surname,dateOfBirth:s.date_of_birth,countryOfBirth:s.country_of_birth,rfc:s.rfc,curp:s.curp,userId:s.user_id,gender:s.gender,govtId:s.govt_id,emailAddress:s.email_address,phoneNumber:s.phone_number,proofOfAddress:s.proof_of_address,termsOfService:s.terms_of_service});get address(){return this._address}set address(t){t&&0!==Object.keys(t).length&&(this._address=jt.fromObject(t))}get proofOfAddress(){return this._proofOfAddress}set proofOfAddress(t){t&&0!==Object.keys(t).length&&(this._proofOfAddress=Nt.fromObject(t))}get govtId(){return this._govtId}set govtId(t){t&&0!==Object.keys(t).length&&(this._govtId=Nt.fromObject(t))}get termsOfService(){return this._termsOfService}set termsOfService(t){t&&0!==Object.keys(t).length&&(this._termsOfService=Bt.fromObject(t))}}class Zt{constructor({clabe:t,createdAt:e,curp:s,error:i,firstName:a,id:r,names:n,rfc:c,secondSurname:o,status:d}){this.clabe=t,this.createdAt=At(e),this.curp=s,this.error=i,this.firstName=a,this.id=r,this.names=n,this.rfc=c,this.secondSurname=o,this.status=Ot(g,d)}static fromObject=({clabe:t,curp:e,error:s,id:i,names:a,rfc:r,status:n,...c})=>new Zt({clabe:t,curp:e,error:s,id:i,names:a,rfc:r,status:n,createdAt:c.created_at,firstName:c.first_name,secondSurname:c.second_surname})}class Qt{constructor({account:t,clabe:e,currency:s,id:i,network:a,platformId:r}){this.account=t,this.clabe=e,this.currency=Ot(x,s),this.id=i,this.network=Ot(L,a),this.platformId=r}static fromObject=({clabe:t,currency:e,id:s,network:i,...a})=>new Qt({clabe:t,currency:e,id:s,network:i,account:a.account_uri.split("/")[2],platformId:a.platform_id})}class Jt{constructor({id:t,createdAt:e,platformId:s,type:i,status:a,accountUri:r,quoteUri:n,currency:c,network:o,sourceWallet:d,destinationWallet:u,bankAccountUri:h,cuencaId:l,cuentaOrdenante:p,cuentaBeneficiario:m,nombreOrdenante:w,claveRastreo:_,rfcCurpOrdenante:f,concepto:b,referenciaNumerica:y,signature:g,trackingLink:v,fromCurrency:A,toCurrency:O,fromAmount:I,toAmount:S}){this.id=t,this.createdAt=At(e),this.platformId=s,this.type=Ot(j,i),this.status=Ot(W,a),this.accountUri=r,this.quoteUri=n,this.currency=Ot(x,c),this.network=Ot(L,o),this.sourceWallet=d,this.destinationWallet=u,this.bankAccountUri=h,this.cuencaId=l,this.cuentaOrdenante=p,this.cuentaBeneficiario=m,this.nombreOrdenante=w,this.claveRastreo=_,this.rfcCurpOrdenante=f,this.concepto=b,this.referenciaNumerica=y,this.signature=g,this.trackingLink=v,this.fromCurrency=Ot(x,A),this.toCurrency=Ot(x,O),this.fromAmount=I,this.toAmount=S}static fromObject=({type:t,status:e,currency:s,network:i,concepto:a,signature:r,...n})=>new Jt({id:n.id,createdAt:n.created_at,platformId:n.platform_id,accountUri:n.account_uri,quoteUri:n.quote_uri,sourceWallet:n.source_wallet,destinationWallet:n.destination_wallet,bankAccountUri:n.bank_account_uri,cuencaId:n.cuenca_id,cuentaOrdenante:n.cuenta_ordenante,cuentaBeneficiario:n.cuenta_beneficiario,nombreOrdenante:n.nombre_ordenante,claveRastreo:n.clave_rastreo,rfcCurpOrdenante:n.rfc_curp_ordenante,referenciaNumerica:n.referencia_numerica,trackingLink:n.tracking_link,fromCurrency:n.from_currency,toCurrency:n.to_currency,fromAmount:n.from_amount,toAmount:n.to_amount,type:t,status:e,currency:s,network:i,concepto:a,signature:r})}class Xt{constructor({createdAt:t,cvv2:e,expMonth:s,expYear:i,fundingType:a,id:r,issuer:n,number:c,pin:o,status:d,type:u,updatedAt:h,userId:l}){this.createdAt=At(t),this.cvv2=e,this.expMonth=s,this.expYear=i,this.fundingType=Ot(A,a),this.id=r,this.issuer=Ot(O,n),this.number=c,this.pin=o,this.status=Ot(I,d),this.type=Ot(T,u),this.updatedAt=At(h),this.userId=l}static fromObject=({cvv2:t,id:e,issuer:s,number:i,pin:a,status:r,type:n,...c})=>new Xt({cvv2:t,id:e,issuer:s,number:i,pin:a,status:r,type:n,createdAt:c.created_at,expMonth:c.exp_month,expYear:c.exp_year,fundingType:c.funding_type,updatedAt:c.updated_at,userId:c.user_id})}class zt{constructor({cardUri:t,createdAt:e,id:s,ipAddress:i,success:a,userId:r}){this.cardUri=t,this.createdAt=At(e),this.id=s,this.ipAddress=i,this.success=a,this.userId=r}static fromObject=({id:t,success:e,...s})=>new zt({id:t,success:e,cardUri:s.card_uri,createdAt:s.created_at,ipAddress:s.ip_address,userId:s.user_id})}class te extends Yt{constructor({amount:t,cardErrorType:e,cardLastFour:s,cardType:i,cardUri:a,createdAt:r,descriptor:n,metadata:c,network:o,relatedCardTransactionsUris:d,status:u,type:h,userId:l}){super({amount:t,createdAt:r,descriptor:n,status:u,userId:l}),this.cardErrorType=Ot(v,e),this.cardLastFour=s,this.cardType=Ot(T,i),this.cardUri=a,this.metadata=c,this.network=o,this.relatedCardTransactionsUris=d,this.type=Ot(S,h)}static fromObject=({amount:t,descriptor:e,metadata:s,network:i,status:a,type:r,...n})=>new te({amount:t,descriptor:e,metadata:s,network:i,status:a,type:r,cardErrorType:n.error_type,cardLastFour:n.card_last4,cardType:n.card_type,cardUri:n.card_uri,createdAt:n.created_at,relatedCardTransactionsUris:n.related_card_transaction,userId:n.user_id})}class ee{constructor({cardStatus:t,cardType:e,cardUri:s,createdAt:i,isExpired:a,isPinAttemptsExceeded:r,isValidCvv:n,isValidCvv2:c,isValidExpDate:o,isValidIcvv:d,isValidPinBlock:u,userId:h}){this.cardStatus=Ot(I,t),this.cardType=Ot(T,e),this.cardUri=s,this.createdAt=At(i),this.isExpired=a,this.isPinAttemptsExceeded=r,this.isValidCvv=n,this.isValidCvv2=c,this.isValidExpDate=o,this.isValidIcvv=d,this.isValidPinBlock=u,this.userId=h}static fromObject=({...t})=>new ee({cardStatus:t.card_status,cardType:t.card_type,cardUri:t.card_uri,createdAt:t.created_at,isExpired:t.is_expired,isPinAttemptsExceeded:t.is_pin_attempts_exceeded,isValidCvv:t.is_valid_cvv,isValidCvv2:t.is_valid_cvv2,isValidExpDate:t.is_valid_exp_date,isValidIcvv:t.is_valid_icvv,isValidPinBlock:t.is_valid_pin_block,userId:t.user_id});get isActive(){return this.cardStatus===I.Active}}class se extends Yt{constructor({amount:t,createdAt:e,descriptor:s,relatedTransactionUri:i,status:a,type:r,userId:n}){super({amount:t,createdAt:e,descriptor:s,status:a,userId:n}),this.relatedTransactionUri=i,this.type=Ot(C,r)}static fromObject=({amount:t,descriptor:e,status:s,type:i,...a})=>new se({amount:t,descriptor:e,status:s,type:i,createdAt:a.created_at,relatedTransactionUri:a.related_transaction_uri,userId:a.user_id})}class ie extends Yt{constructor({amount:t,createdAt:e,descriptor:s,id:i,network:a,status:r,sourceUri:n,trackingKey:c,userId:o}){super({amount:t,createdAt:e,descriptor:s,status:r,userId:o}),this.id=i,this.network=Ot(N,a),this.sourceUri=n,this.trackingKey=c}static fromObject=({amount:t,descriptor:e,id:s,network:i,status:a,...r})=>new ie({amount:t,descriptor:e,id:s,network:i,status:a,createdAt:r.created_at,sourceUri:r.source_uri,trackingKey:r.tracking_key,userId:r.user_id})}class ae{constructor({extension:t,type:e,url:s,userId:i}){this.extension=t,this.type=Ot(U,e),this.url=s,this.userId=i}static fromObject=({extension:t,type:e,url:s,...i})=>new ae({extension:t,type:e,url:s,userId:i.user_id})}class re{constructor({id:t,createdAt:e,updatedAt:s,deactivatedAt:i,platformId:a,filesUri:r,userId:n,verificationId:c,identityId:o,govtIdStatus:d,proofOfAddressStatus:u,proofOfLifeStatus:h,sourceType:l,flowId:p,status:m,providerUrl:w}){this.id=t,this.createdAt=At(e),this.updatedAt=At(s),this.deactivatedAt=At(i),this.platformId=a,this.filesUri=r||[],this.userId=n,this.verificationId=c,this.identityId=o,this.govtIdStatus=Ot(X,d),this.proofOfAddressStatus=Ot(X,u),this.proofOfLifeStatus=Ot(X,h),this.sourceType=Ot(M,l),this.flowId=p,this.status=Ot(X,m),this.providerUrl=w}static fromObject=({id:t,status:e,...s})=>new re({id:t,status:e,createdAt:s.created_at,updatedAt:s.updated_at,deactivatedAt:s.deactivated_at,platformId:s.platform_id,filesUri:s.files_uri,userId:s.user_id,verificationId:s.verification_id,identityId:s.identity_id,govtIdStatus:s.govt_id_status,proofOfAddressStatus:s.proof_of_address_status,proofOfLifeStatus:s.proof_of_life_status,sourceType:s.source_type,flowId:s.flow_id,providerUrl:s.provider_url})}class ne{constructor({id:t}){this.id=t}static fromObject=({id:t})=>new ne({id:t})}class ce{constructor({currency:t,monthlyAmount:e,recipientsNum:s,payersNum:i,deposits:a,withdrawal:r}){this.currency=t,this.monthlyAmount=e,this.recipientsNum=s,this.payersNum=i,this.deposits=a,this.withdrawal=r}get deposits(){return this._deposits}set deposits(t){t&&(this._deposits=Pt.fromObject(t))}get withdrawal(){return this._withdrawal}set withdrawal(t){t&&(this._withdrawal=Pt.fromObject(t))}static fromObject=({currency:t,deposits:e,withdrawal:s,...i})=>new ce({currency:t,deposits:e,withdrawal:s,payersNum:i.payers_num,recipientsNum:i.recipients_num,monthlyAmount:i.monthly_amount})}class oe{constructor({address:t,clabe:e,emailAddress:s,id:i,level:a,meta:r,nationality:n,platformId:c,phoneNumber:o,requiredLevel:d,rfc:u,status:h,createdAt:l,updatedAt:p,userType:m}){this.address=t,this.clabe=e,this.createdAt=At(l),this.emailAddress=s,this.id=i,this.level=a,this.meta=r,this.nationality=n,this.platformId=c,this.phoneNumber=o,this.requiredLevel=d,this.rfc=u,this.status=Ot(Q,h),this.updatedAt=At(p),this.userType=m}get address(){return this._address}set address(t){t&&(this._address=jt.fromObject(t))}static fromObject=({address:t,clabe:e,id:s,level:i,nationality:a,rfc:r,status:n,...c})=>new oe({address:t,clabe:e,id:s,level:i,meta:c.meta,nationality:a,rfc:r,status:n,createdAt:c.created_at,emailAddress:c.email_address,phoneNumber:c.phone_number,platformId:c.platform_id,requiredLevel:c.required_level,updatedAt:c.updated_at,userType:c.user_type})}class de extends oe{constructor({address:t,audit:e,businessDetails:s,businessModel:i,businessName:a,clabe:r,createdAt:n,documentationUrl:c,emailAddress:o,externalAccount:d,folio:u,id:h,incorporationDate:l,legalName:p,legalRepresentatives:m,level:w,license:_,meta:f,nationality:b,phoneNumber:y,platformId:g,requiredLevel:v,rfc:A,shareholders:O,status:j,transactionalProfile:I,updatedAt:S,userId:x,userType:T,vulnerableActivity:C,webSite:N}){super({address:t,clabe:r,emailAddress:o,rfc:A,id:h,level:w,meta:f,nationality:b,platformId:g,phoneNumber:y,requiredLevel:v,status:j,createdAt:n,updatedAt:S,userType:T}),this.audit=e,this.businessModel=i,this.businessName=a,this.businessDetails=s,this.documentationUrl=c,this.incorporationDate=At(l),this.externalAccount=d,this.folio=u,this.legalName=p,this.license=_,this.shareholders=O,this.legalRepresentatives=m,this.transactionalProfile=I,this.userId=x,this.vulnerableActivity=C,this.webSite=N}get shareholders(){return this._shareholders}set shareholders(t){t&&(this._shareholders=t.map((t=>Rt.fromObject(t))))}get legalRepresentatives(){return this._legalRepresentatives}set legalRepresentatives(t){t&&(this._legalRepresentatives=t.map((t=>Ut.fromObject(t))))}get externalAccount(){return this._externalAccount}set externalAccount(t){t&&(this._externalAccount=Tt.fromObject(t))}get vulnerableActivity(){return this._vulnerableActivity}set vulnerableActivity(t){t&&(this._vulnerableActivity=Lt.fromObject(t))}get audit(){return this._audit}set audit(t){t&&(this._audit=St.fromObject(t))}get license(){return this._license}set license(t){t&&(this._license=kt.fromObject(t))}get transactionalProfile(){return this._transactionalProfile}set transactionalProfile(t){t&&(this._transactionalProfile=ce.fromObject(t))}get businessDetails(){return this._businessDetails}set businessDetails(t){t&&(this._businessDetails=xt.fromObject(t))}static fromObject=({audit:t,address:e,clabe:s,folio:i,id:a,level:r,license:n,nationality:c,rfc:o,status:d,shareholders:u,...h})=>new de({address:e,audit:t,clabe:s,folio:i,id:a,level:r,license:n,nationality:c,rfc:o,shareholders:u,status:d,legalName:h.legal_name,legalRepresentatives:h.legal_representatives,businessModel:h.business_model,businessName:h.business_name,businessDetails:h.business_details,createdAt:h.created_at,documentationUrl:h.documentation_url,emailAddress:h.email_address,externalAccount:h.external_account,incorporationDate:h.incorporation_date,meta:h.meta,phoneNumber:h.phone_number,platformId:h.platform_id,requiredLevel:h.required_level,transactionalProfile:h.transactional_profile,updatedAt:h.updated_at,userId:h.user_id,userType:h.user_type,vulnerableActivity:h.vulnerable_activity,webSite:h.web_site})}class ue{constructor({id:t,postalCode:e,colonia:s,city:i,state:a,country:r,createdAt:n,updatedAt:c}){this.id=t,this.postalCode=e,this.colonia=s,this.city=i,this.state=Ot(G,a),this.country=Ot(K,r),this.createdAt=At(n),this.updatedAt=At(c)}static fromObject=({id:t,colonia:e,city:s,state:i,country:a,...r})=>new ue({id:t,colonia:e,city:s,state:i,country:a,postalCode:r.postal_code,createdAt:r.created_at,updatedAt:r.updated_at})}class he{constructor({balance:t,createdAt:e,deactivatedAt:s,id:i,userId:a,updatedAt:r}){this.balance=t,this.createdAt=At(e),this.deactivatedAt=At(s),this.id=i,this.userId=a,this.updatedAt=At(r)}}class le extends he{constructor({balance:t,category:e,createdAt:s,deactivatedAt:i,goalAmount:a,goalDate:r,id:n,name:c,userId:o,updatedAt:d}){super({balance:t,createdAt:s,deactivatedAt:i,id:n,userId:o,updatedAt:d}),this.category=Ot(V,e),this.goalAmount=a,this.goalDate=At(r),this.name=c}static fromObject=({balance:t,category:e,id:s,name:i,...a})=>new le({balance:t,category:e,id:s,name:i,createdAt:a.created_at,deactivatedAt:a.deactivated_at,goalAmount:a.goal_amount,goalDate:a.goal_date,userId:a.user_id,updatedAt:a.updated_at})}class pe{constructor({categories:t,id:e,name:s,providerKey:i}){var a;this.categories=null==(a=t)?[]:a.map((t=>Ot(F,t))),this.id=e,this.name=s,this.providerKey=i}static fromObject=({categories:t,id:e,name:s,...i})=>new pe({categories:t,id:e,name:s,providerKey:i.provider_key})}class me{constructor({createdAt:t,expiresAt:e,failureUrl:s,id:i,platformId:a,successUrl:r,type:n,userId:c}){this.createdAt=At(t),this.expiresAt=At(e),this.failureUrl=s,this.id=i,this.platformId=a,this.successUrl=r,this.type=Ot(H,n),this.userId=c}static fromObject=({id:t,type:e,...s})=>new me({id:t,type:e,createdAt:s.created_at,expiresAt:s.expires_at,failureUrl:s.failure_url,platformId:s.platform_id,successUrl:s.success_url,userId:s.user_id})}class we{constructor({createdAt:t,id:e,month:s,year:i}){this.createdAt=At(t),this.id=e,this.month=s,this.year=i}static fromObject=({id:t,month:e,year:s,...i})=>new we({id:t,month:e,year:s,createdAt:i.created_at})}class _e extends Yt{constructor({accountNumber:t,amount:e,createdAt:s,descriptor:i,destinationUri:a,id:r,idempotencyKey:n,network:c,recipientName:o,status:d,trackingKey:u,updatedAt:h,userId:l}){super({amount:e,createdAt:s,descriptor:i,status:d,userId:l}),this.accountNumber=t,this.destinationUri=a,this.id=r,this.idempotencyKey=n,this.network=Ot(Z,c),this.recipientName=o,this.trackingKey=u,this.updatedAt=At(h)}static fromObject=({amount:t,descriptor:e,id:s,network:i,status:a,...r})=>new _e({amount:t,descriptor:e,id:s,network:i,status:a,accountNumber:r.account_number,createdAt:r.created_at,destinationUri:r.destination_uri,idempotencyKey:r.idempotency_key,recipientName:r.recipient_name,trackingKey:r.tracking_key,updatedAt:r.updated_at,userId:r.user_id})}class fe{constructor({address:t,blacklistValidationStatus:e,clabe:s,countryOfBirth:i,createdAt:a,curp:r,curpDocument:n,dateOfBirth:c,emailAddress:o,firstSurname:d,gender:u,govtId:h,id:l,isDormant:p,isFraud:m,isPldBlocked:w,isSecurityMode:_,level:f,names:b,nationality:y,phoneNumber:g,proofOfAddress:v,proofOfLife:A,requiredLevel:O,rfc:j,secondSurname:I,stateOfBirth:S,status:x,termsOfService:T,updatedAt:C,userTosAgreementsId:N,userType:k,verificationId:D}){this.address=t,this.blacklistValidationStatus=Ot(X,e),this.clabe=s,this.countryOfBirth=i,this.createdAt=At(a),this.curp=r,this.curpDocument=n,this.dateOfBirth=c,this.emailAddress=o,this.firstSurname=d,this.gender=u,this.id=l,this.isDormant=p,this.isFraud=m,this.isPldBlocked=w,this.isSecurityMode=_,this.level=f,this.names=b,this.nationality=y,this.phoneNumber=g,this.govtId=h,this.proofOfAddress=v,this.proofOfLife=A,this.requiredLevel=O,this.rfc=j,this.secondSurname=I,this.stateOfBirth=S,this.status=Ot(Q,x),this.termsOfService=T,this.updatedAt=At(C),this.userTosAgreementsId=N,this.userType=k,this.verificationId=D}get address(){return this._address}set address(t){t&&(this._address=jt.fromObject(t))}get proofOfAddress(){return this._proofOfAddress}set proofOfAddress(t){t&&(this._proofOfAddress=Nt.fromObject(t))}get proofOfLife(){return this._proofOfLife}set proofOfLife(t){t&&(this._proofOfLife=Nt.fromObject(t))}get govtId(){return this._govtId}set govtId(t){t&&(this._govtId=Nt.fromObject(t))}get termsOfService(){return this._termsOfService}set termsOfService(t){t&&(this._termsOfService=Bt.fromObject(t))}get curpDocument(){return this._curpDocument}set curpDocument(t){t&&(this._curpDocument=Nt.fromObject(t))}static fromObject=({address:t,clabe:e,curp:s,gender:i,id:a,level:r,names:n,nationality:c,rfc:o,status:d,...u})=>new fe({address:t,clabe:e,curp:s,gender:i,id:a,level:r,names:n,nationality:c,rfc:o,status:d,blacklistValidationStatus:u.blacklist_validation_status,countryOfBirth:u.country_of_birth,createdAt:u.created_at,curpDocument:u.curp_document,dateOfBirth:u.date_of_birth,emailAddress:u.email_address,firstSurname:u.first_surname,govtId:u.govt_id,isDormant:u.is_dormant,isFraud:u.is_fraud,isPldBlocked:u.is_pld_blocked,isSecurityMode:u.is_security_mode,phoneNumber:u.phone_number,proofOfAddress:u.proof_of_address,proofOfLife:u.proof_of_life,requiredLevel:u.required_level,secondSurname:u.second_surname,stateOfBirth:u.state_of_birth,termsOfService:u.terms_of_service,updatedAt:u.updated_at,userTosAgreementsId:u.user_tos_agreements_id,userType:u.user_type,verificationId:u.verification_id})}class be{constructor({createdAt:t,id:e,isActive:s,updatedAt:i}){this.createdAt=At(t),this.id=e,this.isActive=s,this.updatedAt=At(i)}static fromObject=({id:t,...e})=>new be({id:t,createdAt:e.created_at,isActive:e.is_active,updatedAt:e.updated_at})}class ye{constructor({id:t,lastLoginAt:e,success:s}){this.id=t,this.lastLoginAt=At(e),this.success=s}static fromObject=({id:t,success:e,...s})=>new ye({id:t,success:e,lastLoginAt:s.last_login_at})}class ge{constructor({createdAt:t,id:e,ip:s,location:i,type:a,updatedAt:r,version:n}){this.createdAt=At(t),this.id=e,this.ip=s,this.location=i,this.type=a,this.updatedAt=At(r),this.version=n}static fromObject=({id:t,ip:e,location:s,type:i,version:a,...r})=>new ge({id:t,ip:e,location:s,type:i,version:a,createdAt:r.created_at,updatedAt:r.updated_at})}class ve{constructor({createdAt:t,id:e,platformId:s,recipient:i,type:a,updatedAt:r}){this.createdAt=At(t),this.id=e,this.platformId=s,this.recipient=i,this.type=Ot(z,a),this.updatedAt=At(r)}static fromObject=({id:t,recipient:e,type:s,...i})=>new ve({id:t,recipient:e,type:s,createdAt:i.created_at,platformId:i.platform_id,updatedAt:i.updated_at})}class Ae extends Yt{constructor({amount:t,createdAt:e,descriptor:s,id:i,status:a,transactionType:r,userId:n,walletUri:c}){super({amount:t,createdAt:e,descriptor:s,status:a,userId:n}),this.id=i,this.transactionType=Ot(tt,r),this.walletUri=c}static fromObject=({amount:t,descriptor:e,id:s,status:i,...a})=>new Ae({amount:t,descriptor:e,id:s,status:i,createdAt:a.created_at,transactionType:a.transaction_type,userId:a.user_id,walletUri:a.wallet_uri})}class Oe extends Yt{constructor({amount:t,claimUrl:e,createdAt:s,descriptor:i,destinationUri:a,expiresAt:r,id:n,network:c,phoneNumber:o,recipientName:d,status:u,trackingKey:h,updatedAt:l,userId:p}){super({amount:t,createdAt:s,descriptor:i,status:u,userId:p}),this.claimUrl=e,this.destinationUri=a,this.id=n,this.expiresAt=At(r),this.network=Ot(Z,c),this.phoneNumber=o,this.recipientName=d,this.trackingKey=h,this.updatedAt=At(l)}static fromObject=({amount:t,descriptor:e,id:s,network:i,status:a,...r})=>new Oe({amount:t,descriptor:e,id:s,network:i,status:a,createdAt:r.created_at,claimUrl:r.claim_url,destinationUri:r.destination_uri,expiresAt:r.expires_at,phoneNumber:r.phone_number,recipientName:r.recipient_name,trackingKey:r.tracking_key,updatedAt:r.updated_at,userId:r.user_id})}class je{constructor(t){this.superclass=t}with(...t){return t.reduce(((t,e)=>e(t)),this.superclass)}}const Ie=t=>new je(t),Se=(t,e)=>({accounts:()=>Kt.fromObject(e),alerts:()=>Gt.fromObject(e),api_keys:()=>Ft.fromObject(e),arpc:()=>Vt.fromObject(e),balance_entries:()=>Ht.fromObject(e),bill_payments:()=>$t.fromObject(e),"bridge/accounts":()=>Wt.fromObject(e),"bridge/bank_accounts":()=>Zt.fromObject(e),"bridge/clabes":()=>Qt.fromObject(e),"bridge/kyc_validations":()=>re.fromObject(e),"bridge/sessions":()=>me.fromObject(e),"bridge/transactions":()=>Jt.fromObject(e),cards:()=>Xt.fromObject(e),card_activations:()=>zt.fromObject(e),card_transactions:()=>te.fromObject(e),card_validations:()=>ee.fromObject(e),commissions:()=>se.fromObject(e),deposits:()=>ie.fromObject(e),files:()=>ae.fromObject(e),kyc_validations:()=>re.fromObject(e),login_tokens:()=>ne.fromObject(e),partners:()=>de.fromObject(e),postal_codes:()=>ue.fromObject(e),savings:()=>le.fromObject(e),service_providers:()=>pe.fromObject(e),sessions:()=>me.fromObject(e),statements:()=>we.fromObject(e),transfers:()=>_e.fromObject(e),users:()=>fe.fromObject(e),user_credentials:()=>be.fromObject(e),user_logins:()=>ye.fromObject(e),users_tos_agreements:()=>ge.fromObject(e),verifications:()=>ve.fromObject(e),wallet_transactions:()=>Ae.fromObject(e),whatsapp_transfers:()=>Oe.fromObject(e)}[t]()),xe=t=>{if(null===t||""===t)return null;const e=t.match("/(.*?)/");return null===e?null:e[0].replaceAll("/","")};class Te{constructor(t,e,s){this.path=t,this.QueryParams=e,this.client=s}}const Ce=t=>class extends t{async retrieve(t){const e=await this.client.get({endpoint:`/${this.path}/${t}`});return Se(this.path,e)}},Ne=t=>class extends t{async _create(t){const e=await this.client.post({endpoint:`/${this.path}`,data:t});return Se(this.path,e)}},ke=t=>class extends t{async _update(t,e){const s=await this.client.patch({endpoint:`/${this.path}/${t}`,data:e});return Se(this.path,s)}},De=t=>class extends t{async _upload(t){const e=await this.client.post({endpoint:`/${this.path}`,data:t,multipart:!0});return Se(this.path,e)}},Ue=t=>class extends t{async _deactivate(t,e){const s=await this.client.delete({endpoint:`/${this.path}/${t}`,data:e});return Se(this.path,s)}},Me=t=>class extends t{async _download(t,e){return await this.client.get({endpoint:`/${this.path}/${t}`,format:e})}},Re=t=>class extends t{async one(t=new this.QueryParams({})){const{items:e}=await this.client.get({endpoint:`/${this.path}`,params:t.toParams()});if(!e||!e.length)throw new o;if(e.length>1)throw new d;const[s]=e;return Se(this.path,s)}async first(t=new this.QueryParams({})){const{items:e}=await this.client.get({endpoint:`/${this.path}`,params:t.toParams()});if(!e||!e[0])return null;const[s]=e;return Se(this.path,s)}async count(t=new this.QueryParams({})){t.count=!0;const{count:e}=await this.client.get({endpoint:`/${this.path}`,params:t.toParams()});return e||0}async*all(t=new this.QueryParams({})){let e=`/${this.path}?${t.toQueryString()}`;for(;e;){const t=await this.client.get({endpoint:e});if(t.items)for(const e of t.items){const t=Se(this.path,e);yield t}e=t.next_page_uri}}};class Pe extends(Ie(Te).with(Re,Ce)){constructor(t){super("accounts",st,t)}}class Be{toObject(){return{}}toCleanObject(){const t=this.toObject();return Object.keys(t).forEach((e=>{null==t[e]&&delete t[e]})),t}}class Le extends Be{constructor(t,e){super(),this.userId=t,this.metadata=e}toObject(){return{user_id:this.userId,metadata:this.metadata}}}class qe extends Be{constructor({accountNumber:t,actualPeriodCount:e,actualPeriodSum:s,agent:i,aggregationType:a,changeLog:r,committeeMeetingDate:n,comments:c,createdAt:o,description:d,id:u,institutionName:h,level:l,manualScenario:p,name:m,period:w,periodNumber:_,status:f,sourceType:b,transactionDate:y,type:g,typeOfFilter:v,updatedAt:A,userId:O}={}){super(),this.accountNumber=t,this.actualPeriodCount=e,this.actualPeriodSum=s,this.agent=i,this.aggregationType=a,this.changeLog=r,this.committeeMeetingDate=n,this.createdAt=o,this.comments=c,this.description=d,this.id=u,this.institutionName=h,this.level=l,this.name=m,this.manualScenario=p,this.period=w,this.periodNumber=_,this.status=f,this.sourceType=b,this.transactionDate=y,this.type=g,this.typeOfFilter=v,this.updatedAt=A,this.userId=O}toObject(){return{agent:this.agent,change_log:this.changeLog,comments:this.comments,description:this.description,id:this.id,level:this.level,name:this.name,period:this.period,status:this.status,type:this.type,account_number:this.accountNumber,actual_period_count:this.actualPeriodCount,actual_period_sum:this.actualPeriodSum,aggregation_type:this.aggregationType,committee_meeting_date:this.committeeMeetingDate,created_at:this.createdAt,institution_name:this.institutionName,manual_scenario:this.manualScenario,period_number:this.periodNumber,transaction_date:this.transactionDate,source_type:this.sourceType,type_of_filter:this.typeOfFilter,updated_at:this.updatedAt,user_id:this.userId}}}class Ee extends Be{constructor(t,e,s){super(),this.userId=t,this.issuer=e,this.fundingType=s}toObject(){return{user_id:this.userId,issuer:this.issuer,funding_type:this.fundingType}}}class Ke extends Be{constructor(t,e){super(),this.status=t,this.pinBlock=e}toObject(){return{status:this.status,pin_block:this.pinBlock}}}class Ge extends Be{constructor(t,e,s,i){super(),this.n=t,this.eM=e,this.eY=s,this.c2=i}get number(){return this._number}set n(t){if([!!t,16===t.length,/^\d{16}/.test(t)].some((t=>!t)))throw new l("Invalid number");this._number=t.trim()}get expMonth(){return this._expMonth}set eM(t){if([!!t,t>=1,t<=12].some((t=>!t)))throw new l("Invalid expiration month");this._expMonth=t}get expYear(){return this._expYear}set eY(t){if([!!t,t>=18,t<=99].some((t=>!t)))throw new l("Invalid expiration year");this._expYear=t}get cvv2(){return this._cvv2}set c2(t){if([!!t,3===t.length,/^\d{3}/.test(t)].some((t=>!t)))throw new l("Invalid cvv2");this._cvv2=t}toObject(){return{number:this.number,exp_month:this.expMonth,exp_year:this.expYear,cvv2:this.cvv2}}}class Fe extends Be{constructor({cvv:t,cvv2:e,expMonth:s,expYear:i,icvv:a,number:r,pinBlock:n,pinAttemptsExceeded:c}){super(),this.c=t,this.c2=e,this.em=s,this.ey=i,this.ic=a,this.n=r,this.pinBloc=n,this.pinAttemptsExceeded=c}get cvv(){return this._cvv}set c(t){if(!t)return;if([3===t.length].some((t=>!t)))throw new l("Invalid cvv");this._cvv=t}get cvv2(){return this._cvv2}set c2(t){if(!t)return;if([3===t.length].some((t=>!t)))throw new l("Invalid cvv2");this._cvv2=t}get expMonth(){return this._expMonth}set em(t){if(!t)return;if([t>=1,t<=12].some((t=>!t)))throw new l("Invalid expiration month");this._expMonth=t}get expYear(){return this._expYear}set ey(t){if(!t)return;if([t>=18,t<=99].some((t=>!t)))throw new l("Invalid expiration year");this._expYear=t}get icvv(){return this._icvv}set ic(t){if(!t)return;if([3===t.length].some((t=>!t)))throw new l("Invalid icvv");this._icvv=t}get number(){return this._number}set n(t){if([!!t,16===t.length,/^\d{16}/.test(t)].some((t=>!t)))throw new l("Invalid number");this._number=t}toObject(){return{cvv:this.cvv,cvv2:this.cvv2,exp_month:this.expMonth,exp_year:this.expYear,icvv:this.icvv,number:this.number,pin_block:this.pinBloc,pin_attempts_exceeded:this.pinAttemptsExceeded}}}class Ve extends Be{constructor({userId:t,force:e,isBridge:s=!1}){super(),this.force=e,this.userId=t,this.isBridge=s}toObject(){return{force:this.force,[this.isBridge?"account_id":"user_id"]:this.userId}}}class He extends Be{constructor({city:t,colonia:e,country:s,extNumber:i,fullName:a,intNumber:r,postalCode:n,postalCodeId:c,state:o,street:d}={}){super(),this.city=t,this.colonia=e,this.country=s,this.extNumber=i,this.fullName=a,this.intNumber=r,this.postalCode=n,this.postalCodeId=c,this.state=o,this.street=d}toObject(){return{city:this.city,colonia:this.colonia,country:this.country,ext_number:this.extNumber,full_name:this.fullName,int_number:this.intNumber,postal_code:this.postalCode,postal_code_id:this.postalCodeId,state:this.state,street:this.street}}}class Ye extends Be{constructor({speiTransfersNum:t,speiTransfersAmount:e,internalTransfersNum:s,internalTransfersAmount:i}){super(),this.speiTransfersNum=t,this.speiTransfersAmount=e,this.internalTransfersNum=s,this.internalTransfersAmount=i}toObject(){return{spei_transfers_num:this.speiTransfersNum,spei_transfers_amount:this.speiTransfersAmount,internal_transfers_num:this.internalTransfersNum,internal_transfers_amount:this.internalTransfersAmount}}}class $e{constructor({currency:t,monthlyAmount:e,recipientsNum:s,payersNum:i,deposits:a,withdrawal:r}){this.currency=t,this.monthlyAmount=e,this.recipientsNum=s,this.payersNum=i,this.deposits=a,this.withdrawal=r}get deposits(){return this._deposits}set deposits(t){t&&(this._deposits=new Ye(t).toObject())}get withdrawal(){return this._withdrawal}set withdrawal(t){t&&(this._withdrawal=new Ye(t).toObject())}toObject(){return{currency:this.currency,monthly_amount:this.monthlyAmount,recipients_num:this.recipientsNum,payers_num:this.payersNum,deposits:this.deposits,withdrawal:this.withdrawal}}}class We extends Be{constructor({accountUsageDescription:t,businessDescription:e}){super(),this.accountUsageDescription=t,this.businessDescription=e}toObject(){return{account_usage_description:this.accountUsageDescription,business_description:this.businessDescription}}}class Ze extends Be{constructor({names:t,curp:e,rfc:s,firstSurname:i,percentage:a,secondSurname:r,shareCapital:n}){super(),this.names=t,this.curp=e,this.percentage=a,this.rfc=s,this.shareCapital=n,this.firstSurname=i,this.secondSurname=r}toObject(){return{curp:this.curp,names:this.names,percentage:this.percentage,rfc:this.rfc,share_capital:this.shareCapital,first_surname:this.firstSurname,second_surname:this.secondSurname}}}class Qe extends Ze{constructor({address:t,curp:e,emailAddress:s,firstSurname:i,job:a,names:r,percentage:n,phoneNumber:c,rfc:o,secondSurname:d}){super({curp:e,firstSurname:i,names:r,percentage:n,rfc:o,secondSurname:d}),this.job=a,this.phoneNumber=c,this.emailAddress=s,this.address=t}get address(){return this._address}set address(t){t&&(this._address=new He(t).toCleanObject())}toObject(){return{...super.toObject(),job:this.job,phone_number:this.phoneNumber,email_address:this.emailAddress,address:this.address}}}class Je extends Be{constructor({name:t,percentage:e,shareholders:s,legalRepresentatives:i}){super(),this.name=t,this.percentage=e,this.shareholders=s,this.legalRepresentatives=i}get shareholders(){return this._shareholders}set shareholders(t){t&&(this._shareholders=t.map((t=>new Ze(t).toObject())))}get legalRepresentatives(){return this._legalRepresentatives}set legalRepresentatives(t){t&&(this._legalRepresentatives=t.map((t=>new Qe(t).toObject())))}toObject(){return{name:this.name,percentage:this.percentage,shareholders:this.shareholders,legal_representatives:this.legalRepresentatives}}}class Xe extends Be{constructor({isVulnerableActivity:t,hasSatRegister:e,satRegisteredDate:s,isInCompliance:i}){super(),this.isVulnerableActivity=t,this.hasSatRegister=e,this.satRegisteredDate=s,this.isInCompliance=i}toObject(){return{is_vulnerable_activity:this.isVulnerableActivity,has_sat_register:this.hasSatRegister,sat_registered_date:this.satRegisteredDate,is_in_compliance:this.isInCompliance}}}class ze extends Be{constructor({licenseRequired:t,supervisoryEntity:e,licenseType:s,licenseDate:i}){super(),this.licenseRequired=t,this.supervisoryEntity=e,this.licenseType=s,this.licenseDate=i}toObject(){return{license_required:this.licenseRequired,supervisory_entity:this.supervisoryEntity,license_type:this.licenseType,license_date:this.licenseDate}}}class ts extends Be{constructor({hasAudit:t,auditProvider:e,auditDate:s,auditComments:i}){super(),this.hasAudit=t,this.auditProvider=e,this.auditDate=s,this.auditComments=i}toObject(){return{has_audit:this.hasAudit,audit_provider:this.auditProvider,audit_date:this.auditDate,audit_comments:this.auditComments}}}class es extends Be{constructor({address:t,audit:e,businessDetails:s,businessName:i,clabe:a,createdAt:r,documentationUrl:n,emailAddress:c,externalAccount:o,folio:d,id:u,incorporationDate:h,legalName:l,legalRepresentatives:p,level:m,license:w,meta:_,nationality:f,phoneNumber:b,platformId:y,requiredLevel:g,rfc:v,shareholders:A,status:O,transactionalProfile:j,updatedAt:I,userId:S,userType:x,vulnerableActivity:T,webSite:C}={}){super(),this.addressRequest=t,this.auditRequest=e,this.businessDetailsRequest=s,this.businessName=i,this.clabe=a,this.createdAt=r,this.documentationUrl=n,this.emailAddress=c,this.externalAccountRequest=o,this.folio=d,this.id=u,this.incorporationDate=h,this.legalName=l,this.legalRepresentativesRequest=p,this.level=m,this.licenseRequest=w,this.meta=_,this.nationality=f,this.phoneNumber=b,this.platformId=y,this.requiredLevel=g,this.rfc=v,this.shareholdersRequest=A,this.status=O,this.transactionalProfileRequest=j,this.updatedAt=I,this.userId=S,this.userType=x,this.vulnerableActivityRequest=T,this.webSite=C}get address(){return this._address}set addressRequest(t){t&&(this._address=new He(t).toCleanObject())}get audit(){return this._audit}set auditRequest(t){t&&(this._audit=new ts(t).toObject())}get businessDetails(){return this._businessDetails}set businessDetailsRequest(t){t&&(this._businessDetails=new We(t).toObject())}get legalRepresentatives(){return this._legalRepresentatives}set legalRepresentativesRequest(t){t&&(this._legalRepresentatives=t.map((t=>new Qe(t).toObject())))}get license(){return this._license}set licenseRequest(t){t&&(this._license=new ze(t).toObject())}get shareholders(){return this._shareholders}set shareholdersRequest(t){t&&(this._shareholders=t.map((t=>new Je(t).toObject())))}get transactionalProfile(){return this._transactionalProfile}set transactionalProfileRequest(t){t&&(this._transactionalProfile=new $e(t).toObject())}get vulnerableActivity(){return this._vulnerableActivity}set vulnerableActivityRequest(t){t&&(this._vulnerableActivity=new Xe(t).toObject())}get externalAccount(){return this._externalAccount}set externalAccountRequest(t){t&&(this._externalAccount={account:t.account,bank:t.bank})}toObject(){return{address:this.address,audit:this.audit,business_details:this.businessDetails,business_name:this.businessName,clabe:this.clabe,created_at:this.createdAt,documentation_url:this.documentationUrl,email_address:this.emailAddress,external_account:this.externalAccount,folio:this.folio,id:this.id,incorporation_date:this.incorporationDate,legal_name:this.legalName,legal_representatives:this.legalRepresentatives,level:this.level,license:this.license,meta:this.meta,nationality:this.nationality,phone_number:this.phoneNumber,platform_id:this.platformId,required_level:this.requiredLevel,rfc:this.rfc,shareholders:this.shareholders,status:this.status,transactional_profile:this.transactionalProfile,updated_at:this.updatedAt,user_id:this.userId,user_type:this.userType,vulnerable_activity:this.vulnerableActivity,web_site:this.webSite}}}class ss extends Be{constructor(t,e,s,i){super(),this.category=t,this.name=i,this.goalAmount=e,this.validDate=s}get goalDate(){return this._goalDate}set validDate(t){if(t){if(At(t).getTime()<=At(Date.now()).getTime())throw new l("The goal_date always need to be higher than now");this._goalDate=t}}toObject(){return{category:this.category,goal_amount:this.goalAmount,goal_date:this.goalDate,name:this.name}}}class is extends Be{constructor({failureUrl:t,successUrl:e,type:s,userId:i,isBridge:a=!1}){super(),this.failureUrl=t,this.successUrl=e,this.type=s,this.userId=i,this.isBridge=a}toObject(){return{failure_url:this.failureUrl,success_url:this.successUrl,type:this.type,[this.isBridge?"account_id":"user_id"]:this.userId}}}class as extends Be{constructor(t,e,s,i,a){super(),this.accountNumber=t,this.amount=e,this.descriptor=s,this.idempotencyKey=i,this.recipientName=a}toObject(){return{account_number:this.accountNumber,amount:this.amount,descriptor:this.descriptor,idempotency_key:this.idempotencyKey,recipient_name:this.recipientName}}}class rs extends Be{constructor(t){super(),this.pwd=t}get password(){return this._password}set pwd(t){if([!!t,t.length>=6].some((t=>!t)))throw new l("Invalid password");this._password=t}toObject(){return{password:this.password}}}class ns extends Be{constructor(t,e){super(),this.pwd=t,this.isActive=e,this.req={password:this.password,isActive:this.isActive}}get password(){return this._password}get request(){return this._request}set pwd(t){if(!t)return void(this._password=t);if([t.length>=6].some((t=>!t)))throw new l("Invalid password");this._password=t}set req(t){if(t.password&&null!=t.isActive)throw new l("Only one property can be updated at a time");this._request=t}toObject(){return{password:this.request.password,is_active:this.request.isActive}}}class cs extends Be{constructor(t,e="me"){super(),this.pwd=t,this.userId=e}get password(){return this._password}set pwd(t){if([!!t,6===t.length,/^\d{6}$/.test(t)].some((t=>!t)))throw new l("Invalid password");this._password=t}toObject(){return{password:this.password,user_id:this.userId}}}class os extends Be{constructor({ip:t,location:e,type:s,version:i}){super(),this.ipAddress=t,this.location=e,this.type=s,this.version=i}get ip(){return this._ip}set ipAddress(t){if(!t)throw new l("missing ip address");if(!t.split(".").every((t=>t>=0&&t<=255)))throw new l("Invalid ip address");this._ip=t}toObject(){return{ip:this.ip,location:this.location,type:this.type,version:this.version}}}class ds extends Be{constructor({data:t,isMx:e,status:s,type:i,uriBack:a,uriFront:r}){super(),this.data=t,this.isMx=e,this.status=s,this.type=i,this.uriBack=a,this.uriFront=r}toObject(){return{data:this.data,is_mx:this.isMx,status:this.status,type:this.type,uri_back:this.uriBack,uri_front:this.uriFront}}}class us extends Be{constructor({address:t,blacklistValidationStatus:e,curpDocumentUri:s,govtId:i,emailAddress:a,isDormant:r,isFraud:n,isPldBlocked:c,isSecurityMode:o,profession:d,proofOfAddress:u,proofOfLife:h,requiredLevel:l,termsOfService:p,phoneNumber:m,rfc:w,status:_,userType:f,verificationId:b}){super(),this.addressProofs=u,this.adrs=t,this.blacklistValidationStatus=e,this.curpDocumentUri=s,this.emailAddress=a,this.govstIds=i,this.isDormant=r,this.isFraud=n,this.isPldBlocked=c,this.isSecurityMode=o,this.lifeProofs=h,this.profession=d,this.phoneNumber=m,this.requiredLevel=l,this.termsOfService=p,this.rfc=w,this.status=_,this.userType=f,this.verificationId=b}get termsOfService(){return this._termsOfService}set termsOfService(t){t&&(this._termsOfService=new os(t).toObject())}get address(){return this._address}set adrs(t){t&&(this._address=new He(t).toCleanObject())}get proofOfLife(){return this._proofOfLife}set lifeProofs(t){t&&(this._proofOfLife=new ds(t).toCleanObject())}get proofOfAddress(){return this._proofOfAddress}set addressProofs(t){t&&(this._proofOfAddress=new ds(t).toCleanObject())}get govtId(){return this._govtId}set govstIds(t){t&&(this._govtId=new ds(t).toCleanObject())}toObject(){return{address:this.address,blacklist_validation_status:this.blacklistValidationStatus,curp_document_uri:this.curpDocumentUri,email_address:this.emailAddress,govt_id:this.govtId,is_dormant:this.isDormant,is_fraud:this.isFraud,is_pld_blocked:this.isPldBlocked,is_security_mode:this.isSecurityMode,phone_number:this.phoneNumber,profession:this.profession,proof_of_life:this.proofOfLife,proof_of_address:this.proofOfAddress,requiredLevel:this.requiredLevel,rfc:this.rfc,status:this.status,terms_of_service:this.termsOfService,verification_id:this.verificationId,user_type:this.userType}}}class hs extends Be{constructor({platformId:t,recipient:e,type:s}){super(),this.platformId=t,this.type=s,this.recipients=e}get recipient(){return this._recipient}set recipients(t){switch(Ot(z,this.type)){case z.Email:if(!t.match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/))throw new l("Invalid email address");this._recipient=t;break;case z.Phone:if(!t.match(/^\+?[0-9]{10,15}$/))throw new l("Invalid Phone Number");this._recipient=t}}toObject(){return{platform_id:this.platformId,recipient:this.recipient,type:this.type}}}class ls extends Be{constructor({code:t}){super(),this.code=t}toObject(){return{code:this.code}}}class ps extends Be{constructor(t,e,s){super(),this.amount=t,this.transactionType=e,this.walletUri=s}toObject(){return{amount:this.amount,transaction_type:this.transactionType,wallet_uri:this.walletUri}}}class ms extends(Ie(Te).with(Ne,Re,Ce,ke)){constructor(t){super("alerts",it,t)}async create(t){const e=new qe(t);return await this._create(e.toCleanObject())}async update(t,e){const s=new qe(e);return await this._update(t,s.toCleanObject())}}class ws extends(Ie(Te).with(Ne,Ue,Re,Ce,ke)){constructor(t){super("api_keys",at,t)}async create(){return await this._create()}async deactivate(t,e=0){return await this._deactivate(t,{minutes:e})}async update(t,e,s){const i=new Le(s,e);return await this._update(t,i.toCleanObject())}}class _s extends(Ie(Te).with(Ne)){constructor(t){super("arpc",Object,t)}async create({number:t,arqc:e,arpcMethod:s,transactionData:i,responseCode:a,transactionCounter:r,panSequence:n,uniqueNumber:c,trackDataMethod:o}){const d=new ArpcRequest({number:t,arqc:e,arpcMethod:s,transactionData:i,responseCode:a,transactionCounter:r,panSequence:n,uniqueNumber:c,trackDataMethod:o});return await this._create(d.toObject())}}class fs extends(Ie(Te).with(Re,Ce)){constructor(t){super("balance_entries",rt,t)}async relatedTransaction(t){const e=xe(t);if(null==e)return null;const s=await this.client.get({endpoint:t});return Se(`${e}`,s)}async fundingInstrument(t){const e=xe(t);if(null==e)return null;const s=await this.client.get({endpoint:t});return Se(`${e}`,s)}}class bs extends(Ie(Te).with(Re,Ce)){constructor(t){super("bill_payments",nt,t)}async serviceProvider(t){const e=xe(t);if(null==e)return null;const s=await this.client.get({endpoint:t});return Se(`${e}`,s)}}class ys extends(Ie(Te).with(Re,ke,Ce)){constructor(t){super("bridge/accounts",ct,t)}async update({userId:t="me",...e}){const s=new us(e);return await this._update(t,s.toCleanObject())}}class gs extends(Ie(Te).with(Re,Ce)){constructor(t){super("bridge/bank_accounts",ot,t)}}class vs extends(Ie(Te).with(Re)){constructor(t){super("bridge/clabes",dt,t)}}class As extends(Ie(Te).with(Re,Ce)){constructor(t){super("bridge/transactions",ut,t)}}class Os extends(Ie(Te).with(Ne)){constructor(t){super("card_activations",Object,t)}async create({number:t,expMonth:e,expYear:s,cvv2:i}){const a=new Ge(t,e,s,i);return await this._create(a.toCleanObject())}async card(t){if(!t)return null;const e=await this.client.get({endpoint:t});return Xt.fromObject(e)}}class js extends(Ie(Te).with(Ne,Ue,Re,Ce,ke)){constructor(t){super("cards",ht,t)}async create(t,e,s){const i=new Ee(t,e,s);return await this._create(i.toCleanObject())}async deactivate(t){return await this._deactivate(t)}async update(t,e,s){const i=new Ke(e,s);return await this._update(t,i.toCleanObject())}}class Is extends(Ie(Te).with(Re,Ce)){constructor(t){super("card_transactions",lt,t)}async relatedCard(t){const e=xe(t);if(null==e)return null;const s=await this.client.get({endpoint:t});return Se(`${e}`,s)}}class Ss extends(Ie(Te).with(Ne)){constructor(t){super("card_validations",Object,t)}async create({cvv:t,cvv2:e,expMonth:s,expYear:i,icvv:a,number:r,pinBlock:n,pinAttemptsExceeded:c}){const o=new Fe({cvv:t,cvv2:e,expMonth:s,expYear:i,icvv:a,number:r,pinBlock:n,pinAttemptsExceeded:c});return await this._create(o.toCleanObject())}async card(t){if(!t)return null;const e=await this.client.get({endpoint:t});return Xt.fromObject(e)}}class xs extends(Ie(Te).with(Re,Ce)){constructor(t){super("commissions",et,t)}async relatedTransaction(t){const e=xe(t);if(null==e)return null;const s=await this.client.get(t);return Se(`${e}`,s)}}class Ts extends(Ie(Te).with(Re,Ce)){constructor(t){super("deposits",mt,t)}async source(t){const e=await this.client.get({endpoint:t});return Kt.fromObject(e)}}class Cs extends(Ie(Te).with(Me,De)){constructor(t){super("files",Object,t)}async download(t){return await this._download(t,D.Any)}async upload(t){return await this._upload(t)}}class Ns extends(Ie(Te).with(Ne,Ce,Ue,Re)){constructor(t,e=!1){super(e?"bridge/kyc_validations":"kyc_validations",Object,t),this.isBridge=e}async create(t="me",e=!1){const s=new Ve({force:e,userId:t,isBridge:this.isBridge});return await this._create(s.toCleanObject())}async deactivate(t){return await this._deactivate(t)}}class ks extends(Ie(Te).with(Ne)){constructor(t){super("login_tokens",Object,t)}async create(){return await this._create()}}class Ds extends(Ie(Te).with(Ne,Re,ke,Ce)){constructor(t){super("partners",wt,t)}async create(t){const e=new es(t);return await this._create(e.toCleanObject())}async update(t,e){const s=new es(e);return await this._update(t,s.toCleanObject())}}class Us extends(Ie(Te).with(Re)){constructor(t){super("postal_codes",_t,t)}}class Ms extends(Ie(Te).with(Ne,Ue,Re,Ce,ke)){constructor(t){super("savings",gt,t)}async create(t,e,s,i){const a=new ss(t,e,s,i);return await this._create(a.toObject())}async deactivate(t){return await this._deactivate(t)}async update(t,e,s,i,a){const r=new ss(e,s,i,a);return await this._update(t,r.toObject())}}class Rs extends(Ie(Te).with(Re,Ce)){constructor(t){super("service_providers",et,t)}}class Ps extends(Ie(Te).with(Ne,Ce,Re)){constructor(t,e=!1){super(e?"bridge/sessions":"sessions",Object,t),this.isBridge=e}async create(t,e,s,i){const a=new is({failureUrl:i,successUrl:s,type:e,userId:t,isBridge:this.isBridge});return await this._create(a.toCleanObject())}}class Bs extends(Ie(Te).with(Me,Re)){constructor(t){super("statements",ft,t)}async pdf(t){return await this._download(t,D.Pdf)}async xml(t){return await this._download(t,D.Xml)}}class Ls extends(Ie(Te).with(Ne,Re,Ce)){constructor(t){super("transfers",bt,t)}async destination(t){const e=await this.client.get({endpoint:t});return Kt.fromObject(e)}async create({accountNumber:t,amount:e,descriptor:s,recipientName:i,idempotencyKey:a}){const r=a||this.constructor._genIdempotencyKey(t,e),n=new as(t,e,s,r,i);return await this._create(n.toCleanObject())}async createMany(t){if(!t||!Array.isArray(t)||!t.length)return{};const e={submitted:[],errors:[]};return await Promise.all(t.map((async({accountNumber:t,amount:s,descriptor:i,idempotencyKey:a,recipientName:r})=>{const n=new as(t,s,i,a||this.constructor._genIdempotencyKey(t,s),r);let c;try{c=await this._create(n.toCleanObject())}catch(t){return void e.errors.push({actualRequest:n,error:t})}e.submitted.push(c)}))),e}static _genIdempotencyKey(t,e){const[s]=At(Date.now()).toISOString().split("T");return`${s}:${t}:${e}`}}class qs extends(Ie(Te).with(Ne,ke)){constructor(t){super("user_credentials",Object,t)}async create(t){const e=new rs(t);return await this._create(e.toObject())}async update({isActive:t,password:e,userId:s="me"}){const i=new ns(e,t);return await this._update(s,i.toCleanObject())}}class Es extends(Ie(Te).with(Ne,Ue)){constructor(t){super("user_logins",Object,t),this.loginIdInHeaders=null}async create(t,e){const s=new cs(t,e),i=await this._create(s.toObject());if(!i.success)throw new h;return this.loginIdInHeaders=this.client.addHeadersToRequest({"X-Cuenca-LoginId":i.id}),i}async logOut(t="me"){return await this._deactivate(t,{}),this.loginIdInHeaders&&this.loginIdInHeaders.eject(),!0}}class Ks extends(Ie(Te).with(Re,ke,Ce,Ue)){constructor(t){super("users",yt,t)}async update({userId:t="me",...e}){const s=new us(e);return await this._update(t,s.toCleanObject())}async deactivate(t){return await this._deactivate(t)}}class Gs extends(Ie(Te).with(Ce)){constructor(t){super("users_tos_agreements",Object,t)}}class Fs extends(Ie(Te).with(Ne,ke)){constructor(t){super("verifications",Object,t)}async create({platformId:t,recipient:e,type:s}){const i=new hs({platformId:t,recipient:e,type:s});return await this._create(i.toObject())}async update({code:t,id:e}){const s=new ls({code:t});return await this._update(e,s.toObject())}}class Vs extends(Ie(Te).with(Ne,Re,Ce)){constructor(t){super("wallet_transactions",vt,t)}async create(t,e,s){const i=new ps(t,e,s);return await this._create(i.toObject())}async realtedWallet(t){const e=xe(t);if(null==e)return null;const s=await this.client.get(t);return Se(`${e}`,s)}}class Hs extends(Ie(Te).with(Re,Ce)){constructor(t){super("whatsapp_transfers",et,t)}async accountDestination(t){const e=xe(t);if(null==e)return null;const s=await this.client.get(t);return Se(`${e}`,s)}}t.Cuenca=class{constructor({apiKey:t,apiSecret:e,language:s="en",phase:i=q.Sandbox}={}){this.client=new Et({apiKey:t,apiSecret:e,language:s,phase:i}),this.withClient(this.client)}withClient(t){this.accounts=new Pe(t),this.alerts=new ms(t),this.apiKeys=new ws(t),this.balanceEntries=new fs(t),this.billPayments=new bs(t),this.bridgeAccounts=new ys(t),this.bridgeBankAccounts=new gs(t),this.bridgeClabes=new vs(t),this.bridgeKycValidations=new Ns(t,!0),this.bridgeSessions=new Ps(t,!0),this.bridgeTransactions=new As(t),this.cardActivations=new Os(t),this.cards=new js(t),this.cardTransactions=new Is(t),this.cardValidations=new Ss(t),this.commissions=new xs(t),this.deposits=new Ts(t),this.files=new Cs(t),this.kycValidations=new Ns(t),this.loginTokens=new ks(t),this.partners=new Ds(t),this.postalCodes=new Us(t),this.savings=new Ms(t),this.serviceProviders=new Rs(t),this.sessions=new Ps(t),this.statements=new Bs(t),this.transfers=new Ls(t),this.userCredentials=new qs(t),this.userLogins=new Es(t),this.users=new Ks(t),this.usersTosAgreements=new Gs(t),this.verifications=new Fs(t),this.walletTransactions=new Vs(t),this.whatsAppTransfers=new Hs(t)}}}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("axios"),require("buffer")):"function"==typeof define&&define.amd?define(["exports","axios","buffer"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).cuenca={},t.axios,t.Buffer)}(this,(function(t,e,s){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=i(e),r=i(s);class n extends Error{constructor(t){super(t),Object.setPrototypeOf(this,n.prototype)}}class c extends n{constructor(t,e){super(`Cuenca Response Error: ${e}`),this.name="CuencaResponseError",this.data=t,this.status=e,Object.setPrototypeOf(this,c.prototype)}}class o extends n{constructor(){super("No results were found"),this.name="NoResultFound",Object.setPrototypeOf(this,o.prototype)}}class d extends n{constructor(){super("One result was expected but multiple were found"),this.name="MultipleResultsFound",Object.setPrototypeOf(this,d.prototype)}}class u extends n{constructor(){super("An invalid JWT token was obtained during authentication"),this.name="MalformedJwtToken",Object.setPrototypeOf(this,u.prototype)}}class h extends n{constructor(){super("Invalid password"),this.name="InvalidPassword",Object.setPrototypeOf(this,h.prototype)}}class l extends Error{constructor(t){super(t),Object.setPrototypeOf(this,l.prototype)}}const p="undefined"!=typeof window&&void 0!==window.document,m="undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process),w=p,_=m;class f{constructor(t,e){this.expiresAt=t,this.token=e}get isExpired(){const t=new Date;return(this.expiresAt.valueOf()-t.valueOf())/6e4<=5}static getExpirationDate=t=>{let e;try{const[,s]=t.split(".");e=JSON.parse(r.default.Buffer.from(`${s}==`,"base64").toString())}catch(t){throw new u}const{exp:s}=e;return new Date(new Date(1e3*s).toUTCString())};static create=async t=>{const e=t;e.jwtToken=null;const s=e.deleteRequestHeader("X-Cuenca-Token"),{token:i}=await t.post("token",{});s.eject();const a=f.getExpirationDate(i);return new f(a,i)}}class b{static Created=new b("created");static ReadyForAnalysis=new b("ready_for_analysis");static Analysis=new b("analysis");static Dictum=new b("dictum");static Justified=new b("justified");static Unusual=new b("unusual");static Reported=new b("reported");static Questionary=new b("questionary");static JustifiedByTime=new b("justified_by_time");static AdditionalInformation=new b("additional_information");static Documentation=new b("documentation");static Xml=new b("xml");constructor(t){this.value=t}}class y{static Succeeded=new y("succeeded");static NotValidated=new y("not_validated");static Failed=new y("failed");static OnWaitList=new y("on_wait_list");constructor(t){this.value=t}}class g{static Created=new g("created");static Failed=new g("failed");static Pending=new g("pending");static Succeeded=new g("succeeded");constructor(t){this.value=t}}class v{static Blocked=new v("blocked");static Comunication=new v("comunication");static ContactlesAmountLimit=new v("contactles_amount_limit");static FraudDetection=new v("fraud_detection");static FraudDetectionUncertain=new v("fraud_detection_uncertain");static InsufficientFounds=new v("insufficient_founds");static InvalidPin=new v("invalid_pin");static Notification=new v("notification");static NotificationDeactivatedCard=new v("notification_deactivated_card");constructor(t){this.value=t}}class A{static Credit=new A("credit");static Debit=new A("debit");constructor(t){this.value=t}}class O{static Accendo=new O("accendo");static Cuenca=new O("cuenca");constructor(t){this.value=t}}class j{static Buy=new j("buy");static Sell=new j("sell");constructor(t){this.value=t}}class I{static Active=new I("active");static Blocked=new I("blocked");static Created=new I("created");static Deactivated=new I("deactivated");static Printing=new I("printing");constructor(t){this.value=t}}class S{static Auth=new S("auth");static Capture=new S("capture");static Chargeback=new S("chargeback");static Expiration=new S("expiration");static Refund=new S("refund");static Void=new S("void");constructor(t){this.value=t}}class x{static Mxn=new x("mxn");static Usdc=new x("usdc");static Sol=new x("sol");constructor(t){this.value=t}}class T{static Physical=new T("physical");static Virtual=new T("virtual");constructor(t){this.value=t}}class C{static CardRequest=new C("card_request");static CashDeposit=new C("cash_deposit");static OutgoingSpei=new C("outgoing_spei");constructor(t){this.value=t}}class N{static Cash=new N("cash");static Internal=new N("internal");static Spei=new N("spei");constructor(t){this.value=t}}class k{static Credit=new k("credit");static Debit=new k("debit");constructor(t){this.value=t}}class D{static Pdf=new D("application/pdf");static Xml=new D("application/xml");static Json=new D("application/json");static Any=new D("*/*");constructor(t){this.value=t}}class U{static Curp=new U("curp");static Dni=new U("dni");static Ine=new U("ine");static Passport=new U("passport");static Residency=new U("residency");static MatriculaConsular=new U("matricula_consular");static ProofOfLiveness=new U("proof_of_liveness");static ProofOfAddress=new U("proof_of_address");constructor(t){this.value=t}}class R{static Client=new R("client");static Server=new R("server");constructor(t){this.value=t}}class M{static Low=new M("low");static Medium=new M("medium");static High=new M("high");constructor(t){this.value=t}}class P{static Deposit=new P("deposit");static Withdrawal=new P("withdrawal");constructor(t){this.value=t}}class B{static Bimester=new B("bimester");static Trimester=new B("trimester");static Semester=new B("semester");constructor(t){this.value=t}}class q{static Polygon=new q("polygon");static Solana=new q("solana");constructor(t){this.value=t}}class L{static Sandbox=new L("sandbox-api");static Stage=new L("stage-api");static Api=new L("api");constructor(t){this.value=t}}class E{static Amount=new E("amount");static Volume=new E("volume");constructor(t){this.value=t}}class K{static AW=new K("AW");static AF=new K("AF");static AO=new K("AO");static AI=new K("AI");static AX=new K("AX");static AL=new K("AL");static AD=new K("AD");static AE=new K("AE");static AR=new K("AR");static AM=new K("AM");static AS=new K("AS");static AQ=new K("AQ");static TF=new K("TF");static AG=new K("AG");static AU=new K("AU");static AT=new K("AT");static AZ=new K("AZ");static BI=new K("BI");static BE=new K("BE");static BJ=new K("BJ");static BQ=new K("BQ");static BF=new K("BF");static BD=new K("BD");static BG=new K("BG");static BH=new K("BH");static BS=new K("BS");static BA=new K("BA");static BL=new K("BL");static BY=new K("BY");static BZ=new K("BZ");static BM=new K("BM");static BO=new K("BO");static BR=new K("BR");static BB=new K("BB");static BN=new K("BN");static BT=new K("BT");static BV=new K("BV");static BW=new K("BW");static CF=new K("CF");static CA=new K("CA");static CC=new K("CC");static CH=new K("CH");static CL=new K("CL");static CN=new K("CN");static CI=new K("CI");static CM=new K("CM");static CD=new K("CD");static CG=new K("CG");static CK=new K("CK");static CO=new K("CO");static KM=new K("KM");static CV=new K("CV");static CR=new K("CR");static CU=new K("CU");static CW=new K("CW");static CX=new K("CX");static KY=new K("KY");static CY=new K("CY");static CZ=new K("CZ");static DE=new K("DE");static DJ=new K("DJ");static DM=new K("DM");static DK=new K("DK");static DO=new K("DO");static DZ=new K("DZ");static EC=new K("EC");static EG=new K("EG");static ER=new K("ER");static EH=new K("EH");static ES=new K("ES");static EE=new K("EE");static ET=new K("ET");static FI=new K("FI");static FJ=new K("FJ");static FK=new K("FK");static FR=new K("FR");static FO=new K("FO");static FM=new K("FM");static GA=new K("GA");static GB=new K("GB");static GE=new K("GE");static GG=new K("GG");static GH=new K("GH");static GI=new K("GI");static GN=new K("GN");static GP=new K("GP");static GM=new K("GM");static GW=new K("GW");static GQ=new K("GQ");static GR=new K("GR");static GD=new K("GD");static GL=new K("GL");static GT=new K("GT");static GF=new K("GF");static GU=new K("GU");static GY=new K("GY");static HK=new K("HK");static HM=new K("HM");static HN=new K("HN");static HR=new K("HR");static HT=new K("HT");static HU=new K("HU");static ID=new K("ID");static IM=new K("IM");static IN=new K("IN");static IO=new K("IO");static IE=new K("IE");static IR=new K("IR");static IQ=new K("IQ");static IS=new K("IS");static IL=new K("IL");static IT=new K("IT");static JM=new K("JM");static JE=new K("JE");static JO=new K("JO");static JP=new K("JP");static KZ=new K("KZ");static KE=new K("KE");static KG=new K("KG");static KH=new K("KH");static KI=new K("KI");static KN=new K("KN");static KR=new K("KR");static KW=new K("KW");static LA=new K("LA");static LB=new K("LB");static LC=new K("LC");static LI=new K("LI");static LK=new K("LK");static LR=new K("LR");static LS=new K("LS");static LT=new K("LT");static LU=new K("LU");static LV=new K("LV");static LY=new K("LY");static MA=new K("MA");static MC=new K("MC");static MD=new K("MD");static MG=new K("MG");static MV=new K("MV");static MX=new K("MX");static MH=new K("MH");static MK=new K("MK");static ML=new K("ML");static MT=new K("MT");static MM=new K("MM");static ME=new K("ME");static MN=new K("MN");static MP=new K("MP");static MZ=new K("MZ");static MR=new K("MR");static MS=new K("MS");static MQ=new K("MQ");static MU=new K("MU");static MW=new K("MW");static MY=new K("MY");static YT=new K("YT");static NA=new K("NA");static NC=new K("NC");static NE=new K("NE");static NF=new K("NF");static NG=new K("NG");static NI=new K("NI");static NU=new K("NU");static NL=new K("NL");static NO=new K("NO");static NP=new K("NP");static NR=new K("NR");static NZ=new K("NZ");static OM=new K("OM");static PK=new K("PK");static PA=new K("PA");static PN=new K("PN");static PE=new K("PE");static PH=new K("PH");static PW=new K("PW");static PG=new K("PG");static PL=new K("PL");static PR=new K("PR");static KP=new K("KP");static PT=new K("PT");static PY=new K("PY");static PS=new K("PS");static PF=new K("PF");static QA=new K("QA");static RE=new K("RE");static RO=new K("RO");static RU=new K("RU");static RW=new K("RW");static SA=new K("SA");static SD=new K("SD");static SN=new K("SN");static SG=new K("SG");static GS=new K("GS");static SH=new K("SH");static SJ=new K("SJ");static SB=new K("SB");static SL=new K("SL");static SV=new K("SV");static SM=new K("SM");static SO=new K("SO");static PM=new K("PM");static RS=new K("RS");static SS=new K("SS");static ST=new K("ST");static SR=new K("SR");static SK=new K("SK");static SI=new K("SI");static SE=new K("SE");static SZ=new K("SZ");static SX=new K("SX");static SC=new K("SC");static SY=new K("SY");static TC=new K("TC");static TD=new K("TD");static TG=new K("TG");static TH=new K("TH");static TJ=new K("TJ");static TK=new K("TK");static TM=new K("TM");static TL=new K("TL");static TO=new K("TO");static TT=new K("TT");static TN=new K("TN");static TR=new K("TR");static TV=new K("TV");static TW=new K("TW");static TZ=new K("TZ");static UG=new K("UG");static UA=new K("UA");static UM=new K("UM");static UY=new K("UY");static US=new K("US");static UZ=new K("UZ");static VA=new K("VA");static VC=new K("VC");static VE=new K("VE");static VG=new K("VG");static VI=new K("VI");static VN=new K("VN");static VU=new K("VU");static WF=new K("WF");static WS=new K("WS");static YE=new K("YE");static ZA=new K("ZA");static ZM=new K("ZM");static ZW=new K("ZW");static XA=new K("XA");constructor(t){this.value=t}}class G{static NE=new G("NE");static AS=new G("AS");static BC=new G("BC");static BS=new G("BS");static CC=new G("CC");static CS=new G("CS");static CH=new G("CH");static CL=new G("CL");static CM=new G("CM");static DF=new G("DF");static DG=new G("DG");static GT=new G("GT");static GR=new G("GR");static HG=new G("HG");static JC=new G("JC");static MC=new G("MC");static MN=new G("MN");static MS=new G("MS");static NT=new G("NT");static NL=new G("NL");static OC=new G("OC");static PL=new G("PL");static QT=new G("QT");static QR=new G("QR");static SP=new G("SP");static SL=new G("SL");static SR=new G("SR");static TC=new G("TC");static TL=new G("TL");static TS=new G("TS");static VZ=new G("VZ");static YN=new G("YN");static ZS=new G("ZS");constructor(t){this.value=t}}class F{static Cable=new F("cable");static CreditCard=new F("credit_card");static Electricity=new F("electricity");static Gas=new F("gas");static Internet=new F("internet");static LandlineTelephone=new F("landline_telephone");static MobileTelephonePostpaid=new F("mobile_telephone_postpaid");static MobileTelephonePrepaid=new F("mobile_telephone_prepaid");static SateliteTelevision=new F("satelite_television");static Water=new F("water");constructor(t){this.value=t}}class V{static General=new V("general");static Home=new V("home");static Vehicle=new V("vehicle");static Travel=new V("travel");static Clothing=new V("clothing");static Other=new V("other");static Medical=new V("medical");static Accident=new V("accident");static Education=new V("education");constructor(t){this.value=t}}class H{static AccountEntries=new H("session.account_entries");static DownloadFile=new H("session.download_file");static Registration=new H("session.registration");static ShowCard=new H("session.show_card");static UploadFile=new H("session.upload_file");constructor(t){this.value=t}}class Y{static Chester=new Y("chester");static External=new Y("external");static Manual=new Y("manual");constructor(t){this.value=t}}class ${static NotSet=new $("not_set");static Terminal=new $("terminal");static Manual=new $("manual");static Unknown=new $("unknown");static Contactless=new $("contactless");static FallBack=new $("fall_back");static MagneticStripe=new $("magnetic_stripe");static RecurringCharge=new $("recurring_charge");constructor(t){this.value=t}}class W{static Created=new W("created");static Failed=new W("failed");static InReview=new W("in_review");static Submitted=new W("submitted");static Succeeded=new W("succeeded");constructor(t){this.value=t}}class Z{static Internal=new Z("internal");static Spei=new Z("spei");constructor(t){this.value=t}}class Q{static Active=new Q("active");static Deactivated=new Q("deactivated");static InReview=new Q("in_review");static Fraud=new Q("fraud");static PldBlocked=new Q("pld_blocked");static UserBlocked=new Q("user_blocked");static Inactive=new Q("inactive");constructor(t){this.value=t}}class J{static Moral=new J("moral");static Physical=new J("physical");constructor(t){this.value=t}}class X{static Created=new X("created");static NotVerified=new X("not_verified");static Rejected=new X("rejected");static ReviewNeeded=new X("review_needed");static Submitted=new X("submitted");static Succeeded=new X("succeeded");static UploadAgain=new X("upload_again");constructor(t){this.value=t}}class z{static Phone=new z("phone");static Email=new z("email");constructor(t){this.value=t}}class tt{static Deposit=new tt("deposit");static Withdrawal=new tt("withdrawal");constructor(t){this.value=t}}class et{constructor({createdAfter:t,createdBefore:e,limit:s,pageSize:i,relatedTransaction:a,userId:r,count:n=!1}){this.createdAfter=t,this.createdBefore=e,this._lmt=s,this.relatedTransaction=a,this.userId=r,this.count=n,this.pageSize=i}get limit(){return this._limit}set _lmt(t){let e=null;"number"==typeof t&&t>=0&&(e=t),this._limit=e}toObject(){return{created_after:this.createdAfter,created_before:this.createdBefore,limit:this.limit,related_transaction:this.relatedTransaction,user_id:this.userId,page_size:this.pageSize&&this.pageSize.size}}toParams(){const t={...this.toObject()};return this.count&&(t.count=1),Object.keys(t).forEach((e=>{null==t[e]&&delete t[e]})),t}toQueryString(){return new URLSearchParams(this.toParams()).toString()}}class st extends et{constructor({accountNumber:t,...e}){super(e),this.accountNumber=t}toObject(){return Object.assign(super.toObject(),{account_number:this.accountNumber})}}class it extends et{constructor({agent:t,comments:e,committeeMeetingDate:s,count:i,hasQuestionnaire:a,inProcess:r,status:n,typeOfFilter:c,transactionDate:o,...d}){super(d),this.agent=t,this.comments=e,this.committeeMeetingDate=s,this.count=i,this.hasQuestionnaire=a,this.inProcess=r,this.status=n,this.typeOfFilter=c,this.transactionDate=o}toObject(){return Object.assign(super.toObject(),{agent:this.agent,comments:this.comments,committee_meeting_date:this.committeeMeetingDate,count:this.count,has_questionnaire:this.hasQuestionnaire,in_process:this.inProcess,status:this.status,transaction_date:this.transactionDate,type_of_filter:this.typeOfFilter})}}class at extends et{constructor({active:t,...e}){super(e),this.active=t}toObject(){return Object.assign(super.toObject(),{active:this.active})}}class rt extends et{constructor({fundingInstrumentUri:t,count:e=!1,walletId:s="default",...i}){super(i),this.fundingInstrumentUri=t,this.count=e,this.walletId=s}toObject(){return Object.assign(super.toObject(),{wallet_id:this.walletId,funding_instrument_uri:this.fundingInstrumentUri,count:this.count})}}class nt extends et{constructor({accountNumber:t,...e}){super(e),this.accountNumber=t}toObject(){return Object.assign(super.toObject(),{account_number:this.accountNumber})}}class ct extends et{constructor({emailAddress:t,...e}){super(e),this.emailAddress=t}toObject(){return Object.assign(super.toObject(),{email_address:this.emailAddress})}}class ot extends et{constructor({accountId:t,...e}){super(e),this.accountId=t}toObject(){return Object.assign(super.toObject(),{account_id:this.accountId})}}class dt extends et{constructor({accountId:t,...e}){super(e),this.accountId=t}toObject(){return Object.assign(super.toObject(),{account:this.accountId})}}class ut extends dt{constructor({status:t,type:e,...s}){super(s),this.status=t,this.type=e}toObject(){return Object.assign(super.toObject(),{status:this.status,type:this.type})}}class ht extends et{constructor({cardUri:t,count:e=!1,...s}={}){super(s),this.cardUri=t,this.count=e}toObject(){return Object.assign(super.toObject(),{card_uri:this.cardUri,count:this.count})}}class lt extends et{constructor({cardUri:t,...e}){super(e),this.cardUri=t}toObject(){return Object.assign(super.toObject(),{card_uri:this.cardUri})}}class pt extends et{constructor({status:t,...e}){super(e),this.status=t}toObject(){return Object.assign(super.toObject(),{status:this.status})}}class mt extends pt{constructor({trackingKey:t,network:e,...s}){super(s),this.trackingKey=t,this.network=e}toObject(){return Object.assign(super.toObject(),{tracking_key:this.trackingKey,network:this.network})}}class wt extends pt{constructor({requestId:t,...e}={}){super(e),this.requestId=t}toObject(){return Object.assign(super.toObject(),{request_id:this.requestId})}}class _t extends et{constructor({emailAddress:t,...e}){super(e),this.emailAddress=t}toObject(){return Object.assign(super.toObject(),{email_address:this.emailAddress})}}class ft extends et{constructor({postalCode:t,...e}){super(e),this.postalCode=t}toObject(){return Object.assign(super.toObject(),{postal_code:this.postalCode})}}class bt extends et{constructor({month:t,year:e,...s}={}){super(s),void 0!==t&&void 0!==e&&(this.d={month:t,year:e})}get month(){return this._date?.month}get year(){return this._date?.year}set d({month:t,year:e}){const s=Number(t),i=Number(e);if(!Number.isInteger(s)||s<1||s>12)throw new l("month must be an integer between 1 and 12");if(!Number.isInteger(i)||i<1900||i>9999)throw new l("year must be an integer between 1900 and 9999");const a=new Date(Date.UTC(i,s-1,1)),r=new Date,n=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),1));if(a.getTime()>=n.getTime()){const t=String(s).padStart(2,"0");throw new l(`${i}-${t} is not a valid year-month pair`)}this._date={month:s,year:i}}toObject(){return Object.assign(super.toObject(),{month:this.month,year:this.year})}}class yt extends pt{constructor({accountNumber:t,idempotencyKey:e,trackingKey:s,network:i,...a}){super(a),this.accountNumber=t,this.idempotencyKey=e,this.trackingKey=s,this.network=i}toObject(){return Object.assign(super.toObject(),{account_number:this.accountNumber,idempotency_key:this.idempotencyKey,tracking_key:this.trackingKey,network:this.network})}}class gt extends et{constructor({clabe:t,curp:e,emailAddress:s,hasCurpDocument:i,name:a,phoneNumber:r,status:n,...c}={}){super(c),this.clabe=t,this.curp=e,this.emailAddress=s,this.hasCurpDocument=i,this.name=a,this.phoneNumber=r,this.status=n}toObject(){return Object.assign(super.toObject(),{clabe:this.clabe,curp:this.curp,email_address:this.emailAddress,has_curp_document:this.hasCurpDocument,name:this.name,phone_number:this.phoneNumber,status:this.status})}}class vt extends et{constructor({active:t,...e}){super(e),this.active=t}toObject(){return Object.assign(super.toObject(),{active:this.active})}}class At extends et{constructor({walletUri:t,...e}){super(e),this.walletUri=t}toObject(){return Object.assign(super.toObject(),{wallet_uri:this.walletUri})}}const Ot=t=>{if(!t)return null;const e=new Date(t);return new Date(e.getTime())},jt=(t,e)=>Object.values(t).find((t=>t.value===e));class It{constructor({city:t,colonia:e,country:s,createdAt:i,extNumber:a,fullName:r,intNumber:n,postalCode:c,state:o,street:d}){this.city=t,this.colonia=e,this.country=s,this.createdAt=Ot(i),this.extNumber=a,this.fullName=r,this.intNumber=n,this.postalCode=c,this.state=o,this.street=d}static fromObject=({city:t,colonia:e,country:s,state:i,street:a,...r})=>new It({city:t,colonia:e,country:s,state:i,street:a,createdAt:r.created_at,extNumber:r.ext_number,fullName:r.full_name,intNumber:r.int_number,postalCode:r.postal_code})}class St{constructor({agent:t,createdAt:e,status:s,updatedAt:i,comments:a}){this.agent=t,this.comments=a,this.createdAt=Ot(e),this.updatedAt=Ot(i),this.status=jt(b,s)}static fromObject=({agent:t,comments:e,status:s,...i})=>new St({agent:t,comments:e,status:s,createdAt:i.created_at,updatedAt:i.updated_at})}class xt{constructor({hasAudit:t,auditProvider:e,auditDate:s,auditComments:i}){this.hasAudit=t,this.auditProvider=e,this.auditDate=Ot(s),this.auditComments=i}static fromObject=({...t})=>new xt({hasAudit:t.has_audit,auditProvider:t.audit_provider,auditDate:t.audit_date,auditComments:t.audit_comments})}class Tt{constructor({accountUsageDescription:t=null,businessDescription:e=null}={}){this.accountUsageDescription=t,this.businessDescription=e}static fromObject=({...t}={})=>new Tt({accountUsageDescription:t.account_usage_description,businessDescription:t.business_description});toObject(){return{account_usage_description:this.accountUsageDescription,business_description:this.businessDescription}}}class Ct{constructor({bank:t,account:e}){this.bank=t,this.account=e}static fromObject=({account:t,bank:e})=>new Ct({bank:e,account:t})}class Nt{constructor({code:t,error:e,identifier:s,message:i}){this.code=t,this.error=e,this.identifier=s,this.message=i}static fromObject=({code:t,error:e,identifier:s,message:i})=>new Nt({code:t,error:e,identifier:s,message:i})}class kt{constructor({data:t,errors:e,isMx:s,status:i,type:a,uriBack:r,uriFront:n}){this.data=t,this.isMx=s,this.status=jt(X,i),this.type=jt(U,a),this.uriBack=r,this.uriFront=n,e&&e.length>0&&(this.errors=e.map((t=>Nt.fromObject(t))))}static fromObject=({data:t,errors:e,status:s,type:i,...a})=>new kt({data:t,errors:e,status:s,type:i,isMx:a.is_mx,uriBack:a.uri_back,uriFront:a.uri_front})}class Dt{constructor({licenseRequired:t=!1,supervisoryEntity:e=null,licenseType:s=null,licenseDate:i=null}={}){this.licenseRequired=t,this.supervisoryEntity=e,this.licenseType=s,this.licenseDate=i?Ot(i):null}static fromObject=({...t}={})=>new Dt({licenseRequired:t.license_required,supervisoryEntity:t.supervisory_entity,licenseType:t.license_type,licenseDate:t.license_date})}class Ut{constructor({names:t,curp:e,rfc:s,firstSurname:i,secondSurname:a}){this.names=t,this.curp=e,this.rfc=s,this.firstSurname=i,this.secondSurname=a}static fromObject=({names:t,curp:e,rfc:s,...i})=>new Ut({names:t,curp:e,rfc:s,firstSurname:i.first_surname,secondSurname:i.second_surname});toObject(){return{names:this.names,curp:this.curp,rfc:this.rfc,first_surname:this.firstSurname,second_surname:this.secondSurname}}}class Rt extends Ut{constructor({names:t,curp:e,rfc:s,firstSurname:i,secondSurname:a,job:r,phoneNumber:n,emailAddress:c,address:o}){super({names:t,curp:e,rfc:s,firstSurname:i,secondSurname:a}),this.job=r,this.phoneNumber=n,this.emailAddress=c,this.address=o}get address(){return this._address}set address(t){t&&(this._address=It.fromObject(t))}static fromObject=({job:t,address:e,...s})=>new Rt({address:e,job:t,phoneNumber:s.phone_number,emailAddress:s.email_address,...Ut.fromObject(s)})}class Mt extends Ut{constructor({names:t,curp:e,rfc:s,firstSurname:i,secondSurname:a,shareCapital:r,percentage:n}){super({names:t,curp:e,rfc:s,firstSurname:i,secondSurname:a}),this.shareCapital=r,this.percentage=n}static fromObject=({percentage:t,...e})=>new Mt({percentage:t,shareCapital:e.share_capital,...Ut.fromObject(e)})}class Pt{constructor({name:t,percentage:e,shareholders:s,legalRepresentatives:i}){this.name=t,this.percentage=e,this.shareholders=s,this.legalRepresentatives=i}get shareholders(){return this._shareholders}set shareholders(t){t&&(this._shareholders=t.map((t=>Mt.fromObject(t))))}get legalRepresentatives(){return this._legalRepresentatives}set legalRepresentatives(t){t&&(this._legalRepresentatives=t.map((t=>Rt.fromObject(t))))}static fromObject=({name:t,percentage:e,shareholders:s,...i})=>new Pt({name:t,percentage:e,shareholders:s||[],legalRepresentatives:i.legal_representatives||[]})}class Bt{constructor({speiTransfersNum:t,speiTransfersAmount:e,internalTransfersNum:s,internalTransfersAmount:i}={}){this.speiTransfersNum=t,this.speiTransfersAmount=e,this.internalTransfersNum=s,this.internalTransfersAmount=i}static fromObject=({...t}={})=>new Bt({speiTransfersNum:t.spei_transfers_num,speiTransfersAmount:t.spei_transfers_amount,internalTransfersNum:t.internal_transfers_num,internalTransfersAmount:t.internal_transfers_amount})}class qt{constructor({ip:t,location:e,type:s,version:i}){this.ip=t,this.location=e,this.type=s,this.version=i}static fromObject=({ip:t,location:e,type:s,version:i})=>new qt({ip:t,location:e,type:s,version:i})}class Lt{constructor({isVulnerableActivity:t,hasSatRegister:e,satRegisteredDate:s,isInCompliance:i}){this.isVulnerableActivity=t,this.hasSatRegister=e,this.satRegisteredDate=Ot(s),this.isInCompliance=i}static fromObject=({...t})=>new Lt({isVulnerableActivity:t.is_vulnerable_activity,hasSatRegister:t.has_sat_register,satRegisteredDate:t.sat_registered_date,isInCompliance:t.is_in_compliance})}var Et="1.1.1-dev1";class Kt{constructor({apiKey:t,apiSecret:e,language:s="en",phase:i=L.Sandbox}={}){this.phase=i,this.basicAuth={apiKey:t,apiSecret:e},this.jwtToken=null,this._session=a.default.create({headers:{"Accept-Language":s},timeout:45e3})}get session(){return this._session}get origin(){return`https://${this.phase.value}.arteria.xyz`}get authHeader(){const{apiKey:t,apiSecret:e}=this.basicAuth;return t&&e?`Basic ${r.default.Buffer.from(`${t}:${e}`,"utf-8").toString("base64")}`:""}addHeadersToRequest(t){const e=this._session.interceptors.request.use((e=>{const s=e,{headers:{common:i}}=s;return Object.keys(t).forEach((e=>i[e]=t[e])),s}));return{interceptorId:e,eject:()=>this._session.interceptors.request.eject(e)}}deleteRequestHeader(t){const e=this._session.interceptors.request.use((e=>{const s=e,{headers:{common:i}}=s;return delete i[t],s}));return{interceptorId:e,eject:()=>this._session.interceptors.request.eject(e)}}addConfigToRequest(t){const e=this._session.interceptors.request.use((e=>{const s=e;return Object.keys(t).forEach((e=>s[e]=t[e])),s}));return{interceptorId:e,eject:()=>this._session.interceptors.request.eject(e)}}async configure({apiKey:t,apiSecret:e,loginToken:s,phase:i,sessionId:a,useJwt:r=!1}){this.basicAuth={apiKey:t||this.basicAuth.apiKey,apiSecret:e||this.basicAuth.apiSecret},i&&(this.phase=i),r&&(this.jwtToken=await f.create(this)),s&&this.addHeadersToRequest({"X-Cuenca-LoginToken":s}),a&&this.addHeadersToRequest({"X-Cuenca-SessionId":a})}async get({endpoint:t,format:e,params:s}){return this.request({endpoint:t,format:e,params:s})}async post({endpoint:t,data:e,multipart:s}){return this.request({method:"POST",endpoint:t,data:e,multipart:s})}async patch({endpoint:t,data:e}){return this.request({method:"PATCH",endpoint:t,data:e})}async delete({endpoint:t,data:e}){return this.request({method:"DELETE",endpoint:t,data:e})}async request({endpoint:t,data:e=null,format:s=D.Json,method:i="GET",multipart:a=!1,params:r=null}){let o={};a||(o={"Content-Type":"application/json",Accept:`application/${s.value}`}),this.authHeader&&(o.Authorization=this.authHeader),_?o["User-Agent"]=`cuenca-js/${Et}`:w&&(o["X-User-Agent"]=`cuenca-js/${Et}`),this.jwtToken&&(this.jwtToken.isExpired&&(this.jwtToken=await f.create(this)),o["X-Cuenca-Token"]=this.jwtToken.token);const d=this.addHeadersToRequest(o),u=e;u&&!a&&Object.keys(u).forEach((t=>{u[t]instanceof Date&&(u[t]=u[t].toISOString())}));const h=this.addConfigToRequest({method:i,params:r,data:u,url:t});let l;try{l=await this._session.request({baseURL:this.origin})}catch(t){throw t.response?new c(t.response.data,t.response.status):t.request?new n(`No response received: ${t.errno}: ${t.code}`):new n(t.message)}finally{d.eject(),h.eject()}return l.data}}class Gt{constructor({accountNumber:t,createdAt:e,id:s,institutionName:i,name:a,userId:r}){this.accountNumber=t,this.createdAt=Ot(e),this.id=s,this.institutionName=i,this.name=a,this.userId=r}static fromObject=({id:t,name:e,...s})=>new Gt({id:t,name:e,accountNumber:s.account_number,createdAt:s.created_at,institutionName:s.institution_name,userId:s.user_id})}class Ft{constructor({agent:t,accountNumber:e,actualPeriodCount:s,actualPeriodSum:i,aggregationType:a,changeLog:r,comments:n,committeeMeetingDate:c,createdAt:o,questionnaireId:d,description:u,hasQuestionnaire:h,id:l,institutionName:p,level:m,name:w,period:_,periodNumber:f,status:y,sourceType:g,transactionDate:v,type:A,typeOfFilter:O,userId:j,updatedAt:I}){this.accountNumber=e,this.actualPeriodCount=s,this.actualPeriodSum=i,this.agent=t,this.aggregationType=a,this.comments=n,this.committeeMeetingDate=Ot(c),this.createdAt=Ot(o),this.questionnaireId=d,this.description=u,this.hasQuestionnaire=h,this.id=l,this.institutionName=p,this.level=jt(M,m),this.name=w,this.period=jt(B,_),this.periodNumber=f,this.status=jt(b,y),this.sourceType=jt(Y,g),this.transactionDate=Ot(v),this.type=jt(P,A),this.typeOfFilter=jt(E,O),this.updatedAt=Ot(I),this.userId=j,this.changeLog=r}static fromObject=({agent:t,comments:e,description:s,id:i,level:a,name:r,period:n,status:c,type:o,...d})=>new Ft({agent:t,comments:e,description:s,id:i,level:a,name:r,period:n,status:c,type:o,accountNumber:d.account_number,actualPeriodCount:d.actual_period_count,actualPeriodSum:d.actual_period_sum,aggregationType:d.aggregation_type,changeLog:d.change_log,committeeMeetingDate:d.committee_meeting_date,createdAt:d.created_at,questionnaireId:d.questionnaire_id,hasQuestionnaire:d.has_questionnaire,institutionName:d.institution_name,periodNumber:d.period_number,sourceType:d.source_type,transactionDate:d.transaction_date,typeOfFilter:d.type_of_filter,updatedAt:d.updated_at,userId:d.user_id});get changeLog(){return this._changeLog}set changeLog(t){t&&Array.isArray(t)&&0!==t.length&&(this._changeLog=t.map((t=>St.fromObject(t))))}}class Vt{constructor({createdAt:t,deactivatedAt:e,id:s,secret:i,userId:a,updatedAt:r}){this.createdAt=Ot(t),this.deactivatedAt=Ot(e),this.id=s,this.secret=i,this.userId=a,this.updatedAt=Ot(r)}static fromObject=({id:t,secret:e,...s})=>new Vt({id:t,secret:e,createdAt:s.created_at,deactivatedAt:s.deactivated_at,userId:s.user_id,updatedAt:s.updated_at});get isActive(){const t=Ot(Date.now());return!this.deactivatedAt||this.deactivatedAt.getTime()>t.getTime()}}class Ht{constructor({arpc:t,createdAt:e,cardUri:s,isValidArqc:i}){this.arpc=t,this.createdAt=Ot(e),this.cardUri=s,this.isValidArqc=i}static fromObject=({arpc:t,...e})=>new Ht({arpc:t,createdAt:e.created_at,cardUri:e.card_uri,isValidArqc:e.is_valid_arqc})}class Yt{constructor({amount:t,createdAt:e,descriptor:s,entryType:i,fundingInstrumentUri:a,id:r,name:n,relatedTransactionUri:c,rollingBalance:o}){this.amount=t,this.createdAt=Ot(e),this.descriptor=s,this.entryType=jt(k,i),this.fundingInstrumentUri=a,this.id=r,this.name=n,this.relatedTransactionUri=c,this.rollingBalance=o}static fromObject=({amount:t,descriptor:e,id:s,name:i,type:a,...r})=>new Yt({amount:t,descriptor:e,name:i,id:s,createdAt:r.created_at,entryType:a,fundingInstrumentUri:r.funding_instrument_uri,relatedTransactionUri:r.related_transaction_uri,rollingBalance:r.rolling_balance})}class $t{constructor({amount:t,createdAt:e,descriptor:s,status:i,userId:a}){this.amount=t,this.createdAt=Ot(e),this.descriptor=s,this.status=jt(W,i),this.userId=a}}class Wt extends $t{constructor({amount:t,accountNumber:e,createdAt:s,descriptor:i,id:a,providerUri:r,status:n,userId:c}){super({amount:t,createdAt:s,descriptor:i,status:n,userId:c}),this.accountNumber=e,this.id=a,this.providerUri=r}static fromObject=({amount:t,descriptor:e,id:s,status:i,...a})=>new Wt({amount:t,descriptor:e,id:s,status:i,accountNumber:a.account_number,createdAt:a.created_at,providerUri:a.provider_uri,userId:a.user_id})}class Zt{constructor({id:t,createdAt:e,updatedAt:s,names:i,firstSurname:a,secondSurname:r,dateOfBirth:n,countryOfBirth:c,rfc:o,curp:d,userId:u,gender:h,phoneNumber:l,emailAddress:p,clientClabe:m,govtId:w,proofOfAddress:_,status:f,termsOfService:b,address:g}){this.id=t,this.createdAt=Ot(e),this.updatedAt=Ot(s),this.emailAddress=p,this.clientClabe=m,this.govtId=w,this.names=i,this.firstSurname=a,this.secondSurname=r,this.dateOfBirth=n,this.countryOfBirth=c,this.rfc=o,this.curp=d,this.userId=u,this.gender=h,this.phoneNumber=l,this.proofOfAddress=_,this.status=jt(y,f),this.termsOfService=b,this.address=g}static fromObject=({status:t,address:e,...s})=>new Zt({address:e,status:t,id:s.id,createdAt:s.created_at,updatedAt:s.updated_at,clientClabe:s.client_clabe,names:s.names,firstSurname:s.first_surname,secondSurname:s.second_surname,dateOfBirth:s.date_of_birth,countryOfBirth:s.country_of_birth,rfc:s.rfc,curp:s.curp,userId:s.user_id,gender:s.gender,govtId:s.govt_id,emailAddress:s.email_address,phoneNumber:s.phone_number,proofOfAddress:s.proof_of_address,termsOfService:s.terms_of_service});get address(){return this._address}set address(t){t&&0!==Object.keys(t).length&&(this._address=It.fromObject(t))}get proofOfAddress(){return this._proofOfAddress}set proofOfAddress(t){t&&0!==Object.keys(t).length&&(this._proofOfAddress=kt.fromObject(t))}get govtId(){return this._govtId}set govtId(t){t&&0!==Object.keys(t).length&&(this._govtId=kt.fromObject(t))}get termsOfService(){return this._termsOfService}set termsOfService(t){t&&0!==Object.keys(t).length&&(this._termsOfService=qt.fromObject(t))}}class Qt{constructor({clabe:t,createdAt:e,curp:s,error:i,firstName:a,id:r,names:n,rfc:c,secondSurname:o,status:d}){this.clabe=t,this.createdAt=Ot(e),this.curp=s,this.error=i,this.firstName=a,this.id=r,this.names=n,this.rfc=c,this.secondSurname=o,this.status=jt(g,d)}static fromObject=({clabe:t,curp:e,error:s,id:i,names:a,rfc:r,status:n,...c})=>new Qt({clabe:t,curp:e,error:s,id:i,names:a,rfc:r,status:n,createdAt:c.created_at,firstName:c.first_name,secondSurname:c.second_surname})}class Jt{constructor({account:t,clabe:e,currency:s,id:i,network:a,platformId:r}){this.account=t,this.clabe=e,this.currency=jt(x,s),this.id=i,this.network=jt(q,a),this.platformId=r}static fromObject=({clabe:t,currency:e,id:s,network:i,...a})=>new Jt({clabe:t,currency:e,id:s,network:i,account:a.account_uri.split("/")[2],platformId:a.platform_id})}class Xt{constructor({id:t,createdAt:e,platformId:s,type:i,status:a,accountUri:r,quoteUri:n,currency:c,network:o,sourceWallet:d,destinationWallet:u,bankAccountUri:h,cuencaId:l,cuentaOrdenante:p,cuentaBeneficiario:m,nombreOrdenante:w,claveRastreo:_,rfcCurpOrdenante:f,concepto:b,referenciaNumerica:y,signature:g,trackingLink:v,fromCurrency:A,toCurrency:O,fromAmount:I,toAmount:S}){this.id=t,this.createdAt=Ot(e),this.platformId=s,this.type=jt(j,i),this.status=jt(W,a),this.accountUri=r,this.quoteUri=n,this.currency=jt(x,c),this.network=jt(q,o),this.sourceWallet=d,this.destinationWallet=u,this.bankAccountUri=h,this.cuencaId=l,this.cuentaOrdenante=p,this.cuentaBeneficiario=m,this.nombreOrdenante=w,this.claveRastreo=_,this.rfcCurpOrdenante=f,this.concepto=b,this.referenciaNumerica=y,this.signature=g,this.trackingLink=v,this.fromCurrency=jt(x,A),this.toCurrency=jt(x,O),this.fromAmount=I,this.toAmount=S}static fromObject=({type:t,status:e,currency:s,network:i,concepto:a,signature:r,...n})=>new Xt({id:n.id,createdAt:n.created_at,platformId:n.platform_id,accountUri:n.account_uri,quoteUri:n.quote_uri,sourceWallet:n.source_wallet,destinationWallet:n.destination_wallet,bankAccountUri:n.bank_account_uri,cuencaId:n.cuenca_id,cuentaOrdenante:n.cuenta_ordenante,cuentaBeneficiario:n.cuenta_beneficiario,nombreOrdenante:n.nombre_ordenante,claveRastreo:n.clave_rastreo,rfcCurpOrdenante:n.rfc_curp_ordenante,referenciaNumerica:n.referencia_numerica,trackingLink:n.tracking_link,fromCurrency:n.from_currency,toCurrency:n.to_currency,fromAmount:n.from_amount,toAmount:n.to_amount,type:t,status:e,currency:s,network:i,concepto:a,signature:r})}class zt{constructor({createdAt:t,cvv2:e,expMonth:s,expYear:i,fundingType:a,id:r,issuer:n,number:c,pin:o,status:d,type:u,updatedAt:h,userId:l}){this.createdAt=Ot(t),this.cvv2=e,this.expMonth=s,this.expYear=i,this.fundingType=jt(A,a),this.id=r,this.issuer=jt(O,n),this.number=c,this.pin=o,this.status=jt(I,d),this.type=jt(T,u),this.updatedAt=Ot(h),this.userId=l}static fromObject=({cvv2:t,id:e,issuer:s,number:i,pin:a,status:r,type:n,...c})=>new zt({cvv2:t,id:e,issuer:s,number:i,pin:a,status:r,type:n,createdAt:c.created_at,expMonth:c.exp_month,expYear:c.exp_year,fundingType:c.funding_type,updatedAt:c.updated_at,userId:c.user_id})}class te{constructor({cardUri:t,createdAt:e,id:s,ipAddress:i,success:a,userId:r}){this.cardUri=t,this.createdAt=Ot(e),this.id=s,this.ipAddress=i,this.success=a,this.userId=r}static fromObject=({id:t,success:e,...s})=>new te({id:t,success:e,cardUri:s.card_uri,createdAt:s.created_at,ipAddress:s.ip_address,userId:s.user_id})}class ee extends $t{constructor({amount:t,cardErrorType:e,cardLastFour:s,cardType:i,cardUri:a,createdAt:r,descriptor:n,metadata:c,network:o,relatedCardTransactionsUris:d,status:u,type:h,userId:l}){super({amount:t,createdAt:r,descriptor:n,status:u,userId:l}),this.cardErrorType=jt(v,e),this.cardLastFour=s,this.cardType=jt(T,i),this.cardUri=a,this.metadata=c,this.network=o,this.relatedCardTransactionsUris=d,this.type=jt(S,h)}static fromObject=({amount:t,descriptor:e,metadata:s,network:i,status:a,type:r,...n})=>new ee({amount:t,descriptor:e,metadata:s,network:i,status:a,type:r,cardErrorType:n.error_type,cardLastFour:n.card_last4,cardType:n.card_type,cardUri:n.card_uri,createdAt:n.created_at,relatedCardTransactionsUris:n.related_card_transaction,userId:n.user_id})}class se{constructor({cardStatus:t,cardType:e,cardUri:s,createdAt:i,isExpired:a,isPinAttemptsExceeded:r,isValidCvv:n,isValidCvv2:c,isValidExpDate:o,isValidIcvv:d,isValidPinBlock:u,userId:h}){this.cardStatus=jt(I,t),this.cardType=jt(T,e),this.cardUri=s,this.createdAt=Ot(i),this.isExpired=a,this.isPinAttemptsExceeded=r,this.isValidCvv=n,this.isValidCvv2=c,this.isValidExpDate=o,this.isValidIcvv=d,this.isValidPinBlock=u,this.userId=h}static fromObject=({...t})=>new se({cardStatus:t.card_status,cardType:t.card_type,cardUri:t.card_uri,createdAt:t.created_at,isExpired:t.is_expired,isPinAttemptsExceeded:t.is_pin_attempts_exceeded,isValidCvv:t.is_valid_cvv,isValidCvv2:t.is_valid_cvv2,isValidExpDate:t.is_valid_exp_date,isValidIcvv:t.is_valid_icvv,isValidPinBlock:t.is_valid_pin_block,userId:t.user_id});get isActive(){return this.cardStatus===I.Active}}class ie extends $t{constructor({amount:t,createdAt:e,descriptor:s,relatedTransactionUri:i,status:a,type:r,userId:n}){super({amount:t,createdAt:e,descriptor:s,status:a,userId:n}),this.relatedTransactionUri=i,this.type=jt(C,r)}static fromObject=({amount:t,descriptor:e,status:s,type:i,...a})=>new ie({amount:t,descriptor:e,status:s,type:i,createdAt:a.created_at,relatedTransactionUri:a.related_transaction_uri,userId:a.user_id})}class ae extends $t{constructor({amount:t,createdAt:e,descriptor:s,id:i,network:a,status:r,sourceUri:n,trackingKey:c,userId:o}){super({amount:t,createdAt:e,descriptor:s,status:r,userId:o}),this.id=i,this.network=jt(N,a),this.sourceUri=n,this.trackingKey=c}static fromObject=({amount:t,descriptor:e,id:s,network:i,status:a,...r})=>new ae({amount:t,descriptor:e,id:s,network:i,status:a,createdAt:r.created_at,sourceUri:r.source_uri,trackingKey:r.tracking_key,userId:r.user_id})}class re{constructor({extension:t,type:e,url:s,userId:i}){this.extension=t,this.type=jt(U,e),this.url=s,this.userId=i}static fromObject=({extension:t,type:e,url:s,...i})=>new re({extension:t,type:e,url:s,userId:i.user_id})}class ne{constructor({id:t,requestId:e,createdAt:s,updatedAt:i,requestedAt:a,userId:r,amount:n,concepto:c,clabe:o,status:d,transactionId:u,claveRastreo:h,reasonCode:l,message:p,completedAt:m}){this.id=t,this.requestId=e,this.createdAt=Ot(s),this.updatedAt=Ot(i),this.requestedAt=Ot(a),this.userId=r,this.amount=n,this.concepto=c,this.clabe=o,this.status=jt(W,d),this.transactionId=u,this.claveRastreo=h,this.reasonCode=l,this.message=p,this.completedAt=Ot(m)}static fromObject=({id:t,amount:e,concepto:s,clabe:i,status:a,message:r,...n})=>new ne({id:t,amount:e,concepto:s,clabe:i,status:a,message:r,requestId:n.request_id,createdAt:n.created_at,updatedAt:n.updated_at,requestedAt:n.requested_at,userId:n.user_id,transactionId:n.transaction_id,claveRastreo:n.clave_rastreo,reasonCode:n.reason_code,completedAt:n.completed_at})}class ce{constructor({id:t,createdAt:e,updatedAt:s,deactivatedAt:i,platformId:a,filesUri:r,userId:n,verificationId:c,identityId:o,govtIdStatus:d,proofOfAddressStatus:u,proofOfLifeStatus:h,sourceType:l,flowId:p,status:m,providerUrl:w}){this.id=t,this.createdAt=Ot(e),this.updatedAt=Ot(s),this.deactivatedAt=Ot(i),this.platformId=a,this.filesUri=r||[],this.userId=n,this.verificationId=c,this.identityId=o,this.govtIdStatus=jt(X,d),this.proofOfAddressStatus=jt(X,u),this.proofOfLifeStatus=jt(X,h),this.sourceType=jt(R,l),this.flowId=p,this.status=jt(X,m),this.providerUrl=w}static fromObject=({id:t,status:e,...s})=>new ce({id:t,status:e,createdAt:s.created_at,updatedAt:s.updated_at,deactivatedAt:s.deactivated_at,platformId:s.platform_id,filesUri:s.files_uri,userId:s.user_id,verificationId:s.verification_id,identityId:s.identity_id,govtIdStatus:s.govt_id_status,proofOfAddressStatus:s.proof_of_address_status,proofOfLifeStatus:s.proof_of_life_status,sourceType:s.source_type,flowId:s.flow_id,providerUrl:s.provider_url})}class oe{constructor({id:t}){this.id=t}static fromObject=({id:t})=>new oe({id:t})}class de{constructor({currency:t,monthlyAmount:e,recipientsNum:s,payersNum:i,deposits:a,withdrawal:r}){this.currency=t,this.monthlyAmount=e,this.recipientsNum=s,this.payersNum=i,this.deposits=a,this.withdrawal=r}get deposits(){return this._deposits}set deposits(t){t&&(this._deposits=Bt.fromObject(t))}get withdrawal(){return this._withdrawal}set withdrawal(t){t&&(this._withdrawal=Bt.fromObject(t))}static fromObject=({currency:t,deposits:e,withdrawal:s,...i})=>new de({currency:t,deposits:e,withdrawal:s,payersNum:i.payers_num,recipientsNum:i.recipients_num,monthlyAmount:i.monthly_amount})}class ue{constructor({address:t,clabe:e,emailAddress:s,id:i,level:a,meta:r,nationality:n,platformId:c,phoneNumber:o,requiredLevel:d,rfc:u,status:h,createdAt:l,updatedAt:p,userType:m}){this.address=t,this.clabe=e,this.createdAt=Ot(l),this.emailAddress=s,this.id=i,this.level=a,this.meta=r,this.nationality=n,this.platformId=c,this.phoneNumber=o,this.requiredLevel=d,this.rfc=u,this.status=jt(Q,h),this.updatedAt=Ot(p),this.userType=m}get address(){return this._address}set address(t){t&&(this._address=It.fromObject(t))}static fromObject=({address:t,clabe:e,id:s,level:i,nationality:a,rfc:r,status:n,...c})=>new ue({address:t,clabe:e,id:s,level:i,meta:c.meta,nationality:a,rfc:r,status:n,createdAt:c.created_at,emailAddress:c.email_address,phoneNumber:c.phone_number,platformId:c.platform_id,requiredLevel:c.required_level,updatedAt:c.updated_at,userType:c.user_type})}class he extends ue{constructor({address:t,audit:e,businessDetails:s,businessModel:i,businessName:a,clabe:r,createdAt:n,documentationUrl:c,emailAddress:o,externalAccount:d,folio:u,id:h,incorporationDate:l,legalName:p,legalRepresentatives:m,level:w,license:_,meta:f,nationality:b,phoneNumber:y,platformId:g,requiredLevel:v,rfc:A,shareholders:O,status:j,transactionalProfile:I,updatedAt:S,userId:x,userType:T,vulnerableActivity:C,webSite:N}){super({address:t,clabe:r,emailAddress:o,rfc:A,id:h,level:w,meta:f,nationality:b,platformId:g,phoneNumber:y,requiredLevel:v,status:j,createdAt:n,updatedAt:S,userType:T}),this.audit=e,this.businessModel=i,this.businessName=a,this.businessDetails=s,this.documentationUrl=c,this.incorporationDate=Ot(l),this.externalAccount=d,this.folio=u,this.legalName=p,this.license=_,this.shareholders=O,this.legalRepresentatives=m,this.transactionalProfile=I,this.userId=x,this.vulnerableActivity=C,this.webSite=N}get shareholders(){return this._shareholders}set shareholders(t){t&&(this._shareholders=t.map((t=>Pt.fromObject(t))))}get legalRepresentatives(){return this._legalRepresentatives}set legalRepresentatives(t){t&&(this._legalRepresentatives=t.map((t=>Rt.fromObject(t))))}get externalAccount(){return this._externalAccount}set externalAccount(t){t&&(this._externalAccount=Ct.fromObject(t))}get vulnerableActivity(){return this._vulnerableActivity}set vulnerableActivity(t){t&&(this._vulnerableActivity=Lt.fromObject(t))}get audit(){return this._audit}set audit(t){t&&(this._audit=xt.fromObject(t))}get license(){return this._license}set license(t){t&&(this._license=Dt.fromObject(t))}get transactionalProfile(){return this._transactionalProfile}set transactionalProfile(t){t&&(this._transactionalProfile=de.fromObject(t))}get businessDetails(){return this._businessDetails}set businessDetails(t){t&&(this._businessDetails=Tt.fromObject(t))}static fromObject=({audit:t,address:e,clabe:s,folio:i,id:a,level:r,license:n,nationality:c,rfc:o,status:d,shareholders:u,...h})=>new he({address:e,audit:t,clabe:s,folio:i,id:a,level:r,license:n,nationality:c,rfc:o,shareholders:u,status:d,legalName:h.legal_name,legalRepresentatives:h.legal_representatives,businessModel:h.business_model,businessName:h.business_name,businessDetails:h.business_details,createdAt:h.created_at,documentationUrl:h.documentation_url,emailAddress:h.email_address,externalAccount:h.external_account,incorporationDate:h.incorporation_date,meta:h.meta,phoneNumber:h.phone_number,platformId:h.platform_id,requiredLevel:h.required_level,transactionalProfile:h.transactional_profile,updatedAt:h.updated_at,userId:h.user_id,userType:h.user_type,vulnerableActivity:h.vulnerable_activity,webSite:h.web_site})}class le{constructor({id:t,postalCode:e,colonia:s,city:i,state:a,country:r,createdAt:n,updatedAt:c}){this.id=t,this.postalCode=e,this.colonia=s,this.city=i,this.state=jt(G,a),this.country=jt(K,r),this.createdAt=Ot(n),this.updatedAt=Ot(c)}static fromObject=({id:t,colonia:e,city:s,state:i,country:a,...r})=>new le({id:t,colonia:e,city:s,state:i,country:a,postalCode:r.postal_code,createdAt:r.created_at,updatedAt:r.updated_at})}class pe{constructor({balance:t,createdAt:e,deactivatedAt:s,id:i,userId:a,updatedAt:r}){this.balance=t,this.createdAt=Ot(e),this.deactivatedAt=Ot(s),this.id=i,this.userId=a,this.updatedAt=Ot(r)}}class me extends pe{constructor({balance:t,category:e,createdAt:s,deactivatedAt:i,goalAmount:a,goalDate:r,id:n,name:c,userId:o,updatedAt:d}){super({balance:t,createdAt:s,deactivatedAt:i,id:n,userId:o,updatedAt:d}),this.category=jt(V,e),this.goalAmount=a,this.goalDate=Ot(r),this.name=c}static fromObject=({balance:t,category:e,id:s,name:i,...a})=>new me({balance:t,category:e,id:s,name:i,createdAt:a.created_at,deactivatedAt:a.deactivated_at,goalAmount:a.goal_amount,goalDate:a.goal_date,userId:a.user_id,updatedAt:a.updated_at})}class we{constructor({categories:t,id:e,name:s,providerKey:i}){var a;this.categories=null==(a=t)?[]:a.map((t=>jt(F,t))),this.id=e,this.name=s,this.providerKey=i}static fromObject=({categories:t,id:e,name:s,...i})=>new we({categories:t,id:e,name:s,providerKey:i.provider_key})}class _e{constructor({createdAt:t,expiresAt:e,failureUrl:s,id:i,platformId:a,successUrl:r,type:n,userId:c}){this.createdAt=Ot(t),this.expiresAt=Ot(e),this.failureUrl=s,this.id=i,this.platformId=a,this.successUrl=r,this.type=jt(H,n),this.userId=c}static fromObject=({id:t,type:e,...s})=>new _e({id:t,type:e,createdAt:s.created_at,expiresAt:s.expires_at,failureUrl:s.failure_url,platformId:s.platform_id,successUrl:s.success_url,userId:s.user_id})}class fe{constructor({createdAt:t,id:e,month:s,year:i}){this.createdAt=Ot(t),this.id=e,this.month=s,this.year=i}static fromObject=({id:t,month:e,year:s,...i})=>new fe({id:t,month:e,year:s,createdAt:i.created_at})}class be extends $t{constructor({accountNumber:t,amount:e,createdAt:s,descriptor:i,destinationUri:a,id:r,idempotencyKey:n,network:c,recipientName:o,status:d,trackingKey:u,updatedAt:h,userId:l}){super({amount:e,createdAt:s,descriptor:i,status:d,userId:l}),this.accountNumber=t,this.destinationUri=a,this.id=r,this.idempotencyKey=n,this.network=jt(Z,c),this.recipientName=o,this.trackingKey=u,this.updatedAt=Ot(h)}static fromObject=({amount:t,descriptor:e,id:s,network:i,status:a,...r})=>new be({amount:t,descriptor:e,id:s,network:i,status:a,accountNumber:r.account_number,createdAt:r.created_at,destinationUri:r.destination_uri,idempotencyKey:r.idempotency_key,recipientName:r.recipient_name,trackingKey:r.tracking_key,updatedAt:r.updated_at,userId:r.user_id})}class ye{constructor({address:t,blacklistValidationStatus:e,clabe:s,countryOfBirth:i,createdAt:a,curp:r,curpDocument:n,dateOfBirth:c,emailAddress:o,firstSurname:d,gender:u,govtId:h,id:l,isDormant:p,isFraud:m,isPldBlocked:w,isSecurityMode:_,level:f,names:b,nationality:y,phoneNumber:g,proofOfAddress:v,proofOfLife:A,requiredLevel:O,rfc:j,secondSurname:I,stateOfBirth:S,status:x,termsOfService:T,updatedAt:C,userTosAgreementsId:N,userType:k,verificationId:D}){this.address=t,this.blacklistValidationStatus=jt(X,e),this.clabe=s,this.countryOfBirth=i,this.createdAt=Ot(a),this.curp=r,this.curpDocument=n,this.dateOfBirth=c,this.emailAddress=o,this.firstSurname=d,this.gender=u,this.id=l,this.isDormant=p,this.isFraud=m,this.isPldBlocked=w,this.isSecurityMode=_,this.level=f,this.names=b,this.nationality=y,this.phoneNumber=g,this.govtId=h,this.proofOfAddress=v,this.proofOfLife=A,this.requiredLevel=O,this.rfc=j,this.secondSurname=I,this.stateOfBirth=S,this.status=jt(Q,x),this.termsOfService=T,this.updatedAt=Ot(C),this.userTosAgreementsId=N,this.userType=k,this.verificationId=D}get address(){return this._address}set address(t){t&&(this._address=It.fromObject(t))}get proofOfAddress(){return this._proofOfAddress}set proofOfAddress(t){t&&(this._proofOfAddress=kt.fromObject(t))}get proofOfLife(){return this._proofOfLife}set proofOfLife(t){t&&(this._proofOfLife=kt.fromObject(t))}get govtId(){return this._govtId}set govtId(t){t&&(this._govtId=kt.fromObject(t))}get termsOfService(){return this._termsOfService}set termsOfService(t){t&&(this._termsOfService=qt.fromObject(t))}get curpDocument(){return this._curpDocument}set curpDocument(t){t&&(this._curpDocument=kt.fromObject(t))}static fromObject=({address:t,clabe:e,curp:s,gender:i,id:a,level:r,names:n,nationality:c,rfc:o,status:d,...u})=>new ye({address:t,clabe:e,curp:s,gender:i,id:a,level:r,names:n,nationality:c,rfc:o,status:d,blacklistValidationStatus:u.blacklist_validation_status,countryOfBirth:u.country_of_birth,createdAt:u.created_at,curpDocument:u.curp_document,dateOfBirth:u.date_of_birth,emailAddress:u.email_address,firstSurname:u.first_surname,govtId:u.govt_id,isDormant:u.is_dormant,isFraud:u.is_fraud,isPldBlocked:u.is_pld_blocked,isSecurityMode:u.is_security_mode,phoneNumber:u.phone_number,proofOfAddress:u.proof_of_address,proofOfLife:u.proof_of_life,requiredLevel:u.required_level,secondSurname:u.second_surname,stateOfBirth:u.state_of_birth,termsOfService:u.terms_of_service,updatedAt:u.updated_at,userTosAgreementsId:u.user_tos_agreements_id,userType:u.user_type,verificationId:u.verification_id})}class ge{constructor({createdAt:t,id:e,isActive:s,updatedAt:i}){this.createdAt=Ot(t),this.id=e,this.isActive=s,this.updatedAt=Ot(i)}static fromObject=({id:t,...e})=>new ge({id:t,createdAt:e.created_at,isActive:e.is_active,updatedAt:e.updated_at})}class ve{constructor({id:t,lastLoginAt:e,success:s}){this.id=t,this.lastLoginAt=Ot(e),this.success=s}static fromObject=({id:t,success:e,...s})=>new ve({id:t,success:e,lastLoginAt:s.last_login_at})}class Ae{constructor({createdAt:t,id:e,ip:s,location:i,type:a,updatedAt:r,version:n}){this.createdAt=Ot(t),this.id=e,this.ip=s,this.location=i,this.type=a,this.updatedAt=Ot(r),this.version=n}static fromObject=({id:t,ip:e,location:s,type:i,version:a,...r})=>new Ae({id:t,ip:e,location:s,type:i,version:a,createdAt:r.created_at,updatedAt:r.updated_at})}class Oe{constructor({createdAt:t,id:e,platformId:s,recipient:i,type:a,updatedAt:r}){this.createdAt=Ot(t),this.id=e,this.platformId=s,this.recipient=i,this.type=jt(z,a),this.updatedAt=Ot(r)}static fromObject=({id:t,recipient:e,type:s,...i})=>new Oe({id:t,recipient:e,type:s,createdAt:i.created_at,platformId:i.platform_id,updatedAt:i.updated_at})}class je extends $t{constructor({amount:t,createdAt:e,descriptor:s,id:i,status:a,transactionType:r,userId:n,walletUri:c}){super({amount:t,createdAt:e,descriptor:s,status:a,userId:n}),this.id=i,this.transactionType=jt(tt,r),this.walletUri=c}static fromObject=({amount:t,descriptor:e,id:s,status:i,...a})=>new je({amount:t,descriptor:e,id:s,status:i,createdAt:a.created_at,transactionType:a.transaction_type,userId:a.user_id,walletUri:a.wallet_uri})}class Ie extends $t{constructor({amount:t,claimUrl:e,createdAt:s,descriptor:i,destinationUri:a,expiresAt:r,id:n,network:c,phoneNumber:o,recipientName:d,status:u,trackingKey:h,updatedAt:l,userId:p}){super({amount:t,createdAt:s,descriptor:i,status:u,userId:p}),this.claimUrl=e,this.destinationUri=a,this.id=n,this.expiresAt=Ot(r),this.network=jt(Z,c),this.phoneNumber=o,this.recipientName=d,this.trackingKey=h,this.updatedAt=Ot(l)}static fromObject=({amount:t,descriptor:e,id:s,network:i,status:a,...r})=>new Ie({amount:t,descriptor:e,id:s,network:i,status:a,createdAt:r.created_at,claimUrl:r.claim_url,destinationUri:r.destination_uri,expiresAt:r.expires_at,phoneNumber:r.phone_number,recipientName:r.recipient_name,trackingKey:r.tracking_key,updatedAt:r.updated_at,userId:r.user_id})}class Se{constructor(t){this.superclass=t}with(...t){return t.reduce(((t,e)=>e(t)),this.superclass)}}const xe=t=>new Se(t),Te=(t,e)=>({accounts:()=>Gt.fromObject(e),alerts:()=>Ft.fromObject(e),api_keys:()=>Vt.fromObject(e),arpc:()=>Ht.fromObject(e),balance_entries:()=>Yt.fromObject(e),bill_payments:()=>Wt.fromObject(e),"bridge/accounts":()=>Zt.fromObject(e),"bridge/bank_accounts":()=>Qt.fromObject(e),"bridge/clabes":()=>Jt.fromObject(e),"bridge/kyc_validations":()=>ce.fromObject(e),"bridge/sessions":()=>_e.fromObject(e),"bridge/transactions":()=>Xt.fromObject(e),cards:()=>zt.fromObject(e),card_activations:()=>te.fromObject(e),card_transactions:()=>ee.fromObject(e),card_validations:()=>se.fromObject(e),commissions:()=>ie.fromObject(e),deposits:()=>ae.fromObject(e),files:()=>re.fromObject(e),fraud_funds_transfers:()=>ne.fromObject(e),kyc_validations:()=>ce.fromObject(e),login_tokens:()=>oe.fromObject(e),partners:()=>he.fromObject(e),postal_codes:()=>le.fromObject(e),savings:()=>me.fromObject(e),service_providers:()=>we.fromObject(e),sessions:()=>_e.fromObject(e),statements:()=>fe.fromObject(e),transfers:()=>be.fromObject(e),users:()=>ye.fromObject(e),user_credentials:()=>ge.fromObject(e),user_logins:()=>ve.fromObject(e),users_tos_agreements:()=>Ae.fromObject(e),verifications:()=>Oe.fromObject(e),wallet_transactions:()=>je.fromObject(e),whatsapp_transfers:()=>Ie.fromObject(e)}[t]()),Ce=t=>{if(null===t||""===t)return null;const e=t.match("/(.*?)/");return null===e?null:e[0].replaceAll("/","")};class Ne{constructor(t,e,s){this.path=t,this.QueryParams=e,this.client=s}}const ke=t=>class extends t{async retrieve(t){const e=await this.client.get({endpoint:`/${this.path}/${t}`});return Te(this.path,e)}},De=t=>class extends t{async _create(t){const e=await this.client.post({endpoint:`/${this.path}`,data:t});return Te(this.path,e)}},Ue=t=>class extends t{async _update(t,e){const s=await this.client.patch({endpoint:`/${this.path}/${t}`,data:e});return Te(this.path,s)}},Re=t=>class extends t{async _upload(t){const e=await this.client.post({endpoint:`/${this.path}`,data:t,multipart:!0});return Te(this.path,e)}},Me=t=>class extends t{async _deactivate(t,e){const s=await this.client.delete({endpoint:`/${this.path}/${t}`,data:e});return Te(this.path,s)}},Pe=t=>class extends t{async _download(t,e){return await this.client.get({endpoint:`/${this.path}/${t}`,format:e})}},Be=t=>class extends t{async one(t=new this.QueryParams({})){const{items:e}=await this.client.get({endpoint:`/${this.path}`,params:t.toParams()});if(!e||!e.length)throw new o;if(e.length>1)throw new d;const[s]=e;return Te(this.path,s)}async first(t=new this.QueryParams({})){const{items:e}=await this.client.get({endpoint:`/${this.path}`,params:t.toParams()});if(!e||!e[0])return null;const[s]=e;return Te(this.path,s)}async count(t=new this.QueryParams({})){t.count=!0;const{count:e}=await this.client.get({endpoint:`/${this.path}`,params:t.toParams()});return e||0}async*all(t=new this.QueryParams({})){let e=`/${this.path}?${t.toQueryString()}`;for(;e;){const t=await this.client.get({endpoint:e});if(t.items)for(const e of t.items){const t=Te(this.path,e);yield t}e=t.next_page_uri}}};class qe extends(xe(Ne).with(Be,ke)){constructor(t){super("accounts",st,t)}}class Le{toObject(){return{}}toCleanObject(){const t=this.toObject();return Object.keys(t).forEach((e=>{null==t[e]&&delete t[e]})),t}}class Ee extends Le{constructor(t,e){super(),this.userId=t,this.metadata=e}toObject(){return{user_id:this.userId,metadata:this.metadata}}}class Ke extends Le{constructor({accountNumber:t,actualPeriodCount:e,actualPeriodSum:s,agent:i,aggregationType:a,changeLog:r,committeeMeetingDate:n,comments:c,createdAt:o,description:d,id:u,institutionName:h,level:l,manualScenario:p,name:m,period:w,periodNumber:_,status:f,sourceType:b,transactionDate:y,type:g,typeOfFilter:v,updatedAt:A,userId:O}={}){super(),this.accountNumber=t,this.actualPeriodCount=e,this.actualPeriodSum=s,this.agent=i,this.aggregationType=a,this.changeLog=r,this.committeeMeetingDate=n,this.createdAt=o,this.comments=c,this.description=d,this.id=u,this.institutionName=h,this.level=l,this.name=m,this.manualScenario=p,this.period=w,this.periodNumber=_,this.status=f,this.sourceType=b,this.transactionDate=y,this.type=g,this.typeOfFilter=v,this.updatedAt=A,this.userId=O}toObject(){return{agent:this.agent,change_log:this.changeLog,comments:this.comments,description:this.description,id:this.id,level:this.level,name:this.name,period:this.period,status:this.status,type:this.type,account_number:this.accountNumber,actual_period_count:this.actualPeriodCount,actual_period_sum:this.actualPeriodSum,aggregation_type:this.aggregationType,committee_meeting_date:this.committeeMeetingDate,created_at:this.createdAt,institution_name:this.institutionName,manual_scenario:this.manualScenario,period_number:this.periodNumber,transaction_date:this.transactionDate,source_type:this.sourceType,type_of_filter:this.typeOfFilter,updated_at:this.updatedAt,user_id:this.userId}}}class Ge extends Le{constructor(t,e,s){super(),this.userId=t,this.issuer=e,this.fundingType=s}toObject(){return{user_id:this.userId,issuer:this.issuer,funding_type:this.fundingType}}}class Fe extends Le{constructor(t,e){super(),this.status=t,this.pinBlock=e}toObject(){return{status:this.status,pin_block:this.pinBlock}}}class Ve extends Le{constructor(t,e,s,i){super(),this.n=t,this.eM=e,this.eY=s,this.c2=i}get number(){return this._number}set n(t){if([!!t,16===t.length,/^\d{16}/.test(t)].some((t=>!t)))throw new l("Invalid number");this._number=t.trim()}get expMonth(){return this._expMonth}set eM(t){if([!!t,t>=1,t<=12].some((t=>!t)))throw new l("Invalid expiration month");this._expMonth=t}get expYear(){return this._expYear}set eY(t){if([!!t,t>=18,t<=99].some((t=>!t)))throw new l("Invalid expiration year");this._expYear=t}get cvv2(){return this._cvv2}set c2(t){if([!!t,3===t.length,/^\d{3}/.test(t)].some((t=>!t)))throw new l("Invalid cvv2");this._cvv2=t}toObject(){return{number:this.number,exp_month:this.expMonth,exp_year:this.expYear,cvv2:this.cvv2}}}class He extends Le{constructor({cvv:t,cvv2:e,expMonth:s,expYear:i,icvv:a,number:r,pinBlock:n,pinAttemptsExceeded:c}){super(),this.c=t,this.c2=e,this.em=s,this.ey=i,this.ic=a,this.n=r,this.pinBloc=n,this.pinAttemptsExceeded=c}get cvv(){return this._cvv}set c(t){if(!t)return;if([3===t.length].some((t=>!t)))throw new l("Invalid cvv");this._cvv=t}get cvv2(){return this._cvv2}set c2(t){if(!t)return;if([3===t.length].some((t=>!t)))throw new l("Invalid cvv2");this._cvv2=t}get expMonth(){return this._expMonth}set em(t){if(!t)return;if([t>=1,t<=12].some((t=>!t)))throw new l("Invalid expiration month");this._expMonth=t}get expYear(){return this._expYear}set ey(t){if(!t)return;if([t>=18,t<=99].some((t=>!t)))throw new l("Invalid expiration year");this._expYear=t}get icvv(){return this._icvv}set ic(t){if(!t)return;if([3===t.length].some((t=>!t)))throw new l("Invalid icvv");this._icvv=t}get number(){return this._number}set n(t){if([!!t,16===t.length,/^\d{16}/.test(t)].some((t=>!t)))throw new l("Invalid number");this._number=t}toObject(){return{cvv:this.cvv,cvv2:this.cvv2,exp_month:this.expMonth,exp_year:this.expYear,icvv:this.icvv,number:this.number,pin_block:this.pinBloc,pin_attempts_exceeded:this.pinAttemptsExceeded}}}class Ye extends Le{constructor({userId:t,force:e,isBridge:s=!1}){super(),this.force=e,this.userId=t,this.isBridge=s}toObject(){return{force:this.force,[this.isBridge?"account_id":"user_id"]:this.userId}}}class $e extends Le{constructor({city:t,colonia:e,country:s,extNumber:i,fullName:a,intNumber:r,postalCode:n,postalCodeId:c,state:o,street:d}={}){super(),this.city=t,this.colonia=e,this.country=s,this.extNumber=i,this.fullName=a,this.intNumber=r,this.postalCode=n,this.postalCodeId=c,this.state=o,this.street=d}toObject(){return{city:this.city,colonia:this.colonia,country:this.country,ext_number:this.extNumber,full_name:this.fullName,int_number:this.intNumber,postal_code:this.postalCode,postal_code_id:this.postalCodeId,state:this.state,street:this.street}}}class We extends Le{constructor({speiTransfersNum:t,speiTransfersAmount:e,internalTransfersNum:s,internalTransfersAmount:i}){super(),this.speiTransfersNum=t,this.speiTransfersAmount=e,this.internalTransfersNum=s,this.internalTransfersAmount=i}toObject(){return{spei_transfers_num:this.speiTransfersNum,spei_transfers_amount:this.speiTransfersAmount,internal_transfers_num:this.internalTransfersNum,internal_transfers_amount:this.internalTransfersAmount}}}class Ze{constructor({currency:t,monthlyAmount:e,recipientsNum:s,payersNum:i,deposits:a,withdrawal:r}){this.currency=t,this.monthlyAmount=e,this.recipientsNum=s,this.payersNum=i,this.deposits=a,this.withdrawal=r}get deposits(){return this._deposits}set deposits(t){t&&(this._deposits=new We(t).toObject())}get withdrawal(){return this._withdrawal}set withdrawal(t){t&&(this._withdrawal=new We(t).toObject())}toObject(){return{currency:this.currency,monthly_amount:this.monthlyAmount,recipients_num:this.recipientsNum,payers_num:this.payersNum,deposits:this.deposits,withdrawal:this.withdrawal}}}class Qe extends Le{constructor({accountUsageDescription:t,businessDescription:e}){super(),this.accountUsageDescription=t,this.businessDescription=e}toObject(){return{account_usage_description:this.accountUsageDescription,business_description:this.businessDescription}}}class Je extends Le{constructor({names:t,curp:e,rfc:s,firstSurname:i,percentage:a,secondSurname:r,shareCapital:n}){super(),this.names=t,this.curp=e,this.percentage=a,this.rfc=s,this.shareCapital=n,this.firstSurname=i,this.secondSurname=r}toObject(){return{curp:this.curp,names:this.names,percentage:this.percentage,rfc:this.rfc,share_capital:this.shareCapital,first_surname:this.firstSurname,second_surname:this.secondSurname}}}class Xe extends Je{constructor({address:t,curp:e,emailAddress:s,firstSurname:i,job:a,names:r,percentage:n,phoneNumber:c,rfc:o,secondSurname:d}){super({curp:e,firstSurname:i,names:r,percentage:n,rfc:o,secondSurname:d}),this.job=a,this.phoneNumber=c,this.emailAddress=s,this.address=t}get address(){return this._address}set address(t){t&&(this._address=new $e(t).toCleanObject())}toObject(){return{...super.toObject(),job:this.job,phone_number:this.phoneNumber,email_address:this.emailAddress,address:this.address}}}class ze extends Le{constructor({name:t,percentage:e,shareholders:s,legalRepresentatives:i}){super(),this.name=t,this.percentage=e,this.shareholders=s,this.legalRepresentatives=i}get shareholders(){return this._shareholders}set shareholders(t){t&&(this._shareholders=t.map((t=>new Je(t).toObject())))}get legalRepresentatives(){return this._legalRepresentatives}set legalRepresentatives(t){t&&(this._legalRepresentatives=t.map((t=>new Xe(t).toObject())))}toObject(){return{name:this.name,percentage:this.percentage,shareholders:this.shareholders,legal_representatives:this.legalRepresentatives}}}class ts extends Le{constructor({isVulnerableActivity:t,hasSatRegister:e,satRegisteredDate:s,isInCompliance:i}){super(),this.isVulnerableActivity=t,this.hasSatRegister=e,this.satRegisteredDate=s,this.isInCompliance=i}toObject(){return{is_vulnerable_activity:this.isVulnerableActivity,has_sat_register:this.hasSatRegister,sat_registered_date:this.satRegisteredDate,is_in_compliance:this.isInCompliance}}}class es extends Le{constructor({licenseRequired:t,supervisoryEntity:e,licenseType:s,licenseDate:i}){super(),this.licenseRequired=t,this.supervisoryEntity=e,this.licenseType=s,this.licenseDate=i}toObject(){return{license_required:this.licenseRequired,supervisory_entity:this.supervisoryEntity,license_type:this.licenseType,license_date:this.licenseDate}}}class ss extends Le{constructor({hasAudit:t,auditProvider:e,auditDate:s,auditComments:i}){super(),this.hasAudit=t,this.auditProvider=e,this.auditDate=s,this.auditComments=i}toObject(){return{has_audit:this.hasAudit,audit_provider:this.auditProvider,audit_date:this.auditDate,audit_comments:this.auditComments}}}class is extends Le{constructor({address:t,audit:e,businessDetails:s,businessName:i,clabe:a,createdAt:r,documentationUrl:n,emailAddress:c,externalAccount:o,folio:d,id:u,incorporationDate:h,legalName:l,legalRepresentatives:p,level:m,license:w,meta:_,nationality:f,phoneNumber:b,platformId:y,requiredLevel:g,rfc:v,shareholders:A,status:O,transactionalProfile:j,updatedAt:I,userId:S,userType:x,vulnerableActivity:T,webSite:C}={}){super(),this.addressRequest=t,this.auditRequest=e,this.businessDetailsRequest=s,this.businessName=i,this.clabe=a,this.createdAt=r,this.documentationUrl=n,this.emailAddress=c,this.externalAccountRequest=o,this.folio=d,this.id=u,this.incorporationDate=h,this.legalName=l,this.legalRepresentativesRequest=p,this.level=m,this.licenseRequest=w,this.meta=_,this.nationality=f,this.phoneNumber=b,this.platformId=y,this.requiredLevel=g,this.rfc=v,this.shareholdersRequest=A,this.status=O,this.transactionalProfileRequest=j,this.updatedAt=I,this.userId=S,this.userType=x,this.vulnerableActivityRequest=T,this.webSite=C}get address(){return this._address}set addressRequest(t){t&&(this._address=new $e(t).toCleanObject())}get audit(){return this._audit}set auditRequest(t){t&&(this._audit=new ss(t).toObject())}get businessDetails(){return this._businessDetails}set businessDetailsRequest(t){t&&(this._businessDetails=new Qe(t).toObject())}get legalRepresentatives(){return this._legalRepresentatives}set legalRepresentativesRequest(t){t&&(this._legalRepresentatives=t.map((t=>new Xe(t).toObject())))}get license(){return this._license}set licenseRequest(t){t&&(this._license=new es(t).toObject())}get shareholders(){return this._shareholders}set shareholdersRequest(t){t&&(this._shareholders=t.map((t=>new ze(t).toObject())))}get transactionalProfile(){return this._transactionalProfile}set transactionalProfileRequest(t){t&&(this._transactionalProfile=new Ze(t).toObject())}get vulnerableActivity(){return this._vulnerableActivity}set vulnerableActivityRequest(t){t&&(this._vulnerableActivity=new ts(t).toObject())}get externalAccount(){return this._externalAccount}set externalAccountRequest(t){t&&(this._externalAccount={account:t.account,bank:t.bank})}toObject(){return{address:this.address,audit:this.audit,business_details:this.businessDetails,business_name:this.businessName,clabe:this.clabe,created_at:this.createdAt,documentation_url:this.documentationUrl,email_address:this.emailAddress,external_account:this.externalAccount,folio:this.folio,id:this.id,incorporation_date:this.incorporationDate,legal_name:this.legalName,legal_representatives:this.legalRepresentatives,level:this.level,license:this.license,meta:this.meta,nationality:this.nationality,phone_number:this.phoneNumber,platform_id:this.platformId,required_level:this.requiredLevel,rfc:this.rfc,shareholders:this.shareholders,status:this.status,transactional_profile:this.transactionalProfile,updated_at:this.updatedAt,user_id:this.userId,user_type:this.userType,vulnerable_activity:this.vulnerableActivity,web_site:this.webSite}}}class as extends Le{constructor(t,e,s,i){super(),this.category=t,this.name=i,this.goalAmount=e,this.validDate=s}get goalDate(){return this._goalDate}set validDate(t){if(t){if(Ot(t).getTime()<=Ot(Date.now()).getTime())throw new l("The goal_date always need to be higher than now");this._goalDate=t}}toObject(){return{category:this.category,goal_amount:this.goalAmount,goal_date:this.goalDate,name:this.name}}}class rs extends Le{constructor({failureUrl:t,successUrl:e,type:s,userId:i,isBridge:a=!1}){super(),this.failureUrl=t,this.successUrl=e,this.type=s,this.userId=i,this.isBridge=a}toObject(){return{failure_url:this.failureUrl,success_url:this.successUrl,type:this.type,[this.isBridge?"account_id":"user_id"]:this.userId}}}class ns extends Le{constructor({requestId:t,userId:e,amount:s,concepto:i,clabe:a,reason:r}){super(),this.requestId=t,this.userId=e,this.amount=s,this.concepto=i,this.clabe=a,this.reason=r}toObject(){return{request_id:this.requestId,user_id:this.userId,amount:this.amount,concepto:this.concepto,clabe:this.clabe,reason:this.reason}}}class cs extends Le{constructor(t,e,s,i,a){super(),this.accountNumber=t,this.amount=e,this.descriptor=s,this.idempotencyKey=i,this.recipientName=a}toObject(){return{account_number:this.accountNumber,amount:this.amount,descriptor:this.descriptor,idempotency_key:this.idempotencyKey,recipient_name:this.recipientName}}}class os extends Le{constructor(t){super(),this.pwd=t}get password(){return this._password}set pwd(t){if([!!t,t.length>=6].some((t=>!t)))throw new l("Invalid password");this._password=t}toObject(){return{password:this.password}}}class ds extends Le{constructor(t,e){super(),this.pwd=t,this.isActive=e,this.req={password:this.password,isActive:this.isActive}}get password(){return this._password}get request(){return this._request}set pwd(t){if(!t)return void(this._password=t);if([t.length>=6].some((t=>!t)))throw new l("Invalid password");this._password=t}set req(t){if(t.password&&null!=t.isActive)throw new l("Only one property can be updated at a time");this._request=t}toObject(){return{password:this.request.password,is_active:this.request.isActive}}}class us extends Le{constructor(t,e="me"){super(),this.pwd=t,this.userId=e}get password(){return this._password}set pwd(t){if([!!t,6===t.length,/^\d{6}$/.test(t)].some((t=>!t)))throw new l("Invalid password");this._password=t}toObject(){return{password:this.password,user_id:this.userId}}}class hs extends Le{constructor({ip:t,location:e,type:s,version:i}){super(),this.ipAddress=t,this.location=e,this.type=s,this.version=i}get ip(){return this._ip}set ipAddress(t){if(!t)throw new l("missing ip address");if(!t.split(".").every((t=>t>=0&&t<=255)))throw new l("Invalid ip address");this._ip=t}toObject(){return{ip:this.ip,location:this.location,type:this.type,version:this.version}}}class ls extends Le{constructor({data:t,isMx:e,status:s,type:i,uriBack:a,uriFront:r}){super(),this.data=t,this.isMx=e,this.status=s,this.type=i,this.uriBack=a,this.uriFront=r}toObject(){return{data:this.data,is_mx:this.isMx,status:this.status,type:this.type,uri_back:this.uriBack,uri_front:this.uriFront}}}class ps extends Le{constructor({address:t,blacklistValidationStatus:e,curpDocumentUri:s,govtId:i,emailAddress:a,isDormant:r,isFraud:n,isPldBlocked:c,isSecurityMode:o,profession:d,proofOfAddress:u,proofOfLife:h,requiredLevel:l,termsOfService:p,phoneNumber:m,rfc:w,status:_,userType:f,verificationId:b}){super(),this.addressProofs=u,this.adrs=t,this.blacklistValidationStatus=e,this.curpDocumentUri=s,this.emailAddress=a,this.govstIds=i,this.isDormant=r,this.isFraud=n,this.isPldBlocked=c,this.isSecurityMode=o,this.lifeProofs=h,this.profession=d,this.phoneNumber=m,this.requiredLevel=l,this.termsOfService=p,this.rfc=w,this.status=_,this.userType=f,this.verificationId=b}get termsOfService(){return this._termsOfService}set termsOfService(t){t&&(this._termsOfService=new hs(t).toObject())}get address(){return this._address}set adrs(t){t&&(this._address=new $e(t).toCleanObject())}get proofOfLife(){return this._proofOfLife}set lifeProofs(t){t&&(this._proofOfLife=new ls(t).toCleanObject())}get proofOfAddress(){return this._proofOfAddress}set addressProofs(t){t&&(this._proofOfAddress=new ls(t).toCleanObject())}get govtId(){return this._govtId}set govstIds(t){t&&(this._govtId=new ls(t).toCleanObject())}toObject(){return{address:this.address,blacklist_validation_status:this.blacklistValidationStatus,curp_document_uri:this.curpDocumentUri,email_address:this.emailAddress,govt_id:this.govtId,is_dormant:this.isDormant,is_fraud:this.isFraud,is_pld_blocked:this.isPldBlocked,is_security_mode:this.isSecurityMode,phone_number:this.phoneNumber,profession:this.profession,proof_of_life:this.proofOfLife,proof_of_address:this.proofOfAddress,requiredLevel:this.requiredLevel,rfc:this.rfc,status:this.status,terms_of_service:this.termsOfService,verification_id:this.verificationId,user_type:this.userType}}}class ms extends Le{constructor({platformId:t,recipient:e,type:s}){super(),this.platformId=t,this.type=s,this.recipients=e}get recipient(){return this._recipient}set recipients(t){switch(jt(z,this.type)){case z.Email:if(!t.match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/))throw new l("Invalid email address");this._recipient=t;break;case z.Phone:if(!t.match(/^\+?[0-9]{10,15}$/))throw new l("Invalid Phone Number");this._recipient=t}}toObject(){return{platform_id:this.platformId,recipient:this.recipient,type:this.type}}}class ws extends Le{constructor({code:t}){super(),this.code=t}toObject(){return{code:this.code}}}class _s extends Le{constructor(t,e,s){super(),this.amount=t,this.transactionType=e,this.walletUri=s}toObject(){return{amount:this.amount,transaction_type:this.transactionType,wallet_uri:this.walletUri}}}class fs extends(xe(Ne).with(De,Be,ke,Ue)){constructor(t){super("alerts",it,t)}async create(t){const e=new Ke(t);return await this._create(e.toCleanObject())}async update(t,e){const s=new Ke(e);return await this._update(t,s.toCleanObject())}}class bs extends(xe(Ne).with(De,Me,Be,ke,Ue)){constructor(t){super("api_keys",at,t)}async create(){return await this._create()}async deactivate(t,e=0){return await this._deactivate(t,{minutes:e})}async update(t,e,s){const i=new Ee(s,e);return await this._update(t,i.toCleanObject())}}class ys extends(xe(Ne).with(De)){constructor(t){super("arpc",Object,t)}async create({number:t,arqc:e,arpcMethod:s,transactionData:i,responseCode:a,transactionCounter:r,panSequence:n,uniqueNumber:c,trackDataMethod:o}){const d=new ArpcRequest({number:t,arqc:e,arpcMethod:s,transactionData:i,responseCode:a,transactionCounter:r,panSequence:n,uniqueNumber:c,trackDataMethod:o});return await this._create(d.toObject())}}class gs extends(xe(Ne).with(Be,ke)){constructor(t){super("balance_entries",rt,t)}async relatedTransaction(t){const e=Ce(t);if(null==e)return null;const s=await this.client.get({endpoint:t});return Te(`${e}`,s)}async fundingInstrument(t){const e=Ce(t);if(null==e)return null;const s=await this.client.get({endpoint:t});return Te(`${e}`,s)}}class vs extends(xe(Ne).with(Be,ke)){constructor(t){super("bill_payments",nt,t)}async serviceProvider(t){const e=Ce(t);if(null==e)return null;const s=await this.client.get({endpoint:t});return Te(`${e}`,s)}}class As extends(xe(Ne).with(Be,Ue,ke)){constructor(t){super("bridge/accounts",ct,t)}async update({userId:t="me",...e}){const s=new ps(e);return await this._update(t,s.toCleanObject())}}class Os extends(xe(Ne).with(Be,ke)){constructor(t){super("bridge/bank_accounts",ot,t)}}class js extends(xe(Ne).with(Be)){constructor(t){super("bridge/clabes",dt,t)}}class Is extends(xe(Ne).with(Be,ke)){constructor(t){super("bridge/transactions",ut,t)}}class Ss extends(xe(Ne).with(De)){constructor(t){super("card_activations",Object,t)}async create({number:t,expMonth:e,expYear:s,cvv2:i}){const a=new Ve(t,e,s,i);return await this._create(a.toCleanObject())}async card(t){if(!t)return null;const e=await this.client.get({endpoint:t});return zt.fromObject(e)}}class xs extends(xe(Ne).with(De,Me,Be,ke,Ue)){constructor(t){super("cards",ht,t)}async create(t,e,s){const i=new Ge(t,e,s);return await this._create(i.toCleanObject())}async deactivate(t){return await this._deactivate(t)}async update(t,e,s){const i=new Fe(e,s);return await this._update(t,i.toCleanObject())}}class Ts extends(xe(Ne).with(Be,ke)){constructor(t){super("card_transactions",lt,t)}async relatedCard(t){const e=Ce(t);if(null==e)return null;const s=await this.client.get({endpoint:t});return Te(`${e}`,s)}}class Cs extends(xe(Ne).with(De)){constructor(t){super("card_validations",Object,t)}async create({cvv:t,cvv2:e,expMonth:s,expYear:i,icvv:a,number:r,pinBlock:n,pinAttemptsExceeded:c}){const o=new He({cvv:t,cvv2:e,expMonth:s,expYear:i,icvv:a,number:r,pinBlock:n,pinAttemptsExceeded:c});return await this._create(o.toCleanObject())}async card(t){if(!t)return null;const e=await this.client.get({endpoint:t});return zt.fromObject(e)}}class Ns extends(xe(Ne).with(Be,ke)){constructor(t){super("commissions",et,t)}async relatedTransaction(t){const e=Ce(t);if(null==e)return null;const s=await this.client.get(t);return Te(`${e}`,s)}}class ks extends(xe(Ne).with(Be,ke)){constructor(t){super("deposits",mt,t)}async source(t){const e=await this.client.get({endpoint:t});return Gt.fromObject(e)}}class Ds extends(xe(Ne).with(Pe,Re)){constructor(t){super("files",Object,t)}async download(t){return await this._download(t,D.Any)}async upload(t){return await this._upload(t)}}class Us extends(xe(Ne).with(De,Be,ke)){constructor(t){super("fraud_funds_transfers",wt,t)}async create({requestId:t,userId:e,amount:s,concepto:i,clabe:a,reason:r}){const n=new ns({requestId:t,userId:e,amount:s,concepto:i,clabe:a,reason:r});return await this._create(n.toObject())}}class Rs extends(xe(Ne).with(De,ke,Me,Be)){constructor(t,e=!1){super(e?"bridge/kyc_validations":"kyc_validations",Object,t),this.isBridge=e}async create(t="me",e=!1){const s=new Ye({force:e,userId:t,isBridge:this.isBridge});return await this._create(s.toCleanObject())}async deactivate(t){return await this._deactivate(t)}}class Ms extends(xe(Ne).with(De)){constructor(t){super("login_tokens",Object,t)}async create(){return await this._create()}}class Ps extends(xe(Ne).with(De,Be,Ue,ke)){constructor(t){super("partners",_t,t)}async create(t){const e=new is(t);return await this._create(e.toCleanObject())}async update(t,e){const s=new is(e);return await this._update(t,s.toCleanObject())}}class Bs extends(xe(Ne).with(Be)){constructor(t){super("postal_codes",ft,t)}}class qs extends(xe(Ne).with(De,Me,Be,ke,Ue)){constructor(t){super("savings",vt,t)}async create(t,e,s,i){const a=new as(t,e,s,i);return await this._create(a.toObject())}async deactivate(t){return await this._deactivate(t)}async update(t,e,s,i,a){const r=new as(e,s,i,a);return await this._update(t,r.toObject())}}class Ls extends(xe(Ne).with(Be,ke)){constructor(t){super("service_providers",et,t)}}class Es extends(xe(Ne).with(De,ke,Be)){constructor(t,e=!1){super(e?"bridge/sessions":"sessions",Object,t),this.isBridge=e}async create(t,e,s,i){const a=new rs({failureUrl:i,successUrl:s,type:e,userId:t,isBridge:this.isBridge});return await this._create(a.toCleanObject())}}class Ks extends(xe(Ne).with(Pe,Be)){constructor(t){super("statements",bt,t)}async pdf(t){return await this._download(t,D.Pdf)}async xml(t){return await this._download(t,D.Xml)}}class Gs extends(xe(Ne).with(De,Be,ke)){constructor(t){super("transfers",yt,t)}async destination(t){const e=await this.client.get({endpoint:t});return Gt.fromObject(e)}async create({accountNumber:t,amount:e,descriptor:s,recipientName:i,idempotencyKey:a}){const r=a||this.constructor._genIdempotencyKey(t,e),n=new cs(t,e,s,r,i);return await this._create(n.toCleanObject())}async createMany(t){if(!t||!Array.isArray(t)||!t.length)return{};const e={submitted:[],errors:[]};return await Promise.all(t.map((async({accountNumber:t,amount:s,descriptor:i,idempotencyKey:a,recipientName:r})=>{const n=new cs(t,s,i,a||this.constructor._genIdempotencyKey(t,s),r);let c;try{c=await this._create(n.toCleanObject())}catch(t){return void e.errors.push({actualRequest:n,error:t})}e.submitted.push(c)}))),e}static _genIdempotencyKey(t,e){const[s]=Ot(Date.now()).toISOString().split("T");return`${s}:${t}:${e}`}}class Fs extends(xe(Ne).with(De,Ue)){constructor(t){super("user_credentials",Object,t)}async create(t){const e=new os(t);return await this._create(e.toObject())}async update({isActive:t,password:e,userId:s="me"}){const i=new ds(e,t);return await this._update(s,i.toCleanObject())}}class Vs extends(xe(Ne).with(De,Me)){constructor(t){super("user_logins",Object,t),this.loginIdInHeaders=null}async create(t,e){const s=new us(t,e),i=await this._create(s.toObject());if(!i.success)throw new h;return this.loginIdInHeaders=this.client.addHeadersToRequest({"X-Cuenca-LoginId":i.id}),i}async logOut(t="me"){return await this._deactivate(t,{}),this.loginIdInHeaders&&this.loginIdInHeaders.eject(),!0}}class Hs extends(xe(Ne).with(Be,Ue,ke,Me)){constructor(t){super("users",gt,t)}async update({userId:t="me",...e}){const s=new ps(e);return await this._update(t,s.toCleanObject())}async deactivate(t){return await this._deactivate(t)}}class Ys extends(xe(Ne).with(ke)){constructor(t){super("users_tos_agreements",Object,t)}}class $s extends(xe(Ne).with(De,Ue)){constructor(t){super("verifications",Object,t)}async create({platformId:t,recipient:e,type:s}){const i=new ms({platformId:t,recipient:e,type:s});return await this._create(i.toObject())}async update({code:t,id:e}){const s=new ws({code:t});return await this._update(e,s.toObject())}}class Ws extends(xe(Ne).with(De,Be,ke)){constructor(t){super("wallet_transactions",At,t)}async create(t,e,s){const i=new _s(t,e,s);return await this._create(i.toObject())}async realtedWallet(t){const e=Ce(t);if(null==e)return null;const s=await this.client.get(t);return Te(`${e}`,s)}}class Zs extends(xe(Ne).with(Be,ke)){constructor(t){super("whatsapp_transfers",et,t)}async accountDestination(t){const e=Ce(t);if(null==e)return null;const s=await this.client.get(t);return Te(`${e}`,s)}}t.Cuenca=class{constructor({apiKey:t,apiSecret:e,language:s="en",phase:i=L.Sandbox}={}){this.client=new Kt({apiKey:t,apiSecret:e,language:s,phase:i}),this.withClient(this.client)}withClient(t){this.accounts=new qe(t),this.alerts=new fs(t),this.apiKeys=new bs(t),this.balanceEntries=new gs(t),this.billPayments=new vs(t),this.bridgeAccounts=new As(t),this.bridgeBankAccounts=new Os(t),this.bridgeClabes=new js(t),this.bridgeKycValidations=new Rs(t,!0),this.bridgeSessions=new Es(t,!0),this.bridgeTransactions=new Is(t),this.cardActivations=new Ss(t),this.cards=new xs(t),this.cardTransactions=new Ts(t),this.cardValidations=new Cs(t),this.commissions=new Ns(t),this.deposits=new ks(t),this.files=new Ds(t),this.fraudFundsTransfers=new Us(t),this.kycValidations=new Rs(t),this.loginTokens=new Ms(t),this.partners=new Ps(t),this.postalCodes=new Bs(t),this.savings=new qs(t),this.serviceProviders=new Ls(t),this.sessions=new Es(t),this.statements=new Ks(t),this.transfers=new Gs(t),this.userCredentials=new Fs(t),this.userLogins=new Vs(t),this.users=new Hs(t),this.usersTosAgreements=new Ys(t),this.verifications=new $s(t),this.walletTransactions=new Ws(t),this.whatsAppTransfers=new Zs(t)}}}));
@@ -268,6 +268,19 @@ class DepositQuery extends TransactionQuery {
268
268
  }
269
269
  }
270
270
 
271
+ class FraudFundsTransferQuery extends TransactionQuery {
272
+ constructor({ requestId, ...args } = {}) {
273
+ super(args);
274
+ this.requestId = requestId;
275
+ }
276
+
277
+ toObject() {
278
+ return Object.assign(super.toObject(), {
279
+ request_id: this.requestId,
280
+ });
281
+ }
282
+ }
283
+
271
284
  class PartnerQuery extends QueryParams {
272
285
  constructor({ emailAddress, ...args }) {
273
286
  super(args);
@@ -798,4 +811,4 @@ class VulnerableActivity {
798
811
  });
799
812
  }
800
813
 
801
- export { AlertLog as A, BusinessDetails as B, CardsQuery as C, DepositQuery as D, ExternalAccount as E, KYCFile as K, LegalRepresentatives as L, PartnerQuery as P, QueryParams as Q, ShareholderMoral as S, TOSAgreements as T, UserQuery as U, VulnerableActivity as V, WalletQuery as W, Address as a, TransactionalProfileServices as b, Audit as c, License as d, AccountQuery as e, AlertQuery as f, ApiKeyQuery as g, BalanceEntryQuery as h, BillPaymentQuery as i, BridgeAccountQuery as j, BridgeBankAccountQuery as k, BridgeQuery as l, BridgeTransactionQuery as m, CardTransactionQuery as n, PostalCodeQuery as o, StatementQuery as p, TransferQuery as q, WalletTransactionQuery as r, TransactionQuery as s, VerificationError as t };
814
+ export { AlertLog as A, BusinessDetails as B, CardsQuery as C, DepositQuery as D, ExternalAccount as E, FraudFundsTransferQuery as F, KYCFile as K, LegalRepresentatives as L, PartnerQuery as P, QueryParams as Q, ShareholderMoral as S, TOSAgreements as T, UserQuery as U, VulnerableActivity as V, WalletQuery as W, Address as a, TransactionalProfileServices as b, Audit as c, License as d, AccountQuery as e, AlertQuery as f, ApiKeyQuery as g, BalanceEntryQuery as h, BillPaymentQuery as i, BridgeAccountQuery as j, BridgeBankAccountQuery as k, BridgeQuery as l, BridgeTransactionQuery as m, CardTransactionQuery as n, PostalCodeQuery as o, StatementQuery as p, TransferQuery as q, WalletTransactionQuery as r, TransactionQuery as s, VerificationError as t };
@@ -270,6 +270,19 @@ class DepositQuery extends TransactionQuery {
270
270
  }
271
271
  }
272
272
 
273
+ class FraudFundsTransferQuery extends TransactionQuery {
274
+ constructor({ requestId, ...args } = {}) {
275
+ super(args);
276
+ this.requestId = requestId;
277
+ }
278
+
279
+ toObject() {
280
+ return Object.assign(super.toObject(), {
281
+ request_id: this.requestId,
282
+ });
283
+ }
284
+ }
285
+
273
286
  class PartnerQuery extends QueryParams {
274
287
  constructor({ emailAddress, ...args }) {
275
288
  super(args);
@@ -817,6 +830,7 @@ exports.CardTransactionQuery = CardTransactionQuery;
817
830
  exports.CardsQuery = CardsQuery;
818
831
  exports.DepositQuery = DepositQuery;
819
832
  exports.ExternalAccount = ExternalAccount;
833
+ exports.FraudFundsTransferQuery = FraudFundsTransferQuery;
820
834
  exports.KYCFile = KYCFile;
821
835
  exports.LegalRepresentatives = LegalRepresentatives;
822
836
  exports.License = License;
@@ -967,6 +967,29 @@ class SessionRequest extends BaseRequest {
967
967
  }
968
968
  }
969
969
 
970
+ class FraudFundsTransferRequest extends BaseRequest {
971
+ constructor({ requestId, userId, amount, concepto, clabe, reason }) {
972
+ super();
973
+ this.requestId = requestId;
974
+ this.userId = userId;
975
+ this.amount = amount;
976
+ this.concepto = concepto;
977
+ this.clabe = clabe;
978
+ this.reason = reason;
979
+ }
980
+
981
+ toObject() {
982
+ return {
983
+ request_id: this.requestId,
984
+ user_id: this.userId,
985
+ amount: this.amount,
986
+ concepto: this.concepto,
987
+ clabe: this.clabe,
988
+ reason: this.reason,
989
+ };
990
+ }
991
+ }
992
+
970
993
  class TransferRequest extends BaseRequest {
971
994
  constructor(
972
995
  accountNumber,
@@ -1353,6 +1376,7 @@ exports.CardActivationRequest = CardActivationRequest;
1353
1376
  exports.CardRequest = CardRequest;
1354
1377
  exports.CardUpdateRequest = CardUpdateRequest;
1355
1378
  exports.CardValidationRequest = CardValidationRequest;
1379
+ exports.FraudFundsTransferRequest = FraudFundsTransferRequest;
1356
1380
  exports.KYCValidationsRequest = KYCValidationsRequest;
1357
1381
  exports.PartnerUserRequest = PartnerUserRequest;
1358
1382
  exports.SavingRequest = SavingRequest;
@@ -965,6 +965,29 @@ class SessionRequest extends BaseRequest {
965
965
  }
966
966
  }
967
967
 
968
+ class FraudFundsTransferRequest extends BaseRequest {
969
+ constructor({ requestId, userId, amount, concepto, clabe, reason }) {
970
+ super();
971
+ this.requestId = requestId;
972
+ this.userId = userId;
973
+ this.amount = amount;
974
+ this.concepto = concepto;
975
+ this.clabe = clabe;
976
+ this.reason = reason;
977
+ }
978
+
979
+ toObject() {
980
+ return {
981
+ request_id: this.requestId,
982
+ user_id: this.userId,
983
+ amount: this.amount,
984
+ concepto: this.concepto,
985
+ clabe: this.clabe,
986
+ reason: this.reason,
987
+ };
988
+ }
989
+ }
990
+
968
991
  class TransferRequest extends BaseRequest {
969
992
  constructor(
970
993
  accountNumber,
@@ -1342,4 +1365,4 @@ class WalletTransactionRequest extends BaseRequest {
1342
1365
  }
1343
1366
  }
1344
1367
 
1345
- export { AlertUpdateRequest as A, BaseRequest as B, CardActivationRequest as C, KYCValidationsRequest as K, PartnerUserRequest as P, SavingRequest as S, TransferRequest as T, UserUpdateRequest as U, VerificationRequest as V, WalletTransactionRequest as W, ApiKeyUpdateRequest as a, ArpcRequest as b, CardRequest as c, CardUpdateRequest as d, CardValidationRequest as e, SessionRequest as f, UserCredentialRequest as g, UserCredentialUpdateRequest as h, UserLoginRequest as i, VerificationAttemptRequest as j, AddressUpdateRequest as k };
1368
+ export { AlertUpdateRequest as A, BaseRequest as B, CardActivationRequest as C, FraudFundsTransferRequest as F, KYCValidationsRequest as K, PartnerUserRequest as P, SavingRequest as S, TransferRequest as T, UserUpdateRequest as U, VerificationRequest as V, WalletTransactionRequest as W, ApiKeyUpdateRequest as a, ArpcRequest as b, CardRequest as c, CardUpdateRequest as d, CardValidationRequest as e, SessionRequest as f, UserCredentialRequest as g, UserCredentialUpdateRequest as h, UserLoginRequest as i, VerificationAttemptRequest as j, AddressUpdateRequest as k };
package/package.json CHANGED
@@ -1,23 +1,19 @@
1
1
  {
2
2
  "name": "@cuenca-mx/cuenca-js",
3
- "version": "1.1.0-dev0",
3
+ "version": "1.1.1-dev1",
4
4
  "description": "Cuenca client for JS",
5
5
  "main": "./build/index.cjs",
6
6
  "module": "./build/index.mjs",
7
- "types": "./typings/index.d.ts",
8
7
  "browser": "./build/umd/cuenca.umd.js",
9
8
  "files": [
10
- "build/**/*",
11
- "typings/**/*"
9
+ "build/**/*"
12
10
  ],
13
11
  "exports": {
14
12
  ".": {
15
- "types": "./typings/index.d.ts",
16
13
  "import": "./build/index.mjs",
17
14
  "require": "./build/index.cjs"
18
15
  },
19
16
  "./errors": {
20
- "types": "./typings/errors/index.d.ts",
21
17
  "import": "./build/errors/index.mjs",
22
18
  "require": "./build/errors/index.cjs"
23
19
  },
@@ -30,7 +26,6 @@
30
26
  "require": "./build/requests/index.cjs"
31
27
  },
32
28
  "./types": {
33
- "types": "./typings/types/index.d.ts",
34
29
  "import": "./build/types/index.mjs",
35
30
  "require": "./build/types/index.cjs"
36
31
  }
@@ -1,41 +0,0 @@
1
- export class CuencaException extends Error {
2
- constructor(msg?: string);
3
- }
4
-
5
- export class CuencaResponseException extends CuencaException {
6
- readonly name: 'CuencaResponseError';
7
-
8
- data: unknown;
9
-
10
- status: number;
11
-
12
- constructor(data: unknown, status: number);
13
- }
14
-
15
- export class NoResultFound extends CuencaException {
16
- readonly name: 'NoResultFound';
17
-
18
- constructor();
19
- }
20
-
21
- export class MultipleResultsFound extends CuencaException {
22
- readonly name: 'MultipleResultsFound';
23
-
24
- constructor();
25
- }
26
-
27
- export class MalformedJwtToken extends CuencaException {
28
- readonly name: 'MalformedJwtToken';
29
-
30
- constructor();
31
- }
32
-
33
- export class InvalidPassword extends CuencaException {
34
- readonly name: 'InvalidPassword';
35
-
36
- constructor();
37
- }
38
-
39
- export class ValidationError extends Error {
40
- constructor(msg?: string);
41
- }
@@ -1,12 +0,0 @@
1
- export class Cuenca {
2
- constructor(opts?: {
3
- apiKey?: string;
4
- apiSecret?: string;
5
- language?: string;
6
- phase?: unknown;
7
- });
8
-
9
- client: unknown;
10
-
11
- withClient(client: unknown): void;
12
- }
@@ -1,98 +0,0 @@
1
- export class PageSize {
2
- maxSize: number;
3
-
4
- constructor(size?: number);
5
-
6
- get size(): number;
7
- }
8
-
9
- export class QueryParams {
10
- createdAfter?: unknown;
11
-
12
- createdBefore?: unknown;
13
-
14
- relatedTransaction?: unknown;
15
-
16
- userId?: unknown;
17
-
18
- count: boolean;
19
-
20
- pageSize?: PageSize;
21
-
22
- constructor(opts?: {
23
- createdAfter?: unknown;
24
- createdBefore?: unknown;
25
- limit?: number | null;
26
- pageSize?: PageSize;
27
- relatedTransaction?: unknown;
28
- userId?: unknown;
29
- count?: boolean;
30
- });
31
-
32
- get limit(): number | null;
33
-
34
- toObject(): Record<string, unknown>;
35
-
36
- toParams(): Record<string, unknown>;
37
-
38
- toQueryString(): string;
39
- }
40
-
41
- export class TransactionQuery extends QueryParams {
42
- status?: unknown;
43
-
44
- constructor(opts?: {
45
- status?: unknown;
46
- createdAfter?: unknown;
47
- createdBefore?: unknown;
48
- limit?: number | null;
49
- pageSize?: PageSize;
50
- relatedTransaction?: unknown;
51
- userId?: unknown;
52
- count?: boolean;
53
- });
54
- }
55
-
56
- export class TransferQuery extends TransactionQuery {
57
- accountNumber?: unknown;
58
-
59
- idempotencyKey?: unknown;
60
-
61
- trackingKey?: unknown;
62
-
63
- network?: unknown;
64
-
65
- constructor(opts?: {
66
- accountNumber?: unknown;
67
- idempotencyKey?: unknown;
68
- trackingKey?: unknown;
69
- network?: unknown;
70
- status?: unknown;
71
- createdAfter?: unknown;
72
- createdBefore?: unknown;
73
- limit?: number | null;
74
- pageSize?: PageSize;
75
- relatedTransaction?: unknown;
76
- userId?: unknown;
77
- count?: boolean;
78
- });
79
- }
80
-
81
- export class DepositQuery extends TransactionQuery {
82
- trackingKey?: unknown;
83
-
84
- network?: unknown;
85
-
86
- constructor(opts?: {
87
- trackingKey?: unknown;
88
- network?: unknown;
89
- status?: unknown;
90
- createdAfter?: unknown;
91
- createdBefore?: unknown;
92
- limit?: number | null;
93
- pageSize?: PageSize;
94
- relatedTransaction?: unknown;
95
- userId?: unknown;
96
- count?: boolean;
97
- });
98
- }