@golemio/pid 4.0.2 → 4.0.3-dev.1993091012

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 (201) hide show
  1. package/README.md +1 -1
  2. package/db/example/redis/gtfsStopsCacheMock.json +8 -0
  3. package/db/example/redis/jisCacheMock.json +31 -0
  4. package/db/migrations/postgresql/20250716143052-add-stop-name-to-combined-stop-times.js +53 -0
  5. package/db/migrations/postgresql/sqls/20250716143052-add-stop-name-to-combined-stop-times-down.sql +47 -0
  6. package/db/migrations/postgresql/sqls/20250716143052-add-stop-name-to-combined-stop-times-up.sql +47 -0
  7. package/dist/helpers/GtfsStopParser.d.ts +2 -0
  8. package/dist/helpers/GtfsStopParser.js +11 -8
  9. package/dist/helpers/GtfsStopParser.js.map +1 -1
  10. package/dist/helpers/jis/JISInfotextSeverityLevelPriority.d.ts +6 -0
  11. package/dist/helpers/jis/JISInfotextSeverityLevelPriority.js +11 -0
  12. package/dist/helpers/jis/JISInfotextSeverityLevelPriority.js.map +1 -0
  13. package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js +0 -1
  14. package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js.map +1 -1
  15. package/dist/integration-engine/jis/ioc/Di.js +10 -0
  16. package/dist/integration-engine/jis/ioc/Di.js.map +1 -1
  17. package/dist/integration-engine/jis/ioc/JISContainerToken.d.ts +4 -0
  18. package/dist/integration-engine/jis/ioc/JISContainerToken.js +5 -0
  19. package/dist/integration-engine/jis/ioc/JISContainerToken.js.map +1 -1
  20. package/dist/integration-engine/jis/repositories/JISInfotextsRedisRepository.d.ts +9 -0
  21. package/dist/integration-engine/jis/repositories/JISInfotextsRedisRepository.js +86 -0
  22. package/dist/integration-engine/jis/repositories/JISInfotextsRedisRepository.js.map +1 -0
  23. package/dist/integration-engine/jis/repositories/JISInfotextsRepository.d.ts +6 -1
  24. package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js +50 -2
  25. package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js.map +1 -1
  26. package/dist/integration-engine/jis/repositories/JISMetadataRepository.d.ts +4 -1
  27. package/dist/integration-engine/jis/repositories/JISMetadataRepository.js +37 -12
  28. package/dist/integration-engine/jis/repositories/JISMetadataRepository.js.map +1 -1
  29. package/dist/integration-engine/jis/transformations/JISInfotextCacheTranformation.d.ts +7 -0
  30. package/dist/integration-engine/jis/transformations/JISInfotextCacheTranformation.js +37 -0
  31. package/dist/integration-engine/jis/transformations/JISInfotextCacheTranformation.js.map +1 -0
  32. package/dist/integration-engine/jis/workers/JISWorker.js +1 -0
  33. package/dist/integration-engine/jis/workers/JISWorker.js.map +1 -1
  34. package/dist/integration-engine/jis/workers/tasks/AbstractFetchJISResourceTask.d.ts +14 -0
  35. package/dist/integration-engine/jis/workers/tasks/AbstractFetchJISResourceTask.js +71 -0
  36. package/dist/integration-engine/jis/workers/tasks/AbstractFetchJISResourceTask.js.map +1 -0
  37. package/dist/integration-engine/jis/workers/tasks/FetchJISEventsTask.d.ts +10 -4
  38. package/dist/integration-engine/jis/workers/tasks/FetchJISEventsTask.js +15 -22
  39. package/dist/integration-engine/jis/workers/tasks/FetchJISEventsTask.js.map +1 -1
  40. package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.d.ts +10 -5
  41. package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.js +15 -23
  42. package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.js.map +1 -1
  43. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsCacheTask.d.ts +13 -0
  44. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsCacheTask.js +47 -0
  45. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsCacheTask.js.map +1 -0
  46. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.d.ts +1 -2
  47. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js +5 -4
  48. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js.map +1 -1
  49. package/dist/integration-engine/ropid-gtfs/RopidGTFSCisStopsModel.d.ts +18 -0
  50. package/dist/integration-engine/ropid-gtfs/RopidGTFSCisStopsModel.js +44 -0
  51. package/dist/integration-engine/ropid-gtfs/RopidGTFSCisStopsModel.js.map +1 -0
  52. package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.d.ts +5 -1
  53. package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js +24 -0
  54. package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js.map +1 -1
  55. package/dist/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.js.map +1 -1
  56. package/dist/integration-engine/ropid-gtfs/index.d.ts +1 -0
  57. package/dist/integration-engine/ropid-gtfs/index.js +1 -0
  58. package/dist/integration-engine/ropid-gtfs/index.js.map +1 -1
  59. package/dist/integration-engine/ropid-gtfs/ioc/Di.js +8 -0
  60. package/dist/integration-engine/ropid-gtfs/ioc/Di.js.map +1 -1
  61. package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.d.ts +3 -0
  62. package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js +3 -0
  63. package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js.map +1 -1
  64. package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.js +1 -1
  65. package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.js.map +1 -1
  66. package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js +1 -0
  67. package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js.map +1 -1
  68. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js +8 -5
  69. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js.map +1 -1
  70. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.d.ts +12 -0
  71. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.js +44 -0
  72. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.js.map +1 -0
  73. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.d.ts +12 -0
  74. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.js +87 -0
  75. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.js.map +1 -0
  76. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js +1 -0
  77. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js.map +1 -1
  78. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/interfaces/TripRepositoryInterfaces.d.ts +2 -1
  79. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.d.ts +3 -1
  80. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.js +100 -85
  81. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.js.map +1 -1
  82. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateTrainDelayTask.js.map +1 -1
  83. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicStopTimeCacheTask.js +1 -0
  84. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicStopTimeCacheTask.js.map +1 -1
  85. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/PublicApiTripTransformation.js +2 -0
  86. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/PublicApiTripTransformation.js.map +1 -1
  87. package/dist/output-gateway/index.js +1 -0
  88. package/dist/output-gateway/index.js.map +1 -1
  89. package/dist/output-gateway/jis/data-access/cache/JISInfotextsRedisRepository.d.ts +17 -0
  90. package/dist/output-gateway/jis/data-access/cache/JISInfotextsRedisRepository.js +113 -0
  91. package/dist/output-gateway/jis/data-access/cache/JISInfotextsRedisRepository.js.map +1 -0
  92. package/dist/output-gateway/jis/ioc/Di.js +2 -2
  93. package/dist/output-gateway/jis/ioc/Di.js.map +1 -1
  94. package/dist/output-gateway/jis/ioc/OgJisToken.d.ts +2 -0
  95. package/dist/output-gateway/jis/ioc/OgJisToken.js +2 -0
  96. package/dist/output-gateway/jis/ioc/OgJisToken.js.map +1 -1
  97. package/dist/output-gateway/pid/controllers/v3/V3TransferBoardsController.js.map +1 -1
  98. package/dist/output-gateway/pid/controllers/v4/V4TransferBoardsController.d.ts +17 -0
  99. package/dist/output-gateway/pid/controllers/v4/V4TransferBoardsController.js +154 -0
  100. package/dist/output-gateway/pid/controllers/v4/V4TransferBoardsController.js.map +1 -0
  101. package/dist/output-gateway/pid/controllers/v4/interfaces/ITransferBoardsParams.d.ts +14 -0
  102. package/dist/output-gateway/pid/controllers/v4/interfaces/ITransferBoardsParams.js +3 -0
  103. package/dist/output-gateway/pid/controllers/v4/interfaces/ITransferBoardsParams.js.map +1 -0
  104. package/dist/output-gateway/pid/domain/InfotextInterfaces.d.ts +5 -0
  105. package/dist/output-gateway/pid/helpers/JISInfotextStopSuppressionFilter.d.ts +4 -1
  106. package/dist/output-gateway/pid/helpers/JISInfotextStopSuppressionFilter.js +7 -1
  107. package/dist/output-gateway/pid/helpers/JISInfotextStopSuppressionFilter.js.map +1 -1
  108. package/dist/output-gateway/pid/helpers/TransferBoardFilter.d.ts +5 -0
  109. package/dist/output-gateway/pid/helpers/TransferBoardFilter.js +33 -0
  110. package/dist/output-gateway/pid/helpers/TransferBoardFilter.js.map +1 -0
  111. package/dist/output-gateway/pid/helpers/TransferBoardSorter.d.ts +6 -0
  112. package/dist/output-gateway/pid/helpers/TransferBoardSorter.js +61 -0
  113. package/dist/output-gateway/pid/helpers/TransferBoardSorter.js.map +1 -0
  114. package/dist/output-gateway/pid/index.d.ts +50 -0
  115. package/dist/output-gateway/pid/index.js.map +1 -1
  116. package/dist/output-gateway/pid/ioc/Di.js +62 -6
  117. package/dist/output-gateway/pid/ioc/Di.js.map +1 -1
  118. package/dist/output-gateway/pid/ioc/OgPidToken.d.ts +11 -0
  119. package/dist/output-gateway/pid/ioc/OgPidToken.js +11 -0
  120. package/dist/output-gateway/pid/ioc/OgPidToken.js.map +1 -1
  121. package/dist/output-gateway/pid/routers/index.d.ts +1 -0
  122. package/dist/output-gateway/pid/routers/index.js +3 -1
  123. package/dist/output-gateway/pid/routers/index.js.map +1 -1
  124. package/dist/output-gateway/pid/routers/v4/V4PIDRouter.d.ts +16 -0
  125. package/dist/output-gateway/pid/routers/v4/V4PIDRouter.js +67 -0
  126. package/dist/output-gateway/pid/routers/v4/V4PIDRouter.js.map +1 -0
  127. package/dist/output-gateway/pid/service/facade/InfotextFacade.d.ts +7 -2
  128. package/dist/output-gateway/pid/service/facade/InfotextFacade.js +29 -4
  129. package/dist/output-gateway/pid/service/facade/InfotextFacade.js.map +1 -1
  130. package/dist/output-gateway/pid/service/facade/StopFacade.d.ts +12 -3
  131. package/dist/output-gateway/pid/service/facade/StopFacade.js +43 -7
  132. package/dist/output-gateway/pid/service/facade/StopFacade.js.map +1 -1
  133. package/dist/output-gateway/pid/service/facade/TransferFacade.d.ts +11 -9
  134. package/dist/output-gateway/pid/service/facade/TransferFacade.js +117 -14
  135. package/dist/output-gateway/pid/service/facade/TransferFacade.js.map +1 -1
  136. package/dist/output-gateway/pid/service/helpers/PlatformCodeResolver.d.ts +7 -1
  137. package/dist/output-gateway/pid/service/helpers/PlatformCodeResolver.js +12 -0
  138. package/dist/output-gateway/pid/service/helpers/PlatformCodeResolver.js.map +1 -1
  139. package/dist/output-gateway/pid/service/transformations/JISInfotextCacheTransferTransformation.d.ts +13 -0
  140. package/dist/output-gateway/pid/service/transformations/JISInfotextCacheTransferTransformation.js +31 -0
  141. package/dist/output-gateway/pid/service/transformations/JISInfotextCacheTransferTransformation.js.map +1 -0
  142. package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.d.ts +27 -0
  143. package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.js +78 -0
  144. package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.js.map +1 -0
  145. package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.d.ts +1 -1
  146. package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js +4 -4
  147. package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js.map +1 -1
  148. package/dist/output-gateway/public/ioc/Di.js +1 -1
  149. package/dist/output-gateway/public/ioc/Di.js.map +1 -1
  150. package/dist/output-gateway/ropid-gtfs/data-access/redis/GtfsStopsRedisRepository.d.ts +13 -0
  151. package/dist/output-gateway/ropid-gtfs/data-access/redis/GtfsStopsRedisRepository.js +83 -0
  152. package/dist/output-gateway/ropid-gtfs/data-access/redis/GtfsStopsRedisRepository.js.map +1 -0
  153. package/dist/output-gateway/shared/constants/route-version.d.ts +2 -1
  154. package/dist/output-gateway/shared/constants/route-version.js +1 -0
  155. package/dist/output-gateway/shared/constants/route-version.js.map +1 -1
  156. package/dist/output-gateway/{public → shared}/service/VPSubscriber.d.ts +4 -2
  157. package/dist/output-gateway/{public → shared}/service/VPSubscriber.js +1 -1
  158. package/dist/output-gateway/shared/service/VPSubscriber.js.map +1 -0
  159. package/dist/schema-definitions/jis/redis/const.d.ts +1 -0
  160. package/dist/schema-definitions/jis/redis/const.js +2 -1
  161. package/dist/schema-definitions/jis/redis/const.js.map +1 -1
  162. package/dist/schema-definitions/jis/redis/interfaces/IJISInfotextDto.d.ts +17 -0
  163. package/dist/schema-definitions/jis/redis/interfaces/IJISInfotextDto.js +3 -0
  164. package/dist/schema-definitions/jis/redis/interfaces/IJISInfotextDto.js.map +1 -0
  165. package/dist/schema-definitions/jis/redis/interfaces/IJISMetadataDto.d.ts +1 -5
  166. package/dist/schema-definitions/jis/redis/schemas/JISInfotextDtoSchema.d.ts +3 -0
  167. package/dist/schema-definitions/jis/redis/schemas/JISInfotextDtoSchema.js +59 -0
  168. package/dist/schema-definitions/jis/redis/schemas/JISInfotextDtoSchema.js.map +1 -0
  169. package/dist/schema-definitions/jis/redis/schemas/JISMetadataDtoSchema.js +5 -11
  170. package/dist/schema-definitions/jis/redis/schemas/JISMetadataDtoSchema.js.map +1 -1
  171. package/dist/schema-definitions/ropid-departures-presets/index.d.ts +1 -0
  172. package/dist/schema-definitions/ropid-departures-presets/index.js +3 -0
  173. package/dist/schema-definitions/ropid-departures-presets/index.js.map +1 -1
  174. package/dist/schema-definitions/ropid-gtfs/interfaces/IStopCisDto.d.ts +16 -0
  175. package/dist/schema-definitions/ropid-gtfs/interfaces/IStopCisDto.js +3 -0
  176. package/dist/schema-definitions/ropid-gtfs/interfaces/IStopCisDto.js.map +1 -0
  177. package/dist/schema-definitions/ropid-gtfs/interfaces/IStopDto.d.ts +1 -0
  178. package/dist/schema-definitions/ropid-gtfs/models/StopCisDto.d.ts +58 -0
  179. package/dist/schema-definitions/ropid-gtfs/models/StopCisDto.js +69 -0
  180. package/dist/schema-definitions/ropid-gtfs/models/StopCisDto.js.map +1 -0
  181. package/dist/schema-definitions/ropid-gtfs/redis/const.d.ts +1 -0
  182. package/dist/schema-definitions/ropid-gtfs/redis/const.js +2 -1
  183. package/dist/schema-definitions/ropid-gtfs/redis/const.js.map +1 -1
  184. package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.d.ts +3 -2
  185. package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.js +4 -0
  186. package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.js.map +1 -1
  187. package/dist/schema-definitions/vehicle-positions/models/views/interfaces/IPublicStopTimeDto.d.ts +1 -0
  188. package/dist/schema-definitions/vehicle-positions/redis/interfaces/IPublicApiCacheDto.d.ts +2 -0
  189. package/dist/schema-definitions/vehicle-positions/redis/interfaces/IPublicStopTimeCacheDto.d.ts +1 -0
  190. package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicApiCacheDtoSchema.js +8 -0
  191. package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicApiCacheDtoSchema.js.map +1 -1
  192. package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicStopTimeCacheDtoSchema.js +4 -1
  193. package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicStopTimeCacheDtoSchema.js.map +1 -1
  194. package/docs/asyncapi.yaml +45 -0
  195. package/docs/cache/types/redis.md +82 -2
  196. package/docs/implementation_documentation.md +2 -0
  197. package/docs/jis/index.md +17 -5
  198. package/docs/openapi-input.yaml +13 -2
  199. package/docs/openapi-output.yaml +326 -4
  200. package/package.json +2 -2
  201. package/dist/output-gateway/public/service/VPSubscriber.js.map +0 -1
