Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #148 from technologiestiftung/staging
Browse files Browse the repository at this point in the history
  • Loading branch information
ff6347 authored May 9, 2022
2 parents 27ddc43 + e82c8e9 commit c62d0dc
Show file tree
Hide file tree
Showing 16 changed files with 634 additions and 136 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.19.0
14.19.1
25 changes: 21 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,34 @@
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/jest",
"args": [
"-p ${input:pattern}",
// "--runInBand",
"-p http",
"--runInBand",
// "--no-cache",
"--watch"
"--watch",
"-f"
],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
{
"name": "Jest Debug tests watch mode specific file",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/jest",
"args": [
"src/integration/http.test.ts",
"--runInBand",
// "--no-cache",
"--watch",
"-f"
],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},

{
"name": "Inpyjamas scripts Debug tests watch mode",
"type": "node",
Expand Down
35 changes: 25 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,44 @@
# [3.1.0](https://github.com/technologiestiftung/stadtpuls-api/compare/v3.0.2...v3.1.0) (2022-03-30)
# [3.2.0-rc.2](https://github.com/technologiestiftung/stadtpuls-api/compare/v3.2.0-rc.1...v3.2.0-rc.2) (2022-05-03)


### Features
### Bug Fixes

* **error messages:** Add custom error response ([068eb1f](https://github.com/technologiestiftung/stadtpuls-api/commit/068eb1faf9178c6ae272849e0061034dfdd27fa2))
* **http integration:** allow additional props in body ([9487983](https://github.com/technologiestiftung/stadtpuls-api/commit/9487983046429e7b8e6404914b29585de68c6cdc))
* **http:** adds ability to post with own recorded_at prop ([83966c2](https://github.com/technologiestiftung/stadtpuls-api/commit/83966c2e17e6e4c5c12f2aa4d2e15ce1f46ba7a7))
* **HTTP:** Remove max number of records ([f996c56](https://github.com/technologiestiftung/stadtpuls-api/commit/f996c5601334f494a905478754dd0c3dbc03e338))

# [3.1.0-rc.2](https://github.com/technologiestiftung/stadtpuls-api/compare/v3.1.0-rc.1...v3.1.0-rc.2) (2022-03-30)
# [3.2.0-rc.1](https://github.com/technologiestiftung/stadtpuls-api/compare/v3.1.0...v3.2.0-rc.1) (2022-05-03)


### Bug Fixes

* **deps:** update react monorepo to v18 ([7caef30](https://github.com/technologiestiftung/stadtpuls-api/commit/7caef30be2873989a33a10361e5f4f86e70e32c6))
* **http:** fixes failing logic and adds tests ([e030419](https://github.com/technologiestiftung/stadtpuls-api/commit/e03041984368fedb6a16649fc42060457b2d7efa))


### Features

* **error messages:** Add custom error response ([068eb1f](https://github.com/technologiestiftung/stadtpuls-api/commit/068eb1faf9178c6ae272849e0061034dfdd27fa2))
* **http:** adds ability to post with own recorded_at prop ([83966c2](https://github.com/technologiestiftung/stadtpuls-api/commit/83966c2e17e6e4c5c12f2aa4d2e15ce1f46ba7a7))
* **http:** adds batch posting of records ([510d433](https://github.com/technologiestiftung/stadtpuls-api/commit/510d433c358f50360890918d583709cdfa2cf1a9))

# [3.1.0-rc.1](https://github.com/technologiestiftung/stadtpuls-api/compare/v3.0.2...v3.1.0-rc.1) (2022-03-29)
# [3.1.0](https://github.com/technologiestiftung/stadtpuls-api/compare/v3.0.2...v3.1.0) (2022-03-30)


### Bug Fixes

* **http:** fixes failing logic and adds tests ([e030419](https://github.com/technologiestiftung/stadtpuls-api/commit/e03041984368fedb6a16649fc42060457b2d7efa))
* **deps:** update react monorepo to v18 ([7caef30](https://github.com/technologiestiftung/stadtpuls-api/commit/7caef30be2873989a33a10361e5f4f86e70e32c6))


### Features

* **http:** adds batch posting of records ([510d433](https://github.com/technologiestiftung/stadtpuls-api/commit/510d433c358f50360890918d583709cdfa2cf1a9))
* **error messages:** Add custom error response ([068eb1f](https://github.com/technologiestiftung/stadtpuls-api/commit/068eb1faf9178c6ae272849e0061034dfdd27fa2))
* **http integration:** allow additional props in body ([9487983](https://github.com/technologiestiftung/stadtpuls-api/commit/9487983046429e7b8e6404914b29585de68c6cdc))
* **http:** adds ability to post with own recorded_at prop ([83966c2](https://github.com/technologiestiftung/stadtpuls-api/commit/83966c2e17e6e4c5c12f2aa4d2e15ce1f46ba7a7))
* **error messages:** Add custom error response ([068eb1f](https://github.com/technologiestiftung/stadtpuls-api/commit/068eb1faf9178c6ae272849e0061034dfdd27fa2))
* **http:** adds ability to post with own recorded_at prop ([83966c2](https://github.com/technologiestiftung/stadtpuls-api/commit/83966c2e17e6e4c5c12f2aa4d2e15ce1f46ba7a7))
* **http integration:** allow additional props in body ([9487983](https://github.com/technologiestiftung/stadtpuls-api/commit/9487983046429e7b8e6404914b29585de68c6cdc))

## [3.0.2](https://github.com/technologiestiftung/stadtpuls-api/compare/v3.0.1...v3.0.2) (2022-03-23)

## [3.0.2](https://github.com/technologiestiftung/stadtpuls-api/compare/v3.0.1...v3.0.2) (2022-03-23)

### Bug Fixes

Expand Down
30 changes: 14 additions & 16 deletions dev-tools/dev-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dev-tools/dev-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
},
"dependencies": {
"@supabase/supabase-js": "1.21.3",
"react": "17.0.2",
"react-dom": "17.0.2"
"react": "18.0.0",
"react-dom": "18.0.0"
},
"devDependencies": {
"@snowpack/plugin-dotenv": "2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/k6/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3"
services:
k6:
image: loadimpact/k6:0.36.0
image: loadimpact/k6:0.37.0
volumes:
- ./scripts:/scripts
command: ["run", "/scripts/memory-leaks.js"]
49 changes: 47 additions & 2 deletions dev-tools/rest-client/api.http
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@service_role_key = {{ $dotenv %SUPABASE_SERVICE_ROLE_KEY }}

@auth_token = {{ $dotenv %AUTH_TOKEN }}
@sensor_id = 3
@sensor_id = {{ $dotenv %SENSOR_ID }}

@nice_id = {{ $dotenv %NICE_ID }}

Expand Down Expand Up @@ -119,6 +119,18 @@ Prefer: return=representation
# }
# ]

### delete a record in database using postgrest

# ▄▄▄ ██▓███ ██▓
# ▒████▄ ▓██░ ██▒▓██▒
# ▒██ ▀█▄ ▓██░ ██▓▒▒██▒
# ░██▄▄▄▄██ ▒██▄█▓▒ ▒░██░
# ▓█ ▓██▒▒██▒ ░ ░░██░
# ▒▒ ▓▒█░▒▓▒░ ░ ░░▓
# ▒ ▒▒ ░░▒ ░ ▒ ░
# ░ ▒ ░░ ▒ ░
# ░ ░ ░


### healthcheck

Expand Down Expand Up @@ -216,4 +228,37 @@ POST {{ baseurl }}/integrations/ttn/v3
Content-Type: application/json
Authorization: Bearer {{auth_token}}

{"simulated":true,"end_device_ids":{"application_ids":{"application_id":"foo"},"device_id":"foo"},"received_at":"2021-10-04T14:36:58.082Z","uplink_message":{"decoded_payload":{"foo":"bah","measurements":[1,2,3],"bytes":[1,2,3]},"locations":{"user":{"latitude":13,"longitude":52,"altitude":23,"source":"SOURCE_REGISTRY"}}}}
{"simulated":true,"end_device_ids":{"application_ids":{"application_id":"foo"},"device_id":"foo"},"received_at":"2021-10-04T14:36:58.082Z","uplink_message":{"decoded_payload":{"foo":"bah","measurements":[1,2,3],"bytes":[1,2,3]},"locations":{"user":{"latitude":13,"longitude":52,"altitude":23,"source":"SOURCE_REGISTRY"}}}}


### records create


POST {{supabase_url}}/rest/v1/records
Content-Type: application/json
apikey: {{anon_key}}
Authorization: Bearer {{user_token}}
Prefer: return=representation

{"measurements":[1], "recorded_at":"2021-10-04T14:36:58.082Z","sensor_id": {{sensor_id}}}


### update a record

PATCH {{supabase_url}}/rest/v1/records?id=eq.2
Content-Type: application/json
apikey: {{anon_key}}
Authorization: Bearer {{user_token}}
Prefer: return=representation

{"measurements":[5,2,3,4], "recorded_at":"2021-10-04T14:36:58.082Z","sensor_id": {{sensor_id}}}



### delete a record

DELETE {{supabase_url}}/rest/v1/records?id=eq.2&sensor_id=eq.{{sensor_id}}
Content-Type: application/json
apikey: {{anon_key}}
Authorization: Bearer {{user_token}}
Prefer: return=representation
Loading

0 comments on commit c62d0dc

Please sign in to comment.