@5minds/node-red-contrib-processcube 1.1.4-feature-e7d879-m0jyro4t → 1.1.4-feature-f2fee5-m0kpqgkx
Sign up to get free protection for your applications and to get access to all the features.
- package/externaltask-event-listener.js +15 -11
- package/package.json +1 -1
- package/usertask-event-listener.js +19 -12
@@ -31,17 +31,21 @@ module.exports = function (RED) {
|
|
31
31
|
}
|
32
32
|
|
33
33
|
async function subscribe() {
|
34
|
-
|
35
|
-
created:
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
34
|
+
switch (config.eventtype) {
|
35
|
+
case 'created':
|
36
|
+
return await client.notification.onExternalTaskCreated(externalTaskCallback(), {
|
37
|
+
identity: currentIdentity,
|
38
|
+
});
|
39
|
+
case 'locked':
|
40
|
+
return await client.notification.onExternalTaskLocked(externalTaskCallback(), {
|
41
|
+
identity: currentIdentity,
|
42
|
+
});
|
43
|
+
case 'unlocked':
|
44
|
+
return await client.notification.onExternalTaskUnlocked(externalTaskCallback(), {
|
45
|
+
identity: currentIdentity,
|
46
|
+
});
|
47
|
+
default:
|
48
|
+
console.error('no such event: ' + config.eventtype);
|
45
49
|
}
|
46
50
|
}
|
47
51
|
|
package/package.json
CHANGED
@@ -46,18 +46,25 @@ module.exports = function (RED) {
|
|
46
46
|
}
|
47
47
|
|
48
48
|
async function subscribe() {
|
49
|
-
|
50
|
-
new:
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
49
|
+
switch (config.eventtype) {
|
50
|
+
case 'new':
|
51
|
+
return await client.userTasks.onUserTaskWaiting(userTaskCallback(), {
|
52
|
+
identity: currentIdentity,
|
53
|
+
});
|
54
|
+
case 'finished':
|
55
|
+
return await client.userTasks.onUserTaskFinished(userTaskCallback(), {
|
56
|
+
identity: currentIdentity,
|
57
|
+
});
|
58
|
+
case 'reserved':
|
59
|
+
return await client.userTasks.onUserTaskReserved(userTaskCallback(), {
|
60
|
+
identity: currentIdentity,
|
61
|
+
});
|
62
|
+
case 'reservation-canceled':
|
63
|
+
return await client.userTasks.onUserTaskReservationCanceled(userTaskCallback(), {
|
64
|
+
identity: currentIdentity,
|
65
|
+
});
|
66
|
+
default:
|
67
|
+
console.error('no such event: ' + config.eventtype);
|
61
68
|
}
|
62
69
|
}
|
63
70
|
|