@cuenca-mx/cuenca-js 0.0.5-dev.1 → 0.0.5-dev.11
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-38bfc8ad.mjs → data-86ddd935.mjs} +5 -3
- package/build/{data-6451748e.cjs → data-d25afb50.cjs} +5 -3
- package/build/{identities-cd77b9f2.cjs → identities-b472f1c7.cjs} +25 -3
- package/build/{identities-c0047807.mjs → identities-f01f7ffa.mjs} +25 -3
- package/build/index.cjs +118 -12
- package/build/index.mjs +118 -12
- package/build/requests/index.cjs +5 -2
- package/build/requests/index.mjs +3 -2
- package/build/types/index.cjs +2 -2
- package/build/types/index.mjs +2 -2
- package/build/umd/cuenca.umd.js +1 -1
- package/build/{walletTransactionRequest-2e5deaee.mjs → walletTransactionRequest-1a351e54.mjs} +112 -2
- package/build/{walletTransactionRequest-267a5d18.cjs → walletTransactionRequest-7b37acb9.cjs} +113 -1
- package/package.json +3 -2
package/build/{walletTransactionRequest-2e5deaee.mjs → walletTransactionRequest-1a351e54.mjs}
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ValidationError } from './errors/index.mjs';
|
|
2
|
-
import { d as dateToUTC, e as enumValueFromString, k as VerificationType } from './data-
|
|
2
|
+
import { d as dateToUTC, e as enumValueFromString, k as VerificationType } from './data-86ddd935.mjs';
|
|
3
|
+
import { createRequire } from 'module';
|
|
3
4
|
|
|
4
5
|
class BaseRequest {
|
|
5
6
|
toObject() {
|
|
@@ -307,6 +308,19 @@ class CardValidationRequest extends BaseRequest {
|
|
|
307
308
|
}
|
|
308
309
|
}
|
|
309
310
|
|
|
311
|
+
class KYCValidationsRequest extends BaseRequest {
|
|
312
|
+
constructor(userId) {
|
|
313
|
+
super();
|
|
314
|
+
this.userId = userId;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
toObject() {
|
|
318
|
+
return {
|
|
319
|
+
user_id: this.userId,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
310
324
|
class SavingRequest extends BaseRequest {
|
|
311
325
|
constructor(category, goalAmount, goalDate, name) {
|
|
312
326
|
super();
|
|
@@ -340,6 +354,43 @@ class SavingRequest extends BaseRequest {
|
|
|
340
354
|
}
|
|
341
355
|
}
|
|
342
356
|
|
|
357
|
+
const requires = createRequire(import.meta.url);
|
|
358
|
+
const FormData = requires('form-data');
|
|
359
|
+
|
|
360
|
+
class UploadRequest extends BaseRequest {
|
|
361
|
+
constructor({ isBack = false, file, extension, type, userId = 'me' }) {
|
|
362
|
+
super();
|
|
363
|
+
this.extension = extension;
|
|
364
|
+
this.file = file;
|
|
365
|
+
this.isBack = isBack;
|
|
366
|
+
this.type = type;
|
|
367
|
+
this.userId = userId;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
toObject() {
|
|
371
|
+
return {
|
|
372
|
+
extension: this.extension,
|
|
373
|
+
file: this.file,
|
|
374
|
+
is_back: this.isBack,
|
|
375
|
+
type: this.type,
|
|
376
|
+
user_id: this.userId,
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
toFormData() {
|
|
381
|
+
// const fileBase64 = Buffer.Buffer.from(this.file, 'utf-8').toString(
|
|
382
|
+
// 'base64',
|
|
383
|
+
// );
|
|
384
|
+
// console.log(this.file);
|
|
385
|
+
const form = new FormData();
|
|
386
|
+
form.append('extension', this.extension);
|
|
387
|
+
form.append('file', this.file);
|
|
388
|
+
form.append('type', this.type);
|
|
389
|
+
form.append('user_id', this.userId);
|
|
390
|
+
return form;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
343
394
|
class TransferRequest extends BaseRequest {
|
|
344
395
|
constructor(
|
|
345
396
|
accountNumber,
|
|
@@ -534,17 +585,46 @@ class AddressUpdateRequest extends BaseRequest {
|
|
|
534
585
|
}
|
|
535
586
|
}
|
|
536
587
|
|
|
588
|
+
class KycFileRequest extends BaseRequest {
|
|
589
|
+
constructor({ data, isMx, status, type, uriBack, uriFront }) {
|
|
590
|
+
super();
|
|
591
|
+
this.data = data;
|
|
592
|
+
this.isMx = isMx;
|
|
593
|
+
this.status = status;
|
|
594
|
+
this.type = type;
|
|
595
|
+
this.uriBack = uriBack;
|
|
596
|
+
this.uriFront = uriFront;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
toObject() {
|
|
600
|
+
return {
|
|
601
|
+
data: this.data,
|
|
602
|
+
is_mx: this.isMx,
|
|
603
|
+
status: this.status,
|
|
604
|
+
type: this.type,
|
|
605
|
+
uri_back: this.uriBack,
|
|
606
|
+
uri_front: this.uriFront,
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
537
611
|
class UserUpdateRequest extends BaseRequest {
|
|
538
612
|
constructor({
|
|
539
613
|
address,
|
|
614
|
+
govtId,
|
|
540
615
|
profession,
|
|
616
|
+
proofOfAddress,
|
|
617
|
+
proofOfLife,
|
|
541
618
|
requiredLevel,
|
|
542
619
|
termsOfService,
|
|
543
620
|
verificationId,
|
|
544
621
|
}) {
|
|
545
622
|
super();
|
|
546
623
|
this.adrs = address;
|
|
624
|
+
this.govstIds = govtId;
|
|
547
625
|
this.profession = profession;
|
|
626
|
+
this.addressProofs = proofOfAddress;
|
|
627
|
+
this.lifeProofs = proofOfLife;
|
|
548
628
|
this.requiredLevel = requiredLevel;
|
|
549
629
|
this.terms = termsOfService;
|
|
550
630
|
this.verificationId = verificationId;
|
|
@@ -568,6 +648,33 @@ class UserUpdateRequest extends BaseRequest {
|
|
|
568
648
|
this._address = new AddressUpdateRequest(value).toCleanObject();
|
|
569
649
|
}
|
|
570
650
|
|
|
651
|
+
get proofOfLife() {
|
|
652
|
+
return this._proofOfLife;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
set lifeProofs(value) {
|
|
656
|
+
if (!value) return;
|
|
657
|
+
this._proofOfLife = new KycFileRequest(value).toCleanObject();
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
get proofOfAddress() {
|
|
661
|
+
return this._proofOfAddress;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
set addressProofs(value) {
|
|
665
|
+
if (!value) return;
|
|
666
|
+
this._proofOfAddress = new KycFileRequest(value).toCleanObject();
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
get govtId() {
|
|
670
|
+
return this._govtId;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
set govstIds(value) {
|
|
674
|
+
if (!value) return;
|
|
675
|
+
this._govtId = new KycFileRequest(value).toCleanObject();
|
|
676
|
+
}
|
|
677
|
+
|
|
571
678
|
toObject() {
|
|
572
679
|
return {
|
|
573
680
|
address: this.address,
|
|
@@ -575,6 +682,9 @@ class UserUpdateRequest extends BaseRequest {
|
|
|
575
682
|
requiredLevel: this.requiredLevel,
|
|
576
683
|
terms_of_service: this.termsOfService,
|
|
577
684
|
verification_id: this.verificationId,
|
|
685
|
+
proof_of_life: this.proofOfLife,
|
|
686
|
+
proof_of_address: this.proofOfAddress,
|
|
687
|
+
govt_id: this.govtId,
|
|
578
688
|
};
|
|
579
689
|
}
|
|
580
690
|
}
|
|
@@ -659,4 +769,4 @@ class WalletTransactionRequest extends BaseRequest {
|
|
|
659
769
|
}
|
|
660
770
|
}
|
|
661
771
|
|
|
662
|
-
export { ApiKeyUpdateRequest as A, CardActivationRequest as C, SavingRequest as S, TransferRequest as T,
|
|
772
|
+
export { ApiKeyUpdateRequest as A, CardActivationRequest as C, KYCValidationsRequest as K, SavingRequest as S, TransferRequest as T, UploadRequest as U, VerificationRequest as V, WalletTransactionRequest as W, ArpcRequest as a, CardRequest as b, CardUpdateRequest as c, CardValidationRequest as d, UserCredentialRequest as e, UserCredentialUpdateRequest as f, UserLoginRequest as g, UserUpdateRequest as h, VerificationAttemptRequest as i };
|
package/build/{walletTransactionRequest-267a5d18.cjs → walletTransactionRequest-7b37acb9.cjs}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var errors_index = require('./errors/index.cjs');
|
|
4
|
-
var data = require('./data-
|
|
4
|
+
var data = require('./data-d25afb50.cjs');
|
|
5
|
+
var module$1 = require('module');
|
|
5
6
|
|
|
6
7
|
class BaseRequest {
|
|
7
8
|
toObject() {
|
|
@@ -309,6 +310,19 @@ class CardValidationRequest extends BaseRequest {
|
|
|
309
310
|
}
|
|
310
311
|
}
|
|
311
312
|
|
|
313
|
+
class KYCValidationsRequest extends BaseRequest {
|
|
314
|
+
constructor(userId) {
|
|
315
|
+
super();
|
|
316
|
+
this.userId = userId;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
toObject() {
|
|
320
|
+
return {
|
|
321
|
+
user_id: this.userId,
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
312
326
|
class SavingRequest extends BaseRequest {
|
|
313
327
|
constructor(category, goalAmount, goalDate, name) {
|
|
314
328
|
super();
|
|
@@ -342,6 +356,43 @@ class SavingRequest extends BaseRequest {
|
|
|
342
356
|
}
|
|
343
357
|
}
|
|
344
358
|
|
|
359
|
+
const requires = module$1.createRequire((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('walletTransactionRequest-7b37acb9.cjs', document.baseURI).href)));
|
|
360
|
+
const FormData = requires('form-data');
|
|
361
|
+
|
|
362
|
+
class UploadRequest extends BaseRequest {
|
|
363
|
+
constructor({ isBack = false, file, extension, type, userId = 'me' }) {
|
|
364
|
+
super();
|
|
365
|
+
this.extension = extension;
|
|
366
|
+
this.file = file;
|
|
367
|
+
this.isBack = isBack;
|
|
368
|
+
this.type = type;
|
|
369
|
+
this.userId = userId;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
toObject() {
|
|
373
|
+
return {
|
|
374
|
+
extension: this.extension,
|
|
375
|
+
file: this.file,
|
|
376
|
+
is_back: this.isBack,
|
|
377
|
+
type: this.type,
|
|
378
|
+
user_id: this.userId,
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
toFormData() {
|
|
383
|
+
// const fileBase64 = Buffer.Buffer.from(this.file, 'utf-8').toString(
|
|
384
|
+
// 'base64',
|
|
385
|
+
// );
|
|
386
|
+
// console.log(this.file);
|
|
387
|
+
const form = new FormData();
|
|
388
|
+
form.append('extension', this.extension);
|
|
389
|
+
form.append('file', this.file);
|
|
390
|
+
form.append('type', this.type);
|
|
391
|
+
form.append('user_id', this.userId);
|
|
392
|
+
return form;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
345
396
|
class TransferRequest extends BaseRequest {
|
|
346
397
|
constructor(
|
|
347
398
|
accountNumber,
|
|
@@ -536,17 +587,46 @@ class AddressUpdateRequest extends BaseRequest {
|
|
|
536
587
|
}
|
|
537
588
|
}
|
|
538
589
|
|
|
590
|
+
class KycFileRequest extends BaseRequest {
|
|
591
|
+
constructor({ data, isMx, status, type, uriBack, uriFront }) {
|
|
592
|
+
super();
|
|
593
|
+
this.data = data;
|
|
594
|
+
this.isMx = isMx;
|
|
595
|
+
this.status = status;
|
|
596
|
+
this.type = type;
|
|
597
|
+
this.uriBack = uriBack;
|
|
598
|
+
this.uriFront = uriFront;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
toObject() {
|
|
602
|
+
return {
|
|
603
|
+
data: this.data,
|
|
604
|
+
is_mx: this.isMx,
|
|
605
|
+
status: this.status,
|
|
606
|
+
type: this.type,
|
|
607
|
+
uri_back: this.uriBack,
|
|
608
|
+
uri_front: this.uriFront,
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
539
613
|
class UserUpdateRequest extends BaseRequest {
|
|
540
614
|
constructor({
|
|
541
615
|
address,
|
|
616
|
+
govtId,
|
|
542
617
|
profession,
|
|
618
|
+
proofOfAddress,
|
|
619
|
+
proofOfLife,
|
|
543
620
|
requiredLevel,
|
|
544
621
|
termsOfService,
|
|
545
622
|
verificationId,
|
|
546
623
|
}) {
|
|
547
624
|
super();
|
|
548
625
|
this.adrs = address;
|
|
626
|
+
this.govstIds = govtId;
|
|
549
627
|
this.profession = profession;
|
|
628
|
+
this.addressProofs = proofOfAddress;
|
|
629
|
+
this.lifeProofs = proofOfLife;
|
|
550
630
|
this.requiredLevel = requiredLevel;
|
|
551
631
|
this.terms = termsOfService;
|
|
552
632
|
this.verificationId = verificationId;
|
|
@@ -570,6 +650,33 @@ class UserUpdateRequest extends BaseRequest {
|
|
|
570
650
|
this._address = new AddressUpdateRequest(value).toCleanObject();
|
|
571
651
|
}
|
|
572
652
|
|
|
653
|
+
get proofOfLife() {
|
|
654
|
+
return this._proofOfLife;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
set lifeProofs(value) {
|
|
658
|
+
if (!value) return;
|
|
659
|
+
this._proofOfLife = new KycFileRequest(value).toCleanObject();
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
get proofOfAddress() {
|
|
663
|
+
return this._proofOfAddress;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
set addressProofs(value) {
|
|
667
|
+
if (!value) return;
|
|
668
|
+
this._proofOfAddress = new KycFileRequest(value).toCleanObject();
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
get govtId() {
|
|
672
|
+
return this._govtId;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
set govstIds(value) {
|
|
676
|
+
if (!value) return;
|
|
677
|
+
this._govtId = new KycFileRequest(value).toCleanObject();
|
|
678
|
+
}
|
|
679
|
+
|
|
573
680
|
toObject() {
|
|
574
681
|
return {
|
|
575
682
|
address: this.address,
|
|
@@ -577,6 +684,9 @@ class UserUpdateRequest extends BaseRequest {
|
|
|
577
684
|
requiredLevel: this.requiredLevel,
|
|
578
685
|
terms_of_service: this.termsOfService,
|
|
579
686
|
verification_id: this.verificationId,
|
|
687
|
+
proof_of_life: this.proofOfLife,
|
|
688
|
+
proof_of_address: this.proofOfAddress,
|
|
689
|
+
govt_id: this.govtId,
|
|
580
690
|
};
|
|
581
691
|
}
|
|
582
692
|
}
|
|
@@ -667,8 +777,10 @@ exports.CardActivationRequest = CardActivationRequest;
|
|
|
667
777
|
exports.CardRequest = CardRequest;
|
|
668
778
|
exports.CardUpdateRequest = CardUpdateRequest;
|
|
669
779
|
exports.CardValidationRequest = CardValidationRequest;
|
|
780
|
+
exports.KYCValidationsRequest = KYCValidationsRequest;
|
|
670
781
|
exports.SavingRequest = SavingRequest;
|
|
671
782
|
exports.TransferRequest = TransferRequest;
|
|
783
|
+
exports.UploadRequest = UploadRequest;
|
|
672
784
|
exports.UserCredentialRequest = UserCredentialRequest;
|
|
673
785
|
exports.UserCredentialUpdateRequest = UserCredentialUpdateRequest;
|
|
674
786
|
exports.UserLoginRequest = UserLoginRequest;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cuenca-mx/cuenca-js",
|
|
3
|
-
"version": "0.0.5-dev.
|
|
3
|
+
"version": "0.0.5-dev.11",
|
|
4
4
|
"description": "Cuenca client for JS",
|
|
5
5
|
"main": "./build/index.cjs",
|
|
6
6
|
"module": "./build/index.mjs",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"axios": "^0.24.0",
|
|
62
|
-
"buffer": "^6.0.3"
|
|
62
|
+
"buffer": "^6.0.3",
|
|
63
|
+
"form-data": "^4.0.0"
|
|
63
64
|
}
|
|
64
65
|
}
|