@@ -1,30 +1,44 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OgPidContainer = void 0;
4
+ const GtfsStopParser_1 = require("../../../helpers/GtfsStopParser");
5
+ const JISInfotextsRedisRepository_1 = require("../../jis/data-access/cache/JISInfotextsRedisRepository");
4
6
  const PublicVehiclePositionsRepository_1 = require("../../public/data-access/redis/PublicVehiclePositionsRepository");
5
7
  const CisStopGroupRepository_1 = require("../../ropid-gtfs/data-access/CisStopGroupRepository");
6
8
  const RunTripsRedisRepository_1 = require("../../ropid-gtfs/data-access/redis/RunTripsRedisRepository");
7
9
  const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
10
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
11
+ const V3DeparturesPresetController_1 = require("../controllers/v3/V3DeparturesPresetController");
8
12
  const V3InfotextsController_1 = require("../controllers/v3/V3InfotextsController");
9
13
  const V3TransferBoardsController_1 = require("../controllers/v3/V3TransferBoardsController");
14
+ const V4TransferBoardsController_1 = require("../controllers/v4/V4TransferBoardsController");
10
15
  const data_access_1 = require("../data-access");
11
16
  const JISInfotextRepository_1 = require("../data-access/JISInfotextRepository");
12
17
  const JISInfotextRopidGTFSStopsRepository_1 = require("../data-access/JISInfotextRopidGTFSStopsRepository");
