feat: allow broadcast notifications

Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
Heikki Hellgren
2024-01-25 10:12:31 +02:00
parent 6a79f9f1ee
commit a3d42153d1
6 changed files with 45 additions and 13 deletions
@@ -27,9 +27,14 @@ export type NotificationServiceOptions = {
signalService: SignalService;
};
/** @public */
export type NotificationReceivers =
| { type: 'entity'; entityRef: string | string[] }
| { type: 'broadcast' };
/** @public */
export type NotificationSendOptions = {
entityRef: string | string[];
receivers: NotificationReceivers;
title: string;
description: string;
link: string;
@@ -18,6 +18,6 @@ import { NotificationSendOptions } from './DefaultNotificationService';
import { Notification } from '@backstage/plugin-notifications-common';
/** @public */
export type NotificationService = {
export interface NotificationService {
send(options: NotificationSendOptions): Promise<Notification[]>;
};
}