-
Notifications
You must be signed in to change notification settings - Fork 7
/
flows.json
1 lines (1 loc) · 63.2 KB
/
flows.json
1
[{"id":"5ef53777.338c68","type":"tab","label":"World Wide Emergencies","disabled":false,"info":"connect to a EMS public alert, transform into COT and push to FTS"},{"id":"9483f9cf.5222d8","type":"tab","label":"TelegramTAK","disabled":true,"info":"Connects to FTS emergency and send a Telegram location and a message to a specific Telegram group chat. From a same chat, you ca create an emergency OR send a regular chat to all in FTS."},{"id":"200c11bc.712fce","type":"tab","label":"web Map 2","disabled":false,"info":"Get the flow of COT from FTS and display on a web map (credit @ampledata#8354) "},{"id":"7b06f04.b04ce1","type":"tab","label":"RDF example","disabled":false,"info":""},{"id":"65930269.15cc9c","type":"tab","label":"Naha TelegramTAK Playground","disabled":false,"info":"Connects to FTS emergency and send a Telegram location and a message to a specific Telegram group chat. From a same chat, you ca create an emergency OR send a regular chat to all in FTS."},{"id":"df714a46.435838","type":"tab","label":"test","disabled":false,"info":""},{"id":"ce1eb260.b0f65","type":"telegram bot","botname":"FreeTAKServerNotification_bot","usernames":"","chatids":"595264086, 935590830, -1001297275903","baseapiurl":"","updatemode":"polling","pollinterval":"300","usesocks":false,"sockshost":"","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","botpath":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false},{"id":"8575f7eb.9a4908","type":"telegram bot","botname":"","usernames":"","chatids":"","baseapiurl":"","updatemode":"polling","pollinterval":"300","usesocks":false,"sockshost":"","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","botpath":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false},{"id":"905b6aeb.a0e6b8","type":"ui_group","name":"add","tab":"d6ad932e.08e25","order":1,"disp":true,"width":12,"collapse":false},{"id":"d4f6e247.8b798","type":"ui_group","name":"manage","tab":"d6ad932e.08e25","order":2,"disp":true,"width":"6","collapse":false},{"id":"d6ad932e.08e25","type":"ui_tab","name":"fromBot","icon":"dashboard","disabled":false,"hidden":false},{"id":"21b59bfe.fc8c94","type":"ui_group","name":"manage","tab":"a3909b1d.4d4d68","order":1,"disp":true,"width":"6","collapse":false},{"id":"a3909b1d.4d4d68","type":"ui_tab","name":"toBot","icon":"dashboard","order":2,"disabled":false,"hidden":false},{"id":"f21fc304.cbccd","type":"ui_group","name":"manager","tab":"df1647d.1c953b8","order":1,"disp":true,"width":"6","collapse":false},{"id":"df1647d.1c953b8","type":"ui_tab","name":"general","icon":"dashboard","order":3,"disabled":false,"hidden":false},{"id":"dd514bbb.374248","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"},"themeState":{"base-color":{"default":"#0094CE","value":"#0094CE","edited":false},"page-titlebar-backgroundColor":{"value":"#0094CE","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#ffffff","edited":false},"group-textColor":{"value":"#1bbfff","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#0094ce","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false},"base-font":{"value":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","lockMenu":"false","allowTempTheme":"true","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"6ab2056f.fa1a6c","type":"tls-config","name":"","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":false},{"id":"592e4fc.cfdb0b","type":"multifeed-parser","z":"5ef53777.338c68","d":true,"name":"EU emergency","interval":15,"urls":"http://southfront.org/feed","x":340,"y":60,"wires":[["51ae8ba6.5a1aa4"]]},{"id":"f89da775.1df008","type":"http request","z":"5ef53777.338c68","name":"Post to FTS","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://204.48.30.216:19023/ManageGeoObject/postGeoObject","tls":"","persist":false,"proxy":"","authType":"bearer","x":1010,"y":600,"wires":[["a2005c3b.d3453"]]},{"id":"21815e95.9e74b2","type":"debug","z":"5ef53777.338c68","name":"Rest result","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1010,"y":500,"wires":[]},{"id":"121d99cd.71ef96","type":"inject","z":"5ef53777.338c68","d":true,"name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":60,"wires":[["592e4fc.cfdb0b"]]},{"id":"fe31d5a6.664968","type":"xml","z":"5ef53777.338c68","name":"","property":"payload","attr":"","chr":"","x":370,"y":400,"wires":[["3b0de43e.9e26cc","aba30843.8a1ca8"]]},{"id":"51ae8ba6.5a1aa4","type":"debug","z":"5ef53777.338c68","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":550,"y":60,"wires":[]},{"id":"f65983ff.0047f","type":"inject","z":"5ef53777.338c68","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":320,"wires":[["46fbea16.4dfde4"]]},{"id":"8c15aac.0124058","type":"http request","z":"5ef53777.338c68","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":150,"y":400,"wires":[["fe31d5a6.664968"]]},{"id":"95b43cd1.8efce","type":"function","z":"5ef53777.338c68","name":"convert to rest","func":" let longitude;\n let latitude;\n let attitude;\n let geoObject;\n let how;\n let name;\n let timeout;\n \nlet item = msg.payload;\nmsg.payload = [];\n\n var i;\nfor (i = 0; i < item.length; i++) \n{\n name = item[i][\"title\"][0];\n georss = item[i][\"georss:point\"][0];\n var geoArray = georss.split(/(\\s+)/);\n \n longitude =geoArray[2];\n latitude= geoArray[0];\n //attitude =geoArray[1];\n //TODO implement type \n //geoObject = item[i][\"category\"][0];\n geoObject = 'Other incident other';\n // how;\n// hard coded for now TODO change it\n timeout = 86400; \n\nmsg.payload.push( {\n longitude: longitude,\n latitude: latitude,\n attitude: 'hostile',\n geoObject: geoObject,\n how: \"nonCoT\",\n name: name,\n timeout: timeout\n});\n \n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":800,"y":500,"wires":[["21815e95.9e74b2","93437df0.3b965"]]},{"id":"3b0de43e.9e26cc","type":"debug","z":"5ef53777.338c68","name":"XML output","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":610,"y":400,"wires":[]},{"id":"26dec5ec.50a0ba","type":"comment","z":"5ef53777.338c68","name":"READMEFIRST","info":"EMS aggregated from\n[source](https://emergency.copernicus.eu/mapping/georss-feeds-aggregated#zoom=2&lat=33.83678&lon=39.36376&layers=TB00)\n","x":760,"y":60,"wires":[]},{"id":"28a50a5f.d096f6","type":"split","z":"5ef53777.338c68","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":630,"y":500,"wires":[["95b43cd1.8efce","fb6b67a6.595548"]]},{"id":"fb6b67a6.595548","type":"debug","z":"5ef53777.338c68","name":"Split result","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":790,"y":440,"wires":[]},{"id":"aba30843.8a1ca8","type":"function","z":"5ef53777.338c68","name":"retun Items only","func":" let longitude;\n let latitude;\n let attitude;\n let geoObject;\n let how;\n let name;\n let timeout;\n \nlet item = msg.payload[\"rss\"][\"channel\"][0][\"item\"];\n\n\nmsg.payload = {\n item\n}\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":460,"y":500,"wires":[["28a50a5f.d096f6"]]},{"id":"93437df0.3b965","type":"split","z":"5ef53777.338c68","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":770,"y":600,"wires":[["64eb6ca1.283324","f89da775.1df008"]]},{"id":"64eb6ca1.283324","type":"debug","z":"5ef53777.338c68","name":"final split","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1000,"y":560,"wires":[]},{"id":"a2005c3b.d3453","type":"debug","z":"5ef53777.338c68","name":"Rest body","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1200,"y":600,"wires":[]},{"id":"46fbea16.4dfde4","type":"function","z":"5ef53777.338c68","name":"Calculate Date range","func":"// retuns the query of 3 months\n\nvar dateObj = new Date();\nvar range = 3;\nvar month = dateObj.getUTCMonth() + 1; //months from 1-12\nvar prevMonth = month - range;\nvar day = dateObj.getUTCDate();\nvar year = dateObj.getUTCFullYear();\n\ndateEnd = year + \"-\" + month + \"-\" + day;\n\nvar dateStart = year + \"-\" + prevMonth + \"-\" + day;\n\nmsg.url = \"https://sertit.unistra.fr/activations-georss/?created%5Bmin%5D=\" + dateStart + \"&created%5Bmax%5D=\" + dateEnd;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":420,"y":300,"wires":[["8c15aac.0124058","72bcb47a.7498cc"]]},{"id":"72bcb47a.7498cc","type":"debug","z":"5ef53777.338c68","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"url","targetType":"msg","statusVal":"","statusType":"auto","x":640,"y":260,"wires":[]},{"id":"38b2e01.c9d642","type":"telegram sender","z":"9483f9cf.5222d8","name":"","bot":"ce1eb260.b0f65","haserroroutput":false,"outputs":1,"x":1270,"y":440,"wires":[[]]},{"id":"e6457bcf.d57208","type":"inject","z":"9483f9cf.5222d8","name":"every 10 minutes","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"600","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":140,"wires":[["881e666.48a6798"]]},{"id":"5a070fcf.8edd8","type":"function","z":"9483f9cf.5222d8","name":"send location","func":"let longitude;\n let latitude;\n let name;\n let type;\n let message1 = 'you have an emergency!\\n';\n let message2 = ' is ';\n let message3 = '\\n Latitude: ';\n let message4 = '\\n longitude: ';\n \nlet item = msg.payload;\nmsg.payload = [];\n\n var i;\n\n name = item[\"name\"];\n type = item[\"type\"];\n longitude =item[\"lon\"];\n latitude= item[\"lat\"];\n \nmsg.payload = {}\n\n//family emergencies group 595264086, \n// open ID 1001297275903\n// personal ID is 935590830\nmsg.payload.chatId = -1001297275903;\n//msg.payload.type = 'message';\nmsg.payload.type = 'location';\n//msg.payload.content = message1 + name + message2 + type + message3 + latitude + message4 + longitude;\nmsg.payload.content={\n 'longitude': longitude,\n 'latitude': latitude\n };\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":990,"y":400,"wires":[["38b2e01.c9d642","4a638f9c.40bb4"]]},{"id":"881e666.48a6798","type":"http request","z":"9483f9cf.5222d8","name":"Get emergencies","method":"GET","ret":"txt","paytoqs":"ignore","url":"204.48.30.216:19023/ManageEmergency/getEmergency","tls":"","persist":false,"proxy":"","authType":"bearer","x":270,"y":260,"wires":[["f9a1bda6.5bded"]]},{"id":"f9a1bda6.5bded","type":"json","z":"9483f9cf.5222d8","name":"transform to Json","property":"payload","action":"","pretty":false,"x":510,"y":180,"wires":[["bacdf9d8.da4698","e2652bb2.4e3bc8"]]},{"id":"bacdf9d8.da4698","type":"debug","z":"9483f9cf.5222d8","name":"Json Payload","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":720,"y":80,"wires":[]},{"id":"e2652bb2.4e3bc8","type":"split","z":"9483f9cf.5222d8","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":490,"y":300,"wires":[["c5407afe.598be8","7e07a5f0.66496c"]]},{"id":"c5407afe.598be8","type":"debug","z":"9483f9cf.5222d8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":790,"y":140,"wires":[]},{"id":"4a638f9c.40bb4","type":"debug","z":"9483f9cf.5222d8","name":"after function","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1190,"y":320,"wires":[]},{"id":"31fd743d.b496bc","type":"split","z":"9483f9cf.5222d8","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":830,"y":440,"wires":[["5a070fcf.8edd8","a8ffb0ea.8b99f"]]},{"id":"22c293de.eeb96c","type":"http request","z":"5ef53777.338c68","name":"Post geoObject to FTS","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://204.48.30.216:19023/ManageGeoObject/postGeoObject","tls":"","persist":false,"proxy":"","authType":"bearer","x":960,"y":720,"wires":[["ee68979.d06c068","fb044294.ea083"]]},{"id":"f7bbd31d.1c46e","type":"debug","z":"5ef53777.338c68","name":"Rest result","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":750,"y":800,"wires":[]},{"id":"2778ffe4.dc324","type":"xml","z":"5ef53777.338c68","name":"","property":"payload","attr":"","chr":"","x":430,"y":660,"wires":[["ed499ac5.687b88","6ac2f102.5077a"]]},{"id":"37feebcf.435fc4","type":"inject","z":"5ef53777.338c68","name":"Global disaster 24 H","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"86400","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":640,"wires":[["39c2ddcc.8a6dc2"]]},{"id":"73bc62c7.0140dc","type":"http request","z":"5ef53777.338c68","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":290,"y":720,"wires":[["2778ffe4.dc324"]]},{"id":"baadfbfe.23f398","type":"function","z":"5ef53777.338c68","name":"convert to rest","func":" let longitude;\n let latitude;\n let attitude = 'hostile';\n let geoObject;\n let how = \"nonCoT\";\n let name;\n let timeout = 86400;\n \nlet item = msg.payload;\nmsg.payload = [];\n\n name = item.title[0];\n latitude=item[\"geo:Point\"][0][\"geo:lat\"][0];\n longitude = item[\"geo:Point\"][0][\"geo:long\"][0];\n geoObject = item[\"gdacs:eventtype\"][0];\n \n\n switch(geoObject) \n {\n case 'DR':\n // drought\n geoObject = \"drought\"\n break;\n case 'EQ':\n // earthquake \n geoObject = \"earthquake\"\n break;\n case 'TC':\n // cyclone\n geoObject = \"cyclone\"\n break;\n default:\n // otherwise\n geoObject= \"Other incident other\";\n}\n\n msg.payload={\n longitude: longitude,\n latitude: latitude,\n attitude: attitude,\n geoObject: geoObject,\n how: how,\n name: name,\n timeout: timeout\n};\n \nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":740,"y":720,"wires":[["f7bbd31d.1c46e","22c293de.eeb96c"]]},{"id":"ed499ac5.687b88","type":"debug","z":"5ef53777.338c68","name":"XML output","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":570,"y":580,"wires":[]},{"id":"604f5bb2.de7f64","type":"split","z":"5ef53777.338c68","name":"split to in array of Items","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":670,"y":660,"wires":[["37ad0315.b164dc"]]},{"id":"d2c622f3.89c62","type":"debug","z":"5ef53777.338c68","name":"final split","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1100,"y":660,"wires":[]},{"id":"ee68979.d06c068","type":"debug","z":"5ef53777.338c68","name":"Rest body","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":980,"y":820,"wires":[]},{"id":"39c2ddcc.8a6dc2","type":"function","z":"5ef53777.338c68","name":"URL","func":"// retuns the query of 1 week at www.gdacs.org\n\n\nmsg.url = \"https://www.gdacs.org/xml/rss_24h.xml\";\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":290,"y":660,"wires":[["73bc62c7.0140dc","18b66e60.0b8c72"]]},{"id":"18b66e60.0b8c72","type":"debug","z":"5ef53777.338c68","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"url","targetType":"msg","statusVal":"","statusType":"auto","x":400,"y":580,"wires":[]},{"id":"6ac2f102.5077a","type":"function","z":"5ef53777.338c68","name":"retun Items only","func":" let longitude;\n let latitude;\n let attitude;\n let geoObject;\n let how;\n let name;\n let timeout;\n \n //set msg.url to null to avoid '\"Warning: msg properties can no longer override set node properties' message\n msg.url ='';\n \nlet item = msg.payload[\"rss\"][\"channel\"][0][\"item\"];\n\n\nmsg.payload = {\n item\n}\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":500,"y":720,"wires":[["604f5bb2.de7f64"]]},{"id":"37ad0315.b164dc","type":"split","z":"5ef53777.338c68","name":"single messages","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":910,"y":660,"wires":[["d2c622f3.89c62","baadfbfe.23f398"]]},{"id":"a8ffb0ea.8b99f","type":"function","z":"9483f9cf.5222d8","name":"send text","func":"let longitude;\n let latitude;\n let name;\n let type;\n let message1 = 'you have an emergency!\\n';\n let message2 = ' is ';\n let message3 = '\\n Latitude: ';\n let message4 = '\\n longitude: ';\n \nlet item = msg.payload;\nmsg.payload = [];\n\n var i;\n\n name = item[\"name\"];\n type = item[\"type\"];\n longitude =item[\"lon\"];\n latitude= item[\"lat\"];\n \nmsg.payload = {}\n\n//family emergencies group 595264086, \n// open ID 1001297275903\n// personal ID is 935590830\nmsg.payload.chatId = -1001297275903;\nmsg.payload.type = 'message';\nmsg.payload.content = message1 + name + message2 + type + message3 + latitude + message4 + longitude;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1000,"y":500,"wires":[["38b2e01.c9d642"]]},{"id":"7e07a5f0.66496c","type":"switch","z":"9483f9cf.5222d8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":380,"wires":[["cb4816a0.0d1158"],["31fd743d.b496bc","282c3e1c.0ab7b2"]]},{"id":"cb4816a0.0d1158","type":"debug","z":"9483f9cf.5222d8","name":"empty!","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":790,"y":200,"wires":[]},{"id":"282c3e1c.0ab7b2","type":"debug","z":"9483f9cf.5222d8","name":"Full!","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":870,"y":240,"wires":[]},{"id":"5933fdea.cec3d4","type":"inject","z":"200c11bc.712fce","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"120","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":160,"wires":[["4bd2e2df.f9aa7c"]]},{"id":"4bd2e2df.f9aa7c","type":"function","z":"200c11bc.712fce","name":"CoT Hello","func":"const dt = Date.now();\nconst dtD = new Date(dt).toISOString();\nconst dtD5 = new Date(dt + 250000).toISOString();\n\nmsg.payload = {\n event: {\n \"$\": { \n version: \"2.0\", \n type: \"t-x-d-d\", \n uid : \"node-red\",\n time: dtD,\n start: dtD,\n stale: dtD5,\n how: \"m-g\"\n }\n }\n \n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":320,"y":160,"wires":[["5b9d9a93.9d7be4"]]},{"id":"5b9d9a93.9d7be4","type":"xml","z":"200c11bc.712fce","name":"","property":"payload","attr":"","chr":"","x":450,"y":160,"wires":[["be931fee.99f7b"]]},{"id":"22586e65.0be3c2","type":"comment","z":"200c11bc.712fce","name":"Keep Server Connection Alive","info":"","x":200,"y":120,"wires":[]},{"id":"be931fee.99f7b","type":"tcp request","z":"200c11bc.712fce","server":"204.48.30.216","port":"8087","out":"sit","splitc":" ","name":"FTS Server","x":590,"y":160,"wires":[["dcfd8c13.36d5"]]},{"id":"dcfd8c13.36d5","type":"function","z":"200c11bc.712fce","name":"buf->str","func":"let oldPayload = msg.payload;\nmsg.payload = oldPayload.toString();\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":740,"y":160,"wires":[["6a9a0012.7eabd"]]},{"id":"6a9a0012.7eabd","type":"xml","z":"200c11bc.712fce","name":"","property":"payload","attr":"","chr":"","x":870,"y":160,"wires":[["84789664.ba09f8"]]},{"id":"84789664.ba09f8","type":"function","z":"200c11bc.712fce","name":"CoT to Map","func":"/*\nThe following block of code transforms a JSONified CoT Event into a Worldmap \nPoint Payload.\n*/\n\nlet icon = null;\nlet invalid = \"9999999.0\";\nlet event = msg.payload[\"event\"];\n\n/* \nIf the CoT Event contains Detail Elements, extract the first one.\nIf there are no Detail Elements, break.\n*/\nlet _detail = event[\"detail\"];\nif (_detail === undefined) {\n return null;\n}\nlet detail = _detail[0];\n\n/*\nIf the CoT Event contains a Point element, use it. If not, break.\n*/\nlet point = event[\"point\"];\nif (point === undefined) {\n return null;\n}\n\n/* We'll use UID a couple of times, so lets set it as a variable here. */\nlet uid = event[\"$\"][\"uid\"];\n\n/* Extract the Event Type and Affiliation. */\nlet eventType = event[\"$\"][\"type\"];\net = eventType.split(\"-\");\nlet affil = et[1];\n\n/* There is no '.' notation in SDR, so mark Neutral. */\nif (affil.includes(\".\")) {\n affil = \"n\";\n} \n\n/* Ram the CoT Event Type portions into a SIDR Type */\nlet SIDC = `s${affil}${et[2]}p${et[3] || \"-\" }${et[4] || \"-\" }${et[5] || \"-\" }--------`;\n\n/* \nPoints on the Worldmap can only have one uniquite identifier, which is also\nthat Points display name. If possible, use a Callsign, otherwise use UID.\n*/\nlet callsign;\nlet _contact = detail[\"contact\"];\nif (_contact === undefined) {\n callsign = uid;\n} else {\n callsign = _contact[0][\"$\"][\"callsign\"]; \n}\n\n/* Mouse-over Label */\nlet label = `Callsign: ${callsign} UID: ${uid}<br/>Type: ${eventType} SIDC: ${SIDC}`\n\nlet remarks = detail[\"remarks\"];\nif (remarks) {\n remark = remarks[0][\"$\"];\n label = `${label}<br/>${remarks}`;\n}\n\nlet track = detail[\"track\"]\n\nbearing = null;\nspeed = null;\n\nif (track) {\n course = track[0][\"$\"][\"course\"];\n if (course) {\n if (course.toString() !== invalid && course.toString() !== \"0\") {\n bearing = course;\n }\n }\n\n _speed = track[0][\"$\"][\"speed\"];\n if (_speed) {\n if (_speed.toString() !== invalid) {\n speed = _speed;\n }\n }\n}\n\n/* \nIf CoT Point CE is set and is not invalid, use that as Worldmap Point Accuracy. \n*/\naccuracy = null;\nce = event[\"point\"][0][\"$\"][\"ce\"];\nif (ce.toString() !== invalid) {\n accuracy = ce;\n}\n\n/* Add a helpful weblink to Worldmap Points. */\nweblink = null;\nif (uid.includes(\"ICAO\")) {\n weblink = `https://globe.adsbexchange.com/?icao=${uid.replace(\"ICAO-\", \"\")}`;\n} else if (uid.includes(\"APRS\")) {\n weblink = `https://qrz.com/db/${uid.replace(\"APRS.\", \"\").split(\"-\")[0]}`;\n}\n\n/* Serialize as a Worldmap compatible Payload. */\nmsg.payload = {\n name: callsign,\n tooltip: label,\n lat: event[\"point\"][0][\"$\"][\"lat\"],\n lon: event[\"point\"][0][\"$\"][\"lon\"],\n speed: speed,\n bearing: bearing,\n accuracy: accuracy,\n SIDC: SIDC,\n icon: icon,\n ttl: 3600,\n weblink: weblink,\n layer: eventType\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1010,"y":160,"wires":[["7cf11924.aafee8","21f3e38f.ab8ecc"]]},{"id":"7cf11924.aafee8","type":"worldmap","z":"200c11bc.712fce","name":"TAK Map","lat":"45","lon":"-72","zoom":"9","layer":"OSM","cluster":"","maxage":"","usermenu":"show","layers":"show","panit":"false","panlock":"false","zoomlock":"false","hiderightclick":"false","coords":"deg","showgrid":"true","path":"/tak-map","x":1160,"y":160,"wires":[]},{"id":"f7a01771.45aa98","type":"comment","z":"200c11bc.712fce","name":"Connect to FTS","info":"","x":600,"y":120,"wires":[]},{"id":"8eb7f830.342298","type":"comment","z":"200c11bc.712fce","name":"Convert to Worldmap Payload","info":"","x":1060,"y":120,"wires":[]},{"id":"21f3e38f.ab8ecc","type":"debug","z":"200c11bc.712fce","name":"TAK map output","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1180,"y":220,"wires":[]},{"id":"71ec99cf.bfd928","type":"telegram receiver","z":"9483f9cf.5222d8","name":"","bot":"ce1eb260.b0f65","saveDataDir":"","filterCommands":false,"x":130,"y":440,"wires":[["3ccce5c9.7404ba","c361a90.7f6a358"],["abdcc1ba.13be6"]]},{"id":"abdcc1ba.13be6","type":"debug","z":"9483f9cf.5222d8","name":"no way!","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":360,"y":420,"wires":[]},{"id":"addb6aba.f6de08","type":"debug","z":"9483f9cf.5222d8","name":"REST emergency","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":480,"wires":[]},{"id":"347cc5c0.932a3a","type":"function","z":"9483f9cf.5222d8","name":"Emergency message","func":"if(msg.payload.type='location') \n{\n var latitude = msg.payload.content.latitude;\n var longitude = msg.payload.content.longitude;\n // var name = msg.payload.from.username;\n var name=msg.originalMessage.from.username;\n var emergencyType= \"In Contact\";\n msg.payload={name, emergencyType, latitude, longitude };\n return msg;\n}\nelse \n{\n return null;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":460,"y":560,"wires":[["addb6aba.f6de08","f057f34.3744c1"]]},{"id":"3ccce5c9.7404ba","type":"debug","z":"9483f9cf.5222d8","name":"original telegram","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":370,"y":360,"wires":[]},{"id":"f057f34.3744c1","type":"http request","z":"9483f9cf.5222d8","name":"Post emergency to FTS","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://204.48.30.216:19023/ManageEmergency/postEmergency","tls":"","persist":false,"proxy":"","authType":"bearer","x":730,"y":560,"wires":[["e43df410.cc0178"]]},{"id":"e43df410.cc0178","type":"debug","z":"9483f9cf.5222d8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":970,"y":560,"wires":[]},{"id":"c361a90.7f6a358","type":"switch","z":"9483f9cf.5222d8","name":"switch message types","property":"payload.type","propertyType":"msg","rules":[{"t":"eq","v":"location","vt":"str"},{"t":"eq","v":"message","vt":"str"},{"t":"eq","v":"document","vt":"str"},{"t":"eq","v":"photo","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":5,"x":180,"y":600,"wires":[["347cc5c0.932a3a"],["34f1124b.87728e"],["ca15e3.2438ca2"],["43068b9.9986274"],["ff07e0fd.4b97d"]]},{"id":"3dabbf8c.2ec5d","type":"http request","z":"9483f9cf.5222d8","name":"Post Chat to FTS","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://204.48.30.216:19023/ManageChat/postChatToAll","tls":"","persist":false,"proxy":"","authType":"bearer","x":670,"y":660,"wires":[[]]},{"id":"34f1124b.87728e","type":"function","z":"9483f9cf.5222d8","name":"Chat Message","func":"if(msg.payload.type='message') \n{\n\n // var name = msg.payload.from.username;\n var sender=msg.originalMessage.from.username;\n //var message= msg.payload.text;\n var message= msg.originalMessage.text\n msg.payload={sender, message};\n return msg;\n}\nelse \n{\n return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":440,"y":620,"wires":[["3dabbf8c.2ec5d","bfb1d51d.f05d48"]]},{"id":"ff07e0fd.4b97d","type":"debug","z":"9483f9cf.5222d8","name":"otherwise","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":420,"y":880,"wires":[]},{"id":"bfb1d51d.f05d48","type":"debug","z":"9483f9cf.5222d8","name":"REST chat","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":650,"y":620,"wires":[]},{"id":"91c4dd78.bbc41","type":"catch","z":"5ef53777.338c68","name":"","scope":null,"uncaught":false,"x":160,"y":820,"wires":[["cc3e1698.bff4d8"]]},{"id":"cc3e1698.bff4d8","type":"debug","z":"5ef53777.338c68","name":"WW emergency exception","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":430,"y":820,"wires":[]},{"id":"d9c296bf.e0bc78","type":"catch","z":"9483f9cf.5222d8","name":"","scope":null,"uncaught":false,"x":140,"y":960,"wires":[["f8ec606d.b2a3c"]]},{"id":"f8ec606d.b2a3c","type":"debug","z":"9483f9cf.5222d8","name":"TelegramTAK exception","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":410,"y":980,"wires":[]},{"id":"fb044294.ea083","type":"switch","z":"5ef53777.338c68","name":"check retunr","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"str"},{"t":"eq","v":"500","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1190,"y":740,"wires":[["8e6f53c.31e5cb"],["b3c266ba.64b8b8"]]},{"id":"8e6f53c.31e5cb","type":"debug","z":"5ef53777.338c68","name":"Success!","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1380,"y":700,"wires":[]},{"id":"b3c266ba.64b8b8","type":"debug","z":"5ef53777.338c68","name":" INTERNAL SERVER ERROR","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1430,"y":800,"wires":[]},{"id":"ca15e3.2438ca2","type":"debug","z":"9483f9cf.5222d8","name":"Document","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":430,"y":800,"wires":[]},{"id":"43068b9.9986274","type":"function","z":"9483f9cf.5222d8","name":"Prepare Get Photo URL","func":"var photo = msg.originalMessage.photo;\nmsg.file_id = photo[photo.length-1].file_id; // get the largest photo\nmsg.token = '1757672189:AAE_DyNuf6W6_1zS022flyoAZC79voowDwo';\nmsg.sender=msg.originalMessage.from.username;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":470,"y":720,"wires":[["332e3358.ecad9c"]]},{"id":"332e3358.ecad9c","type":"http request","z":"9483f9cf.5222d8","name":"Get Photo URL","method":"GET","ret":"obj","url":"https://api.telegram.org/bot{{{token}}}/getFile?file_id={{{file_id}}}","tls":"","x":680,"y":720,"wires":[["cb8a878.4117778"]]},{"id":"cb8a878.4117778","type":"function","z":"9483f9cf.5222d8","name":"Set to payload","func":"msg.url = 'https://api.telegram.org/file/bot' + msg.token + '/' + msg.payload.result.file_path;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":680,"y":780,"wires":[["bcd35beb.a663f8"]]},{"id":"bcd35beb.a663f8","type":"http request","z":"9483f9cf.5222d8","name":"request telegram pic","method":"GET","ret":"bin","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":940,"y":720,"wires":[["1a6a99cd.e4a7f6","11c4318c.b1140e"]]},{"id":"1a6a99cd.e4a7f6","type":"zip","z":"9483f9cf.5222d8","name":"zip image","mode":"compress","filename":"{{{sender}}}.zip","outasstring":false,"x":900,"y":840,"wires":[["7b169f63.f31f6","ed0ce7c.7b23018"]]},{"id":"5d06817e.18776","type":"http request","z":"9483f9cf.5222d8","name":"Post zip to FTS","method":"POST","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"bearer","x":1360,"y":760,"wires":[["1fcad081.e5beff"]]},{"id":"1fcad081.e5beff","type":"switch","z":"9483f9cf.5222d8","name":"check return","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"str"},{"t":"eq","v":"500","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1410,"y":580,"wires":[["ed2e7816.6ccef8"],["7af81310.be8d7c"],["f8c04286.3a18d"]]},{"id":"ed2e7816.6ccef8","type":"debug","z":"9483f9cf.5222d8","name":"Success!","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1620,"y":560,"wires":[]},{"id":"7af81310.be8d7c","type":"debug","z":"9483f9cf.5222d8","name":" INTERNAL SERVER ERROR","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1670,"y":620,"wires":[]},{"id":"f8c04286.3a18d","type":"debug","z":"9483f9cf.5222d8","name":"Issue","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1650,"y":720,"wires":[]},{"id":"7b169f63.f31f6","type":"debug","z":"9483f9cf.5222d8","name":"zip file","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":890,"y":920,"wires":[]},{"id":"dc639ad4.af61e8","type":"function","z":"9483f9cf.5222d8","name":"","func":"msg.headers = {};\nmsg.headers['X-Auth-User'] = 'mike';\nmsg.headers['X-Auth-Key'] = 'fred-key';\nreturn msg;\n\n// bytestreamvar.toString()\n\n//Content-Disposition: form-data\n//name=\\\"assetfile\\\";\n//filename=\\\"[PROXY]\\\n\nvar fs = require('fs');\n\n\nvar req = https.request(options, function (res) {\n var chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function (chunk) {\n var body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n\n res.on(\"error\", function (error) {\n console.error(error);\n });\n});\n\nvar postData = \"------WebKitFormBoundary7MA4YWxkTrZu0gW\\r\\nContent-Disposition: form-data; name=\\\"assetfile\\\"; filename=\\\"[PROXY]\\\"\\r\\nContent-Type: \\\"{Insert_File_Content_Type}\\\"\\r\\n\\r\\n\" + fs.readFileSync('js1PzqL0n/FEMA Icons.zip') + \"\\r\\n------WebKitFormBoundary7MA4YWxkTrZu0gW--\";\n\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1140,"y":900,"wires":[[]]},{"id":"bff79629.6e1058","type":"inject","z":"7b06f04.b04ce1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":120,"wires":[["36a0a31e.976bcc"]]},{"id":"36a0a31e.976bcc","type":"http request","z":"7b06f04.b04ce1","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://3.211.208.147:804/SSNA_GP_Repository_TOGAF/oslc/am/qc/?oslc.where=dcterms:type=\"Actor\"","tls":"","persist":false,"proxy":"","authType":"","x":290,"y":120,"wires":[["88f6c359.0273b"]]},{"id":"88f6c359.0273b","type":"xml","z":"7b06f04.b04ce1","name":"","property":"payload","attr":"","chr":"","x":470,"y":120,"wires":[["ee20b7be.cca8c8"]]},{"id":"74eade68.f5ab1","type":"debug","z":"7b06f04.b04ce1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1050,"y":520,"wires":[]},{"id":"ed0ce7c.7b23018","type":"function","z":"9483f9cf.5222d8","name":"test DP postdata gen","func":"const request = global.get('request')\n//const fs = global.get('fs')\nconst serverip = '204.48.30.216'\nconst serverport = '19023'\n\nrequest.post({\n\n 'url': `http://${serverip}:${serverport}/DataPackageTable?filename=${msg.name}`,\n 'formData': {\n 'assetfile': {\n //'value': fs.readFileSync(\"/root/example.zip\"),\n 'value': msg.payload,\n 'options': {\n 'filename': 'example',\n 'contentType': \"application/x-zip-compressed\"\n }\n }\n },\n 'headers': {\n 'Authorization': 'Bearer token'\n },\n 'maxRedirects': 20\n}, function(error, response, body) {\n msg.payload = body\n //console.log(body)\n return msg\n});","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1160,"y":820,"wires":[["a5cfc01c.77dc5","5d06817e.18776"]]},{"id":"a5cfc01c.77dc5","type":"debug","z":"9483f9cf.5222d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1390,"y":820,"wires":[]},{"id":"527a0337.e9e60c","type":"telegram sender","z":"65930269.15cc9c","name":"","bot":"ce1eb260.b0f65","haserroroutput":false,"outputs":1,"x":1270,"y":440,"wires":[[]]},{"id":"5dc32ad4.f69da4","type":"inject","z":"65930269.15cc9c","name":"every 10 minutes","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"600","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":140,"wires":[["a8841cc3.b2a3"]]},{"id":"94eac137.12f37","type":"function","z":"65930269.15cc9c","name":"send location","func":"let longitude;\n let latitude;\n let name;\n let type;\n let message1 = 'you have an emergency!\\n';\n let message2 = ' is ';\n let message3 = '\\n Latitude: ';\n let message4 = '\\n longitude: ';\n \nlet item = msg.payload;\nmsg.payload = [];\n\n var i;\n\n name = item[\"name\"];\n type = item[\"type\"];\n longitude =item[\"lon\"];\n latitude= item[\"lat\"];\n \nmsg.payload = {}\n\n//family emergencies group 595264086, \n// open ID 1001297275903\n// personal ID is 935590830\nmsg.payload.chatId = -1001297275903;\n//msg.payload.type = 'message';\nmsg.payload.type = 'location';\n//msg.payload.content = message1 + name + message2 + type + message3 + latitude + message4 + longitude;\nmsg.payload.content={\n 'longitude': longitude,\n 'latitude': latitude\n };\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":990,"y":400,"wires":[["527a0337.e9e60c","4ba9fda5.a6c0a4"]]},{"id":"a8841cc3.b2a3","type":"http request","z":"65930269.15cc9c","name":"Get emergencies","method":"GET","ret":"txt","paytoqs":"ignore","url":"204.48.30.216:19023//ManageEmergency/getEmergency","tls":"","persist":false,"proxy":"","authType":"bearer","x":270,"y":260,"wires":[["54bac6d2.534fa8"]]},{"id":"54bac6d2.534fa8","type":"json","z":"65930269.15cc9c","name":"transform to Json","property":"payload","action":"","pretty":false,"x":510,"y":180,"wires":[["d8312c48.46df7","c45a3e91.decab"]]},{"id":"d8312c48.46df7","type":"debug","z":"65930269.15cc9c","name":"Json Payload","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":720,"y":80,"wires":[]},{"id":"c45a3e91.decab","type":"split","z":"65930269.15cc9c","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":490,"y":300,"wires":[["2ad6b66e.507eaa","10854496.29664b"]]},{"id":"2ad6b66e.507eaa","type":"debug","z":"65930269.15cc9c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":790,"y":140,"wires":[]},{"id":"4ba9fda5.a6c0a4","type":"debug","z":"65930269.15cc9c","name":"after function","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1190,"y":320,"wires":[]},{"id":"c50a8457.29c528","type":"split","z":"65930269.15cc9c","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":830,"y":440,"wires":[["94eac137.12f37","9f131823.c13a48"]]},{"id":"9f131823.c13a48","type":"function","z":"65930269.15cc9c","name":"send text","func":"let longitude;\n let latitude;\n let name;\n let type;\n let message1 = 'you have an emergency!\\n';\n let message2 = ' is ';\n let message3 = '\\n Latitude: ';\n let message4 = '\\n longitude: ';\n \nlet item = msg.payload;\nmsg.payload = [];\n\n var i;\n\n name = item[\"name\"];\n type = item[\"type\"];\n longitude =item[\"lon\"];\n latitude= item[\"lat\"];\n \nmsg.payload = {}\n\n//family emergencies group 595264086, \n// open ID 1001297275903\n// personal ID is 935590830\nmsg.payload.chatId = -1001297275903;\nmsg.payload.type = 'message';\nmsg.payload.content = message1 + name + message2 + type + message3 + latitude + message4 + longitude;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1000,"y":500,"wires":[["527a0337.e9e60c"]]},{"id":"10854496.29664b","type":"switch","z":"65930269.15cc9c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":380,"wires":[["e9d37ecc.a0f7e"],["c50a8457.29c528","52558b56.b545a4"]]},{"id":"e9d37ecc.a0f7e","type":"debug","z":"65930269.15cc9c","name":"empty!","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":790,"y":200,"wires":[]},{"id":"52558b56.b545a4","type":"debug","z":"65930269.15cc9c","name":"Full!","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":870,"y":240,"wires":[]},{"id":"944c2260.00c8","type":"telegram receiver","z":"65930269.15cc9c","name":"","bot":"ce1eb260.b0f65","saveDataDir":"","filterCommands":false,"x":130,"y":440,"wires":[["dff2b0fd.79b22","b49c9910.d6e7d8"],["395d01ff.503aae"]]},{"id":"395d01ff.503aae","type":"debug","z":"65930269.15cc9c","name":"no way!","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":360,"y":400,"wires":[]},{"id":"39315d29.071eb2","type":"debug","z":"65930269.15cc9c","name":"REST emergency","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":480,"wires":[]},{"id":"986f6f30.6df84","type":"function","z":"65930269.15cc9c","name":"Emergency message","func":"if(msg.payload.type='location') \n{\n var latitude = msg.payload.content.latitude;\n var longitude = msg.payload.content.longitude;\n // var name = msg.payload.from.username;\n var name=msg.originalMessage.from.username;\n var emergencyType= \"In Contact\";\n msg.payload={name, emergencyType, latitude, longitude };\n return msg;\n}\nelse \n{\n return null;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":460,"y":560,"wires":[["39315d29.071eb2","84068f.3371697"]]},{"id":"dff2b0fd.79b22","type":"debug","z":"65930269.15cc9c","name":"original","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":340,"y":340,"wires":[]},{"id":"84068f.3371697","type":"http request","z":"65930269.15cc9c","name":"Post emergency to FTS","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://204.48.30.216:19023/ManageEmergency/postEmergency","tls":"","persist":false,"proxy":"","authType":"bearer","x":730,"y":560,"wires":[["3c5d43c7.1ad6cc"]]},{"id":"3c5d43c7.1ad6cc","type":"debug","z":"65930269.15cc9c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":970,"y":560,"wires":[]},{"id":"b49c9910.d6e7d8","type":"switch","z":"65930269.15cc9c","name":"switch message types","property":"payload.type","propertyType":"msg","rules":[{"t":"eq","v":"location","vt":"str"},{"t":"eq","v":"message","vt":"str"},{"t":"eq","v":"document","vt":"str"},{"t":"eq","v":"photo","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":5,"x":180,"y":600,"wires":[["986f6f30.6df84"],["571fd398.5c4f7c"],["4f045dbf.8418c4"],["7ee7ca83.178104"],["f1f2a71d.7dfe48"]]},{"id":"285ab342.0e00fc","type":"http request","z":"65930269.15cc9c","name":"Post Chat to FTS","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://204.48.30.216:19023/ManageChat/postChatToAll","tls":"","persist":false,"proxy":"","authType":"bearer","x":670,"y":660,"wires":[[]]},{"id":"571fd398.5c4f7c","type":"function","z":"65930269.15cc9c","name":"Chat Message","func":"if(msg.payload.type='message') \n{\n\n // var name = msg.payload.from.username;\n var sender=msg.originalMessage.from.username;\n //var message= msg.payload.text;\n var message= msg.originalMessage.text\n msg.payload={sender, message};\n return msg;\n}\nelse \n{\n return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":440,"y":620,"wires":[["285ab342.0e00fc","d88c8cfc.eac9e"]]},{"id":"f1f2a71d.7dfe48","type":"debug","z":"65930269.15cc9c","name":"otherwise","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":420,"y":880,"wires":[]},{"id":"d88c8cfc.eac9e","type":"debug","z":"65930269.15cc9c","name":"REST chat","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":650,"y":620,"wires":[]},{"id":"e0c52793.956cc8","type":"catch","z":"65930269.15cc9c","name":"","scope":null,"uncaught":false,"x":140,"y":960,"wires":[["70a8bc92.516f04"]]},{"id":"70a8bc92.516f04","type":"debug","z":"65930269.15cc9c","name":"TelegramTAK exception","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":410,"y":980,"wires":[]},{"id":"4f045dbf.8418c4","type":"debug","z":"65930269.15cc9c","name":"Document","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":430,"y":800,"wires":[]},{"id":"7ee7ca83.178104","type":"function","z":"65930269.15cc9c","name":"Prepare Get Photo URL","func":"var photo = msg.originalMessage.photo;\nmsg.file_id = photo[photo.length-1].file_id; // get the largest photo\nmsg.token = '1757672189:AAE_DyNuf6W6_1zS022flyoAZC79voowDwo';\nmsg.sender=msg.originalMessage.from.username;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":470,"y":720,"wires":[["48f478f2.e6f9c8"]]},{"id":"48f478f2.e6f9c8","type":"http request","z":"65930269.15cc9c","name":"Get Photo URL","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://api.telegram.org/bot{{{token}}}/getFile?file_id={{{file_id}}}","tls":"","persist":false,"proxy":"","authType":"","x":680,"y":720,"wires":[["40380834.cfcc58","c28a3fe9.70a2c"]]},{"id":"c28a3fe9.70a2c","type":"function","z":"65930269.15cc9c","name":"Set to payload","func":"msg.filename = msg.payload.result.file_path.split('/')[1]\nmsg.url = 'https://api.telegram.org/file/bot' + msg.token + '/' + msg.payload.result.file_path;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":680,"y":780,"wires":[["3861a165.06e53e"]]},{"id":"3861a165.06e53e","type":"http request","z":"65930269.15cc9c","name":"request telegram pic","method":"GET","ret":"bin","paytoqs":"ignore","url":"https://api.telegram.org/file/bot1757672189:AAE_DyNuf6W6_1zS022flyoAZC79voowDwo/photos/file_15.jpg","tls":"6ab2056f.fa1a6c","persist":false,"proxy":"","authType":"","x":940,"y":720,"wires":[["32145f92.cd646"]]},{"id":"32145f92.cd646","type":"zip","z":"65930269.15cc9c","name":"natha test","mode":"compress","filename":"","outasstring":false,"x":980,"y":780,"wires":[["c9475ca5.9007","8352b69a.412d78"]]},{"id":"ee621fc8.4165f","type":"http request","z":"65930269.15cc9c","name":"Post zip to FTS","method":"POST","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"bearer","x":1260,"y":640,"wires":[["11fee39b.ff9c9c"]]},{"id":"11fee39b.ff9c9c","type":"switch","z":"65930269.15cc9c","name":"check return","property":"payload.statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"str"},{"t":"eq","v":"500","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1370,"y":720,"wires":[["ce459063.e3e26"],["193a758d.e998ba"],["739d6f4a.5224c"]]},{"id":"ce459063.e3e26","type":"debug","z":"65930269.15cc9c","name":"Success!","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1580,"y":680,"wires":[]},{"id":"193a758d.e998ba","type":"debug","z":"65930269.15cc9c","name":" INTERNAL SERVER ERROR","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1650,"y":720,"wires":[]},{"id":"739d6f4a.5224c","type":"debug","z":"65930269.15cc9c","name":"Issue","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1580,"y":780,"wires":[]},{"id":"a000b978.bbdfa8","type":"function","z":"65930269.15cc9c","name":"","func":"msg.headers = {};\nmsg.headers['X-Auth-User'] = 'mike';\nmsg.headers['X-Auth-Key'] = 'fred-key';\nreturn msg;\n\n// bytestreamvar.toString()\n\n//Content-Disposition: form-data\n//name=\\\"assetfile\\\";\n//filename=\\\"[PROXY]\\\n\nvar fs = require('fs');\n\n\nvar req = https.request(options, function (res) {\n var chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function (chunk) {\n var body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n\n res.on(\"error\", function (error) {\n console.error(error);\n });\n});\n\nvar postData = \"------WebKitFormBoundary7MA4YWxkTrZu0gW\\r\\nContent-Disposition: form-data; name=\\\"assetfile\\\"; filename=\\\"[PROXY]\\\"\\r\\nContent-Type: \\\"{Insert_File_Content_Type}\\\"\\r\\n\\r\\n\" + fs.readFileSync('js1PzqL0n/FEMA Icons.zip') + \"\\r\\n------WebKitFormBoundary7MA4YWxkTrZu0gW--\";\n\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1120,"y":1020,"wires":[[]]},{"id":"8352b69a.412d78","type":"function","z":"65930269.15cc9c","name":"test DP postdata gen","func":"const request = global.get('request')\nconst fs = global.get('fs')\nconst serverip = '204.48.30.216'\nconst serverport = '19023'\nconsole.log(\"running\")\ntry{\n var name = msg.filename.split('.')\n name.pop()\n name = name.join('.')+'.zip'\n console.log(name)\nvar options = {\n 'method': 'POST',\n 'url': `http://204.48.30.216:19023/DataPackageTable?filename=${name}`,\n 'headers': {\n 'Authorization': 'Bearer token'\n },\n formData: {\n 'assetfile': {\n 'value': msg.payload,\n //'value': fs.readFileSync(\"/root/example.txt\"),\n\n 'options': {\n 'filename': name,\n 'contentType': \"application/x-zip-compressed\"\n }\n }\n }\n};\nconsole.log(\"making request\")\nawait request(options, function (error, response) {\n if (error) throw new Error(error);\n //console.log(response)\n msg.payload = response\n node.send(msg)\n node.done()\n node.log(\"done\")\n});\nreturn;\n}\ncatch(err){\n console.log('error encountered')\n console.log(err)\n msg.payload = err\n return msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1240,"y":820,"wires":[["11fee39b.ff9c9c"]]},{"id":"60ea6288.100f6c","type":"inject","z":"65930269.15cc9c","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":770,"y":1080,"wires":[[]]},{"id":"d5fc4964.bc7b98","type":"debug","z":"65930269.15cc9c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1450,"y":1020,"wires":[]},{"id":"65624570.1d2afc","type":"zip","z":"65930269.15cc9c","name":"","mode":"decompress","filename":"","outasstring":true,"x":1270,"y":1020,"wires":[["d5fc4964.bc7b98"]]},{"id":"ee20b7be.cca8c8","type":"split","z":"7b06f04.b04ce1","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":610,"y":120,"wires":[["cdb1b735.af6f28"]]},{"id":"cdb1b735.af6f28","type":"split","z":"7b06f04.b04ce1","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":630,"y":180,"wires":[["d040d9b.f3f6928"]]},{"id":"d040d9b.f3f6928","type":"split","z":"7b06f04.b04ce1","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":610,"y":240,"wires":[["6e44f371.3febdc"]]},{"id":"6e44f371.3febdc","type":"split","z":"7b06f04.b04ce1","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":590,"y":300,"wires":[["c055f750.5d6138"]]},{"id":"c055f750.5d6138","type":"split","z":"7b06f04.b04ce1","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":590,"y":360,"wires":[["b3ea366f.07a1f8"]]},{"id":"b3ea366f.07a1f8","type":"split","z":"7b06f04.b04ce1","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":590,"y":420,"wires":[["afb4c059.252be"]]},{"id":"afb4c059.252be","type":"split","z":"7b06f04.b04ce1","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":570,"y":480,"wires":[["8f0dee78.50ab6"]]},{"id":"966e68b7.ae3398","type":"catch","z":"7b06f04.b04ce1","name":"","scope":null,"uncaught":false,"x":280,"y":660,"wires":[["53ed94da.909c7c"]]},{"id":"53ed94da.909c7c","type":"debug","z":"7b06f04.b04ce1","name":"error","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":510,"y":660,"wires":[]},{"id":"ccce688c.36cc68","type":"csv","z":"7b06f04.b04ce1","name":"","sep":",","hdrin":"","hdrout":"none","multi":"mult","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":890,"y":520,"wires":[["74eade68.f5ab1"]]},{"id":"8f0dee78.50ab6","type":"function","z":"7b06f04.b04ce1","name":"","func":" let about;\n let title;\n let type ;\n let uid;\n let creator;\n let created;\n let modified;\n let status;\n let complexity;\n let phase;\n let version;\n let language;\n \nlet item = msg.payload;\nmsg.payload = [];\n\n title = item[\"dcterms:title\"][0];\n type= item[\"dcterms:type\"][0];\n uid= item[\"dcterms:identifier\"][0];\n creator= item[\"dcterms:creator\"][0];\n created= item[\"dcterms:created\"][0];\n modified= item[\"dcterms:modified\"][0];\n status= item[\"ss:status\"][0];\n complexity= item[\"ss:complexity\"][0];\n phase= item[\"ss:phase\"][0];\n version= item[\"ss:version\"][0];\n language= item[\"ss:language\"][0];\n \n\n \n msg.payload={\n title: title,\n type: type,\n uid: uid,\n creator: creator,\n created: created,\n modified: modified,\n status: status,\n complexity: complexity,\n phase: phase,\n version: version,\n language: language\n }\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":740,"y":520,"wires":[["ccce688c.36cc68"]]},{"id":"2759b5b1.ce0a3a","type":"join","z":"7b06f04.b04ce1","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":730,"y":580,"wires":[[]]},{"id":"5264064b.0fa978","type":"http response","z":"7b06f04.b04ce1","name":"","statusCode":"","headers":{},"x":1060,"y":600,"wires":[]},{"id":"40380834.cfcc58","type":"debug","z":"65930269.15cc9c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":900,"y":660,"wires":[]},{"id":"bcfc2504.dce228","type":"inject","z":"65930269.15cc9c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":660,"y":1000,"wires":[["6f079416.e5f33c"]]},{"id":"6f079416.e5f33c","type":"http request","z":"65930269.15cc9c","name":"ex","method":"GET","ret":"bin","paytoqs":"ignore","url":"https://api.telegram.org/file/bot1757672189:AAE_DyNuf6W6_1zS022flyoAZC79voowDwo/photos/file_13.jpg","tls":"","persist":false,"proxy":"","authType":"","x":650,"y":900,"wires":[["c2971b85.8619c8"]]},{"id":"c2971b85.8619c8","type":"debug","z":"65930269.15cc9c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":900,"y":980,"wires":[]},{"id":"c9475ca5.9007","type":"debug","z":"65930269.15cc9c","name":"zip payload","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1040,"y":880,"wires":[]},{"id":"11c4318c.b1140e","type":"debug","z":"9483f9cf.5222d8","name":"picture","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1060,"y":640,"wires":[]},{"id":"e0ba879a.419e08","type":"function","z":"7b06f04.b04ce1","name":"send OSLC raw query","func":"let aurl= 'http://3.211.208.147';\nlet port= ':804/';\nlet repository = 'SSNA_GP_Repository_TOGAF';\nlet oslcfunction= '/oslc/am/raw/';\n\nlet xmlPref= `<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:ss=\"http://www.sparxsystems.com.au/oslc_am#\"> \n <ss:rawquery>\n <ss:query>`;\nlet xmlSuf=`</ss:query>\n </ss:rawquery>\n </rdf:RDF>`\n\n// test query\nlet query= `SELECT SUM(CAST(cost_prop.Value as Int)) AS cost, tam_app.Name AS Application\nFROM t_object AS app\nINNER JOIN t_objectproperties AS cost_prop ON cost_prop.Object_ID = app.Object_ID\nINNER JOIN t_objectproperties AS type_prop ON type_prop.Object_ID = app.Object_ID\nINNER JOIN t_objectproperties AS maint_prop ON maint_prop.Object_ID = app.Object_ID\nINNER JOIN t_connector AS conn ON conn.Start_Object_ID = app.Object_ID\nINNER JOIN t_object AS tam_app ON conn.End_Object_ID = tam_app.Object_ID\nWHERE app.Stereotype = ('dApplicationComponent') \nAND cost_prop.Property = ('Cost')\nAND tam_app.Stereotype = ('dCapability') \nGROUP BY tam_app.name;\n`;\nquery = msg.payload;\n\nmsg.url = aurl + port + repository + oslcfunction;\nmsg.payload = xmlPref + query + xmlSuf;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":550,"y":760,"wires":[["f06f89c0.f072a8","eda4dabd.aa7eb8"]]},{"id":"f06f89c0.f072a8","type":"http request","z":"7b06f04.b04ce1","name":"","method":"POST","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":770,"y":760,"wires":[["ecc6b824.a44598"]]},{"id":"e5cd4e98.c253c","type":"inject","z":"7b06f04.b04ce1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":310,"y":780,"wires":[["e0ba879a.419e08"]]},{"id":"e63aa9e7.4a8df8","type":"debug","z":"7b06f04.b04ce1","name":"JSPN result","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1110,"y":700,"wires":[]},{"id":"eda4dabd.aa7eb8","type":"debug","z":"7b06f04.b04ce1","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":780,"y":700,"wires":[]},{"id":"ecc6b824.a44598","type":"xml","z":"7b06f04.b04ce1","name":"","property":"payload","attr":"","chr":"","x":960,"y":820,"wires":[["e63aa9e7.4a8df8","c459370c.545d38"]]},{"id":"c459370c.545d38","type":"function","z":"7b06f04.b04ce1","name":"","func":"let columns = msg.payload[\"rdf:RDF\"][\"rdf:Description\"][0][\"ss:rows\"][0][\"rdf:Description\"][0][\"rdfs:member\"]\nmsg.payload = [];\nmsg.payload = columns;\n\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":760,"y":920,"wires":[["ce191316.ff847"]]},{"id":"ce191316.ff847","type":"split","z":"7b06f04.b04ce1","name":"","splt":"","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":930,"y":980,"wires":[["6de2044c.55063c","eaf24f9a.6193a"]]},{"id":"f5ea03f2.75fa","type":"split","z":"7b06f04.b04ce1","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1270,"y":840,"wires":[[]]},{"id":"f2818af2.df1d08","type":"debug","z":"7b06f04.b04ce1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1530,"y":1200,"wires":[]},{"id":"cdf00374.b6c0d","type":"csv","z":"7b06f04.b04ce1","name":"","sep":",","hdrin":"","hdrout":"all","multi":"one","ret":"\\n","temp":"col1, col2","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":1390,"y":1000,"wires":[[]]},{"id":"6de2044c.55063c","type":"function","z":"7b06f04.b04ce1","name":"","func":"let col1 = msg.payload[\"ss:row\"][0][\"ss:column1\"][0];\nlet col2 = msg.payload[\"ss:row\"][0][\"ss:column2\"][0];\nmsg.payload={col1: col1,\n col2: col2};\n \nmsg.headers = {};\nmsg.headers['Content-Type']='application/json';\n\n//forEach((payload[\"ss:row\"]) => { let msg.xx${i+1} = msg.payload[\"ss:row\"][0][`ss:column${i+1}`]})\n\n\nreturn msg;\n\n\n//","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1060,"y":1020,"wires":[["cd7a3e38.35d47"]]},{"id":"cd7a3e38.35d47","type":"join","z":"7b06f04.b04ce1","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":1220,"y":1080,"wires":[["de23a811.e270f8"]]},{"id":"fd7bff34.44a8d","type":"http response","z":"7b06f04.b04ce1","name":"","statusCode":"","headers":{},"x":1550,"y":1060,"wires":[]},{"id":"f7bfb44c.807fe8","type":"http in","z":"7b06f04.b04ce1","name":"","url":"/oslc","method":"post","upload":false,"swaggerDoc":"","x":280,"y":840,"wires":[["e0ba879a.419e08"]]},{"id":"3e1c5107.c1e3ae","type":"http in","z":"df714a46.435838","name":"","url":"/hello-raw","method":"post","swaggerDoc":"","x":320,"y":160,"wires":[["cf679478.309868"]]},{"id":"cf679478.309868","type":"template","z":"df714a46.435838","name":"page","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n <head></head>\n <body>\n <h1>Hello {{ payload }}!</h1>\n </body>\n</html>","x":490,"y":160,"wires":[["f3c1a3f0.0c3e6"]]},{"id":"f3c1a3f0.0c3e6","type":"http response","z":"df714a46.435838","name":"","x":630,"y":160,"wires":[]},{"id":"eaf24f9a.6193a","type":"debug","z":"7b06f04.b04ce1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1080,"y":940,"wires":[]},{"id":"de23a811.e270f8","type":"json","z":"7b06f04.b04ce1","name":"","property":"payload","action":"obj","pretty":false,"x":1340,"y":1160,"wires":[["f2818af2.df1d08","fd7bff34.44a8d"]]}]