@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,7 +1,5 @@
1
1
  "use strict";
2
2
  /**
3
- * app/routers/DepartureBoardsRouter.ts
4
- *
5
3
  * DEPRECATED!!! use PIDDepartureBoardsRoutes.ts instead
6
4
  *
7
5
  * Router /WEB LAYER/: maps routes to specific controller functions, passes request parameters and handles responses.
@@ -20,23 +18,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
20
18
  return (mod && mod.__esModule) ? mod : { "default": mod };
21
19
  };
22
20
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.departureBoardsRouter = exports.DepartureBoardsRouter = void 0;
24
- const pid_1 = require("../pid");
25
- const shared_1 = require("../shared");
26
- const constants_1 = require("../shared/constants");
21
+ exports.v2DepartureBoardsRouter = exports.V2DepartureBoardsRouter = void 0;
22
+ const pid_1 = require("../../../pid");
23
+ const shared_1 = require("../../../shared");
24
+ const constants_1 = require("../../../shared/constants");
25
+ const AbstractRouter_1 = require("@golemio/core/dist/helpers/routing/AbstractRouter");
27
26
  const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
28
27
  const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
29
- const BaseRouter_1 = require("@golemio/core/dist/output-gateway/routes/BaseRouter");
30
28
  const express_1 = require("@golemio/core/dist/shared/express");
31
29
  const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
32
30
  const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
33
- const const_1 = require("../../const");
31
+ const const_1 = require("../../../../const");
34
32
  /**
35
33
  * @deprecated use /pid/departureboards instead
36
34
  */
