@golemio/bicycle-counters 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/.gitkeep
ADDED
|
File without changes
|
|
Binary file
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
# Implementační dokumentace modulu *bicycle-counters*
|
|
2
|
+
|
|
3
|
+
## Záměr
|
|
4
|
+
|
|
5
|
+
Modul slouží k ukládání informací o sčítačích kol v Praze.
|
|
6
|
+
|
|
7
|
+
Dostupní poskytovatelé:
|
|
8
|
+
- Camea
|
|
9
|
+
- EcoCounter
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Vstupní data
|
|
13
|
+
|
|
14
|
+
### Data aktivně stahujeme
|
|
15
|
+
|
|
16
|
+
Měření Camea senzorů jsou validovány a přepočítány každý den o 05:00 (UTC) a můžou být zpětně změněna.
|
|
17
|
+
Data z Camea senzorů obsahují informaci o teplotě.
|
|
18
|
+
|
|
19
|
+
#### *Camea*
|
|
20
|
+
|
|
21
|
+
##### Lokalita
|
|
22
|
+
|
|
23
|
+
- zdroj dat
|
|
24
|
+
- url: `config.datasources.BicycleCountersCamea`
|
|
25
|
+
- parametry dotazu: žádné
|
|
26
|
+
- formát dat
|
|
27
|
+
- protokol: http
|
|
28
|
+
- datový typ: json
|
|
29
|
+
- [validační schéma: datasourceCameaJsonSchema](https://gitlab.com/operator-ict/golemio/code/modules/bicycle-counters/-/blob/development/src/schema-definitions/index.ts)
|
|
30
|
+
- [příklad vstupních dat](https://gitlab.com/operator-ict/golemio/code/modules/bicycle-counters/-/blob/development/test/integration-engine/data/bicyclecounters-camea-datasource.json)
|
|
31
|
+
- frekvence stahování
|
|
32
|
+
- cron definice:
|
|
33
|
+
- `cron.dataplatform.bicyclecounters.refreshCameaDataLastXHoursInDB` (`0 */5 * * * *`)
|
|
34
|
+
- `cron.dataplatform.bicyclecounters.refreshCameaDataPreviousDayInDB` (`0 0 5 * * *`)
|
|
35
|
+
- název rabbitmq fronty
|
|
36
|
+
- `dataplatform.bicyclecounters.refreshCameaDataLastXHoursInDB`
|
|
37
|
+
- `dataplatform.bicyclecounters.refreshCameaDataPreviousDayInDB`
|
|
38
|
+
- `dataplatform.bicyclecounters.refreshCameaDataSpecificDayInDB`
|
|
39
|
+
|
|
40
|
+
##### Měření
|
|
41
|
+
|
|
42
|
+
- zdroj dat
|
|
43
|
+
- url: `config.datasources.BicycleCountersCameaMeasurements`
|
|
44
|
+
- parametry dotazu: žádné
|
|
45
|
+
- formát dat
|
|
46
|
+
- protokol: http
|
|
47
|
+
- datový typ: json
|
|
48
|
+
- [validační schéma: datasourceCameaMeasurementsJsonSchema](https://gitlab.com/operator-ict/golemio/code/modules/bicycle-counters/-/blob/development/src/schema-definitions/index.ts)
|
|
49
|
+
- [příklad vstupních dat](https://gitlab.com/operator-ict/golemio/code/modules/bicycle-counters/-/blob/development/test/integration-engine/data/bicyclecounters-camea-measurements-datasource.json)
|
|
50
|
+
- frekvence stahování
|
|
51
|
+
- cron definice:
|
|
52
|
+
- stahuje se spolu s lokalitou
|
|
53
|
+
- název rabbitmq fronty
|
|
54
|
+
- `dataplatform.bicyclecounters.updateCamea`
|
|
55
|
+
|
|
56
|
+
#### *EcoCounter*
|
|
57
|
+
|
|
58
|
+
##### Lokalita
|
|
59
|
+
|
|
60
|
+
- zdroj dat
|
|
61
|
+
- url: `config.datasources.BicycleCountersEcoCounter`
|
|
62
|
+
- parametry dotazu: Bearer `config.datasources.CountersEcoCounterTokens.PRAHA`
|
|
63
|
+
- formát dat
|
|
64
|
+
- protokol: http
|
|
65
|
+
- datový typ: json
|
|
66
|
+
- [validační schéma: datasourceEcoCounterJsonSchema](https://gitlab.com/operator-ict/golemio/code/modules/bicycle-counters/-/blob/development/src/schema-definitions/index.ts)
|
|
67
|
+
- [příklad vstupních dat](https://gitlab.com/operator-ict/golemio/code/modules/bicycle-counters/-/blob/development/test/integration-engine/data/bicyclecounters-ecocounter-datasource.json)
|
|
68
|
+
- frekvence stahování
|
|
69
|
+
- cron definice:
|
|
70
|
+
- `cron.dataplatform.bicyclecounters.refreshEcoCounterDataInDB` (`0 */5 * * * *`)
|
|
71
|
+
- název rabbitmq fronty
|
|
72
|
+
- `dataplatform.bicyclecounters.refreshEcoCounterDataInDB`
|
|
73
|
+
|
|
74
|
+
##### Měření
|
|
75
|
+
|
|
76
|
+
- zdroj dat
|
|
77
|
+
- url: `config.datasources.BicycleCountersEcoCounterMeasurements`
|
|
78
|
+
- parametry dotazu: Bearer `config.datasources.CountersEcoCounterTokens.PRAHA`
|
|
79
|
+
- formát dat
|
|
80
|
+
- protokol: http
|
|
81
|
+
- datový typ: json
|
|
82
|
+
- [validační schéma: datasourceEcoCounterMeasurementsJsonSchema](https://gitlab.com/operator-ict/golemio/code/modules/bicycle-counters/-/blob/development/src/schema-definitions/index.ts)
|
|
83
|
+
- [příklad vstupních dat](https://gitlab.com/operator-ict/golemio/code/modules/bicycle-counters/-/blob/development/test/integration-engine/data/bicyclecounters-ecocounter-measurements-datasource.json)
|
|
84
|
+
- frekvence stahování
|
|
85
|
+
- cron definice:
|
|
86
|
+
- stahuje se spolu s lokalitou
|
|
87
|
+
- název rabbitmq fronty
|
|
88
|
+
- `dataplatform.bicyclecounters.updateEcoCounter`
|
|
89
|
+
|
|
90
|
+
## Zpracování dat / transformace
|
|
91
|
+
|
|
92
|
+
Popis transformace a případného obohacení dat. Zaměřeno hlavně na workery a jejich metody.
|
|
93
|
+
|
|
94
|
+
### Worker BicycleCountersWorker
|
|
95
|
+
|
|
96
|
+
#### refreshCameaDataLastXHoursInDB
|
|
97
|
+
|
|
98
|
+
- vstupní rabbitmq fronta
|
|
99
|
+
- `dataplatform.bicyclecounters.refreshCameaDataLastXHoursInDB`
|
|
100
|
+
- bez parametrů
|
|
101
|
+
- závislé fronty (do kterých jsou odesílány zprávy z metody workeru)
|
|
102
|
+
- `dataplatform.bicyclecounters.updateCamea`
|
|
103
|
+
- parametry:
|
|
104
|
+
```
|
|
105
|
+
{ id: <vendor_id>, duration: CameaRefreshDurations.last3Hours }
|
|
106
|
+
```
|
|
107
|
+
- datové zdroje
|
|
108
|
+
- dataSourceCamea
|
|
109
|
+
- transformace
|
|
110
|
+
- [CameaTransformation](https://gitlab.com/operator-ict/golemio/code/modules/bicycle-counters/-/blob/development/src/integration-engine/CameaTransformation.ts) - mapování pro `locationsModel` a `directionsModel`
|
|
111
|
+
- data modely
|
|
112
|
+
- locationsModel -> (schéma public) `bicyclecounters_locations`
|
|
113
|
+
- directionsModel -> (schéma public) `bicyclecounters_directions`
|
|
114
|
+
|
|
115
|
+
#### refreshCameaDataPreviousDayInDB
|
|
116
|
+
|
|
117
|
+
- vstupní rabbitmq fronta
|
|
118
|
+
- `dataplatform.bicyclecounters.refreshCameaDataPreviousDayInDB`
|
|
119
|
+
- bez parametrů
|
|
120
|
+
- závislé fronty (do kterých jsou odesílány zprávy z metody workeru)
|
|
121
|
+
- `dataplatform.bicyclecounters.updateCamea`
|
|
122
|
+
- parametry:
|
|
123
|
+
```
|
|
124
|
+
{ id: <vendor_id>, duration: CameaRefreshDurations.previousDay }
|
|
125
|
+
```
|
|
126
|
+
- datové zdroje/transformace/data modely stejně jako `refreshCameaDataLastXHoursInDB`
|
|
127
|
+
|
|
128
|
+
#### refreshCameaDataSpecificDayInDB
|
|
129
|
+
|
|
130
|
+
bez cronu, k zpětné opravě dat
|
|
131
|
+
|
|
132
|
+
- vstupní rabbitmq fronta
|
|
133
|
+
- `dataplatform.bicyclecounters.refreshCameaDataSpecificDayInDB`
|
|
134
|
+
- bez parametrů
|
|
135
|
+
- závislé fronty (do kterých jsou odesílány zprávy z metody workeru)
|
|
136
|
+
- `dataplatform.bicyclecounters.updateCamea`
|
|
137
|
+
- parametry:
|
|
138
|
+
```
|
|
139
|
+
{ id: <vendor_id>, duration: CameaRefreshDurations.specificDay, date: <date, f.e. 2020-12-14> }
|
|
140
|
+
```
|
|
141
|
+
- datové zdroje/transformace/data modely stejně jako `refreshCameaDataLastXHoursInDB`
|
|
142
|
+
|
|
143
|
+
#### updateCamea
|
|
144
|
+
|
|
145
|
+
- vstupní rabbitmq fronta
|
|
146
|
+
- `dataplatform.bicyclecounters.updateCamea`
|
|
147
|
+
- parametry:
|
|
148
|
+
```
|
|
149
|
+
{ id: <vendor_id>, duration: CameaRefreshDurations.specificDay, date: <date, f.e. 2020-12-14> }
|
|
150
|
+
```
|
|
151
|
+
- datové zdroje
|
|
152
|
+
- dataSourceCameaMeasurements
|
|
153
|
+
- transformace
|
|
154
|
+
- [CameaMeasurementsTransformation](https://gitlab.com/operator-ict/golemio/code/modules/bicycle-counters/-/blob/development/src/integration-engine/https://gitlab.com/operator-ict/golemio/code/modules/bicycle-counters/-/blob/development/src/integration-engine/CameaMeasurementsTransformation.ts) mapování pro `detectionsModel` a `temperaturesModel`
|
|
155
|
+
- data modely
|
|
156
|
+
- detectionsModel -> (schéma public) `bicyclecounters_detections`
|
|
157
|
+
- temperaturesModel -> (schéma public) `bicyclecounters_temperatures`
|
|
158
|
+
|
|
159
|
+
#### refreshEcoCounterDataInDB
|
|
160
|
+
|
|
161
|
+
- vstupní rabbitmq fronta
|
|
162
|
+
- `dataplatform.bicyclecounters.refreshEcoCounterDataInDB`
|
|
163
|
+
- bez parametrů
|
|
164
|
+
- závislé fronty (do kterých jsou odesílány zprávy z metody workeru)
|
|
165
|
+
- `dataplatform.bicyclecounters.updateEcoCounter`
|
|
166
|
+
- parametry:
|
|
167
|
+
```
|
|
168
|
+
{ category: "bicycle", directions_id: <id>, id: <vendor_id>, locations_id: <locations_id> }
|
|
169
|
+
```
|
|
170
|
+
- datové zdroje
|
|
171
|
+
- dataSourceEcoCounter
|
|
172
|
+
- transformace
|
|
173
|
+
- [EcoCounterTransformation](https://gitlab.com/operator-ict/golemio/code/modules/bicycle-counters/-/blob/development/src/integration-engine/EcoCounterTransformation.ts) - mapování pro `locationsModel` a `directionsModel`
|
|
174
|
+
- data modely
|
|
175
|
+
- locationsModel -> (schéma public) `bicyclecounters_locations`
|
|
176
|
+
- directionsModel -> (schéma public) `bicyclecounters_directions`
|
|
177
|
+
|
|
178
|
+
#### updateEcoCounter
|
|
179
|
+
|
|
180
|
+
- vstupní rabbitmq fronta
|
|
181
|
+
- `dataplatform.bicyclecounters.updateEcoCounter`
|
|
182
|
+
- parametry:
|
|
183
|
+
```
|
|
184
|
+
{ category: "bicycle", directions_id: <id>, id: <vendor_id>, locations_id: <locations_id> }
|
|
185
|
+
```
|
|
186
|
+
- datové zdroje
|
|
187
|
+
- dataSourceEcoCounterMeasurements
|
|
188
|
+
- transformace
|
|
189
|
+
- [EcoCounterMeasurementsTransformation](https://gitlab.com/operator-ict/golemio/code/modules/bicycle-counters/-/blob/development/src/integration-engine/https://gitlab.com/operator-ict/golemio/code/modules/bicycle-counters/-/blob/development/src/integration-engine/EcoCounterMeasurementsTransformation.ts) mapování pro `detectionsModel` a `temperaturesModel`
|
|
190
|
+
- data modely
|
|
191
|
+
- detectionsModel -> (schéma public) `bicyclecounters_detections`
|
|
192
|
+
- temperaturesModel -> (schéma public) `bicyclecounters_temperatures`
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
## Uložení dat
|
|
196
|
+
|
|
197
|
+
Popis ukládání dat.
|
|
198
|
+
|
|
199
|
+
### Obecné
|
|
200
|
+
|
|
201
|
+
- typ databáze
|
|
202
|
+
- PSQL
|
|
203
|
+
- databázové schéma
|
|
204
|
+
- 
|
|
205
|
+
- retence dat
|
|
206
|
+
- `locationsModel` a `directionsModel` update
|
|
207
|
+
- `detectionsModel` a `temperaturesModel` historizace bez promazávání
|
|
208
|
+
|
|
209
|
+
### *Název datového modelu*
|
|
210
|
+
|
|
211
|
+
- schéma a název tabulky / kolekce
|
|
212
|
+
- struktura tabulky / kolekce
|
|
213
|
+
- odkaz na schéma, případně na migrační skripty
|
|
214
|
+
- ukázka dat
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
## Output API
|
|
218
|
+
|
|
219
|
+
### Obecné
|
|
220
|
+
|
|
221
|
+
- OpenAPI v3 dokumentace
|
|
222
|
+
- [odkaz na dokumentaci](https://gitlab.com/operator-ict/golemio/code/modules/bicycle-counters/-/blob/development/docs/openapi.yaml)
|
|
223
|
+
- veřejné / neveřejné endpointy
|
|
224
|
+
- api je veřejné
|
|
225
|
+
- postman kolekce
|
|
226
|
+
- TBD
|
|
227
|
+
|
|
228
|
+
#### */bicyclecounters*
|
|
229
|
+
|
|
230
|
+
- zdrojové tabulky
|
|
231
|
+
- `bicyclecounters_locations`
|
|
232
|
+
- `bicyclecounters_directions`
|
|
233
|
+
|
|
234
|
+
#### */bicyclecounters/detections*
|
|
235
|
+
|
|
236
|
+
- zdrojové tabulky
|
|
237
|
+
- `bicyclecounters_detections`
|
|
238
|
+
|
|
239
|
+
- (volitelně) nestandardní url a query parametry
|
|
240
|
+
- `aggregate: boolean` umožňuje agregaci dle `directions_id`
|
|
241
|
+
|
|
242
|
+
#### */bicyclecounters/temperatures*
|
|
243
|
+
|
|
244
|
+
- zdrojové tabulky
|
|
245
|
+
- `bicyclecounters_temperatures`
|
|
246
|
+
|
|
247
|
+
- (volitelně) nestandardní url a query parametry
|
|
248
|
+
- `aggregate: boolean` umožňuje agregaci dle `locations_id`
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
openapi: 3.0.1
|
|
2
|
+
info:
|
|
3
|
+
title: Bicycle Counter
|
|
4
|
+
description: |
|
|
5
|
+
| Vendor | Vendor id prefix | Measurement time aggregation | Temperature availability |
|
|
6
|
+
| - | - | - | - |
|
|
7
|
+
| Camea | `camea-` | 5 minutes | available |
|
|
8
|
+
| EcoCounter | `ecoCounter-` | 15 minutes | not available |
|
|
9
|
+
⚠️ Measurements of vendor Camea are every day at 5:00am (UTC) validated and recalculated and can change then.
|
|
10
|
+
version: 1.0.0
|
|
11
|
+
tags:
|
|
12
|
+
- name: Bicycle Counter
|
|
13
|
+
paths:
|
|
14
|
+
/bicyclecounters/:
|
|
15
|
+
get:
|
|
16
|
+
tags:
|
|
17
|
+
- Bicycle Counter
|
|
18
|
+
summary: GET All Bicycle Counters
|
|
19
|
+
parameters:
|
|
20
|
+
- name: latlng
|
|
21
|
+
in: query
|
|
22
|
+
description: Sorting by location (Latitude and Longitude separated by comma,
|
|
23
|
+
latitude first).
|
|
24
|
+
schema:
|
|
25
|
+
type: string
|
|
26
|
+
example: 50.124935,14.457204
|
|
27
|
+
- name: range
|
|
28
|
+
in: query
|
|
29
|
+
description: Filter by distance from latlng in meters (range query). Depends
|
|
30
|
+
on the latlng parameter.
|
|
31
|
+
schema:
|
|
32
|
+
type: number
|
|
33
|
+
example: 5000
|
|
34
|
+
- name: limit
|
|
35
|
+
in: query
|
|
36
|
+
description: Limits number of retrieved items. The maximum is 10000 (default
|
|
37
|
+
value).
|
|
38
|
+
schema:
|
|
39
|
+
type: number
|
|
40
|
+
example: 10
|
|
41
|
+
- name: offset
|
|
42
|
+
in: query
|
|
43
|
+
description: Number of the first items that are skipped.
|
|
44
|
+
schema:
|
|
45
|
+
type: number
|
|
46
|
+
example: 0
|
|
47
|
+
- name: x-access-token
|
|
48
|
+
in: header
|
|
49
|
+
description: e.g. YOUR_ACCESS_TOKEN
|
|
50
|
+
schema:
|
|
51
|
+
type: string
|
|
52
|
+
example: YOUR_ACCESS_TOKEN
|
|
53
|
+
responses:
|
|
54
|
+
200:
|
|
55
|
+
description: OK
|
|
56
|
+
content:
|
|
57
|
+
application/json; charset=utf-8:
|
|
58
|
+
schema:
|
|
59
|
+
required:
|
|
60
|
+
- type
|
|
61
|
+
type: object
|
|
62
|
+
properties:
|
|
63
|
+
type:
|
|
64
|
+
type: string
|
|
65
|
+
features:
|
|
66
|
+
type: array
|
|
67
|
+
items:
|
|
68
|
+
$ref: '#/components/schemas/FeaturePoint'
|
|
69
|
+
example:
|
|
70
|
+
type: FeatureCollection
|
|
71
|
+
features:
|
|
72
|
+
- geometry:
|
|
73
|
+
type: Point
|
|
74
|
+
coordinates:
|
|
75
|
+
- 14.4633
|
|
76
|
+
- 50.07827
|
|
77
|
+
properties:
|
|
78
|
+
id: camea-BC_AT-STLA
|
|
79
|
+
name: Altetická
|
|
80
|
+
route: A140
|
|
81
|
+
updated_at: "2019-05-18T07:38:37.000Z"
|
|
82
|
+
directions:
|
|
83
|
+
- id: BC_AT_ST
|
|
84
|
+
name: Strahov
|
|
85
|
+
type: Feature
|
|
86
|
+
404:
|
|
87
|
+
description: Not found
|
|
88
|
+
content:
|
|
89
|
+
application/json; charset=utf-8:
|
|
90
|
+
schema:
|
|
91
|
+
$ref: '#/components/schemas/Error'
|
|
92
|
+
example:
|
|
93
|
+
error_message: Not Found
|
|
94
|
+
error_status: 404
|
|
95
|
+
403:
|
|
96
|
+
description: Forbidden
|
|
97
|
+
content:
|
|
98
|
+
application/json; charset=utf-8:
|
|
99
|
+
schema:
|
|
100
|
+
$ref: '#/components/schemas/Error'
|
|
101
|
+
example:
|
|
102
|
+
error_message: Forbidden
|
|
103
|
+
error_status: 403
|
|
104
|
+
/bicyclecounters/detections:
|
|
105
|
+
get:
|
|
106
|
+
tags:
|
|
107
|
+
- Bicycle Counter
|
|
108
|
+
summary: GET Bicycle Counters Detections
|
|
109
|
+
parameters:
|
|
110
|
+
- name: limit
|
|
111
|
+
in: query
|
|
112
|
+
description: Limits number of retrieved items. The maximum is 10000 (default
|
|
113
|
+
value).
|
|
114
|
+
schema:
|
|
115
|
+
type: number
|
|
116
|
+
example: 10
|
|
117
|
+
- name: offset
|
|
118
|
+
in: query
|
|
119
|
+
description: Number of the first items that are skipped.
|
|
120
|
+
schema:
|
|
121
|
+
type: number
|
|
122
|
+
example: 0
|
|
123
|
+
- name: from
|
|
124
|
+
in: query
|
|
125
|
+
description: Date in ISO8601, limits data measured from this datetime
|
|
126
|
+
schema:
|
|
127
|
+
type: string
|
|
128
|
+
example: "2019-05-16T04:27:58.000Z"
|
|
129
|
+
- name: to
|
|
130
|
+
in: query
|
|
131
|
+
description: Date in ISO8601, limits data measured up until this datetime
|
|
132
|
+
schema:
|
|
133
|
+
type: string
|
|
134
|
+
example: "2019-05-18T04:27:58.000Z"
|
|
135
|
+
- name: aggregate
|
|
136
|
+
in: query
|
|
137
|
+
description: sum aggregated by directions_id is returned
|
|
138
|
+
schema:
|
|
139
|
+
type: boolean
|
|
140
|
+
example: true
|
|
141
|
+
- name: id
|
|
142
|
+
in: query
|
|
143
|
+
description: direction ids
|
|
144
|
+
schema:
|
|
145
|
+
type: string
|
|
146
|
+
example: camea-BC_ZA-BO
|
|
147
|
+
- name: x-access-token
|
|
148
|
+
in: header
|
|
149
|
+
description: e.g. YOUR_ACCESS_TOKEN
|
|
150
|
+
schema:
|
|
151
|
+
type: string
|
|
152
|
+
example: YOUR_ACCESS_TOKEN
|
|
153
|
+
responses:
|
|
154
|
+
200:
|
|
155
|
+
description: OK
|
|
156
|
+
content:
|
|
157
|
+
application/json; charset=utf-8:
|
|
158
|
+
schema:
|
|
159
|
+
type: array
|
|
160
|
+
items:
|
|
161
|
+
$ref: '#/components/schemas/BicycleCounterDetections'
|
|
162
|
+
example:
|
|
163
|
+
- id: camea-BC_ZA-BO
|
|
164
|
+
value: 3
|
|
165
|
+
value_pedestrians: 7
|
|
166
|
+
locations_id: camea-BC_PN-VYBR
|
|
167
|
+
measured_from: "2019-05-18T07:38:37.000Z"
|
|
168
|
+
measured_to: "2019-05-18T07:38:37.000Z"
|
|
169
|
+
measurement_count: 1
|
|
170
|
+
404:
|
|
171
|
+
description: Not found
|
|
172
|
+
content:
|
|
173
|
+
application/json; charset=utf-8:
|
|
174
|
+
schema:
|
|
175
|
+
$ref: '#/components/schemas/Error'
|
|
176
|
+
example:
|
|
177
|
+
error_message: Not Found
|
|
178
|
+
error_status: 404
|
|
179
|
+
403:
|
|
180
|
+
description: Forbidden
|
|
181
|
+
content:
|
|
182
|
+
application/json; charset=utf-8:
|
|
183
|
+
schema:
|
|
184
|
+
$ref: '#/components/schemas/Error'
|
|
185
|
+
example:
|
|
186
|
+
error_message: Forbidden
|
|
187
|
+
error_status: 403
|
|
188
|
+
/bicyclecounters/temperatures:
|
|
189
|
+
get:
|
|
190
|
+
tags:
|
|
191
|
+
- Bicycle Counter
|
|
192
|
+
summary: GET Bicycle Counters Temperatures
|
|
193
|
+
parameters:
|
|
194
|
+
- name: limit
|
|
195
|
+
in: query
|
|
196
|
+
description: Limits number of retrieved items. The maximum is 10000 (default
|
|
197
|
+
value).
|
|
198
|
+
schema:
|
|
199
|
+
type: number
|
|
200
|
+
example: 10
|
|
201
|
+
- name: offset
|
|
202
|
+
in: query
|
|
203
|
+
description: Number of the first items that are skipped.
|
|
204
|
+
schema:
|
|
205
|
+
type: number
|
|
206
|
+
example: 0
|
|
207
|
+
- name: from
|
|
208
|
+
in: query
|
|
209
|
+
description: Date in ISO8601, limits data measured from this datetime
|
|
210
|
+
schema:
|
|
211
|
+
type: string
|
|
212
|
+
example: "2019-05-16T04:27:58.000Z"
|
|
213
|
+
- name: to
|
|
214
|
+
in: query
|
|
215
|
+
description: Date in ISO8601, limits data measured up until this datetime
|
|
216
|
+
schema:
|
|
217
|
+
type: string
|
|
218
|
+
example: "2019-05-18T04:27:58.000Z"
|
|
219
|
+
- name: aggregate
|
|
220
|
+
in: query
|
|
221
|
+
description: average aggregated by locations_id is returned
|
|
222
|
+
schema:
|
|
223
|
+
type: boolean
|
|
224
|
+
example: true
|
|
225
|
+
- name: id
|
|
226
|
+
in: query
|
|
227
|
+
description: location ids
|
|
228
|
+
schema:
|
|
229
|
+
type: array
|
|
230
|
+
items:
|
|
231
|
+
type: string
|
|
232
|
+
example: camea-BC_ZA-KLBO
|
|
233
|
+
- name: x-access-token
|
|
234
|
+
in: header
|
|
235
|
+
description: e.g. YOUR_ACCESS_TOKEN
|
|
236
|
+
schema:
|
|
237
|
+
type: string
|
|
238
|
+
example: YOUR_ACCESS_TOKEN
|
|
239
|
+
responses:
|
|
240
|
+
200:
|
|
241
|
+
description: OK
|
|
242
|
+
content:
|
|
243
|
+
application/json; charset=utf-8:
|
|
244
|
+
schema:
|
|
245
|
+
type: array
|
|
246
|
+
items:
|
|
247
|
+
$ref: '#/components/schemas/BicycleCounterTemperatures'
|
|
248
|
+
example:
|
|
249
|
+
- id: camea-BC_AT-STLA
|
|
250
|
+
value: 3
|
|
251
|
+
measured_from: "2019-05-18T07:38:37.000Z"
|
|
252
|
+
measured_to: "2019-05-18T07:38:37.000Z"
|
|
253
|
+
measurement_count: 1
|
|
254
|
+
404:
|
|
255
|
+
description: Not found
|
|
256
|
+
content:
|
|
257
|
+
application/json; charset=utf-8:
|
|
258
|
+
schema:
|
|
259
|
+
$ref: '#/components/schemas/Error'
|
|
260
|
+
example:
|
|
261
|
+
error_message: Not Found
|
|
262
|
+
error_status: 404
|
|
263
|
+
403:
|
|
264
|
+
description: Forbidden
|
|
265
|
+
content:
|
|
266
|
+
application/json; charset=utf-8:
|
|
267
|
+
schema:
|
|
268
|
+
$ref: '#/components/schemas/Error'
|
|
269
|
+
example:
|
|
270
|
+
error_message: Forbidden
|
|
271
|
+
error_status: 403
|
|
272
|
+
components:
|
|
273
|
+
schemas:
|
|
274
|
+
Point:
|
|
275
|
+
type: array
|
|
276
|
+
items:
|
|
277
|
+
type: number
|
|
278
|
+
minItems: 2
|
|
279
|
+
maxItems: 2
|
|
280
|
+
example:
|
|
281
|
+
- 14.4633
|
|
282
|
+
- 50.07827
|
|
283
|
+
Error:
|
|
284
|
+
title: Error
|
|
285
|
+
required:
|
|
286
|
+
- error_message
|
|
287
|
+
- error_status
|
|
288
|
+
type: object
|
|
289
|
+
properties:
|
|
290
|
+
error_message:
|
|
291
|
+
type: string
|
|
292
|
+
example: Forbidden
|
|
293
|
+
error_status:
|
|
294
|
+
type: number
|
|
295
|
+
example: 403
|
|
296
|
+
FeaturePoint:
|
|
297
|
+
title: Feature Point
|
|
298
|
+
required:
|
|
299
|
+
- geometry
|
|
300
|
+
- properties
|
|
301
|
+
- type
|
|
302
|
+
type: object
|
|
303
|
+
properties:
|
|
304
|
+
geometry:
|
|
305
|
+
required:
|
|
306
|
+
- coordinates
|
|
307
|
+
- type
|
|
308
|
+
type: object
|
|
309
|
+
properties:
|
|
310
|
+
type:
|
|
311
|
+
type: string
|
|
312
|
+
coordinates:
|
|
313
|
+
$ref: '#/components/schemas/Point'
|
|
314
|
+
properties:
|
|
315
|
+
$ref: '#/components/schemas/BicycleCounter'
|
|
316
|
+
type:
|
|
317
|
+
type: string
|
|
318
|
+
BicycleCounter:
|
|
319
|
+
title: Bicycle Counter
|
|
320
|
+
required:
|
|
321
|
+
- id
|
|
322
|
+
- name
|
|
323
|
+
type: object
|
|
324
|
+
properties:
|
|
325
|
+
id:
|
|
326
|
+
type: string
|
|
327
|
+
example: camea-BC_AT-STLA
|
|
328
|
+
name:
|
|
329
|
+
type: string
|
|
330
|
+
example: Altetická
|
|
331
|
+
route:
|
|
332
|
+
type: string
|
|
333
|
+
example: A140
|
|
334
|
+
updated_at:
|
|
335
|
+
type: string
|
|
336
|
+
example: "2019-05-18T07:38:37.000Z"
|
|
337
|
+
directions:
|
|
338
|
+
type: array
|
|
339
|
+
items:
|
|
340
|
+
$ref: '#/components/schemas/BicycleCounterDirection'
|
|
341
|
+
BicycleCounterDetections:
|
|
342
|
+
title: Bicycle Counter Detections
|
|
343
|
+
type: object
|
|
344
|
+
properties:
|
|
345
|
+
id:
|
|
346
|
+
type: string
|
|
347
|
+
description: direction_id
|
|
348
|
+
example: camea-BC_ZA-BO
|
|
349
|
+
value:
|
|
350
|
+
type: number
|
|
351
|
+
example: 3
|
|
352
|
+
value_pedestrians:
|
|
353
|
+
type: number
|
|
354
|
+
example: 7
|
|
355
|
+
locations_id:
|
|
356
|
+
type: string
|
|
357
|
+
example: camea-BC_PN-VYBR
|
|
358
|
+
measured_from:
|
|
359
|
+
type: string
|
|
360
|
+
example: 2019-05-18T07:38:37.000Z
|
|
361
|
+
measured_to:
|
|
362
|
+
type: string
|
|
363
|
+
example: 2019-05-18T07:38:37.000Z
|
|
364
|
+
measurement_count:
|
|
365
|
+
type: number
|
|
366
|
+
example: 1
|
|
367
|
+
BicycleCounterDirection:
|
|
368
|
+
title: Bicycle Counter Direction
|
|
369
|
+
required:
|
|
370
|
+
- id
|
|
371
|
+
type: object
|
|
372
|
+
properties:
|
|
373
|
+
id:
|
|
374
|
+
type: string
|
|
375
|
+
description: direction ID
|
|
376
|
+
example: BC_AT_ST
|
|
377
|
+
name:
|
|
378
|
+
type: string
|
|
379
|
+
description: direction name
|
|
380
|
+
example: Strahov
|
|
381
|
+
BicycleCounterTemperatures:
|
|
382
|
+
title: Bicycle Counter Temperatures
|
|
383
|
+
type: object
|
|
384
|
+
properties:
|
|
385
|
+
id:
|
|
386
|
+
type: string
|
|
387
|
+
description: location_id
|
|
388
|
+
example: camea-BC_AT-STLA
|
|
389
|
+
value:
|
|
390
|
+
type: number
|
|
391
|
+
example: 3
|
|
392
|
+
measured_from:
|
|
393
|
+
type: string
|
|
394
|
+
example: "2019-05-18T07:38:37.000Z"
|
|
395
|
+
measured_to:
|
|
396
|
+
type: string
|
|
397
|
+
example: "2019-05-18T07:38:37.000Z"
|
|
398
|
+
measurement_count:
|
|
399
|
+
type: number
|
|
400
|
+
example: 1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/bicycle-counters",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Golemio Bicycle Counters Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@commitlint/cli": "^11.0.0",
|
|
29
29
|
"@commitlint/config-conventional": "^11.0.0",
|
|
30
|
-
"@golemio/core": "1.2.
|
|
31
|
-
"@golemio/eslint-config": "^1.0
|
|
32
|
-
"@golemio/schema-definitions": "2.0.
|
|
30
|
+
"@golemio/core": "1.2.14",
|
|
31
|
+
"@golemio/eslint-config": "^1.1.0",
|
|
32
|
+
"@golemio/schema-definitions": "2.0.39",
|
|
33
33
|
"@ovos-media/ts-transform-paths": "^1.7.18-1",
|
|
34
34
|
"@types/chai": "4.2.3",
|
|
35
35
|
"@types/chai-as-promised": "7.1.2",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"chai-as-promised": "7.1.1",
|
|
43
43
|
"cross-env": "^7.0.3",
|
|
44
44
|
"dotenv": "^8.2.0",
|
|
45
|
-
"eslint": "^
|
|
45
|
+
"eslint": "^8.1.1",
|
|
46
46
|
"husky": "^4.3.7",
|
|
47
47
|
"mocha": "^8.2.1",
|
|
48
48
|
"npm-run-all": "^4.1.5",
|
|
49
49
|
"nyc": "^15.1.0",
|
|
50
|
-
"prettier": "^2.
|
|
50
|
+
"prettier": "^2.5.1",
|
|
51
51
|
"pretty-quick": "^3.1.0",
|
|
52
52
|
"rimraf": "^3.0.2",
|
|
53
53
|
"sinon": "^9.2.3",
|