18
+ const RopidDeparturesPresetRepository_1 = require("../data-access/RopidDeparturesPresetRepository");
19
+ const RopidDeparturesPresetsRopidGTFSStopsRepository_1 = require("../data-access/RopidDeparturesPresetsRopidGTFSStopsRepository");
13
20
  const JISInfotextStopSuppressionFilter_1 = require("../helpers/JISInfotextStopSuppressionFilter");
14
21
  const InfotextFacade_1 = require("../service/facade/InfotextFacade");
22
+ const RopidDeparturesPresetFacade_1 = require("../service/facade/RopidDeparturesPresetFacade");
15
23
  const StopFacade_1 = require("../service/facade/StopFacade");
16
24
  const TransferFacade_1 = require("../service/facade/TransferFacade");
17
25
  const JISInfotextDepartureTransformation_1 = require("../service/transformations/JISInfotextDepartureTransformation");
18
26
  const JISInfotextOverviewTransformation_1 = require("../service/transformations/JISInfotextOverviewTransformation");
19
27
  const JISInfotextTransferTransformation_1 = require("../service/transformations/JISInfotextTransferTransformation");
28
+ const RopidDeparturesPresetTransformation_1 = require("../service/transformations/RopidDeparturesPresetTransformation");
20
29
  const TransferDepartureTransformation_1 = require("../service/transformations/TransferDepartureTransformation");
21
30
  const OgPidToken_1 = require("./OgPidToken");
22
- const RopidDeparturesPresetFacade_1 = require("../service/facade/RopidDeparturesPresetFacade");
23
- const V3DeparturesPresetController_1 = require("../controllers/v3/V3DeparturesPresetController");
24
- const RopidDeparturesPresetRepository_1 = require("../data-access/RopidDeparturesPresetRepository");
25
- const RopidDeparturesPresetsRopidGTFSStopsRepository_1 = require("../data-access/RopidDeparturesPresetsRopidGTFSStopsRepository");
26
- const RopidDeparturesPresetTransformation_1 = require("../service/transformations/RopidDeparturesPresetTransformation");
27
- const GtfsStopParser_1 = require("../../../helpers/GtfsStopParser");
31
+ const GtfsStopsRedisRepository_1 = require("../../ropid-gtfs/data-access/redis/GtfsStopsRedisRepository");
32
+ const VPSubscriber_1 = require("../../shared/service/VPSubscriber");
33
+ const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
34
+ const const_1 = require("../../../schema-definitions/ropid-gtfs/redis/const");
35
+ const const_2 = require("../../../schema-definitions/jis/redis/const");
36
+ const PublicGtfsDepartureRepository_1 = require("../../public/data-access/redis/PublicGtfsDepartureRepository");
37
+ const VehicleDescriptorCachedRepository_1 = require("../../public/data-access/VehicleDescriptorCachedRepository");
38
+ const PublicStopTimeRepository_1 = require("../../public/data-access/redis/PublicStopTimeRepository");
39
+ const const_3 = require("../../../schema-definitions/vehicle-positions/redis/const");
40
+ const JISInfotextCacheTransferTransformation_1 = require("../service/transformations/JISInfotextCacheTransferTransformation");
41
+ const TransferDepartureCacheTransformation_1 = require("../service/transformations/TransferDepartureCacheTransformation");
28
42
  const ogPidContainer = ioc_1.OutputGatewayContainer.createChildContainer();
29
43
  exports.OgPidContainer = ogPidContainer;
30
44
  //#region Repositories
@@ -36,6 +50,11 @@ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.RunTripsRedisRepository
36
50
  ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.PublicVehiclePositionsRepository, PublicVehiclePositionsRepository_1.PublicVehiclePositionsRepository);
37
51
  ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.RopidDeparturesPresetRepository, RopidDeparturesPresetRepository_1.RopidDeparturesPresetRepository);
38
52
  ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.RopidDeparturesPresetsRopidGTFSStopsRepository, RopidDeparturesPresetsRopidGTFSStopsRepository_1.RopidDeparturesPresetsRopidGTFSStopsRepository);
53
+ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.GtfsStopsRedisRepository, GtfsStopsRedisRepository_1.GtfsStopsRedisRepository);
54
+ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextsRedisRepository, JISInfotextsRedisRepository_1.JISInfotextsRedisRepository);
55
+ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.PublicGtfsDepartureRepository, PublicGtfsDepartureRepository_1.PublicGtfsDepartureRepository);
56
+ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.VehicleDescriptorCachedRepository, VehicleDescriptorCachedRepository_1.VehicleDescriptorCachedRepository);
57
+ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.PublicStopTimeRepository, PublicStopTimeRepository_1.PublicStopTimeRepository);
39
58
  //#endregion
40
59
  //#region Transformations
41
60
  ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextDepartureTransformation, JISInfotextDepartureTransformation_1.JISInfotextDepartureTransformation);
@@ -43,6 +62,8 @@ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextTransferTran
43
62
  ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextOverviewTransformation, JISInfotextOverviewTransformation_1.JISInfotextOverviewTransformation);
44
63
  ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.TransferDepartureTransformation, TransferDepartureTransformation_1.TransferDepartureTransformation);
45
64
  ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.RopidDeparturesPresetTransformation, RopidDeparturesPresetTransformation_1.RopidDeparturesPresetTransformation);
65
+ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextCacheTransferTransformation, JISInfotextCacheTransferTransformation_1.JISInfotextCacheTransferTransformation);
66
+ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.TransferDepartureCacheTransformation, TransferDepartureCacheTransformation_1.TransferDepartureCacheTransformation);
46
67
  //#endregion
47
68
  //#region Facade
48
69
  ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.StopFacade, StopFacade_1.StopFacade);
@@ -54,8 +75,43 @@ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.RopidDeparturesPresetFa
54
75
  ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.V3TransferBoardsController, V3TransferBoardsController_1.V3TransferBoardsController);
55
76
  ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.V3InfotextsController, V3InfotextsController_1.V3InfotextsController);
56
77
  ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.V3RopidDeparturesPresetController, V3DeparturesPresetController_1.V3RopidDeparturesPresetController);
78
+ ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.V4TransferBoardsController, V4TransferBoardsController_1.V4TransferBoardsController);
57
79
  //#endregion
58
80
  //#region Helpers
59
81
  ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.JISInfotextStopSuppressionFilter, JISInfotextStopSuppressionFilter_1.JISInfotextStopSuppressionFilter);
60
82
  ogPidContainer.registerSingleton(OgPidToken_1.OgPidToken.GtfsStopParser, GtfsStopParser_1.GtfsStopParser);
