@cuenca-mx/cuenca-js 0.0.5-dev.10 → 0.0.5-dev.12

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,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;
@@ -171,7 +159,11 @@ class KYCFileType {
171
159
  }
172
160
 
173
161
  class KYCStatus {
174
- static UploadAgain = new KYCStatus('upload_again');
162
+ static Created = new KYCStatus('created');
163
+
164
+ static NotVerified = new KYCStatus('not_verified');
165
+
166
+ static Rejected = new KYCStatus('rejected');
175
167
 
176
168
  static ReviewNeeded = new KYCStatus('review_needed');
177
169
 
@@ -179,6 +171,8 @@ class KYCStatus {
179
171
 
180
172
  static Succeeded = new KYCStatus('succeeded');
181
173
 
174
+ static UploadAgain = new KYCStatus('upload_again');
175
+
182
176
  constructor(value) {
183
177
  this.value = value;
184
178
  }
@@ -314,6 +308,26 @@ class UserStatus {
314
308
  }
315
309
  }
316
310
 
311
+ class VerificationStatus {
312
+ static Created = new VerificationStatus('created');
313
+
314
+ static NotVerified = new VerificationStatus('not_verified');
315
+
316
+ static Rejected = new VerificationStatus('rejected');
317
+
318
+ static ReviewNeeded = new VerificationStatus('review_needed');
319
+
320
+ static UploadAgain = new VerificationStatus('upload_again');
321
+
322
+ static Submitted = new VerificationStatus('submitted');
323
+
324
+ static Succeeded = new VerificationStatus('succeeded');
325
+
326
+ constructor(value) {
327
+ this.value = value;
328
+ }
329
+ }
330
+
317
331
  class VerificationType {
318
332
  static Phone = new VerificationType('phone');
319
333
 
@@ -343,7 +357,6 @@ const dateToUTC = (date) => {
343
357
  const enumValueFromString = (enumValue, value) =>
344
358
  Object.values(enumValue).find((enumV) => enumV.value === value);
345
359
 
346
- exports.BridgeAccountStatus = BridgeAccountStatus;
347
360
  exports.CardErrorType = CardErrorType;
348
361
  exports.CardFundingType = CardFundingType;
349
362
  exports.CardIssuer = CardIssuer;
@@ -363,6 +376,7 @@ exports.TrackDataMethod = TrackDataMethod;
363
376
  exports.TransactionStatus = TransactionStatus;
364
377
  exports.TransferNetwork = TransferNetwork;
365
378
  exports.UserStatus = UserStatus;
379
+ exports.VerificationStatus = VerificationStatus;
366
380
  exports.VerificationType = VerificationType;
367
381
  exports.WalletTransactionType = WalletTransactionType;
368
382
  exports.dateToUTC = dateToUTC;
@@ -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;
@@ -169,7 +157,11 @@ class KYCFileType {
169
157
  }
170
158
 
171
159
  class KYCStatus {
172
- static UploadAgain = new KYCStatus('upload_again');
160
+ static Created = new KYCStatus('created');
161
+
162
+ static NotVerified = new KYCStatus('not_verified');
163
+
164
+ static Rejected = new KYCStatus('rejected');
173
165
 
174
166
  static ReviewNeeded = new KYCStatus('review_needed');
175
167
 
@@ -177,6 +169,8 @@ class KYCStatus {
177
169
 
178
170
  static Succeeded = new KYCStatus('succeeded');
179
171
 
172
+ static UploadAgain = new KYCStatus('upload_again');
173
+
180
174
  constructor(value) {
181
175
  this.value = value;
182
176
  }
@@ -312,6 +306,26 @@ class UserStatus {
312
306
  }
313
307
  }
314
308
 
309
+ class VerificationStatus {
310
+ static Created = new VerificationStatus('created');
311
+
312
+ static NotVerified = new VerificationStatus('not_verified');
313
+
314
+ static Rejected = new VerificationStatus('rejected');
315
+
316
+ static ReviewNeeded = new VerificationStatus('review_needed');
317
+
318
+ static UploadAgain = new VerificationStatus('upload_again');
319
+
320
+ static Submitted = new VerificationStatus('submitted');
321
+
322
+ static Succeeded = new VerificationStatus('succeeded');
323
+
324
+ constructor(value) {
325
+ this.value = value;
326
+ }
327
+ }
328
+
315
329
  class VerificationType {
316
330
  static Phone = new VerificationType('phone');
317
331
 
@@ -341,4 +355,4 @@ const dateToUTC = (date) => {
341
355
  const enumValueFromString = (enumValue, value) =>
342
356
  Object.values(enumValue).find((enumV) => enumV.value === value);
343
357
 
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 };
358
+ 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,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-7695e624.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-78294ccf.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 };