@golemio/pid 2.13.6-dev.1313101349 → 2.13.6-dev.1313748965

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 (121) hide show
  1. package/db/example/02_pid_line_example_115.sql +148 -0
  2. package/db/migrations/postgresql/20240529165139-gtfs-index-optimization.js +53 -0
  3. package/db/migrations/postgresql/sqls/20240529165139-gtfs-index-optimization-down.sql +2 -0
  4. package/db/migrations/postgresql/sqls/20240529165139-gtfs-index-optimization-up.sql +2 -0
  5. package/dist/helpers/PassengerTransferEnums.d.ts +20 -0
  6. package/dist/helpers/PassengerTransferEnums.js +26 -0
  7. package/dist/helpers/PassengerTransferEnums.js.map +1 -0
  8. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CheckForNewDeparturesPresetsTask.js +0 -1
  9. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CheckForNewDeparturesPresetsTask.js.map +1 -1
  10. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/DownloadDeparturesPresetsTask.js +0 -1
  11. package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/DownloadDeparturesPresetsTask.js.map +1 -1
  12. package/dist/output-gateway/departure-boards/DepartureBoardsRouter.d.ts +1 -0
  13. package/dist/output-gateway/departure-boards/DepartureBoardsRouter.js +9 -6
  14. package/dist/output-gateway/departure-boards/DepartureBoardsRouter.js.map +1 -1
  15. package/dist/output-gateway/pid/PIDRouter.d.ts +1 -0
  16. package/dist/output-gateway/pid/PIDRouter.js +9 -9
  17. package/dist/output-gateway/pid/PIDRouter.js.map +1 -1
  18. package/dist/output-gateway/public/controllers/v1/PublicGtfsController.d.ts +6 -0
  19. package/dist/output-gateway/public/controllers/v1/PublicGtfsController.js +44 -0
  20. package/dist/output-gateway/public/controllers/v1/PublicGtfsController.js.map +1 -0
  21. package/dist/output-gateway/public/controllers/v1/interfaces/PublicParamsInterfaces.d.ts +4 -0
  22. package/dist/output-gateway/public/domain/ITripScopeHandler.d.ts +7 -0
  23. package/dist/output-gateway/public/domain/{ITripScopeHandlerFactory.js → ITripScopeHandler.js} +1 -1
  24. package/dist/output-gateway/public/domain/ITripScopeHandler.js.map +1 -0
  25. package/dist/output-gateway/public/domain/PublicApiGtfsTripLookupInterfaces.d.ts +35 -0
  26. package/dist/output-gateway/public/domain/PublicApiGtfsTripLookupInterfaces.js +3 -0
  27. package/dist/output-gateway/public/domain/PublicApiGtfsTripLookupInterfaces.js.map +1 -0
  28. package/dist/output-gateway/public/ioc/Di.js +34 -8
  29. package/dist/output-gateway/public/ioc/Di.js.map +1 -1
  30. package/dist/output-gateway/public/ioc/OgModuleToken.d.ts +10 -0
  31. package/dist/output-gateway/public/ioc/OgModuleToken.js +14 -0
  32. package/dist/output-gateway/public/ioc/OgModuleToken.js.map +1 -1
  33. package/dist/output-gateway/public/routers/v1/PublicDeparturesRouter.d.ts +2 -1
  34. package/dist/output-gateway/public/routers/v1/PublicDeparturesRouter.js +8 -4
  35. package/dist/output-gateway/public/routers/v1/PublicDeparturesRouter.js.map +1 -1
  36. package/dist/output-gateway/public/routers/v1/PublicGtfsRouter.d.ts +11 -0
  37. package/dist/output-gateway/public/routers/v1/PublicGtfsRouter.js +27 -0
  38. package/dist/output-gateway/public/routers/v1/PublicGtfsRouter.js.map +1 -0
  39. package/dist/output-gateway/public/routers/v1/PublicVehiclePositionsRouter.d.ts +2 -1
  40. package/dist/output-gateway/public/routers/v1/PublicVehiclePositionsRouter.js +12 -4
  41. package/dist/output-gateway/public/routers/v1/PublicVehiclePositionsRouter.js.map +1 -1
  42. package/dist/output-gateway/public/service/facade/DetailedTripFacade.d.ts +2 -2
  43. package/dist/output-gateway/public/service/facade/DetailedTripFacade.js.map +1 -1
  44. package/dist/output-gateway/public/service/facade/GtfsTripLookupFacade.d.ts +10 -0
  45. package/dist/output-gateway/public/service/facade/GtfsTripLookupFacade.js +50 -0
  46. package/dist/output-gateway/public/service/facade/GtfsTripLookupFacade.js.map +1 -0
  47. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/GtfsTripScopeHandlerFactory.d.ts +11 -0
  48. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/GtfsTripScopeHandlerFactory.js +43 -0
  49. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/GtfsTripScopeHandlerFactory.js.map +1 -0
  50. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/AbstractGtfsTripScopeHandler.d.ts +6 -0
  51. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/AbstractGtfsTripScopeHandler.js +7 -0
  52. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/AbstractGtfsTripScopeHandler.js.map +1 -0
  53. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/InfoTripScopeHandler.d.ts +9 -0
  54. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/InfoTripScopeHandler.js +35 -0
  55. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/InfoTripScopeHandler.js.map +1 -0
  56. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/ShapesTripScopeHandler.d.ts +9 -0
  57. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/ShapesTripScopeHandler.js +36 -0
  58. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/ShapesTripScopeHandler.js.map +1 -0
  59. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/StopTimesTripScopeHandler.d.ts +9 -0
  60. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/StopTimesTripScopeHandler.js +38 -0
  61. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/StopTimesTripScopeHandler.js.map +1 -0
  62. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/VehicleDescriptorTripScopeHandler.d.ts +9 -0
  63. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/VehicleDescriptorTripScopeHandler.js +35 -0
  64. package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/VehicleDescriptorTripScopeHandler.js.map +1 -0
  65. package/dist/output-gateway/public/service/helpers/trip-scope/TripScopeHandlerFactory.d.ts +4 -5
  66. package/dist/output-gateway/public/service/helpers/trip-scope/TripScopeHandlerFactory.js +6 -6
  67. package/dist/output-gateway/public/service/helpers/trip-scope/TripScopeHandlerFactory.js.map +1 -1
  68. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/{AbstractTripScopeHandler.d.ts → AbstractDetailedTripScopeHandler.d.ts} +2 -1
  69. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/AbstractDetailedTripScopeHandler.js +7 -0
  70. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/AbstractDetailedTripScopeHandler.js.map +1 -0
  71. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/InfoTripScopeHandler.d.ts +2 -2
  72. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/InfoTripScopeHandler.js +2 -2
  73. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/InfoTripScopeHandler.js.map +1 -1
  74. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.d.ts +2 -2
  75. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.js +2 -2
  76. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.js.map +1 -1
  77. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.d.ts +2 -2
  78. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js +2 -2
  79. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js.map +1 -1
  80. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler.d.ts +2 -2
  81. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler.js +2 -2
  82. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler.js.map +1 -1
  83. package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripInfoTransformation.d.ts +15 -0
  84. package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripInfoTransformation.js +35 -0
  85. package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripInfoTransformation.js.map +1 -0
  86. package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripShapesTransformation.d.ts +7 -0
  87. package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripShapesTransformation.js +30 -0
  88. package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripShapesTransformation.js.map +1 -0
  89. package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsVehicleDescriptorTransformation.d.ts +10 -0
  90. package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsVehicleDescriptorTransformation.js +33 -0
  91. package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsVehicleDescriptorTransformation.js.map +1 -0
  92. package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicTripStopTimesTransformation.d.ts +8 -0
  93. package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicTripStopTimesTransformation.js +46 -0
  94. package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicTripStopTimesTransformation.js.map +1 -0
  95. package/dist/output-gateway/ropid-gtfs/GTFSRouter.d.ts +2 -1
  96. package/dist/output-gateway/ropid-gtfs/GTFSRouter.js +30 -27
  97. package/dist/output-gateway/ropid-gtfs/GTFSRouter.js.map +1 -1
  98. package/dist/output-gateway/ropid-gtfs/data-access/GtfsTripScheduleRepository.d.ts +8 -0
  99. package/dist/output-gateway/ropid-gtfs/data-access/GtfsTripScheduleRepository.js +22 -0
  100. package/dist/output-gateway/ropid-gtfs/data-access/GtfsTripScheduleRepository.js.map +1 -0
  101. package/dist/output-gateway/ropid-gtfs/models/GTFSStopTimesModel.js +2 -1
  102. package/dist/output-gateway/ropid-gtfs/models/GTFSStopTimesModel.js.map +1 -1
  103. package/dist/output-gateway/ropid-gtfs/models/GTFSTripsModel.d.ts +9 -1
  104. package/dist/output-gateway/ropid-gtfs/models/GTFSTripsModel.js +93 -2
  105. package/dist/output-gateway/ropid-gtfs/models/GTFSTripsModel.js.map +1 -1
  106. package/dist/output-gateway/vehicle-positions/VehiclePositionsRouter.d.ts +1 -0
  107. package/dist/output-gateway/vehicle-positions/VehiclePositionsRouter.js +27 -9
  108. package/dist/output-gateway/vehicle-positions/VehiclePositionsRouter.js.map +1 -1
  109. package/dist/schema-definitions/ropid-gtfs/RopidGTFSPrecomputed.js +8 -2
  110. package/dist/schema-definitions/ropid-gtfs/RopidGTFSPrecomputed.js.map +1 -1
  111. package/dist/schema-definitions/ropid-gtfs/RopidGTFSRunNumbers.d.ts +1 -1
  112. package/dist/schema-definitions/ropid-gtfs/interfaces/ITripWithOptionalAssociationsDto.d.ts +19 -0
  113. package/dist/schema-definitions/ropid-gtfs/interfaces/ITripWithOptionalAssociationsDto.js +3 -0
  114. package/dist/schema-definitions/ropid-gtfs/interfaces/ITripWithOptionalAssociationsDto.js.map +1 -0
  115. package/docs/implementation_documentation.md +10 -1
  116. package/docs/openapi-output.yaml +151 -13
  117. package/package.json +2 -2
  118. package/dist/output-gateway/public/domain/ITripScopeHandlerFactory.d.ts +0 -5
  119. package/dist/output-gateway/public/domain/ITripScopeHandlerFactory.js.map +0 -1
  120. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/AbstractTripScopeHandler.js +0 -7
  121. package/dist/output-gateway/public/service/helpers/trip-scope/strategy/AbstractTripScopeHandler.js.map +0 -1
