ldn-inbox-server 1.6.1 → 1.6.3
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/config/inbox_config.json
CHANGED
|
@@ -42,7 +42,10 @@
|
|
|
42
42
|
[
|
|
43
43
|
{
|
|
44
44
|
"id": "@handler/notification_handler/on_error.js",
|
|
45
|
-
"handler":
|
|
45
|
+
"handler": {
|
|
46
|
+
"id" : "@handler/notification_handler/nothing.js",
|
|
47
|
+
"demo": 123
|
|
48
|
+
}
|
|
46
49
|
},
|
|
47
50
|
{
|
|
48
51
|
"id": "@handler/notification_handler/jsonpath_filter.js",
|
|
@@ -67,21 +67,24 @@ async function handle({path,options}) {
|
|
|
67
67
|
thisWorkflow = false;
|
|
68
68
|
|
|
69
69
|
if (options['fallback']) {
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
const fallback_id = options['fallback']['id'];
|
|
71
|
+
config = options['fallback'];
|
|
72
|
+
|
|
73
|
+
logger.debug(`loading fallback ${fallback_id}`);
|
|
74
|
+
const fallback = dynamic_handler(fallback_id,null);
|
|
72
75
|
|
|
73
76
|
if (!fallback) {
|
|
74
|
-
throw new Error(`failed to load ${
|
|
77
|
+
throw new Error(`failed to load ${fallback_id}`);
|
|
75
78
|
}
|
|
76
79
|
|
|
77
|
-
logger.info(`workflow[${i}] : starting ${
|
|
80
|
+
logger.info(`workflow[${i}] : starting ${fallback_id}`);
|
|
78
81
|
const fallback_result = await fallback({path,options,config,notification});
|
|
79
82
|
|
|
80
83
|
if (fallback_result['success']) {
|
|
81
|
-
logger.info(`workflow[${i}] : finished ${
|
|
84
|
+
logger.info(`workflow[${i}] : finished ${fallback_id}`);
|
|
82
85
|
}
|
|
83
86
|
else {
|
|
84
|
-
logger.error(`workflow[${i}] : failed ${
|
|
87
|
+
logger.error(`workflow[${i}] : failed ${fallback_id}`);
|
|
85
88
|
}
|
|
86
89
|
}
|
|
87
90
|
else {
|
|
@@ -3,7 +3,7 @@ const logger = require('../../lib/util.js').getLogger();
|
|
|
3
3
|
/**
|
|
4
4
|
* Handler that does nothing (debug purposes)
|
|
5
5
|
*/
|
|
6
|
-
async function handle({path,options,config}) {
|
|
6
|
+
async function handle({path,options,config,notification}) {
|
|
7
7
|
try {
|
|
8
8
|
return { path, options, success: true };
|
|
9
9
|
}
|
|
@@ -12,9 +12,9 @@ async function handle({path,options,config}) {
|
|
|
12
12
|
return { path, options, success: true };
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
logger.info(`setting fallback to ${fallback}`);
|
|
15
|
+
logger.info(`setting fallback to ${fallback.id}`);
|
|
16
16
|
|
|
17
|
-
options['fallback'] = fallback;
|
|
17
|
+
options['fallback'] = structuredClone(fallback);
|
|
18
18
|
|
|
19
19
|
return { path, options, success: true };
|
|
20
20
|
}
|