@fiado/api-invoker 1.4.4 → 1.4.6
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/authentication/AuthenticationApi.js +1 -1
- package/bin/cnbv-connector/CnbvConnectorApi.d.ts +10 -0
- package/bin/cnbv-connector/CnbvConnectorApi.js +31 -0
- package/bin/cnbv-connector/index.d.ts +2 -0
- package/bin/cnbv-connector/index.js +18 -0
- package/bin/cnbv-connector/interfaces/ICnbvConnectorApi.d.ts +5 -0
- package/bin/cnbv-connector/interfaces/ICnbvConnectorApi.js +2 -0
- package/bin/onboarding/api/OnboardingApi.d.ts +1 -0
- package/bin/onboarding/api/OnboardingApi.js +4 -0
- package/bin/onboarding/api/interfaces/IOnboardingApi.d.ts +1 -0
- package/package.json +2 -2
- package/src/authentication/AuthenticationApi.ts +1 -1
- package/src/cnbv-connector/CnbvConnectorApi.ts +19 -0
- package/src/cnbv-connector/index.ts +2 -0
- package/src/cnbv-connector/interfaces/ICnbvConnectorApi.ts +7 -0
- package/src/onboarding/api/OnboardingApi.ts +5 -0
- package/src/onboarding/api/interfaces/IOnboardingApi.ts +1 -0
|
@@ -26,7 +26,7 @@ let AuthenticationApi = class AuthenticationApi {
|
|
|
26
26
|
async deleteAuthSessionByDirectoryId(directoryId) {
|
|
27
27
|
const url = `${process.env.AUTH_LAMBDA_URL}`;
|
|
28
28
|
const operation = "deleteAuthSessionByDirectoryId";
|
|
29
|
-
return await this.httpRequest.
|
|
29
|
+
return await this.httpRequest.post(url, { directoryId }, { 'operationName': operation });
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
exports.AuthenticationApi = AuthenticationApi;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ICnbvConnectorApi } from "./interfaces/ICnbvConnectorApi";
|
|
2
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
3
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
+
import { CNBVLocalityRequest, CNBVLocalityResponse } from "@fiado/type-kit/bin/cnbv";
|
|
5
|
+
export default class CnbvConnectorApi implements ICnbvConnectorApi {
|
|
6
|
+
private httpRequest;
|
|
7
|
+
private readonly baseUrl;
|
|
8
|
+
constructor(httpRequest: IHttpRequest);
|
|
9
|
+
findLocalityByAddress(request: CNBVLocalityRequest): Promise<ApiGatewayResponse<CNBVLocalityResponse>>;
|
|
10
|
+
}
|
|
@@ -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 CnbvConnectorApi = class CnbvConnectorApi {
|
|
17
|
+
constructor(httpRequest) {
|
|
18
|
+
this.httpRequest = httpRequest;
|
|
19
|
+
this.baseUrl = process.env.CNBV_CONNECTOR_URL || "";
|
|
20
|
+
}
|
|
21
|
+
async findLocalityByAddress(request) {
|
|
22
|
+
const url = `${this.baseUrl}/localities/find`;
|
|
23
|
+
return await this.httpRequest.post(url, request);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
CnbvConnectorApi = __decorate([
|
|
27
|
+
(0, inversify_1.injectable)(),
|
|
28
|
+
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
29
|
+
__metadata("design:paramtypes", [Object])
|
|
30
|
+
], CnbvConnectorApi);
|
|
31
|
+
exports.default = CnbvConnectorApi;
|
|
@@ -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/ICnbvConnectorApi"), exports);
|
|
18
|
+
__exportStar(require("./CnbvConnectorApi"), exports);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { CNBVLocalityRequest, CNBVLocalityResponse } from "@fiado/type-kit/bin/cnbv";
|
|
3
|
+
export interface ICnbvConnectorApi {
|
|
4
|
+
findLocalityByAddress(request: CNBVLocalityRequest): Promise<ApiGatewayResponse<CNBVLocalityResponse>>;
|
|
5
|
+
}
|
|
@@ -18,6 +18,10 @@ let OnboardingApi = class OnboardingApi {
|
|
|
18
18
|
this.httpRequest = httpRequest;
|
|
19
19
|
this.baseUrl = process.env.ONBOARDING_LAMBDA_URL || "";
|
|
20
20
|
}
|
|
21
|
+
async getByReferralDirectoryId(referralDirectoryId) {
|
|
22
|
+
const url = `${this.baseUrl}all?referralDirectoryId=${referralDirectoryId}`;
|
|
23
|
+
return await this.httpRequest.get(`${url}`);
|
|
24
|
+
}
|
|
21
25
|
async delete(id) {
|
|
22
26
|
const url = `${this.baseUrl}onboarding/${id}`;
|
|
23
27
|
return await this.httpRequest.delete(`${url}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.6",
|
|
4
4
|
"description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a través 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.43",
|
|
17
17
|
"@fiado/http-client": "^1.0.7",
|
|
18
18
|
"@fiado/logger": "^1.0.3",
|
|
19
|
-
"@fiado/type-kit": "^2.0.
|
|
19
|
+
"@fiado/type-kit": "^2.0.86",
|
|
20
20
|
"dotenv": "^16.4.7",
|
|
21
21
|
"inversify": "^6.2.2",
|
|
22
22
|
"reflect-metadata": "^0.2.2"
|
|
@@ -19,6 +19,6 @@ export class AuthenticationApi implements IAuthenticationApi {
|
|
|
19
19
|
const url = `${process.env.AUTH_LAMBDA_URL}`;
|
|
20
20
|
const operation = "deleteAuthSessionByDirectoryId";
|
|
21
21
|
|
|
22
|
-
return await this.httpRequest.
|
|
22
|
+
return await this.httpRequest.post(url, {directoryId}, { 'operationName': operation });
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ICnbvConnectorApi } from "./interfaces/ICnbvConnectorApi";
|
|
2
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
3
|
+
import { inject, injectable } from "inversify";
|
|
4
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
5
|
+
import { CNBVLocalityRequest, CNBVLocalityResponse } from "@fiado/type-kit/bin/cnbv";
|
|
6
|
+
|
|
7
|
+
@injectable()
|
|
8
|
+
export default class CnbvConnectorApi implements ICnbvConnectorApi {
|
|
9
|
+
|
|
10
|
+
private readonly baseUrl = process.env.CNBV_CONNECTOR_URL || "";
|
|
11
|
+
|
|
12
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public async findLocalityByAddress(request: CNBVLocalityRequest): Promise<ApiGatewayResponse<CNBVLocalityResponse>> {
|
|
16
|
+
const url = `${this.baseUrl}/localities/find`;
|
|
17
|
+
return await this.httpRequest.post(url, request);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { CNBVLocalityRequest, CNBVLocalityResponse } from "@fiado/type-kit/bin/cnbv";
|
|
3
|
+
|
|
4
|
+
export interface ICnbvConnectorApi {
|
|
5
|
+
|
|
6
|
+
findLocalityByAddress(request: CNBVLocalityRequest): Promise<ApiGatewayResponse<CNBVLocalityResponse>>;
|
|
7
|
+
}
|
|
@@ -11,6 +11,11 @@ export default class OnboardingApi implements IOnboardingApi {
|
|
|
11
11
|
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
async getByReferralDirectoryId(referralDirectoryId: string): Promise<any> {
|
|
15
|
+
const url = `${this.baseUrl}all?referralDirectoryId=${referralDirectoryId}`;
|
|
16
|
+
return await this.httpRequest.get(`${url}`);
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
async delete(id: string): Promise<any> {
|
|
15
20
|
const url = `${this.baseUrl}onboarding/${id}`;
|
|
16
21
|
return await this.httpRequest.delete(`${url}`);
|