diff --git a/test/node-red-integration-tests/apitest.json b/test/node-red-integration-tests/apitest.json new file mode 100644 index 0000000..b5a524f --- /dev/null +++ b/test/node-red-integration-tests/apitest.json @@ -0,0 +1,432 @@ +[ + { + "id": "59310844a3cdc638", + "type": "tab", + "label": "Flow 1", + "disabled": false, + "info": "", + "env": [] + }, + { + "id": "883490d684612591", + "type": "inject", + "z": "59310844a3cdc638", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 180, + "y": 240, + "wires": [ + [ + "522c9262dc81a34f" + ] + ] + }, + { + "id": "3a198c85c047a80d", + "type": "comment", + "z": "59310844a3cdc638", + "name": "Server components test | BEACONS LIST", + "info": "", + "x": 260, + "y": 140, + "wires": [] + }, + { + "id": "522c9262dc81a34f", + "type": "function", + "z": "59310844a3cdc638", + "name": "GET beacons", + "func": "msg.url = \"http://presense-server:1902/api/beacons\";\nmsg.method = \"GET\";\nmsg.payload = \"\";\nreturn msg;", + "outputs": 1, + "timeout": 0, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 360, + "y": 240, + "wires": [ + [ + "2f19e204e95d32b2" + ] + ] + }, + { + "id": "2f19e204e95d32b2", + "type": "http request", + "z": "59310844a3cdc638", + "name": "", + "method": "use", + "ret": "txt", + "paytoqs": "ignore", + "url": "", + "tls": "", + "persist": false, + "proxy": "", + "insecureHTTPParser": false, + "authType": "", + "senderr": false, + "headers": [], + "x": 550, + "y": 240, + "wires": [ + [ + "3b832f5f2a705f87" + ] + ] + }, + { + "id": "8a39a884d333343d", + "type": "comment", + "z": "59310844a3cdc638", + "name": "GET beacons list", + "info": "", + "x": 180, + "y": 200, + "wires": [] + }, + { + "id": "bfc307bbffd86501", + "type": "inject", + "z": "59310844a3cdc638", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 180, + "y": 340, + "wires": [ + [ + "368acb55a1372809" + ] + ] + }, + { + "id": "368acb55a1372809", + "type": "function", + "z": "59310844a3cdc638", + "name": "POST beacons", + "func": "msg.url = \"http://presense-server:1902/api/beacons\";\nmsg.method = \"POST\";\nmsg.payload = {\n \"timestamp\": \"2025-07-24T15:00:00.141Z\", \n \"mac\": \"C3000057B9DA\", \n \"rssi\": -66, \n \"rawData\": \"0201060303AAFE1116AAFE20000C392500000601EA01192890\",\n \"Name\": \"Beacon1\",\n \"Beacon_id\": \"1\"\n};\nreturn msg;", + "outputs": 1, + "timeout": 0, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 360, + "y": 340, + "wires": [ + [ + "06586c5ac291f999" + ] + ] + }, + { + "id": "06586c5ac291f999", + "type": "http request", + "z": "59310844a3cdc638", + "name": "", + "method": "use", + "ret": "txt", + "paytoqs": "ignore", + "url": "", + "tls": "", + "persist": false, + "proxy": "", + "insecureHTTPParser": false, + "authType": "", + "senderr": false, + "headers": [], + "x": 550, + "y": 340, + "wires": [ + [ + "48eb1b4c5a48a874" + ] + ] + }, + { + "id": "d8d3d6ee351c3fce", + "type": "comment", + "z": "59310844a3cdc638", + "name": "POST beacons list", + "info": "", + "x": 190, + "y": 300, + "wires": [] + }, + { + "id": "b03a9a99c8897f49", + "type": "debug", + "z": "59310844a3cdc638", + "name": "debug 1", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "statusVal": "", + "statusType": "auto", + "x": 860, + "y": 240, + "wires": [] + }, + { + "id": "48eb1b4c5a48a874", + "type": "debug", + "z": "59310844a3cdc638", + "name": "debug 2", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "statusVal": "", + "statusType": "auto", + "x": 860, + "y": 340, + "wires": [] + }, + { + "id": "3b832f5f2a705f87", + "type": "json", + "z": "59310844a3cdc638", + "name": "", + "property": "payload", + "action": "", + "pretty": false, + "x": 710, + "y": 240, + "wires": [ + [ + "b03a9a99c8897f49" + ] + ] + }, + { + "id": "1817099dc85d0c73", + "type": "inject", + "z": "59310844a3cdc638", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 180, + "y": 440, + "wires": [ + [ + "3b4d5dca9051f727" + ] + ] + }, + { + "id": "3b4d5dca9051f727", + "type": "function", + "z": "59310844a3cdc638", + "name": "PUT beacons", + "func": "msg.url = \"http://presense-server:1902/api/beacons\";\nmsg.method = \"PUT\";\nmsg.payload = {\n \"timestamp\": \"2025-07-24T15:00:00.141Z\",\n \"mac\": \"C3000056GSZW\",\n \"rssi\": -76,\n \"rawData\": \"0201060303AAFE1116AAFE20000C392500000601EA01192890\",\n \"Name\": \"Beacon2\",\n \"Beacon_id\": \"2\"\n};\nreturn msg;", + "outputs": 1, + "timeout": 0, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 360, + "y": 440, + "wires": [ + [ + "213a0de12ca7b387" + ] + ] + }, + { + "id": "213a0de12ca7b387", + "type": "http request", + "z": "59310844a3cdc638", + "name": "", + "method": "use", + "ret": "txt", + "paytoqs": "ignore", + "url": "", + "tls": "", + "persist": false, + "proxy": "", + "insecureHTTPParser": false, + "authType": "", + "senderr": false, + "headers": [], + "x": 550, + "y": 440, + "wires": [ + [ + "668a57a11d34fab9" + ] + ] + }, + { + "id": "9095389f88755788", + "type": "comment", + "z": "59310844a3cdc638", + "name": "PUT beacons list", + "info": "", + "x": 180, + "y": 400, + "wires": [] + }, + { + "id": "668a57a11d34fab9", + "type": "debug", + "z": "59310844a3cdc638", + "name": "debug 4", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "statusVal": "", + "statusType": "auto", + "x": 860, + "y": 440, + "wires": [] + }, + { + "id": "9fe67862caf1033d", + "type": "inject", + "z": "59310844a3cdc638", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 180, + "y": 540, + "wires": [ + [ + "c52f0e6e0e08f1ca" + ] + ] + }, + { + "id": "c52f0e6e0e08f1ca", + "type": "function", + "z": "59310844a3cdc638", + "name": "DELETE beacons", + "func": "msg.url = \"http://presense-server:1902/api/beacons/2\";\nmsg.method = \"DELETE\";\nmsg.payload = \"\";\nreturn msg;", + "outputs": 1, + "timeout": 0, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 370, + "y": 540, + "wires": [ + [ + "35d94840a12ca741" + ] + ] + }, + { + "id": "35d94840a12ca741", + "type": "http request", + "z": "59310844a3cdc638", + "name": "", + "method": "use", + "ret": "txt", + "paytoqs": "ignore", + "url": "", + "tls": "", + "persist": false, + "proxy": "", + "insecureHTTPParser": false, + "authType": "", + "senderr": false, + "headers": [], + "x": 550, + "y": 540, + "wires": [ + [ + "50c9899be46f95be" + ] + ] + }, + { + "id": "2475de26f85f96e5", + "type": "comment", + "z": "59310844a3cdc638", + "name": "DELETE beacons list", + "info": "", + "x": 200, + "y": 500, + "wires": [] + }, + { + "id": "50c9899be46f95be", + "type": "debug", + "z": "59310844a3cdc638", + "name": "debug 3", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "statusVal": "", + "statusType": "auto", + "x": 860, + "y": 540, + "wires": [] + } +] \ No newline at end of file