@@ -15,13 +15,23 @@ const PublicVehiclePositionsRepository_1 = require("../data-access/redis/PublicV
15
15
  const VPSubscriber_1 = require("../service/VPSubscriber");
16
16
  const DepartureBoardFacade_1 = require("../service/facade/DepartureBoardFacade");
17
17
  const DetailedTripFacade_1 = require("../service/facade/DetailedTripFacade");
18
+ const GtfsTripLookupFacade_1 = require("../service/facade/GtfsTripLookupFacade");
18
19
  const VehiclePositionsFacade_1 = require("../service/facade/VehiclePositionsFacade");
19
20
  const BoundingBoxHelper_1 = require("../service/helpers/BoundingBoxHelper");
21
+ const GtfsTripScopeHandlerFactory_1 = require("../service/helpers/gtfs-trip-scope/GtfsTripScopeHandlerFactory");
22
+ const InfoTripScopeHandler_1 = require("../service/helpers/gtfs-trip-scope/strategy/InfoTripScopeHandler");
23
+ const ShapesTripScopeHandler_1 = require("../service/helpers/gtfs-trip-scope/strategy/ShapesTripScopeHandler");
24
+ const StopTimesTripScopeHandler_1 = require("../service/helpers/gtfs-trip-scope/strategy/StopTimesTripScopeHandler");
25
+ const VehicleDescriptorTripScopeHandler_1 = require("../service/helpers/gtfs-trip-scope/strategy/VehicleDescriptorTripScopeHandler");
20
26
  const TripScopeHandlerFactory_1 = require("../service/helpers/trip-scope/TripScopeHandlerFactory");
21
- const InfoTripScopeHandler_1 = require("../service/helpers/trip-scope/strategy/InfoTripScopeHandler");
22
- const ShapesTripScopeHandler_1 = require("../service/helpers/trip-scope/strategy/ShapesTripScopeHandler");
23
- const StopTimesTripScopeHandler_1 = require("../service/helpers/trip-scope/strategy/StopTimesTripScopeHandler");
24
- const VehicleDescriptorTripScopeHandler_1 = require("../service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler");
27
+ const InfoTripScopeHandler_2 = require("../service/helpers/trip-scope/strategy/InfoTripScopeHandler");
28
+ const ShapesTripScopeHandler_2 = require("../service/helpers/trip-scope/strategy/ShapesTripScopeHandler");
29
+ const StopTimesTripScopeHandler_2 = require("../service/helpers/trip-scope/strategy/StopTimesTripScopeHandler");
30
+ const VehicleDescriptorTripScopeHandler_2 = require("../service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler");
31
+ const PublicGtfsTripInfoTransformation_1 = require("../service/transformations/gtfs-trip-scopes/PublicGtfsTripInfoTransformation");
32
+ const PublicGtfsTripShapesTransformation_1 = require("../service/transformations/gtfs-trip-scopes/PublicGtfsTripShapesTransformation");
33
+ const PublicGtfsVehicleDescriptorTransformation_1 = require("../service/transformations/gtfs-trip-scopes/PublicGtfsVehicleDescriptorTransformation");
34
+ const PublicTripStopTimesTransformation_1 = require("../service/transformations/gtfs-trip-scopes/PublicTripStopTimesTransformation");
25
35
  const OgModuleToken_1 = require("./OgModuleToken");
26
36
  const ogPublicContainer = Di_1.OutputGatewayContainer.createChildContainer();
27
37
  exports.OgPublicContainer = ogPublicContainer;
@@ -38,11 +48,27 @@ ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.PublicVehicleP
38
48
  ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.DelayComputationRepository, DelayComputationRepository_1.DelayComputationRepository);
39
49
  ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.PublicStopTimeRepository, PublicStopTimeRepository_1.PublicStopTimeRepository);
40
50
  ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.PublicGtfsDepartureRepository, PublicGtfsDepartureRepository_1.PublicGtfsDepartureRepository);
41
- ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.InfoTripScopeHandler, InfoTripScopeHandler_1.InfoTripScopeHandler);
42
- ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.StopTimesTripScopeHandler, StopTimesTripScopeHandler_1.StopTimesTripScopeHandler);
43
- ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.ShapesTripScopeHandler, ShapesTripScopeHandler_1.ShapesTripScopeHandler);
44
- ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.VehicleDescriptorTripScopeHandler, VehicleDescriptorTripScopeHandler_1.VehicleDescriptorTripScopeHandler);
51
+ ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.InfoTripScopeHandler, InfoTripScopeHandler_2.InfoTripScopeHandler);
52
+ ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.StopTimesTripScopeHandler, StopTimesTripScopeHandler_2.StopTimesTripScopeHandler);
53
+ ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.ShapesTripScopeHandler, ShapesTripScopeHandler_2.ShapesTripScopeHandler);
54
+ ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.VehicleDescriptorTripScopeHandler, VehicleDescriptorTripScopeHandler_2.VehicleDescriptorTripScopeHandler);
45
55
  ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.TripScopeHandlerFactory, TripScopeHandlerFactory_1.TripScopeHandlerFactory);
