@gregoriusrippenstein/erlang-red-unittest 0.21.4 → 0.21.7
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/examples/http/dynamic redirect.json +1 -1
- package/examples/http/have params in the path.json +1 -1
- package/examples/join/manual config with count & nested property name.json +1 -1
- package/examples/status/basic working version.json +1 -1
- package/examples/switch/post debug on JSONata exception.json +1 -1
- package/examples/template/support mustache template (ered).json +1 -0
- package/examples/template/support mustache template.json +1 -1
- package/nodes/locales/en-US/ut-config.html +25 -0
- package/nodes/locales/en-US/ut-config.json +14 -0
- package/nodes/ut-config.html +70 -0
- package/nodes/ut-config.js +74 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"eed68dbcecd1431f","type":"tab","label":"[http] dynamic redirect","disabled":false,"info":"## HTTP redirect\n\nDynamic redirect overwriting the header settings of the node.\n\nTesting the dynamic setting of the Location header.","env":[{"name":"ERED_NOT_EUNIT","
|
|
1
|
+
[{"id":"eed68dbcecd1431f","type":"tab","label":"[http] dynamic redirect","disabled":false,"info":"## HTTP redirect\n\nDynamic redirect overwriting the header settings of the node.\n\nTesting the dynamic setting of the Location header.","env":[{"name":"ERED_NOT_EUNIT","type":"bool","value":"true"},{"name":"ERED_TIMEOUT","type":"num","value":"5"}]},{"id":"5b426d51dcf3c2f8","type":"http response","z":"eed68dbcecd1431f","name":"redirect to https","statusCode":"301","headers":{},"x":834.857177734375,"y":461.14288330078125,"wires":[]},{"id":"c6d401a2115666f6","type":"change","z":"eed68dbcecd1431f","name":"","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"301","tot":"num"},{"t":"set","p":"hostname","pt":"msg","to":"utcfg.host","tot":"msg"},{"t":"set","p":"_loc","pt":"msg","to":"$$.hostname & \"/teed68dbcecd1431f/redirected\"","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"\"<a href='\" & $$._loc & \"'>Redirect</a>\\n\"","tot":"jsonata"},{"t":"set","p":"headers","pt":"msg","to":"{ \"Location\": $$._loc }","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":699.4285888671875,"y":372.28570556640625,"wires":[["5b426d51dcf3c2f8"]]},{"id":"2f671b7422d502d9","type":"http in","z":"eed68dbcecd1431f","name":"","url":"/teed68dbcecd1431f/example12/fubar","method":"get","upload":false,"skipBodyParsing":false,"swaggerDoc":"","x":438.857177734375,"y":237.64286041259766,"wires":[["56d2224b5822edc1"]]},{"id":"e3748318a95178e9","type":"inject","z":"eed68dbcecd1431f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":250.0000228881836,"y":546.8214645385742,"wires":[["dda324dd7f114c3d"]]},{"id":"455ca5e77834096a","type":"http request","z":"eed68dbcecd1431f","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"${host}/teed68dbcecd1431f/example12/fubar","tls":"83cd62fbf15a01f3","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":711.5237757364908,"y":546.8214645385742,"wires":[["ee737a9e34a1d3a2"]]},{"id":"dda324dd7f114c3d","type":"delay","z":"eed68dbcecd1431f","name":"","pauseType":"delay","timeout":"250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":475.7618993123372,"y":546.8214645385742,"wires":[["455ca5e77834096a"]]},{"id":"624fa5de5352cb90","type":"ut-assert-values","z":"eed68dbcecd1431f","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"statusCode","pt":"msg","to":"200","tot":"num"},{"t":"eql","p":"responseUrl","pt":"msg","to":"$$.hostname & \"/teed68dbcecd1431f/redirected\"","tot":"jsonata"}],"x":1447.2856521606445,"y":606.8214645385742,"wires":[[]]},{"id":"f6b14e1666d62ba8","type":"change","z":"eed68dbcecd1431f","name":"","rules":[{"t":"set","p":"hostname","pt":"msg","to":"utcfg.host","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1206,"y":607,"wires":[["624fa5de5352cb90"]]},{"id":"0ec557f03f0cecef","type":"http in","z":"eed68dbcecd1431f","name":"","url":"/teed68dbcecd1431f/redirected","method":"get","upload":false,"skipBodyParsing":false,"swaggerDoc":"","x":954.9999694824219,"y":237.64286041259766,"wires":[["30746844a862b851"]]},{"id":"30746844a862b851","type":"http response","z":"eed68dbcecd1431f","name":"","statusCode":"","headers":{},"x":1224,"y":331,"wires":[]},{"id":"56d2224b5822edc1","type":"ut-config","z":"eed68dbcecd1431f","name":"","x":603,"y":303,"wires":[["c6d401a2115666f6"]]},{"id":"ee737a9e34a1d3a2","type":"ut-config","z":"eed68dbcecd1431f","name":"","x":970,"y":580,"wires":[["f6b14e1666d62ba8"]]},{"id":"83cd62fbf15a01f3","type":"tls-config","name":"","cert":"","key":"","p12":"","p12name":"","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":false,"alpnprotocol":"","certEnv":"","keyEnv":"","caEnv":""}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"64445798b59d2630","type":"tab","label":"[http] have params in the path","disabled":false,"info":"Http in nodes should be able to define paths that contain placeholder for parameters.","env":[{"name":"ERED_NOT_EUNIT","
|
|
1
|
+
[{"id":"64445798b59d2630","type":"tab","label":"[http] have params in the path","disabled":false,"info":"Http in nodes should be able to define paths that contain placeholder for parameters.","env":[{"name":"ERED_NOT_EUNIT","type":"bool","value":"true"},{"name":"ERED_TIMEOUT","type":"num","value":"5"}]},{"id":"636e832e3c16a9e6","type":"http in","z":"64445798b59d2630","name":"","url":"/t64445798b59d2630/testtwo/:param1/:param2","method":"get","upload":false,"swaggerDoc":"","x":208,"y":530,"wires":[["7288f0fd22652e25","58de6c031b4d0618","2b0918bcb0b55c53","c2a29d7fc0ebe85e","2ca24d1ddbfe2454"]]},{"id":"568af6bcb1c5cf73","type":"http response","z":"64445798b59d2630","name":"","statusCode":"","headers":{},"x":743,"y":852,"wires":[]},{"id":"a7e3dcf48b15929a","type":"inject","z":"64445798b59d2630","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":222.5,"y":200,"wires":[["4311564baa38d4f0"]]},{"id":"7288f0fd22652e25","type":"template","z":"64445798b59d2630","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"plain","template":"Hello world.\n\nAnd one more thing.\n\nThis is a test.\n\nBut should work.\n\n","output":"str","x":511,"y":744,"wires":[["568af6bcb1c5cf73"]]},{"id":"2ed1a71543381782","type":"http request","z":"64445798b59d2630","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"${host}/t64445798b59d2630/testtwo/val1/val2?query1=val3&query1=val4","tls":"83cd62fbf15a01f3","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":589.5,"y":213,"wires":[["ebafe26f5b73eff6"]]},{"id":"4311564baa38d4f0","type":"delay","z":"64445798b59d2630","name":"","pauseType":"delay","timeout":"250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":410,"y":260,"wires":[["2ed1a71543381782"]]},{"id":"ebafe26f5b73eff6","type":"ut-assert-values","z":"64445798b59d2630","name":"","rules":[{"p":"statusCode","pt":"msg","t":"eql","to":"200","tot":"num"},{"p":"payload","pt":"msg","t":"eql","to":"\"Hello world.\\n\\nAnd one more thing.\\n\\nThis is a test.\\n\\nBut should work.\\n\\n\"","tot":"json"}],"x":845.5,"y":213.5,"wires":[[]]},{"id":"58de6c031b4d0618","type":"ut-assert-values","z":"64445798b59d2630","name":"","rules":[{"p":"req.params.param1","pt":"msg","t":"eql","to":"val1","tot":"str"}],"x":613,"y":638,"wires":[[]]},{"id":"2b0918bcb0b55c53","type":"ut-assert-values","z":"64445798b59d2630","name":"","rules":[{"p":"req.params.param2","pt":"msg","t":"eql","to":"val2","tot":"str"}],"x":661,"y":579,"wires":[[]]},{"id":"c2a29d7fc0ebe85e","type":"ut-assert-values","z":"64445798b59d2630","name":"","rules":[{"p":"req.query","pt":"msg","t":"set"}],"x":734,"y":471,"wires":[[]]},{"id":"2ca24d1ddbfe2454","type":"ut-assert-values","z":"64445798b59d2630","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"req.query.query1","pt":"msg","to":"[\"val3\",\"val4\"]","tot":"json"}],"x":715,"y":530,"wires":[[]]},{"id":"83cd62fbf15a01f3","type":"tls-config","name":"","cert":"","key":"","p12":"","p12name":"","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":false,"alpnprotocol":"","certEnv":"","keyEnv":"","caEnv":""}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"084fb0fc954b7156","type":"tab","label":"[join] manual config with count & nested property name","disabled":false,"info":"Join should also handled nested property names.","env":[]},{"id":"8948c193b946b0ff","type":"junction","z":"084fb0fc954b7156","x":263.76970052719116,"y":543.6267687082291,"wires":[["782f7d5e5d547b63"]]},{"id":"bc4077f4dd04d17e","type":"inject","z":"084fb0fc954b7156","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"status\":{\"text\":1}},{\"status\":{\"text\":2}},{\"status\":{\"text\":3}},{\"status\":{\"text\":4}}]","payloadType":"json","x":95,"y":388,"wires":[["8948c193b946b0ff"]]},{"id":"782f7d5e5d547b63","type":"split","z":"084fb0fc954b7156","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","property":"payload","x":416,"y":319,"wires":[["703b790b65d4dc3f","cc0351c3ea4d9378"]]},{"id":"703b790b65d4dc3f","type":"join","z":"084fb0fc954b7156","name":"","mode":"custom","build":"array","property":"payload.status.text","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","useparts":false,"accumulate":false,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":657,"y":480,"wires":[["bc6a6f437c51bc0a"]]},{"id":"cc0351c3ea4d9378","type":"ut-assert-success","z":"084fb0fc954b7156","name":"","count":"4","x":904.5,"y":321.5,"wires":[]},{"id":"bc6a6f437c51bc0a","type":"ut-assert-values","z":"084fb0fc954b7156","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"{\"status\":{\"text\":[1,2,3,4]}}","tot":"json"}],"x":896,"y":437.5,"wires":[[]]}]
|
|
1
|
+
[{"id":"084fb0fc954b7156","type":"tab","label":"[join] manual config with count & nested property name","disabled":false,"info":"Join should also handled nested property names.","env":[{"name":"ERED_PENDING","value":"true","type":"bool"}]},{"id":"8948c193b946b0ff","type":"junction","z":"084fb0fc954b7156","x":263.76970052719116,"y":543.6267687082291,"wires":[["782f7d5e5d547b63"]]},{"id":"bc4077f4dd04d17e","type":"inject","z":"084fb0fc954b7156","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"status\":{\"text\":1}},{\"status\":{\"text\":2}},{\"status\":{\"text\":3}},{\"status\":{\"text\":4}}]","payloadType":"json","x":95,"y":388,"wires":[["8948c193b946b0ff"]]},{"id":"782f7d5e5d547b63","type":"split","z":"084fb0fc954b7156","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","property":"payload","x":416,"y":319,"wires":[["703b790b65d4dc3f","cc0351c3ea4d9378"]]},{"id":"703b790b65d4dc3f","type":"join","z":"084fb0fc954b7156","name":"","mode":"custom","build":"array","property":"payload.status.text","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","useparts":false,"accumulate":false,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":657,"y":480,"wires":[["bc6a6f437c51bc0a"]]},{"id":"cc0351c3ea4d9378","type":"ut-assert-success","z":"084fb0fc954b7156","name":"","count":"4","x":904.5,"y":321.5,"wires":[]},{"id":"bc6a6f437c51bc0a","type":"ut-assert-values","z":"084fb0fc954b7156","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"{\"status\":{\"text\":[1,2,3,4]}}","tot":"json"}],"x":896,"y":437.5,"wires":[[]]}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"a916165378c446e3","type":"tab","label":"[status] basic working version","disabled":false,"info":"Status node listens to other nodes for their status updates. It then posts these status updates as its messages","env":[{"name":"ERED_PENDING","value":"false","type":"bool"},{"name":"ERED_TIMEOUT","value":"6","type":"num"}]},{"id":"116137642eb0cbe7","type":"debug","z":"a916165378c446e3","name":"debug 395","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"status.text","targetType":"msg","statusVal":"payload","statusType":"msg","x":727,"y":316,"wires":[]},{"id":"34cbd3682d560baf","type":"status","z":"a916165378c446e3","name":"","scope":["116137642eb0cbe7"],"x":239,"y":705.1071634292603,"wires":[["a1142417496ed5ef","0532caa79b85ad02"]]},{"id":"d4a3eab1fe256e75","type":"inject","z":"a916165378c446e3","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"e","payloadType":"str","x":307,"y":489,"wires":[["aa935988bc52cb94"]]},{"id":"aa935988bc52cb94","type":"delay","z":"a916165378c446e3","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":524,"y":489,"wires":[["116137642eb0cbe7"]]},{"id":"f85c03456c8d0d25","type":"inject","z":"a916165378c446e3","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"b","payloadType":"str","x":215,"y":407.5,"wires":[["792349f35f115592"]]},{"id":"792349f35f115592","type":"delay","z":"a916165378c446e3","name":"","pauseType":"delay","timeout":"750","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":414,"y":407.5,"wires":[["116137642eb0cbe7"]]},{"id":"a1142417496ed5ef","type":"join","z":"a916165378c446e3","name":"","mode":"custom","build":"array","property":"status.text","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","useparts":false,"accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":505,"y":772.5,"wires":[["8e7239952bc1b21c"]]},{"id":"0532caa79b85ad02","type":"ut-assert-success","z":"a916165378c446e3","name":"","count":"3","x":747.9999923706055,"y":705.1071634292603,"wires":[]},{"id":"249a4c9fa0ef8ded","type":"inject","z":"a916165378c446e3","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"b","payloadType":"str","x":299,"y":316,"wires":[["116137642eb0cbe7"]]},{"id":"8e7239952bc1b21c","type":"ut-assert-values","z":"a916165378c446e3","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"
|
|
1
|
+
[{"id":"a916165378c446e3","type":"tab","label":"[status] basic working version","disabled":false,"info":"Status node listens to other nodes for their status updates. It then posts these status updates as its messages.\n\nThis also ensures that join nodes can join on specific attributes on a msg object.","env":[{"name":"ERED_PENDING","value":"false","type":"bool"},{"name":"ERED_TIMEOUT","value":"6","type":"num"}]},{"id":"116137642eb0cbe7","type":"debug","z":"a916165378c446e3","name":"debug 395","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"status.text","targetType":"msg","statusVal":"payload","statusType":"msg","x":727,"y":316,"wires":[]},{"id":"34cbd3682d560baf","type":"status","z":"a916165378c446e3","name":"","scope":["116137642eb0cbe7"],"x":239,"y":705.1071634292603,"wires":[["a1142417496ed5ef","0532caa79b85ad02"]]},{"id":"d4a3eab1fe256e75","type":"inject","z":"a916165378c446e3","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"e","payloadType":"str","x":307,"y":489,"wires":[["aa935988bc52cb94"]]},{"id":"aa935988bc52cb94","type":"delay","z":"a916165378c446e3","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":524,"y":489,"wires":[["116137642eb0cbe7"]]},{"id":"f85c03456c8d0d25","type":"inject","z":"a916165378c446e3","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"b","payloadType":"str","x":215,"y":407.5,"wires":[["792349f35f115592"]]},{"id":"792349f35f115592","type":"delay","z":"a916165378c446e3","name":"","pauseType":"delay","timeout":"750","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":414,"y":407.5,"wires":[["116137642eb0cbe7"]]},{"id":"a1142417496ed5ef","type":"join","z":"a916165378c446e3","name":"","mode":"custom","build":"array","property":"status.text","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","useparts":false,"accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":505,"y":772.5,"wires":[["8e7239952bc1b21c"]]},{"id":"0532caa79b85ad02","type":"ut-assert-success","z":"a916165378c446e3","name":"","count":"3","x":747.9999923706055,"y":705.1071634292603,"wires":[]},{"id":"249a4c9fa0ef8ded","type":"inject","z":"a916165378c446e3","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"b","payloadType":"str","x":299,"y":316,"wires":[["116137642eb0cbe7"]]},{"id":"8e7239952bc1b21c","type":"ut-assert-values","z":"a916165378c446e3","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"status.text","pt":"msg","to":"[\"b\", \"e\", \"b\"]","tot":"json"}],"x":744,"y":854.5,"wires":[[]]}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"36846ad6698e1bc0","type":"tab","label":"[switch] post debug on JSONata exception","disabled":false,"info":"","env":[{"name":"ERED_ONLY","value":"true","type":"bool"}]},{"id":"68fc7da02e4ce9da","type":"group","z":"36846ad6698e1bc0","name":"catch captures exception","style":{"label":true},"nodes":["83ab1354d90466f0","e9aa1d82d093db52","8d0e6a588bc579ce","915116870214bc0f","1466e3dcc32f09f6","5756ca28703729dc","5973bb0d4b1948b1","67fd7857fbebca0f"],"x":8,"y":828,"w":930,"h":354.5},{"id":"0e4b83838b47f758","type":"group","z":"36846ad6698e1bc0","name":"no catch node to capture the exception","style":{"label":true},"nodes":["9f0163ae195dc699","6dcf13bd6d4133a1","1a2dc9cdead129cb","4a51dd50369e9361","287121aac37d559b","4928acc9d0bc81a2"],"x":31,"y":362.5,"w":1030,"h":383},{"id":"5973bb0d4b1948b1","type":"group","z":"36846ad6698e1bc0","g":"68fc7da02e4ce9da","name":"Node-RED diverge","style":{"color":"#9363b7","fill":"#bfdbef","label":true},"nodes":["0dfefb756493e5d9","1bb2357cf149aeb0"],"x":680,"y":1018.5,"w":232,"h":138},{"id":"287121aac37d559b","type":"group","z":"36846ad6698e1bc0","g":"0e4b83838b47f758","name":"Node-RED Diverge","style":{"color":"#9363b7","fill":"#bfdbef","label":true},"nodes":["93eda421738039cf","6ff441e31fe3209a"],"x":580,"y":512.5,"w":232,"h":144},{"id":"9f0163ae195dc699","type":"inject","z":"36846ad6698e1bc0","g":"0e4b83838b47f758","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"hello world","payloadType":"str","x":137,"y":553.5,"wires":[["6dcf13bd6d4133a1"]]},{"id":"6dcf13bd6d4133a1","type":"switch","z":"36846ad6698e1bc0","g":"0e4b83838b47f758","name":"property uses broken jsonata","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"$fromMillis()","vt":"jsonata"},{"t":"else"},{"t":"eq","v":"hello world","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":415,"y":553.5,"wires":[["1a2dc9cdead129cb"],["93eda421738039cf"],["6ff441e31fe3209a"]]},{"id":"1a2dc9cdead129cb","type":"ut-assert-failure","z":"36846ad6698e1bc0","g":"0e4b83838b47f758","name":"","x":696,"y":403.5,"wires":[]},{"id":"4a51dd50369e9361","type":"ut-assert-debug","z":"36846ad6698e1bc0","g":"0e4b83838b47f758","name":"","scope":["6dcf13bd6d4133a1"],"nodeid":"6dcf13bd6d4133a1","msgtype":"error","inverse":false,"x":387,"y":704.5,"wires":[["4928acc9d0bc81a2"]]},{"id":"93eda421738039cf","type":"ut-assert-success","z":"36846ad6698e1bc0","g":"287121aac37d559b","name":"","count":1,"x":696,"y":553.5,"wires":[]},{"id":"6ff441e31fe3209a","type":"ut-assert-success","z":"36846ad6698e1bc0","g":"287121aac37d559b","name":"","count":1,"x":696,"y":615.5,"wires":[]},{"id":"83ab1354d90466f0","type":"inject","z":"36846ad6698e1bc0","g":"68fc7da02e4ce9da","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"hello world","payloadType":"str","x":114,"y":944,"wires":[["e9aa1d82d093db52"]]},{"id":"e9aa1d82d093db52","type":"switch","z":"36846ad6698e1bc0","g":"68fc7da02e4ce9da","name":"broken property jsonata","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"$fromMillis()","vt":"jsonata"},{"t":"else"},{"t":"eq","v":"hello world","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":393,"y":996,"wires":[["8d0e6a588bc579ce"],["0dfefb756493e5d9"],["1bb2357cf149aeb0"]]},{"id":"8d0e6a588bc579ce","type":"ut-assert-failure","z":"36846ad6698e1bc0","g":"68fc7da02e4ce9da","name":"","x":792,"y":946.5,"wires":[]},{"id":"915116870214bc0f","type":"ut-assert-debug","z":"36846ad6698e1bc0","g":"68fc7da02e4ce9da","name":"","scope":["e9aa1d82d093db52"],"nodeid":"e9aa1d82d093db52","msgtype":"error","inverse":true,"x":411,"y":1066.5,"wires":[["67fd7857fbebca0f"]]},{"id":"0dfefb756493e5d9","type":"ut-assert-success","z":"36846ad6698e1bc0","g":"5973bb0d4b1948b1","name":"","count":1,"x":796,"y":1059.5,"wires":[]},{"id":"1bb2357cf149aeb0","type":"ut-assert-success","z":"36846ad6698e1bc0","g":"5973bb0d4b1948b1","name":"","count":1,"x":796,"y":1115.5,"wires":[]},{"id":"1466e3dcc32f09f6","type":"catch","z":"36846ad6698e1bc0","g":"68fc7da02e4ce9da","name":"","scope":["e9aa1d82d093db52"],"uncaught":false,"x":384,"y":926,"wires":[["5756ca28703729dc"]]},{"id":"5756ca28703729dc","type":"ut-assert-success","z":"36846ad6698e1bc0","g":"68fc7da02e4ce9da","name":"","count":1,"x":793,"y":869,"wires":[]},{"id":"67fd7857fbebca0f","type":"ut-assert-failure","z":"36846ad6698e1bc0","g":"68fc7da02e4ce9da","name":"","x":408,"y":1131,"wires":[]},{"id":"4928acc9d0bc81a2","type":"ut-assert-values","z":"36846ad6698e1bc0","g":"0e4b83838b47f758","name":"","ignore_failure_if_succeed":false,"rules":[{"
|
|
1
|
+
[{"id":"36846ad6698e1bc0","type":"tab","label":"[switch] post debug on JSONata exception","disabled":false,"info":"","env":[{"name":"ERED_ONLY","value":"true","type":"bool"}]},{"id":"68fc7da02e4ce9da","type":"group","z":"36846ad6698e1bc0","name":"catch captures exception","style":{"label":true},"nodes":["83ab1354d90466f0","e9aa1d82d093db52","8d0e6a588bc579ce","915116870214bc0f","1466e3dcc32f09f6","5756ca28703729dc","5973bb0d4b1948b1","67fd7857fbebca0f"],"x":8,"y":828,"w":930,"h":354.5},{"id":"0e4b83838b47f758","type":"group","z":"36846ad6698e1bc0","name":"no catch node to capture the exception","style":{"label":true},"nodes":["9f0163ae195dc699","6dcf13bd6d4133a1","1a2dc9cdead129cb","4a51dd50369e9361","287121aac37d559b","4928acc9d0bc81a2"],"x":31,"y":362.5,"w":1030,"h":383},{"id":"5973bb0d4b1948b1","type":"group","z":"36846ad6698e1bc0","g":"68fc7da02e4ce9da","name":"Node-RED diverge","style":{"color":"#9363b7","fill":"#bfdbef","label":true},"nodes":["0dfefb756493e5d9","1bb2357cf149aeb0"],"x":680,"y":1018.5,"w":232,"h":138},{"id":"287121aac37d559b","type":"group","z":"36846ad6698e1bc0","g":"0e4b83838b47f758","name":"Node-RED Diverge","style":{"color":"#9363b7","fill":"#bfdbef","label":true},"nodes":["93eda421738039cf","6ff441e31fe3209a"],"x":580,"y":512.5,"w":232,"h":144},{"id":"9f0163ae195dc699","type":"inject","z":"36846ad6698e1bc0","g":"0e4b83838b47f758","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"hello world","payloadType":"str","x":137,"y":553.5,"wires":[["6dcf13bd6d4133a1"]]},{"id":"6dcf13bd6d4133a1","type":"switch","z":"36846ad6698e1bc0","g":"0e4b83838b47f758","name":"property uses broken jsonata","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"$fromMillis()","vt":"jsonata"},{"t":"else"},{"t":"eq","v":"hello world","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":415,"y":553.5,"wires":[["1a2dc9cdead129cb"],["93eda421738039cf"],["6ff441e31fe3209a"]]},{"id":"1a2dc9cdead129cb","type":"ut-assert-failure","z":"36846ad6698e1bc0","g":"0e4b83838b47f758","name":"","x":696,"y":403.5,"wires":[]},{"id":"4a51dd50369e9361","type":"ut-assert-debug","z":"36846ad6698e1bc0","g":"0e4b83838b47f758","name":"","scope":["6dcf13bd6d4133a1"],"nodeid":"6dcf13bd6d4133a1","msgtype":"error","inverse":false,"x":387,"y":704.5,"wires":[["4928acc9d0bc81a2"]]},{"id":"93eda421738039cf","type":"ut-assert-success","z":"36846ad6698e1bc0","g":"287121aac37d559b","name":"","count":1,"x":696,"y":553.5,"wires":[]},{"id":"6ff441e31fe3209a","type":"ut-assert-success","z":"36846ad6698e1bc0","g":"287121aac37d559b","name":"","count":1,"x":696,"y":615.5,"wires":[]},{"id":"83ab1354d90466f0","type":"inject","z":"36846ad6698e1bc0","g":"68fc7da02e4ce9da","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"hello world","payloadType":"str","x":114,"y":944,"wires":[["e9aa1d82d093db52"]]},{"id":"e9aa1d82d093db52","type":"switch","z":"36846ad6698e1bc0","g":"68fc7da02e4ce9da","name":"broken property jsonata","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"$fromMillis()","vt":"jsonata"},{"t":"else"},{"t":"eq","v":"hello world","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":393,"y":996,"wires":[["8d0e6a588bc579ce"],["0dfefb756493e5d9"],["1bb2357cf149aeb0"]]},{"id":"8d0e6a588bc579ce","type":"ut-assert-failure","z":"36846ad6698e1bc0","g":"68fc7da02e4ce9da","name":"","x":792,"y":946.5,"wires":[]},{"id":"915116870214bc0f","type":"ut-assert-debug","z":"36846ad6698e1bc0","g":"68fc7da02e4ce9da","name":"","scope":["e9aa1d82d093db52"],"nodeid":"e9aa1d82d093db52","msgtype":"error","inverse":true,"x":411,"y":1066.5,"wires":[["67fd7857fbebca0f"]]},{"id":"0dfefb756493e5d9","type":"ut-assert-success","z":"36846ad6698e1bc0","g":"5973bb0d4b1948b1","name":"","count":1,"x":796,"y":1059.5,"wires":[]},{"id":"1bb2357cf149aeb0","type":"ut-assert-success","z":"36846ad6698e1bc0","g":"5973bb0d4b1948b1","name":"","count":1,"x":796,"y":1115.5,"wires":[]},{"id":"1466e3dcc32f09f6","type":"catch","z":"36846ad6698e1bc0","g":"68fc7da02e4ce9da","name":"","scope":["e9aa1d82d093db52"],"uncaught":false,"x":384,"y":926,"wires":[["5756ca28703729dc"]]},{"id":"5756ca28703729dc","type":"ut-assert-success","z":"36846ad6698e1bc0","g":"68fc7da02e4ce9da","name":"","count":1,"x":793,"y":869,"wires":[]},{"id":"67fd7857fbebca0f","type":"ut-assert-failure","z":"36846ad6698e1bc0","g":"68fc7da02e4ce9da","name":"","x":408,"y":1131,"wires":[]},{"id":"4928acc9d0bc81a2","type":"ut-assert-values","z":"36846ad6698e1bc0","g":"0e4b83838b47f758","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"data.id","pt":"msg","to":"6dcf13bd6d4133a1","tot":"str"},{"t":"eql","p":"data['level']","pt":"msg","to":"20","tot":"num"},{"t":"eql","p":"data.name","pt":"msg","to":"property uses broken jsonata","tot":"str"},{"t":"eql","p":"data.msg.error_msg","pt":"msg","to":"jsonata unsupported function: {fromMillis,[]}","tot":"str"}],"x":955,"y":704,"wires":[[]]}]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"id":"56a4f6bde709ddae","type":"tab","label":"[template] support mustache template (ered)","disabled":false,"info":"Basic support mustache templating using [bbmustache](https://github.com/soranoba/bbmustache).","env":[{"name":"ERED_ONLY","value":"true","type":"bool"}]},{"id":"670633d166091f80","type":"inject","z":"56a4f6bde709ddae","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"<b>hello world</b>","payloadType":"str","x":608,"y":882,"wires":[["a19c63d6c7b0b82c","0e2fcb987cb604d2","6fb4a505fbf513ba"]]},{"id":"a19c63d6c7b0b82c","type":"template","z":"56a4f6bde709ddae","name":"double {{ .. }}","field":"payload","fieldType":"msg","format":"text","syntax":"mustache","template":"This is the payload: {{payload}} !","output":"str","x":866,"y":882,"wires":[["cfeb41c5e62ef3ba"]]},{"id":"cfeb41c5e62ef3ba","type":"ut-assert-values","z":"56a4f6bde709ddae","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"This is the payload: <b>hello world</b> !","tot":"str"}],"x":1102,"y":882,"wires":[[]]},{"id":"0e2fcb987cb604d2","type":"template","z":"56a4f6bde709ddae","name":"triple {{{ .. }}}","field":"payload","fieldType":"msg","format":"text","syntax":"mustache","template":"This is the payload: {{{payload}}} !","output":"str","x":866,"y":958,"wires":[["846dc2ca320c8fda"]]},{"id":"846dc2ca320c8fda","type":"ut-assert-values","z":"56a4f6bde709ddae","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"This is the payload: <b>hello world</b> !","tot":"str"}],"x":1102,"y":1017,"wires":[[]]},{"id":"6fb4a505fbf513ba","type":"template","z":"56a4f6bde709ddae","name":"single { .. }","field":"payload","fieldType":"msg","format":"text","syntax":"mustache","template":"This is the payload: {payload} !","output":"str","x":866,"y":813,"wires":[["cf1f20ec5a8ed119"]]},{"id":"cf1f20ec5a8ed119","type":"ut-assert-values","z":"56a4f6bde709ddae","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"This is the payload: {payload} !","tot":"str"}],"x":1102,"y":773,"wires":[[]]}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"08183069b5f8ef9c","type":"tab","label":"[template] support mustache template","disabled":false,"info":"Basic support mustache templating using [bbmustache](https://github.com/soranoba/bbmustache).","env":[]},{"id":"bc81e6748b3aeb9c","type":"inject","z":"08183069b5f8ef9c","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"<b>hello world</b>","payloadType":"str","x":608,"y":882,"wires":[["44c609fe82ebf669","8e84e08b55c84671","f1d52f3c187a674e"]]},{"id":"44c609fe82ebf669","type":"template","z":"08183069b5f8ef9c","name":"double {{ .. }}","field":"payload","fieldType":"msg","format":"text","syntax":"mustache","template":"This is the payload: {{payload}} !","output":"str","x":866,"y":882,"wires":[["781a45ccaa1bf83f"]]},{"id":"781a45ccaa1bf83f","type":"ut-assert-values","z":"08183069b5f8ef9c","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"This is the payload: <b>hello world</b> !","tot":"str"}],"x":1102,"y":882,"wires":[[]]},{"id":"8e84e08b55c84671","type":"template","z":"08183069b5f8ef9c","name":"triple {{{ .. }}}","field":"payload","fieldType":"msg","format":"text","syntax":"mustache","template":"This is the payload: {{{payload}}} !","output":"str","x":866,"y":958,"wires":[["74f729fd37514cd4"]]},{"id":"74f729fd37514cd4","type":"ut-assert-values","z":"08183069b5f8ef9c","name":"","rules":[{"
|
|
1
|
+
[{"id":"08183069b5f8ef9c","type":"tab","label":"[template] support mustache template","disabled":false,"info":"Basic support mustache templating using [bbmustache](https://github.com/soranoba/bbmustache).","env":[{"name":"NODE_RED_ONLY","value":"true","type":"bool"}]},{"id":"bc81e6748b3aeb9c","type":"inject","z":"08183069b5f8ef9c","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"<b>hello world</b>","payloadType":"str","x":608,"y":882,"wires":[["44c609fe82ebf669","8e84e08b55c84671","f1d52f3c187a674e"]]},{"id":"44c609fe82ebf669","type":"template","z":"08183069b5f8ef9c","name":"double {{ .. }}","field":"payload","fieldType":"msg","format":"text","syntax":"mustache","template":"This is the payload: {{payload}} !","output":"str","x":866,"y":882,"wires":[["781a45ccaa1bf83f"]]},{"id":"781a45ccaa1bf83f","type":"ut-assert-values","z":"08183069b5f8ef9c","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"This is the payload: <b>hello world</b> !","tot":"str"}],"x":1102,"y":882,"wires":[[]]},{"id":"8e84e08b55c84671","type":"template","z":"08183069b5f8ef9c","name":"triple {{{ .. }}}","field":"payload","fieldType":"msg","format":"text","syntax":"mustache","template":"This is the payload: {{{payload}}} !","output":"str","x":866,"y":958,"wires":[["74f729fd37514cd4"]]},{"id":"74f729fd37514cd4","type":"ut-assert-values","z":"08183069b5f8ef9c","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"This is the payload: <b>hello world</b> !","tot":"str"}],"x":1102,"y":1017,"wires":[[]]},{"id":"f1d52f3c187a674e","type":"template","z":"08183069b5f8ef9c","name":"single { .. }","field":"payload","fieldType":"msg","format":"text","syntax":"mustache","template":"This is the payload: {payload} !","output":"str","x":866,"y":813,"wires":[["cc3819b467390aab"]]},{"id":"cc3819b467390aab","type":"ut-assert-values","z":"08183069b5f8ef9c","name":"","ignore_failure_if_succeed":false,"rules":[{"t":"eql","p":"payload","pt":"msg","to":"This is the payload: {payload} !","tot":"str"}],"x":1102,"y":773,"wires":[[]]}]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script type="text/markdown" data-help-name="ut-config">
|
|
2
|
+
Configuration details of the unittesting setup
|
|
3
|
+
|
|
4
|
+
### Inputs
|
|
5
|
+
|
|
6
|
+
: payload (any) : what is expected as payload input.
|
|
7
|
+
: topic (string) : (optional) is a topic expected or handled.
|
|
8
|
+
|
|
9
|
+
### Outputs
|
|
10
|
+
|
|
11
|
+
: payload (any) : what is returned as payload.
|
|
12
|
+
|
|
13
|
+
### Description
|
|
14
|
+
|
|
15
|
+
Sets the `utcfg` object with the following values:
|
|
16
|
+
```
|
|
17
|
+
msg.utcfg = {
|
|
18
|
+
"priv": "", // directory containing test data for the tests
|
|
19
|
+
"host": "" // Node-RED/Erlang-Red server endpoint from within the runtime
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
<!-- [Markdown documentation details](https://nodered.org/docs/creating-nodes/help-style-guide) -->
|
|
24
|
+
|
|
25
|
+
</script>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script type="text/javascript">
|
|
2
|
+
(function(){
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
function frontendSupportFunction() {
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
var functTwo = (arg) => {
|
|
9
|
+
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
RED.nodes.registerType('ut-config',{
|
|
13
|
+
color: '#FDF0C2',
|
|
14
|
+
icon: "font-awesome/fa-th",
|
|
15
|
+
category: 'testing',
|
|
16
|
+
paletteLabel: 'Unittest Config',
|
|
17
|
+
defaults: {
|
|
18
|
+
name: {
|
|
19
|
+
value:"",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
inputs: 1,
|
|
24
|
+
|
|
25
|
+
outputs: 1,
|
|
26
|
+
|
|
27
|
+
label: function() {
|
|
28
|
+
return (this.name || this._def.paletteLabel);
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
labelStyle: function() {
|
|
32
|
+
return this.name?"node_label_italic":"";
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
// called when node is added to workspace also if copied and pasted.
|
|
36
|
+
// once for each node added to the workspace
|
|
37
|
+
onadd: function() {
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
// called when node added to palette - one time
|
|
41
|
+
onpaletteadd: function() {
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
onpaletteremove: function() {
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
oneditprepare: function() {
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
oneditcancel: function() {
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
oneditsave: function() {
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
oneditresize: function(size) {
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
});
|
|
61
|
+
})();
|
|
62
|
+
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<script type="text/html" data-template-name="ut-config">
|
|
66
|
+
<div class="form-row">
|
|
67
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
|
68
|
+
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
|
69
|
+
</div>
|
|
70
|
+
</script>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
module.exports = function(RED) {
|
|
2
|
+
function Coreut_configFunctionality(config) {
|
|
3
|
+
RED.nodes.createNode(this,config);
|
|
4
|
+
|
|
5
|
+
var node = this;
|
|
6
|
+
var cfg = config;
|
|
7
|
+
|
|
8
|
+
node.on('close', function() {
|
|
9
|
+
node.status({});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
/* msg handler, in this case pass the message on unchanged */
|
|
13
|
+
node.on("input", function(msg, send, done) {
|
|
14
|
+
|
|
15
|
+
const path = require('path');
|
|
16
|
+
const runtime = require("@node-red/runtime");
|
|
17
|
+
|
|
18
|
+
let getListenPath = (settings) => {
|
|
19
|
+
var port = settings.serverPort;
|
|
20
|
+
if (port === undefined) {
|
|
21
|
+
port = settings.uiPort;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var listenPath = 'http' + (settings.https ? 's' : '') + '://' +
|
|
25
|
+
(settings.uiHost == '::' ? 'localhost' : (settings.uiHost == '0.0.0.0' ? '127.0.0.1' : settings.uiHost)) +
|
|
26
|
+
':' + port;
|
|
27
|
+
if (settings.httpAdminRoot !== false) {
|
|
28
|
+
listenPath += settings.httpAdminRoot;
|
|
29
|
+
} else if (settings.httpStatic) {
|
|
30
|
+
listenPath += "/";
|
|
31
|
+
}
|
|
32
|
+
return listenPath;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let getHttpServer = (settings) => {
|
|
36
|
+
var port = settings.serverPort;
|
|
37
|
+
if (port === undefined) {
|
|
38
|
+
port = settings.uiPort;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
var listenPath = 'http' + (settings.https ? 's' : '') + '://' +
|
|
42
|
+
(settings.uiHost == '::' ? 'localhost' : (settings.uiHost == '0.0.0.0' ? '127.0.0.1' : settings.uiHost)) +
|
|
43
|
+
':' + port;
|
|
44
|
+
|
|
45
|
+
return listenPath;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Send a message and how to handle errors.
|
|
49
|
+
try {
|
|
50
|
+
try {
|
|
51
|
+
msg.utcfg = {
|
|
52
|
+
"priv": path.resolve(path.dirname(__filename), "..", "priv"),
|
|
53
|
+
// "editor": getListenPath(runtime._.settings),
|
|
54
|
+
"host": getHttpServer(runtime._.settings)
|
|
55
|
+
}
|
|
56
|
+
send(msg);
|
|
57
|
+
done();
|
|
58
|
+
} catch ( err ) {
|
|
59
|
+
// use node.error if the node might send subsequent messages
|
|
60
|
+
node.error("error occurred", { ...msg, error: err })
|
|
61
|
+
done();
|
|
62
|
+
}
|
|
63
|
+
} catch (err) {
|
|
64
|
+
// use done if the node won't send anymore messages for the
|
|
65
|
+
// message it received.
|
|
66
|
+
msg.error = err
|
|
67
|
+
done(err.message, msg)
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
RED.nodes.registerType("ut-config", Coreut_configFunctionality);
|
|
73
|
+
|
|
74
|
+
}
|