@cuenca-mx/cuenca-js 0.0.5-dev.8 → 0.0.5-dev.9

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.
@@ -1,17 +1,3 @@
1
- class BridgeAccountStatus {
2
- static Succeeded = new BridgeAccountStatus('succeeded');
3
-
4
- static NotValidated = new BridgeAccountStatus('not_validated');
5
-
6
- static Failed = new BridgeAccountStatus('failed');
7
-
8
- static OnWaitList = new BridgeAccountStatus('on_wait_list');
9
-
10
- constructor(value) {
11
- this.value = value;
12
- }
13
- }
14
-
15
1
  class CardErrorType {
16
2
  static Blocked = new CardErrorType('blocked');
17
3
 
@@ -139,11 +125,13 @@ class EntryType {
139
125
  }
140
126
 
141
127
  class FileFormat {
142
- static Pdf = new FileFormat('pdf');
128
+ static Pdf = new FileFormat('application/pdf');
143
129
 
144
- static Xml = new FileFormat('xml');
130
+ static Xml = new FileFormat('application/xml');
145
131
 
146
- static Json = new FileFormat('json');
132
+ static Json = new FileFormat('application/json');
133
+
134
+ static Any = new FileFormat('*/*');
147
135
 
148
136
  constructor(value) {
149
137
  this.value = value;
@@ -312,6 +300,26 @@ class UserStatus {
312
300
  }
313
301
  }
314
302
 
303
+ class VerificationStatus {
304
+ static Created = new VerificationStatus('created');
305
+
306
+ static NotVerified = new VerificationStatus('not_verified');
307
+
308
+ static Rejected = new VerificationStatus('rejected');
309
+
310
+ static ReviewNeeded = new VerificationStatus('review_needed');
311
+
312
+ static UploadAgain = new VerificationStatus('upload_again');
313
+
314
+ static Submitted = new VerificationStatus('submitted');
315
+
316
+ static Succeeded = new VerificationStatus('succeeded');
317
+
318
+ constructor(value) {
319
+ this.value = value;
320
+ }
321
+ }
322
+
315
323
  class VerificationType {
316
324
  static Phone = new VerificationType('phone');
317
325
 
@@ -341,4 +349,4 @@ const dateToUTC = (date) => {
341
349
  const enumValueFromString = (enumValue, value) =>
342
350
  Object.values(enumValue).find((enumV) => enumV.value === value);
343
351
 
344
- export { BridgeAccountStatus as B, CardFundingType as C, DepositNetwork as D, EntryType as E, FileFormat as F, KYCFileType as K, Phase as P, SavingCategory as S, TransactionStatus as T, UserStatus as U, VerificationType as V, WalletTransactionType as W, CardIssuer as a, CardStatus as b, CardType as c, dateToUTC as d, enumValueFromString as e, CardErrorType as f, CardTransactionType as g, CommissionType as h, ServiceProviderCategory as i, TransferNetwork as j, KYCStatus as k, TrackDataMethod as l };
352
+ export { CardFundingType as C, DepositNetwork as D, EntryType as E, FileFormat as F, KYCFileType as K, Phase as P, SavingCategory as S, TransactionStatus as T, UserStatus as U, VerificationStatus as V, WalletTransactionType as W, CardIssuer as a, CardStatus as b, CardType as c, dateToUTC as d, enumValueFromString as e, CardErrorType as f, CardTransactionType as g, CommissionType as h, ServiceProviderCategory as i, TransferNetwork as j, VerificationType as k, KYCStatus as l, TrackDataMethod as m };
@@ -1,19 +1,5 @@
1
1
  'use strict';
2
2
 
3
- class BridgeAccountStatus {
4
- static Succeeded = new BridgeAccountStatus('succeeded');
5
-
6
- static NotValidated = new BridgeAccountStatus('not_validated');
7
-
8
- static Failed = new BridgeAccountStatus('failed');
9
-
10
- static OnWaitList = new BridgeAccountStatus('on_wait_list');
11
-
12
- constructor(value) {
13
- this.value = value;
14
- }
15
- }
16
-
17
3
  class CardErrorType {
18
4
  static Blocked = new CardErrorType('blocked');
19
5
 
@@ -141,11 +127,13 @@ class EntryType {
141
127
  }
142
128
 
143
129
  class FileFormat {
144
- static Pdf = new FileFormat('pdf');
130
+ static Pdf = new FileFormat('application/pdf');
145
131
 
146
- static Xml = new FileFormat('xml');
132
+ static Xml = new FileFormat('application/xml');
147
133
 
148
- static Json = new FileFormat('json');
134
+ static Json = new FileFormat('application/json');
135
+
136
+ static Any = new FileFormat('*/*');
149
137
 
150
138
  constructor(value) {
151
139
  this.value = value;
@@ -314,6 +302,26 @@ class UserStatus {
314
302
  }
315
303
  }
316
304
 
305
+ class VerificationStatus {
306
+ static Created = new VerificationStatus('created');
307
+
308
+ static NotVerified = new VerificationStatus('not_verified');
309
+
310
+ static Rejected = new VerificationStatus('rejected');
311
+
312
+ static ReviewNeeded = new VerificationStatus('review_needed');
313
+
314
+ static UploadAgain = new VerificationStatus('upload_again');
315
+
316
+ static Submitted = new VerificationStatus('submitted');
317
+
318
+ static Succeeded = new VerificationStatus('succeeded');
319
+
320
+ constructor(value) {
321
+ this.value = value;
322
+ }
323
+ }
324
+
317
325
  class VerificationType {
318
326
  static Phone = new VerificationType('phone');
319
327
 
@@ -343,7 +351,6 @@ const dateToUTC = (date) => {
343
351
  const enumValueFromString = (enumValue, value) =>
344
352
  Object.values(enumValue).find((enumV) => enumV.value === value);
345
353
 
346
- exports.BridgeAccountStatus = BridgeAccountStatus;
347
354
  exports.CardErrorType = CardErrorType;
348
355
  exports.CardFundingType = CardFundingType;
349
356
  exports.CardIssuer = CardIssuer;
@@ -363,6 +370,7 @@ exports.TrackDataMethod = TrackDataMethod;
363
370
  exports.TransactionStatus = TransactionStatus;
364
371
  exports.TransferNetwork = TransferNetwork;
365
372
  exports.UserStatus = UserStatus;
373
+ exports.VerificationStatus = VerificationStatus;
366
374
  exports.VerificationType = VerificationType;
367
375
  exports.WalletTransactionType = WalletTransactionType;
368
376
  exports.dateToUTC = dateToUTC;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var errors_index = require('./errors/index.cjs');
4
- var data = require('./data-f85a5287.cjs');
4
+ var data = require('./data-d25afb50.cjs');
5
5
 
6
6
  class PageSize {
7
7
  constructor(size) {
@@ -298,19 +298,6 @@ class StatementQuery extends QueryParams {
298
298
  }
299
299
  }
300
300
 
301
- class BridgeAccountQuery extends QueryParams {
302
- constructor({ emailAddress, ...args }) {
303
- super(args);
304
- this.emailAddress = emailAddress;
305
- }
306
-
307
- toObject() {
308
- return Object.assign(super.toObject(), {
309
- email_address: this.emailAddress,
310
- });
311
- }
312
- }
313
-
314
301
  class TOSAgreements {
315
302
  constructor({ ip, location, type, version }) {
316
303
  this.ip = ip;
@@ -328,19 +315,41 @@ class TOSAgreements {
328
315
  });
329
316
  }
330
317
 
318
+ class VerificationError {
319
+ constructor({ code, error, identifier, message }) {
320
+ this.code = code;
321
+ this.error = error;
322
+ this.identifier = identifier;
323
+ this.message = message;
324
+ }
325
+
326
+ static fromObject = ({ code, error, identifier, message }) =>
327
+ new VerificationError({
328
+ code,
329
+ error,
330
+ identifier,
331
+ message,
332
+ });
333
+ }
334
+
331
335
  class KYCFile {
332
- constructor({ data: data$1, isMx, status, type, uriBack, uriFront }) {
336
+ constructor({ data: data$1, errors, isMx, status, type, uriBack, uriFront }) {
333
337
  this.data = data$1;
334
338
  this.isMx = isMx;
335
339
  this.status = data.enumValueFromString(data.KYCStatus, status);
336
340
  this.type = data.enumValueFromString(data.KYCFileType, type);
337
341
  this.uriBack = uriBack;
338
342
  this.uriFront = uriFront;
343
+
344
+ if (errors && errors.length > 0) {
345
+ this.errors = errors.map((e) => VerificationError.fromObject(e));
346
+ }
339
347
  }
340
348
 
341
- static fromObject = ({ data, status, type, ...obj }) =>
349
+ static fromObject = ({ data, errors, status, type, ...obj }) =>
342
350
  new KYCFile({
343
351
  data,
352
+ errors,
344
353
  status,
345
354
  type,
346
355
  isMx: obj.is_mx,
@@ -349,11 +358,48 @@ class KYCFile {
349
358
  });
350
359
  }
351
360
 
361
+ class Address {
362
+ constructor({
363
+ city,
364
+ country,
365
+ createdAt,
366
+ extNumber,
367
+ fullName,
368
+ intNumber,
369
+ postalCode,
370
+ state,
371
+ street,
372
+ }) {
373
+ this.city = city;
374
+ this.country = country;
375
+ this.createdAt = data.dateToUTC(createdAt);
376
+ this.extNumber = extNumber;
377
+ this.fullName = fullName;
378
+ this.intNumber = intNumber;
379
+ this.postalCode = postalCode;
380
+ this.state = state;
381
+ this.street = street;
382
+ }
383
+
384
+ static fromObject = ({ city, country, state, street, ...obj }) =>
385
+ new Address({
386
+ city,
387
+ country,
388
+ state,
389
+ street,
390
+ createdAt: obj.created_at,
391
+ extNumber: obj.ext_number,
392
+ fullName: obj.full_name,
393
+ intNumber: obj.int_number,
394
+ postalCode: obj.postal_code,
395
+ });
396
+ }
397
+
352
398
  exports.AccountQuery = AccountQuery;
399
+ exports.Address = Address;
353
400
  exports.ApiKeyQuery = ApiKeyQuery;
354
401
  exports.BalanceEntryQuery = BalanceEntryQuery;
355
402
  exports.BillPaymentQuery = BillPaymentQuery;
356
- exports.BridgeAccountQuery = BridgeAccountQuery;
357
403
  exports.CardTransactionQuery = CardTransactionQuery;
358
404
  exports.CardsQuery = CardsQuery;
359
405
  exports.DepositQuery = DepositQuery;
@@ -362,6 +408,7 @@ exports.PageSize = PageSize;
362
408
  exports.QueryParams = QueryParams;
363
409
  exports.StatementQuery = StatementQuery;
364
410
  exports.TOSAgreements = TOSAgreements;
411
+ exports.TransactionQuery = TransactionQuery;
365
412
  exports.TransferQuery = TransferQuery;
366
413
  exports.UserQuery = UserQuery;
367
414
  exports.WalletQuery = WalletQuery;
@@ -1,5 +1,5 @@
1
1
  import { ValidationError } from './errors/index.mjs';
2
- import { d as dateToUTC, e as enumValueFromString, K as KYCFileType, k as KYCStatus } from './data-487ea691.mjs';
2
+ import { d as dateToUTC, e as enumValueFromString, l as KYCStatus, K as KYCFileType } from './data-86ddd935.mjs';
3
3
 
4
4
  class PageSize {
5
5
  constructor(size) {
@@ -296,19 +296,6 @@ class StatementQuery extends QueryParams {
296
296
  }
297
297
  }
298
298
 
299
- class BridgeAccountQuery extends QueryParams {
300
- constructor({ emailAddress, ...args }) {
301
- super(args);
302
- this.emailAddress = emailAddress;
303
- }
304
-
305
- toObject() {
306
- return Object.assign(super.toObject(), {
307
- email_address: this.emailAddress,
308
- });
309
- }
310
- }
311
-
312
299
  class TOSAgreements {
313
300
  constructor({ ip, location, type, version }) {
314
301
  this.ip = ip;
@@ -326,19 +313,41 @@ class TOSAgreements {
326
313
  });
327
314
  }
328
315
 
316
+ class VerificationError {
317
+ constructor({ code, error, identifier, message }) {
318
+ this.code = code;
319
+ this.error = error;
320
+ this.identifier = identifier;
321
+ this.message = message;
322
+ }
323
+
324
+ static fromObject = ({ code, error, identifier, message }) =>
325
+ new VerificationError({
326
+ code,
327
+ error,
328
+ identifier,
329
+ message,
330
+ });
331
+ }
332
+
329
333
  class KYCFile {
330
- constructor({ data, isMx, status, type, uriBack, uriFront }) {
334
+ constructor({ data, errors, isMx, status, type, uriBack, uriFront }) {
331
335
  this.data = data;
332
336
  this.isMx = isMx;
333
337
  this.status = enumValueFromString(KYCStatus, status);
334
338
  this.type = enumValueFromString(KYCFileType, type);
335
339
  this.uriBack = uriBack;
336
340
  this.uriFront = uriFront;
341
+
342
+ if (errors && errors.length > 0) {
343
+ this.errors = errors.map((e) => VerificationError.fromObject(e));
344
+ }
337
345
  }
338
346
 
339
- static fromObject = ({ data, status, type, ...obj }) =>
347
+ static fromObject = ({ data, errors, status, type, ...obj }) =>
340
348
  new KYCFile({
341
349
  data,
350
+ errors,
342
351
  status,
343
352
  type,
344
353
  isMx: obj.is_mx,
@@ -347,4 +356,41 @@ class KYCFile {
347
356
  });
348
357
  }
349
358
 
350
- export { AccountQuery as A, BalanceEntryQuery as B, CardsQuery as C, DepositQuery as D, KYCFile as K, PageSize as P, QueryParams as Q, StatementQuery as S, TOSAgreements as T, UserQuery as U, WalletQuery as W, ApiKeyQuery as a, BillPaymentQuery as b, BridgeAccountQuery as c, CardTransactionQuery as d, TransferQuery as e, WalletTransactionQuery as f };
359
+ class Address {
360
+ constructor({
361
+ city,
362
+ country,
363
+ createdAt,
364
+ extNumber,
365
+ fullName,
366
+ intNumber,
367
+ postalCode,
368
+ state,
369
+ street,
370
+ }) {
371
+ this.city = city;
372
+ this.country = country;
373
+ this.createdAt = dateToUTC(createdAt);
374
+ this.extNumber = extNumber;
375
+ this.fullName = fullName;
376
+ this.intNumber = intNumber;
377
+ this.postalCode = postalCode;
378
+ this.state = state;
379
+ this.street = street;
380
+ }
381
+
382
+ static fromObject = ({ city, country, state, street, ...obj }) =>
383
+ new Address({
384
+ city,
385
+ country,
386
+ state,
387
+ street,
388
+ createdAt: obj.created_at,
389
+ extNumber: obj.ext_number,
390
+ fullName: obj.full_name,
391
+ intNumber: obj.int_number,
392
+ postalCode: obj.postal_code,
393
+ });
394
+ }
395
+
396
+ export { Address as A, BalanceEntryQuery as B, CardsQuery as C, DepositQuery as D, KYCFile as K, PageSize as P, QueryParams as Q, StatementQuery as S, TOSAgreements as T, UserQuery as U, WalletQuery as W, AccountQuery as a, ApiKeyQuery as b, BillPaymentQuery as c, CardTransactionQuery as d, TransferQuery as e, WalletTransactionQuery as f, TransactionQuery as g };