56
+ //#region GtfsTripLookup scope handlers
57
+ ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.PublicGtfsTripInfoTransformation, PublicGtfsTripInfoTransformation_1.PublicGtfsTripInfoTransformation);
58
+ ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.PublicGtfsTripShapesTransformation, PublicGtfsTripShapesTransformation_1.PublicGtfsTripShapesTransformation);
59
+ ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.PublicGtfsVehicleDescriptorTransformation, PublicGtfsVehicleDescriptorTransformation_1.PublicGtfsVehicleDescriptorTransformation);
60
+ ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.PublicGtfsTripStopTimesTransformation, PublicTripStopTimesTransformation_1.PublicGtfsTripStopTimesTransformation);
61
+ ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.InfoGtfsTripScopeHandler, InfoTripScopeHandler_1.InfoGtfsTripScopeHandler);
62
+ ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.StopTimesGtfsTripScopeHandler, StopTimesTripScopeHandler_1.StopTimesGtfsTripScopeHandler);
63
+ ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.ShapesGtfsTripScopeHandler, ShapesTripScopeHandler_1.ShapesGtfsTripScopeHandler);
64
+ ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.VehicleDescriptorGtfsTripScopeHandler, VehicleDescriptorTripScopeHandler_1.VehicleDescriptorGtfsTripScopeHandler);
65
+ ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.GtfsTripScopeHandlerFactory, GtfsTripScopeHandlerFactory_1.GtfsTripScopeHandlerFactory);
66
+ //#endregion
67
+ ogPublicContainer.register(OgModuleToken_1.OgModuleToken.GtfsTripLookupFacade, {
68
+ useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
69
+ return new GtfsTripLookupFacade_1.GtfsTripLookupFacade(c.resolve(OgModuleToken_1.OgModuleToken.GtfsTripScopeHandlerFactory));
70
+ }),
71
+ });
46
72
  ogPublicContainer.register(OgModuleToken_1.OgModuleToken.PublicVehiclePositionsFacade, {
47
73
  useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
48
74
  return new VehiclePositionsFacade_1.PublicVehiclePositionsFacade(c.resolve(OgModuleToken_1.OgModuleToken.PublicVehiclePositionsRepository), c.resolve(OgModuleToken_1.OgModuleToken.BoundingBoxHelper), c.resolve(CoreToken_1.CoreToken.Logger));
@@ -1 +1 @@
1
- {"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/output-gateway/public/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,oFAAyE;AACzE,qFAAmF;AAEnF,oGAAiG;AACjG,wEAAqE;AAErE,iEAAkF;AAClF,iEAA4E;AAC5E,wGAAqG;AACrG,gGAA6F;AAC7F,sGAAmG;AACnG,4FAAyF;AACzF,4GAAyG;AAGzG,0DAAuD;AACvD,iFAA8E;AAC9E,6EAA0E;AAC1E,qFAAwF;AACxF,4EAAyE;AAEzE,mGAAgG;AAChG,sGAAmG;AACnG,0GAAuG;AACvG,gHAA6G;AAC7G,gIAA6H;AAC7H,mDAAgD;AAEhD,MAAM,iBAAiB,GAAG,2BAAsB,CAAC,oBAAoB,EAAE,CAAC;AAsE1C,8CAAiB;AApE/C,iBAAiB,CAAC,QAAQ,CAAC,6BAAa,CAA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B;YAC1C,qBAAqB,EAAE,MAAM,CAAC,QAAQ,CAAS,gBAAgB,CAAC;YAChE,MAAM,EAAE,MAAM;SACjB,EACD,CAAC,CAAC,OAAO,CAA8B,6BAAa,CAAC,gCAAgC,CAAC,CACzF,CAAC;IACN,CAAC,CAAC;CACL,CAAC,CAAC"}
@@ -12,6 +12,16 @@ export declare const OgModuleToken: {
12
12
  ShapesTripScopeHandler: symbol;
13
13
  VehicleDescriptorTripScopeHandler: symbol;
14
14
  TripScopeHandlerFactory: symbol;
15
+ PublicGtfsTripInfoTransformation: symbol;
16
+ PublicGtfsTripShapesTransformation: symbol;
17
+ PublicGtfsVehicleDescriptorTransformation: symbol;
18
+ PublicGtfsTripStopTimesTransformation: symbol;
19
+ InfoGtfsTripScopeHandler: symbol;
20
+ StopTimesGtfsTripScopeHandler: symbol;
21
+ ShapesGtfsTripScopeHandler: symbol;
22
+ VehicleDescriptorGtfsTripScopeHandler: symbol;
23
+ GtfsTripScopeHandlerFactory: symbol;
24
+ GtfsTripLookupFacade: symbol;
15
25
  PublicVehiclePositionsFacade: symbol;
16
26
  DetailedTripFacade: symbol;
17
27
  DepartureBoardFacade: symbol;
@@ -10,11 +10,25 @@ exports.OgModuleToken = {
10
10
  PublicStopTimeRepository: Symbol(),
11
11
  DelayComputationRepository: Symbol(),
12
12
  PublicGtfsDepartureRepository: Symbol(),
13
+ //#region DetailedTrip scope handlers
13
14
  InfoTripScopeHandler: Symbol(),
14
15
  StopTimesTripScopeHandler: Symbol(),
15
16
  ShapesTripScopeHandler: Symbol(),
16
17
  VehicleDescriptorTripScopeHandler: Symbol(),
17
18
  TripScopeHandlerFactory: Symbol(),
19
+ //#endregion
20
+ //#region GtfsTripLookup scope handlers
21
+ PublicGtfsTripInfoTransformation: Symbol(),
22
+ PublicGtfsTripShapesTransformation: Symbol(),
23
+ PublicGtfsVehicleDescriptorTransformation: Symbol(),
24
+ PublicGtfsTripStopTimesTransformation: Symbol(),
25
+ InfoGtfsTripScopeHandler: Symbol(),
26
+ StopTimesGtfsTripScopeHandler: Symbol(),
27
+ ShapesGtfsTripScopeHandler: Symbol(),
28
+ VehicleDescriptorGtfsTripScopeHandler: Symbol(),
29
+ GtfsTripScopeHandlerFactory: Symbol(),
30
+ //#endregion
31
+ GtfsTripLookupFacade: Symbol(),
18
32
  PublicVehiclePositionsFacade: Symbol(),
19
33
  DetailedTripFacade: Symbol(),
20
34
  DepartureBoardFacade: Symbol(),
@@ -1 +1 @@
1
- {"version":3,"file":"OgModuleToken.js","sourceRoot":"","sources":["../../../../src/output-gateway/public/ioc/OgModuleToken.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IACzB,cAAc,EAAE,MAAM,EAAE;IACxB,oBAAoB,EAAE,MAAM,EAAE;IAC9B,iBAAiB,EAAE,MAAM,EAAE;IAC3B,iCAAiC,EAAE,MAAM,EAAE;IAC3C,gCAAgC,EAAE,MAAM,EAAE;IAC1C,wBAAwB,EAAE,MAAM,EAAE;IAClC,0BAA0B,EAAE,MAAM,EAAE;IACpC,6BAA6B,EAAE,MAAM,EAAE;IACvC,oBAAoB,EAAE,MAAM,EAAE;IAC9B,yBAAyB,EAAE,MAAM,EAAE;IACnC,sBAAsB,EAAE,MAAM,EAAE;IAChC,iCAAiC,EAAE,MAAM,EAAE;IAC3C,uBAAuB,EAAE,MAAM,EAAE;IACjC,4BAA4B,EAAE,MAAM,EAAE;IACtC,kBAAkB,EAAE,MAAM,EAAE;IAC5B,oBAAoB,EAAE,MAAM,EAAE;IAC9B,YAAY,EAAE,MAAM,EAAE;CACzB,CAAC"}
1
+ {"version":3,"file":"OgModuleToken.js","sourceRoot":"","sources":["../../../../src/output-gateway/public/ioc/OgModuleToken.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IACzB,cAAc,EAAE,MAAM,EAAE;IACxB,oBAAoB,EAAE,MAAM,EAAE;IAC9B,iBAAiB,EAAE,MAAM,EAAE;IAC3B,iCAAiC,EAAE,MAAM,EAAE;IAC3C,gCAAgC,EAAE,MAAM,EAAE;IAC1C,wBAAwB,EAAE,MAAM,EAAE;IAClC,0BAA0B,EAAE,MAAM,EAAE;IACpC,6BAA6B,EAAE,MAAM,EAAE;IACvC,qCAAqC;IACrC,oBAAoB,EAAE,MAAM,EAAE;IAC9B,yBAAyB,EAAE,MAAM,EAAE;IACnC,sBAAsB,EAAE,MAAM,EAAE;IAChC,iCAAiC,EAAE,MAAM,EAAE;IAC3C,uBAAuB,EAAE,MAAM,EAAE;IACjC,YAAY;IACZ,uCAAuC;IACvC,gCAAgC,EAAE,MAAM,EAAE;IAC1C,kCAAkC,EAAE,MAAM,EAAE;IAC5C,yCAAyC,EAAE,MAAM,EAAE;IACnD,qCAAqC,EAAE,MAAM,EAAE;IAC/C,wBAAwB,EAAE,MAAM,EAAE;IAClC,6BAA6B,EAAE,MAAM,EAAE;IACvC,0BAA0B,EAAE,MAAM,EAAE;IACpC,qCAAqC,EAAE,MAAM,EAAE;IAC/C,2BAA2B,EAAE,MAAM,EAAE;IACrC,YAAY;IACZ,oBAAoB,EAAE,MAAM,EAAE;IAC9B,4BAA4B,EAAE,MAAM,EAAE;IACtC,kBAAkB,EAAE,MAAM,EAAE;IAC5B,oBAAoB,EAAE,MAAM,EAAE;IAC9B,YAAY,EAAE,MAAM,EAAE;CACzB,CAAC"}
@@ -2,9 +2,10 @@
2
2
  import { Router } from "@golemio/core/dist/shared/express";
3
3
  export declare class PublicDeparturesRouter {
4
4
  router: Router;
5
+ private cacheHeaderMiddleware;
5
6
  private departureController;
6
7
  constructor();
7
- protected initRoutes(expire?: string | number | undefined): void;
8
+ protected initRoutes(): void;
8
9
  }
9
10
  declare const v1PublicDeparturesRouter: Router;
10
11
  export { v1PublicDeparturesRouter };
@@ -2,24 +2,28 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.v1PublicDeparturesRouter = exports.PublicDeparturesRouter = void 0;
4
4
  const PublicDepartureBoardsController_1 = require("../../controllers/v1/PublicDepartureBoardsController");
5
+ const Di_1 = require("../../ioc/Di");
5
6
  const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
7
+ const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
6
8
  const express_1 = require("@golemio/core/dist/shared/express");
7
9
  const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
8
10
  const CustomStopIdGroupValidator_1 = require("./helpers/CustomStopIdGroupValidator");
9
- const redis_1 = require("@golemio/core/dist/output-gateway/redis");
10
11
  class PublicDeparturesRouter {
11
12
  constructor() {
12
13
  this.router = (0, express_1.Router)();
14
+ this.cacheHeaderMiddleware = Di_1.OgPublicContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
13
15
  this.departureController = new PublicDepartureBoardsController_1.PublicDepartureBoardsController();
14
- this.initRoutes("5 seconds");
16
+ this.initRoutes();
15
17
  }
16
- initRoutes(expire) {
18
+ initRoutes() {
17
19
  this.router.get("/", [
18
20
  (0, express_validator_1.query)("stopIds").exists().custom(CustomStopIdGroupValidator_1.CustomStopIdGroupValidator.validate),
19
21
  (0, express_validator_1.query)("limit").optional().isInt({ min: 1, max: 20 }).not().isArray(),
20
22
  (0, express_validator_1.query)("routeShortNames").optional().not().isEmpty({ ignore_whitespace: true }),
21
23
  (0, express_validator_1.query)("minutesAfter").optional().isInt({ min: 1, max: 360 }).not().isArray(),
22
- ], Validation_1.checkErrors, (0, redis_1.useCacheMiddleware)(expire), this.departureController.getAll);
24
+ ], Validation_1.checkErrors,
25
+ // max-age 3 seconds, stale-while-revalidate 2 seconds
26
+ this.cacheHeaderMiddleware.getMiddleware(3, 2), this.departureController.getAll);
23
27
  }
24
28
  }
25
29
  exports.PublicDeparturesRouter = PublicDeparturesRouter;
@@ -1 +1 @@
1
- {"version":3,"file":"PublicDeparturesRouter.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/routers/v1/PublicDeparturesRouter.ts"],"names":[],"mappings":";;;AAAA,0GAA4G;AAC5G,6EAA2E;AAC3E,+DAA2D;AAC3D,mFAAoE;AACpE,qFAAkF;AAClF,mEAA6E;AAE7E,MAAa,sBAAsB;IAI/B;QACI,IAAI,CAAC,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;QACvB,IAAI,CAAC,mBAAmB,GAAG,IAAI,iEAA+B,EAAE,CAAC;QACjE,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IACjC,CAAC;IAES,UAAU,CAAC,MAAoC;QACrD,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,GAAG,EACH;YACI,IAAA,yBAAK,EAAC,SAAS,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,uDAA0B,CAAC,QAAQ,CAAC;YACrE,IAAA,yBAAK,EAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;YACpE,IAAA,yBAAK,EAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;YAC9E,IAAA,yBAAK,EAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;SAC/E,EACD,wBAAW,EACX,IAAA,0BAAkB,EAAC,MAAM,CAAC,EAC1B,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAClC,CAAC;IACN,CAAC;CACJ;AAxBD,wDAwBC;AAED,MAAM,wBAAwB,GAAG,IAAI,sBAAsB,EAAE,CAAC,MAAM,CAAC;AAC5D,4DAAwB"}
1
+ {"version":3,"file":"PublicDeparturesRouter.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/routers/v1/PublicDeparturesRouter.ts"],"names":[],"mappings":";;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,GAAG,IAAI,sBAAsB,EAAE,CAAC,MAAM,CAAC;AAC5D,4DAAwB"}
@@ -0,0 +1,11 @@
1
+ /// <reference types="express" />
2
+ import { Router } from "@golemio/core/dist/shared/express";
3
+ export declare class PublicGtfsRouter {
4
+ router: Router;
5
+ private cacheHeaderMiddleware;
6
+ private gtfsController;
7
+ constructor();
8
+ protected initRoutes(): void;
9
+ }
10
+ declare const v1PublicGtfsRouter: Router;
11
+ export { v1PublicGtfsRouter };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.v1PublicGtfsRouter = exports.PublicGtfsRouter = void 0;
4
+ const PublicGtfsController_1 = require("../../controllers/v1/PublicGtfsController");
5
+ const Di_1 = require("../../ioc/Di");
6
+ const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
7
+ const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
8
+ const express_1 = require("@golemio/core/dist/shared/express");
9
+ const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
10
+ const CustomScopeValidator_1 = require("./helpers/CustomScopeValidator");
11
+ class PublicGtfsRouter {
12
+ constructor() {
13
+ this.router = (0, express_1.Router)();
14
+ this.cacheHeaderMiddleware = Di_1.OgPublicContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
15
+ this.gtfsController = new PublicGtfsController_1.PublicGtfsController();
16
+ this.initRoutes();
17
+ }
18
+ initRoutes() {
19
+ this.router.get("/trips/:gtfsTripId", [(0, express_validator_1.param)("gtfsTripId").exists(), (0, express_validator_1.query)("scopes").custom(CustomScopeValidator_1.CustomScopeValidator.validate)], Validation_1.checkErrors,
20
+ // max-age 4 hours, stale-while-revalidate 1 minute
21
+ this.cacheHeaderMiddleware.getMiddleware(4 * 60 * 60, 60), this.gtfsController.getOneTrip);
22
+ }
23
+ }
24
+ exports.PublicGtfsRouter = PublicGtfsRouter;
25
+ const v1PublicGtfsRouter = new PublicGtfsRouter().router;
26
+ exports.v1PublicGtfsRouter = v1PublicGtfsRouter;
27
+ //# sourceMappingURL=PublicGtfsRouter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PublicGtfsRouter.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/routers/v1/PublicGtfsRouter.ts"],"names":[],"mappings":";;;AAAA,oFAAsF;AACtF,qCAAsD;AAEtD,6EAA2E;AAC3E,+DAAuE;AACvE,+DAA2D;AAC3D,mFAA2E;AAC3E,yEAAsE;AAEtE,MAAa,gBAAgB;IAKzB;QACI,IAAI,CAAC,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;QACvB,IAAI,CAAC,qBAAqB,GAAG,sBAAiB,CAAC,OAAO,CAAwB,oBAAc,CAAC,qBAAqB,CAAC,CAAC;QACpH,IAAI,CAAC,cAAc,GAAG,IAAI,2CAAoB,EAAE,CAAC;QACjD,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IAES,UAAU;QAChB,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,oBAAoB,EACpB,CAAC,IAAA,yBAAK,EAAC,YAAY,CAAC,CAAC,MAAM,EAAE,EAAE,IAAA,yBAAK,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,2CAAoB,CAAC,QAAQ,CAAC,CAAC,EACrF,wBAAW;QACX,mDAAmD;QACnD,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EACzD,IAAI,CAAC,cAAc,CAAC,UAAU,CACjC,CAAC;IACN,CAAC;CACJ;AAtBD,4CAsBC;AAED,MAAM,kBAAkB,GAAG,IAAI,gBAAgB,EAAE,CAAC,MAAM,CAAC;AAChD,gDAAkB"}
@@ -2,10 +2,11 @@
2
2
  import { Router } from "@golemio/core/dist/shared/express";
3
3
  export declare class PublicVehiclePositionsRouter {
4
4
  router: Router;
5
+ private cacheHeaderMiddleware;
5
6
  private vehiclePositionsController;
6
7
  private redisSubscriber;
7
8
  constructor();
8
- protected initRoutes(expire?: string | number | undefined): void;
9
+ protected initRoutes(): void;
9
10
  }
10
11
  declare const v1PublicVPRouter: Router;
11
12
  export { v1PublicVPRouter };
@@ -5,6 +5,7 @@ const PublicVehiclePositionsController_1 = require("../../controllers/v1/PublicV
5
5
  const Di_1 = require("../../ioc/Di");
6
6
  const OgModuleToken_1 = require("../../ioc/OgModuleToken");
7
7
  const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
8
+ const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
8
9
  const express_1 = require("@golemio/core/dist/shared/express");
9
10
  const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
10
11
  const CustomScopeValidator_1 = require("./helpers/CustomScopeValidator");
@@ -12,12 +13,13 @@ const CustomTypeValidator_1 = require("./helpers/CustomTypeValidator");
12
13
  class PublicVehiclePositionsRouter {
13
14
  constructor() {
14
15
  this.router = (0, express_1.Router)();
16
+ this.cacheHeaderMiddleware = Di_1.OgPublicContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
15
17
  this.vehiclePositionsController = new PublicVehiclePositionsController_1.PublicVehiclePositionsController();
16
18
  this.initRoutes();
17
19
  this.redisSubscriber = Di_1.OgPublicContainer.resolve(OgModuleToken_1.OgModuleToken.VPSubscriber);
18
20
  this.redisSubscriber.initialize();
19
21
  }
20
- initRoutes(expire) {
22
+ initRoutes() {
21
23
  this.router.get("/", [
22
24
  (0, express_validator_1.query)("boundingBox")
23
25
  .optional()
@@ -26,9 +28,15 @@ class PublicVehiclePositionsRouter {
26
28
  .isArray(),
27
29
  (0, express_validator_1.query)("routeShortName").optional().not().isEmpty({ ignore_whitespace: true }),
28
30
  (0, express_validator_1.query)("routeType").optional().custom(CustomTypeValidator_1.CustomTypeValidator.validate),
29
- ], Validation_1.checkErrors, this.vehiclePositionsController.getAll);
30
- this.router.get("/:vehicleId;gtfsTripId=:gtfsTripId", [(0, express_validator_1.param)("vehicleId").exists(), (0, express_validator_1.param)("gtfsTripId").exists(), (0, express_validator_1.query)("scopes").custom(CustomScopeValidator_1.CustomScopeValidator.validate)], Validation_1.checkErrors, this.vehiclePositionsController.getOneByParamsCombination);
31
- this.router.get("/:vehicleId", [(0, express_validator_1.param)("vehicleId").exists(), (0, express_validator_1.query)("scopes").custom(CustomScopeValidator_1.CustomScopeValidator.validate)], Validation_1.checkErrors, this.vehiclePositionsController.getOneByVehicleId);
31
+ ], Validation_1.checkErrors,
32
+ // max-age 5 seconds, stale-while-revalidate 5 seconds
33
+ this.cacheHeaderMiddleware.getMiddleware(5, 5), this.vehiclePositionsController.getAll);
34
+ this.router.get("/:vehicleId;gtfsTripId=:gtfsTripId", [(0, express_validator_1.param)("vehicleId").exists(), (0, express_validator_1.param)("gtfsTripId").exists(), (0, express_validator_1.query)("scopes").custom(CustomScopeValidator_1.CustomScopeValidator.validate)], Validation_1.checkErrors,
35
+ // max-age 5 seconds, stale-while-revalidate 5 seconds
36
+ this.cacheHeaderMiddleware.getMiddleware(5, 5), this.vehiclePositionsController.getOneByParamsCombination);
37
+ this.router.get("/:vehicleId", [(0, express_validator_1.param)("vehicleId").exists(), (0, express_validator_1.query)("scopes").custom(CustomScopeValidator_1.CustomScopeValidator.validate)], Validation_1.checkErrors,
38
+ // max-age 5 seconds, stale-while-revalidate 5 seconds
39
+ this.cacheHeaderMiddleware.getMiddleware(5, 5), this.vehiclePositionsController.getOneByVehicleId);
32
40
  }
33
41
  }
34
42
  exports.PublicVehiclePositionsRouter = PublicVehiclePositionsRouter;
@@ -1 +1 @@
1
- {"version":3,"file":"PublicVehiclePositionsRouter.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/routers/v1/PublicVehiclePositionsRouter.ts"],"names":[],"mappings":";;;AAAA,4GAA8G;AAC9G,qCAAsD;AACtD,2DAA6D;AAE7D,6EAA2E;AAC3E,+DAA2D;AAC3D,mFAA2E;AAC3E,yEAAsE;AACtE,uEAAoE;AAEpE,MAAa,4BAA4B;IAKrC;QACI,IAAI,CAAC,MAA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IAAA,yBAAK,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,2CAAoB,CAAC,QAAQ,CAAC,CAAC,EACpF,wBAAW,EACX,IAAI,CAAC,0BAA0B,CAAC,iBAAiB,CACpD,CAAC;IACN,CAAC;CACJ;AA3CD,oEA2CC;AAED,MAAM,gBAAgB,GAAG,IAAI,4BAA4B,EAAE,CAAC,MAAM,CAAC;AAE1D,4CAAgB"}
1
+ {"version":3,"file":"PublicVehiclePositionsRouter.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/routers/v1/PublicVehiclePositionsRouter.ts"],"names":[],"mappings":";;;AAAA,4GAA8G;AAC9G,qCAAsD;AACtD,2DAA6D;AAG7D,6EAA2E;AAC3E,+DAAuE;AACvE,+DAA2D;AAC3D,mFAA2E;AAC3E,yEAAsE;AACtE,uEAAoE;AAEpE,MAAa,4BAA4B;IAMrC;QACI,IAAI,CAAC,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;QACvB,IAAI,CAAC,qBAAqB,GAAG,sBAAiB,CAAC,OAAO,CAAwB,oBAAc,CAAC,qBAAqB,CAAC,CAAC;QACpH,IAAI,CAAC,0BAA0B,GAAG,IAAI,mEAAgC,EAAE,CAAC;QACzE,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,eAAe,GAAG,sBAAiB,CAAC,OAAO,CAAe,6BAAa,CAAC,YAAY,CAAC,CAAC;QAC3F,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;IACtC,CAAC;IAES,UAAU;QAChB,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,GAAG,EACH;YACI,IAAA,yBAAK,EAAC,aAAa,CAAC;iBACf,QAAQ,EAAE;iBACV,OAAO,CAAC,4BAA4B,CAAC,CAAC,8BAA8B;iBACpE,GAAG,EAAE;iBACL,OAAO,EAAE;YACd,IAAA,yBAAK,EAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC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
1
  import { IPublicApiDetailedTrip } from "../../domain/PublicApiDetailedTripInterfaces";
3
2
  import { IVehiclePositionsRepository } from "../../domain/repository/IVehiclePositionsRepository";
4
3
  import { DetailedTripScope } from "../../routers/v1/helpers/DetailedTripScopeEnum";
4
+ import { TripScopeHandlerFactory } from "../helpers/trip-scope/TripScopeHandlerFactory";
5
5
  export declare class DetailedTripFacade {
6
6
  private scopeHandlerFactory;
7
7
  private vehiclePositionRepository;
8
- constructor(scopeHandlerFactory: ITripScopeHandlerFactory, vehiclePositionRepository: IVehiclePositionsRepository);
8
+ constructor(scopeHandlerFactory: TripScopeHandlerFactory, vehiclePositionRepository: IVehiclePositionsRepository);
9
9
  getOneByVehicleId(vehicleId: string, scopes: DetailedTripScope[], tripId?: string): Promise<IPublicApiDetailedTrip>;
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DetailedTripFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/service/facade/DetailedTripFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,0FAAwF;AACxF,6EAAwE;AAExE,MAAa,kBAAkB;IAC3B,YACY,mBAA6C,EAC7C,yBAAsD;QADtD,wBAAmB,GAAnB,mBAAmB,CAA0B;QAC7C,8BAAyB,GAAzB,yBAAyB,CAA6B;IAC/D,CAAC;IAES,iBAAiB,CAC1B,SAAiB,EACjB,MAA2B,EAC3B,MAAe;;YAEf,IAAI,eAAe,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC;YAEjG,IAAI,MAAM,IAAI,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,YAAY,MAAK,MAAM,EAAE;gBACpD,eAAe,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,0BAA0B,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;aACxG;YAED,IAAI,CAAC,eAAe,EAAE;gBAClB,MAAM,IAAI,6BAAY,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;aAC9E;YAED,IAAI,MAAM,GAA2B,EAAE,CAAC;YACxC,IAAI,MAAM,CAAC,QAAQ,CAAC,yCAAiB,CAAC,IAAI,CAAC,EAAE;gBACzC,MAAM,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,yCAAiB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;aAC/G;YAED,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAO,KAAK,EAAE,EAAE;gBACxC,IAAI,KAAK,KAAK,yCAAiB,CAAC,IAAI,EAAE;oBAClC,OAAO;iBACV;gBAED,MAAM,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,eAAgB,CAAC,CAAC;YAChG,CAAC,CAAA,CAAC,CAAC;YAEH,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC5B,OAAO,MAAM,CAAC;QAClB,CAAC;KAAA;CACJ;AArCD,gDAqCC"}
1
+ {"version":3,"file":"DetailedTripFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/service/facade/DetailedTripFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,0FAAwF;AACxF,6EAAwE;AAGxE,MAAa,kBAAkB;IAC3B,YACY,mBAA4C,EAC5C,yBAAsD;QADtD,wBAAmB,GAAnB,mBAAmB,CAAyB;QAC5C,8BAAyB,GAAzB,yBAAyB,CAA6B;IAC/D,CAAC;IAES,iBAAiB,CAC1B,SAAiB,EACjB,MAA2B,EAC3B,MAAe;;YAEf,IAAI,eAAe,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC;YAEjG,IAAI,MAAM,IAAI,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,YAAY,MAAK,MAAM,EAAE;gBACpD,eAAe,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,0BAA0B,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;aACxG;YAED,IAAI,CAAC,eAAe,EAAE;gBAClB,MAAM,IAAI,6BAAY,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;aAC9E;YAED,IAAI,MAAM,GAA2B,EAAE,CAAC;YACxC,IAAI,MAAM,CAAC,QAAQ,CAAC,yCAAiB,CAAC,IAAI,CAAC,EAAE;gBACzC,MAAM,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,yCAAiB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;aAC/G;YAED,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAO,KAAK,EAAE,EAAE;gBACxC,IAAI,KAAK,KAAK,yCAAiB,CAAC,IAAI,EAAE;oBAClC,OAAO;iBACV;gBAED,MAAM,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,eAAgB,CAAC,CAAC;YAChG,CAAC,CAAA,CAAC,CAAC;YAEH,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC5B,OAAO,MAAM,CAAC;QAClB,CAAC;KAAA;CACJ;AArCD,gDAqCC"}
@@ -0,0 +1,10 @@
1
+ import { IPublicApiGtfsTrip } from "../../domain/PublicApiGtfsTripLookupInterfaces";
2
+ import { DetailedTripScope } from "../../routers/v1/helpers/DetailedTripScopeEnum";
3
+ import { GtfsTripScopeHandlerFactory } from "../helpers/gtfs-trip-scope/GtfsTripScopeHandlerFactory";
4
+ export declare class GtfsTripLookupFacade {
5
+ private scopeHandlerFactory;
6
+ private readonly gtfsTripRepository;
7
+ constructor(scopeHandlerFactory: GtfsTripScopeHandlerFactory);
8
+ getOneByGtfsTripId(gtfsTripId: string, scopes: DetailedTripScope[]): Promise<IPublicApiGtfsTrip>;
9
+ private isGtfsTripValid;
10
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.GtfsTripLookupFacade = void 0;
13
+ const DetailedTripScopeEnum_1 = require("../../routers/v1/helpers/DetailedTripScopeEnum");
14
+ const models_1 = require("../../../ropid-gtfs/models");
15
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
16
+ class GtfsTripLookupFacade {
17
+ constructor(scopeHandlerFactory) {
18
+ this.scopeHandlerFactory = scopeHandlerFactory;
19
+ this.gtfsTripRepository = models_1.models.GTFSTripsModel;
20
+ }
21
+ getOneByGtfsTripId(gtfsTripId, scopes) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ const shouldIncludeStopTimes = scopes.includes(DetailedTripScopeEnum_1.DetailedTripScope.StopTimes);
24
+ const shouldIncludeShapes = scopes.includes(DetailedTripScopeEnum_1.DetailedTripScope.Shapes);
25
+ const gtfsTrip = yield this.gtfsTripRepository.getOneForPublicGtfsLookup(gtfsTripId, {
26
+ shouldIncludeStopTimes,
27
+ shouldIncludeShapes,
28
+ });
29
+ if (!this.isGtfsTripValid(gtfsTrip)) {
30
+ throw new golemio_errors_1.GeneralError("GTFS trip info not found", this.constructor.name, undefined, 404);
31
+ }
32
+ let output = {};
33
+ if (scopes.includes(DetailedTripScopeEnum_1.DetailedTripScope.Info)) {
34
+ output = this.scopeHandlerFactory.getStrategy(DetailedTripScopeEnum_1.DetailedTripScope.Info).handle(output, gtfsTrip);
35
+ }
36
+ for (const scope of scopes) {
37
+ if (scope === DetailedTripScopeEnum_1.DetailedTripScope.Info) {
38
+ continue;
39
+ }
40
+ output = this.scopeHandlerFactory.getStrategy(scope).handle(output, gtfsTrip);
41
+ }
42
+ return output;
43
+ });
44
+ }
45
+ isGtfsTripValid(gtfsTrip) {
46
+ return !!gtfsTrip && !!gtfsTrip.route;
47
+ }
48
+ }
49
+ exports.GtfsTripLookupFacade = GtfsTripLookupFacade;
50
+ //# sourceMappingURL=GtfsTripLookupFacade.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GtfsTripLookupFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/service/facade/GtfsTripLookupFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,0FAAwF;AACxF,uDAA+C;AAM/C,6EAAwE;AAGxE,MAAa,oBAAoB;IAG7B,YAAoB,mBAAgD;QAAhD,wBAAmB,GAAnB,mBAAmB,CAA6B;QAChE,IAAI,CAAC,kBAAkB,GAAG,eAAM,CAAC,cAAc,CAAC;IACpD,CAAC;IAEY,kBAAkB,CAAC,UAAkB,EAAE,MAA2B;;YAC3E,MAAM,sBAAsB,GAAG,MAAM,CAAC,QAAQ,CAAC,yCAAiB,CAAC,SAAS,CAAC,CAAC;YAC5E,MAAM,mBAAmB,GAAG,MAAM,CAAC,QAAQ,CAAC,yCAAiB,CAAC,MAAM,CAAC,CAAC;YAEtE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,UAAU,EAAE;gBACjF,sBAAsB;gBACtB,mBAAmB;aACtB,CAAC,CAAC;YAEH,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE;gBACjC,MAAM,IAAI,6BAAY,CAAC,0BAA0B,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;aAC7F;YAED,IAAI,MAAM,GAAuB,EAAE,CAAC;YACpC,IAAI,MAAM,CAAC,QAAQ,CAAC,yCAAiB,CAAC,IAAI,CAAC,EAAE;gBACzC,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,yCAAiB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;aAClG;YAED,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;gBACxB,IAAI,KAAK,KAAK,yCAAiB,CAAC,IAAI,EAAE;oBAClC,SAAS;iBACZ;gBAED,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;aACjF;YAED,OAAO,MAAM,CAAC;QAClB,CAAC;KAAA;IAEO,eAAe,CAAC,QAAiD;QACrE,OAAO,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;IAC1C,CAAC;CACJ;AAvCD,oDAuCC"}
@@ -0,0 +1,11 @@
1
+ import { ITripScopeHandler } from "../../../domain/ITripScopeHandler";
2
+ import { IPublicApiGtfsTrip } from "../../../domain/PublicApiGtfsTripLookupInterfaces";
3
+ import { DetailedTripScope } from "../../../routers/v1/helpers/DetailedTripScopeEnum";
4
+ import { ITripWithOptionalAssociationsDto } from "../../../../../schema-definitions/ropid-gtfs/interfaces/ITripWithOptionalAssociationsDto";
5
+ type GtfsTripScopeHandler = ITripScopeHandler<IPublicApiGtfsTrip, ITripWithOptionalAssociationsDto>;
6
+ export declare class GtfsTripScopeHandlerFactory {
7
+ private dictionary;
8
+ constructor(infoTripScopeHandler: GtfsTripScopeHandler, stopTimesTripScopeHandler: GtfsTripScopeHandler, shapeTripScopeHandler: GtfsTripScopeHandler, vehicleDescriptorTripScopeHandler: GtfsTripScopeHandler);
9
+ getStrategy(scope: DetailedTripScope): GtfsTripScopeHandler;
10
+ }
11
+ export {};
@@ -0,0 +1,43 @@
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.GtfsTripScopeHandlerFactory = void 0;
16
+ const OgModuleToken_1 = require("../../../ioc/OgModuleToken");
17
+ const DetailedTripScopeEnum_1 = require("../../../routers/v1/helpers/DetailedTripScopeEnum");
18
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
19
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
20
+ let GtfsTripScopeHandlerFactory = exports.GtfsTripScopeHandlerFactory = class GtfsTripScopeHandlerFactory {
21
+ constructor(infoTripScopeHandler, stopTimesTripScopeHandler, shapeTripScopeHandler, vehicleDescriptorTripScopeHandler) {
22
+ this.dictionary = new Map();
23
+ this.dictionary.set(DetailedTripScopeEnum_1.DetailedTripScope.Info, infoTripScopeHandler);
24
+ this.dictionary.set(DetailedTripScopeEnum_1.DetailedTripScope.StopTimes, stopTimesTripScopeHandler);
25
+ this.dictionary.set(DetailedTripScopeEnum_1.DetailedTripScope.Shapes, shapeTripScopeHandler);
26
+ this.dictionary.set(DetailedTripScopeEnum_1.DetailedTripScope.VehicleDescriptor, vehicleDescriptorTripScopeHandler);
27
+ }
28
+ getStrategy(scope) {
29
+ if (this.dictionary.has(scope)) {
30
+ return this.dictionary.get(scope);
31
+ }
32
+ throw new golemio_errors_1.GeneralError("Unknown GTFS trip scope strategy", this.constructor.name, undefined, 500);
33
+ }
34
+ };
35
+ exports.GtfsTripScopeHandlerFactory = GtfsTripScopeHandlerFactory = __decorate([
36
+ (0, tsyringe_1.injectable)(),
37
+ __param(0, (0, tsyringe_1.inject)(OgModuleToken_1.OgModuleToken.InfoGtfsTripScopeHandler)),
38
+ __param(1, (0, tsyringe_1.inject)(OgModuleToken_1.OgModuleToken.StopTimesGtfsTripScopeHandler)),
39
+ __param(2, (0, tsyringe_1.inject)(OgModuleToken_1.OgModuleToken.ShapesGtfsTripScopeHandler)),
40
+ __param(3, (0, tsyringe_1.inject)(OgModuleToken_1.OgModuleToken.VehicleDescriptorGtfsTripScopeHandler)),
41
+ __metadata("design:paramtypes", [Object, Object, Object, Object])
42
+ ], GtfsTripScopeHandlerFactory);
43
+ //# sourceMappingURL=GtfsTripScopeHandlerFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GtfsTripScopeHandlerFactory.js","sourceRoot":"","sources":["../../../../../../src/output-gateway/public/service/helpers/gtfs-trip-scope/GtfsTripScopeHandlerFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,8DAA6D;AAC7D,6FAAwF;AAExF,6EAAwE;AACxE,iEAAwE;AAKjE,IAAM,2BAA2B,yCAAjC,MAAM,2BAA2B;IAGpC,YACoD,oBAA0C,EAE1F,yBAA+C,EACG,qBAA2C,EAE7F,iCAAuD;QAEvD,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAA2C,CAAC;QACrE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,yCAAiB,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;QAClE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,yCAAiB,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;QAC5E,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,yCAAiB,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;QACrE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,yCAAiB,CAAC,iBAAiB,EAAE,iCAAiC,CAAC,CAAC;IAChG,CAAC;IAEM,WAAW,CAAC,KAAwB;QACvC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC5B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC;SACtC;QAED,MAAM,IAAI,6BAAY,CAAC,kCAAkC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;IACtG,CAAC;CACJ,CAAA;sCAzBY,2BAA2B;IADvC,IAAA,qBAAU,GAAE;IAKJ,WAAA,IAAA,iBAAM,EAAC,6BAAa,CAAC,wBAAwB,CAAC,CAAA;IAC9C,WAAA,IAAA,iBAAM,EAAC,6BAAa,CAAC,6BAA6B,CAAC,CAAA;IAEnD,WAAA,IAAA,iBAAM,EAAC,6BAAa,CAAC,0BAA0B,CAAC,CAAA;IAChD,WAAA,IAAA,iBAAM,EAAC,6BAAa,CAAC,qCAAqC,CAAC,CAAA;;GARvD,2BAA2B,CAyBvC"}
@@ -0,0 +1,6 @@
1
+ import { ITripScopeHandler } from "../../../../domain/ITripScopeHandler";
2
+ import { IPublicApiGtfsTrip } from "../../../../domain/PublicApiGtfsTripLookupInterfaces";
3
+ import { ITripWithDefinedRouteDto } from "../../../../../../schema-definitions/ropid-gtfs/interfaces/ITripWithOptionalAssociationsDto";
4
+ export declare abstract class AbstractGtfsTripScopeHandler implements ITripScopeHandler<IPublicApiGtfsTrip, ITripWithDefinedRouteDto> {
5
+ abstract handle(output: IPublicApiGtfsTrip, gtfsTrip: ITripWithDefinedRouteDto): IPublicApiGtfsTrip;
6
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AbstractGtfsTripScopeHandler = void 0;
4
+ class AbstractGtfsTripScopeHandler {
5
+ }
6
+ exports.AbstractGtfsTripScopeHandler = AbstractGtfsTripScopeHandler;
7
+ //# sourceMappingURL=AbstractGtfsTripScopeHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractGtfsTripScopeHandler.js","sourceRoot":"","sources":["../../../../../../../src/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/AbstractGtfsTripScopeHandler.ts"],"names":[],"mappings":";;;AAIA,MAAsB,4BAA4B;CAEjD;AAFD,oEAEC"}
@@ -0,0 +1,9 @@
1
+ import { IPublicApiGtfsTrip } from "../../../../domain/PublicApiGtfsTripLookupInterfaces";
2
+ import { PublicGtfsTripInfoTransformation } from "../../../transformations/gtfs-trip-scopes/PublicGtfsTripInfoTransformation";
3
+ import { ITripWithDefinedRouteDto } from "../../../../../../schema-definitions/ropid-gtfs/interfaces/ITripWithOptionalAssociationsDto";
4
+ import { AbstractGtfsTripScopeHandler } from "./AbstractGtfsTripScopeHandler";
5
+ export declare class InfoGtfsTripScopeHandler extends AbstractGtfsTripScopeHandler {
6
+ private tripInfoTransformation;
7
+ constructor(tripInfoTransformation: PublicGtfsTripInfoTransformation);
8
+ handle(output: IPublicApiGtfsTrip, gtfsTrip: ITripWithDefinedRouteDto): IPublicApiGtfsTrip;
9
+ }
@@ -0,0 +1,35 @@
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.InfoGtfsTripScopeHandler = void 0;
16
+ const OgModuleToken_1 = require("../../../../ioc/OgModuleToken");
17
+ const PublicGtfsTripInfoTransformation_1 = require("../../../transformations/gtfs-trip-scopes/PublicGtfsTripInfoTransformation");
18
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
19
+ const AbstractGtfsTripScopeHandler_1 = require("./AbstractGtfsTripScopeHandler");
20
+ let InfoGtfsTripScopeHandler = exports.InfoGtfsTripScopeHandler = class InfoGtfsTripScopeHandler extends AbstractGtfsTripScopeHandler_1.AbstractGtfsTripScopeHandler {
21
+ constructor(tripInfoTransformation) {
22
+ super();
23
+ this.tripInfoTransformation = tripInfoTransformation;
24
+ }
25
+ handle(output, gtfsTrip) {
26
+ output = this.tripInfoTransformation.transformElement(gtfsTrip);
27
+ return output;
28
+ }
29
+ };
30
+ exports.InfoGtfsTripScopeHandler = InfoGtfsTripScopeHandler = __decorate([
31
+ (0, tsyringe_1.injectable)(),
32
+ __param(0, (0, tsyringe_1.inject)(OgModuleToken_1.OgModuleToken.PublicGtfsTripInfoTransformation)),
33
+ __metadata("design:paramtypes", [PublicGtfsTripInfoTransformation_1.PublicGtfsTripInfoTransformation])
34
+ ], InfoGtfsTripScopeHandler);
35
+ //# sourceMappingURL=InfoTripScopeHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfoTripScopeHandler.js","sourceRoot":"","sources":["../../../../../../../src/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/InfoTripScopeHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,iEAA6D;AAC7D,iIAAwI;AAExI,iEAAwE;AACxE,iFAA8E;AAGvE,IAAM,wBAAwB,sCAA9B,MAAM,wBAAyB,SAAQ,2DAA4B;IACtE,YACoE,sBAAwD;QAExH,KAAK,EAAE,CAAC;QAFwD,2BAAsB,GAAtB,sBAAsB,CAAkC;IAG5H,CAAC;IAEM,MAAM,CAAC,MAA0B,EAAE,QAAkC;QACxE,MAAM,GAAG,IAAI,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAChE,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;mCAXY,wBAAwB;IADpC,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,6BAAa,CAAC,gCAAgC,CAAC,CAAA;qCAAiC,mEAAgC;GAFnH,wBAAwB,CAWpC"}
@@ -0,0 +1,9 @@
1
+ import { IPublicApiGtfsTrip } from "../../../../domain/PublicApiGtfsTripLookupInterfaces";
2
+ import { PublicGtfsTripShapesTransformation } from "../../../transformations/gtfs-trip-scopes/PublicGtfsTripShapesTransformation";
3
+ import { ITripWithDefinedRouteDto } from "../../../../../../schema-definitions/ropid-gtfs/interfaces/ITripWithOptionalAssociationsDto";
4
+ import { AbstractGtfsTripScopeHandler } from "./AbstractGtfsTripScopeHandler";
5
+ export declare class ShapesGtfsTripScopeHandler extends AbstractGtfsTripScopeHandler {
6
+ private tripShapesTransformation;
7
+ constructor(tripShapesTransformation: PublicGtfsTripShapesTransformation);
8
+ handle(output: IPublicApiGtfsTrip, gtfsTrip: ITripWithDefinedRouteDto): IPublicApiGtfsTrip;
9
+ }
@@ -0,0 +1,36 @@
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.ShapesGtfsTripScopeHandler = void 0;
16
+ const OgModuleToken_1 = require("../../../../ioc/OgModuleToken");
17
+ const PublicGtfsTripShapesTransformation_1 = require("../../../transformations/gtfs-trip-scopes/PublicGtfsTripShapesTransformation");
18
+ const Geo_1 = require("@golemio/core/dist/output-gateway/Geo");
19
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
20
+ const AbstractGtfsTripScopeHandler_1 = require("./AbstractGtfsTripScopeHandler");
21
+ let ShapesGtfsTripScopeHandler = exports.ShapesGtfsTripScopeHandler = class ShapesGtfsTripScopeHandler extends AbstractGtfsTripScopeHandler_1.AbstractGtfsTripScopeHandler {
22
+ constructor(tripShapesTransformation) {
23
+ super();
24
+ this.tripShapesTransformation = tripShapesTransformation;
25
+ }
26
+ handle(output, gtfsTrip) {
27
+ output.shapes = (0, Geo_1.buildGeojsonFeatureCollection)(gtfsTrip.shapes ? this.tripShapesTransformation.transformArray(gtfsTrip.shapes) : []);
28
+ return output;
29
+ }
30
+ };
31
+ exports.ShapesGtfsTripScopeHandler = ShapesGtfsTripScopeHandler = __decorate([
32
+ (0, tsyringe_1.injectable)(),
33
+ __param(0, (0, tsyringe_1.inject)(OgModuleToken_1.OgModuleToken.PublicGtfsTripShapesTransformation)),
34
+ __metadata("design:paramtypes", [PublicGtfsTripShapesTransformation_1.PublicGtfsTripShapesTransformation])
35
+ ], ShapesGtfsTripScopeHandler);
36
+ //# sourceMappingURL=ShapesTripScopeHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShapesTripScopeHandler.js","sourceRoot":"","sources":["../../../../../../../src/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/ShapesTripScopeHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,iEAA6D;AAC7D,qIAA4I;AAE5I,+DAAsF;AACtF,iEAAwE;AACxE,iFAA8E;AAGvE,IAAM,0BAA0B,wCAAhC,MAAM,0BAA2B,SAAQ,2DAA4B;IACxE,YAEY,wBAA4D;QAEpE,KAAK,EAAE,CAAC;QAFA,6BAAwB,GAAxB,wBAAwB,CAAoC;IAGxE,CAAC;IAEM,MAAM,CAAC,MAA0B,EAAE,QAAkC;QACxE,MAAM,CAAC,MAAM,GAAG,IAAA,mCAA6B,EACzC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CACvF,CAAC;QAEF,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;qCAfY,0BAA0B;IADtC,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,6BAAa,CAAC,kCAAkC,CAAC,CAAA;qCACvB,uEAAkC;GAH/D,0BAA0B,CAetC"}
@@ -0,0 +1,9 @@
1
+ import { IPublicApiGtfsTrip } from "../../../../domain/PublicApiGtfsTripLookupInterfaces";
2
+ import { PublicGtfsTripStopTimesTransformation } from "../../../transformations/gtfs-trip-scopes/PublicTripStopTimesTransformation";
3
+ import { ITripWithDefinedRouteDto } from "../../../../../../schema-definitions/ropid-gtfs/interfaces/ITripWithOptionalAssociationsDto";
4
+ import { AbstractGtfsTripScopeHandler } from "./AbstractGtfsTripScopeHandler";
5
+ export declare class StopTimesGtfsTripScopeHandler extends AbstractGtfsTripScopeHandler {
6
+ private tripStopTimesTransformation;
7
+ constructor(tripStopTimesTransformation: PublicGtfsTripStopTimesTransformation);
8
+ handle(output: IPublicApiGtfsTrip, gtfsTrip: ITripWithDefinedRouteDto): IPublicApiGtfsTrip;
9
+ }