@golemio/flow 1.2.14-dev.1288385588 → 1.2.14-dev.1311678859

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.
@@ -1,10 +1,12 @@
1
1
  /// <reference types="express" />
2
- import { NextFunction, Request, Response, Router } from "@golemio/core/dist/shared/express";
2
+ import { CacheHeaderMiddleware } from "@golemio/core/dist/output-gateway/CacheHeaderMiddleware";
3
3
  import { BaseRouter } from "@golemio/core/dist/output-gateway/routes/BaseRouter";
4
+ import { NextFunction, Request, Response, Router } from "@golemio/core/dist/shared/express";
4
5
  import { PedestriansLocationsModel, PedestriansMeasurementsModel } from "./models";
5
6
  export declare class PedestriansRouter extends BaseRouter {
6
7
  protected pedestriansLocationsModel: PedestriansLocationsModel;
7
8
  protected pedestriansMeasurementsModel: PedestriansMeasurementsModel;
9
+ protected cacheHeaderMiddleware: CacheHeaderMiddleware;
8
10
  constructor();
9
11
  GetPedestriansLocations: (req: Request, res: Response, next: NextFunction) => Promise<Response<any, Record<string, any>> | undefined>;
10
12
  GetPedestriansMeasurements: (req: Request, res: Response, next: NextFunction) => Promise<Response<any, Record<string, any>> | undefined>;
@@ -10,10 +10,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.pedestriansRouter = exports.PedestriansRouter = void 0;
13
- const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
14
- const redis_1 = require("@golemio/core/dist/output-gateway/redis");
15
- const BaseRouter_1 = require("@golemio/core/dist/output-gateway/routes/BaseRouter");
13
+ const Di_1 = require("./ioc/Di");
16
14
  const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
15
+ const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
16
+ const BaseRouter_1 = require("@golemio/core/dist/output-gateway/routes/BaseRouter");
17
+ const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
17
18
  const models_1 = require("./models");
18
19
  class PedestriansRouter extends BaseRouter_1.BaseRouter {
19
20
  constructor() {
@@ -56,16 +57,17 @@ class PedestriansRouter extends BaseRouter_1.BaseRouter {
56
57
  next(err);
57
58
  }
58
59
  });
60
+ this.cacheHeaderMiddleware = Di_1.FlowContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
59
61
  this.router.get("/locations", [
60
62
  (0, express_validator_1.query)("locationId").optional().not().isEmpty({ ignore_whitespace: true }).not().isArray(),
61
63
  (0, express_validator_1.query)("locationName").optional().not().isEmpty({ ignore_whitespace: true }).not().isArray(),
62
- ], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("PedestriansRouter"), (0, redis_1.useCacheMiddleware)(), this.GetPedestriansLocations);
64
+ ], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("PedestriansRouter"), this.cacheHeaderMiddleware.getMiddleware(60 * 60, 300), this.GetPedestriansLocations);
63
65
  this.router.get("/measurements", [
64
66
  (0, express_validator_1.query)("locationId").optional().not().isEmpty({ ignore_whitespace: true }).not().isArray(),
65
67
  (0, express_validator_1.query)("directionId").optional().not().isEmpty({ ignore_whitespace: true }).not().isArray(),
66
68
  (0, express_validator_1.query)("from").optional().isISO8601().not().isArray(),
67
69
  (0, express_validator_1.query)("to").optional().isISO8601().not().isArray(),
68
- ], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("PedestriansRouter"), (0, redis_1.useCacheMiddleware)(), this.GetPedestriansMeasurements);
70
+ ], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("PedestriansRouter"), this.cacheHeaderMiddleware.getMiddleware(60 * 60, 300), this.GetPedestriansMeasurements);
69
71
  }
70
72
  }
71
73
  exports.PedestriansRouter = PedestriansRouter;
