@cuenca-mx/cuenca-js 1.2.2-dev0 → 2.0.0-dev0

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.
Files changed (183) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/build/data-91da6d58.mjs +625 -0
  3. package/build/data-ca00ac2d.cjs +669 -0
  4. package/build/dts/client/client.d.ts +86 -0
  5. package/build/dts/client/index.d.ts +1 -0
  6. package/build/dts/errors.d.ts +25 -0
  7. package/build/dts/helpers/case.d.ts +5 -0
  8. package/build/dts/helpers/data.d.ts +3 -0
  9. package/build/dts/helpers/env.d.ts +7 -0
  10. package/build/dts/index.d.ts +52 -0
  11. package/build/dts/jwt.d.ts +8 -0
  12. package/build/dts/models/account.d.ts +12 -0
  13. package/build/dts/models/alert.d.ts +32 -0
  14. package/build/dts/models/apiKey.d.ts +13 -0
  15. package/build/dts/models/arpc.d.ts +10 -0
  16. package/build/dts/models/balanceEntry.d.ts +15 -0
  17. package/build/dts/models/baseUser.d.ts +23 -0
  18. package/build/dts/models/billPayment.d.ts +10 -0
  19. package/build/dts/models/bridgeAccount.d.ts +27 -0
  20. package/build/dts/models/bridgeBankAccount.d.ts +16 -0
  21. package/build/dts/models/bridgeClabe.d.ts +12 -0
  22. package/build/dts/models/bridgeTransaction.d.ts +32 -0
  23. package/build/dts/models/card.d.ts +19 -0
  24. package/build/dts/models/cardActivation.d.ts +12 -0
  25. package/build/dts/models/cardTransaction.d.ts +15 -0
  26. package/build/dts/models/cardValidation.d.ts +19 -0
  27. package/build/dts/models/commission.d.ts +9 -0
  28. package/build/dts/models/deposit.d.ts +11 -0
  29. package/build/dts/models/file.d.ts +10 -0
  30. package/build/dts/models/fraudFundsTransfer.d.ts +9 -0
  31. package/build/dts/models/index.d.ts +38 -0
  32. package/build/dts/models/kycValidations.d.ts +22 -0
  33. package/build/dts/models/loginToken.d.ts +7 -0
  34. package/build/dts/models/partner.d.ts +25 -0
  35. package/build/dts/models/postalCode.d.ts +14 -0
  36. package/build/dts/models/saving.d.ts +11 -0
  37. package/build/dts/models/serviceProvider.d.ts +10 -0
  38. package/build/dts/models/session.d.ts +14 -0
  39. package/build/dts/models/statement.d.ts +10 -0
  40. package/build/dts/models/transaction.d.ts +7 -0
  41. package/build/dts/models/transactionalProfile.d.ts +14 -0
  42. package/build/dts/models/transfer.d.ts +15 -0
  43. package/build/dts/models/user.d.ts +42 -0
  44. package/build/dts/models/userCredential.d.ts +10 -0
  45. package/build/dts/models/userLogin.d.ts +9 -0
  46. package/build/dts/models/userReport.d.ts +48 -0
  47. package/build/dts/models/userTosAgreement.d.ts +13 -0
  48. package/build/dts/models/verification.d.ts +12 -0
  49. package/build/dts/models/wallet.d.ts +8 -0
  50. package/build/dts/models/walletTransaction.d.ts +10 -0
  51. package/build/dts/models/whatsAppTransfer.d.ts +16 -0
  52. package/build/dts/requests/addressUpdateRequest.d.ts +17 -0
  53. package/build/dts/requests/alertRequest.d.ts +31 -0
  54. package/build/dts/requests/apiKeyRequest.d.ts +9 -0
  55. package/build/dts/requests/arpcRequest.d.ts +16 -0
  56. package/build/dts/requests/base.d.ts +2 -0
  57. package/build/dts/requests/cardActivationRequest.d.ts +11 -0
  58. package/build/dts/requests/cardRequest.d.ts +18 -0
  59. package/build/dts/requests/cardValidationRequest.d.ts +15 -0
  60. package/build/dts/requests/fileUploadRequest.d.ts +12 -0
  61. package/build/dts/requests/fraudFundsTransferRequest.d.ts +13 -0
  62. package/build/dts/requests/index.d.ts +24 -0
  63. package/build/dts/requests/kycValidationsRequest.d.ts +10 -0
  64. package/build/dts/requests/partnerUserRequest.d.ts +100 -0
  65. package/build/dts/requests/reportGenerateRequest.d.ts +8 -0
  66. package/build/dts/requests/savingRequest.d.ts +11 -0
  67. package/build/dts/requests/sessionRequest.d.ts +12 -0
  68. package/build/dts/requests/tosUpdateRequest.d.ts +11 -0
  69. package/build/dts/requests/transferRequest.d.ts +12 -0
  70. package/build/dts/requests/transferUpdateRequest.d.ts +8 -0
  71. package/build/dts/requests/userCredentialRequest.d.ts +15 -0
  72. package/build/dts/requests/userLoginRequest.d.ts +8 -0
  73. package/build/dts/requests/userReportCreateRequest.d.ts +9 -0
  74. package/build/dts/requests/userReportUpdateRequest.d.ts +28 -0
  75. package/build/dts/requests/userRequest.d.ts +39 -0
  76. package/build/dts/requests/verificationRequest.d.ts +17 -0
  77. package/build/dts/requests/walletTransactionRequest.d.ts +9 -0
  78. package/build/dts/resources/accounts.d.ts +33 -0
  79. package/build/dts/resources/alerts.d.ts +54 -0
  80. package/build/dts/resources/apiKeys.d.ts +63 -0
  81. package/build/dts/resources/arpc.d.ts +18 -0
  82. package/build/dts/resources/balanceEntries.d.ts +37 -0
  83. package/build/dts/resources/base.d.ts +135 -0
  84. package/build/dts/resources/billPayments.d.ts +34 -0
  85. package/build/dts/resources/bridgeAccounts.d.ts +49 -0
  86. package/build/dts/resources/bridgeBankAccounts.d.ts +33 -0
  87. package/build/dts/resources/bridgeClabes.d.ts +27 -0
  88. package/build/dts/resources/bridgeTransactions.d.ts +36 -0
  89. package/build/dts/resources/cardActivations.d.ts +19 -0
  90. package/build/dts/resources/cardTransactions.d.ts +34 -0
  91. package/build/dts/resources/cardValidations.d.ts +19 -0
  92. package/build/dts/resources/cards.d.ts +63 -0
  93. package/build/dts/resources/commissions.d.ts +34 -0
  94. package/build/dts/resources/deposits.d.ts +34 -0
  95. package/build/dts/resources/files.d.ts +30 -0
  96. package/build/dts/resources/fraudFundsTransfers.d.ts +18 -0
  97. package/build/dts/resources/index.d.ts +36 -0
  98. package/build/dts/resources/kycValidations.d.ts +53 -0
  99. package/build/dts/resources/loginTokens.d.ts +17 -0
  100. package/build/dts/resources/partners.d.ts +54 -0
  101. package/build/dts/resources/postalCodes.d.ts +24 -0
  102. package/build/dts/resources/reports.d.ts +8 -0
  103. package/build/dts/resources/savings.d.ts +62 -0
  104. package/build/dts/resources/serviceProviders.d.ts +32 -0
  105. package/build/dts/resources/sessions.d.ts +43 -0
  106. package/build/dts/resources/statements.d.ts +44 -0
  107. package/build/dts/resources/transfers.d.ts +64 -0
  108. package/build/dts/resources/userCredentials.d.ts +30 -0
  109. package/build/dts/resources/userLogins.d.ts +28 -0
  110. package/build/dts/resources/userReports.d.ts +54 -0
  111. package/build/dts/resources/users.d.ts +56 -0
  112. package/build/dts/resources/usersTosAgreements.d.ts +16 -0
  113. package/build/dts/resources/verifications.d.ts +31 -0
  114. package/build/dts/resources/walletTransactions.d.ts +48 -0
  115. package/build/dts/resources/whatsAppTransfers.d.ts +34 -0
  116. package/build/dts/types/enums.d.ts +579 -0
  117. package/build/dts/types/identities/address.d.ts +25 -0
  118. package/build/dts/types/identities/alertLog.d.ts +11 -0
  119. package/build/dts/types/identities/audit.d.ts +10 -0
  120. package/build/dts/types/identities/businessDetails.d.ts +9 -0
  121. package/build/dts/types/identities/externalAccount.d.ts +8 -0
  122. package/build/dts/types/identities/index.d.ts +17 -0
  123. package/build/dts/types/identities/kycFile.d.ts +14 -0
  124. package/build/dts/types/identities/legalRepresentatives.d.ts +12 -0
  125. package/build/dts/types/identities/license.d.ts +10 -0
  126. package/build/dts/types/identities/moralOperation.d.ts +8 -0
  127. package/build/dts/types/identities/physicalPerson.d.ts +12 -0
  128. package/build/dts/types/identities/shareholderMoral.d.ts +12 -0
  129. package/build/dts/types/identities/shareholderPhysical.d.ts +9 -0
  130. package/build/dts/types/identities/tosAgreements.d.ts +10 -0
  131. package/build/dts/types/identities/transactionalProfileServices.d.ts +10 -0
  132. package/build/dts/types/identities/verificationError.d.ts +10 -0
  133. package/build/dts/types/identities/vulnerableActivity.d.ts +10 -0
  134. package/build/dts/types/index.d.ts +3 -0
  135. package/build/dts/types/queries/accountQuery.d.ts +4 -0
  136. package/build/dts/types/queries/alertQuery.d.ts +12 -0
  137. package/build/dts/types/queries/apiKeyQuery.d.ts +4 -0
  138. package/build/dts/types/queries/balanceEntryQuery.d.ts +5 -0
  139. package/build/dts/types/queries/billPaymentQuery.d.ts +4 -0
  140. package/build/dts/types/queries/bridgeAccountQuery.d.ts +4 -0
  141. package/build/dts/types/queries/bridgeBankAccountQuery.d.ts +4 -0
  142. package/build/dts/types/queries/bridgeQuery.d.ts +7 -0
  143. package/build/dts/types/queries/bridgeTransactionQuery.d.ts +6 -0
  144. package/build/dts/types/queries/cardTransactionQuery.d.ts +4 -0
  145. package/build/dts/types/queries/cardsQuery.d.ts +4 -0
  146. package/build/dts/types/queries/depositQuery.d.ts +5 -0
  147. package/build/dts/types/queries/index.d.ts +26 -0
  148. package/build/dts/types/queries/partnerQuery.d.ts +4 -0
  149. package/build/dts/types/queries/postalCodeQuery.d.ts +4 -0
  150. package/build/dts/types/queries/queryParams.d.ts +15 -0
  151. package/build/dts/types/queries/statementQuery.d.ts +6 -0
  152. package/build/dts/types/queries/transactionQuery.d.ts +4 -0
  153. package/build/dts/types/queries/transferQuery.d.ts +7 -0
  154. package/build/dts/types/queries/userQuery.d.ts +11 -0
  155. package/build/dts/types/queries/userReportQuery.d.ts +4 -0
  156. package/build/dts/types/queries/walletQuery.d.ts +4 -0
  157. package/build/dts/types/queries/walletTransactionQuery.d.ts +4 -0
  158. package/build/errors/index.cjs +10 -0
  159. package/build/errors/index.mjs +10 -1
  160. package/build/index.cjs +1305 -2894
  161. package/build/index.mjs +1307 -2895
  162. package/build/jwt/index.cjs +11 -8
  163. package/build/jwt/index.mjs +11 -8
  164. package/build/requests/index.cjs +4 -22
  165. package/build/requests/index.mjs +2 -26
  166. package/build/types/index.cjs +18 -56
  167. package/build/types/index.mjs +9 -34
  168. package/build/umd/cuenca.umd.js +1 -1
  169. package/build/vulnerableActivity-61dc2846.mjs +278 -0
  170. package/build/vulnerableActivity-d5aed4a7.cjs +299 -0
  171. package/build/walletTransactionRequest-aab46c5e.cjs +461 -0
  172. package/build/walletTransactionRequest-dc11fc69.mjs +433 -0
  173. package/errors/index.d.ts +1 -0
  174. package/jwt/index.d.ts +1 -0
  175. package/package.json +26 -8
  176. package/requests/index.d.ts +1 -0
  177. package/types/index.d.ts +1 -0
  178. package/build/data-1fd00e5c.mjs +0 -1199
  179. package/build/data-72c37b60.cjs +0 -1240
  180. package/build/vulnerableActivity-7cc1734f.cjs +0 -867
  181. package/build/vulnerableActivity-bd344332.mjs +0 -831
  182. package/build/walletTransactionRequest-05d5305a.mjs +0 -1512
  183. package/build/walletTransactionRequest-c6a5c64d.cjs +0 -1539
