@fiado/api-invoker 3.0.6 → 3.0.8

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.
@@ -87,6 +87,7 @@ const CreditNotificationPublisher_1 = __importDefault(require("./credit-engine/q
87
87
  const CreditStatementPublisher_1 = __importDefault(require("./credit-engine/queue/CreditStatementPublisher"));
88
88
  const CreditReconciliationPublisher_1 = __importDefault(require("./credit-engine/queue/CreditReconciliationPublisher"));
89
89
  const CreditLienCollectionPublisher_1 = __importDefault(require("./credit-engine/queue/CreditLienCollectionPublisher"));
90
+ const PlatformErrorEventsPublisher_1 = __importDefault(require("./platform-error-events/queue/PlatformErrorEventsPublisher"));
90
91
  exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
91
92
  // UTILS bindings
92
93
  bind("InvokerUtils").to(InvokerUtils_1.InvokerUtils);
@@ -173,4 +174,6 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
173
174
  bind("ICreditStatementPublisher").to(CreditStatementPublisher_1.default);
174
175
  bind("ICreditReconciliationPublisher").to(CreditReconciliationPublisher_1.default);
175
176
  bind("ICreditLienCollectionPublisher").to(CreditLienCollectionPublisher_1.default);
177
+ // Platform error events - SQS publisher
178
+ bind("IPlatformErrorEventsPublisher").to(PlatformErrorEventsPublisher_1.default);
176
179
  });
package/bin/index.d.ts CHANGED
@@ -63,3 +63,4 @@ export * from "./credit-engine";
63
63
  export * from "./credit-payment";
64
64
  export * from "./document-generator";
65
65
  export * from "./commission-business";
66
+ export * from "./platform-error-events";
package/bin/index.js CHANGED
@@ -79,3 +79,4 @@ __exportStar(require("./credit-engine"), exports);
79
79
  __exportStar(require("./credit-payment"), exports);
80
80
  __exportStar(require("./document-generator"), exports);
81
81
  __exportStar(require("./commission-business"), exports);
82
+ __exportStar(require("./platform-error-events"), exports);
@@ -0,0 +1,2 @@
1
+ export * from './queue/PlatformErrorEventsPublisher';
2
+ export * from './queue/interfaces/IPlatformErrorEventsPublisher';
@@ -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("./queue/PlatformErrorEventsPublisher"), exports);
18
+ __exportStar(require("./queue/interfaces/IPlatformErrorEventsPublisher"), exports);
@@ -0,0 +1,6 @@
1
+ import { IPlatformErrorEventsPublisher } from "./interfaces/IPlatformErrorEventsPublisher";
2
+ import { PlatformErrorEventMessage } from "@fiado/type-kit/bin/platformErrorEvents";
3
+ export default class PlatformErrorEventsPublisher implements IPlatformErrorEventsPublisher {
4
+ private readonly PLATFORM_ERROR_EVENTS_QUEUE;
5
+ publish(message: PlatformErrorEventMessage): Promise<void>;
6
+ }
@@ -0,0 +1,33 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ const client_sqs_1 = require("@aws-sdk/client-sqs");
10
+ const inversify_1 = require("inversify");
11
+ let PlatformErrorEventsPublisher = class PlatformErrorEventsPublisher {
12
+ constructor() {
13
+ this.PLATFORM_ERROR_EVENTS_QUEUE = process.env.PLATFORM_ERROR_EVENTS_QUEUE;
14
+ }
15
+ async publish(message) {
16
+ try {
17
+ const client = new client_sqs_1.SQSClient();
18
+ const sendMessageRequest = {
19
+ QueueUrl: this.PLATFORM_ERROR_EVENTS_QUEUE,
20
+ MessageBody: JSON.stringify(message)
21
+ };
22
+ const command = new client_sqs_1.SendMessageCommand(sendMessageRequest);
23
+ await client.send(command);
24
+ }
25
+ catch (error) {
26
+ throw new Error(`Error publishing message to PlatformErrorEventsQueue${': ' + error.message}`);
27
+ }
28
+ }
29
+ };
30
+ PlatformErrorEventsPublisher = __decorate([
31
+ (0, inversify_1.injectable)()
32
+ ], PlatformErrorEventsPublisher);
33
+ exports.default = PlatformErrorEventsPublisher;
@@ -0,0 +1,4 @@
1
+ import { PlatformErrorEventMessage } from "@fiado/type-kit/bin/platformErrorEvents";
2
+ export interface IPlatformErrorEventsPublisher {
3
+ publish(message: PlatformErrorEventMessage): Promise<void>;
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "3.0.6",
3
+ "version": "3.0.8",
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.12",
19
+ "@fiado/type-kit": "^3.0.15",
20
20
  "dotenv": "^16.4.7",
21
21
  "inversify": "^6.2.2",
22
22
  "reflect-metadata": "^0.2.2"
@@ -124,6 +124,9 @@ import CreditNotificationPublisher from "./credit-engine/queue/CreditNotificatio
124
124
  import CreditStatementPublisher from "./credit-engine/queue/CreditStatementPublisher";
125
125
  import CreditReconciliationPublisher from "./credit-engine/queue/CreditReconciliationPublisher";
126
126
  import CreditLienCollectionPublisher from "./credit-engine/queue/CreditLienCollectionPublisher";
127
+ // Platform error events - SQS publisher
128
+ import { IPlatformErrorEventsPublisher } from "./platform-error-events";
129
+ import PlatformErrorEventsPublisher from "./platform-error-events/queue/PlatformErrorEventsPublisher";
127
130
 
128
131
  export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
129
132
  // UTILS bindings
@@ -214,4 +217,7 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
214
217
  bind<ICreditStatementPublisher>("ICreditStatementPublisher").to(CreditStatementPublisher);
215
218
  bind<ICreditReconciliationPublisher>("ICreditReconciliationPublisher").to(CreditReconciliationPublisher);
216
219
  bind<ICreditLienCollectionPublisher>("ICreditLienCollectionPublisher").to(CreditLienCollectionPublisher);
220
+
221
+ // Platform error events - SQS publisher
222
+ bind<IPlatformErrorEventsPublisher>("IPlatformErrorEventsPublisher").to(PlatformErrorEventsPublisher);
217
223
  });
