@golemio/pid 5.2.2-dev.2217110065 → 5.2.2-dev.2224364329

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 (212) hide show
  1. package/dist/helpers/library-types/opentelemetry.d.ts +3 -0
  2. package/dist/{schema-definitions/vehicle-positions/models/interfaces/IV1PositionDto.js → helpers/library-types/opentelemetry.js} +1 -1
  3. package/dist/helpers/library-types/opentelemetry.js.map +1 -0
  4. package/dist/integration-engine/jis/repositories/RopidDeparturesPresetsRopidGTFSStopsRepository.d.ts +1 -1
  5. package/dist/integration-engine/ropid-gtfs/RopidGTFSTripsModel.js +6 -4
  6. package/dist/integration-engine/ropid-gtfs/RopidGTFSTripsModel.js.map +1 -1
  7. package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.d.ts +0 -7
  8. package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.js +1 -9
  9. package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.js.map +1 -1
  10. package/dist/integration-engine/ropid-gtfs/RopidGtfsMetadataRepository.d.ts +0 -7
  11. package/dist/integration-engine/ropid-gtfs/RopidGtfsMetadataRepository.js +1 -9
  12. package/dist/integration-engine/ropid-gtfs/RopidGtfsMetadataRepository.js.map +1 -1
  13. package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.d.ts +2 -2
  14. package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.js +11 -11
  15. package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.js.map +1 -1
  16. package/dist/integration-engine/ropid-gtfs/helpers/DatasetEnum.d.ts +7 -0
  17. package/dist/integration-engine/ropid-gtfs/helpers/DatasetEnum.js +12 -0
  18. package/dist/integration-engine/ropid-gtfs/helpers/DatasetEnum.js.map +1 -0
  19. package/dist/integration-engine/ropid-gtfs/workers/presets/data-access/DeparturesPresetsDatasource.js.map +1 -1
  20. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CheckForNewDeparturesPresetsTask.js +4 -4
  21. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CheckForNewDeparturesPresetsTask.js.map +1 -1
  22. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/DownloadDatasetsTask.js +5 -5
  23. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/DownloadDatasetsTask.js.map +1 -1
  24. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/TransformAndSaveDataTask.js +6 -6
  25. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/TransformAndSaveDataTask.js.map +1 -1
  26. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/HelperTypes.d.ts +1 -1
  27. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/HelperTypes.js +5 -5
  28. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/HelperTypes.js.map +1 -1
  29. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.d.ts +1 -1
  30. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js +8 -8
  31. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js.map +1 -1
  32. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/CachedDatasetSchema.js +2 -2
  33. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/CachedDatasetSchema.js.map +1 -1
  34. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/DownloadDataInputSchema.js +2 -2
  35. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/DownloadDataInputSchema.js.map +1 -1
  36. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/VehicleIdGenerator.d.ts +1 -1
  37. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/VehicleIdGenerator.js +1 -1
  38. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/VehicleIdGenerator.js.map +1 -1
  39. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.d.ts +1 -1
  40. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js.map +1 -1
  41. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/TripsMapper.js +1 -1
  42. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/TripsMapper.js.map +1 -1
  43. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/interfaces/TripRepositoryInterfaces.d.ts +1 -1
  44. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/domain/service/IGtfsTripDataFixerFactory.d.ts +1 -1
  45. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-data/GtfsTripDataFixerFactory.d.ts +1 -1
  46. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-data/GtfsTripDataFixerFactory.js +1 -1
  47. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-data/GtfsTripDataFixerFactory.js.map +1 -1
  48. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-data/strategy/HttpGtfsTripDataFixer.js +1 -1
  49. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-data/strategy/HttpGtfsTripDataFixer.js.map +1 -1
  50. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/AbstractGTFSTripRunManager.d.ts +1 -0
  51. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/AbstractGTFSTripRunManager.js.map +1 -1
  52. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripCommonRunManager.d.ts +1 -0
  53. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripCommonRunManager.js.map +1 -1
  54. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripMetroRunManager.d.ts +1 -0
  55. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripMetroRunManager.js.map +1 -1
  56. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/interfaces/ITimeWindow.d.ts +1 -1
  57. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/interfaces/ITimeWindow.js +1 -0
  58. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/gtfs-trip-run/GtfsTripRegionalBusRunManager.d.ts +1 -0
  59. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/gtfs-trip-run/GtfsTripRegionalBusRunManager.js +3 -3
  60. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/gtfs-trip-run/GtfsTripRegionalBusRunManager.js.map +1 -1
  61. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/interfaces/TransformationInterfaces.d.ts +6 -4
  62. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshGtfsTripDataTask.js +1 -1
  63. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshGtfsTripDataTask.js.map +1 -1
  64. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.d.ts +2 -0
  65. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.js +37 -1
  66. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.js.map +1 -1
  67. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.d.ts +17 -14
  68. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js +200 -108
  69. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js.map +1 -1
  70. package/dist/output-gateway/pid/controllers/v2/V2DepartureBoardsController.js +1 -1
  71. package/dist/output-gateway/pid/controllers/v2/V2DepartureBoardsController.js.map +1 -1
  72. package/dist/output-gateway/pid/controllers/v3/V3TransferBoardsController.js +1 -1
  73. package/dist/output-gateway/pid/controllers/v3/V3TransferBoardsController.js.map +1 -1
  74. package/dist/output-gateway/pid/controllers/v4/V4TransferBoardsController.d.ts +2 -2
  75. package/dist/output-gateway/pid/controllers/v4/V4TransferBoardsController.js +7 -7
  76. package/dist/output-gateway/pid/controllers/v4/V4TransferBoardsController.js.map +1 -1
  77. package/dist/output-gateway/pid/data-access/DeparturesRepository.d.ts +2 -1
  78. package/dist/output-gateway/pid/data-access/DeparturesRepository.js +2 -2
  79. package/dist/output-gateway/pid/data-access/DeparturesRepository.js.map +1 -1
  80. package/dist/output-gateway/pid/data-access/interfaces/DepartureInterfaces.d.ts +1 -1
  81. package/dist/output-gateway/pid/domain/DepartureInterfaces.d.ts +2 -1
  82. package/dist/output-gateway/pid/dto/DepartureBoardsDTO.d.ts +5 -1
  83. package/dist/output-gateway/pid/dto/DepartureBoardsDTO.js +6 -4
  84. package/dist/output-gateway/pid/dto/DepartureBoardsDTO.js.map +1 -1
  85. package/dist/output-gateway/pid/dto/interfaces/IDepartureBoardsQueryDTO.d.ts +4 -1
  86. package/dist/output-gateway/pid/helpers/DepartureBoardMapper.d.ts +1 -1
  87. package/dist/output-gateway/pid/helpers/DepartureBoardMapper.js +4 -4
  88. package/dist/output-gateway/pid/helpers/DepartureBoardMapper.js.map +1 -1
  89. package/dist/output-gateway/pid/helpers/JISInfotextStopSuppressionFilter.js +1 -1
  90. package/dist/output-gateway/pid/helpers/JISInfotextStopSuppressionFilter.js.map +1 -1
  91. package/dist/output-gateway/pid/helpers/TransferBoardFilter.d.ts +2 -1
  92. package/dist/output-gateway/pid/helpers/TransferBoardFilter.js.map +1 -1
  93. package/dist/output-gateway/pid/helpers/TransferBoardIconsResolver.d.ts +1 -1
  94. package/dist/output-gateway/pid/helpers/TransferBoardSorter.d.ts +1 -1
  95. package/dist/output-gateway/pid/helpers/enums/DepartureFilter.d.ts +9 -0
  96. package/dist/output-gateway/pid/helpers/enums/DepartureFilter.js +14 -0
  97. package/dist/output-gateway/pid/helpers/enums/DepartureFilter.js.map +1 -0
  98. package/dist/output-gateway/pid/helpers/enums/DepartureMode.d.ts +5 -0
  99. package/dist/output-gateway/pid/helpers/enums/DepartureMode.js +10 -0
  100. package/dist/output-gateway/pid/helpers/enums/DepartureMode.js.map +1 -0
  101. package/dist/output-gateway/pid/helpers/enums/DepartureOrder.d.ts +4 -0
  102. package/dist/output-gateway/pid/helpers/enums/DepartureOrder.js +9 -0
  103. package/dist/output-gateway/pid/helpers/enums/DepartureOrder.js.map +1 -0
  104. package/dist/output-gateway/pid/helpers/enums/DepartureSkip.d.ts +6 -0
  105. package/dist/output-gateway/pid/helpers/enums/DepartureSkip.js +11 -0
  106. package/dist/output-gateway/pid/helpers/enums/DepartureSkip.js.map +1 -0
  107. package/dist/output-gateway/pid/index.d.ts +1 -208
  108. package/dist/output-gateway/pid/index.js +1 -31
  109. package/dist/output-gateway/pid/index.js.map +1 -1
  110. package/dist/output-gateway/pid/interfaces/DepartureUnion.d.ts +3 -0
  111. package/dist/{schema-definitions/jis/models/interfaces/IPresetsGtfsStops.js → output-gateway/pid/interfaces/DepartureUnion.js} +1 -1
  112. package/dist/output-gateway/pid/interfaces/DepartureUnion.js.map +1 -0
  113. package/dist/output-gateway/pid/interfaces/ICurrentTrip.d.ts +8 -0
  114. package/dist/output-gateway/pid/interfaces/ICurrentTrip.js +3 -0
  115. package/dist/output-gateway/pid/interfaces/ICurrentTrip.js.map +1 -0
  116. package/dist/output-gateway/pid/interfaces/IDepartureTime.d.ts +5 -0
  117. package/dist/output-gateway/pid/interfaces/IDepartureTime.js +3 -0
  118. package/dist/output-gateway/pid/interfaces/IDepartureTime.js.map +1 -0
  119. package/dist/output-gateway/pid/interfaces/IDepartureWithPosition.d.ts +12 -0
  120. package/dist/output-gateway/pid/interfaces/IDepartureWithPosition.js +3 -0
  121. package/dist/output-gateway/pid/interfaces/IDepartureWithPosition.js.map +1 -0
  122. package/dist/output-gateway/pid/interfaces/IPIDDeparture.d.ts +43 -0
  123. package/dist/output-gateway/pid/interfaces/IPIDDeparture.js +3 -0
  124. package/dist/output-gateway/pid/interfaces/IPIDDeparture.js.map +1 -0
  125. package/dist/output-gateway/pid/interfaces/IPIDDepartureOutput.d.ts +36 -0
  126. package/dist/output-gateway/pid/interfaces/IPIDDepartureOutput.js +3 -0
  127. package/dist/output-gateway/pid/interfaces/IPIDDepartureOutput.js.map +1 -0
  128. package/dist/output-gateway/pid/interfaces/IStop.d.ts +5 -0
  129. package/dist/{schema-definitions/vehicle-positions/models/interfaces/IV1TripDto.js → output-gateway/pid/interfaces/IStop.js} +1 -1
  130. package/dist/output-gateway/pid/interfaces/IStop.js.map +1 -0
  131. package/dist/output-gateway/pid/interfaces/ITransferAccessibility.d.ts +8 -0
  132. package/dist/output-gateway/pid/interfaces/ITransferAccessibility.js +3 -0
  133. package/dist/output-gateway/pid/interfaces/ITransferAccessibility.js.map +1 -0
  134. package/dist/output-gateway/pid/interfaces/ITransferDeparture.d.ts +17 -0
  135. package/dist/output-gateway/pid/interfaces/ITransferDeparture.js +3 -0
  136. package/dist/output-gateway/pid/interfaces/ITransferDeparture.js.map +1 -0
  137. package/dist/output-gateway/pid/interfaces/ITransferOutputDto.d.ts +15 -0
  138. package/dist/output-gateway/pid/interfaces/ITransferOutputDto.js +3 -0
  139. package/dist/output-gateway/pid/interfaces/ITransferOutputDto.js.map +1 -0
  140. package/dist/output-gateway/pid/interfaces/IV4TransferDepartureOutputDto.d.ts +22 -0
  141. package/dist/output-gateway/pid/interfaces/IV4TransferDepartureOutputDto.js +3 -0
  142. package/dist/output-gateway/pid/interfaces/IV4TransferDepartureOutputDto.js.map +1 -0
  143. package/dist/output-gateway/pid/interfaces/IV4TransferDto.d.ts +9 -0
  144. package/dist/output-gateway/pid/interfaces/IV4TransferDto.js +3 -0
  145. package/dist/output-gateway/pid/interfaces/IV4TransferDto.js.map +1 -0
  146. package/dist/output-gateway/pid/interfaces/IV4TransferOutputDto.d.ts +9 -0
  147. package/dist/output-gateway/pid/interfaces/IV4TransferOutputDto.js +3 -0
  148. package/dist/output-gateway/pid/interfaces/IV4TransferOutputDto.js.map +1 -0
  149. package/dist/output-gateway/pid/interfaces/TransferStops.d.ts +5 -0
  150. package/dist/output-gateway/pid/interfaces/TransferStops.js +3 -0
  151. package/dist/output-gateway/pid/interfaces/TransferStops.js.map +1 -0
  152. package/dist/output-gateway/pid/interfaces/TripsToTransfers.d.ts +2 -0
  153. package/dist/output-gateway/pid/interfaces/TripsToTransfers.js +3 -0
  154. package/dist/output-gateway/pid/interfaces/TripsToTransfers.js.map +1 -0
  155. package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js +4 -4
  156. package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js.map +1 -1
  157. package/dist/output-gateway/pid/models/helpers/FilterHelper.d.ts +2 -1
  158. package/dist/output-gateway/pid/models/helpers/FilterHelper.js +4 -4
  159. package/dist/output-gateway/pid/models/helpers/FilterHelper.js.map +1 -1
  160. package/dist/output-gateway/pid/models/helpers/PIDDepartureModel.d.ts +3 -1
  161. package/dist/output-gateway/pid/models/helpers/PIDDepartureModel.js +10 -8
  162. package/dist/output-gateway/pid/models/helpers/PIDDepartureModel.js.map +1 -1
  163. package/dist/output-gateway/pid/models/helpers/SkipHelper.d.ts +1 -1
  164. package/dist/output-gateway/pid/models/helpers/interfaces/IPIDDepartureQueryOptions.d.ts +4 -1
  165. package/dist/output-gateway/pid/models/interfaces/IGetDeparturesOptions.d.ts +4 -1
  166. package/dist/output-gateway/pid/service/facade/TransferFacade.d.ts +6 -2
  167. package/dist/output-gateway/pid/service/facade/TransferFacade.js +12 -9
  168. package/dist/output-gateway/pid/service/facade/TransferFacade.js.map +1 -1
  169. package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.d.ts +2 -1
  170. package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.js +1 -1
  171. package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.js.map +1 -1
  172. package/dist/output-gateway/pid/service/transformations/TransferDepartureTransformation.d.ts +2 -1
  173. package/dist/output-gateway/pid/service/transformations/TransferDepartureTransformation.js +1 -1
  174. package/dist/output-gateway/pid/service/transformations/TransferDepartureTransformation.js.map +1 -1
  175. package/dist/output-gateway/ropid-gtfs/models/GTFSCalendarModel.d.ts +1 -1
  176. package/dist/output-gateway/ropid-gtfs/models/GTFSCalendarModel.js +10 -11
  177. package/dist/output-gateway/ropid-gtfs/models/GTFSCalendarModel.js.map +1 -1
  178. package/dist/output-gateway/ropid-gtfs/models/GTFSShapesModel.d.ts +1 -1
  179. package/dist/output-gateway/ropid-gtfs/models/GTFSShapesModel.js.map +1 -1
  180. package/dist/output-gateway/ropid-gtfs/models/GTFSStopModel.js +1 -1
  181. package/dist/output-gateway/ropid-gtfs/models/GTFSStopModel.js.map +1 -1
  182. package/dist/output-gateway/ropid-gtfs/models/GTFSStopModelInterfaces.d.ts +1 -1
  183. package/dist/output-gateway/ropid-gtfs/models/GTFSStopTimesModel.d.ts +1 -1
  184. package/dist/output-gateway/ropid-gtfs/models/GTFSStopTimesModel.js +1 -1
  185. package/dist/output-gateway/ropid-gtfs/models/GTFSStopTimesModel.js.map +1 -1
  186. package/dist/output-gateway/ropid-gtfs/models/GTFSTripsModel.d.ts +2 -1
  187. package/dist/output-gateway/ropid-gtfs/models/GTFSTripsModel.js.map +1 -1
  188. package/dist/output-gateway/ropid-gtfs/models/index.d.ts +2 -3
  189. package/dist/output-gateway/ropid-gtfs/models/index.js +1 -2
  190. package/dist/output-gateway/ropid-gtfs/models/index.js.map +1 -1
  191. package/dist/output-gateway/ropid-gtfs/models/interfaces/IGTFSModels.d.ts +9 -0
  192. package/dist/output-gateway/ropid-gtfs/models/interfaces/IGTFSModels.js +3 -0
  193. package/dist/output-gateway/ropid-gtfs/models/interfaces/IGTFSModels.js.map +1 -0
  194. package/dist/schema-definitions/jis/models/RopidDeparturesPresetsRopidGTFSStopsModel.d.ts +1 -1
  195. package/dist/schema-definitions/jis/models/interfaces/IPresetsRopidGTFSStops.d.ts +1 -4
  196. package/dist/schema-definitions/vehicle-positions/models/enums/ProviderSourceTypeEnum.js.map +1 -0
  197. package/dist/schema-definitions/vehicle-positions/models/interfaces/IGtfsRtTripDto.d.ts +2 -2
  198. package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.d.ts +1 -1
  199. package/dist/schema-definitions/vehicle-positions/models/views/interfaces/IPublicStopTimeDto.d.ts +1 -1
  200. package/package.json +4 -2
  201. package/dist/_helpers_/db-integration-setup.d.ts +0 -2
  202. package/dist/_helpers_/db-integration-setup.js +0 -11
  203. package/dist/_helpers_/db-integration-setup.js.map +0 -1
  204. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/ProviderSourceTypeEnum.js.map +0 -1
  205. package/dist/schema-definitions/jis/models/interfaces/IPresetsGtfsStops.d.ts +0 -4
  206. package/dist/schema-definitions/jis/models/interfaces/IPresetsGtfsStops.js.map +0 -1
  207. package/dist/schema-definitions/vehicle-positions/models/interfaces/IV1PositionDto.d.ts +0 -21
  208. package/dist/schema-definitions/vehicle-positions/models/interfaces/IV1PositionDto.js.map +0 -1
  209. package/dist/schema-definitions/vehicle-positions/models/interfaces/IV1TripDto.d.ts +0 -20
  210. package/dist/schema-definitions/vehicle-positions/models/interfaces/IV1TripDto.js.map +0 -1
  211. /package/dist/{integration-engine/vehicle-positions/workers/vehicle-positions/helpers → schema-definitions/vehicle-positions/models/enums}/ProviderSourceTypeEnum.d.ts +0 -0
  212. /package/dist/{integration-engine/vehicle-positions/workers/vehicle-positions/helpers → schema-definitions/vehicle-positions/models/enums}/ProviderSourceTypeEnum.js +0 -0
@@ -14,6 +14,8 @@ const TripsRepository_1 = require("../data-access/TripsRepository");
14
14
  const TripsMapper_1 = __importDefault(require("../data-access/helpers/TripsMapper"));
15
15
  const SaveDataToDBSchema_1 = require("../schema/SaveDataToDBSchema");
16
16
  const MpvMessageTransformation_1 = require("../transformations/MpvMessageTransformation");
17
+ const RopidGTFSCisStopsModel_1 = require("../../../../ropid-gtfs/RopidGTFSCisStopsModel");
18
+ const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
17
19
  class SaveDataToDBTask extends workers_1.AbstractTask {
18
20
  constructor(queuePrefix) {
19
21
  super(queuePrefix);
@@ -23,11 +25,14 @@ class SaveDataToDBTask extends workers_1.AbstractTask {
23
25
  this.tripsRepository = new TripsRepository_1.TripsRepository();
24
26
  this.cisStopRepository = new CisStopRepository_1.CisStopRepository();
25
27
  this.messageTransformation = new MpvMessageTransformation_1.MpvMessageTransformation();
28
+ this.ropidGTFSCisStopsModel = new RopidGTFSCisStopsModel_1.RopidGTFSCisStopsModel();
26
29
  this.logger = ioc_1.IntegrationEngineContainer.resolve(CoreToken_1.CoreToken.Logger);
27
30
  }
28
31
  async execute(data, messageProperties) {
29
32
  const taskStartTimestamp = new Date().getTime();
30
- const { trips, positions, stops } = await this.messageTransformation.transform(data.m.spoj);
33
+ const now = MpvMessageTransformation_1.MpvMessageTransformation.currentTimeInPrague();
34
+ const nowFormatted = MpvMessageTransformation_1.MpvMessageTransformation.currentTimeInPragueFormatted(now);
35
+ const { trips, positions, stops, tripsWithCisStops } = await this.messageTransformation.transform(data.m.spoj);
31
36
  const tripEntities = await this.tripsRepository.bulkSave(trips,
32
37
  // Ignore incoming start_timestamp for existing trips to avoid overwriting existing computed timestamp
33
38
  // TODO this is a workaround, dedicated column (gtfs_start_timestamp) will be added
@@ -35,6 +40,8 @@ class SaveDataToDBTask extends workers_1.AbstractTask {
35
40
  .filter((key) => key !== "start_timestamp")
36
41
  .concat("updated_at"), true);
37
42
  const { inserted, updated } = TripsMapper_1.default.mapTripEntitiesToUpdateDto(tripEntities, taskStartTimestamp);
43
+ const positionsToAppend = await this.preparePositionsFromCisStops(tripsWithCisStops, nowFormatted, now);
44
+ positions.push(...positionsToAppend);
38
45
  // At this point we want to send ACK to rabbit and let the rest of the processing to be done in the background
39
46
  await this.sendDataToUpdateGtfsTripId(inserted, positions, messageProperties?.timestamp);
40
47
  await this.sendDataToUpdateDelay(updated, positions, messageProperties?.timestamp);
@@ -118,6 +125,35 @@ class SaveDataToDBTask extends workers_1.AbstractTask {
118
125
  }
119
126
  }
120
127
  }
128
+ async preparePositionsFromCisStops(tripsWithCisStops, tsText, ts) {
129
+ if (!tripsWithCisStops?.size) {
130
+ return [];
131
+ }
132
+ const newPositions = [];
133
+ const cisList = new Set();
134
+ const cisToTrips = new Map();
135
+ for (const [tripId, cisStop] of tripsWithCisStops.entries()) {
136
+ cisList.add(cisStop);
137
+ cisToTrips.set(cisStop, (cisToTrips.get(cisStop) ?? []).concat([tripId]));
138
+ }
139
+ const rawCisStops = await this.ropidGTFSCisStopsModel.find({
140
+ where: {
141
+ cis: { [sequelize_1.Op.in]: Array.from(cisList) },
142
+ id: { [sequelize_1.Op.like]: `%/301` }, // We want only asw-code like XYZ/301
143
+ },
144
+ attributes: ["cis", "lat", "lon"],
145
+ raw: true,
146
+ });
147
+ for (const cisStop of rawCisStops) {
148
+ if (cisList.has(cisStop.cis) && cisToTrips.has(cisStop.cis)) {
149
+ cisList.delete(cisStop.cis); // prevents to create positions for the same cis stop returning multiple rows
150
+ for (const tripId of cisToTrips.get(cisStop.cis)) {
151
+ newPositions.push(this.messageTransformation.positionWithCisStopCoords(tripId, cisStop.lat, cisStop.lon, tsText, ts));
152
+ }
153
+ }
154
+ }
155
+ return newPositions;
156
+ }
121
157
  async getTripDataAndSendToUpdateDelay(chunk, positions, firstMessageCreatedAt) {
122
158
  try {
123
159
  const updatedTrips = await this.tripsRepository.findAllAssocTripIds(chunk);
@@ -1 +1 @@
1
- {"version":3,"file":"SaveDataToDBTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataTo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IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC7B,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,MAAM,CAAC,KAAK,CACb,IAAI,6BAAY,CACZ,0CAA0C,EAC1C,gBAAgB,CAAC,IAAI,EACrB,KAAK,EACL,SAAS,EACT,KAAK,EACL,IAAI,CAAC,SAAS,CACjB,CACJ,CAAC;YACN,CAAC;QACL,CAAC;IACL,CAAC;IAEO,KAAK,CAAC,+BAA+B,CACzC,KAAe,EACf,SAA0C,EAC1C,qBAA8B;QAE9B,IAAI,CAAC;YACD,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;YAC3E,MAAM,8BAAY,CAAC,qBAAqB,CACpC,IAAI,CAAC,WAAW,EAChB,aAAa,EACb;gBACI,YAAY;gBACZ,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;aAC/E,EACD;gBACI,SAAS,EAAE,qBAAqB;aACnC,CACJ,CAAC;QACN,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,KAAK,YAAY,qCAAoB,EAAE,CAAC;gBACxC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC7B,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,MAAM,CAAC,KAAK,CACb,IAAI,6BAAY,CACZ,0CAA0C,EAC1C,gBAAgB,CAAC,IAAI,EACrB,KAAK,EACL,SAAS,EACT,KAAK,EACL,IAAI,CAAC,SAAS,CACjB,CACJ,CAAC;YACN,CAAC;QACL,CAAC;IACL,CAAC;CACJ;AA3LD,4CA2LC"}
1
+ {"version":3,"file":"SaveDataToDBTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveData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,CAAC,WAAW,EAChB,aAAa,EACb;gBACI,YAAY;gBACZ,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;aAC/E,EACD;gBACI,SAAS,EAAE,qBAAqB;aACnC,CACJ,CAAC;QACN,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,KAAK,YAAY,qCAAoB,EAAE,CAAC;gBACxC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC7B,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,MAAM,CAAC,KAAK,CACb,IAAI,6BAAY,CACZ,0CAA0C,EAC1C,gBAAgB,CAAC,IAAI,EACrB,KAAK,EACL,SAAS,EACT,KAAK,EACL,IAAI,CAAC,SAAS,CACjB,CACJ,CAAC;YACN,CAAC;QACL,CAAC;IACL,CAAC;CACJ;AA1OD,4CA0OC"}
@@ -1,18 +1,19 @@
1
- import { BaseTransformation, ITransformation } from "@golemio/core/dist/integration-engine/transformations";
2
- import { Moment } from "@golemio/core/dist/shared/moment-timezone";
3
1
  import { IMpvPositionContent } from "../../../../../schema-definitions/vehicle-positions/interfaces/IMpvMessageInterfaces";
4
- import { ITransformationElement, ITransformationResult } from "../interfaces/TransformationInterfaces";
2
+ import { BaseTransformation, ITransformation } from "@golemio/core/dist/integration-engine/transformations";
3
+ import moment, { Moment } from "@golemio/core/dist/shared/moment-timezone";
4
+ import { IPositionTransformationResult, ITransformationElement, ITransformationResult } from "../interfaces/TransformationInterfaces";
5
5
  export declare class MpvMessageTransformation extends BaseTransformation implements ITransformation {
6
6
  private static ORIGIN_TIME_FORMAT;
7
- name: string;
7
+ private static readonly CIS_PLATFORM_ELIGIBLE;
8
8
  private config;
9
9
  private skipAgencyNames;
10
+ name: string;
10
11
  constructor();
11
12
  /**
12
13
  * Overrides BaseTransformation::transform
13
14
  */
14
15
  transform: (data: IMpvPositionContent | IMpvPositionContent[]) => Promise<ITransformationResult>;
15
- protected transformElement: (element: IMpvPositionContent) => Promise<ITransformationElement | null>;
16
+ protected transformElement: (element: IMpvPositionContent) => ITransformationElement | null;
16
17
  /**
17
18
  * Deduce UTC timestamp of start of trip and UTC timestamp of current position
18
19
  *
@@ -20,10 +21,13 @@ export declare class MpvMessageTransformation extends BaseTransformation impleme
20
21
  * @param {string} positionTimestampXML - XML attribute of local timestamp of position (HH:mm:ss)
21
22
  * @returns {{ startTimestamp: Moment; positionTimestamp: Moment }}
22
23
  */
23
- protected deduceTimestamps: (firstStopXML: any, positionTimestampXML: string) => Promise<{
24
+ protected deduceTimestamps(firstStopXML: any, positionTimestampXML: string | null): {
24
25
  startTimestamp: Moment;
25
26
  positionTimestamp: Moment;
26
- }>;
27
+ };
28
+ static currentTimeInPrague(): moment.Moment;
29
+ static currentTimeInPragueFormatted(now?: moment.Moment): string;
30
+ private isCisPlatformEligible;
27
31
  /**
28
32
  * Returns -1 if start hour is 12-23 and now is 0-12, 1 if start hour is 18-23 and now 0-6, else 0
29
33
  *
@@ -33,6 +37,8 @@ export declare class MpvMessageTransformation extends BaseTransformation impleme
33
37
  */
34
38
  private checkMidnight;
35
39
  private isBlacklistedAgency;
40
+ private isTrainBeforeTrackWithPlatforms;
41
+ private determinePrimaryKey;
36
42
  /**
37
43
  * Fix source negative bearing value due to overflow by adding 256
38
44
  *
@@ -40,11 +46,8 @@ export declare class MpvMessageTransformation extends BaseTransformation impleme
40
46
  * @returns {number}
41
47
  */
42
48
  private fixSourceNegativeBearing;
43
- /**
44
- * Format input stop id from DPP agency (XXX000Y to XXX/Y) to ASW id
45
- *
46
- * @param {string} stopId
47
- * @returns {stringList}
48
- */
49
- private formatASWStopId;
49
+ private extractStopsForTrain;
50
+ positionWithCisStopCoords(id: string, lat: string, lng: string, cpoz: string, positionTimestamp: moment.Moment): IPositionTransformationResult;
51
+ private determinePosition;
52
+ private determineTrip;
50
53
  }
@@ -4,16 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.MpvMessageTransformation = void 0;
7
+ const RouteTypeEnums_1 = require("../../../../../helpers/RouteTypeEnums");
7
8
  const vehicle_positions_1 = require("../../../../../schema-definitions/vehicle-positions");
9
+ const ProviderSourceTypeEnum_1 = require("../../../../../schema-definitions/vehicle-positions/models/enums/ProviderSourceTypeEnum");
8
10
  const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
9
11
  const Di_1 = require("@golemio/core/dist/integration-engine/ioc/Di");
10
12
  const transformations_1 = require("@golemio/core/dist/integration-engine/transformations");
11
13
  const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
12
14
  const const_1 = require("../../../../../const");
13
15
  const DPPUtils_1 = __importDefault(require("../helpers/DPPUtils"));
14
- const ProviderSourceTypeEnum_1 = require("../helpers/ProviderSourceTypeEnum");
15
16
  const MpvStopParser_1 = require("../helpers/mpv-net/MpvStopParser");
16
- const RouteTypeEnums_1 = require("../../../../../helpers/RouteTypeEnums");
17
17
  var PositionTrackingEnum;
18
18
  (function (PositionTrackingEnum) {
19
19
  PositionTrackingEnum["NOT_TRACKING"] = "0";
@@ -33,51 +33,71 @@ class MpvMessageTransformation extends transformations_1.BaseTransformation {
33
33
  positions: [],
34
34
  stops: [],
35
35
  trips: [],
36
+ tripsWithCisStops: new Map(),
36
37
  };
37
38
  if (!Array.isArray(data))
38
39
  data = [data];
39
40
  for (const element of data) {
40
- const elemRes = await this.transformElement(element);
41
- if (elemRes) {
41
+ const elemRes = this.transformElement(element);
42
+ if (!elemRes) {
43
+ continue;
44
+ }
45
+ if (elemRes.position) {
42
46
  res.positions.push(elemRes.position);
47
+ }
48
+ if (elemRes.trip) {
43
49
  trips.set(elemRes.trip.id, elemRes.trip);
44
- for (const [key, value] of elemRes.stops) {
45
- stops.set(key, value);
46
- }
50
+ }
51
+ if (elemRes.tripToCis && elemRes.trip) {
52
+ res.tripsWithCisStops.set(elemRes.trip.id, elemRes.tripToCis);
53
+ }
54
+ for (const [key, value] of elemRes.stops) {
55
+ stops.set(key, value);
47
56
  }
48
57
  }
49
58
  res.trips = Array.from(trips.values());
50
59
  res.stops = Array.from(stops.values());
51
60
  return res;
52
61
  };
53
- this.transformElement = async (element) => {
62
+ this.transformElement = (element) => {
54
63
  const attributes = element.$;
64
+ if (this.isBlacklistedAgency(attributes.dopr)) {
65
+ return null;
66
+ }
67
+ if (this.isTrainBeforeTrackWithPlatforms(attributes, element.zast)) {
68
+ const { startTimestamp } = this.deduceTimestamps(element.zast[0], null);
69
+ const id = this.determinePrimaryKey(attributes, startTimestamp.utc().format());
70
+ const stops = this.extractStopsForTrain(id, element.zast);
71
+ const firstStop = Array.from(stops.values()).at(0);
72
+ return {
73
+ position: null,
74
+ stops,
75
+ trip: this.determineTrip(attributes, parseInt(attributes.spoj, 10), id, startTimestamp, element.zast[0]),
76
+ tripToCis: firstStop?.cis_stop_group_id ?? null,
77
+ };
78
+ }
55
79
  // Trips with null cpoz (origin time) and falsy or "false" zrus (cancellation) attributes are excluded
56
80
  let hasInvalidAttributes = !attributes.cpoz && (!attributes.zrus || attributes.zrus === "false");
57
81
  // Trips without the CIS trip number are excluded
58
82
  hasInvalidAttributes ||= typeof attributes.spoj === "undefined" || attributes.spoj === "";
59
83
  // Canceled trips with no lat or lng are accepted because we try to later get the coords from the context if possible
60
84
  hasInvalidAttributes ||= attributes.zrus !== "true" && (!attributes.lat || !attributes.lng);
61
- if (this.isBlacklistedAgency(attributes.dopr) || hasInvalidAttributes) {
85
+ const cisTripNumber = parseInt(attributes.spoj, 10);
86
+ // wrong spoj number, no chance to continue
87
+ hasInvalidAttributes ||= isNaN(cisTripNumber);
88
+ if (hasInvalidAttributes) {
62
89
  return null;
63
90
  }
64
91
  attributes.lin = attributes.lin || "none";
65
92
  attributes.alias = attributes.alias || "none";
66
- attributes.cpoz = attributes.cpoz || moment_timezone_1.default.tz("Europe/Prague").format(MpvMessageTransformation.ORIGIN_TIME_FORMAT);
67
- const cisTripNumber = parseInt(attributes.spoj, 10);
68
- if (isNaN(cisTripNumber)) {
69
- return null;
70
- }
93
+ attributes.cpoz = attributes.cpoz || MpvMessageTransformation.currentTimeInPragueFormatted();
71
94
  const stops = element.zast;
72
- const { startTimestamp, positionTimestamp } = await this.deduceTimestamps(stops[0], attributes.cpoz);
95
+ const { startTimestamp, positionTimestamp } = this.deduceTimestamps(stops[0], attributes.cpoz);
73
96
  // filter out position with future time (set to be far than 5 minutes from now)
74
97
  if ((0, moment_timezone_1.default)(positionTimestamp).isAfter((0, moment_timezone_1.default)().add(5, "minutes"))) {
75
98
  return null;
76
99
  }
77
- // primary key for t = 0 (vehicle type is train) -> start_timestamp, cis_number
78
- // primary key for t != 0 -> start_timestamp, cis_id, cis_short_name, cis_number
79
- const primaryKeySuffix = attributes.t === "0" ? `_${attributes.spoj}` : `_${attributes.lin}` + `_${attributes.alias}` + `_${attributes.spoj}`;
80
- const primaryKey = startTimestamp.utc().format() + primaryKeySuffix;
100
+ const primaryKey = this.determinePrimaryKey(attributes, startTimestamp.utc().format());
81
101
  /*
82
102
  MPV route types:
83
103
 
@@ -100,50 +120,11 @@ class MpvMessageTransformation extends transformations_1.BaseTransformation {
100
120
  Ostatní: 17
101
121
  Trolejbus: 18
102
122
  */
103
- const bearing = attributes.azimut;
104
- const speed = attributes.rychl;
105
- const aswLastStopId = null;
106
- const cisLastStopId = attributes.zast;
107
- let res = {
108
- position: {
109
- asw_last_stop_id: aswLastStopId ? this.formatASWStopId(aswLastStopId) : null,
110
- bearing: bearing ? this.fixSourceNegativeBearing(parseInt(bearing, 10)) : null,
111
- cis_last_stop_id: cisLastStopId ? parseInt(cisLastStopId, 10) : null,
112
- cis_last_stop_sequence: null,
113
- delay_stop_arrival: attributes.zpoz_prij ? parseInt(attributes.zpoz_prij, 10) : null,
114
- delay_stop_departure: attributes.zpoz_odj ? parseInt(attributes.zpoz_odj, 10) : null,
115
- is_canceled: attributes.zrus === "true",
116
- lat: attributes.lat ? parseFloat(attributes.lat) : null,
117
- lng: attributes.lng ? parseFloat(attributes.lng) : null,
118
- origin_time: attributes.cpoz,
119
- origin_timestamp: positionTimestamp.toDate(),
120
- speed: speed ? parseInt(speed, 10) : null,
121
- state_position: const_1.StatePositionEnum.UNKNOWN,
122
- state_process: const_1.StateProcessEnum.INPUT,
123
- is_tracked: attributes.sled === PositionTrackingEnum.TRACKING && !!attributes.lat && !!attributes.lng,
124
- trips_id: primaryKey,
125
- },
123
+ const res = {
124
+ position: this.determinePosition(attributes, primaryKey, positionTimestamp),
126
125
  stops: new Map(),
127
- trip: {
128
- agency_name_real: attributes.doprSkut ? attributes.doprSkut : null,
129
- agency_name_scheduled: attributes.dopr ? attributes.dopr : null,
130
- cis_line_id: attributes.lin,
131
- cis_line_short_name: attributes.alias,
132
- cis_trip_number: cisTripNumber,
133
- id: primaryKey,
134
- is_canceled: attributes.zrus === "true",
135
- origin_route_name: attributes.kmenl ?? null,
136
- run_number: attributes.po !== undefined ? parseInt(attributes.po, 10) : null,
137
- start_asw_stop_id: stops[0].$.asw ?? null,
138
- start_cis_stop_id: stops[0].$.zast ? parseInt(stops[0].$.zast, 10) : null,
139
- start_cis_stop_platform_code: stops[0].$.stan ?? null,
140
- start_time: startTimestamp.tz("Europe/Prague").format("HH:mm"),
141
- start_timestamp: startTimestamp.toDate(),
142
- vehicle_registration_number: attributes.vuzevc ? parseInt(attributes.vuzevc, 10) : null,
143
- vehicle_type_id: attributes.t ? parseInt(attributes.t, 10) : null,
144
- wheelchair_accessible: attributes.np === "true",
145
- provider_source_type: ProviderSourceTypeEnum_1.ProviderSourceTypeEnum.Http,
146
- },
126
+ trip: this.determineTrip(attributes, cisTripNumber, primaryKey, startTimestamp, element.zast[0]),
127
+ tripToCis: null,
147
128
  };
148
129
  for (let i = 0; i < stops.length; i++) {
149
130
  const stop = stops[i];
@@ -157,7 +138,7 @@ class MpvMessageTransformation extends transformations_1.BaseTransformation {
157
138
  (stop.$.zpoz_typ_prij && parseInt(stop.$.zpoz_typ_prij, 10) === 3))) {
158
139
  res.position.cis_last_stop_sequence = cisStopSequence;
159
140
  }
160
- if (res.trip.vehicle_type_id === RouteTypeEnums_1.MPVRouteTypesEnum.UNKNOWN || res.trip.vehicle_type_id === RouteTypeEnums_1.MPVRouteTypesEnum.TRAIN) {
141
+ if (this.isCisPlatformEligible(res.trip)) {
161
142
  res.stops.set(`${primaryKey}_${stop.$.zast}`, {
162
143
  rt_trip_id: primaryKey,
163
144
  cis_stop_group_id: parseInt(stop.$.zast, 10),
@@ -167,40 +148,6 @@ class MpvMessageTransformation extends transformations_1.BaseTransformation {
167
148
  }
168
149
  return res;
169
150
  };
170
- /**
171
- * Deduce UTC timestamp of start of trip and UTC timestamp of current position
172
- *
173
- * @param {any} firstStopXML - parsed object of first stop
174
- * @param {string} positionTimestampXML - XML attribute of local timestamp of position (HH:mm:ss)
175
- * @returns {{ startTimestamp: Moment; positionTimestamp: Moment }}
176
- */
177
- this.deduceTimestamps = async (firstStopXML, positionTimestampXML) => {
178
- const now = moment_timezone_1.default.tz("Europe/Prague");
179
- let isOverMidnight = 0;
180
- // creating startDate and timestamp from zast[0].prij and cpoz
181
- const startTimestamp = now.clone();
182
- let startDatePlain = firstStopXML.$.prij || firstStopXML.$.odj;
183
- startDatePlain = startDatePlain.split(":");
184
- // eslint-disable-next-line prettier/prettier
185
- startTimestamp.hour(parseInt(startDatePlain[0], 10)).minute(parseInt(startDatePlain[1], 10)).second(0).millisecond(0);
186
- // midnight checking
187
- isOverMidnight = this.checkMidnight(now, startTimestamp); // returns -1, 1 or 0
188
- startTimestamp.add(isOverMidnight, "d");
189
- const positionTimestamp = now.clone();
190
- const timestampPlain = positionTimestampXML.split(":");
191
- positionTimestamp
192
- .hour(parseInt(timestampPlain[0], 10))
193
- .minute(parseInt(timestampPlain[1], 10))
194
- .second(parseInt(timestampPlain[2], 10))
195
- .millisecond(0);
196
- // midnight checking
197
- isOverMidnight = this.checkMidnight(now, positionTimestamp); // returns -1, 1 or 0
198
- positionTimestamp.add(isOverMidnight, "d");
199
- return {
200
- startTimestamp,
201
- positionTimestamp,
202
- };
203
- };
204
151
  /**
205
152
  * Returns -1 if start hour is 12-23 and now is 0-12, 1 if start hour is 18-23 and now 0-6, else 0
206
153
  *
@@ -231,9 +178,101 @@ class MpvMessageTransformation extends transformations_1.BaseTransformation {
231
178
  .getValue("module.pid.vehicle-positions.mpvIntegration.skipAgencyNames", DPPUtils_1.default.DPP_AGENCY_NAME)
232
179
  .split(",");
233
180
  }
181
+ /**
182
+ * Deduce UTC timestamp of start of trip and UTC timestamp of current position
183
+ *
184
+ * @param {any} firstStopXML - parsed object of first stop
185
+ * @param {string} positionTimestampXML - XML attribute of local timestamp of position (HH:mm:ss)
186
+ * @returns {{ startTimestamp: Moment; positionTimestamp: Moment }}
187
+ */
188
+ deduceTimestamps(firstStopXML, positionTimestampXML) {
189
+ const now = moment_timezone_1.default.tz("Europe/Prague");
190
+ let isOverMidnight = 0;
191
+ // creating startDate and timestamp from zast[0].prij and cpoz
192
+ const startTimestamp = now.clone();
193
+ let startDatePlain = firstStopXML.$.prij || firstStopXML.$.odj;
194
+ startDatePlain = startDatePlain.split(":");
195
+ // eslint-disable-next-line prettier/prettier
196
+ startTimestamp.hour(parseInt(startDatePlain[0], 10)).minute(parseInt(startDatePlain[1], 10)).second(0).millisecond(0);
197
+ // midnight checking
198
+ isOverMidnight = this.checkMidnight(now, startTimestamp); // returns -1, 1 or 0
199
+ startTimestamp.add(isOverMidnight, "d");
200
+ if (positionTimestampXML == null) {
201
+ return { startTimestamp, positionTimestamp: now.clone() };
202
+ }
203
+ const positionTimestamp = now.clone();
204
+ const timestampPlain = positionTimestampXML.split(":");
205
+ positionTimestamp
206
+ .hour(parseInt(timestampPlain[0], 10))
207
+ .minute(parseInt(timestampPlain[1], 10))
208
+ .second(parseInt(timestampPlain[2], 10))
209
+ .millisecond(0);
210
+ // midnight checking
211
+ isOverMidnight = this.checkMidnight(now, positionTimestamp); // returns -1, 1 or 0
212
+ positionTimestamp.add(isOverMidnight, "d");
213
+ return {
214
+ startTimestamp,
215
+ positionTimestamp,
216
+ };
217
+ }
218
+ static currentTimeInPrague() {
219
+ return moment_timezone_1.default.tz("Europe/Prague");
220
+ }
221
+ static currentTimeInPragueFormatted(now) {
222
+ return (now ?? moment_timezone_1.default.tz("Europe/Prague")).format(MpvMessageTransformation.ORIGIN_TIME_FORMAT);
223
+ }
224
+ isCisPlatformEligible(trip) {
225
+ if (trip?.vehicle_type_id == null) {
226
+ return false;
227
+ }
228
+ return MpvMessageTransformation.CIS_PLATFORM_ELIGIBLE.includes(trip.vehicle_type_id);
229
+ }
234
230
  isBlacklistedAgency(agency) {
235
231
  return agency && this.skipAgencyNames.includes(agency);
236
232
  }
233
+ isTrainBeforeTrackWithPlatforms(attrs, zast) {
234
+ if (attrs.lat || attrs.lng || attrs.zrus || attrs.cpoz || isNaN(parseInt(attrs.spoj, 10)) || !Array.isArray(zast)) {
235
+ // Should the message has any of these, we skip it here (not processing in this specific flow):
236
+ // - has lat/lng OR
237
+ // - has information about being cancelled (zrus) OR
238
+ // - has time of position (cpoz) OR
239
+ // - has no information about what train-identifier it is (spoj)
240
+ // - has not list of stops (zast)
241
+ return false;
242
+ }
243
+ // further code accepts only unknown or train transport
244
+ const isValidRouteType = this.isCisPlatformEligible({ vehicle_type_id: parseInt(attrs.t || "0") });
245
+ // and accepts only <zast> XML with some "stan" (platform code) information
246
+ const hasStopWithPlatform = zast.some((z) => z.$.stan?.length);
247
+ // all stops have to be in CZ cis number system
248
+ const wrongStopFromNonCzCis = zast.some((z) => {
249
+ return Number(z.$.zast) < 5400000 || Number(z.$.zast) >= 5500000;
250
+ });
251
+ if (!isValidRouteType || !hasStopWithPlatform || wrongStopFromNonCzCis) {
252
+ return false;
253
+ }
254
+ const { startTimestamp } = this.deduceTimestamps(zast[0], null);
255
+ const departureInterval = [
256
+ (0, moment_timezone_1.default)().subtract(5, "minutes"), // allow planned departure 5 minutes in past
257
+ (0, moment_timezone_1.default)().add(20, "minutes"), // allow up to 20 minutes into future for valid trains
258
+ ];
259
+ if (startTimestamp.isBetween(departureInterval[0], departureInterval[1])) {
260
+ // Seems the train has not yet departed onto the trip, probably good to make it into a position
261
+ // first stop has departure time inside interval of 5 minutes back till now+20 minutes <now-5minutes ... now+20min>
262
+ return true;
263
+ }
264
+ // For trains that are already on the trip = due to arriving from different / far away public
265
+ // transport network, and we don't receive position(s) yet, AND we won't be creating fake positions,
266
+ // because the vehicle is moving in reality, but MPVNet is not sending us the messages with lat/lng of it yet
267
+ return false;
268
+ }
269
+ determinePrimaryKey(attributes, prefix) {
270
+ // primary key for t = 0 (vehicle type is train) -> start_timestamp, cis_number
271
+ // primary key for t != 0 -> start_timestamp, cis_id, cis_short_name, cis_number
272
+ return attributes.t === "0"
273
+ ? `${prefix}_${attributes.spoj}`
274
+ : `${prefix}_${attributes.lin}_${attributes.alias}_${attributes.spoj}`;
275
+ }
237
276
  /**
238
277
  * Fix source negative bearing value due to overflow by adding 256
239
278
  *
@@ -243,19 +282,72 @@ class MpvMessageTransformation extends transformations_1.BaseTransformation {
243
282
  fixSourceNegativeBearing(bearing) {
244
283
  return bearing < 0 ? bearing + 256 : bearing;
245
284
  }
246
- /**
247
- * Format input stop id from DPP agency (XXX000Y to XXX/Y) to ASW id
248
- *
249
- * @param {string} stopId
250
- * @returns {stringList}
251
- */
252
- formatASWStopId(stopId) {
253
- const fixedRightPadFactor = 10000;
254
- const aswParsedStopNodeId = Math.floor(parseInt(stopId, 10) / fixedRightPadFactor);
255
- const aswParsedStopPostId = parseInt(stopId, 10) - aswParsedStopNodeId * fixedRightPadFactor;
256
- return aswParsedStopNodeId + "/" + aswParsedStopPostId;
285
+ extractStopsForTrain(id, stopsXML) {
286
+ const stops = new Map();
287
+ for (const stop of stopsXML) {
288
+ if (!stop.$.zast || !stop.$.stan) {
289
+ continue;
290
+ }
291
+ stops.set(`${id}_${stop.$.zast}`, {
292
+ rt_trip_id: id,
293
+ cis_stop_group_id: parseInt(stop.$.zast, 10),
294
+ cis_stop_platform_code: MpvStopParser_1.MpvStopParser.parsePlatformCode(stop),
295
+ });
296
+ }
297
+ return stops;
298
+ }
299
+ positionWithCisStopCoords(id, lat, lng, cpoz, positionTimestamp) {
300
+ return this.determinePosition({ lat, lng, cpoz }, id, positionTimestamp);
301
+ }
302
+ determinePosition(attributes, id, positionTimestamp) {
303
+ const cisLastStopId = attributes.zast;
304
+ const speed = attributes.rychl;
305
+ const bearing = attributes.azimut;
306
+ return {
307
+ asw_last_stop_id: null,
308
+ bearing: bearing ? this.fixSourceNegativeBearing(parseInt(bearing, 10)) : null,
309
+ cis_last_stop_id: cisLastStopId ? parseInt(cisLastStopId, 10) : null,
310
+ cis_last_stop_sequence: null,
311
+ delay_stop_arrival: attributes.zpoz_prij ? parseInt(attributes.zpoz_prij, 10) : null,
312
+ delay_stop_departure: attributes.zpoz_odj ? parseInt(attributes.zpoz_odj, 10) : null,
313
+ is_canceled: attributes.zrus === "true",
314
+ lat: attributes.lat ? parseFloat(attributes.lat) : null,
315
+ lng: attributes.lng ? parseFloat(attributes.lng) : null,
316
+ origin_time: attributes.cpoz || positionTimestamp.format(MpvMessageTransformation.ORIGIN_TIME_FORMAT),
317
+ origin_timestamp: positionTimestamp.toDate(),
318
+ speed: speed ? parseInt(speed, 10) : null,
319
+ state_position: const_1.StatePositionEnum.UNKNOWN,
320
+ state_process: const_1.StateProcessEnum.INPUT,
321
+ is_tracked: attributes.sled === PositionTrackingEnum.TRACKING && !!attributes.lat && !!attributes.lng,
322
+ trips_id: id,
323
+ };
324
+ }
325
+ determineTrip(attributes, cisTripNumber, id, start, zastXML) {
326
+ if (isNaN(cisTripNumber))
327
+ return null;
328
+ return {
329
+ agency_name_real: attributes.doprSkut ? attributes.doprSkut : null,
330
+ agency_name_scheduled: attributes.dopr ? attributes.dopr : null,
331
+ cis_line_id: attributes.lin || "none",
332
+ cis_line_short_name: attributes.alias || "none",
333
+ cis_trip_number: cisTripNumber,
334
+ id,
335
+ is_canceled: attributes.zrus === "true",
336
+ origin_route_name: attributes.kmenl ?? null,
337
+ run_number: attributes.po !== undefined ? parseInt(attributes.po, 10) : null,
338
+ start_asw_stop_id: zastXML.$.asw ?? null,
339
+ start_cis_stop_id: zastXML.$.zast ? parseInt(zastXML.$.zast, 10) : null,
340
+ start_cis_stop_platform_code: zastXML.$.stan ?? null,
341
+ start_time: start.tz("Europe/Prague").format("HH:mm"),
342
+ start_timestamp: start.toDate(),
343
+ vehicle_registration_number: attributes.vuzevc ? parseInt(attributes.vuzevc, 10) : null,
344
+ vehicle_type_id: attributes.t ? parseInt(attributes.t, 10) : null,
345
+ wheelchair_accessible: attributes.np === "true",
346
+ provider_source_type: ProviderSourceTypeEnum_1.ProviderSourceTypeEnum.Http,
347
+ };
257
348
  }
258
349
  }
259
350
  exports.MpvMessageTransformation = MpvMessageTransformation;
260
351
  MpvMessageTransformation.ORIGIN_TIME_FORMAT = "HH:mm:ss";
352
+ MpvMessageTransformation.CIS_PLATFORM_ELIGIBLE = [RouteTypeEnums_1.MPVRouteTypesEnum.UNKNOWN, RouteTypeEnums_1.MPVRouteTypesEnum.TRAIN];
261
353
  //# sourceMappingURL=MpvMessageTransformation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MpvMessageTransformation.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.ts"],"names":[],"mappings":";;;;;;AAAA,2FAA0D;AAG1D,wEAAqE;AACrE,qEAA0F;AAC1F,2FAA4G;AAC5G,gGAA2E;AAC3E,gDAAgE;AAChE,mEAA2C;AAC3C,8EAA2E;AAC3E,oEAAiE;AAGjE,0EAA4D;AAE5D,IAAK,oBAGJ;AAHD,WAAK,oBAAoB;IACrB,0CAAkB,CAAA;IAClB,sCAAc,CAAA;AAClB,CAAC,EAHI,oBAA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Ae,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;OAKG;IACK,wBAAwB,CAAC,OAAe;QAC5C,OAAO,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;IACjD,CAAC;IAED;;;;;OAKG;IACK,eAAe,CAAC,MAAc;QAClC,MAAM,mBAAmB,GAAG,KAAK,CAAC;QAClC,MAAM,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,mBAAmB,CAAC,CAAC;QACnF,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,mBAAmB,GAAG,mBAAmB,CAAC;QAC7F,OAAO,mBAAmB,GAAG,GAAG,GAAG,mBAAmB,CAAC;IAC3D,CAAC;;AAjRL,4DAkRC;AAjRkB,2CAAkB,GAAG,UAAU,AAAb,CAAc"}
1
+ {"version":3,"file":"MpvMessageTransformation.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.ts"],"names":[],"mappings":";;;;;;AAAA,0EAA4D;AAC5D,2FAA0D;AAE1D,oIAAoG;AAGpG,wEAAqE;AACrE,qEAA0F;AAC1F,2FAA4G;AAC5G,gGAA2E;AAC3E,gDAAgE;AAChE,mEAA2C;AAC3C,oEAAiE;AAQjE,IAAK,oBAGJ;AAHD,WAAK,oBAAoB;IACrB,0CAAkB,CAAA;IAClB,sCAAc,CAAA;AAClB,CAAC,EAHI,oBAAoB,KAApB,oBAAoB,QAGxB;AAED,MAAa,wBAAyB,SAAQ,oCAAkB;IAS5D;QACI,KAAK,EAAE,CAAC;QALJ,oBAAe,GAAa,EAAE,CAAC;QAavC;;WAEG;QACI,cAAS,GAAG,KAAK,EAAE,IAAiD,EAAkC,EAAE;YAC3G,IAAI,KAAK,GAAG,IAAI,GAAG,E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IAAI;YAC5E,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI;YACxC,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;YACvE,4BAA4B,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI;YACpD,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;YACrD,eAAe,EAAE,KAAK,CAAC,MAAM,EAAE;YAC/B,2BAA2B,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;YACvF,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;YACjE,qBAAqB,EAAE,UAAU,CAAC,EAAE,KAAK,MAAM;YAC/C,oBAAoB,EAAE,+CAAsB,CAAC,IAAI;SACpD,CAAC;IACN,CAAC;;AAtYL,4DAuYC;AAtYkB,2CAAkB,GAAG,UAAU,AAAb,CAAc;AACvB,8CAAqB,GAAG,CAAC,kCAAiB,CAAC,OAAO,EAAE,kCAAiB,CAAC,KAAK,CAAC,AAAvD,CAAwD"}
@@ -8,8 +8,8 @@ const dto_1 = require("../../dto");
8
8
  const PIDDepartureBoardsModel_1 = require("../../models/PIDDepartureBoardsModel");
9
9
  const shared_1 = require("../../../shared");
10
10
  const trace_provider_1 = require("@golemio/core/dist/monitoring/opentelemetry/trace-provider");
11
- const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
12
11
  const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
12
+ const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
13
13
  class V2DepartureBoardsController {
14
14
  constructor() {
15
15
  this.getDepartureBoard = async (req, res, next) => {