@golemio/pid 6.3.1-dev.3047078710 → 6.4.0-rc.3053582815
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/TramMessageFilter.d.ts +0 -2
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/TramMessageFilter.js +0 -16
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/TramMessageFilter.js.map +1 -1
- package/package.json +2 -2
package/dist/integration-engine/vehicle-positions/workers/runs/helpers/TramMessageFilter.d.ts
CHANGED
|
@@ -14,12 +14,10 @@ export declare class TramMessageFilter implements ICommonMessageFilter {
|
|
|
14
14
|
* - run number is less than 80
|
|
15
15
|
* - OR registration number is in not-public vehicles whitelist (e.g., mazačka maintenance trams)
|
|
16
16
|
* - timestamp is in acceptable range
|
|
17
|
-
* - scheduled timestamp 'tjr' is not more than 120 minutes ahead of 'tm' (negative delay over 120 minutes)
|
|
18
17
|
*
|
|
19
18
|
* Sets isNotPublic flag on messages to avoid duplicate whitelist checks in processor
|
|
20
19
|
*/
|
|
21
20
|
yieldFilteredMessages(messages: ICommonRunWithMessageDto[], timestamp: number): AsyncGenerator<ICommonRunWithMessageDto>;
|
|
22
|
-
private isNegativeDelayExceeded;
|
|
23
21
|
private isRouteIdValid;
|
|
24
22
|
private isRunNumberValid;
|
|
25
23
|
}
|
|
@@ -20,7 +20,6 @@ const { GeneralError } = GolemioErrorsCore;
|
|
|
20
20
|
const TRAM_SERVICING_ROUTE_ID_MIN = 50;
|
|
21
21
|
const TRAM_SERVICING_ROUTE_ID_MAX = 89;
|
|
22
22
|
const TRAM_UNUSUAL_RUN_NUMBER_MIN = 80;
|
|
23
|
-
const MAX_NEGATIVE_DELAY_IN_MS = 120 * 60 * 1000;
|
|
24
23
|
let TramMessageFilter = class TramMessageFilter {
|
|
25
24
|
constructor(logger, timestampValidator, notPublicVehiclesRepository) {
|
|
26
25
|
this.logger = logger;
|
|
@@ -33,7 +32,6 @@ let TramMessageFilter = class TramMessageFilter {
|
|
|
33
32
|
* - run number is less than 80
|
|
34
33
|
* - OR registration number is in not-public vehicles whitelist (e.g., mazačka maintenance trams)
|
|
35
34
|
* - timestamp is in acceptable range
|
|
36
|
-
* - scheduled timestamp 'tjr' is not more than 120 minutes ahead of 'tm' (negative delay over 120 minutes)
|
|
37
35
|
*
|
|
38
36
|
* Sets isNotPublic flag on messages to avoid duplicate whitelist checks in processor
|
|
39
37
|
*/
|
|
@@ -50,13 +48,6 @@ let TramMessageFilter = class TramMessageFilter {
|
|
|
50
48
|
` is not valid for line ${message.run.line_short_name}, run ${message.run.run_number}`, this.constructor.name, undefined, undefined, "pid"));
|
|
51
49
|
continue;
|
|
52
50
|
}
|
|
53
|
-
if (this.isNegativeDelayExceeded(message)) {
|
|
54
|
-
this.logger.warn(`${this.constructor.name}: message timestamp 'tjr' of value` +
|
|
55
|
-
` '${message.run_message.actual_stop_timestamp_scheduled?.toISOString()}' is more than 120 minutes` +
|
|
56
|
-
` ahead of 'tm' of value '${message.run_message.actual_stop_timestamp_real.toISOString()}'` +
|
|
57
|
-
` (line ${line_short_name}, run ${run_number}, vehicle ${registration_number}), message is skipped.`);
|
|
58
|
-
continue;
|
|
59
|
-
}
|
|
60
51
|
// Check if this is a not-public vehicle
|
|
61
52
|
// - Whitelisted registration number (e.g., mazačka maintenance tram)
|
|
62
53
|
// - Whitelisted route name (e.g., ad-hoc routes like X1, X2, NAD)
|
|
@@ -76,13 +67,6 @@ let TramMessageFilter = class TramMessageFilter {
|
|
|
76
67
|
}
|
|
77
68
|
}
|
|
78
69
|
}
|
|
79
|
-
isNegativeDelayExceeded(message) {
|
|
80
|
-
const { actual_stop_timestamp_scheduled: scheduledTimestamp, actual_stop_timestamp_real: realTimestamp } = message.run_message;
|
|
81
|
-
if (!scheduledTimestamp) {
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
return scheduledTimestamp.getTime() - realTimestamp.getTime() > MAX_NEGATIVE_DELAY_IN_MS;
|
|
85
|
-
}
|
|
86
70
|
isRouteIdValid(routeId) {
|
|
87
71
|
const parsedRouteId = Number.parseInt(routeId);
|
|
88
72
|
return (!Number.isNaN(parsedRouteId) &&
|
package/dist/integration-engine/vehicle-positions/workers/runs/helpers/TramMessageFilter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TramMessageFilter.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/helpers/TramMessageFilter.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,mEAAmE,CAAC;AACrH,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAExE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAE3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,iBAAiB,MAAM,6CAA6C,CAAC;AAC5E,MAAM,EAAE,YAAY,EAAE,GAAG,iBAAiB,CAAC;AAE3C,MAAM,2BAA2B,GAAG,EAAE,CAAC;AACvC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AACvC,MAAM,2BAA2B,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"TramMessageFilter.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/helpers/TramMessageFilter.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,mEAAmE,CAAC;AACrH,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAExE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAE3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,kBAAkB,E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AS,GAAG,2BAA2B,CAAC;IACnD,CAAC;CACJ,CAAA;AA9EY,iBAAiB;IAD7B,UAAU,EAAE;IAGJ,WAAA,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;IACxB,WAAA,MAAM,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAA;IAC3C,WAAA,MAAM,CAAC,gBAAgB,CAAC,gCAAgC,CAAC,CAAA;6CADe,kBAAkB;QAEtD,gCAAgC;GALhE,iBAAiB,CA8E7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/pid",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0-rc.3053582815",
|
|
4
4
|
"description": "Golemio PID Module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"@golemio/core": "^4.0.1-dev.2 || ^4.0.1"
|
|
124
124
|
},
|
|
125
125
|
"dependencies": {
|
|
126
|
-
"@golemio/ovapi-gtfs-realtime-bindings": "1.4.1
|
|
126
|
+
"@golemio/ovapi-gtfs-realtime-bindings": "1.4.1",
|
|
127
127
|
"@turf/turf": "^6.5.0",
|
|
128
128
|
"cheap-ruler": "^3.0.2",
|
|
129
129
|
"csv-parser": "^3.0.0",
|