feat: integrate notifications with signals
Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { DefaultNotificationService } from './service';
|
||||
import { NotificationService } from './service/NotificationService';
|
||||
import { signalService } from '@backstage/plugin-signals-node';
|
||||
|
||||
/** @public */
|
||||
export const notificationService = createServiceRef<NotificationService>({
|
||||
@@ -32,13 +33,14 @@ export const notificationService = createServiceRef<NotificationService>({
|
||||
logger: coreServices.logger,
|
||||
discovery: coreServices.discovery,
|
||||
tokenManager: coreServices.tokenManager,
|
||||
// TODO: Signals
|
||||
signals: signalService,
|
||||
},
|
||||
factory({ logger, discovery, tokenManager }) {
|
||||
factory({ logger, discovery, tokenManager, signals }) {
|
||||
return DefaultNotificationService.create({
|
||||
logger,
|
||||
discovery,
|
||||
tokenManager,
|
||||
signalService: signals,
|
||||
});
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -14,18 +14,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Notification } from '@backstage/plugin-notifications-common';
|
||||
import {
|
||||
PluginEndpointDiscovery,
|
||||
TokenManager,
|
||||
} from '@backstage/backend-common';
|
||||
import { TokenManager } from '@backstage/backend-common';
|
||||
import { NotificationService } from './NotificationService';
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import { DiscoveryService, LoggerService } from '@backstage/backend-plugin-api';
|
||||
import { SignalService } from '@backstage/plugin-signals-node';
|
||||
|
||||
/** @public */
|
||||
export type NotificationServiceOptions = {
|
||||
logger: LoggerService;
|
||||
discovery: PluginEndpointDiscovery;
|
||||
discovery: DiscoveryService;
|
||||
tokenManager: TokenManager;
|
||||
signalService: SignalService;
|
||||
};
|
||||
|
||||
/** @public */
|
||||
@@ -40,7 +39,7 @@ export type NotificationSendOptions = {
|
||||
export class DefaultNotificationService implements NotificationService {
|
||||
private constructor(
|
||||
private readonly logger: LoggerService,
|
||||
private readonly discovery: PluginEndpointDiscovery,
|
||||
private readonly discovery: DiscoveryService,
|
||||
private readonly tokenManager: TokenManager,
|
||||
) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user