@@ -1 +1 @@
1
- {"version":3,"file":"PedestriansRouter.js","sourceRoot":"","sources":["../../src/output-gateway/PedestriansRouter.ts"],"names":[],"mappings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,EAC9C,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,EAAE,GAAG,CAAC,EACtD,IAAI,CAAC,uBAAuB,CAC/B,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,eAAe,EACf;YACI,IAAA,yBAAK,EAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;YACzF,IAAA,yBAAK,EAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;YAC1F,IAAA,yBAAK,EAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;YACpD,IAAA,yBAAK,EAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;SACrD,EACD,uBAAU,EACV,wBAAW,EACX,IAAA,sCAAyB,EAAC,mBAAmB,CAAC,EAC9C,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,EAAE,GAAG,CAAC,EACtD,IAAI,CAAC,0BAA0B,CAClC,CAAC;IACN,CAAC;CAmCJ;AAtED,8CAsEC;AAED,MAAM,iBAAiB,GAAW,IAAI,iBAAiB,EAAE,CAAC,MAAM,CAAC;AAExD,8CAAiB"}
@@ -0,0 +1,3 @@
1
+ import { DependencyContainer } from "@golemio/core/dist/shared/tsyringe";
2
+ declare const flowContainer: DependencyContainer;
3
+ export { flowContainer as FlowContainer };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FlowContainer = void 0;
4
+ const Di_1 = require("@golemio/core/dist/output-gateway/ioc/Di");
5
+ //#region Initialization
6
+ const flowContainer = Di_1.OutputGatewayContainer.createChildContainer();
7
+ exports.FlowContainer = flowContainer;
8
+ //# sourceMappingURL=Di.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../src/output-gateway/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,iEAAkF;AAGlF,wBAAwB;AACxB,MAAM,aAAa,GAAwB,2BAAsB,CAAC,oBAAoB,EAAE,CAAC;AAG/D,sCAAa"}
package/docs/openapi.yaml CHANGED
@@ -1,248 +1,260 @@
1
- openapi: 3.0.3
2
-
3
- info:
4
- title: 🚶 Pedestrians
5
- description: Locations and Measurements of movement
6
- version: 1.0.0
7
- contact:
8
- name: Golemio Prague Data Platform
9
- email: golemio@operatorict.cz
10
- url: https://golemio.cz
11
-
12
- servers:
13
- - url: https://api.golemio.cz
14
- description: Main (production) server
15
- - url: https://rabin.golemio.cz
16
- description: Test (development) server
17
-
18
- tags:
19
- - name: 🚶 Pedestrians (v2)
20
- description: 💡 Locations and Measurements of movement
21
- paths:
22
- /v2/pedestrians/locations:
23
- get:
24
- summary: Get locations and directions
25
- description: ""
26
- tags:
27
- - 🚶 Pedestrians (v2)
28
- parameters:
29
- - name: locationId
30
- in: query
31
- description: Lists only locations with this ID
32
- required: false
33
- schema:
34
- type: integer
35
- format: int64
36
- - name: locationName
37
- in: query
38
- description: Lists only locations with this NAME
39
- required: false
40
- schema:
41
- type: string
42
- - name: limit
43
- in: query
44
- description: Limits number of retrieved items
45
- required: false
46
- schema:
47
- type: integer
48
- format: int64
49
- - name: offset
50
- in: query
51
- description: Number of the first items that are skipped
52
- required: false
53
- schema:
54
- type: integer
55
- format: int64
56
- responses:
57
- "200":
58
- description: successful operation
59
- content:
60
- application/json:
61
- schema:
62
- $ref: "#/components/schemas/PedestriansLocation"
63
- "401":
64
- $ref: "#/components/responses/UnauthorizedError"
65
- "404":
66
- description: Location not found
67
-
68
- /v2/pedestrians/measurements:
69
- get:
70
- summary: GET measurements of pedestrian traffic
71
- description: ""
72
- tags:
73
- - 🚶 Pedestrians (v2)
74
- parameters:
75
- - name: locationId
76
- in: query
77
- description: Lists only measurements for this location
78
- required: false
79
- schema:
80
- type: integer
81
- format: int64
82
- example: 0
83
- - name: directionId
84
- in: query
85
- description: Lists only measurements for this direction
86
- required: false
87
- schema:
88
- type: integer
89
- format: int64
90
- example: 4
91
- - name: limit
92
- in: query
93
- description: Limits number of retrieved items
94
- required: false
95
- schema:
96
- type: integer
97
- format: int64
98
- example: 1
99
- - name: offset
100
- in: query
101
- description: Number of the first items that are skipped
102
- required: false
103
- schema:
104
- type: integer
105
- format: int64
106
- example: 1
107
- - name: from
108
- in: query
109
- description: Date in ISO8601, limits data measured from this datetime
110
- required: false
111
- schema:
112
- type: string
113
- format: date
114
- example: 2020-09-01T01:15:00.000Z
115
- - name: to
116
- in: query
117
- description: Date in ISO8601, limits data measured up until this datetime
118
- required: false
119
- schema:
120
- type: string
121
- format: date
122
- example: 2020-10-22T01:15:00.000Z
123
- responses:
124
- "200":
125
- description: successful operation
126
- content:
127
- application/json:
128
- schema:
129
- $ref: "#/components/schemas/PedestriansMeasurement"
130
- "401":
131
- $ref: "#/components/responses/UnauthorizedError"
132
- "404":
133
- description: Location not found
134
-
135
- components:
136
- responses:
137
- UnauthorizedError:
138
- description: API key is missing or invalid
139
- headers:
140
- WWW_Authenticate:
141
- schema:
142
- type: string
143
-
144
- schemas:
145
- PedestriansLocation:
146
- type: object
147
- properties:
148
- id:
149
- type: string
150
- description: Location id
151
- example: "2"
152
- location_name:
153
- type: string
154
- example: Rytířská 12
155
- lat:
156
- type: string
157
- example: "50.084781715549276"
158
- lng:
159
- type: string
160
- example: "14.422412102465428"
161
- address:
162
- type: string
163
- example: Na Můstku 12
164
- city_district:
165
- type: string
166
- example: Praha 1
167
- tech:
168
- type: string
169
- example: kamera
170
- map_url:
171
- type: string
172
- example: https://storage.golemio.cz/intenzita-pesi-dopravy/2-map.png
173
- photo_url:
174
- type: string
175
- example: https://storage.golemio.cz/intenzita-pesi-dopravy/2.png
176
- measurement_start:
177
- type: string
178
- format: date
179
- example: 2020-09-02 12:00
180
- measurement_end:
181
- type: string
182
- format: date
183
- example: 2020-09-05 12:00
184
- directions:
185
- type: array
186
- items:
187
- $ref: "#/components/schemas/PedestriansDirection"
188
- required:
189
- - id
190
- - location_name
191
- - lat
192
- - lng
193
- - address
194
- - city_district
195
- - tech
196
- - map_url
197
- - photo_url
198
- - measurement_start
199
-
200
- PedestriansDirection:
201
- type: object
202
- properties:
203
- id:
204
- type: integer
205
- format: int64
206
- example: "2"
207
- name:
208
- type: string
209
- example: Můstek
210
- to:
211
- type: integer
212
- format: int64
213
- example: "1"
214
- required:
215
- - id
216
- - name
217
- - to
218
-
219
- PedestriansMeasurement:
220
- type: object
221
- properties:
222
- location_id:
223
- type: string
224
- example: "1"
225
- direction_id:
226
- type: string
227
- example: "3"
228
- value:
229
- type: string
230
- example: "114"
231
- quality:
232
- type: string
233
- example: "1.00000000000000000000"
234
- measured_from:
235
- type: string
236
- format: date
237
- example: 2020-08-21T17:30:00.000Z
238
- measured_to:
239
- type: string
240
- format: date
241
- example: 2020-08-21T17:45:00.000Z
242
- required:
243
- - location_id
244
- - direction_id
245
- - value
246
- - quality
247
- - measured_from
248
- - measured_to
1
+ openapi: 3.0.3
2
+
3
+ info:
4
+ title: 🚶 Pedestrians
5
+ description: Locations and Measurements of movement
6
+ version: 1.0.0
7
+ contact:
8
+ name: Golemio Prague Data Platform
9
+ email: golemio@operatorict.cz
10
+ url: https://golemio.cz
11
+
12
+ servers:
13
+ - url: https://api.golemio.cz
14
+ description: Main (production) server
15
+ - url: https://rabin.golemio.cz
16
+ description: Test (development) server
17
+
18
+ tags:
19
+ - name: 🚶 Pedestrians (v2)
20
+ description: 💡 Locations and Measurements of movement
21
+ paths:
22
+ /v2/pedestrians/locations:
23
+ get:
24
+ summary: Get locations and directions
25
+ description: ""
26
+ tags:
27
+ - 🚶 Pedestrians (v2)
28
+ parameters:
29
+ - name: locationId
30
+ in: query
31
+ description: Lists only locations with this ID
32
+ required: false
33
+ schema:
34
+ type: integer
35
+ format: int64
36
+ - name: locationName
37
+ in: query
38
+ description: Lists only locations with this NAME
39
+ required: false
40
+ schema:
41
+ type: string
42
+ - name: limit
43
+ in: query
44
+ description: Limits number of retrieved items
45
+ required: false
46
+ schema:
47
+ type: integer
48
+ format: int64
49
+ - name: offset
50
+ in: query
51
+ description: Number of the first items that are skipped
52
+ required: false
53
+ schema:
54
+ type: integer
55
+ format: int64
56
+ responses:
57
+ "200":
58
+ description: successful operation
59
+ headers:
60
+ Cache-Control:
61
+ description: Cache control directive for caching proxies
62
+ schema:
63
+ type: string
64
+ example: public, s-maxage=3600, stale-while-revalidate=300
65
+ content:
66
+ application/json:
67
+ schema:
68
+ $ref: "#/components/schemas/PedestriansLocation"
69
+ "401":
70
+ $ref: "#/components/responses/UnauthorizedError"
71
+ "404":
72
+ description: Location not found
73
+
74
+ /v2/pedestrians/measurements:
75
+ get:
76
+ summary: GET measurements of pedestrian traffic
77
+ description: ""
78
+ tags:
79
+ - 🚶 Pedestrians (v2)
80
+ parameters:
81
+ - name: locationId
82
+ in: query
83
+ description: Lists only measurements for this location
84
+ required: false
85
+ schema:
86
+ type: integer
87
+ format: int64
88
+ example: 0
89
+ - name: directionId
90
+ in: query
91
+ description: Lists only measurements for this direction
92
+ required: false
93
+ schema:
94
+ type: integer
95
+ format: int64
96
+ example: 4
97
+ - name: limit
98
+ in: query
99
+ description: Limits number of retrieved items
100
+ required: false
101
+ schema:
102
+ type: integer
103
+ format: int64
104
+ example: 1
105
+ - name: offset
106
+ in: query
107
+ description: Number of the first items that are skipped
108
+ required: false
109
+ schema:
110
+ type: integer
111
+ format: int64
112
+ example: 1
113
+ - name: from
114
+ in: query
115
+ description: Date in ISO8601, limits data measured from this datetime
116
+ required: false
117
+ schema:
118
+ type: string
119
+ format: date
120
+ example: 2020-09-01T01:15:00.000Z
121
+ - name: to
122
+ in: query
123
+ description: Date in ISO8601, limits data measured up until this datetime
124
+ required: false
125
+ schema:
126
+ type: string
127
+ format: date
128
+ example: 2020-10-22T01:15:00.000Z
129
+ responses:
130
+ "200":
131
+ description: successful operation
132
+ headers:
133
+ Cache-Control:
134
+ description: Cache control directive for caching proxies
135
+ schema:
136
+ type: string
137
+ example: public, s-maxage=3600, stale-while-revalidate=300
138
+ content:
139
+ application/json:
140
+ schema:
141
+ $ref: "#/components/schemas/PedestriansMeasurement"
142
+ "401":
143
+ $ref: "#/components/responses/UnauthorizedError"
144
+ "404":
145
+ description: Location not found
146
+
147
+ components:
148
+ responses:
149
+ UnauthorizedError:
150
+ description: API key is missing or invalid
151
+ headers:
152
+ WWW_Authenticate:
153
+ schema:
154
+ type: string
155
+
156
+ schemas:
157
+ PedestriansLocation:
158
+ type: object
159
+ properties:
160
+ id:
161
+ type: string
162
+ description: Location id
163
+ example: "2"
164
+ location_name:
165
+ type: string
166
+ example: Rytířská 12
167
+ lat:
168
+ type: string
169
+ example: "50.084781715549276"
170
+ lng:
171
+ type: string
172
+ example: "14.422412102465428"
173
+ address:
174
+ type: string
175
+ example: Na Můstku 12
176
+ city_district:
177
+ type: string
178
+ example: Praha 1
179
+ tech:
180
+ type: string
181
+ example: kamera
182
+ map_url:
183
+ type: string
184
+ example: https://storage.golemio.cz/intenzita-pesi-dopravy/2-map.png
185
+ photo_url:
186
+ type: string
187
+ example: https://storage.golemio.cz/intenzita-pesi-dopravy/2.png
188
+ measurement_start:
189
+ type: string
190
+ format: date
191
+ example: 2020-09-02 12:00
192
+ measurement_end:
193
+ type: string
194
+ format: date
195
+ example: 2020-09-05 12:00
196
+ directions:
197
+ type: array
198
+ items:
199
+ $ref: "#/components/schemas/PedestriansDirection"
200
+ required:
201
+ - id
202
+ - location_name
203
+ - lat
204
+ - lng
205
+ - address
206
+ - city_district
207
+ - tech
208
+ - map_url
209
+ - photo_url
210
+ - measurement_start
211
+
212
+ PedestriansDirection:
213
+ type: object
214
+ properties:
215
+ id:
216
+ type: integer
217
+ format: int64
218
+ example: "2"
219
+ name:
220
+ type: string
221
+ example: Můstek
222
+ to:
223
+ type: integer
224
+ format: int64
225
+ example: "1"
226
+ required:
227
+ - id
228
+ - name
229
+ - to
230
+
231
+ PedestriansMeasurement:
232
+ type: object
233
+ properties:
234
+ location_id:
235
+ type: string
236
+ example: "1"
237
+ direction_id:
238
+ type: string
239
+ example: "3"
240
+ value:
241
+ type: string
242
+ example: "114"
243
+ quality:
244
+ type: string
245
+ example: "1.00000000000000000000"
246
+ measured_from:
247
+ type: string
248
+ format: date
249
+ example: 2020-08-21T17:30:00.000Z
250
+ measured_to:
251
+ type: string
252
+ format: date
253
+ example: 2020-08-21T17:45:00.000Z
254
+ required:
255
+ - location_id
256
+ - direction_id
257
+ - value
258
+ - quality
259
+ - measured_from
260
+ - measured_to
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/flow",
3
- "version": "1.2.14-dev.1288385588",
3
+ "version": "1.2.14-dev.1311678859",
4
4
  "description": "Golemio Flow Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -36,13 +36,14 @@
