@fiado/api-invoker 1.1.55 → 1.1.56
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/bin/cnbv-business/CnbvApi.d.ts +8 -0
- package/bin/cnbv-business/CnbvApi.js +31 -0
- package/bin/cnbv-business/index.d.ts +2 -0
- package/bin/cnbv-business/index.js +18 -0
- package/bin/cnbv-business/interfaces/ICnbvApi.d.ts +3 -0
- package/bin/cnbv-business/interfaces/ICnbvApi.js +2 -0
- package/bin/container.config.js +2 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/package.json +1 -1
- package/src/cnbv-business/CnbvApi.ts +22 -0
- package/src/cnbv-business/index.ts +4 -0
- package/src/cnbv-business/interfaces/ICnbvApi.ts +7 -0
- package/src/container.config.ts +3 -0
- package/src/index.ts +2 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { ICnbvApi } from "./interfaces/ICnbvApi";
|
|
3
|
+
export default class CnbvApi implements ICnbvApi {
|
|
4
|
+
private httpRequest;
|
|
5
|
+
private readonly baseUrl;
|
|
6
|
+
constructor(httpRequest: IHttpRequest);
|
|
7
|
+
validateConcidence(fullName: string, yearOfBirth: string): Promise<any>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const inversify_1 = require("inversify");
|
|
16
|
+
let CnbvApi = class CnbvApi {
|
|
17
|
+
constructor(httpRequest) {
|
|
18
|
+
this.httpRequest = httpRequest;
|
|
19
|
+
this.baseUrl = process.env.CNBV_LAMBDA_URL || "";
|
|
20
|
+
}
|
|
21
|
+
async validateConcidence(fullName, yearOfBirth) {
|
|
22
|
+
const url = `${this.baseUrl}?value=${yearOfBirth}¶m=YEAR_OF_BIRTH&fullName=${fullName}`;
|
|
23
|
+
return await this.httpRequest.get(url);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
CnbvApi = __decorate([
|
|
27
|
+
(0, inversify_1.injectable)(),
|
|
28
|
+
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
29
|
+
__metadata("design:paramtypes", [Object])
|
|
30
|
+
], CnbvApi);
|
|
31
|
+
exports.default = CnbvApi;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./interfaces/ICnbvApi"), exports);
|
|
18
|
+
__exportStar(require("./CnbvApi"), exports);
|
package/bin/container.config.js
CHANGED
|
@@ -38,6 +38,7 @@ const RiskProfileApi_1 = __importDefault(require("./riskProfile/api/RiskProfileA
|
|
|
38
38
|
const riskProfile_1 = require("./riskProfile");
|
|
39
39
|
const contactInformation_1 = require("./contactInformation");
|
|
40
40
|
const fiadoMessages_1 = require("./fiadoMessages");
|
|
41
|
+
const CnbvApi_1 = __importDefault(require("./cnbv-business/CnbvApi"));
|
|
41
42
|
exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
42
43
|
bind("IDirectoryApi").to(directory_1.DirectoryApi);
|
|
43
44
|
bind("IIdentityApi").to(identity_1.IdentityApi);
|
|
@@ -72,4 +73,5 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
|
72
73
|
bind("ITransactionAlarmPublisher").to(riskProfile_1.TransactionAlarmPublisher);
|
|
73
74
|
bind("IContactInformationApi").to(contactInformation_1.ContactInformationApi);
|
|
74
75
|
bind("IFiadoMessagesApi").to(fiadoMessages_1.FiadoMessagesApi);
|
|
76
|
+
bind("ICnbvApi").to(CnbvApi_1.default);
|
|
75
77
|
});
|
package/bin/index.d.ts
CHANGED
package/bin/index.js
CHANGED
|
@@ -44,3 +44,4 @@ __exportStar(require("./activity-business"), exports);
|
|
|
44
44
|
__exportStar(require("./transactionProcessor"), exports);
|
|
45
45
|
__exportStar(require("./riskProfile"), exports);
|
|
46
46
|
__exportStar(require("./fiadoMessages"), exports);
|
|
47
|
+
__exportStar(require("./cnbv-business"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.56",
|
|
4
4
|
"description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a traves de invocaciones http",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"types": "bin/index.d.ts",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { inject, injectable } from "inversify";
|
|
3
|
+
import { ICnbvApi } from "./interfaces/ICnbvApi";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@injectable()
|
|
8
|
+
export default class CnbvApi implements ICnbvApi {
|
|
9
|
+
|
|
10
|
+
private readonly baseUrl = process.env.CNBV_LAMBDA_URL || "";
|
|
11
|
+
|
|
12
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
async validateConcidence(fullName: string, yearOfBirth: string): Promise<any> {
|
|
16
|
+
|
|
17
|
+
const url = `${this.baseUrl}?value=${yearOfBirth}¶m=YEAR_OF_BIRTH&fullName=${fullName}`;
|
|
18
|
+
|
|
19
|
+
return await this.httpRequest.get(url);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
package/src/container.config.ts
CHANGED
|
@@ -47,6 +47,8 @@ import RiskProfileApi from "./riskProfile/api/RiskProfileApi";
|
|
|
47
47
|
import {IRiskProfileApi, ITransactionAlarmPublisher, TransactionAlarmPublisher} from "./riskProfile";
|
|
48
48
|
import {ContactInformationApi, IContactInformationApi} from "./contactInformation";
|
|
49
49
|
import {FiadoMessagesApi, IFiadoMessagesApi} from "./fiadoMessages";
|
|
50
|
+
import CnbvApi from "./cnbv-business/CnbvApi";
|
|
51
|
+
import { ICnbvApi } from "./cnbv-business";
|
|
50
52
|
|
|
51
53
|
export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
|
|
52
54
|
bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
|
|
@@ -82,4 +84,5 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
|
|
|
82
84
|
bind<ITransactionAlarmPublisher>("ITransactionAlarmPublisher").to(TransactionAlarmPublisher);
|
|
83
85
|
bind<IContactInformationApi>("IContactInformationApi").to(ContactInformationApi);
|
|
84
86
|
bind<IFiadoMessagesApi>("IFiadoMessagesApi").to(FiadoMessagesApi);
|
|
87
|
+
bind<ICnbvApi>("ICnbvApi").to(CnbvApi);
|
|
85
88
|
});
|
package/src/index.ts
CHANGED