@golemio/flow 1.3.4-rc.1848372728 → 1.3.4-rc.2096564950
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,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="express" />
|
|
2
|
+
import { PedestriansLocationsModel, PedestriansMeasurementsModel } from "./models";
|
|
2
3
|
import { CacheHeaderMiddleware } from "@golemio/core/dist/output-gateway/CacheHeaderMiddleware";
|
|
3
4
|
import { BaseRouter } from "@golemio/core/dist/output-gateway/routes/BaseRouter";
|
|
4
5
|
import { NextFunction, Request, Response, Router } from "@golemio/core/dist/shared/express";
|
|
5
|
-
import { PedestriansLocationsModel, PedestriansMeasurementsModel } from "./models";
|
|
6
6
|
export declare class PedestriansRouter extends BaseRouter {
|
|
7
7
|
protected pedestriansLocationsModel: PedestriansLocationsModel;
|
|
8
8
|
protected pedestriansMeasurementsModel: PedestriansMeasurementsModel;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.pedestriansRouter = exports.PedestriansRouter = void 0;
|
|
4
4
|
const Di_1 = require("./ioc/Di");
|
|
5
|
+
const models_1 = require("./models");
|
|
5
6
|
const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
|
|
6
7
|
const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
|
|
7
8
|
const BaseRouter_1 = require("@golemio/core/dist/output-gateway/routes/BaseRouter");
|
|
8
9
|
const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
|
|
9
|
-
const models_1 = require("./models");
|
|
10
10
|
class PedestriansRouter extends BaseRouter_1.BaseRouter {
|
|
11
11
|
constructor() {
|
|
12
12
|
super();
|
|
@@ -14,11 +14,12 @@ class PedestriansRouter extends BaseRouter_1.BaseRouter {
|
|
|
14
14
|
this.pedestriansMeasurementsModel = new models_1.PedestriansMeasurementsModel();
|
|
15
15
|
this.GetPedestriansLocations = async (req, res, next) => {
|
|
16
16
|
try {
|
|
17
|
+
const queryData = (0, express_validator_1.matchedData)(req);
|
|
17
18
|
const data = await this.pedestriansLocationsModel.GetAll({
|
|
18
|
-
locationId:
|
|
19
|
-
locationName:
|
|
20
|
-
limit:
|
|
21
|
-
offset:
|
|
19
|
+
locationId: queryData.locationId,
|
|
20
|
+
locationName: queryData.locationName,
|
|
21
|
+
limit: queryData.limit ? +queryData.limit : undefined,
|
|
22
|
+
offset: queryData.offset ? +queryData.offset : undefined,
|
|
22
23
|
});
|
|
23
24
|
if (!data?.length)
|
|
24
25
|
return res.status(404).send();
|
|
@@ -31,13 +32,14 @@ class PedestriansRouter extends BaseRouter_1.BaseRouter {
|
|
|
31
32
|
};
|
|
32
33
|
this.GetPedestriansMeasurements = async (req, res, next) => {
|
|
33
34
|
try {
|
|
35
|
+
const queryData = (0, express_validator_1.matchedData)(req);
|
|
34
36
|
const data = await this.pedestriansMeasurementsModel.GetAll({
|
|
35
|
-
locationId:
|
|
36
|
-
directionId:
|
|
37
|
-
limit:
|
|
38
|
-
offset:
|
|
39
|
-
from:
|
|
40
|
-
to:
|
|
37
|
+
locationId: queryData.locationId,
|
|
38
|
+
directionId: queryData.directionId,
|
|
39
|
+
limit: queryData.limit ? +queryData.limit : undefined,
|
|
40
|
+
offset: queryData.offset ? +queryData.offset : undefined,
|
|
41
|
+
from: queryData.from,
|
|
42
|
+
to: queryData.to,
|
|
41
43
|
});
|
|
42
44
|
if (!data?.length)
|
|
43
45
|
return res.status(404).send();
|
|
@@ -52,13 +54,13 @@ class PedestriansRouter extends BaseRouter_1.BaseRouter {
|
|
|
52
54
|
this.router.get("/locations", [
|
|
53
55
|
(0, express_validator_1.query)("locationId").optional().not().isEmpty({ ignore_whitespace: true }).not().isArray(),
|
|
54
56
|
(0, express_validator_1.query)("locationName").optional().not().isEmpty({ ignore_whitespace: true }).not().isArray(),
|
|
55
|
-
],
|
|
57
|
+
], (0, Validation_1.paginationLimitMiddleware)("PedestriansRouter"), Validation_1.checkErrors, this.cacheHeaderMiddleware.getMiddleware(60 * 60, 300), this.GetPedestriansLocations);
|
|
56
58
|
this.router.get("/measurements", [
|
|
57
59
|
(0, express_validator_1.query)("locationId").optional().not().isEmpty({ ignore_whitespace: true }).not().isArray(),
|
|
58
60
|
(0, express_validator_1.query)("directionId").optional().not().isEmpty({ ignore_whitespace: true }).not().isArray(),
|
|
59
61
|
(0, express_validator_1.query)("from").optional().isISO8601().not().isArray(),
|
|
60
62
|
(0, express_validator_1.query)("to").optional().isISO8601().not().isArray(),
|
|
61
|
-
],
|
|
63
|
+
], (0, Validation_1.paginationLimitMiddleware)("PedestriansRouter"), Validation_1.checkErrors, this.cacheHeaderMiddleware.getMiddleware(60 * 60, 300), this.GetPedestriansMeasurements);
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
exports.PedestriansRouter = PedestriansRouter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PedestriansRouter.js","sourceRoot":"","sources":["../../src/output-gateway/PedestriansRouter.ts"],"names":[],"mappings":";;;AAAA,iCAA2C;
|
|
1
|
+
{"version":3,"file":"PedestriansRouter.js","sourceRoot":"","sources":["../../src/output-gateway/PedestriansRouter.ts"],"names":[],"mappings":";;;AAAA,iCAA2C;AAC3C,qCAAqF;AAErF,6EAAsG;AACtG,+DAAuE;AACvE,oFAAiF;AAEjF,mFAAiF;AAEjF,MAAa,iBAAkB,SAAQ,uBAAU;IAK7C;QACI,KAAK,EAAE,CAAC;QALF,8BAAyB,GAA8B,IAAI,kCAAyB,EAAE,CAAC;QACvF,iCAA4B,GAAiC,IAAI,qCAA4B,EAAE,CAAC;QAiCnG,4BAAuB,GAAG,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;YACvF,IAAI;gBACA,MAAM,SAAS,GAAG,IAAA,+BAAW,EAAC,GAAG,CAAC,CAAC;gBACnC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAA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AAiB,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,IAAA,sCAAyB,EAAC,mBAAmB,CAAC,EAC9C,wBAAW,EACX,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,EAAE,GAAG,CAAC,EACtD,IAAI,CAAC,0BAA0B,CAClC,CAAC;IACN,CAAC;CAqCJ;AAtED,8CAsEC;AAED,MAAM,iBAAiB,GAAW,IAAI,iBAAiB,EAAE,CAAC,MAAM,CAAC;AAExD,8CAAiB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/flow",
|
|
3
|
-
"version": "1.3.4-rc.
|
|
3
|
+
"version": "1.3.4-rc.2096564950",
|
|
4
4
|
"description": "Golemio Flow Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@commitlint/cli": "^11.0.0",
|
|
37
37
|
"@commitlint/config-conventional": "^11.0.0",
|
|
38
38
|
"@golemio/cli": "1.10.0",
|
|
39
|
-
"@golemio/core": "1.
|
|
39
|
+
"@golemio/core": "1.22.2-dev.2083548346",
|
|
40
40
|
"@golemio/db-common": "1.2.0",
|
|
41
41
|
"@golemio/eslint-config": "1.1.2",
|
|
42
42
|
"@types/chai": "^4.2.3",
|