83
+ //#endregion
84
+ ogPidContainer.register(OgPidToken_1.OgPidToken.GtfsStopsSubscriber, {
85
+ useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
86
+ const config = c.resolve(CoreToken_1.CoreToken.SimpleConfig);
87
+ const logger = c.resolve(CoreToken_1.CoreToken.Logger);
88
+ return new VPSubscriber_1.VPSubscriber({
89
+ channelName: const_1.GTFS_STOPS_NAMESPACE_PREFIX,
90
+ redisConnectionString: config.getValue("env.REDIS_CONN"),
91
+ logger: logger,
92
+ }, c.resolve(OgPidToken_1.OgPidToken.GtfsStopsRedisRepository));
93
+ }),
94
+ });
95
+ ogPidContainer.register(OgPidToken_1.OgPidToken.JisInotextsSubscriber, {
96
+ useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
97
+ const config = c.resolve(CoreToken_1.CoreToken.SimpleConfig);
98
+ const logger = c.resolve(CoreToken_1.CoreToken.Logger);
99
+ return new VPSubscriber_1.VPSubscriber({
100
+ channelName: const_2.JIS_NAMESPACE_PREFIX,
101
+ redisConnectionString: config.getValue("env.REDIS_CONN"),
102
+ logger: logger,
103
+ }, c.resolve(OgPidToken_1.OgPidToken.JISInfotextsRedisRepository));
104
+ }),
105
+ });
106
+ ogPidContainer.register(OgPidToken_1.OgPidToken.VPSubscriber, {
107
+ useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
108
+ const config = c.resolve(CoreToken_1.CoreToken.SimpleConfig);
109
+ const logger = c.resolve(CoreToken_1.CoreToken.Logger);
110
+ return new VPSubscriber_1.VPSubscriber({
111
+ channelName: const_3.PUBLIC_CACHE_NAMESPACE_PREFIX,
112
+ redisConnectionString: config.getValue("env.REDIS_CONN"),
113
+ logger: logger,
114
+ }, c.resolve(OgPidToken_1.OgPidToken.PublicVehiclePositionsRepository));
115
+ }),
116
+ });
61
117
  //# sourceMappingURL=Di.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,sHAAiH;AACjH,gGAA2F;AAC3F,wGAAmG;AACnG,+DAA+E;AAE/E,mFAAgF;AAChF,6FAA0F;AAC1F,gDAAsD;AACtD,gFAA6E;AAC7E,4GAAyG;AACzG,kGAA+F;AAC/F,qEAAkE;AAClE,6DAA0D;AAC1D,qEAAkE;AAClE,sHAAmH;AACnH,oHAAiH;AACjH,oHAAiH;AACjH,gHAA6G;AAC7G,6CAA0C;AAC1C,+FAA4F;AAC5F,iGAAmG;AACnG,oGAAiG;AACjG,kIAA+H;AAC/H,wHAAqH;AACrH,oEAAyD;AAEzD,MAAM,cAAc,GAAwB,4BAAsB,CAAC,oBAAoB,EAAE,CAAC;AA0C/D,wCAAc;AAxCzC,sBAAsB;AACtB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,sBAAsB,EAAE,+CAAsB,CAAC,CAAC;AAC5F,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,mCAAmC,EAAE,yEAAmC,CAAC,CAAC;AACtH,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,qBAAqB,EAAE,6CAAqB,CAAC,CAAC;A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AgB,qBAAS,CAAC,YAAY,CAAC,CAAC;QAChE,MAAM,MAAM,GAAG,CAAC,CAAC,OAAO,CAAU,qBAAS,CAAC,MAAM,CAAC,CAAC;QAEpD,OAAO,IAAI,2BAAY,CACnB;YACI,WAAW,EAAE,qCAA6B;YAC1C,qBAAqB,EAAE,MAAM,CAAC,QAAQ,CAAS,gBAAgB,CAAC;YAChE,MAAM,EAAE,MAAM;SACjB,EACD,CAAC,CAAC,OAAO,CAA8B,uBAAU,CAAC,gCAAgC,CAAC,CACtF,CAAC;IACN,CAAC,CAAC;CACL,CAAC,CAAC"}