37
- class DepartureBoardsRouter extends BaseRouter_1.BaseRouter {
35
+ class V2DepartureBoardsRouter extends AbstractRouter_1.AbstractRouter {
38
36
  constructor() {
39
- super();
37
+ super(constants_1.RouteVersion.v2, "departureboards");
40
38
  // Assign router to the express.Router() instance
41
39
  this.router = (0, express_1.Router)();
42
40
  this.defaultQueryParameters = {
@@ -51,10 +49,10 @@ class DepartureBoardsRouter extends BaseRouter_1.BaseRouter {
51
49
  },
52
50
  };
53
51
  this.GetDepartureBoard = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
54
- const aswIds = this.ConvertToArray(req.query.aswIds || []);
55
- const cisIds = this.ConvertToArray(req.query.cisIds || []);
56
- const gtfsIds = this.ConvertToArray(req.query.ids || []);
57
- const names = this.ConvertToArray(req.query.names || []);
52
+ const aswIds = shared_1.RopidRouterUtils.convertParamToArray(req.query.aswIds);
53
+ const cisIds = shared_1.RopidRouterUtils.convertParamToArray(req.query.cisIds);
54
+ const gtfsIds = shared_1.RopidRouterUtils.convertParamToArray(req.query.ids);
55
+ const names = shared_1.RopidRouterUtils.convertParamToArray(req.query.names);
58
56
  const limit = parseInt(req.query.limit || this.defaultQueryParameters.limit, 10);
59
57
  const preferredTimezone = shared_1.RopidRouterUtils.getPreferredTimezone(req.query.preferredTimezone);
60
58
  const timezoneDefinedRegexp = /[T ][\d:\.]+([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)/;
@@ -152,7 +150,10 @@ class DepartureBoardsRouter extends BaseRouter_1.BaseRouter {
152
150
  this.initRoutes();
153
151
  }
154
152
  }
155
- exports.DepartureBoardsRouter = DepartureBoardsRouter;
156
- const departureBoardsRouter = new DepartureBoardsRouter().router;
157
- exports.departureBoardsRouter = departureBoardsRouter;
158
- //# sourceMappingURL=DepartureBoardsRouter.js.map
153
+ exports.V2DepartureBoardsRouter = V2DepartureBoardsRouter;
154
+ /**
155
+ * @deprecated use /pid/departureboards instead
156
+ */
157
+ const v2DepartureBoardsRouter = new V2DepartureBoardsRouter();
158
+ exports.v2DepartureBoardsRouter = v2DepartureBoardsRouter;
159
+ //# sourceMappingURL=V2DepartureBoardsRouter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V2DepartureBoardsRouter.js","sourceRoot":"","sources":["../../../../../src/output-gateway/departure-boards/routers/v2/V2DepartureBoardsRouter.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;AAEH,sCAAuH;AACvH,4CAA8C;AAC9C,yDAAsE;AACtE,sFAAmF;AAEnF,6EAAkH;AAClH,+DAA+F;AAC/F,+DAA4F;AAC5F,mFAA2E;AAC3E,gGAA2E;AAC3E,6CAAsD;AAEtD;;GAEG;AACH,MAAa,uBAAwB,SAAQ,+BAAc;IAmBvD;QACI,KAAK,CAAC,wBAAY,CAAC,EAAE,EAAE,iBAAiB,CAAC,CAAC;QAnB9C,iDAAiD;QAC1C,WAAM,GAAW,IAAA,gBAAM,GAAE,C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,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;gBAC9F,IAAA,yBAAK,EAAC,oBAAoB,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;aACrE,EACD,uBAAU,EACV,wBAAW,EACX,IAAA,sCAAyB,EAAC,uBAAuB,CAAC;YAClD,sDAAsD;YACtD,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,EACxD,IAAI,CAAC,iBAAiB,CACzB,CAAC;QACN,CAAC,CAAC;QAnHE,IAAI,CAAC,qBAAqB,GAAG,4BAAsB,CAAC,OAAO,CAAwB,oBAAc,CAAC,qBAAqB,CAAC,CAAC;QACzH,IAAI,CAAC,oBAAoB,GAAG,IAAI,6BAAuB,EAAE,CAAC;QAC1D,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;CAiHJ;AAzID,0DAyIC;AAED;;GAEG;AACH,MAAM,uBAAuB,GAAmB,IAAI,uBAAuB,EAAE,CAAC;AAErE,0DAAuB"}
@@ -2,3 +2,4 @@ export * as DepartureBoards from "./departure-boards";
2
2
  export * as PID from "./pid";
3
3
  export * as RopidGTFS from "./ropid-gtfs";
4
4
  export * as VehiclePositions from "./vehicle-positions";
5
+ export declare const routers: import("@golemio/core/dist/helpers/routing/AbstractRouter").AbstractRouter[];
@@ -23,9 +23,33 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.VehiclePositions = exports.RopidGTFS = exports.PID = exports.DepartureBoards = void 0;
26
+ exports.routers = exports.VehiclePositions = exports.RopidGTFS = exports.PID = exports.DepartureBoards = void 0;
27
+ const departure_boards_1 = require("./departure-boards");
28
+ const pid_1 = require("./pid");
29
+ const public_1 = require("./public");
30
+ const ropid_gtfs_1 = require("./ropid-gtfs");
31
+ const vehicle_positions_1 = require("./vehicle-positions");
27
32
  exports.DepartureBoards = __importStar(require("./departure-boards"));
28
33
  exports.PID = __importStar(require("./pid"));
29
34
  exports.RopidGTFS = __importStar(require("./ropid-gtfs"));
30
35
  exports.VehiclePositions = __importStar(require("./vehicle-positions"));
36
+ exports.routers = [
37
+ //#region Ropid GTFS
38
+ ropid_gtfs_1.v2GtfsRouter,
39
+ //#endregion
40
+ //#region Vehicle positions
41
+ vehicle_positions_1.v2VehiclepositionsRouter,
42
+ //#region Departure boards (deprecated)
43
+ departure_boards_1.v2DepartureBoardsRouter,
44
+ //#endregion
45
+ //#region PID Departure boards
46
+ pid_1.v2PidRouter,
47
+ pid_1.v3PidRouter,
48
+ //#endregion
49
+ //#region Public Endpoints
50
+ public_1.v2PublicDeparturesRouter,
51
+ public_1.v2PublicGtfsRouter,
52
+ public_1.v2PublicVPRouter,
53
+ //#endregion
54
+ ];
31
55
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/output-gateway/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAsD;AACtD,6CAA6B;AAC7B,0DAA0C;AAC1C,wEAAwD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/output-gateway/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA+D;AAC/D,+BAAmD;AACnD,qCAA4F;AAC5F,6CAA8C;AAC9C,2DAAiE;AAEjE,sEAAsD;AACtD,6CAA6B;AAC7B,0DAA0C;AAC1C,wEAAwD;AAE3C,QAAA,OAAO,GAAG;IACnB,oBAAoB;IACpB,yBAAY;IACZ,YAAY;IAEZ,2BAA2B;IAC3B,4CAAwB;IAExB,uCAAuC;IACvC,0CAAuB;IACvB,YAAY;IAEZ,8BAA8B;IAC9B,iBAAW;IACX,iBAAW;IACX,YAAY;IAEZ,0BAA0B;IAC1B,iCAAwB;IACxB,2BAAkB;IAClB,yBAAgB;IAChB,YAAY;CACf,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="express" />
2
2
  import { RequestHandler } from "@golemio/core/dist/shared/express";
3
- export declare class DepartureBoardsController {
3
+ export declare class V2DepartureBoardsController {
4
4
  private departureBoardsModel;
5
5
  constructor();
6
6
  getDepartureBoard: RequestHandler;
@@ -12,13 +12,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.DepartureBoardsController = void 0;
16
- const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
15
+ exports.V2DepartureBoardsController = void 0;
16
+ const dto_1 = require("../../dto");
17
+ const models_1 = require("../../models");
18
+ const shared_1 = require("../../../shared");
17
19
  const trace_provider_1 = require("@golemio/core/dist/monitoring/opentelemetry/trace-provider");
18
- const shared_1 = require("../../shared");
19
- const models_1 = require("../models");
20
- const dto_1 = require("../dto");
21
- class DepartureBoardsController {
20
+ const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
21
+ class V2DepartureBoardsController {
22
22
  constructor() {
23
23
  this.getDepartureBoard = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
24
24
  var _a;
@@ -37,7 +37,7 @@ class DepartureBoardsController {
37
37
  ? (0, moment_timezone_1.default)(query.timeFrom)
38
38
  : moment_timezone_1.default.tz(query.timeFrom, preferredTimezone)
39
39
  : undefined;
40
- const span = (0, trace_provider_1.createChildSpan)("DepartureBoardsController.getDepartureBoard");
40
+ const span = (0, trace_provider_1.createChildSpan)("V2DepartureBoardsController.getDepartureBoard");
41
41
  try {
42
42
  const data = yield this.departureBoardsModel.GetAll({
43
43
  aswIds: query.aswIds,
@@ -72,5 +72,5 @@ class DepartureBoardsController {
72
72
  this.departureBoardsModel = new models_1.PIDDepartureBoardsModel();
73
73
  }
74
74
  }
75
- exports.DepartureBoardsController = DepartureBoardsController;
76
- //# sourceMappingURL=DepartureBoardsController.js.map
75
+ exports.V2DepartureBoardsController = V2DepartureBoardsController;
76
+ //# sourceMappingURL=V2DepartureBoardsController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V2DepartureBoardsController.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/controllers/v2/V2DepartureBoardsController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mCAAkF;AAClF,yCAAyD;AACzD,4CAA8C;AAC9C,+FAA6F;AAE7F,gGAA2E;AAE3E,MAAa,2BAA2B;IAGpC;QAIO,sBAAiB,GAAmB,CAAO,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;;YAChE,MAAM,KAAK,GAAG,yBAAgB,CAAC,sBAAsB,CAAC,6BAAuB,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;YAC1F,MAAM,iBAAiB,GAAG,yBAAgB,CAAC,oBAAoB,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;YAEzF,oDAAoD;YACpD,cAAc;YACd,uBAAuB;YACvB,0BAA0B;YAC1B,yBAAyB;YACzB,4BAA4B;YAC5B,MAAM,qBAAqB,GAAW,uDAAuD,CAAC;YAC9F,+DAA+D;YAC/D,MAAM,QAAQ,GAAuB,KAAK,CAAC,QAAQ;gBAC/C,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,qBAAqB,CAAC;oBACzC,CAAC,CAAC,IAAA,yBAAM,EAAC,KAAK,CAAC,QAAQ,CAAC;oBACxB,CAAC,CAAC,yBAAM,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,iBAAiB,CAAC;gBAClD,CAAC,CAAC,SAAS,CAAC;YAEhB,MAAM,IAAI,GAAG,IAAA,gCAAe,EAAC,+CAA+C,CAAC,CAAC;YAC9E,IAAI;gBACA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC;oBAChD,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,OAAO,EAAE,KAAK,CAAC,GAAG;oBAClB,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,YAAY,EAAE,KAAK,CAAC,YAAY;oBAChC,aAAa,EAAE,KAAK,CAAC,aAAa;oBAClC,QAAQ;oBACR,IAAI,EAAE,KAAK,CAAC,IAAI;oBAChB,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;oBAChB,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,KAAK,EAAE,MAAA,KAAK,CAAC,KAAK,mCAAI,KAAK,CAAC,KAAK;oBACjC,QAAQ,EAAE,iBAAiB;oBAC3B,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;oBAC5C,YAAY,EAAE,KAAK,CAAC,YAAY;iBACnC,CAAC,CAAC;gBACH,oCAAoC;gBACpC,GAAG,CAAC,SAAS,CAAC,+BAA+B,EAAE,MAAM,CAAC,CAAC;gBACvD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,yBAAgB,CAAC,sBAAsB,CAAC,gCAA0B,EAAE,IAAI,CAAC,CAAC,CAAC;aACnG;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,GAAG,CAAC,CAAC;aACb;oBAAS;gBACN,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,GAAG,EAAE,CAAC;aACf;QACL,CAAC,CAAA,CAAC;QAlDE,IAAI,CAAC,oBAAoB,GAAG,IAAI,gCAAuB,EAAE,CAAC;IAC9D,CAAC;CAkDJ;AAvDD,kEAuDC"}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="express" />
2
2
  import { RequestHandler } from "@golemio/core/dist/shared/express";
3
- export declare class InfotextsController {
3
+ export declare class V2InfotextsController {
4
4
  private readonly eventsStopsModel;
5
5
  constructor();
6
6
  getInfotexts: RequestHandler;
@@ -9,14 +9,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.InfotextsController = void 0;
12
+ exports.V2InfotextsController = void 0;
13
13
  const trace_provider_1 = require("@golemio/core/dist/monitoring/opentelemetry/trace-provider");
14
14
  const config_1 = require("@golemio/core/dist/output-gateway/config");
15
- const models_1 = require("../models");
16
- class InfotextsController {
15
+ const models_1 = require("../../models");
16
+ class V2InfotextsController {
17
17
  constructor() {
18
18
  this.getInfotexts = (_req, res, next) => __awaiter(this, void 0, void 0, function* () {
19
- const span = (0, trace_provider_1.createChildSpan)("InfotextsController.getInfotexts");
19
+ const span = (0, trace_provider_1.createChildSpan)("V2InfotextsController.getInfotexts");
20
20
  try {
21
21
  const preferredTimezone = config_1.config.vehiclePositions.defaultTimezone;
22
22
  const data = yield this.eventsStopsModel.GetAllWithRoutes(preferredTimezone);
@@ -32,5 +32,5 @@ class InfotextsController {
32
32
  this.eventsStopsModel = new models_1.RopidVYMIEventsStopsModel();
33
33
  }
34
34
  }
35
- exports.InfotextsController = InfotextsController;
36
- //# sourceMappingURL=InfotextsController.js.map
35
+ exports.V2InfotextsController = V2InfotextsController;
36
+ //# sourceMappingURL=V2InfotextsController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V2InfotextsController.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/controllers/v2/V2InfotextsController.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+FAA6F;AAC7F,qEAAkE;AAClE,yCAA2D;AAE3D,MAAa,qBAAqB;IAG9B;QAIO,iBAAY,GAAmB,CAAO,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YAC5D,MAAM,IAAI,GAAG,IAAA,gCAAe,EAAC,oCAAoC,CAAC,CAAC;YAEnE,IAAI;gBACA,MAAM,iBAAiB,GAAG,eAAM,CAAC,gBAAgB,CAAC,eAAe,CAAC;gBAClE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;gBAC7E,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC9B;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,GAAG,CAAC,CAAC;aACb;oBAAS;gBACN,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,GAAG,EAAE,CAAC;aACf;QACL,CAAC,CAAA,CAAC;QAfE,IAAI,CAAC,gBAAgB,GAAG,IAAI,kCAAyB,EAAE,CAAC;IAC5D,CAAC;CAeJ;AApBD,sDAoBC"}
@@ -0,0 +1,10 @@
1
+ /// <reference types="express" />
2
+ import { JISInfotextRepository } from "../../data-access/JISInfotextRepository";
3
+ import { JISInfotextOverviewTransformation } from "../../service/transformations/JISInfotextOverviewTransformation";
4
+ import { RequestHandler } from "@golemio/core/dist/shared/express";
5
+ export declare class V3InfotextsController {
6
+ private infotextRepository;
7
+ private infotextTransformation;
8
+ constructor(infotextRepository: JISInfotextRepository, infotextTransformation: JISInfotextOverviewTransformation);
9
+ getJisInfotexts: RequestHandler;
10
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.V3InfotextsController = void 0;
25
+ const JISInfotextRepository_1 = require("../../data-access/JISInfotextRepository");
26
+ const OgPidToken_1 = require("../../ioc/OgPidToken");
27
+ const JISInfotextOverviewTransformation_1 = require("../../service/transformations/JISInfotextOverviewTransformation");
28
+ const trace_provider_1 = require("@golemio/core/dist/monitoring/opentelemetry/trace-provider");
29
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
30
+ let V3InfotextsController = exports.V3InfotextsController = class V3InfotextsController {
31
+ constructor(infotextRepository, infotextTransformation) {
32
+ this.infotextRepository = infotextRepository;
33
+ this.infotextTransformation = infotextTransformation;
34
+ this.getJisInfotexts = (_req, res, next) => __awaiter(this, void 0, void 0, function* () {
35
+ const span = (0, trace_provider_1.createChildSpan)("V3InfotextsController.getJisInfotexts");
36
+ try {
37
+ const infotexts = yield this.infotextRepository.findAllForOverview();
38
+ const outputDto = this.infotextTransformation.transformArray(infotexts);
39
+ res.status(200).send(outputDto);
40
+ }
41
+ catch (err) {
42
+ next(err);
43
+ }
44
+ finally {
45
+ span === null || span === void 0 ? void 0 : span.end();
46
+ }
47
+ });
48
+ }
49
+ };
50
+ exports.V3InfotextsController = V3InfotextsController = __decorate([
51
+ (0, tsyringe_1.injectable)(),
52
+ __param(0, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.JISInfotextRepository)),
53
+ __param(1, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.JISInfotextOverviewTransformation)),
54
+ __metadata("design:paramtypes", [JISInfotextRepository_1.JISInfotextRepository,
55
+ JISInfotextOverviewTransformation_1.JISInfotextOverviewTransformation])
56
+ ], V3InfotextsController);
57
+ //# sourceMappingURL=V3InfotextsController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V3InfotextsController.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/controllers/v3/V3InfotextsController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,mFAAkF;AAClF,qDAAoD;AACpD,uHAAsH;AACtH,+FAA6F;AAE7F,iEAAwE;AAGjE,IAAM,qBAAqB,mCAA3B,MAAM,qBAAqB;IAC9B,YAC8C,kBAAiD,EACrC,sBAAiE;QADrE,uBAAkB,GAAlB,kBAAkB,CAAuB;QAC7B,2BAAsB,GAAtB,sBAAsB,CAAmC;QAGpH,oBAAe,GAAmB,CAAO,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YAC/D,MAAM,IAAI,GAAG,IAAA,gCAAe,EAAC,uCAAuC,CAAC,CAAC;YAEtE,IAAI;gBACA,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,CAAC;gBACrE,MAAM,SAAS,GAAG,IAAI,CAAC,sBAAsB,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;gBACxE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aACnC;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,GAAG,CAAC,CAAC;aACb;oBAAS;gBACN,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,GAAG,EAAE,CAAC;aACf;QACL,CAAC,CAAA,CAAC;IAdC,CAAC;CAeP,CAAA;gCAnBY,qBAAqB;IADjC,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,qBAAqB,CAAC,CAAA;IACxC,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,iCAAiC,CAAC,CAAA;qCADiB,6CAAqB;QACL,qEAAiC;GAHlH,qBAAqB,CAmBjC"}
@@ -0,0 +1,27 @@
1
+ import { JISInfotextsModel } from "../../../schema-definitions/jis/models/JISInfotextsModel";
2
+ import { ILogger } from "@golemio/core/dist/helpers";
3
+ import { IDatabaseConnector } from "@golemio/core/dist/helpers/data-access/postgres/IDatabaseConnector";
4
+ import { AbstractBasicRepository } from "@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractBasicRepository";
5
+ import { JISInfotextRopidGTFSStopsRepository } from "./JISInfotextRopidGTFSStopsRepository";
6
+ export declare class JISInfotextRepository extends AbstractBasicRepository {
7
+ schema: string;
8
+ tableName: string;
9
+ private sequelizeModel;
10
+ private gtfsStopRepository;
11
+ constructor(infotextStopRepository: JISInfotextRopidGTFSStopsRepository, connector: IDatabaseConnector, logger: ILogger);
12
+ /**
13
+ * Find all active infotexts for given stops and time for PID departure boards API
14
+ *
15
+ * @param stopsIds GTFS stop IDs for which the infotexts should be fetched
16
+ * @param timeFrom Time from which the infotexts should be valid (default is current time)
17
+ * @returns Active infotexts
18
+ */
19
+ findAllForDepartureBoard(stopsIds: string[], timeFrom?: Date): Promise<JISInfotextsModel[]>;
20
+ /**
21
+ * Find all active infotexts for given time for PID infotexts API
22
+ *
23
+ * @param timeFrom Time from which the infotexts should be valid (default is current time)
24
+ * @returns Active infotexts
25
+ */
26
+ findAllForOverview(timeFrom?: Date): Promise<JISInfotextsModel[]>;
27
+ }
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.JISInfotextRepository = void 0;
25
+ const GTFSStopModel_1 = require("../../ropid-gtfs/models/GTFSStopModel");
26
+ const const_1 = require("../../../schema-definitions/const");
27
+ const JISInfotextsModel_1 = require("../../../schema-definitions/jis/models/JISInfotextsModel");
28
+ const AbstractBasicRepository_1 = require("@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractBasicRepository");
29
+ const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
30
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
31
+ const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
32
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
33
+ const OgPidToken_1 = require("../ioc/OgPidToken");
34
+ const JISInfotextRopidGTFSStopsRepository_1 = require("./JISInfotextRopidGTFSStopsRepository");
35
+ let JISInfotextRepository = exports.JISInfotextRepository = class JISInfotextRepository extends AbstractBasicRepository_1.AbstractBasicRepository {
36
+ constructor(infotextStopRepository, connector, logger) {
37
+ super(connector, logger);
38
+ this.schema = const_1.PG_SCHEMA;
39
+ this.tableName = JISInfotextsModel_1.JISInfotextsModel.tableName;
40
+ this.sequelizeModel = connector
41
+ .getConnection()
42
+ .define(this.tableName, JISInfotextsModel_1.JISInfotextsModel.attributeModel, { schema: this.schema, timestamps: false });
43
+ this.gtfsStopRepository = new GTFSStopModel_1.GTFSStopModel();
44
+ // associations
45
+ this.sequelizeModel.belongsToMany(this.gtfsStopRepository.sequelizeModel, {
46
+ through: infotextStopRepository.sequelizeModel,
47
+ foreignKey: "infotext_id",
48
+ otherKey: "stop_id",
49
+ as: "stops",
50
+ });
51
+ this.gtfsStopRepository.sequelizeModel.belongsToMany(this.sequelizeModel, {
52
+ through: infotextStopRepository.sequelizeModel,
53
+ foreignKey: "stop_id",
54
+ otherKey: "infotext_id",
55
+ });
56
+ infotextStopRepository.sequelizeModel.belongsTo(this.sequelizeModel, {
57
+ targetKey: "id",
58
+ foreignKey: "infotext_id",
59
+ });
60
+ infotextStopRepository.sequelizeModel.belongsTo(this.gtfsStopRepository.sequelizeModel, {
61
+ targetKey: "stop_id",
62
+ foreignKey: "stop_id",
63
+ });
64
+ this.sequelizeModel.hasMany(infotextStopRepository.sequelizeModel, {
65
+ sourceKey: "id",
66
+ foreignKey: "infotext_id",
67
+ });
68
+ this.gtfsStopRepository.sequelizeModel.hasMany(infotextStopRepository.sequelizeModel, {
69
+ sourceKey: "stop_id",
70
+ foreignKey: "stop_id",
71
+ });
72
+ }
73
+ /**
74
+ * Find all active infotexts for given stops and time for PID departure boards API
75
+ *
76
+ * @param stopsIds GTFS stop IDs for which the infotexts should be fetched
77
+ * @param timeFrom Time from which the infotexts should be valid (default is current time)
78
+ * @returns Active infotexts
79
+ */
80
+ findAllForDepartureBoard(stopsIds, timeFrom = new Date()) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ try {
83
+ return yield this.sequelizeModel.findAll({
84
+ attributes: ["display_type", "active_period_start", "active_period_end", "description_text"],
85
+ where: {
86
+ active_period_start: { [sequelize_1.Op.lte]: timeFrom },
87
+ active_period_end: { [sequelize_1.Op.or]: [{ [sequelize_1.Op.gte]: timeFrom }, { [sequelize_1.Op.is]: null }] },
88
+ },
89
+ include: [
90
+ {
91
+ model: this.gtfsStopRepository.sequelizeModel,
92
+ as: "stops",
93
+ attributes: ["stop_id"],
94
+ where: {
95
+ stop_id: { [sequelize_1.Op.in]: stopsIds },
96
+ },
97
+ through: { attributes: [] },
98
+ required: true,
99
+ },
100
+ ],
101
+ order: [
102
+ // severity_level is an enum, see type jis_infotext_severity_level
103
+ ["severity_level", "DESC"],
104
+ ["created_timestamp", "DESC"],
105
+ ],
106
+ });
107
+ }
108
+ catch (err) {
109
+ throw new golemio_errors_1.GeneralError("Error while getting infotexts for departure board", this.constructor.name, err);
110
+ }
111
+ });
112
+ }
113
+ /**
114
+ * Find all active infotexts for given time for PID infotexts API
115
+ *
116
+ * @param timeFrom Time from which the infotexts should be valid (default is current time)
117
+ * @returns Active infotexts
118
+ */
119
+ findAllForOverview(timeFrom = new Date()) {
120
+ return __awaiter(this, void 0, void 0, function* () {
121
+ try {
122
+ return yield this.sequelizeModel.findAll({
123
+ attributes: ["id", "display_type", "active_period_start", "active_period_end", "description_text"],
124
+ where: {
125
+ active_period_start: { [sequelize_1.Op.lte]: timeFrom },
126
+ active_period_end: { [sequelize_1.Op.or]: [{ [sequelize_1.Op.gte]: timeFrom }, { [sequelize_1.Op.is]: null }] },
127
+ },
128
+ include: [
129
+ {
130
+ model: this.gtfsStopRepository.sequelizeModel,
131
+ as: "stops",
132
+ attributes: ["stop_id", "stop_name", "platform_code"],
133
+ through: { attributes: [] },
134
+ required: true,
135
+ },
136
+ ],
137
+ order: [
138
+ // severity_level is an enum, see type jis_infotext_severity_level
139
+ ["severity_level", "DESC"],
140
+ ["created_timestamp", "DESC"],
141
+ ],
142
+ });
143
+ }
144
+ catch (err) {
145
+ throw new golemio_errors_1.GeneralError("Error while getting infotexts for overview", this.constructor.name, err);
146
+ }
147
+ });
148
+ }
149
+ };
150
+ exports.JISInfotextRepository = JISInfotextRepository = __decorate([
151
+ (0, tsyringe_1.injectable)(),
152
+ __param(0, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.JISInfotextRopidGTFSStopsRepository)),
153
+ __param(1, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.PostgresConnector)),
154
+ __param(2, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
155
+ __metadata("design:paramtypes", [JISInfotextRopidGTFSStopsRepository_1.JISInfotextRopidGTFSStopsRepository, Object, Object])
156
+ ], JISInfotextRepository);
157
+ //# sourceMappingURL=JISInfotextRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JISInfotextRepository.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/data-access/JISInfotextRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAAoE;AACpE,6DAAuC;AACvC,gGAAsE;AAGtE,kIAA+H;AAC/H,wEAAqE;AACrE,6EAAwE;AACxE,mEAAsE;AACtE,iEAAwE;AACxE,kDAA+C;AAC/C,+FAA4F;AAGrF,IAAM,qBAAqB,mCAA3B,MAAM,qBAAsB,SAAQ,iDAAuB;IAM9D,YAC4D,sBAA2D,EAC9E,SAA6B,EACxC,MAAe;QAEzC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAVtB,WAAM,GAAG,iBAAS,CAAC;QACnB,cAAS,GAAG,qCAAiB,CAAC,SAAS,CAAC;QAU3C,IAAI,CAAC,cAAc,GAAG,SAAS;aAC1B,aAAa,EAAE;aACf,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,qCAAiB,CAA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StopsModel } from "../../../schema-definitions/jis/models/JISInfotextsRopidGTFSStopsModel";
2
+ import { ILogger } from "@golemio/core/dist/helpers";
3
+ import { IDatabaseConnector } from "@golemio/core/dist/helpers/data-access/postgres/IDatabaseConnector";
4
+ import { AbstractBasicRepository } from "@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractBasicRepository";
5
+ import { ModelStatic } from "@golemio/core/dist/shared/sequelize";
6
+ export declare class JISInfotextRopidGTFSStopsRepository extends AbstractBasicRepository {
7
+ schema: string;
8
+ tableName: string;
9
+ sequelizeModel: ModelStatic<JISInfotextsRopidGTFSStopsModel>;
10
+ constructor(connector: IDatabaseConnector, logger: ILogger);
11
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.JISInfotextRopidGTFSStopsRepository = void 0;
16
+ const const_1 = require("../../../schema-definitions/const");
17
+ const JISInfotextsRopidGTFSStopsModel_1 = require("../../../schema-definitions/jis/models/JISInfotextsRopidGTFSStopsModel");
18
+ const AbstractBasicRepository_1 = require("@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractBasicRepository");
19
+ const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
20
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
21
+ let JISInfotextRopidGTFSStopsRepository = exports.JISInfotextRopidGTFSStopsRepository = class JISInfotextRopidGTFSStopsRepository extends AbstractBasicRepository_1.AbstractBasicRepository {
22
+ constructor(connector, logger) {
23
+ super(connector, logger);
24
+ this.schema = const_1.PG_SCHEMA;
25
+ this.tableName = JISInfotextsRopidGTFSStopsModel_1.JISInfotextsRopidGTFSStopsModel.tableName;
26
+ this.sequelizeModel = connector
27
+ .getConnection()
28
+ .define(this.tableName, JISInfotextsRopidGTFSStopsModel_1.JISInfotextsRopidGTFSStopsModel.attributeModel, { schema: this.schema, timestamps: false });
29
+ }
30
+ };
31
+ exports.JISInfotextRopidGTFSStopsRepository = JISInfotextRopidGTFSStopsRepository = __decorate([
32
+ (0, tsyringe_1.injectable)(),
33
+ __param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.PostgresConnector)),
34
+ __param(1, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
35
+ __metadata("design:paramtypes", [Object, Object])
36
+ ], JISInfotextRopidGTFSStopsRepository);
37
+ //# sourceMappingURL=JISInfotextRopidGTFSStopsRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JISInfotextRopidGTFSStopsRepository.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/data-access/JISInfotextRopidGTFSStopsRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAAuC;AACvC,4HAAkG;AAGlG,kIAA+H;AAC/H,wEAAqE;AAErE,iEAAwE;AAGjE,IAAM,mCAAmC,iDAAzC,MAAM,mCAAoC,SAAQ,iDAAuB;IAK5E,YAAiD,SAA6B,EAA4B,MAAe;QACrH,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QALtB,WAAM,GAAG,iBAAS,CAAC;QACnB,cAAS,GAAG,iEAA+B,CAAC,SAAS,CAAC;QAKzD,IAAI,CAAC,cAAc,GAAG,SAAS;aAC1B,aAAa,EAAE;aACf,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,iEAA+B,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5H,CAAC;CACJ,CAAA;8CAXY,mCAAmC;IAD/C,IAAA,qBAAU,GAAE;IAMI,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,iBAAiB,CAAC,CAAA;IAAiC,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;;GALhG,mCAAmC,CAW/C"}
@@ -0,0 +1,4 @@
1
+ export declare enum InfotextDisplayType {
2
+ Inline = "inline",
3
+ General = "general"
4
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InfotextDisplayType = void 0;
4
+ var InfotextDisplayType;
5
+ (function (InfotextDisplayType) {
6
+ InfotextDisplayType["Inline"] = "inline";
7
+ InfotextDisplayType["General"] = "general";
8
+ })(InfotextDisplayType || (exports.InfotextDisplayType = InfotextDisplayType = {}));
9
+ //# sourceMappingURL=InfotextDisplayTypeEnum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfotextDisplayTypeEnum.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/domain/InfotextDisplayTypeEnum.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC3B,wCAAiB,CAAA;IACjB,0CAAmB,CAAA;AACvB,CAAC,EAHW,mBAAmB,mCAAnB,mBAAmB,QAG9B"}
@@ -0,0 +1,28 @@
1
+ import { JISInfotextsModel } from "../../../schema-definitions/jis/models/JISInfotextsModel";
2
+ import { InfotextDisplayType } from "./InfotextDisplayTypeEnum";
3
+ export interface IInfotextDepartureInputDto {
4
+ data: JISInfotextsModel;
5
+ timeZone: string;
6
+ }
7
+ export interface IInfotextStopDto {
8
+ id: string;
9
+ name: string;
10
+ platform_code: string | null;
11
+ }
12
+ export interface IInfotextDepartureOutputDto {
13
+ display_type: InfotextDisplayType;
14
+ text: string;
15
+ text_en: string | null;
16
+ related_stops: string[];
17
+ valid_from: string;
18
+ valid_to: string | null;
19
+ }
20
+ export interface IInfotextOverviewOutputDto {
21
+ id: string;
22
+ display_type: InfotextDisplayType;
23
+ text: string;
24
+ text_en: string | null;
25
+ related_stops: IInfotextStopDto[];
26
+ valid_from: string;
27
+ valid_to: string | null;
28
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=InfotextInterfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfotextInterfaces.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/domain/InfotextInterfaces.ts"],"names":[],"mappings":""}