@golemio/pid 3.4.1-dev.1622321089 → 3.4.1-dev.1622952033

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.
Files changed (426) hide show
  1. package/db/migrations/postgresql/20250103092631-skip-missing.js +53 -0
  2. package/db/migrations/postgresql/sqls/20250103092631-skip-missing-down.sql +184 -0
  3. package/db/migrations/postgresql/sqls/20250103092631-skip-missing-up.sql +195 -0
  4. package/dist/input-gateway/jis/JisInfotextsController.js +4 -13
  5. package/dist/input-gateway/jis/JisInfotextsController.js.map +1 -1
  6. package/dist/input-gateway/jis/JisInfotextsRouter.js +3 -12
  7. package/dist/input-gateway/jis/JisInfotextsRouter.js.map +1 -1
  8. package/dist/input-gateway/ropid-gtfs/RopidGtfsController.js +4 -13
  9. package/dist/input-gateway/ropid-gtfs/RopidGtfsController.js.map +1 -1
  10. package/dist/input-gateway/ropid-gtfs/RopidGtfsRouter.js +3 -12
  11. package/dist/input-gateway/ropid-gtfs/RopidGtfsRouter.js.map +1 -1
  12. package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js +4 -13
  13. package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js.map +1 -1
  14. package/dist/input-gateway/vehicle-positions/VehiclePositionsRouter.js +3 -12
  15. package/dist/input-gateway/vehicle-positions/VehiclePositionsRouter.js.map +1 -1
  16. package/dist/integration-engine/data-retention/workers/tasks/DeleteDataTask.js +4 -15
  17. package/dist/integration-engine/data-retention/workers/tasks/DeleteDataTask.js.map +1 -1
  18. package/dist/integration-engine/data-retention/workers/tasks/TableStorageRetentionTask.js +8 -19
  19. package/dist/integration-engine/data-retention/workers/tasks/TableStorageRetentionTask.js.map +1 -1
  20. package/dist/integration-engine/jis/datasources/JISInfotextsDataSourceFactory.js +1 -1
  21. package/dist/integration-engine/jis/datasources/JISInfotextsDataSourceFactory.js.map +1 -1
  22. package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js +56 -72
  23. package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js.map +1 -1
  24. package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.js +32 -48
  25. package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.js.map +1 -1
  26. package/dist/integration-engine/jis/repositories/JISMetadataRepository.js +24 -37
  27. package/dist/integration-engine/jis/repositories/JISMetadataRepository.js.map +1 -1
  28. package/dist/integration-engine/jis/services/JISInfotextsDataService.js +24 -35
  29. package/dist/integration-engine/jis/services/JISInfotextsDataService.js.map +1 -1
  30. package/dist/integration-engine/jis/transformations/JISInfotextsTransformation.js +2 -3
  31. package/dist/integration-engine/jis/transformations/JISInfotextsTransformation.js.map +1 -1
  32. package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.js +12 -23
  33. package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.js.map +1 -1
  34. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js +4 -15
  35. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js.map +1 -1
  36. package/dist/integration-engine/ropid-gtfs/RopidGTFSStopTimesModel.js +3 -12
  37. package/dist/integration-engine/ropid-gtfs/RopidGTFSStopTimesModel.js.map +1 -1
  38. package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js +2 -11
  39. package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js.map +1 -1
  40. package/dist/integration-engine/ropid-gtfs/RopidGTFSTripsModel.js +3 -12
  41. package/dist/integration-engine/ropid-gtfs/RopidGTFSTripsModel.js.map +1 -1
  42. package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.js +21 -30
  43. package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.js.map +1 -1
  44. package/dist/integration-engine/ropid-gtfs/RopidGtfsMetadataRepository.js +20 -29
  45. package/dist/integration-engine/ropid-gtfs/RopidGtfsMetadataRepository.js.map +1 -1
  46. package/dist/integration-engine/ropid-gtfs/data-access/RopidGtfsRepository.js +33 -52
  47. package/dist/integration-engine/ropid-gtfs/data-access/RopidGtfsRepository.js.map +1 -1
  48. package/dist/integration-engine/ropid-gtfs/data-access/RouteSubAgencyRepository.js +12 -23
  49. package/dist/integration-engine/ropid-gtfs/data-access/RouteSubAgencyRepository.js.map +1 -1
  50. package/dist/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.js +12 -23
  51. package/dist/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.js.map +1 -1
  52. package/dist/integration-engine/ropid-gtfs/data-access/cache/PublicGtfsDepartureRepository.js +33 -44
  53. package/dist/integration-engine/ropid-gtfs/data-access/cache/PublicGtfsDepartureRepository.js.map +1 -1
  54. package/dist/integration-engine/ropid-gtfs/data-access/cache/RunTripsRedisRepository.js +2 -1
  55. package/dist/integration-engine/ropid-gtfs/data-access/cache/RunTripsRedisRepository.js.map +1 -1
  56. package/dist/integration-engine/ropid-gtfs/data-access/cache/StaticFileRedisRepository.js +10 -21
  57. package/dist/integration-engine/ropid-gtfs/data-access/cache/StaticFileRedisRepository.js.map +1 -1
  58. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.js +15 -24
  59. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.js.map +1 -1
  60. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/MinMaxStopSequencesRepository.js +3 -12
  61. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/MinMaxStopSequencesRepository.js.map +1 -1
  62. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/ServicesCalendarRepository.js +3 -12
  63. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/ServicesCalendarRepository.js.map +1 -1
  64. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripScheduleRepository.js +4 -13
  65. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripScheduleRepository.js.map +1 -1
  66. package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.js +30 -41
  67. package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.js.map +1 -1
  68. package/dist/integration-engine/ropid-gtfs/helpers/DataCacheManager.js +11 -22
  69. package/dist/integration-engine/ropid-gtfs/helpers/DataCacheManager.js.map +1 -1
  70. package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js +1 -2
  71. package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js.map +1 -1
  72. package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.js +7 -16
  73. package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.js.map +1 -1
  74. package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.js +3 -12
  75. package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.js.map +1 -1
  76. package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.js +13 -17
  77. package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.js.map +1 -1
  78. package/dist/integration-engine/ropid-gtfs/workers/presets/data-access/PresetLogRepository.js +13 -22
  79. package/dist/integration-engine/ropid-gtfs/workers/presets/data-access/PresetLogRepository.js.map +1 -1
  80. package/dist/integration-engine/ropid-gtfs/workers/presets/datasources/grafana-loki/GrafanaLokiDataSourceProvider.js +1 -2
  81. package/dist/integration-engine/ropid-gtfs/workers/presets/datasources/grafana-loki/GrafanaLokiDataSourceProvider.js.map +1 -1
  82. package/dist/integration-engine/ropid-gtfs/workers/presets/helpers/RopidMonitoringService.js +12 -23
  83. package/dist/integration-engine/ropid-gtfs/workers/presets/helpers/RopidMonitoringService.js.map +1 -1
  84. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CheckForNewDeparturesPresetsTask.js +14 -25
  85. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CheckForNewDeparturesPresetsTask.js.map +1 -1
  86. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CollectAndSaveLogsTask.js +26 -37
  87. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CollectAndSaveLogsTask.js.map +1 -1
  88. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/DownloadDeparturesPresetsTask.js +12 -23
  89. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/DownloadDeparturesPresetsTask.js.map +1 -1
  90. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/ProcessAndSendLogsTask.js +36 -49
  91. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/ProcessAndSendLogsTask.js.map +1 -1
  92. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/SavePresetsDataTask.js +3 -14
  93. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/SavePresetsDataTask.js.map +1 -1
  94. package/dist/integration-engine/ropid-gtfs/workers/presets/transformations/PresetLogTransformation.js +1 -2
  95. package/dist/integration-engine/ropid-gtfs/workers/presets/transformations/PresetLogTransformation.js.map +1 -1
  96. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckForNewDataTask.js +29 -40
  97. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckForNewDataTask.js.map +1 -1
  98. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js +64 -81
  99. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js.map +1 -1
  100. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/DownloadDatasetsTask.js +60 -79
  101. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/DownloadDatasetsTask.js.map +1 -1
  102. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPrecomputedTablesTask.js +23 -34
  103. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPrecomputedTablesTask.js.map +1 -1
  104. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask.js +26 -38
  105. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask.js.map +1 -1
  106. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/SaveStaticDataTask.js +21 -32
  107. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/SaveStaticDataTask.js.map +1 -1
  108. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/TransformAndSaveDataTask.js +43 -55
  109. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/TransformAndSaveDataTask.js.map +1 -1
  110. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/DeparturesDirectionRepository.js +8 -18
  111. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/DeparturesDirectionRepository.js.map +1 -1
  112. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/MetroRailtrackGPSRepository.js +11 -21
  113. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/MetroRailtrackGPSRepository.js.map +1 -1
  114. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js +8 -17
  115. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js.map +1 -1
  116. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js +19 -30
  117. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js.map +1 -1
  118. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/transformations/DeparturesDirectionTransformation.js +8 -1
  119. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/transformations/DeparturesDirectionTransformation.js.map +1 -1
  120. package/dist/integration-engine/ropid-vymi/RopidVYMIEventsTransformation.js +31 -47
  121. package/dist/integration-engine/ropid-vymi/RopidVYMIEventsTransformation.js.map +1 -1
  122. package/dist/integration-engine/ropid-vymi/models/RopidVYMIEventsRoutesModel.js +6 -17
  123. package/dist/integration-engine/ropid-vymi/models/RopidVYMIEventsRoutesModel.js.map +1 -1
  124. package/dist/integration-engine/ropid-vymi/models/RopidVYMIMetadataModel.js +4 -14
  125. package/dist/integration-engine/ropid-vymi/models/RopidVYMIMetadataModel.js.map +1 -1
  126. package/dist/integration-engine/ropid-vymi/workers/tasks/CheckForNewEventsTask.js +6 -17
  127. package/dist/integration-engine/ropid-vymi/workers/tasks/CheckForNewEventsTask.js.map +1 -1
  128. package/dist/integration-engine/ropid-vymi/workers/tasks/FetchAndProcessEventsTask.js +34 -31
  129. package/dist/integration-engine/ropid-vymi/workers/tasks/FetchAndProcessEventsTask.js.map +1 -1
  130. package/dist/integration-engine/ropid-vymi/workers/tasks/helpers/RopidVYMIApiHelper.js +3 -12
  131. package/dist/integration-engine/ropid-vymi/workers/tasks/helpers/RopidVYMIApiHelper.js.map +1 -1
  132. package/dist/integration-engine/shared/RopidMetadataModel.js +35 -45
  133. package/dist/integration-engine/shared/RopidMetadataModel.js.map +1 -1
  134. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/AlertsGenerator.js +13 -24
  135. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/AlertsGenerator.js.map +1 -1
  136. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/VehicleDescriptor.js +9 -6
  137. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/VehicleDescriptor.js.map +1 -1
  138. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.js +113 -128
  139. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.js.map +1 -1
  140. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/transformations/AlertsTransformation.js +20 -34
  141. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/transformations/AlertsTransformation.js.map +1 -1
  142. package/dist/integration-engine/vehicle-positions/workers/runs/data-access/AbstractRunRepository.js +3 -12
  143. package/dist/integration-engine/vehicle-positions/workers/runs/data-access/AbstractRunRepository.js.map +1 -1
  144. package/dist/integration-engine/vehicle-positions/workers/runs/data-access/CommonRunsMessagesRepository.js +3 -12
  145. package/dist/integration-engine/vehicle-positions/workers/runs/data-access/CommonRunsMessagesRepository.js.map +1 -1
  146. package/dist/integration-engine/vehicle-positions/workers/runs/data-access/CommonRunsRepository.js +12 -21
  147. package/dist/integration-engine/vehicle-positions/workers/runs/data-access/CommonRunsRepository.js.map +1 -1
  148. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/CommonMessageProcessor.js +7 -16
  149. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/CommonMessageProcessor.js.map +1 -1
  150. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/CisLookupManager.js +22 -33
  151. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/CisLookupManager.js.map +1 -1
  152. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/GtfsLookupManager.js +31 -44
  153. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/GtfsLookupManager.js.map +1 -1
  154. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusRunsFacade.js +14 -25
  155. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusRunsFacade.js.map +1 -1
  156. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/TripScheduleManager.js +25 -37
  157. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/TripScheduleManager.js.map +1 -1
  158. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/ProcessMetroRunMessagesTask.js +53 -63
  159. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/ProcessMetroRunMessagesTask.js.map +1 -1
  160. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/ProcessRegionalBusRunMessagesTask.js +57 -72
  161. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/ProcessRegionalBusRunMessagesTask.js.map +1 -1
  162. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveArrivaCityRunsToDBTask.js +15 -26
  163. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveArrivaCityRunsToDBTask.js.map +1 -1
  164. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveBusRunsToDBTask.js +10 -21
  165. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveBusRunsToDBTask.js.map +1 -1
  166. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveMetroRunsToDBTask.js +19 -30
  167. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveMetroRunsToDBTask.js.map +1 -1
  168. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveTramRunsToDBTask.js +10 -21
  169. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveTramRunsToDBTask.js.map +1 -1
  170. package/dist/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.js +5 -14
  171. package/dist/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.js.map +1 -1
  172. package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessageProcessingTransformation.js +4 -14
  173. package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessageProcessingTransformation.js.map +1 -1
  174. package/dist/integration-engine/vehicle-positions/workers/runs/transformations/RegionalBusRunsMessagesTransformation.js +1 -2
  175. package/dist/integration-engine/vehicle-positions/workers/runs/transformations/RegionalBusRunsMessagesTransformation.js.map +1 -1
  176. package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/data-access/DescriptorRepository.js +35 -49
  177. package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/data-access/DescriptorRepository.js.map +1 -1
  178. package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/tasks/RefreshDescriptorsTask.js +11 -22
  179. package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/tasks/RefreshDescriptorsTask.js.map +1 -1
  180. package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/transformations/DescriptorTransformation.js +2 -3
  181. package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/transformations/DescriptorTransformation.js.map +1 -1
  182. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/CisStopRepository.js +3 -12
  183. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/CisStopRepository.js.map +1 -1
  184. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsHistoryRepository.js +3 -12
  185. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsHistoryRepository.js.map +1 -1
  186. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsRepository.js +19 -29
  187. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsRepository.js.map +1 -1
  188. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/StopTimesHistoryRepository.js +3 -12
  189. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/StopTimesHistoryRepository.js.map +1 -1
  190. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsHistoryRepository.js +3 -12
  191. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsHistoryRepository.js.map +1 -1
  192. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js +58 -55
  193. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js.map +1 -1
  194. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicApiCacheRepository.js +64 -79
  195. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicApiCacheRepository.js.map +1 -1
  196. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicStopTimeCacheRepository.js +46 -59
  197. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicStopTimeCacheRepository.js.map +1 -1
  198. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/TripsMapper.js +39 -6
  199. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/TripsMapper.js.map +1 -1
  200. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/metro/CachedMetroRailtrackLookup.js +8 -19
  201. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/metro/CachedMetroRailtrackLookup.js.map +1 -1
  202. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/PublicStopTimeRepository.js +2 -13
  203. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/PublicStopTimeRepository.js.map +1 -1
  204. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DPPUtils.js +1 -2
  205. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DPPUtils.js.map +1 -1
  206. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DelayComputationManager.js +10 -16
  207. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DelayComputationManager.js.map +1 -1
  208. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.js +68 -40
  209. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.js.map +1 -1
  210. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/TripStopsManager.js +5 -14
  211. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/TripStopsManager.js.map +1 -1
  212. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/VPUtils.js +1 -2
  213. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/VPUtils.js.map +1 -1
  214. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/anchor-points/AnchorPointSegmenter.js +1 -2
  215. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/anchor-points/AnchorPointSegmenter.js.map +1 -1
  216. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/ComputeDelayHelper.js +4 -4
  217. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/ComputeDelayHelper.js.map +1 -1
  218. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/AbstractDelayAtStop.js +1 -2
  219. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/AbstractDelayAtStop.js.map +1 -1
  220. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/CommonDelayAtStop.js +4 -5
  221. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/CommonDelayAtStop.js.map +1 -1
  222. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/MetroDelayAtStop.js +3 -4
  223. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/MetroDelayAtStop.js.map +1 -1
  224. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-data/strategy/HttpGtfsTripDataFixer.js +7 -18
  225. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-data/strategy/HttpGtfsTripDataFixer.js.map +1 -1
  226. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/AbstractGTFSTripRunManager.js +7 -16
  227. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/AbstractGTFSTripRunManager.js.map +1 -1
  228. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripCommonRunManager.js +40 -57
  229. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripCommonRunManager.js.map +1 -1
  230. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripMetroRunManager.js +36 -53
  231. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripMetroRunManager.js.map +1 -1
  232. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/metro/MetroShapePointsFixer.js +32 -41
  233. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/metro/MetroShapePointsFixer.js.map +1 -1
  234. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.js +61 -33
  235. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.js.map +1 -1
  236. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/compute-positions/RegionalBusComputeDelayHelper.js +4 -4
  237. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/compute-positions/RegionalBusComputeDelayHelper.js.map +1 -1
  238. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/compute-positions/strategy/BusDelayAtStop.js +4 -6
  239. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/compute-positions/strategy/BusDelayAtStop.js.map +1 -1
  240. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/gtfs-trip-run/GtfsTripRegionalBusRunManager.js +38 -55
  241. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/gtfs-trip-run/GtfsTripRegionalBusRunManager.js.map +1 -1
  242. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/DataRetentionTask.js +32 -45
  243. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/DataRetentionTask.js.map +1 -1
  244. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/ProcessRegionalBusPositionsTask.js +81 -91
  245. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/ProcessRegionalBusPositionsTask.js.map +1 -1
  246. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateDelayTask.js +43 -55
  247. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateDelayTask.js.map +1 -1
  248. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateTrainDelayTask.js +37 -49
  249. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateTrainDelayTask.js.map +1 -1
  250. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshGtfsTripDataTask.js +7 -18
  251. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshGtfsTripDataTask.js.map +1 -1
  252. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicStopTimeCacheTask.js +41 -52
  253. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicStopTimeCacheTask.js.map +1 -1
  254. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicTripCacheTask.js +32 -43
  255. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicTripCacheTask.js.map +1 -1
  256. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.js +95 -115
  257. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.js.map +1 -1
  258. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateDelayTask.js +150 -162
  259. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateDelayTask.js.map +1 -1
  260. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateGtfsTripIdTask.js +82 -94
  261. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateGtfsTripIdTask.js.map +1 -1
  262. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateRunsGtfsTripIdTask.js +24 -35
  263. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateRunsGtfsTripIdTask.js.map +1 -1
  264. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/abstract/AbstractPropagateDelayTask.js +15 -18
  265. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/abstract/AbstractPropagateDelayTask.js.map +1 -1
  266. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/helpers/UpdateDelayLimiter.js +1 -1
  267. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/helpers/UpdateDelayLimiter.js.map +1 -1
  268. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js +11 -21
  269. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js.map +1 -1
  270. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/PublicApiTripTransformation.js +2 -3
  271. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/PublicApiTripTransformation.js.map +1 -1
  272. package/dist/output-gateway/pid/controllers/v2/V2DepartureBoardsController.js +5 -15
  273. package/dist/output-gateway/pid/controllers/v2/V2DepartureBoardsController.js.map +1 -1
  274. package/dist/output-gateway/pid/controllers/v2/V2InfotextsController.js +4 -13
  275. package/dist/output-gateway/pid/controllers/v2/V2InfotextsController.js.map +1 -1
  276. package/dist/output-gateway/pid/controllers/v3/V3InfotextsController.js +4 -13
  277. package/dist/output-gateway/pid/controllers/v3/V3InfotextsController.js.map +1 -1
  278. package/dist/output-gateway/pid/controllers/v3/V3TransferBoardsController.d.ts +1 -0
  279. package/dist/output-gateway/pid/controllers/v3/V3TransferBoardsController.js +20 -20
  280. package/dist/output-gateway/pid/controllers/v3/V3TransferBoardsController.js.map +1 -1
  281. package/dist/output-gateway/pid/data-access/DeparturesRepository.js +40 -53
  282. package/dist/output-gateway/pid/data-access/DeparturesRepository.js.map +1 -1
  283. package/dist/output-gateway/pid/data-access/JISInfotextRepository.js +62 -75
  284. package/dist/output-gateway/pid/data-access/JISInfotextRepository.js.map +1 -1
  285. package/dist/output-gateway/pid/domain/DepartureInterfaces.d.ts +7 -0
  286. package/dist/output-gateway/pid/domain/DepartureInterfaces.js +3 -0
  287. package/dist/output-gateway/pid/domain/DepartureInterfaces.js.map +1 -0
  288. package/dist/output-gateway/pid/helpers/DepartureBoardMapper.js +2 -3
  289. package/dist/output-gateway/pid/helpers/DepartureBoardMapper.js.map +1 -1
  290. package/dist/output-gateway/pid/helpers/ParamValidatorManager.js +6 -15
  291. package/dist/output-gateway/pid/helpers/ParamValidatorManager.js.map +1 -1
  292. package/dist/output-gateway/pid/index.d.ts +4 -5
  293. package/dist/output-gateway/pid/index.js +1 -0
  294. package/dist/output-gateway/pid/index.js.map +1 -1
  295. package/dist/output-gateway/pid/ioc/Di.js +4 -0
  296. package/dist/output-gateway/pid/ioc/Di.js.map +1 -1
  297. package/dist/output-gateway/pid/ioc/OgPidToken.d.ts +2 -0
  298. package/dist/output-gateway/pid/ioc/OgPidToken.js +2 -0
  299. package/dist/output-gateway/pid/ioc/OgPidToken.js.map +1 -1
  300. package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.d.ts +14 -28
  301. package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js +195 -84
  302. package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js.map +1 -1
  303. package/dist/output-gateway/pid/models/RopidDeparturesDirectionsModel.js +20 -27
  304. package/dist/output-gateway/pid/models/RopidDeparturesDirectionsModel.js.map +1 -1
  305. package/dist/output-gateway/pid/models/RopidVYMIEventsStopsModel.js +16 -25
  306. package/dist/output-gateway/pid/models/RopidVYMIEventsStopsModel.js.map +1 -1
  307. package/dist/output-gateway/pid/models/helpers/PIDDepartureModel.js +28 -18
  308. package/dist/output-gateway/pid/models/helpers/PIDDepartureModel.js.map +1 -1
  309. package/dist/output-gateway/pid/models/helpers/SkipHelper.d.ts +19 -0
  310. package/dist/output-gateway/pid/models/helpers/SkipHelper.js +116 -0
  311. package/dist/output-gateway/pid/models/helpers/SkipHelper.js.map +1 -0
  312. package/dist/output-gateway/pid/models/helpers/const.d.ts +4 -0
  313. package/dist/output-gateway/pid/models/helpers/const.js +8 -0
  314. package/dist/output-gateway/pid/models/helpers/const.js.map +1 -0
  315. package/dist/output-gateway/pid/models/helpers/interfaces/IPIDDepartureQueryOptions.d.ts +4 -1
  316. package/dist/output-gateway/pid/models/interfaces/IGetDeparturesOptions.d.ts +21 -0
  317. package/dist/output-gateway/pid/models/interfaces/IGetDeparturesOptions.js +3 -0
  318. package/dist/output-gateway/pid/models/interfaces/IGetDeparturesOptions.js.map +1 -0
  319. package/dist/output-gateway/pid/routers/v3/V3PIDRouter.js +1 -1
  320. package/dist/output-gateway/pid/routers/v3/V3PIDRouter.js.map +1 -1
  321. package/dist/output-gateway/pid/service/facade/InfotextFacade.js +12 -23
  322. package/dist/output-gateway/pid/service/facade/InfotextFacade.js.map +1 -1
  323. package/dist/output-gateway/pid/service/facade/StopFacade.js +27 -38
  324. package/dist/output-gateway/pid/service/facade/StopFacade.js.map +1 -1
  325. package/dist/output-gateway/pid/service/facade/TransferFacade.d.ts +1 -1
  326. package/dist/output-gateway/pid/service/facade/TransferFacade.js +34 -39
  327. package/dist/output-gateway/pid/service/facade/TransferFacade.js.map +1 -1
  328. package/dist/output-gateway/pid/service/transformations/JISInfotextDepartureTransformation.js +3 -4
  329. package/dist/output-gateway/pid/service/transformations/JISInfotextDepartureTransformation.js.map +1 -1
  330. package/dist/output-gateway/pid/service/transformations/JISInfotextOverviewTransformation.js +8 -12
  331. package/dist/output-gateway/pid/service/transformations/JISInfotextOverviewTransformation.js.map +1 -1
  332. package/dist/output-gateway/pid/service/transformations/JISInfotextTransferTransformation.js +1 -2
  333. package/dist/output-gateway/pid/service/transformations/JISInfotextTransferTransformation.js.map +1 -1
  334. package/dist/output-gateway/pid/service/transformations/TransferDepartureTransformation.js +1 -2
  335. package/dist/output-gateway/pid/service/transformations/TransferDepartureTransformation.js.map +1 -1
  336. package/dist/output-gateway/public/controllers/v2/V2PublicDepartureBoardsController.js +4 -13
  337. package/dist/output-gateway/public/controllers/v2/V2PublicDepartureBoardsController.js.map +1 -1
  338. package/dist/output-gateway/public/controllers/v2/V2PublicGtfsController.js +4 -13
  339. package/dist/output-gateway/public/controllers/v2/V2PublicGtfsController.js.map +1 -1
  340. package/dist/output-gateway/public/controllers/v2/V2PublicVehiclePositionsController.js +9 -18
  341. package/dist/output-gateway/public/controllers/v2/V2PublicVehiclePositionsController.js.map +1 -1
  342. package/dist/output-gateway/public/data-access/VehicleDescriptorCachedRepository.js +13 -26
  343. package/dist/output-gateway/public/data-access/VehicleDescriptorCachedRepository.js.map +1 -1
  344. package/dist/output-gateway/public/data-access/redis/DelayComputationRepository.js +22 -33
  345. package/dist/output-gateway/public/data-access/redis/DelayComputationRepository.js.map +1 -1
  346. package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js +9 -20
  347. package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js.map +1 -1
  348. package/dist/output-gateway/public/data-access/redis/PublicStopTimeRepository.js +23 -34
  349. package/dist/output-gateway/public/data-access/redis/PublicStopTimeRepository.js.map +1 -1
  350. package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.d.ts +4 -2
  351. package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.js +178 -175
  352. package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.js.map +1 -1
  353. package/dist/output-gateway/public/domain/repository/IVehiclePositionsRepository.d.ts +2 -1
  354. package/dist/output-gateway/public/routers/v2/helpers/CustomStopIdGroupValidator.js +2 -2
  355. package/dist/output-gateway/public/routers/v2/helpers/CustomStopIdGroupValidator.js.map +1 -1
  356. package/dist/output-gateway/public/service/VPSubscriber.js +8 -19
  357. package/dist/output-gateway/public/service/VPSubscriber.js.map +1 -1
  358. package/dist/output-gateway/public/service/facade/DepartureBoardFacade.js +100 -117
  359. package/dist/output-gateway/public/service/facade/DepartureBoardFacade.js.map +1 -1
  360. package/dist/output-gateway/public/service/facade/DetailedTripFacade.js +18 -29
  361. package/dist/output-gateway/public/service/facade/DetailedTripFacade.js.map +1 -1
  362. package/dist/output-gateway/public/service/facade/GtfsTripLookupFacade.js +20 -31
  363. package/dist/output-gateway/public/service/facade/GtfsTripLookupFacade.js.map +1 -1
  364. package/dist/output-gateway/public/service/facade/VehiclePositionsFacade.js +15 -26
  365. package/dist/output-gateway/public/service/facade/VehiclePositionsFacade.js.map +1 -1
  366. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/StopTimesTripScopeHandler.js +1 -2
  367. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/StopTimesTripScopeHandler.js.map +1 -1
  368. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/InfoTripScopeHandler.js +3 -14
  369. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/InfoTripScopeHandler.js.map +1 -1
  370. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.js +7 -18
  371. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.js.map +1 -1
  372. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js +35 -46
  373. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js.map +1 -1
  374. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler.js +16 -22
  375. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler.js.map +1 -1
  376. package/dist/output-gateway/public/service/transformations/PublicDepartureTransformation.js +9 -10
  377. package/dist/output-gateway/public/service/transformations/PublicDepartureTransformation.js.map +1 -1
  378. package/dist/output-gateway/public/service/transformations/PublicVehiclePositionsTransformation.js +5 -15
  379. package/dist/output-gateway/public/service/transformations/PublicVehiclePositionsTransformation.js.map +1 -1
  380. package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripInfoTransformation.js +2 -3
  381. package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripInfoTransformation.js.map +1 -1
  382. package/dist/output-gateway/public/service/transformations/scopes/PublicVPTripInfoTransformation.js +2 -15
  383. package/dist/output-gateway/public/service/transformations/scopes/PublicVPTripInfoTransformation.js.map +1 -1
  384. package/dist/output-gateway/public/service/transformations/scopes/PublicVPTripStopTimesTransformation.js +1 -13
  385. package/dist/output-gateway/public/service/transformations/scopes/PublicVPTripStopTimesTransformation.js.map +1 -1
  386. package/dist/output-gateway/ropid-gtfs/data-access/CisStopGroupRepository.js +14 -25
  387. package/dist/output-gateway/ropid-gtfs/data-access/CisStopGroupRepository.js.map +1 -1
  388. package/dist/output-gateway/ropid-gtfs/data-access/redis/RunTripsRedisRepository.d.ts +10 -0
  389. package/dist/output-gateway/ropid-gtfs/data-access/redis/RunTripsRedisRepository.js +65 -0
  390. package/dist/output-gateway/ropid-gtfs/data-access/redis/RunTripsRedisRepository.js.map +1 -0
  391. package/dist/output-gateway/ropid-gtfs/domain/repository/IRunTripsRedisRepository.d.ts +4 -0
  392. package/dist/output-gateway/ropid-gtfs/domain/repository/IRunTripsRedisRepository.js +3 -0
  393. package/dist/output-gateway/ropid-gtfs/domain/repository/IRunTripsRedisRepository.js.map +1 -0
  394. package/dist/output-gateway/ropid-gtfs/models/GTFSCalendarModel.js +3 -12
  395. package/dist/output-gateway/ropid-gtfs/models/GTFSCalendarModel.js.map +1 -1
  396. package/dist/output-gateway/ropid-gtfs/models/GTFSRoutesModel.js +4 -13
  397. package/dist/output-gateway/ropid-gtfs/models/GTFSRoutesModel.js.map +1 -1
  398. package/dist/output-gateway/ropid-gtfs/models/GTFSShapesModel.js +5 -14
  399. package/dist/output-gateway/ropid-gtfs/models/GTFSShapesModel.js.map +1 -1
  400. package/dist/output-gateway/ropid-gtfs/models/GTFSStopModel.js +90 -102
  401. package/dist/output-gateway/ropid-gtfs/models/GTFSStopModel.js.map +1 -1
  402. package/dist/output-gateway/ropid-gtfs/models/GTFSStopTimesModel.js +3 -12
  403. package/dist/output-gateway/ropid-gtfs/models/GTFSStopTimesModel.js.map +1 -1
  404. package/dist/output-gateway/ropid-gtfs/models/GTFSTripsModel.js +43 -51
  405. package/dist/output-gateway/ropid-gtfs/models/GTFSTripsModel.js.map +1 -1
  406. package/dist/output-gateway/ropid-gtfs/routers/v2/V2GTFSRouter.js +28 -37
  407. package/dist/output-gateway/ropid-gtfs/routers/v2/V2GTFSRouter.js.map +1 -1
  408. package/dist/output-gateway/shared/DepartureCalculator.js +1 -1
  409. package/dist/output-gateway/shared/DepartureCalculator.js.map +1 -1
  410. package/dist/output-gateway/shared/constants/validations.js +1 -1
  411. package/dist/output-gateway/shared/constants/validations.js.map +1 -1
  412. package/dist/output-gateway/vehicle-positions/data-access/helpers/PositionOutputMapper.js +40 -48
  413. package/dist/output-gateway/vehicle-positions/data-access/helpers/PositionOutputMapper.js.map +1 -1
  414. package/dist/output-gateway/vehicle-positions/data-access/views/TripWithLastPositionRepository.js +7 -16
  415. package/dist/output-gateway/vehicle-positions/data-access/views/TripWithLastPositionRepository.js.map +1 -1
  416. package/dist/output-gateway/vehicle-positions/routers/v2/V2VehiclePositionsRouter.js +10 -19
  417. package/dist/output-gateway/vehicle-positions/routers/v2/V2VehiclePositionsRouter.js.map +1 -1
  418. package/dist/schema-definitions/ropid-gtfs/RopidGTFSRunNumbers.js +5 -2
  419. package/dist/schema-definitions/ropid-gtfs/RopidGTFSRunNumbers.js.map +1 -1
  420. package/dist/schema-definitions/ropid-gtfs/index.js +16 -4
  421. package/dist/schema-definitions/ropid-gtfs/index.js.map +1 -1
  422. package/dist/schema-definitions/ropid-gtfs/redis/const.d.ts +1 -0
  423. package/dist/schema-definitions/ropid-gtfs/redis/const.js +2 -1
  424. package/dist/schema-definitions/ropid-gtfs/redis/const.js.map +1 -1
  425. package/docs/openapi-output.yaml +11 -3
  426. package/package.json +2 -2
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=DepartureInterfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DepartureInterfaces.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/domain/DepartureInterfaces.ts"],"names":[],"mappings":""}
@@ -32,7 +32,6 @@ _a = DepartureBoardMapper;
32
32
  * Initiates all routes. Should respond with correct data to a HTTP requests to all routes.
33
33
  */
34
34
  DepartureBoardMapper.transformResponseData = (x, preferredTimezone, mode) => {
35
- var _b, _c;
36
35
  let isAtStop = x.is_delay_available ? x.stop_sequence === x["trip.last_position.this_stop_sequence"] : false;
37
36
  const arrivalTimestamp = {
38
37
  // with added delay
@@ -85,12 +84,12 @@ DepartureBoardMapper.transformResponseData = (x, preferredTimezone, mode) => {
85
84
  },
86
85
  trip: {
87
86
  direction: x.direction,
88
- headsign: (_b = x.stop_headsign) !== null && _b !== void 0 ? _b : x.trip_headsign,
87
+ headsign: x.stop_headsign ?? x.trip_headsign,
89
88
  id: x.trip_id,
90
89
  is_at_stop: isAtStop,
91
90
  is_canceled: x.is_canceled || false,
92
91
  is_wheelchair_accessible: _a.determineWheelchairAccessibility(x),
93
- is_air_conditioned: (_c = x["trip.vehicle_descriptor.is_air_conditioned"]) !== null && _c !== void 0 ? _c : null,
92
+ is_air_conditioned: x["trip.vehicle_descriptor.is_air_conditioned"] ?? null,
94
93
  short_name: x.trip_short_name || null,
95
94
  },
96
95
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DepartureBoardMapper.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/helpers/DepartureBoardMapper.ts"],"names":[],"mappings":";;;AAAA,4EAA2G;AAC3G,oEAA4D;AAC5D,yCAA8C;AAC9C,0EAAqE;AACrE,sEAAwD;AACxD,0BAAuF;AACvF,kFAA+E;AAE/E,MAAqB,oBAAoB;IAC9B,MAAM,CAAC,aAAa,CAAC,IAAS,EAAE,iBAAyB,EAAE,IAAY;QAC1E,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAgB,EAAE,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,EAAE,iBAAiB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,CAAC,mBAAmB,CAAC;YACxD,KAAK,mDAA8B,CAAC,aAAa,CAAC;YAClD;gBACI,OAAO,KAAK,CAAC;SACpB;KACJ;SAAM;QACH,OAAO,OAAO,0BAA0B,KAAK,SAAS;YAClD,CAAC,CAAC,0BAA0B;YAC5B,CAAC,CAAC,qBAAqB,KAAK,iDAA4B,CAAC,iBAAiB,CAAC;KAClF;AACL,CAAC,AAjB8C,CAiB7C;kBA9Ge,oBAAoB"}
@@ -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
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
@@ -21,7 +12,7 @@ exports.ParamValidatorManager = ParamValidatorManager;
21
12
  _a = ParamValidatorManager;
22
13
  ParamValidatorManager.ASW_ID_FORMAT_REGEXP = /^[0-9]+[_\/]?[0-9]*[_\/]?$/;
23
14
  ParamValidatorManager.getAswIdsValidator = () => {
24
- return (value) => __awaiter(void 0, void 0, void 0, function* () {
15
+ return async (value) => {
25
16
  if (!value) {
26
17
  return Promise.reject("aswIds must be defined");
27
18
  }
@@ -32,10 +23,10 @@ ParamValidatorManager.getAswIdsValidator = () => {
32
23
  }
33
24
  }
34
25
  return true;
35
- });
26
+ };
36
27
  };
37
28
  ParamValidatorManager.getDateValidator = () => {
38
- return (date) => __awaiter(void 0, void 0, void 0, function* () {
29
+ return async (date) => {
39
30
  if (!date) {
40
31
  return Promise.reject("Date must be defined");
41
32
  }
@@ -44,14 +35,14 @@ ParamValidatorManager.getDateValidator = () => {
44
35
  return Promise.reject("Value is out of range");
45
36
  }
46
37
  return true;
47
- });
38
+ };
48
39
  };
49
40
  ParamValidatorManager.getTimeFromValidator = () => {
50
41
  const defaultTimeQueryParams = {
51
42
  hoursBefore: 6,
52
43
  hoursAfter: 2 * 24,
53
44
  };
54
- return (date) => __awaiter(void 0, void 0, void 0, function* () {
45
+ return async (date) => {
55
46
  if (!date) {
56
47
  return Promise.reject("Date must be defined");
57
48
  }
@@ -61,6 +52,6 @@ ParamValidatorManager.getTimeFromValidator = () => {
61
52
  !timeFrom.isBetween(currentMoment.clone().subtract(defaultTimeQueryParams.hoursBefore, "hours"), currentMoment.clone().add(defaultTimeQueryParams.hoursAfter, "hours"), undefined, "[]")) {
62
53
  return Promise.reject("Parameter timeFrom must be in interval [-6h; +2d]");
63
54
  }
64
- });
55
+ };
65
56
  };
66
57
  //# sourceMappingURL=ParamValidatorManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ParamValidatorManager.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/helpers/ParamValidatorManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,gGAA+D;AAE/D,MAAa,qBAAqB;;AAAlC,sDA+DC;;AA9DkB,0CAAoB,GAAG,4BAA4B,AAA/B,CAAgC;AAErD,wCAAkB,GAAG,GAAoB,EAAE;IACrD,OAAO,CAAO,KAAK,EAAE,EAAE;QACnB,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,OAAO,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC;SACnD;QAED,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACtD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YACxB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,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YACE,OAAO,OAAO,CAAC,MAAM,CAAC,mDAAmD,CAAC,CAAC;SAC9E;IACL,CAAC,CAAA,CAAC;AACN,CAAC,AA1BiC,CA0BhC"}
1
+ {"version":3,"file":"ParamValidatorManager.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/helpers/ParamValidatorManager.ts"],"names":[],"mappings":";;;;;;;AACA,gGAA+D;AAE/D,MAAa,qBAAqB;;AAAlC,sDA+DC;;AA9DkB,0CAAoB,GAAG,4BAA4B,AAA/B,CAAgC;AAErD,wCAAkB,GAAG,GAAoB,EAAE;IACrD,OAAO,KAAK,EAAE,KAAK,EAAE,EAAE;QACnB,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,OAAO,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC;SACnD;QAED,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACtD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YACxB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,EAAE;gBACvF,OAAO,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;aAClD;SACJ;QAED,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;AACN,CAAC,AAf+B,CAe9B;AAEY,sCAAgB,GAAG,GAAoB,EAAE;IACnD,OAAO,KAAK,EAAE,IAAI,EAAE,EAAE;QAClB,IAAI,CAAC,IAAI,EAAE;YACP,OAAO,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;SACjD;QAED,MAAM,EAAE,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QAEpC,IAAI,EAAE,GAAG,CAAC,EAAE;YACR,OAAO,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;SAClD;QAED,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;AACN,CAAC,AAd6B,CAc5B;AAEY,0CAAoB,GAAG,GAAoB,EAAE;IACvD,MAAM,sBAAsB,GAAG;QAC3B,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,CAAC,GAAG,EAAE;KACrB,CAAC;IAEF,OAAO,KAAK,EAAE,IAAI,EAAE,EAAE;QAClB,IAAI,CAAC,IAAI,EAAE;YACP,OAAO,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;SACjD;QAED,MAAM,QAAQ,GAAG,IAAA,yBAAM,EAAC,IAAI,CAAC,CAAC;QAC9B,MAAM,aAAa,GAAG,IAAA,yBAAM,GAAE,CAAC;QAE/B,IACI,QAAQ;YACR,CAAC,QAAQ,CAAC,SAAS,CACf,aAAa,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC,WAAW,EAAE,OAAO,CAAC,EAC3E,aAAa,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,sBAAsB,CAAC,UAAU,EAAE,OAAO,CAAC,EACrE,SAAS,EACT,IAAI,CACP,EACH;YACE,OAAO,OAAO,CAAC,MAAM,CAAC,mDAAmD,CAAC,CAAC;SAC9E;IACL,CAAC,CAAC;AACN,CAAC,AA1BiC,CA0BhC"}
@@ -33,6 +33,9 @@ export interface IPIDDeparture {
33
33
  departure_datetime_real: Date | null;
34
34
  real_wheelchair_accessible: boolean | null;
35
35
  is_canceled: boolean;
36
+ origin_route_name: string | null;
37
+ run_number: number | null;
38
+ "trip.start_timestamp": string | null;
36
39
  "trip.last_position.last_stop_id": string | null;
37
40
  "trip.last_position.last_stop_sequence": number | null;
38
41
  "trip.last_position.last_stop_name": string | null;
@@ -109,11 +112,6 @@ export interface IStop {
109
112
  stop_name: string;
110
113
  platform_code: string;
111
114
  }
112
- export interface IDepartureBoard {
113
- departures: IPIDDeparture[];
114
- infotexts: any[];
115
- stops: IStop[];
116
- }
117
115
  export interface IDepartureTime {
118
116
  predicted: string | null;
119
117
  scheduled: string | null;
@@ -139,6 +137,7 @@ export declare enum DepartureFilter {
139
137
  }
140
138
  export declare enum DepartureSkip {
141
139
  UNTRACKED = "untracked",
140
+ MISSING = "missing",
142
141
  CANCELED = "canceled",
143
142
  AT_STOP = "atStop"
144
143
  }
@@ -41,6 +41,7 @@ var DepartureFilter;
41
41
  var DepartureSkip;
42
42
  (function (DepartureSkip) {
43
43
  DepartureSkip["UNTRACKED"] = "untracked";
44
+ DepartureSkip["MISSING"] = "missing";
44
45
  DepartureSkip["CANCELED"] = "canceled";
45
46
  DepartureSkip["AT_STOP"] = "atStop";
46
47
  // ON_INFOTEXT = "onInfotext",
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/pid/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA,4CAA0B;AAC1B,2CAAyB;AAoHzB,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,aAKX;AALD,WAAY,aAAa;IACrB,wCAAuB,CAAA;IACvB,sCAAqB,CAAA;IACrB,mCAAkB,CAAA;IAClB,8BAA8B;AAClC,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/pid/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA,4CAA0B;AAC1B,2CAAyB;AAiHzB,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"}
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OgPidContainer = void 0;
4
+ const PublicVehiclePositionsRepository_1 = require("../../public/data-access/redis/PublicVehiclePositionsRepository");
4
5
  const CisStopGroupRepository_1 = require("../../ropid-gtfs/data-access/CisStopGroupRepository");
6
+ const RunTripsRedisRepository_1 = require("../../ropid-gtfs/data-access/redis/RunTripsRedisRepository");
5
7
  const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
6
8
  const V3InfotextsController_1 = require("../controllers/v3/V3InfotextsController");
7
9
  const V3TransferBoardsController_1 = require("../controllers/v3/V3TransferBoardsController");
@@ -24,6 +26,8 @@ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextRopidGTFSSto
24
26
  ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextRopidGTFSStopsRepository, JISInfotextRopidGTFSStopsRepository_1.JISInfotextRopidGTFSStopsRepository);
25
27
  ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextRepository, JISInfotextRepository_1.JISInfotextRepository);
26
28
  ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.DeparturesRepository, data_access_1.DeparturesRepository);
29
+ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.RunTripsRedisRepository, RunTripsRedisRepository_1.RunTripsRedisRepository);
30
+ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.PublicVehiclePositionsRepository, PublicVehiclePositionsRepository_1.PublicVehiclePositionsRepository);
27
31
  //#endregion
28
32
  //#region Transformations
29
33
  ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextDepartureTransformation, JISInfotextDepartureTransformation_1.JISInfotextDepartureTransformation);
@@ -1 +1 @@
1
- {"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,gGAA2F;AAC3F,+DAA+E;AAE/E,mFAAgF;AAChF,6FAA0F;AAC1F,gDAAsD;AACtD,gFAA6E;AAC7E,4GAAyG;AACzG,qEAAkE;AAClE,6DAA0D;AAC1D,qEAAkE;AAClE,sHAAmH;AACnH,oHAAiH;AACjH,oHAAiH;AACjH,gHAA6G;AAC7G,6CAA0C;AAE1C,MAAM,cAAc,GAAwB,4BAAsB,CAAC,oBAAoB,EAAE,CAAC;AA4B/D,wCAAc;AA1BzC,sBAAsB;AACtB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,sBAAsB,EAAE,+CAAsB,CAAC,CAAC;AAC5F,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,mCAAmC,EAAE,yEAAmC,CAAC,CAAC;AACtH,cAAc,CAAC,iBAAiB,CAAC,uBAAU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AACpE,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,cAAc,EAAE,+BAAc,CAAC,CAAC;AAC5E,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,cAAc,EAAE,+BAAc,CAAC,CAAC;AAC5E,YAAY;AAEZ,qBAAqB;AACrB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,0BAA0B,EAAE,uDAA0B,CAAC,CAAC;AACpG,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,qBAAqB,EAAE,6CAAqB,CAAC,CAAC"}
@@ -3,6 +3,8 @@ export declare const OgPidToken: {
3
3
  JISInfotextRopidGTFSStopsRepository: symbol;
4
4
  JISInfotextRepository: symbol;
5
5
  DeparturesRepository: symbol;
6
+ RunTripsRedisRepository: symbol;
7
+ PublicVehiclePositionsRepository: symbol;
6
8
  JISInfotextDepartureTransformation: symbol;
7
9
  JISInfotextTransferTransformation: symbol;
8
10
  JISInfotextOverviewTransformation: symbol;
@@ -7,6 +7,8 @@ exports.OgPidToken = {
7
7
  JISInfotextRopidGTFSStopsRepository: Symbol(),
8
8
  JISInfotextRepository: Symbol(),
9
9
  DeparturesRepository: Symbol(),
10
+ RunTripsRedisRepository: Symbol(),
11
+ PublicVehiclePositionsRepository: Symbol(),
10
12
  //#endregion
11
13
  //#region Transformations
12
14
  JISInfotextDepartureTransformation: Symbol(),
@@ -1 +1 @@
1
- {"version":3,"file":"OgPidToken.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/ioc/OgPidToken.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;IACtB,sBAAsB;IACtB,sBAAsB,EAAE,MAAM,EAAE;IAChC,mCAAmC,EAAE,MAAM,EAAE;IAC7C,qBAAqB,EAAE,MAAM,EAAE;IAC/B,oBAAoB,EAAE,MAAM,EAAE;IAC9B,YAAY;IAEZ,yBAAyB;IACzB,kCAAkC,EAAE,MAAM,EAAE;IAC5C,iCAAiC,EAAE,MAAM,EAAE;IAC3C,iCAAiC,EAAE,MAAM,EAAE;IAC3C,+BAA+B,EAAE,MAAM,EAAE;IACzC,YAAY;IAEZ,gBAAgB;IAChB,UAAU,EAAE,MAAM,EAAE;IACpB,cAAc,EAAE,MAAM,EAAE;IACxB,cAAc,EAAE,MAAM,EAAE;IACxB,YAAY;IAEZ,qBAAqB;IACrB,0BAA0B,EAAE,MAAM,EAAE;IACpC,qBAAqB,EAAE,MAAM,EAAE;IAC/B,YAAY;CACf,CAAC"}
1
+ {"version":3,"file":"OgPidToken.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/ioc/OgPidToken.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;IACtB,sBAAsB;IACtB,sBAAsB,EAAE,MAAM,EAAE;IAChC,mCAAmC,EAAE,MAAM,EAAE;IAC7C,qBAAqB,EAAE,MAAM,EAAE;IAC/B,oBAAoB,EAAE,MAAM,EAAE;IAC9B,uBAAuB,EAAE,MAAM,EAAE;IACjC,gCAAgC,EAAE,MAAM,EAAE;IAC1C,YAAY;IAEZ,yBAAyB;IACzB,kCAAkC,EAAE,MAAM,EAAE;IAC5C,iCAAiC,EAAE,MAAM,EAAE;IAC3C,iCAAiC,EAAE,MAAM,EAAE;IAC3C,+BAA+B,EAAE,MAAM,EAAE;IACzC,YAAY;IAEZ,gBAAgB;IAChB,UAAU,EAAE,MAAM,EAAE;IACpB,cAAc,EAAE,MAAM,EAAE;IACxB,cAAc,EAAE,MAAM,EAAE;IACxB,YAAY;IAEZ,qBAAqB;IACrB,0BAA0B,EAAE,MAAM,EAAE;IACpC,qBAAqB,EAAE,MAAM,EAAE;IAC/B,YAAY;CACf,CAAC"}
@@ -1,34 +1,20 @@
1
- import { Moment } from "@golemio/core/dist/shared/moment-timezone";
2
- import { DepartureFilter, DepartureMode, DepartureOrder, DepartureSkip } from "..";
1
+ import { IDepartureBoardOutputDto } from "../domain/DepartureInterfaces";
2
+ import { IGetDeparturesOptions } from "./interfaces/IGetDeparturesOptions";
3
3
  declare class PIDDepartureBoardsModel {
4
- private stopsMaxCount;
5
- private ropidDeparturesDirectionsModel;
6
- private departuresRepository;
4
+ private readonly log;
5
+ private readonly ropidDeparturesDirectionsModel;
6
+ private readonly departuresRepository;
7
+ private readonly runTripsRedisRepository;
8
+ private readonly positionsRedisRepository;
7
9
  private readonly infotextRepository;
8
10
  private readonly infotextTransformation;
9
11
  constructor();
10
- /** Retrieves all gtfs stop times for specific stop, optionaly enhanced with realtime delays
11
- * @param {string} id Id of the stop
12
- * @returns Object of the retrieved record or null
13
- */
14
- GetAll: (options: {
15
- aswIds?: string[];
16
- cisIds?: string[];
17
- gtfsIds?: string[];
18
- names?: string[];
19
- total: number;
20
- limit: number;
21
- offset: number;
22
- mode: DepartureMode;
23
- minutesBefore: number;
24
- minutesAfter: number;
25
- timeFrom?: Moment;
26
- order: DepartureOrder;
27
- filter: DepartureFilter;
28
- skip: DepartureSkip[];
29
- includeMetroTrains?: boolean;
30
- airCondition?: boolean;
31
- timezone: string;
32
- }) => Promise<any>;
12
+ getAll(options: IGetDeparturesOptions): Promise<IDepartureBoardOutputDto>;
13
+ private retrieveAndReturnStops;
14
+ private retrieveAndReturnInfotexts;
15
+ private retrieveAndReturnDirections;
16
+ private retrieveAndReturnDepartures;
17
+ private retrieveAndReturnRunTrips;
18
+ private retrieveAndReturnUntrackedTrips;
33
19
  }
34
20
  export { PIDDepartureBoardsModel };
@@ -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
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
@@ -21,103 +12,223 @@ const trace_provider_1 = require("@golemio/core/dist/monitoring/opentelemetry/tr
21
12
  const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
22
13
  const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
23
14
  const _1 = require(".");
15
+ const __1 = require("..");
24
16
  const Di_1 = require("../ioc/Di");
25
17
  const OgPidToken_1 = require("../ioc/OgPidToken");
26
18
  const PIDDepartureModel_1 = __importDefault(require("./helpers/PIDDepartureModel"));
19
+ const STOPS_MAX_COUNT = 100;
20
+ // TODO refactor - split into facade and multiple service/strategy classes
21
+ // Check V3TransferBoardsController and TransferFacade for inspiration
27
22
  class PIDDepartureBoardsModel {
28
23
  constructor() {
29
- this.stopsMaxCount = 100;
30
- /** Retrieves all gtfs stop times for specific stop, optionaly enhanced with realtime delays
31
- * @param {string} id Id of the stop
32
- * @returns Object of the retrieved record or null
33
- */
34
- this.GetAll = (options) => __awaiter(this, void 0, void 0, function* () {
35
- var _a, _b;
36
- const currentMoment = (0, moment_timezone_1.default)();
37
- const minutesOffset = options.timeFrom ? options.timeFrom.diff(currentMoment, "minutes") : 0;
38
- const spanStops = (0, trace_provider_1.createChildSpan)("V2PIDRouter.DB.stops");
39
- spanStops === null || spanStops === void 0 ? void 0 : spanStops.setAttributes(Object.assign(Object.assign({}, options), { timeFrom: (_a = options.timeFrom) === null || _a === void 0 ? void 0 : _a.toString() }));
40
- const stopsToInclude = yield models_1.models.GTFSStopModel.GetAll({
24
+ this.log = Di_1.OgPidContainer.resolve(CoreToken_1.CoreToken.Logger);
25
+ this.ropidDeparturesDirectionsModel = new _1.RopidDeparturesDirectionsModel();
26
+ this.departuresRepository = new data_access_1.DeparturesRepository(Di_1.OgPidContainer.resolve(CoreToken_1.CoreToken.PostgresConnector), Di_1.OgPidContainer.resolve(CoreToken_1.CoreToken.SimpleConfig));
27
+ this.runTripsRedisRepository = Di_1.OgPidContainer.resolve(OgPidToken_1.OgPidToken.RunTripsRedisRepository);
28
+ this.positionsRedisRepository = Di_1.OgPidContainer.resolve(OgPidToken_1.OgPidToken.PublicVehiclePositionsRepository);
29
+ this.infotextRepository = Di_1.OgPidContainer.resolve(OgPidToken_1.OgPidToken.JISInfotextRepository);
30
+ this.infotextTransformation = Di_1.OgPidContainer.resolve(OgPidToken_1.OgPidToken.JISInfotextDepartureTransformation);
31
+ }
32
+ async getAll(options) {
33
+ const currentMoment = (0, moment_timezone_1.default)();
34
+ //#region Data retrieval from DB (GTFS stops, infotexts, directions, departures)
35
+ const { stopsToInclude, stopIds } = await this.retrieveAndReturnStops(options);
36
+ const [infotextsToInclude, directions, departures] = await Promise.all([
37
+ this.retrieveAndReturnInfotexts(stopIds, currentMoment, options),
38
+ this.retrieveAndReturnDirections(stopIds),
39
+ this.retrieveAndReturnDepartures(stopIds, currentMoment, options),
40
+ ]);
41
+ //#endregion
42
+ //#region Data retrieval from Redis (run schedule, untracked trips)
43
+ let runScheduleMap = new Map();
44
+ let untrackedTrips = new Set();
45
+ const isMissingRequested = options.skip.includes(__1.DepartureSkip.MISSING) && !options.skip.includes(__1.DepartureSkip.UNTRACKED);
46
+ // Note: The run schedule and untracked trips are populated only if the skip[]=missing (without untracked) is present
47
+ // Check the PIDDeparturesModel.skip function. In other cases they are not needed
48
+ if (isMissingRequested) {
49
+ const runTuples = new Set();
50
+ for (const departure of departures) {
51
+ runTuples.add(`${departure.origin_route_name}_${departure.run_number}`);
52
+ }
53
+ const { runSchedule, runTripIds } = await this.retrieveAndReturnRunTrips(runTuples);
54
+ runScheduleMap = runSchedule;
55
+ untrackedTrips = await this.retrieveAndReturnUntrackedTrips(runTripIds);
56
+ }
57
+ //#endregion
58
+ //#region Processing and returning departures
59
+ const spanProcessing = (0, trace_provider_1.createChildSpan)("V2PIDRouter.Processing");
60
+ try {
61
+ const departuresToInclude = new PIDDepartureModel_1.default(departures, {
62
+ limit: options.limit,
63
+ offset: options.offset,
64
+ total: options.total,
65
+ mode: options.mode,
66
+ order: options.order,
67
+ filter: options.filter,
68
+ skip: options.skip,
69
+ departuresDirections: directions,
70
+ timezone: options.timezone,
71
+ tripNumber: null,
72
+ runScheduleMap,
73
+ untrackedTrips,
74
+ }).toArray();
75
+ spanProcessing?.end();
76
+ return {
77
+ departures: departuresToInclude,
78
+ infotexts: infotextsToInclude,
79
+ stops: stopsToInclude,
80
+ };
81
+ }
82
+ catch (error) {
83
+ spanProcessing?.recordException(error);
84
+ if (error instanceof golemio_errors_1.AbstractGolemioError) {
85
+ throw error;
86
+ }
87
+ throw new golemio_errors_1.GeneralError("Error while processing departures", this.constructor.name, error, 500);
88
+ }
89
+ //#endregion
90
+ }
91
+ async retrieveAndReturnStops(options) {
92
+ const spanStops = (0, trace_provider_1.createChildSpan)("V2PIDRouter.DB.stops");
93
+ spanStops?.setAttributes({ ...options, timeFrom: options.timeFrom?.toString() });
94
+ try {
95
+ const stopsToInclude = await models_1.models.GTFSStopModel.GetAll({
41
96
  includeMetroTrains: options.includeMetroTrains,
42
97
  appendAswId: true,
43
98
  aswIds: options.aswIds,
44
99
  cisIds: options.cisIds,
45
100
  gtfsIds: options.gtfsIds,
46
- limit: this.stopsMaxCount + 1,
101
+ limit: STOPS_MAX_COUNT + 1,
47
102
  locationType: StopEnums_1.GtfsStopLocationType.StopOrPlatform,
48
103
  names: options.names,
49
104
  returnRaw: true,
50
105
  });
51
106
  if (stopsToInclude.length === 0) {
52
- throw new golemio_errors_1.GeneralError("No stops found.", "DepartureBoardsRouter", undefined, 404);
53
- }
54
- if (stopsToInclude.length > this.stopsMaxCount) {
55
- throw new golemio_errors_1.GeneralError(`Too many stops, try lower number or split requests. The maximum is ${this.stopsMaxCount} stops.`, "DepartureBoardsRouter", undefined, 413);
107
+ throw new golemio_errors_1.GeneralError("No stops found.", this.constructor.name, undefined, 404);
56
108
  }
57
- const stopsIds = stopsToInclude.map((e) => e.stop_id);
58
- spanStops === null || spanStops === void 0 ? void 0 : spanStops.end();
59
- const spanInfotexts = (0, trace_provider_1.createChildSpan)("V2PIDRouter.DB.infotexts");
60
- let infotextsToInclude;
61
- try {
62
- const infotexts = yield this.infotextRepository.findAllForDepartureBoard(stopsIds, ((_b = options.timeFrom) !== null && _b !== void 0 ? _b : currentMoment).toDate());
63
- infotextsToInclude = this.infotextTransformation.transformArray(infotexts.map((infotext) => ({
64
- data: infotext,
65
- timeZone: options.timezone,
66
- })));
109
+ else if (stopsToInclude.length > STOPS_MAX_COUNT) {
110
+ throw new golemio_errors_1.GeneralError(`Too many stops, try lower number or split requests. The maximum is ${STOPS_MAX_COUNT} stops.`, this.constructor.name, undefined, 413);
67
111
  }
68
- catch (err) {
69
- if (err instanceof golemio_errors_1.AbstractGolemioError) {
70
- throw err;
71
- }
72
- throw new golemio_errors_1.GeneralError("Database error", "DepartureBoardsModel", err, 500);
112
+ const stopIds = stopsToInclude.map(({ stop_id }) => stop_id);
113
+ spanStops?.end();
114
+ return { stopsToInclude, stopIds };
115
+ }
116
+ catch (error) {
117
+ spanStops?.recordException(error);
118
+ if (error instanceof golemio_errors_1.AbstractGolemioError) {
119
+ throw error;
73
120
  }
74
- spanInfotexts === null || spanInfotexts === void 0 ? void 0 : spanInfotexts.end();
75
- const spanDirections = (0, trace_provider_1.createChildSpan)("V2PIDRouter.DB.directions");
76
- let departuresDirections;
77
- try {
78
- departuresDirections = yield this.ropidDeparturesDirectionsModel.GetAll(stopsIds);
121
+ throw new golemio_errors_1.GeneralError("Error while getting stops", this.constructor.name, error, 500);
122
+ }
123
+ }
124
+ async retrieveAndReturnInfotexts(stopIds, currentMoment, options) {
125
+ const spanInfotexts = (0, trace_provider_1.createChildSpan)("V2PIDRouter.DB.infotexts");
126
+ try {
127
+ const infotexts = await this.infotextRepository.findAllForDepartureBoard(stopIds, (options.timeFrom ?? currentMoment).toDate());
128
+ const infotextsToInclude = this.infotextTransformation.transformArray(infotexts.map((infotext) => ({
129
+ data: infotext,
130
+ timeZone: options.timezone,
131
+ })));
132
+ spanInfotexts?.end();
133
+ return infotextsToInclude;
134
+ }
135
+ catch (error) {
136
+ spanInfotexts?.recordException(error);
137
+ if (error instanceof golemio_errors_1.AbstractGolemioError) {
138
+ throw error;
79
139
  }
80
- catch (err) {
81
- throw new golemio_errors_1.GeneralError("Database error", "DepartureBoardsModel", err, 500);
140
+ throw new golemio_errors_1.GeneralError("Error while getting infotexts", this.constructor.name, error, 500);
141
+ }
142
+ }
143
+ async retrieveAndReturnDirections(stopIds) {
144
+ const spanDirections = (0, trace_provider_1.createChildSpan)("V2PIDRouter.DB.directions");
145
+ try {
146
+ const departuresDirections = await this.ropidDeparturesDirectionsModel.GetAll(stopIds);
147
+ spanDirections?.end();
148
+ return departuresDirections;
149
+ }
150
+ catch (error) {
151
+ spanDirections?.recordException(error);
152
+ if (error instanceof golemio_errors_1.AbstractGolemioError) {
153
+ throw error;
82
154
  }
83
- spanDirections === null || spanDirections === void 0 ? void 0 : spanDirections.end();
84
- try {
85
- const results = yield this.departuresRepository.GetAll({
86
- currentMoment,
87
- minutesAfter: options.minutesAfter,
88
- minutesBefore: options.minutesBefore,
89
- minutesOffset,
90
- stopsIds,
91
- mode: options.mode,
92
- isAirCondition: !!options.airCondition,
93
- });
94
- const spanDepartures = (0, trace_provider_1.createChildSpan)("V2PIDRouter.DB.departures");
95
- const res = {
96
- departures: new PIDDepartureModel_1.default(results, {
97
- limit: options.limit,
98
- offset: options.offset,
99
- total: options.total,
100
- mode: options.mode,
101
- order: options.order,
102
- filter: options.filter,
103
- skip: options.skip,
104
- departuresDirections,
105
- timezone: options.timezone,
106
- }).toArray(),
107
- infotexts: infotextsToInclude,
108
- stops: stopsToInclude,
109
- };
110
- spanDepartures === null || spanDepartures === void 0 ? void 0 : spanDepartures.end();
111
- return res;
155
+ throw new golemio_errors_1.GeneralError("Error while getting directions", this.constructor.name, error, 500);
156
+ }
157
+ }
158
+ async retrieveAndReturnDepartures(stopIds, currentMoment, options) {
159
+ const spanDepartures = (0, trace_provider_1.createChildSpan)("V2PIDRouter.DB.departures");
160
+ spanDepartures?.setAttributes({ stopIds });
161
+ try {
162
+ const minutesOffset = options.timeFrom ? options.timeFrom.diff(currentMoment, "minutes") : 0;
163
+ const departures = await this.departuresRepository.GetAll({
164
+ currentMoment,
165
+ minutesAfter: options.minutesAfter,
166
+ minutesBefore: options.minutesBefore,
167
+ minutesOffset,
168
+ stopsIds: stopIds,
169
+ mode: options.mode,
170
+ isAirCondition: !!options.airCondition,
171
+ });
172
+ spanDepartures?.end();
173
+ return departures;
174
+ }
175
+ catch (error) {
176
+ spanDepartures?.recordException(error);
177
+ if (error instanceof golemio_errors_1.AbstractGolemioError) {
178
+ throw error;
112
179
  }
113
- catch (err) {
114
- throw new golemio_errors_1.GeneralError("Database error", "DepartureBoardsModel", err, 500);
180
+ throw new golemio_errors_1.GeneralError("Error while getting departures", this.constructor.name, error, 500);
181
+ }
182
+ }
183
+ async retrieveAndReturnRunTrips(runTuples) {
184
+ const runScheduleMap = new Map();
185
+ const tripIds = new Set();
186
+ const spanRunTrips = (0, trace_provider_1.createChildSpan)("V2PIDRouter.Redis.runTrips");
187
+ try {
188
+ const runTuplesArray = Array.from(runTuples);
189
+ const runSchedule = await this.runTripsRedisRepository.getMultipleSchedule(runTuplesArray);
190
+ for (let i = 0; i < runSchedule.length; i++) {
191
+ const runTrip = runSchedule[i];
192
+ if (runTrip) {
193
+ const tuple = runTuplesArray[i];
194
+ runScheduleMap.set(tuple, runTrip.schedule);
195
+ for (const trip of runTrip.schedule) {
196
+ tripIds.add(trip.trip_id);
197
+ }
198
+ }
115
199
  }
116
- });
117
- this.ropidDeparturesDirectionsModel = new _1.RopidDeparturesDirectionsModel();
118
- this.departuresRepository = new data_access_1.DeparturesRepository(Di_1.OgPidContainer.resolve(CoreToken_1.CoreToken.PostgresConnector), Di_1.OgPidContainer.resolve(CoreToken_1.CoreToken.SimpleConfig));
119
- this.infotextRepository = Di_1.OgPidContainer.resolve(OgPidToken_1.OgPidToken.JISInfotextRepository);
120
- this.infotextTransformation = Di_1.OgPidContainer.resolve(OgPidToken_1.OgPidToken.JISInfotextDepartureTransformation);
200
+ spanRunTrips?.end();
201
+ }
202
+ catch (error) {
203
+ spanRunTrips?.recordException(error);
204
+ this.log.error(error,
205
+ // eslint-disable-next-line max-len
206
+ "Cannot retrieve run schedule. The API consumer will receive departures with missing vehicles even if they requested to skip them.");
207
+ }
208
+ finally {
209
+ return {
210
+ runSchedule: runScheduleMap,
211
+ runTripIds: tripIds,
212
+ };
213
+ }
214
+ }
215
+ async retrieveAndReturnUntrackedTrips(tripIds) {
216
+ let untrackedTrips = new Set();
217
+ const spanUntrackedTrips = (0, trace_provider_1.createChildSpan)("V2PIDRouter.Redis.untrackedTrips");
218
+ try {
219
+ const tripIdsArray = Array.from(tripIds);
220
+ untrackedTrips = await this.positionsRedisRepository.getTripsWithUntrackedVehicles(tripIdsArray);
221
+ spanUntrackedTrips?.end();
222
+ }
223
+ catch (error) {
224
+ spanUntrackedTrips?.recordException(error);
225
+ this.log.error(error,
226
+ // eslint-disable-next-line max-len
227
+ "Cannot retrieve untracked trips. The API consumer will receive departures with missing vehicles even if they requested to skip them.");
228
+ }
229
+ finally {
230
+ return untrackedTrips;
231
+ }
121
232
  }
122
233
  }
123
234
  exports.PIDDepartureBoardsModel = PIDDepartureBoardsModel;