@@ -2,16 +2,23 @@ export declare const OgPidToken: {
2
2
  CisStopGroupRepository: symbol;
3
3
  JISInfotextRopidGTFSStopsRepository: symbol;
4
4
  JISInfotextRepository: symbol;
5
+ JISInfotextsRedisRepository: symbol;
5
6
  DeparturesRepository: symbol;
6
7
  RunTripsRedisRepository: symbol;
7
8
  PublicVehiclePositionsRepository: symbol;
8
9
  RopidDeparturesPresetRepository: symbol;
9
10
  RopidDeparturesPresetsRopidGTFSStopsRepository: symbol;
11
+ GtfsStopsRedisRepository: symbol;
12
+ PublicGtfsDepartureRepository: symbol;
13
+ VehicleDescriptorCachedRepository: symbol;
14
+ PublicStopTimeRepository: symbol;
10
15
  JISInfotextDepartureTransformation: symbol;
11
16
  JISInfotextTransferTransformation: symbol;
12
17
  JISInfotextOverviewTransformation: symbol;
13
18
  TransferDepartureTransformation: symbol;
14
19
  RopidDeparturesPresetTransformation: symbol;
20
+ JISInfotextCacheTransferTransformation: symbol;
21
+ TransferDepartureCacheTransformation: symbol;
15
22
  StopFacade: symbol;
16
23
  InfotextFacade: symbol;
17
24
  TransferFacade: symbol;
@@ -19,6 +26,10 @@ export declare const OgPidToken: {
19
26
  V3TransferBoardsController: symbol;
20
27
  V3InfotextsController: symbol;
21
28
  V3RopidDeparturesPresetController: symbol;
29
+ V4TransferBoardsController: symbol;
22
30
  JISInfotextStopSuppressionFilter: symbol;
23
31
  GtfsStopParser: symbol;
32
+ GtfsStopsSubscriber: symbol;
33
+ JisInotextsSubscriber: symbol;
34
+ VPSubscriber: symbol;
24
35
  };
@@ -6,11 +6,16 @@ exports.OgPidToken = {
6
6
  CisStopGroupRepository: Symbol("CisStopGroupRepository"),
7
7
  JISInfotextRopidGTFSStopsRepository: Symbol("JISInfotextRopidGTFSStopsRepository"),
8
8
  JISInfotextRepository: Symbol("JISInfotextRepository"),
9
+ JISInfotextsRedisRepository: Symbol("JISInfotextsRedisRepository"),
9
10
  DeparturesRepository: Symbol("DeparturesRepository"),
10
11
  RunTripsRedisRepository: Symbol("RunTripsRedisRepository"),
11
12
  PublicVehiclePositionsRepository: Symbol("PublicVehiclePositionsRepository"),
12
13
  RopidDeparturesPresetRepository: Symbol("RopidDeparturesPresetRepository"),
13
14
  RopidDeparturesPresetsRopidGTFSStopsRepository: Symbol("RopidDeparturesPresetsRopidGTFSStopsRepository"),
15
+ GtfsStopsRedisRepository: Symbol("GtfsStopsRedisRepository"),
16
+ PublicGtfsDepartureRepository: Symbol("PublicGtfsDepartureRepository"),
17
+ VehicleDescriptorCachedRepository: Symbol("VehicleDescriptorCachedRepository"),
18
+ PublicStopTimeRepository: Symbol("PublicStopTimeRepository"),
14
19
  //#endregion
15
20
  //#region Transformations
16
21
  JISInfotextDepartureTransformation: Symbol("JISInfotextDepartureTransformation"),
@@ -18,6 +23,8 @@ exports.OgPidToken = {
18
23
  JISInfotextOverviewTransformation: Symbol("JISInfotextOverviewTransformation"),
19
24
  TransferDepartureTransformation: Symbol("TransferDepartureTransformation"),
20
25
  RopidDeparturesPresetTransformation: Symbol("RopidDeparturesPresetTransformation"),
26
+ JISInfotextCacheTransferTransformation: Symbol("JISInfotextCacheTransferTransformation"),
27
+ TransferDepartureCacheTransformation: Symbol("TransferDepartureCacheTransformation"),
21
28
  //#endregion
22
29
  //#region Facade
23
30
  StopFacade: Symbol("StopFacade"),
@@ -29,10 +36,14 @@ exports.OgPidToken = {
29
36
  V3TransferBoardsController: Symbol("V3TransferBoardsController"),
30
37
  V3InfotextsController: Symbol("V3InfotextsController"),
31
38
  V3RopidDeparturesPresetController: Symbol("V3RopidDeparturesPresetController"),
39
+ V4TransferBoardsController: Symbol("V4TransferBoardsController"),
32
40
  //#endregion
33
41
  //#region Helpers
34
42
  JISInfotextStopSuppressionFilter: Symbol("JISInfotextStopSuppressionFilter"),
35
43
  GtfsStopParser: Symbol("GtfsStopParser"),
44
+ GtfsStopsSubscriber: Symbol("GtfsStopsSubscriber"),
45
+ JisInotextsSubscriber: Symbol("JisInotextsSubscriber"),
46
+ VPSubscriber: Symbol("VPSubscriber"),
36
47
  //#endregion
37
48
  };
38
49
  //# sourceMappingURL=OgPidToken.js.map
@@ -1 +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,sBAAsB,EAAE,MAAM,CAAC,wBAAwB,CAAC;IACxD,mCAAmC,EAAE,MAAM,CAAC,qCAAqC,CAAC;IAClF,qBAAqB,EAAE,MAAM,CAAC,uBAAuB,CAAC;IACtD,oBAAoB,EAAE,MAAM,CAAC,sBAAsB,CAAC;IACpD,uBAAuB,EAAE,MAAM,CAAC,yBAAyB,CAAC;IAC1D,gCAAgC,EAAE,MAAM,CAAC,kCAAkC,CAAC;IAC5E,+BAA+B,EAAE,MAAM,CAAC,iCAAiC,CAAC;IAC1E,8CAA8C,EAAE,MAAM,CAAC,gDAAgD,CAAC;IACxG,YAAY;IAEZ,yBAAyB;IACzB,kCAAkC,EAAE,MAAM,CAAC,oCAAoC,CAAC;IAChF,iCAAiC,EAAE,MAAM,CAAC,mCAAmC,CAAC;IAC9E,iCAAiC,EAAE,MAAM,CAAC,mCAAmC,CAAC;IAC9E,+BAA+B,EAAE,MAAM,CAAC,iCAAiC,CAAC;IAC1E,mCAAmC,EAAE,MAAM,CAAC,qCAAqC,C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Router";
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.v3PidRouter = exports.v2PidRouter = void 0;
3
+ exports.v4PidRouter = exports.v3PidRouter = exports.v2PidRouter = void 0;
4
4
  var V2PIDRouter_1 = require("./v2/V2PIDRouter");
5
5
  Object.defineProperty(exports, "v2PidRouter", { enumerable: true, get: function () { return V2PIDRouter_1.v2PidRouter; } });
6
6
  var V3PIDRouter_1 = require("./v3/V3PIDRouter");
7
7
  Object.defineProperty(exports, "v3PidRouter", { enumerable: true, get: function () { return V3PIDRouter_1.v3PidRouter; } });
8
+ var V4PIDRouter_1 = require("./v4/V4PIDRouter");
9
+ Object.defineProperty(exports, "v4PidRouter", { enumerable: true, get: function () { return V4PIDRouter_1.v4PidRouter; } });
8
10
  //# sourceMappingURL=index.js.map
@@ -1 +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"}
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;AACpB,gDAA+C;AAAtC,0GAAA,WAAW,OAAA"}
@@ -0,0 +1,16 @@
1
+ /// <reference types="express" />
2
+ import { AbstractRouter } from "@golemio/core/dist/helpers/routing/AbstractRouter";
3
+ import { Router } from "@golemio/core/dist/shared/express";
4
+ export declare class V4PIDRouter extends AbstractRouter {
5
+ readonly router: Router;
6
+ private readonly cacheHeaderMiddleware;
7
+ private readonly transferBoardsController;
8
+ private readonly GtfsStopsSubscriber;
9
+ private readonly VPSubscriber;
10
+ private readonly JisInotextsSubscriber;
11
+ constructor();
12
+ protected initRoutes: () => void;
13
+ private registerTransferBoardsRoutes;
14
+ }
15
+ declare const v4PidRouter: AbstractRouter;
16
+ export { v4PidRouter };
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.v4PidRouter = exports.V4PIDRouter = void 0;
4
+ const RouteTypeEnums_1 = require("../../../../helpers/RouteTypeEnums");
5
+ const ParamValidatorManager_1 = require("../../helpers/ParamValidatorManager");
6
+ const Di_1 = require("../../ioc/Di");
7
+ const OgPidToken_1 = require("../../ioc/OgPidToken");
8
+ const constants_1 = require("../../../shared/constants");
9
+ const AbstractRouter_1 = require("@golemio/core/dist/helpers/routing/AbstractRouter");
10
+ const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
11
+ const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
12
+ const express_1 = require("@golemio/core/dist/shared/express");
13
+ const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
14
+ const const_1 = require("../../../../const");
15
+ class V4PIDRouter extends AbstractRouter_1.AbstractRouter {
16
+ constructor() {
17
+ super(constants_1.RouteVersion.v4, "pid");
18
+ this.router = (0, express_1.Router)();
19
+ this.initRoutes = () => {
20
+ this.registerTransferBoardsRoutes();
21
+ };
22
+ this.registerTransferBoardsRoutes = () => {
23
+ const transferBoardsValidation = [
24
+ (0, express_validator_1.query)("aswId").optional().custom(ParamValidatorManager_1.ParamValidatorManager.getAswIdsValidator()).not().isArray(),
25
+ (0, express_validator_1.query)("cisId").optional().isInt({ min: const_1.PG_INT_MIN, max: const_1.PG_INT_MAX }).toInt(10).not().isArray(),
26
+ (0, express_validator_1.oneOf)([
27
+ [
28
+ (0, express_validator_1.query)("aswId").exists(),
29
+ (0, express_validator_1.query)("vehicleRegistrationNumber").exists(),
30
+ (0, express_validator_1.query)("tripNumber").not().exists(),
31
+ (0, express_validator_1.query)("cisId").not().exists(),
32
+ ],
33
+ [
34
+ (0, express_validator_1.query)("cisId").exists(),
35
+ (0, express_validator_1.query)("tripNumber").exists(),
36
+ (0, express_validator_1.query)("aswId").not().exists(),
37
+ (0, express_validator_1.query)("vehicleRegistrationNumber").not().exists(),
38
+ ],
39
+ ], {
40
+ message: "Either an aswId+vehicleRegistrationNumber (and no cisId+tripNumber), " +
41
+ "or a cisId+tripNumber (and aswId+vehicleRegistrationNumber) must be provided",
42
+ }),
43
+ (0, express_validator_1.query)("tripNumber").optional().isInt({ min: 0 }).toInt(10).not().isArray(),
44
+ (0, express_validator_1.query)("vehicleRegistrationNumber").optional().not().isEmpty({ ignore_whitespace: true }).not().isArray(),
45
+ (0, express_validator_1.query)("routeType").exists().isInt().isIn(Object.values(RouteTypeEnums_1.GTFSRouteTypeEnum)).toInt(10).not().isArray(),
46
+ (0, express_validator_1.query)("timeFrom").optional().isISO8601().custom(ParamValidatorManager_1.ParamValidatorManager.getTimeFromValidator()).not().isArray(),
47
+ (0, express_validator_1.query)("limit").optional().isInt({ min: 0 }).toInt(10).not().isArray(),
48
+ ];
49
+ this.router.get("/transferboards", transferBoardsValidation, Validation_1.checkErrors,
50
+ // max-age 5 seconds, stale-while-revalidate 5 seconds
51
+ this.cacheHeaderMiddleware.getMiddleware(5, 5), this.transferBoardsController.getTransferBoardData);
52
+ };
53
+ this.cacheHeaderMiddleware = ioc_1.OutputGatewayContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
54
+ this.transferBoardsController = Di_1.OgPidContainer.resolve(OgPidToken_1.OgPidToken.V4TransferBoardsController);
55
+ this.GtfsStopsSubscriber = Di_1.OgPidContainer.resolve(OgPidToken_1.OgPidToken.GtfsStopsSubscriber);
56
+ this.GtfsStopsSubscriber.initialize();
57
+ this.JisInotextsSubscriber = Di_1.OgPidContainer.resolve(OgPidToken_1.OgPidToken.JisInotextsSubscriber);
58
+ this.JisInotextsSubscriber.initialize();
59
+ this.VPSubscriber = Di_1.OgPidContainer.resolve(OgPidToken_1.OgPidToken.VPSubscriber);
60
+ this.VPSubscriber.initialize();
61
+ this.initRoutes();
62
+ }
63
+ }
64
+ exports.V4PIDRouter = V4PIDRouter;
65
+ const v4PidRouter = new V4PIDRouter();
66
+ exports.v4PidRouter = v4PidRouter;
67
+ //# sourceMappingURL=V4PIDRouter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V4PIDRouter.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/routers/v4/V4PIDRouter.ts"],"names":[],"mappings":";;;AAAA,uEAA4D;AAE5D,+EAA8E;AAC9E,qCAAgD;AAChD,qDAAoD;AAEpD,yDAAoD;AACpD,sFAAmF;AAEnF,6EAA2E;AAC3E,+DAA+F;AAC/F,+DAA2D;AAC3D,mFAA2E;AAC3E,6CAAmD;AAEnD,MAAa,WAAY,SAAQ,+BAAc;IAQ3C;QACI,KAAK,CAAC,wBAAY,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QARlB,WAAM,GAAW,IAAA,gBAAM,GAAE,CAAC;QAoBhC,eAAU,GAAG,GAAS,EAAE;YAC9B,IAAI,CAAC,4BAA4B,EAAE,CAAC;QACxC,CAAC,CAAC;QAEM,iCAA4B,GAAG,GAAG,EAAE;YACxC,MAAM,wBAAwB,GAAG;gBAC7B,IAAA,yBAAK,EAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,6CAAqB,CAAC,kBAAkB,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;gBAC5F,IAAA,yBAAK,EAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,kBAAU,EAAE,GAAG,EAAE,kBAAU,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;gBAC/F,IAAA,yBAAK,EACD;oBACI;wBACI,IAAA,yBAAK,EAAC,OAAO,CAAC,CAAC,MAAM,EAAE;wBACvB,IAAA,yBAAK,EAAC,2BAA2B,CAAC,CAAC,MAAM,EAAE;wBAC3C,IAAA,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otextRepository } from "../../data-access/JISInfotextRepository";
2
- import { IInfotextDepartureOutputDto, IInfotextOverviewOutputDto, IInfotextTransferOutputDto } from "../../domain/InfotextInterfaces";
3
+ import { IInfotextDepartureOutputDto, IInfotextOverviewOutputDto, IInfotextTransferOutputDto, IV4InfotextTransferOutputDto } from "../../domain/InfotextInterfaces";
3
4
  import { JISInfotextStopSuppressionFilter } from "../../helpers/JISInfotextStopSuppressionFilter";
4
5
  import { IGetDeparturesOptions } from "../../models/interfaces/IGetDeparturesOptions";
5
6
  import { Moment } from "@golemio/core/dist/shared/moment-timezone";
6
7
  import { JISInfotextDepartureTransformation } from "../transformations/JISInfotextDepartureTransformation";
7
8
  import { JISInfotextOverviewTransformation } from "../transformations/JISInfotextOverviewTransformation";
8
9
  import { JISInfotextTransferTransformation } from "../transformations/JISInfotextTransferTransformation";
10
+ import { JISInfotextCacheTransferTransformation } from "../transformations/JISInfotextCacheTransferTransformation";
9
11
  export declare class InfotextFacade {
10
12
  private infotextRepository;
11
13
  private infotextDepartureTransformation;
12
14
  private infotextTransferTransformation;
13
15
  private infotextOverviewTransformation;
14
16
  private infotextStopFilter;
15
- constructor(infotextRepository: JISInfotextRepository, infotextDepartureTransformation: JISInfotextDepartureTransformation, infotextTransferTransformation: JISInfotextTransferTransformation, infotextOverviewTransformation: JISInfotextOverviewTransformation, infotextStopFilter: JISInfotextStopSuppressionFilter);
17
+ private infotextsRedisRepository;
18
+ private cacheTransferTransformation;
19
+ constructor(infotextRepository: JISInfotextRepository, infotextDepartureTransformation: JISInfotextDepartureTransformation, infotextTransferTransformation: JISInfotextTransferTransformation, infotextOverviewTransformation: JISInfotextOverviewTransformation, infotextStopFilter: JISInfotextStopSuppressionFilter, infotextsRedisRepository: JISInfotextsRedisRepository, cacheTransferTransformation: JISInfotextCacheTransferTransformation);
16
20
  getInfotextsForDepartureBoards(stopIds: string[], currentMoment: Moment, options: IGetDeparturesOptions): Promise<IInfotextDepartureOutputDto[]>;
17
21
  getInfotextsForTransferBoards(stopIds: string[], currentMoment: Moment, timeFrom: Moment | null): Promise<IInfotextTransferOutputDto[]>;
18
22
  getInfotextsForOverview(): Promise<IInfotextOverviewOutputDto[]>;
23
+ getInfotextsCache(stopIds: string[], currentMoment: Date, timeFrom: Date | null): Promise<IV4InfotextTransferOutputDto[]>;
19
24
  }
@@ -13,6 +13,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.InfotextFacade = void 0;
16
+ const JISInfotextsRedisRepository_1 = require("../../../jis/data-access/cache/JISInfotextsRedisRepository");
16
17
  const JISInfotextRepository_1 = require("../../data-access/JISInfotextRepository");
17
18
  const JISInfotextStopSuppressionFilter_1 = require("../../helpers/JISInfotextStopSuppressionFilter");
18
19
  const OgPidToken_1 = require("../../ioc/OgPidToken");
@@ -21,13 +22,16 @@ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
21
22
  const JISInfotextDepartureTransformation_1 = require("../transformations/JISInfotextDepartureTransformation");
22
23
  const JISInfotextOverviewTransformation_1 = require("../transformations/JISInfotextOverviewTransformation");
23
24
  const JISInfotextTransferTransformation_1 = require("../transformations/JISInfotextTransferTransformation");
25
+ const JISInfotextCacheTransferTransformation_1 = require("../transformations/JISInfotextCacheTransferTransformation");
24
26
  let InfotextFacade = exports.InfotextFacade = class InfotextFacade {
25
- constructor(infotextRepository, infotextDepartureTransformation, infotextTransferTransformation, infotextOverviewTransformation, infotextStopFilter) {
27
+ constructor(infotextRepository, infotextDepartureTransformation, infotextTransferTransformation, infotextOverviewTransformation, infotextStopFilter, infotextsRedisRepository, cacheTransferTransformation) {
26
28
  this.infotextRepository = infotextRepository;
27
29
  this.infotextDepartureTransformation = infotextDepartureTransformation;
28
30
  this.infotextTransferTransformation = infotextTransferTransformation;
29
31
  this.infotextOverviewTransformation = infotextOverviewTransformation;
30
32
  this.infotextStopFilter = infotextStopFilter;
33
+ this.infotextsRedisRepository = infotextsRedisRepository;
34
+ this.cacheTransferTransformation = cacheTransferTransformation;
31
35
  }
32
36
  async getInfotextsForDepartureBoards(stopIds, currentMoment, options) {
33
37
  try {
@@ -69,9 +73,8 @@ let InfotextFacade = exports.InfotextFacade = class InfotextFacade {
69
73
  return this.infotextTransferTransformation.transformArray(filteredInfotexts);
70
74
  }
71
75
  catch (error) {
72
- if (error instanceof golemio_errors_1.AbstractGolemioError) {
76
+ if (error instanceof golemio_errors_1.AbstractGolemioError)
73
77
  throw error;
74
- }
75
78
  throw new golemio_errors_1.GeneralError("Failed to retrieve infotexts for transfer boards", this.constructor.name, error, 500);
76
79
  }
77
80
  }
@@ -94,6 +97,24 @@ let InfotextFacade = exports.InfotextFacade = class InfotextFacade {
94
97
  throw new golemio_errors_1.GeneralError("Failed to retrieve infotexts for overview", this.constructor.name, error, 500);
95
98
  }
96
99
  }
100
+ async getInfotextsCache(stopIds, currentMoment, timeFrom) {
101
+ try {
102
+ const infotexts = await this.infotextsRedisRepository.getActiveStopsInfotexts(stopIds, timeFrom ?? currentMoment);
103
+ if (infotexts.length === 0) {
104
+ return [];
105
+ }
106
+ const filteredInfotexts = this.infotextStopFilter.filterBySeverityLevel(infotexts);
107
+ if (filteredInfotexts.length === 0) {
108
+ return [];
109
+ }
110
+ return this.cacheTransferTransformation.transformArray(filteredInfotexts);
111
+ }
112
+ catch (error) {
113
+ if (error instanceof golemio_errors_1.AbstractGolemioError)
114
+ throw error;
115
+ throw new golemio_errors_1.GeneralError("Failed to retrieve infotexts for V4 transfer boards", this.constructor.name, error, 500);
116
+ }
117
+ }
97
118
  };
98
119
  exports.InfotextFacade = InfotextFacade = __decorate([
99
120
  (0, tsyringe_1.injectable)(),
@@ -102,10 +123,14 @@ exports.InfotextFacade = InfotextFacade = __decorate([
102
123
  __param(2, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.JISInfotextTransferTransformation)),
103
124
  __param(3, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.JISInfotextOverviewTransformation)),
104
125
  __param(4, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.JISInfotextStopSuppressionFilter)),
126
+ __param(5, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.JISInfotextsRedisRepository)),
127
+ __param(6, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.JISInfotextCacheTransferTransformation)),
105
128
  __metadata("design:paramtypes", [JISInfotextRepository_1.JISInfotextRepository,
106
129
  JISInfotextDepartureTransformation_1.JISInfotextDepartureTransformation,
107
130
  JISInfotextTransferTransformation_1.JISInfotextTransferTransformation,
108
131
  JISInfotextOverviewTransformation_1.JISInfotextOverviewTransformation,
109
- JISInfotextStopSuppressionFilter_1.JISInfotextStopSuppressionFilter])
132
+ JISInfotextStopSuppressionFilter_1.JISInfotextStopSuppressionFilter,
133
+ JISInfotextsRedisRepository_1.JISInfotextsRedisRepository,
134
+ JISInfotextCacheTransferTransformation_1.JISInfotextCacheTransferTransformation])
110
135
  ], InfotextFacade);
