@hahnpro/flow-sdk 4.22.6 → 4.22.9
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.
|
@@ -10,6 +10,7 @@ import { RpcClient } from './RpcClient';
|
|
|
10
10
|
export declare class FlowApplication {
|
|
11
11
|
private modules;
|
|
12
12
|
private flow;
|
|
13
|
+
private readonly baseLogger?;
|
|
13
14
|
private amqpConnection?;
|
|
14
15
|
private skipApi;
|
|
15
16
|
api: API;
|
|
@@ -23,7 +24,7 @@ export declare class FlowApplication {
|
|
|
23
24
|
private properties;
|
|
24
25
|
private _rpcClient;
|
|
25
26
|
private initialized;
|
|
26
|
-
constructor(modules: ClassType<any>[], flow: Flow,
|
|
27
|
+
constructor(modules: ClassType<any>[], flow: Flow, baseLogger?: Logger, amqpConnection?: AmqpConnection, skipApi?: boolean, explicitInit?: boolean);
|
|
27
28
|
init(): Promise<void>;
|
|
28
29
|
private publishLifecycleEvent;
|
|
29
30
|
private setQueueMetrics;
|
package/dist/FlowApplication.js
CHANGED
|
@@ -19,9 +19,10 @@ const MAX_EVENT_SIZE_BYTES = +process.env.MAX_EVENT_SIZE_BYTES || 512 * 1024;
|
|
|
19
19
|
const WARN_EVENT_PROCESSING_SEC = +process.env.WARN_EVENT_PROCESSING_SEC || 60;
|
|
20
20
|
const WARN_EVENT_QUEUE_SIZE = +process.env.WARN_EVENT_QUEUE_SIZE || 100;
|
|
21
21
|
class FlowApplication {
|
|
22
|
-
constructor(modules, flow,
|
|
22
|
+
constructor(modules, flow, baseLogger, amqpConnection, skipApi = false, explicitInit = false) {
|
|
23
23
|
this.modules = modules;
|
|
24
24
|
this.flow = flow;
|
|
25
|
+
this.baseLogger = baseLogger;
|
|
25
26
|
this.amqpConnection = amqpConnection;
|
|
26
27
|
this.skipApi = skipApi;
|
|
27
28
|
this.declarations = {};
|
|
@@ -195,7 +196,7 @@ class FlowApplication {
|
|
|
195
196
|
this.logger.error(err);
|
|
196
197
|
}
|
|
197
198
|
};
|
|
198
|
-
this.logger = new FlowLogger_1.FlowLogger(Object.assign({ id: 'none', functionFqn: 'FlowApplication' }, flow === null || flow === void 0 ? void 0 : flow.context),
|
|
199
|
+
this.logger = new FlowLogger_1.FlowLogger(Object.assign({ id: 'none', functionFqn: 'FlowApplication' }, flow === null || flow === void 0 ? void 0 : flow.context), baseLogger || undefined, this.publishEvent);
|
|
199
200
|
process.once('uncaughtException', (err) => {
|
|
200
201
|
this.logger.error('Uncaught exception!');
|
|
201
202
|
this.logger.error(err);
|
|
@@ -209,7 +210,7 @@ class FlowApplication {
|
|
|
209
210
|
this.logger.log('Flow Deployment is terminating');
|
|
210
211
|
this.destroy(0);
|
|
211
212
|
});
|
|
212
|
-
if (
|
|
213
|
+
if (explicitInit !== true) {
|
|
213
214
|
this.init();
|
|
214
215
|
}
|
|
215
216
|
}
|
|
@@ -271,7 +272,7 @@ class FlowApplication {
|
|
|
271
272
|
for (const element of this.flow.elements) {
|
|
272
273
|
const { id, name, properties, module, functionFqn } = element;
|
|
273
274
|
try {
|
|
274
|
-
const context = Object.assign(Object.assign({}, this.context), { id, name, logger: this.
|
|
275
|
+
const context = Object.assign(Object.assign({}, this.context), { id, name, logger: this.baseLogger, app: this });
|
|
275
276
|
this.elements[id] = new this.declarations[`${module}.${functionFqn}`](context, properties);
|
|
276
277
|
}
|
|
277
278
|
catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hahnpro/flow-sdk",
|
|
3
|
-
"version": "4.22.
|
|
3
|
+
"version": "4.22.9",
|
|
4
4
|
"description": "SDK for building Flow Modules",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@hahnpro/hpc-api": "3.
|
|
27
|
+
"@hahnpro/hpc-api": "3.6.1",
|
|
28
28
|
"amqp-connection-manager": "^3.9.0",
|
|
29
29
|
"amqplib": "^0.10.2",
|
|
30
30
|
"class-transformer": "0.5.1",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"@nestjs/common": "^9.0.11",
|
|
43
43
|
"@types/amqp-connection-manager": "^2.0.12",
|
|
44
44
|
"@types/amqplib": "^0.8.2",
|
|
45
|
-
"@types/jest": "^
|
|
45
|
+
"@types/jest": "^29.0.0",
|
|
46
46
|
"@types/lodash": "^4.14.184",
|
|
47
47
|
"@types/node": "^16.11.56",
|
|
48
48
|
"class-validator-jsonschema": "^3.1.1",
|
|
49
|
-
"jest": "^
|
|
50
|
-
"typescript": "^4.
|
|
49
|
+
"jest": "^29.0.1",
|
|
50
|
+
"typescript": "^4.8.2"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": "^14.13.1 || >=16.0.0"
|