diff --git a/.env.local b/.env.local new file mode 100644 index 0000000..40eea73 --- /dev/null +++ b/.env.local @@ -0,0 +1 @@ +PB_URL="https://iot.epi.cb85.software" \ No newline at end of file diff --git a/.history/IOT/lib/pocketbase_20230403114544.js b/.history/IOT/lib/pocketbase_20230403114544.js new file mode 100644 index 0000000..eb247a6 --- /dev/null +++ b/.history/IOT/lib/pocketbase_20230403114544.js @@ -0,0 +1,5 @@ +import PocketBase from 'pocketbase'; + +const pb = new PocketBase(process.env.PB_URL); + +export default pb; \ No newline at end of file diff --git a/.history/IOT/lib/pocketbase_20230403121322.js b/.history/IOT/lib/pocketbase_20230403121322.js new file mode 100644 index 0000000..d82a7ef --- /dev/null +++ b/.history/IOT/lib/pocketbase_20230403121322.js @@ -0,0 +1,7 @@ +import PocketBase from 'pocketbase'; + +const pb = new PocketBase(process.env.PB_URL); + +const authData = await pb.collection('users').authWithPassword('michel.deghaud@gmail.com', 'Kimbomaye67'); + +export default pb; \ No newline at end of file diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..b4269a9 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,19 @@ +{ + "configurations": [ + { + "name": "Mac", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "macFrameworkPath": [ + "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks" + ], + "compilerPath": "/usr/bin/clang", + "cStandard": "c17", + "cppStandard": "c++17", + "intelliSenseMode": "macos-clang-x64" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/IOT/lib/pocketbase.js b/IOT/lib/pocketbase.js new file mode 100644 index 0000000..d82a7ef --- /dev/null +++ b/IOT/lib/pocketbase.js @@ -0,0 +1,7 @@ +import PocketBase from 'pocketbase'; + +const pb = new PocketBase(process.env.PB_URL); + +const authData = await pb.collection('users').authWithPassword('michel.deghaud@gmail.com', 'Kimbomaye67'); + +export default pb; \ No newline at end of file diff --git a/IOT/test/Insomnia-All_2023-04-03.json b/IOT/test/Insomnia-All_2023-04-03.json new file mode 100644 index 0000000..8cfabeb --- /dev/null +++ b/IOT/test/Insomnia-All_2023-04-03.json @@ -0,0 +1 @@ +{"_type":"export","__export_format":4,"__export_date":"2023-04-03T13:50:30.902Z","__export_source":"insomnia.desktop.app:v2023.1.0","resources":[{"_id":"req_7ab7afd204f84b64b0f12c0ac2cce728","parentId":"wrk_c2f3bac211ca48afb0e9b938a5dc22ba","modified":1680528568144,"created":1680528426928,"url":"https://iot.epi.cb85.software/api/collections/users/records/","name":"List users","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1680528426928,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"wrk_c2f3bac211ca48afb0e9b938a5dc22ba","parentId":null,"modified":1680529607763,"created":1680528426859,"name":"Test API","description":"","scope":"design","_type":"workspace"},{"_id":"req_15f80c73d6184fcaa84a27c61f0e9d80","parentId":"wrk_c2f3bac211ca48afb0e9b938a5dc22ba","modified":1680529540579,"created":1680528602721,"url":"https://iot.epi.cb85.software/api/collections/users/records","name":"Create users","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n \"username\": \"nico\",\n \"email\": \"nicolas.sans@epitech.eu\",\n \"emailVisibility\": true,\n \"password\": \"12345abcdefg\",\n \"passwordConfirm\": \"12345abcdefg\",\n \"name\": \"test\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1680528602722,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_b1a4c2a1ac7949a9bef9a1dcdee28ef0","parentId":"wrk_c2f3bac211ca48afb0e9b938a5dc22ba","modified":1680529705996,"created":1680529686485,"url":"https://iot.epi.cb85.software/api/collections/trashs/records","name":"List trashs","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1680529686485,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_33bf2e1173ba46eea65e1fca84d4a49d","parentId":"wrk_c2f3bac211ca48afb0e9b938a5dc22ba","modified":1680529740613,"created":1680529725947,"url":"https://iot.epi.cb85.software/api/collections/data/records","name":"List data","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1680529725947,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_c064b9f18a216b0e8542bcc13d85f87eae7567c9","parentId":"wrk_c2f3bac211ca48afb0e9b938a5dc22ba","modified":1680528426923,"created":1680528426923,"name":"Base Environment","data":{},"dataPropertyOrder":null,"color":null,"isPrivate":false,"metaSortKey":1680528426923,"_type":"environment"},{"_id":"jar_c064b9f18a216b0e8542bcc13d85f87eae7567c9","parentId":"wrk_c2f3bac211ca48afb0e9b938a5dc22ba","modified":1680528426925,"created":1680528426925,"name":"Default Jar","cookies":[],"_type":"cookie_jar"},{"_id":"spc_96bf7588a8b04c9ea2fb780dc2e6b0f5","parentId":"wrk_c2f3bac211ca48afb0e9b938a5dc22ba","modified":1680529607757,"created":1680528426887,"fileName":"Test API","contents":"","contentType":"yaml","_type":"api_spec"},{"_id":"uts_8ae620046c8a4f17af78e1354b40b6e2","parentId":"wrk_c2f3bac211ca48afb0e9b938a5dc22ba","modified":1680528426929,"created":1680528426929,"name":"Example Test Suite","_type":"unit_test_suite"},{"_id":"ut_a4ef4a2ba5a84ec09d963c48c2505ebd","parentId":"uts_8ae620046c8a4f17af78e1354b40b6e2","modified":1680528528479,"created":1680528524523,"requestId":"req_7ab7afd204f84b64b0f12c0ac2cce728","name":"Returns 200","code":"const response1 = await insomnia.send();\nexpect(response1.status).to.equal(200);","_type":"unit_test"}]} \ No newline at end of file