@golemio/pid 5.7.3-dev.2378632985 → 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 -22
- 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 +1 -1
- 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 +2 -2
- 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/interfaces/IUpdateRunsGtfsTripInput.d.ts +0 -6
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateRunsGtfsTripIdTask.js +2 -3
- 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 -6
- package/docs/asyncapi.yaml +2 -6
- package/docs/cache/types/redis.md +2 -30
- package/docs/implementation_documentation.md +3 -96
- 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 +0 -1
- 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/const.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export declare enum TCPEventEnum {
|
|
|
29
29
|
export declare enum RegionalBusEventEnum {
|
|
30
30
|
DEPARTURED = "R"
|
|
31
31
|
}
|
|
32
|
+
export declare const ArrayNotPublicRegistrationNumbers: string[];
|
|
32
33
|
export declare const DATA_RETENTION_IN_MINUTES = 30;
|
|
33
34
|
export declare const GTFS_CALENDAR_LIMIT_IN_MINUTES: number;
|
|
34
35
|
export declare const PG_INT_MAX: number;
|
package/dist/const.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PG_INT_MIN = exports.PG_INT_MAX = exports.GTFS_CALENDAR_LIMIT_IN_MINUTES = exports.DATA_RETENTION_IN_MINUTES = exports.RegionalBusEventEnum = exports.TCPEventEnum = exports.StateProcessEnum = exports.StatePositionEnum = void 0;
|
|
3
|
+
exports.PG_INT_MIN = exports.PG_INT_MAX = exports.GTFS_CALENDAR_LIMIT_IN_MINUTES = exports.DATA_RETENTION_IN_MINUTES = exports.ArrayNotPublicRegistrationNumbers = exports.RegionalBusEventEnum = exports.TCPEventEnum = exports.StateProcessEnum = exports.StatePositionEnum = void 0;
|
|
4
4
|
var StatePositionEnum;
|
|
5
5
|
(function (StatePositionEnum) {
|
|
6
6
|
StatePositionEnum["OFF_TRACK"] = "off_track";
|
|
@@ -36,6 +36,7 @@ var RegionalBusEventEnum;
|
|
|
36
36
|
(function (RegionalBusEventEnum) {
|
|
37
37
|
RegionalBusEventEnum["DEPARTURED"] = "R";
|
|
38
38
|
})(RegionalBusEventEnum || (exports.RegionalBusEventEnum = RegionalBusEventEnum = {}));
|
|
39
|
+
exports.ArrayNotPublicRegistrationNumbers = ["2210", "5572"];
|
|
39
40
|
exports.DATA_RETENTION_IN_MINUTES = 30;
|
|
40
41
|
exports.GTFS_CALENDAR_LIMIT_IN_MINUTES = 3 * 60 * 24; // 3 days (see IE/ServicesCalendarRepository SQL query)
|
|
41
42
|
exports.PG_INT_MAX = 2 ** 31 - 1;
|
package/dist/const.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","sourceRoot":"","sources":["../src/const.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAcX;AAdD,WAAY,iBAAiB;IACzB,4CAAuB,CAAA;IACvB,wCAAmB,CAAA;IACnB,0CAAqB,CAAA;IACrB,kDAA6B,CAAA;IAC7B,gDAA2B,CAAA;IAC3B,gEAA2C,CAAA;IAC3C,0CAAqB,CAAA;IACrB,4CAAuB,CAAA;IACvB,wCAAmB,CAAA;IACnB,kEAA6C,CAAA;IAC7C,4CAAuB,CAAA;IACvB,8CAAyB,CAAA;IACzB,8CAAyB,CAAA;AAC7B,CAAC,EAdW,iBAAiB,iCAAjB,iBAAiB,QAc5B;AAED,IAAY,gBAMX;AAND,WAAY,gBAAgB;IACxB,2CAAuB,CAAA;IACvB,2CAAuB,CAAA;IACvB,mCAAe,CAAA;IACf,2CAAuB,CAAA;IACvB,+CAA2B,CAAA;AAC/B,CAAC,EANW,gBAAgB,gCAAhB,gBAAgB,QAM3B;AAED,IAAY,YAKX;AALD,WAAY,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ALW,YAAY,4BAAZ,YAAY,QAKvB;AAED,IAAY,oBAEX;AAFD,WAAY,oBAAoB;IAC5B,wCAAgB,CAAA;AACpB,CAAC,EAFW,oBAAoB,oCAApB,oBAAoB,QAE/B;AAEY,QAAA,iCAAiC,GAAa,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE/D,QAAA,yBAAyB,GAAG,EAAE,CAAC;AAC/B,QAAA,8BAA8B,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,uDAAuD;AAErG,QAAA,UAAU,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACzB,QAAA,UAAU,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { IDataSourceProvider } from "../../shared/datasources/IDataSourceProvider";
|
|
2
|
-
import { IMetroRailtrack, IDeparturesDirection
|
|
2
|
+
import { IMetroRailtrack, IDeparturesDirection } from "../../../schema-definitions/datasources/static-data";
|
|
3
3
|
import { IDataSource } from "@golemio/core/dist/integration-engine";
|
|
4
4
|
type DataSourceDict = {
|
|
5
5
|
metroRailTrack: IDataSource<IMetroRailtrack[]>;
|
|
6
6
|
departuresDirections: IDataSource<IDeparturesDirection[]>;
|
|
7
|
-
notPublicVehicles: IDataSource<INotPublicVehicles>;
|
|
8
7
|
};
|
|
9
8
|
export declare class StaticDataSourceFactory {
|
|
10
9
|
private readonly dataSourceDict;
|
|
11
|
-
constructor(metroRailTrackDataSourceProvider: IDataSourceProvider<IMetroRailtrack[]>, departuresDirectionDataSourceProvider: IDataSourceProvider<IDeparturesDirection[]
|
|
10
|
+
constructor(metroRailTrackDataSourceProvider: IDataSourceProvider<IMetroRailtrack[]>, departuresDirectionDataSourceProvider: IDataSourceProvider<IDeparturesDirection[]>);
|
|
12
11
|
getDataSource<T extends keyof DataSourceDict>(descriptorProvider: T): DataSourceDict[T];
|
|
13
12
|
}
|
|
14
13
|
export {};
|
|
@@ -16,11 +16,10 @@ exports.StaticDataSourceFactory = void 0;
|
|
|
16
16
|
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
17
17
|
const RopidGtfsContainerToken_1 = require("../ioc/RopidGtfsContainerToken");
|
|
18
18
|
let StaticDataSourceFactory = class StaticDataSourceFactory {
|
|
19
|
-
constructor(metroRailTrackDataSourceProvider, departuresDirectionDataSourceProvider
|
|
19
|
+
constructor(metroRailTrackDataSourceProvider, departuresDirectionDataSourceProvider) {
|
|
20
20
|
this.dataSourceDict = {
|
|
21
21
|
metroRailTrack: metroRailTrackDataSourceProvider.getDataSource(),
|
|
22
22
|
departuresDirections: departuresDirectionDataSourceProvider.getDataSource(),
|
|
23
|
-
notPublicVehicles: notPublicVehiclesDataSourceProvider.getDataSource(),
|
|
24
23
|
};
|
|
25
24
|
}
|
|
26
25
|
getDataSource(descriptorProvider) {
|
|
@@ -32,7 +31,6 @@ exports.StaticDataSourceFactory = StaticDataSourceFactory = __decorate([
|
|
|
32
31
|
(0, tsyringe_1.injectable)(),
|
|
33
32
|
__param(0, (0, tsyringe_1.inject)(RopidGtfsContainerToken_1.RopidGtfsContainerToken.MetroRailTrackDataSourceProvider)),
|
|
34
33
|
__param(1, (0, tsyringe_1.inject)(RopidGtfsContainerToken_1.RopidGtfsContainerToken.DeparturesDirectionDataSourceProvider)),
|
|
35
|
-
|
|
36
|
-
__metadata("design:paramtypes", [Object, Object, Object])
|
|
34
|
+
__metadata("design:paramtypes", [Object, Object])
|
|
37
35
|
], StaticDataSourceFactory);
|
|
38
36
|
//# sourceMappingURL=StaticDataSourceFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StaticDataSourceFactory.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/datasources/StaticDataSourceFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,iEAAwE;AACxE,4EAAyE;
|
|
1
|
+
{"version":3,"file":"StaticDataSourceFactory.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/datasources/StaticDataSourceFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,iEAAwE;AACxE,4EAAyE;AAQlE,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAGhC,YAEI,gCAAwE,EAExE,qCAAkF;QAElF,IAAI,CAAC,cAAc,GAAG;YAClB,cAAc,EAAE,gCAAgC,CAAC,aAAa,EAAE;YAChE,oBAAoB,EAAE,qCAAqC,CAAC,aAAa,EAAE;SAC9E,CAAC;IACN,CAAC;IAEM,aAAa,CAAiC,kBAAqB;QACtE,OAAO,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;IACnD,CAAC;CACJ,CAAA;AAlBY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,qBAAU,GAAE;IAKJ,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,gCAAgC,CAAC,CAAA;IAEhE,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,qCAAqC,CAAC,CAAA;;GANjE,uBAAuB,CAkBnC"}
|
|
@@ -12,14 +12,12 @@ const RopidGtfsMetadataRepository_1 = require("../RopidGtfsMetadataRepository");
|
|
|
12
12
|
const RopidGTFSRoutesRepository_1 = require("../data-access/RopidGTFSRoutesRepository");
|
|
13
13
|
const RopidGtfsRepository_1 = require("../data-access/RopidGtfsRepository");
|
|
14
14
|
const BlockStopsRedisRepository_1 = require("../data-access/cache/BlockStopsRedisRepository");
|
|
15
|
-
const NotPublicVehiclesRedisRepository_1 = require("../data-access/cache/NotPublicVehiclesRedisRepository");
|
|
16
15
|
const PublicGtfsDepartureRepository_1 = require("../data-access/cache/PublicGtfsDepartureRepository");
|
|
17
16
|
const StaticFileRedisRepository_1 = require("../data-access/cache/StaticFileRedisRepository");
|
|
18
17
|
const precomputed_1 = require("../data-access/precomputed");
|
|
19
18
|
const StaticDataSourceFactory_1 = require("../datasources/StaticDataSourceFactory");
|
|
20
19
|
const DeparturesDirectionDataSourceProvider_1 = require("../datasources/static-data/DeparturesDirectionDataSourceProvider");
|
|
21
20
|
const MetroRailTrackDataSourceProvider_1 = require("../datasources/static-data/MetroRailTrackDataSourceProvider");
|
|
22
|
-
const NotPublicVehiclesDataSourceProvider_1 = require("../datasources/static-data/NotPublicVehiclesDataSourceProvider");
|
|
23
21
|
const DeparturePresetsFacade_1 = require("../facade/DeparturePresetsFacade");
|
|
24
22
|
const PublicDepartureCacheTransformation_1 = require("../transformations/PublicDepartureCacheTransformation");
|
|
25
23
|
const RopidGTFSTransformation_1 = require("../transformations/RopidGTFSTransformation");
|
|
@@ -45,12 +43,10 @@ exports.RopidGtfsContainer = RopidGtfsContainer;
|
|
|
45
43
|
//#endregion
|
|
46
44
|
//#region Datasources
|
|
47
45
|
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.BlockStopsRedisRepository, BlockStopsRedisRepository_1.BlockStopsRedisRepository);
|
|
48
|
-
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.NotPublicVehiclesRedisRepository, NotPublicVehiclesRedisRepository_1.NotPublicVehiclesRedisRepository);
|
|
49
46
|
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.DeparturesPresetsDataSource, DeparturesPresetsDatasource_1.DeparturesPresetsDataSource);
|
|
50
47
|
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.StaticDataSourceFactory, StaticDataSourceFactory_1.StaticDataSourceFactory);
|
|
51
48
|
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.MetroRailTrackDataSourceProvider, MetroRailTrackDataSourceProvider_1.MetroRailTrackDataSourceProvider);
|
|
52
49
|
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.DeparturesDirectionDataSourceProvider, DeparturesDirectionDataSourceProvider_1.DeparturesDirectionDataSourceProvider);
|
|
53
|
-
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.NotPublicVehiclesDataSourceProvider, NotPublicVehiclesDataSourceProvider_1.NotPublicVehiclesDataSourceProvider);
|
|
54
50
|
//#endregion
|
|
55
51
|
//#region Repositories
|
|
56
52
|
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.StaticFileRedisRepository, StaticFileRedisRepository_1.StaticFileRedisRepository).registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RopidGtfsRepository, RopidGtfsRepository_1.RopidGtfsRepository);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,qCAA0C;AAC1C,0IAAqI;AACrI,uEAA4C;AAC5C,qFAA8F;AAC9F,iEAAoF;AACpF,gEAA6D;AAC7D,wDAAqD;AACrD,gFAA6E;AAC7E,wFAAqF;AACrF,4EAAyE;AACzE,8FAA2F;AAC3F,
|
|
1
|
+
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,qCAA0C;AAC1C,0IAAqI;AACrI,uEAA4C;AAC5C,qFAA8F;AAC9F,iEAAoF;AACpF,gEAA6D;AAC7D,wDAAqD;AACrD,gFAA6E;AAC7E,wFAAqF;AACrF,4EAAyE;AACzE,8FAA2F;AAC3F,sGAAmG;AACnG,8FAA2F;AAC3F,4DAAkE;AAClE,oFAAiF;AACjF,4HAAyH;AACzH,kHAA+G;AAC/G,6EAA0E;AAC1E,8GAA2G;AAC3G,wFAAqF;AACrF,4GAAyG;AACzG,gHAA6G;AAC7G,0GAAuG;AACvG,iFAA8E;AAC9E,qGAAkG;AAClG,yHAAsH;AACtH,uFAAoF;AACpF,yHAAsH;AACtH,qHAAkH;AAClH,yGAAsG;AACtG,2FAAwF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,iDAAuB,CAAC,yBAAyB,EAAE,qDAAyB,CAAC,CAAC;AACnH,kBAAkB,CAAC,iBAAiB,CAChC,iDAAuB,CAAC,mCAAmC,EAC3D,yEAAmC,CACtC,CAAC;AACF,kBAAkB,CAAC,iBAAiB,CAAC,iDAAuB,CAAC,6BAA6B,EAAE,6DAA6B,CAAC,CAAC;AAC3H,kBAAkB,CAAC,iBAAiB,CAAC,iDAAuB,CAAC,gCAAgC,EAAE,mEAAgC,CAAC,CAAC;AACjI,kBAAkB,CAAC,iBAAiB,CAAC,iDAAuB,CAAC,kBAAkB,EAAE,uCAAkB,CAAC,CAAC;AACrG,kBAAkB,CAAC,iBAAiB,CAAC,iDAAuB,CAAC,eAAe,EAAE,iCAAe,CAAC,CAAC;AAC/F,YAAY;AAEZ,iBAAiB;AACjB,YAAY;AAEZ,eAAe;AACf,kBAAkB,CAAC,iBAAiB,CAAC,iDAAuB,CAAC,wBAAwB,EAAE,mDAAwB,CAAC,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
declare const RopidGtfsContainerToken: {
|
|
2
2
|
BlockStopsRedisRepository: symbol;
|
|
3
|
-
NotPublicVehiclesRedisRepository: symbol;
|
|
4
3
|
RopidGtfsMetadataRepository: symbol;
|
|
5
4
|
RopidGTFSRoutesRepository: symbol;
|
|
6
5
|
PrecomputedTablesFacade: symbol;
|
|
@@ -27,7 +26,6 @@ declare const RopidGtfsContainerToken: {
|
|
|
27
26
|
MetroRailtrackGPSRepository: symbol;
|
|
28
27
|
MetroRailTrackDataSourceProvider: symbol;
|
|
29
28
|
DeparturesDirectionDataSourceProvider: symbol;
|
|
30
|
-
NotPublicVehiclesDataSourceProvider: symbol;
|
|
31
29
|
SaveStaticDataTask: symbol;
|
|
32
30
|
DeparturesDirectionTransformation: symbol;
|
|
33
31
|
RopidDeparturesPresetsRopidGTFSStopsRepository: symbol;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RopidGtfsContainerToken = void 0;
|
|
4
4
|
const RopidGtfsContainerToken = {
|
|
5
5
|
BlockStopsRedisRepository: Symbol("BlockStopsRedisRepository"),
|
|
6
|
-
NotPublicVehiclesRedisRepository: Symbol("NotPublicVehiclesRedisRepository"),
|
|
7
6
|
RopidGtfsMetadataRepository: Symbol("RopidGtfsMetadataRepository"),
|
|
8
7
|
RopidGTFSRoutesRepository: Symbol("RopidGTFSRoutesRepository"),
|
|
9
8
|
PrecomputedTablesFacade: Symbol("PrecomputedTablesFacade"),
|
|
@@ -30,7 +29,6 @@ const RopidGtfsContainerToken = {
|
|
|
30
29
|
MetroRailtrackGPSRepository: Symbol("MetroRailtrackGPSRepository"),
|
|
31
30
|
MetroRailTrackDataSourceProvider: Symbol("MetroRailTrackDataSourceProvider"),
|
|
32
31
|
DeparturesDirectionDataSourceProvider: Symbol("DeparturesDirectionDataSourceProvider"),
|
|
33
|
-
NotPublicVehiclesDataSourceProvider: Symbol("NotPublicVehiclesDataSourceProvider"),
|
|
34
32
|
SaveStaticDataTask: Symbol("SaveStaticDataTask"),
|
|
35
33
|
DeparturesDirectionTransformation: Symbol("DeparturesDirectionTransformation"),
|
|
36
34
|
RopidDeparturesPresetsRopidGTFSStopsRepository: Symbol("RopidDeparturesPresetsRopidGTFSStopsRepository"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RopidGtfsContainerToken.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,uBAAuB,GAAG;IAC5B,yBAAyB,EAAE,MAAM,CAAC,2BAA2B,CAAC;IAC9D,
|
|
1
|
+
{"version":3,"file":"RopidGtfsContainerToken.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,uBAAuB,GAAG;IAC5B,yBAAyB,EAAE,MAAM,CAAC,2BAA2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uC,CAAC;IACtF,kBAAkB,EAAE,MAAM,CAAC,oBAAoB,CAAC;IAChD,iCAAiC,EAAE,MAAM,CAAC,mCAAmC,CAAC;IAC9E,8CAA8C,EAAE,MAAM,CAAC,gDAAgD,CAAC;IACxG,wBAAwB,EAAE,MAAM,CAAC,0BAA0B,CAAC;IAC5D,sBAAsB,EAAE,MAAM,CAAC,wBAAwB,CAAC;IACxD,eAAe,EAAE,MAAM,CAAC,iBAAiB,CAAC;CAC7C,CAAC;AAEO,0DAAuB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine/workers";
|
|
2
2
|
import { StaticDataSourceFactory } from "../../../datasources/StaticDataSourceFactory";
|
|
3
|
-
import { NotPublicVehiclesRedisRepository } from "../../../data-access/cache/NotPublicVehiclesRedisRepository";
|
|
4
3
|
import { DeparturesDirectionRepository } from "./data-access/DeparturesDirectionRepository";
|
|
5
4
|
import { MetroRailtrackDataTransformation } from "./transformations/MetroRailtrackDataTransformation";
|
|
6
5
|
import { MetroRailtrackGPSRepository } from "./data-access/MetroRailtrackGPSRepository";
|
|
@@ -11,12 +10,8 @@ export declare class SaveStaticDataTask extends AbstractEmptyTask {
|
|
|
11
10
|
private railtrackDataTransformation;
|
|
12
11
|
private railtrackGPSRepository;
|
|
13
12
|
private departuresDirectionTransformation;
|
|
14
|
-
private notPublicVehiclesRedisRepository;
|
|
15
13
|
readonly queueName = "saveStaticData";
|
|
16
14
|
readonly queueTtl: number;
|
|
17
|
-
constructor(staticDataSourceFactory: StaticDataSourceFactory, departuresDirectionRepository: DeparturesDirectionRepository, railtrackDataTransformation: MetroRailtrackDataTransformation, railtrackGPSRepository: MetroRailtrackGPSRepository, departuresDirectionTransformation: DeparturesDirectionTransformation
|
|
15
|
+
constructor(staticDataSourceFactory: StaticDataSourceFactory, departuresDirectionRepository: DeparturesDirectionRepository, railtrackDataTransformation: MetroRailtrackDataTransformation, railtrackGPSRepository: MetroRailtrackGPSRepository, departuresDirectionTransformation: DeparturesDirectionTransformation);
|
|
18
16
|
protected execute(): Promise<void>;
|
|
19
|
-
private saveDeparturesDirections;
|
|
20
|
-
private saveMetroRailTracks;
|
|
21
|
-
private saveNotPublicVehiclesConfig;
|
|
22
17
|
}
|
|
@@ -16,7 +16,6 @@ exports.SaveStaticDataTask = void 0;
|
|
|
16
16
|
const workers_1 = require("@golemio/core/dist/integration-engine/workers");
|
|
17
17
|
const StaticDataSourceFactory_1 = require("../../../datasources/StaticDataSourceFactory");
|
|
18
18
|
const RopidGtfsContainerToken_1 = require("../../../ioc/RopidGtfsContainerToken");
|
|
19
|
-
const NotPublicVehiclesRedisRepository_1 = require("../../../data-access/cache/NotPublicVehiclesRedisRepository");
|
|
20
19
|
const DeparturesDirectionRepository_1 = require("./data-access/DeparturesDirectionRepository");
|
|
21
20
|
const MetroRailtrackDataTransformation_1 = require("./transformations/MetroRailtrackDataTransformation");
|
|
22
21
|
const MetroRailtrackGPSRepository_1 = require("./data-access/MetroRailtrackGPSRepository");
|
|
@@ -25,64 +24,38 @@ const DeparturesDirectionTransformation_1 = require("./transformations/Departure
|
|
|
25
24
|
const constants_1 = require("../constants");
|
|
26
25
|
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
27
26
|
let SaveStaticDataTask = class SaveStaticDataTask extends workers_1.AbstractEmptyTask {
|
|
28
|
-
constructor(staticDataSourceFactory, departuresDirectionRepository, railtrackDataTransformation, railtrackGPSRepository, departuresDirectionTransformation
|
|
27
|
+
constructor(staticDataSourceFactory, departuresDirectionRepository, railtrackDataTransformation, railtrackGPSRepository, departuresDirectionTransformation) {
|
|
29
28
|
super(constants_1.TIMETABLE_WORKER_NAME);
|
|
30
29
|
this.staticDataSourceFactory = staticDataSourceFactory;
|
|
31
30
|
this.departuresDirectionRepository = departuresDirectionRepository;
|
|
32
31
|
this.railtrackDataTransformation = railtrackDataTransformation;
|
|
33
32
|
this.railtrackGPSRepository = railtrackGPSRepository;
|
|
34
33
|
this.departuresDirectionTransformation = departuresDirectionTransformation;
|
|
35
|
-
this.notPublicVehiclesRedisRepository = notPublicVehiclesRedisRepository;
|
|
36
34
|
this.queueName = "saveStaticData";
|
|
37
35
|
this.queueTtl = 5 * 60 * 1000; // 5 minutes
|
|
38
36
|
}
|
|
39
37
|
async execute() {
|
|
40
|
-
const results = await Promise.allSettled([
|
|
41
|
-
this.saveDeparturesDirections(),
|
|
42
|
-
this.saveMetroRailTracks(),
|
|
43
|
-
this.saveNotPublicVehiclesConfig(),
|
|
44
|
-
]);
|
|
45
|
-
const errors = results
|
|
46
|
-
.filter((result) => result.status === "rejected")
|
|
47
|
-
.map((result) => result.reason);
|
|
48
|
-
if (errors.length > 0) {
|
|
49
|
-
const errorMessages = errors.map((e, i) => `${i + 1}. ${e.message}`).join("; ");
|
|
50
|
-
throw new golemio_errors_1.GeneralError(`Failed to save ${errors.length} of 3 static data files: ${errorMessages}`, this.constructor.name);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
async saveDeparturesDirections() {
|
|
54
38
|
try {
|
|
55
39
|
const departuresDirections = await this.staticDataSourceFactory.getDataSource("departuresDirections").getAll();
|
|
56
40
|
const departuresDirectionsDto = this.departuresDirectionTransformation.transformArray(departuresDirections);
|
|
57
41
|
await this.departuresDirectionRepository.saveData(departuresDirectionsDto);
|
|
58
42
|
}
|
|
59
43
|
catch (err) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
44
|
+
if (err instanceof golemio_errors_1.AbstractGolemioError) {
|
|
45
|
+
throw err;
|
|
46
|
+
}
|
|
47
|
+
throw new golemio_errors_1.GeneralError("Error while refreshing departures directions", this.constructor.name, err);
|
|
63
48
|
}
|
|
64
|
-
}
|
|
65
|
-
async saveMetroRailTracks() {
|
|
66
49
|
try {
|
|
67
50
|
const metroRailTrack = await this.staticDataSourceFactory.getDataSource("metroRailTrack").getAll();
|
|
68
51
|
const railtrackGPSData = this.railtrackDataTransformation.transformArray(metroRailTrack);
|
|
69
52
|
await this.railtrackGPSRepository.saveData(railtrackGPSData);
|
|
70
53
|
}
|
|
71
54
|
catch (err) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
async saveNotPublicVehiclesConfig() {
|
|
78
|
-
try {
|
|
79
|
-
const notPublicVehiclesConfig = await this.staticDataSourceFactory.getDataSource("notPublicVehicles").getAll();
|
|
80
|
-
await this.notPublicVehiclesRedisRepository.saveConfig(notPublicVehiclesConfig);
|
|
81
|
-
}
|
|
82
|
-
catch (err) {
|
|
83
|
-
throw err instanceof golemio_errors_1.AbstractGolemioError
|
|
84
|
-
? err
|
|
85
|
-
: new golemio_errors_1.GeneralError("Error while refreshing not-public vehicles config", this.constructor.name, err);
|
|
55
|
+
if (err instanceof golemio_errors_1.AbstractGolemioError) {
|
|
56
|
+
throw err;
|
|
57
|
+
}
|
|
58
|
+
throw new golemio_errors_1.GeneralError("Error while refreshing metro rail tracks", this.constructor.name, err);
|
|
86
59
|
}
|
|
87
60
|
}
|
|
88
61
|
};
|
|
@@ -94,12 +67,10 @@ exports.SaveStaticDataTask = SaveStaticDataTask = __decorate([
|
|
|
94
67
|
__param(2, (0, tsyringe_1.inject)(RopidGtfsContainerToken_1.RopidGtfsContainerToken.MetroRailtrackDataTransformation)),
|
|
95
68
|
__param(3, (0, tsyringe_1.inject)(RopidGtfsContainerToken_1.RopidGtfsContainerToken.MetroRailtrackGPSRepository)),
|
|
96
69
|
__param(4, (0, tsyringe_1.inject)(RopidGtfsContainerToken_1.RopidGtfsContainerToken.DeparturesDirectionTransformation)),
|
|
97
|
-
__param(5, (0, tsyringe_1.inject)(RopidGtfsContainerToken_1.RopidGtfsContainerToken.NotPublicVehiclesRedisRepository)),
|
|
98
70
|
__metadata("design:paramtypes", [StaticDataSourceFactory_1.StaticDataSourceFactory,
|
|
99
71
|
DeparturesDirectionRepository_1.DeparturesDirectionRepository,
|
|
100
72
|
MetroRailtrackDataTransformation_1.MetroRailtrackDataTransformation,
|
|
101
73
|
MetroRailtrackGPSRepository_1.MetroRailtrackGPSRepository,
|
|
102
|
-
DeparturesDirectionTransformation_1.DeparturesDirectionTransformation
|
|
103
|
-
NotPublicVehiclesRedisRepository_1.NotPublicVehiclesRedisRepository])
|
|
74
|
+
DeparturesDirectionTransformation_1.DeparturesDirectionTransformation])
|
|
104
75
|
], SaveStaticDataTask);
|
|
105
76
|
//# sourceMappingURL=SaveStaticDataTask.js.map
|
package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/SaveStaticDataTask.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveStaticDataTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/SaveStaticDataTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2EAAkF;AAClF,0FAA6F;AAC7F,kFAAqF;AACrF
|
|
1
|
+
{"version":3,"file":"SaveStaticDataTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/SaveStaticDataTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2EAAkF;AAClF,0FAA6F;AAC7F,kFAAqF;AACrF,+FAA4F;AAC5F,yGAAsG;AACtG,2FAAwF;AACxF,iEAAwE;AACxE,2GAAwG;AACxG,4CAAqD;AACrD,6EAA8F;AAGvF,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,2BAAiB;IAIrD,YAEI,uBAAwD,EAExD,6BAAoE,EAEpE,2BAAqE,EAErE,sBAA2D,EAE3D,iCAA4E;QAE5E,KAAK,CAAC,iCAAqB,CAAC,CAAC;QAVrB,4BAAuB,GAAvB,uBAAuB,CAAyB;QAEhD,kCAA6B,GAA7B,6BAA6B,CAA+B;QAE5D,gCAA2B,GAA3B,2BAA2B,CAAkC;QAE7D,2BAAsB,GAAtB,sBAAsB,CAA6B;QAEnD,sCAAiC,GAAjC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BAAkB;IAD9B,IAAA,qBAAU,GAAE;IAMJ,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,uBAAuB,CAAC,CAAA;IAEvD,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,6BAA6B,CAAC,CAAA;IAE7D,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,gCAAgC,CAAC,CAAA;IAEhE,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,2BAA2B,CAAC,CAAA;IAE3D,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,iCAAiC,CAAC,CAAA;qCAPjC,iDAAuB;QAEjB,6DAA6B;QAE/B,mEAAgC;QAErC,yDAA2B;QAEhB,qEAAiC;GAdvE,kBAAkB,CA0C9B"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VPContainer = void 0;
|
|
4
4
|
const Di_1 = require("../../ioc/Di");
|
|
5
|
-
const NotPublicVehiclesRedisRepository_1 = require("../../ropid-gtfs/data-access/cache/NotPublicVehiclesRedisRepository");
|
|
6
5
|
const MetroRailtrackGPSRepository_1 = require("../../ropid-gtfs/workers/timetables/tasks/data-access/MetroRailtrackGPSRepository");
|
|
7
6
|
const RegionalBusRunsMessagesRepository_1 = require("../workers/runs/data-access/RegionalBusRunsMessagesRepository");
|
|
8
7
|
const RegionalBusCisCacheRepository_1 = require("../workers/runs/data-access/cache/RegionalBusCisCacheRepository");
|
|
@@ -65,7 +64,6 @@ VPContainer.register(VPContainerToken_1.VPContainerToken.PublicApiCacheRepositor
|
|
|
65
64
|
VPContainer.register(VPContainerToken_1.VPContainerToken.PublicStopTimeCacheRepository, PublicStopTimeCacheRepository_1.PublicStopTimeCacheRepository);
|
|
66
65
|
VPContainer.registerSingleton(VPContainerToken_1.VPContainerToken.MetroRailtrackGPSRepository, MetroRailtrackGPSRepository_1.MetroRailtrackGPSRepository);
|
|
67
66
|
VPContainer.registerSingleton(VPContainerToken_1.VPContainerToken.CachedMetroRailTrackLookup, CachedMetroRailtrackLookup_1.CachedMetroRailTrackLookup);
|
|
68
|
-
VPContainer.registerSingleton(VPContainerToken_1.VPContainerToken.NotPublicVehiclesRedisRepository, NotPublicVehiclesRedisRepository_1.NotPublicVehiclesRedisRepository);
|
|
69
67
|
//#endregion
|
|
70
68
|
//#region Transformations
|
|
71
69
|
VPContainer.register(VPContainerToken_1.VPContainerToken.DescriptorTransformation, DescriptorTransformation_1.DescriptorTransformation);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/integration-engine/vehicle-positions/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,qCAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/integration-engine/vehicle-positions/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,qCAA0C;AAC1C,mIAA8H;AAE9H,qHAAkH;AAClH,mHAAgH;AAChH,qHAAkH;AAClH,+EAA4E;AAC5E,mFAAgF;AAChF,iFAA8E;AAC9E,4FAAyF;AACzF,8FAA2F;AAC3F,4GAAyG;AACzG,sGAAmG;AACnG,kGAA+F;AAC/F,mGAAgG;AAChG,+GAA4G;AAC5G,iGAA8F;AAC9F,mFAAgF;AAChF,uFAAoF;AACpF,qFAAkF;AAClF,uHAAoH;AACpH,qHAAkH;AAClH,iIAA8H;AAC9H,0GAAuG;AACvG,wHAAqH;AACrH,kJAA+I;AAC/I,8FAA2F;AAC3F,wGAAqG;AACrG,sHAAmH;AACnH,8FAA2F;AAC3F,sHAAmH;AACnH,gIAA6H;AAC7H,0HAAuH;AACvH,sHAAmH;AACnH,4FAAyF;AACzF,8FAA2F;AAC3F,2HAAwH;AACxH,8HAA2H;AAC3H,4GAAyG;AACzG,+HAA4H;AAC5H,wGAAqG;AACrG,sHAAmH;AACnH,8GAA2G;AAC3G,0HAAuH;AACvH,yDAAsD;AAEtD,wBAAwB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yDAA2B,CAAC,CAAC"}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VPContainerToken = void 0;
|
|
4
4
|
const VPContainerToken = {
|
|
5
5
|
//#region Vehicle Positions
|
|
6
|
-
NotPublicVehiclesRedisRepository: Symbol("NotPublicVehiclesRedisRepository"),
|
|
7
6
|
TripRepository: Symbol("TripRepository"),
|
|
8
7
|
PublicStopTimeRepository: Symbol("PublicStopTimeRepository"),
|
|
9
8
|
PublicApiCacheRepository: Symbol("PublicApiCacheRepository"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VPContainerToken.js","sourceRoot":"","sources":["../../../../src/integration-engine/vehicle-positions/ioc/VPContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,gBAAgB,GAAG;IACrB,2BAA2B;IAC3B,
|
|
1
|
+
{"version":3,"file":"VPContainerToken.js","sourceRoot":"","sources":["../../../../src/integration-engine/vehicle-positions/ioc/VPContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,gBAAgB,GAAG;IACrB,2BAA2B;IAC3B,cAAc,EAAE,MAAM,CAAC,gBAAgB,CAAC;IACxC,wBAAwB,EAAE,MAAM,CAAC,0BAA0B,CAAC;IAC5D,wBAAwB,EAAE,MAAM,CAAC,0BAA0B,CAAC;IAC5D,6BAA6B,EAAE,MAAM,CAAC,+BAA+B,CAAC;IACtE,0BAA0B,EAAE,MAAM,CAAC,4BAA4B,CAAC;IAChE,2BAA2B,EAAE,MAAM,CAAC,6BAA6B,CAAC;IAClE,wBAAwB,EAAE,MAAM,CAAC,0BAA0B,CAAC;IAC5D,qBAAqB,EAAE,MAAM,CAAC,uBAAuB,CAAC;IACtD,0BAA0B,EAAE,MAAM,CAAC,4BAA4B,CAAC;IAChE,8BAA8B,EAAE,MAAM,CAAC,gCAAgC,CAAC;IACxE,uBAAuB,EAAE,MAAM,CAAC,yBAAyB,CAAC;IAC1D,gBAAgB,EAAE,MA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EAAE,MAAM,CAAC,kBAAkB,CAAC;IAC5C,sBAAsB,EAAE,MAAM,CAAC,wBAAwB,CAAC;IACxD,cAAc,EAAE,MAAM,CAAC,gBAAgB,CAAC;IACxC,YAAY;IAEZ,2BAA2B;IAE3B,oBAAoB;IACpB,2BAA2B,EAAE,MAAM,CAAC,6BAA6B,CAAC;IAClE,0BAA0B,EAAE,MAAM,CAAC,4BAA4B,CAAC;IAChE,YAAY;IAEZ,iBAAiB;IACjB,qBAAqB,EAAE,MAAM,CAAC,uBAAuB,CAAC;IACtD,kBAAkB,EAAE,MAAM,CAAC,oBAAoB,CAAC;IAChD,iBAAiB,EAAE,MAAM,CAAC,mBAAmB,CAAC;IAC9C,YAAY;IAEZ,YAAY;CACf,CAAC;AAEO,4CAAgB"}
|
package/dist/integration-engine/vehicle-positions/workers/runs/helpers/BusMessageFilter.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
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";
|
|
@@ -8,19 +7,14 @@ export declare class BusMessageFilter implements ICommonMessageFilter {
|
|
|
8
7
|
private logger;
|
|
9
8
|
private timestampValidator;
|
|
10
9
|
private config;
|
|
11
|
-
private notPublicVehiclesRepository;
|
|
12
10
|
private dppTestingBuses;
|
|
13
|
-
constructor(logger: ILogger, timestampValidator: TimestampValidator, config: ISimpleConfig
|
|
11
|
+
constructor(logger: ILogger, timestampValidator: TimestampValidator, config: ISimpleConfig);
|
|
14
12
|
/**
|
|
15
13
|
* Yield messages that are valid for processing (filter out internal bus lines and testing buses)
|
|
16
|
-
* - route id is a string of length 3 or more
|
|
17
|
-
* - route id is a number in range of trolleybus lines
|
|
18
|
-
*
|
|
19
|
-
* - OR registration number is in not-public vehicles whitelist (e.g., metro replacement buses)
|
|
20
|
-
* - filters out testing buses
|
|
21
|
-
*
|
|
22
|
-
* Sets isNotPublic flag on messages to avoid duplicate whitelist checks in processor
|
|
14
|
+
* - route id is a string of length 3 or more
|
|
15
|
+
* - route id is a number in range of bus and trolleybus lines
|
|
16
|
+
* - route id >= 100 (bus) ∪ [50, 69] (trolleybus)
|
|
23
17
|
*/
|
|
24
|
-
yieldFilteredMessages(messages: ICommonRunWithMessageDto[], timestamp: number):
|
|
18
|
+
yieldFilteredMessages(messages: ICommonRunWithMessageDto[], timestamp: number): Generator<ICommonRunWithMessageDto>;
|
|
25
19
|
private isTestingBus;
|
|
26
20
|
}
|
|
@@ -13,7 +13,6 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.BusMessageFilter = 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");
|
|
19
18
|
const VPContainerToken_1 = require("../../../ioc/VPContainerToken");
|
|
@@ -22,28 +21,19 @@ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
|
22
21
|
const TROLLEYBUS_ROUTE_ID_MIN = 50;
|
|
23
22
|
const TROLLEYBUS_ROUTE_ID_MAX = 69;
|
|
24
23
|
let BusMessageFilter = class BusMessageFilter {
|
|
25
|
-
constructor(logger, timestampValidator, config
|
|
24
|
+
constructor(logger, timestampValidator, config) {
|
|
26
25
|
this.logger = logger;
|
|
27
26
|
this.timestampValidator = timestampValidator;
|
|
28
27
|
this.config = config;
|
|
29
|
-
this.
|
|
30
|
-
this.dppTestingBuses = new Set(this.config.getValue("module.pid.vehicle-positions.dppTestingBuses.*", []));
|
|
28
|
+
this.dppTestingBuses = this.config.getValue("module.pid.vehicle-positions.dppTestingBuses.*", []);
|
|
31
29
|
}
|
|
32
30
|
/**
|
|
33
31
|
* Yield messages that are valid for processing (filter out internal bus lines and testing buses)
|
|
34
|
-
* - route id is a string of length 3 or more
|
|
35
|
-
* - route id is a number in range of trolleybus lines
|
|
36
|
-
*
|
|
37
|
-
* - OR registration number is in not-public vehicles whitelist (e.g., metro replacement buses)
|
|
38
|
-
* - filters out testing buses
|
|
39
|
-
*
|
|
40
|
-
* Sets isNotPublic flag on messages to avoid duplicate whitelist checks in processor
|
|
32
|
+
* - route id is a string of length 3 or more
|
|
33
|
+
* - route id is a number in range of bus and trolleybus lines
|
|
34
|
+
* - route id >= 100 (bus) ∪ [50, 69] (trolleybus)
|
|
41
35
|
*/
|
|
42
|
-
|
|
43
|
-
// Load config once for the entire batch to avoid multiple Redis calls
|
|
44
|
-
const { road: { registrationNumbers }, routeIds, } = await this.notPublicVehiclesRepository.getConfig();
|
|
45
|
-
const whitelistedRegistrationNumbers = new Set(registrationNumbers);
|
|
46
|
-
const whitelistedRouteNames = new Set(routeIds);
|
|
36
|
+
*yieldFilteredMessages(messages, timestamp) {
|
|
47
37
|
for (const message of messages) {
|
|
48
38
|
const { run } = message;
|
|
49
39
|
if (!this.timestampValidator.isTimestampValid(timestamp, message.run_message.actual_stop_timestamp_real.toString())) {
|
|
@@ -52,41 +42,25 @@ let BusMessageFilter = class BusMessageFilter {
|
|
|
52
42
|
` is not valid for line ${message.run.line_short_name}, run ${message.run.run_number}`, this.constructor.name, undefined, undefined, "pid"));
|
|
53
43
|
continue;
|
|
54
44
|
}
|
|
55
|
-
const isNotPublicByRegistration = whitelistedRegistrationNumbers.has(run.registration_number);
|
|
56
|
-
const isNotPublicByRouteName = whitelistedRouteNames.has(run.line_short_name);
|
|
57
|
-
const isNotPublicVehicle = isNotPublicByRegistration || isNotPublicByRouteName;
|
|
58
|
-
if (isNotPublicVehicle) {
|
|
59
|
-
message.isNotPublic = true;
|
|
60
|
-
yield message;
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
// Regular scheduled buses require tjr (scheduled timestamp)
|
|
64
|
-
if (!message.run_message.actual_stop_timestamp_scheduled) {
|
|
65
|
-
this.logger.info(`Skipping bus without scheduled timestamp (tjr) - line ${run.line_short_name}, run ${run.run_number}`);
|
|
66
|
-
continue;
|
|
67
|
-
}
|
|
68
45
|
if (run.route_id.length > 2) {
|
|
69
46
|
if (this.isTestingBus(message.run.registration_number)) {
|
|
70
|
-
this.logger.info(`Testing bus ${message.run.registration_number} was
|
|
47
|
+
this.logger.info(`Testing bus ${message.run.registration_number} was filterd out`);
|
|
71
48
|
continue;
|
|
72
49
|
}
|
|
73
|
-
message.isNotPublic = false;
|
|
74
50
|
yield message;
|
|
75
51
|
continue;
|
|
76
52
|
}
|
|
77
|
-
// Trolleybus (route_id in range [50-69])
|
|
78
53
|
const routeId = Number.parseInt(run.route_id);
|
|
79
54
|
if (Number.isNaN(routeId) || routeId < TROLLEYBUS_ROUTE_ID_MIN || routeId > TROLLEYBUS_ROUTE_ID_MAX) {
|
|
80
55
|
this.logger.info(`${this.constructor.name}: route id ${routeId} is invalid or out of range`);
|
|
81
56
|
this.logger.debug(message);
|
|
82
57
|
continue;
|
|
83
58
|
}
|
|
84
|
-
message.isNotPublic = false;
|
|
85
59
|
yield message;
|
|
86
60
|
}
|
|
87
61
|
}
|
|
88
62
|
isTestingBus(reqNumber) {
|
|
89
|
-
return this.dppTestingBuses.
|
|
63
|
+
return this.dppTestingBuses.includes(reqNumber);
|
|
90
64
|
}
|
|
91
65
|
};
|
|
92
66
|
exports.BusMessageFilter = BusMessageFilter;
|
|
@@ -95,7 +69,6 @@ exports.BusMessageFilter = BusMessageFilter = __decorate([
|
|
|
95
69
|
__param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
|
|
96
70
|
__param(1, (0, tsyringe_1.inject)(VPContainerToken_1.VPContainerToken.TimestampValidator)),
|
|
97
71
|
__param(2, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.SimpleConfig)),
|
|
98
|
-
|
|
99
|
-
__metadata("design:paramtypes", [Object, TimestampValidator_1.TimestampValidator, Object, NotPublicVehiclesRedisRepository_1.NotPublicVehiclesRedisRepository])
|
|
72
|
+
__metadata("design:paramtypes", [Object, TimestampValidator_1.TimestampValidator, Object])
|
|
100
73
|
], BusMessageFilter);
|
|
101
74
|
//# sourceMappingURL=BusMessageFilter.js.map
|
package/dist/integration-engine/vehicle-positions/workers/runs/helpers/BusMessageFilter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BusMessageFilter.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/helpers/BusMessageFilter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,
|
|
1
|
+
{"version":3,"file":"BusMessageFilter.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/helpers/BusMessageFilter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,wEAAqE;AAErE,iEAAwE;AAExE,oEAA8E;AAC9E,6DAA0D;AAC1D,6EAAwE;AAGxE,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAG5B,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAEzB,YACsC,MAAe,EACI,kBAAsC,EACnD,MAAqB;QAF3B,WAAM,GAAN,MAAM,CAAS;QACI,uBAAkB,GAAlB,kBAAkB,CAAoB;QACnD,WAAM,GAAN,MAAM,CAAe;QAE7D,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,gDAAgD,EAAE,EAAE,CAAa,CAAC;IAClH,CAAC;IAED;;;;;OAKG;I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OAAO,6BAA6B,CAAC,CAAC;gBAC7F,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC3B,SAAS;YACb,CAAC;YAED,MAAM,OAAO,CAAC;QAClB,CAAC;IACL,CAAC;IAEO,YAAY,CAAC,SAAiB;QAClC,OAAO,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;CACJ,CAAA;AAzDY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,qBAAU,GAAE;IAIJ,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;IACxB,WAAA,IAAA,iBAAM,EAAC,mCAAgB,CAAC,kBAAkB,CAAC,CAAA;IAC3C,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,YAAY,CAAC,CAAA;6CAD0C,uCAAkB;GAJtF,gBAAgB,CAyD5B"}
|
package/dist/integration-engine/vehicle-positions/workers/runs/helpers/CommonMessageProcessor.d.ts
CHANGED
|
@@ -5,10 +5,7 @@ export declare class CommonMessageProcessor {
|
|
|
5
5
|
private logger;
|
|
6
6
|
constructor(runsRepository: CommonRunsRepository);
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @param element - The run with message data (already filtered, with isNotPublic flag set)
|
|
11
|
-
* @param firstMessageCreatedAt - Timestamp of the first message in the batch
|
|
8
|
+
* Create/update and process transformed run
|
|
12
9
|
*/
|
|
13
10
|
processTransformedRun: (element: ICommonRunWithMessageDto, firstMessageCreatedAt?: number) => Promise<void>;
|
|
14
11
|
private logElementIssues;
|
package/dist/integration-engine/vehicle-positions/workers/runs/helpers/CommonMessageProcessor.js
CHANGED
|
@@ -7,46 +7,33 @@ const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
|
7
7
|
const config_1 = require("@golemio/core/dist/integration-engine/config");
|
|
8
8
|
const queueprocessors_1 = require("@golemio/core/dist/integration-engine/queueprocessors");
|
|
9
9
|
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
10
|
+
const const_1 = require("../../../../../const");
|
|
10
11
|
const ONE_HOUR_IN_MILLIS = 60 * 60 * 1000;
|
|
11
12
|
const MIN_HOURS_DIFF_TO_LOG = 22;
|
|
12
13
|
class CommonMessageProcessor {
|
|
13
14
|
constructor(runsRepository) {
|
|
14
15
|
this.runsRepository = runsRepository;
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* @param element - The run with message data (already filtered, with isNotPublic flag set)
|
|
19
|
-
* @param firstMessageCreatedAt - Timestamp of the first message in the batch
|
|
17
|
+
* Create/update and process transformed run
|
|
20
18
|
*/
|
|
21
19
|
this.processTransformedRun = async (element, firstMessageCreatedAt) => {
|
|
22
20
|
this.logElementIssues(element);
|
|
23
21
|
const record = await this.runsRepository.getRunRecordForUpdate(element.run);
|
|
24
|
-
// Read flag set by filter (avoids duplicate whitelist check)
|
|
25
|
-
const isNotPublic = element.isNotPublic === true ? true : undefined;
|
|
26
22
|
let outputMsg;
|
|
27
23
|
if (record) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (!isNotPublic) {
|
|
35
|
-
const lastRecordMessage = await this.runsRepository["runsMessagesRepository"].getLastMessage(record.id);
|
|
36
|
-
if (!lastRecordMessage || !lastRecordMessage.actual_stop_timestamp_scheduled) {
|
|
37
|
-
// Cannot process scheduled vehicle without timestamp
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
element.run_message.actual_stop_timestamp_scheduled = lastRecordMessage.actual_stop_timestamp_scheduled;
|
|
41
|
-
}
|
|
42
|
-
// If IS a not-public vehicle, continue without timestamp (this is expected)
|
|
24
|
+
if (!element.run_message.actual_stop_timestamp_scheduled &&
|
|
25
|
+
!const_1.ArrayNotPublicRegistrationNumbers.includes(element.run.registration_number)) {
|
|
26
|
+
const lastRecordMessage = await this.runsRepository["runsMessagesRepository"].getLastMessage(record.id);
|
|
27
|
+
if (!lastRecordMessage || !lastRecordMessage.actual_stop_timestamp_scheduled)
|
|
28
|
+
return;
|
|
29
|
+
element.run_message.actual_stop_timestamp_scheduled = lastRecordMessage.actual_stop_timestamp_scheduled;
|
|
43
30
|
}
|
|
44
31
|
outputMsg = await this.runsRepository.updateAndAssociate(element, record.id);
|
|
45
32
|
}
|
|
46
33
|
else {
|
|
47
34
|
outputMsg = await this.runsRepository.createAndAssociate(element);
|
|
48
35
|
}
|
|
49
|
-
await queueprocessors_1.QueueManager.sendMessageToExchange(`${config_1.config.RABBIT_EXCHANGE_NAME}.${vehicle_positions_1.VehiclePositions.name.toLowerCase()}`, "updateRunsGTFSTripId",
|
|
36
|
+
await queueprocessors_1.QueueManager.sendMessageToExchange(`${config_1.config.RABBIT_EXCHANGE_NAME}.${vehicle_positions_1.VehiclePositions.name.toLowerCase()}`, "updateRunsGTFSTripId", outputMsg, { timestamp: firstMessageCreatedAt });
|
|
50
37
|
};
|
|
51
38
|
this.logger = Di_1.PidContainer.resolve(CoreToken_1.CoreToken.Logger);
|
|
52
39
|
}
|