From e99487eed94adc837258f00e7dbf7519a333f041 Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Sun, 23 Nov 2025 21:08:07 +0100 Subject: [PATCH] fix(notifications): multiple providers using the wrong params --- app/client/api-client/types.gen.ts | 40 ++++++++++++--- .../components/create-notification-form.tsx | 50 +++++++++++++++++-- app/schemas/notifications.ts | 2 + .../modules/notifications/builders/discord.ts | 5 +- .../modules/notifications/builders/gotify.ts | 3 +- .../modules/notifications/builders/slack.ts | 2 +- .../notifications/notifications.service.ts | 4 +- 7 files changed, 90 insertions(+), 16 deletions(-) diff --git a/app/client/api-client/types.gen.ts b/app/client/api-client/types.gen.ts index ffb49f5..8a983f9 100644 --- a/app/client/api-client/types.gen.ts +++ b/app/client/api-client/types.gen.ts @@ -1859,13 +1859,15 @@ export type GetScheduleNotificationsResponses = { priority: 'default' | 'high' | 'low' | 'max' | 'min'; topic: string; type: 'ntfy'; + password?: string; serverUrl?: string; - token?: string; + username?: string; } | { priority: number; serverUrl: string; token: string; type: 'gotify'; + path?: string; } | { shoutrrrUrl: string; type: 'custom'; @@ -1873,6 +1875,7 @@ export type GetScheduleNotificationsResponses = { type: 'discord'; webhookUrl: string; avatarUrl?: string; + threadId?: string; username?: string; } | { type: 'slack'; @@ -1940,13 +1943,15 @@ export type UpdateScheduleNotificationsResponses = { priority: 'default' | 'high' | 'low' | 'max' | 'min'; topic: string; type: 'ntfy'; + password?: string; serverUrl?: string; - token?: string; + username?: string; } | { priority: number; serverUrl: string; token: string; type: 'gotify'; + path?: string; } | { shoutrrrUrl: string; type: 'custom'; @@ -1954,6 +1959,7 @@ export type UpdateScheduleNotificationsResponses = { type: 'discord'; webhookUrl: string; avatarUrl?: string; + threadId?: string; username?: string; } | { type: 'slack'; @@ -2010,13 +2016,15 @@ export type ListNotificationDestinationsResponses = { priority: 'default' | 'high' | 'low' | 'max' | 'min'; topic: string; type: 'ntfy'; + password?: string; serverUrl?: string; - token?: string; + username?: string; } | { priority: number; serverUrl: string; token: string; type: 'gotify'; + path?: string; } | { shoutrrrUrl: string; type: 'custom'; @@ -2024,6 +2032,7 @@ export type ListNotificationDestinationsResponses = { type: 'discord'; webhookUrl: string; avatarUrl?: string; + threadId?: string; username?: string; } | { type: 'slack'; @@ -2064,13 +2073,15 @@ export type CreateNotificationDestinationData = { priority: 'default' | 'high' | 'low' | 'max' | 'min'; topic: string; type: 'ntfy'; + password?: string; serverUrl?: string; - token?: string; + username?: string; } | { priority: number; serverUrl: string; token: string; type: 'gotify'; + path?: string; } | { shoutrrrUrl: string; type: 'custom'; @@ -2078,6 +2089,7 @@ export type CreateNotificationDestinationData = { type: 'discord'; webhookUrl: string; avatarUrl?: string; + threadId?: string; username?: string; } | { type: 'slack'; @@ -2117,13 +2129,15 @@ export type CreateNotificationDestinationResponses = { priority: 'default' | 'high' | 'low' | 'max' | 'min'; topic: string; type: 'ntfy'; + password?: string; serverUrl?: string; - token?: string; + username?: string; } | { priority: number; serverUrl: string; token: string; type: 'gotify'; + path?: string; } | { shoutrrrUrl: string; type: 'custom'; @@ -2131,6 +2145,7 @@ export type CreateNotificationDestinationResponses = { type: 'discord'; webhookUrl: string; avatarUrl?: string; + threadId?: string; username?: string; } | { type: 'slack'; @@ -2217,13 +2232,15 @@ export type GetNotificationDestinationResponses = { priority: 'default' | 'high' | 'low' | 'max' | 'min'; topic: string; type: 'ntfy'; + password?: string; serverUrl?: string; - token?: string; + username?: string; } | { priority: number; serverUrl: string; token: string; type: 'gotify'; + path?: string; } | { shoutrrrUrl: string; type: 'custom'; @@ -2231,6 +2248,7 @@ export type GetNotificationDestinationResponses = { type: 'discord'; webhookUrl: string; avatarUrl?: string; + threadId?: string; username?: string; } | { type: 'slack'; @@ -2271,13 +2289,15 @@ export type UpdateNotificationDestinationData = { priority: 'default' | 'high' | 'low' | 'max' | 'min'; topic: string; type: 'ntfy'; + password?: string; serverUrl?: string; - token?: string; + username?: string; } | { priority: number; serverUrl: string; token: string; type: 'gotify'; + path?: string; } | { shoutrrrUrl: string; type: 'custom'; @@ -2285,6 +2305,7 @@ export type UpdateNotificationDestinationData = { type: 'discord'; webhookUrl: string; avatarUrl?: string; + threadId?: string; username?: string; } | { type: 'slack'; @@ -2334,13 +2355,15 @@ export type UpdateNotificationDestinationResponses = { priority: 'default' | 'high' | 'low' | 'max' | 'min'; topic: string; type: 'ntfy'; + password?: string; serverUrl?: string; - token?: string; + username?: string; } | { priority: number; serverUrl: string; token: string; type: 'gotify'; + path?: string; } | { shoutrrrUrl: string; type: 'custom'; @@ -2348,6 +2371,7 @@ export type UpdateNotificationDestinationResponses = { type: 'discord'; webhookUrl: string; avatarUrl?: string; + threadId?: string; username?: string; } | { type: 'slack'; diff --git a/app/client/modules/notifications/components/create-notification-form.tsx b/app/client/modules/notifications/components/create-notification-form.tsx index 7d3c562..7f97e59 100644 --- a/app/client/modules/notifications/components/create-notification-form.tsx +++ b/app/client/modules/notifications/components/create-notification-form.tsx @@ -370,6 +370,22 @@ export const CreateNotificationForm = ({ onSubmit, mode = "create", initialValue )} /> + ( + + Thread ID (Optional) + + + + + ID of the thread to post messages in. Leave empty to post in the main channel. + + + + )} + /> )} @@ -423,6 +439,20 @@ export const CreateNotificationForm = ({ onSubmit, mode = "create", initialValue )} /> + ( + + Path (Optional) + + + + Custom path on the Gotify server, if applicable. + + + )} + /> )} @@ -458,14 +488,28 @@ export const CreateNotificationForm = ({ onSubmit, mode = "create", initialValue /> ( - Access Token (Optional) + Username (Optional) + + + + Username for server authentication, if required. + + + )} + /> + ( + + Password (Optional) - Required if the topic is protected. + Password for server authentication, if required. )} diff --git a/app/schemas/notifications.ts b/app/schemas/notifications.ts index f85f3c4..09a4d98 100644 --- a/app/schemas/notifications.ts +++ b/app/schemas/notifications.ts @@ -36,12 +36,14 @@ export const discordNotificationConfigSchema = type({ webhookUrl: "string", username: "string?", avatarUrl: "string?", + threadId: "string?", }); export const gotifyNotificationConfigSchema = type({ type: "'gotify'", serverUrl: "string", token: "string", + path: "string?", priority: "0 <= number <= 10", }); diff --git a/app/server/modules/notifications/builders/discord.ts b/app/server/modules/notifications/builders/discord.ts index 96c1520..5da0b49 100644 --- a/app/server/modules/notifications/builders/discord.ts +++ b/app/server/modules/notifications/builders/discord.ts @@ -17,7 +17,10 @@ export function buildDiscordShoutrrrUrl(config: Extract