2026-06-09 12:34:15 -07:00
|
|
|
import MonitorController from "../api/controllers/monitorController.js";
|
|
|
|
|
import AuthController from "../api/controllers/authController.js";
|
|
|
|
|
import SettingsController from "../api/controllers/settingsController.js";
|
|
|
|
|
import CheckController from "../api/controllers/checkController.js";
|
|
|
|
|
import GeoCheckController from "../api/controllers/geoCheckController.js";
|
|
|
|
|
import InviteController from "../api/controllers/inviteController.js";
|
|
|
|
|
import MaintenanceWindowController from "../api/controllers/maintenanceWindowController.js";
|
|
|
|
|
import QueueController from "../api/controllers/queueController.js";
|
|
|
|
|
import LogController from "../api/controllers/logController.js";
|
|
|
|
|
import StatusPageController from "../api/controllers/statusPageController.js";
|
|
|
|
|
import NotificationController from "../api/controllers/notificationController.js";
|
|
|
|
|
import TagsController from "../api/controllers/tagController.js";
|
|
|
|
|
import DiagnosticController from "../api/controllers/diagnosticController.js";
|
|
|
|
|
import IncidentController from "../api/controllers/incidentController.js";
|
2026-08-20 13:35:11 -07:00
|
|
|
import ProxyController from "@/api/controllers/proxyController.js";
|
2026-06-24 10:30:21 -07:00
|
|
|
import { ApiServices } from "@/config/services.api.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;
|
2026-05-19 11:16:16 -07:00
|
|
|
tagController: TagsController;
|
2026-01-21 11:18:13 -08:00
|
|
|
diagnosticController: DiagnosticController;
|
|
|
|
|
incidentController: IncidentController;
|
2026-08-20 13:35:11 -07:00
|
|
|
proxyController: ProxyController;
|
2026-01-21 11:18:13 -08:00
|
|
|
}
|
2026-06-24 10:30:21 -07:00
|
|
|
export const initializeControllers = (apiServices: ApiServices): InitializedControllers => {
|
2026-01-21 11:18:13 -08:00
|
|
|
return {
|
2026-06-24 10:30:21 -07:00
|
|
|
authController: new AuthController(apiServices.userService),
|
|
|
|
|
monitorController: new MonitorController(apiServices.monitorService, apiServices.notificationsService),
|
2026-09-15 08:42:09 +01:00
|
|
|
settingsController: new SettingsController(
|
|
|
|
|
apiServices.settingsService,
|
|
|
|
|
apiServices.emailService,
|
|
|
|
|
apiServices.proxiesService,
|
|
|
|
|
apiServices.egressStateService
|
|
|
|
|
),
|
2026-06-24 10:30:21 -07:00
|
|
|
checkController: new CheckController(apiServices.checkService),
|
|
|
|
|
geoCheckController: new GeoCheckController(apiServices.geoChecksService),
|
|
|
|
|
inviteController: new InviteController(apiServices.inviteService),
|
|
|
|
|
maintenanceWindowController: new MaintenanceWindowController(apiServices.maintenanceWindowService),
|
|
|
|
|
queueController: new QueueController(apiServices.worker),
|
|
|
|
|
logController: new LogController(apiServices.logger),
|
2026-07-07 09:47:29 -07:00
|
|
|
statusPageController: new StatusPageController(apiServices.statusPageService),
|
2026-06-24 10:30:21 -07:00
|
|
|
notificationController: new NotificationController(apiServices.notificationsService, apiServices.monitorsRepository),
|
|
|
|
|
tagController: new TagsController(apiServices.tagsService),
|
|
|
|
|
diagnosticController: new DiagnosticController(apiServices.diagnosticService),
|
|
|
|
|
incidentController: new IncidentController(apiServices.incidentService),
|
2026-08-20 13:35:11 -07:00
|
|
|
proxyController: new ProxyController(apiServices.proxiesService),
|
2026-01-21 11:18:13 -08:00
|
|
|
};
|
2026-01-12 19:32:23 +00:00
|
|
|
};
|