@golemio/pid 4.0.2 → 4.0.3-dev.1993091012
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/README.md +1 -1
- package/db/example/redis/gtfsStopsCacheMock.json +8 -0
- package/db/example/redis/jisCacheMock.json +31 -0
- package/db/migrations/postgresql/20250716143052-add-stop-name-to-combined-stop-times.js +53 -0
- package/db/migrations/postgresql/sqls/20250716143052-add-stop-name-to-combined-stop-times-down.sql +47 -0
- package/db/migrations/postgresql/sqls/20250716143052-add-stop-name-to-combined-stop-times-up.sql +47 -0
- package/dist/helpers/GtfsStopParser.d.ts +2 -0
- package/dist/helpers/GtfsStopParser.js +11 -8
- package/dist/helpers/GtfsStopParser.js.map +1 -1
- package/dist/helpers/jis/JISInfotextSeverityLevelPriority.d.ts +6 -0
- package/dist/helpers/jis/JISInfotextSeverityLevelPriority.js +11 -0
- package/dist/helpers/jis/JISInfotextSeverityLevelPriority.js.map +1 -0
- package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js +0 -1
- package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js.map +1 -1
- package/dist/integration-engine/jis/ioc/Di.js +10 -0
- package/dist/integration-engine/jis/ioc/Di.js.map +1 -1
- package/dist/integration-engine/jis/ioc/JISContainerToken.d.ts +4 -0
- package/dist/integration-engine/jis/ioc/JISContainerToken.js +5 -0
- package/dist/integration-engine/jis/ioc/JISContainerToken.js.map +1 -1
- package/dist/integration-engine/jis/repositories/JISInfotextsRedisRepository.d.ts +9 -0
- package/dist/integration-engine/jis/repositories/JISInfotextsRedisRepository.js +86 -0
- package/dist/integration-engine/jis/repositories/JISInfotextsRedisRepository.js.map +1 -0
- package/dist/integration-engine/jis/repositories/JISInfotextsRepository.d.ts +6 -1
- package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js +50 -2
- package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js.map +1 -1
- package/dist/integration-engine/jis/repositories/JISMetadataRepository.d.ts +4 -1
- package/dist/integration-engine/jis/repositories/JISMetadataRepository.js +37 -12
- package/dist/integration-engine/jis/repositories/JISMetadataRepository.js.map +1 -1
- package/dist/integration-engine/jis/transformations/JISInfotextCacheTranformation.d.ts +7 -0
- package/dist/integration-engine/jis/transformations/JISInfotextCacheTranformation.js +37 -0
- package/dist/integration-engine/jis/transformations/JISInfotextCacheTranformation.js.map +1 -0
- package/dist/integration-engine/jis/workers/JISWorker.js +1 -0
- package/dist/integration-engine/jis/workers/JISWorker.js.map +1 -1
- package/dist/integration-engine/jis/workers/tasks/AbstractFetchJISResourceTask.d.ts +14 -0
- package/dist/integration-engine/jis/workers/tasks/AbstractFetchJISResourceTask.js +71 -0
- package/dist/integration-engine/jis/workers/tasks/AbstractFetchJISResourceTask.js.map +1 -0
- package/dist/integration-engine/jis/workers/tasks/FetchJISEventsTask.d.ts +10 -4
- package/dist/integration-engine/jis/workers/tasks/FetchJISEventsTask.js +15 -22
- package/dist/integration-engine/jis/workers/tasks/FetchJISEventsTask.js.map +1 -1
- package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.d.ts +10 -5
- package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.js +15 -23
- package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.js.map +1 -1
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsCacheTask.d.ts +13 -0
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsCacheTask.js +47 -0
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsCacheTask.js.map +1 -0
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.d.ts +1 -2
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js +5 -4
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/RopidGTFSCisStopsModel.d.ts +18 -0
- package/dist/integration-engine/ropid-gtfs/RopidGTFSCisStopsModel.js +44 -0
- package/dist/integration-engine/ropid-gtfs/RopidGTFSCisStopsModel.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.d.ts +5 -1
- package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js +24 -0
- package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/index.d.ts +1 -0
- package/dist/integration-engine/ropid-gtfs/index.js +1 -0
- package/dist/integration-engine/ropid-gtfs/index.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js +8 -0
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.d.ts +3 -0
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js +3 -0
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.js +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js +8 -5
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.d.ts +12 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.js +44 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.d.ts +12 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.js +87 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.js.map +1 -0
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js +1 -0
- 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/interfaces/TripRepositoryInterfaces.d.ts +2 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.d.ts +3 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.js +100 -85
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateTrainDelayTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicStopTimeCacheTask.js +1 -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/PublicApiTripTransformation.js +2 -0
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/PublicApiTripTransformation.js.map +1 -1
- package/dist/output-gateway/index.js +1 -0
- package/dist/output-gateway/index.js.map +1 -1
- package/dist/output-gateway/jis/data-access/cache/JISInfotextsRedisRepository.d.ts +17 -0
- package/dist/output-gateway/jis/data-access/cache/JISInfotextsRedisRepository.js +113 -0
- package/dist/output-gateway/jis/data-access/cache/JISInfotextsRedisRepository.js.map +1 -0
- package/dist/output-gateway/jis/ioc/Di.js +2 -2
- package/dist/output-gateway/jis/ioc/Di.js.map +1 -1
- package/dist/output-gateway/jis/ioc/OgJisToken.d.ts +2 -0
- package/dist/output-gateway/jis/ioc/OgJisToken.js +2 -0
- package/dist/output-gateway/jis/ioc/OgJisToken.js.map +1 -1
- package/dist/output-gateway/pid/controllers/v3/V3TransferBoardsController.js.map +1 -1
- package/dist/output-gateway/pid/controllers/v4/V4TransferBoardsController.d.ts +17 -0
- package/dist/output-gateway/pid/controllers/v4/V4TransferBoardsController.js +154 -0
- package/dist/output-gateway/pid/controllers/v4/V4TransferBoardsController.js.map +1 -0
- package/dist/output-gateway/pid/controllers/v4/interfaces/ITransferBoardsParams.d.ts +14 -0
- package/dist/output-gateway/pid/controllers/v4/interfaces/ITransferBoardsParams.js +3 -0
- package/dist/output-gateway/pid/controllers/v4/interfaces/ITransferBoardsParams.js.map +1 -0
- package/dist/output-gateway/pid/domain/InfotextInterfaces.d.ts +5 -0
- package/dist/output-gateway/pid/helpers/JISInfotextStopSuppressionFilter.d.ts +4 -1
- package/dist/output-gateway/pid/helpers/JISInfotextStopSuppressionFilter.js +7 -1
- package/dist/output-gateway/pid/helpers/JISInfotextStopSuppressionFilter.js.map +1 -1
- package/dist/output-gateway/pid/helpers/TransferBoardFilter.d.ts +5 -0
- package/dist/output-gateway/pid/helpers/TransferBoardFilter.js +33 -0
- package/dist/output-gateway/pid/helpers/TransferBoardFilter.js.map +1 -0
- package/dist/output-gateway/pid/helpers/TransferBoardSorter.d.ts +6 -0
- package/dist/output-gateway/pid/helpers/TransferBoardSorter.js +61 -0
- package/dist/output-gateway/pid/helpers/TransferBoardSorter.js.map +1 -0
- package/dist/output-gateway/pid/index.d.ts +50 -0
- package/dist/output-gateway/pid/index.js.map +1 -1
- package/dist/output-gateway/pid/ioc/Di.js +62 -6
- package/dist/output-gateway/pid/ioc/Di.js.map +1 -1
- package/dist/output-gateway/pid/ioc/OgPidToken.d.ts +11 -0
- package/dist/output-gateway/pid/ioc/OgPidToken.js +11 -0
- package/dist/output-gateway/pid/ioc/OgPidToken.js.map +1 -1
- package/dist/output-gateway/pid/routers/index.d.ts +1 -0
- package/dist/output-gateway/pid/routers/index.js +3 -1
- package/dist/output-gateway/pid/routers/index.js.map +1 -1
- package/dist/output-gateway/pid/routers/v4/V4PIDRouter.d.ts +16 -0
- package/dist/output-gateway/pid/routers/v4/V4PIDRouter.js +67 -0
- package/dist/output-gateway/pid/routers/v4/V4PIDRouter.js.map +1 -0
- package/dist/output-gateway/pid/service/facade/InfotextFacade.d.ts +7 -2
- package/dist/output-gateway/pid/service/facade/InfotextFacade.js +29 -4
- package/dist/output-gateway/pid/service/facade/InfotextFacade.js.map +1 -1
- package/dist/output-gateway/pid/service/facade/StopFacade.d.ts +12 -3
- package/dist/output-gateway/pid/service/facade/StopFacade.js +43 -7
- package/dist/output-gateway/pid/service/facade/StopFacade.js.map +1 -1
- package/dist/output-gateway/pid/service/facade/TransferFacade.d.ts +11 -9
- package/dist/output-gateway/pid/service/facade/TransferFacade.js +117 -14
- package/dist/output-gateway/pid/service/facade/TransferFacade.js.map +1 -1
- package/dist/output-gateway/pid/service/helpers/PlatformCodeResolver.d.ts +7 -1
- package/dist/output-gateway/pid/service/helpers/PlatformCodeResolver.js +12 -0
- package/dist/output-gateway/pid/service/helpers/PlatformCodeResolver.js.map +1 -1
- package/dist/output-gateway/pid/service/transformations/JISInfotextCacheTransferTransformation.d.ts +13 -0
- package/dist/output-gateway/pid/service/transformations/JISInfotextCacheTransferTransformation.js +31 -0
- package/dist/output-gateway/pid/service/transformations/JISInfotextCacheTransferTransformation.js.map +1 -0
- package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.d.ts +27 -0
- package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.js +78 -0
- package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.js.map +1 -0
- package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.d.ts +1 -1
- package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js +4 -4
- package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js.map +1 -1
- package/dist/output-gateway/public/ioc/Di.js +1 -1
- package/dist/output-gateway/public/ioc/Di.js.map +1 -1
- package/dist/output-gateway/ropid-gtfs/data-access/redis/GtfsStopsRedisRepository.d.ts +13 -0
- package/dist/output-gateway/ropid-gtfs/data-access/redis/GtfsStopsRedisRepository.js +83 -0
- package/dist/output-gateway/ropid-gtfs/data-access/redis/GtfsStopsRedisRepository.js.map +1 -0
- package/dist/output-gateway/shared/constants/route-version.d.ts +2 -1
- package/dist/output-gateway/shared/constants/route-version.js +1 -0
- package/dist/output-gateway/shared/constants/route-version.js.map +1 -1
- package/dist/output-gateway/{public → shared}/service/VPSubscriber.d.ts +4 -2
- package/dist/output-gateway/{public → shared}/service/VPSubscriber.js +1 -1
- package/dist/output-gateway/shared/service/VPSubscriber.js.map +1 -0
- package/dist/schema-definitions/jis/redis/const.d.ts +1 -0
- package/dist/schema-definitions/jis/redis/const.js +2 -1
- package/dist/schema-definitions/jis/redis/const.js.map +1 -1
- package/dist/schema-definitions/jis/redis/interfaces/IJISInfotextDto.d.ts +17 -0
- package/dist/schema-definitions/jis/redis/interfaces/IJISInfotextDto.js +3 -0
- package/dist/schema-definitions/jis/redis/interfaces/IJISInfotextDto.js.map +1 -0
- package/dist/schema-definitions/jis/redis/interfaces/IJISMetadataDto.d.ts +1 -5
- package/dist/schema-definitions/jis/redis/schemas/JISInfotextDtoSchema.d.ts +3 -0
- package/dist/schema-definitions/jis/redis/schemas/JISInfotextDtoSchema.js +59 -0
- package/dist/schema-definitions/jis/redis/schemas/JISInfotextDtoSchema.js.map +1 -0
- package/dist/schema-definitions/jis/redis/schemas/JISMetadataDtoSchema.js +5 -11
- package/dist/schema-definitions/jis/redis/schemas/JISMetadataDtoSchema.js.map +1 -1
- package/dist/schema-definitions/ropid-departures-presets/index.d.ts +1 -0
- package/dist/schema-definitions/ropid-departures-presets/index.js +3 -0
- package/dist/schema-definitions/ropid-departures-presets/index.js.map +1 -1
- package/dist/schema-definitions/ropid-gtfs/interfaces/IStopCisDto.d.ts +16 -0
- package/dist/schema-definitions/ropid-gtfs/interfaces/IStopCisDto.js +3 -0
- package/dist/schema-definitions/ropid-gtfs/interfaces/IStopCisDto.js.map +1 -0
- package/dist/schema-definitions/ropid-gtfs/interfaces/IStopDto.d.ts +1 -0
- package/dist/schema-definitions/ropid-gtfs/models/StopCisDto.d.ts +58 -0
- package/dist/schema-definitions/ropid-gtfs/models/StopCisDto.js +69 -0
- package/dist/schema-definitions/ropid-gtfs/models/StopCisDto.js.map +1 -0
- package/dist/schema-definitions/ropid-gtfs/redis/const.d.ts +1 -0
- package/dist/schema-definitions/ropid-gtfs/redis/const.js +2 -1
- package/dist/schema-definitions/ropid-gtfs/redis/const.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.d.ts +3 -2
- package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.js +4 -0
- package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/models/views/interfaces/IPublicStopTimeDto.d.ts +1 -0
- package/dist/schema-definitions/vehicle-positions/redis/interfaces/IPublicApiCacheDto.d.ts +2 -0
- package/dist/schema-definitions/vehicle-positions/redis/interfaces/IPublicStopTimeCacheDto.d.ts +1 -0
- package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicApiCacheDtoSchema.js +8 -0
- package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicApiCacheDtoSchema.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicStopTimeCacheDtoSchema.js +4 -1
- package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicStopTimeCacheDtoSchema.js.map +1 -1
- package/docs/asyncapi.yaml +45 -0
- package/docs/cache/types/redis.md +82 -2
- package/docs/implementation_documentation.md +2 -0
- package/docs/jis/index.md +17 -5
- package/docs/openapi-input.yaml +13 -2
- package/docs/openapi-output.yaml +326 -4
- package/package.json +2 -2
- package/dist/output-gateway/public/service/VPSubscriber.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OgJisContainer = void 0;
|
|
4
|
-
const OgJisToken_1 = require("./OgJisToken");
|
|
5
|
-
const V1EventsController_1 = require("../controllers/v1/V1EventsController");
|
|
6
4
|
const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
|
|
5
|
+
const V1EventsController_1 = require("../controllers/v1/V1EventsController");
|
|
7
6
|
const JISEventsRepository_1 = require("../data-access/JISEventsRepository");
|
|
8
7
|
const JISEventsRopidGTFSRoutesRepository_1 = require("../data-access/JISEventsRopidGTFSRoutesRepository");
|
|
9
8
|
const JISEventsCustomFormatTransformation_1 = require("../transformations/JISEventsCustomFormatTransformation");
|
|
10
9
|
const TranslationHelper_1 = require("../helpers/TranslationHelper");
|
|
11
10
|
const RopidGTFSRoutesRepository_1 = require("../data-access/RopidGTFSRoutesRepository");
|
|
11
|
+
const OgJisToken_1 = require("./OgJisToken");
|
|
12
12
|
const ogJisContainer = ioc_1.OutputGatewayContainer.createChildContainer();
|
|
13
13
|
exports.OgJisContainer = ogJisContainer;
|
|
14
14
|
//#region Controllers
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/output-gateway/jis/ioc/Di.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/output-gateway/jis/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,+DAA+E;AAE/E,6EAA0E;AAC1E,4EAAyE;AACzE,0GAAuG;AACvG,gHAA6G;AAC7G,oEAAiE;AACjE,wFAAqF;AACrF,6CAA0C;AAC1C,MAAM,cAAc,GAAwB,4BAAsB,CAAC,oBAAoB,EAAE,CAAC;AAoB/D,wCAAc;AAlBzC,qBAAqB;AACrB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,kBAAkB,EAAE,uCAAkB,CAAC,CAAC;AACpF,YAAY;AAEZ,sBAAsB;AACtB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,mBAAmB,EAAE,yCAAmB,CAAC,CAAC;AACtF,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,kCAAkC,EAAE,uEAAkC,CAAC,CAAC;AACpH,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,yBAAyB,EAAE,qDAAyB,CAAC,CAAC;AAClG,YAAY;AAEZ,yBAAyB;AACzB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,mCAAmC,EAAE,yEAAmC,CAAC,CAAC;AACtH,YAAY;AAEZ,iBAAiB;AACjB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,iBAAiB,EAAE,qCAAiB,CAAC,CAAC"}
|
|
@@ -2,7 +2,9 @@ export declare const OgJisToken: {
|
|
|
2
2
|
V1EventsController: symbol;
|
|
3
3
|
JISEventsRepository: symbol;
|
|
4
4
|
JISEventsRopidGTFSRoutesRepository: symbol;
|
|
5
|
+
JISInfotextsRedisRepository: symbol;
|
|
5
6
|
RopidGTFSRoutesRepository: symbol;
|
|
6
7
|
JISEventsCustomFormatTransformation: symbol;
|
|
7
8
|
TranslationHelper: symbol;
|
|
9
|
+
VPSubscriber: symbol;
|
|
8
10
|
};
|
|
@@ -8,6 +8,7 @@ exports.OgJisToken = {
|
|
|
8
8
|
//#region Repositories
|
|
9
9
|
JISEventsRepository: Symbol("JISEventsRepository"),
|
|
10
10
|
JISEventsRopidGTFSRoutesRepository: Symbol("JISEventsRopidGTFSRoutesRepository"),
|
|
11
|
+
JISInfotextsRedisRepository: Symbol("JISInfotextsRedisRepository"),
|
|
11
12
|
RopidGTFSRoutesRepository: Symbol("RopidGTFSRoutesRepository"),
|
|
12
13
|
//#endregion
|
|
13
14
|
//#region Transformations
|
|
@@ -15,6 +16,7 @@ exports.OgJisToken = {
|
|
|
15
16
|
//#endregion
|
|
16
17
|
//#region Helpers
|
|
17
18
|
TranslationHelper: Symbol("TranslationHelper"),
|
|
19
|
+
VPSubscriber: Symbol("VPSubscriber"),
|
|
18
20
|
//#endregion
|
|
19
21
|
};
|
|
20
22
|
//# sourceMappingURL=OgJisToken.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OgJisToken.js","sourceRoot":"","sources":["../../../../src/output-gateway/jis/ioc/OgJisToken.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;IACtB,qBAAqB;IACrB,kBAAkB,EAAE,MAAM,CAAC,oBAAoB,CAAC;IAChD,YAAY;IAEZ,sBAAsB;IACtB,mBAAmB,EAAE,MAAM,CAAC,qBAAqB,CAAC;IAClD,kCAAkC,EAAE,MAAM,CAAC,oCAAoC,CAAC;IAChF,yBAAyB,EAAE,MAAM,CAAC,2BAA2B,CAAC;IAC9D,YAAY;IAEZ,yBAAyB;IACzB,mCAAmC,EAAE,MAAM,CAAC,qCAAqC,CAAC;IAClF,YAAY;IAEZ,iBAAiB;IACjB,iBAAiB,EAAE,MAAM,CAAC,mBAAmB,CAAC;IAC9C,YAAY;CACf,CAAC"}
|
|
1
|
+
{"version":3,"file":"OgJisToken.js","sourceRoot":"","sources":["../../../../src/output-gateway/jis/ioc/OgJisToken.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;IACtB,qBAAqB;IACrB,kBAAkB,EAAE,MAAM,CAAC,oBAAoB,CAAC;IAChD,YAAY;IAEZ,sBAAsB;IACtB,mBAAmB,EAAE,MAAM,CAAC,qBAAqB,CAAC;IAClD,kCAAkC,EAAE,MAAM,CAAC,oCAAoC,CAAC;IAChF,2BAA2B,EAAE,MAAM,CAAC,6BAA6B,CAAC;IAClE,yBAAyB,EAAE,MAAM,CAAC,2BAA2B,CAAC;IAC9D,YAAY;IAEZ,yBAAyB;IACzB,mCAAmC,EAAE,MAAM,CAAC,qCAAqC,CAAC;IAClF,YAAY;IAEZ,iBAAiB;IACjB,iBAAiB,EAAE,MAAM,CAAC,mBAAmB,CAAC;IAC9C,YAAY,EAAE,MAAM,CAAC,cAAc,CAAC;IACpC,YAAY;CACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"V3TransferBoardsController.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/controllers/v3/V3TransferBoardsController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAEA,qDAAoD;AACpD,wEAAuE;AACvE,gEAA+D;AAC/D,wEAAuE;AACvE,uEAA+D;AAC/D,+FAA6F;AAE7F,6EAAwE;AACxE,gGAA2E;
|
|
1
|
+
{"version":3,"file":"V3TransferBoardsController.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/controllers/v3/V3TransferBoardsController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAEA,qDAAoD;AACpD,wEAAuE;AACvE,gEAA+D;AAC/D,wEAAuE;AACvE,uEAA+D;AAC/D,+FAA6F;AAE7F,6EAAwE;AACxE,gGAA2E;AAE3E,iEAAwE;AAIjE,IAAM,0BAA0B,wCAAhC,MAAM,0BAA0B;IACnC,YACmC,UAA8B,EAC1B,cAAsC,EACtC,cAAsC;QAFlC,eAAU,GAAV,UAAU,CAAY;QAClB,mBAAc,GAAd,cAAc,CAAgB;QAC9B,mBAAc,GAAd,cAAc,CAAgB;QAGtE,0BAAqB,GAAmB,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YACpE,MAAM,IAAI,GAAG,IAAA,gCAAe,EAAC,kDAAkD,CAAC,CAAC;YAEjF,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC;YAC9B,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC;YAChD,IAAI,EAAE,aAAa,CAAC,EA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;QACrC,CAAC,CAAC;IA/EC,CAAC;CAgFP,CAAA;qCArFY,0BAA0B;IADtC,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,UAAU,CAAC,CAAA;IAC7B,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,cAAc,CAAC,CAAA;IACjC,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,cAAc,CAAC,CAAA;qCAFiB,uBAAU;QACF,+BAAc;QACd,+BAAc;GAJpE,0BAA0B,CAqFtC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="express" />
|
|
2
|
+
import { InfotextFacade } from "../../service/facade/InfotextFacade";
|
|
3
|
+
import { StopFacade } from "../../service/facade/StopFacade";
|
|
4
|
+
import { TransferFacade } from "../../service/facade/TransferFacade";
|
|
5
|
+
import { RequestHandler } from "@golemio/core/dist/shared/express";
|
|
6
|
+
import { TransferDepartureCacheTransformation } from "../../service/transformations/TransferDepartureCacheTransformation";
|
|
7
|
+
export declare class V4TransferBoardsController {
|
|
8
|
+
private stopFacade;
|
|
9
|
+
private infotextFacade;
|
|
10
|
+
private transferFacade;
|
|
11
|
+
private transformation;
|
|
12
|
+
private readonly defaultTransferBoardsLimit;
|
|
13
|
+
constructor(stopFacade: StopFacade, infotextFacade: InfotextFacade, transferFacade: TransferFacade, transformation: TransferDepartureCacheTransformation);
|
|
14
|
+
getTransferBoardData: RequestHandler;
|
|
15
|
+
private parseTransferBoardsParams;
|
|
16
|
+
private getTimeFrom;
|
|
17
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.V4TransferBoardsController = void 0;
|
|
19
|
+
const TransferBoardFilter_1 = require("../../helpers/TransferBoardFilter");
|
|
20
|
+
const TransferBoardSorter_1 = require("../../helpers/TransferBoardSorter");
|
|
21
|
+
const OgPidToken_1 = require("../../ioc/OgPidToken");
|
|
22
|
+
const InfotextFacade_1 = require("../../service/facade/InfotextFacade");
|
|
23
|
+
const StopFacade_1 = require("../../service/facade/StopFacade");
|
|
24
|
+
const TransferFacade_1 = require("../../service/facade/TransferFacade");
|
|
25
|
+
const shared_1 = require("../../../shared");
|
|
26
|
+
const trace_provider_1 = require("@golemio/core/dist/monitoring/opentelemetry/trace-provider");
|
|
27
|
+
const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
|
|
28
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
29
|
+
const TransferDepartureCacheTransformation_1 = require("../../service/transformations/TransferDepartureCacheTransformation");
|
|
30
|
+
const DepartureCalculator_1 = require("../../../shared/DepartureCalculator");
|
|
31
|
+
const DEFAULT_TRANSFER_BOARDS_LIMIT = 8;
|
|
32
|
+
let V4TransferBoardsController = exports.V4TransferBoardsController = class V4TransferBoardsController {
|
|
33
|
+
constructor(stopFacade, infotextFacade, transferFacade, transformation) {
|
|
34
|
+
this.stopFacade = stopFacade;
|
|
35
|
+
this.infotextFacade = infotextFacade;
|
|
36
|
+
this.transferFacade = transferFacade;
|
|
37
|
+
this.transformation = transformation;
|
|
38
|
+
this.defaultTransferBoardsLimit = DEFAULT_TRANSFER_BOARDS_LIMIT;
|
|
39
|
+
this.getTransferBoardData = async (req, res, next) => {
|
|
40
|
+
const span = (0, trace_provider_1.createChildSpan)("V4TransferBoardsController.getTransferBoardData");
|
|
41
|
+
try {
|
|
42
|
+
const params = this.parseTransferBoardsParams(req.query);
|
|
43
|
+
span?.setAttributes(Object.fromEntries(Object.entries(params).filter(([_, value]) => value !== null)));
|
|
44
|
+
const now = new Date();
|
|
45
|
+
let timeFrom = null;
|
|
46
|
+
if (params.timeFrom !== null) {
|
|
47
|
+
timeFrom = moment_timezone_1.default.tz(params.timeFrom, shared_1.RopidRouterUtils.TIMEZONE).toDate();
|
|
48
|
+
}
|
|
49
|
+
//#region GTFS stops
|
|
50
|
+
let stopIds = [];
|
|
51
|
+
let transferCacheDto = undefined;
|
|
52
|
+
let infotextsToInclude = [];
|
|
53
|
+
try {
|
|
54
|
+
if ("aswId" in params && typeof params.aswId === "string") {
|
|
55
|
+
stopIds = await this.stopFacade.getStopIdsForTransferBoardsByAswId(params.aswId);
|
|
56
|
+
//#region Transfer departures and infotexts
|
|
57
|
+
if (stopIds.length === 0) {
|
|
58
|
+
return res.status(404).json({
|
|
59
|
+
departures: [],
|
|
60
|
+
infotexts: [],
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
const [transferCache, infotexts] = await Promise.all([
|
|
65
|
+
this.transferFacade.getTransferCache(stopIds, parseInt(params.vehicleRegistrationNumber ?? "0", 10), params.routeType),
|
|
66
|
+
this.infotextFacade.getInfotextsCache(stopIds, now, timeFrom),
|
|
67
|
+
]);
|
|
68
|
+
infotextsToInclude = infotexts;
|
|
69
|
+
transferCacheDto = transferCache;
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
span?.recordException(error);
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
}
|
|
77
|
+
else if ("cisId" in params && typeof params.cisId === "number") {
|
|
78
|
+
// TODO: add support for trains
|
|
79
|
+
// stopIds = await this.stopFacade.getStopIdsForTransferBoardsByCisId(`${params.cisId!}`);
|
|
80
|
+
return res.status(501).json({ message: "EP is not ready for cisId+tripNumber yet" });
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
return res.status(400).json({
|
|
84
|
+
message: "Either an aswId (and no cisId), or a cisId (and no aswId) must be provided",
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
span?.recordException(error);
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
// add predictedDeparture to transfers
|
|
94
|
+
transferCacheDto.transfers = transferCacheDto.transfers.map((t) => {
|
|
95
|
+
t.departure.predictedDepartureDate = DepartureCalculator_1.DepartureCalculator.getPredictedDepartureTime(new Date(t.departure.departure_datetime), t.departure.arrival_datetime ? new Date(t.departure.arrival_datetime) : null, t.position?.delay ?? null);
|
|
96
|
+
t.departure.predictedDepartureTimestamp = t.departure.predictedDepartureDate.getTime();
|
|
97
|
+
return t;
|
|
98
|
+
});
|
|
99
|
+
TransferBoardSorter_1.TransferBoardSorter.sortDepartures(transferCacheDto.transfers);
|
|
100
|
+
const transformedData = this.transformation.transformArray(transferCacheDto.transfers);
|
|
101
|
+
const flitredData = TransferBoardFilter_1.TransferBoardFilter.filterDepartures(transformedData, this.defaultTransferBoardsLimit, this.getTimeFrom(transferCacheDto.currentTrip));
|
|
102
|
+
const output = {
|
|
103
|
+
platform_code: transferCacheDto.currentTrip.stopTime?.platform_code ??
|
|
104
|
+
transferCacheDto.currentTrip.stopTime?.cis_stop_platform_code,
|
|
105
|
+
stop_name: transferCacheDto.currentTrip.stopTime?.stop_name,
|
|
106
|
+
departures: flitredData,
|
|
107
|
+
infotexts: infotextsToInclude,
|
|
108
|
+
icons: [],
|
|
109
|
+
};
|
|
110
|
+
return res.status(200).json(output);
|
|
111
|
+
}
|
|
112
|
+
catch (err) {
|
|
113
|
+
next(err);
|
|
114
|
+
}
|
|
115
|
+
finally {
|
|
116
|
+
span?.end();
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
parseTransferBoardsParams(query) {
|
|
121
|
+
return {
|
|
122
|
+
aswId: (query.aswId ?? null),
|
|
123
|
+
cisId: (query.cisId ?? null),
|
|
124
|
+
tripNumber: (query.tripNumber ?? null),
|
|
125
|
+
vehicleRegistrationNumber: (query.vehicleRegistrationNumber ?? null),
|
|
126
|
+
routeType: query.routeType,
|
|
127
|
+
timeFrom: (query.timeFrom ?? null),
|
|
128
|
+
limit: (query.limit ?? this.defaultTransferBoardsLimit),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
getTimeFrom({ departure, position }) {
|
|
132
|
+
if (!departure?.arrival_datetime || !position) {
|
|
133
|
+
return new Date().getTime();
|
|
134
|
+
}
|
|
135
|
+
const arrivalDate = new Date(departure.arrival_datetime);
|
|
136
|
+
if (!position.delay) {
|
|
137
|
+
return arrivalDate.getTime();
|
|
138
|
+
}
|
|
139
|
+
arrivalDate.setSeconds(arrivalDate.getSeconds() + position.delay);
|
|
140
|
+
return arrivalDate.getTime();
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
exports.V4TransferBoardsController = V4TransferBoardsController = __decorate([
|
|
144
|
+
(0, tsyringe_1.injectable)(),
|
|
145
|
+
__param(0, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.StopFacade)),
|
|
146
|
+
__param(1, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.InfotextFacade)),
|
|
147
|
+
__param(2, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.TransferFacade)),
|
|
148
|
+
__param(3, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.TransferDepartureCacheTransformation)),
|
|
149
|
+
__metadata("design:paramtypes", [StopFacade_1.StopFacade,
|
|
150
|
+
InfotextFacade_1.InfotextFacade,
|
|
151
|
+
TransferFacade_1.TransferFacade,
|
|
152
|
+
TransferDepartureCacheTransformation_1.TransferDepartureCacheTransformation])
|
|
153
|
+
], V4TransferBoardsController);
|
|
154
|
+
//# sourceMappingURL=V4TransferBoardsController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V4TransferBoardsController.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/controllers/v4/V4TransferBoardsController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAEA,2EAA0E;AAC1E,2EAA0E;AAC1E,qDAAoD;AACpD,wEAAuE;AACvE,gEAA+D;AAC/D,wEAAuE;AACvE,4CAA8C;AAC9C,+FAA6F;AAE7F,gGAA+D;AAE/D,iEAAwE;AAExE,6HAA4H;AAC5H,6EAAqE;AAErE,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAGjC,IAAM,0BAA0B,wCAAhC,MAAM,0BAA0B;IAGnC,YACmC,UAA8B,EAC1B,cAAsC,EACtC,cAAsC,EAChB,cAA4D;QAH9E,eAAU,GAAV,UAAU,CAAY;QAClB,mBAAc,GAAd,cAAc,CAAgB;QAC9B,mBAAc,GAAd,cAAc,CAAgB;QACR,mBAAc,GAAd,cAAc,CAAsC;QANxG,+BAA0B,GAAG,6BAA6B,CAAC;QASrE,yBAAoB,GAAmB,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YACnE,MAAM,IAAI,GAAG,IAAA,gCAAe,EAAC,iDAAiD,CAAC,CAAC;YAChF,IAAI;gBACA,MAAM,MAAM,GAAG,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,KAAK,CAAC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
2
|
+
timeFrom: string | null;
|
|
3
|
+
limit: number;
|
|
4
|
+
}
|
|
5
|
+
export interface ITransferBoardsAswIdBased extends ITransferBoardsBasic {
|
|
6
|
+
aswId: string | null;
|
|
7
|
+
vehicleRegistrationNumber: string | null;
|
|
8
|
+
routeType: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ITransferBoardsCisIdBased extends ITransferBoardsBasic {
|
|
11
|
+
cisId: number | null;
|
|
12
|
+
tripNumber: number | null;
|
|
13
|
+
}
|
|
14
|
+
export type ITransferBoardsParams = ITransferBoardsAswIdBased | ITransferBoardsCisIdBased;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITransferBoardsParams.js","sourceRoot":"","sources":["../../../../../../src/output-gateway/pid/controllers/v4/interfaces/ITransferBoardsParams.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IJISTranslationText } from "../../../schema-definitions/jis/datasources/interfaces";
|
|
1
2
|
import { JISInfotextsModel } from "../../../schema-definitions/jis/models/JISInfotextsModel";
|
|
2
3
|
import { InfotextDisplayType } from "./InfotextDisplayTypeEnum";
|
|
3
4
|
import { InfotextPriority } from "./InfotextPriorityEnum";
|
|
@@ -23,6 +24,10 @@ export interface IInfotextTransferOutputDto {
|
|
|
23
24
|
text: string;
|
|
24
25
|
text_en: string | null;
|
|
25
26
|
}
|
|
27
|
+
export interface IV4InfotextTransferOutputDto {
|
|
28
|
+
display_type: InfotextDisplayType;
|
|
29
|
+
text: IJISTranslationText;
|
|
30
|
+
}
|
|
26
31
|
export interface IInfotextOverviewOutputDto {
|
|
27
32
|
id: string;
|
|
28
33
|
priority: InfotextPriority;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { JISInfotextsModel } from "../../../schema-definitions/jis/models/JISInfotextsModel";
|
|
2
|
+
import { IJISInfotextDto } from "../../../schema-definitions/jis/redis/interfaces/IJISInfotextDto";
|
|
3
|
+
type InfotextUnion = JISInfotextsModel | IJISInfotextDto;
|
|
2
4
|
export declare class JISInfotextStopSuppressionFilter {
|
|
3
|
-
filterBySeverityLevel(list:
|
|
5
|
+
filterBySeverityLevel<T extends InfotextUnion>(list: T[]): T[];
|
|
4
6
|
private isStopPresentInHigherSeverityLevels;
|
|
5
7
|
private mapSeverityLevelToNumber;
|
|
6
8
|
}
|
|
9
|
+
export {};
|
|
@@ -24,7 +24,13 @@ let JISInfotextStopSuppressionFilter = exports.JISInfotextStopSuppressionFilter
|
|
|
24
24
|
const severity = this.mapSeverityLevelToNumber(infotext.severity_level);
|
|
25
25
|
for (let i = infotext.stops.length - 1; i >= 0; i--) {
|
|
26
26
|
const stop = infotext.stops[i];
|
|
27
|
-
|
|
27
|
+
let stopId;
|
|
28
|
+
if ("getDataValue" in stop && typeof stop.getDataValue === "function") {
|
|
29
|
+
stopId = stop.getDataValue("stop_id");
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
stopId = stop.stop_id;
|
|
33
|
+
}
|
|
28
34
|
if (severity === MAX_SEVERITY_LEVEL) {
|
|
29
35
|
stopsBySeverity.get(severity).add(stopId);
|
|
30
36
|
continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JISInfotextStopSuppressionFilter.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/helpers/JISInfotextStopSuppressionFilter.ts"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"JISInfotextStopSuppressionFilter.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/helpers/JISInfotextStopSuppressionFilter.ts"],"names":[],"mappings":";;;;;;;;;AAEA,uCAAsC;AAEtC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAKtB,IAAM,gCAAgC,8CAAtC,MAAM,gCAAgC;IAClC,qBAAqB,CAA0B,IAAS;QAC3D,MAAM,eAAe,GAAG,IAAI,GAAG,CAAsB;YACjD,CAAC,kBAAkB,EAAE,IAAI,GAAG,EAAU,CAAC;YACvC,CA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C,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC3B,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAC/B;SACJ;QAED,OAAO,YAAY,CAAC;IACxB,CAAC;IAEO,mCAAmC,CACvC,eAAuB,EACvB,MAAc,EACd,eAAyC;QAEzC,KAAK,IAAI,CAAC,GAAG,eAAe,GAAG,CAAC,EAAE,CAAC,IAAI,kBAAkB,EAAE,CAAC,EAAE,EAAE;YAC5D,IAAI,eAAe,CAAC,GAAG,CAAC,CAAC,CAAE,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;gBACrC,OAAO,IAAI,CAAC;aACf;SACJ;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAEO,wBAAwB,CAAC,aAAqB;QAClD,QAAQ,aAAa,EAAE;YACnB,KAAK,QAAQ;gBACT,OAAO,kBAAkB,CAAC;YAC9B,KAAK,SAAS;gBACV,OAAO,CAAC,CAAC;YACb,KAAK,MAAM,CAAC;YACZ;gBACI,OAAO,CAAC,CAAC;SAChB;IACL,CAAC;CACJ,CAAA;2CAzEY,gCAAgC;IAD5C,IAAA,qBAAU,GAAE;GACA,gCAAgC,CAyE5C"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransferBoardFilter = void 0;
|
|
4
|
+
class TransferBoardFilter {
|
|
5
|
+
static filterDepartures(transfers, limit, timeFrom) {
|
|
6
|
+
const filteredDepartures = [];
|
|
7
|
+
for (const transfer of transfers) {
|
|
8
|
+
if (filteredDepartures.length === limit) {
|
|
9
|
+
break;
|
|
10
|
+
}
|
|
11
|
+
if (!this.isInRange(transfer, timeFrom)) {
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
filteredDepartures.push(transfer);
|
|
15
|
+
}
|
|
16
|
+
// Departures are already sorted so that metro ones are first
|
|
17
|
+
return filteredDepartures;
|
|
18
|
+
}
|
|
19
|
+
static isInRange(departure, timeFrom) {
|
|
20
|
+
const timeRangeStart = timeFrom;
|
|
21
|
+
// add one hour
|
|
22
|
+
const timeRangeEnd = timeFrom + 60 * 60 * 1000;
|
|
23
|
+
const departureMinutes = departure.departure_timestamp.minutes[0] === "<1" ? 1 : Number(departure.departure_timestamp.minutes[0]);
|
|
24
|
+
if (isNaN(departureMinutes))
|
|
25
|
+
return false;
|
|
26
|
+
// Calculate the departure time
|
|
27
|
+
const departureTime = timeRangeStart + departureMinutes * 60 * 1000;
|
|
28
|
+
// Check if departureTime is within the range
|
|
29
|
+
return departureTime >= timeRangeStart && departureTime <= timeRangeEnd;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.TransferBoardFilter = TransferBoardFilter;
|
|
33
|
+
//# sourceMappingURL=TransferBoardFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransferBoardFilter.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/helpers/TransferBoardFilter.ts"],"names":[],"mappings":";;;AAEA,MAAa,mBAAmB;IACrB,MAAM,CAAC,gBAAgB,CAC1B,SAA0C,EAC1C,KAAa,EACb,QAAgB;QAEhB,MAAM,kBAAkB,GAAoC,EAAE,CAAC;QAE/D,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;YAC9B,IAAI,kBAAkB,CAAC,MAAM,KAAK,KAAK,EAAE;gBACrC,MAAM;aACT;YACD,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE;gBACrC,SAAS;aACZ;YACD,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACrC;QAED,6DAA6D;QAC7D,OAAO,kBAAkB,CAAC;IAC9B,CAAC;IACO,MAAM,CAAC,SAAS,CAAC,SAAwC,EAAE,QAAgB;QAC/E,MAAM,cAAc,GAAG,QAAQ,CAAC;QAChC,eAAe;QACf,MAAM,YAAY,GAAG,QAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QAE/C,MAAM,gBAAgB,GAClB,SAAS,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7G,IAAI,KAAK,CAAC,gBAAgB,CAAC;YAAE,OAAO,KAAK,CAAC;QAE1C,+BAA+B;QAC/B,MAAM,aAAa,GAAG,cAAc,GAAG,gBAAgB,GAAG,EAAE,GAAG,IAAI,CAAC;QAEpE,6CAA6C;QAC7C,OAAO,aAAa,IAAI,cAAc,IAAI,aAAa,IAAI,YAAY,CAAC;IAC5E,CAAC;CACJ;AApCD,kDAoCC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.TransferBoardSorter = void 0;
|
|
5
|
+
const RouteTypeEnums_1 = require("../../../helpers/RouteTypeEnums");
|
|
6
|
+
class TransferBoardSorter {
|
|
7
|
+
static sortDepartures(departures) {
|
|
8
|
+
departures.sort((a, b) => {
|
|
9
|
+
for (const compareFn of this.compareFnPipeline) {
|
|
10
|
+
const res = compareFn(a, b);
|
|
11
|
+
if (res !== 0)
|
|
12
|
+
return res;
|
|
13
|
+
}
|
|
14
|
+
return 0;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.TransferBoardSorter = TransferBoardSorter;
|
|
19
|
+
_a = TransferBoardSorter;
|
|
20
|
+
TransferBoardSorter.compareFns = {
|
|
21
|
+
metroFirst: (a, b) => {
|
|
22
|
+
const aIsMetro = a.departure.route_type === RouteTypeEnums_1.GTFSRouteTypeEnum.METRO;
|
|
23
|
+
const bIsMetro = b.departure.route_type === RouteTypeEnums_1.GTFSRouteTypeEnum.METRO;
|
|
24
|
+
if (aIsMetro !== bIsMetro)
|
|
25
|
+
return aIsMetro ? -1 : 1;
|
|
26
|
+
return 0;
|
|
27
|
+
},
|
|
28
|
+
metroNameAsc: (a, b) => {
|
|
29
|
+
const aIsMetro = a.departure.route_type === RouteTypeEnums_1.GTFSRouteTypeEnum.METRO;
|
|
30
|
+
const bIsMetro = b.departure.route_type === RouteTypeEnums_1.GTFSRouteTypeEnum.METRO;
|
|
31
|
+
if (aIsMetro && bIsMetro && a.departure.route_short_name !== null && b.departure.route_short_name !== null)
|
|
32
|
+
return a.departure.route_short_name.localeCompare(b.departure.route_short_name);
|
|
33
|
+
return 0;
|
|
34
|
+
},
|
|
35
|
+
departureTimeAsc: (a, b) => {
|
|
36
|
+
const aTimestamp = a.departure.predictedDepartureTimestamp;
|
|
37
|
+
const bTimestamp = b.departure.predictedDepartureTimestamp;
|
|
38
|
+
if (aTimestamp && bTimestamp) {
|
|
39
|
+
return aTimestamp - bTimestamp;
|
|
40
|
+
}
|
|
41
|
+
if (!aTimestamp && !bTimestamp)
|
|
42
|
+
return 0;
|
|
43
|
+
if (!bTimestamp)
|
|
44
|
+
return -1;
|
|
45
|
+
return 1;
|
|
46
|
+
},
|
|
47
|
+
directionIdAsc: (a, b) => {
|
|
48
|
+
const aDirectionId = a.position?.detailed_info.direction_id;
|
|
49
|
+
const bDirectionId = b.position?.detailed_info.direction_id;
|
|
50
|
+
if (aDirectionId !== bDirectionId)
|
|
51
|
+
return aDirectionId ? -1 : 1;
|
|
52
|
+
return 0;
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
TransferBoardSorter.compareFnPipeline = [
|
|
56
|
+
_a.compareFns.metroFirst,
|
|
57
|
+
_a.compareFns.metroNameAsc,
|
|
58
|
+
_a.compareFns.departureTimeAsc,
|
|
59
|
+
_a.compareFns.directionIdAsc,
|
|
60
|
+
];
|
|
61
|
+
//# sourceMappingURL=TransferBoardSorter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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AccessEnum } from "../../helpers/AccessibilityEnums";
|
|
2
2
|
import { GTFSRouteTypeEnum } from "../../helpers/RouteTypeEnums";
|
|
3
3
|
import { DeparturesDirectionsEnum } from "../../schema-definitions/ropid-departures-directions";
|
|
4
|
+
import { IPublicGtfsDepartureCacheDto } from "../../schema-definitions/ropid-gtfs/redis/interfaces/IPublicGtfsDepartureCacheDto";
|
|
5
|
+
import { IPublicApiCacheDto } from "../../schema-definitions/vehicle-positions/redis/interfaces/IPublicApiCacheDto";
|
|
6
|
+
import { IPublicStopTimeCacheDto } from "../../schema-definitions/vehicle-positions/redis/interfaces/IPublicStopTimeCacheDto";
|
|
7
|
+
import { IV4InfotextTransferOutputDto } from "./domain/InfotextInterfaces";
|
|
4
8
|
export * from "./routers";
|
|
5
9
|
export * from "./models";
|
|
6
10
|
export type DepartureUnion = IPIDDeparture | ITransferDeparture;
|
|
@@ -107,6 +111,52 @@ export interface ITransferOutputDto {
|
|
|
107
111
|
id: string;
|
|
108
112
|
};
|
|
109
113
|
}
|
|
114
|
+
export interface IV4TransferDto {
|
|
115
|
+
transfers: IDepartureWithPosition[];
|
|
116
|
+
currentTrip: ICurrentTrip;
|
|
117
|
+
}
|
|
118
|
+
export interface IDepartureWithPosition {
|
|
119
|
+
departure: IPublicGtfsDepartureCacheDto & {
|
|
120
|
+
predictedDepartureDate?: Date;
|
|
121
|
+
predictedDepartureTimestamp?: number;
|
|
122
|
+
};
|
|
123
|
+
position: IPublicApiCacheDto | null;
|
|
124
|
+
stopTime: IPublicStopTimeCacheDto | null;
|
|
125
|
+
}
|
|
126
|
+
export interface ICurrentTrip {
|
|
127
|
+
departure: IPublicGtfsDepartureCacheDto | null;
|
|
128
|
+
position: IPublicApiCacheDto | null;
|
|
129
|
+
stopTime: IPublicStopTimeCacheDto | null;
|
|
130
|
+
}
|
|
131
|
+
export interface IV4TransferDepartureOutputDto {
|
|
132
|
+
departure_timestamp: {
|
|
133
|
+
minutes: string[];
|
|
134
|
+
};
|
|
135
|
+
route: {
|
|
136
|
+
short_name: string | null;
|
|
137
|
+
type: number | null;
|
|
138
|
+
};
|
|
139
|
+
stop: {
|
|
140
|
+
platform_code: string | null;
|
|
141
|
+
};
|
|
142
|
+
trip: {
|
|
143
|
+
headsign: string;
|
|
144
|
+
id: string;
|
|
145
|
+
is_wheelchair_accessible: boolean | null;
|
|
146
|
+
};
|
|
147
|
+
icons: string[];
|
|
148
|
+
substitution_text: {
|
|
149
|
+
cs: string;
|
|
150
|
+
en: string | null;
|
|
151
|
+
} | null;
|
|
152
|
+
}
|
|
153
|
+
export interface IV4TransferOutputDto {
|
|
154
|
+
platform_code?: string | null;
|
|
155
|
+
stop_name?: string | null;
|
|
156
|
+
icons: string[];
|
|
157
|
+
departures: IV4TransferDepartureOutputDto[];
|
|
158
|
+
infotexts: IV4InfotextTransferOutputDto[];
|
|
159
|
+
}
|
|
110
160
|
export interface IStop {
|
|
111
161
|
stop_id: string;
|
|
112
162
|
stop_name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/pid/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/pid/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAQA,4CAA0B;AAC1B,2CAAyB;AAgKzB,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,0CAAyB,CAAA;IACzB,sCAAqB,CAAA;IACrB,gCAAe,CAAA;AACnB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAED,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,+BAAa,CAAA;IACb,yCAAuB,CAAA;AAC3B,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED,IAAY,eAQX;AARD,WAAY,eAAe;IACvB,gCAAa,CAAA;IACb,2CAAwB,CAAA;IACxB,0DAAuC,CAAA;IACvC,oDAAiC,CAAA;IACjC,mEAAgD,CAAA;IAChD,qEAAkD,CAAA;IAClD,8EAA2D,CAAA;AAC/D,CAAC,EARW,eAAe,+BAAf,eAAe,QAQ1B;AAED,IAAY,aAMX;AAND,WAAY,aAAa;IACrB,wCAAuB,CAAA;IACvB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,mCAAkB,CAAA;IAClB,8BAA8B;AAClC,CAAC,EANW,aAAa,6BAAb,aAAa,QAMxB"}
|