@fiado/api-invoker 1.0.63 → 1.0.65
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/contract-generator/ContractGeneratorApi.d.ts +9 -0
- package/bin/contract-generator/ContractGeneratorApi.js +37 -0
- package/bin/contract-generator/index.d.ts +2 -0
- package/bin/contract-generator/index.js +18 -0
- package/bin/contract-generator/interfaces/IContractGeneratorApi.d.ts +14 -0
- package/bin/contract-generator/interfaces/IContractGeneratorApi.js +2 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/package.json +2 -2
- package/src/container.config.ts +3 -0
- package/src/contract-generator/ContractGeneratorApi.ts +19 -0
- package/src/contract-generator/index.ts +3 -0
- package/src/contract-generator/interfaces/IContractGeneratorApi.ts +16 -0
- package/src/index.ts +2 -1
package/bin/container.config.js
CHANGED
|
@@ -20,6 +20,7 @@ const ExchangeRatesApi_1 = __importDefault(require("./exchangeRates/ExchangeRate
|
|
|
20
20
|
const authentication_1 = require("./authentication");
|
|
21
21
|
const card_1 = require("./card");
|
|
22
22
|
const TransactionPublisher_1 = require("./transaction/queue/TransactionPublisher");
|
|
23
|
+
const ContractGeneratorApi_1 = require("./contract-generator/ContractGeneratorApi");
|
|
23
24
|
exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
24
25
|
bind("IDirectoryApi").to(directory_1.DirectoryApi);
|
|
25
26
|
bind("IIdentityApi").to(identity_1.IdentityApi);
|
|
@@ -36,4 +37,5 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
|
36
37
|
bind("ITransactionPublisher").to(TransactionPublisher_1.TransactionPublisher);
|
|
37
38
|
bind("IAuthenticationApi").to(authentication_1.AuthenticationApi);
|
|
38
39
|
bind("ICardApi").to(card_1.CardApi);
|
|
40
|
+
bind("IContractGeneratorApi").to(ContractGeneratorApi_1.ContractGeneratorApi);
|
|
39
41
|
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IContractGeneratorApi } from "./interfaces/IContractGeneratorApi";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { ContractCreateRequest } from "@fiado/type-kit/bin/contract";
|
|
4
|
+
export declare class ContractGeneratorApi implements IContractGeneratorApi {
|
|
5
|
+
private httpRequest;
|
|
6
|
+
private readonly baseUrl;
|
|
7
|
+
constructor(httpRequest: IHttpRequest);
|
|
8
|
+
generate(params: ContractCreateRequest): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ContractGeneratorApi = void 0;
|
|
19
|
+
const inversify_1 = require("inversify");
|
|
20
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
21
|
+
dotenv_1.default.config();
|
|
22
|
+
let ContractGeneratorApi = class ContractGeneratorApi {
|
|
23
|
+
constructor(httpRequest) {
|
|
24
|
+
this.httpRequest = httpRequest;
|
|
25
|
+
this.baseUrl = process.env.CONTRACT_GENERATOR_URL || "";
|
|
26
|
+
}
|
|
27
|
+
async generate(params) {
|
|
28
|
+
const url = `${this.baseUrl}`;
|
|
29
|
+
return await this.httpRequest.post(`${url}`, params, { 'spring.cloud.function.definition': "generateReport" });
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.ContractGeneratorApi = ContractGeneratorApi;
|
|
33
|
+
exports.ContractGeneratorApi = ContractGeneratorApi = __decorate([
|
|
34
|
+
(0, inversify_1.injectable)(),
|
|
35
|
+
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
36
|
+
__metadata("design:paramtypes", [Object])
|
|
37
|
+
], ContractGeneratorApi);
|
|
@@ -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/IContractGeneratorApi"), exports);
|
|
18
|
+
__exportStar(require("./ContractGeneratorApi"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ContractCreateRequest } from "@fiado/type-kit/bin/contract";
|
|
2
|
+
/**
|
|
3
|
+
* Interfaz para el servicio Contract Generator.
|
|
4
|
+
*/
|
|
5
|
+
export interface IContractGeneratorApi {
|
|
6
|
+
/**
|
|
7
|
+
* Obtiene una lista de people por sus IDs.
|
|
8
|
+
* @param ids Array de IDs de peopleId (UUIDs) a buscar.
|
|
9
|
+
* @returns Una promesa que resuelve a un arreglo de objetos de people.
|
|
10
|
+
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
11
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
12
|
+
*/
|
|
13
|
+
generate(params: ContractCreateRequest): Promise<any>;
|
|
14
|
+
}
|
package/bin/index.d.ts
CHANGED
package/bin/index.js
CHANGED
|
@@ -29,3 +29,4 @@ __exportStar(require("./account-pagoconfiado"), exports);
|
|
|
29
29
|
__exportStar(require("./exchangeRates"), exports);
|
|
30
30
|
__exportStar(require("./authentication"), exports);
|
|
31
31
|
__exportStar(require("./transaction"), exports);
|
|
32
|
+
__exportStar(require("./contract-generator"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.65",
|
|
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/api-invoker": "^1.0.19",
|
|
17
17
|
"@fiado/gateway-adapter": "^1.0.30",
|
|
18
18
|
"@fiado/http-client": "^1.0.1",
|
|
19
|
-
"@fiado/type-kit": "^1.1.
|
|
19
|
+
"@fiado/type-kit": "^1.1.18",
|
|
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
|
@@ -23,6 +23,8 @@ import { AuthenticationApi, IAuthenticationApi } from "./authentication";
|
|
|
23
23
|
import { CardApi, ICardApi } from "./card";
|
|
24
24
|
import { ITransactionPublisher } from "./transaction/queue/interfaces/ITransactionPublisher";
|
|
25
25
|
import { TransactionPublisher } from "./transaction/queue/TransactionPublisher";
|
|
26
|
+
import { ContractGeneratorApi } from "./contract-generator/ContractGeneratorApi";
|
|
27
|
+
import { IContractGeneratorApi } from "./contract-generator/interfaces/IContractGeneratorApi";
|
|
26
28
|
|
|
27
29
|
export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
|
|
28
30
|
bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
|
|
@@ -40,4 +42,5 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
|
|
|
40
42
|
bind<ITransactionPublisher>("ITransactionPublisher").to(TransactionPublisher);
|
|
41
43
|
bind<IAuthenticationApi>("IAuthenticationApi").to(AuthenticationApi);
|
|
42
44
|
bind<ICardApi>("ICardApi").to(CardApi)
|
|
45
|
+
bind<IContractGeneratorApi>("IContractGeneratorApi").to(ContractGeneratorApi)
|
|
43
46
|
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { inject, injectable } from "inversify";
|
|
2
|
+
import { IContractGeneratorApi } from "./interfaces/IContractGeneratorApi";
|
|
3
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
+
import dotenv from 'dotenv';
|
|
5
|
+
import { ContractCreateRequest } from "@fiado/type-kit/bin/contract";
|
|
6
|
+
dotenv.config();
|
|
7
|
+
|
|
8
|
+
@injectable()
|
|
9
|
+
export class ContractGeneratorApi implements IContractGeneratorApi {
|
|
10
|
+
|
|
11
|
+
private readonly baseUrl = process.env.CONTRACT_GENERATOR_URL || "";
|
|
12
|
+
|
|
13
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
14
|
+
|
|
15
|
+
async generate(params: ContractCreateRequest): Promise<any> {
|
|
16
|
+
const url = `${this.baseUrl}`;
|
|
17
|
+
return await this.httpRequest.post(`${url}`,params, { 'spring.cloud.function.definition': "generateReport" });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ContractCreateRequest } from "@fiado/type-kit/bin/contract";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Interfaz para el servicio Contract Generator.
|
|
5
|
+
*/
|
|
6
|
+
export interface IContractGeneratorApi {
|
|
7
|
+
/**
|
|
8
|
+
* Obtiene una lista de people por sus IDs.
|
|
9
|
+
* @param ids Array de IDs de peopleId (UUIDs) a buscar.
|
|
10
|
+
* @returns Una promesa que resuelve a un arreglo de objetos de people.
|
|
11
|
+
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
12
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
13
|
+
*/
|
|
14
|
+
generate(params:ContractCreateRequest): Promise<any>;
|
|
15
|
+
|
|
16
|
+
}
|
package/src/index.ts
CHANGED