36
36
  "@golemio/core": "1.10.0",
37
37
  "@golemio/db-common": "1.1.4",
38
38
  "@golemio/eslint-config": "1.1.2",
39
- "@types/chai": "4.2.3",
40
- "@types/chai-as-promised": "7.1.2",
39
+ "@types/chai": "^4.2.3",
40
+ "@types/chai-as-promised": "^7.1.2",
41
41
  "@types/mocha": "^8.2.0",
42
42
  "@types/node": "^20.12.7",
43
43
  "@types/sinon": "^9.0.10",
44
- "chai": "4.2.0",
45
- "chai-as-promised": "7.1.1",
44
+ "@types/supertest": "^6.0.2",
45
+ "chai": "^4.2.0",
46
+ "chai-as-promised": "^7.1.1",
46
47
  "cross-env": "^7.0.3",
47
48
  "eslint": "^8.1.1",
48
49
  "husky": "^4.3.7",
@@ -54,6 +55,7 @@
54
55
  "rimraf": "^3.0.2",
55
56
  "sinon": "^9.2.3",
56
57
  "source-map-support": "0.5.21",
58
+ "supertest": "^7.0.0",
57
59
  "ts-node": "^10.9.1",
58
60
  "ts-patch": "3.0.0-beta3",
59
61
  "tsconfig-paths": "^4.2.0",