@golemio/pid 2.12.10 → 2.12.11-dev.1273352315
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/db/example/12_metro_line_A_gtfs_trips.sql +1 -2
- package/db/example/15_vehicle_descriptors.sql +3 -3
- package/db/example/redis/publicDepartureBoardsMock.json +13 -0
- package/db/example/redis/publicVehiclePositionsMock.json +24 -0
- package/db/migrations/postgresql/20240418133218-detailed-stop-times.js +53 -0
- package/db/migrations/postgresql/20240424122841-delay-at-past-stops-release-part-1.js +53 -0
- package/db/migrations/postgresql/sqls/20240418133218-detailed-stop-times-down.sql +263 -0
- package/db/migrations/postgresql/sqls/20240418133218-detailed-stop-times-up.sql +174 -0
- package/db/migrations/postgresql/sqls/20240424122841-delay-at-past-stops-release-part-1-down.sql +1 -0
- package/db/migrations/postgresql/sqls/20240424122841-delay-at-past-stops-release-part-1-up.sql +98 -0
- package/dist/integration-engine/ropid-gtfs/RopidGTFSTripsModel.js +4 -0
- package/dist/integration-engine/ropid-gtfs/RopidGTFSTripsModel.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.d.ts +4 -3
- package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.js +8 -6
- package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/cache/PublicGtfsDepartureRepository.d.ts +14 -0
- package/dist/integration-engine/ropid-gtfs/data-access/cache/PublicGtfsDepartureRepository.js +82 -0
- package/dist/integration-engine/ropid-gtfs/data-access/cache/PublicGtfsDepartureRepository.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.d.ts +10 -2
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.js +81 -10
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/interfaces/IPublicDepartureDto.d.ts +12 -0
- package/dist/{schema-definitions/vehicle-positions/models/views/interfaces/IStopTimeDelayPredictionDto.js → integration-engine/ropid-gtfs/interfaces/IPublicDepartureDto.js} +1 -1
- package/dist/integration-engine/ropid-gtfs/interfaces/IPublicDepartureDto.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/interfaces/TripModelInterfaces.d.ts +1 -0
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js +10 -0
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.d.ts +4 -0
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js +4 -0
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.d.ts +7 -0
- package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js +36 -0
- package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.d.ts +2 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js +9 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/constants.d.ts +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/constants.js +5 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/constants.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js +4 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask.d.ts +21 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask.js +102 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.d.ts +3 -2
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js +9 -7
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/interfaces/IRefreshPublicDepartureParams.d.ts +4 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/interfaces/IRefreshPublicDepartureParams.js +3 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/interfaces/IRefreshPublicDepartureParams.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/RefreshPublicDepartureSchema.d.ts +5 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/RefreshPublicDepartureSchema.js +31 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/RefreshPublicDepartureSchema.js.map +1 -0
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.d.ts +1 -0
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.js +30 -12
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusMessageFilter.d.ts +1 -4
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusMessageFilter.js +5 -21
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusMessageFilter.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.d.ts +0 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js +4 -21
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicApiCacheRepository.js +6 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicApiCacheRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicStopTimeCacheRepository.d.ts +4 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicStopTimeCacheRepository.js +39 -2
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicStopTimeCacheRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicStopTimeCacheTask.js +3 -0
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicStopTimeCacheTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.d.ts +3 -6
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js +8 -19
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js.map +1 -1
- package/dist/output-gateway/index.js.map +1 -1
- package/dist/output-gateway/pid/helpers/DepartureBoardMapper.js +2 -1
- package/dist/output-gateway/pid/helpers/DepartureBoardMapper.js.map +1 -1
- package/dist/output-gateway/public/controllers/v1/PublicDepartureBoardsController.d.ts +8 -0
- package/dist/output-gateway/public/controllers/v1/PublicDepartureBoardsController.js +65 -0
- package/dist/output-gateway/public/controllers/v1/PublicDepartureBoardsController.js.map +1 -0
- package/dist/output-gateway/public/controllers/v1/interfaces/PublicParamsInterfaces.d.ts +10 -0
- package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.d.ts +11 -0
- package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js +72 -0
- package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js.map +1 -0
- package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.d.ts +1 -0
- package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.js +22 -2
- package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.js.map +1 -1
- package/dist/output-gateway/public/domain/IPublicDepartureTransformInputDto.d.ts +9 -0
- package/dist/output-gateway/public/domain/IPublicDepartureTransformInputDto.js +3 -0
- package/dist/output-gateway/public/domain/IPublicDepartureTransformInputDto.js.map +1 -0
- package/dist/output-gateway/public/domain/PublicApiDepartureInterfaces.d.ts +34 -0
- package/dist/output-gateway/public/domain/PublicApiDepartureInterfaces.js +3 -0
- package/dist/output-gateway/public/domain/PublicApiDepartureInterfaces.js.map +1 -0
- package/dist/output-gateway/public/domain/repository/IGtfsDepartureRepository.d.ts +4 -0
- package/dist/output-gateway/public/domain/repository/IGtfsDepartureRepository.js +3 -0
- package/dist/output-gateway/public/domain/repository/IGtfsDepartureRepository.js.map +1 -0
- package/dist/output-gateway/public/domain/repository/IVehiclePositionsRepository.d.ts +1 -0
- package/dist/output-gateway/public/ioc/Di.js +8 -0
- package/dist/output-gateway/public/ioc/Di.js.map +1 -1
- package/dist/output-gateway/public/ioc/OgModuleToken.d.ts +2 -0
- package/dist/output-gateway/public/ioc/OgModuleToken.js +2 -0
- package/dist/output-gateway/public/ioc/OgModuleToken.js.map +1 -1
- package/dist/output-gateway/public/routers/v1/PublicDeparturesRouter.d.ts +10 -0
- package/dist/output-gateway/public/routers/v1/PublicDeparturesRouter.js +28 -0
- package/dist/output-gateway/public/routers/v1/PublicDeparturesRouter.js.map +1 -0
- package/dist/output-gateway/public/routers/v1/{PublicRouter.d.ts → PublicVehiclePositionsRouter.d.ts} +3 -3
- package/dist/output-gateway/public/routers/v1/{PublicRouter.js → PublicVehiclePositionsRouter.js} +8 -8
- package/dist/output-gateway/public/routers/v1/PublicVehiclePositionsRouter.js.map +1 -0
- package/dist/output-gateway/public/routers/v1/helpers/CustomStopIdGroupValidator.d.ts +5 -0
- package/dist/output-gateway/public/routers/v1/helpers/CustomStopIdGroupValidator.js +42 -0
- package/dist/output-gateway/public/routers/v1/helpers/CustomStopIdGroupValidator.js.map +1 -0
- package/dist/output-gateway/public/service/facade/DepartureBoardFacade.d.ts +17 -0
- package/dist/output-gateway/public/service/facade/DepartureBoardFacade.js +117 -0
- package/dist/output-gateway/public/service/facade/DepartureBoardFacade.js.map +1 -0
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.d.ts +1 -0
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js +5 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js.map +1 -1
- package/dist/output-gateway/public/service/transformations/PublicDepartureTransformation.d.ts +34 -0
- package/dist/output-gateway/public/service/transformations/PublicDepartureTransformation.js +54 -0
- package/dist/output-gateway/public/service/transformations/PublicDepartureTransformation.js.map +1 -0
- package/dist/output-gateway/shared/DepartureCalculator.d.ts +10 -0
- package/dist/output-gateway/shared/DepartureCalculator.js +26 -0
- package/dist/output-gateway/shared/DepartureCalculator.js.map +1 -0
- package/dist/output-gateway/shared/RopidRouterUtils.d.ts +2 -1
- package/dist/output-gateway/shared/RopidRouterUtils.js +4 -3
- package/dist/output-gateway/shared/RopidRouterUtils.js.map +1 -1
- package/dist/schema-definitions/ropid-gtfs/redis/const.d.ts +1 -0
- package/dist/schema-definitions/ropid-gtfs/redis/const.js +5 -0
- package/dist/schema-definitions/ropid-gtfs/redis/const.js.map +1 -0
- package/dist/schema-definitions/ropid-gtfs/redis/interfaces/IDelayComputationDto.d.ts +1 -0
- package/dist/schema-definitions/ropid-gtfs/redis/interfaces/IPublicGtfsDepartureCacheDto.d.ts +12 -0
- package/dist/schema-definitions/ropid-gtfs/redis/interfaces/IPublicGtfsDepartureCacheDto.js +3 -0
- package/dist/schema-definitions/ropid-gtfs/redis/interfaces/IPublicGtfsDepartureCacheDto.js.map +1 -0
- package/dist/schema-definitions/ropid-gtfs/redis/schemas/DelayComputationDtoSchema.js +1 -0
- package/dist/schema-definitions/ropid-gtfs/redis/schemas/DelayComputationDtoSchema.js.map +1 -1
- package/dist/schema-definitions/ropid-gtfs/redis/schemas/PublicGtfsDepartureDtoSchema.d.ts +4 -0
- package/dist/schema-definitions/ropid-gtfs/redis/schemas/PublicGtfsDepartureDtoSchema.js +69 -0
- package/dist/schema-definitions/ropid-gtfs/redis/schemas/PublicGtfsDepartureDtoSchema.js.map +1 -0
- package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.d.ts +3 -0
- package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.js +12 -0
- package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/models/views/index.d.ts +0 -1
- package/dist/schema-definitions/vehicle-positions/models/views/index.js +0 -1
- package/dist/schema-definitions/vehicle-positions/models/views/index.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/models/views/interfaces/IPublicStopTimeDto.d.ts +3 -0
- package/dist/schema-definitions/vehicle-positions/redis/interfaces/IPublicStopTimeCacheDto.d.ts +3 -0
- package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicStopTimeCacheDtoSchema.js +26 -1
- package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicStopTimeCacheDtoSchema.js.map +1 -1
- package/docs/implementation_documentation.md +26 -0
- package/docs/openapi-output.yaml +234 -0
- package/package.json +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/StopTimeDelayPredictionRepository.d.ts +0 -7
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/StopTimeDelayPredictionRepository.js +0 -19
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/StopTimeDelayPredictionRepository.js.map +0 -1
- package/dist/output-gateway/public/routers/v1/PublicRouter.js.map +0 -1
- package/dist/schema-definitions/vehicle-positions/models/views/StopTimeDelayPredictionModel.d.ts +0 -13
- package/dist/schema-definitions/vehicle-positions/models/views/StopTimeDelayPredictionModel.js +0 -41
- package/dist/schema-definitions/vehicle-positions/models/views/StopTimeDelayPredictionModel.js.map +0 -1
- package/dist/schema-definitions/vehicle-positions/models/views/interfaces/IStopTimeDelayPredictionDto.d.ts +0 -9
- package/dist/schema-definitions/vehicle-positions/models/views/interfaces/IStopTimeDelayPredictionDto.js.map +0 -1
package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IPublicGtfsDepartureCacheDto } from "../../../schema-definitions/ropid-gtfs/redis/interfaces/IPublicGtfsDepartureCacheDto";
|
|
2
|
+
import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
|
|
3
|
+
import { IPublicDepartureDto } from "../interfaces/IPublicDepartureDto";
|
|
4
|
+
export declare class PublicDepartureCacheTransformation extends AbstractTransformation<IPublicDepartureDto, IPublicGtfsDepartureCacheDto> {
|
|
5
|
+
name: string;
|
|
6
|
+
protected transformInternal: (inputDto: IPublicDepartureDto) => IPublicGtfsDepartureCacheDto;
|
|
7
|
+
}
|
package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PublicDepartureCacheTransformation = void 0;
|
|
10
|
+
const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
|
|
11
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
12
|
+
let PublicDepartureCacheTransformation = exports.PublicDepartureCacheTransformation = class PublicDepartureCacheTransformation extends AbstractTransformation_1.AbstractTransformation {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.name = "PublicDepartureCacheTransformation";
|
|
16
|
+
this.transformInternal = (inputDto) => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const outputDto = {
|
|
19
|
+
stop_id: inputDto.stop_id,
|
|
20
|
+
departure_datetime: inputDto.departure_datetime.toISOString(),
|
|
21
|
+
arrival_datetime: (_b = (_a = inputDto.arrival_datetime) === null || _a === void 0 ? void 0 : _a.toISOString()) !== null && _b !== void 0 ? _b : null,
|
|
22
|
+
route_short_name: inputDto.route_short_name,
|
|
23
|
+
route_type: inputDto.route_type,
|
|
24
|
+
trip_id: inputDto.trip_id,
|
|
25
|
+
stop_sequence: inputDto.stop_sequence,
|
|
26
|
+
platform_code: inputDto.platform_code,
|
|
27
|
+
trip_headsign: inputDto.trip_headsign,
|
|
28
|
+
};
|
|
29
|
+
return outputDto;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.PublicDepartureCacheTransformation = PublicDepartureCacheTransformation = __decorate([
|
|
34
|
+
(0, tsyringe_1.injectable)()
|
|
35
|
+
], PublicDepartureCacheTransformation);
|
|
36
|
+
//# sourceMappingURL=PublicDepartureCacheTransformation.js.map
|
package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublicDepartureCacheTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.ts"],"names":[],"mappings":";;;;;;;;;AACA,6GAA0G;AAC1G,iEAAgE;AAIzD,IAAM,kCAAkC,gDAAxC,MAAM,kCAAmC,SAAQ,+CAGvD;IAHM;;QAII,SAAI,GAAG,oCAAoC,CAAC;QAEzC,sBAAiB,GAAG,CAAC,QAA6B,EAAE,EAAE;;YAC5D,MAAM,SAAS,GAAiC;gBAC5C,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB,CAAC,WAAW,EAAE;gBAC7D,gBAAgB,EAAE,MAAA,MAAA,QAAQ,CAAC,gBAAgB,0CAAE,WAAW,EAAE,mCAAI,IAAI;gBAClE,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;gBAC3C,UAAU,EAAE,QAAQ,CAAC,UAAU;gBAC/B,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,aAAa,EAAE,QAAQ,CAAC,aAAa;gBACrC,aAAa,EAAE,QAAQ,CAAC,aAAa;gBACrC,aAAa,EAAE,QAAQ,CAAC,aAAa;aACxC,CAAC;YAEF,OAAO,SAAS,CAAC;QACrB,CAAC,CAAC;IACN,CAAC;CAAA,CAAA;6CArBY,kCAAkC;IAD9C,IAAA,qBAAU,GAAE;GACA,kCAAkC,CAqB9C"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { AbstractWorker } from "@golemio/core/dist/integration-engine/workers";
|
|
1
|
+
import { AbstractTask, AbstractWorker } from "@golemio/core/dist/integration-engine/workers";
|
|
2
2
|
export declare class TimetableWorker extends AbstractWorker {
|
|
3
3
|
protected name: string;
|
|
4
4
|
constructor();
|
|
5
|
+
registerTask: (task: AbstractTask<any>) => void;
|
|
5
6
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TimetableWorker = void 0;
|
|
4
|
+
const Di_1 = require("../../ioc/Di");
|
|
5
|
+
const RopidGtfsContainerToken_1 = require("../../ioc/RopidGtfsContainerToken");
|
|
4
6
|
const workers_1 = require("@golemio/core/dist/integration-engine/workers");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
5
8
|
const CheckForNewDataTask_1 = require("./tasks/CheckForNewDataTask");
|
|
6
9
|
const CheckSavedRowsAndReplaceTablesTask_1 = require("./tasks/CheckSavedRowsAndReplaceTablesTask");
|
|
7
10
|
const DownloadDatasetsTask_1 = require("./tasks/DownloadDatasetsTask");
|
|
@@ -10,8 +13,13 @@ const TransformAndSaveDataTask_1 = require("./tasks/TransformAndSaveDataTask");
|
|
|
10
13
|
class TimetableWorker extends workers_1.AbstractWorker {
|
|
11
14
|
constructor() {
|
|
12
15
|
super();
|
|
13
|
-
this.name =
|
|
16
|
+
this.name = constants_1.TIMETABLE_WORKER_NAME;
|
|
17
|
+
this.registerTask = (task) => {
|
|
18
|
+
super.registerTask(task);
|
|
19
|
+
task.queuePrefix = this.getQueuePrefix();
|
|
20
|
+
};
|
|
14
21
|
// Register tasks
|
|
22
|
+
this.registerTask(Di_1.RopidGtfsContainer.resolve(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RefreshPublicGtfsDepartureCacheTask));
|
|
15
23
|
this.registerTask(new CheckForNewDataTask_1.CheckForNewDataTask(this.getQueuePrefix()));
|
|
16
24
|
this.registerTask(new CheckSavedRowsAndReplaceTablesTask_1.CheckSavedRowsAndReplaceTablesTask(this.getQueuePrefix()));
|
|
17
25
|
this.registerTask(new DownloadDatasetsTask_1.DownloadDatasetsTask(this.getQueuePrefix()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimetableWorker.js","sourceRoot":"","sources":["../../../../../src/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"TimetableWorker.js","sourceRoot":"","sources":["../../../../../src/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.ts"],"names":[],"mappings":";;;AAAA,qCAA2D;AAC3D,+EAAqF;AACrF,2EAA6F;AAC7F,2CAAoD;AACpD,qEAAkE;AAClE,mGAAgG;AAChG,uEAAoE;AACpE,uFAAoF;AAEpF,+EAA4E;AAE5E,MAAa,eAAgB,SAAQ,wBAAc;IAG/C;QACI,KAAK,EAAE,CAAC;QAHF,SAAI,GAAG,iCAAqB,CAAC;QAkBhC,iBAAY,GAAG,CAAC,IAAuB,EAAQ,EAAE;YACpD,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YACzB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAC7C,CAAC,CAAC;QAhBE,iBAAiB;QACjB,IAAI,CAAC,YAAY,CACb,uBAAkB,CAAC,OAAO,CACtB,iDAAuB,CAAC,mCAAmC,CAC9D,CACJ,CAAC;QACF,IAAI,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QAClE,IAAI,CAAC,YAAY,CAAC,IAAI,uEAAkC,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QACjF,IAAI,CAAC,YAAY,CAAC,IAAI,2CAAoB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QACnE,IAAI,CAAC,YAAY,CAAC,IAAI,2DAA4B,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QAC3E,IAAI,CAAC,YAAY,CAAC,IAAI,mDAAwB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;IAC3E,CAAC;CAMJ;AAvBD,0CAuBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TIMETABLE_WORKER_NAME = "RopidGtfs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/integration-engine/ropid-gtfs/workers/timetables/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG,WAAW,CAAC"}
|
|
@@ -54,7 +54,11 @@ class CheckSavedRowsAndReplaceTablesTask extends workers_1.AbstractTask {
|
|
|
54
54
|
yield this.dataCacheManager.cleanCache();
|
|
55
55
|
yield this.ropidGtfsRepository.cleanTmpAndOldTables();
|
|
56
56
|
const rabbitExchangeName = this.config.getValue("env.RABBIT_EXCHANGE_NAME");
|
|
57
|
+
// send message to VP worker to refresh GTFS trip data (see task description for more info)
|
|
57
58
|
yield integration_engine_1.QueueManager.sendMessageToExchange(`${rabbitExchangeName}.${constants_1.WORKER_NAME.toLowerCase()}`, "refreshGTFSTripData", {});
|
|
59
|
+
// send message to GTFS timetable worker to refresh public GTFS departure cache
|
|
60
|
+
// so that the new data is available in the public (Lítačka) API
|
|
61
|
+
yield integration_engine_1.QueueManager.sendMessageToExchange(this.queuePrefix, "refreshPublicGtfsDepartureCache", {});
|
|
58
62
|
}
|
|
59
63
|
catch (err) {
|
|
60
64
|
yield this.retryOrThrow(notDeployedVersions, data, err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckSavedRowsAndReplaceTablesTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,wEAA2E;AAC3E,kFAAqF;AACrF,wCAA2D;AAC3D,kFAAqF;AAErF,iGAA0G;AAE1G,wEAAqE;AAErE,8EAA8F;AAC9F,2EAA6E;AAC7E,6EAAwE;AAIxE,8EAAuE;AAEvE,MAAa,kCAAmC,SAAQ,sBAA4B;IAchF,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QAdP,cAAS,GAAG,gCAAgC,CAAC;QAC7C,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE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ACV;YAED,MAAM,mBAAmB,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YACjH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,2BAA2B,CAAC,mBAAmB,CAAC,CAAC;YAEhG,IAAI;gBACA,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;gBACvD,MAAM,IAAI,CAAC,sBAAsB,CAAC,qCAAqC,CAAC,6CAAqB,CAAC,GAAG,CAAC,CAAC;gBACnG,MAAM,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;gBAC9D,MAAM,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC;gBACzC,MAAM,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,EAAE,CAAC;gBAEtD,MAAM,kBAAkB,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAS,0BAA0B,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"CheckSavedRowsAndReplaceTablesTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,wEAA2E;AAC3E,kFAAqF;AACrF,wCAA2D;AAC3D,kFAAqF;AAErF,iGAA0G;AAE1G,wEAAqE;AAErE,8EAA8F;AAC9F,2EAA6E;AAC7E,6EAAwE;AAIxE,8EAAuE;AAEvE,MAAa,kCAAmC,SAAQ,sBAA4B;IAchF,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QAdP,cAAS,GAAG,gCAAgC,CAAC;QAC7C,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GA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6BAAY,CAAC,0CAA0C,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;aAC7F;YAED,MAAM,OAAO,CAAC,GAAG,CACb,iBAAiB,CAAC,GAAG,CAAC,CAAO,EAAE,EAAE,EAAE;gBAC/B,MAAM,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YACxF,CAAC,CAAA,CAAC,CACL,CAAC;QACN,CAAC;KAAA;IAEa,mBAAmB,CAAC,IAAoB;;YAClD,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,GAAG,CACvC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAO,OAAO,EAAE,EAAE;gBAChC,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;gBAC5E,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,kCAAkC,CAC/E,OAAO,EACP,YAAY,CAAC,OAAO,CACvB,CAAC;gBACF,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;YACjD,CAAC,CAAA,CAAC,CACL,CAAC;YAEF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;YAE3E,MAAM,WAAW,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YACzE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;QAC9C,CAAC;KAAA;CACJ;AAjJD,gFAiJC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PublicGtfsDepartureRepository } from "../../../data-access/cache/PublicGtfsDepartureRepository";
|
|
2
|
+
import { DeparturesRepository } from "../../../data-access/precomputed";
|
|
3
|
+
import { PublicDepartureCacheTransformation } from "../../../transformations/PublicDepartureCacheTransformation";
|
|
4
|
+
import { ISimpleConfig } from "@golemio/core/dist/helpers/configuration/ISimpleConfig";
|
|
5
|
+
import { AbstractTask } from "@golemio/core/dist/integration-engine/workers";
|
|
6
|
+
import { IRefreshPublicDepartureParams } from "./interfaces/IRefreshPublicDepartureParams";
|
|
7
|
+
import { RefreshPublicDepartureValidationSchema } from "./schema/RefreshPublicDepartureSchema";
|
|
8
|
+
export declare class RefreshPublicGtfsDepartureCacheTask extends AbstractTask<IRefreshPublicDepartureParams> {
|
|
9
|
+
private departureTransformation;
|
|
10
|
+
private departureRepository;
|
|
11
|
+
private publicDepartureRepository;
|
|
12
|
+
private config;
|
|
13
|
+
readonly queueName = "refreshPublicGtfsDepartureCache";
|
|
14
|
+
readonly queueTtl: number;
|
|
15
|
+
readonly schema: typeof RefreshPublicDepartureValidationSchema;
|
|
16
|
+
private readonly departurePageSize;
|
|
17
|
+
constructor(departureTransformation: PublicDepartureCacheTransformation, departureRepository: DeparturesRepository, publicDepartureRepository: PublicGtfsDepartureRepository, config: ISimpleConfig);
|
|
18
|
+
protected execute(params: IRefreshPublicDepartureParams): Promise<void>;
|
|
19
|
+
private getIntervalParamsWithDefault;
|
|
20
|
+
private getDeparturesByStopId;
|
|
21
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.RefreshPublicGtfsDepartureCacheTask = void 0;
|
|
25
|
+
const PublicGtfsDepartureRepository_1 = require("../../../data-access/cache/PublicGtfsDepartureRepository");
|
|
26
|
+
const precomputed_1 = require("../../../data-access/precomputed");
|
|
27
|
+
const RopidGtfsContainerToken_1 = require("../../../ioc/RopidGtfsContainerToken");
|
|
28
|
+
const PublicDepartureCacheTransformation_1 = require("../../../transformations/PublicDepartureCacheTransformation");
|
|
29
|
+
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
30
|
+
const workers_1 = require("@golemio/core/dist/integration-engine/workers");
|
|
31
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
32
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
33
|
+
const constants_1 = require("../constants");
|
|
34
|
+
const RefreshPublicDepartureSchema_1 = require("./schema/RefreshPublicDepartureSchema");
|
|
35
|
+
const DEFAULT_PAGE_SIZE = 50000;
|
|
36
|
+
let RefreshPublicGtfsDepartureCacheTask = exports.RefreshPublicGtfsDepartureCacheTask = class RefreshPublicGtfsDepartureCacheTask extends workers_1.AbstractTask {
|
|
37
|
+
constructor(departureTransformation, departureRepository, publicDepartureRepository, config) {
|
|
38
|
+
super(constants_1.TIMETABLE_WORKER_NAME);
|
|
39
|
+
this.departureTransformation = departureTransformation;
|
|
40
|
+
this.departureRepository = departureRepository;
|
|
41
|
+
this.publicDepartureRepository = publicDepartureRepository;
|
|
42
|
+
this.config = config;
|
|
43
|
+
this.queueName = "refreshPublicGtfsDepartureCache";
|
|
44
|
+
this.queueTtl = 59 * 60 * 1000; // 59 minutes
|
|
45
|
+
this.schema = RefreshPublicDepartureSchema_1.RefreshPublicDepartureValidationSchema;
|
|
46
|
+
const departurePageSize = this.config.getValue("module.pid.ropid-gtfs.timetables.refreshPublicGtfsDepartureCache.departurePageSize", DEFAULT_PAGE_SIZE.toString());
|
|
47
|
+
this.departurePageSize = Number.parseInt(departurePageSize);
|
|
48
|
+
}
|
|
49
|
+
execute(params) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
const intervalParams = this.getIntervalParamsWithDefault(params);
|
|
52
|
+
const numberOfDepartures = yield this.departureRepository.countDeparturesForPublicCache(intervalParams);
|
|
53
|
+
const pages = Math.ceil(numberOfDepartures / this.departurePageSize);
|
|
54
|
+
for (let page = 0; page < pages; page++) {
|
|
55
|
+
const departuresForCache = yield this.departureRepository.getDepaturesForPublicCache(page, this.departurePageSize, intervalParams);
|
|
56
|
+
const departuresByStopIdDict = this.getDeparturesByStopId(departuresForCache);
|
|
57
|
+
for (const [stopId, departures] of departuresByStopIdDict.entries()) {
|
|
58
|
+
try {
|
|
59
|
+
const departuresDto = this.departureTransformation.transformArray(departures);
|
|
60
|
+
yield this.publicDepartureRepository.replaceDeparturesForStop(departuresDto, stopId, intervalParams);
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
if (err instanceof golemio_errors_1.AbstractGolemioError) {
|
|
64
|
+
throw err;
|
|
65
|
+
}
|
|
66
|
+
throw new golemio_errors_1.GeneralError("Error while refreshing public departure cache", this.constructor.name, err);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
getIntervalParamsWithDefault(params) {
|
|
73
|
+
var _a, _b;
|
|
74
|
+
const defaultIntervalFromHours = this.config.getValue("module.pid.ropid-gtfs.timetables.refreshPublicGtfsDepartureCache.defaultIntervalFromHours", "-3");
|
|
75
|
+
const defaultIntervalToHours = this.config.getValue("module.pid.ropid-gtfs.timetables.refreshPublicGtfsDepartureCache.defaultIntervalToHours", "6");
|
|
76
|
+
return {
|
|
77
|
+
intervalFromHours: (_a = params.intervalFromHours) !== null && _a !== void 0 ? _a : Number.parseInt(defaultIntervalFromHours),
|
|
78
|
+
intervalToHours: (_b = params.intervalToHours) !== null && _b !== void 0 ? _b : Number.parseInt(defaultIntervalToHours),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
getDeparturesByStopId(departures) {
|
|
82
|
+
const departuresByStopId = new Map();
|
|
83
|
+
for (const departure of departures) {
|
|
84
|
+
if (!departuresByStopId.has(departure.stop_id)) {
|
|
85
|
+
departuresByStopId.set(departure.stop_id, []);
|
|
86
|
+
}
|
|
87
|
+
departuresByStopId.get(departure.stop_id).push(departure);
|
|
88
|
+
}
|
|
89
|
+
return departuresByStopId;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
exports.RefreshPublicGtfsDepartureCacheTask = RefreshPublicGtfsDepartureCacheTask = __decorate([
|
|
93
|
+
(0, tsyringe_1.injectable)(),
|
|
94
|
+
__param(0, (0, tsyringe_1.inject)(RopidGtfsContainerToken_1.RopidGtfsContainerToken.PublicDepartureCacheTransformation)),
|
|
95
|
+
__param(1, (0, tsyringe_1.inject)(RopidGtfsContainerToken_1.RopidGtfsContainerToken.DepartureRepository)),
|
|
96
|
+
__param(2, (0, tsyringe_1.inject)(RopidGtfsContainerToken_1.RopidGtfsContainerToken.PublicGtfsDepartureRepository)),
|
|
97
|
+
__param(3, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.SimpleConfig)),
|
|
98
|
+
__metadata("design:paramtypes", [PublicDepartureCacheTransformation_1.PublicDepartureCacheTransformation,
|
|
99
|
+
precomputed_1.DeparturesRepository,
|
|
100
|
+
PublicGtfsDepartureRepository_1.PublicGtfsDepartureRepository, Object])
|
|
101
|
+
], RefreshPublicGtfsDepartureCacheTask);
|
|
102
|
+
//# sourceMappingURL=RefreshPublicGtfsDepartureCacheTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefreshPublicGtfsDepartureCacheTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,4GAA+G;AAC/G,kEAA8E;AAE9E,kFAAqF;AACrF,oHAAuH;AAEvH,wEAAqE;AACrE,2EAA6E;AAC7E,6EAA8F;AAC9F,iEAAwE;AACxE,4CAAqD;AAErD,wFAA+F;AAE/F,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAGzB,IAAM,mCAAmC,iDAAzC,MAAM,mCAAoC,SAAQ,sBAA2C;IAMhG,YAEI,uBAAmE,EACd,mBAAiD,EAEtG,yBAAgE,EAChC,MAA6B;QAE7D,KAAK,CAAC,iCAAqB,CAAC,CAAC;QANrB,4BAAuB,GAAvB,uBAAuB,CAAoC;QACN,wBAAmB,GAAnB,mBAAmB,CAAsB;QAE9F,8BAAyB,GAAzB,yBAAyB,CAA+B;QACxB,WAAM,GAAN,MAAM,CAAe;QAXjD,cAAS,GAAG,iCAAiC,CAAC;QAC9C,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,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AA;IAE7D,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,YAAY,CAAC,CAAA;qCAJE,uEAAkC;QACe,kCAAoB;QAEnE,6DAA6B;GAX3D,mCAAmC,CAgF/C"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { RopidGtfsRepository } from "../../../../data-access/RopidGtfsRepository";
|
|
2
|
+
import { DeparturesRepository } from "../../../../data-access/precomputed/DeparturesRepository";
|
|
2
3
|
import { SourceTableSuffixEnum } from "../../../../helpers/SourceTableSuffixEnum";
|
|
3
4
|
import { ILogger } from "@golemio/core/dist/helpers/logger/LoggerProvider";
|
|
4
5
|
export declare class PrecomputedTablesFacade {
|
|
5
6
|
private readonly logger;
|
|
6
7
|
private readonly ropidGtfsRepository;
|
|
8
|
+
private readonly departureRepository;
|
|
7
9
|
/** Precomputed data repositories */
|
|
8
|
-
private departuresRepository;
|
|
9
10
|
private minMaxStopSequencesRepository;
|
|
10
11
|
private tripScheduleRepository;
|
|
11
12
|
private servicesCalendarRepository;
|
|
12
|
-
constructor(logger: ILogger, ropidGtfsRepository: RopidGtfsRepository);
|
|
13
|
+
constructor(logger: ILogger, ropidGtfsRepository: RopidGtfsRepository, departureRepository: DeparturesRepository);
|
|
13
14
|
createAndPopulatePrecomputedTmpTables: (sourceTableSuffix: SourceTableSuffixEnum) => Promise<void>;
|
|
14
15
|
}
|
|
@@ -32,9 +32,10 @@ const RopidGtfsContainerToken_1 = require("../../../../ioc/RopidGtfsContainerTok
|
|
|
32
32
|
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
33
33
|
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
34
34
|
let PrecomputedTablesFacade = exports.PrecomputedTablesFacade = class PrecomputedTablesFacade {
|
|
35
|
-
constructor(logger, ropidGtfsRepository) {
|
|
35
|
+
constructor(logger, ropidGtfsRepository, departureRepository) {
|
|
36
36
|
this.logger = logger;
|
|
37
37
|
this.ropidGtfsRepository = ropidGtfsRepository;
|
|
38
|
+
this.departureRepository = departureRepository;
|
|
38
39
|
this.createAndPopulatePrecomputedTmpTables = (sourceTableSuffix) => __awaiter(this, void 0, void 0, function* () {
|
|
39
40
|
yield this.ropidGtfsRepository.createPrecomputedTmpTables();
|
|
40
41
|
this.logger.info(`Datasets: populating temp table ${this.servicesCalendarRepository["tableName"]}${SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp}`);
|
|
@@ -43,13 +44,12 @@ let PrecomputedTablesFacade = exports.PrecomputedTablesFacade = class Precompute
|
|
|
43
44
|
yield this.minMaxStopSequencesRepository.populate(sourceTableSuffix);
|
|
44
45
|
this.logger.info(`Datasets: populating temp table ${this.tripScheduleRepository["tableName"]}${SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp}`);
|
|
45
46
|
yield this.tripScheduleRepository.populate(sourceTableSuffix);
|
|
46
|
-
this.logger.info(`Datasets: populating temp table ${this.
|
|
47
|
-
yield this.
|
|
48
|
-
this.logger.info(`Datasets: running analyze on ${this.
|
|
49
|
-
yield this.
|
|
47
|
+
this.logger.info(`Datasets: populating temp table ${this.departureRepository["tableName"]}${SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp}`);
|
|
48
|
+
yield this.departureRepository.createAndPopulate(sourceTableSuffix);
|
|
49
|
+
this.logger.info(`Datasets: running analyze on ${this.departureRepository["tableName"]}${SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp}`);
|
|
50
|
+
yield this.departureRepository.analyze();
|
|
50
51
|
});
|
|
51
52
|
/** Precomputed data repositories */
|
|
52
|
-
this.departuresRepository = new DeparturesRepository_1.DeparturesRepository();
|
|
53
53
|
this.minMaxStopSequencesRepository = new MinMaxStopSequencesRepository_1.MinMaxStopSequencesRepository();
|
|
54
54
|
this.tripScheduleRepository = new TripScheduleRepository_1.TripScheduleRepository();
|
|
55
55
|
this.servicesCalendarRepository = new ServicesCalendarRepository_1.ServicesCalendarRepository();
|
|
@@ -59,6 +59,8 @@ exports.PrecomputedTablesFacade = PrecomputedTablesFacade = __decorate([
|
|
|
59
59
|
(0, tsyringe_1.injectable)(),
|
|
60
60
|
__param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
|
|
61
61
|
__param(1, (0, tsyringe_1.inject)(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RopidGtfsRepository)),
|
|
62
|
-
|
|
62
|
+
__param(2, (0, tsyringe_1.inject)(RopidGtfsContainerToken_1.RopidGtfsContainerToken.DepartureRepository)),
|
|
63
|
+
__metadata("design:paramtypes", [Object, RopidGtfsRepository_1.RopidGtfsRepository,
|
|
64
|
+
DeparturesRepository_1.DeparturesRepository])
|
|
63
65
|
], PrecomputedTablesFacade);
|
|
64
66
|
//# sourceMappingURL=PrecomputedTablesFacade.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrecomputedTablesFacade.js","sourceRoot":"","sources":["../../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"PrecomputedTablesFacade.js","sourceRoot":"","sources":["../../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,qFAAqF;AACrF,mGAAmG;AACnG,qHAAqH;AACrH,+GAA+G;AAC/G,uGAAuG;AACvG,qFAAqF;AACrF,qFAAqF;AACrF,wEAAqE;AAErE,iEAAwE;AAGjE,IAAM,uBAAuB,qCAA7B,MAAM,uBAAuB;IAMhC,YAC8B,MAAgC,EACL,mBAAyD,EACzD,mBAA0D;QAFpE,WAAM,GAAN,MAAM,CAAS;QACY,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,wBAAmB,GAAnB,mBAAmB,CAAsB;QAQ5G,0CAAqC,GAAG,CAAO,iBAAwC,EAAiB,EAAE;YAC7G,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D,IAAI,CAAC,0BAA0B,GAAG,IAAI,uDAA0B,EAAE,CAAC;IACvE,CAAC;CA0BJ,CAAA;kCAzCY,uBAAuB;IADnC,IAAA,qBAAU,GAAE;IAQJ,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;IACxB,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,mBAAmB,CAAC,CAAA;IACnD,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,mBAAmB,CAAC,CAAA;6CADuC,yCAAmB;QACnB,2CAAoB;GAT1G,uBAAuB,CAyCnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IRefreshPublicDepartureParams.js","sourceRoot":"","sources":["../../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/interfaces/IRefreshPublicDepartureParams.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RefreshPublicDepartureValidationSchema = void 0;
|
|
13
|
+
const class_validator_1 = require("@golemio/core/dist/shared/class-validator");
|
|
14
|
+
class RefreshPublicDepartureValidationSchema {
|
|
15
|
+
}
|
|
16
|
+
exports.RefreshPublicDepartureValidationSchema = RefreshPublicDepartureValidationSchema;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsOptional)(),
|
|
19
|
+
(0, class_validator_1.IsInt)()
|
|
20
|
+
// we do not want to have older departures than 3 hours in the cache for now
|
|
21
|
+
// see the PublicGtfsDepartureRepository.replaceDeparturesForStop method
|
|
22
|
+
,
|
|
23
|
+
(0, class_validator_1.Min)(-3),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], RefreshPublicDepartureValidationSchema.prototype, "intervalFromHours", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
(0, class_validator_1.IsInt)(),
|
|
29
|
+
__metadata("design:type", Number)
|
|
30
|
+
], RefreshPublicDepartureValidationSchema.prototype, "intervalToHours", void 0);
|
|
31
|
+
//# sourceMappingURL=RefreshPublicDepartureSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefreshPublicDepartureSchema.js","sourceRoot":"","sources":["../../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/RefreshPublicDepartureSchema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+EAAmF;AAGnF,MAAa,sCAAsC;CAWlD;AAXD,wFAWC;AALG;IALC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACR,4EAA4E;IAC5E,wEAAwE;;IACvE,IAAA,qBAAG,EAAC,CAAC,CAAC,CAAC;;iFACmB;AAI3B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;;+EACiB"}
|
package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare class GenerateFilesTask extends AbstractEmptyTask {
|
|
|
3
3
|
readonly queueName = "generateFiles";
|
|
4
4
|
readonly queueTtl: number;
|
|
5
5
|
private readonly logger;
|
|
6
|
+
private readonly stopTimeRepository;
|
|
6
7
|
private readonly tripsRepository;
|
|
7
8
|
private readonly gtfsRtRedisRepository;
|
|
8
9
|
private readonly alertsGenerator;
|
package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.js
CHANGED
|
@@ -24,9 +24,11 @@ exports.GenerateFilesTask = void 0;
|
|
|
24
24
|
const RouteTypeEnums_1 = require("../../../../../helpers/RouteTypeEnums");
|
|
25
25
|
const ropid_vymi_1 = require("../../../../ropid-vymi");
|
|
26
26
|
const Di_1 = require("../../../ioc/Di");
|
|
27
|
+
const VPContainerToken_1 = require("../../../ioc/VPContainerToken");
|
|
27
28
|
const TripsRepository_1 = require("../../vehicle-positions/data-access/TripsRepository");
|
|
28
29
|
const ioc_1 = require("@golemio/core/dist/integration-engine/ioc");
|
|
29
30
|
const workers_1 = require("@golemio/core/dist/integration-engine/workers");
|
|
31
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
30
32
|
const ovapi_gtfs_realtime_bindings_1 = require("@golemio/ovapi-gtfs-realtime-bindings");
|
|
31
33
|
const GtfsRtRedisRepository_1 = require("../data-access/GtfsRtRedisRepository");
|
|
32
34
|
const AlertsGenerator_1 = require("../helpers/AlertsGenerator");
|
|
@@ -38,6 +40,7 @@ class GenerateFilesTask extends workers_1.AbstractEmptyTask {
|
|
|
38
40
|
this.queueName = "generateFiles";
|
|
39
41
|
this.queueTtl = 20 * 1000; // 20 seconds
|
|
40
42
|
this.logger = Di_1.VPContainer.resolve(ioc_1.ContainerToken.Logger);
|
|
43
|
+
this.stopTimeRepository = Di_1.VPContainer.resolve(VPContainerToken_1.VPContainerToken.PublicStopTimeCacheRepository);
|
|
41
44
|
this.tripsRepository = new TripsRepository_1.TripsRepository();
|
|
42
45
|
this.gtfsRtRedisRepository = new GtfsRtRedisRepository_1.GtfsRtRedisRepository();
|
|
43
46
|
const vymiEventsRepository = new ropid_vymi_1.RopidVYMIEventsModel();
|
|
@@ -52,8 +55,16 @@ class GenerateFilesTask extends workers_1.AbstractEmptyTask {
|
|
|
52
55
|
const updatesMessage = ovapi_gtfs_realtime_bindings_1.transit_realtime.FeedMessage.create({ header: feedHeader });
|
|
53
56
|
const positionsMessage = ovapi_gtfs_realtime_bindings_1.transit_realtime.FeedMessage.create({ header: feedHeader });
|
|
54
57
|
const pidFeedMessage = ovapi_gtfs_realtime_bindings_1.transit_realtime.FeedMessage.create({ header: feedHeader });
|
|
58
|
+
const vehicleDescriptors = tripData.map((tripRecord) => this.vehicleDescriptor.getVehicleDescriptor(tripRecord));
|
|
59
|
+
const vehicleIds = [];
|
|
60
|
+
for (const { id } of vehicleDescriptors) {
|
|
61
|
+
if (typeof id === "string") {
|
|
62
|
+
vehicleIds.push(id);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const stopTimes = yield this.stopTimeRepository.getPublicStopTimeCache(vehicleIds);
|
|
55
66
|
const gtfsTripIdMap = {};
|
|
56
|
-
for (const tripRecord of
|
|
67
|
+
for (const tripRecord of tripData) {
|
|
57
68
|
const tripDescriptor = {
|
|
58
69
|
scheduleRelationship: tripRecord.last_position.is_canceled
|
|
59
70
|
? ovapi_gtfs_realtime_bindings_1.transit_realtime.TripDescriptor.ScheduleRelationship.CANCELED
|
|
@@ -85,7 +96,14 @@ class GenerateFilesTask extends workers_1.AbstractEmptyTask {
|
|
|
85
96
|
positionsMessage.entity.push(positionsMessageEntity);
|
|
86
97
|
// single feed for trip updates and vehicle positions
|
|
87
98
|
const feedMessageEntity = structuredClone(positionsMessageEntity);
|
|
88
|
-
|
|
99
|
+
let stopTimeUpdates = [];
|
|
100
|
+
if (typeof vehicleDescriptor.id === "string") {
|
|
101
|
+
const stopTimesForVehicle = stopTimes.get(vehicleDescriptor.id);
|
|
102
|
+
stopTimeUpdates = this.generateStopTimeUpdate(tripRecord.gtfs_route_type, stopTimesForVehicle);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
this.logger.error(new golemio_errors_1.GeneralError(`Cannot get stopTimeUpdates for trip with unknown vehicleId and gtfsTripId '${tripRecord.gtfs_trip_id}'`, this.constructor.name, undefined, undefined, "pid"));
|
|
106
|
+
}
|
|
89
107
|
const shouldSkipTripUpdate = stopTimeUpdates.every((el) => el.scheduleRelationship === ovapi_gtfs_realtime_bindings_1.transit_realtime.TripUpdate.StopTimeUpdate.ScheduleRelationship.NO_DATA ||
|
|
90
108
|
gtfsTripIdMap[tripRecord.gtfs_trip_id]);
|
|
91
109
|
if (!shouldSkipTripUpdate) {
|
|
@@ -176,22 +194,22 @@ class GenerateFilesTask extends workers_1.AbstractEmptyTask {
|
|
|
176
194
|
}
|
|
177
195
|
return entity;
|
|
178
196
|
}
|
|
179
|
-
generateStopTimeUpdate(
|
|
197
|
+
generateStopTimeUpdate(routeType, stopTimes) {
|
|
180
198
|
const stopTimeUpdates = [];
|
|
181
|
-
for (const
|
|
182
|
-
const scheduledTrack =
|
|
183
|
-
let actualTrack =
|
|
199
|
+
for (const stopTime of stopTimes) {
|
|
200
|
+
const scheduledTrack = stopTime.platform_code;
|
|
201
|
+
let actualTrack = stopTime.platform_code;
|
|
184
202
|
if (routeType === RouteTypeEnums_1.GTFSRouteTypeEnum.TRAIN) {
|
|
185
|
-
actualTrack =
|
|
203
|
+
actualTrack = stopTime.cis_stop_platform_code;
|
|
186
204
|
}
|
|
187
205
|
stopTimeUpdates.push(Object.assign(Object.assign({ arrival: {
|
|
188
|
-
delay:
|
|
206
|
+
delay: stopTime.arr_delay,
|
|
189
207
|
}, departure: {
|
|
190
|
-
delay:
|
|
191
|
-
} }, (
|
|
192
|
-
|
|
208
|
+
delay: stopTime.dep_delay,
|
|
209
|
+
} }, (stopTime.arr_delay === null &&
|
|
210
|
+
stopTime.dep_delay === null && {
|
|
193
211
|
scheduleRelationship: ovapi_gtfs_realtime_bindings_1.transit_realtime.TripUpdate.StopTimeUpdate.ScheduleRelationship.NO_DATA,
|
|
194
|
-
})), { stopSequence:
|
|
212
|
+
})), { stopSequence: stopTime.sequence, stopId: stopTime.stop_id, ".transit_realtime.ovapiStopTimeUpdate": Object.assign(Object.assign({}, (scheduledTrack && { scheduledTrack })), (actualTrack && { actualTrack })) }));
|
|
195
213
|
}
|
|
196
214
|
return stopTimeUpdates;
|
|
197
215
|
}
|
package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerateFilesTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAA4D;AAC5D,uDAAkF;AAClF,wCAA2D;AAC3D,yFAA8G;
|
|
1
|
+
{"version":3,"file":"GenerateFilesTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAA4D;AAC5D,uDAAkF;AAClF,wCAA2D;AAC3D,oEAA8E;AAC9E,yFAA8G;AAI9G,mEAA2E;AAC3E,2EAAkF;AAClF,6EAAwE;AACxE,wFAAyF;AAEzF,gFAA6E;AAC7E,gEAA6D;AAC7D,oEAAiE;AACjE,4CAA8C;AAK9C,MAAa,iBAAkB,SAAQ,2BAAiB;IAWpD,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QAXP,cAAS,GAAG,eAAe,CAAC;QAC5B,aAAQ,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;QAW/C,IAAI,CAAC,MAAM,GAAG,gBAAW,CAAC,OAAO,CAAU,oBAAc,CAAC,MAAM,CAAC,CAAC;QAElE,IAAI,CAAC,kBAAkB,GAAG,gBAAW,CAAC,OAAO,CACzC,mCAAgB,CAAC,6BAA6B,CAC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AAG,+CAAY,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAY,CAAC;QAC3E,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,GAAG,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjF,CAAC;CACJ;AAvRD,8CAuRC"}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { IRegionalBusRunsMessagesModel } from "../../../../../../schema-definitions/vehicle-positions/models/interfaces/IRegionalBusRunsMessagesModel";
|
|
2
|
-
import { ISimpleConfig } from "@golemio/core/dist/helpers/configuration/ISimpleConfig";
|
|
3
2
|
import { ILogger } from "@golemio/core/dist/helpers/logger";
|
|
4
3
|
import { IRegionalBusMessageFilter } from "./interfaces/IRegionalBusMessageFilter";
|
|
5
4
|
export declare class RegionalBusMessageFilter implements IRegionalBusMessageFilter {
|
|
6
|
-
private config;
|
|
7
5
|
private logger;
|
|
8
|
-
constructor(
|
|
6
|
+
constructor(logger: ILogger);
|
|
9
7
|
/**
|
|
10
8
|
* Get messages that are valid for processing
|
|
11
9
|
*/
|
|
12
10
|
getFilteredMessages(messages: IRegionalBusRunsMessagesModel[]): IRegionalBusRunsMessagesModel[];
|
|
13
|
-
private get regNumberWhitelist();
|
|
14
11
|
}
|