@cuenca-mx/cuenca-js 0.0.1-dev.36 → 0.0.1-dev.39
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-a57c1c8d.mjs +330 -0
- package/build/data-e3c6ae6c.cjs +354 -0
- package/build/identities-3e240f82.cjs +354 -0
- package/build/identities-f24cfdde.mjs +337 -0
- package/build/index.cjs +86 -31
- package/build/index.mjs +59 -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-4e6b348f.mjs → walletTransactionRequest-23775714.mjs} +67 -4
- package/build/{walletTransactionRequest-572c455b.cjs → walletTransactionRequest-3d10024d.cjs} +68 -3
- 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-e3c6ae6c.cjs');
|
|
10
|
+
var identities = require('./identities-3e240f82.cjs');
|
|
11
|
+
var walletTransactionRequest = require('./walletTransactionRequest-3d10024d.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.39";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,40 @@ class UserLogin {
|
|
|
877
878
|
});
|
|
878
879
|
}
|
|
879
880
|
|
|
881
|
+
class Verification {
|
|
882
|
+
constructor({
|
|
883
|
+
attempts,
|
|
884
|
+
code,
|
|
885
|
+
createdAt,
|
|
886
|
+
id,
|
|
887
|
+
platformId,
|
|
888
|
+
recipient,
|
|
889
|
+
type,
|
|
890
|
+
updatedAt,
|
|
891
|
+
}) {
|
|
892
|
+
this.attempts = attempts;
|
|
893
|
+
this.code = code;
|
|
894
|
+
this.createdAt = data.dateToUTC(createdAt);
|
|
895
|
+
this.id = id;
|
|
896
|
+
this.platformId = platformId;
|
|
897
|
+
this.recipient = recipient;
|
|
898
|
+
this.type = data.enumValueFromString(data.VerificationType, type);
|
|
899
|
+
this.updatedAt = data.dateToUTC(updatedAt);
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
static fromObject = ({ attempts, code, id, recipient, type, ...obj }) =>
|
|
903
|
+
new Verification({
|
|
904
|
+
attempts,
|
|
905
|
+
code,
|
|
906
|
+
id,
|
|
907
|
+
recipient,
|
|
908
|
+
type,
|
|
909
|
+
createdAt: obj.created_at,
|
|
910
|
+
platformId: obj.platform_id,
|
|
911
|
+
updatedAt: obj.updated_at,
|
|
912
|
+
});
|
|
913
|
+
}
|
|
914
|
+
|
|
880
915
|
class WalletTransaction extends Transaction {
|
|
881
916
|
constructor({
|
|
882
917
|
amount,
|
|
@@ -897,7 +932,7 @@ class WalletTransaction extends Transaction {
|
|
|
897
932
|
});
|
|
898
933
|
this.id = id;
|
|
899
934
|
this.transactionType = data.enumValueFromString(
|
|
900
|
-
|
|
935
|
+
data.WalletTransactionType,
|
|
901
936
|
transactionType,
|
|
902
937
|
);
|
|
903
938
|
this.walletUri = walletUri;
|
|
@@ -944,7 +979,7 @@ class WhatsAppTransfer extends Transaction {
|
|
|
944
979
|
this.destinationUri = destinationUri;
|
|
945
980
|
this.id = id;
|
|
946
981
|
this.expiresAt = data.dateToUTC(expiresAt);
|
|
947
|
-
this.network = data.enumValueFromString(
|
|
982
|
+
this.network = data.enumValueFromString(data.TransferNetwork, network);
|
|
948
983
|
this.phoneNumber = phoneNumber;
|
|
949
984
|
this.recipientName = recipientName;
|
|
950
985
|
this.trackingKey = trackingKey;
|
|
@@ -1003,6 +1038,7 @@ const getModelFromPath = (path, obj) => {
|
|
|
1003
1038
|
users: () => User.fromObject(obj),
|
|
1004
1039
|
user_credentials: () => UserCredential.fromObject(obj),
|
|
1005
1040
|
user_logins: () => UserLogin.fromObject(obj),
|
|
1041
|
+
verifications: () => Verification.fromObject(obj),
|
|
1006
1042
|
wallet_transactions: () => WalletTransaction.fromObject(obj),
|
|
1007
1043
|
whatsapp_transfers: () => WhatsAppTransfer.fromObject(obj),
|
|
1008
1044
|
};
|
|
@@ -1426,12 +1462,12 @@ class StatementResource extends mix(Resource).with(Downlodable, Queryable) {
|
|
|
1426
1462
|
}
|
|
1427
1463
|
|
|
1428
1464
|
async pdf(id) {
|
|
1429
|
-
const byteString = await this._download(id,
|
|
1465
|
+
const byteString = await this._download(id, data.FileFormat.Pdf);
|
|
1430
1466
|
return byteString;
|
|
1431
1467
|
}
|
|
1432
1468
|
|
|
1433
1469
|
async xml(id) {
|
|
1434
|
-
const byteString = await this._download(id,
|
|
1470
|
+
const byteString = await this._download(id, data.FileFormat.Xml);
|
|
1435
1471
|
return byteString;
|
|
1436
1472
|
}
|
|
1437
1473
|
}
|
|
@@ -1578,6 +1614,24 @@ class UserResourse extends mix(Resource).with(
|
|
|
1578
1614
|
}
|
|
1579
1615
|
}
|
|
1580
1616
|
|
|
1617
|
+
class VerificationResourse extends mix(Resource).with(Creatable, Updateable) {
|
|
1618
|
+
constructor(client) {
|
|
1619
|
+
super('verifications', Object, client);
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
async create({ platformId, recipient, type }) {
|
|
1623
|
+
const request = new walletTransactionRequest.VerificationRequest({ platformId, recipient, type });
|
|
1624
|
+
const verification = await this._create(request.toObject());
|
|
1625
|
+
return verification;
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
async update({ code, id }) {
|
|
1629
|
+
const request = new walletTransactionRequest.VerificationAttemptRequest({ code });
|
|
1630
|
+
const verification = await this._update(id, request.toObject());
|
|
1631
|
+
return verification;
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1581
1635
|
class WalletTransactionsResource extends mix(Resource).with(
|
|
1582
1636
|
Creatable,
|
|
1583
1637
|
Queryable,
|
|
@@ -1624,7 +1678,7 @@ class WhatsAppTransferResource extends mix(Resource).with(
|
|
|
1624
1678
|
}
|
|
1625
1679
|
|
|
1626
1680
|
class Cuenca {
|
|
1627
|
-
constructor(apiKey, apiSecret, phase =
|
|
1681
|
+
constructor(apiKey, apiSecret, phase = data.Phase.Sandbox) {
|
|
1628
1682
|
this.client = new Client({ apiKey, apiSecret, phase });
|
|
1629
1683
|
this.withClient(this.client);
|
|
1630
1684
|
}
|
|
@@ -1648,6 +1702,7 @@ class Cuenca {
|
|
|
1648
1702
|
this.userCredentials = new UserCredentialResource(client);
|
|
1649
1703
|
this.userLogins = new UserLoginResource(client);
|
|
1650
1704
|
this.users = new UserResourse(client);
|
|
1705
|
+
this.verifications = new VerificationResourse(client);
|
|
1651
1706
|
this.walletTransactions = new WalletTransactionsResource(client);
|
|
1652
1707
|
this.whatsAppTransfers = new WhatsAppTransferResource(client);
|
|
1653
1708
|
}
|
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-a57c1c8d.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-f24cfdde.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-23775714.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.39";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,40 @@ class UserLogin {
|
|
|
868
869
|
});
|
|
869
870
|
}
|
|
870
871
|
|
|
872
|
+
class Verification {
|
|
873
|
+
constructor({
|
|
874
|
+
attempts,
|
|
875
|
+
code,
|
|
876
|
+
createdAt,
|
|
877
|
+
id,
|
|
878
|
+
platformId,
|
|
879
|
+
recipient,
|
|
880
|
+
type,
|
|
881
|
+
updatedAt,
|
|
882
|
+
}) {
|
|
883
|
+
this.attempts = attempts;
|
|
884
|
+
this.code = code;
|
|
885
|
+
this.createdAt = dateToUTC(createdAt);
|
|
886
|
+
this.id = id;
|
|
887
|
+
this.platformId = platformId;
|
|
888
|
+
this.recipient = recipient;
|
|
889
|
+
this.type = enumValueFromString(VerificationType, type);
|
|
890
|
+
this.updatedAt = dateToUTC(updatedAt);
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
static fromObject = ({ attempts, code, id, recipient, type, ...obj }) =>
|
|
894
|
+
new Verification({
|
|
895
|
+
attempts,
|
|
896
|
+
code,
|
|
897
|
+
id,
|
|
898
|
+
recipient,
|
|
899
|
+
type,
|
|
900
|
+
createdAt: obj.created_at,
|
|
901
|
+
platformId: obj.platform_id,
|
|
902
|
+
updatedAt: obj.updated_at,
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
|
|
871
906
|
class WalletTransaction extends Transaction {
|
|
872
907
|
constructor({
|
|
873
908
|
amount,
|
|
@@ -994,6 +1029,7 @@ const getModelFromPath = (path, obj) => {
|
|
|
994
1029
|
users: () => User.fromObject(obj),
|
|
995
1030
|
user_credentials: () => UserCredential.fromObject(obj),
|
|
996
1031
|
user_logins: () => UserLogin.fromObject(obj),
|
|
1032
|
+
verifications: () => Verification.fromObject(obj),
|
|
997
1033
|
wallet_transactions: () => WalletTransaction.fromObject(obj),
|
|
998
1034
|
whatsapp_transfers: () => WhatsAppTransfer.fromObject(obj),
|
|
999
1035
|
};
|
|
@@ -1569,6 +1605,24 @@ class UserResourse extends mix(Resource).with(
|
|
|
1569
1605
|
}
|
|
1570
1606
|
}
|
|
1571
1607
|
|
|
1608
|
+
class VerificationResourse extends mix(Resource).with(Creatable, Updateable) {
|
|
1609
|
+
constructor(client) {
|
|
1610
|
+
super('verifications', Object, client);
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
async create({ platformId, recipient, type }) {
|
|
1614
|
+
const request = new VerificationRequest({ platformId, recipient, type });
|
|
1615
|
+
const verification = await this._create(request.toObject());
|
|
1616
|
+
return verification;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
async update({ code, id }) {
|
|
1620
|
+
const request = new VerificationAttemptRequest({ code });
|
|
1621
|
+
const verification = await this._update(id, request.toObject());
|
|
1622
|
+
return verification;
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1572
1626
|
class WalletTransactionsResource extends mix(Resource).with(
|
|
1573
1627
|
Creatable,
|
|
1574
1628
|
Queryable,
|
|
@@ -1639,6 +1693,7 @@ class Cuenca {
|
|
|
1639
1693
|
this.userCredentials = new UserCredentialResource(client);
|
|
1640
1694
|
this.userLogins = new UserLoginResource(client);
|
|
1641
1695
|
this.users = new UserResourse(client);
|
|
1696
|
+
this.verifications = new VerificationResourse(client);
|
|
1642
1697
|
this.walletTransactions = new WalletTransactionsResource(client);
|
|
1643
1698
|
this.whatsAppTransfers = new WhatsAppTransferResource(client);
|
|
1644
1699
|
}
|
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-3d10024d.cjs');
|
|
6
6
|
require('../errors/index.cjs');
|
|
7
|
-
require('../data-
|
|
7
|
+
require('../data-e3c6ae6c.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-23775714.mjs';
|
|
2
2
|
import '../errors/index.mjs';
|
|
3
|
-
import '../data-
|
|
3
|
+
import '../data-a57c1c8d.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-e3c6ae6c.cjs');
|
|
6
|
+
var identities = require('../identities-3e240f82.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-a57c1c8d.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-f24cfdde.mjs';
|
|
2
3
|
import '../errors/index.mjs';
|
|
3
|
-
import '../data-d5bcb7c8.mjs';
|