@golemio/fcd 1.0.6 → 1.0.7-dev.547561943
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/README.md +44 -3
- package/db/example/.config.json +1 -1
- package/db/example/rsd_tmc_osm_mapping.sql +13 -0
- package/db/migrations/postgresql/.config.json +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/input-gateway/index.js +5 -1
- package/dist/input-gateway/index.js.map +1 -1
- package/dist/integration-engine/index.js +5 -1
- package/dist/integration-engine/index.js.map +1 -1
- package/dist/output-gateway/index.js +5 -1
- package/dist/output-gateway/index.js.map +1 -1
- package/dist/output-gateway/models/RsdTmcOsmMappingModel.d.ts +7 -6
- package/dist/output-gateway/models/RsdTmcOsmMappingModel.js +6 -7
- package/dist/output-gateway/models/RsdTmcOsmMappingModel.js.map +1 -1
- package/dist/output-gateway/models/index.js +5 -1
- package/dist/output-gateway/models/index.js.map +1 -1
- package/dist/output-gateway/transformations/OutputFloatingCarDataTransformation.d.ts +0 -1
- package/dist/output-gateway/transformations/OutputFloatingCarDataTransformation.js +2 -15
- package/dist/output-gateway/transformations/OutputFloatingCarDataTransformation.js.map +1 -1
- package/dist/output-gateway/transformations/getLocationPointsFromTsString.d.ts +4 -0
- package/dist/output-gateway/transformations/getLocationPointsFromTsString.js +19 -0
- package/dist/output-gateway/transformations/getLocationPointsFromTsString.js.map +1 -0
- package/package.json +81 -81
- package/db/migrations/postgresql/20210922124116-intermodal20210922.js +0 -53
- package/db/migrations/postgresql/sqls/20210922124116-intermodal20210922-down.sql +0 -1
- package/db/migrations/postgresql/sqls/20210922124116-intermodal20210922-up.sql +0 -5
package/README.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<p>
|
|
3
|
+
<a href="https://operatorict.cz">
|
|
4
|
+
<img src="https://gitlab.com/operator-ict/golemio/code/modules/core/-/raw/development/.assets/oict_logo.png" alt="oict" width="100px" height="100px" />
|
|
5
|
+
</a>
|
|
6
|
+
<a href="https://golemio.cz">
|
|
7
|
+
<img src="https://gitlab.com/operator-ict/golemio/code/modules/core/-/raw/development/.assets/golemio_logo.png" alt="golemio" width="100px" height="100px" />
|
|
8
|
+
</a>
|
|
9
|
+
</p>
|
|
2
10
|
|
|
3
|
-
|
|
11
|
+
<h1>@golemio/fcd</h1>
|
|
4
12
|
|
|
5
|
-
|
|
13
|
+
<p>
|
|
14
|
+
<a href="https://gitlab.com/operator-ict/golemio/code/modules/fcd/commits/master">
|
|
15
|
+
<img src="https://gitlab.com/operator-ict/golemio/code/modules/fcd/badges/master/pipeline.svg" alt="pipeline">
|
|
16
|
+
</a>
|
|
17
|
+
<a href="https://gitlab.com/operator-ict/golemio/code/modules/fcd/commits/master">
|
|
18
|
+
<img src="https://gitlab.com/operator-ict/golemio/code/modules/fcd/badges/master/coverage.svg" alt="coverage">
|
|
19
|
+
</a>
|
|
20
|
+
<a href="./LICENSE">
|
|
21
|
+
<img src="https://img.shields.io/npm/l/@golemio/fcd" alt="license">
|
|
22
|
+
</a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<p>
|
|
26
|
+
<a href="#installation">Installation</a> · <a href="./docs">Documentation</a> · <a href="https://operator-ict.gitlab.io/golemio/code/modules/fcd">TypeDoc</a>
|
|
27
|
+
</p>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
This module is intended for use with Golemio services. Refer [here](https://gitlab.com/operator-ict/golemio/code/modules/core/-/blob/development/README.md) for further information on usage, local development and more.
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
The APIs may be unstable. Therefore, we recommend to install this module as an exact version.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Latest version
|
|
38
|
+
yarn add --exact @golemio/fcd@latest
|
|
39
|
+
|
|
40
|
+
# Development version
|
|
41
|
+
yarn add --exact @golemio/fcd@dev
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
<!-- ## Description -->
|
|
45
|
+
|
|
46
|
+
<!-- Insert module-specific info here -->
|
package/db/example/.config.json
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
DROP TABLE IF EXISTS public.rsd_tmc_osm_mapping;
|
|
2
|
+
|
|
3
|
+
CREATE TABLE public.rsd_tmc_osm_mapping (
|
|
4
|
+
lt_start int8 NULL,
|
|
5
|
+
lt_end int8 NULL,
|
|
6
|
+
osm_path text NULL
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
INSERT INTO public.rsd_tmc_osm_mapping ("lt_start", "lt_end", "osm_path") VALUES
|
|
10
|
+
(10123, 10125, '[1017997529, 977504768, 1994461410, 5216395185, 977504817, 340196025, 1837022967, 5919113281, 7881860424, 977504742, 7881860432, 977504743, 7881860435, 1826208722, 1837041100]');
|
|
11
|
+
|
|
12
|
+
INSERT INTO public.rsd_tmc_osm_mapping ("lt_start", "lt_end", "osm_path") VALUES
|
|
13
|
+
(19629, 10127, '[29381030, 29403193, 338604070, 29381028, 338604072, 29403192, 2681371748, 1138616634, 2681371747, 308815174, 1138624651, 29403191]');
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAkB;AAClB,sEAA0C;AAC1C,gFAAgD;AAChD,gFAA+C"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/input-gateway/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/input-gateway/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iBAAiB;AACjB,0DAAwC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/integration-engine/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/integration-engine/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iBAAiB;AACjB,8CAA4B;AAC5B,qDAAmC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/output-gateway/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/output-gateway/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,2CAAyB"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { SequelizeModel } from "@golemio/core/dist/output-gateway/models";
|
|
2
|
+
export interface LocationConfigOptions {
|
|
3
|
+
ltStart: string;
|
|
4
|
+
ltEnd: string;
|
|
5
|
+
}
|
|
2
6
|
export declare class RsdTmcOsmMappingModel extends SequelizeModel {
|
|
3
7
|
constructor();
|
|
4
8
|
/**
|
|
5
9
|
* @param {object} [options] Options object with params
|
|
6
|
-
* @param {
|
|
7
|
-
* @param {
|
|
10
|
+
* @param {string} [options.ltStart] Options object with params
|
|
11
|
+
* @param {string} [options.ltEnd] Options object with params
|
|
8
12
|
* @returns Array of the retrieved records
|
|
9
13
|
*/
|
|
10
|
-
GetOne: (options:
|
|
11
|
-
ltStart: string;
|
|
12
|
-
ltEnd: string;
|
|
13
|
-
}) => Promise<any>;
|
|
14
|
+
GetOne: (options: LocationConfigOptions) => Promise<any>;
|
|
14
15
|
GetAll: () => Promise<object | null>;
|
|
15
16
|
}
|
|
@@ -20,17 +20,16 @@ const _sch_1 = require("../../schema-definitions");
|
|
|
20
20
|
class RsdTmcOsmMappingModel extends models_1.SequelizeModel {
|
|
21
21
|
constructor() {
|
|
22
22
|
super(_sch_1.FCD.rsd_tmc_osm_mapping.name + "Model", _sch_1.FCD.rsd_tmc_osm_mapping.pgTableName, _sch_1.FCD.rsd_tmc_osm_mapping.outputSequelizeAttributes, {
|
|
23
|
-
schema:
|
|
23
|
+
schema: "public",
|
|
24
24
|
});
|
|
25
25
|
/**
|
|
26
26
|
* @param {object} [options] Options object with params
|
|
27
|
-
* @param {
|
|
28
|
-
* @param {
|
|
27
|
+
* @param {string} [options.ltStart] Options object with params
|
|
28
|
+
* @param {string} [options.ltEnd] Options object with params
|
|
29
29
|
* @returns Array of the retrieved records
|
|
30
30
|
*/
|
|
31
31
|
this.GetOne = (options) => __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
|
|
33
|
-
if (!ltStart || !ltEnd)
|
|
32
|
+
if (!options.ltStart || !options.ltEnd)
|
|
34
33
|
return null;
|
|
35
34
|
try {
|
|
36
35
|
const Op = sequelize_1.default.Op;
|
|
@@ -38,10 +37,10 @@ class RsdTmcOsmMappingModel extends models_1.SequelizeModel {
|
|
|
38
37
|
[Op.and]: [{}],
|
|
39
38
|
};
|
|
40
39
|
where[Op.and].push({
|
|
41
|
-
lt_start:
|
|
40
|
+
lt_start: Number(options.ltStart),
|
|
42
41
|
});
|
|
43
42
|
where[Op.and].push({
|
|
44
|
-
lt_end:
|
|
43
|
+
lt_end: Number(options.ltEnd),
|
|
45
44
|
});
|
|
46
45
|
const rsdTmcOsmMappingFromDB = yield this.sequelizeModel.findOne({
|
|
47
46
|
raw: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RsdTmcOsmMappingModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/RsdTmcOsmMappingModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oFAA4D;AAC5D,6EAAuE;AACvE,qEAA0E;AAC1E,mDAA2B;
|
|
1
|
+
{"version":3,"file":"RsdTmcOsmMappingModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/RsdTmcOsmMappingModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oFAA4D;AAC5D,6EAAuE;AACvE,qEAA0E;AAC1E,mDAA2B;AAO3B,MAAa,qBAAsB,SAAQ,uBAAc;IACrD;QACI,KAAK,CACD,UAAG,CAAC,mBAAmB,CAAC,IAAI,GAAG,OAAO,EACtC,UAAG,CAAC,mBAAmB,CAAC,WAAW,EACnC,UAAG,CAAC,mBAAmB,CAAC,yBAAyB,EACjD;YACI,MAAM,EAAE,QAAQ;SACnB,CACJ,CAAC;QAGN;;;;;WAKG;QAEI,WAAM,GAAG,CAAO,OAA8B,EAAgB,EAAE;YACnE,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK;gBAAE,OAAO,IAAI,CAAC;YAEpD,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,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;oBACf,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;iBACpC,CAAC,CAAC;gBAEH,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;oBACf,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;iBAChC,CAAC,CAAC;gBAEH,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;oBAC7D,GAAG,EAAE,IAAI;oBACT,KAAK;iBACR,CAAC,CAAC;gBAEH,IAAI;oBACA,OAAO,IAAI,CAAC,KAAK,CAAC,sBAAsB,aAAtB,sBAAsB,uBAAtB,sBAAsB,CAAE,QAAQ,CAAC,CAAC;iBACvD;gBAAC,OAAO,CAAC,EAAE;oBACR,OAAO,IAAI,CAAC;iBACf;aACJ;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,4BAAW,CAAC,wBAAwB,GAAG,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;aACzG;QACL,CAAC,CAAA,CAAC;QAEK,WAAM,GAAG,GAAiC,EAAE;YAC/C,MAAM,IAAI,4BAAW,CAAC,iBAAiB,EAAE,IAAI,EAAE,uBAAuB,CAAC,CAAC;QAC5E,CAAC,CAAA,CAAC;IA3CF,CAAC;CA4CJ;AAtDD,sDAsDC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/models/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,0DAAwC"}
|
|
@@ -5,5 +5,4 @@ export declare class OutputFloatingCarDataTransformation {
|
|
|
5
5
|
protected rsdTmcOsmMappingModel: RsdTmcOsmMappingModel;
|
|
6
6
|
constructor();
|
|
7
7
|
transform: (data: IFloatingCarDataModel[], isRequestedPathOsm: Boolean) => Promise<IOutputApiFloatingCarData>;
|
|
8
|
-
private getRsdTmcOsmMappingModelOptions;
|
|
9
8
|
}
|
|
@@ -14,9 +14,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.OutputFloatingCarDataTransformation = void 0;
|
|
16
16
|
const _sch_1 = require("../../schema-definitions");
|
|
17
|
-
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
18
17
|
const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
|
|
19
18
|
const models_1 = require("../models");
|
|
19
|
+
const getLocationPointsFromTsString_1 = require("./getLocationPointsFromTsString");
|
|
20
20
|
class OutputFloatingCarDataTransformation {
|
|
21
21
|
constructor() {
|
|
22
22
|
this.transform = (data, isRequestedPathOsm) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -48,7 +48,7 @@ class OutputFloatingCarDataTransformation {
|
|
|
48
48
|
itemResultObject.toPoint = item.to_point.toString();
|
|
49
49
|
}
|
|
50
50
|
if (isRequestedPathOsm) {
|
|
51
|
-
itemResultObject.osmPath = yield this.rsdTmcOsmMappingModel.GetOne(
|
|
51
|
+
itemResultObject.osmPath = yield this.rsdTmcOsmMappingModel.GetOne((0, getLocationPointsFromTsString_1.getLocationPointsFromTsString)(item.predefined_location));
|
|
52
52
|
}
|
|
53
53
|
elaboratedData.push(itemResultObject);
|
|
54
54
|
if (item.measurement_or_calculation_time > latestPublicationTime) {
|
|
@@ -73,19 +73,6 @@ class OutputFloatingCarDataTransformation {
|
|
|
73
73
|
this.rsdTmcOsmMappingModel = new models_1.RsdTmcOsmMappingModel();
|
|
74
74
|
this.rsdTmcOsmMappingModel.sequelizeModel.removeAttribute("id");
|
|
75
75
|
}
|
|
76
|
-
getRsdTmcOsmMappingModelOptions(location) {
|
|
77
|
-
const regex = /((?<=TS)(.*?)(?=T))|((?<=\dT)(.*?)(?=$))/g;
|
|
78
|
-
const pointsArr = location.match(regex);
|
|
79
|
-
if ((pointsArr === null || pointsArr === void 0 ? void 0 : pointsArr.length) == 2 && pointsArr[0] && pointsArr[1]) {
|
|
80
|
-
return {
|
|
81
|
-
ltStart: pointsArr[1],
|
|
82
|
-
ltEnd: pointsArr[0],
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
throw new golemio_errors_1.CustomError("Unable to parse RsdTmcOsmMappingModelOptions from the location", true, "FCDRouter", 500);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
76
|
}
|
|
90
77
|
exports.OutputFloatingCarDataTransformation = OutputFloatingCarDataTransformation;
|
|
91
78
|
//# sourceMappingURL=OutputFloatingCarDataTransformation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutputFloatingCarDataTransformation.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/OutputFloatingCarDataTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAA2B;AAM3B,
|
|
1
|
+
{"version":3,"file":"OutputFloatingCarDataTransformation.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/OutputFloatingCarDataTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAA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ocationPointsFromTsString = 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: pointsArr[1],
|
|
11
|
+
ltEnd: pointsArr[0],
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
throw new golemio_errors_1.CustomError("Unable to parse RsdTmcOsmMappingModelOptions from the location", true, "FCDRouter", 500);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.getLocationPointsFromTsString = getLocationPointsFromTsString;
|
|
19
|
+
//# sourceMappingURL=getLocationPointsFromTsString.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLocationPointsFromTsString.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/getLocationPointsFromTsString.ts"],"names":[],"mappings":";;;AAAA,6EAAuE;AAEvE,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,SAAS,CAAC,CAAC,CAAC;YACrB,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;SACtB,CAAC;KACL;SAAM;QACH,MAAM,IAAI,4BAAW,CAAC,gEAAgE,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC;KACnH;AACL,CAAC;AAXD,sEAWC"}
|
package/package.json
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
2
|
+
"name": "@golemio/fcd",
|
|
3
|
+
"version": "1.0.7-dev.547561943",
|
|
4
|
+
"description": "Golemio Floating Car Data Module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "rimraf ./dist && ttsc -p ./tsconfig.build.json",
|
|
9
|
+
"build-minimal": "run-s 'build --sourceMap false --declaration false'",
|
|
10
|
+
"build-watch": "run-s 'build --watch --preserveWatchOutput'",
|
|
11
|
+
"pretest": "golemio mdb reset --postgres && golemio mdb up --postgres && golemio import-db-data --postgres",
|
|
12
|
+
"test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' mocha --exit --check-leaks --timeout 120000 -r ts-node/register -r dotenv/config 'test/**/*.test.ts'",
|
|
13
|
+
"apidocs-test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' ts-node -r dotenv/config test/api-docs/index.ts",
|
|
14
|
+
"test-debug": "run-s 'test --inspect-brk=9230'",
|
|
15
|
+
"code-coverage": "nyc run-s 'test -r source-map-support/register'",
|
|
16
|
+
"generate-docs": "typedoc --out docs/typedoc src",
|
|
17
|
+
"lint": "eslint \"{src,test}/**/*.ts\""
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"golemio",
|
|
21
|
+
"fcd"
|
|
22
|
+
],
|
|
23
|
+
"author": "Operator ICT, a.s.",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://gitlab.com/operator-ict/golemio/code/modules/fcd"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@commitlint/cli": "^11.0.0",
|
|
31
|
+
"@commitlint/config-conventional": "^11.0.0",
|
|
32
|
+
"@golemio/cli": "1.2.2",
|
|
33
|
+
"@golemio/core": "1.2.10-dev.544242823",
|
|
34
|
+
"@golemio/db-common": "1.0.1-dev.540050269",
|
|
35
|
+
"@golemio/eslint-config": "^1.0.2",
|
|
36
|
+
"@ovos-media/ts-transform-paths": "^1.7.18-1",
|
|
37
|
+
"@types/body-parser-xml": "^1.1.0",
|
|
38
|
+
"@types/chai": "4.2.3",
|
|
39
|
+
"@types/chai-as-promised": "7.1.2",
|
|
40
|
+
"@types/mocha": "^8.2.0",
|
|
41
|
+
"@types/node": "^16.11.35",
|
|
42
|
+
"@types/sinon": "^9.0.10",
|
|
43
|
+
"@types/supertest": "^2.0.10",
|
|
44
|
+
"body-parser": "^1.19.0",
|
|
45
|
+
"body-parser-xml": "^2.0.0",
|
|
46
|
+
"chai": "4.2.0",
|
|
47
|
+
"chai-as-promised": "7.1.1",
|
|
48
|
+
"cross-env": "^7.0.3",
|
|
49
|
+
"dotenv": "^8.2.0",
|
|
50
|
+
"eslint": "^7.17.0",
|
|
51
|
+
"husky": "^4.3.7",
|
|
52
|
+
"mocha": "^8.2.1",
|
|
53
|
+
"npm-run-all": "^4.1.5",
|
|
54
|
+
"nyc": "^15.1.0",
|
|
55
|
+
"prettier": "^2.2.1",
|
|
56
|
+
"pretty-quick": "^3.1.0",
|
|
57
|
+
"rimraf": "^3.0.2",
|
|
58
|
+
"sinon": "^9.2.3",
|
|
59
|
+
"source-map-support": "0.5.19",
|
|
60
|
+
"supertest": "^6.0.1",
|
|
61
|
+
"ts-node": "^10.7.0",
|
|
62
|
+
"ttypescript": "^1.5.13",
|
|
63
|
+
"typedoc": "^0.22.15",
|
|
64
|
+
"typescript": "4.6.4"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"@golemio/core": "^1.0.5"
|
|
68
|
+
},
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"@apideck/portman": "^1.14.2",
|
|
71
|
+
"ajv": "^8.2.0",
|
|
72
|
+
"xmldom": "github:xmldom/xmldom#0.7.0"
|
|
73
|
+
},
|
|
74
|
+
"resolutions": {
|
|
75
|
+
"@commitlint/cli/**/trim-newlines": "^3.0.1",
|
|
76
|
+
"hosted-git-info": "^3.0.8",
|
|
77
|
+
"xmldom": "github:xmldom/xmldom#0.7.0",
|
|
78
|
+
"mpath": "^0.8.4",
|
|
79
|
+
"minimist": "^1.2.6",
|
|
80
|
+
"follow-redirects": "1.14.7",
|
|
81
|
+
"xsd2jsonschema/urijs": "^1.19.10"
|
|
82
|
+
}
|
|
83
83
|
}
|
|
@@ -1,53 +0,0 @@
|
|
|
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', '20210922124116-intermodal20210922-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', '20210922124116-intermodal20210922-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
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
drop TABLE rsd_tmc_osm_mapping ;
|