@golemio/fcd 1.2.5 → 1.2.6
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/example/sql_dump.sql +7 -0
- package/db/migrations/postgresql/20240419120732-fcd-new-view.js +53 -0
- package/db/migrations/postgresql/sqls/20240419120732-fcd-new-view-down.sql +2 -0
- package/db/migrations/postgresql/sqls/20240419120732-fcd-new-view-up.sql +78 -0
- package/dist/integration-engine/transformations/FloatingCarDataTransformation.d.ts +2 -1
- package/dist/integration-engine/transformations/FloatingCarDataTransformation.js.map +1 -1
- package/dist/integration-engine/transformations/interfaces/FloatingCarDataInterface.d.ts +1 -47
- package/dist/integration-engine/workers/tasks/SaveFloatingCarDataTask.d.ts +2 -2
- package/dist/integration-engine/workers/tasks/SaveFloatingCarDataTask.js +3 -3
- package/dist/integration-engine/workers/tasks/SaveFloatingCarDataTask.js.map +1 -1
- package/dist/output-gateway/FCDRouter.d.ts +4 -2
- package/dist/output-gateway/FCDRouter.js +17 -7
- package/dist/output-gateway/FCDRouter.js.map +1 -1
- package/dist/output-gateway/models/FloatingCarDataModel.d.ts +1 -1
- package/dist/output-gateway/models/FloatingCarDataModel.js.map +1 -1
- package/dist/output-gateway/models/FloatingCarExtendedDataModel.d.ts +1 -1
- package/dist/output-gateway/models/FloatingCarExtendedDataModel.js.map +1 -1
- package/dist/output-gateway/models/FloatingCarWithOsmPathDataModel.d.ts +11 -0
- package/dist/output-gateway/models/FloatingCarWithOsmPathDataModel.js +54 -0
- package/dist/output-gateway/models/FloatingCarWithOsmPathDataModel.js.map +1 -0
- package/dist/output-gateway/models/FloatingCarWithOsmPathExtendedDataModel.d.ts +12 -0
- package/dist/output-gateway/models/FloatingCarWithOsmPathExtendedDataModel.js +61 -0
- package/dist/output-gateway/models/FloatingCarWithOsmPathExtendedDataModel.js.map +1 -0
- package/dist/output-gateway/models/index.d.ts +2 -0
- package/dist/output-gateway/models/index.js +2 -0
- package/dist/output-gateway/models/index.js.map +1 -1
- package/dist/output-gateway/transformations/OutputFloatingCarDataTransformation.d.ts +6 -5
- package/dist/output-gateway/transformations/OutputFloatingCarDataTransformation.js +42 -50
- package/dist/output-gateway/transformations/OutputFloatingCarDataTransformation.js.map +1 -1
- package/dist/output-gateway/transformations/interfaces/outputApiFloatingCarData.d.ts +13 -0
- package/dist/output-gateway/transformations/interfaces/outputApiFloatingCarData.js +3 -0
- package/dist/output-gateway/transformations/interfaces/outputApiFloatingCarData.js.map +1 -0
- package/dist/schema-definitions/index.js +1 -0
- package/dist/schema-definitions/index.js.map +1 -1
- package/dist/schema-definitions/interfaces/FloatingCarDataInterface.d.ts +38 -0
- package/dist/schema-definitions/interfaces/FloatingCarDataInterface.js +3 -0
- package/dist/schema-definitions/interfaces/FloatingCarDataInterface.js.map +1 -0
- package/dist/schema-definitions/schemas/fcd_output_schema.d.ts +1 -0
- package/dist/schema-definitions/schemas/fcd_output_schema.js +2 -1
- package/dist/schema-definitions/schemas/fcd_output_schema.js.map +1 -1
- package/docs/implementation_documentation.md +1 -0
- package/package.json +2 -2
- package/dist/output-gateway/transformations/getLocationPointsFromTsString.d.ts +0 -2
- package/dist/output-gateway/transformations/getLocationPointsFromTsString.js +0 -19
- package/dist/output-gateway/transformations/getLocationPointsFromTsString.js.map +0 -1
package/db/example/sql_dump.sql
CHANGED
|
@@ -7,3 +7,10 @@ VALUES('2021-09-21 01:36:59.000', 'TS10127T19629', '2021-09-21 01:36:01.000', 'T
|
|
|
7
7
|
INSERT INTO fcd_traff_params_part
|
|
8
8
|
(publication_time, source_identification, measurement_or_calculation_time, predefined_location, version_of_predefined_location, traffic_level, queue_exists, queue_length, from_point, to_point, data_quality, input_values, average_vehicle_speed, travel_time, free_flow_travel_time, free_flow_speed, create_batch_id, created_at, created_by, update_batch_id, updated_at, updated_by)
|
|
9
9
|
VALUES('2021-09-21 01:36:59.000', 'TS10182T24828', '2021-09-21 01:36:01.000', 'TS10182T24828', 2, 'level1', false, NULL, NULL, NULL, 0.833, 3, 91, 87, 106, 76, NULL, '2021-10-18 11:01:16.534', NULL, NULL, '2021-10-18 11:01:16.534', NULL);
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
DELETE from traffic.rsd_tmc_osm_mapping;
|
|
13
|
+
|
|
14
|
+
INSERT INTO traffic.rsd_tmc_osm_mapping (lt_start,lt_end,osm_path) VALUES
|
|
15
|
+
(10125,10123,'[1837041102, 8418051939, 7881860434, 1837022954, 1837022956, 1837022966, 977504781, 8404188228, 5216395186, 2674815365, 977504746, 8402974140, 1017997574, 1017997516, 1017997560, 1017997515, 8403075909, 8403127730, 8403075911, 8403075912, 8403127735]'),
|
|
16
|
+
(10127,19629,'[29381030, 29403193, 338604070, 29381028, 338604072, 29403192, 2681371748, 1138616634, 2681371747, 308815174,1138624651, 29403191]');
|
|
@@ -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', '20240419120732-fcd-new-view-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', '20240419120732-fcd-new-view-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,78 @@
|
|
|
1
|
+
CREATE OR REPLACE VIEW v_traffic_params_all_with_osm_path
|
|
2
|
+
AS SELECT t.queue_exists,
|
|
3
|
+
t.queue_length,
|
|
4
|
+
t.from_point,
|
|
5
|
+
t.to_point,
|
|
6
|
+
rtom.osm_path,
|
|
7
|
+
t.source_identification,
|
|
8
|
+
t.data_quality,
|
|
9
|
+
t.input_values,
|
|
10
|
+
t.predefined_location,
|
|
11
|
+
t.average_vehicle_speed,
|
|
12
|
+
t.travel_time,
|
|
13
|
+
t.free_flow_travel_time,
|
|
14
|
+
t.free_flow_speed,
|
|
15
|
+
t.measurement_or_calculation_time,
|
|
16
|
+
t.publication_time,
|
|
17
|
+
t.version_of_predefined_location,
|
|
18
|
+
t.traffic_level
|
|
19
|
+
FROM ( SELECT v_traffic_params_all.publication_time,
|
|
20
|
+
v_traffic_params_all.source_identification,
|
|
21
|
+
v_traffic_params_all.measurement_or_calculation_time,
|
|
22
|
+
v_traffic_params_all.predefined_location,
|
|
23
|
+
v_traffic_params_all.version_of_predefined_location,
|
|
24
|
+
v_traffic_params_all.traffic_level,
|
|
25
|
+
v_traffic_params_all.queue_exists,
|
|
26
|
+
v_traffic_params_all.queue_length,
|
|
27
|
+
v_traffic_params_all.from_point,
|
|
28
|
+
v_traffic_params_all.to_point,
|
|
29
|
+
v_traffic_params_all.data_quality,
|
|
30
|
+
v_traffic_params_all.input_values,
|
|
31
|
+
v_traffic_params_all.average_vehicle_speed,
|
|
32
|
+
v_traffic_params_all.travel_time,
|
|
33
|
+
v_traffic_params_all.free_flow_travel_time,
|
|
34
|
+
v_traffic_params_all.free_flow_speed,
|
|
35
|
+
regexp_split_to_array(v_traffic_params_all.source_identification::text, '(TS|T)'::text) AS i
|
|
36
|
+
FROM v_traffic_params_all)t
|
|
37
|
+
LEFT JOIN traffic.rsd_tmc_osm_mapping rtom ON rtom.lt_start = t.i[2]::integer AND rtom.lt_end = t.i[3]::integer;
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
CREATE OR REPLACE VIEW v_traffic_params_last_hour_osm_path
|
|
43
|
+
AS SELECT t.queue_exists,
|
|
44
|
+
t.queue_length,
|
|
45
|
+
t.from_point,
|
|
46
|
+
t.to_point,
|
|
47
|
+
rtom.osm_path,
|
|
48
|
+
t.source_identification,
|
|
49
|
+
t.data_quality,
|
|
50
|
+
t.input_values,
|
|
51
|
+
t.predefined_location,
|
|
52
|
+
t.average_vehicle_speed,
|
|
53
|
+
t.travel_time,
|
|
54
|
+
t.free_flow_travel_time,
|
|
55
|
+
t.free_flow_speed,
|
|
56
|
+
t.measurement_or_calculation_time,
|
|
57
|
+
t.publication_time,
|
|
58
|
+
t.version_of_predefined_location,
|
|
59
|
+
t.traffic_level
|
|
60
|
+
FROM ( SELECT v_traffic_params_last_hour.publication_time,
|
|
61
|
+
v_traffic_params_last_hour.source_identification,
|
|
62
|
+
v_traffic_params_last_hour.measurement_or_calculation_time,
|
|
63
|
+
v_traffic_params_last_hour.predefined_location,
|
|
64
|
+
v_traffic_params_last_hour.version_of_predefined_location,
|
|
65
|
+
v_traffic_params_last_hour.traffic_level,
|
|
66
|
+
v_traffic_params_last_hour.queue_exists,
|
|
67
|
+
v_traffic_params_last_hour.queue_length,
|
|
68
|
+
v_traffic_params_last_hour.from_point,
|
|
69
|
+
v_traffic_params_last_hour.to_point,
|
|
70
|
+
v_traffic_params_last_hour.data_quality,
|
|
71
|
+
v_traffic_params_last_hour.input_values,
|
|
72
|
+
v_traffic_params_last_hour.average_vehicle_speed,
|
|
73
|
+
v_traffic_params_last_hour.travel_time,
|
|
74
|
+
v_traffic_params_last_hour.free_flow_travel_time,
|
|
75
|
+
v_traffic_params_last_hour.free_flow_speed,
|
|
76
|
+
regexp_split_to_array(v_traffic_params_last_hour.source_identification::text, '(TS|T)'::text) AS i
|
|
77
|
+
FROM v_traffic_params_last_hour)t
|
|
78
|
+
LEFT JOIN traffic.rsd_tmc_osm_mapping rtom ON rtom.lt_start = t.i[2]::integer AND rtom.lt_end = t.i[3]::integer;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseTransformation, ITransformation } from "@golemio/core/dist/integration-engine";
|
|
2
|
-
import { IFloatingCarData, IElaboratedData,
|
|
2
|
+
import { IFloatingCarData, IElaboratedData, IFloatingCarDataModelElaboratedPart } from "..";
|
|
3
|
+
import { IFloatingCarDataModel } from "../../schema-definitions/interfaces/FloatingCarDataInterface";
|
|
3
4
|
export declare class FloatingCarDataTransformation extends BaseTransformation implements ITransformation {
|
|
4
5
|
name: string;
|
|
5
6
|
constructor();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingCarDataTransformation.js","sourceRoot":"","sources":["../../../src/integration-engine/transformations/FloatingCarDataTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8EAA4F;AAC5F,mDAA2B;
|
|
1
|
+
{"version":3,"file":"FloatingCarDataTransformation.js","sourceRoot":"","sources":["../../../src/integration-engine/transformations/FloatingCarDataTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8EA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C,KAAK,CAAC,IAAI,EAAE,CAAC;gBACpC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC1B,CAAC,CAAC,CAAC;YACH,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;gBACrC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;YACzB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;QAxGE,IAAI,CAAC,IAAI,GAAG,UAAG,CAAC,QAAQ,CAAC,IAAI,CAAC;IAClC,CAAC;CAwGJ;AA9GD,sEA8GC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IFloatingCarDataModel } from "../../../schema-definitions/interfaces/FloatingCarDataInterface";
|
|
1
2
|
export interface IFloatingCarData {
|
|
2
3
|
$: {
|
|
3
4
|
xmlns: string;
|
|
@@ -97,52 +98,5 @@ interface IAverageVehicleSpeed {
|
|
|
97
98
|
};
|
|
98
99
|
speed: string;
|
|
99
100
|
}
|
|
100
|
-
export interface IFloatingCarDataModel {
|
|
101
|
-
publication_time: string;
|
|
102
|
-
source_identification: string;
|
|
103
|
-
measurement_or_calculation_time: string;
|
|
104
|
-
predefined_location: string;
|
|
105
|
-
version_of_predefined_location: number;
|
|
106
|
-
traffic_level: string;
|
|
107
|
-
queue_exists?: boolean;
|
|
108
|
-
queue_length?: number;
|
|
109
|
-
from_point?: number;
|
|
110
|
-
to_point?: number;
|
|
111
|
-
data_quality: number;
|
|
112
|
-
input_values: number;
|
|
113
|
-
average_vehicle_speed: number;
|
|
114
|
-
travel_time: number;
|
|
115
|
-
free_flow_travel_time: number;
|
|
116
|
-
free_flow_speed: number;
|
|
117
|
-
}
|
|
118
101
|
export type IFloatingCarDataModelElaboratedPart = Omit<IFloatingCarDataModel, "publication_time">;
|
|
119
|
-
export interface IOutputApiFloatingCarData {
|
|
120
|
-
modelBaseVersion: string;
|
|
121
|
-
payloadPublicationLight: {
|
|
122
|
-
lang: string;
|
|
123
|
-
publicationTime: string;
|
|
124
|
-
publicationCreator: {
|
|
125
|
-
country: string;
|
|
126
|
-
nationalIdentifier: string;
|
|
127
|
-
};
|
|
128
|
-
elaboratedData: IOutputApiFloatingCarDataElaboratedData[];
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
export interface IOutputApiFloatingCarDataElaboratedData {
|
|
132
|
-
measurementOrCalculationTime: string;
|
|
133
|
-
sourceIdentification: string;
|
|
134
|
-
supplierCalculatedDataQuality: string;
|
|
135
|
-
numberOfInputValuesUsed: string;
|
|
136
|
-
predefinedLocationId: string;
|
|
137
|
-
trafficLevel: string;
|
|
138
|
-
averageVehicleSpeed: string;
|
|
139
|
-
travelTime: string;
|
|
140
|
-
freeFlowTravelTime: string;
|
|
141
|
-
freeFlowSpeed: string;
|
|
142
|
-
queueExists?: string;
|
|
143
|
-
queueLength?: string;
|
|
144
|
-
fromPoint?: string;
|
|
145
|
-
toPoint?: string;
|
|
146
|
-
osmPath?: number[] | null;
|
|
147
|
-
}
|
|
148
102
|
export {};
|
|
@@ -4,10 +4,10 @@ import { FloatingCarDataRepository } from "../../repositories/fcd/FloatingCarDat
|
|
|
4
4
|
import { AbstractTaskJsonSchema } from "@golemio/core/dist/integration-engine/workers/AbstractTaskJsonSchema";
|
|
5
5
|
export declare class SaveFloatingCarDataTask extends AbstractTaskJsonSchema<IFloatingCarData> {
|
|
6
6
|
private floatingCarDataTransformation;
|
|
7
|
-
private
|
|
7
|
+
private floatingCarDataRepository;
|
|
8
8
|
readonly queueName = "saveFloatingCarData";
|
|
9
9
|
readonly queueTtl: number;
|
|
10
10
|
protected schema: JSONSchemaValidator;
|
|
11
|
-
constructor(floatingCarDataTransformation: FloatingCarDataTransformation,
|
|
11
|
+
constructor(floatingCarDataTransformation: FloatingCarDataTransformation, floatingCarDataRepository: FloatingCarDataRepository);
|
|
12
12
|
protected execute(data: IFloatingCarData): Promise<void>;
|
|
13
13
|
}
|
|
@@ -32,10 +32,10 @@ const FloatingCarDataRepository_1 = require("../../repositories/fcd/FloatingCarD
|
|
|
32
32
|
const AbstractTaskJsonSchema_1 = require("@golemio/core/dist/integration-engine/workers/AbstractTaskJsonSchema");
|
|
33
33
|
const floatingCarData_1 = require("../../schemas/floatingCarData");
|
|
34
34
|
let SaveFloatingCarDataTask = exports.SaveFloatingCarDataTask = class SaveFloatingCarDataTask extends AbstractTaskJsonSchema_1.AbstractTaskJsonSchema {
|
|
35
|
-
constructor(floatingCarDataTransformation,
|
|
35
|
+
constructor(floatingCarDataTransformation, floatingCarDataRepository) {
|
|
36
36
|
super(_sch_1.FCD.name.toLowerCase());
|
|
37
37
|
this.floatingCarDataTransformation = floatingCarDataTransformation;
|
|
38
|
-
this.
|
|
38
|
+
this.floatingCarDataRepository = floatingCarDataRepository;
|
|
39
39
|
this.queueName = "saveFloatingCarData";
|
|
40
40
|
this.queueTtl = 59 * 60 * 1000;
|
|
41
41
|
this.schema = new golemio_validator_1.JSONSchemaValidator("floatingCarDataValidation", floatingCarData_1.floatingCarDataJsonSchema);
|
|
@@ -44,7 +44,7 @@ let SaveFloatingCarDataTask = exports.SaveFloatingCarDataTask = class SaveFloati
|
|
|
44
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
45
|
try {
|
|
46
46
|
const transformedData = yield this.floatingCarDataTransformation.transform(data);
|
|
47
|
-
yield this.
|
|
47
|
+
yield this.floatingCarDataRepository.save(transformedData);
|
|
48
48
|
}
|
|
49
49
|
catch (error) {
|
|
50
50
|
throw new golemio_errors_1.GeneralError("Error while processing Floating Car Data.", "SaveFloatingCarDataTask", error, 422);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveFloatingCarDataTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/tasks/SaveFloatingCarDataTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAsE;AACtE,sDAA2B;AAC3B,6EAAwE;AACxE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,uBAAuB;IADnC,IAAA,qBAAU,GAAE;IAQJ,WAAA,IAAA,iBAAM,EAAC,sCAAoB,CAAC,6BAA6B,CAAC,CAAA;IAE1D,WAAA,IAAA,iBAAM,EAAC,sCAAoB,CAAC,yBAAyB,CAAC,CAAA;qCADhB,mCAA6B;QAEjC,qDAAyB;GAVvD,uBAAuB,CAuBnC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
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, FloatingCarExtendedDataModel } from "./models";
|
|
4
|
+
import { FloatingCarDataModel, FloatingCarWithOsmPathDataModel, FloatingCarExtendedDataModel, FloatingCarWithOsmPathExtendedDataModel } from "./models";
|
|
5
5
|
import { OutputFloatingCarDataTransformation } from "./transformations/OutputFloatingCarDataTransformation";
|
|
6
6
|
export declare class FCDRouter extends BaseRouter {
|
|
7
7
|
protected floatingCarDataModel: FloatingCarDataModel;
|
|
8
|
+
protected floatingCarWithOsmPathDataModel: FloatingCarWithOsmPathDataModel;
|
|
8
9
|
protected floatingCarExtendedDataModel: FloatingCarExtendedDataModel;
|
|
10
|
+
protected floatingCarWithOsmPathExtendedDataModel: FloatingCarWithOsmPathExtendedDataModel;
|
|
9
11
|
private outputFloatingCarDataTransformation;
|
|
10
|
-
constructor(floatingCarDataModel: FloatingCarDataModel, floatingCarExtendedDataModel: FloatingCarExtendedDataModel, outputFloatingCarDataTransformation: OutputFloatingCarDataTransformation);
|
|
12
|
+
constructor(floatingCarDataModel: FloatingCarDataModel, floatingCarWithOsmPathDataModel: FloatingCarWithOsmPathDataModel, floatingCarExtendedDataModel: FloatingCarExtendedDataModel, floatingCarWithOsmPathExtendedDataModel: FloatingCarWithOsmPathExtendedDataModel, outputFloatingCarDataTransformation: OutputFloatingCarDataTransformation);
|
|
11
13
|
GetFloatingCarData: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
12
14
|
}
|
|
13
15
|
declare const fcdRouter: Router;
|
|
@@ -17,12 +17,13 @@ const BaseRouter_1 = require("@golemio/core/dist/output-gateway/routes/BaseRoute
|
|
|
17
17
|
const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
|
|
18
18
|
const models_1 = require("./models");
|
|
19
19
|
const OutputFloatingCarDataTransformation_1 = require("./transformations/OutputFloatingCarDataTransformation");
|
|
20
|
-
const repositories_1 = require("@golemio/traffic-common/dist/output-gateway/repositories");
|
|
21
20
|
class FCDRouter extends BaseRouter_1.BaseRouter {
|
|
22
|
-
constructor(floatingCarDataModel, floatingCarExtendedDataModel, outputFloatingCarDataTransformation) {
|
|
21
|
+
constructor(floatingCarDataModel, floatingCarWithOsmPathDataModel, floatingCarExtendedDataModel, floatingCarWithOsmPathExtendedDataModel, outputFloatingCarDataTransformation) {
|
|
23
22
|
super();
|
|
24
23
|
this.floatingCarDataModel = floatingCarDataModel;
|
|
24
|
+
this.floatingCarWithOsmPathDataModel = floatingCarWithOsmPathDataModel;
|
|
25
25
|
this.floatingCarExtendedDataModel = floatingCarExtendedDataModel;
|
|
26
|
+
this.floatingCarWithOsmPathExtendedDataModel = floatingCarWithOsmPathExtendedDataModel;
|
|
26
27
|
this.outputFloatingCarDataTransformation = outputFloatingCarDataTransformation;
|
|
27
28
|
this.GetFloatingCarData = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
28
29
|
try {
|
|
@@ -33,14 +34,23 @@ class FCDRouter extends BaseRouter_1.BaseRouter {
|
|
|
33
34
|
limit: req.query.limit ? +req.query.limit : undefined,
|
|
34
35
|
offset: req.query.offset ? +req.query.offset : undefined,
|
|
35
36
|
minutesBefore,
|
|
37
|
+
isRequestedPathOsm,
|
|
36
38
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
let dataFromDb = [];
|
|
40
|
+
if (isRequestedPathOsm) {
|
|
41
|
+
dataFromDb = minutesBefore
|
|
42
|
+
? yield this.floatingCarWithOsmPathExtendedDataModel.GetAll(options)
|
|
43
|
+
: yield this.floatingCarWithOsmPathDataModel.GetAll(options);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
dataFromDb = minutesBefore
|
|
47
|
+
? yield this.floatingCarExtendedDataModel.GetAll(options)
|
|
48
|
+
: yield this.floatingCarDataModel.GetAll(options);
|
|
49
|
+
}
|
|
40
50
|
if (!(dataFromDb === null || dataFromDb === void 0 ? void 0 : dataFromDb.length)) {
|
|
41
51
|
throw new golemio_errors_1.GeneralError("No data found", "FCDRouter", undefined, 404);
|
|
42
52
|
}
|
|
43
|
-
const transformedData =
|
|
53
|
+
const transformedData = this.outputFloatingCarDataTransformation.transform(dataFromDb, isRequestedPathOsm);
|
|
44
54
|
res.status(200).send(transformedData);
|
|
45
55
|
}
|
|
46
56
|
catch (err) {
|
|
@@ -55,6 +65,6 @@ class FCDRouter extends BaseRouter_1.BaseRouter {
|
|
|
55
65
|
}
|
|
56
66
|
}
|
|
57
67
|
exports.FCDRouter = FCDRouter;
|
|
58
|
-
const fcdRouter = new FCDRouter(new models_1.FloatingCarDataModel(), new models_1.FloatingCarExtendedDataModel(), new
|
|
68
|
+
const fcdRouter = new FCDRouter(new models_1.FloatingCarDataModel(), new models_1.FloatingCarWithOsmPathDataModel(), new models_1.FloatingCarExtendedDataModel(), new models_1.FloatingCarWithOsmPathExtendedDataModel(), new OutputFloatingCarDataTransformation_1.OutputFloatingCarDataTransformation()).router;
|
|
59
69
|
exports.fcdRouter = fcdRouter;
|
|
60
70
|
//# 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,
|
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,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;YACzF,IAAA,yBAAK,EAAC,eAAe,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;SAC/E,EACD,uBAAU,EACV,wBAAW,EACX,IAAA,sCAAyB,EAAC,WAAW,CAAC,EACtC,IAAA,0BAAkB,GAAE,EACpB,IAAI,CAAC,kBAAkB,CAC1B,CAAC;IACN,CAAC;CAoCJ;AA3DD,8BA2DC;AAED,MAAM,SAAS,GAAW,IAAI,SAAS,CACnC,IAAI,6BAAoB,EAAE,EAC1B,IAAI,wCAA+B,EAAE,EACrC,IAAI,qCAA4B,EAAE,EAClC,IAAI,gDAAuC,EAAE,EAC7C,IAAI,yEAAmC,EAAE,CAC5C,CAAC,MAAM,CAAC;AAEA,8BAAS"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IFloatingCarDataModel } from "../../
|
|
1
|
+
import { IFloatingCarDataModel } from "../../schema-definitions/interfaces/FloatingCarDataInterface";
|
|
2
2
|
import { SequelizeModel } from "@golemio/core/dist/output-gateway/models";
|
|
3
3
|
export declare class FloatingCarDataModel extends SequelizeModel {
|
|
4
4
|
constructor();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingCarDataModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/FloatingCarDataModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"FloatingCarDataModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/FloatingCarDataModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0DAAiC;AAEjC,qEAA0E;AAC1E,6EAAwE;AACxE,oFAA4D;AAE5D,MAAa,oBAAqB,SAAQ,uBAAc;IACpD;QACI,KAAK,CAAC,WAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,sBAAsB,EAAE,WAAG,CAAC,QAAQ,CAAC,yBAAyB,EAAE;YACrF,MAAM,EAAE,WAAG,CAAC,QAAQ;SACvB,CAAC,CAAC;QAGA,WAAM,GAAG,CACZ,UAII,EAAE,EAC0B,EAAE;YAClC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;YAC9C,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,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,sBAAsB,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;aACnG;QACL,CAAC,CAAA,CAAC;QAEK,WAAM,GAAG,GAAiC,EAAE;YAC/C,MAAM,IAAI,6BAAY,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC;QACtE,CAAC,CAAA,CAAC;IAnCF,CAAC;CAoCJ;AAzCD,oDAyCC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IFloatingCarDataModel } from "../../
|
|
1
|
+
import { IFloatingCarDataModel } from "../../schema-definitions/interfaces/FloatingCarDataInterface";
|
|
2
2
|
import { SequelizeModel } from "@golemio/core/dist/output-gateway/models";
|
|
3
3
|
export declare class FloatingCarExtendedDataModel extends SequelizeModel {
|
|
4
4
|
constructor();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingCarExtendedDataModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/FloatingCarExtendedDataModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"FloatingCarExtendedDataModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/FloatingCarExtendedDataModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0DAAiC;AAEjC,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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IFloatingCarWithOsmPathDataModel } from "../../schema-definitions/interfaces/FloatingCarDataInterface";
|
|
2
|
+
import { SequelizeModel } from "@golemio/core/dist/output-gateway/models";
|
|
3
|
+
export declare class FloatingCarWithOsmPathDataModel extends SequelizeModel {
|
|
4
|
+
constructor();
|
|
5
|
+
GetAll: (options?: {
|
|
6
|
+
locationId?: string;
|
|
7
|
+
limit?: number;
|
|
8
|
+
offset?: number;
|
|
9
|
+
}) => Promise<IFloatingCarWithOsmPathDataModel[]>;
|
|
10
|
+
GetOne: () => Promise<object | null>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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.FloatingCarWithOsmPathDataModel = 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 FloatingCarWithOsmPathDataModel extends models_1.SequelizeModel {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(index_1.FCD.fcd_info.name, "v_traffic_params_all_with_osm_path", index_1.FCD.fcd_info.outputSequelizeAttributesWithOsmPath, {
|
|
23
|
+
schema: index_1.FCD.pgSchema,
|
|
24
|
+
});
|
|
25
|
+
this.GetAll = (options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const { locationId, 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
|
+
return yield this.sequelizeModel.findAll({
|
|
38
|
+
limit,
|
|
39
|
+
offset,
|
|
40
|
+
raw: true,
|
|
41
|
+
where,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
throw new golemio_errors_1.GeneralError(`GetAll method error: ${err.message}`, "FloatingCarDataModel", err, 500);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
this.GetOne = () => __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
throw new golemio_errors_1.GeneralError("Not implemented", "FloatingCarDataModel");
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.FloatingCarWithOsmPathDataModel = FloatingCarWithOsmPathDataModel;
|
|
54
|
+
//# sourceMappingURL=FloatingCarWithOsmPathDataModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingCarWithOsmPathDataModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/FloatingCarWithOsmPathDataModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0DAAiC;AAEjC,qEAA0E;AAC1E,6EAAwE;AACxE,oFAA4D;AAE5D,MAAa,+BAAgC,SAAQ,uBAAc;IAC/D;QACI,KAAK,CAAC,WAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,oCAAoC,EAAE,WAAG,CAAC,QAAQ,CAAC,oCAAoC,EAAE;YAC9G,MAAM,EAAE,WAAG,CAAC,QAAQ;SACvB,CAAC,CAAC;QAGA,WAAM,GAAG,CACZ,UAII,EAAE,EACqC,EAAE;YAC7C,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;YAC9C,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,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,sBAAsB,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;aACnG;QACL,CAAC,CAAA,CAAC;QAEK,WAAM,GAAG,GAAiC,EAAE;YAC/C,MAAM,IAAI,6BAAY,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC;QACtE,CAAC,CAAA,CAAC;IAnCF,CAAC;CAoCJ;AAzCD,0EAyCC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IFloatingCarWithOsmPathDataModel } from "../../schema-definitions/interfaces/FloatingCarDataInterface";
|
|
2
|
+
import { SequelizeModel } from "@golemio/core/dist/output-gateway/models";
|
|
3
|
+
export declare class FloatingCarWithOsmPathExtendedDataModel extends SequelizeModel {
|
|
4
|
+
constructor();
|
|
5
|
+
GetAll: (options?: {
|
|
6
|
+
locationId?: string;
|
|
7
|
+
minutesBefore?: number;
|
|
8
|
+
limit?: number;
|
|
9
|
+
offset?: number;
|
|
10
|
+
}) => Promise<IFloatingCarWithOsmPathDataModel[]>;
|
|
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.FloatingCarWithOsmPathExtendedDataModel = 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 FloatingCarWithOsmPathExtendedDataModel extends models_1.SequelizeModel {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(index_1.FCD.fcd_info.name, "v_traffic_params_last_hour_osm_path", index_1.FCD.fcd_info.outputSequelizeAttributesWithOsmPath, {
|
|
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.FloatingCarWithOsmPathExtendedDataModel = FloatingCarWithOsmPathExtendedDataModel;
|
|
61
|
+
//# sourceMappingURL=FloatingCarWithOsmPathExtendedDataModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingCarWithOsmPathExtendedDataModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/FloatingCarWithOsmPathExtendedDataModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0DAAiC;AAEjC,qEAA0E;AAC1E,6EAAwE;AACxE,oFAA4D;AAE5D,MAAa,uCAAwC,SAAQ,uBAAc;IACvE;QACI,KAAK,CAAC,WAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,qCAAqC,EAAE,WAAG,CAAC,QAAQ,CAAC,oCAAoC,EAAE;YAC/G,MAAM,EAAE,WAAG,CAAC,QAAQ;SACvB,CAAC,CAAC;QAGA,WAAM,GAAG,CACZ,UAKI,EAAE,EACqC,EAAE;YAC7C,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,0FAkDC"}
|
|
@@ -16,4 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./FloatingCarDataModel"), exports);
|
|
18
18
|
__exportStar(require("./FloatingCarExtendedDataModel"), exports);
|
|
19
|
+
__exportStar(require("./FloatingCarWithOsmPathDataModel"), exports);
|
|
20
|
+
__exportStar(require("./FloatingCarWithOsmPathExtendedDataModel"), exports);
|
|
19
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,iEAA+C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,iEAA+C;AAC/C,oEAAkD;AAClD,4EAA0D"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { IFloatingCarWithOsmPathDataModel, IOutputApiFloatingCarDataElaboratedData } from "../../schema-definitions/interfaces/FloatingCarDataInterface";
|
|
2
|
+
import { IOutputApiFloatingCarData } from "./interfaces/outputApiFloatingCarData";
|
|
3
3
|
export declare class OutputFloatingCarDataTransformation {
|
|
4
4
|
name: string;
|
|
5
|
-
|
|
6
|
-
constructor(
|
|
7
|
-
transform: (data:
|
|
5
|
+
private latestPublicationTime;
|
|
6
|
+
constructor();
|
|
7
|
+
transform: (data: IFloatingCarWithOsmPathDataModel[], isRequestedPathOsm: boolean) => IOutputApiFloatingCarData;
|
|
8
|
+
transformElement: (item: IFloatingCarWithOsmPathDataModel, isRequestedPathOsm: boolean) => IOutputApiFloatingCarDataElaboratedData;
|
|
8
9
|
}
|
|
@@ -1,63 +1,21 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.OutputFloatingCarDataTransformation = void 0;
|
|
13
4
|
const _sch_1 = require("../../schema-definitions");
|
|
14
|
-
const getLocationPointsFromTsString_1 = require("./getLocationPointsFromTsString");
|
|
15
5
|
const helpers_1 = require("@golemio/core/dist/helpers");
|
|
16
6
|
class OutputFloatingCarDataTransformation {
|
|
17
|
-
constructor(
|
|
18
|
-
this.transform = (data, isRequestedPathOsm) =>
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
constructor() {
|
|
8
|
+
this.transform = (data, isRequestedPathOsm) => {
|
|
9
|
+
let elaboratedData = [];
|
|
10
|
+
this.latestPublicationTime = new Date(data[0].measurement_or_calculation_time);
|
|
21
11
|
for (const item of data) {
|
|
22
|
-
|
|
23
|
-
const itemResultObject = {
|
|
24
|
-
measurementOrCalculationTime: (0, helpers_1.dateTime)(itemMeasurementTime).setTimeZone("Europe/Prague").toISOString(),
|
|
25
|
-
sourceIdentification: item.source_identification,
|
|
26
|
-
supplierCalculatedDataQuality: item.data_quality.toString(),
|
|
27
|
-
numberOfInputValuesUsed: item.input_values.toString(),
|
|
28
|
-
predefinedLocationId: item.predefined_location,
|
|
29
|
-
trafficLevel: item.traffic_level,
|
|
30
|
-
averageVehicleSpeed: item.average_vehicle_speed.toString(),
|
|
31
|
-
travelTime: item.travel_time.toString(),
|
|
32
|
-
freeFlowTravelTime: item.free_flow_travel_time.toString(),
|
|
33
|
-
freeFlowSpeed: item.free_flow_speed.toString(),
|
|
34
|
-
};
|
|
35
|
-
if (item.queue_exists) {
|
|
36
|
-
itemResultObject.queueExists = item.queue_exists.toString();
|
|
37
|
-
}
|
|
38
|
-
if (item.queue_length) {
|
|
39
|
-
itemResultObject.queueLength = item.queue_length.toString();
|
|
40
|
-
}
|
|
41
|
-
if (item.from_point) {
|
|
42
|
-
itemResultObject.fromPoint = item.from_point.toString();
|
|
43
|
-
}
|
|
44
|
-
if (item.to_point) {
|
|
45
|
-
itemResultObject.toPoint = item.to_point.toString();
|
|
46
|
-
}
|
|
47
|
-
if (isRequestedPathOsm) {
|
|
48
|
-
const osmPath = yield this.rsdTmcOsmMappingRepository.GetOne((0, getLocationPointsFromTsString_1.getLocationPointsFromTsString)(item.predefined_location));
|
|
49
|
-
itemResultObject.osmPath = osmPath !== null && osmPath !== void 0 ? osmPath : null;
|
|
50
|
-
}
|
|
51
|
-
elaboratedData.push(itemResultObject);
|
|
52
|
-
if (itemMeasurementTime > latestPublicationTime) {
|
|
53
|
-
latestPublicationTime = itemMeasurementTime;
|
|
54
|
-
}
|
|
12
|
+
elaboratedData.push(this.transformElement(item, isRequestedPathOsm));
|
|
55
13
|
}
|
|
56
14
|
return {
|
|
57
15
|
modelBaseVersion: "3",
|
|
58
16
|
payloadPublicationLight: {
|
|
59
17
|
lang: "cz",
|
|
60
|
-
publicationTime: (0, helpers_1.dateTime)(latestPublicationTime).setTimeZone("Europe/Prague").toISOString(),
|
|
18
|
+
publicationTime: (0, helpers_1.dateTime)(this.latestPublicationTime).setTimeZone("Europe/Prague").toISOString(),
|
|
61
19
|
publicationCreator: {
|
|
62
20
|
country: "cz",
|
|
63
21
|
nationalIdentifier: "ŘSD",
|
|
@@ -65,9 +23,43 @@ class OutputFloatingCarDataTransformation {
|
|
|
65
23
|
elaboratedData,
|
|
66
24
|
},
|
|
67
25
|
};
|
|
68
|
-
}
|
|
26
|
+
};
|
|
27
|
+
this.transformElement = (item, isRequestedPathOsm) => {
|
|
28
|
+
const itemMeasurementTime = new Date(item.measurement_or_calculation_time);
|
|
29
|
+
const itemResultObject = {
|
|
30
|
+
measurementOrCalculationTime: (0, helpers_1.dateTime)(itemMeasurementTime).setTimeZone("Europe/Prague").toISOString(),
|
|
31
|
+
sourceIdentification: item.source_identification,
|
|
32
|
+
supplierCalculatedDataQuality: item.data_quality.toString(),
|
|
33
|
+
numberOfInputValuesUsed: item.input_values.toString(),
|
|
34
|
+
predefinedLocationId: item.predefined_location,
|
|
35
|
+
trafficLevel: item.traffic_level,
|
|
36
|
+
averageVehicleSpeed: item.average_vehicle_speed.toString(),
|
|
37
|
+
travelTime: item.travel_time.toString(),
|
|
38
|
+
freeFlowTravelTime: item.free_flow_travel_time.toString(),
|
|
39
|
+
freeFlowSpeed: item.free_flow_speed.toString(),
|
|
40
|
+
};
|
|
41
|
+
if (item.queue_exists) {
|
|
42
|
+
itemResultObject.queueExists = item.queue_exists.toString();
|
|
43
|
+
}
|
|
44
|
+
if (item.queue_length) {
|
|
45
|
+
itemResultObject.queueLength = item.queue_length.toString();
|
|
46
|
+
}
|
|
47
|
+
if (item.from_point) {
|
|
48
|
+
itemResultObject.fromPoint = item.from_point.toString();
|
|
49
|
+
}
|
|
50
|
+
if (item.to_point) {
|
|
51
|
+
itemResultObject.toPoint = item.to_point.toString();
|
|
52
|
+
}
|
|
53
|
+
if (isRequestedPathOsm) {
|
|
54
|
+
itemResultObject.osmPath = item.osm_path ? JSON.parse(item.osm_path) : null;
|
|
55
|
+
if (itemMeasurementTime > this.latestPublicationTime) {
|
|
56
|
+
this.latestPublicationTime = itemMeasurementTime;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return itemResultObject;
|
|
60
|
+
};
|
|
69
61
|
this.name = _sch_1.FCD.fcd_info.name;
|
|
70
|
-
this.
|
|
62
|
+
this.latestPublicationTime = new Date();
|
|
71
63
|
}
|
|
72
64
|
}
|
|
73
65
|
exports.OutputFloatingCarDataTransformation = OutputFloatingCarDataTransformation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutputFloatingCarDataTransformation.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/OutputFloatingCarDataTransformation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OutputFloatingCarDataTransformation.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/OutputFloatingCarDataTransformation.ts"],"names":[],"mappings":";;;AAAA,mDAA2B;AAK3B,wDAAsD;AAGtD,MAAa,mCAAmC;IAI5C;QAKO,cAAS,GAAG,CAAC,IAAwC,EAAE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FloatingCarDataInterface";
|
|
2
|
+
export interface IOutputApiFloatingCarData {
|
|
3
|
+
modelBaseVersion: string;
|
|
4
|
+
payloadPublicationLight: {
|
|
5
|
+
lang: string;
|
|
6
|
+
publicationTime: string;
|
|
7
|
+
publicationCreator: {
|
|
8
|
+
country: string;
|
|
9
|
+
nationalIdentifier: string;
|
|
10
|
+
};
|
|
11
|
+
elaboratedData: IOutputApiFloatingCarDataElaboratedData[];
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputApiFloatingCarData.js","sourceRoot":"","sources":["../../../../src/output-gateway/transformations/interfaces/outputApiFloatingCarData.ts"],"names":[],"mappings":""}
|
|
@@ -11,6 +11,7 @@ const forExport = {
|
|
|
11
11
|
datasourceSchema: fcd_datasource_schema_1.datasourceFloatingCarDataSchema,
|
|
12
12
|
outputSchema: fcd_output_schema_1.outputFloatingCarDataSchema,
|
|
13
13
|
outputSequelizeAttributes: fcd_output_schema_1.outputFloatingCarDataSDMA,
|
|
14
|
+
outputSequelizeAttributesWithOsmPath: fcd_output_schema_1.outputFloatingCarDataSDMAWithOsmPath,
|
|
14
15
|
pgTableName: "fcd_traff_params_part",
|
|
15
16
|
},
|
|
16
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema-definitions/index.ts"],"names":[],"mappings":";;;AAAA,2EAAqF;AACrF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema-definitions/index.ts"],"names":[],"mappings":";;;AAAA,2EAAqF;AACrF,mEAIwC;AAExC,MAAM,SAAS,GAAQ;IACnB,IAAI,EAAE,KAAK;IACX,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE;QACN,IAAI,EAAE,iBAAiB;QACvB,gBAAgB,EAAE,uDAA+B;QACjD,YAAY,EAAE,+CAA2B;QACzC,yBAAyB,EAAE,6CAAyB;QACpD,oCAAoC,EAAE,wDAAoC;QAC1E,WAAW,EAAE,uBAAuB;KACvC;CACJ,CAAC;AAEoB,wBAAG"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface IFloatingCarDataModel {
|
|
2
|
+
publication_time: string;
|
|
3
|
+
source_identification: string;
|
|
4
|
+
measurement_or_calculation_time: string;
|
|
5
|
+
predefined_location: string;
|
|
6
|
+
version_of_predefined_location: number;
|
|
7
|
+
traffic_level: string;
|
|
8
|
+
queue_exists?: boolean;
|
|
9
|
+
queue_length?: number;
|
|
10
|
+
from_point?: number;
|
|
11
|
+
to_point?: number;
|
|
12
|
+
data_quality: number;
|
|
13
|
+
input_values: number;
|
|
14
|
+
average_vehicle_speed: number;
|
|
15
|
+
travel_time: number;
|
|
16
|
+
free_flow_travel_time: number;
|
|
17
|
+
free_flow_speed: number;
|
|
18
|
+
}
|
|
19
|
+
export interface IFloatingCarWithOsmPathDataModel extends IFloatingCarDataModel {
|
|
20
|
+
osm_path?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface IOutputApiFloatingCarDataElaboratedData {
|
|
23
|
+
measurementOrCalculationTime: string;
|
|
24
|
+
sourceIdentification: string;
|
|
25
|
+
supplierCalculatedDataQuality: string;
|
|
26
|
+
numberOfInputValuesUsed: string;
|
|
27
|
+
predefinedLocationId: string;
|
|
28
|
+
trafficLevel: string;
|
|
29
|
+
averageVehicleSpeed: string;
|
|
30
|
+
travelTime: string;
|
|
31
|
+
freeFlowTravelTime: string;
|
|
32
|
+
freeFlowSpeed: string;
|
|
33
|
+
queueExists?: string;
|
|
34
|
+
queueLength?: string;
|
|
35
|
+
fromPoint?: string;
|
|
36
|
+
toPoint?: string;
|
|
37
|
+
osmPath?: number[] | null;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingCarDataInterface.js","sourceRoot":"","sources":["../../../src/schema-definitions/interfaces/FloatingCarDataInterface.ts"],"names":[],"mappings":""}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.outputFloatingCarDataSDMA = exports.outputFloatingCarDataSchema = void 0;
|
|
6
|
+
exports.outputFloatingCarDataSDMAWithOsmPath = exports.outputFloatingCarDataSDMA = exports.outputFloatingCarDataSchema = void 0;
|
|
7
7
|
const sequelize_1 = __importDefault(require("@golemio/core/dist/shared/sequelize"));
|
|
8
8
|
exports.outputFloatingCarDataSchema = {
|
|
9
9
|
type: "array",
|
|
@@ -71,4 +71,5 @@ exports.outputFloatingCarDataSDMA = {
|
|
|
71
71
|
updated_at: { type: sequelize_1.default.DATE },
|
|
72
72
|
updated_by: { type: sequelize_1.default.STRING(150) },
|
|
73
73
|
};
|
|
74
|
+
exports.outputFloatingCarDataSDMAWithOsmPath = Object.assign(Object.assign({}, exports.outputFloatingCarDataSDMA), { osm_path: { type: sequelize_1.default.STRING } });
|
|
74
75
|
//# sourceMappingURL=fcd_output_schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fcd_output_schema.js","sourceRoot":"","sources":["../../../src/schema-definitions/schemas/fcd_output_schema.ts"],"names":[],"mappings":";;;;;;AAAA,oFAA4D;AAE/C,QAAA,2BAA2B,GAAG;IACvC,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE;YACN,kBAAkB;YAClB,uBAAuB;YACvB,iCAAiC;YACjC,qBAAqB;YACrB,gCAAgC;YAChC,eAAe;YACf,cAAc;YACd,cAAc;YACd,uBAAuB;YACvB,aAAa;YACb,uBAAuB;YACvB,iBAAiB;SACpB;QACD,oBAAoB,EAAE,KAAK;QAC3B,UAAU,EAAE;YACR,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACpC,qBAAqB,EAAE,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C,IAAI,EAAE;IACpC,UAAU,EAAE,EAAE,IAAI,EAAE,mBAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;IAC3C,eAAe,EAAE,EAAE,IAAI,EAAE,mBAAS,CAAC,MAAM,EAAE;IAC3C,UAAU,EAAE,EAAE,IAAI,EAAE,mBAAS,CAAC,IAAI,EAAE;IACpC,UAAU,EAAE,EAAE,IAAI,EAAE,mBAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;CAC9C,CAAC;AAEW,QAAA,oCAAoC,mCAC1C,iCAAyB,KAC5B,QAAQ,EAAE,EAAE,IAAI,EAAE,mBAAS,CAAC,MAAM,EAAE,IACtC"}
|
|
@@ -99,4 +99,5 @@ uklada data do tabulky `fcd_traff_params_regions`
|
|
|
99
99
|
|
|
100
100
|
- zdrojové tabulky
|
|
101
101
|
- je pouzit view `v_traffic_params_all` kde jste spojene tabulky `fcd_traff_params_regions` a `fcd_traff_params_part`
|
|
102
|
+
- pri zadosti o osmPath je pouzit view `v_traffic_params_all_with_osm_path`/`v_traffic_params_last_hour_osm_path` kde je pripojena tabulka `traffic.rsd_tmc_osm_mapping` pro ziskani `osm_path`
|
|
102
103
|
- zobrazi data viz [openapi](./openapi-output.yaml)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/fcd",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "Golemio Floating Car Data Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@commitlint/cli": "^11.0.0",
|
|
39
39
|
"@commitlint/config-conventional": "^11.0.0",
|
|
40
40
|
"@golemio/cli": "1.5.0",
|
|
41
|
-
"@golemio/core": "1.9.
|
|
41
|
+
"@golemio/core": "1.9.18",
|
|
42
42
|
"@golemio/db-common": "1.1.3",
|
|
43
43
|
"@golemio/eslint-config": "1.1.1",
|
|
44
44
|
"@golemio/traffic-common": "1.0.6",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLocationPointsFromTsString = void 0;
|
|
4
|
-
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
5
|
-
function getLocationPointsFromTsString(location) {
|
|
6
|
-
const regex = /((?<=TS)(.*?)(?=T))|((?<=\dT)(.*?)(?=$))/g;
|
|
7
|
-
const pointsArr = location.match(regex);
|
|
8
|
-
if ((pointsArr === null || pointsArr === void 0 ? void 0 : pointsArr.length) == 2 && pointsArr[0] && pointsArr[1]) {
|
|
9
|
-
return {
|
|
10
|
-
ltStart: Number(pointsArr[0]),
|
|
11
|
-
ltEnd: Number(pointsArr[1]),
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
throw new golemio_errors_1.GeneralError("Unable to parse RsdTmcOsmMappingModelOptions from the location", "FCDRouter", location, 500);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.getLocationPointsFromTsString = getLocationPointsFromTsString;
|
|
19
|
-
//# sourceMappingURL=getLocationPointsFromTsString.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getLocationPointsFromTsString.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/getLocationPointsFromTsString.ts"],"names":[],"mappings":";;;AAAA,6EAAwE;AAGxE,SAAgB,6BAA6B,CAAC,QAAgB;IAC1D,MAAM,KAAK,GAAG,2CAA2C,CAAC;IAC1D,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,KAAI,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE;QACxD,OAAO;YACH,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YAC7B,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;SAC9B,CAAC;KACL;SAAM;QACH,MAAM,IAAI,6BAAY,CAAC,gEAAgE,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;KACxH;AACL,CAAC;AAXD,sEAWC"}
|