@5minds/node-red-contrib-processcube 1.5.8-subscription-logging-0c78a6-m41fdsmp → 1.5.8-subscription-logging-7c74e2-m42gyp9r

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.
@@ -27,11 +27,11 @@ module.exports = function (RED) {
27
27
 
28
28
  const engineEventEmitter = engine.eventEmitter;
29
29
 
30
- node.log(`got event emmiter: ${engineEventEmitter}`);
30
+ node.log(`got event emmiter: ${JSON.stringify(engineEventEmitter)}`);
31
31
 
32
32
  engineEventEmitter.on('engine-client-dispose', () => {
33
33
  node.log('rm subsctiption');
34
- engine.engineClient.externalTasks.removeSubscription(subscription, engine.identity);
34
+ // engine.engineClient.externalTasks.removeSubscription(subscription, engine.identity);
35
35
  node.log('done rm subscriptions');
36
36
  });
37
37
 
@@ -43,7 +43,7 @@ module.exports = function (RED) {
43
43
  const register = async () => {
44
44
  node.log('registering node');
45
45
  const client = engine.engineClient;
46
- node.log(`subscribing to client: ${engine.engineClient}`);
46
+ node.log(`subscribing to client: ${JSON.stringify(engine.engineClient)}`);
47
47
 
48
48
  if (!client) {
49
49
  node.error('No engine configured.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "1.5.8-subscription-logging-0c78a6-m41fdsmp",
3
+ "version": "1.5.8-subscription-logging-7c74e2-m42gyp9r",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "scripts": {
@@ -43,14 +43,22 @@ module.exports = function (RED) {
43
43
  node.log('starting refresh cycle');
44
44
  function refreshUrl() {
45
45
  const newUrl = RED.util.evaluateNodeProperty(n.url, n.urlType, node);
46
+ const newClientId = RED.util.evaluateNodeProperty(n.clientId, n.clientIdType, node);
47
+ const newClientSecret = RED.util.evaluateNodeProperty(n.clientSecret, n.clientSecretType, node);
46
48
 
47
- if (node.url === newUrl) {
49
+ if (
50
+ node.url === newUrl &&
51
+ node.credentials.clientId === newClientId &&
52
+ node.credentials.clientSecret === newClientSecret
53
+ ) {
48
54
  node.log('no new url found');
49
55
  return;
50
56
  }
51
57
 
52
58
  node.log(`new url found: ${newUrl}`);
53
59
  node.url = newUrl;
60
+ node.credentials.clientId = newClientId;
61
+ node.credentials.clientSecret = newClientSecret;
54
62
  if (node.credentials.clientId && node.credentials.clientSecret) {
55
63
  if (node.engineClient) {
56
64
  node.log('disposing old engine client');
@@ -64,7 +72,7 @@ module.exports = function (RED) {
64
72
  getFreshIdentity(node.url, node)
65
73
  );
66
74
 
67
- node.log(`new engine client: ${node.engineClient}`);
75
+ node.log(`new engine client: ${JSON.stringify(node.engineClient)}`);
68
76
 
69
77
  node.eventEmitter.emit('engine-client-changed');
70
78
  } else {
@@ -77,7 +85,7 @@ module.exports = function (RED) {
77
85
  node.log('creating new engine client (without credentials)');
78
86
  node.engineClient = new engine_client.EngineClient(node.url);
79
87
 
80
- node.log(`new engine client (without credentials): ${node.engineClient}`);
88
+ node.log(`new engine client (without credentials): ${JSON.stringify(node.engineClient)}`);
81
89
 
82
90
  node.eventEmitter.emit('engine-client-changed');
83
91
  }