@fiado/api-invoker 1.1.49 → 1.1.51

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.
@@ -37,6 +37,7 @@ const ActivityPublisher_1 = __importDefault(require("./activity-business/queue/A
37
37
  const RiskProfileApi_1 = __importDefault(require("./riskProfile/api/RiskProfileApi"));
38
38
  const riskProfile_1 = require("./riskProfile");
39
39
  const contactInformation_1 = require("./contactInformation");
40
+ const fiadoMessages_1 = require("./fiadoMessages");
40
41
  exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
41
42
  bind("IDirectoryApi").to(directory_1.DirectoryApi);
42
43
  bind("IIdentityApi").to(identity_1.IdentityApi);
@@ -70,4 +71,5 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
70
71
  bind("IRiskProfileApi").to(RiskProfileApi_1.default);
71
72
  bind("ITransactionAlarmPublisher").to(riskProfile_1.TransactionAlarmPublisher);
72
73
  bind("IContactInformationApi").to(contactInformation_1.ContactInformationApi);
74
+ bind("IFiadoMessagesApi").to(fiadoMessages_1.FiadoMessagesApi);
73
75
  });
@@ -0,0 +1,8 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { IFiadoMessagesApi } from "./interfaces/IFiadoMessagesApi";
3
+ export declare class FiadoMessagesApi implements IFiadoMessagesApi {
4
+ private httpRequest;
5
+ private readonly baseUrl;
6
+ constructor(httpRequest: IHttpRequest);
7
+ getValidatedOtpByDirectoryIdAndOtpCode(directoryId: string, otpCode: string): Promise<any>;
8
+ }
@@ -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
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.FiadoMessagesApi = void 0;
16
+ const inversify_1 = require("inversify");
17
+ let FiadoMessagesApi = class FiadoMessagesApi {
18
+ constructor(httpRequest) {
19
+ this.httpRequest = httpRequest;
20
+ this.baseUrl = process.env.MESSAGE_LAMBDA_URL || "";
21
+ }
22
+ async getValidatedOtpByDirectoryIdAndOtpCode(directoryId, otpCode) {
23
+ const url = `${this.baseUrl}`;
24
+ const operationName = "getValidatedOtpByDirectoryIdAndOtpCode";
25
+ const request = {
26
+ directoryId: directoryId,
27
+ otpCode: otpCode
28
+ };
29
+ return await this.httpRequest.post(`${url}`, request, { 'operationName': operationName });
30
+ }
31
+ };
32
+ exports.FiadoMessagesApi = FiadoMessagesApi;
33
+ exports.FiadoMessagesApi = FiadoMessagesApi = __decorate([
34
+ (0, inversify_1.injectable)(),
35
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
36
+ __metadata("design:paramtypes", [Object])
37
+ ], FiadoMessagesApi);
@@ -0,0 +1,3 @@
1
+ export interface IFiadoMessagesApi {
2
+ getValidatedOtpByDirectoryIdAndOtpCode(directoryId: string, otpCode: string): Promise<any>;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './api/interfaces/IFiadoMessagesApi';
2
+ export * from './api/FiadoMessagesApi';
@@ -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/interfaces/IFiadoMessagesApi"), exports);
18
+ __exportStar(require("./api/FiadoMessagesApi"), exports);
package/bin/index.d.ts CHANGED
@@ -27,3 +27,4 @@ export * from "./group";
27
27
  export * from "./activity-business";
28
28
  export * from "./transactionProcessor";
29
29
  export * from "./riskProfile";
30
+ export * from "./fiadoMessages";
package/bin/index.js CHANGED
@@ -43,3 +43,4 @@ __exportStar(require("./group"), exports);
43
43
  __exportStar(require("./activity-business"), exports);
44
44
  __exportStar(require("./transactionProcessor"), exports);
45
45
  __exportStar(require("./riskProfile"), exports);
46
+ __exportStar(require("./fiadoMessages"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.1.49",
3
+ "version": "1.1.51",
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",
@@ -45,7 +45,8 @@ import {ITransactionProcessorApi} from "./transactionProcessor";
45
45
  import ActivityPublisher from "./activity-business/queue/ActivityPublisher";
46
46
  import RiskProfileApi from "./riskProfile/api/RiskProfileApi";
47
47
  import {IRiskProfileApi, ITransactionAlarmPublisher, TransactionAlarmPublisher} from "./riskProfile";
48
- import { ContactInformationApi, IContactInformationApi } from "./contactInformation";
48
+ import {ContactInformationApi, IContactInformationApi} from "./contactInformation";
49
+ import {FiadoMessagesApi, IFiadoMessagesApi} from "./fiadoMessages";
49
50
 
50
51
  export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
51
52
  bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
@@ -80,4 +81,5 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
80
81
  bind<IRiskProfileApi>("IRiskProfileApi").to(RiskProfileApi);
81
82
  bind<ITransactionAlarmPublisher>("ITransactionAlarmPublisher").to(TransactionAlarmPublisher);
82
83
  bind<IContactInformationApi>("IContactInformationApi").to(ContactInformationApi);
84
+ bind<IFiadoMessagesApi>("IFiadoMessagesApi").to(FiadoMessagesApi);
83
85
  });
@@ -0,0 +1,21 @@
1
+ import {inject, injectable} from "inversify";
2
+ import {IHttpRequest} from "@fiado/http-client";
3
+ import {IFiadoMessagesApi} from "./interfaces/IFiadoMessagesApi";
4
+
5
+ @injectable()
6
+ export class FiadoMessagesApi implements IFiadoMessagesApi {
7
+ private readonly baseUrl = process.env.MESSAGE_LAMBDA_URL || "";
8
+
9
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
10
+ }
11
+
12
+ async getValidatedOtpByDirectoryIdAndOtpCode(directoryId: string, otpCode: string): Promise<any> {
13
+ const url: string = `${this.baseUrl}`;
14
+ const operationName: string = "getValidatedOtpByDirectoryIdAndOtpCode";
15
+ const request = {
16
+ directoryId: directoryId,
17
+ otpCode: otpCode
18
+ };
19
+ return await this.httpRequest.post(`${url}`, request, {'operationName': operationName});
20
+ }
21
+ }
@@ -0,0 +1,3 @@
1
+ export interface IFiadoMessagesApi {
2
+ getValidatedOtpByDirectoryIdAndOtpCode(directoryId: string, otpCode: string): Promise<any>;
3
+ }
@@ -0,0 +1,2 @@
1
+ export * from './api/interfaces/IFiadoMessagesApi';
2
+ export * from './api/FiadoMessagesApi';
package/src/index.ts CHANGED
@@ -26,4 +26,5 @@ export * from "./fraudPreventionEngine";
26
26
  export * from "./group";
27
27
  export * from "./activity-business";
28
28
  export * from "./transactionProcessor";
29
- export * from "./riskProfile";
29
+ export * from "./riskProfile";
30
+ export * from "./fiadoMessages";