@golemio/pid 3.4.0 → 3.4.1-dev.1622739356
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/input-gateway/jis/JisInfotextsController.js +4 -13
- package/dist/input-gateway/jis/JisInfotextsController.js.map +1 -1
- package/dist/input-gateway/jis/JisInfotextsRouter.js +3 -12
- package/dist/input-gateway/jis/JisInfotextsRouter.js.map +1 -1
- package/dist/input-gateway/ropid-gtfs/RopidGtfsController.js +4 -13
- package/dist/input-gateway/ropid-gtfs/RopidGtfsController.js.map +1 -1
- package/dist/input-gateway/ropid-gtfs/RopidGtfsRouter.js +3 -12
- package/dist/input-gateway/ropid-gtfs/RopidGtfsRouter.js.map +1 -1
- package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js +4 -13
- package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js.map +1 -1
- package/dist/input-gateway/vehicle-positions/VehiclePositionsRouter.js +3 -12
- package/dist/input-gateway/vehicle-positions/VehiclePositionsRouter.js.map +1 -1
- package/dist/integration-engine/data-retention/workers/tasks/DeleteDataTask.js +4 -15
- package/dist/integration-engine/data-retention/workers/tasks/DeleteDataTask.js.map +1 -1
- package/dist/integration-engine/data-retention/workers/tasks/TableStorageRetentionTask.js +8 -19
- package/dist/integration-engine/data-retention/workers/tasks/TableStorageRetentionTask.js.map +1 -1
- package/dist/integration-engine/jis/datasources/JISInfotextsDataSourceFactory.js +1 -1
- package/dist/integration-engine/jis/datasources/JISInfotextsDataSourceFactory.js.map +1 -1
- package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js +56 -72
- package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js.map +1 -1
- package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.js +32 -48
- package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.js.map +1 -1
- package/dist/integration-engine/jis/repositories/JISMetadataRepository.js +24 -37
- package/dist/integration-engine/jis/repositories/JISMetadataRepository.js.map +1 -1
- package/dist/integration-engine/jis/services/JISInfotextsDataService.js +24 -35
- package/dist/integration-engine/jis/services/JISInfotextsDataService.js.map +1 -1
- package/dist/integration-engine/jis/transformations/JISInfotextsTransformation.js +2 -3
- package/dist/integration-engine/jis/transformations/JISInfotextsTransformation.js.map +1 -1
- package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.js +12 -23
- package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.js.map +1 -1
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js +4 -15
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/RopidGTFSStopTimesModel.js +3 -12
- package/dist/integration-engine/ropid-gtfs/RopidGTFSStopTimesModel.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js +2 -11
- package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/RopidGTFSTripsModel.js +3 -12
- package/dist/integration-engine/ropid-gtfs/RopidGTFSTripsModel.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.js +21 -30
- package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/RopidGtfsMetadataRepository.js +20 -29
- package/dist/integration-engine/ropid-gtfs/RopidGtfsMetadataRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/RopidGtfsRepository.js +33 -52
- package/dist/integration-engine/ropid-gtfs/data-access/RopidGtfsRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/RouteSubAgencyRepository.js +12 -23
- package/dist/integration-engine/ropid-gtfs/data-access/RouteSubAgencyRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.js +12 -23
- package/dist/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/cache/PublicGtfsDepartureRepository.js +33 -44
- package/dist/integration-engine/ropid-gtfs/data-access/cache/PublicGtfsDepartureRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/cache/StaticFileRedisRepository.js +10 -21
- package/dist/integration-engine/ropid-gtfs/data-access/cache/StaticFileRedisRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.js +15 -24
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/MinMaxStopSequencesRepository.js +3 -12
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/MinMaxStopSequencesRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/ServicesCalendarRepository.js +3 -12
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/ServicesCalendarRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripScheduleRepository.js +4 -13
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripScheduleRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.js +30 -41
- package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/helpers/DataCacheManager.js +11 -22
- package/dist/integration-engine/ropid-gtfs/helpers/DataCacheManager.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js +1 -2
- package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.js +7 -16
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.js +3 -12
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.js +13 -17
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/data-access/PresetLogRepository.js +13 -22
- package/dist/integration-engine/ropid-gtfs/workers/presets/data-access/PresetLogRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/datasources/grafana-loki/GrafanaLokiDataSourceProvider.js +1 -2
- package/dist/integration-engine/ropid-gtfs/workers/presets/datasources/grafana-loki/GrafanaLokiDataSourceProvider.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/helpers/RopidMonitoringService.js +12 -23
- package/dist/integration-engine/ropid-gtfs/workers/presets/helpers/RopidMonitoringService.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CheckForNewDeparturesPresetsTask.js +14 -25
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CheckForNewDeparturesPresetsTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CollectAndSaveLogsTask.js +26 -37
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CollectAndSaveLogsTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/DownloadDeparturesPresetsTask.js +12 -23
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/DownloadDeparturesPresetsTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/ProcessAndSendLogsTask.js +36 -49
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/ProcessAndSendLogsTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/SavePresetsDataTask.js +3 -14
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/SavePresetsDataTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/transformations/PresetLogTransformation.js +1 -2
- package/dist/integration-engine/ropid-gtfs/workers/presets/transformations/PresetLogTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckForNewDataTask.js +29 -40
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckForNewDataTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js +64 -81
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/DownloadDatasetsTask.js +60 -79
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/DownloadDatasetsTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPrecomputedTablesTask.js +23 -34
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPrecomputedTablesTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask.js +26 -38
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/SaveStaticDataTask.js +21 -32
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/SaveStaticDataTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/TransformAndSaveDataTask.js +43 -55
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/TransformAndSaveDataTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/DeparturesDirectionRepository.js +8 -18
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/DeparturesDirectionRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/MetroRailtrackGPSRepository.js +11 -21
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/MetroRailtrackGPSRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js +8 -17
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js +19 -30
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/transformations/DeparturesDirectionTransformation.js +8 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/transformations/DeparturesDirectionTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-vymi/RopidVYMIEventsTransformation.js +31 -47
- package/dist/integration-engine/ropid-vymi/RopidVYMIEventsTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-vymi/models/RopidVYMIEventsRoutesModel.js +6 -17
- package/dist/integration-engine/ropid-vymi/models/RopidVYMIEventsRoutesModel.js.map +1 -1
- package/dist/integration-engine/ropid-vymi/models/RopidVYMIMetadataModel.js +4 -14
- package/dist/integration-engine/ropid-vymi/models/RopidVYMIMetadataModel.js.map +1 -1
- package/dist/integration-engine/ropid-vymi/workers/tasks/CheckForNewEventsTask.js +6 -17
- package/dist/integration-engine/ropid-vymi/workers/tasks/CheckForNewEventsTask.js.map +1 -1
- package/dist/integration-engine/ropid-vymi/workers/tasks/FetchAndProcessEventsTask.js +34 -31
- package/dist/integration-engine/ropid-vymi/workers/tasks/FetchAndProcessEventsTask.js.map +1 -1
- package/dist/integration-engine/ropid-vymi/workers/tasks/helpers/RopidVYMIApiHelper.js +3 -12
- package/dist/integration-engine/ropid-vymi/workers/tasks/helpers/RopidVYMIApiHelper.js.map +1 -1
- package/dist/integration-engine/shared/RopidMetadataModel.js +35 -45
- package/dist/integration-engine/shared/RopidMetadataModel.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/AlertsGenerator.js +13 -24
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/AlertsGenerator.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/VehicleDescriptor.js +9 -6
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/VehicleDescriptor.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.js +113 -128
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/transformations/AlertsTransformation.js +20 -34
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/transformations/AlertsTransformation.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/data-access/AbstractRunRepository.js +3 -12
- package/dist/integration-engine/vehicle-positions/workers/runs/data-access/AbstractRunRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/data-access/CommonRunsMessagesRepository.js +3 -12
- package/dist/integration-engine/vehicle-positions/workers/runs/data-access/CommonRunsMessagesRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/data-access/CommonRunsRepository.js +12 -21
- package/dist/integration-engine/vehicle-positions/workers/runs/data-access/CommonRunsRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/CommonMessageProcessor.js +7 -16
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/CommonMessageProcessor.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/CisLookupManager.js +22 -33
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/CisLookupManager.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/GtfsLookupManager.js +31 -44
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/GtfsLookupManager.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusRunsFacade.js +14 -25
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusRunsFacade.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/TripScheduleManager.js +25 -37
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/TripScheduleManager.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/ProcessMetroRunMessagesTask.js +53 -63
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/ProcessMetroRunMessagesTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/ProcessRegionalBusRunMessagesTask.js +57 -72
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/ProcessRegionalBusRunMessagesTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveArrivaCityRunsToDBTask.js +15 -26
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveArrivaCityRunsToDBTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveBusRunsToDBTask.js +10 -21
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveBusRunsToDBTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveMetroRunsToDBTask.js +19 -30
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveMetroRunsToDBTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveTramRunsToDBTask.js +10 -21
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveTramRunsToDBTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.js +5 -14
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessageProcessingTransformation.js +4 -14
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessageProcessingTransformation.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/RegionalBusRunsMessagesTransformation.js +1 -2
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/RegionalBusRunsMessagesTransformation.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/data-access/DescriptorRepository.js +35 -49
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/data-access/DescriptorRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/tasks/RefreshDescriptorsTask.js +11 -22
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/tasks/RefreshDescriptorsTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/transformations/DescriptorTransformation.js +2 -3
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/transformations/DescriptorTransformation.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/CisStopRepository.js +3 -12
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/CisStopRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsHistoryRepository.js +3 -12
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsHistoryRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsRepository.js +19 -29
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/StopTimesHistoryRepository.js +3 -12
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/StopTimesHistoryRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsHistoryRepository.js +3 -12
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsHistoryRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js +58 -55
- 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 +64 -79
- 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.js +46 -59
- 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/data-access/helpers/TripsMapper.js +39 -6
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/TripsMapper.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/metro/CachedMetroRailtrackLookup.js +8 -19
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/metro/CachedMetroRailtrackLookup.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/PublicStopTimeRepository.js +2 -13
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/PublicStopTimeRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DPPUtils.js +1 -2
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DPPUtils.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DelayComputationManager.js +10 -16
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DelayComputationManager.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.js +68 -40
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/TripStopsManager.js +5 -14
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/TripStopsManager.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/VPUtils.js +1 -2
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/VPUtils.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/anchor-points/AnchorPointSegmenter.js +1 -2
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/anchor-points/AnchorPointSegmenter.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/ComputeDelayHelper.js +4 -4
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/ComputeDelayHelper.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/AbstractDelayAtStop.js +1 -2
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/AbstractDelayAtStop.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/CommonDelayAtStop.js +4 -5
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/CommonDelayAtStop.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/MetroDelayAtStop.js +3 -4
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/MetroDelayAtStop.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-data/strategy/HttpGtfsTripDataFixer.js +7 -18
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-data/strategy/HttpGtfsTripDataFixer.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/AbstractGTFSTripRunManager.js +7 -16
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/AbstractGTFSTripRunManager.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripCommonRunManager.js +40 -57
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripCommonRunManager.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripMetroRunManager.js +36 -53
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripMetroRunManager.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/metro/MetroShapePointsFixer.js +32 -41
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/metro/MetroShapePointsFixer.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.js +61 -33
- 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/helpers/regional-bus/compute-positions/RegionalBusComputeDelayHelper.js +4 -4
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/compute-positions/RegionalBusComputeDelayHelper.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/compute-positions/strategy/BusDelayAtStop.js +4 -6
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/compute-positions/strategy/BusDelayAtStop.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/gtfs-trip-run/GtfsTripRegionalBusRunManager.js +38 -55
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/gtfs-trip-run/GtfsTripRegionalBusRunManager.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/DataRetentionTask.js +32 -45
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/DataRetentionTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/ProcessRegionalBusPositionsTask.js +81 -91
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/ProcessRegionalBusPositionsTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateDelayTask.js +43 -55
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateDelayTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateTrainDelayTask.js +37 -49
- 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/RefreshGtfsTripDataTask.js +7 -18
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshGtfsTripDataTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicStopTimeCacheTask.js +41 -52
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicStopTimeCacheTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicTripCacheTask.js +32 -43
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicTripCacheTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.js +95 -115
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateDelayTask.js +150 -162
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateDelayTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateGtfsTripIdTask.js +82 -94
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateGtfsTripIdTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateRunsGtfsTripIdTask.js +24 -35
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateRunsGtfsTripIdTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/abstract/AbstractPropagateDelayTask.js +15 -18
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/abstract/AbstractPropagateDelayTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/helpers/UpdateDelayLimiter.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/helpers/UpdateDelayLimiter.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js +11 -21
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/PublicApiTripTransformation.js +2 -3
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/PublicApiTripTransformation.js.map +1 -1
- package/dist/output-gateway/pid/controllers/v2/V2DepartureBoardsController.js +5 -15
- package/dist/output-gateway/pid/controllers/v2/V2DepartureBoardsController.js.map +1 -1
- package/dist/output-gateway/pid/controllers/v2/V2InfotextsController.js +4 -13
- package/dist/output-gateway/pid/controllers/v2/V2InfotextsController.js.map +1 -1
- package/dist/output-gateway/pid/controllers/v3/V3InfotextsController.js +4 -13
- package/dist/output-gateway/pid/controllers/v3/V3InfotextsController.js.map +1 -1
- package/dist/output-gateway/pid/controllers/v3/V3TransferBoardsController.js +8 -17
- package/dist/output-gateway/pid/controllers/v3/V3TransferBoardsController.js.map +1 -1
- package/dist/output-gateway/pid/data-access/DeparturesRepository.js +40 -53
- package/dist/output-gateway/pid/data-access/DeparturesRepository.js.map +1 -1
- package/dist/output-gateway/pid/data-access/JISInfotextRepository.js +62 -75
- package/dist/output-gateway/pid/data-access/JISInfotextRepository.js.map +1 -1
- package/dist/output-gateway/pid/helpers/DepartureBoardMapper.js +2 -3
- package/dist/output-gateway/pid/helpers/DepartureBoardMapper.js.map +1 -1
- package/dist/output-gateway/pid/helpers/ParamValidatorManager.js +6 -15
- package/dist/output-gateway/pid/helpers/ParamValidatorManager.js.map +1 -1
- package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js +11 -21
- package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js.map +1 -1
- package/dist/output-gateway/pid/models/RopidDeparturesDirectionsModel.js +20 -27
- package/dist/output-gateway/pid/models/RopidDeparturesDirectionsModel.js.map +1 -1
- package/dist/output-gateway/pid/models/RopidVYMIEventsStopsModel.js +16 -25
- package/dist/output-gateway/pid/models/RopidVYMIEventsStopsModel.js.map +1 -1
- package/dist/output-gateway/pid/models/helpers/PIDDepartureModel.js +2 -4
- package/dist/output-gateway/pid/models/helpers/PIDDepartureModel.js.map +1 -1
- package/dist/output-gateway/pid/service/facade/InfotextFacade.js +12 -23
- package/dist/output-gateway/pid/service/facade/InfotextFacade.js.map +1 -1
- package/dist/output-gateway/pid/service/facade/StopFacade.js +27 -38
- package/dist/output-gateway/pid/service/facade/StopFacade.js.map +1 -1
- package/dist/output-gateway/pid/service/facade/TransferFacade.js +32 -39
- package/dist/output-gateway/pid/service/facade/TransferFacade.js.map +1 -1
- package/dist/output-gateway/pid/service/transformations/JISInfotextDepartureTransformation.js +3 -4
- package/dist/output-gateway/pid/service/transformations/JISInfotextDepartureTransformation.js.map +1 -1
- package/dist/output-gateway/pid/service/transformations/JISInfotextOverviewTransformation.js +8 -12
- package/dist/output-gateway/pid/service/transformations/JISInfotextOverviewTransformation.js.map +1 -1
- package/dist/output-gateway/pid/service/transformations/JISInfotextTransferTransformation.js +1 -2
- package/dist/output-gateway/pid/service/transformations/JISInfotextTransferTransformation.js.map +1 -1
- package/dist/output-gateway/pid/service/transformations/TransferDepartureTransformation.js +1 -2
- package/dist/output-gateway/pid/service/transformations/TransferDepartureTransformation.js.map +1 -1
- package/dist/output-gateway/public/controllers/v2/V2PublicDepartureBoardsController.js +4 -13
- package/dist/output-gateway/public/controllers/v2/V2PublicDepartureBoardsController.js.map +1 -1
- package/dist/output-gateway/public/controllers/v2/V2PublicGtfsController.js +4 -13
- package/dist/output-gateway/public/controllers/v2/V2PublicGtfsController.js.map +1 -1
- package/dist/output-gateway/public/controllers/v2/V2PublicVehiclePositionsController.js +9 -18
- package/dist/output-gateway/public/controllers/v2/V2PublicVehiclePositionsController.js.map +1 -1
- package/dist/output-gateway/public/data-access/VehicleDescriptorCachedRepository.js +13 -26
- package/dist/output-gateway/public/data-access/VehicleDescriptorCachedRepository.js.map +1 -1
- package/dist/output-gateway/public/data-access/redis/DelayComputationRepository.js +22 -33
- package/dist/output-gateway/public/data-access/redis/DelayComputationRepository.js.map +1 -1
- package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js +9 -20
- package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js.map +1 -1
- package/dist/output-gateway/public/data-access/redis/PublicStopTimeRepository.js +23 -34
- package/dist/output-gateway/public/data-access/redis/PublicStopTimeRepository.js.map +1 -1
- package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.js +153 -172
- package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.js.map +1 -1
- package/dist/output-gateway/public/routers/v2/helpers/CustomStopIdGroupValidator.js +2 -2
- package/dist/output-gateway/public/routers/v2/helpers/CustomStopIdGroupValidator.js.map +1 -1
- package/dist/output-gateway/public/service/VPSubscriber.js +8 -19
- package/dist/output-gateway/public/service/VPSubscriber.js.map +1 -1
- package/dist/output-gateway/public/service/facade/DepartureBoardFacade.js +100 -117
- package/dist/output-gateway/public/service/facade/DepartureBoardFacade.js.map +1 -1
- package/dist/output-gateway/public/service/facade/DetailedTripFacade.js +18 -29
- package/dist/output-gateway/public/service/facade/DetailedTripFacade.js.map +1 -1
- package/dist/output-gateway/public/service/facade/GtfsTripLookupFacade.js +20 -31
- package/dist/output-gateway/public/service/facade/GtfsTripLookupFacade.js.map +1 -1
- package/dist/output-gateway/public/service/facade/VehiclePositionsFacade.js +15 -26
- package/dist/output-gateway/public/service/facade/VehiclePositionsFacade.js.map +1 -1
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/StopTimesTripScopeHandler.js +1 -2
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/StopTimesTripScopeHandler.js.map +1 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/InfoTripScopeHandler.js +3 -14
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/InfoTripScopeHandler.js.map +1 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.js +7 -18
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.js.map +1 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js +35 -46
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js.map +1 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler.js +16 -22
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler.js.map +1 -1
- package/dist/output-gateway/public/service/transformations/PublicDepartureTransformation.js +9 -10
- package/dist/output-gateway/public/service/transformations/PublicDepartureTransformation.js.map +1 -1
- package/dist/output-gateway/public/service/transformations/PublicVehiclePositionsTransformation.js +5 -15
- package/dist/output-gateway/public/service/transformations/PublicVehiclePositionsTransformation.js.map +1 -1
- package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripInfoTransformation.js +2 -3
- package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripInfoTransformation.js.map +1 -1
- package/dist/output-gateway/public/service/transformations/scopes/PublicVPTripInfoTransformation.js +2 -15
- package/dist/output-gateway/public/service/transformations/scopes/PublicVPTripInfoTransformation.js.map +1 -1
- package/dist/output-gateway/public/service/transformations/scopes/PublicVPTripStopTimesTransformation.js +1 -13
- package/dist/output-gateway/public/service/transformations/scopes/PublicVPTripStopTimesTransformation.js.map +1 -1
- package/dist/output-gateway/ropid-gtfs/data-access/CisStopGroupRepository.js +14 -25
- package/dist/output-gateway/ropid-gtfs/data-access/CisStopGroupRepository.js.map +1 -1
- package/dist/output-gateway/ropid-gtfs/models/GTFSCalendarModel.js +3 -12
- package/dist/output-gateway/ropid-gtfs/models/GTFSCalendarModel.js.map +1 -1
- package/dist/output-gateway/ropid-gtfs/models/GTFSRoutesModel.js +4 -13
- package/dist/output-gateway/ropid-gtfs/models/GTFSRoutesModel.js.map +1 -1
- package/dist/output-gateway/ropid-gtfs/models/GTFSShapesModel.js +5 -14
- package/dist/output-gateway/ropid-gtfs/models/GTFSShapesModel.js.map +1 -1
- package/dist/output-gateway/ropid-gtfs/models/GTFSStopModel.js +90 -102
- package/dist/output-gateway/ropid-gtfs/models/GTFSStopModel.js.map +1 -1
- package/dist/output-gateway/ropid-gtfs/models/GTFSStopTimesModel.js +3 -12
- package/dist/output-gateway/ropid-gtfs/models/GTFSStopTimesModel.js.map +1 -1
- package/dist/output-gateway/ropid-gtfs/models/GTFSTripsModel.js +43 -51
- package/dist/output-gateway/ropid-gtfs/models/GTFSTripsModel.js.map +1 -1
- package/dist/output-gateway/ropid-gtfs/routers/v2/V2GTFSRouter.js +28 -37
- package/dist/output-gateway/ropid-gtfs/routers/v2/V2GTFSRouter.js.map +1 -1
- package/dist/output-gateway/shared/DepartureCalculator.js +1 -1
- package/dist/output-gateway/shared/DepartureCalculator.js.map +1 -1
- package/dist/output-gateway/vehicle-positions/data-access/helpers/PositionOutputMapper.js +40 -48
- package/dist/output-gateway/vehicle-positions/data-access/helpers/PositionOutputMapper.js.map +1 -1
- package/dist/output-gateway/vehicle-positions/data-access/views/TripWithLastPositionRepository.js +7 -16
- package/dist/output-gateway/vehicle-positions/data-access/views/TripWithLastPositionRepository.js.map +1 -1
- package/dist/output-gateway/vehicle-positions/routers/v2/V2VehiclePositionsRouter.js +10 -19
- package/dist/output-gateway/vehicle-positions/routers/v2/V2VehiclePositionsRouter.js.map +1 -1
- package/dist/schema-definitions/ropid-gtfs/RopidGTFSRunNumbers.js +5 -2
- package/dist/schema-definitions/ropid-gtfs/RopidGTFSRunNumbers.js.map +1 -1
- package/dist/schema-definitions/ropid-gtfs/index.js +16 -4
- package/dist/schema-definitions/ropid-gtfs/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.DepartureBoardFacade = void 0;
|
|
13
4
|
const RouteTypeEnums_1 = require("../../../../helpers/RouteTypeEnums");
|
|
@@ -23,122 +14,114 @@ class DepartureBoardFacade {
|
|
|
23
14
|
this.descriptorRepository = descriptorRepository;
|
|
24
15
|
this.transformation = new PublicDepartureTransformation_1.PublicDepartureTransformation();
|
|
25
16
|
}
|
|
26
|
-
getAll(stopIds, limit, routeShortNames, minutesAfter) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
async getAll(stopIds, limit, routeShortNames, minutesAfter) {
|
|
18
|
+
let output;
|
|
19
|
+
const sortedStopGroups = this.sortStopGroupsByPriority(stopIds);
|
|
20
|
+
const promises = sortedStopGroups.map(async (stopGroup) => await this.handleStopGroupDepartures(stopGroup, limit, routeShortNames, minutesAfter));
|
|
21
|
+
try {
|
|
22
|
+
output = await Promise.all(promises);
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
if (err instanceof golemio_errors_1.AbstractGolemioError) {
|
|
26
|
+
throw err;
|
|
33
27
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
throw new golemio_errors_1.GeneralError("Error while retrieving cached data", this.constructor.name, err, 500);
|
|
29
|
+
}
|
|
30
|
+
if (output.every((value) => value === null)) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return output.map((value) => {
|
|
35
|
+
if (value === null) {
|
|
36
|
+
return [];
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (output.every((value) => value === null)) {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
return output.map((value) => {
|
|
45
|
-
if (value === null) {
|
|
46
|
-
return [];
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
return value;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
handleStopGroupDepartures(stopGroup, limit, routeShortNames, minutesAfter) {
|
|
56
|
-
var _a;
|
|
57
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
let outputGroup = [];
|
|
59
|
-
const spanDepartures = (0, trace_provider_1.createChildSpan)(`Departures.${stopGroup.priority}.getPublicDepartureCache`);
|
|
60
|
-
const departures = yield this.departureRepository.getPublicGtfsDepartureCache(stopGroup.stopIds, minutesAfter);
|
|
61
|
-
spanDepartures === null || spanDepartures === void 0 ? void 0 : spanDepartures.end();
|
|
62
|
-
if (departures.length === 0) {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
const spanPositions = (0, trace_provider_1.createChildSpan)(`Departures.${stopGroup.priority}.getAllVehiclePositions`);
|
|
66
|
-
const positionsByTrip = yield this.tripRepository.getAllVehiclePositionsForMultipleTrips(departures.map((departure) => departure.trip_id));
|
|
67
|
-
spanPositions === null || spanPositions === void 0 ? void 0 : spanPositions.end();
|
|
68
|
-
const spanTransform = (0, trace_provider_1.createChildSpan)(`Departures.${stopGroup.priority}.transformDepartures`);
|
|
69
|
-
try {
|
|
70
|
-
for (const departure of departures) {
|
|
71
|
-
if (Object.keys(departure).length === 0) {
|
|
72
|
-
continue;
|
|
73
|
-
}
|
|
74
|
-
const positions = (_a = positionsByTrip.get(departure.trip_id)) !== null && _a !== void 0 ? _a : [];
|
|
75
|
-
const duplicatedDepartures = yield this.duplicateDeparturesWithDifferentVehicleIds(departure, positions);
|
|
76
|
-
outputGroup = outputGroup.concat(duplicatedDepartures);
|
|
38
|
+
else {
|
|
39
|
+
return value;
|
|
77
40
|
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async handleStopGroupDepartures(stopGroup, limit, routeShortNames, minutesAfter) {
|
|
45
|
+
let outputGroup = [];
|
|
46
|
+
const spanDepartures = (0, trace_provider_1.createChildSpan)(`Departures.${stopGroup.priority}.getPublicDepartureCache`);
|
|
47
|
+
const departures = await this.departureRepository.getPublicGtfsDepartureCache(stopGroup.stopIds, minutesAfter);
|
|
48
|
+
spanDepartures?.end();
|
|
49
|
+
if (departures.length === 0) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
const spanPositions = (0, trace_provider_1.createChildSpan)(`Departures.${stopGroup.priority}.getAllVehiclePositions`);
|
|
53
|
+
const positionsByTrip = await this.tripRepository.getAllVehiclePositionsForMultipleTrips(departures.map((departure) => departure.trip_id));
|
|
54
|
+
spanPositions?.end();
|
|
55
|
+
const spanTransform = (0, trace_provider_1.createChildSpan)(`Departures.${stopGroup.priority}.transformDepartures`);
|
|
56
|
+
try {
|
|
57
|
+
for (const departure of departures) {
|
|
58
|
+
if (Object.keys(departure).length === 0) {
|
|
59
|
+
continue;
|
|
82
60
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
spanTransform === null || spanTransform === void 0 ? void 0 : spanTransform.end();
|
|
61
|
+
const positions = positionsByTrip.get(departure.trip_id) ?? [];
|
|
62
|
+
const duplicatedDepartures = await this.duplicateDeparturesWithDifferentVehicleIds(departure, positions);
|
|
63
|
+
outputGroup = outputGroup.concat(duplicatedDepartures);
|
|
87
64
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
// minutesBefore is set to 0 because we want to display departures that are already happening
|
|
93
|
-
// this may change in the future
|
|
94
|
-
outputGroup = DepartureGroupRefiner_1.DepartureGroupRefiner.removeDeparturesOutsideTimeRange(outputGroup, 0, minutesAfter).slice(0, limit);
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
if (err instanceof golemio_errors_1.AbstractGolemioError) {
|
|
68
|
+
throw err;
|
|
95
69
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
70
|
+
throw new golemio_errors_1.GeneralError("Error while retrieving cached data", this.constructor.name, err, 500);
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
spanTransform?.end();
|
|
74
|
+
}
|
|
75
|
+
const spanManipulate = (0, trace_provider_1.createChildSpan)(`Departures.${stopGroup.priority}.manipulateDepartures`);
|
|
76
|
+
try {
|
|
77
|
+
outputGroup = DepartureGroupRefiner_1.DepartureGroupRefiner.filterDeparturesByRouteShortNames(outputGroup, routeShortNames);
|
|
78
|
+
outputGroup = DepartureGroupRefiner_1.DepartureGroupRefiner.sortDeparturesByPredictedTimestamp(outputGroup);
|
|
79
|
+
// minutesBefore is set to 0 because we want to display departures that are already happening
|
|
80
|
+
// this may change in the future
|
|
81
|
+
outputGroup = DepartureGroupRefiner_1.DepartureGroupRefiner.removeDeparturesOutsideTimeRange(outputGroup, 0, minutesAfter).slice(0, limit);
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
throw new golemio_errors_1.GeneralError("Error while manipulating departures", this.constructor.name, err, 500);
|
|
85
|
+
}
|
|
86
|
+
finally {
|
|
87
|
+
spanManipulate?.end();
|
|
88
|
+
}
|
|
89
|
+
return outputGroup;
|
|
104
90
|
}
|
|
105
|
-
duplicateDeparturesWithDifferentVehicleIds(departure, vehiclePositions) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
stopTime: null,
|
|
117
|
-
}));
|
|
118
|
-
return outputGroup;
|
|
119
|
-
}
|
|
120
|
-
// Otherwise, we want to duplicate the departure for each vehicleId
|
|
121
|
-
// (multiple vehicles can be on the same trip at the same time)
|
|
122
|
-
for (const vehiclePosition of vehiclePositions) {
|
|
123
|
-
const vehicleDescriptor = (vehiclePosition === null || vehiclePosition === void 0 ? void 0 : vehiclePosition.detailed_info.registration_number)
|
|
124
|
-
? yield this.descriptorRepository.getOneByRegNumber(departure.route_type, vehiclePosition === null || vehiclePosition === void 0 ? void 0 : vehiclePosition.detailed_info.registration_number)
|
|
125
|
-
: null;
|
|
126
|
-
let currentStopTime = null;
|
|
127
|
-
// If the vehicle is a train, we need to get the current stop time
|
|
128
|
-
// to later determine the RT CIS platform code (trains don't have platform codes in GTFS)
|
|
129
|
-
if (vehiclePosition.route_type === RouteTypeEnums_1.GTFSRouteTypeEnum.TRAIN) {
|
|
130
|
-
const stopTimes = yield this.stopTimeRepository.getPublicStopTimeCache(vehiclePosition.vehicle_id, departure.trip_id);
|
|
131
|
-
currentStopTime = (_a = stopTimes.find((stopTime) => stopTime.sequence === departure.stop_sequence)) !== null && _a !== void 0 ? _a : null;
|
|
132
|
-
}
|
|
133
|
-
outputGroup.push(this.transformation.transformElement({
|
|
134
|
-
departure,
|
|
135
|
-
vehiclePosition,
|
|
136
|
-
vehicleDescriptor,
|
|
137
|
-
stopTime: currentStopTime,
|
|
138
|
-
}));
|
|
139
|
-
}
|
|
91
|
+
async duplicateDeparturesWithDifferentVehicleIds(departure, vehiclePositions) {
|
|
92
|
+
const outputGroup = [];
|
|
93
|
+
// If there are no RT data, we still want to display the departure
|
|
94
|
+
// but without any RT/vehicle information
|
|
95
|
+
if (vehiclePositions.length === 0) {
|
|
96
|
+
outputGroup.push(this.transformation.transformElement({
|
|
97
|
+
departure,
|
|
98
|
+
vehiclePosition: null,
|
|
99
|
+
vehicleDescriptor: null,
|
|
100
|
+
stopTime: null,
|
|
101
|
+
}));
|
|
140
102
|
return outputGroup;
|
|
141
|
-
}
|
|
103
|
+
}
|
|
104
|
+
// Otherwise, we want to duplicate the departure for each vehicleId
|
|
105
|
+
// (multiple vehicles can be on the same trip at the same time)
|
|
106
|
+
for (const vehiclePosition of vehiclePositions) {
|
|
107
|
+
const vehicleDescriptor = vehiclePosition?.detailed_info.registration_number
|
|
108
|
+
? await this.descriptorRepository.getOneByRegNumber(departure.route_type, vehiclePosition?.detailed_info.registration_number)
|
|
109
|
+
: null;
|
|
110
|
+
let currentStopTime = null;
|
|
111
|
+
// If the vehicle is a train, we need to get the current stop time
|
|
112
|
+
// to later determine the RT CIS platform code (trains don't have platform codes in GTFS)
|
|
113
|
+
if (vehiclePosition.route_type === RouteTypeEnums_1.GTFSRouteTypeEnum.TRAIN) {
|
|
114
|
+
const stopTimes = await this.stopTimeRepository.getPublicStopTimeCache(vehiclePosition.vehicle_id, departure.trip_id);
|
|
115
|
+
currentStopTime = stopTimes.find((stopTime) => stopTime.sequence === departure.stop_sequence) ?? null;
|
|
116
|
+
}
|
|
117
|
+
outputGroup.push(this.transformation.transformElement({
|
|
118
|
+
departure,
|
|
119
|
+
vehiclePosition,
|
|
120
|
+
vehicleDescriptor,
|
|
121
|
+
stopTime: currentStopTime,
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
return outputGroup;
|
|
142
125
|
}
|
|
143
126
|
sortStopGroupsByPriority(stopIds) {
|
|
144
127
|
return Array.from(stopIds).sort((a, b) => a.priority - b.priority);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DepartureBoardFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/service/facade/DepartureBoardFacade.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DepartureBoardFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/service/facade/DepartureBoardFacade.ts"],"names":[],"mappings":";;;AAAA,uEAA4D;AAU5D,+FAA6F;AAC7F,6EAA8F;AAC9F,4EAAyE;AACzE,oGAAiG;AAEjG,MAAa,oBAAoB;IAG7B,YACqB,mBAA6C,EAC7C,cAA2C,EAC3C,kBAAuC,EACvC,oBAAuD;QAHvD,wBAAmB,GAAnB,mBAAmB,CAA0B;QAC7C,mBAAc,GAAd,cAAc,CAA6B;QAC3C,uBAAkB,GAAlB,kBAAkB,CAAqB;QACvC,yBAAoB,GAApB,oBAAoB,CAAmC;QAExE,IAAI,CAAC,cAAc,GAAG,IAAI,6DAA6B,EAAE,CAAC;IAC9D,CAAC;IAEM,KAAK,CAAC,MAAM,CACf,OAA0C,EAC1C,KAAa,EACb,eAAgC,EAChC,YAAoB;QAEpB,IAAI,MAAkD,CAAC;QAEvD,MAAM,gBAAgB,GAAG,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAChE,MAAM,QAAQ,GAAG,gBAAgB,CAAC,GAAG,CACjC,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,IAAI,CAAC,yBAAyB,CAAC,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE,YAAY,CAAC,CAC7G,CAAC;QAEF,IAAI;YACA,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;SACxC;QAAC,OAAO,GAAG,EAAE;YACV,IAAI,GAAG,YAAY,qCAAoB,EAAE;gBACrC,MAAM,GAAG,CAAC;aACb;YAED,MAAM,IAAI,6BAAY,CAAC,oCAAoC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;SACjG;QACD,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,EAAE;YACzC,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;gBACxB,IAAI,KAAK,KAAK,IAAI,EAAE;oBAChB,OAAO,EAAE,CAAC;iBACb;qBAAM;oBACH,OAAO,KAAK,CAAC;iBAChB;YACL,CAAC,CAAC,CAAC;SACN;IACL,CAAC;IAEO,KAAK,CAAC,yBAAyB,CACnC,SAAuC,EACvC,KAAa,EACb,eAAgC,EAChC,YAAoB;QAEpB,IAAI,WAAW,GAAiC,EAAE,CAAC;QAEnD,MAAM,cAAc,GAAG,IAAA,gCAAe,EAAC,cAAc,SAAS,CAAC,QAAQ,0BAA0B,CAAC,CAAC;QACnG,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,2BAA2B,CAAC,SAAS,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QAC/G,cAAc,EAAE,GAAG,EAAE,CAAC;QACtB,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YACzB,OAAO,IAAI,CAAC;SACf;QACD,MAAM,aAAa,GAAG,IAAA,gCAAe,EAAC,cAAc,SAAS,CAAC,QAAQ,yBAAyB,CAAC,CAAC;QACjG,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,sCAAsC,CACpF,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CACnD,CAAC;QACF,aAAa,EAAE,GAAG,EAAE,CAAC;QAErB,MAAM,aAAa,GAAG,IAAA,gCAAe,EAAC,cAAc,SAAS,CAAC,QAAQ,sBAAsB,CAAC,CAAC;QAC9F,IAAI;YACA,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;gBAChC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;oBACrC,SAAS;iBACZ;gBACD,MAAM,SAAS,GAAG,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;gBAC/D,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAAC,0CAA0C,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;gBACzG,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;aAC1D;SACJ;QAAC,OAAO,GAAG,EAAE;YACV,IAAI,GAAG,YAAY,qCAAoB,EAAE;gBACrC,MAAM,GAAG,CAAC;aACb;YAED,MAAM,IAAI,6BAAY,CAAC,oCAAoC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;SACjG;gBAAS;YACN,aAAa,EAAE,GAAG,EAAE,CAAC;SACxB;QAED,MAAM,cAAc,GAAG,IAAA,gCAAe,EAAC,cAAc,SAAS,CAAC,QAAQ,uBAAuB,CAAC,CAAC;QAChG,IAAI;YACA,WAAW,GAAG,6CAAqB,CAAC,iCAAiC,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;YACpG,WAAW,GAAG,6CAAqB,CAAC,kCAAkC,CAAC,WAAW,CAAC,CAAC;YACpF,6FAA6F;YAC7F,gCAAgC;YAChC,WAAW,GAAG,6CAAqB,CAAC,gCAAgC,CAAC,WAAW,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;SACtH;QAAC,OAAO,GAAG,EAAE;YACV,MAAM,IAAI,6BAAY,CAAC,qCAAqC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;SAClG;gBAAS;YACN,cAAc,EAAE,GAAG,EAAE,CAAC;SACzB;QAED,OAAO,WAAW,CAAC;IACvB,CAAC;IAEO,KAAK,CAAC,0CAA0C,CACpD,SAAuC,EACvC,gBAAsC;QAEtC,MAAM,WAAW,GAAiC,EAAE,CAAC;QAErD,kEAAkE;QAClE,yCAAyC;QACzC,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE;YAC/B,WAAW,CAAC,IAAI,CACZ,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC;gBACjC,SAAS;gBACT,eAAe,EAAE,IAAI;gBACrB,iBAAiB,EAAE,IAAI;gBACvB,QAAQ,EAAE,IAAI;aACjB,CAAC,CACL,CAAC;YAEF,OAAO,WAAW,CAAC;SACtB;QAED,mEAAmE;QACnE,+DAA+D;QAC/D,KAAK,MAAM,eAAe,IAAI,gBAAgB,EAAE;YAC5C,MAAM,iBAAiB,GAAG,eAAe,EAAE,aAAa,CAAC,mBAAmB;gBACxE,CAAC,CAAC,MAAM,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAC7C,SAAS,CAAC,UAAU,EACpB,eAAe,EAAE,aAAa,CAAC,mBAAmB,CACrD;gBACH,CAAC,CAAC,IAAI,CAAC;YAEX,IAAI,eAAe,GAAmC,IAAI,CAAC;YAE3D,kEAAkE;YAClE,2FAA2F;YAC3F,IAAI,eAAe,CAAC,UAAU,KAAK,kCAAiB,CAAC,KAAK,EAAE;gBACxD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,sBAAsB,CAClE,eAAe,CAAC,UAAU,EAC1B,SAAS,CAAC,OAAO,CACpB,CAAC;gBAEF,eAAe,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,KAAK,SAAS,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC;aACzG;YAED,WAAW,CAAC,IAAI,CACZ,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC;gBACjC,SAAS;gBACT,eAAe;gBACf,iBAAiB;gBACjB,QAAQ,EAAE,eAAe;aAC5B,CAAC,CACL,CAAC;SACL;QAED,OAAO,WAAW,CAAC;IACvB,CAAC;IAEO,wBAAwB,CAAC,OAA0C;QACvE,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;IACvE,CAAC;CACJ;AAnKD,oDAmKC"}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.DetailedTripFacade = void 0;
|
|
13
4
|
const DetailedTripScopeEnum_1 = require("../../routers/v2/helpers/DetailedTripScopeEnum");
|
|
@@ -17,28 +8,26 @@ class DetailedTripFacade {
|
|
|
17
8
|
this.scopeHandlerFactory = scopeHandlerFactory;
|
|
18
9
|
this.vehiclePositionRepository = vehiclePositionRepository;
|
|
19
10
|
}
|
|
20
|
-
getOneByVehicleId(vehicleId, scopes, tripId) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
async getOneByVehicleId(vehicleId, scopes, tripId) {
|
|
12
|
+
let vehiclePosition = await this.vehiclePositionRepository.getDetailedVehiclePosition(vehicleId);
|
|
13
|
+
if (tripId && vehiclePosition?.gtfs_trip_id !== tripId) {
|
|
14
|
+
vehiclePosition = await this.vehiclePositionRepository.getDetailedVehiclePosition(vehicleId, tripId);
|
|
15
|
+
}
|
|
16
|
+
if (!vehiclePosition) {
|
|
17
|
+
throw new golemio_errors_1.GeneralError("not_found", this.constructor.name, undefined, 404);
|
|
18
|
+
}
|
|
19
|
+
let output = {};
|
|
20
|
+
if (scopes.includes(DetailedTripScopeEnum_1.DetailedTripScope.Info)) {
|
|
21
|
+
output = await this.scopeHandlerFactory.getStrategy(DetailedTripScopeEnum_1.DetailedTripScope.Info).handle(output, vehiclePosition);
|
|
22
|
+
}
|
|
23
|
+
const promises = scopes.map(async (scope) => {
|
|
24
|
+
if (scope === DetailedTripScopeEnum_1.DetailedTripScope.Info) {
|
|
25
|
+
return;
|
|
25
26
|
}
|
|
26
|
-
|
|
27
|
-
throw new golemio_errors_1.GeneralError("not_found", this.constructor.name, undefined, 404);
|
|
28
|
-
}
|
|
29
|
-
let output = {};
|
|
30
|
-
if (scopes.includes(DetailedTripScopeEnum_1.DetailedTripScope.Info)) {
|
|
31
|
-
output = yield this.scopeHandlerFactory.getStrategy(DetailedTripScopeEnum_1.DetailedTripScope.Info).handle(output, vehiclePosition);
|
|
32
|
-
}
|
|
33
|
-
const promises = scopes.map((scope) => __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
if (scope === DetailedTripScopeEnum_1.DetailedTripScope.Info) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
output = yield this.scopeHandlerFactory.getStrategy(scope).handle(output, vehiclePosition);
|
|
38
|
-
}));
|
|
39
|
-
yield Promise.all(promises);
|
|
40
|
-
return output;
|
|
27
|
+
output = await this.scopeHandlerFactory.getStrategy(scope).handle(output, vehiclePosition);
|
|
41
28
|
});
|
|
29
|
+
await Promise.all(promises);
|
|
30
|
+
return output;
|
|
42
31
|
}
|
|
43
32
|
}
|
|
44
33
|
exports.DetailedTripFacade = DetailedTripFacade;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailedTripFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/service/facade/DetailedTripFacade.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DetailedTripFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/service/facade/DetailedTripFacade.ts"],"names":[],"mappings":";;;AAEA,0FAAwF;AACxF,6EAAwE;AAGxE,MAAa,kBAAkB;IAC3B,YACY,mBAA4C,EAC5C,yBAAsD;QADtD,wBAAmB,GAAnB,mBAAmB,CAAyB;QAC5C,8BAAyB,GAAzB,yBAAyB,CAA6B;IAC/D,CAAC;IAEG,KAAK,CAAC,iBAAiB,CAC1B,SAAiB,EACjB,MAA2B,EAC3B,MAAe;QAEf,IAAI,eAAe,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC;QAEjG,IAAI,MAAM,IAAI,eAAe,EAAE,YAAY,KAAK,MAAM,EAAE;YACpD,eAAe,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,0BAA0B,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;SACxG;QAED,IAAI,CAAC,eAAe,EAAE;YAClB,MAAM,IAAI,6BAAY,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;SAC9E;QAED,IAAI,MAAM,GAA2B,EAAE,CAAC;QACxC,IAAI,MAAM,CAAC,QAAQ,CAAC,yCAAiB,CAAC,IAAI,CAAC,EAAE;YACzC,MAAM,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,yCAAiB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;SAC/G;QAED,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YACxC,IAAI,KAAK,KAAK,yCAAiB,CAAC,IAAI,EAAE;gBAClC,OAAO;aACV;YAED,MAAM,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,eAAgB,CAAC,CAAC;QAChG,CAAC,CAAC,CAAC;QAEH,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC5B,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AArCD,gDAqCC"}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.GtfsTripLookupFacade = void 0;
|
|
13
4
|
const DetailedTripScopeEnum_1 = require("../../routers/v2/helpers/DetailedTripScopeEnum");
|
|
@@ -18,29 +9,27 @@ class GtfsTripLookupFacade {
|
|
|
18
9
|
this.scopeHandlerFactory = scopeHandlerFactory;
|
|
19
10
|
this.gtfsTripRepository = models_1.models.GTFSTripsModel;
|
|
20
11
|
}
|
|
21
|
-
getOneByGtfsTripId(gtfsTripId, scopes) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
shouldIncludeShapes,
|
|
28
|
-
});
|
|
29
|
-
if (!this.isGtfsTripValid(gtfsTrip)) {
|
|
30
|
-
throw new golemio_errors_1.GeneralError("GTFS trip info not found", this.constructor.name, undefined, 404);
|
|
31
|
-
}
|
|
32
|
-
let output = {};
|
|
33
|
-
if (scopes.includes(DetailedTripScopeEnum_1.DetailedTripScope.Info)) {
|
|
34
|
-
output = this.scopeHandlerFactory.getStrategy(DetailedTripScopeEnum_1.DetailedTripScope.Info).handle(output, gtfsTrip);
|
|
35
|
-
}
|
|
36
|
-
for (const scope of scopes) {
|
|
37
|
-
if (scope === DetailedTripScopeEnum_1.DetailedTripScope.Info) {
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
output = this.scopeHandlerFactory.getStrategy(scope).handle(output, gtfsTrip);
|
|
41
|
-
}
|
|
42
|
-
return output;
|
|
12
|
+
async getOneByGtfsTripId(gtfsTripId, scopes) {
|
|
13
|
+
const shouldIncludeStopTimes = scopes.includes(DetailedTripScopeEnum_1.DetailedTripScope.StopTimes);
|
|
14
|
+
const shouldIncludeShapes = scopes.includes(DetailedTripScopeEnum_1.DetailedTripScope.Shapes);
|
|
15
|
+
const gtfsTrip = await this.gtfsTripRepository.getOneForPublicGtfsLookup(gtfsTripId, {
|
|
16
|
+
shouldIncludeStopTimes,
|
|
17
|
+
shouldIncludeShapes,
|
|
43
18
|
});
|
|
19
|
+
if (!this.isGtfsTripValid(gtfsTrip)) {
|
|
20
|
+
throw new golemio_errors_1.GeneralError("GTFS trip info not found", this.constructor.name, undefined, 404);
|
|
21
|
+
}
|
|
22
|
+
let output = {};
|
|
23
|
+
if (scopes.includes(DetailedTripScopeEnum_1.DetailedTripScope.Info)) {
|
|
24
|
+
output = this.scopeHandlerFactory.getStrategy(DetailedTripScopeEnum_1.DetailedTripScope.Info).handle(output, gtfsTrip);
|
|
25
|
+
}
|
|
26
|
+
for (const scope of scopes) {
|
|
27
|
+
if (scope === DetailedTripScopeEnum_1.DetailedTripScope.Info) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
output = this.scopeHandlerFactory.getStrategy(scope).handle(output, gtfsTrip);
|
|
31
|
+
}
|
|
32
|
+
return output;
|
|
44
33
|
}
|
|
45
34
|
isGtfsTripValid(gtfsTrip) {
|
|
46
35
|
return !!gtfsTrip && !!gtfsTrip.route;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GtfsTripLookupFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/service/facade/GtfsTripLookupFacade.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GtfsTripLookupFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/service/facade/GtfsTripLookupFacade.ts"],"names":[],"mappings":";;;AACA,0FAAwF;AACxF,uDAA+C;AAM/C,6EAAwE;AAGxE,MAAa,oBAAoB;IAG7B,YAAoB,mBAAgD;QAAhD,wBAAmB,GAAnB,mBAAmB,CAA6B;QAChE,IAAI,CAAC,kBAAkB,GAAG,eAAM,CAAC,cAAc,CAAC;IACpD,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAAC,UAAkB,EAAE,MAA2B;QAC3E,MAAM,sBAAsB,GAAG,MAAM,CAAC,QAAQ,CAAC,yCAAiB,CAAC,SAAS,CAAC,CAAC;QAC5E,MAAM,mBAAmB,GAAG,MAAM,CAAC,QAAQ,CAAC,yCAAiB,CAAC,MAAM,CAAC,CAAC;QAEtE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,UAAU,EAAE;YACjF,sBAAsB;YACtB,mBAAmB;SACtB,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE;YACjC,MAAM,IAAI,6BAAY,CAAC,0BAA0B,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;SAC7F;QAED,IAAI,MAAM,GAAuB,EAAE,CAAC;QACpC,IAAI,MAAM,CAAC,QAAQ,CAAC,yCAAiB,CAAC,IAAI,CAAC,EAAE;YACzC,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,yCAAiB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;SAClG;QAED,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YACxB,IAAI,KAAK,KAAK,yCAAiB,CAAC,IAAI,EAAE;gBAClC,SAAS;aACZ;YAED,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;SACjF;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAEO,eAAe,CAAC,QAAiD;QACrE,OAAO,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;IAC1C,CAAC;CACJ;AAvCD,oDAuCC"}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.PublicVehiclePositionsFacade = void 0;
|
|
13
4
|
const output_gateway_1 = require("@golemio/core/dist/output-gateway");
|
|
@@ -19,23 +10,21 @@ class PublicVehiclePositionsFacade {
|
|
|
19
10
|
this.log = log;
|
|
20
11
|
this.transformation = new PublicVehiclePositionsTransformation_1.PublicVehiclePositionsTransformation();
|
|
21
12
|
}
|
|
22
|
-
getAll(boundingBox, routeShortName, type) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return (0, output_gateway_1.buildGeojsonFeatureCollection)(this.transformation.transformArray(filteredResults));
|
|
38
|
-
});
|
|
13
|
+
async getAll(boundingBox, routeShortName, type) {
|
|
14
|
+
const boundingBoxWithCenter = this.boundingBoxHelper.mapToCenterFormat(boundingBox);
|
|
15
|
+
this.log.debug(`width: ${boundingBoxWithCenter.width}m, height: ${boundingBoxWithCenter.height}m`);
|
|
16
|
+
const vehicleIds = await this.repository.getAllVehicleIds(boundingBoxWithCenter);
|
|
17
|
+
if (vehicleIds.length === 0) {
|
|
18
|
+
this.log.debug("No vehicle ids found.");
|
|
19
|
+
return (0, output_gateway_1.buildGeojsonFeatureCollection)([]);
|
|
20
|
+
}
|
|
21
|
+
const vehiclePositions = await this.repository.getAllVehiclePositions(vehicleIds);
|
|
22
|
+
const filteredResults = vehiclePositions.filter((el) => this.filterClientSide(el, routeShortName, type));
|
|
23
|
+
if (filteredResults.length === 0) {
|
|
24
|
+
this.log.debug("No vehicle positions found.");
|
|
25
|
+
return (0, output_gateway_1.buildGeojsonFeatureCollection)([]);
|
|
26
|
+
}
|
|
27
|
+
return (0, output_gateway_1.buildGeojsonFeatureCollection)(this.transformation.transformArray(filteredResults));
|
|
39
28
|
}
|
|
40
29
|
filterClientSide(el, routeShortName, types) {
|
|
41
30
|
if (routeShortName instanceof Array && routeShortName.includes(el.gtfs_route_short_name)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VehiclePositionsFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/service/facade/VehiclePositionsFacade.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VehiclePositionsFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/service/facade/VehiclePositionsFacade.ts"],"names":[],"mappings":";;;AAKA,sEAA6G;AAE7G,kHAA+G;AAE/G,MAAa,4BAA4B;IAGrC,YACY,UAAuC,EACvC,iBAAqC,EACrC,GAAY;QAFZ,eAAU,GAAV,UAAU,CAA6B;QACvC,sBAAiB,GAAjB,iBAAiB,CAAoB;QACrC,QAAG,GAAH,GAAG,CAAS;QAEpB,IAAI,CAAC,cAAc,GAAG,IAAI,2EAAoC,EAAE,CAAC;IACrE,CAAC;IAEM,KAAK,CAAC,MAAM,CACf,WAAyB,EACzB,cAA6C,EAC7C,IAAqC;QAErC,MAAM,qBAAqB,GAAG,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QACpF,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,qBAAqB,CAAC,KAAK,cAAc,qBAAqB,CAAC,MAAM,GAAG,CAAC,CAAC;QAEnG,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;QACjF,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YACzB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;YACxC,OAAO,IAAA,8CAA6B,EAAC,EAAE,CAAC,CAAC;SAC5C;QAED,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC;QAClF,MAAM,eAAe,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC;QACzG,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;YAC9C,OAAO,IAAA,8CAA6B,EAAC,EAAE,CAAC,CAAC;SAC5C;QAED,OAAO,IAAA,8CAA6B,EAAC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;IAC9F,CAAC;IAEO,gBAAgB,CACpB,EAAsB,EACtB,cAA6C,EAC7C,KAAsC;QAEtC,IAAI,cAAc,YAAY,KAAK,IAAI,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC,qBAAqB,CAAC,EAAE;YACtF,OAAO,IAAI,CAAC;SACf;QAED,IAAI,cAAc,IAAI,EAAE,CAAC,qBAAqB,KAAK,cAAc,EAAE;YAC/D,OAAO,KAAK,CAAC;SAChB;QAED,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,UAAU,CAAC,EAAE;YACxD,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAtDD,oEAsDC"}
|
|
@@ -24,8 +24,7 @@ let StopTimesGtfsTripScopeHandler = exports.StopTimesGtfsTripScopeHandler = clas
|
|
|
24
24
|
this.tripStopTimesTransformation = tripStopTimesTransformation;
|
|
25
25
|
}
|
|
26
26
|
handle(output, gtfsTrip) {
|
|
27
|
-
|
|
28
|
-
const stopTimes = this.tripStopTimesTransformation.transformArray((_a = gtfsTrip.stop_times) !== null && _a !== void 0 ? _a : []);
|
|
27
|
+
const stopTimes = this.tripStopTimesTransformation.transformArray(gtfsTrip.stop_times ?? []);
|
|
29
28
|
output.stop_times = (0, Geo_1.buildGeojsonFeatureCollection)(stopTimes);
|
|
30
29
|
return output;
|
|
31
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StopTimesTripScopeHandler.js","sourceRoot":"","sources":["../../../../../../../src/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/StopTimesTripScopeHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,iEAA6D;AAC7D,mIAA8I;AAE9I,+DAAsF;AACtF,iEAAwE;AACxE,iFAA8E;AAGvE,IAAM,6BAA6B,2CAAnC,MAAM,6BAA8B,SAAQ,2DAA4B;IAC3E,YAEY,2BAAkE;QAE1E,KAAK,EAAE,CAAC;QAFA,gCAA2B,GAA3B,2BAA2B,CAAuC;IAG9E,CAAC;IAEM,MAAM,CAAC,MAA0B,EAAE,QAAkC
|
|
1
|
+
{"version":3,"file":"StopTimesTripScopeHandler.js","sourceRoot":"","sources":["../../../../../../../src/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/StopTimesTripScopeHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,iEAA6D;AAC7D,mIAA8I;AAE9I,+DAAsF;AACtF,iEAAwE;AACxE,iFAA8E;AAGvE,IAAM,6BAA6B,2CAAnC,MAAM,6BAA8B,SAAQ,2DAA4B;IAC3E,YAEY,2BAAkE;QAE1E,KAAK,EAAE,CAAC;QAFA,gCAA2B,GAA3B,2BAA2B,CAAuC;IAG9E,CAAC;IAEM,MAAM,CAAC,MAA0B,EAAE,QAAkC;QACxE,MAAM,SAAS,GAAG,IAAI,CAAC,2BAA2B,CAAC,cAAc,CAAC,QAAQ,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;QAE7F,MAAM,CAAC,UAAU,GAAG,IAAA,mCAA6B,EAAC,SAAS,CAAC,CAAC;QAC7D,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;wCAdY,6BAA6B;IADzC,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,6BAAa,CAAC,qCAAqC,CAAC,CAAA;qCACvB,yEAAqC;GAHrE,6BAA6B,CAczC"}
|
package/dist/output-gateway/public/service/helpers/trip-scope/strategy/InfoTripScopeHandler.js
CHANGED
|
@@ -8,15 +8,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
12
|
exports.InfoTripScopeHandler = void 0;
|
|
22
13
|
const PublicVPTripInfoTransformation_1 = require("../../../transformations/scopes/PublicVPTripInfoTransformation");
|
|
@@ -27,11 +18,9 @@ let InfoTripScopeHandler = exports.InfoTripScopeHandler = class InfoTripScopeHan
|
|
|
27
18
|
super();
|
|
28
19
|
this.tripInfoTransformation = new PublicVPTripInfoTransformation_1.PublicVPTripInfoTransformation();
|
|
29
20
|
}
|
|
30
|
-
handle(output, vehiclePosition) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return output;
|
|
34
|
-
});
|
|
21
|
+
async handle(output, vehiclePosition) {
|
|
22
|
+
output = this.tripInfoTransformation.transformElement(vehiclePosition);
|
|
23
|
+
return output;
|
|
35
24
|
}
|
|
36
25
|
};
|
|
37
26
|
exports.InfoTripScopeHandler = InfoTripScopeHandler = __decorate([
|
package/dist/output-gateway/public/service/helpers/trip-scope/strategy/InfoTripScopeHandler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoTripScopeHandler.js","sourceRoot":"","sources":["../../../../../../../src/output-gateway/public/service/helpers/trip-scope/strategy/InfoTripScopeHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InfoTripScopeHandler.js","sourceRoot":"","sources":["../../../../../../../src/output-gateway/public/service/helpers/trip-scope/strategy/InfoTripScopeHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mHAA0H;AAE1H,iEAAgE;AAChE,yFAAsF;AAG/E,IAAM,oBAAoB,kCAA1B,MAAM,oBAAqB,SAAQ,mEAAgC;IAGtE;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,sBAAsB,GAAG,IAAI,+DAA8B,EAAE,CAAC;IACvE,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,MAA8B,EAAE,eAAmC;QACnF,MAAM,GAAG,IAAI,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC;QACvE,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;+BAZY,oBAAoB;IADhC,IAAA,qBAAU,GAAE;;GACA,oBAAoB,CAYhC"}
|
package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.js
CHANGED
|
@@ -11,15 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
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
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
15
|
exports.ShapesTripScopeHandler = void 0;
|
|
25
16
|
const OgModuleToken_1 = require("../../../../ioc/OgModuleToken");
|
|
@@ -36,15 +27,13 @@ let ShapesTripScopeHandler = exports.ShapesTripScopeHandler = class ShapesTripSc
|
|
|
36
27
|
this.tripShapesTransformation = new PublicVPTripShapesTransformation_1.PublicVPTripShapesTransformation();
|
|
37
28
|
this.shapeModel = models_1.models.GTFSShapesModel;
|
|
38
29
|
}
|
|
39
|
-
handle(output, vehiclePosition) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return output;
|
|
47
|
-
});
|
|
30
|
+
async handle(output, vehiclePosition) {
|
|
31
|
+
const delayComputationCache = await this.delayComputationRepository.getDelayComputationCache(vehiclePosition.gtfs_trip_id);
|
|
32
|
+
if (!delayComputationCache) {
|
|
33
|
+
throw new golemio_errors_1.GeneralError("delay_computation_cache_not_found", this.constructor.name, undefined, 500);
|
|
34
|
+
}
|
|
35
|
+
output.shapes = (0, Geo_1.buildGeojsonFeatureCollection)(delayComputationCache.shapes ? this.tripShapesTransformation.transformArray(delayComputationCache.shapes) : []);
|
|
36
|
+
return output;
|
|
48
37
|
}
|
|
49
38
|
};
|
|
50
39
|
exports.ShapesTripScopeHandler = ShapesTripScopeHandler = __decorate([
|
package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShapesTripScopeHandler.js","sourceRoot":"","sources":["../../../../../../../src/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ShapesTripScopeHandler.js","sourceRoot":"","sources":["../../../../../../../src/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,iEAA6D;AAC7D,uHAA8H;AAC9H,6DAA+C;AAG/C,+DAAsF;AACtF,6EAAwE;AACxE,iEAAwE;AACxE,yFAAsF;AAG/E,IAAM,sBAAsB,oCAA5B,MAAM,sBAAuB,SAAQ,mEAAgC;IAIxE,YAC8D,0BAAuD;QAEjH,KAAK,EAAE,CAAC;QAFkD,+BAA0B,GAA1B,0BAA0B,CAA6B;QAGjH,IAAI,CAAC,wBAAwB,GAAG,IAAI,mEAAgC,EAAE,CAAC;QACvE,IAAI,CAAC,UAAU,GAAG,eAAM,CAAC,eAAe,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,MAA8B,EAAE,eAAmC;QACnF,MAAM,qBAAqB,GAAG,MAAM,IAAI,CAAC,0BAA0B,CAAC,wBAAwB,CACxF,eAAe,CAAC,YAAY,CAC/B,CAAC;QAEF,IAAI,CAAC,qBAAqB,EAAE;YACxB,MAAM,IAAI,6BAAY,CAAC,mCAAmC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;SACtG;QAED,MAAM,CAAC,MAAM,GAAG,IAAA,mCAA6B,EACzC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,cAAc,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CACjH,CAAC;QAEF,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;iCA3BY,sBAAsB;IADlC,IAAA,qBAAU,GAAE;IAMJ,WAAA,IAAA,iBAAM,EAAC,6BAAa,CAAC,0BAA0B,CAAC,CAAA;;GAL5C,sBAAsB,CA2BlC"}
|