I want to take some after-deployment action. So the deploy event described here RED.events : Node-RED is the one I want to use.
But somehow the event is not fired / I am not able to catch it.
I use Node Red 2.2.2 inside a NodeJS App.
If I use
RED.events.on('deploy', (params: RuntimeDeployEvent) =>
this.logger.warn('deploy', params),
);
the logger will never be called. Although the flows-event are not triggered / caught.
on the other hand
RED.events.on('runtime-event', (params: RuntimeDeployEvent) =>
this.logger.warn('runtime-event',params),
);
works well.
Any idea why the deploy event is not working as documented?
One thing that I would find really useful if you are looking in that area would be to have a before/after or diff of the config parameter.
In other words, some way for the function in the registerType function to be able to know what has changed pre- to post-deployment.
If there were a way to differentiate between node-red startup, initial deployment of a node and a redeployment of a node, that would also be very helpful.