@fiado/api-invoker 3.0.19 → 3.0.21

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.
@@ -22,6 +22,7 @@ const authentication_1 = require("./authentication");
22
22
  const card_1 = require("./card");
23
23
  const transaction_1 = require("./transaction");
24
24
  const contract_generator_1 = require("./contract-generator");
25
+ const ContractBusinessApi_1 = __importDefault(require("./contract-business/api/ContractBusinessApi"));
25
26
  const ProductCatalogApi_1 = __importDefault(require("./product-catalog/ProductCatalogApi"));
26
27
  const collector_1 = require("./collector");
27
28
  const P2pContactApi_1 = __importDefault(require("./p2pContact/api/P2pContactApi"));
@@ -111,6 +112,7 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
111
112
  bind("IAuthenticationApi").to(authentication_1.AuthenticationApi);
112
113
  bind("ICardApi").to(card_1.CardApi);
113
114
  bind("IContractGeneratorApi").to(contract_generator_1.ContractGeneratorApi);
115
+ bind("IContractBusinessApi").to(ContractBusinessApi_1.default);
114
116
  bind("ICollectorApi").to(collector_1.CollectorApi);
115
117
  bind("IProductCatalogApi").to(ProductCatalogApi_1.default);
116
118
  bind("IP2pContactApi").to(P2pContactApi_1.default);
@@ -0,0 +1,13 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { IContractBusinessApi } from "./interfaces/IContractBusinessApi";
3
+ export default class ContractBusinessApi implements IContractBusinessApi {
4
+ private httpRequest;
5
+ private readonly baseUrl;
6
+ constructor(httpRequest: IHttpRequest);
7
+ signDomiciliation(params: {
8
+ directoryId: string;
9
+ peopleId: string;
10
+ folio: string;
11
+ sessionId: string;
12
+ }): Promise<any>;
13
+ }
@@ -0,0 +1,30 @@
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 ContractBusinessApi = class ContractBusinessApi {
17
+ constructor(httpRequest) {
18
+ this.httpRequest = httpRequest;
19
+ this.baseUrl = process.env.CONTRACT_BUSINESS_LAMBDA_URL || "";
20
+ }
21
+ async signDomiciliation(params) {
22
+ return await this.httpRequest.post(`${this.baseUrl}domiciliation/sign`, params);
23
+ }
24
+ };
25
+ ContractBusinessApi = __decorate([
26
+ (0, inversify_1.injectable)(),
27
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
28
+ __metadata("design:paramtypes", [Object])
29
+ ], ContractBusinessApi);
30
+ exports.default = ContractBusinessApi;
@@ -0,0 +1,8 @@
1
+ export interface IContractBusinessApi {
2
+ signDomiciliation(params: {
3
+ directoryId: string;
4
+ peopleId: string;
5
+ folio: string;
6
+ sessionId: string;
7
+ }): Promise<any>;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './api/ContractBusinessApi';
2
+ export * from './api/interfaces/IContractBusinessApi';
@@ -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/ContractBusinessApi"), exports);
18
+ __exportStar(require("./api/interfaces/IContractBusinessApi"), exports);
package/bin/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export * from "./exchangeRates";
15
15
  export * from "./authentication";
16
16
  export * from "./transaction";
17
17
  export * from "./contract-generator";
18
+ export * from "./contract-business";
18
19
  export * from "./product-catalog";
19
20
  export * from "./collector";
20
21
  export * from "./p2pContact";
package/bin/index.js CHANGED
@@ -31,6 +31,7 @@ __exportStar(require("./exchangeRates"), exports);
31
31
  __exportStar(require("./authentication"), exports);
32
32
  __exportStar(require("./transaction"), exports);
33
33
  __exportStar(require("./contract-generator"), exports);
34
+ __exportStar(require("./contract-business"), exports);
34
35
  __exportStar(require("./product-catalog"), exports);
35
36
  __exportStar(require("./collector"), exports);
36
37
  __exportStar(require("./p2pContact"), exports);
@@ -1,6 +1,6 @@
1
1
  import { IStpServicePaymentApi } from "./interfaces/IStpServicePaymentApi";
2
2
  import { IHttpRequest } from "@fiado/http-client";
3
- import { GetCatalogParams, ServicePaymentRequest } from "@fiado/type-kit/bin/servicePayment";
3
+ import { GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse } from "@fiado/type-kit/bin/servicePayment";
4
4
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
5
5
  export default class StpServicePaymentApi implements IStpServicePaymentApi {
6
6
  private httpRequest;
@@ -17,4 +17,5 @@ export default class StpServicePaymentApi implements IStpServicePaymentApi {
17
17
  getById(id: string): Promise<ApiGatewayResponse<any>>;
18
18
  getPaymentValidation(transactionNumber: string): Promise<ApiGatewayResponse<any>>;
19
19
  getCatalog(params: GetCatalogParams): Promise<ApiGatewayResponse<any>>;
20
+ verificateReference(request: ReferenceVerificationRequest): Promise<ApiGatewayResponse<ReferenceVerificationResponse>>;
20
21
  }
@@ -45,6 +45,10 @@ let StpServicePaymentApi = class StpServicePaymentApi {
45
45
  }
46
46
  return await this.httpRequest.get(url);
47
47
  }
48
+ async verificateReference(request) {
49
+ const url = `${this.baseUrl}verificateReference`;
50
+ return await this.httpRequest.post(url, request);
51
+ }
48
52
  };
