@golemio/fcd 1.0.4-dev.486108168 → 1.0.5-dev.495524269
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/FCDRouter.js +1 -8
- package/dist/output-gateway/FCDRouter.js.map +1 -1
- package/dist/output-gateway/models/FloatingCarDataModel.d.ts +0 -2
- package/dist/output-gateway/models/FloatingCarDataModel.js +6 -15
- package/dist/output-gateway/models/FloatingCarDataModel.js.map +1 -1
- package/docs/openapi.yaml +1 -18
- package/package.json +5 -4
|
@@ -27,8 +27,6 @@ class FCDRouter extends BaseRouter_1.BaseRouter {
|
|
|
27
27
|
locationId: req.query.locationId,
|
|
28
28
|
limit: req.query.limit ? +req.query.limit : undefined,
|
|
29
29
|
offset: req.query.offset ? +req.query.offset : undefined,
|
|
30
|
-
from: req.query.from,
|
|
31
|
-
to: req.query.to,
|
|
32
30
|
});
|
|
33
31
|
if (!(dataFromDb === null || dataFromDb === void 0 ? void 0 : dataFromDb.length)) {
|
|
34
32
|
throw new golemio_errors_1.CustomError("No data found", true, "FCDRouter", 404);
|
|
@@ -42,12 +40,7 @@ class FCDRouter extends BaseRouter_1.BaseRouter {
|
|
|
42
40
|
});
|
|
43
41
|
this.floatingCarDataModel = new models_1.FloatingCarDataModel();
|
|
44
42
|
this.outputFloatingCarDataTransformation = new OutputFloatingCarDataTransformation_1.OutputFloatingCarDataTransformation();
|
|
45
|
-
this.router.get("/info", [
|
|
46
|
-
(0, express_validator_1.query)("osmPath").optional().isString(),
|
|
47
|
-
(0, express_validator_1.query)("locationId").optional().isString(),
|
|
48
|
-
(0, express_validator_1.query)("from").optional().isISO8601(),
|
|
49
|
-
(0, express_validator_1.query)("to").optional().isISO8601(),
|
|
50
|
-
], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("FCDRouter"), (0, redis_1.useCacheMiddleware)(), this.GetFloatingCarData);
|
|
43
|
+
this.router.get("/info", [(0, express_validator_1.query)("osmPath").optional().isString(), (0, express_validator_1.query)("locationId").optional().isString()], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("FCDRouter"), (0, redis_1.useCacheMiddleware)(), this.GetFloatingCarData);
|
|
51
44
|
}
|
|
52
45
|
}
|
|
53
46
|
exports.FCDRouter = FCDRouter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FCDRouter.js","sourceRoot":"","sources":["../../src/output-gateway/FCDRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mFAAoE;AACpE,6EAAuE;AACvE,mEAA6E;AAC7E,oFAAiF;AACjF,6EAAkH;AAClH,qCAAgD;AAChD,+GAA8G;AAE9G,MAAa,SAAU,SAAQ,uBAAU;IAIrC;QACI,KAAK,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"FCDRouter.js","sourceRoot":"","sources":["../../src/output-gateway/FCDRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mFAAoE;AACpE,6EAAuE;AACvE,mEAA6E;AAC7E,oFAAiF;AACjF,6EAAkH;AAClH,qCAAgD;AAChD,+GAA8G;AAE9G,MAAa,SAAU,SAAQ,uBAAU;IAIrC;QACI,KAAK,EAAE,CAAC;QAeL,uBAAkB,GAAG,CAAO,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;YAClF,IAAI;gBACA,MAAM,kBAAkB,GAAI,GAAG,CAAC,KAAK,CAAC,OAAkB,IAAI,MAAM,CAAC;gBAEnE,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC;oBACtD,UAAU,EAAE,GAAG,CAAC,KAAK,CAAC,UAAoB;oBAC1C,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;oBACrD,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,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All = (options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const { locationId, limit, offset
|
|
33
|
+
const { locationId, limit, offset } = options;
|
|
34
34
|
try {
|
|
35
35
|
const Op = sequelize_1.default.Op;
|
|
36
36
|
const where = {
|
|
@@ -41,20 +41,11 @@ class FloatingCarDataModel extends models_1.SequelizeModel {
|
|
|
41
41
|
predefined_location: locationId,
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
if (to) {
|
|
52
|
-
where[Op.and].push({
|
|
53
|
-
measurement_or_calculation_time: {
|
|
54
|
-
[Op.lte]: to,
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
}
|
|
44
|
+
where[Op.and].push({
|
|
45
|
+
measurement_or_calculation_time: {
|
|
46
|
+
[Op.eq]: sequelize_1.default.literal(`(select max(measurement_or_calculation_time) from ${index_1.FCD.fcd_info.pgTableName})`),
|
|
47
|
+
},
|
|
48
|
+
});
|
|
58
49
|
const floatingCarDataFromDB = yield this.sequelizeModel.findAll({
|
|
59
50
|
limit,
|
|
60
51
|
offset,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingCarDataModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/FloatingCarDataModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oFAA4D;AAC5D,6EAAuE;AACvE,qEAA0E;AAC1E,0DAAiC;AAEjC,MAAa,oBAAqB,SAAQ,uBAAc;IACpD;QACI,KAAK,CAAC,WAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,WAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAG,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC;QAG/F;;;;;;;;WAQG;QAEI,WAAM,GAAG,CACZ,
|
|
1
|
+
{"version":3,"file":"FloatingCarDataModel.js","sourceRoot":"","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AI,EAAE,sBAAsB,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;aACxF;QACL,CAAC,CAAA,CAAC;QAEK,WAAM,GAAG,GAAiC,EAAE;YAC/C,MAAM,IAAI,4BAAW,CAAC,iBAAiB,EAAE,IAAI,EAAE,sBAAsB,CAAC,CAAC;QAC3E,CAAC,CAAA,CAAC;IArDF,CAAC;CAsDJ;AAzDD,oDAyDC"}
|
package/docs/openapi.yaml
CHANGED
|
@@ -22,7 +22,7 @@ tags:
|
|
|
22
22
|
paths:
|
|
23
23
|
/fcd/info:
|
|
24
24
|
get:
|
|
25
|
-
summary: GET
|
|
25
|
+
summary: GET Latest floating Car Data
|
|
26
26
|
description: ""
|
|
27
27
|
tags:
|
|
28
28
|
- 🚢 Floating Car Data
|
|
@@ -44,23 +44,6 @@ paths:
|
|
|
44
44
|
schema:
|
|
45
45
|
type: boolean
|
|
46
46
|
example: true
|
|
47
|
-
|
|
48
|
-
- name: from
|
|
49
|
-
in: query
|
|
50
|
-
description: >-
|
|
51
|
-
Filters data where the measurement moment is greater than the query-specified moment.
|
|
52
|
-
required: false
|
|
53
|
-
schema:
|
|
54
|
-
type: string
|
|
55
|
-
example: 2021-06-21 10:00
|
|
56
|
-
- name: to
|
|
57
|
-
in: query
|
|
58
|
-
description: >-
|
|
59
|
-
Filters data where the measurement moment is less than the query-specified moment.
|
|
60
|
-
required: false
|
|
61
|
-
schema:
|
|
62
|
-
type: string
|
|
63
|
-
example: 2021-12-21 10:00
|
|
64
47
|
- name: limit
|
|
65
48
|
in: query
|
|
66
49
|
description: >-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/fcd",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5-dev.495524269",
|
|
4
4
|
"description": "Golemio Floating Car Data Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@commitlint/cli": "^11.0.0",
|
|
31
31
|
"@commitlint/config-conventional": "^11.0.0",
|
|
32
|
-
"@golemio/core": "1.2.2
|
|
32
|
+
"@golemio/core": "1.2.2",
|
|
33
33
|
"@golemio/eslint-config": "^1.0.2",
|
|
34
|
-
"@golemio/schema-definitions": "2.0.
|
|
34
|
+
"@golemio/schema-definitions": "2.0.27",
|
|
35
35
|
"@types/body-parser-xml": "^1.1.0",
|
|
36
36
|
"@types/chai": "4.2.3",
|
|
37
37
|
"@types/chai-as-promised": "7.1.2",
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
"hosted-git-info": "^3.0.8",
|
|
77
77
|
"xmldom": "github:xmldom/xmldom#0.7.0",
|
|
78
78
|
"mpath": "^0.8.4",
|
|
79
|
-
"follow-redirects": "1.14.7"
|
|
79
|
+
"follow-redirects": "1.14.7",
|
|
80
|
+
"xsd2jsonschema/urijs": "^1.19.10"
|
|
80
81
|
}
|
|
81
82
|
}
|