@@ -1,831 +0,0 @@
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-1fd00e5c.mjs';
3
-
4
- class QueryParams {
5
- constructor({
6
- createdAfter,
7
- createdBefore,
8
- ids,
9
- limit,
10
- pageSize,
11
- relatedTransaction,
12
- userId,
13
- count = false,
14
- }) {
15
- this.createdAfter = createdAfter;
16
- this.createdBefore = createdBefore;
17
- this.ids = ids;
18
- this._lmt = limit;
19
- this.relatedTransaction = relatedTransaction;
20
- this.userId = userId;
21
- this.count = count;
22
- this.pageSize = pageSize;
23
- }
24
-
25
- get limit() {
26
- return this._limit;
27
- }
28
-
29
- set _lmt(value) {
30
- let validatedValue = null;
31
- if (typeof value === 'number' && value >= 0) {
32
- validatedValue = value;
33
- }
34
- this._limit = validatedValue;
35
- }
36
-
37
- toObject() {
38
- return {
39
- created_after: this.createdAfter,
40
- created_before: this.createdBefore,
41
- ids: this.ids,
42
- limit: this.limit,
43
- related_transaction: this.relatedTransaction,
44
- user_id: this.userId,
45
- page_size: this.pageSize && this.pageSize.size,
46
- };
47
- }
48
-
49
- toParams() {
50
- const helper = { ...this.toObject() };
51
- if (this.count) helper.count = 1;
52
- Object.keys(helper).forEach((k) => {
53
- if (helper[k] == null) delete helper[k];
54
- });
55
- return helper;
56
- }
57
-
58
- toQueryString() {
59
- const params = new URLSearchParams();
60
- Object.entries(this.toParams()).forEach(([key, value]) => {
61
- if (Array.isArray(value)) {
62
- params.append(key, value.join(','));
63
- } else {
64
- params.append(key, value);
65
- }
66
- });
67
- return params.toString();
68
- }
69
- }
70
-
71
- class AccountQuery extends QueryParams {
72
- constructor({ accountNumber, ...args }) {
73
- super(args);
74
- this.accountNumber = accountNumber;
75
- }
76
-
77
- toObject() {
78
- return Object.assign(super.toObject(), {
79
- account_number: this.accountNumber,
80
- });
81
- }
82
- }
83
-
84
- class AlertQuery extends QueryParams {
85
- constructor({
86
- agent,
87
- comments,
88
- committeeMeetingDate,
89
- count,
90
- hasQuestionnaire,
91
- inProcess,
92
- resolvedAfter,
93
- status,
94
- typeOfFilter,
95
- transactionDate,
96
- ...args
97
- }) {
98
- super(args);
99
- this.agent = agent;
100
- this.comments = comments;
101
- this.committeeMeetingDate = committeeMeetingDate;
102
- this.count = count;
103
- this.hasQuestionnaire = hasQuestionnaire;
104
- this.inProcess = inProcess;
105
- this.resolvedAfter = resolvedAfter;
106
- this.status = status;
107
- this.typeOfFilter = typeOfFilter;
108
- this.transactionDate = transactionDate;
109
- }
110
-
111
- toObject() {
112
- return Object.assign(super.toObject(), {
113
- agent: this.agent,
114
- comments: this.comments,
115
- committee_meeting_date: this.committeeMeetingDate,
116
- count: this.count,
117
- has_questionnaire: this.hasQuestionnaire,
118
- in_process: this.inProcess,
119
- resolved_after: this.resolvedAfter,
120
- status: this.status,
121
- transaction_date: this.transactionDate,
122
- type_of_filter: this.typeOfFilter,
123
- });
124
- }
125
- }
126
-
127
- class ApiKeyQuery extends QueryParams {
128
- constructor({ active, ...args }) {
129
- super(args);
130
- this.active = active;
131
- }
132
-
133
- toObject() {
134
- return Object.assign(super.toObject(), {
135
- active: this.active,
136
- });
137
- }
138
- }
139
-
140
- class BalanceEntryQuery extends QueryParams {
141
- constructor({
142
- fundingInstrumentUri,
143
- count = false,
144
- walletId = 'default',
145
- ...args
146
- }) {
147
- super(args);
148
- this.fundingInstrumentUri = fundingInstrumentUri;
149
- this.count = count;
150
- this.walletId = walletId;
151
- }
152
-
153
- toObject() {
154
- return Object.assign(super.toObject(), {
155
- wallet_id: this.walletId,
156
- funding_instrument_uri: this.fundingInstrumentUri,
157
- count: this.count,
158
- });
159
- }
160
- }
161
-
162
- class BillPaymentQuery extends QueryParams {
163
- constructor({ accountNumber, ...args }) {
164
- super(args);
165
- this.accountNumber = accountNumber;
166
- }
167
-
168
- toObject() {
169
- return Object.assign(super.toObject(), {
170
- account_number: this.accountNumber,
171
- });
172
- }
173
- }
174
-
175
- class BridgeAccountQuery extends QueryParams {
176
- constructor({ emailAddress, ...args }) {
177
- super(args);
178
- this.emailAddress = emailAddress;
179
- }
180
-
181
- toObject() {
182
- return Object.assign(super.toObject(), {
183
- email_address: this.emailAddress,
184
- });
185
- }
186
- }
187
-
188
- class BridgeBankAccountQuery extends QueryParams {
189
- constructor({ accountId, ...args }) {
190
- super(args);
191
- this.accountId = accountId;
192
- }
193
-
194
- toObject() {
195
- return Object.assign(super.toObject(), {
196
- account_id: this.accountId,
197
- });
198
- }
199
- }
200
-
201
- class BridgeQuery extends QueryParams {
202
- constructor({ accountId, ...args }) {
203
- super(args);
204
- this.accountId = accountId;
205
- }
206
-
207
- toObject() {
208
- return Object.assign(super.toObject(), {
209
- account: this.accountId,
210
- });
211
- }
212
- }
213
-
214
- class BridgeTransactionQuery extends BridgeQuery {
215
- constructor({ status, type, ...args }) {
216
- super(args);
217
- this.status = status;
218
- this.type = type;
219
- }
220
-
221
- toObject() {
222
- return Object.assign(super.toObject(), {
223
- status: this.status,
224
- type: this.type,
225
- });
226
- }
227
- }
228
-
229
- class CardsQuery extends QueryParams {
230
- constructor({ cardUri, count = false, ...args } = {}) {
231
- super(args);
232
- this.cardUri = cardUri;
233
- this.count = count;
234
- }
235
-
236
- toObject() {
237
- return Object.assign(super.toObject(), {
238
- card_uri: this.cardUri,
239
- count: this.count,
240
- });
241
- }
242
- }
243
-
244
- class CardTransactionQuery extends QueryParams {
245
- constructor({ cardUri, ...args }) {
246
- super(args);
247
- this.cardUri = cardUri;
248
- }
249
-
250
- toObject() {
251
- return Object.assign(super.toObject(), {
252
- card_uri: this.cardUri,
253
- });
254
- }
255
- }
256
-
257
- class TransactionQuery extends QueryParams {
258
- constructor({ status, ...args }) {
259
- super(args);
260
- this.status = status;
261
- }
262
-
263
- toObject() {
264
- return Object.assign(super.toObject(), {
265
- status: this.status,
266
- });
267
- }
268
- }
269
-
270
- class DepositQuery extends TransactionQuery {
271
- constructor({ trackingKey, network, ...args }) {
272
- super(args);
273
- this.trackingKey = trackingKey;
274
- this.network = network;
275
- }
276
-
277
- toObject() {
278
- return Object.assign(super.toObject(), {
279
- tracking_key: this.trackingKey,
280
- network: this.network,
281
- });
282
- }
283
- }
284
-
285
- class PartnerQuery extends QueryParams {
286
- constructor({ emailAddress, ...args }) {
287
- super(args);
288
- this.emailAddress = emailAddress;
289
- }
290
-
291
- toObject() {
292
- return Object.assign(super.toObject(), {
293
- email_address: this.emailAddress,
294
- });
295
- }
296
- }
297
-
298
- class PostalCodeQuery extends QueryParams {
299
- constructor({ postalCode, ...args }) {
300
- super(args);
301
- this.postalCode = postalCode;
302
- }
303
-
304
- toObject() {
305
- return Object.assign(super.toObject(), {
306
- postal_code: this.postalCode,
307
- });
308
- }
309
- }
310
-
311
- class StatementQuery extends QueryParams {
312
- constructor({ month, year, ...args } = {}) {
313
- super(args);
314
- if (month !== undefined && year !== undefined) {
315
- this.d = { month, year };
316
- }
317
- }
318
-
319
- get month() {
320
- return this._date?.month;
321
- }
322
-
323
- get year() {
324
- return this._date?.year;
325
- }
326
-
327
- set d({ month, year }) {
328
- const m = Number(month);
329
- const y = Number(year);
330
- if (!Number.isInteger(m) || m < 1 || m > 12) {
331
- throw new ValidationError('month must be an integer between 1 and 12');
332
- }
333
- if (!Number.isInteger(y) || y < 1900 || y > 9999) {
334
- throw new ValidationError(
335
- 'year must be an integer between 1900 and 9999',
336
- );
337
- }
338
- const candidate = new Date(Date.UTC(y, m - 1, 1));
339
- const nowUtc = new Date();
340
- const currentMonthStart = new Date(
341
- Date.UTC(nowUtc.getUTCFullYear(), nowUtc.getUTCMonth(), 1),
342
- );
343
- if (candidate.getTime() >= currentMonthStart.getTime()) {
344
- const mm = String(m).padStart(2, '0');
345
- throw new ValidationError(`${y}-${mm} is not a valid year-month pair`);
346
- }
347
-
348
- this._date = { month: m, year: y };
349
- }
350
-
351
- toObject() {
352
- return Object.assign(super.toObject(), {
353
- month: this.month,
354
- year: this.year,
355
- });
356
- }
357
- }
358
-
359
- class TransferQuery extends TransactionQuery {
360
- constructor({
361
- accountNumber,
362
- idempotencyKey,
363
- trackingKey,
364
- network,
365
- ...args
366
- }) {
367
- super(args);
368
- this.accountNumber = accountNumber;
369
- this.idempotencyKey = idempotencyKey;
370
- this.trackingKey = trackingKey;
371
- this.network = network;
372
- }
373
-
374
- toObject() {
375
- return Object.assign(super.toObject(), {
376
- account_number: this.accountNumber,
377
- idempotency_key: this.idempotencyKey,
378
- tracking_key: this.trackingKey,
379
- network: this.network,
380
- });
381
- }
382
- }
383
-
384
- class UserQuery extends QueryParams {
385
- constructor({
386
- clabe,
387
- curp,
388
- emailAddress,
389
- hasCurpDocument,
390
- isBlocked,
391
- name,
392
- phoneNumber,
393
- status,
394
- ...args
395
- } = {}) {
396
- super(args);
397
- this.clabe = clabe;
398
- this.curp = curp;
399
- this.emailAddress = emailAddress;
400
- this.hasCurpDocument = hasCurpDocument;
401
- this.isBlocked = isBlocked;
402
- this.name = name;
403
- this.phoneNumber = phoneNumber;
404
- this.status = status;
405
- }
406
-
407
- toObject() {
408
- return Object.assign(super.toObject(), {
409
- clabe: this.clabe,
410
- curp: this.curp,
411
- email_address: this.emailAddress,
412
- has_curp_document: this.hasCurpDocument,
413
- is_blocked: this.isBlocked,
414
- name: this.name,
415
- phone_number: this.phoneNumber,
416
- status: this.status,
417
- });
418
- }
419
- }
420
-
421
- class UserReportQuery extends QueryParams {
422
- constructor({ committeeMeetingDate, ...args }) {
423
- super(args);
424
- this.committeeMeetingDate = committeeMeetingDate;
425
- }
426
-
427
- toObject() {
428
- return Object.assign(super.toObject(), {
429
- committee_meeting_date: this.committeeMeetingDate,
430
- });
431
- }
432
- }
433
-
434
- class WalletQuery extends QueryParams {
435
- constructor({ active, ...args }) {
436
- super(args);
437
- this.active = active;
438
- }
439
-
440
- toObject() {
441
- return Object.assign(super.toObject(), {
442
- active: this.active,
443
- });
444
- }
445
- }
446
-
447
- class WalletTransactionQuery extends QueryParams {
448
- constructor({ walletUri, ...args }) {
449
- super(args);
450
- this.walletUri = walletUri;
451
- }
452
-
453
- toObject() {
454
- return Object.assign(super.toObject(), {
455
- wallet_uri: this.walletUri,
456
- });
457
- }
458
- }
459
-
460
- class Address {
461
- constructor({
462
- city,
463
- colonia,
464
- country,
465
- createdAt,
466
- extNumber,
467
- fullName,
468
- intNumber,
469
- postalCode,
470
- state,
471
- street,
472
- }) {
473
- this.city = city;
474
- this.colonia = colonia;
475
- this.country = country;
476
- this.createdAt = dateToUTC(createdAt);
477
- this.extNumber = extNumber;
478
- this.fullName = fullName;
479
- this.intNumber = intNumber;
480
- this.postalCode = postalCode;
481
- this.state = state;
482
- this.street = street;
483
- }
484
-
485
- static fromObject = ({ city, colonia, country, state, street, ...obj }) =>
486
- new Address({
487
- city,
488
- colonia,
489
- country,
490
- state,
491
- street,
492
- createdAt: obj.created_at,
493
- extNumber: obj.ext_number,
494
- fullName: obj.full_name,
495
- intNumber: obj.int_number,
496
- postalCode: obj.postal_code,
497
- });
498
- }
499
-
500
- class AlertLog {
501
- constructor({ agent, createdAt, status, updatedAt, comments }) {
502
- this.agent = agent;
503
- this.comments = comments;
504
- this.createdAt = dateToUTC(createdAt);
505
- this.updatedAt = dateToUTC(updatedAt);
506
- this.status = enumValueFromString(AlertStatus, status);
507
- }
508
-
509
- static fromObject = ({ agent, comments, status, ...obj }) =>
510
- new AlertLog({
511
- agent,
512
- comments,
513
- status,
514
- createdAt: obj.created_at,
515
- updatedAt: obj.updated_at,
516
- });
517
- }
518
-
519
- class Audit {
520
- constructor({ hasAudit, auditProvider, auditDate, auditComments }) {
521
- this.hasAudit = hasAudit;
522
- this.auditProvider = auditProvider;
523
- this.auditDate = dateToUTC(auditDate);
524
- this.auditComments = auditComments;
525
- }
526
-
527
- static fromObject = ({ ...obj }) =>
528
- new Audit({
529
- hasAudit: obj.has_audit,
530
- auditProvider: obj.audit_provider,
531
- auditDate: obj.audit_date,
532
- auditComments: obj.audit_comments,
533
- });
534
- }
535
-
536
- class BusinessDetails {
537
- constructor({
538
- accountUsageDescription = null,
539
- businessDescription = null,
540
- } = {}) {
541
- this.accountUsageDescription = accountUsageDescription;
542
- this.businessDescription = businessDescription;
543
- }
544
-
545
- static fromObject = ({ ...obj } = {}) =>
546
- new BusinessDetails({
547
- accountUsageDescription: obj.account_usage_description,
548
- businessDescription: obj.business_description,
549
- });
550
-
551
- toObject() {
552
- return {
553
- account_usage_description: this.accountUsageDescription,
554
- business_description: this.businessDescription,
555
- };
556
- }
557
- }
558
-
559
- class ExternalAccount {
560
- constructor({ bank, account }) {
561
- this.bank = bank;
562
- this.account = account;
563
- }
564
-
565
- static fromObject = ({ account, bank }) =>
566
- new ExternalAccount({
567
- bank,
568
- account,
569
- });
570
- }
571
-
572
- class VerificationError {
573
- constructor({ code, error, identifier, message }) {
574
- this.code = code;
575
- this.error = error;
576
- this.identifier = identifier;
577
- this.message = message;
578
- }
579
-
580
- static fromObject = ({ code, error, identifier, message }) =>
581
- new VerificationError({
582
- code,
583
- error,
584
- identifier,
585
- message,
586
- });
587
- }
588
-
589
- class KYCFile {
590
- constructor({ data, errors, isMx, status, type, uriBack, uriFront }) {
591
- this.data = data;
592
- this.isMx = isMx;
593
- this.status = enumValueFromString(VerificationStatus, status);
594
- this.type = enumValueFromString(KYCFileType, type);
595
- this.uriBack = uriBack;
596
- this.uriFront = uriFront;
597
-
598
- if (errors && errors.length > 0) {
599
- this.errors = errors.map((e) => VerificationError.fromObject(e));
600
- }
601
- }
602
-
603
- static fromObject = ({ data, errors, status, type, ...obj }) =>
604
- new KYCFile({
605
- data,
606
- errors,
607
- status,
608
- type,
609
- isMx: obj.is_mx,
610
- uriBack: obj.uri_back,
611
- uriFront: obj.uri_front,
612
- });
613
- }
614
-
615
- class License {
616
- constructor({
617
- licenseRequired = false,
618
- supervisoryEntity = null,
619
- licenseType = null,
620
- licenseDate = null,
621
- } = {}) {
622
- this.licenseRequired = licenseRequired;
623
- this.supervisoryEntity = supervisoryEntity;
624
- this.licenseType = licenseType;
625
- this.licenseDate = licenseDate ? dateToUTC(licenseDate) : null;
626
- }
627
-
628
- static fromObject = ({ ...obj } = {}) =>
629
- new License({
630
- licenseRequired: obj.license_required,
631
- supervisoryEntity: obj.supervisory_entity,
632
- licenseType: obj.license_type,
633
- licenseDate: obj.license_date,
634
- });
635
- }
636
-
637
- class PhysicalPerson {
638
- constructor({ names, curp, rfc, firstSurname, secondSurname }) {
639
- this.names = names;
640
- this.curp = curp;
641
- this.rfc = rfc;
642
- this.firstSurname = firstSurname;
643
- this.secondSurname = secondSurname;
644
- }
645
-
646
- static fromObject = ({ names, curp, rfc, ...obj }) => {
647
- return new PhysicalPerson({
648
- names,
649
- curp,
650
- rfc,
651
- firstSurname: obj.first_surname,
652
- secondSurname: obj.second_surname,
653
- });
654
- };
655
-
656
- toObject() {
657
- return {
658
- names: this.names,
659
- curp: this.curp,
660
- rfc: this.rfc,
661
- first_surname: this.firstSurname,
662
- second_surname: this.secondSurname,
663
- };
664
- }
665
- }
666
-
667
- class LegalRepresentatives extends PhysicalPerson {
668
- constructor({
669
- names,
670
- curp,
671
- rfc,
672
- firstSurname,
673
- secondSurname,
674
- job,
675
- phoneNumber,
676
- emailAddress,
677
- address,
678
- }) {
679
- super({ names, curp, rfc, firstSurname, secondSurname });
680
- this.job = job;
681
- this.phoneNumber = phoneNumber;
682
- this.emailAddress = emailAddress;
683
- this.address = address;
684
- }
685
-
686
- get address() {
687
- return this._address;
688
- }
689
-
690
- set address(value) {
691
- if (!value) return;
692
- this._address = Address.fromObject(value);
693
- }
694
-
695
- static fromObject = ({ job, address, ...obj }) =>
696
- new LegalRepresentatives({
697
- address,
698
- job,
699
- phoneNumber: obj.phone_number,
700
- emailAddress: obj.email_address,
701
- ...PhysicalPerson.fromObject(obj),
702
- });
703
- }
704
-
705
- class ShareholderPhysical extends PhysicalPerson {
706
- constructor({
707
- names,
708
- curp,
709
- rfc,
710
- firstSurname,
711
- secondSurname,
712
- shareCapital,
713
- percentage,
714
- }) {
715
- super({ names, curp, rfc, firstSurname, secondSurname });
716
- this.shareCapital = shareCapital;
717
- this.percentage = percentage;
718
- }
719
-
720
- static fromObject = ({ percentage, ...obj }) => {
721
- return new ShareholderPhysical({
722
- percentage,
723
- shareCapital: obj.share_capital,
724
- ...PhysicalPerson.fromObject(obj),
725
- });
726
- };
727
- }
728
-
729
- class ShareholderMoral {
730
- constructor({ name, percentage, shareholders, legalRepresentatives }) {
731
- this.name = name;
732
- this.percentage = percentage;
733
- this.shareholders = shareholders;
734
- this.legalRepresentatives = legalRepresentatives;
735
- }
736
-
737
- get shareholders() {
738
- return this._shareholders;
739
- }
740
-
741
- set shareholders(value) {
742
- if (!value) return;
743
- this._shareholders = value.map((sh) => ShareholderPhysical.fromObject(sh));
744
- }
745
-
746
- get legalRepresentatives() {
747
- return this._legalRepresentatives;
748
- }
749
-
750
- set legalRepresentatives(value) {
751
- if (!value) return;
752
- this._legalRepresentatives = value.map((lr) =>
753
- LegalRepresentatives.fromObject(lr),
754
- );
755
- }
756
-
757
- static fromObject = ({ name, percentage, shareholders, ...obj }) => {
758
- return new ShareholderMoral({
759
- name,
760
- percentage,
761
- shareholders: shareholders || [],
762
- legalRepresentatives: obj.legal_representatives || [],
763
- });
764
- };
765
- }
766
-
767
- class TransactionalProfileServices {
768
- constructor({
769
- speiTransfersNum,
770
- speiTransfersAmount,
771
- internalTransfersNum,
772
- internalTransfersAmount,
773
- } = {}) {
774
- this.speiTransfersNum = speiTransfersNum;
775
- this.speiTransfersAmount = speiTransfersAmount;
776
- this.internalTransfersNum = internalTransfersNum;
777
- this.internalTransfersAmount = internalTransfersAmount;
778
- }
779
-
780
- static fromObject = ({ ...obj } = {}) => {
781
- const response = new TransactionalProfileServices({
782
- speiTransfersNum: obj.spei_transfers_num,
783
- speiTransfersAmount: obj.spei_transfers_amount,
784
- internalTransfersNum: obj.internal_transfers_num,
785
- internalTransfersAmount: obj.internal_transfers_amount,
786
- });
787
-
788
- return response;
789
- };
790
- }
791
-
792
- class TOSAgreements {
793
- constructor({ ip, location, type, version }) {
794
- this.ip = ip;
795
- this.location = location;
796
- this.type = type;
797
- this.version = version;
798
- }
799
-
800
- static fromObject = ({ ip, location, type, version }) =>
801
- new TOSAgreements({
802
- ip,
803
- location,
804
- type,
805
- version,
806
- });
807
- }
808
-
809
- class VulnerableActivity {
810
- constructor({
811
- isVulnerableActivity,
812
- hasSatRegister,
813
- satRegisteredDate,
814
- isInCompliance,
815
- }) {
816
- this.isVulnerableActivity = isVulnerableActivity;
817
- this.hasSatRegister = hasSatRegister;
818
- this.satRegisteredDate = dateToUTC(satRegisteredDate);
819
- this.isInCompliance = isInCompliance;
820
- }
821
-
822
- static fromObject = ({ ...obj }) =>
823
- new VulnerableActivity({
824
- isVulnerableActivity: obj.is_vulnerable_activity,
825
- hasSatRegister: obj.has_sat_register,
826
- satRegisteredDate: obj.sat_registered_date,
827
- isInCompliance: obj.is_in_compliance,
828
- });
829
- }
830
-
831
- export { AlertLog as A, BusinessDetails as B, CardsQuery as C, DepositQuery as D, ExternalAccount as E, KYCFile as K, LegalRepresentatives as L, PartnerQuery as P, QueryParams as Q, ShareholderMoral as S, TOSAgreements as T, UserQuery as U, VulnerableActivity as V, WalletQuery as W, Address as a, TransactionalProfileServices as b, Audit as c, License as d, AccountQuery as e, AlertQuery as f, ApiKeyQuery as g, BalanceEntryQuery as h, BillPaymentQuery as i, BridgeAccountQuery as j, BridgeBankAccountQuery as k, BridgeQuery as l, BridgeTransactionQuery as m, CardTransactionQuery as n, PostalCodeQuery as o, StatementQuery as p, TransferQuery as q, UserReportQuery as r, WalletTransactionQuery as s, TransactionQuery as t, VerificationError as u };