package/src/index.ts CHANGED
@@ -63,4 +63,5 @@ export * from "./credit-engine";
63
63
  export * from "./credit-payment";
64
64
  export * from "./document-generator";
65
65
  export * from "./commission-business";
66
+ export * from "./platform-error-events";
66
67
 
@@ -0,0 +1,2 @@
1
+ export * from './queue/PlatformErrorEventsPublisher';
2
+ export * from './queue/interfaces/IPlatformErrorEventsPublisher';
@@ -0,0 +1,23 @@
1
+ import { SendMessageCommand, SendMessageRequest, SQSClient } from "@aws-sdk/client-sqs";
2
+ import { IPlatformErrorEventsPublisher } from "./interfaces/IPlatformErrorEventsPublisher";
3
+ import { PlatformErrorEventMessage } from "@fiado/type-kit/bin/platformErrorEvents";
4
+ import { injectable } from "inversify";
5
+
6
+ @injectable()
7
+ export default class PlatformErrorEventsPublisher implements IPlatformErrorEventsPublisher {
8
+ private readonly PLATFORM_ERROR_EVENTS_QUEUE = process.env.PLATFORM_ERROR_EVENTS_QUEUE;
9
+
10
+ async publish(message: PlatformErrorEventMessage): Promise<void> {
11
+ try {
12
+ const client: SQSClient = new SQSClient();
13
+ const sendMessageRequest: SendMessageRequest = {
14
+ QueueUrl: this.PLATFORM_ERROR_EVENTS_QUEUE,
15
+ MessageBody: JSON.stringify(message)
16
+ };
17
+ const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
18
+ await client.send(command);
19
+ } catch (error) {
20
+ throw new Error(`Error publishing message to PlatformErrorEventsQueue${': ' + error.message}`);
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,5 @@
1
+ import { PlatformErrorEventMessage } from "@fiado/type-kit/bin/platformErrorEvents";
2
+
3
+ export interface IPlatformErrorEventsPublisher {
4
+ publish(message: PlatformErrorEventMessage): Promise<void>;
5
+ }
@@ -1,46 +0,0 @@
1
- import { ChangePasswordRequest, GetUserRequest, GetUserResponse, RefreshTokenRequest, RefreshTokenResponse, RespondToAuthChallengeRequest, SetPasswordRequest, SignInRequest, SignInResponse, SignUpConfirmRequest, SignUpRequest, SignUpResponse } from "@fiado/type-kit/bin/cognitoConnector";
2
- export interface ICognitoApi {
3
- /**
4
- * Healthcheck for the cognito-connector
5
- */
6
- healthcheck(): Promise<HealthcheckResponse>;
7
- /**
8
- * Create a new user in Cognito
9
- */
10
- signUp(request: SignUpRequest): Promise<SignUpResponse>;
11
- /**
12
- * Confirm sign-up for a user in Cognito
13
- */
14
- signUpConfirm(request: SignUpConfirmRequest): Promise<void>;
15
- /**
16
- * Sign in a user
17
- */
18
- signIn(request: SignInRequest): Promise<SignInResponse>;
19
- /**
20
- * Sign out a user
21
- */
22
- signOut(): Promise<void>;
23
- /**
24
- * Change a user's password
25
- */
26
- changePassword(request: ChangePasswordRequest): Promise<void>;
27
- /**
28
- * Retrieve user details
29
- */
30
- getUser(request: GetUserRequest): Promise<GetUserResponse>;
31
- /**
32
- * Refresh a user's tokens
33
- */
34
- refreshToken(request: RefreshTokenRequest): Promise<RefreshTokenResponse>;
35
- /**
36
- * Respond to an auth challenge
37
- */
38
- respondToAuthChallenge(request: RespondToAuthChallengeRequest): Promise<any>;
39
- /**
40
- * Reset a user's password
41
- */
42
- resetPassword(request: SetPasswordRequest): Promise<void>;
43
- }
44
- export interface HealthcheckResponse {
45
- status: string;
46
- }
File without changes
File without changes
@@ -1,3 +0,0 @@
1
- export interface IReportProcessorBusiness {
2
- processReports(key: string): Promise<void>;
3
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });