@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
  };
@@ -32,7 +23,7 @@ const stream_1 = require("stream");
32
23
  let RopidGTFSTransformation = exports.RopidGTFSTransformation = class RopidGTFSTransformation extends transformations_1.BaseTransformation {
33
24
  constructor() {
34
25
  super();
35
- this.transform = (input) => __awaiter(this, void 0, void 0, function* () {
26
+ this.transform = async (input) => {
36
27
  // create object by table structure and fill its values with null
37
28
  const tableToObjectFilledWithNulls = Object.keys(ropid_gtfs_1.RopidGTFS[input.name].outputSequelizeAttributes)
38
29
  .filter((column) => !column.startsWith("computed_"))
@@ -40,12 +31,17 @@ let RopidGTFSTransformation = exports.RopidGTFSTransformation = class RopidGTFST
40
31
  const addColumns = new stream_1.Transform({
41
32
  objectMode: true,
42
33
  transform(chunk, _encoding, callback) {
43
- this.push(Object.assign(Object.assign({}, tableToObjectFilledWithNulls), Object.keys(chunk)
44
- .filter((key) => Object.keys(tableToObjectFilledWithNulls).includes(key))
45
- .reduce((obj, key) => {
46
- obj[key] = chunk[key];
47
- return obj;
48
- }, {})));
34
+ this.push({
35
+ // prepare object to be same as db table (number and order of columns)
36
+ ...tableToObjectFilledWithNulls,
37
+ // filter redundant properties and fill data to prepared structure
38
+ ...Object.keys(chunk)
39
+ .filter((key) => Object.keys(tableToObjectFilledWithNulls).includes(key))
40
+ .reduce((obj, key) => {
41
+ obj[key] = chunk[key];
42
+ return obj;
43
+ }, {}),
44
+ });
49
45
  callback();
50
46
  },
51
47
  });
@@ -58,7 +54,7 @@ let RopidGTFSTransformation = exports.RopidGTFSTransformation = class RopidGTFST
58
54
  integration_engine_1.log.info(`Datasets: transformation success (${input.name})`);
59
55
  }
60
56
  });
61
- });
57
+ };
62
58
  this.transformElement = () => { };
63
59
  this.name = ropid_gtfs_1.RopidGTFS.name;
64
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RopidGTFSTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uEAA4C;AAE5C,8EAA4D;AAC5D,2FAA4G;AAC5G,iEAAgE;AAChE,4DAA6B;AAC7B,kEAAsC;AACtC,mCAAuD;AAQhD,IAAM,uBAAuB,qCAA7B,MAAM,uBAAwB,SAAQ,oCAAkB;IAG3D;QACI,KAAK,EAAE,CAAC;QAIL,cAAS,GAAG,CAAO,KAAmC,EAAqB,EAAE;YAChF,iEAAiE;YACjE,MAAM,4BAA4B,GAAG,MAAM,CAAC,IAAI,CAAC,sBAAS,CAAC,KAAK,CAAC,IAAuB,CAAC,CAAC,yBAAyB,CAAC;iBAC/G,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;iBACnD,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CA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,sBAAS,CAAC,IAAI,CAAC;IAC/B,CAAC;CAqCJ,CAAA;kCA3CY,uBAAuB;IADnC,IAAA,qBAAU,GAAE;;GACA,uBAAuB,CA2CnC"}
1
+ {"version":3,"file":"RopidGTFSTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uEAA4C;AAE5C,8EAA4D;AAC5D,2FAA4G;AAC5G,iEAAgE;AAChE,4DAA6B;AAC7B,kEAAsC;AACtC,mCAAuD;AAQhD,IAAM,uBAAuB,qCAA7B,MAAM,uBAAwB,SAAQ,oCAAkB;IAG3D;QACI,KAAK,EAAE,CAAC;QAIL,cAAS,GAAG,KAAK,EAAE,KAAmC,EAAqB,EAAE;YAChF,iEAAiE;YACjE,MAAM,4BAA4B,GAAG,MAAM,CAAC,IAAI,CAAC,sBAAS,CAAC,KAAK,CAAC,IAAuB,CAAC,CAAC,yBAAyB,CAAC;iBAC/G,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;iBACnD,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,EAA0B,CAAC,CAAC;YAElF,MAAM,UAAU,GAAG,IAAI,kBAAS,CAAC;gBAC7B,UAAU,EAAE,IAAI;gBAChB,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ;oBAChC,IAAI,CAAC,IAAI,CAAC;wBACN,sEAAsE;wBACtE,GAAG,4BAA4B;wBAC/B,kEAAkE;wBAClE,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;6BAChB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;6BACxE,MAAM,CAAC,CAAC,GAAQ,EAAE,GAAG,EAAE,EAAE;4BACtB,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;4BACtB,OAAO,GAAG,CAAC;wBACf,CAAC,EAAE,EAAE,CAAC;qBACb,CAAC,CAAC;oBACH,QAAQ,EAAE,CAAC;gBACf,CAAC;aACJ,CAAC,CAAC;YAEH,OAAO,IAAA,iBAAQ,EAAC,KAAK,CAAC,YAAY,EAAE,IAAA,oBAAG,GAAE,EAAE,UAAU,EAAE,IAAA,uBAAS,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE;gBACxF,IAAI,GAAG,EAAE;oBACL,wBAAG,CAAC,KAAK,CAAC,mCAAmC,KAAK,CAAC,IAAI,MAAM,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;oBAC/E,MAAM,GAAG,CAAC;iBACb;qBAAM;oBACH,wBAAG,CAAC,IAAI,CAAC,qCAAqC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;iBAChE;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;QAEQ,qBAAgB,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;QArClC,IAAI,CAAC,IAAI,GAAG,sBAAS,CAAC,IAAI,CAAC;IAC/B,CAAC;CAqCJ,CAAA;kCA3CY,uBAAuB;IADnC,IAAA,qBAAU,GAAE;;GACA,uBAAuB,CA2CnC"}
@@ -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
  Object.defineProperty(exports, "__esModule", { value: true });
47
38
  exports.PresetLogRepository = void 0;
48
39
  const ModuleContainerToken_1 = require("../../../../ioc/ModuleContainerToken");
@@ -63,9 +54,9 @@ let PresetLogRepository = exports.PresetLogRepository = class PresetLogRepositor
63
54
  outputSequelizeAttributes: models_1.PresetLogModel.attributeModel,
64
55
  savingType: "insertOrUpdate",
65
56
  }, new golemio_validator_1.JSONSchemaValidator("PresetLogPepository", models_1.PresetLogModel.arrayJsonSchema));
66
- this.findUnprocessed = () => __awaiter(this, void 0, void 0, function* () {
57
+ this.findUnprocessed = async () => {
67
58
  try {
68
- return yield this.sequelizeModel.findAll({
59
+ return await this.sequelizeModel.findAll({
69
60
  attributes: ["id", "device_alias", "received_at"],
70
61
  include: [
71
62
  {
@@ -85,21 +76,21 @@ let PresetLogRepository = exports.PresetLogRepository = class PresetLogRepositor
85
76
  catch (err) {
86
77
  throw new golemio_errors_1.GeneralError("Error while fetching unprocessed preset logs", this.constructor.name, err);
87
78
  }
88
- });
89
- this.saveData = (data) => __awaiter(this, void 0, void 0, function* () {
79
+ };
80
+ this.saveData = async (data) => {
90
81
  try {
91
- yield this.validate(data);
92
- yield this.sequelizeModel.bulkCreate(data, {
82
+ await this.validate(data);
83
+ await this.sequelizeModel.bulkCreate(data, {
93
84
  ignoreDuplicates: true,
94
85
  });
95
86
  }
96
87
  catch (err) {
97
88
  throw new golemio_errors_1.GeneralError("Error while creating preset logs", this.constructor.name, err);
98
89
  }
99
- });
100
- this.markAsProcessed = (logIds) => __awaiter(this, void 0, void 0, function* () {
90
+ };
91
+ this.markAsProcessed = async (logIds) => {
101
92
  try {
102
- yield this.sequelizeModel.update({ is_processed: true }, {
93
+ await this.sequelizeModel.update({ is_processed: true }, {
103
94
  where: sequelize_1.default.where(sequelize_1.default.col("id"), {
104
95
  [sequelize_1.Op.in]: logIds,
105
96
  }),
@@ -108,10 +99,10 @@ let PresetLogRepository = exports.PresetLogRepository = class PresetLogRepositor
108
99
  catch (err) {
109
100
  throw new golemio_errors_1.GeneralError("Error while marking preset logs as processed", this.constructor.name, err);
110
101
  }
111
- });
112
- this.deleteNHoursOldData = (hours) => __awaiter(this, void 0, void 0, function* () {
102
+ };
103
+ this.deleteNHoursOldData = async (hours) => {
113
104
  try {
114
- return yield this.sequelizeModel.destroy({
105
+ return await this.sequelizeModel.destroy({
115
106
  where: {
116
107
  received_at: {
117
108
  [sequelize_1.Op.lt]: sequelize_1.default.literal(`NOW() - INTERVAL '${hours} HOURS'`),
@@ -122,7 +113,7 @@ let PresetLogRepository = exports.PresetLogRepository = class PresetLogRepositor
122
113
  catch (err) {
123
114
  throw new golemio_errors_1.GeneralError("Error while purging preset logs", this.constructor.name, err);
124
115
  }
125
- });
116
+ };
126
117
  this.sequelizeModel.hasOne(departurePresetsRepository["sequelizeModel"], {
127
118
  as: ropid_departures_presets_1.RopidDeparturesPresets.pgTableName,
128
119
  foreignKey: "route_name",
@@ -1 +1 @@
1
- {"version":3,"file":"PresetLogRepository.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/presets/data-access/PresetLogRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+EAAoE;AACpE,gGAAmG;AACnG,mEAAuC;AACvC,kGAA0E;AAE1E,yGAAuE;AACvE,yEAA6E;AAC7E,6EAAwE;AACxE,mFAAkF;AAClF,iFAAiF;AACjF,iEAAwE;AAIjE,IAAM,mBAAmB,iCAAzB,MAAM,mBAAoB,SAAQ,sBAAa;IAGlD,YAAqE,0BAAsD;QACvH,KAAK,CACD,qBAAqB,EACrB;YACI,WAAW,EAAE,uBAAc,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AAC,0BAA0B,CAAC,CAAA;qCAA6B,uDAA0B;GAHlH,mBAAmB,CAwF/B"}
1
+ {"version":3,"file":"PresetLogRepository.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/presets/data-access/PresetLogRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+EAAoE;AACpE,gGAAmG;AACnG,mEAAuC;AACvC,kGAA0E;AAE1E,yGAAuE;AACvE,yEAA6E;AAC7E,6EAAwE;AACxE,mFAAkF;AAClF,iFAAiF;AACjF,iEAAwE;AAIjE,IAAM,mBAAmB,iCAAzB,MAAM,mBAAoB,SAAQ,sBAAa;IAGlD,YAAqE,0BAAsD;QACvH,KAAK,CACD,qBAAqB,EACrB;YACI,WAAW,EAAE,uBAAc,CAAC,SAAS;YACrC,QAAQ,EAAE,iBAAS;YACnB,yBAAyB,EAAE,uBAAc,CAAC,cAAc;YACxD,UAAU,EAAE,gBAAgB;SAC/B,EACD,IAAI,uCAAmB,CAAC,qBAAqB,EAAE,uBAAc,CAAC,eAAe,CAAC,CACjF,CAAC;QAaC,oBAAe,GAAG,KAAK,IAA+B,EAAE;YAC3D,IAAI;gBACA,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;oBACrC,UAAU,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,aAAa,CAAC;oBACjD,OAAO,EAAE;wBACL;4BACI,WAAW,EAAE,iDAAsB,CAAC,WAAW;4BAC/C,UAAU,EAAE,EAAE;4BACd,QAAQ,EAAE,IAAI;yBACjB;qBACJ;oBACD,KAAK,EAAE;wBACH,YAAY,EAAE,KAAK;wBACnB,WAAW,EAAE;4BACT,CAAC,cAAE,CAAC,GAAG,CAAC,EAAE,mBAAS,CAAC,OAAO,CAAC,2BAA2B,CAAC;yBAC3D;qBACJ;iBACJ,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,6BAAY,CA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;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,6BAAY,CAAC,iCAAiC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;aACzF;QACL,CAAC,CAAC;QAxEE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,0BAA0B,CAAC,gBAAgB,CAAC,EAAE;YACrE,EAAE,EAAE,iDAAsB,CAAC,WAAW;YACtC,UAAU,EAAE,YAAY;YACxB,SAAS,EAAE,cAAc;YACzB,WAAW,EAAE,KAAK;YAClB,KAAK,EAAE;gBACH,UAAU,EAAE,KAAK;aACpB;SACJ,CAAC,CAAC;IACP,CAAC;CAgEJ,CAAA;8BAxFY,mBAAmB;IAD/B,IAAA,qBAAU,GAAE;IAII,WAAA,IAAA,iBAAM,EAAC,2CAAoB,CAAC,0BAA0B,CAAC,CAAA;qCAA6B,uDAA0B;GAHlH,mBAAmB,CAwF/B"}
@@ -29,12 +29,11 @@ let GrafanaLokiDataSourceProvider = exports.GrafanaLokiDataSourceProvider = Graf
29
29
  return new integration_engine_1.DataSource(GrafanaLokiDataSourceProvider_1.DATASOURCE_NAME, this.getProtocolStrategy(params), new integration_engine_1.JSONDataTypeStrategy({ resultsPath: "data.result" }), new golemio_validator_1.JSONSchemaValidator(GrafanaLokiDataSourceProvider_1.DATASOURCE_NAME, datasources_1.grafanaLokiJsonSchema));
30
30
  }
31
31
  getProtocolStrategy(params) {
32
- var _a;
33
32
  const url = new URL("/loki/api/v1/query_range", this.config.datasources.GrafanaLokiApiUrl);
34
33
  url.searchParams.set("start", params.start.toString());
35
34
  url.searchParams.set("end", params.end.toString());
36
35
  url.searchParams.set("query", params.query);
37
- url.searchParams.set("limit", (_a = this.config.datasources.GrafanaLokiApiLimit) !== null && _a !== void 0 ? _a : DEFAULT_API_LIMIT);
36
+ url.searchParams.set("limit", this.config.datasources.GrafanaLokiApiLimit ?? DEFAULT_API_LIMIT);
38
37
  return new HTTPFetchProtocolStrategy_1.HTTPFetchProtocolStrategy({
39
38
  method: "GET",
40
39
  url: url.toString(),
@@ -1 +1 @@
1
- {"version":3,"file":"GrafanaLokiDataSourceProvider.js","sourceRoot":"","sources":["../../../../../../../src/integration-engine/ropid-gtfs/workers/presets/datasources/grafana-loki/GrafanaLokiDataSourceProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,+GAAsF;AAEtF,8EAAwH;AAExH,6IAA0I;AAC1I,6FAA0F;AAC1F,mFAAkF;AAClF,iEAAwE;AAQxE,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAGxB,IAAM,6BAA6B,6EAAnC,MAAM,6BAA6B;IAGtC,YAAmD,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;IAEtE,aAAa,CAAC,MAAoB;QACrC,OAAO,IAAI,+BAAU,CACjB,+BAA6B,CAAC,eAAe,EAC7C,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAChC,IAAI,yCAAoB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,EACxD,IAAI,uCAAmB,CAAC,+BAA6B,CAAC,eAAe,EAAE,mCAAqB,CAAC,CAChG,CAAC;IACN,CAAC;IAEO,mBAAmB,CAAC,MAAoB;;QAC5C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,0BAA0B,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;QAC3F,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QACvD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;QACnD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,MAAA,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,mBAAmB,mCAAI,iBAAiB,CAAC,CAAC;QAEhG,OAAO,IAAI,qDAAyB,CAAC;YACjC,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE;YACnB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,qBAAqB;YACtD,gBAAgB,EAAE,EAAE;SACvB,CAAC,CAAC;IACP,CAAC;;AA1Bc,6CAAe,GAAG,uBAAuB,AAA1B,CAA2B;wCADhD,6BAA6B;IADzC,IAAA,qBAAU,GAAE;IAII,WAAA,IAAA,iBAAM,EAAC,+BAAc,CAAC,MAAM,CAAC,CAAA;;GAHjC,6BAA6B,CA4BzC"}
1
+ {"version":3,"file":"GrafanaLokiDataSourceProvider.js","sourceRoot":"","sources":["../../../../../../../src/integration-engine/ropid-gtfs/workers/presets/datasources/grafana-loki/GrafanaLokiDataSourceProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,+GAAsF;AAEtF,8EAAwH;AAExH,6IAA0I;AAC1I,6FAA0F;AAC1F,mFAAkF;AAClF,iEAAwE;AAQxE,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAGxB,IAAM,6BAA6B,6EAAnC,MAAM,6BAA6B;IAGtC,YAAmD,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;IAEtE,aAAa,CAAC,MAAoB;QACrC,OAAO,IAAI,+BAAU,CACjB,+BAA6B,CAAC,eAAe,EAC7C,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAChC,IAAI,yCAAoB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,EACxD,IAAI,uCAAmB,CAAC,+BAA6B,CAAC,eAAe,EAAE,mCAAqB,CAAC,CAChG,CAAC;IACN,CAAC;IAEO,mBAAmB,CAAC,MAAoB;QAC5C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,0BAA0B,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;QAC3F,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QACvD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;QACnD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,mBAAmB,IAAI,iBAAiB,CAAC,CAAC;QAEhG,OAAO,IAAI,qDAAyB,CAAC;YACjC,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE;YACnB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,qBAAqB;YACtD,gBAAgB,EAAE,EAAE;SACvB,CAAC,CAAC;IACP,CAAC;;AA1Bc,6CAAe,GAAG,uBAAuB,AAA1B,CAA2B;wCADhD,6BAA6B;IADzC,IAAA,qBAAU,GAAE;IAII,WAAA,IAAA,iBAAM,EAAC,+BAAc,CAAC,MAAM,CAAC,CAAA;;GAHjC,6BAA6B,CA4BzC"}
@@ -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.RopidMonitoringService = void 0;
25
16
  const ContainerToken_1 = require("@golemio/core/dist/integration-engine/ioc/ContainerToken");
@@ -29,22 +20,20 @@ let RopidMonitoringService = exports.RopidMonitoringService = class RopidMonitor
29
20
  constructor(config) {
30
21
  this.config = config;
31
22
  }
32
- sendLogsToMonitoringSystem(logEntries) {
33
- return __awaiter(this, void 0, void 0, function* () {
34
- const requestConfig = this.getRequestConfig(logEntries);
35
- try {
36
- const response = yield fetch(this.config.datasources.RopidMonitoringPushUrl, requestConfig);
37
- if (response.status < 200 || response.status >= 300) {
38
- throw new golemio_errors_1.GeneralError(`Error while sending logs to the ROPID monitoring system. Status code: ${response.status}`, this.constructor.name);
39
- }
23
+ async sendLogsToMonitoringSystem(logEntries) {
24
+ const requestConfig = this.getRequestConfig(logEntries);
25
+ try {
26
+ const response = await fetch(this.config.datasources.RopidMonitoringPushUrl, requestConfig);
27
+ if (response.status < 200 || response.status >= 300) {
28
+ throw new golemio_errors_1.GeneralError(`Error while sending logs to the ROPID monitoring system. Status code: ${response.status}`, this.constructor.name);
40
29
  }
41
- catch (err) {
42
- if (err instanceof golemio_errors_1.GeneralError) {
43
- throw err;
44
- }
45
- throw new golemio_errors_1.GeneralError("Error while sending logs to the ROPID monitoring system", this.constructor.name, err);
30
+ }
31
+ catch (err) {
32
+ if (err instanceof golemio_errors_1.GeneralError) {
33
+ throw err;
46
34
  }
47
- });
35
+ throw new golemio_errors_1.GeneralError("Error while sending logs to the ROPID monitoring system", this.constructor.name, err);
36
+ }
48
37
  }
49
38
  getRequestConfig(logEntries) {
50
39
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"RopidMonitoringService.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/presets/helpers/RopidMonitoringService.ts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,CAAA;;GADjC,sBAAsB,CA+BlC"}
1
+ {"version":3,"file":"RopidMonitoringService.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/presets/helpers/RopidMonitoringService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,6FAA0F;AAC1F,6EAAwE;AACxE,iEAAwE;AAIjE,IAAM,sBAAsB,oCAA5B,MAAM,sBAAsB;IAC/B,YAAmD,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;IAEtE,KAAK,CAAC,0BAA0B,CAAC,UAAoC;QACxE,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAExD,IAAI;YACA,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,sBAAsB,EAAE,aAAa,CAAC,CAAC;YAC5F,IAAI,QAAQ,CAAC,MAAM,GAAG,GAAG,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE;gBACjD,MAAM,IAAI,6BAAY,CAClB,yEAAyE,QAAQ,CAAC,MAAM,EAAE,EAC1F,IAAI,CAAC,WAAW,CAAC,IAAI,CACxB,CAAC;aACL;SACJ;QAAC,OAAO,GAAG,EAAE;YACV,IAAI,GAAG,YAAY,6BAAY,EAAE;gBAC7B,MAAM,GAAG,CAAC;aACb;YAED,MAAM,IAAI,6BAAY,CAAC,yDAAyD,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;SACjH;IACL,CAAC;IAEO,gBAAgB,CAAC,UAAoC;QACzD,OAAO;YACH,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,0BAA0B;YAC3D,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;YAChC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;SACzC,CAAC;IACN,CAAC;CACJ,CAAA;iCA/BY,sBAAsB;IADlC,IAAA,qBAAU,GAAE;IAEI,WAAA,IAAA,iBAAM,EAAC,+BAAc,CAAC,MAAM,CAAC,CAAA;;GADjC,sBAAsB,CA+BlC"}
@@ -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.CheckForNewDeparturesPresetsTask = void 0;
25
16
  const RopidGtfsMetadataRepository_1 = require("../../../RopidGtfsMetadataRepository");
@@ -38,24 +29,22 @@ let CheckForNewDeparturesPresetsTask = exports.CheckForNewDeparturesPresetsTask
38
29
  this.queueName = "checkForNewDeparturesPresets";
39
30
  this.queueTtl = 59 * 1000 * 4; // 4 minutes
40
31
  }
41
- execute() {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- try {
44
- const departuresPresetsServerLastModified = yield this.departuresPresetsDataSource.getLastModified();
45
- const departuresPresetsDbLastModified = yield this.metadataRepository.getLastModified(RopidGtfsFacade_1.DatasetEnum.DEPARTURES_PRESETS);
46
- if (departuresPresetsServerLastModified !== departuresPresetsDbLastModified.lastModified) {
47
- yield integration_engine_1.QueueManager.sendMessageToExchange(this.queuePrefix, "downloadDeparturesPresets", {});
48
- }
32
+ async execute() {
33
+ try {
34
+ const departuresPresetsServerLastModified = await this.departuresPresetsDataSource.getLastModified();
35
+ const departuresPresetsDbLastModified = await this.metadataRepository.getLastModified(RopidGtfsFacade_1.DatasetEnum.DEPARTURES_PRESETS);
36
+ if (departuresPresetsServerLastModified !== departuresPresetsDbLastModified.lastModified) {
37
+ await integration_engine_1.QueueManager.sendMessageToExchange(this.queuePrefix, "downloadDeparturesPresets", {});
38
+ }
39
+ }
40
+ catch (err) {
41
+ if (err instanceof golemio_errors_1.AbstractGolemioError) {
42
+ throw err;
49
43
  }
50
- catch (err) {
51
- if (err instanceof golemio_errors_1.AbstractGolemioError) {
52
- throw err;
53
- }
54
- else {
55
- throw new golemio_errors_1.GeneralError("Error while checking for new departures presets", this.constructor.name, err);
56
- }
44
+ else {
45
+ throw new golemio_errors_1.GeneralError("Error while checking for new departures presets", this.constructor.name, err);
57
46
  }
58
- });
47
+ }
59
48
  }
60
49
  };
61
50
  exports.CheckForNewDeparturesPresetsTask = CheckForNewDeparturesPresetsTask = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"CheckForNewDeparturesPresetsTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/presets/tasks/CheckForNewDeparturesPresetsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,sFAAyF;AACzF,kFAAqF;AACrF,8EAAwF;AACxF,iEAAwE;AACxE,8DAAuD;AACvD,6EAA8F;AAC9F,4FAAyF;AACzF,6EAA4C;AAGrC,IAAM,gCAAgC,8CAAtC,MAAM,gCAAiC,SAAQ,sCAAiB;IAInE,YACiE,kBAAuD,EAEpH,2BAAgE;QAEhE,KAAK,CAAC,sBAAS,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAJiC,uBAAkB,GAAlB,kBAAkB,CAA6B;QAE5G,gCAA2B,GAA3B,2BAA2B,CAA6B;QANpD,cAAS,GAAG,8BAA8B,CAAC;QAC3C,aAAQ,GAAG,EAAE,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,YAAY;IAQtD,CAAC;IAEe,OAAO;;YACnB,IAAI;gBACA,MAAM,mCAAmC,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAAC,eAAe,EAAE,CAAC;gBACrG,MAAM,+BAA+B,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,6BAAW,CAAC,kBAAkB,CAAC,CAAC;gBACtH,IAAI,mCAAmC,KAAK,+BAA+B,CAAC,YAAY,EAAE;oBACtF,MAAM,iCAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,2BAA2B,EAAE,EAAE,CAAC,CAAC;iBAC/F;aACJ;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,GAAG,YAAY,qCAAoB,EAAE;oBACrC,MAAM,GAAG,CAAC;iBACb;qBAAM;oBACH,MAAM,IAAI,6BAAY,CAAC,iDAAiD,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;iBACzG;aACJ;QACL,CAAC;KAAA;CACJ,CAAA;2CA3BY,gCAAgC;IAD5C,IAAA,qBAAU,GAAE;IAMJ,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,2BAA2B,CAAC,CAAA;IAC3D,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,2BAA2B,CAAC,CAAA;qCAD6B,yDAA2B;QAE/E,yDAA2B;GAP3D,gCAAgC,CA2B5C"}
1
+ {"version":3,"file":"CheckForNewDeparturesPresetsTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/presets/tasks/CheckForNewDeparturesPresetsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sFAAyF;AACzF,kFAAqF;AACrF,8EAAwF;AACxF,iEAAwE;AACxE,8DAAuD;AACvD,6EAA8F;AAC9F,4FAAyF;AACzF,6EAA4C;AAGrC,IAAM,gCAAgC,8CAAtC,MAAM,gCAAiC,SAAQ,sCAAiB;IAInE,YACiE,kBAAuD,EAEpH,2BAAgE;QAEhE,KAAK,CAAC,sBAAS,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAJiC,uBAAkB,GAAlB,kBAAkB,CAA6B;QAE5G,gCAA2B,GAA3B,2BAA2B,CAA6B;QANpD,cAAS,GAAG,8BAA8B,CAAC;QAC3C,aAAQ,GAAG,EAAE,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,YAAY;IAQtD,CAAC;IAES,KAAK,CAAC,OAAO;QACnB,IAAI;YACA,MAAM,mCAAmC,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAAC,eAAe,EAAE,CAAC;YACrG,MAAM,+BAA+B,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,6BAAW,CAAC,kBAAkB,CAAC,CAAC;YACtH,IAAI,mCAAmC,KAAK,+BAA+B,CAAC,YAAY,EAAE;gBACtF,MAAM,iCAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,2BAA2B,EAAE,EAAE,CAAC,CAAC;aAC/F;SACJ;QAAC,OAAO,GAAG,EAAE;YACV,IAAI,GAAG,YAAY,qCAAoB,EAAE;gBACrC,MAAM,GAAG,CAAC;aACb;iBAAM;gBACH,MAAM,IAAI,6BAAY,CAAC,iDAAiD,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;aACzG;SACJ;IACL,CAAC;CACJ,CAAA;2CA3BY,gCAAgC;IAD5C,IAAA,qBAAU,GAAE;IAMJ,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,2BAA2B,CAAC,CAAA;IAC3D,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,2BAA2B,CAAC,CAAA;qCAD6B,yDAA2B;QAE/E,yDAA2B;GAP3D,gCAAgC,CA2B5C"}
@@ -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.CollectAndSaveLogsTask = void 0;
13
4
  const Di_1 = require("../../../../ioc/Di");
@@ -31,35 +22,33 @@ class CollectAndSaveLogsTask extends workers_1.AbstractTask {
31
22
  this.logFilter = Di_1.PidContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.PresetLogFilter);
32
23
  this.logger = Di_1.PidContainer.resolve(CoreToken_1.CoreToken.Logger);
33
24
  }
34
- execute(data) {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- const currentTimestampInSeconds = Math.round(new Date().getTime() / 1000);
37
- const dataSource = this.dataSourceFactory.getDataSource(PresetLogProviderEnum_1.PresetLogProvider.GrafanaLoki, {
38
- start: currentTimestampInSeconds - data.targetMinutes * 60,
39
- end: currentTimestampInSeconds,
40
- query: LogQueryManager_1.LogQueryManager.getCompletedPresetRequestLogsQuery(),
41
- });
42
- let queryResult = [];
43
- try {
44
- queryResult = yield dataSource.getAll();
45
- }
46
- catch (err) {
47
- if (err instanceof golemio_errors_1.AbstractGolemioError) {
48
- throw err;
49
- }
50
- throw new golemio_errors_1.DatasourceError("Error while fetching preset logs", this.constructor.name, err);
51
- }
52
- const validLogEntries = this.logFilter.getValidLogEntries(queryResult);
53
- if (validLogEntries.length > 0) {
54
- const presetLogDtos = yield this.logTransformation.transform(queryResult);
55
- this.logger.info(`${this.constructor.name}: ${presetLogDtos.length} log entries collected`);
56
- yield this.logRepository.saveData(presetLogDtos);
57
- }
58
- else {
59
- this.logger.warn(`${this.constructor.name}: no valid log entries collected`);
60
- }
61
- yield queueprocessors_1.QueueManager.sendMessageToExchange(this.queuePrefix, "processAndSendLogs", {});
25
+ async execute(data) {
26
+ const currentTimestampInSeconds = Math.round(new Date().getTime() / 1000);
27
+ const dataSource = this.dataSourceFactory.getDataSource(PresetLogProviderEnum_1.PresetLogProvider.GrafanaLoki, {
28
+ start: currentTimestampInSeconds - data.targetMinutes * 60,
29
+ end: currentTimestampInSeconds,
30
+ query: LogQueryManager_1.LogQueryManager.getCompletedPresetRequestLogsQuery(),
62
31
  });
32
+ let queryResult = [];
33
+ try {
34
+ queryResult = await dataSource.getAll();
35
+ }
36
+ catch (err) {
37
+ if (err instanceof golemio_errors_1.AbstractGolemioError) {
38
+ throw err;
39
+ }
40
+ throw new golemio_errors_1.DatasourceError("Error while fetching preset logs", this.constructor.name, err);
41
+ }
42
+ const validLogEntries = this.logFilter.getValidLogEntries(queryResult);
43
+ if (validLogEntries.length > 0) {
44
+ const presetLogDtos = await this.logTransformation.transform(queryResult);
45
+ this.logger.info(`${this.constructor.name}: ${presetLogDtos.length} log entries collected`);
46
+ await this.logRepository.saveData(presetLogDtos);
47
+ }
48
+ else {
49
+ this.logger.warn(`${this.constructor.name}: no valid log entries collected`);
50
+ }
51
+ await queueprocessors_1.QueueManager.sendMessageToExchange(this.queuePrefix, "processAndSendLogs", {});
63
52
  }
64
53
  }
65
54
  exports.CollectAndSaveLogsTask = CollectAndSaveLogsTask;
@@ -1 +1 @@
1
- {"version":3,"file":"CollectAndSaveLogsTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/presets/tasks/CollectAndSaveLogsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA0C;AAC1C,+EAAoE;AAEpE,wEAAqE;AAErE,2FAAqF;AACrF,2EAA6E;AAC7E,6EAAiG;AAEjG,wFAAiF;AAEjF,gEAA6D;AAG7D,uEAA8E;AAG9E,MAAa,sBAAuB,SAAQ,sBAAkC;IAW1E,YAAY,WAAmB;QAC3B,KAAK,CAA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kCAAkC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;aAC7F;YAED,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;YACvE,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC5B,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;gBAC1E,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,aAAa,CAAC,MAAM,wBAAwB,CAAC,CAAC;gBAE5F,MAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;aACpD;iBAAM;gBACH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,kCAAkC,CAAC,CAAC;aAChF;YAED,MAAM,8BAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,oBAAoB,EAAE,EAAE,CAAC,CAAC;QACzF,CAAC;KAAA;CACJ;AAtDD,wDAsDC"}
1
+ {"version":3,"file":"CollectAndSaveLogsTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/presets/tasks/CollectAndSaveLogsTask.ts"],"names":[],"mappings":";;;AAAA,2CAA0C;AAC1C,+EAAoE;AAEpE,wEAAqE;AAErE,2FAAqF;AACrF,2EAA6E;AAC7E,6EAAiG;AAEjG,wFAAiF;AAEjF,gEAA6D;AAG7D,uEAA8E;AAG9E,MAAa,sBAAuB,SAAQ,sBAAkC;IAW1E,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QAXP,cAAS,GAAG,oBAAoB,CAAC;QACjC,aAAQ,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;QACnC,WAAM,GAAG,mDAA6B,CAAC;QAUnD,I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,CAAC;QACvE,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE;YAC5B,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YAC1E,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,aAAa,CAAC,MAAM,wBAAwB,CAAC,CAAC;YAE5F,MAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;SACpD;aAAM;YACH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,kCAAkC,CAAC,CAAC;SAChF;QAED,MAAM,8BAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,oBAAoB,EAAE,EAAE,CAAC,CAAC;IACzF,CAAC;CACJ;AAtDD,wDAsDC"}
@@ -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.DownloadDeparturesPresetsTask = void 0;
25
16
  const DeparturePresetsFacade_1 = require("../../../facade/DeparturePresetsFacade");
@@ -37,22 +28,20 @@ let DownloadDeparturesPresetsTask = exports.DownloadDeparturesPresetsTask = clas
37
28
  this.queueName = "downloadDeparturesPresets";
38
29
  this.queueTtl = 4 * 60 * 1000; // 4 minutes
39
30
  }
40
- execute() {
41
- return __awaiter(this, void 0, void 0, function* () {
42
- try {
43
- const file = yield this.departuresPresetsDataSource.getAll();
44
- const lastModified = yield this.departuresPresetsDataSource.getLastModified();
45
- yield this.facade.handleNewDeparturePresets(file.data, lastModified);
31
+ async execute() {
32
+ try {
33
+ const file = await this.departuresPresetsDataSource.getAll();
34
+ const lastModified = await this.departuresPresetsDataSource.getLastModified();
35
+ await this.facade.handleNewDeparturePresets(file.data, lastModified);
36
+ }
37
+ catch (err) {
38
+ if (err instanceof golemio_errors_1.AbstractGolemioError) {
39
+ throw err;
46
40
  }
47
- catch (err) {
48
- if (err instanceof golemio_errors_1.AbstractGolemioError) {
49
- throw err;
50
- }
51
- else {
52
- throw new golemio_errors_1.GeneralError("Error while downloading departures presets: " + err.message, this.constructor.name, err);
53
- }
41
+ else {
42
+ throw new golemio_errors_1.GeneralError("Error while downloading departures presets: " + err.message, this.constructor.name, err);
54
43
  }
55
- });
44
+ }
56
45
  }
57
46
  };
58
47
  exports.DownloadDeparturesPresetsTask = DownloadDeparturesPresetsTask = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"DownloadDeparturesPresetsTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/presets/tasks/DownloadDeparturesPresetsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,mFAAsF;AACtF,kFAAqF;AACrF,8EAA0E;AAC1E,6EAA8F;AAC9F,iEAAwE;AACxE,4FAAyF;AAEzF,6EAA4C;AAGrC,IAAM,6BAA6B,2CAAnC,MAAM,6BAA8B,SAAQ,sCAAiB;IAIhE,YAEI,2BAAgE,EACR,MAAsC;QAE9F,KAAK,CAAC,sBAAS,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAH5B,gCAA2B,GAA3B,2BAA2B,CAA6B;QACA,WAAM,GAAN,MAAM,CAAwB;QANlG,cAAS,GAAG,2BAA2B,CAAC;QACxC,aAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;IAQtC,CAAC;IAEe,OAAO;;YACnB,IAAI;gBACA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAAC,MAAM,EAAE,CAAC;gBAC7D,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAAC,eAAe,EAAE,CAAC;gBAC9E,MAAM,IAAI,CAAC,MAAM,CAAC,yBAAyB,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;aACxE;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,GAAG,YAAY,qCAAoB,EAAE;oBACrC,MAAM,GAAG,CAAC;iBACb;qBAAM;oBACH,MAAM,IAAI,6BAAY,CAAC,8CAA8C,GAAG,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;iBACpH;aACJ;QACL,CAAC;KAAA;CACJ,CAAA;wCAzBY,6BAA6B;IADzC,IAAA,qBAAU,GAAE;IAMJ,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,2BAA2B,CAAC,CAAA;IAE3D,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,sBAAsB,CAAC,CAAA;qCADlB,yDAA2B;QACQ,+CAAsB;GAPzF,6BAA6B,CAyBzC"}
1
+ {"version":3,"file":"DownloadDeparturesPresetsTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/presets/tasks/DownloadDeparturesPresetsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mFAAsF;AACtF,kFAAqF;AACrF,8EAA0E;AAC1E,6EAA8F;AAC9F,iEAAwE;AACxE,4FAAyF;AAEzF,6EAA4C;AAGrC,IAAM,6BAA6B,2CAAnC,MAAM,6BAA8B,SAAQ,sCAAiB;IAIhE,YAEI,2BAAgE,EACR,MAAsC;QAE9F,KAAK,CAAC,sBAAS,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAH5B,gCAA2B,GAA3B,2BAA2B,CAA6B;QACA,WAAM,GAAN,MAAM,CAAwB;QANlG,cAAS,GAAG,2BAA2B,CAAC;QACxC,aAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;IAQtC,CAAC;IAES,KAAK,CAAC,OAAO;QACnB,IAAI;YACA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAAC,MAAM,EAAE,CAAC;YAC7D,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAAC,eAAe,EAAE,CAAC;YAC9E,MAAM,IAAI,CAAC,MAAM,CAAC,yBAAyB,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;SACxE;QAAC,OAAO,GAAG,EAAE;YACV,IAAI,GAAG,YAAY,qCAAoB,EAAE;gBACrC,MAAM,GAAG,CAAC;aACb;iBAAM;gBACH,MAAM,IAAI,6BAAY,CAAC,8CAA8C,GAAG,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;aACpH;SACJ;IACL,CAAC;CACJ,CAAA;wCAzBY,6BAA6B;IADzC,IAAA,qBAAU,GAAE;IAMJ,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,2BAA2B,CAAC,CAAA;IAE3D,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,sBAAsB,CAAC,CAAA;qCADlB,yDAA2B;QACQ,+CAAsB;GAPzF,6BAA6B,CAyBzC"}
@@ -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.ProcessAndSendLogsTask = void 0;
13
4
  const Di_1 = require("../../../../ioc/Di");
@@ -36,52 +27,48 @@ class ProcessAndSendLogsTask extends workers_1.AbstractEmptyTask {
36
27
  this.lockTimeout = Number.parseInt(lockTimeout);
37
28
  this.refreshInterval = this.lockTimeout * 0.8; // recommended
38
29
  }
39
- execute() {
40
- return __awaiter(this, void 0, void 0, function* () {
41
- const mutex = this.createMutex();
42
- const lockAcquired = yield mutex.tryAcquire();
43
- if (!lockAcquired) {
44
- this.logger.error(`${this.constructor.name}: unable to obtain mutex lock.`);
30
+ async execute() {
31
+ const mutex = this.createMutex();
32
+ const lockAcquired = await mutex.tryAcquire();
33
+ if (!lockAcquired) {
34
+ this.logger.error(`${this.constructor.name}: unable to obtain mutex lock.`);
35
+ return;
36
+ }
37
+ try {
38
+ const logEntries = await this.logRepository.findUnprocessed();
39
+ if (logEntries.length === 0) {
40
+ this.logger.warn(`${this.constructor.name}: no logs found to send to the ROPID monitoring system`);
45
41
  return;
46
42
  }
47
- try {
48
- const logEntries = yield this.logRepository.findUnprocessed();
49
- if (logEntries.length === 0) {
50
- this.logger.warn(`${this.constructor.name}: no logs found to send to the ROPID monitoring system`);
51
- return;
43
+ // Process logs in batches to avoid exceeding the maximum allowed size of the request
44
+ for (let i = 0; i < logEntries.length; i += this.batchSize) {
45
+ try {
46
+ const batchedLogs = logEntries.slice(i, i + this.batchSize);
47
+ await this.processBatch(batchedLogs);
52
48
  }
53
- // Process logs in batches to avoid exceeding the maximum allowed size of the request
54
- for (let i = 0; i < logEntries.length; i += this.batchSize) {
55
- try {
56
- const batchedLogs = logEntries.slice(i, i + this.batchSize);
57
- yield this.processBatch(batchedLogs);
58
- }
59
- catch (err) {
60
- this.logger.warn(err, `${this.constructor.name}: error while processing DCIP system logs`);
61
- }
49
+ catch (err) {
50
+ this.logger.warn(err, `${this.constructor.name}: error while processing DCIP system logs`);
62
51
  }
63
52
  }
64
- finally {
65
- yield mutex.release();
66
- }
67
- });
53
+ }
54
+ finally {
55
+ await mutex.release();
56
+ }
68
57
  }
69
- processBatch(logEntries) {
70
- return __awaiter(this, void 0, void 0, function* () {
71
- let logIds = [];
72
- let logData = [];
73
- for (const logEntry of logEntries) {
74
- const { device_alias, received_at } = logEntry.toJSON();
75
- logIds.push(logEntry.get("id"));
76
- logData.push({
77
- deviceAlias: device_alias,
78
- receivedAt: LogDateTimeUtils_1.LogDateTimeUtils.parseISONoFractionalFromDate(received_at),
79
- });
80
- }
81
- yield this.monitoringService.sendLogsToMonitoringSystem(logData);
82
- this.logger.info(`${this.constructor.name}: ${logData.length} logs sent to the ROPID monitoring system`);
83
- yield this.logRepository.markAsProcessed(logIds);
84
- });
58
+ async processBatch(logEntries) {
59
+ let logIds = [];
60
+ let logData = [];
61
+ for (const logEntry of logEntries) {
62
+ const { device_alias, received_at } = logEntry.toJSON();
63
+ logIds.push(logEntry.get("id"));
64
+ logData.push({
65
+ deviceAlias: device_alias,
66
+ receivedAt: LogDateTimeUtils_1.LogDateTimeUtils.parseISONoFractionalFromDate(received_at),
67
+ });
68
+ }
69
+ await this.monitoringService.sendLogsToMonitoringSystem(logData);
70
+ this.logger.info(`${this.constructor.name}: ${logData.length} logs sent to the ROPID monitoring system`);
71
+ await this.logRepository.markAsProcessed(logIds);
85
72
  }
86
73
  createMutex() {
87
74
  return new redis_semaphore_1.Mutex(this.redisClient.getConnection(), this.LOCK_KEY_PHRASE, {
@@ -1 +1 @@
1
- {"version":3,"file":"ProcessAndSendLogsTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/presets/tasks/ProcessAndSendLogsTask.ts"],"names":[],"m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I,OAAO,GAA6B,EAAE,CAAC;YAE3C,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE;gBAC/B,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAExD,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAW,CAAC,CAAC;gBAC1C,OAAO,CAAC,IAAI,CAAC;oBACT,WAAW,EAAE,YAAY;oBACzB,UAAU,EAAE,mCAAgB,CAAC,4BAA4B,CAAC,WAAW,CAAC;iBACzE,CAAC,CAAC;aACN;YAED,MAAM,IAAI,CAAC,iBAAiB,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM,2CAA2C,CAAC,CAAC;YACzG,MAAM,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QACrD,CAAC;KAAA;IAEO,WAAW;QACf,OAAO,IAAI,uBAAK,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,EAAE,IAAI,CAAC,eAAe,EAAE;YACrE,oBAAoB,EAAE,CAAC;YACvB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE;gBAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,uBAAuB,CAAC,CAAC;YAC5E,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;CACJ;AAzFD,wDAyFC"}
1
+ {"version":3,"file":"ProcessAndSendLogsTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/presets/tasks/ProcessAndSendLogsTask.ts"],"names":[],"mappings":";;;AAAA,2CAA0C;AAC1C,+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