111
136
  //# sourceMappingURL=InfotextFacade.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InfotextFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/facade/InfotextFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mFAAkF;AAMlF,qGAAoG;AACpG,qDAAoD;AAEpD,6EAA8F;AAE9F,iEAAwE;AACxE,8GAA2G;AAC3G,4GAAyG;AACzG,4GAAyG;AAGlG,IAAM,cAAc,4BAApB,MAAM,cAAc;IACvB,YACsD,kBAAyC,EAEnF,+BAAmE,EAEnE,8BAAiE,EAEjE,8BAAiE,EACZ,kBAAoD;QAP/D,uBAAkB,GAAlB,kBAAkB,CAAuB;QAEnF,oCAA+B,GAA/B,+BAA+B,CAAoC;QAEnE,mCAA8B,GAA9B,8BAA8B,CAAmC;QAEjE,mCAA8B,GAA9B,8BAA8B,CAAmC;QACZ,uBAAkB,GAAlB,kBAAkB,CAAkC;IAClH,CAAC;IAEG,KAAK,CAAC,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;CACJ,CAAA;yBAvGY,cAAc;IAD1B,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,qBAAqB,CAAC,CAAA;IACxC,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,kCAAkC,CAAC,CAAA;IAErD,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,iCAAiC,CAAC,CAAA;IAEpD,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,iCAAiC,CAAC,CAAA;IAEpD,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,gCAAgC,CAAC,CAAA;qCAPkB,6CAAqB;QAElD,uEAAkC;QAEnC,qEAAiC;QAEjC,qEAAiC;QACQ,mEAAgC;GAT5G,cAAc,CAuG1B"}
