@cuenca-mx/cuenca-js 0.0.1-dev.38 → 0.0.1-dev.40
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-69952249.mjs +330 -0
- package/build/data-efb53250.cjs +354 -0
- package/build/identities-5e48f342.mjs +337 -0
- package/build/identities-93faf1ed.cjs +354 -0
- package/build/index.cjs +73 -31
- package/build/index.mjs +46 -4
- package/build/requests/index.cjs +4 -2
- package/build/requests/index.mjs +2 -2
- package/build/types/index.cjs +23 -22
- package/build/types/index.mjs +2 -2
- package/build/umd/cuenca.umd.js +1 -1
- package/build/{walletTransactionRequest-e01a169f.mjs → walletTransactionRequest-3b0c406d.mjs} +65 -2
- package/build/{walletTransactionRequest-277144d0.cjs → walletTransactionRequest-832088b1.cjs} +66 -1
- package/package.json +2 -3
- package/build/data-9edbb2a0.cjs +0 -13
- package/build/data-d5bcb7c8.mjs +0 -10
- package/build/identities-3d77cc91.cjs +0 -684
- package/build/identities-f06b09d1.mjs +0 -647
|
@@ -1,647 +0,0 @@
|
|
|
1
|
-
import { ValidationError } from './errors/index.mjs';
|
|
2
|
-
import { d as dateToUTC, e as enumValueFromString } from './data-d5bcb7c8.mjs';
|
|
3
|
-
|
|
4
|
-
class CardErrorType {
|
|
5
|
-
static Blocked = new CardErrorType('blocked');
|
|
6
|
-
|
|
7
|
-
static Comunication = new CardErrorType('comunication');
|
|
8
|
-
|
|
9
|
-
static ContactlesAmountLimit = new CardErrorType('contactles_amount_limit');
|
|
10
|
-
|
|
11
|
-
static FraudDetection = new CardErrorType('fraud_detection');
|
|
12
|
-
|
|
13
|
-
static FraudDetectionUncertain = new CardErrorType(
|
|
14
|
-
'fraud_detection_uncertain',
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
static InsufficientFounds = new CardErrorType('insufficient_founds');
|
|
18
|
-
|
|
19
|
-
static InvalidPin = new CardErrorType('invalid_pin');
|
|
20
|
-
|
|
21
|
-
static Notification = new CardErrorType('notification');
|
|
22
|
-
|
|
23
|
-
static NotificationDeactivatedCard = new CardErrorType(
|
|
24
|
-
'notification_deactivated_card',
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
constructor(value) {
|
|
28
|
-
this.value = value;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
class CardFundingType {
|
|
33
|
-
static Credit = new CardFundingType('credit');
|
|
34
|
-
|
|
35
|
-
static Debit = new CardFundingType('debit');
|
|
36
|
-
|
|
37
|
-
constructor(value) {
|
|
38
|
-
this.value = value;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
class CardIssuer {
|
|
43
|
-
static Accendo = new CardIssuer('accendo');
|
|
44
|
-
|
|
45
|
-
static Cuenca = new CardIssuer('cuenca');
|
|
46
|
-
|
|
47
|
-
constructor(value) {
|
|
48
|
-
this.value = value;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
class CardStatus {
|
|
53
|
-
static Active = new CardStatus('active');
|
|
54
|
-
|
|
55
|
-
static Blocked = new CardStatus('blocked');
|
|
56
|
-
|
|
57
|
-
static Created = new CardStatus('created');
|
|
58
|
-
|
|
59
|
-
static Deactivated = new CardStatus('deactivated');
|
|
60
|
-
|
|
61
|
-
static Printing = new CardStatus('printing');
|
|
62
|
-
|
|
63
|
-
constructor(value) {
|
|
64
|
-
this.value = value;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
class CardTransactionType {
|
|
69
|
-
static Auth = new CardTransactionType('auth');
|
|
70
|
-
|
|
71
|
-
static Capture = new CardTransactionType('capture');
|
|
72
|
-
|
|
73
|
-
static Chargeback = new CardTransactionType('chargeback');
|
|
74
|
-
|
|
75
|
-
static Expiration = new CardTransactionType('expiration');
|
|
76
|
-
|
|
77
|
-
static Refund = new CardTransactionType('refund');
|
|
78
|
-
|
|
79
|
-
static Void = new CardTransactionType('void');
|
|
80
|
-
|
|
81
|
-
constructor(value) {
|
|
82
|
-
this.value = value;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
class CardType {
|
|
87
|
-
static Physical = new CardType('physical');
|
|
88
|
-
|
|
89
|
-
static Virtual = new CardType('virtual');
|
|
90
|
-
|
|
91
|
-
constructor(value) {
|
|
92
|
-
this.value = value;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
class CommissionType {
|
|
97
|
-
static CardRequest = new CommissionType('card_request');
|
|
98
|
-
|
|
99
|
-
static CashDeposit = new CommissionType('cash_deposit');
|
|
100
|
-
|
|
101
|
-
static OutgoingSpei = new CommissionType('outgoing_spei');
|
|
102
|
-
|
|
103
|
-
constructor(value) {
|
|
104
|
-
this.value = value;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
class DepositNetwork {
|
|
109
|
-
static Cash = new DepositNetwork('cash');
|
|
110
|
-
|
|
111
|
-
static Internal = new DepositNetwork('internal');
|
|
112
|
-
|
|
113
|
-
static Spei = new DepositNetwork('spei');
|
|
114
|
-
|
|
115
|
-
constructor(value) {
|
|
116
|
-
this.value = value;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
class EntryType {
|
|
121
|
-
static Credit = new EntryType('credit');
|
|
122
|
-
|
|
123
|
-
static Debit = new EntryType('debit');
|
|
124
|
-
|
|
125
|
-
constructor(value) {
|
|
126
|
-
this.value = value;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
class FileFormat {
|
|
131
|
-
static Pdf = new FileFormat('pdf');
|
|
132
|
-
|
|
133
|
-
static Xml = new FileFormat('xml');
|
|
134
|
-
|
|
135
|
-
static Json = new FileFormat('json');
|
|
136
|
-
|
|
137
|
-
constructor(value) {
|
|
138
|
-
this.value = value;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
class KYCFileType {
|
|
143
|
-
static Ine = new KYCFileType('ine');
|
|
144
|
-
|
|
145
|
-
static Passport = new KYCFileType('passport');
|
|
146
|
-
|
|
147
|
-
static Residency = new KYCFileType('residency');
|
|
148
|
-
|
|
149
|
-
static MatriculaConsular = new KYCFileType('matricula_consular');
|
|
150
|
-
|
|
151
|
-
static ProofOfLiveness = new KYCFileType('proof_of_liveness');
|
|
152
|
-
|
|
153
|
-
static ProofOfAddress = new KYCFileType('proof_of_address');
|
|
154
|
-
|
|
155
|
-
constructor(value) {
|
|
156
|
-
this.value = value;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
class KYCStatus {
|
|
161
|
-
static UploadAgain = new KYCStatus('upload_again');
|
|
162
|
-
|
|
163
|
-
static ReviewNeeded = new KYCStatus('review_needed');
|
|
164
|
-
|
|
165
|
-
static Submitted = new KYCStatus('submitted');
|
|
166
|
-
|
|
167
|
-
static Succeeded = new KYCStatus('succeeded');
|
|
168
|
-
|
|
169
|
-
constructor(value) {
|
|
170
|
-
this.value = value;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
class Phase {
|
|
175
|
-
static Sandbox = new Phase('sandbox');
|
|
176
|
-
|
|
177
|
-
static Stage = new Phase('stage');
|
|
178
|
-
|
|
179
|
-
static Api = new Phase('api');
|
|
180
|
-
|
|
181
|
-
constructor(value) {
|
|
182
|
-
this.value = value;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
class ServiceProviderCategory {
|
|
187
|
-
static Cable = new ServiceProviderCategory('cable');
|
|
188
|
-
|
|
189
|
-
static CreditCard = new ServiceProviderCategory('credit_card');
|
|
190
|
-
|
|
191
|
-
static Electricity = new ServiceProviderCategory('electricity');
|
|
192
|
-
|
|
193
|
-
static Gas = new ServiceProviderCategory('gas');
|
|
194
|
-
|
|
195
|
-
static Internet = new ServiceProviderCategory('internet');
|
|
196
|
-
|
|
197
|
-
static LandlineTelephone = new ServiceProviderCategory('landline_telephone');
|
|
198
|
-
|
|
199
|
-
static MobileTelephonePostpaid = new ServiceProviderCategory(
|
|
200
|
-
'mobile_telephone_postpaid',
|
|
201
|
-
);
|
|
202
|
-
|
|
203
|
-
static MobileTelephonePrepaid = new ServiceProviderCategory(
|
|
204
|
-
'mobile_telephone_prepaid',
|
|
205
|
-
);
|
|
206
|
-
|
|
207
|
-
static SateliteTelevision = new ServiceProviderCategory(
|
|
208
|
-
'satelite_television',
|
|
209
|
-
);
|
|
210
|
-
|
|
211
|
-
static Water = new ServiceProviderCategory('water');
|
|
212
|
-
|
|
213
|
-
constructor(value) {
|
|
214
|
-
this.value = value;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
class SavingCategory {
|
|
219
|
-
static General = new SavingCategory('general');
|
|
220
|
-
|
|
221
|
-
static Home = new SavingCategory('home');
|
|
222
|
-
|
|
223
|
-
static Vehicle = new SavingCategory('vehicle');
|
|
224
|
-
|
|
225
|
-
static Travel = new SavingCategory('travel');
|
|
226
|
-
|
|
227
|
-
static Clothing = new SavingCategory('clothing');
|
|
228
|
-
|
|
229
|
-
static Other = new SavingCategory('other');
|
|
230
|
-
|
|
231
|
-
static Medical = new SavingCategory('medical');
|
|
232
|
-
|
|
233
|
-
static Accident = new SavingCategory('accident');
|
|
234
|
-
|
|
235
|
-
static Education = new SavingCategory('education');
|
|
236
|
-
|
|
237
|
-
constructor(value) {
|
|
238
|
-
this.value = value;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
class TrackDataMethod {
|
|
243
|
-
static NotSet = new TrackDataMethod('not_set');
|
|
244
|
-
|
|
245
|
-
static Terminal = new TrackDataMethod('terminal');
|
|
246
|
-
|
|
247
|
-
static Manual = new TrackDataMethod('manual');
|
|
248
|
-
|
|
249
|
-
static Unknown = new TrackDataMethod('unknown');
|
|
250
|
-
|
|
251
|
-
static Contactless = new TrackDataMethod('contactless');
|
|
252
|
-
|
|
253
|
-
static FallBack = new TrackDataMethod('fall_back');
|
|
254
|
-
|
|
255
|
-
static MagneticStripe = new TrackDataMethod('magnetic_stripe');
|
|
256
|
-
|
|
257
|
-
static RecurringCharge = new TrackDataMethod('recurring_charge');
|
|
258
|
-
|
|
259
|
-
constructor(value) {
|
|
260
|
-
this.value = value;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
class TransactionStatus {
|
|
265
|
-
static Created = new TransactionStatus('created');
|
|
266
|
-
|
|
267
|
-
static Failed = new TransactionStatus('failed');
|
|
268
|
-
|
|
269
|
-
static InReview = new TransactionStatus('in_review');
|
|
270
|
-
|
|
271
|
-
static Submitted = new TransactionStatus('submitted');
|
|
272
|
-
|
|
273
|
-
static Succeeded = new TransactionStatus('succeeded');
|
|
274
|
-
|
|
275
|
-
constructor(value) {
|
|
276
|
-
this.value = value;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
class TransferNetwork {
|
|
281
|
-
static Internal = new TransferNetwork('internal');
|
|
282
|
-
|
|
283
|
-
static Spei = new TransferNetwork('spei');
|
|
284
|
-
|
|
285
|
-
constructor(value) {
|
|
286
|
-
this.value = value;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
class UserStatus {
|
|
291
|
-
static Active = new UserStatus('active');
|
|
292
|
-
|
|
293
|
-
static Deactivated = new UserStatus('deactivated');
|
|
294
|
-
|
|
295
|
-
static Fraud = new UserStatus('fraud');
|
|
296
|
-
|
|
297
|
-
static PldBlocked = new UserStatus('pld_blocked');
|
|
298
|
-
|
|
299
|
-
constructor(value) {
|
|
300
|
-
this.value = value;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
class WalletTransactionType {
|
|
305
|
-
static Deposit = new WalletTransactionType('deposit');
|
|
306
|
-
|
|
307
|
-
static Withdrawal = new WalletTransactionType('withdrawal');
|
|
308
|
-
|
|
309
|
-
constructor(value) {
|
|
310
|
-
this.value = value;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
class PageSize {
|
|
315
|
-
constructor(size) {
|
|
316
|
-
this.maxSize = 100;
|
|
317
|
-
this._ps = size;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
get size() {
|
|
321
|
-
return this._pageSize;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
set _ps(value) {
|
|
325
|
-
let validatedPageSize = this.maxSize;
|
|
326
|
-
if (value && value > 0 && value <= this.maxSize) {
|
|
327
|
-
validatedPageSize = value;
|
|
328
|
-
}
|
|
329
|
-
this._pageSize = validatedPageSize;
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
class QueryParams {
|
|
334
|
-
constructor({
|
|
335
|
-
createdAfter,
|
|
336
|
-
createdBefore,
|
|
337
|
-
limit,
|
|
338
|
-
pageSize,
|
|
339
|
-
relatedTransaction,
|
|
340
|
-
userId,
|
|
341
|
-
count = false,
|
|
342
|
-
}) {
|
|
343
|
-
this.createdAfter = createdAfter;
|
|
344
|
-
this.createdBefore = createdBefore;
|
|
345
|
-
this._lmt = limit;
|
|
346
|
-
this.relatedTransaction = relatedTransaction;
|
|
347
|
-
this.userId = userId;
|
|
348
|
-
this.count = count;
|
|
349
|
-
this.pageSize = pageSize;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
get limit() {
|
|
353
|
-
return this._limit;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
// Validator for limit
|
|
357
|
-
set _lmt(value) {
|
|
358
|
-
let validatedValue = null;
|
|
359
|
-
if (value && value >= 0) {
|
|
360
|
-
validatedValue = value;
|
|
361
|
-
}
|
|
362
|
-
this._limit = validatedValue;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
toObject() {
|
|
366
|
-
return {
|
|
367
|
-
created_after: this.createdAfter,
|
|
368
|
-
created_before: this.createdBefore,
|
|
369
|
-
limit: this.limit,
|
|
370
|
-
related_transaction: this.relatedTransaction,
|
|
371
|
-
user_id: this.userId,
|
|
372
|
-
page_size: this.pageSize && this.pageSize.size,
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
toParams() {
|
|
377
|
-
const helper = { ...this.toObject() };
|
|
378
|
-
if (this.count) helper.count = 1;
|
|
379
|
-
Object.keys(helper).forEach((k) => {
|
|
380
|
-
if (helper[k] == null) delete helper[k];
|
|
381
|
-
});
|
|
382
|
-
return helper;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
toQueryString() {
|
|
386
|
-
return new URLSearchParams(this.toParams()).toString();
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
class AccountQuery extends QueryParams {
|
|
391
|
-
constructor({ accountNumber, ...args }) {
|
|
392
|
-
super(args);
|
|
393
|
-
this.accountNumber = accountNumber;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
toObject() {
|
|
397
|
-
return Object.assign(super.toObject(), {
|
|
398
|
-
account_number: this.accountNumber,
|
|
399
|
-
});
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
class ApiKeyQuery extends QueryParams {
|
|
404
|
-
constructor({ active, ...args }) {
|
|
405
|
-
super(args);
|
|
406
|
-
this.active = active;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
toObject() {
|
|
410
|
-
return Object.assign(super.toObject(), {
|
|
411
|
-
active: this.active,
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
class TransactionQuery extends QueryParams {
|
|
417
|
-
constructor({ status, ...args }) {
|
|
418
|
-
super(args);
|
|
419
|
-
this.status = status;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
toObject() {
|
|
423
|
-
return Object.assign(super.toObject(), {
|
|
424
|
-
status: this.status,
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
class DepositQuery extends TransactionQuery {
|
|
430
|
-
constructor({ trackingKey, network, ...args }) {
|
|
431
|
-
super(args);
|
|
432
|
-
this.trackingKey = trackingKey;
|
|
433
|
-
this.network = network;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
toObject() {
|
|
437
|
-
return Object.assign(super.toObject(), {
|
|
438
|
-
tracking_key: this.trackingKey,
|
|
439
|
-
network: this.network,
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
class TransferQuery extends TransactionQuery {
|
|
445
|
-
constructor({
|
|
446
|
-
accountNumber,
|
|
447
|
-
idempotencyKey,
|
|
448
|
-
trackingKey,
|
|
449
|
-
network,
|
|
450
|
-
...args
|
|
451
|
-
}) {
|
|
452
|
-
super(args);
|
|
453
|
-
this.accountNumber = accountNumber;
|
|
454
|
-
this.idempotencyKey = idempotencyKey;
|
|
455
|
-
this.trackingKey = trackingKey;
|
|
456
|
-
this.network = network;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
toObject() {
|
|
460
|
-
return Object.assign(super.toObject(), {
|
|
461
|
-
account_number: this.accountNumber,
|
|
462
|
-
idempotency_key: this.idempotencyKey,
|
|
463
|
-
tracking_key: this.trackingKey,
|
|
464
|
-
network: this.network,
|
|
465
|
-
});
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
class BalanceEntryQuery extends QueryParams {
|
|
470
|
-
constructor({
|
|
471
|
-
fundingInstrumentUri,
|
|
472
|
-
count = false,
|
|
473
|
-
walletId = 'default',
|
|
474
|
-
...args
|
|
475
|
-
}) {
|
|
476
|
-
super(args);
|
|
477
|
-
this.fundingInstrumentUri = fundingInstrumentUri;
|
|
478
|
-
this.count = count;
|
|
479
|
-
this.walletId = walletId;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
toObject() {
|
|
483
|
-
return Object.assign(super.toObject(), {
|
|
484
|
-
wallet_id: this.walletId,
|
|
485
|
-
funding_instrument_uri: this.fundingInstrumentUri,
|
|
486
|
-
count: this.count,
|
|
487
|
-
});
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
class BillPaymentQuery extends QueryParams {
|
|
492
|
-
constructor({ accountNumber, ...args }) {
|
|
493
|
-
super(args);
|
|
494
|
-
this.accountNumber = accountNumber;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
toObject() {
|
|
498
|
-
return Object.assign(super.toObject(), {
|
|
499
|
-
account_number: this.accountNumber,
|
|
500
|
-
});
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
class CardTransactionQuery extends QueryParams {
|
|
505
|
-
constructor({ cardUri, ...args }) {
|
|
506
|
-
super(args);
|
|
507
|
-
this.cardUri = cardUri;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
toObject() {
|
|
511
|
-
return Object.assign(super.toObject(), {
|
|
512
|
-
card_uri: this.cardUri,
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
class CardsQuery extends QueryParams {
|
|
518
|
-
constructor({ cardUri, count = false, ...args }) {
|
|
519
|
-
super(args);
|
|
520
|
-
this.cardUri = cardUri;
|
|
521
|
-
this.count = count;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
toObject() {
|
|
525
|
-
return Object.assign(super.toObject(), {
|
|
526
|
-
card_uri: this.cardUri,
|
|
527
|
-
count: this.count,
|
|
528
|
-
});
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
class WalletTransactionQuery extends QueryParams {
|
|
533
|
-
constructor({ walletUri, ...args }) {
|
|
534
|
-
super(args);
|
|
535
|
-
this.walletUri = walletUri;
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
toObject() {
|
|
539
|
-
return Object.assign(super.toObject(), {
|
|
540
|
-
wallet_uri: this.walletUri,
|
|
541
|
-
});
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
class UserQuery extends QueryParams {
|
|
546
|
-
constructor({ emailAddress, phoneNumber, status, ...args }) {
|
|
547
|
-
super(args);
|
|
548
|
-
this.emailAddress = emailAddress;
|
|
549
|
-
this.phoneNumber = phoneNumber;
|
|
550
|
-
this.status = status;
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
toObject() {
|
|
554
|
-
return Object.assign(super.toObject(), {
|
|
555
|
-
email_address: this.emailAddress,
|
|
556
|
-
phone_number: this.phoneNumber,
|
|
557
|
-
status: this.status,
|
|
558
|
-
});
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
class WalletQuery extends QueryParams {
|
|
563
|
-
constructor({ active, ...args }) {
|
|
564
|
-
super(args);
|
|
565
|
-
this.active = active;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
toObject() {
|
|
569
|
-
return Object.assign(super.toObject(), {
|
|
570
|
-
active: this.active,
|
|
571
|
-
});
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
class StatementQuery extends QueryParams {
|
|
576
|
-
constructor({ month, year, ...args }) {
|
|
577
|
-
super(args);
|
|
578
|
-
this.d = { month, year };
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
get month() {
|
|
582
|
-
return this._date.month;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
get year() {
|
|
586
|
-
return this._date.year;
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
set d({ month, year }) {
|
|
590
|
-
const now = dateToUTC(Date.now());
|
|
591
|
-
now.setUTCDate(1);
|
|
592
|
-
const date = dateToUTC(`${year}-${month}-01`);
|
|
593
|
-
if (date.getTime() >= now.getTime()) {
|
|
594
|
-
throw new ValidationError(
|
|
595
|
-
`${year}-${month} is not a valid year-month pair`,
|
|
596
|
-
);
|
|
597
|
-
}
|
|
598
|
-
this._date = { month, year };
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
toObject() {
|
|
602
|
-
return Object.assign(super.toObject(), {
|
|
603
|
-
month: this.month,
|
|
604
|
-
year: this.year,
|
|
605
|
-
});
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
class TOSAgreements {
|
|
610
|
-
constructor({ ip, location, type, version }) {
|
|
611
|
-
this.ip = ip;
|
|
612
|
-
this.location = location;
|
|
613
|
-
this.type = type;
|
|
614
|
-
this.version = version;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
static fromObject = ({ ip, location, type, version }) =>
|
|
618
|
-
new TOSAgreements({
|
|
619
|
-
ip,
|
|
620
|
-
location,
|
|
621
|
-
type,
|
|
622
|
-
version,
|
|
623
|
-
});
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
class KYCFile {
|
|
627
|
-
constructor({ data, isMx, status, type, uriBack, uriFront }) {
|
|
628
|
-
this.data = data;
|
|
629
|
-
this.isMx = isMx;
|
|
630
|
-
this.status = enumValueFromString(KYCStatus, status);
|
|
631
|
-
this.type = enumValueFromString(KYCFileType, type);
|
|
632
|
-
this.uriBack = uriBack;
|
|
633
|
-
this.uriFront = uriFront;
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
static fromObject = ({ data, status, type, ...obj }) =>
|
|
637
|
-
new KYCFile({
|
|
638
|
-
data,
|
|
639
|
-
status,
|
|
640
|
-
type,
|
|
641
|
-
isMx: obj.is_mx,
|
|
642
|
-
uriBack: obj.uri_back,
|
|
643
|
-
uriFront: obj.uri_front,
|
|
644
|
-
});
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
export { AccountQuery as A, BalanceEntryQuery as B, CardFundingType as C, DepositNetwork as D, EntryType as E, FileFormat as F, KYCFile as K, Phase as P, QueryParams as Q, SavingCategory as S, TransactionStatus as T, UserStatus as U, WalletTransactionType as W, CardIssuer as a, CardStatus as b, CardType as c, CardErrorType as d, CardTransactionType as e, CommissionType as f, ServiceProviderCategory as g, TransferNetwork as h, TOSAgreements as i, ApiKeyQuery as j, BillPaymentQuery as k, CardsQuery as l, CardTransactionQuery as m, DepositQuery as n, WalletQuery as o, StatementQuery as p, TransferQuery as q, UserQuery as r, WalletTransactionQuery as s, KYCFileType as t, KYCStatus as u, TrackDataMethod as v, PageSize as w };
|