@golemio/pid 2.16.0 → 2.16.1-dev.1405891097
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/20_jis_infotexts.sql +214 -0
- package/db/migrations/postgresql/20240801141948-jis-infotexts.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/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 +40 -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/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/helpers/PositionsManager.js +15 -10
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/abstract/AbstractPropagateDelayTask.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/abstract/AbstractPropagateDelayTask.js.map +1 -1
- 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 +147 -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 +15 -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 +18 -0
- package/dist/schema-definitions/jis/models/JISInfotextsModel.js +75 -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 +9 -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/dist/schema-definitions/vehicle-positions/models/VPTripsModel.js +6 -0
- package/dist/schema-definitions/vehicle-positions/models/VPTripsModel.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/models/interfaces/VPTripsLastPositionInterfaces.d.ts +2 -0
- package/docs/assets/pid_jis_erd.png +0 -0
- package/docs/implementation_documentation.md +86 -35
- package/docs/openapi-output.yaml +128 -69
- package/package.json +2 -2
- 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 { JISInfotextsRopidGTFSStopsModel } from "../../../schema-definitions/jis/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,iEAA+B,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IACzG,CAAC;IAED;;;;;;OAMG;IACU,0BAA0B,CAAC,QAAc,EAAE,OAA2B;;YAC/E,IAAI;gBACA,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;oBACrC,KAAK,EAAE;wBACH,UAAU,EAAE,EAAE,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE;qBACpC;oBACD,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW;iBACpC,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,6BAAY,CAAC,qCAAqC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;aAC7F;QACL,CAAC;KAAA;IAED;;;;;;OAMG;IACU,SAAS,CAClB,IAAmC,EACnC,OAA2B;;;YAE3B,IAAI;gBACA,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,EAAE;oBAC9C,iBAAiB,EAAE,IAAI,CAAC,mBAAmB,EAAS;oBACpD,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW;iBACpC,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,GAAG,YAAY,2BAAwB,IAAI,CAAA,MAAA,GAAG,CAAC,MAAM,0CAAE,MAAM,IAAG,CAAC,EAAE;oBACnE,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACnF,MAAM,IAAI,gCAAe,CACrB,kCAAkC,YAAY,EAAE,EAChD,IAAI,CAAC,WAAW,CAAC,IAAI,EACrB,GAAG,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,40 @@
|
|
|
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
|
+
};
|
|
26
|
+
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 }) => ({
|
|
27
|
+
infotext_id: data.id,
|
|
28
|
+
stop_id,
|
|
29
|
+
}))) !== null && _c !== void 0 ? _c : [];
|
|
30
|
+
return {
|
|
31
|
+
infotext,
|
|
32
|
+
infotextsRopidGTFSStops,
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.JISInfotextsTransformation = JISInfotextsTransformation = __decorate([
|
|
38
|
+
(0, tsyringe_1.injectable)()
|
|
39
|
+
], JISInfotextsTransformation);
|
|
40
|
+
//# 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;aAC1C,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;qCAtBY,0BAA0B;IADtC,IAAA,qBAAU,GAAE;GACA,0BAA0B,CAsBtC"}
|
|
@@ -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;AAGxC,IAAM,uBAAuB,qCAA7B,MAAM,uBAAwB,SAAQ,sCAAiB;IAI1D,YAEI,iBAAwD,EAExD,oBAAqD,EAErD,uBAA2D;QAE3D,KAAK,CAAC,2BAAe,CAAC,WAAW,EAAE,CAAC,CAAC;QAN7B,sBAAiB,GAAjB,iBAAiB,CAA+B;QAEhD,yBAAoB,GAApB,oBAAoB,CAAyB;QAE7C,4BAAuB,GAAvB,uBAAuB,CAA4B;QAT/C,cAAS,GAAG,qBAAqB,CAAC;QAClC,aAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;IAWtD,CAAC;IAEe,OAAO;;YACnB,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,aAAa,EAAE,CAAC;YAC1D,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;YACvC,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YAChF,MAAM,EAAE,SAAS,EAAE,uBAAuB,EAAE,GAAG,IAAI,CAAC,mCAAmC,CAAC,eAAe,CAAC,CAAC;YACzG,MAAM,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;QACpF,CAAC;KAAA;IAEO,mCAAmC,CAAC,eAAyE;QACjH,MAAM,gBAAgB,GAAmB,EAAE,CAAC;QAC5C,MAAM,+BAA+B,GAAkC,EAAE,CAAC;QAC1E,KAAK,MAAM,EAAE,QAAQ,EAAE,uBAAuB,EAAE,IAAI,eAAe,EAAE;YACjE,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAChC,+BAA+B,CAAC,IAAI,CAAC,GAAG,uBAAuB,CAAC,CAAC;SACpE;QACD,OAAO;YACH,SAAS,EAAE,gBAAgB;YAC3B,uBAAuB,EAAE,+BAA+B;SAC3D,CAAC;IACN,CAAC;CACJ,CAAA;kCAnCY,uBAAuB;IADnC,IAAA,qBAAU,GAAE;IAMJ,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,6BAA6B,CAAC,CAAA;IAEvD,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,uBAAuB,CAAC,CAAA;IAEjD,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,0BAA0B,CAAC,CAAA;qCAH1B,6DAA6B;QAE1B,iDAAuB;QAEpB,uDAA0B;GAVtD,uBAAuB,CAmCnC"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { IRegionalBusRunsMessagesModel } from "../../../../../../schema-definitions/vehicle-positions/models/interfaces/IRegionalBusRunsMessagesModel";
|
|
2
|
-
import { ISimpleConfig } from "@golemio/core/dist/helpers/configuration/ISimpleConfig";
|
|
3
2
|
import { ILogger } from "@golemio/core/dist/helpers/logger";
|
|
4
3
|
import { IRegionalBusMessageFilter } from "./interfaces/IRegionalBusMessageFilter";
|
|
5
4
|
import { TimestampValidator } from "../TimestampValidator";
|
|
6
5
|
export declare class RegionalBusMessageFilter implements IRegionalBusMessageFilter {
|
|
7
|
-
private config;
|
|
8
6
|
private logger;
|
|
9
7
|
private timestampValidator;
|
|
10
|
-
constructor(
|
|
8
|
+
constructor(logger: ILogger, timestampValidator: TimestampValidator);
|
|
11
9
|
/**
|
|
12
10
|
* Get messages that are valid for processing
|
|
13
11
|
*/
|
|
14
12
|
getFilteredMessages(messages: IRegionalBusRunsMessagesModel[], timestamp: number): IRegionalBusRunsMessagesModel[];
|
|
15
|
-
private get regNumberWhitelist();
|
|
16
13
|
}
|
|
@@ -19,8 +19,7 @@ const VPContainerToken_1 = require("../../../../ioc/VPContainerToken");
|
|
|
19
19
|
const TimestampValidator_1 = require("../TimestampValidator");
|
|
20
20
|
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
21
21
|
let RegionalBusMessageFilter = exports.RegionalBusMessageFilter = class RegionalBusMessageFilter {
|
|
22
|
-
constructor(
|
|
23
|
-
this.config = config;
|
|
22
|
+
constructor(logger, timestampValidator) {
|
|
24
23
|
this.logger = logger;
|
|
25
24
|
this.timestampValidator = timestampValidator;
|
|
26
25
|
}
|
|
@@ -30,18 +29,13 @@ let RegionalBusMessageFilter = exports.RegionalBusMessageFilter = class Regional
|
|
|
30
29
|
getFilteredMessages(messages, timestamp) {
|
|
31
30
|
let filteredMessages = [];
|
|
32
31
|
for (const message of messages) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (!this.timestampValidator.isTimestampValid(timestamp, message.timestamp)) {
|
|
41
|
-
this.logger.error(new golemio_errors_1.GeneralError(`Message timestamp 'tm' of value ${message.timestamp} is not valid ` +
|
|
42
|
-
`(line ${message.cis_line_id}, trip id ${message.cis_trip_number})`, this.constructor.name, undefined, undefined, "pid"));
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
32
|
+
const isValidMessage = message.cis_line_id && message.cis_trip_number && message.registration_number && message.events !== "";
|
|
33
|
+
if (!this.timestampValidator.isTimestampValid(timestamp, message.timestamp)) {
|
|
34
|
+
this.logger.error(new golemio_errors_1.GeneralError(`Message timestamp 'tm' of value ${message.timestamp} is not valid ` +
|
|
35
|
+
`(line ${message.cis_line_id}, trip id ${message.cis_trip_number})`, this.constructor.name, undefined, undefined, "pid"));
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (isValidMessage) {
|
|
45
39
|
filteredMessages.push(message);
|
|
46
40
|
}
|
|
47
41
|
}
|
|
@@ -50,21 +44,11 @@ let RegionalBusMessageFilter = exports.RegionalBusMessageFilter = class Regional
|
|
|
50
44
|
}
|
|
51
45
|
return filteredMessages;
|
|
52
46
|
}
|
|
53
|
-
get regNumberWhitelist() {
|
|
54
|
-
const valuePath = "old.datasources.pid.vehicle-positions.regNumberWhitelist.regionalBus";
|
|
55
|
-
const whitelistDict = this.config.getValue(valuePath, {});
|
|
56
|
-
const whitelist = Object.values(whitelistDict);
|
|
57
|
-
if (whitelist[0] !== "*") {
|
|
58
|
-
return whitelist;
|
|
59
|
-
}
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
47
|
};
|
|
63
48
|
exports.RegionalBusMessageFilter = RegionalBusMessageFilter = __decorate([
|
|
64
49
|
(0, tsyringe_1.injectable)(),
|
|
65
|
-
__param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.
|
|
66
|
-
__param(1, (0, tsyringe_1.inject)(
|
|
67
|
-
|
|
68
|
-
__metadata("design:paramtypes", [Object, Object, TimestampValidator_1.TimestampValidator])
|
|
50
|
+
__param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
|
|
51
|
+
__param(1, (0, tsyringe_1.inject)(VPContainerToken_1.VPContainerToken.TimestampValidator)),
|
|
52
|
+
__metadata("design:paramtypes", [Object, TimestampValidator_1.TimestampValidator])
|
|
69
53
|
], RegionalBusMessageFilter);
|
|
70
54
|
//# sourceMappingURL=RegionalBusMessageFilter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegionalBusMessageFilter.js","sourceRoot":"","sources":["../../../../../../../src/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusMessageFilter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"RegionalBusMessageFilter.js","sourceRoot":"","sources":["../../../../../../../src/integration-engine/vehicle-positions/workers/runs/helpers/regional-bus/RegionalBusMessageFilter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,wEAAqE;AAErE,iEAAwE;AAExE,uEAA8E;AAC9E,8DAA2D;AAC3D,6EAAwE;AAGjE,IAAM,wBAAwB,sCAA9B,MAAM,wBAAwB;IACjC,YACsC,MAAe,EACI,kBAAsC;QADzD,WAAM,GAAN,MAAM,CAAS;QACI,uBAAkB,GAAlB,kBAAkB,CAAoB;IAC5F,CAAC;IAEJ;;OAEG;IACI,mBAAmB,CAAC,QAAyC,EAAE,SAAiB;QACnF,IAAI,gBAAgB,GAAoC,EAAE,CAAC;QAC3D,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC5B,MAAM,cAAc,GAChB,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,mBAAmB,IAAI,OAAO,CAAC,MAAM,KAAK,EAAE,CAAC;YAC3G,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,SAAU,CAAC,EAAE;gBAC1E,IAAI,CAAC,MAAM,CAAC,KAAK,CACb,IAAI,6BAAY,CACZ,mCAAmC,OAAO,CAAC,SAAS,gBAAgB;oBAChE,SAAS,OAAO,CAAC,WAAW,aAAa,OAAO,CAAC,eAAe,GAAG,EACvE,IAAI,CAAC,WAAW,CAAC,IAAI,EACrB,SAAS,EACT,SAAS,EACT,KAAK,CACR,CACJ,CAAC;gBACF,SAAS;aACZ;YAED,IAAI,cAAc,EAAE;gBAChB,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aAClC;SACJ;QAED,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE;YAC/B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,uDAAuD,CAAC,CAAC;SAChF;QAED,OAAO,gBAAgB,CAAC;IAC5B,CAAC;CACJ,CAAA;mCAvCY,wBAAwB;IADpC,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;IACxB,WAAA,IAAA,iBAAM,EAAC,mCAAgB,CAAC,kBAAkB,CAAC,CAAA;6CAA6B,uCAAkB;GAHtF,wBAAwB,CAuCpC"}
|
|
@@ -89,7 +89,7 @@ let PositionsManager = exports.PositionsManager = class PositionsManager {
|
|
|
89
89
|
* @returns {void} - void
|
|
90
90
|
*/
|
|
91
91
|
this.updatePositions = (options, schedule) => __awaiter(this, void 0, void 0, function* () {
|
|
92
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l
|
|
92
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
93
93
|
const { tripPositions, startDayTimestamp, startTimestamp, endTimestamp, context, computedPositions, gtfsRouteType } = options;
|
|
94
94
|
for (let i = 0; i < tripPositions.positions.length; i++) {
|
|
95
95
|
const position = tripPositions.positions[i];
|
|
@@ -151,8 +151,8 @@ let PositionsManager = exports.PositionsManager = class PositionsManager {
|
|
|
151
151
|
case PositionHandlerEnum_1.PositionHandlerEnum.CANCELED:
|
|
152
152
|
positionToUpdate = {
|
|
153
153
|
id: position.id,
|
|
154
|
-
lat: (
|
|
155
|
-
lng: (
|
|
154
|
+
lat: (_e = (_d = position.lat) !== null && _d !== void 0 ? _d : context.lastPositionLat) !== null && _e !== void 0 ? _e : null,
|
|
155
|
+
lng: (_g = (_f = position.lng) !== null && _f !== void 0 ? _f : context.lastPositionLng) !== null && _g !== void 0 ? _g : null,
|
|
156
156
|
state_position: const_1.StatePositionEnum.CANCELED,
|
|
157
157
|
state_process: const_1.StateProcessEnum.PROCESSED,
|
|
158
158
|
};
|
|
@@ -167,19 +167,19 @@ let PositionsManager = exports.PositionsManager = class PositionsManager {
|
|
|
167
167
|
}
|
|
168
168
|
// if not null push to update
|
|
169
169
|
if (positionToUpdate) {
|
|
170
|
-
(
|
|
170
|
+
(_h = positionToUpdate.is_tracked) !== null && _h !== void 0 ? _h : (positionToUpdate.is_tracked = position.is_tracked);
|
|
171
171
|
positionToUpdate.valid_to = this.validToCalculator.getValidToAttribute(positionToUpdate, position, gtfsRouteType, tripPositions.gtfsData, startTimestamp);
|
|
172
172
|
computedPositions.push(positionToUpdate);
|
|
173
173
|
}
|
|
174
174
|
else {
|
|
175
175
|
computedPositions.push(null);
|
|
176
176
|
}
|
|
177
|
-
context.lastPositionState = (
|
|
177
|
+
context.lastPositionState = (_j = positionToUpdate === null || positionToUpdate === void 0 ? void 0 : positionToUpdate.state_position) !== null && _j !== void 0 ? _j : position.state_position;
|
|
178
178
|
// set last known BEFORE_TRACK_DELAYED position
|
|
179
179
|
if (position.state_position === const_1.StatePositionEnum.BEFORE_TRACK_DELAYED) {
|
|
180
180
|
context.lastPositionBeforeTrackDelayed = {
|
|
181
|
-
delay: (
|
|
182
|
-
origin_timestamp: (
|
|
181
|
+
delay: (_k = positionToUpdate === null || positionToUpdate === void 0 ? void 0 : positionToUpdate.delay) !== null && _k !== void 0 ? _k : position.delay,
|
|
182
|
+
origin_timestamp: (_l = positionToUpdate === null || positionToUpdate === void 0 ? void 0 : positionToUpdate.origin_timestamp) !== null && _l !== void 0 ? _l : position.origin_timestamp,
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
185
|
// set last position tracking (only for at_stop and on_track)
|
|
@@ -212,10 +212,13 @@ let PositionsManager = exports.PositionsManager = class PositionsManager {
|
|
|
212
212
|
context.atStopStreak.stop_sequence = null;
|
|
213
213
|
}
|
|
214
214
|
// duplicated or mismatched position should not be considered at all
|
|
215
|
-
if (
|
|
216
|
-
|
|
217
|
-
|
|
215
|
+
if (positionToUpdate &&
|
|
216
|
+
positionToUpdate.state_position !== const_1.StatePositionEnum.DUPLICATE &&
|
|
217
|
+
positionToUpdate.state_position !== const_1.StatePositionEnum.INVISIBLE &&
|
|
218
|
+
positionToUpdate.state_position !== const_1.StatePositionEnum.MISMATCHED) {
|
|
218
219
|
context.lastPositionId = position.id;
|
|
220
|
+
context.lastPositionLat = position.lat;
|
|
221
|
+
context.lastPositionLng = position.lng;
|
|
219
222
|
context.lastPositionCanceled = position.is_canceled;
|
|
220
223
|
context.lastPositionOriginTimestamp = position.origin_timestamp.getTime();
|
|
221
224
|
ComputeDelayHelper_1.default.updateContext(context, positionToUpdate, position, gtfsRouteType);
|
|
@@ -244,6 +247,8 @@ let PositionsManager = exports.PositionsManager = class PositionsManager {
|
|
|
244
247
|
},
|
|
245
248
|
lastPositionDelay: null,
|
|
246
249
|
lastPositionId: null,
|
|
250
|
+
lastPositionLat: null,
|
|
251
|
+
lastPositionLng: null,
|
|
247
252
|
lastPositionOriginTimestamp: null,
|
|
248
253
|
lastPositionTracking: null,
|
|
249
254
|
lastPositionCanceled: null,
|