@fiado/api-invoker 3.0.10 → 3.0.12
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 +6 -0
- package/bin/index.d.ts +2 -0
- package/bin/index.js +2 -0
- package/bin/platform-error-events/index.d.ts +2 -0
- package/bin/platform-error-events/index.js +18 -0
- package/bin/platform-error-events/queue/PlatformErrorEventsPublisher.d.ts +6 -0
- package/bin/platform-error-events/queue/PlatformErrorEventsPublisher.js +33 -0
- package/bin/platform-error-events/queue/interfaces/IPlatformErrorEventsPublisher.d.ts +4 -0
- package/bin/platform-error-events/queue/interfaces/IPlatformErrorEventsPublisher.js +2 -0
- package/bin/teams-connector/index.d.ts +2 -0
- package/bin/teams-connector/index.js +18 -0
- package/bin/teams-connector/queue/TeamsNotificationPublisher.d.ts +6 -0
- package/bin/teams-connector/queue/TeamsNotificationPublisher.js +33 -0
- package/bin/teams-connector/queue/interfaces/ITeamsNotificationPublisher.d.ts +4 -0
- package/bin/teams-connector/queue/interfaces/ITeamsNotificationPublisher.js +2 -0
- package/package.json +2 -2
package/bin/container.config.js
CHANGED
|
@@ -87,6 +87,8 @@ 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"));
|
|
91
|
+
const TeamsNotificationPublisher_1 = __importDefault(require("./teams-connector/queue/TeamsNotificationPublisher"));
|
|
90
92
|
exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
91
93
|
// UTILS bindings
|
|
92
94
|
bind("InvokerUtils").to(InvokerUtils_1.InvokerUtils);
|
|
@@ -173,4 +175,8 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
|
173
175
|
bind("ICreditStatementPublisher").to(CreditStatementPublisher_1.default);
|
|
174
176
|
bind("ICreditReconciliationPublisher").to(CreditReconciliationPublisher_1.default);
|
|
175
177
|
bind("ICreditLienCollectionPublisher").to(CreditLienCollectionPublisher_1.default);
|
|
178
|
+
// Platform error events - SQS publisher
|
|
179
|
+
bind("IPlatformErrorEventsPublisher").to(PlatformErrorEventsPublisher_1.default);
|
|
180
|
+
// Teams connector - SQS publisher
|
|
181
|
+
bind("ITeamsNotificationPublisher").to(TeamsNotificationPublisher_1.default);
|
|
176
182
|
});
|
package/bin/index.d.ts
CHANGED
package/bin/index.js
CHANGED
|
@@ -79,3 +79,5 @@ __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);
|
|
83
|
+
__exportStar(require("./teams-connector"), exports);
|
|
@@ -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,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/TeamsNotificationPublisher"), exports);
|
|
18
|
+
__exportStar(require("./queue/interfaces/ITeamsNotificationPublisher"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ITeamsNotificationPublisher } from "./interfaces/ITeamsNotificationPublisher";
|
|
2
|
+
import { TeamsNotificationRequest } from "@fiado/type-kit/bin/teamsConnector";
|
|
3
|
+
export default class TeamsNotificationPublisher implements ITeamsNotificationPublisher {
|
|
4
|
+
private readonly TEAMS_NOTIFICATION_QUEUE;
|
|
5
|
+
publish(message: TeamsNotificationRequest): 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 TeamsNotificationPublisher = class TeamsNotificationPublisher {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.TEAMS_NOTIFICATION_QUEUE = process.env.TEAMS_NOTIFICATION_QUEUE;
|
|
14
|
+
}
|
|
15
|
+
async publish(message) {
|
|
16
|
+
try {
|
|
17
|
+
const client = new client_sqs_1.SQSClient();
|
|
18
|
+
const sendMessageRequest = {
|
|
19
|
+
QueueUrl: this.TEAMS_NOTIFICATION_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 TeamsNotificationQueue${': ' + error.message}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
TeamsNotificationPublisher = __decorate([
|
|
31
|
+
(0, inversify_1.injectable)()
|
|
32
|
+
], TeamsNotificationPublisher);
|
|
33
|
+
exports.default = TeamsNotificationPublisher;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.12",
|
|
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.
|
|
19
|
+
"@fiado/type-kit": "^3.0.17",
|
|
20
20
|
"dotenv": "^16.4.7",
|
|
21
21
|
"inversify": "^6.2.2",
|
|
22
22
|
"reflect-metadata": "^0.2.2"
|