1
+ {"version":3,"file":"InfotextFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/facade/InfotextFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4GAAoG;AACpG,mFAAkF;AAOlF,qGAAoG;AACpG,qDAAoD;AAEpD,6EAA8F;AAE9F,iEAAwE;AACxE,8GAA2G;AAC3G,4GAAyG;AACzG,4GAAyG;AACzG,sHAAmH;AAG5G,IAAM,cAAc,4BAApB,MAAM,cAAc;IACvB,YACsD,kBAAyC,EAEnF,+BAAmE,EAEnE,8BAAiE,EAEjE,8BAAiE,EACZ,kBAAoD,EACzD,wBAAqD,EAErG,2BAAmE;QAVzB,uBAAkB,GAAlB,kBAAkB,CAAuB;QAEnF,oCAA+B,GAA/B,+BAA+B,CAAoC;QAEnE,mCAA8B,GAA9B,8BAA8B,CAAmC;QAEjE,mCAA8B,GAA9B,8BAA8B,CAAmC;QACZ,uBAAkB,GAAlB,kBAAkB,CAAkC;QACzD,6BAAwB,GAAxB,wBAAwB,CAA6B;QAErG,gCAA2B,GAA3B,2BAA2B,CAAwC;IAC5E,CAAC;IAEG,KAAK,CAAC,8BAA8B,CACvC,OAAiB,EACjB,aAAqB,EACr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;QAEjC,qEAAiC;QACQ,mEAAgC;QAC/B,yDAA2B;QAExE,+EAAsC;GAZtE,cAAc,CA8H1B"}
@@ -1,9 +1,18 @@
1
1
  import { CisStopGroupRepository } from "../../../ropid-gtfs/data-access/CisStopGroupRepository";
2
+ import { GtfsStopsRedisRepository } from "../../../ropid-gtfs/data-access/redis/GtfsStopsRedisRepository";
2
3
  export declare class StopFacade {
3
4
  private cisStopGroupsRepository;
4
- constructor(cisStopGroupsRepository: CisStopGroupRepository);
5
+ private gtfsStopsRedisRepository;
6
+ private readonly gtfsStopParser;
7
+ constructor(cisStopGroupsRepository: CisStopGroupRepository, gtfsStopsRedisRepository: GtfsStopsRedisRepository);
8
+ getStopIdsForTransferBoards(cisId: string): Promise<string[]>;
5
9
  /**
6
- * Retrieves ASW node ID for given CIS ID and then returns GTFS stop IDs for this ASW node
10
+ * Retrieve ASW node ID for given CIS ID and then returns GTFS stop IDs for this ASW node
7
11
  */
8
- getStopIdsForTransferBoards(cisId: string): Promise<string[]>;
12
+ getStopIdsForTransferBoardsByCisId(cisId: string): Promise<string[]>;
13
+ /**
14
+ * Retrieve ASW node ID for given ASW stop ID and then returns GTFS stop IDs for this ASW node
15
+ */
16
+ getStopIdsForTransferBoardsByAswId(aswId: string): Promise<string[]>;
17
+ private getStopIdsForTransferBoardsByAswNode;
9
18
  }
@@ -13,18 +13,19 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.StopFacade = void 0;
16
+ const GtfsStopParser_1 = require("../../../../helpers/GtfsStopParser");
16
17
  const OgPidToken_1 = require("../../ioc/OgPidToken");
17
- const CisStopGroupRepository_1 = require("../../../ropid-gtfs/data-access/CisStopGroupRepository");
18
18
  const models_1 = require("../../../ropid-gtfs/models");
19
- const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
19
+ const CisStopGroupRepository_1 = require("../../../ropid-gtfs/data-access/CisStopGroupRepository");
20
+ const GtfsStopsRedisRepository_1 = require("../../../ropid-gtfs/data-access/redis/GtfsStopsRedisRepository");
20
21
  const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
