@cuenca-mx/cuenca-js 2.0.0-dev0 → 2.0.0-dev2
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-ca00ac2d.cjs → data-added373.cjs} +24 -0
- package/build/{data-91da6d58.mjs → data-fa440a47.mjs} +21 -1
- package/build/dts/index.d.ts +5 -1
- package/build/dts/models/index.d.ts +5 -0
- package/build/dts/models/legalPerson.d.ts +10 -0
- package/build/dts/models/operator.d.ts +17 -0
- package/build/dts/models/operatorLogin.d.ts +11 -0
- package/build/dts/models/paymentOrder.d.ts +42 -0
- package/build/dts/requests/index.d.ts +6 -0
- package/build/dts/requests/legalPersonRequest.d.ts +33 -0
- package/build/dts/requests/operatorLoginRequest.d.ts +9 -0
- package/build/dts/requests/operatorRequest.d.ts +24 -0
- package/build/dts/requests/paymentOrderRequest.d.ts +28 -0
- package/build/dts/resources/index.d.ts +4 -0
- package/build/dts/resources/legalPersons.d.ts +54 -0
- package/build/dts/resources/operatorLogins.d.ts +19 -0
- package/build/dts/resources/operators.d.ts +54 -0
- package/build/dts/resources/paymentOrders.d.ts +57 -0
- package/build/dts/types/enums.d.ts +24 -0
- package/build/dts/types/queries/index.d.ts +2 -0
- package/build/dts/types/queries/operatorQuery.d.ts +4 -0
- package/build/dts/types/queries/paymentOrderQuery.d.ts +8 -0
- package/build/index.cjs +145 -10
- package/build/index.mjs +145 -10
- package/build/requests/index.cjs +9 -2
- package/build/requests/index.mjs +2 -2
- package/build/types/index.cjs +6 -2
- package/build/types/index.mjs +2 -2
- package/build/umd/cuenca.umd.js +1 -1
- package/build/{vulnerableActivity-d5aed4a7.cjs → vulnerableActivity-48357401.cjs} +1 -1
- package/build/{vulnerableActivity-61dc2846.mjs → vulnerableActivity-e5e336fc.mjs} +2 -2
- package/build/{walletTransactionRequest-aab46c5e.cjs → walletTransactionRequest-3feb43b2.cjs} +82 -1
- package/build/{walletTransactionRequest-dc11fc69.mjs → walletTransactionRequest-72ea259b.mjs} +76 -2
- package/package.json +1 -1
package/build/index.cjs
CHANGED
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var Buffer = require('buffer');
|
|
6
6
|
var errors_index = require('./errors/index.cjs');
|
|
7
7
|
var jwt_index = require('./jwt/index.cjs');
|
|
8
|
-
var data = require('./data-
|
|
9
|
-
var vulnerableActivity = require('./vulnerableActivity-
|
|
10
|
-
var walletTransactionRequest = require('./walletTransactionRequest-
|
|
8
|
+
var data = require('./data-added373.cjs');
|
|
9
|
+
var vulnerableActivity = require('./vulnerableActivity-48357401.cjs');
|
|
10
|
+
var walletTransactionRequest = require('./walletTransactionRequest-3feb43b2.cjs');
|
|
11
11
|
|
|
12
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
13
|
|
|
@@ -24,7 +24,7 @@ const isNode =
|
|
|
24
24
|
|
|
25
25
|
const runtimeEnv = { isBrowser, isNode };
|
|
26
26
|
|
|
27
|
-
const name="@cuenca-mx/cuenca-js";const version="2.0.0-
|
|
27
|
+
const name="@cuenca-mx/cuenca-js";const version="2.0.0-dev2";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 types="./build/dts/index.d.ts";const sideEffects=false;const files=["build/**/*","errors/**/*","jwt/**/*","requests/**/*","types/**/*"];const exports$1={".":{types:"./build/dts/index.d.ts","import":"./build/index.mjs",require:"./build/index.cjs"},"./errors":{types:"./build/dts/errors.d.ts","import":"./build/errors/index.mjs",require:"./build/errors/index.cjs"},"./jwt":{types:"./build/dts/jwt.d.ts","import":"./build/jwt/index.mjs",require:"./build/jwt/index.cjs"},"./requests":{types:"./build/dts/requests/index.d.ts","import":"./build/requests/index.mjs",require:"./build/requests/index.cjs"},"./types":{types:"./build/dts/types/index.d.ts","import":"./build/types/index.mjs",require:"./build/types/index.cjs"}};const packageManager="yarn@3.2.0";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 engines={node:">=20"};const scripts={build:"rm -rf build/ tsconfig.tsbuildinfo && yarn rollup --config && yarn tsc -p tsconfig.json && yarn tsc-alias -p tsconfig.json --outDir build/dts",test:"vitest run --coverage",publish:"yarn build && yarn npm publish",dev:"rm -rf build/ && yarn rollup --config && yarn node ../example.cjs",example:"yarn node ../example.cjs"};const devDependencies={"@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.1.1","@rollup/plugin-typescript":"^11.1.6","@vitest/coverage-v8":"^1.6.0",rollup:"^2.61.1","rollup-plugin-terser":"^7.0.2","tsc-alias":"^1.8.10",typescript:"^4.9.5","vite-tsconfig-paths":"^4.3.2",vitest:"^1.6.0"};const dependencies={buffer:"^6.0.3"};var pkg = {name:name,version:version,description:description,main:main,module:module$1,browser:browser,types:types,sideEffects:sideEffects,files:files,exports:exports$1,packageManager:packageManager,type:type,repository:repository,keywords:keywords,license:license,bugs:bugs,homepage:homepage,engines:engines,scripts:scripts,devDependencies:devDependencies,dependencies:dependencies};
|
|
28
28
|
|
|
29
29
|
/* global FormData */
|
|
30
30
|
|
|
@@ -530,12 +530,6 @@ const KYCValidations = {
|
|
|
530
530
|
},
|
|
531
531
|
};
|
|
532
532
|
|
|
533
|
-
const LoginToken = {
|
|
534
|
-
fromObject: (obj) => ({
|
|
535
|
-
id: obj.id,
|
|
536
|
-
}),
|
|
537
|
-
};
|
|
538
|
-
|
|
539
533
|
const BaseUser = {
|
|
540
534
|
fromObject: (obj) => {
|
|
541
535
|
const camelized = data.camelize(obj);
|
|
@@ -548,6 +542,49 @@ const BaseUser = {
|
|
|
548
542
|
},
|
|
549
543
|
};
|
|
550
544
|
|
|
545
|
+
const toLegalRepresentatives$1 = (obj) => {
|
|
546
|
+
const value = obj.legal_representatives;
|
|
547
|
+
return value ? value.map(vulnerableActivity.LegalRepresentatives.fromObject) : undefined;
|
|
548
|
+
};
|
|
549
|
+
const LegalPerson = {
|
|
550
|
+
fromObject: (obj) => {
|
|
551
|
+
const base = BaseUser.fromObject(obj);
|
|
552
|
+
const camelized = data.camelize(obj);
|
|
553
|
+
return data.coerceDatesWithDefaults({
|
|
554
|
+
...camelized,
|
|
555
|
+
...base,
|
|
556
|
+
legalRepresentatives: toLegalRepresentatives$1(obj),
|
|
557
|
+
}, ['createdAt', 'updatedAt']);
|
|
558
|
+
},
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
const LoginToken = {
|
|
562
|
+
fromObject: (obj) => ({
|
|
563
|
+
id: obj.id,
|
|
564
|
+
}),
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
const Operator = {
|
|
568
|
+
fromObject: (obj) => data.coerceDatesWithDefaults(data.camelize(obj), [
|
|
569
|
+
'createdAt',
|
|
570
|
+
'updatedAt',
|
|
571
|
+
]),
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
const OperatorLogin = {
|
|
575
|
+
fromObject: (obj) => data.camelize(obj),
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
const PaymentOrder = {
|
|
579
|
+
fromObject: (obj) => data.coerceDatesWithDefaults(data.camelize(obj), [
|
|
580
|
+
'createdAt',
|
|
581
|
+
'updatedAt',
|
|
582
|
+
'expiresAt',
|
|
583
|
+
'authorizedAt',
|
|
584
|
+
'rejectedAt',
|
|
585
|
+
]),
|
|
586
|
+
};
|
|
587
|
+
|
|
551
588
|
const TransactionalProfile = {
|
|
552
589
|
fromObject: (obj) => {
|
|
553
590
|
const camelized = data.camelize(obj);
|
|
@@ -1210,6 +1247,19 @@ class KYCValidationsResource extends Creatable(Deactivable(Queryable(Retrievable
|
|
|
1210
1247
|
}
|
|
1211
1248
|
var KYCValidationsResource$1 = KYCValidationsResource;
|
|
1212
1249
|
|
|
1250
|
+
class LegalPersonResource extends Creatable(Queryable(Retrievable(Updateable(Resource)))) {
|
|
1251
|
+
constructor(client) {
|
|
1252
|
+
super(client, 'legal_persons', LegalPerson.fromObject);
|
|
1253
|
+
}
|
|
1254
|
+
async create(req) {
|
|
1255
|
+
return this._create(walletTransactionRequest.LegalPersonRequest.toCleanObject(req));
|
|
1256
|
+
}
|
|
1257
|
+
async update(legalPersonId, req) {
|
|
1258
|
+
return this._update(legalPersonId, walletTransactionRequest.LegalPersonUpdateRequest.toCleanObject(req));
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
var LegalPersonResource$1 = LegalPersonResource;
|
|
1262
|
+
|
|
1213
1263
|
class LoginTokenResource extends Creatable(Resource) {
|
|
1214
1264
|
constructor(client) {
|
|
1215
1265
|
super(client, 'login_tokens', LoginToken.fromObject);
|
|
@@ -1220,6 +1270,42 @@ class LoginTokenResource extends Creatable(Resource) {
|
|
|
1220
1270
|
}
|
|
1221
1271
|
var LoginTokenResource$1 = LoginTokenResource;
|
|
1222
1272
|
|
|
1273
|
+
class OperatorLoginResource extends Creatable(Resource) {
|
|
1274
|
+
constructor(client) {
|
|
1275
|
+
super(client, 'operator-login', OperatorLogin.fromObject);
|
|
1276
|
+
this.sessionIdInHeaders = null;
|
|
1277
|
+
}
|
|
1278
|
+
async create(email, password) {
|
|
1279
|
+
const operatorLogin = await this._create(walletTransactionRequest.OperatorLoginRequest.toCleanObject({ email, password }));
|
|
1280
|
+
if (operatorLogin.sessionToken) {
|
|
1281
|
+
this.sessionIdInHeaders = this.client.addHeadersToRequest({
|
|
1282
|
+
'X-Cuenca-SessionId': operatorLogin.sessionToken,
|
|
1283
|
+
});
|
|
1284
|
+
}
|
|
1285
|
+
return operatorLogin;
|
|
1286
|
+
}
|
|
1287
|
+
clearSessionHeader() {
|
|
1288
|
+
if (this.sessionIdInHeaders) {
|
|
1289
|
+
this.sessionIdInHeaders.eject();
|
|
1290
|
+
this.sessionIdInHeaders = null;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
var OperatorLoginResource$1 = OperatorLoginResource;
|
|
1295
|
+
|
|
1296
|
+
class OperatorResource extends Creatable(Queryable(Retrievable(Updateable(Resource)))) {
|
|
1297
|
+
constructor(client) {
|
|
1298
|
+
super(client, 'operators', Operator.fromObject);
|
|
1299
|
+
}
|
|
1300
|
+
async create(req) {
|
|
1301
|
+
return this._create(walletTransactionRequest.OperatorRequest.toCleanObject(req));
|
|
1302
|
+
}
|
|
1303
|
+
async update(operatorId, req) {
|
|
1304
|
+
return this._update(operatorId, walletTransactionRequest.OperatorUpdateRequest.toCleanObject(req));
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
var OperatorResource$1 = OperatorResource;
|
|
1308
|
+
|
|
1223
1309
|
class PartnerResource extends Creatable(Queryable(Retrievable(Updateable(Resource)))) {
|
|
1224
1310
|
constructor(client) {
|
|
1225
1311
|
super(client, 'partners', Partner.fromObject);
|
|
@@ -1233,6 +1319,51 @@ class PartnerResource extends Creatable(Queryable(Retrievable(Updateable(Resourc
|
|
|
1233
1319
|
}
|
|
1234
1320
|
var PartnerResource$1 = PartnerResource;
|
|
1235
1321
|
|
|
1322
|
+
const operatorIdHeader = (operatorId) => ({
|
|
1323
|
+
'X-Cuenca-Operator-Id': operatorId,
|
|
1324
|
+
});
|
|
1325
|
+
class PaymentOrderResource extends Creatable(Queryable(Retrievable(Resource))) {
|
|
1326
|
+
constructor(client) {
|
|
1327
|
+
super(client, 'payment_orders', PaymentOrder.fromObject);
|
|
1328
|
+
}
|
|
1329
|
+
async create(req, { operatorId }) {
|
|
1330
|
+
const response = await this.client.post({
|
|
1331
|
+
endpoint: `/${this.path}`,
|
|
1332
|
+
data: walletTransactionRequest.PaymentOrderRequest.toCleanObject(req),
|
|
1333
|
+
headers: operatorIdHeader(operatorId),
|
|
1334
|
+
});
|
|
1335
|
+
return this.fromObject(response);
|
|
1336
|
+
}
|
|
1337
|
+
async validate(req, { operatorId }) {
|
|
1338
|
+
const response = await this.client.post({
|
|
1339
|
+
endpoint: `/${this.path}/validate`,
|
|
1340
|
+
data: walletTransactionRequest.PaymentOrderRequest.toCleanObject(req),
|
|
1341
|
+
headers: operatorIdHeader(operatorId),
|
|
1342
|
+
});
|
|
1343
|
+
return this.fromObject(response);
|
|
1344
|
+
}
|
|
1345
|
+
async authorize(paymentOrderId, { operatorId, otp }) {
|
|
1346
|
+
const response = await this.client.post({
|
|
1347
|
+
endpoint: `/${this.path}/${paymentOrderId}/authorize`,
|
|
1348
|
+
data: {},
|
|
1349
|
+
headers: {
|
|
1350
|
+
...operatorIdHeader(operatorId),
|
|
1351
|
+
'X-Cuenca-OTP': otp,
|
|
1352
|
+
},
|
|
1353
|
+
});
|
|
1354
|
+
return this.fromObject(response);
|
|
1355
|
+
}
|
|
1356
|
+
async reject(paymentOrderId, { operatorId, rejectionReason, }) {
|
|
1357
|
+
const response = await this.client.post({
|
|
1358
|
+
endpoint: `/${this.path}/${paymentOrderId}/reject`,
|
|
1359
|
+
data: walletTransactionRequest.PaymentOrderRejectRequest.toCleanObject({ rejectionReason }),
|
|
1360
|
+
headers: operatorIdHeader(operatorId),
|
|
1361
|
+
});
|
|
1362
|
+
return this.fromObject(response);
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
var PaymentOrderResource$1 = PaymentOrderResource;
|
|
1366
|
+
|
|
1236
1367
|
class PostalCodeResource extends Queryable(Resource) {
|
|
1237
1368
|
constructor(client) {
|
|
1238
1369
|
super(client, 'postal_codes', PostalCode.fromObject);
|
|
@@ -1537,8 +1668,12 @@ class Cuenca {
|
|
|
1537
1668
|
this.files = new FileResource$1(client);
|
|
1538
1669
|
this.fraudFundsTransfers = new FraudFundsTransferResource$1(client);
|
|
1539
1670
|
this.kycValidations = new KYCValidationsResource$1(client);
|
|
1671
|
+
this.legalPersons = new LegalPersonResource$1(client);
|
|
1540
1672
|
this.loginTokens = new LoginTokenResource$1(client);
|
|
1673
|
+
this.operatorLogins = new OperatorLoginResource$1(client);
|
|
1674
|
+
this.operators = new OperatorResource$1(client);
|
|
1541
1675
|
this.partners = new PartnerResource$1(client);
|
|
1676
|
+
this.paymentOrders = new PaymentOrderResource$1(client);
|
|
1542
1677
|
this.postalCodes = new PostalCodeResource$1(client);
|
|
1543
1678
|
this.reports = new ReportResource$1(client);
|
|
1544
1679
|
this.savings = new SavingResource$1(client);
|
package/build/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import Buffer, { Buffer as Buffer$1 } from 'buffer';
|
|
2
2
|
import { CuencaException, CuencaResponseException, NoResultFound, MultipleResultsFound, PaginationError, InvalidPassword } from './errors/index.mjs';
|
|
3
3
|
import { Jwt } from './jwt/index.mjs';
|
|
4
|
-
import { P as Phase, F as FileFormat, c as coerceDatesWithDefaults, a as camelize, d as dateToUTC, C as CardStatus } from './data-
|
|
5
|
-
import { A as AlertLog, a as Address, K as KYCFile, T as TOSAgreements, b as TransactionalProfileServices, c as Audit, B as BusinessDetails, E as ExternalAccount,
|
|
6
|
-
import { A as AlertUpdateRequest, a as ApiKeyUpdateRequest, b as ArpcRequest, U as UserUpdateRequest, C as CardActivationRequest, c as CardRequest, d as CardUpdateRequest, e as CardValidationRequest, F as FileUploadRequest, f as FraudFundsTransferRequest, K as KYCValidationsRequest, P as PartnerUserRequest, R as ReportGenerateRequest, S as SavingRequest,
|
|
4
|
+
import { P as Phase, F as FileFormat, c as coerceDatesWithDefaults, a as camelize, d as dateToUTC, C as CardStatus } from './data-fa440a47.mjs';
|
|
5
|
+
import { A as AlertLog, a as Address, K as KYCFile, T as TOSAgreements, L as LegalRepresentatives, b as TransactionalProfileServices, c as Audit, B as BusinessDetails, E as ExternalAccount, d as License, S as ShareholderMoral, V as VulnerableActivity, t as toParams, e as toQueryString, f as toParams$1, g as toQueryString$1, v as validateStatementQuery } from './vulnerableActivity-e5e336fc.mjs';
|
|
6
|
+
import { A as AlertUpdateRequest, a as ApiKeyUpdateRequest, b as ArpcRequest, U as UserUpdateRequest, C as CardActivationRequest, c as CardRequest, d as CardUpdateRequest, e as CardValidationRequest, F as FileUploadRequest, f as FraudFundsTransferRequest, K as KYCValidationsRequest, L as LegalPersonRequest, g as LegalPersonUpdateRequest, O as OperatorLoginRequest, h as OperatorRequest, i as OperatorUpdateRequest, P as PartnerUserRequest, j as PaymentOrderRequest, k as PaymentOrderRejectRequest, R as ReportGenerateRequest, S as SavingRequest, l as SessionRequest, T as TransferRequest, m as TransferUpdateRequest, n as UserCredentialRequest, o as UserCredentialUpdateRequest, p as UserLoginRequest, q as UserReportCreateRequest, r as UserReportUpdateRequest, V as VerificationRequest, s as VerificationAttemptRequest, W as WalletTransactionRequest } from './walletTransactionRequest-72ea259b.mjs';
|
|
7
7
|
|
|
8
8
|
/* global window */
|
|
9
9
|
|
|
@@ -16,7 +16,7 @@ const isNode =
|
|
|
16
16
|
|
|
17
17
|
const runtimeEnv = { isBrowser, isNode };
|
|
18
18
|
|
|
19
|
-
const name="@cuenca-mx/cuenca-js";const version="2.0.0-
|
|
19
|
+
const name="@cuenca-mx/cuenca-js";const version="2.0.0-dev2";const description="Cuenca client for JS";const main="./build/index.cjs";const module="./build/index.mjs";const browser="./build/umd/cuenca.umd.js";const types="./build/dts/index.d.ts";const sideEffects=false;const files=["build/**/*","errors/**/*","jwt/**/*","requests/**/*","types/**/*"];const exports={".":{types:"./build/dts/index.d.ts","import":"./build/index.mjs",require:"./build/index.cjs"},"./errors":{types:"./build/dts/errors.d.ts","import":"./build/errors/index.mjs",require:"./build/errors/index.cjs"},"./jwt":{types:"./build/dts/jwt.d.ts","import":"./build/jwt/index.mjs",require:"./build/jwt/index.cjs"},"./requests":{types:"./build/dts/requests/index.d.ts","import":"./build/requests/index.mjs",require:"./build/requests/index.cjs"},"./types":{types:"./build/dts/types/index.d.ts","import":"./build/types/index.mjs",require:"./build/types/index.cjs"}};const packageManager="yarn@3.2.0";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 engines={node:">=20"};const scripts={build:"rm -rf build/ tsconfig.tsbuildinfo && yarn rollup --config && yarn tsc -p tsconfig.json && yarn tsc-alias -p tsconfig.json --outDir build/dts",test:"vitest run --coverage",publish:"yarn build && yarn npm publish",dev:"rm -rf build/ && yarn rollup --config && yarn node ../example.cjs",example:"yarn node ../example.cjs"};const devDependencies={"@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.1.1","@rollup/plugin-typescript":"^11.1.6","@vitest/coverage-v8":"^1.6.0",rollup:"^2.61.1","rollup-plugin-terser":"^7.0.2","tsc-alias":"^1.8.10",typescript:"^4.9.5","vite-tsconfig-paths":"^4.3.2",vitest:"^1.6.0"};const dependencies={buffer:"^6.0.3"};var pkg = {name:name,version:version,description:description,main:main,module:module,browser:browser,types:types,sideEffects:sideEffects,files:files,exports:exports,packageManager:packageManager,type:type,repository:repository,keywords:keywords,license:license,bugs:bugs,homepage:homepage,engines:engines,scripts:scripts,devDependencies:devDependencies,dependencies:dependencies};
|
|
20
20
|
|
|
21
21
|
/* global FormData */
|
|
22
22
|
|
|
@@ -522,12 +522,6 @@ const KYCValidations = {
|
|
|
522
522
|
},
|
|
523
523
|
};
|
|
524
524
|
|
|
525
|
-
const LoginToken = {
|
|
526
|
-
fromObject: (obj) => ({
|
|
527
|
-
id: obj.id,
|
|
528
|
-
}),
|
|
529
|
-
};
|
|
530
|
-
|
|
531
525
|
const BaseUser = {
|
|
532
526
|
fromObject: (obj) => {
|
|
533
527
|
const camelized = camelize(obj);
|
|
@@ -540,6 +534,49 @@ const BaseUser = {
|
|
|
540
534
|
},
|
|
541
535
|
};
|
|
542
536
|
|
|
537
|
+
const toLegalRepresentatives$1 = (obj) => {
|
|
538
|
+
const value = obj.legal_representatives;
|
|
539
|
+
return value ? value.map(LegalRepresentatives.fromObject) : undefined;
|
|
540
|
+
};
|
|
541
|
+
const LegalPerson = {
|
|
542
|
+
fromObject: (obj) => {
|
|
543
|
+
const base = BaseUser.fromObject(obj);
|
|
544
|
+
const camelized = camelize(obj);
|
|
545
|
+
return coerceDatesWithDefaults({
|
|
546
|
+
...camelized,
|
|
547
|
+
...base,
|
|
548
|
+
legalRepresentatives: toLegalRepresentatives$1(obj),
|
|
549
|
+
}, ['createdAt', 'updatedAt']);
|
|
550
|
+
},
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
const LoginToken = {
|
|
554
|
+
fromObject: (obj) => ({
|
|
555
|
+
id: obj.id,
|
|
556
|
+
}),
|
|
557
|
+
};
|
|
558
|
+
|
|
559
|
+
const Operator = {
|
|
560
|
+
fromObject: (obj) => coerceDatesWithDefaults(camelize(obj), [
|
|
561
|
+
'createdAt',
|
|
562
|
+
'updatedAt',
|
|
563
|
+
]),
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
const OperatorLogin = {
|
|
567
|
+
fromObject: (obj) => camelize(obj),
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
const PaymentOrder = {
|
|
571
|
+
fromObject: (obj) => coerceDatesWithDefaults(camelize(obj), [
|
|
572
|
+
'createdAt',
|
|
573
|
+
'updatedAt',
|
|
574
|
+
'expiresAt',
|
|
575
|
+
'authorizedAt',
|
|
576
|
+
'rejectedAt',
|
|
577
|
+
]),
|
|
578
|
+
};
|
|
579
|
+
|
|
543
580
|
const TransactionalProfile = {
|
|
544
581
|
fromObject: (obj) => {
|
|
545
582
|
const camelized = camelize(obj);
|
|
@@ -1202,6 +1239,19 @@ class KYCValidationsResource extends Creatable(Deactivable(Queryable(Retrievable
|
|
|
1202
1239
|
}
|
|
1203
1240
|
var KYCValidationsResource$1 = KYCValidationsResource;
|
|
1204
1241
|
|
|
1242
|
+
class LegalPersonResource extends Creatable(Queryable(Retrievable(Updateable(Resource)))) {
|
|
1243
|
+
constructor(client) {
|
|
1244
|
+
super(client, 'legal_persons', LegalPerson.fromObject);
|
|
1245
|
+
}
|
|
1246
|
+
async create(req) {
|
|
1247
|
+
return this._create(LegalPersonRequest.toCleanObject(req));
|
|
1248
|
+
}
|
|
1249
|
+
async update(legalPersonId, req) {
|
|
1250
|
+
return this._update(legalPersonId, LegalPersonUpdateRequest.toCleanObject(req));
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
var LegalPersonResource$1 = LegalPersonResource;
|
|
1254
|
+
|
|
1205
1255
|
class LoginTokenResource extends Creatable(Resource) {
|
|
1206
1256
|
constructor(client) {
|
|
1207
1257
|
super(client, 'login_tokens', LoginToken.fromObject);
|
|
@@ -1212,6 +1262,42 @@ class LoginTokenResource extends Creatable(Resource) {
|
|
|
1212
1262
|
}
|
|
1213
1263
|
var LoginTokenResource$1 = LoginTokenResource;
|
|
1214
1264
|
|
|
1265
|
+
class OperatorLoginResource extends Creatable(Resource) {
|
|
1266
|
+
constructor(client) {
|
|
1267
|
+
super(client, 'operator-login', OperatorLogin.fromObject);
|
|
1268
|
+
this.sessionIdInHeaders = null;
|
|
1269
|
+
}
|
|
1270
|
+
async create(email, password) {
|
|
1271
|
+
const operatorLogin = await this._create(OperatorLoginRequest.toCleanObject({ email, password }));
|
|
1272
|
+
if (operatorLogin.sessionToken) {
|
|
1273
|
+
this.sessionIdInHeaders = this.client.addHeadersToRequest({
|
|
1274
|
+
'X-Cuenca-SessionId': operatorLogin.sessionToken,
|
|
1275
|
+
});
|
|
1276
|
+
}
|
|
1277
|
+
return operatorLogin;
|
|
1278
|
+
}
|
|
1279
|
+
clearSessionHeader() {
|
|
1280
|
+
if (this.sessionIdInHeaders) {
|
|
1281
|
+
this.sessionIdInHeaders.eject();
|
|
1282
|
+
this.sessionIdInHeaders = null;
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
var OperatorLoginResource$1 = OperatorLoginResource;
|
|
1287
|
+
|
|
1288
|
+
class OperatorResource extends Creatable(Queryable(Retrievable(Updateable(Resource)))) {
|
|
1289
|
+
constructor(client) {
|
|
1290
|
+
super(client, 'operators', Operator.fromObject);
|
|
1291
|
+
}
|
|
1292
|
+
async create(req) {
|
|
1293
|
+
return this._create(OperatorRequest.toCleanObject(req));
|
|
1294
|
+
}
|
|
1295
|
+
async update(operatorId, req) {
|
|
1296
|
+
return this._update(operatorId, OperatorUpdateRequest.toCleanObject(req));
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
var OperatorResource$1 = OperatorResource;
|
|
1300
|
+
|
|
1215
1301
|
class PartnerResource extends Creatable(Queryable(Retrievable(Updateable(Resource)))) {
|
|
1216
1302
|
constructor(client) {
|
|
1217
1303
|
super(client, 'partners', Partner.fromObject);
|
|
@@ -1225,6 +1311,51 @@ class PartnerResource extends Creatable(Queryable(Retrievable(Updateable(Resourc
|
|
|
1225
1311
|
}
|
|
1226
1312
|
var PartnerResource$1 = PartnerResource;
|
|
1227
1313
|
|
|
1314
|
+
const operatorIdHeader = (operatorId) => ({
|
|
1315
|
+
'X-Cuenca-Operator-Id': operatorId,
|
|
1316
|
+
});
|
|
1317
|
+
class PaymentOrderResource extends Creatable(Queryable(Retrievable(Resource))) {
|
|
1318
|
+
constructor(client) {
|
|
1319
|
+
super(client, 'payment_orders', PaymentOrder.fromObject);
|
|
1320
|
+
}
|
|
1321
|
+
async create(req, { operatorId }) {
|
|
1322
|
+
const response = await this.client.post({
|
|
1323
|
+
endpoint: `/${this.path}`,
|
|
1324
|
+
data: PaymentOrderRequest.toCleanObject(req),
|
|
1325
|
+
headers: operatorIdHeader(operatorId),
|
|
1326
|
+
});
|
|
1327
|
+
return this.fromObject(response);
|
|
1328
|
+
}
|
|
1329
|
+
async validate(req, { operatorId }) {
|
|
1330
|
+
const response = await this.client.post({
|
|
1331
|
+
endpoint: `/${this.path}/validate`,
|
|
1332
|
+
data: PaymentOrderRequest.toCleanObject(req),
|
|
1333
|
+
headers: operatorIdHeader(operatorId),
|
|
1334
|
+
});
|
|
1335
|
+
return this.fromObject(response);
|
|
1336
|
+
}
|
|
1337
|
+
async authorize(paymentOrderId, { operatorId, otp }) {
|
|
1338
|
+
const response = await this.client.post({
|
|
1339
|
+
endpoint: `/${this.path}/${paymentOrderId}/authorize`,
|
|
1340
|
+
data: {},
|
|
1341
|
+
headers: {
|
|
1342
|
+
...operatorIdHeader(operatorId),
|
|
1343
|
+
'X-Cuenca-OTP': otp,
|
|
1344
|
+
},
|
|
1345
|
+
});
|
|
1346
|
+
return this.fromObject(response);
|
|
1347
|
+
}
|
|
1348
|
+
async reject(paymentOrderId, { operatorId, rejectionReason, }) {
|
|
1349
|
+
const response = await this.client.post({
|
|
1350
|
+
endpoint: `/${this.path}/${paymentOrderId}/reject`,
|
|
1351
|
+
data: PaymentOrderRejectRequest.toCleanObject({ rejectionReason }),
|
|
1352
|
+
headers: operatorIdHeader(operatorId),
|
|
1353
|
+
});
|
|
1354
|
+
return this.fromObject(response);
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
var PaymentOrderResource$1 = PaymentOrderResource;
|
|
1358
|
+
|
|
1228
1359
|
class PostalCodeResource extends Queryable(Resource) {
|
|
1229
1360
|
constructor(client) {
|
|
1230
1361
|
super(client, 'postal_codes', PostalCode.fromObject);
|
|
@@ -1529,8 +1660,12 @@ class Cuenca {
|
|
|
1529
1660
|
this.files = new FileResource$1(client);
|
|
1530
1661
|
this.fraudFundsTransfers = new FraudFundsTransferResource$1(client);
|
|
1531
1662
|
this.kycValidations = new KYCValidationsResource$1(client);
|
|
1663
|
+
this.legalPersons = new LegalPersonResource$1(client);
|
|
1532
1664
|
this.loginTokens = new LoginTokenResource$1(client);
|
|
1665
|
+
this.operatorLogins = new OperatorLoginResource$1(client);
|
|
1666
|
+
this.operators = new OperatorResource$1(client);
|
|
1533
1667
|
this.partners = new PartnerResource$1(client);
|
|
1668
|
+
this.paymentOrders = new PaymentOrderResource$1(client);
|
|
1534
1669
|
this.postalCodes = new PostalCodeResource$1(client);
|
|
1535
1670
|
this.reports = new ReportResource$1(client);
|
|
1536
1671
|
this.savings = new SavingResource$1(client);
|
package/build/requests/index.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var walletTransactionRequest = require('../walletTransactionRequest-
|
|
6
|
-
require('../data-
|
|
5
|
+
var walletTransactionRequest = require('../walletTransactionRequest-3feb43b2.cjs');
|
|
6
|
+
require('../data-added373.cjs');
|
|
7
7
|
require('../errors/index.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
@@ -19,7 +19,14 @@ exports.CardValidationRequest = walletTransactionRequest.CardValidationRequest;
|
|
|
19
19
|
exports.FileUploadRequest = walletTransactionRequest.FileUploadRequest;
|
|
20
20
|
exports.FraudFundsTransferRequest = walletTransactionRequest.FraudFundsTransferRequest;
|
|
21
21
|
exports.KYCValidationsRequest = walletTransactionRequest.KYCValidationsRequest;
|
|
22
|
+
exports.LegalPersonRequest = walletTransactionRequest.LegalPersonRequest;
|
|
23
|
+
exports.LegalPersonUpdateRequest = walletTransactionRequest.LegalPersonUpdateRequest;
|
|
24
|
+
exports.OperatorLoginRequest = walletTransactionRequest.OperatorLoginRequest;
|
|
25
|
+
exports.OperatorRequest = walletTransactionRequest.OperatorRequest;
|
|
26
|
+
exports.OperatorUpdateRequest = walletTransactionRequest.OperatorUpdateRequest;
|
|
22
27
|
exports.PartnerUserRequest = walletTransactionRequest.PartnerUserRequest;
|
|
28
|
+
exports.PaymentOrderRejectRequest = walletTransactionRequest.PaymentOrderRejectRequest;
|
|
29
|
+
exports.PaymentOrderRequest = walletTransactionRequest.PaymentOrderRequest;
|
|
23
30
|
exports.ReportGenerateRequest = walletTransactionRequest.ReportGenerateRequest;
|
|
24
31
|
exports.SavingRequest = walletTransactionRequest.SavingRequest;
|
|
25
32
|
exports.SessionRequest = walletTransactionRequest.SessionRequest;
|
package/build/requests/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import '../data-
|
|
1
|
+
export { t as AddressUpdateRequest, A as AlertUpdateRequest, a as ApiKeyUpdateRequest, b as ArpcRequest, C as CardActivationRequest, c as CardRequest, d as CardUpdateRequest, e as CardValidationRequest, F as FileUploadRequest, f as FraudFundsTransferRequest, K as KYCValidationsRequest, L as LegalPersonRequest, g as LegalPersonUpdateRequest, O as OperatorLoginRequest, h as OperatorRequest, i as OperatorUpdateRequest, P as PartnerUserRequest, k as PaymentOrderRejectRequest, j as PaymentOrderRequest, R as ReportGenerateRequest, S as SavingRequest, l as SessionRequest, u as TosUpdateRequest, T as TransferRequest, m as TransferUpdateRequest, n as UserCredentialRequest, o as UserCredentialUpdateRequest, p as UserLoginRequest, q as UserReportCreateRequest, r as UserReportUpdateRequest, U as UserUpdateRequest, s as VerificationAttemptRequest, V as VerificationRequest, W as WalletTransactionRequest } from '../walletTransactionRequest-72ea259b.mjs';
|
|
2
|
+
import '../data-fa440a47.mjs';
|
|
3
3
|
import '../errors/index.mjs';
|
package/build/types/index.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var data = require('../data-
|
|
6
|
-
var vulnerableActivity = require('../vulnerableActivity-
|
|
5
|
+
var data = require('../data-added373.cjs');
|
|
6
|
+
var vulnerableActivity = require('../vulnerableActivity-48357401.cjs');
|
|
7
7
|
require('../errors/index.cjs');
|
|
8
8
|
|
|
9
9
|
const MoralOperation = {
|
|
@@ -35,7 +35,11 @@ exports.MLIndicatorLevel = data.MLIndicatorLevel;
|
|
|
35
35
|
exports.MLIndicatorPeriod = data.MLIndicatorPeriod;
|
|
36
36
|
exports.MLIndicatorType = data.MLIndicatorType;
|
|
37
37
|
exports.Network = data.Network;
|
|
38
|
+
exports.OperatorRole = data.OperatorRole;
|
|
39
|
+
exports.OperatorStatus = data.OperatorStatus;
|
|
38
40
|
exports.PLDFilterType = data.PLDFilterType;
|
|
41
|
+
exports.PaymentOrderLineStatus = data.PaymentOrderLineStatus;
|
|
42
|
+
exports.PaymentOrderStatus = data.PaymentOrderStatus;
|
|
39
43
|
exports.Phase = data.Phase;
|
|
40
44
|
exports.SATRegimeCode = data.SATRegimeCode;
|
|
41
45
|
exports.SATRegimeLabels = data.SATRegimeLabels;
|
package/build/types/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as AlertStatus, B as BridgeAccountStatus, b as BridgeBankAccountStatus, e as BridgeTransactionType, f as CardErrorType, g as CardFundingType, h as CardIssuer, C as CardStatus, i as CardTransactionType, j as CardType, k as CommissionType, q as Country, l as Currency, D as DepositNetwork, E as EntryType, F as FileFormat, K as KYCFileType, m as KYCValidationSource, M as MLIndicatorLevel, o as MLIndicatorPeriod, n as MLIndicatorType, N as Network, p as PLDFilterType, P as Phase,
|
|
2
|
-
export { a as Address, A as AlertLog, c as Audit, B as BusinessDetails, E as ExternalAccount, K as KYCFile,
|
|
1
|
+
export { A as AlertStatus, B as BridgeAccountStatus, b as BridgeBankAccountStatus, e as BridgeTransactionType, f as CardErrorType, g as CardFundingType, h as CardIssuer, C as CardStatus, i as CardTransactionType, j as CardType, k as CommissionType, q as Country, l as Currency, D as DepositNetwork, E as EntryType, F as FileFormat, K as KYCFileType, m as KYCValidationSource, M as MLIndicatorLevel, o as MLIndicatorPeriod, n as MLIndicatorType, N as Network, O as OperatorRole, z as OperatorStatus, p as PLDFilterType, H as PaymentOrderLineStatus, G as PaymentOrderStatus, P as Phase, J as SATRegimeCode, L as SATRegimeLabels, t as SavingCategory, r as ServiceProviderCategory, u as SessionType, v as SourceAlertType, S as State, T as TrackDataMethod, w as TransactionStatus, x as TransferNetwork, U as UserStatus, y as UserType, I as VerificationStatus, V as VerificationType, W as WalletTransactionType } from '../data-fa440a47.mjs';
|
|
2
|
+
export { a as Address, A as AlertLog, c as Audit, B as BusinessDetails, E as ExternalAccount, K as KYCFile, L as LegalRepresentatives, d as License, P as PhysicalPerson, S as ShareholderMoral, h as ShareholderPhysical, T as TOSAgreements, b as TransactionalProfileServices, i as VerificationError, V as VulnerableActivity, f as bridgeToParams, g as bridgeToQueryString, f as bridgeTransactionToParams, g as bridgeTransactionToQueryString, t as toParams, e as toQueryString, v as validateStatementQuery } from '../vulnerableActivity-e5e336fc.mjs';
|
|
3
3
|
import '../errors/index.mjs';
|
|
4
4
|
|
|
5
5
|
const MoralOperation = {
|