@fiado/api-invoker 3.4.3 → 3.4.4

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.
@@ -0,0 +1,2 @@
1
+ export * from './queue/ICardBusinessPublisher';
2
+ export * from './queue/CardBusinessPublisher';
@@ -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/ICardBusinessPublisher"), exports);
18
+ __exportStar(require("./queue/CardBusinessPublisher"), exports);
@@ -0,0 +1,5 @@
1
+ import { CardBusinessQueueMessage, ICardBusinessPublisher } from "./ICardBusinessPublisher";
2
+ export default class CardBusinessPublisher implements ICardBusinessPublisher {
3
+ private readonly SQS_CARD_BUSINESS_QUEUE;
4
+ publish(message: CardBusinessQueueMessage): Promise<void>;
5
+ }
@@ -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 CardBusinessPublisher = class CardBusinessPublisher {
12
+ constructor() {
13
+ this.SQS_CARD_BUSINESS_QUEUE = process.env.SQS_CARD_BUSINESS_QUEUE;
14
+ }
15
+ async publish(message) {
16
+ try {
17
+ const client = new client_sqs_1.SQSClient();
18
+ const sendMessageRequest = {
19
+ QueueUrl: this.SQS_CARD_BUSINESS_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 queue ${': ' + error.message}`);
27
+ }
28
+ }
29
+ };
30
+ CardBusinessPublisher = __decorate([
31
+ (0, inversify_1.injectable)()
32
+ ], CardBusinessPublisher);
33
+ exports.default = CardBusinessPublisher;
@@ -0,0 +1,7 @@
1
+ export interface CardBusinessQueueMessage {
2
+ productCatalogId: string;
3
+ externalCardId: string;
4
+ }
5
+ export interface ICardBusinessPublisher {
6
+ publish(message: CardBusinessQueueMessage): Promise<void>;
7
+ }
@@ -37,6 +37,7 @@ const group_1 = require("./group");
37
37
  const ActivityApi_1 = __importDefault(require("./activity-business/ActivityApi"));
38
38
  const TransactionProcessorApi_1 = __importDefault(require("./transactionProcessor/api/TransactionProcessorApi"));
39
39
  const ActivityPublisher_1 = __importDefault(require("./activity-business/queue/ActivityPublisher"));
40
+ const CardBusinessPublisher_1 = __importDefault(require("./card-business/queue/CardBusinessPublisher"));
40
41
  const RiskProfileApi_1 = __importDefault(require("./riskProfile/api/RiskProfileApi"));
41
42
  const riskProfile_1 = require("./riskProfile");
42
43
  const contactInformation_1 = require("./contactInformation");
@@ -135,6 +136,7 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
135
136
  bind("IActivityApi").to(ActivityApi_1.default);
136
137
  bind("ITransactionProcessorApi").to(TransactionProcessorApi_1.default);
137
138
  bind("IActivityPublisher").to(ActivityPublisher_1.default);
139
+ bind("ICardBusinessPublisher").to(CardBusinessPublisher_1.default);
138
140
  bind("IRiskProfileApi").to(RiskProfileApi_1.default);
139
141
  bind("ITransactionAlarmPublisher").to(riskProfile_1.TransactionAlarmPublisher);
140
142
  bind("IContactInformationApi").to(contactInformation_1.ContactInformationApi);
package/bin/index.d.ts CHANGED
@@ -27,6 +27,7 @@ export * from "./bbvaRst";
27
27
  export * from "./fraudPreventionEngine";
28
28
  export * from "./group";
29
29
  export * from "./activity-business";
30
+ export * from "./card-business";
30
31
  export * from "./transactionProcessor";
31
32
  export * from "./riskProfile";
32
33
  export * from "./fiadoMessages";
package/bin/index.js CHANGED
@@ -43,6 +43,7 @@ __exportStar(require("./bbvaRst"), exports);
43
43
  __exportStar(require("./fraudPreventionEngine"), exports);
44
44
  __exportStar(require("./group"), exports);
45
45
  __exportStar(require("./activity-business"), exports);
46
+ __exportStar(require("./card-business"), exports);
46
47
  __exportStar(require("./transactionProcessor"), exports);
47
48
  __exportStar(require("./riskProfile"), exports);
48
49
  __exportStar(require("./fiadoMessages"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "3.4.3",
3
+ "version": "3.4.4",
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.7.0",
19
+ "@fiado/type-kit": "^3.8.1",
20
20
  "dotenv": "^16.4.7",
21
21
  "i": "^0.3.7",
22
22
  "inversify": "^6.2.2",
@@ -0,0 +1,2 @@
1
+ export * from './queue/ICardBusinessPublisher';
2
+ export * from './queue/CardBusinessPublisher';
@@ -0,0 +1,22 @@
1
+ import { SendMessageCommand, SendMessageRequest, SQSClient } from "@aws-sdk/client-sqs";
2
+ import { injectable } from "inversify";
3
+ import { CardBusinessQueueMessage, ICardBusinessPublisher } from "./ICardBusinessPublisher";
4
+
5
+ @injectable()
6
+ export default class CardBusinessPublisher implements ICardBusinessPublisher {
7
+ private readonly SQS_CARD_BUSINESS_QUEUE = process.env.SQS_CARD_BUSINESS_QUEUE;
8
+
9
+ async publish(message: CardBusinessQueueMessage): Promise<void> {
10
+ try {
11
+ const client: SQSClient = new SQSClient();
12
+ const sendMessageRequest: SendMessageRequest = {
13
+ QueueUrl: this.SQS_CARD_BUSINESS_QUEUE,
14
+ MessageBody: JSON.stringify(message),
15
+ };
16
+ const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
17
+ await client.send(command);
18
+ } catch (error) {
19
+ throw new Error(`Error publishing message to queue ${': ' + error.message}`);
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,8 @@
1
+ export interface CardBusinessQueueMessage {
2
+ productCatalogId: string;
3
+ externalCardId: string;
4
+ }
5
+
6
+ export interface ICardBusinessPublisher {
7
+ publish(message: CardBusinessQueueMessage): Promise<void>;
8
+ }
@@ -47,6 +47,8 @@ import ActivityApi from "./activity-business/ActivityApi";
47
47
  import TransactionProcessorApi from "./transactionProcessor/api/TransactionProcessorApi";
48
48
  import { ITransactionProcessorApi } from "./transactionProcessor";
49
49
  import ActivityPublisher from "./activity-business/queue/ActivityPublisher";
50
+ import { ICardBusinessPublisher } from "./card-business";
51
+ import CardBusinessPublisher from "./card-business/queue/CardBusinessPublisher";
50
52
  import RiskProfileApi from "./riskProfile/api/RiskProfileApi";
51
53
  import {
52
54
  IRiskProfileApi,
@@ -182,6 +184,7 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
182
184
  bind<IActivityApi>("IActivityApi").to(ActivityApi);
183
185
  bind<ITransactionProcessorApi>("ITransactionProcessorApi").to(TransactionProcessorApi);
184
186
  bind<IActivityPublisher>("IActivityPublisher").to(ActivityPublisher);
187
+ bind<ICardBusinessPublisher>("ICardBusinessPublisher").to(CardBusinessPublisher);
185
188
  bind<IRiskProfileApi>("IRiskProfileApi").to(RiskProfileApi);
186
189
  bind<ITransactionAlarmPublisher>("ITransactionAlarmPublisher").to(TransactionAlarmPublisher);
187
190
  bind<IContactInformationApi>("IContactInformationApi").to(ContactInformationApi);
package/src/index.ts CHANGED
@@ -27,6 +27,7 @@ export * from "./bbvaRst";
27
27
  export * from "./fraudPreventionEngine";
28
28
  export * from "./group";
29
29
  export * from "./activity-business";
30
+ export * from "./card-business";
30
31
  export * from "./transactionProcessor";
31
32
  export * from "./riskProfile";
32
33
  export * from "./fiadoMessages";
@@ -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 });