From b17383c34dd63dc19d2137decb606a79f24dc7af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Edeg=C3=A5rd?= Date: Wed, 5 Nov 2025 07:03:36 +0000 Subject: [PATCH] Add comments for clarity in notification configuration types. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Henrik EdegÄrd --- plugins/notifications-backend/config.d.ts | 15 ++++++++++++++ plugins/notifications-common/src/types.ts | 24 +++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/plugins/notifications-backend/config.d.ts b/plugins/notifications-backend/config.d.ts index d03baaec94..90a2053824 100644 --- a/plugins/notifications-backend/config.d.ts +++ b/plugins/notifications-backend/config.d.ts @@ -33,6 +33,9 @@ export interface Config { */ defaultSettings?: { channels?: { + /** + * Channel identifier (e.g., 'Web', 'Email') + */ id: string; /** * Optional flag to enable/disable the channel by default. @@ -42,10 +45,22 @@ export interface Config { */ enabled?: boolean; origins?: { + /** + * Origin identifier (e.g., 'plugin:catalog', 'external:jenkins') + */ id: string; + /** + * Whether notifications from this origin are enabled by default + */ enabled: boolean; topics?: { + /** + * Topic identifier (e.g., 'entity-refresh', 'build-failure') + */ id: string; + /** + * Whether notifications for this topic are enabled by default + */ enabled: boolean; }[]; }[]; diff --git a/plugins/notifications-common/src/types.ts b/plugins/notifications-common/src/types.ts index 0653007637..41b335a4c2 100644 --- a/plugins/notifications-common/src/types.ts +++ b/plugins/notifications-common/src/types.ts @@ -136,7 +136,13 @@ export type NotificationProcessorFilters = { * @public */ export type TopicSetting = { + /** + * Topic identifier + */ id: string; + /** + * Whether notifications for this topic are enabled + */ enabled: boolean; }; @@ -144,8 +150,17 @@ export type TopicSetting = { * @public */ export type OriginSetting = { + /** + * Origin identifier + */ id: string; + /** + * Whether notifications from this origin are enabled + */ enabled: boolean; + /** + * Optional array of topic-specific settings + */ topics?: TopicSetting[]; }; @@ -153,6 +168,9 @@ export type OriginSetting = { * @public */ export type ChannelSetting = { + /** + * Channel identifier + */ id: string; /** * Optional flag to enable/disable the channel by default. @@ -160,6 +178,9 @@ export type ChannelSetting = { * When set to false, the channel uses an opt-in strategy. */ enabled?: boolean; + /** + * Array of origin settings for this channel + */ origins: OriginSetting[]; }; @@ -167,5 +188,8 @@ export type ChannelSetting = { * @public */ export type NotificationSettings = { + /** + * Array of channel settings + */ channels: ChannelSetting[]; };