@hahnpro/flow-sdk 4.20.12 → 4.20.13

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.
@@ -32,7 +32,7 @@ export declare class FlowApplication {
32
32
  * Publish a flow event to the amqp flowlogs exchange.
33
33
  * If the event size exceeds the limit it will be truncated
34
34
  */
35
- publishEvent: (event: FlowEvent) => Promise<void>;
35
+ publishEvent: (event: FlowEvent) => void;
36
36
  rpcClient(): Promise<RpcClient>;
37
37
  /**
38
38
  * Calls onDestroy lifecycle method on all flow elements,
@@ -109,7 +109,12 @@ class FlowApplication {
109
109
  contentType: 'application/json',
110
110
  data: { deploymentId: this.context.deploymentId, status: 'updated' },
111
111
  };
112
- (_f = this.amqpConnection) === null || _f === void 0 ? void 0 : _f.publish('deployment', 'health', statusEvent).catch((err) => this.logger.error(err));
112
+ try {
113
+ (_f = this.amqpConnection) === null || _f === void 0 ? void 0 : _f.publish('deployment', 'health', statusEvent);
114
+ }
115
+ catch (err) {
116
+ this.logger.error(err);
117
+ }
113
118
  }
114
119
  catch (err) {
115
120
  this.logger.error(err);
@@ -120,7 +125,12 @@ class FlowApplication {
120
125
  contentType: 'application/json',
121
126
  data: { deploymentId: this.context.deploymentId, status: 'updating failed' },
122
127
  };
123
- (_g = this.amqpConnection) === null || _g === void 0 ? void 0 : _g.publish('deployment', 'health', statusEvent).catch((err) => this.logger.error(err));
128
+ try {
129
+ (_g = this.amqpConnection) === null || _g === void 0 ? void 0 : _g.publish('deployment', 'health', statusEvent);
130
+ }
131
+ catch (e) {
132
+ this.logger.error(e);
133
+ }
124
134
  }
125
135
  }
126
136
  else if (event.type === 'com.flowstudio.deployment.message') {
@@ -203,7 +213,7 @@ class FlowApplication {
203
213
  exchange: 'deployment',
204
214
  routingKey: this.context.deploymentId,
205
215
  queueOptions: { durable: false, exclusive: true },
206
- });
216
+ }, 'FlowApplication.onMessage');
207
217
  }
208
218
  catch (err) {
209
219
  logErrorAndExit(`Could not subscribe to deployment exchange: ${err}`);
@@ -16,7 +16,7 @@ export declare class FlowLogger implements Logger {
16
16
  private readonly logger;
17
17
  private readonly publishEvent?;
18
18
  private static getStackTrace;
19
- constructor(metadata: FlowElementContext, logger?: Logger, publishEvent?: (event: FlowEvent) => Promise<void>);
19
+ constructor(metadata: FlowElementContext, logger?: Logger, publishEvent?: (event: FlowEvent) => void);
20
20
  debug: (message: any, options?: LoggerOptions) => void;
21
21
  error: (message: any, options?: LoggerOptions) => void;
22
22
  log: (message: any, options?: LoggerOptions) => void;
@@ -35,10 +35,9 @@ class FlowLogger {
35
35
  return stack.splice(1).join('\n');
36
36
  }
37
37
  publish(message, level, options) {
38
- var _a;
39
38
  if (this.publishEvent) {
40
39
  const event = new FlowEvent_1.FlowEvent(this.metadata, message, `flow.log.${level}`);
41
- (_a = this.publishEvent(event)) === null || _a === void 0 ? void 0 : _a.catch((err) => this.logger.error(err, this.metadata));
40
+ this.publishEvent(event);
42
41
  }
43
42
  switch (level) {
44
43
  case 'debug':
package/dist/amqp.d.ts CHANGED
@@ -5,8 +5,8 @@ export interface AmqpConnection {
5
5
  connection: Connection;
6
6
  managedChannel: ChannelWrapper;
7
7
  managedConnection: AmqpConnectionManager;
8
- createSubscriber<T>(handler: (msg: T | undefined, rawMessage?: ConsumeMessage) => Promise<any | undefined>, msgOptions: MessageHandlerOptions): Promise<void>;
9
- publish(exchange: string, routingKey: string, message: any, options?: Options.Publish): Promise<void>;
8
+ createSubscriber<T>(handler: (msg: T | undefined, rawMessage?: ConsumeMessage) => Promise<any | undefined | void>, msgOptions: MessageHandlerOptions, originalHandlerName: string): Promise<void>;
9
+ publish(exchange: string, routingKey: string, message: any, options?: Options.Publish): void;
10
10
  }
11
11
  export declare class Nack {
12
12
  private readonly _requeue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hahnpro/flow-sdk",
3
- "version": "4.20.12",
3
+ "version": "4.20.13",
4
4
  "description": "SDK for building Flow Modules",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -39,14 +39,14 @@
39
39
  "uuid": "^8.3.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@golevelup/nestjs-rabbitmq": "^2.3.0",
43
- "@nestjs/common": "^8.4.5",
42
+ "@golevelup/nestjs-rabbitmq": "^2.4.0",
43
+ "@nestjs/common": "^8.4.6",
44
44
  "@types/amqp-connection-manager": "^2.0.12",
45
45
  "@types/amqplib": "^0.8.2",
46
46
  "@types/jest": "^27.5.1",
47
47
  "@types/lodash": "^4.14.182",
48
- "@types/node": "^16.11.36",
49
- "class-validator-jsonschema": "^3.1.0",
48
+ "@types/node": "^16.11.38",
49
+ "class-validator-jsonschema": "^3.1.1",
50
50
  "jest": "^28.1.0",
51
51
  "typescript": "^4.7.2"
52
52
  },