@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
package/build/index.cjs
CHANGED
|
@@ -6,9 +6,9 @@ var axios = require('axios');
|
|
|
6
6
|
var Buffer = require('buffer');
|
|
7
7
|
var errors_index = require('./errors/index.cjs');
|
|
8
8
|
var jwt_index = require('./jwt/index.cjs');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var walletTransactionRequest = require('./walletTransactionRequest-
|
|
9
|
+
var data = require('./data-efb53250.cjs');
|
|
10
|
+
var identities = require('./identities-93faf1ed.cjs');
|
|
11
|
+
var walletTransactionRequest = require('./walletTransactionRequest-832088b1.cjs');
|
|
12
12
|
|
|
13
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
14
|
|
|
@@ -26,10 +26,10 @@ const isNode =
|
|
|
26
26
|
|
|
27
27
|
const runtimeEnv = { isBrowser, isNode };
|
|
28
28
|
|
|
29
|
-
const name="@cuenca-mx/cuenca-js";const version="0.0.1-dev.
|
|
29
|
+
const name="@cuenca-mx/cuenca-js";const version="0.0.1-dev.40";const description="Cuenca client for JS";const main="./build/index.cjs";const module$1="./build/index.mjs";const browser="./build/umd/cuenca.umd.js";const files=["build/**/*"];const exports$1={".":{"import":"./build/index.mjs",require:"./build/index.cjs"},"./errors":{"import":"./build/errors/index.mjs",require:"./build/errors/index.cjs"},"./jwt":{"import":"./build/jwt/index.mjs",require:"./build/jwt/index.cjs"},"./requests":{"import":"./build/requests/index.mjs",require:"./build/requests/index.cjs"},"./types":{"import":"./build/types/index.mjs",require:"./build/types/index.cjs"}};const packageManager="yarn@3.0.2";const type="module";const repository={type:"git",url:"https://github.com/cuenca-mx/cuenca-js.git",directory:"packages/cuenca-js"};const keywords=["cuenca"];const license="MIT";const bugs={url:"https://github.com/cuenca-mx/cuenca-js/issues"};const homepage="https://cuenca.com";const scripts={build:"rm -rf build/ && yarn rollup --config",test:"yarn node --experimental-vm-modules $(yarn bin jest)",publish:"yarn build && yarn npm publish"};const devDependencies={"@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.1.1",jest:"^27.4.5",rollup:"^2.61.1","rollup-plugin-terser":"^7.0.2"};const dependencies={axios:"^0.24.0",buffer:"^6.0.3"};var pkg = {name:name,version:version,description:description,main:main,module:module$1,browser:browser,files:files,exports:exports$1,packageManager:packageManager,type:type,repository:repository,keywords:keywords,license:license,bugs:bugs,homepage:homepage,scripts:scripts,devDependencies:devDependencies,dependencies:dependencies};
|
|
30
30
|
|
|
31
31
|
class Client {
|
|
32
|
-
constructor({ apiKey, apiSecret, phase =
|
|
32
|
+
constructor({ apiKey, apiSecret, phase = data.Phase.Sandbox } = {}) {
|
|
33
33
|
this.phase = phase;
|
|
34
34
|
this.basicAuth = { apiKey, apiSecret };
|
|
35
35
|
this.jwtToken = null;
|
|
@@ -139,8 +139,8 @@ class Client {
|
|
|
139
139
|
|
|
140
140
|
async request({
|
|
141
141
|
endpoint,
|
|
142
|
-
data = null,
|
|
143
|
-
format =
|
|
142
|
+
data: data$1 = null,
|
|
143
|
+
format = data.FileFormat.Json,
|
|
144
144
|
method = 'GET',
|
|
145
145
|
params = null,
|
|
146
146
|
}) {
|
|
@@ -148,6 +148,7 @@ class Client {
|
|
|
148
148
|
'Content-Type': 'application/json',
|
|
149
149
|
Accept: `application/${format.value}`,
|
|
150
150
|
};
|
|
151
|
+
|
|
151
152
|
if (this.authHeader) {
|
|
152
153
|
headers.Authorization = this.authHeader;
|
|
153
154
|
}
|
|
@@ -169,7 +170,7 @@ class Client {
|
|
|
169
170
|
|
|
170
171
|
const headersInterceptor = this.addHeadersToRequest(headers);
|
|
171
172
|
|
|
172
|
-
const modifiedData = data;
|
|
173
|
+
const modifiedData = data$1;
|
|
173
174
|
if (modifiedData) {
|
|
174
175
|
Object.keys(modifiedData).forEach((k) => {
|
|
175
176
|
if (modifiedData[k] instanceof Date) {
|
|
@@ -291,7 +292,7 @@ class BalanceEntry {
|
|
|
291
292
|
this.amount = amount;
|
|
292
293
|
this.createdAt = data.dateToUTC(createdAt);
|
|
293
294
|
this.descriptor = descriptor;
|
|
294
|
-
this.entryType = data.enumValueFromString(
|
|
295
|
+
this.entryType = data.enumValueFromString(data.EntryType, entryType);
|
|
295
296
|
this.fundingInstrumentUri = fundingInstrumentUri;
|
|
296
297
|
this.id = id;
|
|
297
298
|
this.name = name;
|
|
@@ -318,7 +319,7 @@ class Transaction {
|
|
|
318
319
|
this.amount = amount;
|
|
319
320
|
this.createdAt = data.dateToUTC(createdAt);
|
|
320
321
|
this.descriptor = descriptor;
|
|
321
|
-
this.status = data.enumValueFromString(
|
|
322
|
+
this.status = data.enumValueFromString(data.TransactionStatus, status);
|
|
322
323
|
this.userId = userId;
|
|
323
324
|
}
|
|
324
325
|
}
|
|
@@ -379,13 +380,13 @@ class Card {
|
|
|
379
380
|
this.cvv2 = cvv2;
|
|
380
381
|
this.expMonth = expMonth;
|
|
381
382
|
this.expYear = expYear;
|
|
382
|
-
this.fundingType = data.enumValueFromString(
|
|
383
|
+
this.fundingType = data.enumValueFromString(data.CardFundingType, fundingType);
|
|
383
384
|
this.id = id;
|
|
384
|
-
this.issuer = data.enumValueFromString(
|
|
385
|
+
this.issuer = data.enumValueFromString(data.CardIssuer, issuer);
|
|
385
386
|
this.number = number;
|
|
386
387
|
this.pin = pin;
|
|
387
|
-
this.status = data.enumValueFromString(
|
|
388
|
-
this.type = data.enumValueFromString(
|
|
388
|
+
this.status = data.enumValueFromString(data.CardStatus, status);
|
|
389
|
+
this.type = data.enumValueFromString(data.CardType, type);
|
|
389
390
|
this.updatedAt = data.dateToUTC(updatedAt);
|
|
390
391
|
this.userId = userId;
|
|
391
392
|
}
|
|
@@ -461,14 +462,14 @@ class CardTransaction extends Transaction {
|
|
|
461
462
|
status,
|
|
462
463
|
userId,
|
|
463
464
|
});
|
|
464
|
-
this.cardErrorType = data.enumValueFromString(
|
|
465
|
+
this.cardErrorType = data.enumValueFromString(data.CardErrorType, cardErrorType);
|
|
465
466
|
this.cardLastFour = cardLastFour;
|
|
466
|
-
this.cardType = data.enumValueFromString(
|
|
467
|
+
this.cardType = data.enumValueFromString(data.CardType, cardType);
|
|
467
468
|
this.cardUri = cardUri;
|
|
468
469
|
this.metadata = metadata;
|
|
469
470
|
this.network = network;
|
|
470
471
|
this.relatedCardTransactionsUris = relatedCardTransactionsUris;
|
|
471
|
-
this.type = data.enumValueFromString(
|
|
472
|
+
this.type = data.enumValueFromString(data.CardTransactionType, type);
|
|
472
473
|
}
|
|
473
474
|
|
|
474
475
|
static fromObject = ({
|
|
@@ -512,8 +513,8 @@ class CardValidation {
|
|
|
512
513
|
isValidPinBlock,
|
|
513
514
|
userId,
|
|
514
515
|
}) {
|
|
515
|
-
this.cardStatus = data.enumValueFromString(
|
|
516
|
-
this.cardType = data.enumValueFromString(
|
|
516
|
+
this.cardStatus = data.enumValueFromString(data.CardStatus, cardStatus);
|
|
517
|
+
this.cardType = data.enumValueFromString(data.CardType, cardType);
|
|
517
518
|
this.cardUri = cardUri;
|
|
518
519
|
this.createdAt = data.dateToUTC(createdAt);
|
|
519
520
|
this.isExpired = isExpired;
|
|
@@ -543,7 +544,7 @@ class CardValidation {
|
|
|
543
544
|
});
|
|
544
545
|
|
|
545
546
|
get isActive() {
|
|
546
|
-
return this.cardStatus ===
|
|
547
|
+
return this.cardStatus === data.CardStatus.Active;
|
|
547
548
|
}
|
|
548
549
|
}
|
|
549
550
|
|
|
@@ -565,7 +566,7 @@ class Commission extends Transaction {
|
|
|
565
566
|
userId,
|
|
566
567
|
});
|
|
567
568
|
this.relatedTransactionUri = relatedTransactionUri;
|
|
568
|
-
this.type = data.enumValueFromString(
|
|
569
|
+
this.type = data.enumValueFromString(data.CommissionType, type);
|
|
569
570
|
}
|
|
570
571
|
|
|
571
572
|
static fromObject = ({ amount, descriptor, status, type, ...obj }) =>
|
|
@@ -600,7 +601,7 @@ class Deposit extends Transaction {
|
|
|
600
601
|
userId,
|
|
601
602
|
});
|
|
602
603
|
this.id = id;
|
|
603
|
-
this.network = data.enumValueFromString(
|
|
604
|
+
this.network = data.enumValueFromString(data.DepositNetwork, network);
|
|
604
605
|
this.sourceUri = sourceUri;
|
|
605
606
|
this.trackingKey = trackingKey;
|
|
606
607
|
}
|
|
@@ -659,7 +660,7 @@ class Saving extends Wallet {
|
|
|
659
660
|
userId,
|
|
660
661
|
updatedAt,
|
|
661
662
|
});
|
|
662
|
-
this.category = data.enumValueFromString(
|
|
663
|
+
this.category = data.enumValueFromString(data.SavingCategory, category);
|
|
663
664
|
this.goalAmount = goalAmount;
|
|
664
665
|
this.goalDate = data.dateToUTC(goalDate);
|
|
665
666
|
this.name = name;
|
|
@@ -683,7 +684,7 @@ class Saving extends Wallet {
|
|
|
683
684
|
const categoriesFromString = (categoriesList) => {
|
|
684
685
|
if (categoriesList == null) return [];
|
|
685
686
|
return categoriesList.map((category) =>
|
|
686
|
-
data.enumValueFromString(
|
|
687
|
+
data.enumValueFromString(data.ServiceProviderCategory, category),
|
|
687
688
|
);
|
|
688
689
|
};
|
|
689
690
|
|
|
@@ -748,7 +749,7 @@ class Transfer extends Transaction {
|
|
|
748
749
|
this.destinationUri = destinationUri;
|
|
749
750
|
this.id = id;
|
|
750
751
|
this.idempotencyKey = idempotencyKey;
|
|
751
|
-
this.network = data.enumValueFromString(
|
|
752
|
+
this.network = data.enumValueFromString(data.TransferNetwork, network);
|
|
752
753
|
this.recipientName = recipientName;
|
|
753
754
|
this.trackingKey = trackingKey;
|
|
754
755
|
this.updatedAt = data.dateToUTC(updatedAt);
|
|
@@ -790,7 +791,7 @@ class User {
|
|
|
790
791
|
this.phoneNumber = phoneNumber;
|
|
791
792
|
this.addressProofs = proofOfAddress;
|
|
792
793
|
this.lifeProofs = proofOfLife;
|
|
793
|
-
this.status = data.enumValueFromString(
|
|
794
|
+
this.status = data.enumValueFromString(data.UserStatus, status);
|
|
794
795
|
this.terms = termsOfService;
|
|
795
796
|
this.verificationId = verificationId;
|
|
796
797
|
}
|
|
@@ -877,6 +878,27 @@ class UserLogin {
|
|
|
877
878
|
});
|
|
878
879
|
}
|
|
879
880
|
|
|
881
|
+
class Verification {
|
|
882
|
+
constructor({ createdAt, id, platformId, recipient, type, updatedAt }) {
|
|
883
|
+
this.createdAt = data.dateToUTC(createdAt);
|
|
884
|
+
this.id = id;
|
|
885
|
+
this.platformId = platformId;
|
|
886
|
+
this.recipient = recipient;
|
|
887
|
+
this.type = data.enumValueFromString(data.VerificationType, type);
|
|
888
|
+
this.updatedAt = data.dateToUTC(updatedAt);
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
static fromObject = ({ id, recipient, type, ...obj }) =>
|
|
892
|
+
new Verification({
|
|
893
|
+
id,
|
|
894
|
+
recipient,
|
|
895
|
+
type,
|
|
896
|
+
createdAt: obj.created_at,
|
|
897
|
+
platformId: obj.platform_id,
|
|
898
|
+
updatedAt: obj.updated_at,
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
|
|
880
902
|
class WalletTransaction extends Transaction {
|
|
881
903
|
constructor({
|
|
882
904
|
amount,
|
|
@@ -897,7 +919,7 @@ class WalletTransaction extends Transaction {
|
|
|
897
919
|
});
|
|
898
920
|
this.id = id;
|
|
899
921
|
this.transactionType = data.enumValueFromString(
|
|
900
|
-
|
|
922
|
+
data.WalletTransactionType,
|
|
901
923
|
transactionType,
|
|
902
924
|
);
|
|
903
925
|
this.walletUri = walletUri;
|
|
@@ -944,7 +966,7 @@ class WhatsAppTransfer extends Transaction {
|
|
|
944
966
|
this.destinationUri = destinationUri;
|
|
945
967
|
this.id = id;
|
|
946
968
|
this.expiresAt = data.dateToUTC(expiresAt);
|
|
947
|
-
this.network = data.enumValueFromString(
|
|
969
|
+
this.network = data.enumValueFromString(data.TransferNetwork, network);
|
|
948
970
|
this.phoneNumber = phoneNumber;
|
|
949
971
|
this.recipientName = recipientName;
|
|
950
972
|
this.trackingKey = trackingKey;
|
|
@@ -1003,6 +1025,7 @@ const getModelFromPath = (path, obj) => {
|
|
|
1003
1025
|
users: () => User.fromObject(obj),
|
|
1004
1026
|
user_credentials: () => UserCredential.fromObject(obj),
|
|
1005
1027
|
user_logins: () => UserLogin.fromObject(obj),
|
|
1028
|
+
verifications: () => Verification.fromObject(obj),
|
|
1006
1029
|
wallet_transactions: () => WalletTransaction.fromObject(obj),
|
|
1007
1030
|
whatsapp_transfers: () => WhatsAppTransfer.fromObject(obj),
|
|
1008
1031
|
};
|
|
@@ -1426,12 +1449,12 @@ class StatementResource extends mix(Resource).with(Downlodable, Queryable) {
|
|
|
1426
1449
|
}
|
|
1427
1450
|
|
|
1428
1451
|
async pdf(id) {
|
|
1429
|
-
const byteString = await this._download(id,
|
|
1452
|
+
const byteString = await this._download(id, data.FileFormat.Pdf);
|
|
1430
1453
|
return byteString;
|
|
1431
1454
|
}
|
|
1432
1455
|
|
|
1433
1456
|
async xml(id) {
|
|
1434
|
-
const byteString = await this._download(id,
|
|
1457
|
+
const byteString = await this._download(id, data.FileFormat.Xml);
|
|
1435
1458
|
return byteString;
|
|
1436
1459
|
}
|
|
1437
1460
|
}
|
|
@@ -1578,6 +1601,24 @@ class UserResourse extends mix(Resource).with(
|
|
|
1578
1601
|
}
|
|
1579
1602
|
}
|
|
1580
1603
|
|
|
1604
|
+
class VerificationResourse extends mix(Resource).with(Creatable, Updateable) {
|
|
1605
|
+
constructor(client) {
|
|
1606
|
+
super('verifications', Object, client);
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
async create({ platformId, recipient, type }) {
|
|
1610
|
+
const request = new walletTransactionRequest.VerificationRequest({ platformId, recipient, type });
|
|
1611
|
+
const verification = await this._create(request.toObject());
|
|
1612
|
+
return verification;
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1615
|
+
async update({ code, id }) {
|
|
1616
|
+
const request = new walletTransactionRequest.VerificationAttemptRequest({ code });
|
|
1617
|
+
const verification = await this._update(id, request.toObject());
|
|
1618
|
+
return verification;
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1581
1622
|
class WalletTransactionsResource extends mix(Resource).with(
|
|
1582
1623
|
Creatable,
|
|
1583
1624
|
Queryable,
|
|
@@ -1624,7 +1665,7 @@ class WhatsAppTransferResource extends mix(Resource).with(
|
|
|
1624
1665
|
}
|
|
1625
1666
|
|
|
1626
1667
|
class Cuenca {
|
|
1627
|
-
constructor(apiKey, apiSecret, phase =
|
|
1668
|
+
constructor(apiKey, apiSecret, phase = data.Phase.Sandbox) {
|
|
1628
1669
|
this.client = new Client({ apiKey, apiSecret, phase });
|
|
1629
1670
|
this.withClient(this.client);
|
|
1630
1671
|
}
|
|
@@ -1648,6 +1689,7 @@ class Cuenca {
|
|
|
1648
1689
|
this.userCredentials = new UserCredentialResource(client);
|
|
1649
1690
|
this.userLogins = new UserLoginResource(client);
|
|
1650
1691
|
this.users = new UserResourse(client);
|
|
1692
|
+
this.verifications = new VerificationResourse(client);
|
|
1651
1693
|
this.walletTransactions = new WalletTransactionsResource(client);
|
|
1652
1694
|
this.whatsAppTransfers = new WhatsAppTransferResource(client);
|
|
1653
1695
|
}
|
package/build/index.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import axios from 'axios';
|
|
|
2
2
|
import Buffer from 'buffer';
|
|
3
3
|
import { CuencaResponseException, CuencaException, NoResultFound, MultipleResultsFound, InvalidPassword } from './errors/index.mjs';
|
|
4
4
|
import { Jwt } from './jwt/index.mjs';
|
|
5
|
-
import { P as Phase, F as FileFormat, E as EntryType, T as TransactionStatus, C as CardFundingType, a as CardIssuer, b as CardStatus, c as CardType,
|
|
6
|
-
import { d as
|
|
7
|
-
import { A as ApiKeyUpdateRequest, a as ArpcRequest, C as CardActivationRequest, b as CardRequest, c as CardUpdateRequest, d as CardValidationRequest, S as SavingRequest, T as TransferRequest, U as UserCredentialRequest, e as UserCredentialUpdateRequest, f as UserLoginRequest, g as UserUpdateRequest, W as WalletTransactionRequest } from './walletTransactionRequest-
|
|
5
|
+
import { P as Phase, F as FileFormat, d as dateToUTC, e as enumValueFromString, E as EntryType, T as TransactionStatus, C as CardFundingType, a as CardIssuer, b as CardStatus, c as CardType, f as CardErrorType, g as CardTransactionType, h as CommissionType, D as DepositNetwork, S as SavingCategory, i as ServiceProviderCategory, j as TransferNetwork, U as UserStatus, V as VerificationType, W as WalletTransactionType } from './data-69952249.mjs';
|
|
6
|
+
import { K as KYCFile, T as TOSAgreements, A as AccountQuery, a as ApiKeyQuery, B as BalanceEntryQuery, b as BillPaymentQuery, C as CardsQuery, c as CardTransactionQuery, Q as QueryParams, D as DepositQuery, W as WalletQuery, S as StatementQuery, d as TransferQuery, U as UserQuery, e as WalletTransactionQuery } from './identities-5e48f342.mjs';
|
|
7
|
+
import { A as ApiKeyUpdateRequest, a as ArpcRequest, C as CardActivationRequest, b as CardRequest, c as CardUpdateRequest, d as CardValidationRequest, S as SavingRequest, T as TransferRequest, U as UserCredentialRequest, e as UserCredentialUpdateRequest, f as UserLoginRequest, g as UserUpdateRequest, V as VerificationRequest, h as VerificationAttemptRequest, W as WalletTransactionRequest } from './walletTransactionRequest-3b0c406d.mjs';
|
|
8
8
|
|
|
9
9
|
/* global window */
|
|
10
10
|
|
|
@@ -17,7 +17,7 @@ const isNode =
|
|
|
17
17
|
|
|
18
18
|
const runtimeEnv = { isBrowser, isNode };
|
|
19
19
|
|
|
20
|
-
const name="@cuenca-mx/cuenca-js";const version="0.0.1-dev.
|
|
20
|
+
const name="@cuenca-mx/cuenca-js";const version="0.0.1-dev.40";const description="Cuenca client for JS";const main="./build/index.cjs";const module="./build/index.mjs";const browser="./build/umd/cuenca.umd.js";const files=["build/**/*"];const exports={".":{"import":"./build/index.mjs",require:"./build/index.cjs"},"./errors":{"import":"./build/errors/index.mjs",require:"./build/errors/index.cjs"},"./jwt":{"import":"./build/jwt/index.mjs",require:"./build/jwt/index.cjs"},"./requests":{"import":"./build/requests/index.mjs",require:"./build/requests/index.cjs"},"./types":{"import":"./build/types/index.mjs",require:"./build/types/index.cjs"}};const packageManager="yarn@3.0.2";const type="module";const repository={type:"git",url:"https://github.com/cuenca-mx/cuenca-js.git",directory:"packages/cuenca-js"};const keywords=["cuenca"];const license="MIT";const bugs={url:"https://github.com/cuenca-mx/cuenca-js/issues"};const homepage="https://cuenca.com";const scripts={build:"rm -rf build/ && yarn rollup --config",test:"yarn node --experimental-vm-modules $(yarn bin jest)",publish:"yarn build && yarn npm publish"};const devDependencies={"@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.1.1",jest:"^27.4.5",rollup:"^2.61.1","rollup-plugin-terser":"^7.0.2"};const dependencies={axios:"^0.24.0",buffer:"^6.0.3"};var pkg = {name:name,version:version,description:description,main:main,module:module,browser:browser,files:files,exports:exports,packageManager:packageManager,type:type,repository:repository,keywords:keywords,license:license,bugs:bugs,homepage:homepage,scripts:scripts,devDependencies:devDependencies,dependencies:dependencies};
|
|
21
21
|
|
|
22
22
|
class Client {
|
|
23
23
|
constructor({ apiKey, apiSecret, phase = Phase.Sandbox } = {}) {
|
|
@@ -139,6 +139,7 @@ class Client {
|
|
|
139
139
|
'Content-Type': 'application/json',
|
|
140
140
|
Accept: `application/${format.value}`,
|
|
141
141
|
};
|
|
142
|
+
|
|
142
143
|
if (this.authHeader) {
|
|
143
144
|
headers.Authorization = this.authHeader;
|
|
144
145
|
}
|
|
@@ -868,6 +869,27 @@ class UserLogin {
|
|
|
868
869
|
});
|
|
869
870
|
}
|
|
870
871
|
|
|
872
|
+
class Verification {
|
|
873
|
+
constructor({ createdAt, id, platformId, recipient, type, updatedAt }) {
|
|
874
|
+
this.createdAt = dateToUTC(createdAt);
|
|
875
|
+
this.id = id;
|
|
876
|
+
this.platformId = platformId;
|
|
877
|
+
this.recipient = recipient;
|
|
878
|
+
this.type = enumValueFromString(VerificationType, type);
|
|
879
|
+
this.updatedAt = dateToUTC(updatedAt);
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
static fromObject = ({ id, recipient, type, ...obj }) =>
|
|
883
|
+
new Verification({
|
|
884
|
+
id,
|
|
885
|
+
recipient,
|
|
886
|
+
type,
|
|
887
|
+
createdAt: obj.created_at,
|
|
888
|
+
platformId: obj.platform_id,
|
|
889
|
+
updatedAt: obj.updated_at,
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
|
|
871
893
|
class WalletTransaction extends Transaction {
|
|
872
894
|
constructor({
|
|
873
895
|
amount,
|
|
@@ -994,6 +1016,7 @@ const getModelFromPath = (path, obj) => {
|
|
|
994
1016
|
users: () => User.fromObject(obj),
|
|
995
1017
|
user_credentials: () => UserCredential.fromObject(obj),
|
|
996
1018
|
user_logins: () => UserLogin.fromObject(obj),
|
|
1019
|
+
verifications: () => Verification.fromObject(obj),
|
|
997
1020
|
wallet_transactions: () => WalletTransaction.fromObject(obj),
|
|
998
1021
|
whatsapp_transfers: () => WhatsAppTransfer.fromObject(obj),
|
|
999
1022
|
};
|
|
@@ -1569,6 +1592,24 @@ class UserResourse extends mix(Resource).with(
|
|
|
1569
1592
|
}
|
|
1570
1593
|
}
|
|
1571
1594
|
|
|
1595
|
+
class VerificationResourse extends mix(Resource).with(Creatable, Updateable) {
|
|
1596
|
+
constructor(client) {
|
|
1597
|
+
super('verifications', Object, client);
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
async create({ platformId, recipient, type }) {
|
|
1601
|
+
const request = new VerificationRequest({ platformId, recipient, type });
|
|
1602
|
+
const verification = await this._create(request.toObject());
|
|
1603
|
+
return verification;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
async update({ code, id }) {
|
|
1607
|
+
const request = new VerificationAttemptRequest({ code });
|
|
1608
|
+
const verification = await this._update(id, request.toObject());
|
|
1609
|
+
return verification;
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1572
1613
|
class WalletTransactionsResource extends mix(Resource).with(
|
|
1573
1614
|
Creatable,
|
|
1574
1615
|
Queryable,
|
|
@@ -1639,6 +1680,7 @@ class Cuenca {
|
|
|
1639
1680
|
this.userCredentials = new UserCredentialResource(client);
|
|
1640
1681
|
this.userLogins = new UserLoginResource(client);
|
|
1641
1682
|
this.users = new UserResourse(client);
|
|
1683
|
+
this.verifications = new VerificationResourse(client);
|
|
1642
1684
|
this.walletTransactions = new WalletTransactionsResource(client);
|
|
1643
1685
|
this.whatsAppTransfers = new WhatsAppTransferResource(client);
|
|
1644
1686
|
}
|
package/build/requests/index.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var walletTransactionRequest = require('../walletTransactionRequest-
|
|
5
|
+
var walletTransactionRequest = require('../walletTransactionRequest-832088b1.cjs');
|
|
6
6
|
require('../errors/index.cjs');
|
|
7
|
-
require('../data-
|
|
7
|
+
require('../data-efb53250.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -20,4 +20,6 @@ exports.UserCredentialRequest = walletTransactionRequest.UserCredentialRequest;
|
|
|
20
20
|
exports.UserCredentialUpdateRequest = walletTransactionRequest.UserCredentialUpdateRequest;
|
|
21
21
|
exports.UserLoginRequest = walletTransactionRequest.UserLoginRequest;
|
|
22
22
|
exports.UserUpdateRequest = walletTransactionRequest.UserUpdateRequest;
|
|
23
|
+
exports.VerificationAttemptRequest = walletTransactionRequest.VerificationAttemptRequest;
|
|
24
|
+
exports.VerificationRequest = walletTransactionRequest.VerificationRequest;
|
|
23
25
|
exports.WalletTransactionRequest = walletTransactionRequest.WalletTransactionRequest;
|
package/build/requests/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { A as ApiKeyUpdateRequest, a as ArpcRequest, C as CardActivationRequest, b as CardRequest, c as CardUpdateRequest, d as CardValidationRequest, S as SavingRequest, T as TransferRequest, U as UserCredentialRequest, e as UserCredentialUpdateRequest, f as UserLoginRequest, g as UserUpdateRequest, W as WalletTransactionRequest } from '../walletTransactionRequest-
|
|
1
|
+
export { A as ApiKeyUpdateRequest, a as ArpcRequest, C as CardActivationRequest, b as CardRequest, c as CardUpdateRequest, d as CardValidationRequest, S as SavingRequest, T as TransferRequest, U as UserCredentialRequest, e as UserCredentialUpdateRequest, f as UserLoginRequest, g as UserUpdateRequest, h as VerificationAttemptRequest, V as VerificationRequest, W as WalletTransactionRequest } from '../walletTransactionRequest-3b0c406d.mjs';
|
|
2
2
|
import '../errors/index.mjs';
|
|
3
|
-
import '../data-
|
|
3
|
+
import '../data-69952249.mjs';
|
package/build/types/index.cjs
CHANGED
|
@@ -2,45 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var data = require('../data-efb53250.cjs');
|
|
6
|
+
var identities = require('../identities-93faf1ed.cjs');
|
|
6
7
|
require('../errors/index.cjs');
|
|
7
|
-
require('../data-9edbb2a0.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
exports.CardErrorType = data.CardErrorType;
|
|
12
|
+
exports.CardFundingType = data.CardFundingType;
|
|
13
|
+
exports.CardIssuer = data.CardIssuer;
|
|
14
|
+
exports.CardStatus = data.CardStatus;
|
|
15
|
+
exports.CardTransactionType = data.CardTransactionType;
|
|
16
|
+
exports.CardType = data.CardType;
|
|
17
|
+
exports.CommissionType = data.CommissionType;
|
|
18
|
+
exports.DepositNetwork = data.DepositNetwork;
|
|
19
|
+
exports.EntryType = data.EntryType;
|
|
20
|
+
exports.FileFormat = data.FileFormat;
|
|
21
|
+
exports.KYCFileType = data.KYCFileType;
|
|
22
|
+
exports.KYCStatus = data.KYCStatus;
|
|
23
|
+
exports.Phase = data.Phase;
|
|
24
|
+
exports.SavingCategory = data.SavingCategory;
|
|
25
|
+
exports.ServiceProviderCategory = data.ServiceProviderCategory;
|
|
26
|
+
exports.TrackDataMethod = data.TrackDataMethod;
|
|
27
|
+
exports.TransactionStatus = data.TransactionStatus;
|
|
28
|
+
exports.TransferNetwork = data.TransferNetwork;
|
|
29
|
+
exports.UserStatus = data.UserStatus;
|
|
30
|
+
exports.VerificationType = data.VerificationType;
|
|
31
|
+
exports.WalletTransactionType = data.WalletTransactionType;
|
|
11
32
|
exports.AccountQuery = identities.AccountQuery;
|
|
12
33
|
exports.ApiKeyQuery = identities.ApiKeyQuery;
|
|
13
34
|
exports.BalanceEntryQuery = identities.BalanceEntryQuery;
|
|
14
35
|
exports.BillPaymentQuery = identities.BillPaymentQuery;
|
|
15
|
-
exports.CardErrorType = identities.CardErrorType;
|
|
16
|
-
exports.CardFundingType = identities.CardFundingType;
|
|
17
|
-
exports.CardIssuer = identities.CardIssuer;
|
|
18
|
-
exports.CardStatus = identities.CardStatus;
|
|
19
36
|
exports.CardTransactionQuery = identities.CardTransactionQuery;
|
|
20
|
-
exports.CardTransactionType = identities.CardTransactionType;
|
|
21
|
-
exports.CardType = identities.CardType;
|
|
22
37
|
exports.CardsQuery = identities.CardsQuery;
|
|
23
|
-
exports.CommissionType = identities.CommissionType;
|
|
24
|
-
exports.DepositNetwork = identities.DepositNetwork;
|
|
25
38
|
exports.DepositQuery = identities.DepositQuery;
|
|
26
|
-
exports.EntryType = identities.EntryType;
|
|
27
|
-
exports.FileFormat = identities.FileFormat;
|
|
28
39
|
exports.KYCFile = identities.KYCFile;
|
|
29
|
-
exports.KYCFileType = identities.KYCFileType;
|
|
30
|
-
exports.KYCStatus = identities.KYCStatus;
|
|
31
40
|
exports.PageSize = identities.PageSize;
|
|
32
|
-
exports.Phase = identities.Phase;
|
|
33
41
|
exports.QueryParams = identities.QueryParams;
|
|
34
|
-
exports.SavingCategory = identities.SavingCategory;
|
|
35
|
-
exports.ServiceProviderCategory = identities.ServiceProviderCategory;
|
|
36
42
|
exports.StatementQuery = identities.StatementQuery;
|
|
37
43
|
exports.TOSAgreements = identities.TOSAgreements;
|
|
38
|
-
exports.TrackDataMethod = identities.TrackDataMethod;
|
|
39
|
-
exports.TransactionStatus = identities.TransactionStatus;
|
|
40
|
-
exports.TransferNetwork = identities.TransferNetwork;
|
|
41
44
|
exports.TransferQuery = identities.TransferQuery;
|
|
42
45
|
exports.UserQuery = identities.UserQuery;
|
|
43
|
-
exports.UserStatus = identities.UserStatus;
|
|
44
46
|
exports.WalletQuery = identities.WalletQuery;
|
|
45
47
|
exports.WalletTransactionQuery = identities.WalletTransactionQuery;
|
|
46
|
-
exports.WalletTransactionType = identities.WalletTransactionType;
|
package/build/types/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { f as CardErrorType, C as CardFundingType, a as CardIssuer, b as CardStatus, g as CardTransactionType, c as CardType, h as CommissionType, D as DepositNetwork, E as EntryType, F as FileFormat, K as KYCFileType, k as KYCStatus, P as Phase, S as SavingCategory, i as ServiceProviderCategory, l as TrackDataMethod, T as TransactionStatus, j as TransferNetwork, U as UserStatus, V as VerificationType, W as WalletTransactionType } from '../data-69952249.mjs';
|
|
2
|
+
export { A as AccountQuery, a as ApiKeyQuery, B as BalanceEntryQuery, b as BillPaymentQuery, c as CardTransactionQuery, C as CardsQuery, D as DepositQuery, K as KYCFile, P as PageSize, Q as QueryParams, S as StatementQuery, T as TOSAgreements, d as TransferQuery, U as UserQuery, W as WalletQuery, e as WalletTransactionQuery } from '../identities-5e48f342.mjs';
|
|
2
3
|
import '../errors/index.mjs';
|
|
3
|
-
import '../data-d5bcb7c8.mjs';
|