@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.
Files changed (381) hide show
  1. package/dist/input-gateway/jis/JisInfotextsController.js +4 -13
  2. package/dist/input-gateway/jis/JisInfotextsController.js.map +1 -1
  3. package/dist/input-gateway/jis/JisInfotextsRouter.js +3 -12
  4. package/dist/input-gateway/jis/JisInfotextsRouter.js.map +1 -1
  5. package/dist/input-gateway/ropid-gtfs/RopidGtfsController.js +4 -13
  6. package/dist/input-gateway/ropid-gtfs/RopidGtfsController.js.map +1 -1
  7. package/dist/input-gateway/ropid-gtfs/RopidGtfsRouter.js +3 -12
  8. package/dist/input-gateway/ropid-gtfs/RopidGtfsRouter.js.map +1 -1
  9. package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js +4 -13
  10. package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js.map +1 -1
  11. package/dist/input-gateway/vehicle-positions/VehiclePositionsRouter.js +3 -12
  12. package/dist/input-gateway/vehicle-positions/VehiclePositionsRouter.js.map +1 -1
  13. package/dist/integration-engine/data-retention/workers/tasks/DeleteDataTask.js +4 -15
  14. package/dist/integration-engine/data-retention/workers/tasks/DeleteDataTask.js.map +1 -1
  15. package/dist/integration-engine/data-retention/workers/tasks/TableStorageRetentionTask.js +8 -19
  16. package/dist/integration-engine/data-retention/workers/tasks/TableStorageRetentionTask.js.map +1 -1
  17. package/dist/integration-engine/jis/datasources/JISInfotextsDataSourceFactory.js +1 -1
  18. package/dist/integration-engine/jis/datasources/JISInfotextsDataSourceFactory.js.map +1 -1
  19. package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js +56 -72
  20. package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js.map +1 -1
  21. package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.js +32 -48
  22. package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.js.map +1 -1
  23. package/dist/integration-engine/jis/repositories/JISMetadataRepository.js +24 -37
  24. package/dist/integration-engine/jis/repositories/JISMetadataRepository.js.map +1 -1
  25. package/dist/integration-engine/jis/services/JISInfotextsDataService.js +24 -35
  26. package/dist/integration-engine/jis/services/JISInfotextsDataService.js.map +1 -1
  27. package/dist/integration-engine/jis/transformations/JISInfotextsTransformation.js +2 -3
  28. package/dist/integration-engine/jis/transformations/JISInfotextsTransformation.js.map +1 -1
  29. package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.js +12 -23
  30. package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.js.map +1 -1
  31. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js +4 -15
  32. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js.map +1 -1
  33. package/dist/integration-engine/ropid-gtfs/RopidGTFSStopTimesModel.js +3 -12
  34. package/dist/integration-engine/ropid-gtfs/RopidGTFSStopTimesModel.js.map +1 -1
  35. package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js +2 -11
  36. package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js.map +1 -1
  37. package/dist/integration-engine/ropid-gtfs/RopidGTFSTripsModel.js +3 -12
  38. package/dist/integration-engine/ropid-gtfs/RopidGTFSTripsModel.js.map +1 -1
  39. package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.js +21 -30
  40. package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.js.map +1 -1
  41. package/dist/integration-engine/ropid-gtfs/RopidGtfsMetadataRepository.js +20 -29
  42. package/dist/integration-engine/ropid-gtfs/RopidGtfsMetadataRepository.js.map +1 -1
  43. package/dist/integration-engine/ropid-gtfs/data-access/RopidGtfsRepository.js +33 -52
  44. package/dist/integration-engine/ropid-gtfs/data-access/RopidGtfsRepository.js.map +1 -1
  45. package/dist/integration-engine/ropid-gtfs/data-access/RouteSubAgencyRepository.js +12 -23
  46. package/dist/integration-engine/ropid-gtfs/data-access/RouteSubAgencyRepository.js.map +1 -1
  47. package/dist/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.js +12 -23
  48. package/dist/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.js.map +1 -1
  49. package/dist/integration-engine/ropid-gtfs/data-access/cache/PublicGtfsDepartureRepository.js +33 -44
  50. package/dist/integration-engine/ropid-gtfs/data-access/cache/PublicGtfsDepartureRepository.js.map +1 -1
  51. package/dist/integration-engine/ropid-gtfs/data-access/cache/StaticFileRedisRepository.js +10 -21
  52. package/dist/integration-engine/ropid-gtfs/data-access/cache/StaticFileRedisRepository.js.map +1 -1
  53. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.js +15 -24
  54. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.js.map +1 -1
  55. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/MinMaxStopSequencesRepository.js +3 -12
  56. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/MinMaxStopSequencesRepository.js.map +1 -1
  57. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/ServicesCalendarRepository.js +3 -12
  58. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/ServicesCalendarRepository.js.map +1 -1
  59. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripScheduleRepository.js +4 -13
  60. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripScheduleRepository.js.map +1 -1
  61. package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.js +30 -41
  62. package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.js.map +1 -1
  63. package/dist/integration-engine/ropid-gtfs/helpers/DataCacheManager.js +11 -22
  64. package/dist/integration-engine/ropid-gtfs/helpers/DataCacheManager.js.map +1 -1
  65. package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js +1 -2
  66. package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js.map +1 -1
  67. package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.js +7 -16
  68. package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.js.map +1 -1
  69. package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.js +3 -12
  70. package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.js.map +1 -1
  71. package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.js +13 -17
  72. package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.js.map +1 -1
  73. package/dist/integration-engine/ropid-gtfs/workers/presets/data-access/PresetLogRepository.js +13 -22
  74. package/dist/integration-engine/ropid-gtfs/workers/presets/data-access/PresetLogRepository.js.map +1 -1
  75. package/dist/integration-engine/ropid-gtfs/workers/presets/datasources/grafana-loki/GrafanaLokiDataSourceProvider.js +1 -2
  76. package/dist/integration-engine/ropid-gtfs/workers/presets/datasources/grafana-loki/GrafanaLokiDataSourceProvider.js.map +1 -1
  77. package/dist/integration-engine/ropid-gtfs/workers/presets/helpers/RopidMonitoringService.js +12 -23
  78. package/dist/integration-engine/ropid-gtfs/workers/presets/helpers/RopidMonitoringService.js.map +1 -1
  79. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CheckForNewDeparturesPresetsTask.js +14 -25
  80. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CheckForNewDeparturesPresetsTask.js.map +1 -1
  81. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CollectAndSaveLogsTask.js +26 -37
  82. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CollectAndSaveLogsTask.js.map +1 -1
  83. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/DownloadDeparturesPresetsTask.js +12 -23
  84. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/DownloadDeparturesPresetsTask.js.map +1 -1
  85. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/ProcessAndSendLogsTask.js +36 -49
  86. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/ProcessAndSendLogsTask.js.map +1 -1
  87. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/SavePresetsDataTask.js +3 -14
  88. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/SavePresetsDataTask.js.map +1 -1
  89. package/dist/integration-engine/ropid-gtfs/workers/presets/transformations/PresetLogTransformation.js +1 -2
  90. package/dist/integration-engine/ropid-gtfs/workers/presets/transformations/PresetLogTransformation.js.map +1 -1
  91. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckForNewDataTask.js +29 -40
  92. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckForNewDataTask.js.map +1 -1
  93. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js +64 -81
  94. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js.map +1 -1
  95. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/DownloadDatasetsTask.js +60 -79
  96. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/DownloadDatasetsTask.js.map +1 -1
  97. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPrecomputedTablesTask.js +23 -34
  98. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPrecomputedTablesTask.js.map +1 -1
  99. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask.js +26 -38
  100. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask.js.map +1 -1
  101. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/SaveStaticDataTask.js +21 -32
  102. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/SaveStaticDataTask.js.map +1 -1
  103. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/TransformAndSaveDataTask.js +43 -55
  104. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/TransformAndSaveDataTask.js.map +1 -1
  105. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/DeparturesDirectionRepository.js +8 -18
  106. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/DeparturesDirectionRepository.js.map +1 -1
  107. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/MetroRailtrackGPSRepository.js +11 -21
  108. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/MetroRailtrackGPSRepository.js.map +1 -1
  109. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js +8 -17
  110. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js.map +1 -1
  111. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js +19 -30
  112. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js.map +1 -1
  113. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/transformations/DeparturesDirectionTransformation.js +8 -1
  114. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/transformations/DeparturesDirectionTransformation.js.map +1 -1
  115. package/dist/integration-engine/ropid-vymi/RopidVYMIEventsTransformation.js +31 -47
  116. package/dist/integration-engine/ropid-vymi/RopidVYMIEventsTransformation.js.map +1 -1
  117. package/dist/integration-engine/ropid-vymi/models/RopidVYMIEventsRoutesModel.js +6 -17
  118. package/dist/integration-engine/ropid-vymi/models/RopidVYMIEventsRoutesModel.js.map +1 -1
  119. package/dist/integration-engine/ropid-vymi/models/RopidVYMIMetadataModel.js +4 -14
  120. package/dist/integration-engine/ropid-vymi/models/RopidVYMIMetadataModel.js.map +1 -1
  121. package/dist/integration-engine/ropid-vymi/workers/tasks/CheckForNewEventsTask.js +6 -17
  122. package/dist/integration-engine/ropid-vymi/workers/tasks/CheckForNewEventsTask.js.map +1 -1
  123. package/dist/integration-engine/ropid-vymi/workers/tasks/FetchAndProcessEventsTask.js +34 -31
  124. package/dist/integration-engine/ropid-vymi/workers/tasks/FetchAndProcessEventsTask.js.map +1 -1
  125. package/dist/integration-engine/ropid-vymi/workers/tasks/helpers/RopidVYMIApiHelper.js +3 -12
  126. package/dist/integration-engine/ropid-vymi/workers/tasks/helpers/RopidVYMIApiHelper.js.map +1 -1
  127. package/dist/integration-engine/shared/RopidMetadataModel.js +35 -45
  128. package/dist/integration-engine/shared/RopidMetadataModel.js.map +1 -1
  129. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/AlertsGenerator.js +13 -24
  130. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/AlertsGenerator.js.map +1 -1
  131. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/VehicleDescriptor.js +9 -6
  132. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/VehicleDescriptor.js.map +1 -1
  133. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.js +113 -128
  134. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.js.map +1 -1
  135. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/transformations/AlertsTransformation.js +20 -34
  136. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/transformations/AlertsTransformation.js.map +1 -1
  137. package/dist/integration-engine/vehicle-positions/workers/runs/data-access/AbstractRunRepository.js +3 -12
  138. package/dist/integration-engine/vehicle-positions/workers/runs/data-access/AbstractRunRepository.js.map +1 -1
  139. package/dist/integration-engine/vehicle-positions/workers/runs/data-access/CommonRunsMessagesRepository.js +3 -12
  140. package/dist/integration-engine/vehicle-positions/workers/runs/data-access/CommonRunsMessagesRepository.js.map +1 -1
  141. package/dist/integration-engine/vehicle-positions/workers/runs/data-access/CommonRunsRepository.js +12 -21
  142. package/dist/integration-engine/vehicle-positions/workers/runs/data-access/CommonRunsRepository.js.map +1 -1
  143. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/CommonMessageProcessor.js +7 -16
  144. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/CommonMessageProcessor.js.map +1 -1
  145. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/CisLookupManager.js +22 -33
  146. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/CisLookupManager.js.map +1 -1
  147. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/GtfsLookupManager.js +31 -44
  148. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/GtfsLookupManager.js.map +1 -1
  149. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusRunsFacade.js +14 -25
  150. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusRunsFacade.js.map +1 -1
  151. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/TripScheduleManager.js +25 -37
  152. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/TripScheduleManager.js.map +1 -1
  153. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/ProcessMetroRunMessagesTask.js +53 -63
  154. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/ProcessMetroRunMessagesTask.js.map +1 -1
  155. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/ProcessRegionalBusRunMessagesTask.js +57 -72
  156. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/ProcessRegionalBusRunMessagesTask.js.map +1 -1
  157. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveArrivaCityRunsToDBTask.js +15 -26
  158. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveArrivaCityRunsToDBTask.js.map +1 -1
  159. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveBusRunsToDBTask.js +10 -21
  160. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveBusRunsToDBTask.js.map +1 -1
  161. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveMetroRunsToDBTask.js +19 -30
  162. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveMetroRunsToDBTask.js.map +1 -1
  163. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveTramRunsToDBTask.js +10 -21
  164. package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveTramRunsToDBTask.js.map +1 -1
  165. package/dist/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.js +5 -14
  166. package/dist/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.js.map +1 -1
  167. package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessageProcessingTransformation.js +4 -14
  168. package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessageProcessingTransformation.js.map +1 -1
  169. package/dist/integration-engine/vehicle-positions/workers/runs/transformations/RegionalBusRunsMessagesTransformation.js +1 -2
  170. package/dist/integration-engine/vehicle-positions/workers/runs/transformations/RegionalBusRunsMessagesTransformation.js.map +1 -1
  171. package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/data-access/DescriptorRepository.js +35 -49
  172. package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/data-access/DescriptorRepository.js.map +1 -1
  173. package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/tasks/RefreshDescriptorsTask.js +11 -22
  174. package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/tasks/RefreshDescriptorsTask.js.map +1 -1
  175. package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/transformations/DescriptorTransformation.js +2 -3
  176. package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/transformations/DescriptorTransformation.js.map +1 -1
  177. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/CisStopRepository.js +3 -12
  178. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/CisStopRepository.js.map +1 -1
  179. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsHistoryRepository.js +3 -12
  180. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsHistoryRepository.js.map +1 -1
  181. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsRepository.js +19 -29
  182. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsRepository.js.map +1 -1
  183. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/StopTimesHistoryRepository.js +3 -12
  184. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/StopTimesHistoryRepository.js.map +1 -1
  185. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsHistoryRepository.js +3 -12
  186. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsHistoryRepository.js.map +1 -1
  187. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js +58 -55
  188. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js.map +1 -1
  189. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicApiCacheRepository.js +64 -79
  190. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicApiCacheRepository.js.map +1 -1
  191. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicStopTimeCacheRepository.js +46 -59
  192. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicStopTimeCacheRepository.js.map +1 -1
  193. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/TripsMapper.js +39 -6
  194. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/TripsMapper.js.map +1 -1
  195. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/metro/CachedMetroRailtrackLookup.js +8 -19
  196. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/metro/CachedMetroRailtrackLookup.js.map +1 -1
  197. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/PublicStopTimeRepository.js +2 -13
  198. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/PublicStopTimeRepository.js.map +1 -1
  199. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DPPUtils.js +1 -2
  200. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DPPUtils.js.map +1 -1
  201. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DelayComputationManager.js +10 -16
  202. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DelayComputationManager.js.map +1 -1
  203. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.js +68 -40
  204. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.js.map +1 -1
  205. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/TripStopsManager.js +5 -14
  206. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/TripStopsManager.js.map +1 -1
  207. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/VPUtils.js +1 -2
  208. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/VPUtils.js.map +1 -1
  209. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/anchor-points/AnchorPointSegmenter.js +1 -2
  210. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/anchor-points/AnchorPointSegmenter.js.map +1 -1
  211. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/ComputeDelayHelper.js +4 -4
  212. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/ComputeDelayHelper.js.map +1 -1
  213. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/AbstractDelayAtStop.js +1 -2
  214. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/AbstractDelayAtStop.js.map +1 -1
  215. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/CommonDelayAtStop.js +4 -5
  216. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/CommonDelayAtStop.js.map +1 -1
  217. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/MetroDelayAtStop.js +3 -4
  218. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/compute-positions/strategy/MetroDelayAtStop.js.map +1 -1
  219. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-data/strategy/HttpGtfsTripDataFixer.js +7 -18
  220. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-data/strategy/HttpGtfsTripDataFixer.js.map +1 -1
  221. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/AbstractGTFSTripRunManager.js +7 -16
  222. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/AbstractGTFSTripRunManager.js.map +1 -1
  223. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripCommonRunManager.js +40 -57
  224. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripCommonRunManager.js.map +1 -1
  225. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripMetroRunManager.js +36 -53
  226. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripMetroRunManager.js.map +1 -1
  227. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/metro/MetroShapePointsFixer.js +32 -41
  228. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/metro/MetroShapePointsFixer.js.map +1 -1
  229. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.js +61 -33
  230. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.js.map +1 -1
  231. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/compute-positions/RegionalBusComputeDelayHelper.js +4 -4
  232. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/compute-positions/RegionalBusComputeDelayHelper.js.map +1 -1
  233. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/compute-positions/strategy/BusDelayAtStop.js +4 -6
  234. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/compute-positions/strategy/BusDelayAtStop.js.map +1 -1
  235. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/gtfs-trip-run/GtfsTripRegionalBusRunManager.js +38 -55
  236. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/gtfs-trip-run/GtfsTripRegionalBusRunManager.js.map +1 -1
  237. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/DataRetentionTask.js +32 -45
  238. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/DataRetentionTask.js.map +1 -1
  239. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/ProcessRegionalBusPositionsTask.js +81 -91
  240. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/ProcessRegionalBusPositionsTask.js.map +1 -1
  241. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateDelayTask.js +43 -55
  242. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateDelayTask.js.map +1 -1
  243. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateTrainDelayTask.js +37 -49
  244. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateTrainDelayTask.js.map +1 -1
  245. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshGtfsTripDataTask.js +7 -18
  246. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshGtfsTripDataTask.js.map +1 -1
  247. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicStopTimeCacheTask.js +41 -52
  248. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicStopTimeCacheTask.js.map +1 -1
  249. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicTripCacheTask.js +32 -43
  250. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicTripCacheTask.js.map +1 -1
  251. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.js +95 -115
  252. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.js.map +1 -1
  253. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateDelayTask.js +150 -162
  254. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateDelayTask.js.map +1 -1
  255. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateGtfsTripIdTask.js +82 -94
  256. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateGtfsTripIdTask.js.map +1 -1
  257. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateRunsGtfsTripIdTask.js +24 -35
  258. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/UpdateRunsGtfsTripIdTask.js.map +1 -1
  259. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/abstract/AbstractPropagateDelayTask.js +15 -18
  260. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/abstract/AbstractPropagateDelayTask.js.map +1 -1
  261. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/helpers/UpdateDelayLimiter.js +1 -1
  262. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/helpers/UpdateDelayLimiter.js.map +1 -1
  263. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js +11 -21
  264. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js.map +1 -1
  265. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/PublicApiTripTransformation.js +2 -3
  266. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/PublicApiTripTransformation.js.map +1 -1
  267. package/dist/output-gateway/pid/controllers/v2/V2DepartureBoardsController.js +5 -15
  268. package/dist/output-gateway/pid/controllers/v2/V2DepartureBoardsController.js.map +1 -1
  269. package/dist/output-gateway/pid/controllers/v2/V2InfotextsController.js +4 -13
  270. package/dist/output-gateway/pid/controllers/v2/V2InfotextsController.js.map +1 -1
  271. package/dist/output-gateway/pid/controllers/v3/V3InfotextsController.js +4 -13
  272. package/dist/output-gateway/pid/controllers/v3/V3InfotextsController.js.map +1 -1
  273. package/dist/output-gateway/pid/controllers/v3/V3TransferBoardsController.js +8 -17
  274. package/dist/output-gateway/pid/controllers/v3/V3TransferBoardsController.js.map +1 -1
  275. package/dist/output-gateway/pid/data-access/DeparturesRepository.js +40 -53
  276. package/dist/output-gateway/pid/data-access/DeparturesRepository.js.map +1 -1
  277. package/dist/output-gateway/pid/data-access/JISInfotextRepository.js +62 -75
  278. package/dist/output-gateway/pid/data-access/JISInfotextRepository.js.map +1 -1
  279. package/dist/output-gateway/pid/helpers/DepartureBoardMapper.js +2 -3
  280. package/dist/output-gateway/pid/helpers/DepartureBoardMapper.js.map +1 -1
  281. package/dist/output-gateway/pid/helpers/ParamValidatorManager.js +6 -15
  282. package/dist/output-gateway/pid/helpers/ParamValidatorManager.js.map +1 -1
  283. package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js +11 -21
  284. package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js.map +1 -1
  285. package/dist/output-gateway/pid/models/RopidDeparturesDirectionsModel.js +20 -27
  286. package/dist/output-gateway/pid/models/RopidDeparturesDirectionsModel.js.map +1 -1
  287. package/dist/output-gateway/pid/models/RopidVYMIEventsStopsModel.js +16 -25
  288. package/dist/output-gateway/pid/models/RopidVYMIEventsStopsModel.js.map +1 -1
  289. package/dist/output-gateway/pid/models/helpers/PIDDepartureModel.js +2 -4
  290. package/dist/output-gateway/pid/models/helpers/PIDDepartureModel.js.map +1 -1
  291. package/dist/output-gateway/pid/service/facade/InfotextFacade.js +12 -23
  292. package/dist/output-gateway/pid/service/facade/InfotextFacade.js.map +1 -1
  293. package/dist/output-gateway/pid/service/facade/StopFacade.js +27 -38
  294. package/dist/output-gateway/pid/service/facade/StopFacade.js.map +1 -1
  295. package/dist/output-gateway/pid/service/facade/TransferFacade.js +32 -39
  296. package/dist/output-gateway/pid/service/facade/TransferFacade.js.map +1 -1
  297. package/dist/output-gateway/pid/service/transformations/JISInfotextDepartureTransformation.js +3 -4
  298. package/dist/output-gateway/pid/service/transformations/JISInfotextDepartureTransformation.js.map +1 -1
  299. package/dist/output-gateway/pid/service/transformations/JISInfotextOverviewTransformation.js +8 -12
  300. package/dist/output-gateway/pid/service/transformations/JISInfotextOverviewTransformation.js.map +1 -1
  301. package/dist/output-gateway/pid/service/transformations/JISInfotextTransferTransformation.js +1 -2
  302. package/dist/output-gateway/pid/service/transformations/JISInfotextTransferTransformation.js.map +1 -1
  303. package/dist/output-gateway/pid/service/transformations/TransferDepartureTransformation.js +1 -2
  304. package/dist/output-gateway/pid/service/transformations/TransferDepartureTransformation.js.map +1 -1
  305. package/dist/output-gateway/public/controllers/v2/V2PublicDepartureBoardsController.js +4 -13
  306. package/dist/output-gateway/public/controllers/v2/V2PublicDepartureBoardsController.js.map +1 -1
  307. package/dist/output-gateway/public/controllers/v2/V2PublicGtfsController.js +4 -13
  308. package/dist/output-gateway/public/controllers/v2/V2PublicGtfsController.js.map +1 -1
  309. package/dist/output-gateway/public/controllers/v2/V2PublicVehiclePositionsController.js +9 -18
  310. package/dist/output-gateway/public/controllers/v2/V2PublicVehiclePositionsController.js.map +1 -1
  311. package/dist/output-gateway/public/data-access/VehicleDescriptorCachedRepository.js +13 -26
  312. package/dist/output-gateway/public/data-access/VehicleDescriptorCachedRepository.js.map +1 -1
  313. package/dist/output-gateway/public/data-access/redis/DelayComputationRepository.js +22 -33
  314. package/dist/output-gateway/public/data-access/redis/DelayComputationRepository.js.map +1 -1
  315. package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js +9 -20
  316. package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js.map +1 -1
  317. package/dist/output-gateway/public/data-access/redis/PublicStopTimeRepository.js +23 -34
  318. package/dist/output-gateway/public/data-access/redis/PublicStopTimeRepository.js.map +1 -1
  319. package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.js +153 -172
  320. package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.js.map +1 -1
  321. package/dist/output-gateway/public/routers/v2/helpers/CustomStopIdGroupValidator.js +2 -2
  322. package/dist/output-gateway/public/routers/v2/helpers/CustomStopIdGroupValidator.js.map +1 -1
  323. package/dist/output-gateway/public/service/VPSubscriber.js +8 -19
  324. package/dist/output-gateway/public/service/VPSubscriber.js.map +1 -1
  325. package/dist/output-gateway/public/service/facade/DepartureBoardFacade.js +100 -117
  326. package/dist/output-gateway/public/service/facade/DepartureBoardFacade.js.map +1 -1
  327. package/dist/output-gateway/public/service/facade/DetailedTripFacade.js +18 -29
  328. package/dist/output-gateway/public/service/facade/DetailedTripFacade.js.map +1 -1
  329. package/dist/output-gateway/public/service/facade/GtfsTripLookupFacade.js +20 -31
  330. package/dist/output-gateway/public/service/facade/GtfsTripLookupFacade.js.map +1 -1
  331. package/dist/output-gateway/public/service/facade/VehiclePositionsFacade.js +15 -26
  332. package/dist/output-gateway/public/service/facade/VehiclePositionsFacade.js.map +1 -1
  333. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/StopTimesTripScopeHandler.js +1 -2
  334. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/StopTimesTripScopeHandler.js.map +1 -1
  335. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/InfoTripScopeHandler.js +3 -14
  336. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/InfoTripScopeHandler.js.map +1 -1
  337. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.js +7 -18
  338. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.js.map +1 -1
  339. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js +35 -46
  340. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js.map +1 -1
  341. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler.js +16 -22
  342. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler.js.map +1 -1
  343. package/dist/output-gateway/public/service/transformations/PublicDepartureTransformation.js +9 -10
  344. package/dist/output-gateway/public/service/transformations/PublicDepartureTransformation.js.map +1 -1
  345. package/dist/output-gateway/public/service/transformations/PublicVehiclePositionsTransformation.js +5 -15
  346. package/dist/output-gateway/public/service/transformations/PublicVehiclePositionsTransformation.js.map +1 -1
  347. package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripInfoTransformation.js +2 -3
  348. package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripInfoTransformation.js.map +1 -1
  349. package/dist/output-gateway/public/service/transformations/scopes/PublicVPTripInfoTransformation.js +2 -15
  350. package/dist/output-gateway/public/service/transformations/scopes/PublicVPTripInfoTransformation.js.map +1 -1
  351. package/dist/output-gateway/public/service/transformations/scopes/PublicVPTripStopTimesTransformation.js +1 -13
  352. package/dist/output-gateway/public/service/transformations/scopes/PublicVPTripStopTimesTransformation.js.map +1 -1
  353. package/dist/output-gateway/ropid-gtfs/data-access/CisStopGroupRepository.js +14 -25
  354. package/dist/output-gateway/ropid-gtfs/data-access/CisStopGroupRepository.js.map +1 -1
  355. package/dist/output-gateway/ropid-gtfs/models/GTFSCalendarModel.js +3 -12
  356. package/dist/output-gateway/ropid-gtfs/models/GTFSCalendarModel.js.map +1 -1
  357. package/dist/output-gateway/ropid-gtfs/models/GTFSRoutesModel.js +4 -13
  358. package/dist/output-gateway/ropid-gtfs/models/GTFSRoutesModel.js.map +1 -1
  359. package/dist/output-gateway/ropid-gtfs/models/GTFSShapesModel.js +5 -14
  360. package/dist/output-gateway/ropid-gtfs/models/GTFSShapesModel.js.map +1 -1
  361. package/dist/output-gateway/ropid-gtfs/models/GTFSStopModel.js +90 -102
  362. package/dist/output-gateway/ropid-gtfs/models/GTFSStopModel.js.map +1 -1
  363. package/dist/output-gateway/ropid-gtfs/models/GTFSStopTimesModel.js +3 -12
  364. package/dist/output-gateway/ropid-gtfs/models/GTFSStopTimesModel.js.map +1 -1
  365. package/dist/output-gateway/ropid-gtfs/models/GTFSTripsModel.js +43 -51
  366. package/dist/output-gateway/ropid-gtfs/models/GTFSTripsModel.js.map +1 -1
  367. package/dist/output-gateway/ropid-gtfs/routers/v2/V2GTFSRouter.js +28 -37
  368. package/dist/output-gateway/ropid-gtfs/routers/v2/V2GTFSRouter.js.map +1 -1
  369. package/dist/output-gateway/shared/DepartureCalculator.js +1 -1
  370. package/dist/output-gateway/shared/DepartureCalculator.js.map +1 -1
  371. package/dist/output-gateway/vehicle-positions/data-access/helpers/PositionOutputMapper.js +40 -48
  372. package/dist/output-gateway/vehicle-positions/data-access/helpers/PositionOutputMapper.js.map +1 -1
  373. package/dist/output-gateway/vehicle-positions/data-access/views/TripWithLastPositionRepository.js +7 -16
  374. package/dist/output-gateway/vehicle-positions/data-access/views/TripWithLastPositionRepository.js.map +1 -1
  375. package/dist/output-gateway/vehicle-positions/routers/v2/V2VehiclePositionsRouter.js +10 -19
  376. package/dist/output-gateway/vehicle-positions/routers/v2/V2VehiclePositionsRouter.js.map +1 -1
  377. package/dist/schema-definitions/ropid-gtfs/RopidGTFSRunNumbers.js +5 -2
  378. package/dist/schema-definitions/ropid-gtfs/RopidGTFSRunNumbers.js.map +1 -1
  379. package/dist/schema-definitions/ropid-gtfs/index.js +16 -4
  380. package/dist/schema-definitions/ropid-gtfs/index.js.map +1 -1
  381. package/package.json +3 -3
@@ -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
  var __importDefault = (this && this.__importDefault) || function (mod) {
21
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
22
13
  };
@@ -34,7 +25,7 @@ let CommonRunsMessagesTransformation = exports.CommonRunsMessagesTransformation
34
25
  /**
35
26
  * Overrides BaseTransformation::transform
36
27
  */
37
- this.transform = ({ data, timestamp }, isTram = false) => __awaiter(this, void 0, void 0, function* () {
28
+ this.transform = async ({ data, timestamp }, isTram = false) => {
38
29
  const now = (0, moment_timezone_1.default)(timestamp).tz("Europe/Prague").format();
39
30
  const res = [];
40
31
  if (!Array.isArray(data)) {
@@ -42,7 +33,7 @@ let CommonRunsMessagesTransformation = exports.CommonRunsMessagesTransformation
42
33
  }
43
34
  for (const element of data) {
44
35
  try {
45
- const elementTransformed = yield this.transformElement({ data: element, timestamp: now }, isTram);
36
+ const elementTransformed = await this.transformElement({ data: element, timestamp: now }, isTram);
46
37
  res.push(elementTransformed);
47
38
  }
48
39
  catch (err) {
@@ -50,8 +41,8 @@ let CommonRunsMessagesTransformation = exports.CommonRunsMessagesTransformation
50
41
  }
51
42
  }
52
43
  return res;
53
- });
54
- this.transformElement = (element, isTram = false) => __awaiter(this, void 0, void 0, function* () {
44
+ };
45
+ this.transformElement = async (element, isTram = false) => {
55
46
  const attributes = element.data.$;
56
47
  if (!isTram && !attributes.tjr) {
57
48
  return Promise.reject();
@@ -89,7 +80,7 @@ let CommonRunsMessagesTransformation = exports.CommonRunsMessagesTransformation
89
80
  },
90
81
  };
91
82
  return t;
92
- });
83
+ };
93
84
  this.commonRunHelper = new CommonRunHelper_1.CommonRunHelper();
94
85
  }
95
86
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CommonRunsMessagesTransformation.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,2EAAoE;AACpE,2FAA4G;AAC5G,gEAA6D;AAG7D,gGAA+D;AAC/D,iEAAgE;AAGzD,IAAM,gCAAgC,8CAAtC,MAAM,gCAAiC,SAAQ,oCAAkB;IAIpE;QACI,KAAK,EAAE,CAAC;QAJL,SAAI,GAAG,kCAAkC,CAAC;QAQjD;;WAEG;QACI,cAAS,GAAG,CACf,EAAE,IAAI,EAAE,SAAS,EAAwB,EACzC,SAAkB,KAAK,EACY,EAAE;YACrC,MAAM,GAAG,GAAG,IAAA,yBAAM,EAAC,SAAS,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC;YAC3D,MAAM,GAAG,GAA+B,EAAE,CAAC;YAE3C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBACtB,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;aACjB;YACD,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE;gBACxB,IAAI;oBACA,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,E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BACD,EAAE,EAAE,WAAW,CAAC,KAAK;oBACrB,QAAQ,EAAE,WAAW,CAAC,OAAO;oBAC7B,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC;oBAClD,eAAe,EAAE,UAAU,CAAC,IAAI;oBAChC,mBAAmB,EAAE,UAAU,CAAC,GAAG;oBACnC,mBAAmB,EAAE,OAAO,CAAC,SAAS;oBACtC,kBAAkB,EAAE,OAAO,CAAC,SAAS;oBACrC,qBAAqB,EAAE,UAAU,CAAC,EAAE,KAAK,KAAK;iBACjD;gBACD,WAAW,EAAE;oBACT,qBAAqB;oBACrB,0BAA0B;oBAC1B,GAAG,EAAE,CAAC,UAAU,CAAC,GAAG;oBACpB,GAAG,EAAE,CAAC,UAAU,CAAC,GAAG;oBACpB,kBAAkB,EAAE,UAAU,CAAC,GAAG;oBAClC,0BAA0B,EAAE,qBAAqB;oBACjD,+BAA+B,EAAE,0BAA0B;oBAC3D,gBAAgB,EAAE,UAAU,CAAC,IAAI;oBACjC,aAAa,EAAE,UAAU,CAAC,GAAG;oBAC7B,aAAa,EAAE,oBAAoB;oBACnC,MAAM,EAAE,UAAU,CAAC,MAAM;iBAC5B;aACJ,CAAC;YAEF,OAAO,CAAC,CAAC;QACb,CAAC,CAAA,CAAC;QAxEE,IAAI,CAAC,eAAe,GAAG,IAAI,iCAAe,EAAE,CAAC;IACjD,CAAC;CAwEJ,CAAA;2CA/EY,gCAAgC;IAD5C,IAAA,qBAAU,GAAE;;GACA,gCAAgC,CA+E5C"}
1
+ {"version":3,"file":"CommonRunsMessagesTransformation.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,2EAAoE;AACpE,2FAA4G;AAC5G,gEAA6D;AAG7D,gGAA+D;AAC/D,iEAAgE;AAGzD,IAAM,gCAAgC,8CAAtC,MAAM,gCAAiC,SAAQ,oCA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,EAAE,oBAAoB;oBACnC,MAAM,EAAE,UAAU,CAAC,MAAM;iBAC5B;aACJ,CAAC;YAEF,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAxEE,IAAI,CAAC,eAAe,GAAG,IAAI,iCAAe,EAAE,CAAC;IACjD,CAAC;CAwEJ,CAAA;2CA/EY,gCAAgC;IAD5C,IAAA,qBAAU,GAAE;;GACA,gCAAgC,CA+E5C"}
@@ -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.MetroRunsMessageProcessingTransformation = void 0;
13
4
  const helpers_1 = require("@golemio/core/dist/integration-engine/helpers");
