@fiado/api-invoker 1.1.22 → 1.1.24
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/container.config.js +2 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/bin/riskProfile/api/RiskProfileApi.d.ts +9 -0
- package/bin/riskProfile/api/RiskProfileApi.js +31 -0
- package/bin/riskProfile/api/interfaces/IRiskProfileApi.d.ts +4 -0
- package/bin/riskProfile/api/interfaces/IRiskProfileApi.js +2 -0
- package/bin/riskProfile/index.d.ts +2 -0
- package/bin/riskProfile/index.js +18 -0
- package/bin/stpServicePayment/api/StpServicePaymentApi.d.ts +1 -0
- package/bin/stpServicePayment/api/StpServicePaymentApi.js +4 -0
- package/bin/stpServicePayment/api/interfaces/IStpServicePaymentApi.d.ts +1 -0
- package/package.json +2 -2
- package/src/container.config.ts +3 -0
- package/src/index.ts +2 -1
- package/src/riskProfile/api/RiskProfileApi.ts +18 -0
- package/src/riskProfile/api/interfaces/IRiskProfileApi.ts +5 -0
- package/src/riskProfile/index.ts +2 -0
- package/src/stpServicePayment/api/StpServicePaymentApi.ts +5 -0
- package/src/stpServicePayment/api/interfaces/IStpServicePaymentApi.ts +2 -0
package/bin/container.config.js
CHANGED
|
@@ -34,6 +34,7 @@ const group_1 = require("./group");
|
|
|
34
34
|
const ActivityApi_1 = __importDefault(require("./activity-business/ActivityApi"));
|
|
35
35
|
const TransactionProcessorApi_1 = __importDefault(require("./transactionProcessor/api/TransactionProcessorApi"));
|
|
36
36
|
const ActivityPublisher_1 = __importDefault(require("./activity-business/queue/ActivityPublisher"));
|
|
37
|
+
const RiskProfileApi_1 = __importDefault(require("./riskProfile/api/RiskProfileApi"));
|
|
37
38
|
exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
38
39
|
bind("IDirectoryApi").to(directory_1.DirectoryApi);
|
|
39
40
|
bind("IIdentityApi").to(identity_1.IdentityApi);
|
|
@@ -64,4 +65,5 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
|
64
65
|
bind("IActivityApi").to(ActivityApi_1.default);
|
|
65
66
|
bind("ITransactionProcessorApi").to(TransactionProcessorApi_1.default);
|
|
66
67
|
bind("IActivityPublisher").to(ActivityPublisher_1.default);
|
|
68
|
+
bind("IRiskProfileApi").to(RiskProfileApi_1.default);
|
|
67
69
|
});
|
package/bin/index.d.ts
CHANGED
package/bin/index.js
CHANGED
|
@@ -42,3 +42,4 @@ __exportStar(require("./fraudPreventionEngine"), exports);
|
|
|
42
42
|
__exportStar(require("./group"), exports);
|
|
43
43
|
__exportStar(require("./activity-business"), exports);
|
|
44
44
|
__exportStar(require("./transactionProcessor"), exports);
|
|
45
|
+
__exportStar(require("./riskProfile"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IRiskProfileApi } from "./interfaces/IRiskProfileApi";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { CreateRiskProfileRequest } from "@fiado/type-kit/bin/riskProfile";
|
|
4
|
+
export default class RiskProfileApi implements IRiskProfileApi {
|
|
5
|
+
private httpRequest;
|
|
6
|
+
private readonly baseUrl;
|
|
7
|
+
constructor(httpRequest: IHttpRequest);
|
|
8
|
+
createRiskProfile(request: CreateRiskProfileRequest): Promise<any>;
|
|
9
|
+
}
|
|
@@ -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 RiskProfileApi = class RiskProfileApi {
|
|
17
|
+
constructor(httpRequest) {
|
|
18
|
+
this.httpRequest = httpRequest;
|
|
19
|
+
this.baseUrl = process.env.RISK_PROFILE_LAMBDA_URL || "";
|
|
20
|
+
}
|
|
21
|
+
async createRiskProfile(request) {
|
|
22
|
+
const url = `${this.baseUrl}/profiles`;
|
|
23
|
+
return await this.httpRequest.post(url, request);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
RiskProfileApi = __decorate([
|
|
27
|
+
(0, inversify_1.injectable)(),
|
|
28
|
+
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
29
|
+
__metadata("design:paramtypes", [Object])
|
|
30
|
+
], RiskProfileApi);
|
|
31
|
+
exports.default = RiskProfileApi;
|
|
@@ -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("./api/RiskProfileApi"), exports);
|
|
18
|
+
__exportStar(require("./api/interfaces/IRiskProfileApi"), exports);
|
|
@@ -8,6 +8,7 @@ export default class StpServicePaymentApi implements IStpServicePaymentApi {
|
|
|
8
8
|
constructor(httpRequest: IHttpRequest);
|
|
9
9
|
pay(request: ServicePaymentRequest): Promise<ApiGatewayResponse<any>>;
|
|
10
10
|
getTransaction(transactionNumber: string): Promise<ApiGatewayResponse<any>>;
|
|
11
|
+
getById(id: string): Promise<ApiGatewayResponse<any>>;
|
|
11
12
|
getPaymentValidation(transactionNumber: string): Promise<ApiGatewayResponse<any>>;
|
|
12
13
|
getCatalog(params: GetCatalogParams): Promise<ApiGatewayResponse<any>>;
|
|
13
14
|
}
|
|
@@ -26,6 +26,10 @@ let StpServicePaymentApi = class StpServicePaymentApi {
|
|
|
26
26
|
const url = `${this.baseUrl}/transaction/${transactionNumber}`;
|
|
27
27
|
return await this.httpRequest.get(url);
|
|
28
28
|
}
|
|
29
|
+
async getById(id) {
|
|
30
|
+
const url = `${this.baseUrl}/transaction/${id}`;
|
|
31
|
+
return await this.httpRequest.get(url);
|
|
32
|
+
}
|
|
29
33
|
async getPaymentValidation(transactionNumber) {
|
|
30
34
|
const url = `${this.baseUrl}/pay/validation/${transactionNumber}`;
|
|
31
35
|
return await this.httpRequest.get(url);
|
|
@@ -5,4 +5,5 @@ export interface IStpServicePaymentApi {
|
|
|
5
5
|
getTransaction(transactionNumber: string): Promise<ApiGatewayResponse<any>>;
|
|
6
6
|
getPaymentValidation(transactionNumber: string): Promise<ApiGatewayResponse<any>>;
|
|
7
7
|
getCatalog(params: GetCatalogParams): Promise<ApiGatewayResponse<any>>;
|
|
8
|
+
getById(id: string): any;
|
|
8
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.24",
|
|
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",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@fiado/gateway-adapter": "^1.1.32",
|
|
17
17
|
"@fiado/http-client": "^1.0.2",
|
|
18
18
|
"@fiado/logger": "^1.0.2",
|
|
19
|
-
"@fiado/type-kit": "^1.2.
|
|
19
|
+
"@fiado/type-kit": "^1.2.55",
|
|
20
20
|
"dotenv": "^16.4.5",
|
|
21
21
|
"inversify": "^6.0.2",
|
|
22
22
|
"reflect-metadata": "^0.2.1",
|
package/src/container.config.ts
CHANGED
|
@@ -43,6 +43,8 @@ import ActivityApi from "./activity-business/ActivityApi";
|
|
|
43
43
|
import TransactionProcessorApi from "./transactionProcessor/api/TransactionProcessorApi";
|
|
44
44
|
import {ITransactionProcessorApi} from "./transactionProcessor";
|
|
45
45
|
import ActivityPublisher from "./activity-business/queue/ActivityPublisher";
|
|
46
|
+
import RiskProfileApi from "./riskProfile/api/RiskProfileApi";
|
|
47
|
+
import {IRiskProfileApi} from "./riskProfile";
|
|
46
48
|
|
|
47
49
|
export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
|
|
48
50
|
bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
|
|
@@ -74,4 +76,5 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
|
|
|
74
76
|
bind<IActivityApi>("IActivityApi").to(ActivityApi);
|
|
75
77
|
bind<ITransactionProcessorApi>("ITransactionProcessorApi").to(TransactionProcessorApi);
|
|
76
78
|
bind<IActivityPublisher>("IActivityPublisher").to(ActivityPublisher);
|
|
79
|
+
bind<IRiskProfileApi>("IRiskProfileApi").to(RiskProfileApi);
|
|
77
80
|
});
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {IRiskProfileApi} from "./interfaces/IRiskProfileApi";
|
|
2
|
+
import {inject, injectable} from "inversify";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import {CreateRiskProfileRequest} from "@fiado/type-kit/bin/riskProfile";
|
|
5
|
+
|
|
6
|
+
@injectable()
|
|
7
|
+
export default class RiskProfileApi implements IRiskProfileApi {
|
|
8
|
+
private readonly baseUrl = process.env.RISK_PROFILE_LAMBDA_URL || "";
|
|
9
|
+
|
|
10
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async createRiskProfile(request: CreateRiskProfileRequest): Promise<any> {
|
|
14
|
+
const url = `${this.baseUrl}/profiles`;
|
|
15
|
+
return await this.httpRequest.post(url, request);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -21,6 +21,11 @@ export default class StpServicePaymentApi implements IStpServicePaymentApi {
|
|
|
21
21
|
return await this.httpRequest.get(url);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
async getById(id: string): Promise<ApiGatewayResponse<any>> {
|
|
25
|
+
const url = `${this.baseUrl}/transaction/${id}`;
|
|
26
|
+
return await this.httpRequest.get(url);
|
|
27
|
+
}
|
|
28
|
+
|
|
24
29
|
async getPaymentValidation(transactionNumber: string): Promise<ApiGatewayResponse<any>> {
|
|
25
30
|
const url = `${this.baseUrl}/pay/validation/${transactionNumber}`;
|
|
26
31
|
return await this.httpRequest.get(url);
|