@5minds/node-red-contrib-processcube 1.5.10-feature-1d5283-m4mr0aqw → 1.5.10-feature-495a3f-m4mrvan4
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/externaltask-input.js
CHANGED
|
@@ -126,11 +126,6 @@ module.exports = function (RED) {
|
|
|
126
126
|
|
|
127
127
|
node.etw = externalTaskWorker;
|
|
128
128
|
|
|
129
|
-
externalTaskWorker.identity = node.engine.identity;
|
|
130
|
-
node.engine.registerOnIdentityChanged((identity) => {
|
|
131
|
-
externalTaskWorker.identity = identity;
|
|
132
|
-
});
|
|
133
|
-
|
|
134
129
|
// export type WorkerErrorHandler = (errorType: 'fetchAndLock' | 'extendLock' | 'processExternalTask' | 'finishExternalTask', error: Error, externalTask?: ExternalTask<any>) => void;
|
|
135
130
|
externalTaskWorker.onWorkerError((errorType, error, externalTask) => {
|
|
136
131
|
switch (errorType) {
|
package/package.json
CHANGED
|
@@ -6,35 +6,11 @@ module.exports = function (RED) {
|
|
|
6
6
|
function ProcessCubeEngineNode(n) {
|
|
7
7
|
RED.nodes.createNode(this, n);
|
|
8
8
|
const node = this;
|
|
9
|
-
const identityChangedCallbacks = [];
|
|
10
|
-
node.identity = null;
|
|
11
9
|
|
|
12
10
|
node.url = RED.util.evaluateNodeProperty(n.url, n.urlType, node);
|
|
13
|
-
|
|
14
11
|
node.credentials.clientId = RED.util.evaluateNodeProperty(n.clientId, n.clientIdType, node);
|
|
15
12
|
node.credentials.clientSecret = RED.util.evaluateNodeProperty(n.clientSecret, n.clientSecretType, node);
|
|
16
13
|
|
|
17
|
-
node.registerOnIdentityChanged = function (callback) {
|
|
18
|
-
identityChangedCallbacks.push(callback);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
node.isIdentityReady = function () {
|
|
22
|
-
if (node.credentials.clientId && node.credentials.clientSecret) {
|
|
23
|
-
return node.identity != null;
|
|
24
|
-
} else {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
node.setIdentity = (identity) => {
|
|
30
|
-
node.log(`setIdentity: ${JSON.stringify(identity)}`);
|
|
31
|
-
node.identity = identity;
|
|
32
|
-
|
|
33
|
-
for (const callback of identityChangedCallbacks) {
|
|
34
|
-
callback(identity);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
14
|
if (node.credentials.clientId && node.credentials.clientSecret) {
|
|
39
15
|
node.engineClient = new engine_client.EngineClient(node.url, {
|
|
40
16
|
clientId: node.credentials.clientId,
|