@@ -17,7 +8,7 @@ class MetroRunsMessageProcessingTransformation extends transformations_1.BaseTra
17
8
  constructor() {
18
9
  super(...arguments);
19
10
  this.name = "MetroRunMessageProcessing";
20
- this.transform = ({ message, gpsData }) => __awaiter(this, void 0, void 0, function* () {
11
+ this.transform = async ({ message, gpsData }) => {
21
12
  const runSchedule = this.parseRunScheduleFromMessage(message);
22
13
  if (!runSchedule) {
23
14
  return;
@@ -29,8 +20,8 @@ class MetroRunsMessageProcessingTransformation extends transformations_1.BaseTra
29
20
  runInput,
30
21
  };
31
22
  }
32
- });
33
- this.transformElement = () => __awaiter(this, void 0, void 0, function* () { });
23
+ };
24
+ this.transformElement = async () => { };
34
25
  }
35
26
  parseRunScheduleFromMessage(message) {
36
27
  const routeId = MetroRouteHelper_1.MetroRouteHelper.getRouteId(message.route_name);
@@ -56,8 +47,7 @@ class MetroRunsMessageProcessingTransformation extends transformations_1.BaseTra
56
47
  };
57
48
  }
58
49
  parseRunInputFromMessage(message, runSchedule, gpsData) {
59
- var _a;
60
- const coordinates = (_a = gpsData === null || gpsData === void 0 ? void 0 : gpsData.coordinates) === null || _a === void 0 ? void 0 : _a[message.track_id];
50
+ const coordinates = gpsData?.coordinates?.[message.track_id];
61
51
  if (!coordinates) {
62
52
  helpers_1.log.verbose(`parseRunInputFromMessage: no GPS coordinates for the message: ${JSON.stringify(message)}`);
63
53
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"MetroRunsMessageProcessingTransformation.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessageProcessingTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,2EAAoE;AACpE,2FAA4G;AAC5G,kEAA+D;AAc/D,MAAa,wCAAyC,SAAQ,oCAAkB;IAAhF;;QACW,SAAI,GAAG,2BAA2B,CAAC;QAEnC,cAAS,GAAG,CAAO,EAAE,OAAO,EAAE,OAAO,EAAwB,EAA8C,EAAE;YAChH,MAAM,WAAW,GAAG,IAAI,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;YAC9D,IAAI,CAAC,WAAW,EAAE;gBACd,OAAO;aACV;YAED,MAAM,QAAQ,GAAG,IAAI,CAAC,wBAAwB,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;YAC9E,IAAI,QAAQ,EAAE;gBACV,OAAO;oBACH,WAAW;oBACX,QAAQ;iBACX,CAAC;aACL;QACL,CAAC,CAAA,CAAC;QAEQ,qBAAgB,GAAG,GAAuB,EAAE,gDAAE,CAAC,CAAA,CAAC;IAgD9D,CAAC;IA9CW,2BAA2B,CAAC,OAAiC;QACjE,MAAM,OAAO,GAAG,mCAAgB,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAChE,IAAI,CA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C,qBAAqB;YACjD,WAAW,EAAE,OAAO,CAAC,YAAY;YACjC,WAAW;SACd,CAAC;IACN,CAAC;CACJ;AAlED,4FAkEC"}
1
+ {"version":3,"file":"MetroRunsMessageProcessingTransformation.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessageProcessingTransformation.ts"],"names":[],"mappings":";;;AAEA,2EAAoE;AACpE,2FAA4G;AAC5G,kEAA+D;AAc/D,MAAa,wCAAyC,SAAQ,oCAAkB;IAAhF;;QACW,SAAI,GAAG,2BAA2B,CAAC;QAEnC,cAAS,GAAG,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAwB,EAA8C,EAAE;YAChH,MAAM,WAAW,GAAG,IAAI,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;YAC9D,IAAI,CAAC,WAAW,EAAE;gBACd,OAAO;aACV;YAED,MAAM,QAAQ,GAAG,IAAI,CAAC,wBAAwB,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;YAC9E,IAAI,QAAQ,EAAE;gBACV,OAAO;oBACH,WAAW;oBACX,QAAQ;iBACX,CAAC;aACL;QACL,CAAC,CAAC;QAEQ,qBAAgB,GAAG,KAAK,IAAkB,EAAE,GAAE,CAAC,CAAC;IAgD9D,CAAC;IA9CW,2BAA2B,CAAC,OAAiC;QACjE,MAAM,OAAO,GAAG,mCAAgB,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAChE,IAAI,CAAC,OAAO,EAAE;YACV,aAAG,CAAC,IAAI,CAAC,mEAAmE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACvG,OAAO;SACV;QAED,IAAI,SAAiB,CAAC;QACtB,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE;YACpD,SAAS,GAAG,OAAO,CAAC,qBAAqB,CAAC;SAC7C;aAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,0BAA0B,CAAC,GAAG,CAAC,EAAE;YAChE,SAAS,GAAG,OAAO,CAAC,0BAA0B,CAAC;SAClD;aAAM;YACH,aAAG,CAAC,IAAI,CAAC,kFAAkF,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACtH,OAAO;SACV;QAED,OAAO;YACH,QAAQ,EAAE,OAAO;YACjB,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;YACtC,kBAAkB,EAAE,OAAO,CAAC,iBAAiB;SAChD,CAAC;IACN,CAAC;IAEO,wBAAwB,CAC5B,OAAiC,EACjC,WAAsC,EACtC,OAA2C;QAE3C,MAAM,WAAW,GAAG,OAAO,EAAE,WAAW,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC7D,IAAI,CAAC,WAAW,EAAE;YACd,aAAG,CAAC,OAAO,CAAC,iEAAiE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACxG,OAAO;SACV;QAED,OAAO;YACH,gBAAgB,EAAE,OAAO,CAAC,iBAAiB;YAC3C,kBAAkB,EAAE,OAAO,CAAC,mCAAmC;YAC/D,OAAO,EAAE,WAAW,CAAC,QAAQ;YAC7B,SAAS,EAAE,WAAW,CAAC,UAAU;YACjC,uBAAuB,EAAE,OAAO,CAAC,0BAA0B;YAC3D,kBAAkB,EAAE,OAAO,CAAC,qBAAqB;YACjD,WAAW,EAAE,OAAO,CAAC,YAAY;YACjC,WAAW;SACd,CAAC;IACN,CAAC;CACJ;AAlED,4FAkEC"}
@@ -14,13 +14,12 @@ let RegionalBusRunsMessagesTransformation = exports.RegionalBusRunsMessagesTrans
14
14
  super(...arguments);
15
15
  this.name = "RegionalBusRunsMessagesTransformation";
16
16
  this.transformInternal = (data) => {
17
- var _a;
18
17
  const messageData = data.$;
19
18
  return {
20
19
  external_trip_id: messageData.imei,
21
20
  cis_line_id: messageData.line && messageData.line !== "0" ? messageData.line : null,
22
21
  cis_trip_number: messageData.conn && messageData.conn !== "0" ? Number.parseInt(messageData.conn) : null,
23
- events: (_a = messageData.events) !== null && _a !== void 0 ? _a : "",
22
+ events: messageData.events ?? "",
24
23
  coordinates: {
25
24
  type: "Point",
26
25
  coordinates: [Number.parseFloat(messageData.lng), Number.parseFloat(messageData.lat)],
@@ -1 +1 @@
1
- {"version":3,"file":"RegionalBusRunsMessagesTransformation.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/transformations/RegionalBusRunsMessagesTransformation.ts"],"names":[],"mappings":";;;;;;;;;AACA,6GAA0G;AAC1G,iEAAwE;AASjE,IAAM,qCAAqC,mDAA3C,MAAM,qCAAsC,SAAQ,+CAAiD;IAArG;;QACI,SAAI,GAAG,uCAAuC,CAAC;QAE5C,sBAAiB,GAAG,CAAC,IAAiB,EAAgB,EAAE;;YAC9D,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC;YAE3B,OAAO;gBACH,gBAAgB,EAAE,WAAW,CAAC,IAAI;gBAClC,WAAW,EAAE,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;gBACnF,eAAe,EAAE,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;gBACxG,MAAM,EAAE,MAAA,WAAW,CAAC,MAAM,mCAAI,EAAE;gBAChC,WAAW,EAAE;oBACT,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;iBACxF;gBACD,iBAAiB,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC,EAAE,GAAG,GAAG,CAAC;gBACjD,mBAAmB,EAAE,WAAW,CAAC,GAAG,IAAI,WAAW,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI;gBACzG,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC;gBAC5C,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC;gBAC1C,aAAa,EAAE,WAAW,CAAC,IAAI,KAAK,GAAG,IAAI,WAAW,CAAC,IAAI,KAAK,GAAG;gBACnE,SAAS,EAAE,WAAW,CAAC,EAAE;aAC5B,CAAC;QACN,CAAC,CAAC;IACN,CAAC;CAAA,CAAA;gDAvBY,qCAAqC;IADjD,IAAA,qBAAU,GAAE;GACA,qCAAqC,CAuBjD"}
1
+ {"version":3,"file":"RegionalBusRunsMessagesTransformation.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/transformations/RegionalBusRunsMessagesTransformation.ts"],"names":[],"mappings":";;;;;;;;;AACA,6GAA0G;AAC1G,iEAAwE;AASjE,IAAM,qCAAqC,mDAA3C,MAAM,qCAAsC,SAAQ,+CAAiD;IAArG;;QACI,SAAI,GAAG,uCAAuC,CAAC;QAE5C,sBAAiB,GAAG,CAAC,IAAiB,EAAgB,EAAE;YAC9D,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC;YAE3B,OAAO;gBACH,gBAAgB,EAAE,WAAW,CAAC,IAAI;gBAClC,WAAW,EAAE,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;gBACnF,eAAe,EAAE,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;gBACxG,MAAM,EAAE,WAAW,CAAC,MAAM,IAAI,EAAE;gBAChC,WAAW,EAAE;oBACT,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;iBACxF;gBACD,iBAAiB,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC,EAAE,GAAG,GAAG,CAAC;gBACjD,mBAAmB,EAAE,WAAW,CAAC,GAAG,IAAI,WAAW,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI;gBACzG,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC;gBAC5C,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC;gBAC1C,aAAa,EAAE,WAAW,CAAC,IAAI,KAAK,GAAG,IAAI,WAAW,CAAC,IAAI,KAAK,GAAG;gBACnE,SAAS,EAAE,WAAW,CAAC,EAAE;aAC5B,CAAC;QACN,CAAC,CAAC;IACN,CAAC;CAAA,CAAA;gDAvBY,qCAAqC;IADjD,IAAA,qBAAU,GAAE;GACA,qCAAqC,CAuBjD"}
@@ -34,15 +34,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
34
34
  var __param = (this && this.__param) || function (paramIndex, decorator) {
35
35
  return function (target, key) { decorator(target, key, paramIndex); }
36
36
  };
37
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
38
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
39
- return new (P || (P = Promise))(function (resolve, reject) {
40
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
41
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
42
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
43
- step((generator = generator.apply(thisArg, _arguments || [])).next());
44
- });
45
- };
46
37
  var DescriptorRepository_1;
47
38
  Object.defineProperty(exports, "__esModule", { value: true });
48
39
  exports.DescriptorRepository = void 0;
@@ -63,9 +54,9 @@ let DescriptorRepository = exports.DescriptorRepository = DescriptorRepository_1
63
54
  savingType: "insertOrUpdate",
64
55
  }, new golemio_validator_1.JSONSchemaValidator(DescriptorRepository_1.REPOSITORY_NAME + "Validator", models_1.DescriptorModel.arrayJsonSchema));
65
56
  this.logger = logger;
66
- this.deleteNHoursOldData = (hours) => __awaiter(this, void 0, void 0, function* () {
57
+ this.deleteNHoursOldData = async (hours) => {
67
58
  try {
68
- return yield this.sequelizeModel.destroy({
59
+ return await this.sequelizeModel.destroy({
69
60
  where: {
70
61
  updated_at: {
71
62
  [sequelize_1.Op.lt]: sequelize_1.default.literal(`NOW() - INTERVAL '${hours} HOURS'`),
@@ -76,46 +67,41 @@ let DescriptorRepository = exports.DescriptorRepository = DescriptorRepository_1
76
67
  catch (err) {
77
68
  throw new golemio_errors_1.GeneralError("Error while purging old data", this.constructor.name, err);
78
69
  }
79
- });
70
+ };
80
71
  }
81
- findAccessDescByRegistrationNumbers(registrationNumbers, gtfsRouteType) {
82
- return __awaiter(this, void 0, void 0, function* () {
83
- try {
84
- return yield this.sequelizeModel.findAll({
85
- attributes: ["is_wheelchair_accessible", "registration_number"],
86
- where: {
87
- registration_number: registrationNumbers,
88
- gtfs_route_type: gtfsRouteType,
89
- },
90
- });
91
- }
92
- catch (err) {
93
- throw new golemio_errors_1.GeneralError("findAccessDescByRegistrationNumbers: failed to get descriptors", this.name, err);
94
- }
95
- });
72
+ async findAccessDescByRegistrationNumbers(registrationNumbers, gtfsRouteType) {
73
+ try {
74
+ return await this.sequelizeModel.findAll({
75
+ attributes: ["is_wheelchair_accessible", "registration_number"],
76
+ where: {
77
+ registration_number: registrationNumbers,
78
+ gtfs_route_type: gtfsRouteType,
79
+ },
80
+ });
81
+ }
82
+ catch (err) {
83
+ throw new golemio_errors_1.GeneralError("findAccessDescByRegistrationNumbers: failed to get descriptors", this.name, err);
84
+ }
96
85
  }
97
- saveData(descriptors) {
98
- var _a;
99
- return __awaiter(this, void 0, void 0, function* () {
100
- let transaction;
101
- try {
102
- yield this.validate(descriptors);
103
- transaction = yield ((_a = this.sequelizeModel.sequelize) === null || _a === void 0 ? void 0 : _a.transaction());
104
- yield this.sequelizeModel.destroy({ where: {}, transaction });
105
- yield this.sequelizeModel.bulkCreate(descriptors, {
106
- ignoreDuplicates: true,
107
- returning: false,
108
- transaction,
109
- });
110
- yield (transaction === null || transaction === void 0 ? void 0 : transaction.commit());
111
- }
112
- catch (err) {
113
- const exception = new golemio_errors_1.GeneralError(`[${this.constructor.name}] Could not save data: ${err.message}`, this.constructor.name, err);
114
- this.logger.error(exception);
115
- yield (transaction === null || transaction === void 0 ? void 0 : transaction.rollback());
116
- throw exception;
117
- }
118
- });
86
+ async saveData(descriptors) {
87
+ let transaction;
88
+ try {
89
+ await this.validate(descriptors);
90
+ transaction = await this.sequelizeModel.sequelize?.transaction();
91
+ await this.sequelizeModel.destroy({ where: {}, transaction });
92
+ await this.sequelizeModel.bulkCreate(descriptors, {
93
+ ignoreDuplicates: true,
94
+ returning: false,
95
+ transaction,
96
+ });
97
+ await transaction?.commit();
98
+ }
99
+ catch (err) {
100
+ const exception = new golemio_errors_1.GeneralError(`[${this.constructor.name}] Could not save data: ${err.message}`, this.constructor.name, err);
101
+ this.logger.error(exception);
102
+ await transaction?.rollback();
103
+ throw exception;
104
+ }
119
105
  }
120
106
  };
121
107
  DescriptorRepository.REPOSITORY_NAME = "VPDescriptorRepository";
@@ -1 +1 @@
1
- {"version":3,"file":"DescriptorRepository.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-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+BADjD,oBAAoB;IADhC,IAAA,qBAAU,GAAE;IAII,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;;GAH5B,oBAAoB,CAyEhC"}
1
+ {"version":3,"file":"DescriptorRepository.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-descriptors/data-access/DescriptorRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,mEAAuC;AACvC,yFAAkE;AAClE,yEAAqF;AACrF,6EAAwE;AACxE,mFAAkF;AAClF,iFAAiF;AACjF,iEAAwE;AAExE,wEAAqE;AAI9D,IAAM,oBAAoB,2DAA1B,MAAM,oBAAqB,SAAQ,sBAAa;IAGnD,YAAsC,MAAuB;QACzD,KAAK,CACD,sBAAoB,CAAC,eAAe,EACpC;YACI,WAAW,EAAE,wBAAe,CAAC,SAAS;YACtC,QAAQ,EAAE,iBAAS;YACnB,yBAAyB,EAAE,wBAAe,CAAC,cAAc;YACzD,UAAU,EAAE,gBAAgB;SAC/B,EACD,IAAI,uCAAmB,CAAC,sBAAoB,CAAC,eAAe,GAAG,WAAW,EAAE,wBAAe,CAAC,eAAe,CAAC,CAC/G,CAAC;QAVwC,WAAM,GAAN,MAAM,CAAS;QAyDtD,wBAAmB,GAAG,KAAK,EAAE,KAAa,EAAmB,EAAE;YAClE,IAAI;gBACA,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;oBACrC,KAAK,EAAE;wBACH,UAAU,EAAE;4BACR,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,mBAAS,CAAC,OAAO,CAAC,qBAAqB,KAAK,SAAS,CAAC;yBAClE;qBACJ;iBACJ,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,6BAAY,CAAC,8BAA8B,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;aACtF;QACL,CA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AE,CAAC;YAC9B,MAAM,SAAS,CAAC;SACnB;IACL,CAAC;;AAzDc,oCAAe,GAAG,wBAAwB,AAA3B,CAA4B;+BADjD,oBAAoB;IADhC,IAAA,qBAAU,GAAE;IAII,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;;GAH5B,oBAAoB,CAyEhC"}
@@ -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.RefreshDescriptorsTask = void 0;
25
16
  const VPContainerToken_1 = require("../../../ioc/VPContainerToken");
@@ -41,19 +32,17 @@ let RefreshDescriptorsTask = exports.RefreshDescriptorsTask = class RefreshDescr
41
32
  this.queueName = "refreshDescriptors";
42
33
  this.queueTtl = 10 * 60 * 1000; // 10 minutes
43
34
  }
44
- execute() {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- const dataSource = this.dataSourceFactory.getDataSource(DescriptorDataSourceFactory_1.DescriptorProvider.SeznamAutobusu);
47
- const descriptorsResult = yield dataSource.getAll();
48
- const descriptorsTransformed = yield this.descriptorTransformation.transform(descriptorsResult);
49
- const descriptorsFiltered = [...this.descriptorFilter.yieldFilteredDescriptors(descriptorsTransformed)];
50
- if (descriptorsFiltered.length === 0) {
51
- this.logger.warn(`${this.queueName}: no descriptors out of ${descriptorsResult.length} were transformed or were filtered out`);
52
- return;
53
- }
54
- yield this.descriptorRepository.saveData(descriptorsFiltered);
55
- this.logger.info(`${this.queueName}: ${descriptorsFiltered.length}/${descriptorsResult.length} vehicle descriptors were saved`);
56
- });
35
+ async execute() {
36
+ const dataSource = this.dataSourceFactory.getDataSource(DescriptorDataSourceFactory_1.DescriptorProvider.SeznamAutobusu);
37
+ const descriptorsResult = await dataSource.getAll();
38
+ const descriptorsTransformed = await this.descriptorTransformation.transform(descriptorsResult);
39
+ const descriptorsFiltered = [...this.descriptorFilter.yieldFilteredDescriptors(descriptorsTransformed)];
40
+ if (descriptorsFiltered.length === 0) {
41
+ this.logger.warn(`${this.queueName}: no descriptors out of ${descriptorsResult.length} were transformed or were filtered out`);
42
+ return;
43
+ }
44
+ await this.descriptorRepository.saveData(descriptorsFiltered);
45
+ this.logger.info(`${this.queueName}: ${descriptorsFiltered.length}/${descriptorsResult.length} vehicle descriptors were saved`);
57
46
  }
58
47
  };
59
48
  exports.RefreshDescriptorsTask = RefreshDescriptorsTask = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshDescriptorsTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-descriptors/tasks/RefreshDescriptorsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAA8E;AAG9E,8EAA0E;AAC1E,6FAA0F;AAC1F,iEAAwE;AACxE,4CAA2C;AAC3C,8EAA2E;AAC3E,4FAA6G;AAE7G,0FAAuF;AAGhF,IAAM,sBAAsB,oCAA5B,MAAM,sBAAuB,SAAQ,sCAAiB;IAIzD,YAEI,iBAAsD,EAEtD,gBAA2C,EAE3C,oBAAkD,EAElD,wBAA0D,EAC3B,MAAuB;QAEtD,KAAK,CAAC,uBAAW,CAAC,CAAC;QATX,sBAAiB,GAAjB,iBAAiB,CAA6B;QAE9C,qBAAgB,GAAhB,gBAAgB,CAAmB;QAE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AC,oBAAoB,CAAC,CAAA;IAE7C,WAAA,IAAA,iBAAM,EAAC,mCAAgB,CAAC,wBAAwB,CAAC,CAAA;IAEjD,WAAA,IAAA,iBAAM,EAAC,+BAAc,CAAC,MAAM,CAAC,CAAA;qCAPH,yDAA2B,UAIxB,2CAAoB;QAEhB,mDAAwB;GAZrD,sBAAsB,CAoClC"}
1
+ {"version":3,"file":"RefreshDescriptorsTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-descriptors/tasks/RefreshDescriptorsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oEAA8E;AAG9E,8EAA0E;AAC1E,6FAA0F;AAC1F,iEAAwE;AACxE,4CAA2C;AAC3C,8EAA2E;AAC3E,4FAA6G;AAE7G,0FAAuF;AAGhF,IAAM,sBAAsB,oCAA5B,MAAM,sBAAuB,SAAQ,sCAAiB;IAIzD,YAEI,iBAAsD,EAEtD,gBAA2C,EAE3C,oBAAkD,EAElD,wBAA0D,EAC3B,MAAuB;QAEtD,KAAK,CAAC,uBAAW,CAAC,CAAC;QATX,sBAAiB,GAAjB,iBAAiB,CAA6B;QAE9C,qBAAgB,GAAhB,gBAAgB,CAAmB;QAEnC,yBAAoB,GAApB,oBAAoB,CAAsB;QAE1C,6BAAwB,GAAxB,wBAAwB,CAA0B;QACnB,WAAM,GAAN,MAAM,CAAS;QAZ1C,cAAS,GAAG,oBAAoB,CAAC;QACjC,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;IAcxD,CAAC;IAES,KAAK,CAAC,OAAO;QACnB,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,gDAAkB,CAAC,cAAc,CAAC,CAAC;QAC3F,MAAM,iBAAiB,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;QACpD,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;QAChG,MAAM,mBAAmB,GAAG,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,wBAAwB,CAAC,sBAAsB,CAAC,CAAC,CAAC;QAExG,IAAI,mBAAmB,CAAC,MAAM,KAAK,CAAC,EAAE;YAClC,IAAI,CAAC,MAAM,CAAC,IAAI,CACZ,GAAG,IAAI,CAAC,SAAS,2BAA2B,iBAAiB,CAAC,MAAM,wCAAwC,CAC/G,CAAC;YACF,OAAO;SACV;QAED,MAAM,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;QAC9D,IAAI,CAAC,MAAM,CAAC,IAAI,CACZ,GAAG,IAAI,CAAC,SAAS,KAAK,mBAAmB,CAAC,MAAM,IAAI,iBAAiB,CAAC,MAAM,iCAAiC,CAChH,CAAC;IACN,CAAC;CACJ,CAAA;iCApCY,sBAAsB;IADlC,IAAA,qBAAU,GAAE;IAMJ,WAAA,IAAA,iBAAM,EAAC,mCAAgB,CAAC,2BAA2B,CAAC,CAAA;IAEpD,WAAA,IAAA,iBAAM,EAAC,mCAAgB,CAAC,gBAAgB,CAAC,CAAA;IAEzC,WAAA,IAAA,iBAAM,EAAC,mCAAgB,CAAC,oBAAoB,CAAC,CAAA;IAE7C,WAAA,IAAA,iBAAM,EAAC,mCAAgB,CAAC,wBAAwB,CAAC,CAAA;IAEjD,WAAA,IAAA,iBAAM,EAAC,+BAAc,CAAC,MAAM,CAAC,CAAA;qCAPH,yDAA2B,UAIxB,2CAAoB;QAEhB,mDAAwB;GAZrD,sBAAsB,CAoClC"}
@@ -27,7 +27,6 @@ let DescriptorTransformation = exports.DescriptorTransformation = class Descript
27
27
  return Promise.resolve(dto);
28
28
  };
29
29
  this.transformElement = (dataItem) => {
30
- var _a, _b;
31
30
  return {
32
31
  id: dataItem.id,
33
32
  state: dataItem.state,
@@ -43,8 +42,8 @@ let DescriptorTransformation = exports.DescriptorTransformation = class Descript
43
42
  is_air_conditioned: !!dataItem.airCondition,
44
43
  has_usb_chargers: !!dataItem.usbChargers,
45
44
  paint: dataItem.paint,
46
- thumbnail_url: ((_a = dataItem.thumbnailUrl) === null || _a === void 0 ? void 0 : _a.length) === 0 ? null : dataItem.thumbnailUrl,
47
- photo_url: ((_b = dataItem.photoUrl) === null || _b === void 0 ? void 0 : _b.length) === 0 ? null : dataItem.photoUrl,
45
+ thumbnail_url: dataItem.thumbnailUrl?.length === 0 ? null : dataItem.thumbnailUrl,
46
+ photo_url: dataItem.photoUrl?.length === 0 ? null : dataItem.photoUrl,
48
47
  };
49
48
  };
50
49
  this.mapTractionToRouteType = (traction) => {
@@ -1 +1 @@
1
- {"version":3,"file":"DescriptorTransformation.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-descriptors/transformations/DescriptorTransformation.ts"],"names":[],"mappings":";;;;;;;;;AAEA,2FAA4G;AAC5G,6EAAwE;AACxE,iEAAgE;AAChE,0EAA+D;AAC/D,0FAA+G;AAGxG,IAAM,wBAAwB,sCAA9B,MAAM,wBAAyB,SAAQ,oCAAkB;IAAzD;;QACI,SAAI,GAAG,4BAA4B,CAAC;QAEpC,cAAS,GAAG,CAAC,IAAwB,EAAmC,EAAE;YAC7E,MAAM,GAAG,GAA2B,EAAE,CAAC;YACvC,KAAK,MAAM,QAAQ,IAAI,IAAI,EAAE;gBACzB,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;gBAChD,IAAI,OAAO,EAAE;oBACT,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;iBACrB;aACJ;YAED,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC,CAAC;QAEQ,qBAAgB,GAAG,CAAC,QAA0B,EAA+B,EAAE;;YACrF,OAAO;gBACH,EAAE,EAAE,QAAQ,CAAC,EAAE;gBACf,KAAK,EAAE,QAAQ,CAAC,KAAK;gBACrB,mBAAmB,EAAE,QAAQ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gBACxC,KAAK,sDAA6B,CAAC,IAAI;oBACnC,OAAO,kCAAiB,CAAC,IAAI,CAAC;gBAClC;oBACI,MAAM,IAAI,6BAAY,CAAC,GAAG,IAAI,CAAC,IAAI,uBAAuB,QAAQ,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;aACpG;QACL,CAAC,CAAC;IACN,CAAC;CAAA,CAAA;mCAlDY,wBAAwB;IADpC,IAAA,qBAAU,GAAE;GACA,wBAAwB,CAkDpC"}
1
+ {"version":3,"file":"DescriptorTransformation.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-descriptors/transformations/DescriptorTransformation.ts"],"names":[],"mappings":";;;;;;;;;AAEA,2FAA4G;AAC5G,6EAAwE;AACxE,iEAAgE;AAChE,0EAA+D;AAC/D,0FAA+G;AAGxG,IAAM,wBAAwB,sCAA9B,MAAM,wBAAyB,SAAQ,oCAAkB;IAAzD;;QACI,SAAI,GAAG,4BAA4B,CAAC;QAEpC,cAAS,GAAG,CAAC,IAAwB,EAAmC,EAAE;YAC7E,MAAM,GAAG,GAA2B,EAAE,CAAC;YACvC,KAAK,MAAM,QAAQ,IAAI,IAAI,EAAE;gBACzB,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;gBAChD,IAAI,OAAO,EAAE;oBACT,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;iBACrB;aACJ;YAED,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC,CAAC;QAEQ,qBAAgB,GAAG,CAAC,QAA0B,EAA+B,EAAE;YACrF,OAAO;gBACH,EAAE,EAAE,QAAQ,CAAC,EAAE;gBACf,KAAK,EAAE,QAAQ,CAAC,KAAK;gBACrB,mBAAmB,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAC9C,yBAAyB,EAAE,QAAQ,CAAC,WAAW;gBAC/C,aAAa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AG,IAAI,CAAC,IAAI,uBAAuB,QAAQ,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;aACpG;QACL,CAAC,CAAC;IACN,CAAC;CAAA,CAAA;mCAlDY,wBAAwB;IADpC,IAAA,qBAAU,GAAE;GACA,wBAAwB,CAkDpC"}
@@ -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.CisStopRepository = void 0;
13
4
  const const_1 = require("../../../../../schema-definitions/const");
@@ -24,9 +15,9 @@ class CisStopRepository extends integration_engine_1.PostgresModel {
24
15
  outputSequelizeAttributes: CisStopModel_1.CisStopModel.attributeModel,
25
16
  savingType: "insertOrUpdate",
26
17
  }, new golemio_validator_1.JSONSchemaValidator("VPCisStopRepositoryValidator", CisStopModel_1.CisStopModel.arrayJsonSchema));
27
- this.deleteNHoursOldData = (hours) => __awaiter(this, void 0, void 0, function* () {
18
+ this.deleteNHoursOldData = async (hours) => {
28
19
  try {
29
- return yield this.sequelizeModel.destroy({
20
+ return await this.sequelizeModel.destroy({
30
21
  where: {
31
22
  updated_at: {
32
23
  [sequelize_1.Op.lt]: sequelize_1.Sequelize.literal(`NOW() - INTERVAL '${hours} HOURS'`),
@@ -37,7 +28,7 @@ class CisStopRepository extends integration_engine_1.PostgresModel {
37
28
  catch (err) {
38
29
  throw new golemio_errors_1.GeneralError("Error while purging old data", this.constructor.name, err);
39
30
  }
40
- });
31
+ };
41
32
  }
42
33
  }
43
34
  exports.CisStopRepository = CisStopRepository;
@@ -1 +1 @@
1
- {"version":3,"file":"CisStopRepository.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/CisStopRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mEAAuC;AACvC,0GAA0E;AAC1E,8EAA8E;AAC9E,6EAAwE;AACxE,mFAAkF;AAClF,mEAAoE;AAEpE,MAAa,iBAAkB,SAAQ,kCAAa;IAChD;QACI,KAAK,CACD,qBAAqB,EACrB;YACI,WAAW,EAAE,2BAAY,CAAC,SAAS;YACnC,QAAQ,EAAE,iBAAS;YACnB,yBAAyB,EAAE,2BAAY,CAAC,cAAc;YACtD,UAAU,EAAE,gBAAgB;SAC/B,EACD,IAAI,uCAAmB,CAAC,8BAA8B,EAAE,2BAAY,CAAC,eAAe,CAAC,CACxF,CAAC;QAGC,wBAAmB,GAAG,CAAO,KAAa,EAAmB,EAAE;YAClE,IAAI;gBACA,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;oBACrC,KAAK,EAAE;wBACH,UAAU,EAAE;4BACR,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,qBAAS,CAAC,OAAO,CAAC,qBAAqB,KAAK,SAAS,CAAC;yBAClE;qBACJ;iBACJ,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,6BAAY,CAAC,8BAA8B,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;aACtF;QACL,CAAC,CAAA,CAAC;IAdF,CAAC;CAeJ;AA3BD,8CA2BC"}
1
+ {"version":3,"file":"CisStopRepository.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/CisStopRepository.ts"],"names":[],"mappings":";;;AAAA,mEAAuC;AACvC,0GAA0E;AAC1E,8EAA8E;AAC9E,6EAAwE;AACxE,mFAAkF;AAClF,mEAAoE;AAEpE,MAAa,iBAAkB,SAAQ,kCAAa;IAChD;QACI,KAAK,CACD,qBAAqB,EACrB;YACI,WAAW,EAAE,2BAAY,CAAC,SAAS;YACnC,QAAQ,EAAE,iBAAS;YACnB,yBAAyB,EAAE,2BAAY,CAAC,cAAc;YACtD,UAAU,EAAE,gBAAgB;SAC/B,EACD,IAAI,uCAAmB,CAAC,8BAA8B,EAAE,2BAAY,CAAC,eAAe,CAAC,CACxF,CAAC;QAGC,wBAAmB,GAAG,KAAK,EAAE,KAAa,EAAmB,EAAE;YAClE,IAAI;gBACA,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;oBACrC,KAAK,EAAE;wBACH,UAAU,EAAE;4BACR,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,qBAAS,CAAC,OAAO,CAAC,qBAAqB,KAAK,SAAS,CAAC;yBAClE;qBACJ;iBACJ,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,6BAAY,CAAC,8BAA8B,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;aACtF;QACL,CAAC,CAAC;IAdF,CAAC;CAeJ;AA3BD,8CA2BC"}
@@ -22,15 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
25
  Object.defineProperty(exports, "__esModule", { value: true });
35
26
  exports.PositionsHistoryRepository = void 0;
36
27
  const const_1 = require("../../../../../schema-definitions/const");
@@ -60,9 +51,9 @@ class PositionsHistoryRepository extends integration_engine_1.PostgresModel {
60
51
  ],
61
52
  },
62
53
  }, new golemio_validator_1.JSONSchemaValidator(vehicle_positions_1.VehiclePositions.positions.name + "ModelValidator", PositionDto_1.PositionDto.jsonSchema));
63
- this.deleteNHoursOldData = (hours) => __awaiter(this, void 0, void 0, function* () {
54
+ this.deleteNHoursOldData = async (hours) => {
64
55
  try {
65
- return yield this.sequelizeModel.destroy({
56
+ return await this.sequelizeModel.destroy({
66
57
  where: {
67
58
  updated_at: {
68
59
  [sequelize_1.Op.lt]: sequelize_1.default.literal(`NOW() - INTERVAL '${hours} HOURS'`),
@@ -73,7 +64,7 @@ class PositionsHistoryRepository extends integration_engine_1.PostgresModel {
73
64
  catch (err) {
74
65
  throw new golemio_errors_1.GeneralError("Error while purging old data", this.constructor.name, err);
75
66
  }
76
- });
67
+ };
77
68
  }
78
69
  }
79
70
  exports.PositionsHistoryRepository = PositionsHistoryRepository;
@@ -1 +1 @@
1
- {"version":3,"file":"PositionsHistoryRepository.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsHistoryRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAAuC;AACvC,2FAA0D;AAC1D,wGAAwE;AACxE,8EAA8E;AAC9E,6EAAwE;AACxE,mFAAkF;AAClF,iFAAoE;AAEpE,MAAa,0BAA2B,SAAQ,kCAAa;IACzD;QACI,KAAK,CACD,0BAA0B,EAC1B;YACI,yBAAyB,EAAE,yBAAW,CAAC,cAAc;YACrD,WAAW,EAAE,oCAAgB,CAAC,SAAS,CAAC,kBAAkB;YAC1D,QAAQ,EAAE,iBAAS;YACnB,UAAU,EAAE,YAAY;YACxB,2BAA2B,EAAE;gBACzB,OAAO,EAAE;oBACL;wBACI,MAAM,EAAE,CAAC,UAAU,CAAC;wBACpB,IAAI,EAAE,qCAAqC;qBAC9C;oBACD;wBACI,MAAM,EAAE,CAAC,aAAa,CAAC;wBACvB,IAAI,EAAE,wCAAwC;qBACjD;iBACJ;aACJ;SACJ,EACD,IAAI,uCAAmB,CAAC,oCAAgB,CAAC,SAAS,CAAC,IAAI,GAAG,gBAAgB,EAAE,yBAAW,CAAC,UAAU,CAAC,CACtG,CAAC;QAGC,wBAAmB,GAAG,CAAO,KAAa,EAAmB,EAAE;YAClE,IAAI;gBACA,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;oBACrC,KAAK,EAAE;wBACH,UAAU,EAAE;4BACR,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,mBAAS,CAAC,OAAO,CAAC,qBAAqB,KAAK,SAAS,CAAC;yBAClE;qBACJ;iBACJ,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,6BAAY,CAAC,8BAA8B,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;aACtF;QACL,CAAC,CAAA,CAAC;IAdF,CAAC;CAeJ;AAvCD,gEAuCC"}
1
+ {"version":3,"file":"PositionsHistoryRepository.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsHistoryRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAAuC;AACvC,2FAA0D;AAC1D,wGAAwE;AACxE,8EAA8E;AAC9E,6EAAwE;AACxE,mFAAkF;AAClF,iFAAoE;AAEpE,MAAa,0BAA2B,SAAQ,kCAAa;IACzD;QACI,KAAK,CACD,0BAA0B,EAC1B;YACI,yBAAyB,EAAE,yBAAW,CAAC,cAAc;YACrD,WAAW,EAAE,oCAAgB,CAAC,SAAS,CAAC,kBAAkB;YAC1D,QAAQ,EAAE,iBAAS;YACnB,UAAU,EAAE,YAAY;YACxB,2BAA2B,EAAE;gBACzB,OAAO,EAAE;oBACL;wBACI,MAAM,EAAE,CAAC,UAAU,CAAC;wBACpB,IAAI,EAAE,qCAAqC;qBAC9C;oBACD;wBACI,MAAM,EAAE,CAAC,aAAa,CAAC;wBACvB,IAAI,EAAE,wCAAwC;qBACjD;iBACJ;aACJ;SACJ,EACD,IAAI,uCAAmB,CAAC,oCAAgB,CAAC,SAAS,CAAC,IAAI,GAAG,gBAAgB,EAAE,yBAAW,CAAC,UAAU,CAAC,CACtG,CAAC;QAGC,wBAAmB,GAAG,KAAK,EAAE,KAAa,EAAmB,EAAE;YAClE,IAAI;gBACA,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;oBACrC,KAAK,EAAE;wBACH,UAAU,EAAE;4BACR,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,mBAAS,CAAC,OAAO,CAAC,qBAAqB,KAAK,SAAS,CAAC;yBAClE;qBACJ;iBACJ,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,6BAAY,CAAC,8BAA8B,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;aACtF;QACL,CAAC,CAAC;IAdF,CAAC;CAeJ;AAvCD,gEAuCC"}
@@ -22,15 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
35
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
27
  };
@@ -82,14 +73,14 @@ class PositionsRepository extends models_2.PostgresModel {
82
73
  * Batch 3 - TCP position (event 0) with origin_timestamp 10:01:40, created_at 10:01:44, last position
83
74
  * (position is on_track, last stop sequence is 3, delay at last stop is 20 and is served to the output API)
84
75
  */
85
- this.getPositionsForUpdateDelay = (tripIds) => __awaiter(this, void 0, void 0, function* () {
76
+ this.getPositionsForUpdateDelay = async (tripIds) => {
86
77
  // TODO - check that origin_time is not duplicate for tracking == 2.
87
78
  // const originTimeColumn = `"vehiclepositions_positions"."origin_time"`;
88
79
  // make sure to not run with empty array
89
80
  if (tripIds.length === 0) {
90
81
  return [];
91
82
  }
92
- const results = yield this.tripsModel.findAll({
83
+ const results = await this.tripsModel.findAll({
93
84
  attributes: [
94
85
  // Sequelize.literal(`DISTINCT ON (${originTimeColumn}) ${originTimeColumn}`),
95
86
  "id",
@@ -173,7 +164,6 @@ class PositionsRepository extends models_2.PostgresModel {
173
164
  // We return objects of positions grouped by trips_id
174
165
  try {
175
166
  return results.reduce((p, c) => {
176
- var _a;
177
167
  let pIndex = p.findIndex((e) => e.id === c.id);
178
168
  if (pIndex === -1) {
179
169
  p.push({
@@ -197,7 +187,7 @@ class PositionsRepository extends models_2.PostgresModel {
197
187
  lng: parseFloat(c["vehiclepositions_positions.lng"]) || null,
198
188
  origin_time: c["vehiclepositions_positions.origin_time"],
199
189
  origin_timestamp: c["vehiclepositions_positions.origin_timestamp"],
200
- scheduled_timestamp: (_a = c["vehiclepositions_positions.scheduled_timestamp"]) !== null && _a !== void 0 ? _a : null,
190
+ scheduled_timestamp: c["vehiclepositions_positions.scheduled_timestamp"] ?? null,
201
191
  shape_dist_traveled: parseFloat(c["vehiclepositions_positions.shape_dist_traveled"]) || null,
202
192
  is_tracked: c["vehiclepositions_positions.is_tracked"],
203
193
  is_canceled: c["vehiclepositions_positions.is_canceled"],
@@ -223,10 +213,10 @@ class PositionsRepository extends models_2.PostgresModel {
223
213
  catch (err) {
224
214
  throw new golemio_errors_1.GeneralError(`Error while transforming data from db for batch. Trip count ${results.length}.`, this.name, err);
225
215
  }
226
- });
227
- this.upsertCommonRunPosition = ({ run, run_message }, gtfsTrip, isCurrent = true) => __awaiter(this, void 0, void 0, function* () {
216
+ };
217
+ this.upsertCommonRunPosition = async ({ run, run_message }, gtfsTrip, isCurrent = true) => {
228
218
  try {
229
- const [record] = yield this.sequelizeModel.upsert(PositionsMapper_1.default.mapCommonRunToDto(run_message, isCurrent, gtfsTrip, run), {
219
+ const [record] = await this.sequelizeModel.upsert(PositionsMapper_1.default.mapCommonRunToDto(run_message, isCurrent, gtfsTrip, run), {
230
220
  returning: true,
231
221
  });
232
222
  return record.get({ plain: true });
@@ -234,10 +224,10 @@ class PositionsRepository extends models_2.PostgresModel {
234
224
  catch (err) {
235
225
  throw new golemio_errors_1.GeneralError("upsertCommonRunPosition: Error while saving to database.", this.name, err);
236
226
  }
237
- });
238
- this.upsertMetroRunPosition = (runInput, gtfsTrip, isCurrent = true) => __awaiter(this, void 0, void 0, function* () {
227
+ };
228
+ this.upsertMetroRunPosition = async (runInput, gtfsTrip, isCurrent = true) => {
239
229
  try {
240
- const [record] = yield this.sequelizeModel.upsert(PositionsMapper_1.default.mapMetroRunToDto(isCurrent, gtfsTrip, runInput), {
230
+ const [record] = await this.sequelizeModel.upsert(PositionsMapper_1.default.mapMetroRunToDto(isCurrent, gtfsTrip, runInput), {
241
231
  returning: true,
242
232
  });
243
233
  return record.get({ plain: true });
@@ -245,10 +235,10 @@ class PositionsRepository extends models_2.PostgresModel {
245
235
  catch (err) {
246
236
  throw new golemio_errors_1.GeneralError("upsertMetroRunPosition: Error while saving to database.", this.name, err);
247
237
  }
248
- });
249
- this.deleteNHoursOldData = (hours) => __awaiter(this, void 0, void 0, function* () {
238
+ };
239
+ this.deleteNHoursOldData = async (hours) => {
250
240
  try {
251
- return yield this.sequelizeModel.destroy({
241
+ return await this.sequelizeModel.destroy({
252
242
  where: {
253
243
  updated_at: {
254
244
  [sequelize_1.Op.lt]: sequelize_1.default.literal(`NOW() - INTERVAL '${hours} HOURS'`),
@@ -259,24 +249,24 @@ class PositionsRepository extends models_2.PostgresModel {
259
249
  catch (err) {
260
250
  throw new golemio_errors_1.GeneralError("Error while purging old data", this.constructor.name, err);
261
251
  }
262
- });
263
- this.createEntity = (positionDto) => __awaiter(this, void 0, void 0, function* () {
252
+ };
253
+ this.createEntity = async (positionDto) => {
264
254
  try {
265
- return yield this.sequelizeModel.create(positionDto, {
255
+ return await this.sequelizeModel.create(positionDto, {
266
256
  returning: true,
267
257
  });
268
258
  }
269
259
  catch (err) {
270
260
  throw new golemio_errors_1.GeneralError("createEntity: error while saving data", this.name, err);
271
261
  }
272
- });
262
+ };
273
263
  /**
274
264
  * Invalidate positions for trips with stop sequence greater than given stop sequence
275
265
  * Used when a vehicle repeats some part of the trip
276
266
  * @param tripWithStopSequenceTuples - array of tuples with trip id and stop sequence
277
267
  * @returns number of invalidated positions
278
268
  */
279
- this.invalidatePositionsAfterStopSequence = (tripWithStopSequenceTuples) => __awaiter(this, void 0, void 0, function* () {
269
+ this.invalidatePositionsAfterStopSequence = async (tripWithStopSequenceTuples) => {
280
270
  if (tripWithStopSequenceTuples.length === 0) {
281
271
  return 0;
282
272
  }
@@ -290,7 +280,7 @@ class PositionsRepository extends models_2.PostgresModel {
290
280
  })),
291
281
  };
292
282
  try {
293
- const [count] = yield this.sequelizeModel.update({
283
+ const [count] = await this.sequelizeModel.update({
294
284
  state_process: const_2.StateProcessEnum.INVALIDATED,
295
285
  state_position: const_2.StatePositionEnum.UNKNOWN,
296
286
  }, {
@@ -301,7 +291,7 @@ class PositionsRepository extends models_2.PostgresModel {
301
291
  catch (err) {
302
292
  throw new golemio_errors_1.GeneralError("invalidatePositions: error while updating data", this.name, err);
303
293
  }
304
- });
294
+ };
305
295
  this.tripsModel = connectors_1.PostgresConnector.getConnection().define(models_1.VPTripsModel.TABLE_NAME, models_1.VPTripsModel.attributeModel, {
306
296
  schema: const_1.PG_SCHEMA,
307
297
  });