@golemio/fcd 1.1.6-dev.899782642 → 1.1.6-rc.906686893
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/db/migrations/postgresql/20230619150515-v-traffic-params-last-hour.js +53 -0
- package/db/migrations/postgresql/sqls/20230619150515-v-traffic-params-last-hour-down.sql +1 -0
- package/db/migrations/postgresql/sqls/20230619150515-v-traffic-params-last-hour-up.sql +86 -0
- package/dist/output-gateway/FCDRouter.d.ts +3 -2
- package/dist/output-gateway/FCDRouter.js +15 -5
- package/dist/output-gateway/FCDRouter.js.map +1 -1
- package/dist/output-gateway/models/FloatingCarExtendedDataModel.d.ts +12 -0
- package/dist/output-gateway/models/FloatingCarExtendedDataModel.js +61 -0
- package/dist/output-gateway/models/FloatingCarExtendedDataModel.js.map +1 -0
- package/dist/output-gateway/models/index.d.ts +1 -0
- package/dist/output-gateway/models/index.js +1 -0
- package/dist/output-gateway/models/index.js.map +1 -1
- package/docs/openapi.yaml +190 -179
- package/package.json +2 -2
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var dbm;
|
|
4
|
+
var type;
|
|
5
|
+
var seed;
|
|
6
|
+
var fs = require('fs');
|
|
7
|
+
var path = require('path');
|
|
8
|
+
var Promise;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* We receive the dbmigrate dependency from dbmigrate initially.
|
|
12
|
+
* This enables us to not have to rely on NODE_PATH.
|
|
13
|
+
*/
|
|
14
|
+
exports.setup = function(options, seedLink) {
|
|
15
|
+
dbm = options.dbmigrate;
|
|
16
|
+
type = dbm.dataType;
|
|
17
|
+
seed = seedLink;
|
|
18
|
+
Promise = options.Promise;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.up = function(db) {
|
|
22
|
+
var filePath = path.join(__dirname, 'sqls', '20230619150515-v-traffic-params-last-hour-up.sql');
|
|
23
|
+
return new Promise( function( resolve, reject ) {
|
|
24
|
+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
|
|
25
|
+
if (err) return reject(err);
|
|
26
|
+
console.log('received data: ' + data);
|
|
27
|
+
|
|
28
|
+
resolve(data);
|
|
29
|
+
});
|
|
30
|
+
})
|
|
31
|
+
.then(function(data) {
|
|
32
|
+
return db.runSql(data);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.down = function(db) {
|
|
37
|
+
var filePath = path.join(__dirname, 'sqls', '20230619150515-v-traffic-params-last-hour-down.sql');
|
|
38
|
+
return new Promise( function( resolve, reject ) {
|
|
39
|
+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
|
|
40
|
+
if (err) return reject(err);
|
|
41
|
+
console.log('received data: ' + data);
|
|
42
|
+
|
|
43
|
+
resolve(data);
|
|
44
|
+
});
|
|
45
|
+
})
|
|
46
|
+
.then(function(data) {
|
|
47
|
+
return db.runSql(data);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports._meta = {
|
|
52
|
+
"version": 1
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
DROP VIEW fcd.v_traffic_params_last_hour;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
-- fcd.v_traffic_params_last_hour view source
|
|
2
|
+
|
|
3
|
+
CREATE OR REPLACE VIEW fcd.v_traffic_params_last_hour AS (
|
|
4
|
+
SELECT *
|
|
5
|
+
FROM (
|
|
6
|
+
SELECT
|
|
7
|
+
DISTINCT ON (tr_all.source_identification)
|
|
8
|
+
tr_all.publication_time,
|
|
9
|
+
tr_all.source_identification,
|
|
10
|
+
tr_all.measurement_or_calculation_time,
|
|
11
|
+
tr_all.predefined_location,
|
|
12
|
+
tr_all.version_of_predefined_location,
|
|
13
|
+
tr_all.traffic_level,
|
|
14
|
+
tr_all.queue_exists,
|
|
15
|
+
tr_all.queue_length,
|
|
16
|
+
tr_all.from_point,
|
|
17
|
+
tr_all.to_point,
|
|
18
|
+
tr_all.data_quality,
|
|
19
|
+
tr_all.input_values,
|
|
20
|
+
tr_all.average_vehicle_speed,
|
|
21
|
+
tr_all.travel_time,
|
|
22
|
+
tr_all.free_flow_travel_time,
|
|
23
|
+
tr_all.free_flow_speed,
|
|
24
|
+
tr_all.create_batch_id,
|
|
25
|
+
tr_all.created_at,
|
|
26
|
+
tr_all.created_by,
|
|
27
|
+
tr_all.update_batch_id,
|
|
28
|
+
tr_all.updated_at,
|
|
29
|
+
tr_all.updated_by
|
|
30
|
+
FROM (
|
|
31
|
+
SELECT
|
|
32
|
+
fcd_traff_params_part.publication_time,
|
|
33
|
+
fcd_traff_params_part.source_identification,
|
|
34
|
+
fcd_traff_params_part.measurement_or_calculation_time,
|
|
35
|
+
fcd_traff_params_part.predefined_location,
|
|
36
|
+
fcd_traff_params_part.version_of_predefined_location,
|
|
37
|
+
fcd_traff_params_part.traffic_level,
|
|
38
|
+
fcd_traff_params_part.queue_exists,
|
|
39
|
+
fcd_traff_params_part.queue_length,
|
|
40
|
+
fcd_traff_params_part.from_point,
|
|
41
|
+
fcd_traff_params_part.to_point,
|
|
42
|
+
fcd_traff_params_part.data_quality,
|
|
43
|
+
fcd_traff_params_part.input_values,
|
|
44
|
+
fcd_traff_params_part.average_vehicle_speed,
|
|
45
|
+
fcd_traff_params_part.travel_time,
|
|
46
|
+
fcd_traff_params_part.free_flow_travel_time,
|
|
47
|
+
fcd_traff_params_part.free_flow_speed,
|
|
48
|
+
fcd_traff_params_part.create_batch_id,
|
|
49
|
+
fcd_traff_params_part.created_at,
|
|
50
|
+
fcd_traff_params_part.created_by,
|
|
51
|
+
fcd_traff_params_part.update_batch_id,
|
|
52
|
+
fcd_traff_params_part.updated_at,
|
|
53
|
+
fcd_traff_params_part.updated_by
|
|
54
|
+
FROM fcd.fcd_traff_params_part
|
|
55
|
+
WHERE fcd_traff_params_part.measurement_or_calculation_time >= NOW() - INTERVAL '1 HOUR'
|
|
56
|
+
UNION ALL
|
|
57
|
+
SELECT
|
|
58
|
+
fcd_traff_params_regions.publication_time,
|
|
59
|
+
fcd_traff_params_regions.source_identification,
|
|
60
|
+
fcd_traff_params_regions.measurement_or_calculation_time,
|
|
61
|
+
fcd_traff_params_regions.predefined_location,
|
|
62
|
+
fcd_traff_params_regions.version_of_predefined_location,
|
|
63
|
+
fcd_traff_params_regions.traffic_level,
|
|
64
|
+
fcd_traff_params_regions.queue_exists,
|
|
65
|
+
fcd_traff_params_regions.queue_length,
|
|
66
|
+
fcd_traff_params_regions.from_point,
|
|
67
|
+
fcd_traff_params_regions.to_point,
|
|
68
|
+
fcd_traff_params_regions.data_quality,
|
|
69
|
+
fcd_traff_params_regions.input_values,
|
|
70
|
+
fcd_traff_params_regions.average_vehicle_speed,
|
|
71
|
+
fcd_traff_params_regions.travel_time,
|
|
72
|
+
fcd_traff_params_regions.free_flow_travel_time,
|
|
73
|
+
fcd_traff_params_regions.free_flow_speed,
|
|
74
|
+
fcd_traff_params_regions.create_batch_id,
|
|
75
|
+
fcd_traff_params_regions.created_at,
|
|
76
|
+
fcd_traff_params_regions.created_by,
|
|
77
|
+
fcd_traff_params_regions.update_batch_id,
|
|
78
|
+
fcd_traff_params_regions.updated_at,
|
|
79
|
+
fcd_traff_params_regions.updated_by
|
|
80
|
+
FROM fcd.fcd_traff_params_regions
|
|
81
|
+
WHERE fcd_traff_params_regions.measurement_or_calculation_time >= NOW() - INTERVAL '1 HOUR'
|
|
82
|
+
) tr_all
|
|
83
|
+
ORDER BY tr_all.source_identification ASC, tr_all.measurement_or_calculation_time DESC
|
|
84
|
+
) as tr
|
|
85
|
+
ORDER BY tr.measurement_or_calculation_time DESC
|
|
86
|
+
)
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/// <reference types="express" />
|
|
2
2
|
import { NextFunction, Request, Response, Router } from "@golemio/core/dist/shared/express";
|
|
3
3
|
import { BaseRouter } from "@golemio/core/dist/output-gateway/routes/BaseRouter";
|
|
4
|
-
import { FloatingCarDataModel } from "./models";
|
|
4
|
+
import { FloatingCarDataModel, FloatingCarExtendedDataModel } from "./models";
|
|
5
5
|
import { OutputFloatingCarDataTransformation } from "./transformations/OutputFloatingCarDataTransformation";
|
|
6
6
|
export declare class FCDRouter extends BaseRouter {
|
|
7
7
|
protected floatingCarDataModel: FloatingCarDataModel;
|
|
8
|
+
protected floatingCarExtendedDataModel: FloatingCarExtendedDataModel;
|
|
8
9
|
private outputFloatingCarDataTransformation;
|
|
9
|
-
constructor(floatingCarDataModel: FloatingCarDataModel, outputFloatingCarDataTransformation: OutputFloatingCarDataTransformation);
|
|
10
|
+
constructor(floatingCarDataModel: FloatingCarDataModel, floatingCarExtendedDataModel: FloatingCarExtendedDataModel, outputFloatingCarDataTransformation: OutputFloatingCarDataTransformation);
|
|
10
11
|
GetFloatingCarData: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
11
12
|
}
|
|
12
13
|
declare const fcdRouter: Router;
|
|
@@ -19,18 +19,24 @@ const models_1 = require("./models");
|
|
|
19
19
|
const OutputFloatingCarDataTransformation_1 = require("./transformations/OutputFloatingCarDataTransformation");
|
|
20
20
|
const repositories_1 = require("@golemio/traffic-common/dist/output-gateway/repositories");
|
|
21
21
|
class FCDRouter extends BaseRouter_1.BaseRouter {
|
|
22
|
-
constructor(floatingCarDataModel, outputFloatingCarDataTransformation) {
|
|
22
|
+
constructor(floatingCarDataModel, floatingCarExtendedDataModel, outputFloatingCarDataTransformation) {
|
|
23
23
|
super();
|
|
24
24
|
this.floatingCarDataModel = floatingCarDataModel;
|
|
25
|
+
this.floatingCarExtendedDataModel = floatingCarExtendedDataModel;
|
|
25
26
|
this.outputFloatingCarDataTransformation = outputFloatingCarDataTransformation;
|
|
26
27
|
this.GetFloatingCarData = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
27
28
|
try {
|
|
28
29
|
const isRequestedPathOsm = req.query.osmPath == "true";
|
|
29
|
-
const
|
|
30
|
+
const minutesBefore = req.query.minutesBefore ? parseInt(req.query.minutesBefore, 10) : undefined;
|
|
31
|
+
const options = {
|
|
30
32
|
locationId: req.query.locationId,
|
|
31
33
|
limit: req.query.limit ? +req.query.limit : undefined,
|
|
32
34
|
offset: req.query.offset ? +req.query.offset : undefined,
|
|
33
|
-
|
|
35
|
+
minutesBefore,
|
|
36
|
+
};
|
|
37
|
+
const dataFromDb = minutesBefore
|
|
38
|
+
? yield this.floatingCarExtendedDataModel.GetAll(options)
|
|
39
|
+
: yield this.floatingCarDataModel.GetAll(options);
|
|
34
40
|
if (!(dataFromDb === null || dataFromDb === void 0 ? void 0 : dataFromDb.length)) {
|
|
35
41
|
throw new golemio_errors_1.GeneralError("No data found", "FCDRouter", undefined, 404);
|
|
36
42
|
}
|
|
@@ -41,10 +47,14 @@ class FCDRouter extends BaseRouter_1.BaseRouter {
|
|
|
41
47
|
next(err);
|
|
42
48
|
}
|
|
43
49
|
});
|
|
44
|
-
this.router.get("/info", [
|
|
50
|
+
this.router.get("/info", [
|
|
51
|
+
(0, express_validator_1.query)("osmPath").optional().isString(),
|
|
52
|
+
(0, express_validator_1.query)("locationId").optional().isString(),
|
|
53
|
+
(0, express_validator_1.query)("minutesBefore").optional().isInt({ min: 1, max: 60 }),
|
|
54
|
+
], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("FCDRouter"), (0, redis_1.useCacheMiddleware)(), this.GetFloatingCarData);
|
|
45
55
|
}
|
|
46
56
|
}
|
|
47
57
|
exports.FCDRouter = FCDRouter;
|
|
48
|
-
const fcdRouter = new FCDRouter(new models_1.FloatingCarDataModel(), new OutputFloatingCarDataTransformation_1.OutputFloatingCarDataTransformation(new repositories_1.RsdTmcOsmMappingRepository())).router;
|
|
58
|
+
const fcdRouter = new FCDRouter(new models_1.FloatingCarDataModel(), new models_1.FloatingCarExtendedDataModel(), new OutputFloatingCarDataTransformation_1.OutputFloatingCarDataTransformation(new repositories_1.RsdTmcOsmMappingRepository())).router;
|
|
49
59
|
exports.fcdRouter = fcdRouter;
|
|
50
60
|
//# sourceMappingURL=FCDRouter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FCDRouter.js","sourceRoot":"","sources":["../../src/output-gateway/FCDRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mFAAoE;AACpE,6EAAwE;AACxE,mEAA6E;AAC7E,oFAAiF;AACjF,6EAAkH;AAClH,
|
|
1
|
+
{"version":3,"file":"FCDRouter.js","sourceRoot":"","sources":["../../src/output-gateway/FCDRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mFAAoE;AACpE,6EAAwE;AACxE,mEAA6E;AAC7E,oFAAiF;AACjF,6EAAkH;AAClH,qCAA8E;AAC9E,+GAA8G;AAC9G,2FAAsG;AAEtG,MAAa,SAAU,SAAQ,uBAAU;IACrC,YACc,oBAA0C,EAC1C,4BAA0D,EAC5D,mCAAwE;QAEhF,KAAK,EAAE,CAAC;QAJE,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,iCAA4B,GAA5B,4BAA4B,CAA8B;QAC5D,wCAAmC,GAAnC,mCAAmC,CAAqC;QAmB7E,uBAAkB,GAAG,CAAO,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;YAClF,IAAI;gBACA,MAAM,kBAAkB,GAAI,GAAG,CAAC,KAAK,CAAC,OAAkB,IAAI,MAAM,CAAC;gBACnE,MAAM,aAAa,GAAG,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,aAAuB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;gBAE5G,MAAM,OAAO,GAAG;oBACZ,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,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;oBACxD,aAAa;iBAChB,CAAC;gBAEF,MAAM,UAAU,GAAG,aAAa;oBAC5B,CAAC,CAAC,MAAM,IAAI,CAAC,4BAA4B,CAAC,MAAM,CAAC,OAAO,CAAC;oBACzD,CAAC,CAAC,MAAM,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBAEtD,IAAI,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,CAAA,EAAE;oBACrB,MAAM,IAAI,6BAAY,CAAC,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;iBACxE;gBACD,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,mCAAmC,CAAC,SAAS,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;gBACjH,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;aACzC;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,GAAG,CAAC,CAAC;aACb;QACL,CAAC,CAAA,CAAC;QAvCE,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,OAAO,EACP;YACI,IAAA,yBAAK,EAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;YACtC,IAAA,yBAAK,EAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;YACzC,IAAA,yBAAK,EAAC,eAAe,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;SAC/D,EACD,uBAAU,EACV,wBAAW,EACX,IAAA,sCAAyB,EAAC,WAAW,CAAC,EACtC,IAAA,0BAAkB,GAAE,EACpB,IAAI,CAAC,kBAAkB,CAC1B,CAAC;IACN,CAAC;CA2BJ;AAhDD,8BAgDC;AAED,MAAM,SAAS,GAAW,IAAI,SAAS,CACnC,IAAI,6BAAoB,EAAE,EAC1B,IAAI,qCAA4B,EAAE,EAClC,IAAI,yEAAmC,CAAC,IAAI,yCAA0B,EAAE,CAAC,CAC5E,CAAC,MAAM,CAAC;AAEA,8BAAS"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IFloatingCarDataModel } from "../../integration-engine/transformations/FloatingCarDataInterface";
|
|
2
|
+
import { SequelizeModel } from "@golemio/core/dist/output-gateway/models";
|
|
3
|
+
export declare class FloatingCarExtendedDataModel extends SequelizeModel {
|
|
4
|
+
constructor();
|
|
5
|
+
GetAll: (options?: {
|
|
6
|
+
locationId?: string;
|
|
7
|
+
minutesBefore?: number;
|
|
8
|
+
limit?: number;
|
|
9
|
+
offset?: number;
|
|
10
|
+
}) => Promise<IFloatingCarDataModel[]>;
|
|
11
|
+
GetOne: () => Promise<object | null>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.FloatingCarExtendedDataModel = void 0;
|
|
16
|
+
const index_1 = require("../../schema-definitions/index");
|
|
17
|
+
const models_1 = require("@golemio/core/dist/output-gateway/models");
|
|
18
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
19
|
+
const sequelize_1 = __importDefault(require("@golemio/core/dist/shared/sequelize"));
|
|
20
|
+
class FloatingCarExtendedDataModel extends models_1.SequelizeModel {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(index_1.FCD.fcd_info.name, "v_traffic_params_last_hour", index_1.FCD.fcd_info.outputSequelizeAttributes, {
|
|
23
|
+
schema: index_1.FCD.pgSchema,
|
|
24
|
+
});
|
|
25
|
+
this.GetAll = (options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const { locationId, minutesBefore, limit, offset } = options;
|
|
27
|
+
try {
|
|
28
|
+
const Op = sequelize_1.default.Op;
|
|
29
|
+
const where = {
|
|
30
|
+
[Op.and]: [{}],
|
|
31
|
+
};
|
|
32
|
+
if (locationId) {
|
|
33
|
+
where[Op.and].push({
|
|
34
|
+
predefined_location: locationId,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (minutesBefore) {
|
|
38
|
+
where[Op.and].push({
|
|
39
|
+
measurement_or_calculation_time: {
|
|
40
|
+
[sequelize_1.default.Op.gte]: sequelize_1.default.literal(`NOW() - INTERVAL '${minutesBefore} minutes'`),
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return yield this.sequelizeModel.findAll({
|
|
45
|
+
limit,
|
|
46
|
+
offset,
|
|
47
|
+
raw: true,
|
|
48
|
+
where,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
throw new golemio_errors_1.GeneralError(`GetAll method error: ${err.message}`, "FloatingCarExtendedDataModel", err, 500);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
this.GetOne = () => __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
throw new golemio_errors_1.GeneralError("Not implemented", "FloatingCarExtendedDataModel");
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.FloatingCarExtendedDataModel = FloatingCarExtendedDataModel;
|
|
61
|
+
//# sourceMappingURL=FloatingCarExtendedDataModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingCarExtendedDataModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/FloatingCarExtendedDataModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,0DAAiC;AACjC,qEAA0E;AAC1E,6EAAwE;AACxE,oFAA4D;AAE5D,MAAa,4BAA6B,SAAQ,uBAAc;IAC5D;QACI,KAAK,CAAC,WAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,4BAA4B,EAAE,WAAG,CAAC,QAAQ,CAAC,yBAAyB,EAAE;YAC3F,MAAM,EAAE,WAAG,CAAC,QAAQ;SACvB,CAAC,CAAC;QAGA,WAAM,GAAG,CACZ,UAKI,EAAE,EAC0B,EAAE;YAClC,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;YAC7D,IAAI;gBACA,MAAM,EAAE,GAAG,mBAAS,CAAC,EAAE,CAAC;gBACxB,MAAM,KAAK,GAAG;oBACV,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;iBACjB,CAAC;gBAEF,IAAI,UAAU,EAAE;oBACZ,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;wBACf,mBAAmB,EAAE,UAAU;qBAClC,CAAC,CAAC;iBACN;gBAED,IAAI,aAAa,EAAE;oBACf,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;wBACf,+BAA+B,EAAE;4BAC7B,CAAC,mBAAS,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,mBAAS,CAAC,OAAO,CAAC,qBAAqB,aAAa,WAAW,CAAC;yBACvF;qBACJ,CAAC,CAAC;iBACN;gBAED,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;oBACrC,KAAK;oBACL,MAAM;oBACN,GAAG,EAAE,IAAI;oBACT,KAAK;iBACR,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,6BAAY,CAAC,wBAAwB,GAAG,CAAC,OAAO,EAAE,EAAE,8BAA8B,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;aAC3G;QACL,CAAC,CAAA,CAAC;QAEK,WAAM,GAAG,GAAiC,EAAE;YAC/C,MAAM,IAAI,6BAAY,CAAC,iBAAiB,EAAE,8BAA8B,CAAC,CAAC;QAC9E,CAAC,CAAA,CAAC;IA5CF,CAAC;CA6CJ;AAlDD,oEAkDC"}
|
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./FloatingCarDataModel"), exports);
|
|
18
|
+
__exportStar(require("./FloatingCarExtendedDataModel"), exports);
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,iEAA+C"}
|
package/docs/openapi.yaml
CHANGED
|
@@ -1,179 +1,190 @@
|
|
|
1
|
-
openapi: 3.0.3
|
|
2
|
-
info:
|
|
3
|
-
title: 🚢 Floating Car Data
|
|
4
|
-
description: >-
|
|
5
|
-
version: 1.0.1
|
|
6
|
-
contact:
|
|
7
|
-
name: Golemio Prague Data Plaform
|
|
8
|
-
email: golemio@operatorict.cz
|
|
9
|
-
url: https://golemio.cz
|
|
10
|
-
|
|
11
|
-
servers:
|
|
12
|
-
- url: https://rabin.golemio.cz/v2
|
|
13
|
-
description: Test (development) server
|
|
14
|
-
- url: https://api.golemio.cz/v2
|
|
15
|
-
description: Main (production) server
|
|
16
|
-
|
|
17
|
-
tags:
|
|
18
|
-
- name: 🚢 Floating Car Data
|
|
19
|
-
description: >-
|
|
20
|
-
💡 FCD
|
|
21
|
-
|
|
22
|
-
paths:
|
|
23
|
-
/fcd/info:
|
|
24
|
-
get:
|
|
25
|
-
summary: GET Latest floating Car Data
|
|
26
|
-
description: ""
|
|
27
|
-
tags:
|
|
28
|
-
- 🚢 Floating Car Data
|
|
29
|
-
operationId: getFCD
|
|
30
|
-
parameters:
|
|
31
|
-
- name: locationId
|
|
32
|
-
in: query
|
|
33
|
-
description: >-
|
|
34
|
-
Filters data with Predefined Location Id.
|
|
35
|
-
required: false
|
|
36
|
-
schema:
|
|
37
|
-
type: string
|
|
38
|
-
example: TS10125T10123
|
|
39
|
-
- name: osmPath
|
|
40
|
-
in: query
|
|
41
|
-
description: >-
|
|
42
|
-
Includes in the output pathOsm
|
|
43
|
-
required: false
|
|
44
|
-
schema:
|
|
45
|
-
type: boolean
|
|
46
|
-
example: true
|
|
47
|
-
- name:
|
|
48
|
-
in: query
|
|
49
|
-
description: >-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
1
|
+
openapi: 3.0.3
|
|
2
|
+
info:
|
|
3
|
+
title: 🚢 Floating Car Data
|
|
4
|
+
description: >-
|
|
5
|
+
version: 1.0.1
|
|
6
|
+
contact:
|
|
7
|
+
name: Golemio Prague Data Plaform
|
|
8
|
+
email: golemio@operatorict.cz
|
|
9
|
+
url: https://golemio.cz
|
|
10
|
+
|
|
11
|
+
servers:
|
|
12
|
+
- url: https://rabin.golemio.cz/v2
|
|
13
|
+
description: Test (development) server
|
|
14
|
+
- url: https://api.golemio.cz/v2
|
|
15
|
+
description: Main (production) server
|
|
16
|
+
|
|
17
|
+
tags:
|
|
18
|
+
- name: 🚢 Floating Car Data
|
|
19
|
+
description: >-
|
|
20
|
+
💡 FCD
|
|
21
|
+
|
|
22
|
+
paths:
|
|
23
|
+
/fcd/info:
|
|
24
|
+
get:
|
|
25
|
+
summary: GET Latest floating Car Data
|
|
26
|
+
description: ""
|
|
27
|
+
tags:
|
|
28
|
+
- 🚢 Floating Car Data
|
|
29
|
+
operationId: getFCD
|
|
30
|
+
parameters:
|
|
31
|
+
- name: locationId
|
|
32
|
+
in: query
|
|
33
|
+
description: >-
|
|
34
|
+
Filters data with Predefined Location Id.
|
|
35
|
+
required: false
|
|
36
|
+
schema:
|
|
37
|
+
type: string
|
|
38
|
+
example: TS10125T10123
|
|
39
|
+
- name: osmPath
|
|
40
|
+
in: query
|
|
41
|
+
description: >-
|
|
42
|
+
Includes in the output pathOsm
|
|
43
|
+
required: false
|
|
44
|
+
schema:
|
|
45
|
+
type: boolean
|
|
46
|
+
example: true
|
|
47
|
+
- name: minutesBefore
|
|
48
|
+
in: query
|
|
49
|
+
description: >-
|
|
50
|
+
Lists items updated since given number of minutes, returns unique locations only
|
|
51
|
+
schema:
|
|
52
|
+
type: integer
|
|
53
|
+
example: 10
|
|
54
|
+
minimum: 1
|
|
55
|
+
exclusiveMinimum: false
|
|
56
|
+
maximum: 60
|
|
57
|
+
exclusiveMaximum: false
|
|
58
|
+
- name: limit
|
|
59
|
+
in: query
|
|
60
|
+
description: >-
|
|
61
|
+
Limits number of retrieved items. The maximum is 10000 (default
|
|
62
|
+
value)
|
|
63
|
+
required: false
|
|
64
|
+
schema:
|
|
65
|
+
type: integer
|
|
66
|
+
format: int64
|
|
67
|
+
example: 10
|
|
68
|
+
- name: offset
|
|
69
|
+
in: query
|
|
70
|
+
description: Number of the first items that are skipped
|
|
71
|
+
required: false
|
|
72
|
+
schema:
|
|
73
|
+
type: integer
|
|
74
|
+
format: int64
|
|
75
|
+
example: 0
|
|
76
|
+
responses:
|
|
77
|
+
"200":
|
|
78
|
+
description: successful operation
|
|
79
|
+
content:
|
|
80
|
+
application/json:
|
|
81
|
+
schema:
|
|
82
|
+
$ref: "#/components/schemas/FloatingCarDataPublication"
|
|
83
|
+
"401":
|
|
84
|
+
$ref: "#/components/responses/UnauthorizedError"
|
|
85
|
+
"404":
|
|
86
|
+
description: Not found
|
|
87
|
+
|
|
88
|
+
components:
|
|
89
|
+
responses:
|
|
90
|
+
UnauthorizedError:
|
|
91
|
+
description: API key is missing or invalid
|
|
92
|
+
headers:
|
|
93
|
+
WWW_Authenticate:
|
|
94
|
+
schema:
|
|
95
|
+
type: string
|
|
96
|
+
|
|
97
|
+
schemas:
|
|
98
|
+
FloatingCarDataPublication:
|
|
99
|
+
type: object
|
|
100
|
+
properties:
|
|
101
|
+
modelBaseVersion:
|
|
102
|
+
type: string
|
|
103
|
+
example: 3
|
|
104
|
+
situationPublicationLight:
|
|
105
|
+
type: object
|
|
106
|
+
properties:
|
|
107
|
+
lang:
|
|
108
|
+
type: string
|
|
109
|
+
example: cz
|
|
110
|
+
publicationTime:
|
|
111
|
+
type: string
|
|
112
|
+
example: "2021-06-21T10:00:37.000Z"
|
|
113
|
+
publicationCreator:
|
|
114
|
+
type: object
|
|
115
|
+
properties:
|
|
116
|
+
country:
|
|
117
|
+
type: string
|
|
118
|
+
example: cz
|
|
119
|
+
nationalIdentifier:
|
|
120
|
+
type: string
|
|
121
|
+
example: ŘSD
|
|
122
|
+
elaboratedData:
|
|
123
|
+
type: array
|
|
124
|
+
items:
|
|
125
|
+
$ref: "#/components/schemas/FCDElaboratedData"
|
|
126
|
+
|
|
127
|
+
FCDElaboratedData:
|
|
128
|
+
type: object
|
|
129
|
+
required:
|
|
130
|
+
[
|
|
131
|
+
measurementOrCalculationTime,
|
|
132
|
+
sourceIdentification,
|
|
133
|
+
supplierCalculatedDataQuality,
|
|
134
|
+
numberOfInputValuesUsed,
|
|
135
|
+
predefinedLocationId,
|
|
136
|
+
trafficLevel,
|
|
137
|
+
averageVehicleSpeed,
|
|
138
|
+
travelTime,
|
|
139
|
+
freeFlowTravelTime,
|
|
140
|
+
freeFlowSpeed,
|
|
141
|
+
]
|
|
142
|
+
properties:
|
|
143
|
+
measurementOrCalculationTime:
|
|
144
|
+
type: string
|
|
145
|
+
example: "2021-06-21T10:00:37.000Z"
|
|
146
|
+
sourceIdentification:
|
|
147
|
+
type: string
|
|
148
|
+
example: "TS01239T25689"
|
|
149
|
+
supplierCalculatedDataQuality:
|
|
150
|
+
type: string
|
|
151
|
+
example: "0.5"
|
|
152
|
+
numberOfInputValuesUsed:
|
|
153
|
+
type: string
|
|
154
|
+
example: "1"
|
|
155
|
+
predefinedLocationId:
|
|
156
|
+
type: string
|
|
157
|
+
example: "TS01239T25689"
|
|
158
|
+
trafficLevel:
|
|
159
|
+
type: string
|
|
160
|
+
example: "level3"
|
|
161
|
+
averageVehicleSpeed:
|
|
162
|
+
type: string
|
|
163
|
+
example: "86"
|
|
164
|
+
travelTime:
|
|
165
|
+
type: string
|
|
166
|
+
example: "116"
|
|
167
|
+
freeFlowTravelTime:
|
|
168
|
+
type: string
|
|
169
|
+
example: "80"
|
|
170
|
+
freeFlowSpeed:
|
|
171
|
+
type: string
|
|
172
|
+
example: "126"
|
|
173
|
+
queueExists:
|
|
174
|
+
type: string
|
|
175
|
+
example: "true"
|
|
176
|
+
queueLength:
|
|
177
|
+
type: string
|
|
178
|
+
example: "180"
|
|
179
|
+
fromPoint:
|
|
180
|
+
type: string
|
|
181
|
+
example: "0.591"
|
|
182
|
+
toPoint:
|
|
183
|
+
type: string
|
|
184
|
+
example: "0.708"
|
|
185
|
+
osmPath:
|
|
186
|
+
type: array
|
|
187
|
+
nullable: true
|
|
188
|
+
items:
|
|
189
|
+
type: number
|
|
190
|
+
example: 32948103
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/fcd",
|
|
3
|
-
"version": "1.1.6-
|
|
3
|
+
"version": "1.1.6-rc.906686893",
|
|
4
4
|
"description": "Golemio Floating Car Data 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.4.3",
|
|
39
|
-
"@golemio/core": "1.8.
|
|
39
|
+
"@golemio/core": "1.8.1",
|
|
40
40
|
"@golemio/db-common": "1.1.1",
|
|
41
41
|
"@golemio/eslint-config": "1.1.1",
|
|
42
42
|
"@golemio/traffic-common": "0.1.2",
|