@siglesiasg/node-red-event-manager
Advanced tools
Comparing version 0.0.4 to 0.0.5
import { NodeDef } from 'node-red'; | ||
export interface EventManagerCheckpointDef extends NodeDef { | ||
name: string; | ||
debugStatus: boolean; | ||
} | ||
//# sourceMappingURL=event-manager-checkpoint.def.d.ts.map |
@@ -17,4 +17,6 @@ "use strict"; | ||
eventsQueue.checkEvent(); | ||
const nodeAny = RED.nodes.getNode(_dispatchNodeId); | ||
nodeAny.status({ fill: eventsQueue.isPrintStatusWarning(), shape: 'dot', text: `${eventsQueue.printStatus()}` }); | ||
if (config.debugStatus) { | ||
const nodeAny = RED.nodes.getNode(_dispatchNodeId); | ||
nodeAny.status({ fill: eventsQueue.isPrintStatusWarning(), shape: 'dot', text: `${eventsQueue.printStatus()}` }); | ||
} | ||
this.status({ fill: 'green', shape: 'dot', text: 'Checked' }); | ||
@@ -21,0 +23,0 @@ done(); |
@@ -5,3 +5,4 @@ import { NodeDef } from 'node-red'; | ||
maxConcurrency: number; | ||
debugStatus: boolean; | ||
} | ||
//# sourceMappingURL=event-manager-dispatcher.def.d.ts.map |
@@ -14,3 +14,5 @@ "use strict"; | ||
eventsQueue.setConsumeEvents((msg) => { | ||
this.status({ fill: eventsQueue.isPrintStatusWarning(), shape: 'dot', text: `${eventsQueue.printStatus()}` }); | ||
if (config.debugStatus) { | ||
this.status({ fill: eventsQueue.isPrintStatusWarning(), shape: 'dot', text: `${eventsQueue.printStatus()}` }); | ||
} | ||
const dispatcherNodeId = `${this.id}`; | ||
@@ -27,3 +29,5 @@ RED.util.setMessageProperty(msg, '_dispatchNodeId', dispatcherNodeId, true); | ||
eventsQueue.enqueue(msg); | ||
this.status({ fill: eventsQueue.isPrintStatusWarning(), shape: 'dot', text: `${eventsQueue.printStatus()}` }); | ||
if (config.debugStatus) { | ||
this.status({ fill: eventsQueue.isPrintStatusWarning(), shape: 'dot', text: `${eventsQueue.printStatus()}` }); | ||
} | ||
done(); | ||
@@ -38,2 +42,3 @@ } | ||
this.debug('Event Manager Dispatcher Closed'); | ||
eventsQueue.stopConsumingEvents(); | ||
(0, node_red_utils_1.deleteSharedData)(this, 'eventsQueue'); | ||
@@ -48,3 +53,5 @@ done(); | ||
} | ||
node.status({ fill: eventsQueue.isPrintStatusWarning(), shape: 'dot', text: `${eventsQueue.printStatus()}` }); | ||
if (config.debugStatus) { | ||
node.status({ fill: eventsQueue.isPrintStatusWarning(), shape: 'dot', text: `${eventsQueue.printStatus()}` }); | ||
} | ||
return true; | ||
@@ -51,0 +58,0 @@ } |
{ | ||
"name": "@siglesiasg/node-red-event-manager", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Event Manager for Node Red", | ||
@@ -35,23 +35,21 @@ "author": { | ||
}, | ||
"dependencies": { | ||
}, | ||
"devDependencies": { | ||
"@node-red-contrib-themes/theme-collection": "^3.1.6", | ||
"@siglesiasg/node-red-event-manager": "file:./", | ||
"@types/node": "^18.12.0", | ||
"@node-red-contrib-themes/theme-collection": "^3.1.11", | ||
"@types/node": "^18.19.24", | ||
"@types/node-red": "^1.3.4", | ||
"@typescript-eslint/eslint-plugin": "^6.13.2", | ||
"@typescript-eslint/parser": "^6.13.2", | ||
"@typescript-eslint/eslint-plugin": "^7.2.0", | ||
"@typescript-eslint/parser": "^7.2.0", | ||
"cpy-cli": "^5.0.0", | ||
"eslint": "^8.55.0", | ||
"eslint-config-prettier": "^8.10.0", | ||
"eslint": "^8.57.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"mkdirp": "^3.0.1", | ||
"node-red": "^3.1.2", | ||
"node-red": "^3.1.7", | ||
"node-red-contrib-loop-processing": "^0.5.1", | ||
"node-red-node-random": "^0.4.1", | ||
"prettier": "^3.1.0", | ||
"prettier": "^3.2.5", | ||
"rimraf": "^5.0.5", | ||
"ts-node": "^10.9.1", | ||
"ts-node": "^10.9.2", | ||
"tsc-watch": "^6.0.4", | ||
"typescript": "^5.3.3", | ||
"node-red-contrib-loop-processing": "^0.5.1" | ||
"typescript": "^5.3.3" | ||
}, | ||
@@ -58,0 +56,0 @@ "node-red": { |
@@ -5,2 +5,3 @@ import { NodeDef } from 'node-red'; | ||
name: string; | ||
debugStatus: boolean; | ||
} |
@@ -23,3 +23,5 @@ import { Node, NodeAPI, NodeMessageInFlow } from 'node-red'; | ||
const _dispatchNodeId: string = (msg as any)._dispatchNodeId; | ||
if (!_dispatchNodeId) { throw new Error('Unable to get _dispatchNodeId attribute from message'); } | ||
if (!_dispatchNodeId) { | ||
throw new Error('Unable to get _dispatchNodeId attribute from message'); | ||
} | ||
const eventsQueue: EventsQueue<NodeMessageInFlow> = getSharedData(RED, _dispatchNodeId, 'eventsQueue'); | ||
@@ -30,4 +32,6 @@ | ||
// Update origin node message | ||
const nodeAny = RED.nodes.getNode(_dispatchNodeId) as any; | ||
nodeAny.status({ fill: eventsQueue.isPrintStatusWarning(), shape: 'dot', text: `${eventsQueue.printStatus()}` }); | ||
if (config.debugStatus) { | ||
const nodeAny = RED.nodes.getNode(_dispatchNodeId) as any; | ||
nodeAny.status({ fill: eventsQueue.isPrintStatusWarning(), shape: 'dot', text: `${eventsQueue.printStatus()}` }); | ||
} | ||
@@ -34,0 +38,0 @@ // Update node as checked |
@@ -6,2 +6,3 @@ import { NodeDef } from 'node-red'; | ||
maxConcurrency: number; | ||
debugStatus: boolean; | ||
} |
@@ -28,3 +28,5 @@ import { Node, NodeAPI, NodeMessageInFlow } from 'node-red'; | ||
// Update node status | ||
this.status({ fill: eventsQueue.isPrintStatusWarning(), shape: 'dot', text: `${eventsQueue.printStatus()}` }); | ||
if (config.debugStatus) { | ||
this.status({ fill: eventsQueue.isPrintStatusWarning(), shape: 'dot', text: `${eventsQueue.printStatus()}` }); | ||
} | ||
@@ -52,4 +54,5 @@ // Add to msg current node id to perform checkpoint | ||
// Update node status | ||
this.status({ fill: eventsQueue.isPrintStatusWarning(), shape: 'dot', text: `${eventsQueue.printStatus()}` }); | ||
if (config.debugStatus) { | ||
this.status({ fill: eventsQueue.isPrintStatusWarning(), shape: 'dot', text: `${eventsQueue.printStatus()}` }); | ||
} | ||
done(); | ||
@@ -67,2 +70,3 @@ | ||
this.debug('Event Manager Dispatcher Closed'); | ||
eventsQueue.stopConsumingEvents(); | ||
deleteSharedData(this, 'eventsQueue'); | ||
@@ -81,3 +85,5 @@ done(); | ||
node.status({ fill: eventsQueue.isPrintStatusWarning(), shape: 'dot', text: `${eventsQueue.printStatus()}` }); | ||
if (config.debugStatus) { | ||
node.status({ fill: eventsQueue.isPrintStatusWarning(), shape: 'dot', text: `${eventsQueue.printStatus()}` }); | ||
} | ||
@@ -84,0 +90,0 @@ return true; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
311268
1370