@golemio/pid 2.18.0 → 2.18.1-dev.1427397189
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.
- package/db/example/00_clear_test_data.sql +2 -0
- package/db/example/03_ropidgtfs_dump.sql +36 -0
- package/db/example/20_jis_infotexts.sql +214 -0
- package/db/migrations/postgresql/20240801141948-jis-infotexts.js +53 -0
- package/db/migrations/postgresql/20240809084521-jis-infotexts-severity-level.js +53 -0
- package/db/migrations/postgresql/sqls/20240801141948-jis-infotexts-down.sql +2 -0
- package/db/migrations/postgresql/sqls/20240801141948-jis-infotexts-up.sql +19 -0
- package/db/migrations/postgresql/sqls/20240809084521-jis-infotexts-severity-level-down.sql +8 -0
- package/db/migrations/postgresql/sqls/20240809084521-jis-infotexts-severity-level-up.sql +7 -0
- package/dist/integration-engine/index.js +4 -0
- package/dist/integration-engine/index.js.map +1 -1
- package/dist/integration-engine/jis/datasources/JISInfotextsDataSourceFactory.d.ts +10 -0
- package/dist/integration-engine/jis/datasources/JISInfotextsDataSourceFactory.js +49 -0
- package/dist/integration-engine/jis/datasources/JISInfotextsDataSourceFactory.js.map +1 -0
- package/dist/integration-engine/jis/index.d.ts +1 -0
- package/dist/{output-gateway/pid/controllers → integration-engine/jis}/index.js +1 -2
- package/dist/integration-engine/jis/index.js.map +1 -0
- package/dist/integration-engine/jis/ioc/Di.d.ts +3 -0
- package/dist/integration-engine/jis/ioc/Di.js +31 -0
- package/dist/integration-engine/jis/ioc/Di.js.map +1 -0
- package/dist/integration-engine/jis/ioc/JISContainerToken.d.ts +9 -0
- package/dist/integration-engine/jis/ioc/JISContainerToken.js +18 -0
- package/dist/integration-engine/jis/ioc/JISContainerToken.js.map +1 -0
- package/dist/integration-engine/jis/repositories/JISInfotextsRepository.d.ts +36 -0
- package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js +101 -0
- package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js.map +1 -0
- package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.d.ts +36 -0
- package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.js +101 -0
- package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.js.map +1 -0
- package/dist/integration-engine/jis/services/JISInfotextsDataService.d.ts +20 -0
- package/dist/integration-engine/jis/services/JISInfotextsDataService.js +78 -0
- package/dist/integration-engine/jis/services/JISInfotextsDataService.js.map +1 -0
- package/dist/integration-engine/jis/transformations/JISInfotextsTransformation.d.ts +13 -0
- package/dist/integration-engine/jis/transformations/JISInfotextsTransformation.js +41 -0
- package/dist/integration-engine/jis/transformations/JISInfotextsTransformation.js.map +1 -0
- package/dist/integration-engine/jis/workers/JISWorker.d.ts +7 -0
- package/dist/integration-engine/jis/workers/JISWorker.js +21 -0
- package/dist/integration-engine/jis/workers/JISWorker.js.map +1 -0
- package/dist/integration-engine/jis/workers/constants.d.ts +1 -0
- package/dist/integration-engine/jis/workers/constants.js +5 -0
- package/dist/integration-engine/jis/workers/constants.js.map +1 -0
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.d.ts +14 -0
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js +72 -0
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/data-access/helpers/RawQueryProvider.d.ts +3 -0
- package/dist/integration-engine/ropid-gtfs/data-access/helpers/RawQueryProvider.js +62 -0
- package/dist/integration-engine/ropid-gtfs/data-access/helpers/RawQueryProvider.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripScheduleRepository.d.ts +2 -0
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripScheduleRepository.js +21 -0
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripScheduleRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/interfaces/TripScheduleInterfaces.d.ts +22 -0
- package/dist/integration-engine/ropid-gtfs/interfaces/TripScheduleInterfaces.js +3 -0
- package/dist/integration-engine/ropid-gtfs/interfaces/TripScheduleInterfaces.js.map +1 -0
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusMessageFilter.d.ts +1 -4
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusMessageFilter.js +11 -27
- package/dist/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusMessageFilter.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.d.ts +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js +22 -49
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/RawQueryProvider.d.ts +0 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/RawQueryProvider.js +1 -80
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/RawQueryProvider.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/interfaces/TripRepositoryInterfaces.d.ts +0 -17
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.d.ts +3 -6
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js +8 -19
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js.map +1 -1
- package/dist/output-gateway/departure-boards/index.d.ts +1 -1
- package/dist/output-gateway/departure-boards/index.js +1 -1
- package/dist/output-gateway/departure-boards/index.js.map +1 -1
- package/dist/output-gateway/departure-boards/routers/index.d.ts +1 -0
- package/dist/output-gateway/departure-boards/routers/index.js +6 -0
- package/dist/output-gateway/departure-boards/routers/index.js.map +1 -0
- package/dist/output-gateway/departure-boards/{DepartureBoardsRouter.d.ts → routers/v2/V2DepartureBoardsRouter.d.ts} +9 -8
- package/dist/output-gateway/departure-boards/{DepartureBoardsRouter.js → routers/v2/V2DepartureBoardsRouter.js} +19 -18
- package/dist/output-gateway/departure-boards/routers/v2/V2DepartureBoardsRouter.js.map +1 -0
- package/dist/output-gateway/index.d.ts +1 -0
- package/dist/output-gateway/index.js +25 -1
- package/dist/output-gateway/index.js.map +1 -1
- package/dist/output-gateway/pid/controllers/{DepartureBoardsController.d.ts → v2/V2DepartureBoardsController.d.ts} +1 -1
- package/dist/output-gateway/pid/controllers/{DepartureBoardsController.js → v2/V2DepartureBoardsController.js} +9 -9
- package/dist/output-gateway/pid/controllers/v2/V2DepartureBoardsController.js.map +1 -0
- package/dist/output-gateway/pid/controllers/{InfotextsController.d.ts → v2/V2InfotextsController.d.ts} +1 -1
- package/dist/output-gateway/pid/controllers/{InfotextsController.js → v2/V2InfotextsController.js} +6 -6
- package/dist/output-gateway/pid/controllers/v2/V2InfotextsController.js.map +1 -0
- package/dist/output-gateway/pid/controllers/v3/V3InfotextsController.d.ts +10 -0
- package/dist/output-gateway/pid/controllers/v3/V3InfotextsController.js +57 -0
- package/dist/output-gateway/pid/controllers/v3/V3InfotextsController.js.map +1 -0
- package/dist/output-gateway/pid/data-access/JISInfotextRepository.d.ts +27 -0
- package/dist/output-gateway/pid/data-access/JISInfotextRepository.js +157 -0
- package/dist/output-gateway/pid/data-access/JISInfotextRepository.js.map +1 -0
- package/dist/output-gateway/pid/data-access/JISInfotextRopidGTFSStopsRepository.d.ts +11 -0
- package/dist/output-gateway/pid/data-access/JISInfotextRopidGTFSStopsRepository.js +37 -0
- package/dist/output-gateway/pid/data-access/JISInfotextRopidGTFSStopsRepository.js.map +1 -0
- package/dist/output-gateway/pid/domain/InfotextDisplayTypeEnum.d.ts +4 -0
- package/dist/output-gateway/pid/domain/InfotextDisplayTypeEnum.js +9 -0
- package/dist/output-gateway/pid/domain/InfotextDisplayTypeEnum.js.map +1 -0
- package/dist/output-gateway/pid/domain/InfotextInterfaces.d.ts +28 -0
- package/dist/output-gateway/pid/domain/InfotextInterfaces.js +3 -0
- package/dist/output-gateway/pid/domain/InfotextInterfaces.js.map +1 -0
- package/dist/output-gateway/pid/dto/DepartureBoardsDTO.d.ts +3 -3
- package/dist/output-gateway/pid/dto/DepartureBoardsDTO.js +1 -1
- package/dist/output-gateway/pid/dto/DepartureBoardsDTO.js.map +1 -1
- package/dist/output-gateway/pid/index.d.ts +1 -1
- package/dist/output-gateway/pid/index.js +1 -1
- package/dist/output-gateway/pid/index.js.map +1 -1
- package/dist/output-gateway/pid/ioc/Di.d.ts +3 -0
- package/dist/output-gateway/pid/ioc/Di.js +23 -0
- package/dist/output-gateway/pid/ioc/Di.js.map +1 -0
- package/dist/output-gateway/pid/ioc/OgPidToken.d.ts +7 -0
- package/dist/output-gateway/pid/ioc/OgPidToken.js +17 -0
- package/dist/output-gateway/pid/ioc/OgPidToken.js.map +1 -0
- package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.d.ts +2 -1
- package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js +20 -10
- package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js.map +1 -1
- package/dist/output-gateway/pid/models/RopidVYMIEventsStopsModel.d.ts +2 -19
- package/dist/output-gateway/pid/models/RopidVYMIEventsStopsModel.js +4 -64
- package/dist/output-gateway/pid/models/RopidVYMIEventsStopsModel.js.map +1 -1
- package/dist/output-gateway/pid/routers/index.d.ts +2 -0
- package/dist/output-gateway/pid/routers/index.js +8 -0
- package/dist/output-gateway/pid/routers/index.js.map +1 -0
- package/dist/output-gateway/pid/{PIDRouter.d.ts → routers/v2/V2PIDRouter.d.ts} +5 -4
- package/dist/output-gateway/pid/{PIDRouter.js → routers/v2/V2PIDRouter.js} +20 -17
- package/dist/output-gateway/pid/routers/v2/V2PIDRouter.js.map +1 -0
- package/dist/output-gateway/pid/routers/v3/V3PIDRouter.d.ts +11 -0
- package/dist/output-gateway/pid/routers/v3/V3PIDRouter.js +31 -0
- package/dist/output-gateway/pid/routers/v3/V3PIDRouter.js.map +1 -0
- package/dist/output-gateway/pid/service/helpers/DisplayTypeMapper.d.ts +10 -0
- package/dist/output-gateway/pid/service/helpers/DisplayTypeMapper.js +25 -0
- package/dist/output-gateway/pid/service/helpers/DisplayTypeMapper.js.map +1 -0
- package/dist/output-gateway/pid/service/transformations/JISInfotextDepartureTransformation.d.ts +13 -0
- package/dist/output-gateway/pid/service/transformations/JISInfotextDepartureTransformation.js +35 -0
- package/dist/output-gateway/pid/service/transformations/JISInfotextDepartureTransformation.js.map +1 -0
- package/dist/output-gateway/pid/service/transformations/JISInfotextOverviewTransformation.d.ts +19 -0
- package/dist/output-gateway/pid/service/transformations/JISInfotextOverviewTransformation.js +43 -0
- package/dist/output-gateway/pid/service/transformations/JISInfotextOverviewTransformation.js.map +1 -0
- package/dist/output-gateway/public/controllers/{v1/PublicDepartureBoardsController.d.ts → v2/V2PublicDepartureBoardsController.d.ts} +1 -1
- package/dist/output-gateway/public/controllers/{v1/PublicDepartureBoardsController.js → v2/V2PublicDepartureBoardsController.js} +5 -5
- package/dist/output-gateway/public/controllers/v2/V2PublicDepartureBoardsController.js.map +1 -0
- package/dist/output-gateway/public/controllers/{v1/PublicGtfsController.d.ts → v2/V2PublicGtfsController.d.ts} +1 -1
- package/dist/output-gateway/public/controllers/{v1/PublicGtfsController.js → v2/V2PublicGtfsController.js} +5 -5
- package/dist/output-gateway/public/controllers/v2/V2PublicGtfsController.js.map +1 -0
- package/dist/output-gateway/public/controllers/{v1/PublicVehiclePositionsController.d.ts → v2/V2PublicVehiclePositionsController.d.ts} +1 -1
- package/dist/output-gateway/public/controllers/{v1/PublicVehiclePositionsController.js → v2/V2PublicVehiclePositionsController.js} +4 -4
- package/dist/output-gateway/public/controllers/v2/V2PublicVehiclePositionsController.js.map +1 -0
- package/dist/output-gateway/public/controllers/{v1 → v2}/interfaces/PublicParamsInterfaces.d.ts +1 -1
- package/dist/output-gateway/public/controllers/{v1 → v2}/interfaces/PublicParamsInterfaces.js.map +1 -1
- package/dist/output-gateway/public/index.d.ts +1 -0
- package/dist/output-gateway/public/index.js +18 -0
- package/dist/output-gateway/public/index.js.map +1 -0
- package/dist/output-gateway/public/routers/index.d.ts +3 -0
- package/dist/output-gateway/public/routers/index.js +10 -0
- package/dist/output-gateway/public/routers/index.js.map +1 -0
- package/dist/output-gateway/public/routers/{v1/PublicDeparturesRouter.d.ts → v2/V2PublicDeparturesRouter.d.ts} +4 -3
- package/dist/output-gateway/public/routers/{v1/PublicDeparturesRouter.js → v2/V2PublicDeparturesRouter.js} +11 -8
- package/dist/output-gateway/public/routers/v2/V2PublicDeparturesRouter.js.map +1 -0
- package/dist/output-gateway/public/routers/{v1/PublicGtfsRouter.d.ts → v2/V2PublicGtfsRouter.d.ts} +4 -3
- package/dist/output-gateway/public/routers/{v1/PublicGtfsRouter.js → v2/V2PublicGtfsRouter.js} +11 -8
- package/dist/output-gateway/public/routers/v2/V2PublicGtfsRouter.js.map +1 -0
- package/dist/output-gateway/public/routers/{v1/PublicVehiclePositionsRouter.d.ts → v2/V2PublicVehiclePositionsRouter.d.ts} +4 -3
- package/dist/output-gateway/public/routers/{v1/PublicVehiclePositionsRouter.js → v2/V2PublicVehiclePositionsRouter.js} +11 -8
- package/dist/output-gateway/public/routers/v2/V2PublicVehiclePositionsRouter.js.map +1 -0
- package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomScopeValidator.js.map +1 -1
- package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomStopIdGroupValidator.js.map +1 -1
- package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomTypeValidator.js.map +1 -1
- package/dist/output-gateway/public/routers/{v1 → v2}/helpers/DetailedTripScopeEnum.js.map +1 -1
- package/dist/output-gateway/public/service/facade/DepartureBoardFacade.d.ts +1 -1
- package/dist/output-gateway/public/service/facade/DetailedTripFacade.d.ts +1 -1
- package/dist/output-gateway/public/service/facade/DetailedTripFacade.js +1 -1
- package/dist/output-gateway/public/service/facade/GtfsTripLookupFacade.d.ts +1 -1
- package/dist/output-gateway/public/service/facade/GtfsTripLookupFacade.js +1 -1
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/GtfsTripScopeHandlerFactory.d.ts +1 -1
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/GtfsTripScopeHandlerFactory.js +1 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/TripScopeHandlerFactory.d.ts +1 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/TripScopeHandlerFactory.js +1 -1
- package/dist/output-gateway/ropid-gtfs/index.d.ts +1 -1
- package/dist/output-gateway/ropid-gtfs/index.js +1 -1
- package/dist/output-gateway/ropid-gtfs/index.js.map +1 -1
- package/dist/output-gateway/ropid-gtfs/routers/index.d.ts +1 -0
- package/dist/output-gateway/ropid-gtfs/routers/index.js +6 -0
- package/dist/output-gateway/ropid-gtfs/routers/index.js.map +1 -0
- package/dist/output-gateway/ropid-gtfs/{GTFSRouter.d.ts → routers/v2/V2GTFSRouter.d.ts} +11 -13
- package/dist/output-gateway/ropid-gtfs/{GTFSRouter.js → routers/v2/V2GTFSRouter.js} +16 -16
- package/dist/output-gateway/ropid-gtfs/routers/v2/V2GTFSRouter.js.map +1 -0
- package/dist/output-gateway/shared/RopidRouterUtils.d.ts +4 -0
- package/dist/output-gateway/shared/RopidRouterUtils.js +11 -0
- package/dist/output-gateway/shared/RopidRouterUtils.js.map +1 -1
- package/dist/output-gateway/shared/constants/index.d.ts +1 -0
- package/dist/output-gateway/shared/constants/index.js +1 -0
- package/dist/output-gateway/shared/constants/index.js.map +1 -1
- package/dist/output-gateway/shared/constants/route-version.d.ts +5 -0
- package/dist/output-gateway/shared/constants/route-version.js +10 -0
- package/dist/output-gateway/shared/constants/route-version.js.map +1 -0
- package/dist/output-gateway/vehicle-positions/index.d.ts +1 -1
- package/dist/output-gateway/vehicle-positions/index.js +1 -1
- package/dist/output-gateway/vehicle-positions/index.js.map +1 -1
- package/dist/output-gateway/vehicle-positions/routers/index.d.ts +1 -0
- package/dist/output-gateway/vehicle-positions/routers/index.js +6 -0
- package/dist/output-gateway/vehicle-positions/routers/index.js.map +1 -0
- package/dist/output-gateway/vehicle-positions/{VehiclePositionsRouter.d.ts → routers/v2/V2VehiclePositionsRouter.d.ts} +6 -6
- package/dist/output-gateway/vehicle-positions/{VehiclePositionsRouter.js → routers/v2/V2VehiclePositionsRouter.js} +12 -11
- package/dist/output-gateway/vehicle-positions/routers/v2/V2VehiclePositionsRouter.js.map +1 -0
- package/dist/schema-definitions/jis/datasources/JISInfotextsJsonSchema.d.ts +3 -0
- package/dist/schema-definitions/jis/datasources/JISInfotextsJsonSchema.js +59 -0
- package/dist/schema-definitions/jis/datasources/JISInfotextsJsonSchema.js.map +1 -0
- package/dist/schema-definitions/jis/datasources/interfaces/IJISInfotext.d.ts +16 -0
- package/dist/schema-definitions/jis/datasources/interfaces/IJISInfotext.js +3 -0
- package/dist/schema-definitions/jis/datasources/interfaces/IJISInfotext.js.map +1 -0
- package/dist/schema-definitions/jis/datasources/interfaces/IJISInfotextStop.d.ts +3 -0
- package/dist/schema-definitions/jis/datasources/interfaces/IJISInfotextStop.js +3 -0
- package/dist/schema-definitions/jis/datasources/interfaces/IJISInfotextStop.js.map +1 -0
- package/dist/schema-definitions/jis/datasources/interfaces/IJISTranslationText.d.ts +4 -0
- package/dist/schema-definitions/jis/datasources/interfaces/IJISTranslationText.js +3 -0
- package/dist/schema-definitions/jis/datasources/interfaces/IJISTranslationText.js.map +1 -0
- package/dist/schema-definitions/jis/datasources/interfaces/index.d.ts +3 -0
- package/dist/schema-definitions/jis/datasources/interfaces/index.js +20 -0
- package/dist/schema-definitions/jis/datasources/interfaces/index.js.map +1 -0
- package/dist/schema-definitions/jis/models/JISInfotextsModel.d.ts +19 -0
- package/dist/schema-definitions/jis/models/JISInfotextsModel.js +80 -0
- package/dist/schema-definitions/jis/models/JISInfotextsModel.js.map +1 -0
- package/dist/schema-definitions/jis/models/JISInfotextsRopidGTFSStopsModel.d.ts +12 -0
- package/dist/schema-definitions/jis/models/JISInfotextsRopidGTFSStopsModel.js +41 -0
- package/dist/schema-definitions/jis/models/JISInfotextsRopidGTFSStopsModel.js.map +1 -0
- package/dist/schema-definitions/jis/models/interfaces/IJISInfotext.d.ts +10 -0
- package/dist/schema-definitions/jis/models/interfaces/IJISInfotext.js +3 -0
- package/dist/schema-definitions/jis/models/interfaces/IJISInfotext.js.map +1 -0
- package/dist/schema-definitions/jis/models/interfaces/IJISInfotextsRopidGTFSStops.d.ts +4 -0
- package/dist/schema-definitions/jis/models/interfaces/IJISInfotextsRopidGTFSStops.js +3 -0
- package/dist/schema-definitions/jis/models/interfaces/IJISInfotextsRopidGTFSStops.js.map +1 -0
- package/dist/schema-definitions/jis/models/interfaces/IJISTranslationText.d.ts +4 -0
- package/dist/schema-definitions/jis/models/interfaces/IJISTranslationText.js +3 -0
- package/dist/schema-definitions/jis/models/interfaces/IJISTranslationText.js.map +1 -0
- package/dist/schema-definitions/jis/models/interfaces/index.d.ts +3 -0
- package/dist/schema-definitions/jis/models/interfaces/index.js +20 -0
- package/dist/schema-definitions/jis/models/interfaces/index.js.map +1 -0
- package/docs/assets/pid_jis_erd.png +0 -0
- package/docs/asyncapi.yaml +1371 -1332
- package/docs/implementation_documentation.md +86 -35
- package/docs/openapi-output.yaml +128 -69
- package/package.json +3 -3
- package/dist/output-gateway/departure-boards/DepartureBoardsRouter.js.map +0 -1
- package/dist/output-gateway/pid/PIDRouter.js.map +0 -1
- package/dist/output-gateway/pid/controllers/DepartureBoardsController.js.map +0 -1
- package/dist/output-gateway/pid/controllers/InfotextsController.js.map +0 -1
- package/dist/output-gateway/pid/controllers/index.d.ts +0 -2
- package/dist/output-gateway/pid/controllers/index.js.map +0 -1
- package/dist/output-gateway/public/controllers/v1/PublicDepartureBoardsController.js.map +0 -1
- package/dist/output-gateway/public/controllers/v1/PublicGtfsController.js.map +0 -1
- package/dist/output-gateway/public/controllers/v1/PublicVehiclePositionsController.js.map +0 -1
- package/dist/output-gateway/public/routers/v1/PublicDeparturesRouter.js.map +0 -1
- package/dist/output-gateway/public/routers/v1/PublicGtfsRouter.js.map +0 -1
- package/dist/output-gateway/public/routers/v1/PublicVehiclePositionsRouter.js.map +0 -1
- package/dist/output-gateway/ropid-gtfs/GTFSRouter.js.map +0 -1
- package/dist/output-gateway/vehicle-positions/VehiclePositionsRouter.js.map +0 -1
- /package/dist/output-gateway/public/controllers/{v1 → v2}/interfaces/PublicParamsInterfaces.js +0 -0
- /package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomScopeValidator.d.ts +0 -0
- /package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomScopeValidator.js +0 -0
- /package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomStopIdGroupValidator.d.ts +0 -0
- /package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomStopIdGroupValidator.js +0 -0
- /package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomTypeValidator.d.ts +0 -0
- /package/dist/output-gateway/public/routers/{v1 → v2}/helpers/CustomTypeValidator.js +0 -0
- /package/dist/output-gateway/public/routers/{v1 → v2}/helpers/DetailedTripScopeEnum.d.ts +0 -0
- /package/dist/output-gateway/public/routers/{v1 → v2}/helpers/DetailedTripScopeEnum.js +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { JISInfotextsModel } from "../../../schema-definitions/jis/models/JISInfotextsModel";
|
|
2
|
+
import { IJISInfotext } from "../../../schema-definitions/jis/models/interfaces";
|
|
3
|
+
import { ILogger } from "@golemio/core/dist/helpers";
|
|
4
|
+
import { IDatabaseConnector } from "@golemio/core/dist/helpers/data-access/postgres/IDatabaseConnector";
|
|
5
|
+
import { AbstractValidatableRepository } from "@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractValidatableRepository";
|
|
6
|
+
import { JSONSchemaValidator } from "@golemio/core/dist/shared/golemio-validator";
|
|
7
|
+
import { ModelStatic, Transaction } from "@golemio/core/dist/shared/sequelize";
|
|
8
|
+
type RepositoryOptions = {
|
|
9
|
+
transaction?: Transaction;
|
|
10
|
+
};
|
|
11
|
+
export declare class JISInfotextsRepository extends AbstractValidatableRepository {
|
|
12
|
+
private logger;
|
|
13
|
+
validator: JSONSchemaValidator;
|
|
14
|
+
schema: string;
|
|
15
|
+
tableName: string;
|
|
16
|
+
private sequelizeModel;
|
|
17
|
+
constructor(connector: IDatabaseConnector, logger: ILogger);
|
|
18
|
+
/**
|
|
19
|
+
* Delete all items last updated before a given date and time (where their `updated_at` is less than the given limit)
|
|
20
|
+
*
|
|
21
|
+
* @param dateTime The `updated_at` limit, where all items last updated before this limit shall be deleted
|
|
22
|
+
* @param options Options for the operation
|
|
23
|
+
* @returns The number of deleted items
|
|
24
|
+
*/
|
|
25
|
+
deleteAllLastUpdatedBefore(dateTime: Date, options?: RepositoryOptions): Promise<number>;
|
|
26
|
+
/**
|
|
27
|
+
* Insert or update all given data. In case of an update, all attributes except for `created_at` shall be overwritten.
|
|
28
|
+
*
|
|
29
|
+
* @param data The data to be upserted
|
|
30
|
+
* @param options Options for the operation
|
|
31
|
+
* @returns The upserted items
|
|
32
|
+
*/
|
|
33
|
+
upsertAll(data: IJISInfotext[], options?: RepositoryOptions): ReturnType<ModelStatic<JISInfotextsModel>["bulkCreate"]>;
|
|
34
|
+
private getUpdateAttributes;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.JISInfotextsRepository = void 0;
|
|
25
|
+
const const_1 = require("../../../schema-definitions/const");
|
|
26
|
+
const JISInfotextsModel_1 = require("../../../schema-definitions/jis/models/JISInfotextsModel");
|
|
27
|
+
const AbstractValidatableRepository_1 = require("@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractValidatableRepository");
|
|
28
|
+
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
29
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
30
|
+
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
31
|
+
const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
|
|
32
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
33
|
+
let JISInfotextsRepository = exports.JISInfotextsRepository = class JISInfotextsRepository extends AbstractValidatableRepository_1.AbstractValidatableRepository {
|
|
34
|
+
constructor(connector, logger) {
|
|
35
|
+
super(connector, logger);
|
|
36
|
+
this.logger = logger;
|
|
37
|
+
this.schema = const_1.PG_SCHEMA;
|
|
38
|
+
this.tableName = JISInfotextsModel_1.JISInfotextsModel.tableName;
|
|
39
|
+
this.validator = new golemio_validator_1.JSONSchemaValidator("JISInfotextsRepository", JISInfotextsModel_1.JISInfotextsModel.jsonSchema);
|
|
40
|
+
this.sequelizeModel = connector
|
|
41
|
+
.getConnection()
|
|
42
|
+
.define(this.tableName, JISInfotextsModel_1.JISInfotextsModel.attributeModel, { schema: this.schema });
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Delete all items last updated before a given date and time (where their `updated_at` is less than the given limit)
|
|
46
|
+
*
|
|
47
|
+
* @param dateTime The `updated_at` limit, where all items last updated before this limit shall be deleted
|
|
48
|
+
* @param options Options for the operation
|
|
49
|
+
* @returns The number of deleted items
|
|
50
|
+
*/
|
|
51
|
+
deleteAllLastUpdatedBefore(dateTime, options) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
try {
|
|
54
|
+
return yield this.sequelizeModel.destroy({
|
|
55
|
+
where: {
|
|
56
|
+
updated_at: { [sequelize_1.Op.lt]: dateTime },
|
|
57
|
+
},
|
|
58
|
+
transaction: options === null || options === void 0 ? void 0 : options.transaction,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
throw new golemio_errors_1.GeneralError("Error in deleteAllLastUpdatedBefore", this.constructor.name, err);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Insert or update all given data. In case of an update, all attributes except for `created_at` shall be overwritten.
|
|
68
|
+
*
|
|
69
|
+
* @param data The data to be upserted
|
|
70
|
+
* @param options Options for the operation
|
|
71
|
+
* @returns The upserted items
|
|
72
|
+
*/
|
|
73
|
+
upsertAll(data, options) {
|
|
74
|
+
var _a;
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
try {
|
|
77
|
+
return yield this.sequelizeModel.bulkCreate(data, {
|
|
78
|
+
updateOnDuplicate: this.getUpdateAttributes(),
|
|
79
|
+
transaction: options === null || options === void 0 ? void 0 : options.transaction,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
if (err instanceof sequelize_1.ValidationError && ((_a = err.errors) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
84
|
+
const mappedErrors = err.errors.map((e) => `${e.message} (${e.value})`).join(", ");
|
|
85
|
+
throw new golemio_errors_1.ValidationError(`Validation error in upsertAll: ${mappedErrors}`, this.constructor.name, err, undefined, "pid");
|
|
86
|
+
}
|
|
87
|
+
throw new golemio_errors_1.GeneralError("Error in upsertAll", this.constructor.name, err);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
getUpdateAttributes() {
|
|
92
|
+
return Object.keys(JISInfotextsModel_1.JISInfotextsModel.attributeModel).filter((attribute) => !["created_at"].includes(attribute));
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
exports.JISInfotextsRepository = JISInfotextsRepository = __decorate([
|
|
96
|
+
(0, tsyringe_1.injectable)(),
|
|
97
|
+
__param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.PostgresConnector)),
|
|
98
|
+
__param(1, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
|
|
99
|
+
__metadata("design:paramtypes", [Object, Object])
|
|
100
|
+
], JISInfotextsRepository);
|
|
101
|
+
//# sourceMappingURL=JISInfotextsRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JISInfotextsRepository.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/repositories/JISInfotextsRepository.ts"],"names":[],"mappings":";;;;;;;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/models/JISInfotextsRopidGTFSStopsModel";
|
|
2
|
+
import { IJISInfotextsRopidGTFSStops } from "../../../schema-definitions/jis/models/interfaces";
|
|
3
|
+
import { ILogger } from "@golemio/core/dist/helpers";
|
|
4
|
+
import { IDatabaseConnector } from "@golemio/core/dist/helpers/data-access/postgres/IDatabaseConnector";
|
|
5
|
+
import { AbstractValidatableRepository } from "@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractValidatableRepository";
|
|
6
|
+
import { JSONSchemaValidator } from "@golemio/core/dist/shared/golemio-validator";
|
|
7
|
+
import { ModelStatic, Transaction } from "@golemio/core/dist/shared/sequelize";
|
|
8
|
+
type RepositoryOptions = {
|
|
9
|
+
transaction?: Transaction;
|
|
10
|
+
};
|
|
11
|
+
export declare class JISInfotextsRopidGTFSStopsRepository extends AbstractValidatableRepository {
|
|
12
|
+
private logger;
|
|
13
|
+
validator: JSONSchemaValidator;
|
|
14
|
+
schema: string;
|
|
15
|
+
tableName: string;
|
|
16
|
+
private sequelizeModel;
|
|
17
|
+
constructor(connector: IDatabaseConnector, logger: ILogger);
|
|
18
|
+
/**
|
|
19
|
+
* Delete all items last updated before a given date and time (where their `updated_at` is less than the given limit)
|
|
20
|
+
*
|
|
21
|
+
* @param dateTime The `updated_at` limit, where all items last updated before this limit shall be deleted
|
|
22
|
+
* @param options Options for the operation
|
|
23
|
+
* @returns The number of deleted items
|
|
24
|
+
*/
|
|
25
|
+
deleteAllLastUpdatedBefore(dateTime: Date, options?: RepositoryOptions): Promise<number>;
|
|
26
|
+
/**
|
|
27
|
+
* Insert or update all given data. In case of an update, all attributes except for `created_at` shall be overwritten.
|
|
28
|
+
*
|
|
29
|
+
* @param data The data to be upserted
|
|
30
|
+
* @param options Options for the operation
|
|
31
|
+
* @returns The upserted items
|
|
32
|
+
*/
|
|
33
|
+
upsertAll(data: IJISInfotextsRopidGTFSStops[], options?: RepositoryOptions): ReturnType<ModelStatic<JISInfotextsRopidGTFSStopsModel>["bulkCreate"]>;
|
|
34
|
+
private getUpdateAttributes;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.JISInfotextsRopidGTFSStopsRepository = void 0;
|
|
25
|
+
const const_1 = require("../../../schema-definitions/const");
|
|
26
|
+
const JISInfotextsRopidGTFSStopsModel_1 = require("../../../schema-definitions/jis/models/JISInfotextsRopidGTFSStopsModel");
|
|
27
|
+
const AbstractValidatableRepository_1 = require("@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractValidatableRepository");
|
|
28
|
+
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
29
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
30
|
+
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
31
|
+
const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
|
|
32
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
33
|
+
let JISInfotextsRopidGTFSStopsRepository = exports.JISInfotextsRopidGTFSStopsRepository = class JISInfotextsRopidGTFSStopsRepository extends AbstractValidatableRepository_1.AbstractValidatableRepository {
|
|
34
|
+
constructor(connector, logger) {
|
|
35
|
+
super(connector, logger);
|
|
36
|
+
this.logger = logger;
|
|
37
|
+
this.schema = const_1.PG_SCHEMA;
|
|
38
|
+
this.tableName = JISInfotextsRopidGTFSStopsModel_1.JISInfotextsRopidGTFSStopsModel.tableName;
|
|
39
|
+
this.validator = new golemio_validator_1.JSONSchemaValidator("JISInfotextsRopidGTFSStopsRepository", JISInfotextsRopidGTFSStopsModel_1.JISInfotextsRopidGTFSStopsModel.jsonSchema);
|
|
40
|
+
this.sequelizeModel = connector
|
|
41
|
+
.getConnection()
|
|
42
|
+
.define(this.tableName, JISInfotextsRopidGTFSStopsModel_1.JISInfotextsRopidGTFSStopsModel.attributeModel, { schema: this.schema });
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Delete all items last updated before a given date and time (where their `updated_at` is less than the given limit)
|
|
46
|
+
*
|
|
47
|
+
* @param dateTime The `updated_at` limit, where all items last updated before this limit shall be deleted
|
|
48
|
+
* @param options Options for the operation
|
|
49
|
+
* @returns The number of deleted items
|
|
50
|
+
*/
|
|
51
|
+
deleteAllLastUpdatedBefore(dateTime, options) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
try {
|
|
54
|
+
return yield this.sequelizeModel.destroy({
|
|
55
|
+
where: {
|
|
56
|
+
updated_at: { [sequelize_1.Op.lt]: dateTime },
|
|
57
|
+
},
|
|
58
|
+
transaction: options === null || options === void 0 ? void 0 : options.transaction,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
throw new golemio_errors_1.GeneralError("Error in deleteAllLastUpdatedBefore", this.constructor.name, err);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Insert or update all given data. In case of an update, all attributes except for `created_at` shall be overwritten.
|
|
68
|
+
*
|
|
69
|
+
* @param data The data to be upserted
|
|
70
|
+
* @param options Options for the operation
|
|
71
|
+
* @returns The upserted items
|
|
72
|
+
*/
|
|
73
|
+
upsertAll(data, options) {
|
|
74
|
+
var _a;
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
try {
|
|
77
|
+
return yield this.sequelizeModel.bulkCreate(data, {
|
|
78
|
+
updateOnDuplicate: this.getUpdateAttributes(),
|
|
79
|
+
transaction: options === null || options === void 0 ? void 0 : options.transaction,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
if (err instanceof sequelize_1.ValidationError && ((_a = err.errors) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
84
|
+
const mappedErrors = err.errors.map((e) => `${e.message} (${e.value})`).join(", ");
|
|
85
|
+
throw new golemio_errors_1.ValidationError(`Validation error in upsertAll: ${mappedErrors}`, this.constructor.name, err, undefined, "pid");
|
|
86
|
+
}
|
|
87
|
+
throw new golemio_errors_1.GeneralError("Error in upsertAll", this.constructor.name, err);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
getUpdateAttributes() {
|
|
92
|
+
return Object.keys(JISInfotextsRopidGTFSStopsModel_1.JISInfotextsRopidGTFSStopsModel.attributeModel).filter((attribute) => !["created_at"].includes(attribute));
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
exports.JISInfotextsRopidGTFSStopsRepository = JISInfotextsRopidGTFSStopsRepository = __decorate([
|
|
96
|
+
(0, tsyringe_1.injectable)(),
|
|
97
|
+
__param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.PostgresConnector)),
|
|
98
|
+
__param(1, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
|
|
99
|
+
__metadata("design:paramtypes", [Object, Object])
|
|
100
|
+
], JISInfotextsRopidGTFSStopsRepository);
|
|
101
|
+
//# sourceMappingURL=JISInfotextsRopidGTFSStopsRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JISInfotextsRopidGTFSStopsRepository.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAAuC;AACvC,4HAAkG;AAIlG,8IAA2I;AAC3I,wEAAqE;AACrE,6EAAyF;AACzF,mFAAkF;AAClF,mEAAgI;AAChI,iEAAwE;AAOjE,IAAM,oCAAoC,kDAA1C,MAAM,oCAAqC,SAAQ,6DAA6B;IAOnF,YACyC,SAA6B,EACxC,MAAuB;QAEjD,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAFS,WAAM,GAAN,MAAM,CAAS;QAP9C,WAAM,GAAG,iBAAS,CAAC;QACnB,cAAS,GAAG,iEAA+B,CAAC,SAAS,CAAC;QASzD,IAAI,CAAC,SAAS,GAAG,IAAI,uCAAmB,CACpC,sCAAsC,EACtC,iEAA+B,CAAC,UAAU,CAC7C,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,SAAS;aAC1B,aAAa,EAAE;aACf,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,iE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EACH,SAAS,EACT,KAAK,CACR,CAAC;iBACL;gBACD,MAAM,IAAI,6BAAY,CAAC,oBAAoB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;aAC5E;;KACJ;IAEO,mBAAmB;QACvB,OAAO,MAAM,CAAC,IAAI,CAAC,iEAA+B,CAAC,cAAc,CAAC,CAAC,MAAM,CACrE,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CACrD,CAAC;IACN,CAAC;CACJ,CAAA;+CA7EY,oCAAoC;IADhD,IAAA,qBAAU,GAAE;IASJ,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,iBAAiB,CAAC,CAAA;IACnC,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;;GATpB,oCAAoC,CA6EhD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { JISInfotextsRepository } from "../repositories/JISInfotextsRepository";
|
|
2
|
+
import { JISInfotextsRopidGTFSStopsRepository } from "../repositories/JISInfotextsRopidGTFSStopsRepository";
|
|
3
|
+
import { IJISInfotext, IJISInfotextsRopidGTFSStops } from "../../../schema-definitions/jis/models/interfaces";
|
|
4
|
+
import { ILogger } from "@golemio/core/dist/helpers";
|
|
5
|
+
import { IDatabaseConnector } from "@golemio/core/dist/helpers/data-access/postgres/IDatabaseConnector";
|
|
6
|
+
export declare class JISInfotextsDataService {
|
|
7
|
+
private infotextsRepository;
|
|
8
|
+
private infotextsRopidGTFSStopsRepository;
|
|
9
|
+
private databaseConnector;
|
|
10
|
+
private logger;
|
|
11
|
+
constructor(infotextsRepository: JISInfotextsRepository, infotextsRopidGTFSStopsRepository: JISInfotextsRopidGTFSStopsRepository, databaseConnector: IDatabaseConnector, logger: ILogger);
|
|
12
|
+
/**
|
|
13
|
+
* Insert or update all given infotexts and infotextsRopidGTFSStops data. In case of an update, all attributes except for
|
|
14
|
+
* `created_at` shall be overwritten. Delete all non-updated data from before the refresh.
|
|
15
|
+
*
|
|
16
|
+
* @param infotexts The infotexts data to be upserted
|
|
17
|
+
* @param infotextsRopidGTFSStops The infotextsRopidGTFSStops data to be upserted
|
|
18
|
+
*/
|
|
19
|
+
refreshData(infotexts: IJISInfotext[], infotextsRopidGTFSStops: IJISInfotextsRopidGTFSStops[]): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.JISInfotextsDataService = void 0;
|
|
25
|
+
const JISContainerToken_1 = require("../ioc/JISContainerToken");
|
|
26
|
+
const JISInfotextsRepository_1 = require("../repositories/JISInfotextsRepository");
|
|
27
|
+
const JISInfotextsRopidGTFSStopsRepository_1 = require("../repositories/JISInfotextsRopidGTFSStopsRepository");
|
|
28
|
+
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
29
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
30
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
31
|
+
let JISInfotextsDataService = exports.JISInfotextsDataService = class JISInfotextsDataService {
|
|
32
|
+
constructor(infotextsRepository, infotextsRopidGTFSStopsRepository, databaseConnector, logger) {
|
|
33
|
+
this.infotextsRepository = infotextsRepository;
|
|
34
|
+
this.infotextsRopidGTFSStopsRepository = infotextsRopidGTFSStopsRepository;
|
|
35
|
+
this.databaseConnector = databaseConnector;
|
|
36
|
+
this.logger = logger;
|
|
37
|
+
// do nothing
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Insert or update all given infotexts and infotextsRopidGTFSStops data. In case of an update, all attributes except for
|
|
41
|
+
* `created_at` shall be overwritten. Delete all non-updated data from before the refresh.
|
|
42
|
+
*
|
|
43
|
+
* @param infotexts The infotexts data to be upserted
|
|
44
|
+
* @param infotextsRopidGTFSStops The infotextsRopidGTFSStops data to be upserted
|
|
45
|
+
*/
|
|
46
|
+
refreshData(infotexts, infotextsRopidGTFSStops) {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
const connection = this.databaseConnector.getConnection();
|
|
49
|
+
const transaction = yield connection.transaction();
|
|
50
|
+
const saveTime = new Date();
|
|
51
|
+
try {
|
|
52
|
+
yield this.infotextsRepository.upsertAll(infotexts, { transaction });
|
|
53
|
+
yield this.infotextsRopidGTFSStopsRepository.upsertAll(infotextsRopidGTFSStops, { transaction });
|
|
54
|
+
yield this.infotextsRopidGTFSStopsRepository.deleteAllLastUpdatedBefore(saveTime, { transaction });
|
|
55
|
+
yield this.infotextsRepository.deleteAllLastUpdatedBefore(saveTime, { transaction });
|
|
56
|
+
yield transaction.commit();
|
|
57
|
+
this.logger.info(`${this.constructor.name}.refreshData: ${infotexts.length} JIS infotexts and ${infotextsRopidGTFSStops.length}` +
|
|
58
|
+
` JIS infotextsRopidGTFSStops were saved`);
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
yield transaction.rollback();
|
|
62
|
+
if (err instanceof golemio_errors_1.GeneralError)
|
|
63
|
+
throw err;
|
|
64
|
+
throw new golemio_errors_1.GeneralError("Refreshing JIS Infotexts in database failed", this.constructor.name, err);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
exports.JISInfotextsDataService = JISInfotextsDataService = __decorate([
|
|
70
|
+
(0, tsyringe_1.injectable)(),
|
|
71
|
+
__param(0, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextsRepository)),
|
|
72
|
+
__param(1, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextsRopidGTFSStopsRepository)),
|
|
73
|
+
__param(2, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.PostgresConnector)),
|
|
74
|
+
__param(3, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
|
|
75
|
+
__metadata("design:paramtypes", [JISInfotextsRepository_1.JISInfotextsRepository,
|
|
76
|
+
JISInfotextsRopidGTFSStopsRepository_1.JISInfotextsRopidGTFSStopsRepository, Object, Object])
|
|
77
|
+
], JISInfotextsDataService);
|
|
78
|
+
//# sourceMappingURL=JISInfotextsDataService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JISInfotextsDataService.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/services/JISInfotextsDataService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAAkE;AAClE,mFAAqF;AACrF,+GAAiH;AAIjH,wEAAqE;AACrE,6EAAwE;AACxE,iEAAwE;AAGjE,IAAM,uBAAuB,qCAA7B,MAAM,uBAAuB;IAChC,YAEY,mBAA2C,EAE3C,iCAAuE,EAClC,iBAAqC,EAChD,MAAe;QAJzC,wBAAmB,GAAnB,mBAAmB,CAAwB;QAE3C,sCAAiC,GAAjC,iCAAiC,CAAsC;QAClC,sBAAiB,GAAjB,iBAAiB,CAAoB;QAChD,WAAM,GAAN,MAAM,CAAS;QAEjD,aAAa;IACjB,CAAC;IAED;;;;;;OAMG;IACU,WAAW,CAAC,SAAyB,EAAE,uBAAsD;;YACtG,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,aAAa,EAAE,CAAC;YAC1D,MAAM,WAAW,GAAG,MAAM,UAAU,CAAC,WAAW,EAAE,CAAC;YACnD,MAAM,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;YAE5B,IAAI;gBACA,MAAM,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;gBACrE,MAAM,IAAI,CAAC,iCAAiC,CAAC,SAAS,CAAC,uBAAuB,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;gBACjG,MAAM,IAAI,CAAC,iCAAiC,CAAC,0BAA0B,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;gBACnG,MAAM,IAAI,CAAC,mBAAmB,CAAC,0BAA0B,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;gBACrF,MAAM,WAAW,CAAC,MAAM,EAAE,CAAC;gBAC3B,IAAI,CAAC,MAAM,CAAC,IAAI,CACZ,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,iBAAiB,SAAS,CAAC,MAAM,sBAAsB,uBAAuB,CAAC,MAAM,EAAE;oBAC3G,yCAAyC,CAChD,CAAC;aACL;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,WAAW,CAAC,QAAQ,EAAE,CAAC;gBAC7B,IAAI,GAAG,YAAY,6BAAY;oBAAE,MAAM,GAAG,CAAC;gBAC3C,MAAM,IAAI,6BAAY,CAAC,6CAA6C,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;aACrG;QACL,CAAC;KAAA;CACJ,CAAA;kCAxCY,uBAAuB;IADnC,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,sBAAsB,CAAC,CAAA;IAEhD,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,oCAAoC,CAAC,CAAA;IAE9D,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,iBAAiB,CAAC,CAAA;IACnC,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;qCAJI,+CAAsB;QAER,2EAAoC;GAL1E,uBAAuB,CAwCnC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IJISInfotext as IJISInfotextDataSource } from "../../../schema-definitions/jis/datasources/interfaces";
|
|
2
|
+
import { IJISInfotext as IJISInfotextModel, IJISInfotextsRopidGTFSStops as IJISInfotextsRopidGTFSStopsModel } from "../../../schema-definitions/jis/models/interfaces";
|
|
3
|
+
import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
|
|
4
|
+
type TransformIn = IJISInfotextDataSource;
|
|
5
|
+
type TransformOut = {
|
|
6
|
+
infotext: IJISInfotextModel;
|
|
7
|
+
infotextsRopidGTFSStops: IJISInfotextsRopidGTFSStopsModel[];
|
|
8
|
+
};
|
|
9
|
+
export declare class JISInfotextsTransformation extends AbstractTransformation<TransformIn, TransformOut> {
|
|
10
|
+
name: string;
|
|
11
|
+
protected transformInternal: (data: TransformIn) => TransformOut;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.JISInfotextsTransformation = void 0;
|
|
10
|
+
const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
|
|
11
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
12
|
+
let JISInfotextsTransformation = exports.JISInfotextsTransformation = class JISInfotextsTransformation extends AbstractTransformation_1.AbstractTransformation {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.name = "JISInfotextsTransformation";
|
|
16
|
+
this.transformInternal = (data) => {
|
|
17
|
+
var _a, _b, _c;
|
|
18
|
+
const infotext = {
|
|
19
|
+
id: data.id,
|
|
20
|
+
severity_level: data.severity_level,
|
|
21
|
+
display_type: data.display_type,
|
|
22
|
+
active_period_start: new Date(data.active_period.start),
|
|
23
|
+
active_period_end: data.active_period.end ? new Date(data.active_period.end) : null,
|
|
24
|
+
description_text: data.description_text,
|
|
25
|
+
created_timestamp: new Date(data.created_timestamp),
|
|
26
|
+
};
|
|
27
|
+
const infotextsRopidGTFSStops = (_c = (_b = (_a = data.informed_entity) === null || _a === void 0 ? void 0 : _a.stops) === null || _b === void 0 ? void 0 : _b.map(({ stop_id }) => ({
|
|
28
|
+
infotext_id: data.id,
|
|
29
|
+
stop_id,
|
|
30
|
+
}))) !== null && _c !== void 0 ? _c : [];
|
|
31
|
+
return {
|
|
32
|
+
infotext,
|
|
33
|
+
infotextsRopidGTFSStops,
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.JISInfotextsTransformation = JISInfotextsTransformation = __decorate([
|
|
39
|
+
(0, tsyringe_1.injectable)()
|
|
40
|
+
], JISInfotextsTransformation);
|
|
41
|
+
//# sourceMappingURL=JISInfotextsTransformation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JISInfotextsTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/transformations/JISInfotextsTransformation.ts"],"names":[],"mappings":";;;;;;;;;AAKA,6GAA0G;AAC1G,iEAAgE;AASzD,IAAM,0BAA0B,wCAAhC,MAAM,0BAA2B,SAAQ,+CAAiD;IAA1F;;QACI,SAAI,GAAG,4BAA4B,CAAC;QAEjC,sBAAiB,GAAG,CAAC,IAAiB,EAAgB,EAAE;;YAC9D,MAAM,QAAQ,GAAG;gBACb,EAAE,EAAE,IAAI,CAAC,EAAE;gBACX,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC/B,mBAAmB,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;gBACvD,iBAAiB,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI;gBACnF,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;gBACvC,iBAAiB,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC;aACtD,CAAC;YACF,MAAM,uBAAuB,GACzB,MAAA,MAAA,MAAA,IAAI,CAAC,eAAe,0CAAE,KAAK,0CAAE,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;gBAC/C,WAAW,EAAE,IAAI,CAAC,EAAE;gBACpB,OAAO;aACV,CAAC,CAAC,mCAAI,EAAE,CAAC;YACd,OAAO;gBACH,QAAQ;gBACR,uBAAuB;aAC1B,CAAC;QACN,CAAC,CAAC;IACN,CAAC;CAAA,CAAA;qCAvBY,0BAA0B;IADtC,IAAA,qBAAU,GAAE;GACA,0BAA0B,CAuBtC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AbstractWorker } from "@golemio/core/dist/integration-engine/workers";
|
|
2
|
+
import { ITask } from "@golemio/core/dist/integration-engine/workers/interfaces";
|
|
3
|
+
export declare class JISWorker extends AbstractWorker {
|
|
4
|
+
protected name: string;
|
|
5
|
+
constructor();
|
|
6
|
+
registerTask: (task: ITask) => void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JISWorker = void 0;
|
|
4
|
+
const workers_1 = require("@golemio/core/dist/integration-engine/workers");
|
|
5
|
+
const Di_1 = require("../ioc/Di");
|
|
6
|
+
const JISContainerToken_1 = require("../ioc/JISContainerToken");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
8
|
+
class JISWorker extends workers_1.AbstractWorker {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.name = constants_1.JIS_WORKER_NAME.toLowerCase();
|
|
12
|
+
this.registerTask = (task) => {
|
|
13
|
+
super.registerTask(task);
|
|
14
|
+
task.queuePrefix = this.getQueuePrefix();
|
|
15
|
+
};
|
|
16
|
+
// Register tasks
|
|
17
|
+
this.registerTask(Di_1.JISContainer.resolve(JISContainerToken_1.JISContainerToken.RefreshJISInfotextsTask));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.JISWorker = JISWorker;
|
|
21
|
+
//# sourceMappingURL=JISWorker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JISWorker.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/workers/JISWorker.ts"],"names":[],"mappings":";;;AAAA,2EAA+E;AAE/E,kCAAyC;AACzC,gEAA6D;AAC7D,2CAA8C;AAG9C,MAAa,SAAU,SAAQ,wBAAc;IAGzC;QACI,KAAK,EAAE,CAAC;QAHF,SAAI,GAAG,2BAAe,CAAC,WAAW,EAAE,CAAC;QASxC,iBAAY,GAAG,CAAC,IAAW,EAAQ,EAAE;YACxC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YACzB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAC7C,CAAC,CAAC;QAPE,iBAAiB;QACjB,IAAI,CAAC,YAAY,CAAC,iBAAY,CAAC,OAAO,CAA0B,qCAAiB,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAChH,CAAC;CAMJ;AAdD,8BAcC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const JIS_WORKER_NAME = "jis";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/workers/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JISInfotextsDataSourceFactory } from "../../datasources/JISInfotextsDataSourceFactory";
|
|
2
|
+
import { JISInfotextsDataService } from "../../services/JISInfotextsDataService";
|
|
3
|
+
import { JISInfotextsTransformation } from "../../transformations/JISInfotextsTransformation";
|
|
4
|
+
import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine";
|
|
5
|
+
export declare class RefreshJISInfotextsTask extends AbstractEmptyTask {
|
|
6
|
+
private dataSourceFactory;
|
|
7
|
+
private infotextsDataService;
|
|
8
|
+
private infotextsTransformation;
|
|
9
|
+
readonly queueName = "refreshJISInfotexts";
|
|
10
|
+
readonly queueTtl: number;
|
|
11
|
+
constructor(dataSourceFactory: JISInfotextsDataSourceFactory, infotextsDataService: JISInfotextsDataService, infotextsTransformation: JISInfotextsTransformation);
|
|
12
|
+
protected execute(): Promise<void>;
|
|
13
|
+
private getEntitiesFromTransformationResult;
|
|
14
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.RefreshJISInfotextsTask = void 0;
|
|
25
|
+
const JISInfotextsDataSourceFactory_1 = require("../../datasources/JISInfotextsDataSourceFactory");
|
|
26
|
+
const JISContainerToken_1 = require("../../ioc/JISContainerToken");
|
|
27
|
+
const JISInfotextsDataService_1 = require("../../services/JISInfotextsDataService");
|
|
28
|
+
const JISInfotextsTransformation_1 = require("../../transformations/JISInfotextsTransformation");
|
|
29
|
+
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
30
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
31
|
+
const constants_1 = require("../constants");
|
|
32
|
+
let RefreshJISInfotextsTask = exports.RefreshJISInfotextsTask = class RefreshJISInfotextsTask extends integration_engine_1.AbstractEmptyTask {
|
|
33
|
+
constructor(dataSourceFactory, infotextsDataService, infotextsTransformation) {
|
|
34
|
+
super(constants_1.JIS_WORKER_NAME.toLowerCase());
|
|
35
|
+
this.dataSourceFactory = dataSourceFactory;
|
|
36
|
+
this.infotextsDataService = infotextsDataService;
|
|
37
|
+
this.infotextsTransformation = infotextsTransformation;
|
|
38
|
+
this.queueName = "refreshJISInfotexts";
|
|
39
|
+
this.queueTtl = 1 * 60 * 1000; // 1 minute;
|
|
40
|
+
}
|
|
41
|
+
execute() {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
const dataSource = this.dataSourceFactory.getDataSource();
|
|
44
|
+
const data = yield dataSource.getAll();
|
|
45
|
+
const transformedData = yield this.infotextsTransformation.transformArray(data);
|
|
46
|
+
const { infotexts, infotextsRopidGTFSStops } = this.getEntitiesFromTransformationResult(transformedData);
|
|
47
|
+
yield this.infotextsDataService.refreshData(infotexts, infotextsRopidGTFSStops);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
getEntitiesFromTransformationResult(transformedData) {
|
|
51
|
+
const infotextEntities = [];
|
|
52
|
+
const infotextsRopidGTFSStopsEntities = [];
|
|
53
|
+
for (const { infotext, infotextsRopidGTFSStops } of transformedData) {
|
|
54
|
+
infotextEntities.push(infotext);
|
|
55
|
+
infotextsRopidGTFSStopsEntities.push(...infotextsRopidGTFSStops);
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
infotexts: infotextEntities,
|
|
59
|
+
infotextsRopidGTFSStops: infotextsRopidGTFSStopsEntities,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
exports.RefreshJISInfotextsTask = RefreshJISInfotextsTask = __decorate([
|
|
64
|
+
(0, tsyringe_1.injectable)(),
|
|
65
|
+
__param(0, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextsDataSourceFactory)),
|
|
66
|
+
__param(1, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextsDataService)),
|
|
67
|
+
__param(2, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextsTransformation)),
|
|
68
|
+
__metadata("design:paramtypes", [JISInfotextsDataSourceFactory_1.JISInfotextsDataSourceFactory,
|
|
69
|
+
JISInfotextsDataService_1.JISInfotextsDataService,
|
|
70
|
+
JISInfotextsTransformation_1.JISInfotextsTransformation])
|
|
71
|
+
], RefreshJISInfotextsTask);
|
|
72
|
+
//# sourceMappingURL=RefreshJISInfotextsTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefreshJISInfotextsTask.js","sourceRoot":"","sources":["../../../../../src/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,mGAAkG;AAClG,mEAAkE;AAClE,oFAAmF;AACnF,iGAAgG;AAEhG,8EAA0E;AAC1E,iEAAwE;AACxE,4CAA+C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