@hahnpro/flow-sdk 4.20.11 → 4.20.14
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/dist/FlowApplication.d.ts +1 -1
- package/dist/FlowApplication.js +13 -3
- package/dist/FlowLogger.d.ts +1 -1
- package/dist/FlowLogger.js +1 -2
- package/dist/amqp.d.ts +2 -2
- package/package.json +10 -10
|
@@ -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) =>
|
|
35
|
+
publishEvent: (event: FlowEvent) => void;
|
|
36
36
|
rpcClient(): Promise<RpcClient>;
|
|
37
37
|
/**
|
|
38
38
|
* Calls onDestroy lifecycle method on all flow elements,
|
package/dist/FlowApplication.js
CHANGED
|
@@ -109,7 +109,12 @@ class FlowApplication {
|
|
|
109
109
|
contentType: 'application/json',
|
|
110
110
|
data: { deploymentId: this.context.deploymentId, status: 'updated' },
|
|
111
111
|
};
|
|
112
|
-
|
|
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
|
-
|
|
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}`);
|
package/dist/FlowLogger.d.ts
CHANGED
|
@@ -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) =>
|
|
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;
|
package/dist/FlowLogger.js
CHANGED
|
@@ -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
|
-
|
|
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):
|
|
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.
|
|
3
|
+
"version": "4.20.14",
|
|
4
4
|
"description": "SDK for building Flow Modules",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@hahnpro/hpc-api": "
|
|
27
|
+
"@hahnpro/hpc-api": "3.1.0",
|
|
28
28
|
"amqp-connection-manager": "^3.9.0",
|
|
29
|
-
"amqplib": "^0.
|
|
29
|
+
"amqplib": "^0.10.0",
|
|
30
30
|
"class-transformer": "0.5.1",
|
|
31
31
|
"class-validator": "~0.13.2",
|
|
32
32
|
"cloudevents": "^6.0.1",
|
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
"uuid": "^8.3.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@golevelup/nestjs-rabbitmq": "^2.
|
|
43
|
-
"@nestjs/common": "^8.4.
|
|
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
|
-
"@types/jest": "^
|
|
46
|
+
"@types/jest": "^28.1.1",
|
|
47
47
|
"@types/lodash": "^4.14.182",
|
|
48
|
-
"@types/node": "^16.11.
|
|
49
|
-
"class-validator-jsonschema": "^3.1.
|
|
50
|
-
"jest": "^
|
|
51
|
-
"typescript": "^4.
|
|
48
|
+
"@types/node": "^16.11.39",
|
|
49
|
+
"class-validator-jsonschema": "^3.1.1",
|
|
50
|
+
"jest": "^28.1.1",
|
|
51
|
+
"typescript": "^4.7.3"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": "^14.13.1 || >=16.0.0"
|