49
53
  StpServicePaymentApi = __decorate([
50
54
  (0, inversify_1.injectable)(),
@@ -1,4 +1,4 @@
1
- import { GetCatalogParams, ServicePaymentRequest } from "@fiado/type-kit/bin/servicePayment";
1
+ import { GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse } from "@fiado/type-kit/bin/servicePayment";
2
2
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
3
3
  export interface IStpServicePaymentApi {
4
4
  pay(request: ServicePaymentRequest): Promise<ApiGatewayResponse<any>>;
@@ -12,4 +12,5 @@ export interface IStpServicePaymentApi {
12
12
  pageSize?: number;
13
13
  sort?: string;
14
14
  }): Promise<ApiGatewayResponse<any>>;
15
+ verificateReference(request: ReferenceVerificationRequest): Promise<ApiGatewayResponse<ReferenceVerificationResponse>>;
15
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "3.0.19",
3
+ "version": "3.0.21",
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.50",
17
17
  "@fiado/http-client": "^1.0.7",
18
18
  "@fiado/logger": "^1.0.3",
19
- "@fiado/type-kit": "^3.0.21",
19
+ "@fiado/type-kit": "^3.0.23",
20
20
  "dotenv": "^16.4.7",
21
21
  "inversify": "^6.2.2",
22
22
  "reflect-metadata": "^0.2.2"
@@ -23,6 +23,8 @@ import { AuthenticationApi, IAuthenticationApi } from "./authentication";
23
23
  import { CardApi, ICardApi } from "./card";
24
24
  import { ITransactionApi, ITransactionPublisher, TransactionPublisher } from "./transaction";
25
25
  import { ContractGeneratorApi, IContractGeneratorApi } from "./contract-generator";
26
+ import { IContractBusinessApi } from "./contract-business";
27
+ import ContractBusinessApi from "./contract-business/api/ContractBusinessApi";
26
28
  import { IProductCatalogApi } from "./product-catalog";
27
29
  import ProductCatalogApi from "./product-catalog/ProductCatalogApi";
28
30
  import { CollectorApi, ICollectorApi } from "./collector";
@@ -154,6 +156,7 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
154
156
  bind<IAuthenticationApi>("IAuthenticationApi").to(AuthenticationApi);
155
157
  bind<ICardApi>("ICardApi").to(CardApi);
156
158
  bind<IContractGeneratorApi>("IContractGeneratorApi").to(ContractGeneratorApi);
159
+ bind<IContractBusinessApi>("IContractBusinessApi").to(ContractBusinessApi);
157
160
  bind<ICollectorApi>("ICollectorApi").to(CollectorApi);
158
161
  bind<IProductCatalogApi>("IProductCatalogApi").to(ProductCatalogApi);
159
162
  bind<IP2pContactApi>("IP2pContactApi").to(P2pContactApi);
@@ -0,0 +1,21 @@
1
+ import { inject, injectable } from "inversify";
2
+ import { IHttpRequest } from "@fiado/http-client";
3
+ import { IContractBusinessApi } from "./interfaces/IContractBusinessApi";
4
+
5
+ @injectable()
6
+ export default class ContractBusinessApi implements IContractBusinessApi {
7
+
8
+ private readonly baseUrl = process.env.CONTRACT_BUSINESS_LAMBDA_URL || "";
9
+
10
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
11
+ }
12
+
13
+ async signDomiciliation(params: {
14
+ directoryId: string;
15
+ peopleId: string;
16
+ folio: string;
17
+ sessionId: string;
18
+ }): Promise<any> {
19
+ return await this.httpRequest.post(`${this.baseUrl}domiciliation/sign`, params);
20
+ }
21
+ }
@@ -0,0 +1,8 @@
1
+ export interface IContractBusinessApi {
2
+ signDomiciliation(params: {
3
+ directoryId: string;
4
+ peopleId: string;
5
+ folio: string;
6
+ sessionId: string;
7
+ }): Promise<any>;
8
+ }
@@ -0,0 +1,2 @@
1
+ export * from './api/ContractBusinessApi';
2
+ export * from './api/interfaces/IContractBusinessApi';
package/src/index.ts CHANGED
@@ -15,6 +15,7 @@ export * from "./exchangeRates";
15
15
  export * from "./authentication";
16
16
  export * from "./transaction";
17
17
  export * from "./contract-generator";
18
+ export * from "./contract-business";
18
19
  export * from "./product-catalog";
19
20
  export * from "./collector";
20
21
  export * from "./p2pContact";
@@ -1,7 +1,7 @@
1
1
  import {IStpServicePaymentApi} from "./interfaces/IStpServicePaymentApi";
2
2
  import {inject, injectable} from "inversify";
3
3
  import {IHttpRequest} from "@fiado/http-client";
4
- import {GetCatalogParams, ServicePaymentRequest} from "@fiado/type-kit/bin/servicePayment";
4
+ import {GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse} from "@fiado/type-kit/bin/servicePayment";
5
5
  import {ApiGatewayResponse} from "@fiado/gateway-adapter";
6
6
 
7
7
  @injectable()
@@ -42,4 +42,9 @@ export default class StpServicePaymentApi implements IStpServicePaymentApi {
42
42
  }
43
43
  return await this.httpRequest.get(url);
44
44
  }
45
+
46
+ async verificateReference(request: ReferenceVerificationRequest): Promise<ApiGatewayResponse<ReferenceVerificationResponse>> {
47
+ const url = `${this.baseUrl}verificateReference`;
48
+ return await this.httpRequest.post(url, request);
49
+ }
45
50
  }
@@ -1,4 +1,4 @@
1
- import {GetCatalogParams, ServicePaymentRequest} from "@fiado/type-kit/bin/servicePayment";
1
+ import {GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse} from "@fiado/type-kit/bin/servicePayment";
2
2
  import {ApiGatewayResponse} from "@fiado/gateway-adapter";
3
3
 
4
4
  export interface IStpServicePaymentApi {
@@ -13,4 +13,6 @@ export interface IStpServicePaymentApi {
13
13
  getById(id: string): Promise<ApiGatewayResponse<any>>;
14
14
 
15
15
  getSTPTransactionDownload(params: {date: string,index?:string,pageSize?:number, sort?:string}): Promise<ApiGatewayResponse<any>>;
16
+
17
+ verificateReference(request: ReferenceVerificationRequest): Promise<ApiGatewayResponse<ReferenceVerificationResponse>>;
16
18
  }