@cuenca-mx/cuenca-js 1.1.8-dev1 → 1.1.8-dev3
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/{data-6e06f557.cjs → data-06c55643.cjs} +0 -15
- package/build/{data-d38756fb.mjs → data-48673329.mjs} +1 -15
- package/build/index.cjs +5 -14
- package/build/index.mjs +5 -14
- package/build/requests/index.cjs +2 -2
- package/build/requests/index.mjs +3 -3
- package/build/types/index.cjs +2 -3
- package/build/types/index.mjs +2 -2
- package/build/umd/cuenca.umd.js +1 -1
- package/build/{vulnerableActivity-f0ac8658.mjs → vulnerableActivity-2dcc85a5.mjs} +1 -1
- package/build/{vulnerableActivity-8871af81.cjs → vulnerableActivity-dd2edc0a.cjs} +1 -1
- package/build/{walletTransactionRequest-8665538a.mjs → walletTransactionRequest-29003a99.mjs} +2 -4
- package/build/{walletTransactionRequest-7d91d9dc.cjs → walletTransactionRequest-4c4229bb.cjs} +2 -4
- package/package.json +1 -1
|
@@ -1189,20 +1189,6 @@ class SATRegimeCode {
|
|
|
1189
1189
|
}
|
|
1190
1190
|
}
|
|
1191
1191
|
|
|
1192
|
-
class FraudFundsTransferPaymentType {
|
|
1193
|
-
static Participante = new FraudFundsTransferPaymentType(7);
|
|
1194
|
-
|
|
1195
|
-
static DevolucionEspecialOrdenesAceptadasAcreditadas =
|
|
1196
|
-
new FraudFundsTransferPaymentType(23);
|
|
1197
|
-
|
|
1198
|
-
static DevolucionExtemporaneaEspecialOrdenesAcreditadas =
|
|
1199
|
-
new FraudFundsTransferPaymentType(24);
|
|
1200
|
-
|
|
1201
|
-
constructor(value) {
|
|
1202
|
-
this.value = value;
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
|
|
1206
1192
|
const dateToUTC = (date) => {
|
|
1207
1193
|
if (!date) return null;
|
|
1208
1194
|
const dateObj = new Date(date);
|
|
@@ -1228,7 +1214,6 @@ exports.Currency = Currency;
|
|
|
1228
1214
|
exports.DepositNetwork = DepositNetwork;
|
|
1229
1215
|
exports.EntryType = EntryType;
|
|
1230
1216
|
exports.FileFormat = FileFormat;
|
|
1231
|
-
exports.FraudFundsTransferPaymentType = FraudFundsTransferPaymentType;
|
|
1232
1217
|
exports.KYCFileType = KYCFileType;
|
|
1233
1218
|
exports.KYCValidationSource = KYCValidationSource;
|
|
1234
1219
|
exports.MLIndicatorLevel = MLIndicatorLevel;
|
|
@@ -1187,20 +1187,6 @@ class SATRegimeCode {
|
|
|
1187
1187
|
}
|
|
1188
1188
|
}
|
|
1189
1189
|
|
|
1190
|
-
class FraudFundsTransferPaymentType {
|
|
1191
|
-
static Participante = new FraudFundsTransferPaymentType(7);
|
|
1192
|
-
|
|
1193
|
-
static DevolucionEspecialOrdenesAceptadasAcreditadas =
|
|
1194
|
-
new FraudFundsTransferPaymentType(23);
|
|
1195
|
-
|
|
1196
|
-
static DevolucionExtemporaneaEspecialOrdenesAcreditadas =
|
|
1197
|
-
new FraudFundsTransferPaymentType(24);
|
|
1198
|
-
|
|
1199
|
-
constructor(value) {
|
|
1200
|
-
this.value = value;
|
|
1201
|
-
}
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
1190
|
const dateToUTC = (date) => {
|
|
1205
1191
|
if (!date) return null;
|
|
1206
1192
|
const dateObj = new Date(date);
|
|
@@ -1210,4 +1196,4 @@ const dateToUTC = (date) => {
|
|
|
1210
1196
|
const enumValueFromString = (enumValue, value) =>
|
|
1211
1197
|
Object.values(enumValue).find((enumV) => enumV.value === value);
|
|
1212
1198
|
|
|
1213
|
-
export { AlertStatus as A, BridgeAccountStatus as B, Currency as C, DepositNetwork as D, EntryType as E, FileFormat as F, KYCFileType as K, MLIndicatorLevel as M, Network as N, Phase as P, SourceAlertType as S, TransactionStatus as T, UserStatus as U, VerificationStatus as V, WalletTransactionType as W, MLIndicatorPeriod as a, MLIndicatorType as b, PLDFilterType as c, dateToUTC as d, enumValueFromString as e, BridgeBankAccountStatus as f, BridgeTransactionType as g, CardFundingType as h, CardIssuer as i, CardStatus as j, CardType as k, CardErrorType as l, CardTransactionType as m, CommissionType as n, KYCValidationSource as o, State as p, Country as q, SavingCategory as r, ServiceProviderCategory as s, SessionType as t, TransferNetwork as u, SATRegimeCode as v, VerificationType as w, TrackDataMethod as x, UserType as y
|
|
1199
|
+
export { AlertStatus as A, BridgeAccountStatus as B, Currency as C, DepositNetwork as D, EntryType as E, FileFormat as F, KYCFileType as K, MLIndicatorLevel as M, Network as N, Phase as P, SourceAlertType as S, TransactionStatus as T, UserStatus as U, VerificationStatus as V, WalletTransactionType as W, MLIndicatorPeriod as a, MLIndicatorType as b, PLDFilterType as c, dateToUTC as d, enumValueFromString as e, BridgeBankAccountStatus as f, BridgeTransactionType as g, CardFundingType as h, CardIssuer as i, CardStatus as j, CardType as k, CardErrorType as l, CardTransactionType as m, CommissionType as n, KYCValidationSource as o, State as p, Country as q, SavingCategory as r, ServiceProviderCategory as s, SessionType as t, TransferNetwork as u, SATRegimeCode as v, VerificationType as w, TrackDataMethod as x, UserType as y };
|
package/build/index.cjs
CHANGED
|
@@ -6,9 +6,9 @@ var axios = require('axios');
|
|
|
6
6
|
var Buffer = require('buffer');
|
|
7
7
|
var errors_index = require('./errors/index.cjs');
|
|
8
8
|
var jwt_index = require('./jwt/index.cjs');
|
|
9
|
-
var data = require('./data-
|
|
10
|
-
var vulnerableActivity = require('./vulnerableActivity-
|
|
11
|
-
var walletTransactionRequest = require('./walletTransactionRequest-
|
|
9
|
+
var data = require('./data-06c55643.cjs');
|
|
10
|
+
var vulnerableActivity = require('./vulnerableActivity-dd2edc0a.cjs');
|
|
11
|
+
var walletTransactionRequest = require('./walletTransactionRequest-4c4229bb.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.8-
|
|
29
|
+
const name="@cuenca-mx/cuenca-js";const version="1.1.8-dev3";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({
|
|
@@ -2500,15 +2500,7 @@ class FraudFundsTransferResource extends mix(Resource).with(Creatable) {
|
|
|
2500
2500
|
super('support/transfer_fraud_funds', Object, client);
|
|
2501
2501
|
}
|
|
2502
2502
|
|
|
2503
|
-
async create({
|
|
2504
|
-
userId,
|
|
2505
|
-
amount,
|
|
2506
|
-
concepto,
|
|
2507
|
-
clabe,
|
|
2508
|
-
reason,
|
|
2509
|
-
bankCode,
|
|
2510
|
-
tipoPago,
|
|
2511
|
-
}) {
|
|
2503
|
+
async create({ userId, amount, concepto, clabe, reason, bankCode }) {
|
|
2512
2504
|
const request = new walletTransactionRequest.FraudFundsTransferRequest({
|
|
2513
2505
|
userId,
|
|
2514
2506
|
amount,
|
|
@@ -2516,7 +2508,6 @@ class FraudFundsTransferResource extends mix(Resource).with(Creatable) {
|
|
|
2516
2508
|
clabe,
|
|
2517
2509
|
reason,
|
|
2518
2510
|
bankCode,
|
|
2519
|
-
tipoPago,
|
|
2520
2511
|
});
|
|
2521
2512
|
const fraudFundsTransfer = await this._create(request.toObject());
|
|
2522
2513
|
return fraudFundsTransfer;
|
package/build/index.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import axios from 'axios';
|
|
|
2
2
|
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
|
-
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 SATRegimeCode, w as VerificationType, W as WalletTransactionType } from './data-
|
|
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-
|
|
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 TransferUpdateRequest, h as UserCredentialRequest, i as UserCredentialUpdateRequest, j as UserLoginRequest, V as VerificationRequest, k as VerificationAttemptRequest, W as WalletTransactionRequest } from './walletTransactionRequest-
|
|
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 SATRegimeCode, w as VerificationType, W as WalletTransactionType } from './data-48673329.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-2dcc85a5.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 TransferUpdateRequest, h as UserCredentialRequest, i as UserCredentialUpdateRequest, j as UserLoginRequest, V as VerificationRequest, k as VerificationAttemptRequest, W as WalletTransactionRequest } from './walletTransactionRequest-29003a99.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.8-
|
|
20
|
+
const name="@cuenca-mx/cuenca-js";const version="1.1.8-dev3";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({
|
|
@@ -2491,15 +2491,7 @@ class FraudFundsTransferResource extends mix(Resource).with(Creatable) {
|
|
|
2491
2491
|
super('support/transfer_fraud_funds', Object, client);
|
|
2492
2492
|
}
|
|
2493
2493
|
|
|
2494
|
-
async create({
|
|
2495
|
-
userId,
|
|
2496
|
-
amount,
|
|
2497
|
-
concepto,
|
|
2498
|
-
clabe,
|
|
2499
|
-
reason,
|
|
2500
|
-
bankCode,
|
|
2501
|
-
tipoPago,
|
|
2502
|
-
}) {
|
|
2494
|
+
async create({ userId, amount, concepto, clabe, reason, bankCode }) {
|
|
2503
2495
|
const request = new FraudFundsTransferRequest({
|
|
2504
2496
|
userId,
|
|
2505
2497
|
amount,
|
|
@@ -2507,7 +2499,6 @@ class FraudFundsTransferResource extends mix(Resource).with(Creatable) {
|
|
|
2507
2499
|
clabe,
|
|
2508
2500
|
reason,
|
|
2509
2501
|
bankCode,
|
|
2510
|
-
tipoPago,
|
|
2511
2502
|
});
|
|
2512
2503
|
const fraudFundsTransfer = await this._create(request.toObject());
|
|
2513
2504
|
return fraudFundsTransfer;
|
package/build/requests/index.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var walletTransactionRequest = require('../walletTransactionRequest-
|
|
5
|
+
var walletTransactionRequest = require('../walletTransactionRequest-4c4229bb.cjs');
|
|
6
6
|
require('../errors/index.cjs');
|
|
7
|
-
require('../data-
|
|
7
|
+
require('../data-06c55643.cjs');
|
|
8
8
|
|
|
9
9
|
class UploadRequest extends walletTransactionRequest.BaseRequest {
|
|
10
10
|
constructor({ isBack = false, file, extension, type, userId = 'me' }) {
|
package/build/requests/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as BaseRequest } from '../walletTransactionRequest-
|
|
2
|
-
export { l 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 TransferUpdateRequest, h as UserCredentialRequest, i as UserCredentialUpdateRequest, j as UserLoginRequest, U as UserUpdateRequest, k as VerificationAttemptRequest, V as VerificationRequest, W as WalletTransactionRequest } from '../walletTransactionRequest-
|
|
1
|
+
import { B as BaseRequest } from '../walletTransactionRequest-29003a99.mjs';
|
|
2
|
+
export { l 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 TransferUpdateRequest, h as UserCredentialRequest, i as UserCredentialUpdateRequest, j as UserLoginRequest, U as UserUpdateRequest, k as VerificationAttemptRequest, V as VerificationRequest, W as WalletTransactionRequest } from '../walletTransactionRequest-29003a99.mjs';
|
|
3
3
|
import '../errors/index.mjs';
|
|
4
|
-
import '../data-
|
|
4
|
+
import '../data-48673329.mjs';
|
|
5
5
|
|
|
6
6
|
class UploadRequest extends BaseRequest {
|
|
7
7
|
constructor({ isBack = false, file, extension, type, userId = 'me' }) {
|
package/build/types/index.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var data = require('../data-
|
|
6
|
-
var vulnerableActivity = require('../vulnerableActivity-
|
|
5
|
+
var data = require('../data-06c55643.cjs');
|
|
6
|
+
var vulnerableActivity = require('../vulnerableActivity-dd2edc0a.cjs');
|
|
7
7
|
require('../errors/index.cjs');
|
|
8
8
|
|
|
9
9
|
class PageSize {
|
|
@@ -54,7 +54,6 @@ exports.Currency = data.Currency;
|
|
|
54
54
|
exports.DepositNetwork = data.DepositNetwork;
|
|
55
55
|
exports.EntryType = data.EntryType;
|
|
56
56
|
exports.FileFormat = data.FileFormat;
|
|
57
|
-
exports.FraudFundsTransferPaymentType = data.FraudFundsTransferPaymentType;
|
|
58
57
|
exports.KYCFileType = data.KYCFileType;
|
|
59
58
|
exports.KYCValidationSource = data.KYCValidationSource;
|
|
60
59
|
exports.MLIndicatorLevel = data.MLIndicatorLevel;
|
package/build/types/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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,
|
|
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-
|
|
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, v as SATRegimeCode, r as SavingCategory, s as ServiceProviderCategory, t as SessionType, S as SourceAlertType, p as State, x as TrackDataMethod, T as TransactionStatus, u as TransferNetwork, U as UserStatus, y as UserType, V as VerificationStatus, w as VerificationType, W as WalletTransactionType } from '../data-48673329.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-2dcc85a5.mjs';
|
|
3
3
|
import '../errors/index.mjs';
|
|
4
4
|
|
|
5
5
|
class PageSize {
|
package/build/umd/cuenca.umd.js
CHANGED
|
@@ -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 g{static Succeeded=new g("succeeded");static NotValidated=new g("not_validated");static Failed=new g("failed");static OnWaitList=new g("on_wait_list");constructor(t){this.value=t}}class y{static Created=new y("created");static Failed=new y("failed");static Pending=new y("pending");static Succeeded=new y("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 C{static Physical=new C("physical");static Virtual=new C("virtual");constructor(t){this.value=t}}class T{static CardRequest=new T("card_request");static CashDeposit=new T("cash_deposit");static OutgoingSpei=new T("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 R{static Curp=new R("curp");static Dni=new R("dni");static Ine=new R("ine");static Passport=new R("passport");static Residency=new R("residency");static MatriculaConsular=new R("matricula_consular");static ProofOfLiveness=new R("proof_of_liveness");static ProofOfAddress=new R("proof_of_address");constructor(t){this.value=t}}class P{static Client=new P("client");static Server=new P("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 U{static Deposit=new U("deposit");static Withdrawal=new U("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 E{static Sandbox=new E("sandbox-api");static Stage=new E("stage-api");static Api=new E("api");constructor(t){this.value=t}}class q{static Amount=new q("amount");static Volume=new q("volume");constructor(t){this.value=t}}class G{static AW=new G("AW");static AF=new G("AF");static AO=new G("AO");static AI=new G("AI");static AX=new G("AX");static AL=new G("AL");static AD=new G("AD");static AE=new G("AE");static AR=new G("AR");static AM=new G("AM");static AS=new G("AS");static AQ=new G("AQ");static TF=new G("TF");static AG=new G("AG");static AU=new G("AU");static AT=new G("AT");static AZ=new G("AZ");static BI=new G("BI");static BE=new G("BE");static BJ=new G("BJ");static BQ=new G("BQ");static BF=new G("BF");static BD=new G("BD");static BG=new G("BG");static BH=new G("BH");static BS=new G("BS");static BA=new G("BA");static BL=new G("BL");static BY=new G("BY");static BZ=new G("BZ");static BM=new G("BM");static BO=new G("BO");static BR=new G("BR");static BB=new G("BB");static BN=new G("BN");static BT=new G("BT");static BV=new G("BV");static BW=new G("BW");static CF=new G("CF");static CA=new G("CA");static CC=new G("CC");static CH=new G("CH");static CL=new G("CL");static CN=new G("CN");static CI=new G("CI");static CM=new G("CM");static CD=new G("CD");static CG=new G("CG");static CK=new G("CK");static CO=new G("CO");static KM=new G("KM");static CV=new G("CV");static CR=new G("CR");static CU=new G("CU");static CW=new G("CW");static CX=new G("CX");static KY=new G("KY");static CY=new G("CY");static CZ=new G("CZ");static DE=new G("DE");static DJ=new G("DJ");static DM=new G("DM");static DK=new G("DK");static DO=new G("DO");static DZ=new G("DZ");static EC=new G("EC");static EG=new G("EG");static ER=new G("ER");static EH=new G("EH");static ES=new G("ES");static EE=new G("EE");static ET=new G("ET");static FI=new G("FI");static FJ=new G("FJ");static FK=new G("FK");static FR=new G("FR");static FO=new G("FO");static FM=new G("FM");static GA=new G("GA");static GB=new G("GB");static GE=new G("GE");static GG=new G("GG");static GH=new G("GH");static GI=new G("GI");static GN=new G("GN");static GP=new G("GP");static GM=new G("GM");static GW=new G("GW");static GQ=new G("GQ");static GR=new G("GR");static GD=new G("GD");static GL=new G("GL");static GT=new G("GT");static GF=new G("GF");static GU=new G("GU");static GY=new G("GY");static HK=new G("HK");static HM=new G("HM");static HN=new G("HN");static HR=new G("HR");static HT=new G("HT");static HU=new G("HU");static ID=new G("ID");static IM=new G("IM");static IN=new G("IN");static IO=new G("IO");static IE=new G("IE");static IR=new G("IR");static IQ=new G("IQ");static IS=new G("IS");static IL=new G("IL");static IT=new G("IT");static JM=new G("JM");static JE=new G("JE");static JO=new G("JO");static JP=new G("JP");static KZ=new G("KZ");static KE=new G("KE");static KG=new G("KG");static KH=new G("KH");static KI=new G("KI");static KN=new G("KN");static KR=new G("KR");static KW=new G("KW");static LA=new G("LA");static LB=new G("LB");static LC=new G("LC");static LI=new G("LI");static LK=new G("LK");static LR=new G("LR");static LS=new G("LS");static LT=new G("LT");static LU=new G("LU");static LV=new G("LV");static LY=new G("LY");static MA=new G("MA");static MC=new G("MC");static MD=new G("MD");static MG=new G("MG");static MV=new G("MV");static MX=new G("MX");static MH=new G("MH");static MK=new G("MK");static ML=new G("ML");static MT=new G("MT");static MM=new G("MM");static ME=new G("ME");static MN=new G("MN");static MP=new G("MP");static MZ=new G("MZ");static MR=new G("MR");static MS=new G("MS");static MQ=new G("MQ");static MU=new G("MU");static MW=new G("MW");static MY=new G("MY");static YT=new G("YT");static NA=new G("NA");static NC=new G("NC");static NE=new G("NE");static NF=new G("NF");static NG=new G("NG");static NI=new G("NI");static NU=new G("NU");static NL=new G("NL");static NO=new G("NO");static NP=new G("NP");static NR=new G("NR");static NZ=new G("NZ");static OM=new G("OM");static PK=new G("PK");static PA=new G("PA");static PN=new G("PN");static PE=new G("PE");static PH=new G("PH");static PW=new G("PW");static PG=new G("PG");static PL=new G("PL");static PR=new G("PR");static KP=new G("KP");static PT=new G("PT");static PY=new G("PY");static PS=new G("PS");static PF=new G("PF");static QA=new G("QA");static RE=new G("RE");static RO=new G("RO");static RU=new G("RU");static RW=new G("RW");static SA=new G("SA");static SD=new G("SD");static SN=new G("SN");static SG=new G("SG");static GS=new G("GS");static SH=new G("SH");static SJ=new G("SJ");static SB=new G("SB");static SL=new G("SL");static SV=new G("SV");static SM=new G("SM");static SO=new G("SO");static PM=new G("PM");static RS=new G("RS");static SS=new G("SS");static ST=new G("ST");static SR=new G("SR");static SK=new G("SK");static SI=new G("SI");static SE=new G("SE");static SZ=new G("SZ");static SX=new G("SX");static SC=new G("SC");static SY=new G("SY");static TC=new G("TC");static TD=new G("TD");static TG=new G("TG");static TH=new G("TH");static TJ=new G("TJ");static TK=new G("TK");static TM=new G("TM");static TL=new G("TL");static TO=new G("TO");static TT=new G("TT");static TN=new G("TN");static TR=new G("TR");static TV=new G("TV");static TW=new G("TW");static TZ=new G("TZ");static UG=new G("UG");static UA=new G("UA");static UM=new G("UM");static UY=new G("UY");static US=new G("US");static UZ=new G("UZ");static VA=new G("VA");static VC=new G("VC");static VE=new G("VE");static VG=new G("VG");static VI=new G("VI");static VN=new G("VN");static VU=new G("VU");static WF=new G("WF");static WS=new G("WS");static YE=new G("YE");static ZA=new G("ZA");static ZM=new G("ZM");static ZW=new G("ZW");static XA=new G("XA");constructor(t){this.value=t}}class K{static NE=new K("NE");static AS=new K("AS");static BC=new K("BC");static BS=new K("BS");static CC=new K("CC");static CS=new K("CS");static CH=new K("CH");static CL=new K("CL");static CM=new K("CM");static DF=new K("DF");static DG=new K("DG");static GT=new K("GT");static GR=new K("GR");static HG=new K("HG");static JC=new K("JC");static MC=new K("MC");static MN=new K("MN");static MS=new K("MS");static NT=new K("NT");static NL=new K("NL");static OC=new K("OC");static PL=new K("PL");static QT=new K("QT");static QR=new K("QR");static SP=new K("SP");static SL=new K("SL");static SR=new K("SR");static TC=new K("TC");static TL=new K("TL");static TS=new K("TS");static VZ=new K("VZ");static YN=new K("YN");static ZS=new K("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{static GRL_PM=new et("601","General de Ley Personas Morales");static PM_FN=new et("603","Personas Morales con Fines no Lucrativos");static SAL_IS=new et("605","Sueldos y Salarios e Ingresos Asimilados a Salarios");static ARR=new et("606","Arrendamiento");static ENAJ_ADQ=new et("607","Régimen de Enajenación o Adquisición de Bienes");static DEM_ING=new et("608","Demás ingresos");static CONS=new et("609","Consolidación");static RES_EXT=new et("610","Residentes en el Extranjero sin Establecimiento Permanente");static DIV=new et("611","Ingresos por Dividendos (socios y accionistas)");static PF_AEP=new et("612","Personas Físicas con Actividades Empresariales y Profesionales");static INT=new et("614","Ingresos por intereses");static ING_PREM=new et("615","Régimen de los ingresos por obtención de premios");static SIN_OBL=new et("616","Sin obligaciones fiscales");static SCP_DIF=new et("620","Sociedades Cooperativas de Producción que optan por diferir");static INC_FISC=new et("621","Incorporación Fiscal");static AGRO_GAN_SILV_PES=new et("622","Actividades Agrícolas, Ganaderas, Silvícolas y Pesqueras");static OP_GRUPO_SOC=new et("623","Opcional para Grupos de Sociedades");static COOR=new et("624","Coordinados");static AE_PLAT_TEC=new et("625","Régimen de las Actividades Empresariales con ingresos a través de Plataformas Tecnológicas");static RS_CONF=new et("626","Régimen Simplificado de Confianza");static HID=new et("628","Hidrocarburos");static PREF_EM_MULT=new et("629","De los Regímenes Fiscales Preferentes y de las Empresas Multinacionales");static ENAJ_ACC_BOL=new et("630","Enajenación de acciones en bolsa de valores");constructor(t,e){this.value=t,this.name=e}}class st{static Participante=new st(7);static DevolucionEspecialOrdenesAceptadasAcreditadas=new st(23);static DevolucionExtemporaneaEspecialOrdenesAcreditadas=new st(24);constructor(t){this.value=t}}class it{constructor({createdAfter:t,createdBefore:e,ids:s,limit:i,pageSize:a,relatedTransaction:r,userId:n,count:c=!1}){this.createdAfter=t,this.createdBefore=e,this.ids=s,this._lmt=i,this.relatedTransaction=r,this.userId=n,this.count=c,this.pageSize=a}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,ids:this.ids,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(){const t=new URLSearchParams;return Object.entries(this.toParams()).forEach((([e,s])=>{Array.isArray(s)?t.append(e,s.join(",")):t.append(e,s)})),t.toString()}}class at extends it{constructor({accountNumber:t,...e}){super(e),this.accountNumber=t}toObject(){return Object.assign(super.toObject(),{account_number:this.accountNumber})}}class rt extends it{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 nt extends it{constructor({active:t,...e}){super(e),this.active=t}toObject(){return Object.assign(super.toObject(),{active:this.active})}}class ct extends it{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 ot extends it{constructor({accountNumber:t,...e}){super(e),this.accountNumber=t}toObject(){return Object.assign(super.toObject(),{account_number:this.accountNumber})}}class dt extends it{constructor({emailAddress:t,...e}){super(e),this.emailAddress=t}toObject(){return Object.assign(super.toObject(),{email_address:this.emailAddress})}}class ut extends it{constructor({accountId:t,...e}){super(e),this.accountId=t}toObject(){return Object.assign(super.toObject(),{account_id:this.accountId})}}class ht extends it{constructor({accountId:t,...e}){super(e),this.accountId=t}toObject(){return Object.assign(super.toObject(),{account:this.accountId})}}class lt extends ht{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 pt extends it{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 mt extends it{constructor({cardUri:t,...e}){super(e),this.cardUri=t}toObject(){return Object.assign(super.toObject(),{card_uri:this.cardUri})}}class wt extends it{constructor({status:t,...e}){super(e),this.status=t}toObject(){return Object.assign(super.toObject(),{status:this.status})}}class _t extends wt{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 ft extends it{constructor({emailAddress:t,...e}){super(e),this.emailAddress=t}toObject(){return Object.assign(super.toObject(),{email_address:this.emailAddress})}}class bt extends it{constructor({postalCode:t,...e}){super(e),this.postalCode=t}toObject(){return Object.assign(super.toObject(),{postal_code:this.postalCode})}}class gt extends it{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 wt{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 vt extends it{constructor({clabe:t,curp:e,emailAddress:s,hasCurpDocument:i,isBlocked:a,name:r,phoneNumber:n,status:c,...o}={}){super(o),this.clabe=t,this.curp=e,this.emailAddress=s,this.hasCurpDocument=i,this.isBlocked=a,this.name=r,this.phoneNumber=n,this.status=c}toObject(){return Object.assign(super.toObject(),{clabe:this.clabe,curp:this.curp,email_address:this.emailAddress,has_curp_document:this.hasCurpDocument,is_blocked:this.isBlocked,name:this.name,phone_number:this.phoneNumber,status:this.status})}}class At extends it{constructor({active:t,...e}){super(e),this.active=t}toObject(){return Object.assign(super.toObject(),{active:this.active})}}class Ot extends it{constructor({walletUri:t,...e}){super(e),this.walletUri=t}toObject(){return Object.assign(super.toObject(),{wallet_uri:this.walletUri})}}const jt=t=>{if(!t)return null;const e=new Date(t);return new Date(e.getTime())},It=(t,e)=>Object.values(t).find((t=>t.value===e));class St{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=jt(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 St({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 xt{constructor({agent:t,createdAt:e,status:s,updatedAt:i,comments:a}){this.agent=t,this.comments=a,this.createdAt=jt(e),this.updatedAt=jt(i),this.status=It(b,s)}static fromObject=({agent:t,comments:e,status:s,...i})=>new xt({agent:t,comments:e,status:s,createdAt:i.created_at,updatedAt:i.updated_at})}class Ct{constructor({hasAudit:t,auditProvider:e,auditDate:s,auditComments:i}){this.hasAudit=t,this.auditProvider=e,this.auditDate=jt(s),this.auditComments=i}static fromObject=({...t})=>new Ct({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 Nt{constructor({bank:t,account:e}){this.bank=t,this.account=e}static fromObject=({account:t,bank:e})=>new Nt({bank:e,account:t})}class kt{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 kt({code:t,error:e,identifier:s,message:i})}class Dt{constructor({data:t,errors:e,isMx:s,status:i,type:a,uriBack:r,uriFront:n}){this.data=t,this.isMx=s,this.status=It(X,i),this.type=It(R,a),this.uriBack=r,this.uriFront=n,e&&e.length>0&&(this.errors=e.map((t=>kt.fromObject(t))))}static fromObject=({data:t,errors:e,status:s,type:i,...a})=>new Dt({data:t,errors:e,status:s,type:i,isMx:a.is_mx,uriBack:a.uri_back,uriFront:a.uri_front})}class Rt{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?jt(i):null}static fromObject=({...t}={})=>new Rt({licenseRequired:t.license_required,supervisoryEntity:t.supervisory_entity,licenseType:t.license_type,licenseDate:t.license_date})}class Pt{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 Pt({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 Mt extends Pt{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=St.fromObject(t))}static fromObject=({job:t,address:e,...s})=>new Mt({address:e,job:t,phoneNumber:s.phone_number,emailAddress:s.email_address,...Pt.fromObject(s)})}class Ut extends Pt{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 Ut({percentage:t,shareCapital:e.share_capital,...Pt.fromObject(e)})}class Bt{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=>Ut.fromObject(t))))}get legalRepresentatives(){return this._legalRepresentatives}set legalRepresentatives(t){t&&(this._legalRepresentatives=t.map((t=>Mt.fromObject(t))))}static fromObject=({name:t,percentage:e,shareholders:s,...i})=>new Bt({name:t,percentage:e,shareholders:s||[],legalRepresentatives:i.legal_representatives||[]})}class Lt{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 Lt({speiTransfersNum:t.spei_transfers_num,speiTransfersAmount:t.spei_transfers_amount,internalTransfersNum:t.internal_transfers_num,internalTransfersAmount:t.internal_transfers_amount})}class Et{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 Et({ip:t,location:e,type:s,version:i})}class qt{constructor({isVulnerableActivity:t,hasSatRegister:e,satRegisteredDate:s,isInCompliance:i}){this.isVulnerableActivity=t,this.hasSatRegister=e,this.satRegisteredDate=jt(s),this.isInCompliance=i}static fromObject=({...t})=>new qt({isVulnerableActivity:t.is_vulnerable_activity,hasSatRegister:t.has_sat_register,satRegisteredDate:t.sat_registered_date,isInCompliance:t.is_in_compliance})}var Gt="1.1.8-dev1";class Kt{constructor({apiKey:t,apiSecret:e,language:s="en",phase:i=E.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:s.value}),this.authHeader&&(o.Authorization=this.authHeader),_?o["User-Agent"]=`cuenca-js/${Gt}`:w&&(o["X-User-Agent"]=`cuenca-js/${Gt}`),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 Ft{constructor({accountNumber:t,createdAt:e,id:s,institutionName:i,name:a,userId:r}){this.accountNumber=t,this.createdAt=jt(e),this.id=s,this.institutionName=i,this.name=a,this.userId=r}static fromObject=({id:t,name:e,...s})=>new Ft({id:t,name:e,accountNumber:s.account_number,createdAt:s.created_at,institutionName:s.institution_name,userId:s.user_id})}class Vt{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:g,sourceType:y,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=jt(c),this.createdAt=jt(o),this.questionnaireId=d,this.description=u,this.hasQuestionnaire=h,this.id=l,this.institutionName=p,this.level=It(M,m),this.name=w,this.period=It(B,_),this.periodNumber=f,this.status=It(b,g),this.sourceType=It(Y,y),this.transactionDate=jt(v),this.type=It(U,A),this.typeOfFilter=It(q,O),this.updatedAt=jt(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 Vt({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=>xt.fromObject(t))))}}class Ht{constructor({createdAt:t,deactivatedAt:e,id:s,secret:i,userId:a,updatedAt:r}){this.createdAt=jt(t),this.deactivatedAt=jt(e),this.id=s,this.secret=i,this.userId=a,this.updatedAt=jt(r)}static fromObject=({id:t,secret:e,...s})=>new Ht({id:t,secret:e,createdAt:s.created_at,deactivatedAt:s.deactivated_at,userId:s.user_id,updatedAt:s.updated_at});get isActive(){const t=jt(Date.now());return!this.deactivatedAt||this.deactivatedAt.getTime()>t.getTime()}}class Yt{constructor({arpc:t,createdAt:e,cardUri:s,isValidArqc:i}){this.arpc=t,this.createdAt=jt(e),this.cardUri=s,this.isValidArqc=i}static fromObject=({arpc:t,...e})=>new Yt({arpc:t,createdAt:e.created_at,cardUri:e.card_uri,isValidArqc:e.is_valid_arqc})}class $t{constructor({amount:t,createdAt:e,descriptor:s,entryType:i,fundingInstrumentUri:a,id:r,name:n,relatedTransactionUri:c,rollingBalance:o}){this.amount=t,this.createdAt=jt(e),this.descriptor=s,this.entryType=It(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 $t({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 Wt{constructor({amount:t,createdAt:e,descriptor:s,status:i,userId:a}){this.amount=t,this.createdAt=jt(e),this.descriptor=s,this.status=It(W,i),this.userId=a}}class Zt extends Wt{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 Zt({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 Qt{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:y}){this.id=t,this.createdAt=jt(e),this.updatedAt=jt(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=It(g,f),this.termsOfService=b,this.address=y}static fromObject=({status:t,address:e,...s})=>new Qt({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=St.fromObject(t))}get proofOfAddress(){return this._proofOfAddress}set proofOfAddress(t){t&&0!==Object.keys(t).length&&(this._proofOfAddress=Dt.fromObject(t))}get govtId(){return this._govtId}set govtId(t){t&&0!==Object.keys(t).length&&(this._govtId=Dt.fromObject(t))}get termsOfService(){return this._termsOfService}set termsOfService(t){t&&0!==Object.keys(t).length&&(this._termsOfService=Et.fromObject(t))}}class Jt{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=jt(e),this.curp=s,this.error=i,this.firstName=a,this.id=r,this.names=n,this.rfc=c,this.secondSurname=o,this.status=It(y,d)}static fromObject=({clabe:t,curp:e,error:s,id:i,names:a,rfc:r,status:n,...c})=>new Jt({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 Xt{constructor({account:t,clabe:e,currency:s,id:i,network:a,platformId:r}){this.account=t,this.clabe=e,this.currency=It(x,s),this.id=i,this.network=It(L,a),this.platformId=r}static fromObject=({clabe:t,currency:e,id:s,network:i,...a})=>new Xt({clabe:t,currency:e,id:s,network:i,account:a.account_uri.split("/")[2],platformId:a.platform_id})}class zt{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:g,signature:y,trackingLink:v,fromCurrency:A,toCurrency:O,fromAmount:I,toAmount:S}){this.id=t,this.createdAt=jt(e),this.platformId=s,this.type=It(j,i),this.status=It(W,a),this.accountUri=r,this.quoteUri=n,this.currency=It(x,c),this.network=It(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=g,this.signature=y,this.trackingLink=v,this.fromCurrency=It(x,A),this.toCurrency=It(x,O),this.fromAmount=I,this.toAmount=S}static fromObject=({type:t,status:e,currency:s,network:i,concepto:a,signature:r,...n})=>new zt({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 te{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=jt(t),this.cvv2=e,this.expMonth=s,this.expYear=i,this.fundingType=It(A,a),this.id=r,this.issuer=It(O,n),this.number=c,this.pin=o,this.status=It(I,d),this.type=It(C,u),this.updatedAt=jt(h),this.userId=l}static fromObject=({cvv2:t,id:e,issuer:s,number:i,pin:a,status:r,type:n,...c})=>new te({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 ee{constructor({cardUri:t,createdAt:e,id:s,ipAddress:i,success:a,userId:r}){this.cardUri=t,this.createdAt=jt(e),this.id=s,this.ipAddress=i,this.success=a,this.userId=r}static fromObject=({id:t,success:e,...s})=>new ee({id:t,success:e,cardUri:s.card_uri,createdAt:s.created_at,ipAddress:s.ip_address,userId:s.user_id})}class se extends Wt{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=It(v,e),this.cardLastFour=s,this.cardType=It(C,i),this.cardUri=a,this.metadata=c,this.network=o,this.relatedCardTransactionsUris=d,this.type=It(S,h)}static fromObject=({amount:t,descriptor:e,metadata:s,network:i,status:a,type:r,...n})=>new se({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 ie{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=It(I,t),this.cardType=It(C,e),this.cardUri=s,this.createdAt=jt(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 ie({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 ae extends Wt{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=It(T,r)}static fromObject=({amount:t,descriptor:e,status:s,type:i,...a})=>new ae({amount:t,descriptor:e,status:s,type:i,createdAt:a.created_at,relatedTransactionUri:a.related_transaction_uri,userId:a.user_id})}class re extends Wt{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=It(N,a),this.sourceUri=n,this.trackingKey=c}static fromObject=({amount:t,descriptor:e,id:s,network:i,status:a,...r})=>new re({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 ne{constructor({extension:t,type:e,url:s,userId:i}){this.extension=t,this.type=It(R,e),this.url=s,this.userId=i}static fromObject=({extension:t,type:e,url:s,...i})=>new ne({extension:t,type:e,url:s,userId:i.user_id})}class ce{constructor({transactionId:t,amount:e,claveRastreo:s}){this.transactionId=t,this.amount=e,this.claveRastreo=s}static fromObject=({amount:t,...e})=>new ce({transactionId:e.transaction_id,amount:t,claveRastreo:e.clave_rastreo})}class oe{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=jt(e),this.updatedAt=jt(s),this.deactivatedAt=jt(i),this.platformId=a,this.filesUri=r||[],this.userId=n,this.verificationId=c,this.identityId=o,this.govtIdStatus=It(X,d),this.proofOfAddressStatus=It(X,u),this.proofOfLifeStatus=It(X,h),this.sourceType=It(P,l),this.flowId=p,this.status=It(X,m),this.providerUrl=w}static fromObject=({id:t,status:e,...s})=>new oe({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 de{constructor({id:t}){this.id=t}static fromObject=({id:t})=>new de({id:t})}class ue{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=Lt.fromObject(t))}get withdrawal(){return this._withdrawal}set withdrawal(t){t&&(this._withdrawal=Lt.fromObject(t))}static fromObject=({currency:t,deposits:e,withdrawal:s,...i})=>new ue({currency:t,deposits:e,withdrawal:s,payersNum:i.payers_num,recipientsNum:i.recipients_num,monthlyAmount:i.monthly_amount})}class he{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=jt(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=It(Q,h),this.updatedAt=jt(p),this.userType=m}get address(){return this._address}set address(t){t&&(this._address=St.fromObject(t))}static fromObject=({address:t,clabe:e,id:s,level:i,nationality:a,rfc:r,status:n,...c})=>new he({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 le extends he{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:g,platformId:y,requiredLevel:v,rfc:A,shareholders:O,status:j,transactionalProfile:I,updatedAt:S,userId:x,userType:C,vulnerableActivity:T,webSite:N}){super({address:t,clabe:r,emailAddress:o,rfc:A,id:h,level:w,meta:f,nationality:b,platformId:y,phoneNumber:g,requiredLevel:v,status:j,createdAt:n,updatedAt:S,userType:C}),this.audit=e,this.businessModel=i,this.businessName=a,this.businessDetails=s,this.documentationUrl=c,this.incorporationDate=jt(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=T,this.webSite=N}get shareholders(){return this._shareholders}set shareholders(t){t&&(this._shareholders=t.map((t=>Bt.fromObject(t))))}get legalRepresentatives(){return this._legalRepresentatives}set legalRepresentatives(t){t&&(this._legalRepresentatives=t.map((t=>Mt.fromObject(t))))}get externalAccount(){return this._externalAccount}set externalAccount(t){t&&(this._externalAccount=Nt.fromObject(t))}get vulnerableActivity(){return this._vulnerableActivity}set vulnerableActivity(t){t&&(this._vulnerableActivity=qt.fromObject(t))}get audit(){return this._audit}set audit(t){t&&(this._audit=Ct.fromObject(t))}get license(){return this._license}set license(t){t&&(this._license=Rt.fromObject(t))}get transactionalProfile(){return this._transactionalProfile}set transactionalProfile(t){t&&(this._transactionalProfile=ue.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 le({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 pe{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=It(K,a),this.country=It(G,r),this.createdAt=jt(n),this.updatedAt=jt(c)}static fromObject=({id:t,colonia:e,city:s,state:i,country:a,...r})=>new pe({id:t,colonia:e,city:s,state:i,country:a,postalCode:r.postal_code,createdAt:r.created_at,updatedAt:r.updated_at})}class me{constructor({balance:t,createdAt:e,deactivatedAt:s,id:i,userId:a,updatedAt:r}){this.balance=t,this.createdAt=jt(e),this.deactivatedAt=jt(s),this.id=i,this.userId=a,this.updatedAt=jt(r)}}class we extends me{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=It(V,e),this.goalAmount=a,this.goalDate=jt(r),this.name=c}static fromObject=({balance:t,category:e,id:s,name:i,...a})=>new we({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 _e{constructor({categories:t,id:e,name:s,providerKey:i}){var a;this.categories=null==(a=t)?[]:a.map((t=>It(F,t))),this.id=e,this.name=s,this.providerKey=i}static fromObject=({categories:t,id:e,name:s,...i})=>new _e({categories:t,id:e,name:s,providerKey:i.provider_key})}class fe{constructor({createdAt:t,expiresAt:e,failureUrl:s,id:i,platformId:a,successUrl:r,type:n,userId:c}){this.createdAt=jt(t),this.expiresAt=jt(e),this.failureUrl=s,this.id=i,this.platformId=a,this.successUrl=r,this.type=It(H,n),this.userId=c}static fromObject=({id:t,type:e,...s})=>new fe({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 be{constructor({createdAt:t,id:e,month:s,year:i}){this.createdAt=jt(t),this.id=e,this.month=s,this.year=i}static fromObject=({id:t,month:e,year:s,...i})=>new be({id:t,month:e,year:s,createdAt:i.created_at})}class ge extends Wt{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=It(Z,c),this.recipientName=o,this.trackingKey=u,this.updatedAt=jt(h)}static fromObject=({amount:t,descriptor:e,id:s,network:i,status:a,...r})=>new ge({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:g,phoneNumber:y,proofOfAddress:v,proofOfLife:A,requiredLevel:O,rfc:j,secondSurname:I,stateOfBirth:S,status:x,termsOfService:C,updatedAt:T,userTosAgreementsId:N,userType:k,verificationId:D,fiscalRegimeCode:R}){this.address=t,this.blacklistValidationStatus=It(X,e),this.clabe=s,this.countryOfBirth=i,this.createdAt=jt(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=g,this.phoneNumber=y,this.govtId=h,this.proofOfAddress=v,this.proofOfLife=A,this.requiredLevel=O,this.rfc=j,this.secondSurname=I,this.stateOfBirth=S,this.status=It(Q,x),this.termsOfService=C,this.updatedAt=jt(T),this.userTosAgreementsId=N,this.userType=k,this.verificationId=D,this.fiscalRegimeCode=It(et,R)}get address(){return this._address}set address(t){t&&(this._address=St.fromObject(t))}get proofOfAddress(){return this._proofOfAddress}set proofOfAddress(t){t&&(this._proofOfAddress=Dt.fromObject(t))}get proofOfLife(){return this._proofOfLife}set proofOfLife(t){t&&(this._proofOfLife=Dt.fromObject(t))}get govtId(){return this._govtId}set govtId(t){t&&(this._govtId=Dt.fromObject(t))}get termsOfService(){return this._termsOfService}set termsOfService(t){t&&(this._termsOfService=Et.fromObject(t))}get curpDocument(){return this._curpDocument}set curpDocument(t){t&&(this._curpDocument=Dt.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,fiscalRegimeCode:u.fiscal_regime_code})}class ve{constructor({createdAt:t,id:e,isActive:s,updatedAt:i}){this.createdAt=jt(t),this.id=e,this.isActive=s,this.updatedAt=jt(i)}static fromObject=({id:t,...e})=>new ve({id:t,createdAt:e.created_at,isActive:e.is_active,updatedAt:e.updated_at})}class Ae{constructor({id:t,lastLoginAt:e,success:s}){this.id=t,this.lastLoginAt=jt(e),this.success=s}static fromObject=({id:t,success:e,...s})=>new Ae({id:t,success:e,lastLoginAt:s.last_login_at})}class Oe{constructor({createdAt:t,id:e,ip:s,location:i,type:a,updatedAt:r,version:n}){this.createdAt=jt(t),this.id=e,this.ip=s,this.location=i,this.type=a,this.updatedAt=jt(r),this.version=n}static fromObject=({id:t,ip:e,location:s,type:i,version:a,...r})=>new Oe({id:t,ip:e,location:s,type:i,version:a,createdAt:r.created_at,updatedAt:r.updated_at})}class je{constructor({createdAt:t,id:e,platformId:s,recipient:i,type:a,updatedAt:r}){this.createdAt=jt(t),this.id=e,this.platformId=s,this.recipient=i,this.type=It(z,a),this.updatedAt=jt(r)}static fromObject=({id:t,recipient:e,type:s,...i})=>new je({id:t,recipient:e,type:s,createdAt:i.created_at,platformId:i.platform_id,updatedAt:i.updated_at})}class Ie extends Wt{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=It(tt,r),this.walletUri=c}static fromObject=({amount:t,descriptor:e,id:s,status:i,...a})=>new Ie({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 Se extends Wt{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=jt(r),this.network=It(Z,c),this.phoneNumber=o,this.recipientName=d,this.trackingKey=h,this.updatedAt=jt(l)}static fromObject=({amount:t,descriptor:e,id:s,network:i,status:a,...r})=>new Se({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 xe{constructor(t){this.superclass=t}with(...t){return t.reduce(((t,e)=>e(t)),this.superclass)}}const Ce=t=>new xe(t),Te=(t,e)=>({accounts:()=>Ft.fromObject(e),alerts:()=>Vt.fromObject(e),api_keys:()=>Ht.fromObject(e),arpc:()=>Yt.fromObject(e),balance_entries:()=>$t.fromObject(e),bill_payments:()=>Zt.fromObject(e),"bridge/accounts":()=>Qt.fromObject(e),"bridge/bank_accounts":()=>Jt.fromObject(e),"bridge/clabes":()=>Xt.fromObject(e),"bridge/kyc_validations":()=>oe.fromObject(e),"bridge/sessions":()=>fe.fromObject(e),"bridge/transactions":()=>zt.fromObject(e),cards:()=>te.fromObject(e),card_activations:()=>ee.fromObject(e),card_transactions:()=>se.fromObject(e),card_validations:()=>ie.fromObject(e),commissions:()=>ae.fromObject(e),deposits:()=>re.fromObject(e),files:()=>ne.fromObject(e),"support/transfer_fraud_funds":()=>ce.fromObject(e),kyc_validations:()=>oe.fromObject(e),login_tokens:()=>de.fromObject(e),partners:()=>le.fromObject(e),postal_codes:()=>pe.fromObject(e),savings:()=>we.fromObject(e),service_providers:()=>_e.fromObject(e),sessions:()=>fe.fromObject(e),statements:()=>be.fromObject(e),transfers:()=>ge.fromObject(e),users:()=>ye.fromObject(e),user_credentials:()=>ve.fromObject(e),user_logins:()=>Ae.fromObject(e),users_tos_agreements:()=>Oe.fromObject(e),verifications:()=>je.fromObject(e),wallet_transactions:()=>Ie.fromObject(e),whatsapp_transfers:()=>Se.fromObject(e)}[t]()),Ne=t=>{if(null===t||""===t)return null;const e=t.match("/(.*?)/");return null===e?null:e[0].replaceAll("/","")};class ke{constructor(t,e,s){this.path=t,this.QueryParams=e,this.client=s}}const De=t=>class extends t{async retrieve(t){const e=await this.client.get({endpoint:`/${this.path}/${t}`});return Te(this.path,e)}},Re=t=>class extends t{async _create(t){const e=await this.client.post({endpoint:`/${this.path}`,data:t});return Te(this.path,e)}},Pe=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)}},Me=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)}},Ue=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)}},Be=t=>class extends t{async _download(t,e){return await this.client.get({endpoint:`/${this.path}/${t}`,format:e})}},Le=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 Ee extends(Ce(ke).with(Le,De)){constructor(t){super("accounts",at,t)}}class qe{toObject(){return{}}toCleanObject(){const t=this.toObject();return Object.keys(t).forEach((e=>{null==t[e]&&delete t[e]})),t}}class Ge extends qe{constructor(t,e){super(),this.userId=t,this.metadata=e}toObject(){return{user_id:this.userId,metadata:this.metadata}}}class Ke extends qe{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:g,type:y,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=g,this.type=y,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 Fe extends qe{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 Ve extends qe{constructor(t,e){super(),this.status=t,this.pinBlock=e}toObject(){return{status:this.status,pin_block:this.pinBlock}}}class He extends qe{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 Ye extends qe{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 $e extends qe{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 We extends qe{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 Ze extends qe{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 Qe{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 Ze(t).toObject())}get withdrawal(){return this._withdrawal}set withdrawal(t){t&&(this._withdrawal=new Ze(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 Je extends qe{constructor({accountUsageDescription:t,businessDescription:e}){super(),this.accountUsageDescription=t,this.businessDescription=e}toObject(){return{account_usage_description:this.accountUsageDescription,business_description:this.businessDescription}}}class Xe extends qe{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 ze extends Xe{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 We(t).toCleanObject())}toObject(){return{...super.toObject(),job:this.job,phone_number:this.phoneNumber,email_address:this.emailAddress,address:this.address}}}class ts extends qe{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 Xe(t).toObject())))}get legalRepresentatives(){return this._legalRepresentatives}set legalRepresentatives(t){t&&(this._legalRepresentatives=t.map((t=>new ze(t).toObject())))}toObject(){return{name:this.name,percentage:this.percentage,shareholders:this.shareholders,legal_representatives:this.legalRepresentatives}}}class es extends qe{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 ss extends qe{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 is extends qe{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 as extends qe{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:g,requiredLevel:y,rfc:v,shareholders:A,status:O,transactionalProfile:j,updatedAt:I,userId:S,userType:x,vulnerableActivity:C,webSite:T}={}){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=g,this.requiredLevel=y,this.rfc=v,this.shareholdersRequest=A,this.status=O,this.transactionalProfileRequest=j,this.updatedAt=I,this.userId=S,this.userType=x,this.vulnerableActivityRequest=C,this.webSite=T}get address(){return this._address}set addressRequest(t){t&&(this._address=new We(t).toCleanObject())}get audit(){return this._audit}set auditRequest(t){t&&(this._audit=new is(t).toObject())}get businessDetails(){return this._businessDetails}set businessDetailsRequest(t){t&&(this._businessDetails=new Je(t).toObject())}get legalRepresentatives(){return this._legalRepresentatives}set legalRepresentativesRequest(t){t&&(this._legalRepresentatives=t.map((t=>new ze(t).toObject())))}get license(){return this._license}set licenseRequest(t){t&&(this._license=new ss(t).toObject())}get shareholders(){return this._shareholders}set shareholdersRequest(t){t&&(this._shareholders=t.map((t=>new ts(t).toObject())))}get transactionalProfile(){return this._transactionalProfile}set transactionalProfileRequest(t){t&&(this._transactionalProfile=new Qe(t).toObject())}get vulnerableActivity(){return this._vulnerableActivity}set vulnerableActivityRequest(t){t&&(this._vulnerableActivity=new es(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 rs extends qe{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(jt(t).getTime()<=jt(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 ns extends qe{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 cs extends qe{constructor({userId:t,amount:e,concepto:s,clabe:i,reason:a,bankCode:r,tipoPago:n}){super(),this.userId=t,this.amount=e,this.concepto=s,this.clabe=i,this.reason=a,this.bankCode=r,this.tipoPago=n}toObject(){return{user_id:this.userId,amount:this.amount,concepto:this.concepto,clabe:this.clabe,reason:this.reason,bank_code:this.bankCode,tipo_pago:this.tipoPago}}}class os extends qe{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}}}const ds=["succeeded","failed"];class us extends qe{constructor({status:t}={}){if(super(),!t||!ds.includes(t))throw new Error(`Invalid status: "${t}". Must be one of: ${ds.join(", ")}`);this.status=t}toObject(){return{status:this.status}}}class hs extends qe{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 ls extends qe{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}}toCleanObject(){const t=this.toObject();return Object.keys(t).forEach((e=>{"password"===e&&null===t[e]||null==t[e]&&delete t[e]})),t}}class ps extends qe{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 ms extends qe{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 ws extends qe{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 _s extends qe{constructor({address:t,blacklistValidationStatus:e,curpDocumentUri:s,fiscalRegimeCode:i,govtId:a,emailAddress:r,isDormant:n,isFraud:c,isPldBlocked:o,isSecurityMode:d,profession:u,proofOfAddress:h,proofOfLife:l,requiredLevel:p,termsOfService:m,phoneNumber:w,rfc:_,status:f,userType:b,verificationId:g}){super(),this.addressProofs=h,this.adrs=t,this.blacklistValidationStatus=e,this.curpDocumentUri=s,this.emailAddress=r,this.fiscalRegimeCode=i,this.govstIds=a,this.isDormant=n,this.isFraud=c,this.isPldBlocked=o,this.isSecurityMode=d,this.lifeProofs=l,this.profession=u,this.phoneNumber=w,this.requiredLevel=p,this.termsOfService=m,this.rfc=_,this.status=f,this.userType=b,this.verificationId=g}get termsOfService(){return this._termsOfService}set termsOfService(t){t&&(this._termsOfService=new ms(t).toObject())}get address(){return this._address}set adrs(t){t&&(this._address=new We(t).toCleanObject())}get proofOfLife(){return this._proofOfLife}set lifeProofs(t){t&&(this._proofOfLife=new ws(t).toCleanObject())}get proofOfAddress(){return this._proofOfAddress}set addressProofs(t){t&&(this._proofOfAddress=new ws(t).toCleanObject())}get govtId(){return this._govtId}set govstIds(t){t&&(this._govtId=new ws(t).toCleanObject())}toObject(){return{address:this.address,blacklist_validation_status:this.blacklistValidationStatus,curp_document_uri:this.curpDocumentUri,email_address:this.emailAddress,fiscal_regime_code:this.fiscalRegimeCode,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 fs extends qe{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(It(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 bs extends qe{constructor({code:t}){super(),this.code=t}toObject(){return{code:this.code}}}class gs extends qe{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 ys extends(Ce(ke).with(Re,Le,De,Pe)){constructor(t){super("alerts",rt,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 vs extends(Ce(ke).with(Re,Ue,Le,De,Pe)){constructor(t){super("api_keys",nt,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 Ge(s,e);return await this._update(t,i.toCleanObject())}}class As extends(Ce(ke).with(Re)){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 Os extends(Ce(ke).with(Le,De)){constructor(t){super("balance_entries",ct,t)}async relatedTransaction(t){const e=Ne(t);if(null==e)return null;const s=await this.client.get({endpoint:t});return Te(`${e}`,s)}async fundingInstrument(t){const e=Ne(t);if(null==e)return null;const s=await this.client.get({endpoint:t});return Te(`${e}`,s)}}class js extends(Ce(ke).with(Le,De)){constructor(t){super("bill_payments",ot,t)}async serviceProvider(t){const e=Ne(t);if(null==e)return null;const s=await this.client.get({endpoint:t});return Te(`${e}`,s)}}class Is extends(Ce(ke).with(Le,Pe,De)){constructor(t){super("bridge/accounts",dt,t)}async update({userId:t="me",...e}){const s=new _s(e);return await this._update(t,s.toCleanObject())}}class Ss extends(Ce(ke).with(Le,De)){constructor(t){super("bridge/bank_accounts",ut,t)}}class xs extends(Ce(ke).with(Le)){constructor(t){super("bridge/clabes",ht,t)}}class Cs extends(Ce(ke).with(Le,De)){constructor(t){super("bridge/transactions",lt,t)}}class Ts extends(Ce(ke).with(Re)){constructor(t){super("card_activations",Object,t)}async create({number:t,expMonth:e,expYear:s,cvv2:i}){const a=new He(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 te.fromObject(e)}}class Ns extends(Ce(ke).with(Re,Ue,Le,De,Pe)){constructor(t){super("cards",pt,t)}async create(t,e,s){const i=new Fe(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 Ve(e,s);return await this._update(t,i.toCleanObject())}}class ks extends(Ce(ke).with(Le,De)){constructor(t){super("card_transactions",mt,t)}async relatedCard(t){const e=Ne(t);if(null==e)return null;const s=await this.client.get({endpoint:t});return Te(`${e}`,s)}}class Ds extends(Ce(ke).with(Re)){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 Ye({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 te.fromObject(e)}}class Rs extends(Ce(ke).with(Le,De)){constructor(t){super("commissions",it,t)}async relatedTransaction(t){const e=Ne(t);if(null==e)return null;const s=await this.client.get(t);return Te(`${e}`,s)}}class Ps extends(Ce(ke).with(Le,De)){constructor(t){super("deposits",_t,t)}async source(t){const e=await this.client.get({endpoint:t});return Ft.fromObject(e)}}class Ms extends(Ce(ke).with(Be,Me)){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(Ce(ke).with(Re)){constructor(t){super("support/transfer_fraud_funds",Object,t)}async create({userId:t,amount:e,concepto:s,clabe:i,reason:a,bankCode:r,tipoPago:n}){const c=new cs({userId:t,amount:e,concepto:s,clabe:i,reason:a,bankCode:r,tipoPago:n});return await this._create(c.toObject())}}class Bs extends(Ce(ke).with(Re,De,Ue,Le)){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 $e({force:e,userId:t,isBridge:this.isBridge});return await this._create(s.toCleanObject())}async deactivate(t){return await this._deactivate(t)}}class Ls extends(Ce(ke).with(Re)){constructor(t){super("login_tokens",Object,t)}async create(){return await this._create()}}class Es extends(Ce(ke).with(Re,Le,Pe,De)){constructor(t){super("partners",ft,t)}async create(t){const e=new as(t);return await this._create(e.toCleanObject())}async update(t,e){const s=new as(e);return await this._update(t,s.toCleanObject())}}class qs extends(Ce(ke).with(Le)){constructor(t){super("postal_codes",bt,t)}}class Gs extends(Ce(ke).with(Re,Ue,Le,De,Pe)){constructor(t){super("savings",At,t)}async create(t,e,s,i){const a=new rs(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 rs(e,s,i,a);return await this._update(t,r.toObject())}}class Ks extends(Ce(ke).with(Le,De)){constructor(t){super("service_providers",it,t)}}class Fs extends(Ce(ke).with(Re,De,Le)){constructor(t,e=!1){super(e?"bridge/sessions":"sessions",Object,t),this.isBridge=e}async create(t,e,s,i){const a=new ns({failureUrl:i,successUrl:s,type:e,userId:t,isBridge:this.isBridge});return await this._create(a.toCleanObject())}}class Vs extends(Ce(ke).with(Be,Le)){constructor(t){super("statements",gt,t)}async pdf(t){return await this._download(t,D.Pdf)}async xml(t){return await this._download(t,D.Xml)}async downloadFiles({userId:t,year:e,month:s}){const i=await this.one(new gt({userId:t,year:e,month:s})),[a,r]=await Promise.all([this.pdf(i.id),this.xml(i.id)]);return{statement:i,pdf:a,xml:r}}}class Hs extends(Ce(ke).with(Re,Le,De,Pe)){constructor(t){super("transfers",yt,t)}async destination(t){const e=await this.client.get({endpoint:t});return Ft.fromObject(e)}async create({accountNumber:t,amount:e,descriptor:s,recipientName:i,idempotencyKey:a}){const r=a||this.constructor._genIdempotencyKey(t,e),n=new os(t,e,s,r,i);return await this._create(n.toCleanObject())}async update(t,e){const s=new us(e);return await this._update(t,s.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 os(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]=jt(Date.now()).toISOString().split("T");return`${s}:${t}:${e}`}}class Ys extends(Ce(ke).with(Re,Pe)){constructor(t){super("user_credentials",Object,t)}async create(t){const e=new hs(t);return await this._create(e.toObject())}async update({isActive:t,password:e,userId:s="me"}){const i=new ls(e,t);return await this._update(s,i.toCleanObject())}}class $s extends(Ce(ke).with(Re,Ue)){constructor(t){super("user_logins",Object,t),this.loginIdInHeaders=null}async create(t,e){const s=new ps(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 Ws extends(Ce(ke).with(Le,Pe,De,Ue)){constructor(t){super("users",vt,t)}async update({userId:t="me",...e}){const s=new _s(e);return await this._update(t,s.toCleanObject())}async deactivate(t){return await this._deactivate(t)}}class Zs extends(Ce(ke).with(De)){constructor(t){super("users_tos_agreements",Object,t)}}class Qs extends(Ce(ke).with(Re,Pe)){constructor(t){super("verifications",Object,t)}async create({platformId:t,recipient:e,type:s}){const i=new fs({platformId:t,recipient:e,type:s});return await this._create(i.toObject())}async update({code:t,id:e}){const s=new bs({code:t});return await this._update(e,s.toObject())}}class Js extends(Ce(ke).with(Re,Le,De)){constructor(t){super("wallet_transactions",Ot,t)}async create(t,e,s){const i=new gs(t,e,s);return await this._create(i.toObject())}async realtedWallet(t){const e=Ne(t);if(null==e)return null;const s=await this.client.get(t);return Te(`${e}`,s)}}class Xs extends(Ce(ke).with(Le,De)){constructor(t){super("whatsapp_transfers",it,t)}async accountDestination(t){const e=Ne(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=E.Sandbox}={}){this.client=new Kt({apiKey:t,apiSecret:e,language:s,phase:i}),this.withClient(this.client)}withClient(t){this.accounts=new Ee(t),this.alerts=new ys(t),this.apiKeys=new vs(t),this.balanceEntries=new Os(t),this.billPayments=new js(t),this.bridgeAccounts=new Is(t),this.bridgeBankAccounts=new Ss(t),this.bridgeClabes=new xs(t),this.bridgeKycValidations=new Bs(t,!0),this.bridgeSessions=new Fs(t,!0),this.bridgeTransactions=new Cs(t),this.cardActivations=new Ts(t),this.cards=new Ns(t),this.cardTransactions=new ks(t),this.cardValidations=new Ds(t),this.commissions=new Rs(t),this.deposits=new Ps(t),this.files=new Ms(t),this.fraudFundsTransfers=new Us(t),this.kycValidations=new Bs(t),this.loginTokens=new Ls(t),this.partners=new Es(t),this.postalCodes=new qs(t),this.savings=new Gs(t),this.serviceProviders=new Ks(t),this.sessions=new Fs(t),this.statements=new Vs(t),this.transfers=new Hs(t),this.userCredentials=new Ys(t),this.userLogins=new $s(t),this.users=new Ws(t),this.usersTosAgreements=new Zs(t),this.verifications=new Qs(t),this.walletTransactions=new Js(t),this.whatsAppTransfers=new Xs(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 g{static Succeeded=new g("succeeded");static NotValidated=new g("not_validated");static Failed=new g("failed");static OnWaitList=new g("on_wait_list");constructor(t){this.value=t}}class y{static Created=new y("created");static Failed=new y("failed");static Pending=new y("pending");static Succeeded=new y("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 C{static Physical=new C("physical");static Virtual=new C("virtual");constructor(t){this.value=t}}class T{static CardRequest=new T("card_request");static CashDeposit=new T("cash_deposit");static OutgoingSpei=new T("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 R{static Curp=new R("curp");static Dni=new R("dni");static Ine=new R("ine");static Passport=new R("passport");static Residency=new R("residency");static MatriculaConsular=new R("matricula_consular");static ProofOfLiveness=new R("proof_of_liveness");static ProofOfAddress=new R("proof_of_address");constructor(t){this.value=t}}class P{static Client=new P("client");static Server=new P("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 U{static Deposit=new U("deposit");static Withdrawal=new U("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 E{static Sandbox=new E("sandbox-api");static Stage=new E("stage-api");static Api=new E("api");constructor(t){this.value=t}}class q{static Amount=new q("amount");static Volume=new q("volume");constructor(t){this.value=t}}class G{static AW=new G("AW");static AF=new G("AF");static AO=new G("AO");static AI=new G("AI");static AX=new G("AX");static AL=new G("AL");static AD=new G("AD");static AE=new G("AE");static AR=new G("AR");static AM=new G("AM");static AS=new G("AS");static AQ=new G("AQ");static TF=new G("TF");static AG=new G("AG");static AU=new G("AU");static AT=new G("AT");static AZ=new G("AZ");static BI=new G("BI");static BE=new G("BE");static BJ=new G("BJ");static BQ=new G("BQ");static BF=new G("BF");static BD=new G("BD");static BG=new G("BG");static BH=new G("BH");static BS=new G("BS");static BA=new G("BA");static BL=new G("BL");static BY=new G("BY");static BZ=new G("BZ");static BM=new G("BM");static BO=new G("BO");static BR=new G("BR");static BB=new G("BB");static BN=new G("BN");static BT=new G("BT");static BV=new G("BV");static BW=new G("BW");static CF=new G("CF");static CA=new G("CA");static CC=new G("CC");static CH=new G("CH");static CL=new G("CL");static CN=new G("CN");static CI=new G("CI");static CM=new G("CM");static CD=new G("CD");static CG=new G("CG");static CK=new G("CK");static CO=new G("CO");static KM=new G("KM");static CV=new G("CV");static CR=new G("CR");static CU=new G("CU");static CW=new G("CW");static CX=new G("CX");static KY=new G("KY");static CY=new G("CY");static CZ=new G("CZ");static DE=new G("DE");static DJ=new G("DJ");static DM=new G("DM");static DK=new G("DK");static DO=new G("DO");static DZ=new G("DZ");static EC=new G("EC");static EG=new G("EG");static ER=new G("ER");static EH=new G("EH");static ES=new G("ES");static EE=new G("EE");static ET=new G("ET");static FI=new G("FI");static FJ=new G("FJ");static FK=new G("FK");static FR=new G("FR");static FO=new G("FO");static FM=new G("FM");static GA=new G("GA");static GB=new G("GB");static GE=new G("GE");static GG=new G("GG");static GH=new G("GH");static GI=new G("GI");static GN=new G("GN");static GP=new G("GP");static GM=new G("GM");static GW=new G("GW");static GQ=new G("GQ");static GR=new G("GR");static GD=new G("GD");static GL=new G("GL");static GT=new G("GT");static GF=new G("GF");static GU=new G("GU");static GY=new G("GY");static HK=new G("HK");static HM=new G("HM");static HN=new G("HN");static HR=new G("HR");static HT=new G("HT");static HU=new G("HU");static ID=new G("ID");static IM=new G("IM");static IN=new G("IN");static IO=new G("IO");static IE=new G("IE");static IR=new G("IR");static IQ=new G("IQ");static IS=new G("IS");static IL=new G("IL");static IT=new G("IT");static JM=new G("JM");static JE=new G("JE");static JO=new G("JO");static JP=new G("JP");static KZ=new G("KZ");static KE=new G("KE");static KG=new G("KG");static KH=new G("KH");static KI=new G("KI");static KN=new G("KN");static KR=new G("KR");static KW=new G("KW");static LA=new G("LA");static LB=new G("LB");static LC=new G("LC");static LI=new G("LI");static LK=new G("LK");static LR=new G("LR");static LS=new G("LS");static LT=new G("LT");static LU=new G("LU");static LV=new G("LV");static LY=new G("LY");static MA=new G("MA");static MC=new G("MC");static MD=new G("MD");static MG=new G("MG");static MV=new G("MV");static MX=new G("MX");static MH=new G("MH");static MK=new G("MK");static ML=new G("ML");static MT=new G("MT");static MM=new G("MM");static ME=new G("ME");static MN=new G("MN");static MP=new G("MP");static MZ=new G("MZ");static MR=new G("MR");static MS=new G("MS");static MQ=new G("MQ");static MU=new G("MU");static MW=new G("MW");static MY=new G("MY");static YT=new G("YT");static NA=new G("NA");static NC=new G("NC");static NE=new G("NE");static NF=new G("NF");static NG=new G("NG");static NI=new G("NI");static NU=new G("NU");static NL=new G("NL");static NO=new G("NO");static NP=new G("NP");static NR=new G("NR");static NZ=new G("NZ");static OM=new G("OM");static PK=new G("PK");static PA=new G("PA");static PN=new G("PN");static PE=new G("PE");static PH=new G("PH");static PW=new G("PW");static PG=new G("PG");static PL=new G("PL");static PR=new G("PR");static KP=new G("KP");static PT=new G("PT");static PY=new G("PY");static PS=new G("PS");static PF=new G("PF");static QA=new G("QA");static RE=new G("RE");static RO=new G("RO");static RU=new G("RU");static RW=new G("RW");static SA=new G("SA");static SD=new G("SD");static SN=new G("SN");static SG=new G("SG");static GS=new G("GS");static SH=new G("SH");static SJ=new G("SJ");static SB=new G("SB");static SL=new G("SL");static SV=new G("SV");static SM=new G("SM");static SO=new G("SO");static PM=new G("PM");static RS=new G("RS");static SS=new G("SS");static ST=new G("ST");static SR=new G("SR");static SK=new G("SK");static SI=new G("SI");static SE=new G("SE");static SZ=new G("SZ");static SX=new G("SX");static SC=new G("SC");static SY=new G("SY");static TC=new G("TC");static TD=new G("TD");static TG=new G("TG");static TH=new G("TH");static TJ=new G("TJ");static TK=new G("TK");static TM=new G("TM");static TL=new G("TL");static TO=new G("TO");static TT=new G("TT");static TN=new G("TN");static TR=new G("TR");static TV=new G("TV");static TW=new G("TW");static TZ=new G("TZ");static UG=new G("UG");static UA=new G("UA");static UM=new G("UM");static UY=new G("UY");static US=new G("US");static UZ=new G("UZ");static VA=new G("VA");static VC=new G("VC");static VE=new G("VE");static VG=new G("VG");static VI=new G("VI");static VN=new G("VN");static VU=new G("VU");static WF=new G("WF");static WS=new G("WS");static YE=new G("YE");static ZA=new G("ZA");static ZM=new G("ZM");static ZW=new G("ZW");static XA=new G("XA");constructor(t){this.value=t}}class K{static NE=new K("NE");static AS=new K("AS");static BC=new K("BC");static BS=new K("BS");static CC=new K("CC");static CS=new K("CS");static CH=new K("CH");static CL=new K("CL");static CM=new K("CM");static DF=new K("DF");static DG=new K("DG");static GT=new K("GT");static GR=new K("GR");static HG=new K("HG");static JC=new K("JC");static MC=new K("MC");static MN=new K("MN");static MS=new K("MS");static NT=new K("NT");static NL=new K("NL");static OC=new K("OC");static PL=new K("PL");static QT=new K("QT");static QR=new K("QR");static SP=new K("SP");static SL=new K("SL");static SR=new K("SR");static TC=new K("TC");static TL=new K("TL");static TS=new K("TS");static VZ=new K("VZ");static YN=new K("YN");static ZS=new K("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{static GRL_PM=new et("601","General de Ley Personas Morales");static PM_FN=new et("603","Personas Morales con Fines no Lucrativos");static SAL_IS=new et("605","Sueldos y Salarios e Ingresos Asimilados a Salarios");static ARR=new et("606","Arrendamiento");static ENAJ_ADQ=new et("607","Régimen de Enajenación o Adquisición de Bienes");static DEM_ING=new et("608","Demás ingresos");static CONS=new et("609","Consolidación");static RES_EXT=new et("610","Residentes en el Extranjero sin Establecimiento Permanente");static DIV=new et("611","Ingresos por Dividendos (socios y accionistas)");static PF_AEP=new et("612","Personas Físicas con Actividades Empresariales y Profesionales");static INT=new et("614","Ingresos por intereses");static ING_PREM=new et("615","Régimen de los ingresos por obtención de premios");static SIN_OBL=new et("616","Sin obligaciones fiscales");static SCP_DIF=new et("620","Sociedades Cooperativas de Producción que optan por diferir");static INC_FISC=new et("621","Incorporación Fiscal");static AGRO_GAN_SILV_PES=new et("622","Actividades Agrícolas, Ganaderas, Silvícolas y Pesqueras");static OP_GRUPO_SOC=new et("623","Opcional para Grupos de Sociedades");static COOR=new et("624","Coordinados");static AE_PLAT_TEC=new et("625","Régimen de las Actividades Empresariales con ingresos a través de Plataformas Tecnológicas");static RS_CONF=new et("626","Régimen Simplificado de Confianza");static HID=new et("628","Hidrocarburos");static PREF_EM_MULT=new et("629","De los Regímenes Fiscales Preferentes y de las Empresas Multinacionales");static ENAJ_ACC_BOL=new et("630","Enajenación de acciones en bolsa de valores");constructor(t,e){this.value=t,this.name=e}}class st{constructor({createdAfter:t,createdBefore:e,ids:s,limit:i,pageSize:a,relatedTransaction:r,userId:n,count:c=!1}){this.createdAfter=t,this.createdBefore=e,this.ids=s,this._lmt=i,this.relatedTransaction=r,this.userId=n,this.count=c,this.pageSize=a}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,ids:this.ids,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(){const t=new URLSearchParams;return Object.entries(this.toParams()).forEach((([e,s])=>{Array.isArray(s)?t.append(e,s.join(",")):t.append(e,s)})),t.toString()}}class it extends st{constructor({accountNumber:t,...e}){super(e),this.accountNumber=t}toObject(){return Object.assign(super.toObject(),{account_number:this.accountNumber})}}class at extends st{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 rt extends st{constructor({active:t,...e}){super(e),this.active=t}toObject(){return Object.assign(super.toObject(),{active:this.active})}}class nt extends st{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 ct extends st{constructor({accountNumber:t,...e}){super(e),this.accountNumber=t}toObject(){return Object.assign(super.toObject(),{account_number:this.accountNumber})}}class ot extends st{constructor({emailAddress:t,...e}){super(e),this.emailAddress=t}toObject(){return Object.assign(super.toObject(),{email_address:this.emailAddress})}}class dt extends st{constructor({accountId:t,...e}){super(e),this.accountId=t}toObject(){return Object.assign(super.toObject(),{account_id:this.accountId})}}class ut extends st{constructor({accountId:t,...e}){super(e),this.accountId=t}toObject(){return Object.assign(super.toObject(),{account:this.accountId})}}class ht extends ut{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 lt extends st{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 pt extends st{constructor({cardUri:t,...e}){super(e),this.cardUri=t}toObject(){return Object.assign(super.toObject(),{card_uri:this.cardUri})}}class mt extends st{constructor({status:t,...e}){super(e),this.status=t}toObject(){return Object.assign(super.toObject(),{status:this.status})}}class wt extends mt{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 _t extends st{constructor({emailAddress:t,...e}){super(e),this.emailAddress=t}toObject(){return Object.assign(super.toObject(),{email_address:this.emailAddress})}}class ft extends st{constructor({postalCode:t,...e}){super(e),this.postalCode=t}toObject(){return Object.assign(super.toObject(),{postal_code:this.postalCode})}}class bt extends st{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 gt extends mt{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 st{constructor({clabe:t,curp:e,emailAddress:s,hasCurpDocument:i,isBlocked:a,name:r,phoneNumber:n,status:c,...o}={}){super(o),this.clabe=t,this.curp=e,this.emailAddress=s,this.hasCurpDocument=i,this.isBlocked=a,this.name=r,this.phoneNumber=n,this.status=c}toObject(){return Object.assign(super.toObject(),{clabe:this.clabe,curp:this.curp,email_address:this.emailAddress,has_curp_document:this.hasCurpDocument,is_blocked:this.isBlocked,name:this.name,phone_number:this.phoneNumber,status:this.status})}}class vt extends st{constructor({active:t,...e}){super(e),this.active=t}toObject(){return Object.assign(super.toObject(),{active:this.active})}}class At extends st{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 Ct{constructor({accountUsageDescription:t=null,businessDescription:e=null}={}){this.accountUsageDescription=t,this.businessDescription=e}static fromObject=({...t}={})=>new Ct({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 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(R,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 Rt{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 Rt({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 Pt extends Rt{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 Pt({address:e,job:t,phoneNumber:s.phone_number,emailAddress:s.email_address,...Rt.fromObject(s)})}class Mt extends Rt{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,...Rt.fromObject(e)})}class Ut{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=>Pt.fromObject(t))))}static fromObject=({name:t,percentage:e,shareholders:s,...i})=>new Ut({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 Lt{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 Lt({ip:t,location:e,type:s,version:i})}class Et{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 Et({isVulnerableActivity:t.is_vulnerable_activity,hasSatRegister:t.has_sat_register,satRegisteredDate:t.sat_registered_date,isInCompliance:t.is_in_compliance})}var qt="1.1.8-dev3";class Gt{constructor({apiKey:t,apiSecret:e,language:s="en",phase:i=E.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: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=Ot(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 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:g,sourceType:y,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,g),this.sourceType=jt(Y,y),this.transactionDate=Ot(v),this.type=jt(U,A),this.typeOfFilter=jt(q,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:y}){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(g,f),this.termsOfService=b,this.address=y}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=Lt.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(y,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(L,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:g,signature:y,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(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=g,this.signature=y,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(C,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(C,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(C,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(T,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(R,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({transactionId:t,amount:e,claveRastreo:s}){this.transactionId=t,this.amount=e,this.claveRastreo=s}static fromObject=({amount:t,...e})=>new ne({transactionId:e.transaction_id,amount:t,claveRastreo:e.clave_rastreo})}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(P,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:g,platformId:y,requiredLevel:v,rfc:A,shareholders:O,status:j,transactionalProfile:I,updatedAt:S,userId:x,userType:C,vulnerableActivity:T,webSite:N}){super({address:t,clabe:r,emailAddress:o,rfc:A,id:h,level:w,meta:f,nationality:b,platformId:y,phoneNumber:g,requiredLevel:v,status:j,createdAt:n,updatedAt:S,userType:C}),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=T,this.webSite=N}get shareholders(){return this._shareholders}set shareholders(t){t&&(this._shareholders=t.map((t=>Ut.fromObject(t))))}get legalRepresentatives(){return this._legalRepresentatives}set legalRepresentatives(t){t&&(this._legalRepresentatives=t.map((t=>Pt.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=Et.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=Ct.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(K,a),this.country=jt(G,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 ge{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:g,phoneNumber:y,proofOfAddress:v,proofOfLife:A,requiredLevel:O,rfc:j,secondSurname:I,stateOfBirth:S,status:x,termsOfService:C,updatedAt:T,userTosAgreementsId:N,userType:k,verificationId:D,fiscalRegimeCode:R}){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=g,this.phoneNumber=y,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=C,this.updatedAt=Ot(T),this.userTosAgreementsId=N,this.userType=k,this.verificationId=D,this.fiscalRegimeCode=jt(et,R)}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=Lt.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 ge({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,fiscalRegimeCode:u.fiscal_regime_code})}class ye{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 ye({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),Ce=(t,e)=>({accounts:()=>Kt.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),"support/transfer_fraud_funds":()=>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:()=>ge.fromObject(e),user_credentials:()=>ye.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]()),Te=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 Ce(this.path,e)}},De=t=>class extends t{async _create(t){const e=await this.client.post({endpoint:`/${this.path}`,data:t});return Ce(this.path,e)}},Re=t=>class extends t{async _update(t,e){const s=await this.client.patch({endpoint:`/${this.path}/${t}`,data:e});return Ce(this.path,s)}},Pe=t=>class extends t{async _upload(t){const e=await this.client.post({endpoint:`/${this.path}`,data:t,multipart:!0});return Ce(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 Ce(this.path,s)}},Ue=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 Ce(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 Ce(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=Ce(this.path,e);yield t}e=t.next_page_uri}}};class Le extends(xe(Ne).with(Be,ke)){constructor(t){super("accounts",it,t)}}class Ee{toObject(){return{}}toCleanObject(){const t=this.toObject();return Object.keys(t).forEach((e=>{null==t[e]&&delete t[e]})),t}}class qe extends Ee{constructor(t,e){super(),this.userId=t,this.metadata=e}toObject(){return{user_id:this.userId,metadata:this.metadata}}}class Ge extends Ee{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:g,type:y,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=g,this.type=y,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 Ke extends Ee{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 Ee{constructor(t,e){super(),this.status=t,this.pinBlock=e}toObject(){return{status:this.status,pin_block:this.pinBlock}}}class Ve extends Ee{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 Ee{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 Ee{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 Ee{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 Ee{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 Ee{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 Ee{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 Ee{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 Ee{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 Ee{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 Ee{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 Ee{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:g,requiredLevel:y,rfc:v,shareholders:A,status:O,transactionalProfile:j,updatedAt:I,userId:S,userType:x,vulnerableActivity:C,webSite:T}={}){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=g,this.requiredLevel=y,this.rfc=v,this.shareholdersRequest=A,this.status=O,this.transactionalProfileRequest=j,this.updatedAt=I,this.userId=S,this.userType=x,this.vulnerableActivityRequest=C,this.webSite=T}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 Ee{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 Ee{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 Ee{constructor({userId:t,amount:e,concepto:s,clabe:i,reason:a,bankCode:r}){super(),this.userId=t,this.amount=e,this.concepto=s,this.clabe=i,this.reason=a,this.bankCode=r}toObject(){return{user_id:this.userId,amount:this.amount,concepto:this.concepto,clabe:this.clabe,reason:this.reason,bank_code:this.bankCode}}}class cs extends Ee{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}}}const os=["succeeded","failed"];class ds extends Ee{constructor({status:t}={}){if(super(),!t||!os.includes(t))throw new Error(`Invalid status: "${t}". Must be one of: ${os.join(", ")}`);this.status=t}toObject(){return{status:this.status}}}class us extends Ee{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 hs extends Ee{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}}toCleanObject(){const t=this.toObject();return Object.keys(t).forEach((e=>{"password"===e&&null===t[e]||null==t[e]&&delete t[e]})),t}}class ls extends Ee{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 ps extends Ee{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 ms extends Ee{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 ws extends Ee{constructor({address:t,blacklistValidationStatus:e,curpDocumentUri:s,fiscalRegimeCode:i,govtId:a,emailAddress:r,isDormant:n,isFraud:c,isPldBlocked:o,isSecurityMode:d,profession:u,proofOfAddress:h,proofOfLife:l,requiredLevel:p,termsOfService:m,phoneNumber:w,rfc:_,status:f,userType:b,verificationId:g}){super(),this.addressProofs=h,this.adrs=t,this.blacklistValidationStatus=e,this.curpDocumentUri=s,this.emailAddress=r,this.fiscalRegimeCode=i,this.govstIds=a,this.isDormant=n,this.isFraud=c,this.isPldBlocked=o,this.isSecurityMode=d,this.lifeProofs=l,this.profession=u,this.phoneNumber=w,this.requiredLevel=p,this.termsOfService=m,this.rfc=_,this.status=f,this.userType=b,this.verificationId=g}get termsOfService(){return this._termsOfService}set termsOfService(t){t&&(this._termsOfService=new ps(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 ms(t).toCleanObject())}get proofOfAddress(){return this._proofOfAddress}set addressProofs(t){t&&(this._proofOfAddress=new ms(t).toCleanObject())}get govtId(){return this._govtId}set govstIds(t){t&&(this._govtId=new ms(t).toCleanObject())}toObject(){return{address:this.address,blacklist_validation_status:this.blacklistValidationStatus,curp_document_uri:this.curpDocumentUri,email_address:this.emailAddress,fiscal_regime_code:this.fiscalRegimeCode,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 _s extends Ee{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 fs extends Ee{constructor({code:t}){super(),this.code=t}toObject(){return{code:this.code}}}class bs extends Ee{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 gs extends(xe(Ne).with(De,Be,ke,Re)){constructor(t){super("alerts",at,t)}async create(t){const e=new Ge(t);return await this._create(e.toCleanObject())}async update(t,e){const s=new Ge(e);return await this._update(t,s.toCleanObject())}}class ys extends(xe(Ne).with(De,Me,Be,ke,Re)){constructor(t){super("api_keys",rt,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 qe(s,e);return await this._update(t,i.toCleanObject())}}class vs 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 As extends(xe(Ne).with(Be,ke)){constructor(t){super("balance_entries",nt,t)}async relatedTransaction(t){const e=Te(t);if(null==e)return null;const s=await this.client.get({endpoint:t});return Ce(`${e}`,s)}async fundingInstrument(t){const e=Te(t);if(null==e)return null;const s=await this.client.get({endpoint:t});return Ce(`${e}`,s)}}class Os extends(xe(Ne).with(Be,ke)){constructor(t){super("bill_payments",ct,t)}async serviceProvider(t){const e=Te(t);if(null==e)return null;const s=await this.client.get({endpoint:t});return Ce(`${e}`,s)}}class js extends(xe(Ne).with(Be,Re,ke)){constructor(t){super("bridge/accounts",ot,t)}async update({userId:t="me",...e}){const s=new ws(e);return await this._update(t,s.toCleanObject())}}class Is extends(xe(Ne).with(Be,ke)){constructor(t){super("bridge/bank_accounts",dt,t)}}class Ss extends(xe(Ne).with(Be)){constructor(t){super("bridge/clabes",ut,t)}}class xs extends(xe(Ne).with(Be,ke)){constructor(t){super("bridge/transactions",ht,t)}}class Cs 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 Ts extends(xe(Ne).with(De,Me,Be,ke,Re)){constructor(t){super("cards",lt,t)}async create(t,e,s){const i=new Ke(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 Ns extends(xe(Ne).with(Be,ke)){constructor(t){super("card_transactions",pt,t)}async relatedCard(t){const e=Te(t);if(null==e)return null;const s=await this.client.get({endpoint:t});return Ce(`${e}`,s)}}class ks 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 Ds extends(xe(Ne).with(Be,ke)){constructor(t){super("commissions",st,t)}async relatedTransaction(t){const e=Te(t);if(null==e)return null;const s=await this.client.get(t);return Ce(`${e}`,s)}}class Rs extends(xe(Ne).with(Be,ke)){constructor(t){super("deposits",wt,t)}async source(t){const e=await this.client.get({endpoint:t});return Kt.fromObject(e)}}class Ps extends(xe(Ne).with(Ue,Pe)){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 Ms extends(xe(Ne).with(De)){constructor(t){super("support/transfer_fraud_funds",Object,t)}async create({userId:t,amount:e,concepto:s,clabe:i,reason:a,bankCode:r}){const n=new ns({userId:t,amount:e,concepto:s,clabe:i,reason:a,bankCode:r});return await this._create(n.toObject())}}class Us 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 Bs extends(xe(Ne).with(De)){constructor(t){super("login_tokens",Object,t)}async create(){return await this._create()}}class Ls extends(xe(Ne).with(De,Be,Re,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 Es extends(xe(Ne).with(Be)){constructor(t){super("postal_codes",ft,t)}}class qs extends(xe(Ne).with(De,Me,Be,ke,Re)){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 Gs extends(xe(Ne).with(Be,ke)){constructor(t){super("service_providers",st,t)}}class Ks 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 Fs extends(xe(Ne).with(Ue,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)}async downloadFiles({userId:t,year:e,month:s}){const i=await this.one(new bt({userId:t,year:e,month:s})),[a,r]=await Promise.all([this.pdf(i.id),this.xml(i.id)]);return{statement:i,pdf:a,xml:r}}}class Vs extends(xe(Ne).with(De,Be,ke,Re)){constructor(t){super("transfers",gt,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 cs(t,e,s,r,i);return await this._create(n.toCleanObject())}async update(t,e){const s=new ds(e);return await this._update(t,s.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 Hs extends(xe(Ne).with(De,Re)){constructor(t){super("user_credentials",Object,t)}async create(t){const e=new us(t);return await this._create(e.toObject())}async update({isActive:t,password:e,userId:s="me"}){const i=new hs(e,t);return await this._update(s,i.toCleanObject())}}class Ys extends(xe(Ne).with(De,Me)){constructor(t){super("user_logins",Object,t),this.loginIdInHeaders=null}async create(t,e){const s=new ls(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 $s extends(xe(Ne).with(Be,Re,ke,Me)){constructor(t){super("users",yt,t)}async update({userId:t="me",...e}){const s=new ws(e);return await this._update(t,s.toCleanObject())}async deactivate(t){return await this._deactivate(t)}}class Ws extends(xe(Ne).with(ke)){constructor(t){super("users_tos_agreements",Object,t)}}class Zs extends(xe(Ne).with(De,Re)){constructor(t){super("verifications",Object,t)}async create({platformId:t,recipient:e,type:s}){const i=new _s({platformId:t,recipient:e,type:s});return await this._create(i.toObject())}async update({code:t,id:e}){const s=new fs({code:t});return await this._update(e,s.toObject())}}class Qs extends(xe(Ne).with(De,Be,ke)){constructor(t){super("wallet_transactions",At,t)}async create(t,e,s){const i=new bs(t,e,s);return await this._create(i.toObject())}async realtedWallet(t){const e=Te(t);if(null==e)return null;const s=await this.client.get(t);return Ce(`${e}`,s)}}class Js extends(xe(Ne).with(Be,ke)){constructor(t){super("whatsapp_transfers",st,t)}async accountDestination(t){const e=Te(t);if(null==e)return null;const s=await this.client.get(t);return Ce(`${e}`,s)}}t.Cuenca=class{constructor({apiKey:t,apiSecret:e,language:s="en",phase:i=E.Sandbox}={}){this.client=new Gt({apiKey:t,apiSecret:e,language:s,phase:i}),this.withClient(this.client)}withClient(t){this.accounts=new Le(t),this.alerts=new gs(t),this.apiKeys=new ys(t),this.balanceEntries=new As(t),this.billPayments=new Os(t),this.bridgeAccounts=new js(t),this.bridgeBankAccounts=new Is(t),this.bridgeClabes=new Ss(t),this.bridgeKycValidations=new Us(t,!0),this.bridgeSessions=new Ks(t,!0),this.bridgeTransactions=new xs(t),this.cardActivations=new Cs(t),this.cards=new Ts(t),this.cardTransactions=new Ns(t),this.cardValidations=new ks(t),this.commissions=new Ds(t),this.deposits=new Rs(t),this.files=new Ps(t),this.fraudFundsTransfers=new Ms(t),this.kycValidations=new Us(t),this.loginTokens=new Bs(t),this.partners=new Ls(t),this.postalCodes=new Es(t),this.savings=new qs(t),this.serviceProviders=new Gs(t),this.sessions=new Ks(t),this.statements=new Fs(t),this.transfers=new Vs(t),this.userCredentials=new Hs(t),this.userLogins=new Ys(t),this.users=new $s(t),this.usersTosAgreements=new Ws(t),this.verifications=new Zs(t),this.walletTransactions=new Qs(t),this.whatsAppTransfers=new Js(t)}}}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ValidationError } from './errors/index.mjs';
|
|
2
|
-
import { d as dateToUTC, e as enumValueFromString, A as AlertStatus, V as VerificationStatus, K as KYCFileType } from './data-
|
|
2
|
+
import { d as dateToUTC, e as enumValueFromString, A as AlertStatus, V as VerificationStatus, K as KYCFileType } from './data-48673329.mjs';
|
|
3
3
|
|
|
4
4
|
class QueryParams {
|
|
5
5
|
constructor({
|
package/build/{walletTransactionRequest-8665538a.mjs → walletTransactionRequest-29003a99.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ValidationError } from './errors/index.mjs';
|
|
2
|
-
import { d as dateToUTC, e as enumValueFromString, w as VerificationType } from './data-
|
|
2
|
+
import { d as dateToUTC, e as enumValueFromString, w as VerificationType } from './data-48673329.mjs';
|
|
3
3
|
|
|
4
4
|
class BaseRequest {
|
|
5
5
|
toObject() {
|
|
@@ -966,7 +966,7 @@ class SessionRequest extends BaseRequest {
|
|
|
966
966
|
}
|
|
967
967
|
|
|
968
968
|
class FraudFundsTransferRequest extends BaseRequest {
|
|
969
|
-
constructor({ userId, amount, concepto, clabe, reason, bankCode
|
|
969
|
+
constructor({ userId, amount, concepto, clabe, reason, bankCode }) {
|
|
970
970
|
super();
|
|
971
971
|
this.userId = userId;
|
|
972
972
|
this.amount = amount;
|
|
@@ -974,7 +974,6 @@ class FraudFundsTransferRequest extends BaseRequest {
|
|
|
974
974
|
this.clabe = clabe;
|
|
975
975
|
this.reason = reason;
|
|
976
976
|
this.bankCode = bankCode;
|
|
977
|
-
this.tipoPago = tipoPago;
|
|
978
977
|
}
|
|
979
978
|
|
|
980
979
|
toObject() {
|
|
@@ -985,7 +984,6 @@ class FraudFundsTransferRequest extends BaseRequest {
|
|
|
985
984
|
clabe: this.clabe,
|
|
986
985
|
reason: this.reason,
|
|
987
986
|
bank_code: this.bankCode,
|
|
988
|
-
tipo_pago: this.tipoPago,
|
|
989
987
|
};
|
|
990
988
|
}
|
|
991
989
|
}
|
package/build/{walletTransactionRequest-7d91d9dc.cjs → walletTransactionRequest-4c4229bb.cjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var errors_index = require('./errors/index.cjs');
|
|
4
|
-
var data = require('./data-
|
|
4
|
+
var data = require('./data-06c55643.cjs');
|
|
5
5
|
|
|
6
6
|
class BaseRequest {
|
|
7
7
|
toObject() {
|
|
@@ -968,7 +968,7 @@ class SessionRequest extends BaseRequest {
|
|
|
968
968
|
}
|
|
969
969
|
|
|
970
970
|
class FraudFundsTransferRequest extends BaseRequest {
|
|
971
|
-
constructor({ userId, amount, concepto, clabe, reason, bankCode
|
|
971
|
+
constructor({ userId, amount, concepto, clabe, reason, bankCode }) {
|
|
972
972
|
super();
|
|
973
973
|
this.userId = userId;
|
|
974
974
|
this.amount = amount;
|
|
@@ -976,7 +976,6 @@ class FraudFundsTransferRequest extends BaseRequest {
|
|
|
976
976
|
this.clabe = clabe;
|
|
977
977
|
this.reason = reason;
|
|
978
978
|
this.bankCode = bankCode;
|
|
979
|
-
this.tipoPago = tipoPago;
|
|
980
979
|
}
|
|
981
980
|
|
|
982
981
|
toObject() {
|
|
@@ -987,7 +986,6 @@ class FraudFundsTransferRequest extends BaseRequest {
|
|
|
987
986
|
clabe: this.clabe,
|
|
988
987
|
reason: this.reason,
|
|
989
988
|
bank_code: this.bankCode,
|
|
990
|
-
tipo_pago: this.tipoPago,
|
|
991
989
|
};
|
|
992
990
|
}
|
|
993
991
|
}
|