This commit is contained in:
Alex Holliday committed 2025-07-21 10:34:16 -07:00
1 parent 846564a17e
commit bfa6832beb
83 files changed
+338 -1249

No files matched your search

+1 -6
View File
@@ -15,12 +15,7 @@ class AnnouncementRoutes {
* @desc Create a new announcement
* @access Private (Requires JWT verification)
*/
this.router.post(
"/",
verifyJWT,
isAllowed(["admin", "superadmin"]),
this.announcementController.createAnnouncement
);
this.router.post("/", verifyJWT, isAllowed(["admin", "superadmin"]), this.announcementController.createAnnouncement);
/**
* @route GET /
+5 -25
View File
@@ -15,34 +15,14 @@ class CheckRoutes {
initRoutes() {
this.router.get("/team/summary", this.checkController.getChecksSummaryByTeamId);
this.router.get("/team", this.checkController.getChecksByTeam);
this.router.put(
"/team/ttl",
isAllowed(["admin", "superadmin"]),
this.checkController.updateChecksTTL
);
this.router.delete(
"/team",
isAllowed(["admin", "superadmin"]),
this.checkController.deleteChecksByTeamId
);
this.router.put("/team/ttl", isAllowed(["admin", "superadmin"]), this.checkController.updateChecksTTL);
this.router.delete("/team", isAllowed(["admin", "superadmin"]), this.checkController.deleteChecksByTeamId);
this.router.put(
"/check/:checkId",
verifyTeamAccess(Check, "checkId"),
this.checkController.ackCheck
);
this.router.put("/check/:checkId", verifyTeamAccess(Check, "checkId"), this.checkController.ackCheck);
this.router.get("/:monitorId", this.checkController.getChecksByMonitor);
this.router.post(
"/:monitorId",
verifyOwnership(Monitor, "monitorId"),
this.checkController.createCheck
);
this.router.delete(
"/:monitorId",
verifyOwnership(Monitor, "monitorId"),
this.checkController.deleteChecks
);
this.router.post("/:monitorId", verifyOwnership(Monitor, "monitorId"), this.checkController.createCheck);
this.router.delete("/:monitorId", verifyOwnership(Monitor, "monitorId"), this.checkController.deleteChecks);
this.router.put("/:path/:monitorId?", this.checkController.ackAllChecks);
}
+1 -4
View File
@@ -9,10 +9,7 @@ class DiagnosticRoutes {
initRoutes() {
this.router.post("/db/stats", this.diagnosticController.getDbStats);
this.router.get("/system", this.diagnosticController.getSystemStats);
this.router.get(
"/db/get-monitors-by-team-id/:teamId",
this.diagnosticController.getMonitorsByTeamIdExecutionStats
);
this.router.get("/db/get-monitors-by-team-id/:teamId", this.diagnosticController.getMonitorsByTeamIdExecutionStats);
}
getRouter() {
+1 -6
View File
@@ -12,12 +12,7 @@ class InviteRoutes {
initRoutes() {
this.router.post("/send", this.inviteController.sendInviteEmail);
this.router.post("/verify", this.inviteController.inviteVerifyController);
this.router.post(
"/",
verifyJWT,
isAllowed(["admin", "superadmin"]),
this.inviteController.getInviteToken
);
this.router.post("/", verifyJWT, isAllowed(["admin", "superadmin"]), this.inviteController.getInviteToken);
}
getRouter() {
+3 -15
View File
@@ -13,23 +13,11 @@ class MaintenanceWindowRoutes {
this.router.post("/", this.mwController.createMaintenanceWindows);
this.router.get("/team/", this.mwController.getMaintenanceWindowsByTeamId);
this.router.get(
"/monitor/:monitorId",
verifyOwnership(Monitor, "monitorId"),
this.mwController.getMaintenanceWindowsByMonitorId
);
this.router.get("/monitor/:monitorId", verifyOwnership(Monitor, "monitorId"), this.mwController.getMaintenanceWindowsByMonitorId);
this.router.get("/:id", this.mwController.getMaintenanceWindowById);
this.router.put(
"/:id",
verifyTeamAccess(MaintenanceWindow, "id"),
this.mwController.editMaintenanceWindow
);
this.router.delete(
"/:id",
verifyTeamAccess(MaintenanceWindow, "id"),
this.mwController.deleteMaintenanceWindow
);
this.router.put("/:id", verifyTeamAccess(MaintenanceWindow, "id"), this.mwController.editMaintenanceWindow);
this.router.delete("/:id", verifyTeamAccess(MaintenanceWindow, "id"), this.mwController.deleteMaintenanceWindow);
}
getRouter() {
+2 -10
View File
@@ -20,17 +20,9 @@ class NotificationRoutes {
this.router.get("/team", this.notificationController.getNotificationsByTeamId);
this.router.delete(
"/:id",
verifyOwnership(Notification, "id"),
this.notificationController.deleteNotification
);
this.router.delete("/:id", verifyOwnership(Notification, "id"), this.notificationController.deleteNotification);
this.router.get("/:id", this.notificationController.getNotificationById);
this.router.put(
"/:id",
verifyTeamAccess(Notification, "id"),
this.notificationController.editNotification
);
this.router.put("/:id", verifyTeamAccess(Notification, "id"), this.notificationController.editNotification);
}
getRouter() {
+6 -30
View File
@@ -7,37 +7,13 @@ class QueueRoutes {
this.initRoutes();
}
initRoutes() {
this.router.get(
"/jobs",
isAllowed(["admin", "superadmin"]),
this.queueController.getJobs
);
this.router.post(
"/jobs",
isAllowed(["admin", "superadmin"]),
this.queueController.addJob
);
this.router.get("/jobs", isAllowed(["admin", "superadmin"]), this.queueController.getJobs);
this.router.post("/jobs", isAllowed(["admin", "superadmin"]), this.queueController.addJob);
this.router.get(
"/metrics",
isAllowed(["admin", "superadmin"]),
this.queueController.getMetrics
);
this.router.get(
"/health",
isAllowed(["admin", "superadmin"]),
this.queueController.checkQueueHealth
);
this.router.get(
"/all-metrics",
isAllowed(["admin", "superadmin"]),
this.queueController.getAllMetrics
);
this.router.post(
"/flush",
isAllowed(["admin", "superadmin"]),
this.queueController.flushQueue
);
this.router.get("/metrics", isAllowed(["admin", "superadmin"]), this.queueController.getMetrics);
this.router.get("/health", isAllowed(["admin", "superadmin"]), this.queueController.checkQueueHealth);
this.router.get("/all-metrics", isAllowed(["admin", "superadmin"]), this.queueController.getAllMetrics);
this.router.post("/flush", isAllowed(["admin", "superadmin"]), this.queueController.flushQueue);
}
getRouter() {
+2 -12
View File
@@ -14,18 +14,8 @@ class StatusPageRoutes {
this.router.get("/", this.statusPageController.getStatusPage);
this.router.get("/team", verifyJWT, this.statusPageController.getStatusPagesByTeamId);
this.router.post(
"/",
upload.single("logo"),
verifyJWT,
this.statusPageController.createStatusPage
);
this.router.put(
"/",
upload.single("logo"),
verifyJWT,
this.statusPageController.updateStatusPage
);
this.router.post("/", upload.single("logo"), verifyJWT, this.statusPageController.createStatusPage);
this.router.put("/", upload.single("logo"), verifyJWT, this.statusPageController.updateStatusPage);
this.router.get("/:url", this.statusPageController.getStatusPageByUrl);
this.router.delete("/:url(*)", verifyJWT, this.statusPageController.deleteStatusPage);