From 15d8a8ba1fd0dc695e298b2c32c539a0505fac01 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 11 Mar 2026 13:40:35 -0700 Subject: [PATCH] fix test alert type --- .../notificationProviders/INotificationProvider.ts | 2 +- .../src/service/infrastructure/notificationProviders/discord.ts | 2 +- .../src/service/infrastructure/notificationProviders/email.ts | 2 +- .../src/service/infrastructure/notificationProviders/matrix.ts | 2 +- .../service/infrastructure/notificationProviders/pagerduty.ts | 2 +- .../src/service/infrastructure/notificationProviders/slack.ts | 2 +- .../src/service/infrastructure/notificationProviders/teams.ts | 2 +- .../src/service/infrastructure/notificationProviders/webhook.ts | 2 +- server/src/service/infrastructure/notificationsService.ts | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/server/src/service/infrastructure/notificationProviders/INotificationProvider.ts b/server/src/service/infrastructure/notificationProviders/INotificationProvider.ts index 87056ef7a..2743dfab9 100644 --- a/server/src/service/infrastructure/notificationProviders/INotificationProvider.ts +++ b/server/src/service/infrastructure/notificationProviders/INotificationProvider.ts @@ -3,5 +3,5 @@ import type { NotificationMessage } from "@/types/notificationMessage.js"; export interface INotificationProvider { sendMessage: (notification: Notification, message: NotificationMessage) => Promise; - sendTestAlert(notification: Notification): Promise; + sendTestAlert(notification: Partial): Promise; } diff --git a/server/src/service/infrastructure/notificationProviders/discord.ts b/server/src/service/infrastructure/notificationProviders/discord.ts index e630e4e86..3bd2556ae 100644 --- a/server/src/service/infrastructure/notificationProviders/discord.ts +++ b/server/src/service/infrastructure/notificationProviders/discord.ts @@ -13,7 +13,7 @@ export class DiscordProvider implements INotificationProvider { this.logger = logger; } - sendTestAlert = async (notification: Notification) => { + sendTestAlert = async (notification: Partial) => { if (!notification.address) { return false; } diff --git a/server/src/service/infrastructure/notificationProviders/email.ts b/server/src/service/infrastructure/notificationProviders/email.ts index c14d59a85..7b61b1617 100644 --- a/server/src/service/infrastructure/notificationProviders/email.ts +++ b/server/src/service/infrastructure/notificationProviders/email.ts @@ -14,7 +14,7 @@ export class EmailProvider implements INotificationProvider { this.logger = logger; } - async sendTestAlert(notification: Notification): Promise { + async sendTestAlert(notification: Partial): Promise { const subject = "Test notification"; const html = await buildTestEmail(this.emailService); diff --git a/server/src/service/infrastructure/notificationProviders/matrix.ts b/server/src/service/infrastructure/notificationProviders/matrix.ts index ce53215bd..f14ea4d17 100644 --- a/server/src/service/infrastructure/notificationProviders/matrix.ts +++ b/server/src/service/infrastructure/notificationProviders/matrix.ts @@ -13,7 +13,7 @@ export class MatrixProvider implements INotificationProvider { this.logger = logger; } - sendTestAlert = async (notification: Notification) => { + sendTestAlert = async (notification: Partial) => { const { homeserverUrl, accessToken, roomId } = notification; if (!homeserverUrl || !accessToken || !roomId) { return false; diff --git a/server/src/service/infrastructure/notificationProviders/pagerduty.ts b/server/src/service/infrastructure/notificationProviders/pagerduty.ts index b15717878..304c38cf4 100644 --- a/server/src/service/infrastructure/notificationProviders/pagerduty.ts +++ b/server/src/service/infrastructure/notificationProviders/pagerduty.ts @@ -14,7 +14,7 @@ export class PagerDutyProvider implements INotificationProvider { this.logger = logger; } - async sendTestAlert(notification: Notification): Promise { + async sendTestAlert(notification: Partial): Promise { try { await got.post("https://events.pagerduty.com/v2/enqueue", { json: { diff --git a/server/src/service/infrastructure/notificationProviders/slack.ts b/server/src/service/infrastructure/notificationProviders/slack.ts index e13362669..cfb135901 100644 --- a/server/src/service/infrastructure/notificationProviders/slack.ts +++ b/server/src/service/infrastructure/notificationProviders/slack.ts @@ -13,7 +13,7 @@ export class SlackProvider implements INotificationProvider { this.logger = logger; } - async sendTestAlert(notification: Notification): Promise { + async sendTestAlert(notification: Partial): Promise { if (!notification.address) { return false; } diff --git a/server/src/service/infrastructure/notificationProviders/teams.ts b/server/src/service/infrastructure/notificationProviders/teams.ts index 2a4476807..dcf48c4cd 100644 --- a/server/src/service/infrastructure/notificationProviders/teams.ts +++ b/server/src/service/infrastructure/notificationProviders/teams.ts @@ -65,7 +65,7 @@ export class TeamsProvider implements INotificationProvider { this.logger = logger; } - async sendTestAlert(notification: Notification): Promise { + async sendTestAlert(notification: Partial): Promise { if (!notification.address) { return false; } diff --git a/server/src/service/infrastructure/notificationProviders/webhook.ts b/server/src/service/infrastructure/notificationProviders/webhook.ts index 6a00f3f1e..fcb5728d4 100644 --- a/server/src/service/infrastructure/notificationProviders/webhook.ts +++ b/server/src/service/infrastructure/notificationProviders/webhook.ts @@ -98,7 +98,7 @@ export class WebhookProvider implements INotificationProvider { }; } - sendTestAlert = async (notification: Notification) => { + sendTestAlert = async (notification: Partial) => { if (!notification.address) { return false; } diff --git a/server/src/service/infrastructure/notificationsService.ts b/server/src/service/infrastructure/notificationsService.ts index ffd12e86a..c75477c88 100644 --- a/server/src/service/infrastructure/notificationsService.ts +++ b/server/src/service/infrastructure/notificationsService.ts @@ -141,7 +141,7 @@ export class NotificationsService implements INotificationsService { return await this.sendNotifications(monitor, monitorStatusResponse, decision); }; - sendTestNotification = async (notification: Notification) => { + sendTestNotification = async (notification: Partial) => { switch (notification.type) { case "email": return await this.emailProvider.sendTestAlert(notification);