@hahnpro/flow-sdk 4.22.8 → 4.22.10

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, logger?: Logger, amqpConnection?: AmqpConnection, skipApi?: boolean, explicitInit?: boolean);
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;
@@ -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, logger, amqpConnection, skipApi = false, explicitInit = false) {
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), logger || undefined, this.publishEvent);
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 (!explicitInit) {
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.logger, app: 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.8",
3
+ "version": "4.22.10",
4
4
  "description": "SDK for building Flow Modules",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -24,30 +24,30 @@
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
- "@hahnpro/hpc-api": "3.6.1",
27
+ "@hahnpro/hpc-api": "3.6.2",
28
28
  "amqp-connection-manager": "^3.9.0",
29
- "amqplib": "^0.10.2",
29
+ "amqplib": "^0.10.3",
30
30
  "class-transformer": "0.5.1",
31
31
  "class-validator": "~0.13.2",
32
- "cloudevents": "^6.0.2",
32
+ "cloudevents": "^6.0.3",
33
33
  "lodash": "^4.17.21",
34
34
  "object-sizeof": "^1.6.3",
35
35
  "python-shell": "^3.0.1",
36
36
  "reflect-metadata": "^0.1.13",
37
- "rxjs": "^7.5.6",
37
+ "rxjs": "^7.5.7",
38
38
  "string-interp": "^0.3.6"
39
39
  },
40
40
  "devDependencies": {
41
- "@golevelup/nestjs-rabbitmq": "^3.2.0",
42
- "@nestjs/common": "^9.0.11",
41
+ "@golevelup/nestjs-rabbitmq": "^3.4.0",
42
+ "@nestjs/common": "^9.2.0",
43
43
  "@types/amqp-connection-manager": "^2.0.12",
44
44
  "@types/amqplib": "^0.8.2",
45
- "@types/jest": "^29.0.0",
46
- "@types/lodash": "^4.14.184",
47
- "@types/node": "^16.11.56",
45
+ "@types/jest": "^29.2.2",
46
+ "@types/lodash": "^4.14.188",
47
+ "@types/node": "^18.11.9",
48
48
  "class-validator-jsonschema": "^3.1.1",
49
- "jest": "^29.0.1",
50
- "typescript": "^4.8.2"
49
+ "jest": "^29.3.1",
50
+ "typescript": "^4.8.4"
51
51
  },
52
52
  "engines": {
53
53
  "node": "^14.13.1 || >=16.0.0"