Created
October 22, 2024 05:36
-
-
Save ShaneDunn/1920e075abe5bd68757cad2636cc5d4c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "id": "667fdf0f9a80a951", | |
| "type": "tab", | |
| "label": "GrapeWeb v3", | |
| "disabled": false, | |
| "info": "", | |
| "env": [] | |
| }, | |
| { | |
| "id": "8f9f280777c8d621", | |
| "type": "comment", | |
| "z": "667fdf0f9a80a951", | |
| "name": "jobs", | |
| "info": "\n# Fields\nid,firebase_key,connect_with,type,external_id,type_category,client_id,client_name,scheduled_start_time,scheduled_end_time,actual_start_time,actual_end_time,name,address,notes,map_id,status,created_at,updated_at,implement_id,areas,create_user,planted_distance,spread_width,origin_width,contact,phone,actual_rate_used,average_pressure,average_ground_speed,tanks,average_speed,additional_time_in_hr,estimated_time_in_hr,requested_date,overdue_date,additional_ha_covered,group_id,grapelink_block_id,grapelink_spray_width,grapeweb_job_id,grapeweb_winery_block_id,firebase_sync_at,captured_fields,customer_user\n\n# Example Schema\n{\n \"current_page\": 0,\n \"from\": 0,\n \"next_page_url\": \"string\",\n \"per_page\": 0,\n \"prev_page_url\": \"string\",\n \"to\": 0,\n \"data\": [\n {\n \"created_at\": \"2023-06-06T10:25:18.087Z\",\n \"updated_at\": \"2023-06-06T10:25:18.087Z\",\n \"id\": 0,\n \"name\": \"string\",\n \"actual_end_time\": \"2023-06-06T10:25:18.087Z\",\n \"actual_start_time\": \"2023-06-06T10:25:18.087Z\",\n \"actual_rate_used\": 0,\n \"additional_ha_covered\": 0,\n \"additional_time_in_hr\": 0,\n \"address\": \"string\",\n \"areas\": 0,\n \"average_ground_speed\": 0,\n \"average_speed\": 0,\n \"average_pressure\": 0,\n \"client_id\": 0,\n \"client_name\": \"string\",\n \"contact\": \"string\",\n \"create_user\": 0,\n \"estimated_time_in_hr\": 0,\n \"external_id\": \"string\",\n \"group_id\": 0,\n \"map_id\": 0,\n \"notes\": \"string\",\n \"origin_width\": 0,\n \"overdue_date\": \"2023-06-06T10:25:18.087Z\",\n \"phone\": \"string\",\n \"planted_distance\": 0,\n \"requested_date\": \"2023-06-06T10:25:18.087Z\",\n \"scheduled_end_time\": \"2023-06-06T10:25:18.087Z\",\n \"scheduled_start_time\": \"2023-06-06T10:25:18.087Z\",\n \"spread_width\": 0,\n \"status\": \"saved\",\n \"tanks\": 0,\n \"type\": 0,\n \"type_category\": 0,\n \"implement_id\": 0,\n \"captured_fields\": [\n {\n \"field\": \"string\",\n \"value\": \"string\"\n }\n ]\n }\n ]\n}\n\n# Actual Output\n{\n \"per_page\": 20,\n \"current_page\": 1,\n \"next_page_url\": \"https://nupointonline.com/v2/jobs/?page=2\",\n \"prev_page_url\": null,\n \"from\": 1,\n \"to\": 20,\n \"data\": [\n {\n \"id\": 214375,\n \"firebase_key\": \"org/238/jobs/214375\",\n \"connect_with\": [\n \"214375\"\n ],\n \"type\": 1357,\n \"external_id\": null,\n \"type_category\": 465,\n \"client_id\": 12449,\n \"client_name\": \"De Bortoli - Yarra Valley\",\n \"scheduled_start_time\": \"2023-06-06T05:04:39+00:00\",\n \"scheduled_end_time\": \"2023-06-06T05:34:39+00:00\",\n \"actual_start_time\": \"2023-06-06T05:05:03+00:00\",\n \"actual_end_time\": \"2023-06-06T05:45:19+00:00\",\n \"name\": \"J214375\",\n \"address\": \"58 Pinnacle lane Dixons Creek\",\n \"notes\": \"\",\n \"map_id\": 6934,\n \"status\": \"returned\",\n \"created_at\": \"2023-06-06T05:04:39+00:00\",\n \"updated_at\": \"2023-06-06T05:48:07+00:00\",\n \"implement_id\": 889,\n \"areas\": 0.346,\n \"create_user\": 12444,\n \"planted_distance\": 0,\n \"spread_width\": 2,\n \"origin_width\": 2,\n \"contact\": null,\n \"phone\": null,\n \"actual_rate_used\": null,\n \"average_pressure\": null,\n \"average_ground_speed\": null,\n \"tanks\": null,\n \"average_speed\": null,\n \"additional_time_in_hr\": null,\n \"estimated_time_in_hr\": null,\n \"requested_date\": \"2023-06-06T05:04:39+00:00\",\n \"overdue_date\": \"2023-06-06T05:34:39+00:00\",\n \"additional_ha_covered\": 0,\n \"group_id\": null,\n \"grapelink_block_id\": null,\n \"grapelink_spray_width\": null,\n \"grapeweb_job_id\": null,\n \"grapeweb_winery_block_id\": null,\n \"firebase_sync_at\": \"2023-06-06 05:45:21\",\n \"captured_fields\": []\n },\n ...\n {\n \"id\": 213291,\n \"firebase_key\": \"org/238/jobs/213291\",\n \"connect_with\": [\n \"213291\"\n ],\n \"type\": 1357,\n \"external_id\": null,\n \"type_category\": 465,\n \"client_id\": 12449,\n \"client_name\": \"De Bortoli - Yarra Valley\",\n \"scheduled_start_time\": \"2023-05-25T05:14:23+00:00\",\n \"scheduled_end_time\": \"2023-05-25T05:44:23+00:00\",\n \"actual_start_time\": \"2023-05-25T05:20:27+00:00\",\n \"actual_end_time\": \"2023-05-30T05:14:52+00:00\",\n \"name\": \"J213291\",\n \"address\": \"58 Pinnacle lane Dixons Creek\",\n \"notes\": \"\",\n \"map_id\": 6934,\n \"status\": \"returned\",\n \"created_at\": \"2023-05-25T05:14:23+00:00\",\n \"updated_at\": \"2023-05-30T05:15:08+00:00\",\n \"implement_id\": 889,\n \"areas\": 1.601,\n \"create_user\": 12444,\n \"planted_distance\": 0,\n \"spread_width\": 20,\n \"origin_width\": 20,\n \"contact\": null,\n \"phone\": null,\n \"actual_rate_used\": null,\n \"average_pressure\": null,\n \"average_ground_speed\": null,\n \"tanks\": null,\n \"average_speed\": null,\n \"additional_time_in_hr\": null,\n \"estimated_time_in_hr\": null,\n \"requested_date\": \"2023-05-25T05:14:23+00:00\",\n \"overdue_date\": \"2023-05-25T05:44:23+00:00\",\n \"additional_ha_covered\": 0,\n \"group_id\": null,\n \"grapelink_block_id\": null,\n \"grapelink_spray_width\": null,\n \"grapeweb_job_id\": null,\n \"grapeweb_winery_block_id\": null,\n \"firebase_sync_at\": \"2023-05-30 05:14:55\",\n \"captured_fields\": []\n }\n ]\n}", | |
| "x": 90, | |
| "y": 40, | |
| "wires": [] | |
| }, | |
| { | |
| "id": "763c960301cc1f21", | |
| "type": "inject", | |
| "z": "667fdf0f9a80a951", | |
| "name": "Variety", | |
| "props": [ | |
| { | |
| "p": "payload" | |
| }, | |
| { | |
| "p": "topic", | |
| "vt": "str" | |
| }, | |
| { | |
| "p": "columns", | |
| "v": "code,name,abbr,type", | |
| "vt": "str" | |
| } | |
| ], | |
| "repeat": "", | |
| "crontab": "", | |
| "once": false, | |
| "onceDelay": "", | |
| "topic": "varieties", | |
| "payload": "varieties", | |
| "payloadType": "str", | |
| "x": 90, | |
| "y": 80, | |
| "wires": [ | |
| [ | |
| "fe2e5ef44e63683c" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "d3f99dec59cab766", | |
| "type": "change", | |
| "z": "667fdf0f9a80a951", | |
| "name": "Delete Old Data", | |
| "rules": [ | |
| { | |
| "t": "delete", | |
| "p": "csvdata", | |
| "pt": "flow" | |
| } | |
| ], | |
| "action": "", | |
| "property": "", | |
| "from": "", | |
| "to": "", | |
| "reg": false, | |
| "x": 440, | |
| "y": 160, | |
| "wires": [ | |
| [ | |
| "03ae3191c651c7b3" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "112dda8288efe8a6", | |
| "type": "function", | |
| "z": "667fdf0f9a80a951", | |
| "name": "Initialise & Set Header", | |
| "func": "// msg.dataset = 'varieties;\nvar initial_url = 'https://api-winery.grapeweb.au/' + msg.topic;\n// var initial_url = 'https://api-winery.test.grapeweb.au/' + msg.topic;\nflow.set('dataset', msg.payload);\nflow.set('url', initial_url);\n\nvar csvdata = [];\nflow.set('csvdata', csvdata);\n\nmsg.payload = \"data to post\";\n// msg.headers = {};\n// msg.headers['accept'] = 'application/json';\n// msg.headers['Authorization'] = '';\n// msg.headers['Authorization'] = '';\nreturn msg;\n\n\n/*\nmsg.headers = {\n 'authorization': 'Bearer TOKEN Here',\n 'cookie': 'Cookie here',\n 'content-type': 'multipart/form-data;'\n};\n*/", | |
| "outputs": 1, | |
| "noerr": 0, | |
| "initialize": "", | |
| "finalize": "", | |
| "libs": [], | |
| "x": 780, | |
| "y": 80, | |
| "wires": [ | |
| [ | |
| "03ae3191c651c7b3" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "03ae3191c651c7b3", | |
| "type": "change", | |
| "z": "667fdf0f9a80a951", | |
| "name": "Set url", | |
| "rules": [ | |
| { | |
| "t": "set", | |
| "p": "url", | |
| "pt": "msg", | |
| "to": "url", | |
| "tot": "flow" | |
| } | |
| ], | |
| "action": "", | |
| "property": "", | |
| "from": "", | |
| "to": "", | |
| "reg": false, | |
| "x": 650, | |
| "y": 160, | |
| "wires": [ | |
| [ | |
| "9a4ca56bb6de8681", | |
| "5bd22154640bedfa" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "9a4ca56bb6de8681", | |
| "type": "http request", | |
| "z": "667fdf0f9a80a951", | |
| "name": "Get Data", | |
| "method": "GET", | |
| "ret": "txt", | |
| "paytoqs": "ignore", | |
| "url": "", | |
| "tls": "6bc1b7f7d64b2e55", | |
| "persist": false, | |
| "proxy": "5581caf0b52bb697", | |
| "insecureHTTPParser": false, | |
| "authType": "bearer", | |
| "senderr": false, | |
| "headers": [ | |
| { | |
| "keyType": "other", | |
| "keyValue": "accept", | |
| "valueType": "other", | |
| "valueValue": "application/json" | |
| } | |
| ], | |
| "x": 800, | |
| "y": 200, | |
| "wires": [ | |
| [ | |
| "dbb30831e44746e7", | |
| "9e9340e1fc781d91" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "2215546ec1d2044d", | |
| "type": "json", | |
| "z": "667fdf0f9a80a951", | |
| "name": "", | |
| "property": "payload", | |
| "action": "", | |
| "pretty": false, | |
| "x": 570, | |
| "y": 320, | |
| "wires": [ | |
| [ | |
| "aaabc1c6e5bad985", | |
| "d051a1237b521257" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "aaabc1c6e5bad985", | |
| "type": "function", | |
| "z": "667fdf0f9a80a951", | |
| "name": "Split out Data", | |
| "func": "//check if the call was paged or not\n// RED.util.getMessageProperty(msg,prop);\nif (msg.payload.hasOwnProperty('next_page_url')) {\n // The call is paged - save the data array: \n var csvdata = flow.get('csvdata') || [];\n csvdata = csvdata.concat(msg.payload.data);\n flow.set('csvdata', csvdata);\n // save header info\n flow.set('hdr_total', msg.payload.total);\n flow.set('hdr_per_page', msg.payload.per_page);\n flow.set('hdr_current_page', msg.payload.current_page);\n flow.set('hdr_last_page', msg.payload.last_page);\n flow.set('hdr_next_page_url', msg.payload.next_page_url);\n flow.set('hdr_prev_page_url', msg.payload.prev_page_url);\n flow.set('hdr_from', msg.payload.from);\n flow.set('hdr_to', msg.payload.to);\n flow.set('per_page', '?per_page = 100')\n\n // save cookies and set authorisation for paged retreival\n msg.cookies = msg.responseCookies;\n\n msg.headers['Authorization'] = msg.headers.authorization;\n /*\n msg.headers = {\n 'authorization': 'Bearer TOKEN Here',\n 'cookie': 'Cookie here',\n 'content-type': 'multipart/form-data;'\n };\n */\n} else {\n // The call is not paged - pass straight thru: \n // var data = msg.payload.data; // Data\n // msg.payload = data;\n var csvdata = flow.get('csvdata') || [];\n // var csvdata = flow.get('csvdata') || [];\n csvdata = csvdata.concat(msg.payload);\n flow.set('csvdata', csvdata);\n}\nreturn msg;", | |
| "outputs": 1, | |
| "noerr": 0, | |
| "initialize": "", | |
| "finalize": "", | |
| "libs": [], | |
| "x": 780, | |
| "y": 360, | |
| "wires": [ | |
| [ | |
| "5cb5eb4fd5d8dc6f", | |
| "eac8f80784f23a23" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "a258882b52dc1130", | |
| "type": "switch", | |
| "z": "667fdf0f9a80a951", | |
| "name": "", | |
| "property": "hdr_next_page_url", | |
| "propertyType": "flow", | |
| "rules": [ | |
| { | |
| "t": "null" | |
| }, | |
| { | |
| "t": "nnull" | |
| } | |
| ], | |
| "checkall": "true", | |
| "repair": false, | |
| "outputs": 2, | |
| "x": 810, | |
| "y": 520, | |
| "wires": [ | |
| [ | |
| "db49f4955146c6f9" | |
| ], | |
| [ | |
| "4d5fa3ef4ae70ae5" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "5cb5eb4fd5d8dc6f", | |
| "type": "change", | |
| "z": "667fdf0f9a80a951", | |
| "name": "", | |
| "rules": [ | |
| { | |
| "t": "set", | |
| "p": "payload", | |
| "pt": "msg", | |
| "to": "csvdata", | |
| "tot": "flow" | |
| } | |
| ], | |
| "action": "", | |
| "property": "", | |
| "from": "", | |
| "to": "", | |
| "reg": false, | |
| "x": 540, | |
| "y": 420, | |
| "wires": [ | |
| [ | |
| "77695bdf2ef39233", | |
| "e1b0067dec4f0deb" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "4d5fa3ef4ae70ae5", | |
| "type": "delay", | |
| "z": "667fdf0f9a80a951", | |
| "name": "", | |
| "pauseType": "delay", | |
| "timeout": "3", | |
| "timeoutUnits": "seconds", | |
| "rate": "1", | |
| "nbRateUnits": "1", | |
| "rateUnits": "second", | |
| "randomFirst": "1", | |
| "randomLast": "5", | |
| "randomUnits": "seconds", | |
| "drop": false, | |
| "allowrate": false, | |
| "outputs": 1, | |
| "x": 560, | |
| "y": 580, | |
| "wires": [ | |
| [ | |
| "99ae45c709a23252" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "99ae45c709a23252", | |
| "type": "change", | |
| "z": "667fdf0f9a80a951", | |
| "name": "", | |
| "rules": [ | |
| { | |
| "t": "set", | |
| "p": "url", | |
| "pt": "flow", | |
| "to": "hdr_next_page_url", | |
| "tot": "flow" | |
| } | |
| ], | |
| "action": "", | |
| "property": "", | |
| "from": "", | |
| "to": "", | |
| "reg": false, | |
| "x": 790, | |
| "y": 580, | |
| "wires": [ | |
| [ | |
| "7af7dbcdf8a955ab" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "77695bdf2ef39233", | |
| "type": "csv", | |
| "z": "667fdf0f9a80a951", | |
| "name": "varieties CSV", | |
| "sep": ",", | |
| "hdrin": "", | |
| "hdrout": "none", | |
| "multi": "one", | |
| "ret": "\\n", | |
| "temp": "", | |
| "skip": 0, | |
| "strings": true, | |
| "include_empty_strings": false, | |
| "include_null_values": false, | |
| "x": 780, | |
| "y": 440, | |
| "wires": [ | |
| [ | |
| "99fa0ef99a05ee19", | |
| "1481235e3d0fbbf9" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "fe2e5ef44e63683c", | |
| "type": "function", | |
| "z": "667fdf0f9a80a951", | |
| "name": "Filename generator", | |
| "func": "// Get the current time and convert it to text\nvar now = new Date();\nvar yyyy = now.getFullYear();\nvar mm = now.getMonth() < 9 ? \"0\" + (now.getMonth() + 1) : (now.getMonth() + 1); // getMonth() is zero-based\nvar dd = now.getDate() < 10 ? \"0\" + now.getDate() : now.getDate();\nvar hh = now.getHours() < 10 ? \"0\" + now.getHours() : now.getHours();\nvar mmm = now.getMinutes() < 10 ? \"0\" + now.getMinutes() : now.getMinutes();\nvar ss = now.getSeconds() < 10 ? \"0\" + now.getSeconds() : now.getSeconds();\n\n// Generate out file name pattern\nmsg.fname = msg.topic + \"_\"+ yyyy + mm + dd + \".csv\";\n// Full filename with path for the file node later\n// msg.filename = \"/tmp/\"+ msg.fname;\nmsg.filename = \"/data/\" + msg.fname;\n\n/*\n// We save the current payload into a different place on the msg object\nmsg.filecontent = msg.payload;\n\n// We are passing the file name search pattern to fs node to tell us if the file exists or not\nmsg.payload = {\"pattern\":msg.fname};\n*/\nmsg.payload = \"id,firebase_key,connect_with,type,external_id,type_category,client_id,client_name,scheduled_start_time,scheduled_end_time,actual_start_time,actual_end_time,name,address,notes,map_id,status,created_at,updated_at,implement_id,areas,create_user,planted_distance,spread_width,origin_width,contact,phone,actual_rate_used,average_pressure,average_ground_speed,tanks,average_speed,additional_time_in_hr,estimated_time_in_hr,requested_date,overdue_date,additional_ha_covered,group_id,grapelink_block_id,grapelink_spray_width,grapeweb_job_id,grapeweb_winery_block_id,firebase_sync_at,captured_fields,customer_user\";\nnode.status({fill:\"blue\",shape:\"ring\",text:msg.fname});\nreturn msg;", | |
| "outputs": 1, | |
| "noerr": 0, | |
| "initialize": "", | |
| "finalize": "", | |
| "libs": [], | |
| "x": 370, | |
| "y": 80, | |
| "wires": [ | |
| [ | |
| "0960daff0134dc26" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "99fa0ef99a05ee19", | |
| "type": "file", | |
| "z": "667fdf0f9a80a951", | |
| "name": "varieties File", | |
| "filename": "filename", | |
| "filenameType": "msg", | |
| "appendNewline": false, | |
| "createDir": false, | |
| "overwriteFile": "false", | |
| "x": 550, | |
| "y": 500, | |
| "wires": [ | |
| [ | |
| "a258882b52dc1130", | |
| "321825539f3cd021" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "edfb0846e27d4353", | |
| "type": "link in", | |
| "z": "667fdf0f9a80a951", | |
| "name": "link in 2", | |
| "links": [ | |
| "7af7dbcdf8a955ab" | |
| ], | |
| "x": 355, | |
| "y": 740, | |
| "wires": [ | |
| [ | |
| "d3f99dec59cab766" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "7af7dbcdf8a955ab", | |
| "type": "link out", | |
| "z": "667fdf0f9a80a951", | |
| "name": "link out 2", | |
| "mode": "link", | |
| "links": [ | |
| "edfb0846e27d4353" | |
| ], | |
| "x": 895, | |
| "y": 740, | |
| "wires": [] | |
| }, | |
| { | |
| "id": "db49f4955146c6f9", | |
| "type": "debug", | |
| "z": "667fdf0f9a80a951", | |
| "name": "debug Get Next Page", | |
| "active": true, | |
| "tosidebar": true, | |
| "console": false, | |
| "tostatus": false, | |
| "complete": "true", | |
| "targetType": "full", | |
| "statusVal": "", | |
| "statusType": "auto", | |
| "x": 1120, | |
| "y": 520, | |
| "wires": [] | |
| }, | |
| { | |
| "id": "5bd22154640bedfa", | |
| "type": "debug", | |
| "z": "667fdf0f9a80a951", | |
| "name": "debug Check URL", | |
| "active": true, | |
| "tosidebar": true, | |
| "console": false, | |
| "tostatus": false, | |
| "complete": "true", | |
| "targetType": "full", | |
| "statusVal": "", | |
| "statusType": "auto", | |
| "x": 1110, | |
| "y": 160, | |
| "wires": [] | |
| }, | |
| { | |
| "id": "dbb30831e44746e7", | |
| "type": "debug", | |
| "z": "667fdf0f9a80a951", | |
| "name": "debug Check Return", | |
| "active": true, | |
| "tosidebar": true, | |
| "console": false, | |
| "tostatus": false, | |
| "complete": "true", | |
| "targetType": "full", | |
| "statusVal": "", | |
| "statusType": "auto", | |
| "x": 1120, | |
| "y": 200, | |
| "wires": [] | |
| }, | |
| { | |
| "id": "0960daff0134dc26", | |
| "type": "file", | |
| "z": "667fdf0f9a80a951", | |
| "name": "File Reset", | |
| "filename": "filename", | |
| "filenameType": "msg", | |
| "appendNewline": true, | |
| "createDir": false, | |
| "overwriteFile": "true", | |
| "x": 580, | |
| "y": 80, | |
| "wires": [ | |
| [ | |
| "112dda8288efe8a6" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "d051a1237b521257", | |
| "type": "debug", | |
| "z": "667fdf0f9a80a951", | |
| "name": "debug JSON", | |
| "active": true, | |
| "tosidebar": true, | |
| "console": false, | |
| "tostatus": false, | |
| "complete": "true", | |
| "targetType": "full", | |
| "statusVal": "", | |
| "statusType": "auto", | |
| "x": 1090, | |
| "y": 320, | |
| "wires": [] | |
| }, | |
| { | |
| "id": "eac8f80784f23a23", | |
| "type": "debug", | |
| "z": "667fdf0f9a80a951", | |
| "name": "debug Check Paging", | |
| "active": true, | |
| "tosidebar": true, | |
| "console": false, | |
| "tostatus": false, | |
| "complete": "true", | |
| "targetType": "full", | |
| "statusVal": "", | |
| "statusType": "auto", | |
| "x": 1120, | |
| "y": 360, | |
| "wires": [] | |
| }, | |
| { | |
| "id": "e1b0067dec4f0deb", | |
| "type": "debug", | |
| "z": "667fdf0f9a80a951", | |
| "name": "debug Check Payload", | |
| "active": true, | |
| "tosidebar": true, | |
| "console": false, | |
| "tostatus": false, | |
| "complete": "true", | |
| "targetType": "full", | |
| "statusVal": "", | |
| "statusType": "auto", | |
| "x": 1120, | |
| "y": 400, | |
| "wires": [] | |
| }, | |
| { | |
| "id": "1481235e3d0fbbf9", | |
| "type": "debug", | |
| "z": "667fdf0f9a80a951", | |
| "name": "debug CSV", | |
| "active": true, | |
| "tosidebar": true, | |
| "console": false, | |
| "tostatus": false, | |
| "complete": "true", | |
| "targetType": "full", | |
| "statusVal": "", | |
| "statusType": "auto", | |
| "x": 1090, | |
| "y": 440, | |
| "wires": [] | |
| }, | |
| { | |
| "id": "321825539f3cd021", | |
| "type": "debug", | |
| "z": "667fdf0f9a80a951", | |
| "name": "debug Check File", | |
| "active": true, | |
| "tosidebar": true, | |
| "console": false, | |
| "tostatus": false, | |
| "complete": "true", | |
| "targetType": "full", | |
| "statusVal": "", | |
| "statusType": "auto", | |
| "x": 1110, | |
| "y": 480, | |
| "wires": [] | |
| }, | |
| { | |
| "id": "9e9340e1fc781d91", | |
| "type": "function", | |
| "z": "667fdf0f9a80a951", | |
| "name": "Check for Error", | |
| "func": "// check if the call returned an error\n\nif (msg.hasOwnProperty('statusCode')) {\n if (msg.statusCode == 200) {\n flow.set('http_error', 'no');\n } else {\n flow.set('http_error', 'yes');\n }\n} else {\n // The call did not return a status: An Error\n flow.set('http_error', 'yes');\n}\nreturn msg;", | |
| "outputs": 1, | |
| "noerr": 0, | |
| "initialize": "", | |
| "finalize": "", | |
| "libs": [], | |
| "x": 540, | |
| "y": 260, | |
| "wires": [ | |
| [ | |
| "9e4d12a7fa4acf47" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "9e4d12a7fa4acf47", | |
| "type": "switch", | |
| "z": "667fdf0f9a80a951", | |
| "name": "", | |
| "property": "http_error", | |
| "propertyType": "flow", | |
| "rules": [ | |
| { | |
| "t": "eq", | |
| "v": "yes", | |
| "vt": "str" | |
| }, | |
| { | |
| "t": "eq", | |
| "v": "no", | |
| "vt": "str" | |
| } | |
| ], | |
| "checkall": "true", | |
| "repair": false, | |
| "outputs": 2, | |
| "x": 810, | |
| "y": 260, | |
| "wires": [ | |
| [ | |
| "1a4a4162ed3073c8" | |
| ], | |
| [ | |
| "2215546ec1d2044d" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "1a4a4162ed3073c8", | |
| "type": "debug", | |
| "z": "667fdf0f9a80a951", | |
| "name": "Debug API Error", | |
| "active": true, | |
| "tosidebar": true, | |
| "console": false, | |
| "tostatus": false, | |
| "complete": "true", | |
| "targetType": "full", | |
| "statusVal": "", | |
| "statusType": "auto", | |
| "x": 1100, | |
| "y": 260, | |
| "wires": [], | |
| "icon": "node-red/alert.svg" | |
| }, | |
| { | |
| "id": "ebd9583bc1a740c7", | |
| "type": "inject", | |
| "z": "667fdf0f9a80a951", | |
| "name": "Regions", | |
| "props": [ | |
| { | |
| "p": "payload" | |
| }, | |
| { | |
| "p": "topic", | |
| "vt": "str" | |
| }, | |
| { | |
| "p": "columns", | |
| "v": "code,text,state_name,name", | |
| "vt": "str" | |
| } | |
| ], | |
| "repeat": "", | |
| "crontab": "", | |
| "once": false, | |
| "onceDelay": "", | |
| "topic": "regions", | |
| "payload": "regions", | |
| "payloadType": "str", | |
| "x": 100, | |
| "y": 140, | |
| "wires": [ | |
| [ | |
| "fe2e5ef44e63683c" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "6f94d21507c6deda", | |
| "type": "inject", | |
| "z": "667fdf0f9a80a951", | |
| "name": "Growth Stages", | |
| "props": [ | |
| { | |
| "p": "payload" | |
| }, | |
| { | |
| "p": "topic", | |
| "vt": "str" | |
| }, | |
| { | |
| "p": "columns", | |
| "v": "name,number,text", | |
| "vt": "str" | |
| } | |
| ], | |
| "repeat": "", | |
| "crontab": "", | |
| "once": false, | |
| "onceDelay": "", | |
| "topic": "growth-stages", | |
| "payload": "growth-stages", | |
| "payloadType": "str", | |
| "x": 120, | |
| "y": 200, | |
| "wires": [ | |
| [ | |
| "fe2e5ef44e63683c" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "6bc1b7f7d64b2e55", | |
| "type": "tls-config", | |
| "name": "", | |
| "cert": "", | |
| "key": "", | |
| "ca": "", | |
| "certname": "", | |
| "keyname": "", | |
| "caname": "", | |
| "servername": "", | |
| "verifyservercert": false, | |
| "alpnprotocol": "" | |
| }, | |
| { | |
| "id": "5581caf0b52bb697", | |
| "type": "http proxy", | |
| "name": "dbw", | |
| "url": "http://proxy1:3128/", | |
| "noproxy": [] | |
| } | |
| ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment