@golemio/pid 2.17.0 → 2.17.1-dev.1412857437

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 (273) hide show
  1. package/db/example/00_clear_test_data.sql +2 -0
  2. package/db/example/03_ropidgtfs_dump.sql +36 -0
  3. package/db/example/20_jis_infotexts.sql +214 -0
  4. package/db/migrations/postgresql/20240801141948-jis-infotexts.js +53 -0
  5. package/db/migrations/postgresql/20240808123947-filter-null-island.js +53 -0
  6. package/db/migrations/postgresql/20240809084521-jis-infotexts-severity-level.js +53 -0
  7. package/db/migrations/postgresql/sqls/20240801141948-jis-infotexts-down.sql +2 -0
  8. package/db/migrations/postgresql/sqls/20240801141948-jis-infotexts-up.sql +19 -0
  9. package/db/migrations/postgresql/sqls/20240808123947-filter-null-island-down.sql +53 -0
  10. package/db/migrations/postgresql/sqls/20240808123947-filter-null-island-up.sql +55 -0
  11. package/db/migrations/postgresql/sqls/20240809084521-jis-infotexts-severity-level-down.sql +8 -0
  12. package/db/migrations/postgresql/sqls/20240809084521-jis-infotexts-severity-level-up.sql +7 -0
  13. package/dist/integration-engine/index.js +4 -0
  14. package/dist/integration-engine/index.js.map +1 -1
  15. package/dist/integration-engine/jis/datasources/JISInfotextsDataSourceFactory.d.ts +10 -0
  16. package/dist/integration-engine/jis/datasources/JISInfotextsDataSourceFactory.js +49 -0
  17. package/dist/integration-engine/jis/datasources/JISInfotextsDataSourceFactory.js.map +1 -0
  18. package/dist/integration-engine/jis/index.d.ts +1 -0
  19. package/dist/{output-gateway/pid/controllers → integration-engine/jis}/index.js +1 -2
  20. package/dist/integration-engine/jis/index.js.map +1 -0
  21. package/dist/integration-engine/jis/ioc/Di.d.ts +3 -0
  22. package/dist/integration-engine/jis/ioc/Di.js +31 -0
  23. package/dist/integration-engine/jis/ioc/Di.js.map +1 -0
  24. package/dist/integration-engine/jis/ioc/JISContainerToken.d.ts +9 -0
  25. package/dist/integration-engine/jis/ioc/JISContainerToken.js +18 -0
  26. package/dist/integration-engine/jis/ioc/JISContainerToken.js.map +1 -0
  27. package/dist/integration-engine/jis/repositories/JISInfotextsRepository.d.ts +36 -0
  28. package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js +101 -0
  29. package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js.map +1 -0
  30. package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.d.ts +36 -0
  31. package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.js +101 -0
  32. package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.js.map +1 -0
  33. package/dist/integration-engine/jis/services/JISInfotextsDataService.d.ts +20 -0
  34. package/dist/integration-engine/jis/services/JISInfotextsDataService.js +78 -0
  35. package/dist/integration-engine/jis/services/JISInfotextsDataService.js.map +1 -0
  36. package/dist/integration-engine/jis/transformations/JISInfotextsTransformation.d.ts +13 -0
  37. package/dist/integration-engine/jis/transformations/JISInfotextsTransformation.js +41 -0
  38. package/dist/integration-engine/jis/transformations/JISInfotextsTransformation.js.map +1 -0
  39. package/dist/integration-engine/jis/workers/JISWorker.d.ts +7 -0
  40. package/dist/integration-engine/jis/workers/JISWorker.js +21 -0
  41. package/dist/integration-engine/jis/workers/JISWorker.js.map +1 -0
  42. package/dist/integration-engine/jis/workers/constants.d.ts +1 -0
  43. package/dist/integration-engine/jis/workers/constants.js +5 -0
  44. package/dist/integration-engine/jis/workers/constants.js.map +1 -0
  45. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.d.ts +14 -0
  46. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js +72 -0
  47. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js.map +1 -0
  48. package/dist/integration-engine/ropid-gtfs/data-access/helpers/RawQueryProvider.d.ts +3 -0
  49. package/dist/integration-engine/ropid-gtfs/data-access/helpers/RawQueryProvider.js +62 -0
  50. package/dist/integration-engine/ropid-gtfs/data-access/helpers/RawQueryProvider.js.map +1 -0
  51. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripScheduleRepository.d.ts +2 -0
  52. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripScheduleRepository.js +21 -0
  53. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripScheduleRepository.js.map +1 -1
  54. package/dist/integration-engine/ropid-gtfs/interfaces/TripScheduleInterfaces.d.ts +22 -0
  55. package/dist/integration-engine/ropid-gtfs/interfaces/TripScheduleInterfaces.js +3 -0
  56. package/dist/integration-engine/ropid-gtfs/interfaces/TripScheduleInterfaces.js.map +1 -0
  57. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusMessageFilter.d.ts +1 -4
  58. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusMessageFilter.js +11 -27
  59. package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusMessageFilter.js.map +1 -1
  60. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.d.ts +1 -1
  61. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js +34 -51
  62. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js.map +1 -1
  63. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/RawQueryProvider.d.ts +0 -1
  64. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/RawQueryProvider.js +1 -80
  65. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/RawQueryProvider.js.map +1 -1
  66. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/interfaces/TripRepositoryInterfaces.d.ts +0 -17
  67. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.js +19 -11
  68. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.js.map +1 -1
  69. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/abstract/AbstractPropagateDelayTask.js +1 -1
  70. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/abstract/AbstractPropagateDelayTask.js.map +1 -1
  71. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.d.ts +3 -6
  72. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js +8 -19
  73. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js.map +1 -1
  74. package/dist/output-gateway/departure-boards/index.d.ts +1 -1
  75. package/dist/output-gateway/departure-boards/index.js +1 -1
  76. package/dist/output-gateway/departure-boards/index.js.map +1 -1
  77. package/dist/output-gateway/departure-boards/routers/index.d.ts +1 -0
  78. package/dist/output-gateway/departure-boards/routers/index.js +6 -0
  79. package/dist/output-gateway/departure-boards/routers/index.js.map +1 -0
  80. package/dist/output-gateway/departure-boards/{DepartureBoardsRouter.d.ts → routers/v2/V2DepartureBoardsRouter.d.ts} +9 -8
  81. package/dist/output-gateway/departure-boards/{DepartureBoardsRouter.js → routers/v2/V2DepartureBoardsRouter.js} +19 -18
  82. package/dist/output-gateway/departure-boards/routers/v2/V2DepartureBoardsRouter.js.map +1 -0
  83. package/dist/output-gateway/index.d.ts +1 -0
  84. package/dist/output-gateway/index.js +25 -1
  85. package/dist/output-gateway/index.js.map +1 -1
  86. package/dist/output-gateway/pid/controllers/{DepartureBoardsController.d.ts → v2/V2DepartureBoardsController.d.ts} +1 -1
  87. package/dist/output-gateway/pid/controllers/{DepartureBoardsController.js → v2/V2DepartureBoardsController.js} +9 -9
  88. package/dist/output-gateway/pid/controllers/v2/V2DepartureBoardsController.js.map +1 -0
  89. package/dist/output-gateway/pid/controllers/{InfotextsController.d.ts → v2/V2InfotextsController.d.ts} +1 -1
  90. package/dist/output-gateway/pid/controllers/{InfotextsController.js → v2/V2InfotextsController.js} +6 -6
  91. package/dist/output-gateway/pid/controllers/v2/V2InfotextsController.js.map +1 -0
  92. package/dist/output-gateway/pid/controllers/v3/V3InfotextsController.d.ts +10 -0
  93. package/dist/output-gateway/pid/controllers/v3/V3InfotextsController.js +57 -0
  94. package/dist/output-gateway/pid/controllers/v3/V3InfotextsController.js.map +1 -0
  95. package/dist/output-gateway/pid/data-access/JISInfotextRepository.d.ts +27 -0
  96. package/dist/output-gateway/pid/data-access/JISInfotextRepository.js +157 -0
  97. package/dist/output-gateway/pid/data-access/JISInfotextRepository.js.map +1 -0
  98. package/dist/output-gateway/pid/data-access/JISInfotextRopidGTFSStopsRepository.d.ts +11 -0
  99. package/dist/output-gateway/pid/data-access/JISInfotextRopidGTFSStopsRepository.js +37 -0
  100. package/dist/output-gateway/pid/data-access/JISInfotextRopidGTFSStopsRepository.js.map +1 -0
  101. package/dist/output-gateway/pid/domain/InfotextDisplayTypeEnum.d.ts +4 -0
  102. package/dist/output-gateway/pid/domain/InfotextDisplayTypeEnum.js +9 -0
  103. package/dist/output-gateway/pid/domain/InfotextDisplayTypeEnum.js.map +1 -0
  104. package/dist/output-gateway/pid/domain/InfotextInterfaces.d.ts +28 -0
  105. package/dist/output-gateway/pid/domain/InfotextInterfaces.js +3 -0
  106. package/dist/output-gateway/pid/domain/InfotextInterfaces.js.map +1 -0
  107. package/dist/output-gateway/pid/dto/DepartureBoardsDTO.d.ts +3 -3
  108. package/dist/output-gateway/pid/dto/DepartureBoardsDTO.js +1 -1
  109. package/dist/output-gateway/pid/dto/DepartureBoardsDTO.js.map +1 -1
  110. package/dist/output-gateway/pid/index.d.ts +1 -1
  111. package/dist/output-gateway/pid/index.js +1 -1
  112. package/dist/output-gateway/pid/index.js.map +1 -1
  113. package/dist/output-gateway/pid/ioc/Di.d.ts +3 -0
  114. package/dist/output-gateway/pid/ioc/Di.js +23 -0
  115. package/dist/output-gateway/pid/ioc/Di.js.map +1 -0
  116. package/dist/output-gateway/pid/ioc/OgPidToken.d.ts +7 -0
  117. package/dist/output-gateway/pid/ioc/OgPidToken.js +17 -0
  118. package/dist/output-gateway/pid/ioc/OgPidToken.js.map +1 -0
  119. package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.d.ts +2 -1
  120. package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js +20 -10
  121. package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js.map +1 -1
  122. package/dist/output-gateway/pid/models/RopidVYMIEventsStopsModel.d.ts +2 -19
  123. package/dist/output-gateway/pid/models/RopidVYMIEventsStopsModel.js +4 -64
  124. package/dist/output-gateway/pid/models/RopidVYMIEventsStopsModel.js.map +1 -1
  125. package/dist/output-gateway/pid/routers/index.d.ts +2 -0
  126. package/dist/output-gateway/pid/routers/index.js +8 -0
  127. package/dist/output-gateway/pid/routers/index.js.map +1 -0
  128. package/dist/output-gateway/pid/{PIDRouter.d.ts → routers/v2/V2PIDRouter.d.ts} +5 -4
  129. package/dist/output-gateway/pid/{PIDRouter.js → routers/v2/V2PIDRouter.js} +20 -17
  130. package/dist/output-gateway/pid/routers/v2/V2PIDRouter.js.map +1 -0
  131. package/dist/output-gateway/pid/routers/v3/V3PIDRouter.d.ts +11 -0
  132. package/dist/output-gateway/pid/routers/v3/V3PIDRouter.js +31 -0
  133. package/dist/output-gateway/pid/routers/v3/V3PIDRouter.js.map +1 -0
  134. package/dist/output-gateway/pid/service/helpers/DisplayTypeMapper.d.ts +10 -0
  135. package/dist/output-gateway/pid/service/helpers/DisplayTypeMapper.js +25 -0
  136. package/dist/output-gateway/pid/service/helpers/DisplayTypeMapper.js.map +1 -0
  137. package/dist/output-gateway/pid/service/transformations/JISInfotextDepartureTransformation.d.ts +13 -0
  138. package/dist/output-gateway/pid/service/transformations/JISInfotextDepartureTransformation.js +35 -0
  139. package/dist/output-gateway/pid/service/transformations/JISInfotextDepartureTransformation.js.map +1 -0
  140. package/dist/output-gateway/pid/service/transformations/JISInfotextOverviewTransformation.d.ts +19 -0
  141. package/dist/output-gateway/pid/service/transformations/JISInfotextOverviewTransformation.js +43 -0
  142. package/dist/output-gateway/pid/service/transformations/JISInfotextOverviewTransformation.js.map +1 -0
  143. package/dist/output-gateway/public/controllers/{v1/PublicDepartureBoardsController.d.ts → v2/V2PublicDepartureBoardsController.d.ts} +1 -1
  144. package/dist/output-gateway/public/controllers/{v1/PublicDepartureBoardsController.js → v2/V2PublicDepartureBoardsController.js} +5 -5
  145. package/dist/output-gateway/public/controllers/v2/V2PublicDepartureBoardsController.js.map +1 -0
  146. package/dist/output-gateway/public/controllers/{v1/PublicGtfsController.d.ts → v2/V2PublicGtfsController.d.ts} +1 -1
  147. package/dist/output-gateway/public/controllers/{v1/PublicGtfsController.js → v2/V2PublicGtfsController.js} +5 -5
  148. package/dist/output-gateway/public/controllers/v2/V2PublicGtfsController.js.map +1 -0
  149. package/dist/output-gateway/public/controllers/{v1/PublicVehiclePositionsController.d.ts → v2/V2PublicVehiclePositionsController.d.ts} +1 -1
  150. package/dist/output-gateway/public/controllers/{v1/PublicVehiclePositionsController.js → v2/V2PublicVehiclePositionsController.js} +4 -4
  151. package/dist/output-gateway/public/controllers/v2/V2PublicVehiclePositionsController.js.map +1 -0
  152. package/dist/output-gateway/public/controllers/{v1 → v2}/interfaces/PublicParamsInterfaces.d.ts +1 -1
  153. package/dist/output-gateway/public/controllers/{v1 → v2}/interfaces/PublicParamsInterfaces.js.map +1 -1
  154. package/dist/output-gateway/public/index.d.ts +1 -0
  155. package/dist/output-gateway/public/index.js +18 -0
  156. package/dist/output-gateway/public/index.js.map +1 -0
  157. package/dist/output-gateway/public/routers/index.d.ts +3 -0
  158. package/dist/output-gateway/public/routers/index.js +10 -0
  159. package/dist/output-gateway/public/routers/index.js.map +1 -0
  160. package/dist/output-gateway/public/routers/{v1/PublicDeparturesRouter.d.ts → v2/V2PublicDeparturesRouter.d.ts} +4 -3
  161. package/dist/output-gateway/public/routers/{v1/PublicDeparturesRouter.js → v2/V2PublicDeparturesRouter.js} +11 -8
  162. package/dist/output-gateway/public/routers/v2/V2PublicDeparturesRouter.js.map +1 -0
  163. package/dist/output-gateway/public/routers/{v1/PublicGtfsRouter.d.ts → v2/V2PublicGtfsRouter.d.ts} +4 -3
  164. package/dist/output-gateway/public/routers/{v1/PublicGtfsRouter.js → v2/V2PublicGtfsRouter.js} +11 -8
  165. package/dist/output-gateway/public/routers/v2/V2PublicGtfsRouter.js.map +1 -0
  166. package/dist/output-gateway/public/routers/{v1/PublicVehiclePositionsRouter.d.ts → v2/V2PublicVehiclePositionsRouter.d.ts} +4 -3
  167. package/dist/output-gateway/public/routers/{v1/PublicVehiclePositionsRouter.js → v2/V2PublicVehiclePositionsRouter.js} +11 -8
  168. package/dist/output-gateway/public/routers/v2/V2PublicVehiclePositionsRouter.js.map +1 -0
  169. package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomScopeValidator.js.map +1 -1
  170. package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomStopIdGroupValidator.js.map +1 -1
  171. package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomTypeValidator.js.map +1 -1
  172. package/dist/output-gateway/public/routers/{v1 → v2}/helpers/DetailedTripScopeEnum.js.map +1 -1
  173. package/dist/output-gateway/public/service/facade/DepartureBoardFacade.d.ts +1 -1
  174. package/dist/output-gateway/public/service/facade/DetailedTripFacade.d.ts +1 -1
  175. package/dist/output-gateway/public/service/facade/DetailedTripFacade.js +1 -1
  176. package/dist/output-gateway/public/service/facade/GtfsTripLookupFacade.d.ts +1 -1
  177. package/dist/output-gateway/public/service/facade/GtfsTripLookupFacade.js +1 -1
  178. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/GtfsTripScopeHandlerFactory.d.ts +1 -1
  179. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/GtfsTripScopeHandlerFactory.js +1 -1
  180. package/dist/output-gateway/public/service/helpers/trip-scope/TripScopeHandlerFactory.d.ts +1 -1
  181. package/dist/output-gateway/public/service/helpers/trip-scope/TripScopeHandlerFactory.js +1 -1
  182. package/dist/output-gateway/ropid-gtfs/index.d.ts +1 -1
  183. package/dist/output-gateway/ropid-gtfs/index.js +1 -1
  184. package/dist/output-gateway/ropid-gtfs/index.js.map +1 -1
  185. package/dist/output-gateway/ropid-gtfs/routers/index.d.ts +1 -0
  186. package/dist/output-gateway/ropid-gtfs/routers/index.js +6 -0
  187. package/dist/output-gateway/ropid-gtfs/routers/index.js.map +1 -0
  188. package/dist/output-gateway/ropid-gtfs/{GTFSRouter.d.ts → routers/v2/V2GTFSRouter.d.ts} +11 -13
  189. package/dist/output-gateway/ropid-gtfs/{GTFSRouter.js → routers/v2/V2GTFSRouter.js} +16 -16
  190. package/dist/output-gateway/ropid-gtfs/routers/v2/V2GTFSRouter.js.map +1 -0
  191. package/dist/output-gateway/shared/RopidRouterUtils.d.ts +4 -0
  192. package/dist/output-gateway/shared/RopidRouterUtils.js +11 -0
  193. package/dist/output-gateway/shared/RopidRouterUtils.js.map +1 -1
  194. package/dist/output-gateway/shared/constants/index.d.ts +1 -0
  195. package/dist/output-gateway/shared/constants/index.js +1 -0
  196. package/dist/output-gateway/shared/constants/index.js.map +1 -1
  197. package/dist/output-gateway/shared/constants/route-version.d.ts +5 -0
  198. package/dist/output-gateway/shared/constants/route-version.js +10 -0
  199. package/dist/output-gateway/shared/constants/route-version.js.map +1 -0
  200. package/dist/output-gateway/vehicle-positions/data-access/views/TripWithLastPositionRepository.js +0 -2
  201. package/dist/output-gateway/vehicle-positions/data-access/views/TripWithLastPositionRepository.js.map +1 -1
  202. package/dist/output-gateway/vehicle-positions/index.d.ts +1 -1
  203. package/dist/output-gateway/vehicle-positions/index.js +1 -1
  204. package/dist/output-gateway/vehicle-positions/index.js.map +1 -1
  205. package/dist/output-gateway/vehicle-positions/routers/index.d.ts +1 -0
  206. package/dist/output-gateway/vehicle-positions/routers/index.js +6 -0
  207. package/dist/output-gateway/vehicle-positions/routers/index.js.map +1 -0
  208. package/dist/output-gateway/vehicle-positions/{VehiclePositionsRouter.d.ts → routers/v2/V2VehiclePositionsRouter.d.ts} +6 -6
  209. package/dist/output-gateway/vehicle-positions/{VehiclePositionsRouter.js → routers/v2/V2VehiclePositionsRouter.js} +12 -11
  210. package/dist/output-gateway/vehicle-positions/routers/v2/V2VehiclePositionsRouter.js.map +1 -0
  211. package/dist/schema-definitions/jis/datasources/JISInfotextsJsonSchema.d.ts +3 -0
  212. package/dist/schema-definitions/jis/datasources/JISInfotextsJsonSchema.js +59 -0
  213. package/dist/schema-definitions/jis/datasources/JISInfotextsJsonSchema.js.map +1 -0
  214. package/dist/schema-definitions/jis/datasources/interfaces/IJISInfotext.d.ts +16 -0
  215. package/dist/schema-definitions/jis/datasources/interfaces/IJISInfotext.js +3 -0
  216. package/dist/schema-definitions/jis/datasources/interfaces/IJISInfotext.js.map +1 -0
  217. package/dist/schema-definitions/jis/datasources/interfaces/IJISInfotextStop.d.ts +3 -0
  218. package/dist/schema-definitions/jis/datasources/interfaces/IJISInfotextStop.js +3 -0
  219. package/dist/schema-definitions/jis/datasources/interfaces/IJISInfotextStop.js.map +1 -0
  220. package/dist/schema-definitions/jis/datasources/interfaces/IJISTranslationText.d.ts +4 -0
  221. package/dist/schema-definitions/jis/datasources/interfaces/IJISTranslationText.js +3 -0
  222. package/dist/schema-definitions/jis/datasources/interfaces/IJISTranslationText.js.map +1 -0
  223. package/dist/schema-definitions/jis/datasources/interfaces/index.d.ts +3 -0
  224. package/dist/schema-definitions/jis/datasources/interfaces/index.js +20 -0
  225. package/dist/schema-definitions/jis/datasources/interfaces/index.js.map +1 -0
  226. package/dist/schema-definitions/jis/models/JISInfotextsModel.d.ts +19 -0
  227. package/dist/schema-definitions/jis/models/JISInfotextsModel.js +80 -0
  228. package/dist/schema-definitions/jis/models/JISInfotextsModel.js.map +1 -0
  229. package/dist/schema-definitions/jis/models/JISInfotextsRopidGTFSStopsModel.d.ts +12 -0
  230. package/dist/schema-definitions/jis/models/JISInfotextsRopidGTFSStopsModel.js +41 -0
  231. package/dist/schema-definitions/jis/models/JISInfotextsRopidGTFSStopsModel.js.map +1 -0
  232. package/dist/schema-definitions/jis/models/interfaces/IJISInfotext.d.ts +10 -0
  233. package/dist/schema-definitions/jis/models/interfaces/IJISInfotext.js +3 -0
  234. package/dist/schema-definitions/jis/models/interfaces/IJISInfotext.js.map +1 -0
  235. package/dist/schema-definitions/jis/models/interfaces/IJISInfotextsRopidGTFSStops.d.ts +4 -0
  236. package/dist/schema-definitions/jis/models/interfaces/IJISInfotextsRopidGTFSStops.js +3 -0
  237. package/dist/schema-definitions/jis/models/interfaces/IJISInfotextsRopidGTFSStops.js.map +1 -0
  238. package/dist/schema-definitions/jis/models/interfaces/IJISTranslationText.d.ts +4 -0
  239. package/dist/schema-definitions/jis/models/interfaces/IJISTranslationText.js +3 -0
  240. package/dist/schema-definitions/jis/models/interfaces/IJISTranslationText.js.map +1 -0
  241. package/dist/schema-definitions/jis/models/interfaces/index.d.ts +3 -0
  242. package/dist/schema-definitions/jis/models/interfaces/index.js +20 -0
  243. package/dist/schema-definitions/jis/models/interfaces/index.js.map +1 -0
  244. package/dist/schema-definitions/vehicle-positions/models/VPTripsModel.js +6 -0
  245. package/dist/schema-definitions/vehicle-positions/models/VPTripsModel.js.map +1 -1
  246. package/dist/schema-definitions/vehicle-positions/models/interfaces/VPTripsLastPositionInterfaces.d.ts +2 -0
  247. package/docs/assets/pid_jis_erd.png +0 -0
  248. package/docs/implementation_documentation.md +86 -35
  249. package/docs/openapi-output.yaml +128 -69
  250. package/package.json +2 -2
  251. package/dist/output-gateway/departure-boards/DepartureBoardsRouter.js.map +0 -1
  252. package/dist/output-gateway/pid/PIDRouter.js.map +0 -1
  253. package/dist/output-gateway/pid/controllers/DepartureBoardsController.js.map +0 -1
  254. package/dist/output-gateway/pid/controllers/InfotextsController.js.map +0 -1
  255. package/dist/output-gateway/pid/controllers/index.d.ts +0 -2
  256. package/dist/output-gateway/pid/controllers/index.js.map +0 -1
  257. package/dist/output-gateway/public/controllers/v1/PublicDepartureBoardsController.js.map +0 -1
  258. package/dist/output-gateway/public/controllers/v1/PublicGtfsController.js.map +0 -1
  259. package/dist/output-gateway/public/controllers/v1/PublicVehiclePositionsController.js.map +0 -1
  260. package/dist/output-gateway/public/routers/v1/PublicDeparturesRouter.js.map +0 -1
  261. package/dist/output-gateway/public/routers/v1/PublicGtfsRouter.js.map +0 -1
  262. package/dist/output-gateway/public/routers/v1/PublicVehiclePositionsRouter.js.map +0 -1
  263. package/dist/output-gateway/ropid-gtfs/GTFSRouter.js.map +0 -1
  264. package/dist/output-gateway/vehicle-positions/VehiclePositionsRouter.js.map +0 -1
  265. /package/dist/output-gateway/public/controllers/{v1 → v2}/interfaces/PublicParamsInterfaces.js +0 -0
  266. /package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomScopeValidator.d.ts +0 -0
  267. /package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomScopeValidator.js +0 -0
  268. /package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomStopIdGroupValidator.d.ts +0 -0
  269. /package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomStopIdGroupValidator.js +0 -0
  270. /package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomTypeValidator.d.ts +0 -0
  271. /package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomTypeValidator.js +0 -0
  272. /package/dist/output-gateway/public/routers/{v1 → v2}/helpers/DetailedTripScopeEnum.d.ts +0 -0
  273. /package/dist/output-gateway/public/routers/{v1 → v2}/helpers/DetailedTripScopeEnum.js +0 -0
@@ -1,6 +1,6 @@
1
+ import { DepartureFilter, DepartureMode, DepartureOrder, DepartureSkip, IPIDDepartureOutput } from "..";
1
2
  import { IGTFSStopGetAllOutput } from "../../ropid-gtfs/models/GTFSStopModelInterfaces";
2
- import { IInfotextsStopsWithEventOutputModel } from "../models/RopidVYMIEventsStopsModel";
3
- import { IPIDDepartureOutput, DepartureMode, DepartureFilter, DepartureOrder, DepartureSkip } from "..";
3
+ import { IInfotextDepartureOutputDto } from "../domain/InfotextInterfaces";
4
4
  import { IDepartureBoardsQueryDTO } from "./interfaces/IDepartureBoardsQueryDTO";
5
5
  export declare class DepartureBoardsQueryDTO implements IDepartureBoardsQueryDTO {
6
6
  aswIds: string[];
@@ -24,5 +24,5 @@ export declare class DepartureBoardsQueryDTO implements IDepartureBoardsQueryDTO
24
24
  export declare class DepartureBoardsResponseDTO {
25
25
  stops: IGTFSStopGetAllOutput[];
26
26
  departures: IPIDDepartureOutput[];
27
- infotexts: IInfotextsStopsWithEventOutputModel[];
27
+ infotexts: IInfotextDepartureOutputDto[];
28
28
  }
@@ -10,8 +10,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.DepartureBoardsResponseDTO = exports.DepartureBoardsQueryDTO = void 0;
13
- const decorators_1 = require("../../shared/decorators");
14
13
  const pid_1 = require("..");
14
+ const decorators_1 = require("../../shared/decorators");
15
15
  class DepartureBoardsQueryDTO {
16
16
  constructor() {
17
17
  this.aswIds = [];
@@ -1 +1 @@
1
- {"version":3,"file":"DepartureBoardsDTO.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/dto/DepartureBoardsDTO.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA2F;AAG3F,4BAA6G;AAG7G,MAAa,uBAAuB;IAApC;QAEI,WAAM,GAAa,EAAE,CAAC;QAGtB,WAAM,GAAa,EAAE,CAAC;QAGtB,QAAG,GAAa,EAAE,CAAC;QAGnB,UAAK,GAAa,EAAE,CAAC;QAGrB,SAAI,GAAoB,EAAE,CAAC;QAG3B,UAAK,GAAW,EAAE,CAAC;QAGnB,iBAAY,GAAW,GAAG,CAAC;QAG3B,kBAAa,GAAW,CAAC,CAAC;QAG1B,uBAAkB,GAAY,KAAK,CAAC;QAGpC,iBAAY,GAAY,IAAI,CAAC;QAE7B,SAAI,GAAkB,mBAAa,CAAC,UAAU,CAAC;QAE/C,UAAK,GAAmB,oBAAc,CAAC,IAAI,CAAC;QAE5C,WAAM,GAAoB,qBAAe,CAAC,IAAI,CAAC;QAG/C,WAAM,GAAW,CAAC,CAAC;IAQvB,CAAC;CAAA;AA9CD,0DA8CC;AA5CG;IADC,IAAA,2BAAc,GAAE;;uDACK;AAGtB;IADC,IAAA,2BAAc,GAAE;;uDACK;AAGtB;IADC,IAAA,2BAAc,GAAE;;oDACE;AAGnB;IADC,IAAA,2BAAc,GAAE;;sDACI;AAGrB;IADC,IAAA,2BAAc,GAAE;;qDACU;AAG3B;IADC,IAAA,6BAAgB,GAAE;;sDACA;AAGnB;IADC,IAAA,6BAAgB,GAAE;;6DACQ;AAG3B;IADC,IAAA,6BAAgB,GAAE;;8DACO;AAG1B;IADC,IAAA,6BAAgB,GAAE;;mEACiB;AAGpC;IADC,IAAA,6BAAgB,GAAE;;6DACU;AAS7B;IADC,IAAA,6BAAgB,GAAE;;uDACA;AAGnB;IADC,IAAA,6BAAgB,GAAE;;sDACJ;AAOnB,MAAa,0BAA0B;IAAvC;QACI,UAAK,GAA4B,EAAE,CAAC;QACpC,eAAU,GAA0B,EAAE,CAAC;QACvC,cAAS,GAA0C,EAAE,CAAC;IAC1D,CAAC;CAAA;AAJD,gEAIC"}
1
+ {"version":3,"file":"DepartureBoardsDTO.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/dto/DepartureBoardsDTO.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4BAA6G;AAE7G,wDAA2F;AAI3F,MAAa,uBAAuB;IAApC;QAEI,WAAM,GAAa,EAAE,CAAC;QAGtB,WAAM,GAAa,EAAE,CAAC;QAGtB,QAAG,GAAa,EAAE,CAAC;QAGnB,UAAK,GAAa,EAAE,CAAC;QAGrB,SAAI,GAAoB,EAAE,CAAC;QAG3B,UAAK,GAAW,EAAE,CAAC;QAGnB,iBAAY,GAAW,GAAG,CAAC;QAG3B,kBAAa,GAAW,CAAC,CAAC;QAG1B,uBAAkB,GAAY,KAAK,CAAC;QAGpC,iBAAY,GAAY,IAAI,CAAC;QAE7B,SAAI,GAAkB,mBAAa,CAAC,UAAU,CAAC;QAE/C,UAAK,GAAmB,oBAAc,CAAC,IAAI,CAAC;QAE5C,WAAM,GAAoB,qBAAe,CAAC,IAAI,CAAC;QAG/C,WAAM,GAAW,CAAC,CAAC;IAQvB,CAAC;CAAA;AA9CD,0DA8CC;AA5CG;IADC,IAAA,2BAAc,GAAE;;uDACK;AAGtB;IADC,IAAA,2BAAc,GAAE;;uDACK;AAGtB;IADC,IAAA,2BAAc,GAAE;;oDACE;AAGnB;IADC,IAAA,2BAAc,GAAE;;sDACI;AAGrB;IADC,IAAA,2BAAc,GAAE;;qDACU;AAG3B;IADC,IAAA,6BAAgB,GAAE;;sDACA;AAGnB;IADC,IAAA,6BAAgB,GAAE;;6DACQ;AAG3B;IADC,IAAA,6BAAgB,GAAE;;8DACO;AAG1B;IADC,IAAA,6BAAgB,GAAE;;mEACiB;AAGpC;IADC,IAAA,6BAAgB,GAAE;;6DACU;AAS7B;IADC,IAAA,6BAAgB,GAAE;;uDACA;AAGnB;IADC,IAAA,6BAAgB,GAAE;;sDACJ;AAOnB,MAAa,0BAA0B;IAAvC;QACI,UAAK,GAA4B,EAAE,CAAC;QACpC,eAAU,GAA0B,EAAE,CAAC;QACvC,cAAS,GAAkC,EAAE,CAAC;IAClD,CAAC;CAAA;AAJD,gEAIC"}
@@ -1,7 +1,7 @@
1
1
  import { GtfsStopWheelchairBoardingEnum, GtfsTripWheelchairAccessEnum } from "../../helpers/AccessibilityEnums";
2
2
  import { GTFSRouteTypeEnum } from "../../helpers/RouteTypeEnums";
3
3
  import { DeparturesDirectionsEnum } from "../../schema-definitions/ropid-departures-directions";
4
- export * from "./PIDRouter";
4
+ export * from "./routers";
5
5
  export * from "./models";
6
6
  export interface IPIDDeparture {
7
7
  stop_sequence: number;
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.DepartureSkip = exports.DepartureFilter = exports.DepartureOrder = exports.DepartureMode = void 0;
18
- __exportStar(require("./PIDRouter"), exports);
18
+ __exportStar(require("./routers"), exports);
19
19
  __exportStar(require("./models"), exports);
20
20
  var DepartureMode;
21
21
  (function (DepartureMode) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/pid/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA,8CAA4B;AAC5B,2CAAyB;AAkFzB,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,0CAAyB,CAAA;IACzB,sCAAqB,CAAA;IACrB,gCAAe,CAAA;AACnB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAED,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,+BAAa,CAAA;IACb,yCAAuB,CAAA;AAC3B,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED,IAAY,eAQX;AARD,WAAY,eAAe;IACvB,gCAAa,CAAA;IACb,2CAAwB,CAAA;IACxB,0DAAuC,CAAA;IACvC,oDAAiC,CAAA;IACjC,mEAAgD,CAAA;IAChD,qEAAkD,CAAA;IAClD,8EAA2D,CAAA;AAC/D,CAAC,EARW,eAAe,+BAAf,eAAe,QAQ1B;AAED,IAAY,aAKX;AALD,WAAY,aAAa;IACrB,wCAAuB,CAAA;IACvB,sCAAqB,CAAA;IACrB,mCAAkB,CAAA;IAClB,8BAA8B;AAClC,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/pid/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA,4CAA0B;AAC1B,2CAAyB;AAkFzB,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,0CAAyB,CAAA;IACzB,sCAAqB,CAAA;IACrB,gCAAe,CAAA;AACnB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAED,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,+BAAa,CAAA;IACb,yCAAuB,CAAA;AAC3B,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED,IAAY,eAQX;AARD,WAAY,eAAe;IACvB,gCAAa,CAAA;IACb,2CAAwB,CAAA;IACxB,0DAAuC,CAAA;IACvC,oDAAiC,CAAA;IACjC,mEAAgD,CAAA;IAChD,qEAAkD,CAAA;IAClD,8EAA2D,CAAA;AAC/D,CAAC,EARW,eAAe,+BAAf,eAAe,QAQ1B;AAED,IAAY,aAKX;AALD,WAAY,aAAa;IACrB,wCAAuB,CAAA;IACvB,sCAAqB,CAAA;IACrB,mCAAkB,CAAA;IAClB,8BAA8B;AAClC,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB"}
@@ -0,0 +1,3 @@
1
+ import { DependencyContainer } from "@golemio/core/dist/shared/tsyringe";
2
+ declare const ogPidContainer: DependencyContainer;
3
+ export { ogPidContainer as OgPidContainer };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OgPidContainer = void 0;
4
+ const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
5
+ const V3InfotextsController_1 = require("../controllers/v3/V3InfotextsController");
6
+ const JISInfotextRepository_1 = require("../data-access/JISInfotextRepository");
7
+ const JISInfotextRopidGTFSStopsRepository_1 = require("../data-access/JISInfotextRopidGTFSStopsRepository");
8
+ const JISInfotextDepartureTransformation_1 = require("../service/transformations/JISInfotextDepartureTransformation");
9
+ const JISInfotextOverviewTransformation_1 = require("../service/transformations/JISInfotextOverviewTransformation");
10
+ const OgPidToken_1 = require("./OgPidToken");
11
+ const ogPidContainer = ioc_1.OutputGatewayContainer.createChildContainer();
12
+ exports.OgPidContainer = ogPidContainer;
13
+ //#region Repositories
14
+ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextRopidGTFSStopsRepository, JISInfotextRopidGTFSStopsRepository_1.JISInfotextRopidGTFSStopsRepository);
15
+ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextRepository, JISInfotextRepository_1.JISInfotextRepository);
16
+ //#endregion
17
+ //#region Transformations
18
+ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextDepartureTransformation, JISInfotextDepartureTransformation_1.JISInfotextDepartureTransformation);
19
+ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextOverviewTransformation, JISInfotextOverviewTransformation_1.JISInfotextOverviewTransformation);
20
+ //#endregion
21
+ //#region Controllers
22
+ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.V3InfotextsController, V3InfotextsController_1.V3InfotextsController);
23
+ //# sourceMappingURL=Di.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,+DAA+E;AAE/E,mFAAgF;AAChF,gFAA6E;AAC7E,4GAAyG;AACzG,sHAAmH;AACnH,oHAAiH;AACjH,6CAA0C;AAE1C,MAAM,cAAc,GAAwB,4BAAsB,CAAC,oBAAoB,EAAE,CAAC;AAgB/D,wCAAc;AAdzC,sBAAsB;AACtB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,mCAAmC,EAAE,yEAAmC,CAAC,CAAC;AACtH,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,qBAAqB,EAAE,6CAAqB,CAAC,CAAC;AAC1F,YAAY;AAEZ,yBAAyB;AACzB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,kCAAkC,EAAE,uEAAkC,CAAC,CAAC;AACpH,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,iCAAiC,EAAE,qEAAiC,CAAC,CAAC;AAClH,YAAY;AAEZ,qBAAqB;AACrB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,qBAAqB,EAAE,6CAAqB,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const OgPidToken: {
2
+ JISInfotextRopidGTFSStopsRepository: symbol;
3
+ JISInfotextRepository: symbol;
4
+ JISInfotextDepartureTransformation: symbol;
5
+ JISInfotextOverviewTransformation: symbol;
6
+ V3InfotextsController: symbol;
7
+ };
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OgPidToken = void 0;
4
+ exports.OgPidToken = {
5
+ //#region Repositories
6
+ JISInfotextRopidGTFSStopsRepository: Symbol(),
7
+ JISInfotextRepository: Symbol(),
8
+ //#endregion
9
+ //#region Transformations
10
+ JISInfotextDepartureTransformation: Symbol(),
11
+ JISInfotextOverviewTransformation: Symbol(),
12
+ //#endregion
13
+ //#region Controllers
14
+ V3InfotextsController: Symbol(),
15
+ //#endregion
16
+ };
17
+ //# sourceMappingURL=OgPidToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OgPidToken.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/ioc/OgPidToken.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;IACtB,sBAAsB;IACtB,mCAAmC,EAAE,MAAM,EAAE;IAC7C,qBAAqB,EAAE,MAAM,EAAE;IAC/B,YAAY;IAEZ,yBAAyB;IACzB,kCAAkC,EAAE,MAAM,EAAE;IAC5C,iCAAiC,EAAE,MAAM,EAAE;IAC3C,YAAY;IAEZ,qBAAqB;IACrB,qBAAqB,EAAE,MAAM,EAAE;IAC/B,YAAY;CACf,CAAC"}
@@ -2,9 +2,10 @@ import { Moment } from "@golemio/core/dist/shared/moment-timezone";
2
2
  import { DepartureFilter, DepartureMode, DepartureOrder, DepartureSkip } from "..";
3
3
  declare class PIDDepartureBoardsModel {
4
4
  private stopsMaxCount;
5
- private ropidVYMIEventsStopsModel;
6
5
  private ropidDeparturesDirectionsModel;
7
6
  private departuresRepository;
7
+ private readonly infotextRepository;
8
+ private readonly infotextTransformation;
8
9
  constructor();
9
10
  /** Retrieves all gtfs stop times for specific stop, optionaly enhanced with realtime delays
10
11
  * @param {string} id Id of the stop
@@ -13,12 +13,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.PIDDepartureBoardsModel = void 0;
16
+ const data_access_1 = require("../data-access");
17
+ const models_1 = require("../../ropid-gtfs/models");
18
+ const trace_provider_1 = require("@golemio/core/dist/monitoring/opentelemetry/trace-provider");
16
19
  const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
17
20
  const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
18
- const models_1 = require("../../ropid-gtfs/models");
19
21
  const _1 = require(".");
20
- const data_access_1 = require("../data-access");
21
- const trace_provider_1 = require("@golemio/core/dist/monitoring/opentelemetry/trace-provider");
22
+ const Di_1 = require("../ioc/Di");
23
+ const OgPidToken_1 = require("../ioc/OgPidToken");
22
24
  const PIDDepartureModel_1 = __importDefault(require("./helpers/PIDDepartureModel"));
23
25
  class PIDDepartureBoardsModel {
24
26
  constructor() {
@@ -31,7 +33,7 @@ class PIDDepartureBoardsModel {
31
33
  var _a, _b;
32
34
  const currentMoment = (0, moment_timezone_1.default)();
33
35
  const minutesOffset = options.timeFrom ? options.timeFrom.diff(currentMoment, "minutes") : 0;
34
- const spanStops = (0, trace_provider_1.createChildSpan)("PIDRouter.DB.stops");
36
+ const spanStops = (0, trace_provider_1.createChildSpan)("V2PIDRouter.DB.stops");
35
37
  spanStops === null || spanStops === void 0 ? void 0 : spanStops.setAttributes(Object.assign(Object.assign({}, options), { timeFrom: (_a = options.timeFrom) === null || _a === void 0 ? void 0 : _a.toString() }));
36
38
  const stopsToInclude = yield models_1.models.GTFSStopModel.GetAll({
37
39
  includeMetroTrains: options.includeMetroTrains,
@@ -52,16 +54,23 @@ class PIDDepartureBoardsModel {
52
54
  }
53
55
  const stopsIds = stopsToInclude.map((e) => e.stop_id);
54
56
  spanStops === null || spanStops === void 0 ? void 0 : spanStops.end();
55
- const spanVymi = (0, trace_provider_1.createChildSpan)("PIDRouter.DB.vymi");
57
+ const spanInfotexts = (0, trace_provider_1.createChildSpan)("V2PIDRouter.DB.infotexts");
56
58
  let infotextsToInclude;
57
59
  try {
58
- infotextsToInclude = yield this.ropidVYMIEventsStopsModel.GetAllDistinctWithEvents(stopsIds, (_b = options.timeFrom) !== null && _b !== void 0 ? _b : currentMoment, options.timezone);
60
+ const infotexts = yield this.infotextRepository.findAllForDepartureBoard(stopsIds, ((_b = options.timeFrom) !== null && _b !== void 0 ? _b : currentMoment).toDate());
61
+ infotextsToInclude = this.infotextTransformation.transformArray(infotexts.map((infotext) => ({
62
+ data: infotext,
63
+ timeZone: options.timezone,
64
+ })));
59
65
  }
60
66
  catch (err) {
67
+ if (err instanceof golemio_errors_1.AbstractGolemioError) {
68
+ throw err;
69
+ }
61
70
  throw new golemio_errors_1.GeneralError("Database error", "DepartureBoardsModel", err, 500);
62
71
  }
63
- spanVymi === null || spanVymi === void 0 ? void 0 : spanVymi.end();
64
- const spanDirections = (0, trace_provider_1.createChildSpan)("PIDRouter.DB.directions");
72
+ spanInfotexts === null || spanInfotexts === void 0 ? void 0 : spanInfotexts.end();
73
+ const spanDirections = (0, trace_provider_1.createChildSpan)("V2PIDRouter.DB.directions");
65
74
  let departuresDirections;
66
75
  try {
67
76
  departuresDirections = yield this.ropidDeparturesDirectionsModel.GetAll(stopsIds);
@@ -80,7 +89,7 @@ class PIDDepartureBoardsModel {
80
89
  mode: options.mode,
81
90
  isAirCondition: !!options.airCondition,
82
91
  });
83
- const spanDepartures = (0, trace_provider_1.createChildSpan)("PIDRouter.DB.departures");
92
+ const spanDepartures = (0, trace_provider_1.createChildSpan)("V2PIDRouter.DB.departures");
84
93
  const res = {
85
94
  departures: new PIDDepartureModel_1.default(results, {
86
95
  limit: options.limit,
@@ -103,9 +112,10 @@ class PIDDepartureBoardsModel {
103
112
  throw new golemio_errors_1.GeneralError("Database error", "DepartureBoardsModel", err, 500);
104
113
  }
105
114
  });
106
- this.ropidVYMIEventsStopsModel = new _1.RopidVYMIEventsStopsModel();
107
115
  this.ropidDeparturesDirectionsModel = new _1.RopidDeparturesDirectionsModel();
108
116
  this.departuresRepository = new data_access_1.DeparturesRepository();
117
+ this.infotextRepository = Di_1.OgPidContainer.resolve(OgPidToken_1.OgPidToken.JISInfotextRepository);
118
+ this.infotextTransformation = Di_1.OgPidContainer.resolve(OgPidToken_1.OgPidToken.JISInfotextDepartureTransformation);
109
119
  }
110
120
  }
111
121
  exports.PIDDepartureBoardsModel = PIDDepartureBoardsModel;
@@ -1 +1 @@
1
- {"version":3,"file":"PIDDepartureBoardsModel.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/models/PIDDepartureBoardsModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6EAAwE;AACxE,gGAA2E;AAC3E,oDAA+C;AAC/C,wBAA8E;AAG9E,gDAA2D;AAE3D,+FAA6F;AAE7F,oFAA6D;AAE7D,MAAM,uBAAuB;IAMzB;QALQ,kBAAa,GAAG,GAAG,CAAC;QAW5B;;;WAGG;QACI,WAAM,GAAG,CAAO,OAkBtB,EAAgB,EAAE;;YACf,MAAM,aAAa,GAAG,IAAA,yBAAM,GAAE,CAAC;YAC/B,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAE7F,MAAM,SAAS,GAAG,IAAA,gCAAe,EAAC,oBAAoB,CAAC,CAAC;YACxD,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,aAAa,CAAC,gCAAK,OAAO,KAAE,QAAQ,EAAE,MAAA,OAAO,CAAC,QAAQ,0CAAE,QAAQ,EAAE,GAAoB,CAAC,CAAC;YACnG,MAAM,cAAc,GAAG,MAAM,eAAM,CAAC,aAAa,CAAC,MAAM,CAAC;gBACrD,kBAAkB,EAAE,OAAO,CA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,EAAE,IAAI,2BAAkB,CAAC,OAAO,EAAE;wBACxC,KAAK,EAAE,OAAO,CAAC,KAAK;wBACpB,MAAM,EAAE,OAAO,CAAC,MAAM;wBACtB,KAAK,EAAE,OAAO,CAAC,KAAK;wBACpB,IAAI,EAAE,OAAO,CAAC,IAAI;wBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;wBACpB,MAAM,EAAE,OAAO,CAAC,MAAM;wBACtB,IAAI,EAAE,OAAO,CAAC,IAAI;wBAClB,oBAAoB;wBACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ;qBAC7B,CAAC,CAAC,OAAO,EAAE;oBACZ,SAAS,EAAE,kBAAkB;oBAC7B,KAAK,EAAE,cAAc;iBACxB,CAAC;gBACF,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,GAAG,EAAE,CAAC;gBACtB,OAAO,GAAG,CAAC;aACd;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,6BAAY,CAAC,gBAAgB,EAAE,sBAAsB,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;aAC9E;QACL,CAAC,CAAA,CAAC;QA9HE,IAAI,CAAC,8BAA8B,GAAG,IAAI,iCAA8B,EAAE,CAAC;QAC3E,IAAI,CAAC,oBAAoB,GAAG,IAAI,kCAAoB,EAAE,CAAC;QACvD,IAAI,CAAC,kBAAkB,GAAG,mBAAc,CAAC,OAAO,CAAwB,uBAAU,CAAC,qBAAqB,CAAC,CAAC;QAC1G,IAAI,CAAC,sBAAsB,GAAG,mBAAc,CAAC,OAAO,CAChD,uBAAU,CAAC,kCAAkC,CAChD,CAAC;IACN,CAAC;CAyHJ;AAEQ,0DAAuB"}
@@ -1,9 +1,5 @@
1
1
  import { SequelizeModel } from "@golemio/core/dist/output-gateway";
2
- import moment from "@golemio/core/dist/shared/moment-timezone";
3
- export declare enum InfotextsDisplayTypeEnum {
4
- INLINE = "inline",
5
- GENERAL = "general"
6
- }
2
+ import { InfotextDisplayType } from "../domain/InfotextDisplayTypeEnum";
7
3
  interface IInfotextsStopsWithEventModel {
8
4
  valid_from: Date | null;
9
5
  valid_to: Date | null;
@@ -19,14 +15,8 @@ interface IInfotextsStopsWithRoutesModel extends IInfotextsStopsWithEventModel {
19
15
  last_updated_user: string;
20
16
  related_routes: string[];
21
17
  }
22
- export interface IInfotextsStopsWithEventOutputModel extends Omit<IInfotextsStopsWithEventModel, "stop_type" | "valid_from" | "valid_to"> {
23
- display_type: InfotextsDisplayTypeEnum;
24
- text_en: null;
25
- valid_from: string | null;
26
- valid_to: string | null;
27
- }
28
18
  interface IInfotextsStopsWithRoutesOutputModel extends Omit<IInfotextsStopsWithRoutesModel, "stop_type" | "expiration_date" | "last_updated" | "valid_from" | "valid_to"> {
29
- display_type: InfotextsDisplayTypeEnum;
19
+ display_type: InfotextDisplayType;
30
20
  text_en: null;
31
21
  expiration_date: string | null;
32
22
  last_updated: string;
@@ -44,17 +34,10 @@ export declare class RopidVYMIEventsStopsModel extends SequelizeModel {
44
34
  GetAll(options?: any): Promise<any>;
45
35
  GetOne(id: any): Promise<any>;
46
36
  constructor();
47
- /** Retrieves all infotexts with event, could be inner joined with set of stops
48
- *
49
- * @param {string[]} stopsIds - Array of GTFS stop ids to be inner joined with corresponding infotexts
50
- * @param {Moment} timeFrom - Timestamp to filter out specified expiration_date column greater than this value
51
- */
52
- GetAllDistinctWithEvents: (stopsIds: string[], timeFrom: moment.Moment | undefined, timezone: string) => Promise<IInfotextsStopsWithEventOutputModel[]>;
53
37
  /**
54
38
  * Retrieve all infotexts with routes
55
39
  */
56
40
  GetAllWithRoutes: (timezone: string) => Promise<IInfotextsStopsWithRoutesOutputModel[]>;
57
- private mapDataWithEvent;
58
41
  private mapDataWithRoutes;
59
42
  private mapStopTypeToDisplayType;
60
43
  }
@@ -23,7 +23,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
23
23
  return (mod && mod.__esModule) ? mod : { "default": mod };
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.RopidVYMIEventsStopsModel = exports.InfotextsDisplayTypeEnum = void 0;
26
+ exports.RopidVYMIEventsStopsModel = void 0;
27
27
  const models_1 = require("./");
28
28
  const GTFSStopModel_1 = require("../../ropid-gtfs/models/GTFSStopModel");
29
29
  const shared_1 = require("../../shared");
@@ -31,20 +31,9 @@ const const_1 = require("../../../schema-definitions/const");
31
31
  const ropid_gtfs_1 = require("../../../schema-definitions/ropid-gtfs");
32
32
  const ropid_vymi_1 = require("../../../schema-definitions/ropid-vymi");
33
33
  const output_gateway_1 = require("@golemio/core/dist/output-gateway");
34
- const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
35
- const sequelize_1 = __importDefault(require("@golemio/core/dist/shared/sequelize"));
36
34
  const ioc_1 = require("@golemio/core/dist/output-gateway/ioc/");
37
- var InfotextsRecordTypeEnum;
38
- (function (InfotextsRecordTypeEnum) {
39
- InfotextsRecordTypeEnum[InfotextsRecordTypeEnum["EXCEPTION"] = 1] = "EXCEPTION";
40
- InfotextsRecordTypeEnum[InfotextsRecordTypeEnum["PLANNED_RESTRICTION"] = 2] = "PLANNED_RESTRICTION";
41
- InfotextsRecordTypeEnum[InfotextsRecordTypeEnum["PERMANENT_CHANGE"] = 3] = "PERMANENT_CHANGE";
42
- })(InfotextsRecordTypeEnum || (InfotextsRecordTypeEnum = {}));
43
- var InfotextsDisplayTypeEnum;
44
- (function (InfotextsDisplayTypeEnum) {
45
- InfotextsDisplayTypeEnum["INLINE"] = "inline";
46
- InfotextsDisplayTypeEnum["GENERAL"] = "general";
47
- })(InfotextsDisplayTypeEnum || (exports.InfotextsDisplayTypeEnum = InfotextsDisplayTypeEnum = {}));
35
+ const sequelize_1 = __importDefault(require("@golemio/core/dist/shared/sequelize"));
36
+ const InfotextDisplayTypeEnum_1 = require("../domain/InfotextDisplayTypeEnum");
48
37
  /**
49
38
  * Custom Postgres model for Ropid VYMI Events
50
39
  */
@@ -57,49 +46,6 @@ class RopidVYMIEventsStopsModel extends output_gateway_1.SequelizeModel {
57
46
  }
58
47
  constructor() {
59
48
  super(ropid_vymi_1.RopidVYMI.eventsStops.name + "Model", ropid_vymi_1.RopidVYMI.eventsStops.pgTableName, ropid_vymi_1.RopidVYMI.eventsStops.outputSequelizeAttributes, { schema: const_1.PG_SCHEMA });
60
- /** Retrieves all infotexts with event, could be inner joined with set of stops
61
- *
62
- * @param {string[]} stopsIds - Array of GTFS stop ids to be inner joined with corresponding infotexts
63
- * @param {Moment} timeFrom - Timestamp to filter out specified expiration_date column greater than this value
64
- */
65
- this.GetAllDistinctWithEvents = (stopsIds, timeFrom = (0, moment_timezone_1.default)(), timezone) => __awaiter(this, void 0, void 0, function* () {
66
- if (stopsIds.length < 1) {
67
- return [];
68
- }
69
- const data = yield this.sequelizeModel.findAll({
70
- attributes: [
71
- "valid_from",
72
- "valid_to",
73
- "text",
74
- "stop_type",
75
- [sequelize_1.default.fn("ARRAY_AGG", sequelize_1.default.col("gtfs_stop_id")), "related_stops"],
76
- ],
77
- include: {
78
- attributes: [],
79
- as: "vymi_event",
80
- model: this.dbConnector.getConnection().models[ropid_vymi_1.RopidVYMI.events.pgTableName],
81
- where: {
82
- time_from: {
83
- [sequelize_1.default.Op.lte]: new Date().toISOString(),
84
- },
85
- expiration_date: {
86
- [sequelize_1.default.Op.or]: [null, { [sequelize_1.default.Op.gte]: timeFrom.toISOString() }],
87
- },
88
- },
89
- },
90
- where: {
91
- gtfs_stop_id: {
92
- [sequelize_1.default.Op.in]: stopsIds,
93
- },
94
- text: {
95
- [sequelize_1.default.Op.and]: [{ [sequelize_1.default.Op.ne]: null }, { [sequelize_1.default.Op.ne]: "" }],
96
- },
97
- },
98
- group: ["valid_from", "valid_to", "text", "stop_type", "vymi_event.vymi_id"],
99
- raw: true,
100
- });
101
- return this.mapDataWithEvent(data, timezone);
102
- });
103
49
  /**
104
50
  * Retrieve all infotexts with routes
105
51
  */
@@ -165,12 +111,6 @@ class RopidVYMIEventsStopsModel extends output_gateway_1.SequelizeModel {
165
111
  });
166
112
  return this.mapDataWithRoutes(data, timezone);
167
113
  });
168
- this.mapDataWithEvent = (items, timezone) => {
169
- return items.map((item) => {
170
- const { stop_type: stopType, valid_from, valid_to } = item, infotextsStopModel = __rest(item, ["stop_type", "valid_from", "valid_to"]);
171
- return Object.assign(Object.assign({ display_type: this.mapStopTypeToDisplayType(stopType), text_en: null }, infotextsStopModel), { valid_from: shared_1.RopidRouterUtils.formatTimestamp(valid_from, timezone), valid_to: shared_1.RopidRouterUtils.formatTimestamp(valid_to, timezone) });
172
- });
173
- };
174
114
  this.mapDataWithRoutes = (items, timezone) => {
175
115
  return items.map((item) => {
176
116
  const { vymi_id, vymi_id_dtb, stop_type: stopType, expiration_date, last_updated, valid_from, valid_to, last_updated_user } = item, infotextsStopModel = __rest(item, ["vymi_id", "vymi_id_dtb", "stop_type", "expiration_date", "last_updated", "valid_from", "valid_to", "last_updated_user"]);
@@ -179,7 +119,7 @@ class RopidVYMIEventsStopsModel extends output_gateway_1.SequelizeModel {
179
119
  };
180
120
  this.mapStopTypeToDisplayType = (stopType) => {
181
121
  // stop type 1 and 9 leads to general infotext type
182
- return stopType === 1 || stopType === 9 ? InfotextsDisplayTypeEnum.GENERAL : InfotextsDisplayTypeEnum.INLINE;
122
+ return stopType === 1 || stopType === 9 ? InfotextDisplayTypeEnum_1.InfotextDisplayType.General : InfotextDisplayTypeEnum_1.InfotextDisplayType.Inline;
183
123
  };
184
124
  this.dbConnector = ioc_1.OutputGatewayContainer.resolve(ioc_1.ContainerToken.PostgresDatabase);
185
125
  this.eventsModel = new models_1.RopidVYMIEventsModel();
@@ -1 +1 @@
1
- {"version":3,"file":"RopidVYMIEventsStopsModel.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/models/RopidVYMIEventsStopsModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAkF;AAClF,yEAAoE;AACpE,yCAA8C;AAC9C,6DAAuC;AACvC,uEAA4C;A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,iBAAiB,GAAG,IAAI,mCAA0B,EAAE,CAAC;QAC1D,IAAI,CAAC,cAAc,GAAG,IAAI,6BAAa,EAAE,CAAC;QAE1C,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE;YAC3D,EAAE,EAAE,YAAY;YAChB,SAAS,EAAE,SAAS;YACpB,UAAU,EAAE,UAAU;SACzB,CAAC,CAAC;QAEH,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE;YAC/D,EAAE,EAAE,YAAY;YAChB,UAAU,EAAE,UAAU;YACtB,SAAS,EAAE,UAAU;SACxB,CAAC,CAAC;QAEH,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,cAAc,EAAE;YAC3D,EAAE,EAAE,WAAW;YACf,UAAU,EAAE,SAAS;YACrB,SAAS,EAAE,cAAc;SAC5B,CAAC,CAAC;IACP,CAAC;CA2KJ;AAvND,8DAuNC"}
1
+ {"version":3,"file":"RopidVYMIEventsStopsModel.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/models/RopidVYMIEventsStopsModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAkF;AAClF,yEAAoE;AACpE,yCAA8C;AAC9C,6DAAuC;AACvC,uEAA4C;AAC5C,uEAA4C;AAE5C,sEAAmE;AACnE,gEAAgG;AAChG,oFAA4D;AAC5D,+EAAwE;AA6BxE;;GAEG;AACH,MAAa,yBAA0B,SAAQ,+BAAc;IAMzD,MAAM,CAAC,OAAa;QAChB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IACD,MAAM,CAAC,EAAO;QACV,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED;QACI,KAAK,CACD,sBAAS,CAAC,WAAW,CAAC,IAAI,GAAG,OAAO,EACpC,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AAC;QAEH,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE;YAC/D,EAAE,EAAE,YAAY;YAChB,UAAU,EAAE,UAAU;YACtB,SAAS,EAAE,UAAU;SACxB,CAAC,CAAC;QAEH,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,cAAc,EAAE;YAC3D,EAAE,EAAE,WAAW;YACf,UAAU,EAAE,SAAS;YACrB,SAAS,EAAE,cAAc;SAC5B,CAAC,CAAC;IACP,CAAC;CAyGJ;AArJD,8DAqJC"}
@@ -0,0 +1,2 @@
1
+ export { v2PidRouter } from "./v2/V2PIDRouter";
2
+ export { v3PidRouter } from "./v3/V3PIDRouter";
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.v3PidRouter = exports.v2PidRouter = void 0;
4
+ var V2PIDRouter_1 = require("./v2/V2PIDRouter");
5
+ Object.defineProperty(exports, "v2PidRouter", { enumerable: true, get: function () { return V2PIDRouter_1.v2PidRouter; } });
6
+ var V3PIDRouter_1 = require("./v3/V3PIDRouter");
7
+ Object.defineProperty(exports, "v3PidRouter", { enumerable: true, get: function () { return V3PIDRouter_1.v3PidRouter; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/routers/index.ts"],"names":[],"mappings":";;;AAAA,gDAA+C;AAAtC,0GAAA,WAAW,OAAA;AACpB,gDAA+C;AAAtC,0GAAA,WAAW,OAAA"}
@@ -3,17 +3,18 @@
3
3
  * Handles web logic (http request, response). Sets response headers, handles error responses.
4
4
  */
5
5
  /// <reference types="express" />
6
- import { BaseRouter } from "@golemio/core/dist/output-gateway/routes/BaseRouter";
6
+ import { AbstractRouter } from "@golemio/core/dist/helpers/routing/AbstractRouter";
7
7
  import { Router } from "@golemio/core/dist/shared/express";
8
- export declare class PIDRouter extends BaseRouter {
8
+ export declare class V2PIDRouter extends AbstractRouter {
9
9
  readonly router: Router;
10
10
  private cacheHeaderMiddleware;
11
11
  private readonly departureBoardsController;
12
12
  private readonly infotextsController;
13
13
  constructor();
14
+ protected initRoutes: () => void;
14
15
  private registerDepartureBoardsRoutes;
15
16
  private registerInfotextsRoutes;
16
17
  private commonMiddleware;
17
18
  }
18
- declare const pidRouter: Router;
19
- export { pidRouter };
19
+ declare const v2PidRouter: AbstractRouter;
20
+ export { v2PidRouter };
@@ -4,20 +4,25 @@
4
4
  * Handles web logic (http request, response). Sets response headers, handles error responses.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.pidRouter = exports.PIDRouter = void 0;
7
+ exports.v2PidRouter = exports.V2PIDRouter = void 0;
8
+ const V2DepartureBoardsController_1 = require("../../controllers/v2/V2DepartureBoardsController");
9
+ const V2InfotextsController_1 = require("../../controllers/v2/V2InfotextsController");
10
+ const ParamValidatorManager_1 = require("../../helpers/ParamValidatorManager");
11
+ const constants_1 = require("../../../shared/constants");
12
+ const AbstractRouter_1 = require("@golemio/core/dist/helpers/routing/AbstractRouter");
8
13
  const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
9
14
  const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
10
- const BaseRouter_1 = require("@golemio/core/dist/output-gateway/routes/BaseRouter");
11
15
  const express_1 = require("@golemio/core/dist/shared/express");
12
16
  const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
13
- const const_1 = require("../../const");
14
- const constants_1 = require("../shared/constants");
15
- const controllers_1 = require("./controllers");
16
- const ParamValidatorManager_1 = require("./helpers/ParamValidatorManager");
17
- class PIDRouter extends BaseRouter_1.BaseRouter {
17
+ const const_1 = require("../../../../const");
18
+ class V2PIDRouter extends AbstractRouter_1.AbstractRouter {
18
19
  constructor() {
19
- super();
20
+ super(constants_1.RouteVersion.v2, "pid");
20
21
  this.router = (0, express_1.Router)();
22
+ this.initRoutes = () => {
23
+ this.registerDepartureBoardsRoutes();
24
+ this.registerInfotextsRoutes();
25
+ };
21
26
  this.registerDepartureBoardsRoutes = () => {
22
27
  const { preferredTimezone, departureBoards: { departureMode, order, filter, skip }, } = constants_1.ValidationArrays;
23
28
  const validation = [
@@ -67,14 +72,12 @@ class PIDRouter extends BaseRouter_1.BaseRouter {
67
72
  };
68
73
  this.commonMiddleware = (name) => [Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)(name)];
69
74
  this.cacheHeaderMiddleware = ioc_1.OutputGatewayContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
70
- this.departureBoardsController = new controllers_1.DepartureBoardsController();
71
- this.infotextsController = new controllers_1.InfotextsController();
72
- // Register routes
73
- this.registerDepartureBoardsRoutes();
74
- this.registerInfotextsRoutes();
75
+ this.departureBoardsController = new V2DepartureBoardsController_1.V2DepartureBoardsController();
76
+ this.infotextsController = new V2InfotextsController_1.V2InfotextsController();
77
+ this.initRoutes();
75
78
  }
76
79
  }
77
- exports.PIDRouter = PIDRouter;
78
- const pidRouter = new PIDRouter().router;
79
- exports.pidRouter = pidRouter;
80
- //# sourceMappingURL=PIDRouter.js.map
80
+ exports.V2PIDRouter = V2PIDRouter;
81
+ const v2PidRouter = new V2PIDRouter();
82
+ exports.v2PidRouter = v2PidRouter;
83
+ //# sourceMappingURL=V2PIDRouter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V2PIDRouter.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/routers/v2/V2PIDRouter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kGAAiG;AACjG,sFAAqF;AACrF,+EAA8E;AAC9E,yDAAsE;AACtE,sFAAmF;AAEnF,6EAAkH;AAClH,+DAA+F;AAC/F,+DAA2D;AAC3D,mFAA2E;AAC3E,6CAAsF;AAEtF,MAAa,WAAY,SAAQ,+BAAc;IAM3C;QACI,KAAK,CAAC,wBAAY,CAAC,EA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kCAoFC;AAED,MAAM,WAAW,GAAmB,IAAI,WAAW,EAAE,CAAC;AAC7C,kCAAW"}
@@ -0,0 +1,11 @@
1
+ import { AbstractRouter } from "@golemio/core/dist/helpers/routing/AbstractRouter";
2
+ export declare class V3PIDRouter extends AbstractRouter {
3
+ readonly router: import("express-serve-static-core").Router;
4
+ private readonly cacheHeaderMiddleware;
5
+ private readonly infotextsController;
6
+ constructor();
7
+ protected initRoutes: () => void;
8
+ private registerInfotextsRoutes;
9
+ }
10
+ declare const v3PidRouter: AbstractRouter;
11
+ export { v3PidRouter };
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.v3PidRouter = exports.V3PIDRouter = void 0;
4
+ const Di_1 = require("../../ioc/Di");
5
+ const OgPidToken_1 = require("../../ioc/OgPidToken");
6
+ const constants_1 = require("../../../shared/constants");
7
+ const AbstractRouter_1 = require("@golemio/core/dist/helpers/routing/AbstractRouter");
8
+ const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
9
+ const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
10
+ const express_1 = require("@golemio/core/dist/shared/express");
11
+ class V3PIDRouter extends AbstractRouter_1.AbstractRouter {
12
+ constructor() {
13
+ super(constants_1.RouteVersion.v3, "pid");
14
+ this.router = (0, express_1.Router)();
15
+ this.initRoutes = () => {
16
+ this.registerInfotextsRoutes();
17
+ };
18
+ this.registerInfotextsRoutes = () => {
19
+ this.router.get("/infotexts", Validation_1.checkErrors,
20
+ // max-age 10 seconds, stale-while-revalidate 10 seconds
21
+ this.cacheHeaderMiddleware.getMiddleware(10, 10), this.infotextsController.getJisInfotexts);
22
+ };
23
+ this.cacheHeaderMiddleware = Di_1.OgPidContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
24
+ this.infotextsController = Di_1.OgPidContainer.resolve(OgPidToken_1.OgPidToken.V3InfotextsController);
25
+ this.initRoutes();
26
+ }
27
+ }
28
+ exports.V3PIDRouter = V3PIDRouter;
29
+ const v3PidRouter = new V3PIDRouter();
30
+ exports.v3PidRouter = v3PidRouter;
31
+ //# sourceMappingURL=V3PIDRouter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V3PIDRouter.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/routers/v3/V3PIDRouter.ts"],"names":[],"mappings":";;;AACA,qCAAgD;AAChD,qDAAoD;AACpD,yDAAoD;AACpD,sFAAmF;AAEnF,6EAA2E;AAC3E,+DAAuE;AACvE,+DAA2D;AAE3D,MAAa,WAAY,SAAQ,+BAAc;IAK3C;QACI,KAAK,CAAC,wBAAY,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QALlB,WAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;QAWxB,eAAU,GAAG,GAAS,EAAE;YAC9B,IAAI,CAAC,uBAAuB,EAAE,CAAC;QACnC,CAAC,CAAC;QAEM,4BAAuB,GAAG,GAAG,EAAE;YACnC,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,YAAY,EACZ,wBAAW;YACX,wDAAwD;YACxD,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,CAAC,EAChD,IAAI,CAAC,mBAAmB,CAAC,eAAe,CAC3C,CAAC;QACN,CAAC,CAAC;QAjBE,IAAI,CAAC,qBAAqB,GAAG,mBAAc,CAAC,OAAO,CAAwB,oBAAc,CAAC,qBAAqB,CAAC,CAAC;QACjH,IAAI,CAAC,mBAAmB,GAAG,mBAAc,CAAC,OAAO,CAAwB,uBAAU,CAAC,qBAAqB,CAAC,CAAC;QAC3G,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;CAeJ;AAzBD,kCAyBC;AAED,MAAM,WAAW,GAAmB,IAAI,WAAW,EAAE,CAAC;AAC7C,kCAAW"}
@@ -0,0 +1,10 @@
1
+ import { InfotextDisplayType } from "../../domain/InfotextDisplayTypeEnum";
2
+ export declare class DisplayTypeMapper {
3
+ /**
4
+ * Map input display type from DB to output display type for API
5
+ *
6
+ * @param input Display type from DB
7
+ * @returns Display type for API
8
+ */
9
+ static mapInputToOutputDisplayType(input: string): InfotextDisplayType;
10
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DisplayTypeMapper = void 0;
4
+ const InfotextDisplayTypeEnum_1 = require("../../domain/InfotextDisplayTypeEnum");
5
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
6
+ class DisplayTypeMapper {
7
+ /**
8
+ * Map input display type from DB to output display type for API
9
+ *
10
+ * @param input Display type from DB
11
+ * @returns Display type for API
12
+ */
13
+ static mapInputToOutputDisplayType(input) {
14
+ switch (input) {
15
+ case "INLINE":
16
+ return InfotextDisplayTypeEnum_1.InfotextDisplayType.Inline;
17
+ case "GENERAL":
18
+ return InfotextDisplayTypeEnum_1.InfotextDisplayType.General;
19
+ default:
20
+ throw new golemio_errors_1.GeneralError(`Unknown display type: ${input}`);
21
+ }
22
+ }
23
+ }
24
+ exports.DisplayTypeMapper = DisplayTypeMapper;
25
+ //# sourceMappingURL=DisplayTypeMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DisplayTypeMapper.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/helpers/DisplayTypeMapper.ts"],"names":[],"mappings":";;;AAAA,kFAA6E;AAC7E,6EAAwE;AAExE,MAAa,iBAAiB;IAC1B;;;;;OAKG;IACI,MAAM,CAAC,2BAA2B,CAAC,KAAa;QACnD,QAAQ,KAAK,EAAE;YACX,KAAK,QAAQ;gBACT,OAAO,6CAAmB,CAAC,MAAM,CAAC;YACtC,KAAK,SAAS;gBACV,OAAO,6CAAmB,CAAC,OAAO,CAAC;YACvC;gBACI,MAAM,IAAI,6BAAY,CAAC,yBAAyB,KAAK,EAAE,CAAC,CAAC;SAChE;IACL,CAAC;CACJ;AAjBD,8CAiBC"}