@golemio/microclimate 1.2.4 → 1.2.5-dev.1311981981
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/dist/output-gateway/MicroclimateRouter.js +8 -5
- package/dist/output-gateway/MicroclimateRouter.js.map +1 -1
- package/dist/output-gateway/ioc/Di.d.ts +3 -0
- package/dist/output-gateway/ioc/Di.js +8 -0
- package/dist/output-gateway/ioc/Di.js.map +1 -0
- package/docs/openapi.yaml +83 -62
- package/package.json +1 -1
|
@@ -12,10 +12,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.microclimateRouter = void 0;
|
|
13
13
|
const LocationsOutputMapper_1 = require("./helpers/LocationsOutputMapper");
|
|
14
14
|
const PointsOutputMapper_1 = require("./helpers/PointsOutputMapper");
|
|
15
|
+
const Di_1 = require("./ioc/Di");
|
|
15
16
|
const repositories_1 = require("./repositories");
|
|
16
17
|
const SensorMeasurementsViewRepository_1 = require("./repositories/SensorMeasurementsViewRepository");
|
|
17
18
|
const SensorPointsViewRepository_1 = require("./repositories/SensorPointsViewRepository");
|
|
18
19
|
const output_gateway_1 = require("@golemio/core/dist/output-gateway");
|
|
20
|
+
const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
|
|
19
21
|
const BaseRouter_1 = require("@golemio/core/dist/output-gateway/routes/BaseRouter");
|
|
20
22
|
const express_1 = require("@golemio/core/dist/shared/express");
|
|
21
23
|
const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
|
|
@@ -63,21 +65,22 @@ class MicroclimateRouter extends BaseRouter_1.BaseRouter {
|
|
|
63
65
|
next(err);
|
|
64
66
|
}
|
|
65
67
|
});
|
|
66
|
-
this.initRoutes = (
|
|
67
|
-
this.router.get("/locations", [(0, express_validator_1.query)("locationId'").optional().isInt().not().isArray()], output_gateway_1.checkErrors, (
|
|
68
|
-
this.router.get("/points", [(0, express_validator_1.query)("locationId'").optional().isInt().not().isArray(), (0, express_validator_1.query)("pointId").optional().isInt().not().isArray()], output_gateway_1.checkErrors, (
|
|
68
|
+
this.initRoutes = () => {
|
|
69
|
+
this.router.get("/locations", [(0, express_validator_1.query)("locationId'").optional().isInt().not().isArray()], output_gateway_1.checkErrors, this.cacheHeaderMiddleware.getMiddleware(60 * 60, 300), this.getLocations);
|
|
70
|
+
this.router.get("/points", [(0, express_validator_1.query)("locationId'").optional().isInt().not().isArray(), (0, express_validator_1.query)("pointId").optional().isInt().not().isArray()], output_gateway_1.checkErrors, this.cacheHeaderMiddleware.getMiddleware(60 * 60, 300), this.getPoints);
|
|
69
71
|
this.router.get("/measurements", [
|
|
70
72
|
(0, express_validator_1.query)("locationId'").optional().isInt().not().isArray(),
|
|
71
73
|
(0, express_validator_1.query)("pointId").optional().isInt().not().isArray(),
|
|
72
74
|
(0, express_validator_1.query)("measure").optional().not().isEmpty({ ignore_whitespace: true }),
|
|
73
75
|
(0, express_validator_1.query)("from").optional().isISO8601().not().isArray(),
|
|
74
76
|
(0, express_validator_1.query)("to").optional().isISO8601().not().isArray(),
|
|
75
|
-
], output_gateway_1.pagination, output_gateway_1.checkErrors, (0, output_gateway_1.paginationLimitMiddleware)("MicroclimateRouter"), (
|
|
77
|
+
], output_gateway_1.pagination, output_gateway_1.checkErrors, (0, output_gateway_1.paginationLimitMiddleware)("MicroclimateRouter"), this.cacheHeaderMiddleware.getMiddleware(60 * 60, 300), this.getMeasurements);
|
|
76
78
|
};
|
|
79
|
+
this.cacheHeaderMiddleware = Di_1.MicroClimateContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
|
|
77
80
|
this.sensorDevicesImportRepository = new repositories_1.SensorDevicesImportRepository();
|
|
78
81
|
this.sensorPointsViewRepository = new SensorPointsViewRepository_1.SensorPointsViewRepository();
|
|
79
82
|
this.sensorMeasurementsViewRepository = new SensorMeasurementsViewRepository_1.SensorMeasurementsViewRepository();
|
|
80
|
-
this.initRoutes(
|
|
83
|
+
this.initRoutes();
|
|
81
84
|
}
|
|
82
85
|
}
|
|
83
86
|
const microclimateRouter = new MicroclimateRouter().router;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MicroclimateRouter.js","sourceRoot":"","sources":["../../src/output-gateway/MicroclimateRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2EAA0E;AAC1E,qEAAoE;AACpE,iDAAiE;AACjE,sGAAqG;AACrG,0FAAyF;AACzF,sEAA2H;
|
|
1
|
+
{"version":3,"file":"MicroclimateRouter.js","sourceRoot":"","sources":["../../src/output-gateway/MicroclimateRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2EAA0E;AAC1E,qEAAoE;AACpE,iCAAmD;AACnD,iDAAiE;AACjE,sGAAqG;AACrG,0FAAyF;AACzF,sEAA2H;AAE3H,+DAAuE;AACvE,oFAAiF;AACjF,+DAA4F;AAC5F,mFAAoE;AAEpE,MAAM,kBAAmB,SAAQ,uBAAU;IAOvC;QACI,KAAK,EAAE,CAAC;QAPL,WAAM,GAAW,IAAA,gBAAM,GAAE,CAAC;QAgBzB,iBAAY,GAAG,CAAO,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAiB,EAAE;YAC5F,IAAI;gBACA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,6BAA6B,CAAC,uBAAuB,CAAC;oBAC1E,UAAU,EAAE,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS;iBAC9E,CAAC,CAAC;gBACH,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,6CAAqB,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;aACrE;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,GAAG,CAAC,CAAC;aACb;QACL,CAAC,CAAA,CAAC;QAEM,cAAS,GAAG,CAAO,GAAY,EAAE,GAAa,EAAE,IA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
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MicroClimateContainer = void 0;
|
|
4
|
+
const Di_1 = require("@golemio/core/dist/output-gateway/ioc/Di");
|
|
5
|
+
//#region Initialization
|
|
6
|
+
const microClimateContainer = Di_1.OutputGatewayContainer.createChildContainer();
|
|
7
|
+
exports.MicroClimateContainer = microClimateContainer;
|
|
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,qBAAqB,GAAwB,2BAAsB,CAAC,oBAAoB,EAAE,CAAC;AAG/D,sDAAqB"}
|
package/docs/openapi.yaml
CHANGED
|
@@ -28,17 +28,22 @@ paths:
|
|
|
28
28
|
tags:
|
|
29
29
|
- 🌡️ Microclimate (v2)
|
|
30
30
|
parameters:
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
- name: locationId
|
|
32
|
+
in: query
|
|
33
|
+
description: Filter by location
|
|
34
|
+
required: false
|
|
35
|
+
example: 130
|
|
36
|
+
schema:
|
|
37
37
|
type: number
|
|
38
38
|
responses:
|
|
39
39
|
"200":
|
|
40
40
|
description: OK
|
|
41
|
-
headers:
|
|
41
|
+
headers:
|
|
42
|
+
Cache-Control:
|
|
43
|
+
description: Cache control directive for caching proxies
|
|
44
|
+
schema:
|
|
45
|
+
type: string
|
|
46
|
+
example: public, s-maxage=3600, stale-while-revalidate=300
|
|
42
47
|
content:
|
|
43
48
|
application/json; charset=utf-8:
|
|
44
49
|
schema:
|
|
@@ -59,24 +64,30 @@ paths:
|
|
|
59
64
|
tags:
|
|
60
65
|
- 🌡️ Microclimate (v2)
|
|
61
66
|
parameters:
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
- name: locationId
|
|
68
|
+
in: query
|
|
69
|
+
description: Filter by location
|
|
70
|
+
required: false
|
|
71
|
+
example: 130
|
|
72
|
+
schema:
|
|
73
|
+
type: number
|
|
74
|
+
- name: pointId
|
|
75
|
+
in: query
|
|
76
|
+
description: Filter by location
|
|
77
|
+
required: false
|
|
78
|
+
example: 131
|
|
79
|
+
schema:
|
|
80
|
+
type: number
|
|
76
81
|
responses:
|
|
77
82
|
"200":
|
|
78
83
|
description: OK
|
|
79
|
-
headers:
|
|
84
|
+
headers:
|
|
85
|
+
Cache-Control:
|
|
86
|
+
description: Cache control directive for caching proxies
|
|
87
|
+
schema:
|
|
88
|
+
type: string
|
|
89
|
+
example: public, s-maxage=3600, stale-while-revalidate=300
|
|
90
|
+
|
|
80
91
|
content:
|
|
81
92
|
application/json; charset=utf-8:
|
|
82
93
|
schema:
|
|
@@ -94,47 +105,52 @@ paths:
|
|
|
94
105
|
tags:
|
|
95
106
|
- 🌡️ Microclimate (v2)
|
|
96
107
|
parameters:
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
108
|
+
- name: locationId
|
|
109
|
+
in: query
|
|
110
|
+
description: Filter by location
|
|
111
|
+
required: false
|
|
112
|
+
example: 130
|
|
113
|
+
schema:
|
|
114
|
+
type: number
|
|
115
|
+
- name: pointId
|
|
116
|
+
in: query
|
|
117
|
+
description: Filter by location
|
|
118
|
+
required: false
|
|
119
|
+
example: 131
|
|
120
|
+
schema:
|
|
121
|
+
type: number
|
|
122
|
+
- name: measure
|
|
123
|
+
in: query
|
|
124
|
+
description: Filter by measure type
|
|
125
|
+
required: false
|
|
126
|
+
example: air_temp200
|
|
127
|
+
schema:
|
|
128
|
+
type: string
|
|
129
|
+
- name: from
|
|
130
|
+
in: query
|
|
131
|
+
description: Filter by measured_at
|
|
132
|
+
required: false
|
|
133
|
+
example: 2023-02-16T23:03:42.588Z
|
|
134
|
+
schema:
|
|
135
|
+
type: string
|
|
136
|
+
format: date-time
|
|
137
|
+
- name: to
|
|
138
|
+
in: query
|
|
139
|
+
description: Filter by measured_at
|
|
140
|
+
required: false
|
|
141
|
+
example: 2023-02-16T23:03:42.588Z
|
|
142
|
+
schema:
|
|
143
|
+
type: string
|
|
144
|
+
format: date-time
|
|
134
145
|
responses:
|
|
135
146
|
"200":
|
|
136
147
|
description: OK
|
|
137
|
-
headers:
|
|
148
|
+
headers:
|
|
149
|
+
Cache-Control:
|
|
150
|
+
description: Cache control directive for caching proxies
|
|
151
|
+
schema:
|
|
152
|
+
type: string
|
|
153
|
+
example: public, s-maxage=3600, stale-while-revalidate=300
|
|
138
154
|
content:
|
|
139
155
|
application/json; charset=utf-8:
|
|
140
156
|
schema:
|
|
@@ -155,7 +171,12 @@ components:
|
|
|
155
171
|
type: string
|
|
156
172
|
ForbiddenError:
|
|
157
173
|
description: Forbidden
|
|
158
|
-
headers:
|
|
174
|
+
headers:
|
|
175
|
+
Cache-Control:
|
|
176
|
+
description: Cache control directive for caching proxies
|
|
177
|
+
schema:
|
|
178
|
+
type: string
|
|
179
|
+
example: public, s-maxage=3600, stale-while-revalidate=300
|
|
159
180
|
content:
|
|
160
181
|
application/json; charset=utf-8:
|
|
161
182
|
schema:
|
|
@@ -228,7 +249,7 @@ components:
|
|
|
228
249
|
example: areál bez zeleně
|
|
229
250
|
loc_orientation:
|
|
230
251
|
type: string
|
|
231
|
-
example:
|
|
252
|
+
example: východ-západ
|
|
232
253
|
loc_surface:
|
|
233
254
|
type: string
|
|
234
255
|
example: asfalt/beton
|