@golemio/pid
Version:
Golemio PID Module
78 lines • 8.3 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RopidGtfsContainer = void 0;
const Di_1 = require("../../ioc/Di");
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 RopidGtfsFacade_1 = require("../RopidGtfsFacade");
const RopidGtfsMetadataRepository_1 = require("../RopidGtfsMetadataRepository");
const RopidGtfsRepository_1 = require("../data-access/RopidGtfsRepository");
const BlockStopsRedisRepository_1 = require("../data-access/cache/BlockStopsRedisRepository");
const PublicGtfsDepartureRepository_1 = require("../data-access/cache/PublicGtfsDepartureRepository");
const StaticFileRedisRepository_1 = require("../data-access/cache/StaticFileRedisRepository");
const precomputed_1 = require("../data-access/precomputed");
const DeparturePresetsFacade_1 = require("../facade/DeparturePresetsFacade");
const PublicDepartureCacheTransformation_1 = require("../transformations/PublicDepartureCacheTransformation");
const RopidGTFSTransformation_1 = require("../transformations/RopidGTFSTransformation");
const RefreshPublicGtfsDepartureCacheTask_1 = require("../workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask");
const PrecomputedTablesFacade_1 = require("../workers/timetables/tasks/helpers/PrecomputedTablesFacade");
const RopidGtfsFactory_1 = require("../workers/timetables/tasks/helpers/RopidGtfsFactory");
const RopidGtfsContainerToken_1 = require("./RopidGtfsContainerToken");
const DeparturesPresetsDatasource_1 = require("../workers/presets/data-access/DeparturesPresetsDatasource");
const CheckForNewDeparturesPresetsTask_1 = require("../workers/presets/tasks/CheckForNewDeparturesPresetsTask");
const DownloadDeparturesPresetsTask_1 = require("../workers/presets/tasks/DownloadDeparturesPresetsTask");
const RopidGTFSStopsModel_1 = require("../RopidGTFSStopsModel");
const StaticDataSourceFactory_1 = require("../datasources/StaticDataSourceFactory");
const DeparturesDirectionRepository_1 = require("../workers/timetables/tasks/data-access/DeparturesDirectionRepository");
const MetroRailtrackDataTransformation_1 = require("../workers/timetables/tasks/transformations/MetroRailtrackDataTransformation");
const MetroRailtrackGPSRepository_1 = require("../workers/timetables/tasks/data-access/MetroRailtrackGPSRepository");
const DeparturesDirectionDataSourceProvider_1 = require("../datasources/static-data/DeparturesDirectionDataSourceProvider");
const MetroRailTrackDataSourceProvider_1 = require("../datasources/static-data/MetroRailTrackDataSourceProvider");
const SaveStaticDataTask_1 = require("../workers/timetables/tasks/SaveStaticDataTask");
const DeparturesDirectionTransformation_1 = require("../workers/timetables/tasks/transformations/DeparturesDirectionTransformation");
const RopidDeparturesPresetsRopidGTFSStopsRepository_1 = require("../../jis/repositories/RopidDeparturesPresetsRopidGTFSStopsRepository");
const GtfsStopParser_1 = require("../../../helpers/GtfsStopParser");
//#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.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);
//#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.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.DeparturesDirectionRepository, DeparturesDirectionRepository_1.DeparturesDirectionRepository);
//#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.RefreshPublicGtfsDepartureCacheTask, RefreshPublicGtfsDepartureCacheTask_1.RefreshPublicGtfsDepartureCacheTask);
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);
//#endregion
// #regin Helpers
RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.GtfsStopParser, GtfsStopParser_1.GtfsStopParser);
//# sourceMappingURL=Di.js.map