@golemio/pid
Version:
Golemio PID Module
116 lines • 13.3 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RopidGtfsContainer = void 0;
const Di_1 = require("../../ioc/Di");
const RopidDeparturesPresetsRopidGTFSStopsRepository_1 = require("../../jis/repositories/RopidDeparturesPresetsRopidGTFSStopsRepository");
const RopidDeparturesPresetsRoutesRepository_1 = require("../../jis/repositories/RopidDeparturesPresetsRoutesRepository");
const ropid_gtfs_1 = require("../../../schema-definitions/ropid-gtfs");
const pubsub_1 = require("@golemio/core/dist/integration-engine/data-access/pubsub");
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
const RopidGTFSCisStopsModel_1 = require("../RopidGTFSCisStopsModel");
const RopidGTFSStopsModel_1 = require("../RopidGTFSStopsModel");
const RopidGtfsFacade_1 = require("../RopidGtfsFacade");
const RopidGtfsMetadataRepository_1 = require("../RopidGtfsMetadataRepository");
const RopidGTFSRoutesRepository_1 = require("../data-access/RopidGTFSRoutesRepository");
const RopidGtfsRepository_1 = require("../data-access/RopidGtfsRepository");
const BlockStopsRedisRepository_1 = require("../data-access/cache/BlockStopsRedisRepository");
const GtfsTripStopsCacheRepository_1 = require("../data-access/cache/GtfsTripStopsCacheRepository");
const NotPublicVehiclesRedisRepository_1 = require("../data-access/cache/NotPublicVehiclesRedisRepository");
const PublicGtfsDepartureRepository_1 = require("../data-access/cache/PublicGtfsDepartureRepository");
const StaticFileRedisRepository_1 = require("../data-access/cache/StaticFileRedisRepository");
const precomputed_1 = require("../data-access/precomputed");
const StaticDataSourceFactory_1 = require("../datasources/StaticDataSourceFactory");
const DeparturesDirectionDataSourceProvider_1 = require("../datasources/static-data/DeparturesDirectionDataSourceProvider");
const MetroRailTrackDataSourceProvider_1 = require("../datasources/static-data/MetroRailTrackDataSourceProvider");
const NotPublicVehiclesDataSourceProvider_1 = require("../datasources/static-data/NotPublicVehiclesDataSourceProvider");
const DeparturePresetsFacade_1 = require("../facade/DeparturePresetsFacade");
const PublicDepartureCacheTransformation_1 = require("../transformations/PublicDepartureCacheTransformation");
const RopidGTFSTransformation_1 = require("../transformations/RopidGTFSTransformation");
const DeparturesPresetsDatasource_1 = require("../workers/presets/data-access/DeparturesPresetsDatasource");
const CheckForNewDeparturesPresetsTask_1 = require("../workers/presets/tasks/CheckForNewDeparturesPresetsTask");
const CollectAndSaveLogsTask_1 = require("../workers/presets/tasks/CollectAndSaveLogsTask");
const DownloadDeparturesPresetsTask_1 = require("../workers/presets/tasks/DownloadDeparturesPresetsTask");
const ProcessAndSendLogsTask_1 = require("../workers/presets/tasks/ProcessAndSendLogsTask");
const SavePresetsDataTask_1 = require("../workers/presets/tasks/SavePresetsDataTask");
const CheckForNewDataTask_1 = require("../workers/timetables/tasks/CheckForNewDataTask");
const CheckSavedRowsAndReplaceTablesTask_1 = require("../workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask");
const DownloadDatasetsTask_1 = require("../workers/timetables/tasks/DownloadDatasetsTask");
const EnsureCacheTask_1 = require("../workers/timetables/tasks/EnsureCacheTask");
const RefreshGtfsStopsCacheTask_1 = require("../workers/timetables/tasks/RefreshGtfsStopsCacheTask");
const RefreshGtfsTripStopsCacheTask_1 = require("../workers/timetables/tasks/RefreshGtfsTripStopsCacheTask");
const RefreshPrecomputedTablesTask_1 = require("../workers/timetables/tasks/RefreshPrecomputedTablesTask");
const RefreshPublicGtfsDepartureCacheTask_1 = require("../workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask");
const RemapPresetsToGtfsStopsTask_1 = require("../workers/timetables/tasks/RemapPresetsToGtfsStopsTask");
const SaveStaticDataTask_1 = require("../workers/timetables/tasks/SaveStaticDataTask");
const TransformAndSaveDataTask_1 = require("../workers/timetables/tasks/TransformAndSaveDataTask");
const DeparturesDirectionRepository_1 = require("../workers/timetables/tasks/data-access/DeparturesDirectionRepository");
const MetroRailtrackGPSRepository_1 = require("../workers/timetables/tasks/data-access/MetroRailtrackGPSRepository");
const GtfsStopsRedisRepository_1 = require("../workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository");
const PrecomputedTablesFacade_1 = require("../workers/timetables/tasks/helpers/PrecomputedTablesFacade");
const RopidGtfsFactory_1 = require("../workers/timetables/tasks/helpers/RopidGtfsFactory");
const DeparturesDirectionTransformation_1 = require("../workers/timetables/tasks/transformations/DeparturesDirectionTransformation");
const MetroRailtrackDataTransformation_1 = require("../workers/timetables/tasks/transformations/MetroRailtrackDataTransformation");
const RopidGtfsContainerToken_1 = require("./RopidGtfsContainerToken");
//#region Initialization
const RopidGtfsContainer = Di_1.PidContainer.createChildContainer();
exports.RopidGtfsContainer = RopidGtfsContainer;
//#endregion
//#region Datasources
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.BlockStopsRedisRepository, BlockStopsRedisRepository_1.BlockStopsRedisRepository);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.NotPublicVehiclesRedisRepository, NotPublicVehiclesRedisRepository_1.NotPublicVehiclesRedisRepository);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.DeparturesPresetsDataSource, DeparturesPresetsDatasource_1.DeparturesPresetsDataSource);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.StaticDataSourceFactory, StaticDataSourceFactory_1.StaticDataSourceFactory);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.MetroRailTrackDataSourceProvider, MetroRailTrackDataSourceProvider_1.MetroRailTrackDataSourceProvider);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.DeparturesDirectionDataSourceProvider, DeparturesDirectionDataSourceProvider_1.DeparturesDirectionDataSourceProvider);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.NotPublicVehiclesDataSourceProvider, NotPublicVehiclesDataSourceProvider_1.NotPublicVehiclesDataSourceProvider);
//#endregion
//#region Repositories
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.StaticFileRedisRepository, StaticFileRedisRepository_1.StaticFileRedisRepository).registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RopidGtfsRepository, RopidGtfsRepository_1.RopidGtfsRepository);
RopidGtfsContainer.register(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RopidGtfsMetadataRepository, RopidGtfsMetadataRepository_1.RopidGtfsMetadataRepository);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RopidGTFSRoutesRepository, RopidGTFSRoutesRepository_1.RopidGTFSRoutesRepository);
RopidGtfsContainer.register(RopidGtfsContainerToken_1.RopidGtfsContainerToken.DepartureRepository, precomputed_1.DeparturesRepository);
RopidGtfsContainer.register(RopidGtfsContainerToken_1.RopidGtfsContainerToken.PublicGtfsDepartureRepository, PublicGtfsDepartureRepository_1.PublicGtfsDepartureRepository);
RopidGtfsContainer.register(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RopidGTFSStopsModel, RopidGTFSStopsModel_1.RopidGTFSStopsModel);
RopidGtfsContainer.register(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RopidDeparturesPresetsRopidGTFSStopsRepository, RopidDeparturesPresetsRopidGTFSStopsRepository_1.RopidDeparturesPresetsRopidGTFSStopsRepository);
RopidGtfsContainer.register(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RopidDeparturesPresetsRoutesRepository, RopidDeparturesPresetsRoutesRepository_1.RopidDeparturesPresetsRoutesRepository);
RopidGtfsContainer.register(RopidGtfsContainerToken_1.RopidGtfsContainerToken.DeparturesDirectionRepository, DeparturesDirectionRepository_1.DeparturesDirectionRepository);
RopidGtfsContainer.register(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RopidGTFSCisStopsModel, RopidGTFSCisStopsModel_1.RopidGTFSCisStopsModel);
//#endregion
//#region Transformations
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RopidGTFSTransformation, RopidGTFSTransformation_1.RopidGTFSTransformation);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.PublicDepartureCacheTransformation, PublicDepartureCacheTransformation_1.PublicDepartureCacheTransformation);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.MetroRailtrackDataTransformation, MetroRailtrackDataTransformation_1.MetroRailtrackDataTransformation);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.MetroRailtrackGPSRepository, MetroRailtrackGPSRepository_1.MetroRailtrackGPSRepository);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.DeparturesDirectionTransformation, DeparturesDirectionTransformation_1.DeparturesDirectionTransformation);
//#endregion
//#region Facade
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RopidGtfsFacade, RopidGtfsFacade_1.RopidGtfsFacade);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.PrecomputedTablesFacade, PrecomputedTablesFacade_1.PrecomputedTablesFacade)
.register(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RopidGtfsFactory, RopidGtfsFactory_1.RopidGtfsFactory, { lifecycle: tsyringe_1.Lifecycle.Transient })
.registerInstance(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RedisPubSubChannel, new pubsub_1.RedisPubSubChannel(ropid_gtfs_1.RopidGTFS.name));
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.DeparturePresetsFacade, DeparturePresetsFacade_1.DeparturePresetsFacade);
//#endregion
//#region Tasks
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RefreshGtfsStopsCacheTask, RefreshGtfsStopsCacheTask_1.RefreshGtfsStopsCacheTask);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RefreshGtfsTripStopsCacheTask, RefreshGtfsTripStopsCacheTask_1.RefreshGtfsTripStopsCacheTask);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RefreshPublicGtfsDepartureCacheTask, RefreshPublicGtfsDepartureCacheTask_1.RefreshPublicGtfsDepartureCacheTask);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RemapPresetsToGtfsStopsTask, RemapPresetsToGtfsStopsTask_1.RemapPresetsToGtfsStopsTask);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.DownloadDeparturesPresetsTask, DownloadDeparturesPresetsTask_1.DownloadDeparturesPresetsTask);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.CheckForNewDeparturesPresetsTask, CheckForNewDeparturesPresetsTask_1.CheckForNewDeparturesPresetsTask);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.SaveStaticDataTask, SaveStaticDataTask_1.SaveStaticDataTask);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.EnsureCacheTask, EnsureCacheTask_1.EnsureCacheTask);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.DownloadDatasetsTask, DownloadDatasetsTask_1.DownloadDatasetsTask);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.CheckForNewDataTask, CheckForNewDataTask_1.CheckForNewDataTask);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.CheckSavedRowsAndReplaceTablesTask, CheckSavedRowsAndReplaceTablesTask_1.CheckSavedRowsAndReplaceTablesTask);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RefreshPrecomputedTablesTask, RefreshPrecomputedTablesTask_1.RefreshPrecomputedTablesTask);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.TransformAndSaveDataTask, TransformAndSaveDataTask_1.TransformAndSaveDataTask);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.CollectAndSaveLogsTask, CollectAndSaveLogsTask_1.CollectAndSaveLogsTask);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.ProcessAndSendLogsTask, ProcessAndSendLogsTask_1.ProcessAndSendLogsTask);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.SavePresetsDataTask, SavePresetsDataTask_1.SavePresetsDataTask);
//#endregion
//#region Helpers
//#endregion
//#region Cache
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.GtfsStopsRedisRepository, GtfsStopsRedisRepository_1.GtfsStopsRedisRepository);
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.GtfsTripStopsCacheRepository, GtfsTripStopsCacheRepository_1.GtfsTripStopsCacheRepository);
//# sourceMappingURL=Di.js.map