@golemio/pid 5.7.3-dev.2387345183 → 5.7.3-rc.2387358195
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/const.d.ts +1 -0
- package/dist/const.js +2 -1
- package/dist/const.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/datasources/StaticDataSourceFactory.d.ts +2 -3
- package/dist/integration-engine/ropid-gtfs/datasources/StaticDataSourceFactory.js +2 -4
- package/dist/integration-engine/ropid-gtfs/datasources/StaticDataSourceFactory.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js +0 -4
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.d.ts +0 -2
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js +0 -2
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/SaveStaticDataTask.d.ts +1 -6
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/SaveStaticDataTask.js +10 -39
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/SaveStaticDataTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/ioc/Di.js +0 -2
- package/dist/integration-engine/vehicle-positions/ioc/Di.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/ioc/VPContainerToken.d.ts +0 -1
- package/dist/integration-engine/vehicle-positions/ioc/VPContainerToken.js +0 -1
- package/dist/integration-engine/vehicle-positions/ioc/VPContainerToken.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/BusMessageFilter.d.ts +5 -11
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/BusMessageFilter.js +9 -36
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/BusMessageFilter.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/CommonMessageProcessor.d.ts +1 -4
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/CommonMessageProcessor.js +9 -26
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/CommonMessageProcessor.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/TramMessageFilter.d.ts +3 -7
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/TramMessageFilter.js +8 -26
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/TramMessageFilter.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/interfaces/ICommonMessageFilter.d.ts +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveBusRunsToDBTask.js +2 -3
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveBusRunsToDBTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveTramRunsToDBTask.js +3 -4
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveTramRunsToDBTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.d.ts +2 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.js +10 -3
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/TripsMapper.d.ts +1 -2
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/TripsMapper.js +3 -5
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/TripsMapper.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/interfaces/IUpdateRunsGtfsTripInput.d.ts +0 -11
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/schema/UpdateRunsGtfsTripIdSchema.d.ts +0 -3
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/schema/UpdateRunsGtfsTripIdSchema.js +0 -11
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/schema/UpdateRunsGtfsTripIdSchema.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateRunsGtfsTripIdTask.js +3 -4
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateRunsGtfsTripIdTask.js.map +1 -1
- package/dist/output-gateway/vehicle-positions/data-access/PositionRepository.d.ts +3 -10
- package/dist/output-gateway/vehicle-positions/data-access/PositionRepository.js +7 -30
- package/dist/output-gateway/vehicle-positions/data-access/PositionRepository.js.map +1 -1
- package/dist/output-gateway/vehicle-positions/data-access/TripRepository.d.ts +3 -7
- package/dist/output-gateway/vehicle-positions/data-access/TripRepository.js +7 -30
- package/dist/output-gateway/vehicle-positions/data-access/TripRepository.js.map +1 -1
- package/dist/output-gateway/vehicle-positions/data-access/VehicleDescriptorRepository.d.ts +3 -10
- package/dist/output-gateway/vehicle-positions/data-access/VehicleDescriptorRepository.js +7 -30
- package/dist/output-gateway/vehicle-positions/data-access/VehicleDescriptorRepository.js.map +1 -1
- package/dist/output-gateway/vehicle-positions/data-access/VehicleTypeRepository.d.ts +3 -10
- package/dist/output-gateway/vehicle-positions/data-access/VehicleTypeRepository.js +7 -30
- package/dist/output-gateway/vehicle-positions/data-access/VehicleTypeRepository.js.map +1 -1
- package/dist/output-gateway/vehicle-positions/data-access/index.js +18 -9
- package/dist/output-gateway/vehicle-positions/data-access/index.js.map +1 -1
- package/dist/output-gateway/vehicle-positions/data-access/interfaces/ITripWithPositionRepository.d.ts +2 -3
- package/dist/output-gateway/vehicle-positions/data-access/interfaces/IVPRepositoryInstances.d.ts +6 -6
- package/dist/output-gateway/vehicle-positions/data-access/views/ProcessedPositionRepository.d.ts +3 -7
- package/dist/output-gateway/vehicle-positions/data-access/views/ProcessedPositionRepository.js +7 -30
- package/dist/output-gateway/vehicle-positions/data-access/views/ProcessedPositionRepository.js.map +1 -1
- package/dist/output-gateway/vehicle-positions/data-access/views/TripWithLastPositionRepository.d.ts +7 -17
- package/dist/output-gateway/vehicle-positions/data-access/views/TripWithLastPositionRepository.js +42 -112
- package/dist/output-gateway/vehicle-positions/data-access/views/TripWithLastPositionRepository.js.map +1 -1
- package/dist/schema-definitions/datasources/static-data/index.d.ts +0 -1
- package/dist/schema-definitions/datasources/static-data/index.js +0 -1
- package/dist/schema-definitions/datasources/static-data/index.js.map +1 -1
- package/dist/schema-definitions/datasources/static-data/interfaces/index.d.ts +0 -1
- package/dist/schema-definitions/datasources/static-data/interfaces/index.js +0 -1
- package/dist/schema-definitions/datasources/static-data/interfaces/index.js.map +1 -1
- package/dist/schema-definitions/ropid-gtfs/redis/const.d.ts +0 -2
- package/dist/schema-definitions/ropid-gtfs/redis/const.js +1 -3
- package/dist/schema-definitions/ropid-gtfs/redis/const.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/models/interfaces/ICommonRunWithMessageDto.d.ts +0 -8
- package/docs/asyncapi.yaml +2 -13
- package/docs/cache/types/redis.md +2 -30
- package/docs/implementation_documentation.md +4 -101
- package/docs/jis/index.md +0 -17
- package/docs/processing/input_realtime_data/http_mpvnet.md +0 -21
- package/docs/processing/state_position_tracking/http_mpvnet.md +0 -1
- package/docs/processing/state_position_tracking/tcp_dpp_common.md +1 -2
- package/package.json +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/cache/NotPublicVehiclesRedisRepository.d.ts +0 -14
- package/dist/integration-engine/ropid-gtfs/data-access/cache/NotPublicVehiclesRedisRepository.js +0 -47
- package/dist/integration-engine/ropid-gtfs/data-access/cache/NotPublicVehiclesRedisRepository.js.map +0 -1
- package/dist/integration-engine/ropid-gtfs/datasources/static-data/NotPublicVehiclesDataSourceProvider.d.ts +0 -9
- package/dist/integration-engine/ropid-gtfs/datasources/static-data/NotPublicVehiclesDataSourceProvider.js +0 -47
- package/dist/integration-engine/ropid-gtfs/datasources/static-data/NotPublicVehiclesDataSourceProvider.js.map +0 -1
- package/dist/output-gateway/vehicle-positions/data-access/cache/NotPublicVehiclesRedisRepository.d.ts +0 -10
- package/dist/output-gateway/vehicle-positions/data-access/cache/NotPublicVehiclesRedisRepository.js +0 -45
- package/dist/output-gateway/vehicle-positions/data-access/cache/NotPublicVehiclesRedisRepository.js.map +0 -1
- package/dist/output-gateway/vehicle-positions/ioc/Di.d.ts +0 -3
- package/dist/output-gateway/vehicle-positions/ioc/Di.js +0 -23
- package/dist/output-gateway/vehicle-positions/ioc/Di.js.map +0 -1
- package/dist/output-gateway/vehicle-positions/ioc/OgVehiclePositionsToken.d.ts +0 -9
- package/dist/output-gateway/vehicle-positions/ioc/OgVehiclePositionsToken.js +0 -15
- package/dist/output-gateway/vehicle-positions/ioc/OgVehiclePositionsToken.js.map +0 -1
- package/dist/schema-definitions/datasources/static-data/NotPublicVehiclesJsonSchema.d.ts +0 -3
- package/dist/schema-definitions/datasources/static-data/NotPublicVehiclesJsonSchema.js +0 -40
- package/dist/schema-definitions/datasources/static-data/NotPublicVehiclesJsonSchema.js.map +0 -1
- package/dist/schema-definitions/datasources/static-data/interfaces/NotPublicVehiclesDataInterface.d.ts +0 -35
- package/dist/schema-definitions/datasources/static-data/interfaces/NotPublicVehiclesDataInterface.js +0 -18
- package/dist/schema-definitions/datasources/static-data/interfaces/NotPublicVehiclesDataInterface.js.map +0 -1
- package/docs/examples/not_public_vehicles.json +0 -9
- package/docs/processing/transferboards_filtering.md +0 -312
package/dist/integration-engine/vehicle-positions/workers/runs/helpers/CommonMessageProcessor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonMessageProcessor.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/helpers/CommonMessageProcessor.ts"],"names":[],"mappings":";;;AAAA,2CAA0C;AAC1C,2FAA0D;AAE1D,wEAAqE;AAErE,yEAAsE;AACtE,2FAAqF;AACrF,6EAAwE;
|
|
1
|
+
{"version":3,"file":"CommonMessageProcessor.js","sourceRoot":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AAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;YACtE,CAAC;YAED,MAAM,8BAAY,CAAC,qBAAqB,CACpC,GAAG,eAAM,CAAC,oBAAoB,IAAI,oCAAgB,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,EACvE,sBAAsB,EACtB,SAAS,EACT,EAAE,SAAS,EAAE,qBAAqB,EAAE,CACvC,CAAC;QACN,CAAC,CAAC;QAhCE,IAAI,CAAC,MAAM,GAAG,iBAAY,CAAC,OAAO,CAAU,qBAAS,CAAC,MAAM,CAAC,CAAC;IAClE,CAAC;IAiCO,gBAAgB,CAAC,OAAiC;QACtD,IACI,OAAO,CAAC,WAAW,CAAC,+BAA+B,YAAY,IAAI;YACnE,OAAO,CAAC,WAAW,CAAC,+BAA+B,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE;gBACtE,qBAAqB,GAAG,kBAAkB,EAChD,CAAC;YACC,IAAI,CAAC,MAAM,CAAC,KAAK,CACb,IAAI,6BAAY,CACZ,qCAAqC,OAAO,CAAC,WAAW,CAAC,+BAA+B,CAAC,WAAW,EAAE,GAAG;gBACrG,OAAO,qBAAqB,qBAAqB,OAAO,CAAC,GAAG,CAAC,eAAe,OAAO;gBACnF,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,GAAG,EACjC,IAAI,CAAC,WAAW,CAAC,IAAI,EACrB,SAAS,EACT,SAAS,EACT,KAAK,CACR,CACJ,CAAC;QACN,CAAC;IACL,CAAC;CACJ;AAzDD,wDAyDC"}
|
package/dist/integration-engine/vehicle-positions/workers/runs/helpers/TramMessageFilter.d.ts
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
import { ICommonRunWithMessageDto } from "../../../../../schema-definitions/vehicle-positions/models/interfaces/ICommonRunWithMessageDto";
|
|
2
|
-
import { NotPublicVehiclesRedisRepository } from "../../../../ropid-gtfs/data-access/cache/NotPublicVehiclesRedisRepository";
|
|
3
2
|
import { ILogger } from "@golemio/core/dist/helpers/logger";
|
|
4
3
|
import { ICommonMessageFilter } from "./interfaces/ICommonMessageFilter";
|
|
5
4
|
import { TimestampValidator } from "./TimestampValidator";
|
|
6
5
|
export declare class TramMessageFilter implements ICommonMessageFilter {
|
|
7
6
|
private logger;
|
|
8
7
|
private timestampValidator;
|
|
9
|
-
|
|
10
|
-
constructor(logger: ILogger, timestampValidator: TimestampValidator, notPublicVehiclesRepository: NotPublicVehiclesRedisRepository);
|
|
8
|
+
constructor(logger: ILogger, timestampValidator: TimestampValidator);
|
|
11
9
|
/**
|
|
12
10
|
* Yield tram messages that are valid for processing
|
|
13
11
|
* - route id is not considered a servicing route (50-89, note: >89 is a night tram route)
|
|
14
12
|
* - run number is less than 80
|
|
15
|
-
* -
|
|
13
|
+
* - mazačka trams (maintanance) are always processed, even though they are servicing routes
|
|
16
14
|
* - timestamp is in acceptable range
|
|
17
|
-
*
|
|
18
|
-
* Sets isNotPublic flag on messages to avoid duplicate whitelist checks in processor
|
|
19
15
|
*/
|
|
20
|
-
yieldFilteredMessages(messages: ICommonRunWithMessageDto[], timestamp: number):
|
|
16
|
+
yieldFilteredMessages(messages: ICommonRunWithMessageDto[], timestamp: number): Generator<ICommonRunWithMessageDto>;
|
|
21
17
|
private isRouteIdValid;
|
|
22
18
|
private isRunNumberValid;
|
|
23
19
|
}
|
|
@@ -13,9 +13,9 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.TramMessageFilter = void 0;
|
|
16
|
-
const NotPublicVehiclesRedisRepository_1 = require("../../../../ropid-gtfs/data-access/cache/NotPublicVehiclesRedisRepository");
|
|
17
16
|
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
18
17
|
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
18
|
+
const const_1 = require("../../../../../const");
|
|
19
19
|
const VPContainerToken_1 = require("../../../ioc/VPContainerToken");
|
|
20
20
|
const TimestampValidator_1 = require("./TimestampValidator");
|
|
21
21
|
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
@@ -23,44 +23,28 @@ const TRAM_SERVICING_ROUTE_ID_MIN = 50;
|
|
|
23
23
|
const TRAM_SERVICING_ROUTE_ID_MAX = 89;
|
|
24
24
|
const TRAM_UNUSUAL_RUN_NUMBER_MIN = 80;
|
|
25
25
|
let TramMessageFilter = class TramMessageFilter {
|
|
26
|
-
constructor(logger, timestampValidator
|
|
26
|
+
constructor(logger, timestampValidator) {
|
|
27
27
|
this.logger = logger;
|
|
28
28
|
this.timestampValidator = timestampValidator;
|
|
29
|
-
this.notPublicVehiclesRepository = notPublicVehiclesRepository;
|
|
30
29
|
}
|
|
31
30
|
/**
|
|
32
31
|
* Yield tram messages that are valid for processing
|
|
33
32
|
* - route id is not considered a servicing route (50-89, note: >89 is a night tram route)
|
|
34
33
|
* - run number is less than 80
|
|
35
|
-
* -
|
|
34
|
+
* - mazačka trams (maintanance) are always processed, even though they are servicing routes
|
|
36
35
|
* - timestamp is in acceptable range
|
|
37
|
-
*
|
|
38
|
-
* Sets isNotPublic flag on messages to avoid duplicate whitelist checks in processor
|
|
39
36
|
*/
|
|
40
|
-
|
|
41
|
-
// Load config once for the entire batch to avoid multiple Redis calls
|
|
42
|
-
const { tram: { registrationNumbers }, routeIds, } = await this.notPublicVehiclesRepository.getConfig();
|
|
43
|
-
const whitelistedRegistrationNumbers = new Set(registrationNumbers);
|
|
44
|
-
const whitelistedRouteNames = new Set(routeIds);
|
|
37
|
+
*yieldFilteredMessages(messages, timestamp) {
|
|
45
38
|
for (const message of messages) {
|
|
46
|
-
const { route_id, run_number, registration_number
|
|
39
|
+
const { route_id, run_number, registration_number } = message.run;
|
|
47
40
|
if (!this.timestampValidator.isTimestampValid(timestamp, message.run_message.actual_stop_timestamp_real.toString())) {
|
|
48
41
|
this.logger.error(new golemio_errors_1.GeneralError("Message timestamp 'takt' of value" +
|
|
49
42
|
` '${message.run_message.actual_stop_timestamp_real.toISOString()}'` +
|
|
50
43
|
` is not valid for line ${message.run.line_short_name}, run ${message.run.run_number}`, this.constructor.name, undefined, undefined, "pid"));
|
|
51
44
|
continue;
|
|
52
45
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// - Whitelisted route name (e.g., ad-hoc routes like X1, X2, NAD)
|
|
56
|
-
const isNotPublicByRegistration = whitelistedRegistrationNumbers.has(registration_number);
|
|
57
|
-
const isNotPublicByRouteName = whitelistedRouteNames.has(line_short_name);
|
|
58
|
-
const isNotPublicVehicle = isNotPublicByRegistration || isNotPublicByRouteName;
|
|
59
|
-
// Allow if:
|
|
60
|
-
// - Whitelisted by registration number OR route name (not-public vehicles)
|
|
61
|
-
// - OR valid route_id and run_number (scheduled vehicles)
|
|
62
|
-
if (isNotPublicVehicle || (this.isRouteIdValid(route_id) && this.isRunNumberValid(run_number))) {
|
|
63
|
-
message.isNotPublic = isNotPublicVehicle; // ← Set flag
|
|
46
|
+
if (const_1.ArrayNotPublicRegistrationNumbers.includes(registration_number) ||
|
|
47
|
+
(this.isRouteIdValid(route_id) && this.isRunNumberValid(run_number))) {
|
|
64
48
|
yield message;
|
|
65
49
|
}
|
|
66
50
|
else {
|
|
@@ -83,8 +67,6 @@ exports.TramMessageFilter = TramMessageFilter = __decorate([
|
|
|
83
67
|
(0, tsyringe_1.injectable)(),
|
|
84
68
|
__param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
|
|
85
69
|
__param(1, (0, tsyringe_1.inject)(VPContainerToken_1.VPContainerToken.TimestampValidator)),
|
|
86
|
-
|
|
87
|
-
__metadata("design:paramtypes", [Object, TimestampValidator_1.TimestampValidator,
|
|
88
|
-
NotPublicVehiclesRedisRepository_1.NotPublicVehiclesRedisRepository])
|
|
70
|
+
__metadata("design:paramtypes", [Object, TimestampValidator_1.TimestampValidator])
|
|
89
71
|
], TramMessageFilter);
|
|
90
72
|
//# sourceMappingURL=TramMessageFilter.js.map
|
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,
|
|
1
|
+
{"version":3,"file":"TramMessageFilter.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/helpers/TramMessageFilter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,wEAAqE;AAErE,iEAAwE;AACxE,gDAA8D;AAE9D,oEAA8E;AAC9E,6DAA0D;AAC1D,6EAAwE;AAExE,MAAM,2BAA2B,GAAG,EAAE,CAAC;AACvC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AACvC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAGhC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC1B,YACsC,MAAe,EACI,kBAAsC;QADzD,WAAM,GAAN,MAAM,CAAS;QACI,uBAAkB,GAAlB,kBAAkB,CAAoB;IAC5F,CAAC;IAEJ;;;;;;OAMG;IACI,CAAC,qBAAqB,CAAC,QAAoC,EAAE,SAAiB;QACjF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;YAElE,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,0BAA0B,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC;gBAClH,IAAI,CAAC,MAAM,CAAC,KAAK,CACb,IAAI,6BAAY,CACZ,mCAAmC;oBAC/B,KAAK,OAAO,CAAC,WAAW,CAAC,0BAA0B,CAAC,WAAW,EAAE,GAAG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
1
1
|
import { ICommonRunWithMessageDto } from "../../../../../../schema-definitions/vehicle-positions/models/interfaces/ICommonRunWithMessageDto";
|
|
2
2
|
export interface ICommonMessageFilter {
|
|
3
|
-
yieldFilteredMessages(messages: ICommonRunWithMessageDto[], timestamp: number):
|
|
3
|
+
yieldFilteredMessages(messages: ICommonRunWithMessageDto[], timestamp: number): Generator<ICommonRunWithMessageDto>;
|
|
4
4
|
}
|
|
@@ -19,7 +19,6 @@ const Di_1 = require("../../../ioc/Di");
|
|
|
19
19
|
const VPContainerToken_1 = require("../../../ioc/VPContainerToken");
|
|
20
20
|
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
21
21
|
const constants_1 = require("../constants");
|
|
22
|
-
const RouteTypeEnums_1 = require("../../../../../helpers/RouteTypeEnums");
|
|
23
22
|
let SaveBusRunsToDBTask = class SaveBusRunsToDBTask extends workers_1.AbstractTask {
|
|
24
23
|
constructor() {
|
|
25
24
|
super(constants_1.WORKER_NAME);
|
|
@@ -38,8 +37,8 @@ let SaveBusRunsToDBTask = class SaveBusRunsToDBTask extends workers_1.AbstractTa
|
|
|
38
37
|
}
|
|
39
38
|
const messages = this.messagesTransformation.transform({ data: data.M.V, timestamp });
|
|
40
39
|
const filteredMessages = this.messageFilter.yieldFilteredMessages(messages, timestamp);
|
|
41
|
-
for
|
|
42
|
-
await this.messageProcessor.processTransformedRun(
|
|
40
|
+
for (const runMessage of filteredMessages) {
|
|
41
|
+
await this.messageProcessor.processTransformedRun(runMessage, timestamp);
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
};
|
package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveBusRunsToDBTask.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveBusRunsToDBTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/tasks/SaveBusRunsToDBTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2EAA6E;AAC7E,6EAAwE;AAExE,8EAA2E;
|
|
1
|
+
{"version":3,"file":"SaveBusRunsToDBTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/tasks/SaveBusRunsToDBTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2EAA6E;AAC7E,6EAAwE;AAExE,8EAA2E;AAE3E,8EAA2E;AAG3E,iEAAwE;AAExE,wCAA2D;AAC3D,oEAA8E;AAC9E,iEAAgE;AAChE,4CAA2C;AAGpC,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,sBAA8B;IAUnE;QACI,KAAK,CAAC,uBAAW,CAAC,CAAC;QAVP,cAAS,GAAG,iBAAiB,CAAC;QAC9B,aAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;QACtC,WAAM,GAAG,6CAA0B,CAAC;QAShD,IAAI,CAAC,sBAAsB,GAAG,gBAAW,CAAC,OAAO,CAC7C,mCAAgB,CAAC,gCAAgC,CACpD,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,IAAI,2CAAoB,EAAE,CAAC;QACjD,IAAI,CAAC,gBAAgB,GAAG,IAAI,+CAAsB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACxE,IAAI,CAAC,aAAa,GAAG,gBAAW,CAAC,OAAO,CAAmB,mCAAgB,CAAC,gBAAgB,CAAC,CAAC;IAClG,CAAC;IAES,KAAK,CAAC,OAAO,CAAC,IAAsB,EAAE,aAAiC;QAC7E,MAAM,SAAS,GAAG,aAAa,EAAE,SAAS,CAAC;QAC3C,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,MAAM,IAAI,6BAAY,CAAC,sCAAsC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAChH,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;QACtF,MAAM,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,qBAAqB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAEvF,KAAK,MAAM,UAAU,IAAI,gBAAgB,EAAE,CAAC;YACxC,MAAM,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QAC7E,CAAC;IACL,CAAC;CACJ,CAAA;AAjCY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,qBAAU,GAAE;;GACA,mBAAmB,CAiC/B"}
|
package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveTramRunsToDBTask.js
CHANGED
|
@@ -19,7 +19,6 @@ const CommonMessageProcessor_1 = require("../helpers/CommonMessageProcessor");
|
|
|
19
19
|
const CommonRunsSchema_1 = require("../schema/CommonRunsSchema");
|
|
20
20
|
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
21
21
|
const constants_1 = require("../constants");
|
|
22
|
-
const RouteTypeEnums_1 = require("../../../../../helpers/RouteTypeEnums");
|
|
23
22
|
let SaveTramRunsToDBTask = class SaveTramRunsToDBTask extends workers_1.AbstractTask {
|
|
24
23
|
constructor() {
|
|
25
24
|
super(constants_1.WORKER_NAME);
|
|
@@ -36,10 +35,10 @@ let SaveTramRunsToDBTask = class SaveTramRunsToDBTask extends workers_1.Abstract
|
|
|
36
35
|
if (!timestamp) {
|
|
37
36
|
throw new golemio_errors_1.GeneralError(`Missing tram run message timestamp: ${JSON.stringify(data)}`, this.constructor.name);
|
|
38
37
|
}
|
|
39
|
-
const messages = this.messagesTransformation.transform({ data: data.M.V, timestamp });
|
|
38
|
+
const messages = this.messagesTransformation.transform({ data: data.M.V, timestamp }, true);
|
|
40
39
|
const filteredMessages = this.messageFilter.yieldFilteredMessages(messages, timestamp);
|
|
41
|
-
for
|
|
42
|
-
await this.messageProcessor.processTransformedRun(
|
|
40
|
+
for (const runMessage of filteredMessages) {
|
|
41
|
+
await this.messageProcessor.processTransformedRun(runMessage, timestamp);
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
};
|
package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveTramRunsToDBTask.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveTramRunsToDBTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/tasks/SaveTramRunsToDBTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAA2D;AAC3D,oEAA8E;AAC9E,2EAA6E;AAC7E,6EAAwE;AAExE,8EAA2E;AAC3E,8EAA2E;AAG3E,iEAAwE;AAExE,iEAAgE;AAChE,4CAA2C;
|
|
1
|
+
{"version":3,"file":"SaveTramRunsToDBTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/tasks/SaveTramRunsToDBTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAA2D;AAC3D,oEAA8E;AAC9E,2EAA6E;AAC7E,6EAAwE;AAExE,8EAA2E;AAC3E,8EAA2E;AAG3E,iEAAwE;AAExE,iEAAgE;AAChE,4CAA2C;AAIpC,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,sBAA8B;IAUpE;QACI,KAAK,CAAC,uBAAW,CAAC,CAAC;QAVP,cAAS,GAAG,kBAAkB,CAAC;QAC/B,aAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;QACtC,WAAM,GAAG,6CAA0B,CAAC;QAShD,IAAI,CAAC,sBAAsB,GAAG,gBAAW,CAAC,OAAO,CAC7C,mCAAgB,CAAC,gCAAgC,CACpD,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,IAAI,2CAAoB,EAAE,CAAC;QACjD,IAAI,CAAC,gBAAgB,GAAG,IAAI,+CAAsB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACxE,IAAI,CAAC,aAAa,GAAG,gBAAW,CAAC,OAAO,CAAoB,mCAAgB,CAAC,iBAAiB,CAAC,CAAC;IACpG,CAAC;IAES,KAAK,CAAC,OAAO,CAAC,IAAsB,EAAE,aAAiC;QAC7E,MAAM,SAAS,GAAG,aAAa,EAAE,SAAS,CAAC;QAC3C,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,MAAM,IAAI,6BAAY,CAAC,uCAAuC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACjH,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,IAAI,CAAC,CAAC;QAC5F,MAAM,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,qBAAqB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QACvF,KAAK,MAAM,UAAU,IAAI,gBAAgB,EAAE,CAAC;YACxC,MAAM,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QAC7E,CAAC;IACL,CAAC;CACJ,CAAA;AAhCY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,qBAAU,GAAE;;GACA,oBAAoB,CAgChC"}
|
|
@@ -5,6 +5,7 @@ export declare class CommonRunsMessagesTransformation extends AbstractTransforma
|
|
|
5
5
|
name: string;
|
|
6
6
|
private readonly commonRunHelper;
|
|
7
7
|
constructor();
|
|
8
|
-
transform: ({ data, timestamp }: ICommonRunsInputData) => ICommonRunWithMessageDto[];
|
|
8
|
+
transform: ({ data, timestamp }: ICommonRunsInputData, isTram?: boolean) => ICommonRunWithMessageDto[];
|
|
9
9
|
protected transformInternal: (element: ICommonRunsInputElement) => ICommonRunWithMessageDto;
|
|
10
|
+
private transformElementWithTram;
|
|
10
11
|
}
|
|
@@ -23,7 +23,7 @@ let CommonRunsMessagesTransformation = class CommonRunsMessagesTransformation ex
|
|
|
23
23
|
constructor() {
|
|
24
24
|
super();
|
|
25
25
|
this.name = "CommonRunsMessagesTransformation";
|
|
26
|
-
this.transform = ({ data, timestamp }) => {
|
|
26
|
+
this.transform = ({ data, timestamp }, isTram = false) => {
|
|
27
27
|
const now = (0, moment_timezone_1.default)(timestamp).tz("Europe/Prague").format();
|
|
28
28
|
const res = [];
|
|
29
29
|
if (!Array.isArray(data)) {
|
|
@@ -31,7 +31,7 @@ let CommonRunsMessagesTransformation = class CommonRunsMessagesTransformation ex
|
|
|
31
31
|
}
|
|
32
32
|
for (const element of data) {
|
|
33
33
|
try {
|
|
34
|
-
const elementTransformed = this.
|
|
34
|
+
const elementTransformed = this.transformElementWithTram({ data: element, timestamp: now }, isTram);
|
|
35
35
|
res.push(elementTransformed);
|
|
36
36
|
}
|
|
37
37
|
catch (err) {
|
|
@@ -41,7 +41,13 @@ let CommonRunsMessagesTransformation = class CommonRunsMessagesTransformation ex
|
|
|
41
41
|
return res;
|
|
42
42
|
};
|
|
43
43
|
this.transformInternal = (element) => {
|
|
44
|
+
return this.transformElementWithTram(element, false);
|
|
45
|
+
};
|
|
46
|
+
this.transformElementWithTram = (element, isTram) => {
|
|
44
47
|
const attributes = element.data.$;
|
|
48
|
+
if (!isTram && !attributes.tjr) {
|
|
49
|
+
throw new golemio_errors_1.GeneralError("Missing tjr attribute", this.constructor.name);
|
|
50
|
+
}
|
|
45
51
|
const identifiers = this.commonRunHelper.getRunIdentifiers(attributes, element.timestamp);
|
|
46
52
|
const realStopTimestampDate = this.commonRunHelper.parseDateFromRunInput(attributes.takt);
|
|
47
53
|
const messageTimestampDate = this.commonRunHelper.parseDateFromRunInput(attributes.tm);
|
|
@@ -49,7 +55,7 @@ let CommonRunsMessagesTransformation = class CommonRunsMessagesTransformation ex
|
|
|
49
55
|
throw new golemio_errors_1.GeneralError("Missing identifiers or timestamps", this.constructor.name);
|
|
50
56
|
}
|
|
51
57
|
const scheduledStopTimestampDate = attributes.tjr ? this.commonRunHelper.parseDateFromRunInput(attributes.tjr) : null;
|
|
52
|
-
|
|
58
|
+
const t = {
|
|
53
59
|
run: {
|
|
54
60
|
id: identifiers.runId,
|
|
55
61
|
route_id: identifiers.routeId,
|
|
@@ -74,6 +80,7 @@ let CommonRunsMessagesTransformation = class CommonRunsMessagesTransformation ex
|
|
|
74
80
|
events: attributes.events,
|
|
75
81
|
},
|
|
76
82
|
};
|
|
83
|
+
return t;
|
|
77
84
|
};
|
|
78
85
|
this.commonRunHelper = new CommonRunHelper_1.CommonRunHelper();
|
|
79
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonRunsMessagesTransformation.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,2EAAoE;AACpE,6GAA0G;AAC1G,gEAA6D;AAG7D,gGAA+D;AAC/D,iEAAgE;AAChE,6EAAwE;AAGjE,IAAM,gCAAgC,GAAtC,MAAM,gCAAiC,SAAQ,+CAAyE;IAI3H;QACI,KAAK,EAAE,CAAC;QAJL,SAAI,GAAG,kCAAkC,CAAC;QAQ1C,cAAS,GAAG,CAAC,EAAE,IAAI,EAAE,SAAS,EAAwB,EAA8B,EAAE;
|
|
1
|
+
{"version":3,"file":"CommonRunsMessagesTransformation.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,2EAAoE;AACpE,6GAA0G;AAC1G,gEAA6D;AAG7D,gGAA+D;AAC/D,iEAAgE;AAChE,6EAAwE;AAGjE,IAAM,gCAAgC,GAAtC,MAAM,gCAAiC,SAAQ,+CAAyE;IAI3H;QACI,KAAK,EAAE,CAAC;Q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GAAG,EAAE,CAAC,UAAU,CAAC,GAAG;oBACpB,kBAAkB,EAAE,UAAU,CAAC,GAAG;oBAClC,0BAA0B,EAAE,qBAAqB;oBACjD,+BAA+B,EAAE,0BAA0B;oBAC3D,gBAAgB,EAAE,UAAU,CAAC,IAAI;oBACjC,aAAa,EAAE,UAAU,CAAC,GAAG;oBAC7B,aAAa,EAAE,oBAAoB;oBACnC,MAAM,EAAE,UAAU,CAAC,MAAM;iBAC5B;aACJ,CAAC;YAEF,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAnEE,IAAI,CAAC,eAAe,GAAG,IAAI,iCAAe,EAAE,CAAC;IACjD,CAAC;CAmEJ,CAAA;AA1EY,4EAAgC;2CAAhC,gCAAgC;IAD5C,IAAA,qBAAU,GAAE;;GACA,gCAAgC,CA0E5C"}
|
|
@@ -4,11 +4,10 @@ import { ICommonRunsModel } from "../../../../../../schema-definitions/vehicle-p
|
|
|
4
4
|
import { IVPTripsModel } from "../../../../../../schema-definitions/vehicle-positions/models/interfaces/IVPTripsModel";
|
|
5
5
|
import { IScheduleDto } from "../../../../../../schema-definitions/vehicle-positions/redis/interfaces/IGtfsRunTripCacheDto";
|
|
6
6
|
import { BulkSaveResult } from "@golemio/core/dist/integration-engine";
|
|
7
|
-
import { GTFSRouteTypeEnum } from "../../../../../../helpers/RouteTypeEnums";
|
|
8
7
|
import { IBulkUpsertOutput } from "../interfaces/TripRepositoryInterfaces";
|
|
9
8
|
export default class TripsMapper {
|
|
10
9
|
static mapCommonRunToDto(gtfsTrip: IScheduleDto, runInput: ICommonRunsModel): Partial<IVPTripsModel>;
|
|
11
|
-
static mapCommonRunNotPublicToDto(runInput: ICommonRunsModel, tripId: string, lastPositionId: string
|
|
10
|
+
static mapCommonRunNotPublicToDto(runInput: ICommonRunsModel, tripId: string, lastPositionId: string): Partial<IVPTripsModel>;
|
|
12
11
|
static mapMetroRunToDto(gtfsTrip: IScheduleDto, runInput: IExtendedMetroRunInputForProcessing): Partial<IVPTripsModel>;
|
|
13
12
|
static mapRegionalBusRunToDto(gtfsTrip: IScheduleDto, runInput: IRegionalBusRunInputWithMetadata): Partial<IVPTripsModel>;
|
|
14
13
|
static mapTripEntitiesToUpdateDto(tripEntities: BulkSaveResult<IVPTripsModel>, taskStartTimestamp: number): IBulkUpsertOutput;
|
|
@@ -23,19 +23,17 @@ class TripsMapper {
|
|
|
23
23
|
provider_source_type: ProviderSourceTypeEnum_1.ProviderSourceTypeEnum.TcpCommon,
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
static mapCommonRunNotPublicToDto(runInput, tripId, lastPositionId
|
|
26
|
+
static mapCommonRunNotPublicToDto(runInput, tripId, lastPositionId) {
|
|
27
27
|
return {
|
|
28
28
|
agency_name_real: DPPUtils_1.default.DPP_AGENCY_NAME,
|
|
29
29
|
agency_name_scheduled: DPPUtils_1.default.DPP_AGENCY_NAME,
|
|
30
|
-
gtfs_route_type:
|
|
30
|
+
gtfs_route_type: RouteTypeEnums_1.GTFSRouteTypeEnum.TRAM,
|
|
31
31
|
origin_route_name: runInput.route_id,
|
|
32
32
|
internal_route_name: runInput.route_id,
|
|
33
33
|
run_number: runInput.run_number,
|
|
34
34
|
internal_run_number: runInput.run_number,
|
|
35
35
|
vehicle_registration_number: parseInt(runInput.registration_number),
|
|
36
|
-
vehicle_type_id:
|
|
37
|
-
? TripsMapper.getVehicleTypeId(notPublicVehicleRouteType, false, false, false)
|
|
38
|
-
: RouteTypeEnums_1.MPVRouteTypesEnum.UNKNOWN,
|
|
36
|
+
vehicle_type_id: RouteTypeEnums_1.MPVRouteTypesEnum.TRAM,
|
|
39
37
|
wheelchair_accessible: runInput.wheelchair_accessible,
|
|
40
38
|
provider_source_type: ProviderSourceTypeEnum_1.ProviderSourceTypeEnum.TcpCommon,
|
|
41
39
|
id: tripId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TripsMapper.js","sourceRoot":"","sources":["../../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/TripsMapper.ts"],"names":[],"mappings":";;;;;AAAA,2EAAuD;AAGvD,sEAAwF;AACxF,uIAAoG;AAKpG,6EAAkF;AAElF,0EAAoD;AAEpD,MAAqB,WAAW;IACrB,MAAM,CAAC,iBAAiB,CAAC,QAAsB,EAAE,QAA0B;QAC9E,OAAO;YACH,GAAG,WAAW,CAAC,iBAAiB,CAAC,QAAQ,CAAC;YAC1C,EAAE,EAAE,0BAAkB,CAAC,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,CAAC;YAChE,iBAAiB,EAAE,QAAQ,CAAC,QAAQ;YACpC,mBAAmB,EAAE,QAAQ,CAAC,QAAQ;YACtC,UAAU,EAAE,QAAQ,CAAC,UAAU;YAC/B,mBAAmB,EAAE,QAAQ,CAAC,UAAU;YACxC,2BAA2B,EAAE,QAAQ,CAAC,QAAQ,CAAC,mBAAmB,CAAC;YACnE,eAAe,EAAE,WAAW,CAAC,gBAAgB,CACzC,CAAC,QAAQ,CAAC,UAAU,EACpB,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,EACpB,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,EACvB,CAAC,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CACtC;YACD,qBAAqB,EAAE,QAAQ,CAAC,qBAAqB;YACrD,oBAAoB,EAAE,+CAAsB,CAAC,SAAS;SACzD,CAAC;IACN,CAAC;IAEM,MAAM,CAAC,0BAA0B,CACpC,QAA0B,EAC1B,MAAc,EACd,cAAsB
|
|
1
|
+
{"version":3,"file":"TripsMapper.js","sourceRoot":"","sources":["../../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/TripsMapper.ts"],"names":[],"mappings":";;;;;AAAA,2EAAuD;AAGvD,sEAAwF;AACxF,uIAAoG;AAKpG,6EAAkF;AAElF,0EAAoD;AAEpD,MAAqB,WAAW;IACrB,MAAM,CAAC,iBAAiB,CAAC,QAAsB,EAAE,QAA0B;QAC9E,OAAO;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K,CAAC,sBAAsB,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC,CAAC;kBArMe,WAAW"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { GTFSRouteTypeEnum } from "../../../../../helpers/RouteTypeEnums";
|
|
2
1
|
import { ICommonRunsMessagesModel } from "../../../../../schema-definitions/vehicle-positions/models/interfaces/ICommonRunsMessagesModel";
|
|
3
2
|
import { ICommonRunsModel } from "../../../../../schema-definitions/vehicle-positions/models/interfaces/ICommonRunsModel";
|
|
4
3
|
export interface IRunMessageWithStringTimestamps extends Omit<ICommonRunsMessagesModel, "actual_stop_timestamp_real" | "actual_stop_timestamp_scheduled"> {
|
|
@@ -8,14 +7,4 @@ export interface IRunMessageWithStringTimestamps extends Omit<ICommonRunsMessage
|
|
|
8
7
|
export interface IUpdateRunsGtfsTripInput {
|
|
9
8
|
run: ICommonRunsModel;
|
|
10
9
|
run_message: IRunMessageWithStringTimestamps;
|
|
11
|
-
/**
|
|
12
|
-
* Flag set by message filters to indicate this is a not-public vehicle
|
|
13
|
-
* (replacement bus/tram without schedule, or ad-hoc route)
|
|
14
|
-
* Used to avoid duplicate whitelist checks
|
|
15
|
-
*/
|
|
16
|
-
isNotPublic?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Vehicle type for not-public vehicles. Only populated when isNotPublic is true.
|
|
19
|
-
*/
|
|
20
|
-
notPublicVehicleRouteType?: GTFSRouteTypeEnum.TRAM | GTFSRouteTypeEnum.BUS;
|
|
21
10
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { ICommonRunsModel } from "../../../../../schema-definitions/vehicle-positions/models/interfaces/ICommonRunsModel";
|
|
2
2
|
import { IRunMessageWithStringTimestamps, IUpdateRunsGtfsTripInput } from "../interfaces/IUpdateRunsGtfsTripInput";
|
|
3
|
-
import { GTFSRouteTypeEnum } from "../../../../../helpers/RouteTypeEnums";
|
|
4
3
|
export declare class UpdateRunsGtfsTripIdValidationSchema implements IUpdateRunsGtfsTripInput {
|
|
5
4
|
run: ICommonRunsModel;
|
|
6
5
|
run_message: IRunMessageWithStringTimestamps;
|
|
7
|
-
isNotPublic?: boolean;
|
|
8
|
-
notPublicVehicleRouteType?: GTFSRouteTypeEnum.TRAM | GTFSRouteTypeEnum.BUS;
|
|
9
6
|
}
|
|
@@ -11,7 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.UpdateRunsGtfsTripIdValidationSchema = void 0;
|
|
13
13
|
const class_validator_1 = require("@golemio/core/dist/shared/class-validator");
|
|
14
|
-
const RouteTypeEnums_1 = require("../../../../../helpers/RouteTypeEnums");
|
|
15
14
|
class UpdateRunsGtfsTripIdValidationSchema {
|
|
16
15
|
}
|
|
17
16
|
exports.UpdateRunsGtfsTripIdValidationSchema = UpdateRunsGtfsTripIdValidationSchema;
|
|
@@ -23,14 +22,4 @@ __decorate([
|
|
|
23
22
|
(0, class_validator_1.IsObject)(),
|
|
24
23
|
__metadata("design:type", Object)
|
|
25
24
|
], UpdateRunsGtfsTripIdValidationSchema.prototype, "run_message", void 0);
|
|
26
|
-
__decorate([
|
|
27
|
-
(0, class_validator_1.IsOptional)(),
|
|
28
|
-
(0, class_validator_1.IsBoolean)(),
|
|
29
|
-
__metadata("design:type", Boolean)
|
|
30
|
-
], UpdateRunsGtfsTripIdValidationSchema.prototype, "isNotPublic", void 0);
|
|
31
|
-
__decorate([
|
|
32
|
-
(0, class_validator_1.IsOptional)(),
|
|
33
|
-
(0, class_validator_1.IsIn)([RouteTypeEnums_1.GTFSRouteTypeEnum.TRAM, RouteTypeEnums_1.GTFSRouteTypeEnum.BUS]),
|
|
34
|
-
__metadata("design:type", Number)
|
|
35
|
-
], UpdateRunsGtfsTripIdValidationSchema.prototype, "notPublicVehicleRouteType", void 0);
|
|
36
25
|
//# sourceMappingURL=UpdateRunsGtfsTripIdSchema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateRunsGtfsTripIdSchema.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/schema/UpdateRunsGtfsTripIdSchema.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+
|
|
1
|
+
{"version":3,"file":"UpdateRunsGtfsTripIdSchema.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/schema/UpdateRunsGtfsTripIdSchema.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+EAAqE;AAGrE,MAAa,oCAAoC;CAMhD;AAND,oFAMC;AAJG;IADC,IAAA,0BAAQ,GAAE;;iEACY;AAGvB;IADC,IAAA,0BAAQ,GAAE;;yEACmC"}
|
|
@@ -9,6 +9,7 @@ const CommonRunsRepository_1 = require("../../runs/data-access/CommonRunsReposit
|
|
|
9
9
|
const helpers_1 = require("@golemio/core/dist/integration-engine/helpers");
|
|
10
10
|
const queueprocessors_1 = require("@golemio/core/dist/integration-engine/queueprocessors");
|
|
11
11
|
const workers_1 = require("@golemio/core/dist/integration-engine/workers");
|
|
12
|
+
const const_1 = require("../../../../../const");
|
|
12
13
|
const PositionsRepository_1 = require("../data-access/PositionsRepository");
|
|
13
14
|
const TripsRepository_1 = require("../data-access/TripsRepository");
|
|
14
15
|
const PositionsMapper_1 = __importDefault(require("../data-access/helpers/PositionsMapper"));
|
|
@@ -32,7 +33,7 @@ class UpdateRunsGtfsTripIdTask extends workers_1.AbstractTask {
|
|
|
32
33
|
const createdPosition = await this.positionsRepository.createEntity(positionDto);
|
|
33
34
|
//#endregion
|
|
34
35
|
//#region trip
|
|
35
|
-
const tripDto = TripsMapper_1.default.mapCommonRunNotPublicToDto(input.run, tripId, createdPosition.id
|
|
36
|
+
const tripDto = TripsMapper_1.default.mapCommonRunNotPublicToDto(input.run, tripId, createdPosition.id);
|
|
36
37
|
await this.tripsRepository.upsertEntity(tripDto);
|
|
37
38
|
//#endregion
|
|
38
39
|
};
|
|
@@ -48,9 +49,7 @@ class UpdateRunsGtfsTripIdTask extends workers_1.AbstractTask {
|
|
|
48
49
|
async execute(data, messageProperties) {
|
|
49
50
|
const schedule = await this.gtfsTripRunManager.setAndReturnScheduledTrips(data.run);
|
|
50
51
|
if (schedule.length === 0) {
|
|
51
|
-
|
|
52
|
-
// This flag is true if the vehicle is whitelisted by registration number or route name
|
|
53
|
-
if (data.isNotPublic === true) {
|
|
52
|
+
if (const_1.ArrayNotPublicRegistrationNumbers.includes(data.run.registration_number)) {
|
|
54
53
|
await this.updateNotPublicRunTrip(data);
|
|
55
54
|
}
|
|
56
55
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateRunsGtfsTripIdTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateRunsGtfsTripIdTask.ts"],"names":[],"mappings":";;;;;;AAAA,oEAA2E;AAC3E,sFAA2G;AAC3G,2EAAoE;AACpE,2FAAqF;AACrF,2EAA6E;AAE7E,4EAAyE;AACzE,oEAAiE;AACjE,6FAAqE;AACrE,+FAAuE;AACvE,qFAA6D;AAE7D,kGAAgH;AAEhH,qFAA4F;AAE5F,MAAa,wBAAyB,SAAQ,sBAAsC;IAWhF,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QAXP,cAAS,GAAG,sBAAsB,CAAC;QACnC,aAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;QACtC,WAAM,GAAG,iEAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"UpdateRunsGtfsTripIdTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateRunsGtfsTripIdTask.ts"],"names":[],"mappings":";;;;;;AAAA,oEAA2E;AAC3E,sFAA2G;AAC3G,2EAAoE;AACpE,2FAAqF;AACrF,2EAA6E;AAE7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ED,4DA2EC"}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { ILogger } from "@golemio/core/dist/helpers/logger/LoggerProvider";
|
|
5
|
-
import { ModelStatic } from "@golemio/core/dist/shared/sequelize";
|
|
6
|
-
export declare class PositionRepository extends AbstractBasicRepository {
|
|
7
|
-
schema: string;
|
|
8
|
-
tableName: string;
|
|
9
|
-
sequelizeModel: ModelStatic<PositionDto>;
|
|
10
|
-
constructor(connector: IDatabaseConnector, logger: ILogger);
|
|
1
|
+
import { SequelizeModel } from "@golemio/core/dist/output-gateway";
|
|
2
|
+
export declare class PositionRepository extends SequelizeModel {
|
|
3
|
+
constructor();
|
|
11
4
|
GetAll(): never;
|
|
12
5
|
GetOne(): never;
|
|
13
6
|
}
|
|
@@ -1,32 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
3
|
exports.PositionRepository = void 0;
|
|
16
4
|
const const_1 = require("../../../schema-definitions/const");
|
|
17
5
|
const vehicle_positions_1 = require("../../../schema-definitions/vehicle-positions");
|
|
18
6
|
const PositionDto_1 = require("../../../schema-definitions/vehicle-positions/models/PositionDto");
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this.schema = const_1.PG_SCHEMA;
|
|
26
|
-
this.tableName = vehicle_positions_1.VehiclePositions.positions.pgTableName;
|
|
27
|
-
this.sequelizeModel = connector
|
|
28
|
-
.getConnection()
|
|
29
|
-
.define(this.tableName, PositionDto_1.PositionDto.attributeModel, { schema: this.schema });
|
|
7
|
+
const output_gateway_1 = require("@golemio/core/dist/output-gateway");
|
|
8
|
+
class PositionRepository extends output_gateway_1.SequelizeModel {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(vehicle_positions_1.VehiclePositions.positions.name + "Repository", vehicle_positions_1.VehiclePositions.positions.pgTableName, PositionDto_1.PositionDto.attributeModel, {
|
|
11
|
+
schema: const_1.PG_SCHEMA,
|
|
12
|
+
});
|
|
30
13
|
}
|
|
31
14
|
GetAll() {
|
|
32
15
|
throw new Error("Not implemented");
|
|
@@ -34,12 +17,6 @@ let PositionRepository = class PositionRepository extends AbstractBasicRepositor
|
|
|
34
17
|
GetOne() {
|
|
35
18
|
throw new Error("Not implemented");
|
|
36
19
|
}
|
|
37
|
-
}
|
|
20
|
+
}
|
|
38
21
|
exports.PositionRepository = PositionRepository;
|
|
39
|
-
exports.PositionRepository = PositionRepository = __decorate([
|
|
40
|
-
(0, tsyringe_1.injectable)(),
|
|
41
|
-
__param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.PostgresConnector)),
|
|
42
|
-
__param(1, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
|
|
43
|
-
__metadata("design:paramtypes", [Object, Object])
|
|
44
|
-
], PositionRepository);
|
|
45
22
|
//# sourceMappingURL=PositionRepository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PositionRepository.js","sourceRoot":"","sources":["../../../../src/output-gateway/vehicle-positions/data-access/PositionRepository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PositionRepository.js","sourceRoot":"","sources":["../../../../src/output-gateway/vehicle-positions/data-access/PositionRepository.ts"],"names":[],"mappings":";;;AAAA,6DAAuC;AACvC,qFAA0D;AAC1D,kGAAwE;AACxE,sEAAmE;AAEnE,MAAa,kBAAmB,SAAQ,+BAAc;IAClD;QACI,KAAK,CACD,oCAAgB,CAAC,SAAS,CAAC,IAAI,GAAG,YAAY,EAC9C,oCAAgB,CAAC,SAAS,CAAC,WAAW,EACtC,yBAAW,CAAC,cAAc,EAC1B;YACI,MAAM,EAAE,iBAAS;SACpB,CACJ,CAAC;IACN,CAAC;IAEM,MAAM;QACT,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;IAEM,MAAM;QACT,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;CACJ;AAnBD,gDAmBC"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { VPTripsModel } from "../../../schema-definitions/vehicle-positions/models";
|
|
2
|
-
import {
|
|
3
|
-
import { IDatabaseConnector } from "@golemio/core/dist/helpers/data-access/postgres/IDatabaseConnector";
|
|
4
|
-
import { ILogger } from "@golemio/core/dist/helpers/logger/LoggerProvider";
|
|
2
|
+
import { SequelizeModel } from "@golemio/core/dist/output-gateway/models";
|
|
5
3
|
import { ModelStatic } from "@golemio/core/dist/shared/sequelize";
|
|
6
|
-
export declare class TripRepository extends
|
|
7
|
-
schema: string;
|
|
8
|
-
tableName: string;
|
|
4
|
+
export declare class TripRepository extends SequelizeModel {
|
|
9
5
|
sequelizeModel: ModelStatic<VPTripsModel>;
|
|
10
|
-
constructor(
|
|
6
|
+
constructor();
|
|
11
7
|
GetAll(): never;
|
|
12
8
|
GetOne(): never;
|
|
13
9
|
}
|