feat(notifications): extension point to modify user resolving
this change adds a new extension point method that can be used to pass a custom function that can modify how individual user entity references are resolved inside the notifications backend. Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
This commit is contained in:
@@ -100,6 +100,19 @@ export interface NotificationProcessor {
|
||||
getNotificationFilters?(): NotificationProcessorFilters;
|
||||
}
|
||||
|
||||
/**
|
||||
* NotificationRecipientResolver is a function that resolves the individual users to receive the notification
|
||||
* based on the entity reference(s) and the excluded entity reference(s).
|
||||
*
|
||||
* The function should return a list of user entity references that should receive the notification.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type NotificationRecipientResolver = (
|
||||
entityRef: string | string[] | null,
|
||||
excludeEntityRefs: string | string[],
|
||||
) => Promise<string[]>;
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
@@ -107,6 +120,9 @@ export interface NotificationsProcessingExtensionPoint {
|
||||
addProcessor(
|
||||
...processors: Array<NotificationProcessor | Array<NotificationProcessor>>
|
||||
): void;
|
||||
setNotificationRecipientResolver(
|
||||
resolver: NotificationRecipientResolver,
|
||||
): void;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user