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