diff --git a/server/src/service/infrastructure/notificationProviders/slack.ts b/server/src/service/infrastructure/notificationProviders/slack.ts index a4cf0ed26..e13362669 100644 --- a/server/src/service/infrastructure/notificationProviders/slack.ts +++ b/server/src/service/infrastructure/notificationProviders/slack.ts @@ -1,15 +1,15 @@ const SERVICE_NAME = "SlackProvider"; -import type { Monitor, Notification, MonitorStatusResponse } from "@/types/index.js"; +import type { Notification } from "@/types/index.js"; import { INotificationProvider } from "@/service/index.js"; -import type { MonitorActionDecision } from "@/service/infrastructure/SuperSimpleQueue/SuperSimpleQueueHelper.js"; import type { NotificationMessage } from "@/types/notificationMessage.js"; import { getTestMessage } from "@/service/infrastructure/notificationProviders/utils.js"; import got, { HTTPError } from "got"; +import { ILogger } from "@/utils/logger.js"; export class SlackProvider implements INotificationProvider { - private logger: any; + private logger: ILogger; - constructor(logger: any) { + constructor(logger: ILogger) { this.logger = logger; } @@ -78,7 +78,7 @@ export class SlackProvider implements INotificationProvider { * Uses Slack's rich formatting with sections, fields, and context blocks */ private buildSlackPayload(message: NotificationMessage): object { - const blocks: any[] = []; + const blocks: unknown[] = []; // Determine color based on severity const colorMap = { diff --git a/server/src/service/infrastructure/notificationProviders/utils.ts b/server/src/service/infrastructure/notificationProviders/utils.ts index 874152413..8d4e08171 100644 --- a/server/src/service/infrastructure/notificationProviders/utils.ts +++ b/server/src/service/infrastructure/notificationProviders/utils.ts @@ -1,6 +1,6 @@ -import { Monitor, HardwareStatusPayload, MonitorStatusResponse } from "@/types/index.js"; +import EmailService from "@/service/infrastructure/emailService.js"; // Test notification helpers - used by all providers for test alerts -export const buildTestEmail = async (emailService: any) => { +export const buildTestEmail = async (emailService: EmailService) => { const context = { testName: "Monitoring System" }; const html = await emailService.buildEmail("testEmailTemplate", context); return html; diff --git a/server/src/service/infrastructure/notificationProviders/webhook.ts b/server/src/service/infrastructure/notificationProviders/webhook.ts index 532714827..6a00f3f1e 100644 --- a/server/src/service/infrastructure/notificationProviders/webhook.ts +++ b/server/src/service/infrastructure/notificationProviders/webhook.ts @@ -1,15 +1,15 @@ const SERVICE_NAME = "WebhookProvider"; -import type { Monitor, Alert, Notification, MonitorStatusResponse } from "@/types/index.js"; +import type { Notification } from "@/types/index.js"; import { INotificationProvider } from "@/service/index.js"; -import type { MonitorActionDecision } from "@/service/infrastructure/SuperSimpleQueue/SuperSimpleQueueHelper.js"; import type { NotificationMessage } from "@/types/notificationMessage.js"; import { getTestMessage } from "@/service/infrastructure/notificationProviders/utils.js"; import got from "got"; +import { ILogger } from "@/utils/logger.js"; export class WebhookProvider implements INotificationProvider { - private logger: any; + private logger: ILogger; - constructor(logger: any) { + constructor(logger: ILogger) { this.logger = logger; } @@ -46,10 +46,6 @@ export class WebhookProvider implements INotificationProvider { } }; - /** - * Build webhook payload from NotificationMessage - * Format: { text: string, severity: string, monitor: object, details: object } - */ private buildWebhookPayload(message: NotificationMessage): object { const lines: string[] = []; diff --git a/server/src/service/infrastructure/notificationsService.ts b/server/src/service/infrastructure/notificationsService.ts index 4331c5ff0..1da308678 100644 --- a/server/src/service/infrastructure/notificationsService.ts +++ b/server/src/service/infrastructure/notificationsService.ts @@ -1,4 +1,4 @@ -import type { HardwareStatusPayload, Monitor, MonitorStatusResponse, Notification, MonitorStatus } from "@/types/index.js"; +import type { Monitor, MonitorStatusResponse, Notification } from "@/types/index.js"; import type { NotificationMessage } from "@/types/notificationMessage.js"; import { IMonitorsRepository, INotificationsRepository } from "@/repositories/index.js"; import { INotificationProvider } from "./notificationProviders/INotificationProvider.js";