22
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
21
23
  let StopFacade = exports.StopFacade = class StopFacade {
22
- constructor(cisStopGroupsRepository) {
24
+ constructor(cisStopGroupsRepository, gtfsStopsRedisRepository) {
23
25
  this.cisStopGroupsRepository = cisStopGroupsRepository;
26
+ this.gtfsStopsRedisRepository = gtfsStopsRedisRepository;
27
+ this.gtfsStopParser = new GtfsStopParser_1.GtfsStopParser();
24
28
  }
25
- /**
26
- * Retrieves ASW node ID for given CIS ID and then returns GTFS stop IDs for this ASW node
27
- */
28
29
  async getStopIdsForTransferBoards(cisId) {
29
30
  //#region CIS stop node
30
31
  let aswNode;
@@ -56,10 +57,45 @@ let StopFacade = exports.StopFacade = class StopFacade {
56
57
  //#endregion
57
58
  return stopIds;
58
59
  }
60
+ /**
61
+ * Retrieve ASW node ID for given CIS ID and then returns GTFS stop IDs for this ASW node
62
+ */
63
+ async getStopIdsForTransferBoardsByCisId(cisId) {
64
+ try {
65
+ const aswNodeId = await this.gtfsStopsRedisRepository.getAswNodeIdFromCisId(cisId);
66
+ if (aswNodeId === null) {
67
+ return [];
68
+ }
69
+ return await this.getStopIdsForTransferBoardsByAswNode(aswNodeId);
70
+ }
71
+ catch (error) {
72
+ if (error instanceof golemio_errors_1.AbstractGolemioError)
73
+ throw error;
74
+ throw new golemio_errors_1.GeneralError("Failed to retrieve CIS stop node", this.constructor.name, error, 500);
75
+ }
76
+ }
77
+ /**
78
+ * Retrieve ASW node ID for given ASW stop ID and then returns GTFS stop IDs for this ASW node
79
+ */
80
+ async getStopIdsForTransferBoardsByAswId(aswId) {
81
+ return await this.getStopIdsForTransferBoardsByAswNode(this.gtfsStopParser.getAswNodeFromId(aswId));
82
+ }
83
+ async getStopIdsForTransferBoardsByAswNode(aswNodeId) {
84
+ try {
85
+ return await this.gtfsStopsRedisRepository.getGtfsStopIdsByAswNode(aswNodeId);
86
+ }
87
+ catch (error) {
88
+ if (error instanceof golemio_errors_1.AbstractGolemioError)
89
+ throw error;
90
+ throw new golemio_errors_1.GeneralError("Failed to retrieve GTFS stops", this.constructor.name, error, 500);
91
+ }
92
+ }
59
93
  };
60
94
  exports.StopFacade = StopFacade = __decorate([
61
95
  (0, tsyringe_1.injectable)(),
62
96
  __param(0, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.CisStopGroupRepository)),
63
- __metadata("design:paramtypes", [CisStopGroupRepository_1.CisStopGroupRepository])
97
+ __param(1, (0, tsyringe_1.inject)(OgPidToken_1.OgPidToken.GtfsStopsRedisRepository)),
98
+ __metadata("design:paramtypes", [CisStopGroupRepository_1.CisStopGroupRepository,
99
+ GtfsStopsRedisRepository_1.GtfsStopsRedisRepository])
64
100
  ], StopFacade);
65
101
  //# sourceMappingURL=StopFacade.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StopFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/facade/StopFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,qDAAoD;AACpD,mGAA2F;AAC3F,uDAA+C;AAC/C,6EAA8F;AAC9F,iEAAwE;AAGjE,IAAM,UAAU,wBAAhB,MAAM,UAAU;IACnB,YAA+D,uBAA+C;QAA/C,4BAAuB,GAAvB,uBAAuB,CAAwB;IAAG,CAAC;IAElH;;OAEG;IACI,KAAK,CAAC,2BAA2B,CAAC,KAAa;QAClD,uBAAuB;QACvB,IAAI,OAAe,CAAC;QACpB,IAAI;YACA,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;YAC7E,IAAI,WAAW,KAAK,IAAI,EAAE;gBACtB,OAAO,EAAE,CAAC;aACb;YAED,OAAO,GAAG,WAAW,CAAC;SACzB;QAAC,OAAO,KAAK,EAAE;YACZ,IAAI,KAAK,YAAY,qCAAoB,EAAE;gBACvC,MAAM,KAAK,CAAC;aACf;YAED,MAAM,IAAI,6BAAY,CAAC,kCAAkC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;SACjG;QACD,YAAY;QAEZ,uBAAuB;QACvB,IAAI,OAAO,GAAa,EAAE,CAAC;QAC3B,IAAI;YACA,OAAO,GAAG,MAAM,eAAM,CAAC,aAAa,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;SACzE;QAAC,OAAO,KAAK,EAAE;YACZ,IAAI,KAAK,YAAY,qCAAoB,EAAE;gBACvC,MAAM,KAAK,CAAC;aACf;YAED,MAAM,IAAI,6BAAY,CAAC,+BAA+B,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;SAC9F;QACD,YAAY;QAEZ,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ,CAAA;qBAxCY,UAAU;IADtB,IAAA,qBAAU,GAAE;IAEI,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,sBAAsB,CAAC,CAAA;qCAAkC,+CAAsB;GADrG,UAAU,CAwCtB"}
1
+ {"version":3,"file":"StopFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/facade/StopFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uEAAyD;AACzD,qDAAoD;AACpD,uDAA+C;AAC/C,mGAA2F;AAC3F,6GAAqG;AACrG,iEAAwE;AACxE,6EAA8F;AAGvF,IAAM,UAAU,wBAAhB,MAAM,UAAU;IAGnB,YAC+C,uBAAuD,EACrD,wBAA0D;QADpD,4BAAuB,GAAvB,uBAAuB,CAAwB;QAC7C,6BAAwB,GAAxB,wBAAwB,CAA0B;QAJ1F,mBAAc,GAAG,IAAI,+BAAc,EAAE,CAAC;IAKpD,CAAC;IAEG,KAAK,CAAC,2BAA2B,CAAC,KAAa;QAClD,uBAAuB;QACvB,IAAI,OA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C,kCAAkC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;SACjG;IACL,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,kCAAkC,CAAC,KAAa;QACzD,OAAO,MAAM,IAAI,CAAC,oCAAoC,CAAC,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;IACxG,CAAC;IAEO,KAAK,CAAC,oCAAoC,CAAC,SAAiB;QAChE,IAAI;YACA,OAAO,MAAM,IAAI,CAAC,wBAAwB,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;SACjF;QAAC,OAAO,KAAK,EAAE;YACZ,IAAI,KAAK,YAAY,qCAAoB;gBAAE,MAAM,KAAK,CAAC;YACvD,MAAM,IAAI,6BAAY,CAAC,+BAA+B,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;SAC9F;IACL,CAAC;CACJ,CAAA;qBA1EY,UAAU;IADtB,IAAA,qBAAU,GAAE;IAKJ,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,sBAAsB,CAAC,CAAA;IACzC,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,wBAAwB,CAAC,CAAA;qCADgC,+CAAsB;QACnB,mDAAwB;GALlG,UAAU,CA0EtB"}
@@ -1,18 +1,20 @@
1
- import { ITransferOutputDto } from "../..";
2
- import { DeparturesRepository } from "../../data-access";
1
+ import { ITransferOutputDto, IV4TransferDto } from "../..";
3
2
  import { Moment } from "@golemio/core/dist/shared/moment-timezone";
4
3
  import { TransferDepartureTransformation } from "../transformations/TransferDepartureTransformation";
4
+ import { PublicGtfsDepartureRepository } from "../../../public/data-access/redis/PublicGtfsDepartureRepository";
5
+ import { PublicVehiclePositionsRepository } from "../../../public/data-access/redis/PublicVehiclePositionsRepository";
6
+ import { PublicStopTimeRepository } from "../../../public/data-access/redis/PublicStopTimeRepository";
7
+ import { DeparturesRepository } from "../../data-access";
5
8
  export declare class TransferFacade {
9
+ private publicDepartureRepository;
6
10
  private departureRepository;
7
11
  private departureTransformation;
8
- constructor(departureRepository: DeparturesRepository, departureTransformation: TransferDepartureTransformation);
9
- /**
10
- * Retrieves transfer departures for given GTFS stop IDs
11
- * - Get transfer departures from DB
12
- * - Process them (filter, sort, etc.)
13
- * - Transform them to DTO
14
- */
12
+ private tripRepository;
13
+ private stopTimeRepository;
14
+ constructor(publicDepartureRepository: PublicGtfsDepartureRepository, departureRepository: DeparturesRepository, departureTransformation: TransferDepartureTransformation, tripRepository: PublicVehiclePositionsRepository, stopTimeRepository: PublicStopTimeRepository);
15
15
  getTransferDepartures(stopIds: string[], tripNumber: string | null, currentMoment: Moment, minutesOffset: number, timeZone?: string): Promise<ITransferOutputDto[]>;
16
+ getTransferCache(stopIds: string[], reqNumber?: number, vehicleType?: number): Promise<IV4TransferDto>;
17
+ private processMultiplePostionsForDeparture;
16
18
  /**
17
19
  * Fallback options as defined by ROPID
18
20
  */