@cuenca-mx/cuenca-js 0.0.5-dev0 → 0.0.5

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,3 +1,17 @@
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
+
1
15
  class CardErrorType {
2
16
  static Blocked = new CardErrorType('blocked');
3
17
 
@@ -125,11 +139,13 @@ class EntryType {
125
139
  }
126
140
 
127
141
  class FileFormat {
128
- static Pdf = new FileFormat('pdf');
142
+ static Pdf = new FileFormat('application/pdf');
129
143
 
130
- static Xml = new FileFormat('xml');
144
+ static Xml = new FileFormat('application/xml');
131
145
 
132
- static Json = new FileFormat('json');
146
+ static Json = new FileFormat('application/json');
147
+
148
+ static Any = new FileFormat('*/*');
133
149
 
134
150
  constructor(value) {
135
151
  this.value = value;
@@ -154,20 +170,6 @@ class KYCFileType {
154
170
  }
155
171
  }
156
172
 
157
- class KYCStatus {
158
- static UploadAgain = new KYCStatus('upload_again');
159
-
160
- static ReviewNeeded = new KYCStatus('review_needed');
161
-
162
- static Submitted = new KYCStatus('submitted');
163
-
164
- static Succeeded = new KYCStatus('succeeded');
165
-
166
- constructor(value) {
167
- this.value = value;
168
- }
169
- }
170
-
171
173
  class Phase {
172
174
  static Sandbox = new Phase('sandbox');
173
175
 
@@ -307,12 +309,12 @@ class VerificationStatus {
307
309
 
308
310
  static ReviewNeeded = new VerificationStatus('review_needed');
309
311
 
310
- static UploadAgain = new VerificationStatus('upload_again');
311
-
312
312
  static Submitted = new VerificationStatus('submitted');
313
313
 
314
314
  static Succeeded = new VerificationStatus('succeeded');
315
315
 
316
+ static UploadAgain = new VerificationStatus('upload_again');
317
+
316
318
  constructor(value) {
317
319
  this.value = value;
318
320
  }
@@ -347,4 +349,4 @@ const dateToUTC = (date) => {
347
349
  const enumValueFromString = (enumValue, value) =>
348
350
  Object.values(enumValue).find((enumV) => enumV.value === value);
349
351
 
350
- 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 };
352
+ 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, 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, TrackDataMethod as l };
@@ -1,5 +1,19 @@
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
+
3
17
  class CardErrorType {
4
18
  static Blocked = new CardErrorType('blocked');
5
19
 
@@ -127,11 +141,13 @@ class EntryType {
127
141
  }
128
142
 
129
143
  class FileFormat {
130
- static Pdf = new FileFormat('pdf');
144
+ static Pdf = new FileFormat('application/pdf');
131
145
 
132
- static Xml = new FileFormat('xml');
146
+ static Xml = new FileFormat('application/xml');
133
147
 
134
- static Json = new FileFormat('json');
148
+ static Json = new FileFormat('application/json');
149
+
150
+ static Any = new FileFormat('*/*');
135
151
 
136
152
  constructor(value) {
137
153
  this.value = value;
@@ -156,20 +172,6 @@ class KYCFileType {
156
172
  }
157
173
  }
158
174
 
159
- class KYCStatus {
160
- static UploadAgain = new KYCStatus('upload_again');
161
-
162
- static ReviewNeeded = new KYCStatus('review_needed');
163
-
164
- static Submitted = new KYCStatus('submitted');
165
-
166
- static Succeeded = new KYCStatus('succeeded');
167
-
168
- constructor(value) {
169
- this.value = value;
170
- }
171
- }
172
-
173
175
  class Phase {
174
176
  static Sandbox = new Phase('sandbox');
175
177
 
@@ -309,12 +311,12 @@ class VerificationStatus {
309
311
 
310
312
  static ReviewNeeded = new VerificationStatus('review_needed');
311
313
 
312
- static UploadAgain = new VerificationStatus('upload_again');
313
-
314
314
  static Submitted = new VerificationStatus('submitted');
315
315
 
316
316
  static Succeeded = new VerificationStatus('succeeded');
317
317
 
318
+ static UploadAgain = new VerificationStatus('upload_again');
319
+
318
320
  constructor(value) {
319
321
  this.value = value;
320
322
  }
@@ -349,6 +351,7 @@ const dateToUTC = (date) => {
349
351
  const enumValueFromString = (enumValue, value) =>
350
352
  Object.values(enumValue).find((enumV) => enumV.value === value);
351
353
 
354
+ exports.BridgeAccountStatus = BridgeAccountStatus;
352
355
  exports.CardErrorType = CardErrorType;
353
356
  exports.CardFundingType = CardFundingType;
354
357
  exports.CardIssuer = CardIssuer;
@@ -360,7 +363,6 @@ exports.DepositNetwork = DepositNetwork;
360
363
  exports.EntryType = EntryType;
361
364
  exports.FileFormat = FileFormat;
362
365
  exports.KYCFileType = KYCFileType;
363
- exports.KYCStatus = KYCStatus;
364
366
  exports.Phase = Phase;
365
367
  exports.SavingCategory = SavingCategory;
366
368
  exports.ServiceProviderCategory = ServiceProviderCategory;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var errors_index = require('./errors/index.cjs');
4
- var data = require('./data-6451748e.cjs');
4
+ var data = require('./data-d6c1558d.cjs');
5
5
 
6
6
  class PageSize {
7
7
  constructor(size) {
@@ -298,6 +298,19 @@ 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
+
301
314
  class TOSAgreements {
302
315
  constructor({ ip, location, type, version }) {
303
316
  this.ip = ip;
@@ -315,19 +328,41 @@ class TOSAgreements {
315
328
  });
316
329
  }
317
330
 
331
+ class VerificationError {
332
+ constructor({ code, error, identifier, message }) {
333
+ this.code = code;
334
+ this.error = error;
335
+ this.identifier = identifier;
336
+ this.message = message;
337
+ }
338
+
339
+ static fromObject = ({ code, error, identifier, message }) =>
340
+ new VerificationError({
341
+ code,
342
+ error,
343
+ identifier,
344
+ message,
345
+ });
346
+ }
347
+
318
348
  class KYCFile {
319
- constructor({ data: data$1, isMx, status, type, uriBack, uriFront }) {
349
+ constructor({ data: data$1, errors, isMx, status, type, uriBack, uriFront }) {
320
350
  this.data = data$1;
321
351
  this.isMx = isMx;
322
- this.status = data.enumValueFromString(data.KYCStatus, status);
352
+ this.status = data.enumValueFromString(data.VerificationStatus, status);
323
353
  this.type = data.enumValueFromString(data.KYCFileType, type);
324
354
  this.uriBack = uriBack;
325
355
  this.uriFront = uriFront;
356
+
357
+ if (errors && errors.length > 0) {
358
+ this.errors = errors.map((e) => VerificationError.fromObject(e));
359
+ }
326
360
  }
327
361
 
328
- static fromObject = ({ data, status, type, ...obj }) =>
362
+ static fromObject = ({ data, errors, status, type, ...obj }) =>
329
363
  new KYCFile({
330
364
  data,
365
+ errors,
331
366
  status,
332
367
  type,
333
368
  isMx: obj.is_mx,
@@ -378,6 +413,7 @@ exports.Address = Address;
378
413
  exports.ApiKeyQuery = ApiKeyQuery;
379
414
  exports.BalanceEntryQuery = BalanceEntryQuery;
380
415
  exports.BillPaymentQuery = BillPaymentQuery;
416
+ exports.BridgeAccountQuery = BridgeAccountQuery;
381
417
  exports.CardTransactionQuery = CardTransactionQuery;
382
418
  exports.CardsQuery = CardsQuery;
383
419
  exports.DepositQuery = DepositQuery;
@@ -386,6 +422,7 @@ exports.PageSize = PageSize;
386
422
  exports.QueryParams = QueryParams;
387
423
  exports.StatementQuery = StatementQuery;
388
424
  exports.TOSAgreements = TOSAgreements;
425
+ exports.TransactionQuery = TransactionQuery;
389
426
  exports.TransferQuery = TransferQuery;
390
427
  exports.UserQuery = UserQuery;
391
428
  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, l as KYCStatus } from './data-38bfc8ad.mjs';
2
+ import { d as dateToUTC, e as enumValueFromString, V as VerificationStatus, K as KYCFileType } from './data-59d28abe.mjs';
3
3
 
4
4
  class PageSize {
5
5
  constructor(size) {
@@ -296,6 +296,19 @@ 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
+
299
312
  class TOSAgreements {
300
313
  constructor({ ip, location, type, version }) {
301
314
  this.ip = ip;
@@ -313,19 +326,41 @@ class TOSAgreements {
313
326
  });
314
327
  }
315
328
 
329
+ class VerificationError {
330
+ constructor({ code, error, identifier, message }) {
331
+ this.code = code;
332
+ this.error = error;
333
+ this.identifier = identifier;
334
+ this.message = message;
335
+ }
336
+
337
+ static fromObject = ({ code, error, identifier, message }) =>
338
+ new VerificationError({
339
+ code,
340
+ error,
341
+ identifier,
342
+ message,
343
+ });
344
+ }
345
+
316
346
  class KYCFile {
317
- constructor({ data, isMx, status, type, uriBack, uriFront }) {
347
+ constructor({ data, errors, isMx, status, type, uriBack, uriFront }) {
318
348
  this.data = data;
319
349
  this.isMx = isMx;
320
- this.status = enumValueFromString(KYCStatus, status);
350
+ this.status = enumValueFromString(VerificationStatus, status);
321
351
  this.type = enumValueFromString(KYCFileType, type);
322
352
  this.uriBack = uriBack;
323
353
  this.uriFront = uriFront;
354
+
355
+ if (errors && errors.length > 0) {
356
+ this.errors = errors.map((e) => VerificationError.fromObject(e));
357
+ }
324
358
  }
325
359
 
326
- static fromObject = ({ data, status, type, ...obj }) =>
360
+ static fromObject = ({ data, errors, status, type, ...obj }) =>
327
361
  new KYCFile({
328
362
  data,
363
+ errors,
329
364
  status,
330
365
  type,
331
366
  isMx: obj.is_mx,
@@ -371,4 +406,4 @@ class Address {
371
406
  });
372
407
  }
373
408
 
374
- 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 };
409
+ 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, BridgeAccountQuery as d, CardTransactionQuery as e, TransferQuery as f, WalletTransactionQuery as g, TransactionQuery as h };