Files
Checkmate/server/src/config/controllers.ts
T

47 lines
2.6 KiB
TypeScript
Raw Normal View History

2026-01-12 19:32:23 +00:00
import MonitorController from "../controllers/monitorController.js";
import AuthController from "../controllers/authController.js";
import SettingsController from "../controllers/settingsController.js";
import CheckController from "../controllers/checkController.js";
2026-02-24 23:20:36 +00:00
import GeoCheckController from "../controllers/geoCheckController.js";
2026-01-12 19:32:23 +00:00
import InviteController from "../controllers/inviteController.js";
import MaintenanceWindowController from "../controllers/maintenanceWindowController.js";
import QueueController from "../controllers/queueController.js";
import LogController from "../controllers/logController.js";
import StatusPageController from "../controllers/statusPageController.js";
import NotificationController from "../controllers/notificationController.js";
import DiagnosticController from "../controllers/diagnosticController.js";
import IncidentController from "../controllers/incidentController.js";
2026-01-21 11:18:13 -08:00
import type { InitializedServices } from "@/config/services.js";
2026-01-12 19:32:23 +00:00
2026-01-21 11:18:13 -08:00
export interface InitializedControllers {
authController: AuthController;
monitorController: MonitorController;
settingsController: SettingsController;
checkController: CheckController;
2026-02-24 23:20:36 +00:00
geoCheckController: GeoCheckController;
2026-01-21 11:18:13 -08:00
inviteController: InviteController;
maintenanceWindowController: MaintenanceWindowController;
queueController: QueueController;
logController: LogController;
statusPageController: StatusPageController;
notificationController: NotificationController;
diagnosticController: DiagnosticController;
incidentController: IncidentController;
}
export const initializeControllers = (services: InitializedServices): InitializedControllers => {
return {
authController: new AuthController(services.userService),
monitorController: new MonitorController(services.monitorService),
2026-02-12 22:37:40 +00:00
settingsController: new SettingsController(services.settingsService, services.emailService),
2026-01-21 11:18:13 -08:00
checkController: new CheckController(services.checkService),
2026-02-24 23:20:36 +00:00
geoCheckController: new GeoCheckController(services.geoChecksService),
2026-01-21 11:18:13 -08:00
inviteController: new InviteController(services.inviteService),
maintenanceWindowController: new MaintenanceWindowController(services.maintenanceWindowService),
queueController: new QueueController(services.jobQueue),
logController: new LogController(services.logger),
2026-01-22 20:57:20 +00:00
statusPageController: new StatusPageController(services.statusPageService, services.monitorsRepository, services.settingsService),
2026-01-21 13:55:22 -08:00
notificationController: new NotificationController(services.notificationsService, services.monitorsRepository),
2026-01-21 11:18:13 -08:00
diagnosticController: new DiagnosticController(services.diagnosticService),
incidentController: new IncidentController(services.incidentService),
};
2026-01-12 19:32:23 +00:00
};