@golemio/pid 2.1.12-dev.501018868 → 2.1.13-dev.501881019
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.
|
@@ -17,6 +17,7 @@ const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/mom
|
|
|
17
17
|
const transformations_1 = require("@golemio/core/dist/integration-engine/transformations");
|
|
18
18
|
const vehicle_positions_1 = require("../../schema-definitions/vehicle-positions");
|
|
19
19
|
const helpers_1 = require("@golemio/core/dist/integration-engine/helpers");
|
|
20
|
+
const config_1 = require("@golemio/core/dist/integration-engine/config");
|
|
20
21
|
class VehiclePositionsRunsTransformation extends transformations_1.BaseTransformation {
|
|
21
22
|
constructor() {
|
|
22
23
|
super();
|
|
@@ -46,6 +47,15 @@ class VehiclePositionsRunsTransformation extends transformations_1.BaseTransform
|
|
|
46
47
|
const uniqueKey = `${route_id}` + `_${run_number}` + `_${attributes.evc}` + `_${element.timestamp}`;
|
|
47
48
|
if (attributes.takt === "" || attributes.tjr === "" || attributes.tm === "")
|
|
48
49
|
return Promise.reject();
|
|
50
|
+
// for TCP buses in this day is hot fix to lower TJR attribute by 1 hour
|
|
51
|
+
// due to time offset shift (CET to CEST)
|
|
52
|
+
const actualStopTimestampScheduled = moment_timezone_1.default
|
|
53
|
+
.utc(attributes.tjr)
|
|
54
|
+
.subtract(parseInt(route_id, 10) >= 100 &&
|
|
55
|
+
(0, moment_timezone_1.default)().isBetween((0, moment_timezone_1.default)("2022-03-27T00:03:00+02:00"), (0, moment_timezone_1.default)("2022-03-28T00:00:00+02:00"))
|
|
56
|
+
? config_1.config.vehiclePositions.tcpBusTjrNegativeOffset
|
|
57
|
+
: 0, "hours")
|
|
58
|
+
.valueOf();
|
|
49
59
|
return {
|
|
50
60
|
run: {
|
|
51
61
|
id: uniqueKey,
|
|
@@ -64,10 +74,7 @@ class VehiclePositionsRunsTransformation extends transformations_1.BaseTransform
|
|
|
64
74
|
lng: +attributes.lng,
|
|
65
75
|
actual_stop_asw_id: attributes.akt,
|
|
66
76
|
actual_stop_timestamp_real: moment_timezone_1.default.utc(attributes.takt).valueOf(),
|
|
67
|
-
actual_stop_timestamp_scheduled:
|
|
68
|
-
.utc(attributes.tjr)
|
|
69
|
-
.add(parseInt(route_id, 10) >= 100 && (0, moment_timezone_1.default)().isBefore((0, moment_timezone_1.default)("2021-11-01T00:00:00+01:00")) ? 1 : 0, "hours")
|
|
70
|
-
.valueOf(),
|
|
77
|
+
actual_stop_timestamp_scheduled: actualStopTimestampScheduled,
|
|
71
78
|
last_stop_asw_id: attributes.konc,
|
|
72
79
|
packet_number: attributes.pkt,
|
|
73
80
|
msg_timestamp: moment_timezone_1.default.utc(attributes.tm).tz("Europe/Prague").format(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VehiclePositionsRunsTransformation.js","sourceRoot":"","sources":["../../../src/integration-engine/vehicle-positions/VehiclePositionsRunsTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gGAA+D;AAC/D,2FAA4G;AAC5G,kFAA0D;AAC1D,2EAAoE;
|
|
1
|
+
{"version":3,"file":"VehiclePositionsRunsTransformation.js","sourceRoot":"","sources":["../../../src/integration-engine/vehicle-positions/VehiclePositionsRunsTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gGAA+D;AAC/D,2FAA4G;AAC5G,kFAA0D;AAC1D,2EAAoE;AAEpE,yEAAsE;AA4DtE,MAAa,kCAAmC,SAAQ,oCAAkB;IAGtE;QACI,KAAK,EAAE,CAAC;QAIZ;;WAEG;QACI,cAAS,GAAG,CAAO,EACtB,IAAI,EACJ,SAAS,GAIZ,EAAyC,EAAE;YACxC,MAAM,GAAG,GAAG,IAAA,yBAAM,EAAC,SAAS,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC;YAC3D,MAAM,GAAG,GAAiC,EAAE,CAAC;YAE7C,IAAI,CAAC,KAAK,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@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/pid",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.13-dev.501881019",
|
|
4
4
|
"description": "Golemio PID Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
"test-debug": "run-s 'test --inspect-brk=9230'",
|
|
14
14
|
"code-coverage": "nyc run-s 'test -r source-map-support/register'",
|
|
15
15
|
"generate-docs": "typedoc --out docs/typedoc src",
|
|
16
|
-
"
|
|
17
|
-
"lint": "eslint \"{src,test}/**/*.ts\""
|
|
16
|
+
"lint": "eslint '{src,test}/**/*.ts'"
|
|
18
17
|
},
|
|
19
18
|
"keywords": [
|
|
20
19
|
"golemio"
|
|
@@ -29,7 +28,7 @@
|
|
|
29
28
|
"@commitlint/cli": "^11.0.0",
|
|
30
29
|
"@commitlint/config-conventional": "^11.0.0",
|
|
31
30
|
"@golemio/cli": "1.2.1",
|
|
32
|
-
"@golemio/core": "1.2.
|
|
31
|
+
"@golemio/core": "1.2.4",
|
|
33
32
|
"@golemio/db-common": "1.0.0",
|
|
34
33
|
"@golemio/eslint-config": "^1.1.0",
|
|
35
34
|
"@types/chai": "4.2.3",
|