feat(catalog): change extension point to inteface

ignore other than user entity references instead error

Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
This commit is contained in:
Hellgren Heikki
2025-09-09 22:41:45 +03:00
parent 7e7ed57de2
commit 4632b6b4da
8 changed files with 335 additions and 245 deletions
+9 -4
View File
@@ -42,10 +42,15 @@ export interface NotificationProcessor {
export type NotificationProcessorFilters = NotificationProcessorFilters_2;
// @public
export type NotificationRecipientResolver = (
entityRef: string | string[] | null,
excludeEntityRefs: string | string[],
) => Promise<string[]>;
export interface NotificationRecipientResolver {
// (undocumented)
resolveNotificationRecipients(options: {
entityRefs: string[];
excludedEntityRefs?: string[];
}): Promise<{
userEntityRefs: string[];
}>;
}
// @public (undocumented)
export type NotificationRecipients =
+12 -7
View File
@@ -101,17 +101,22 @@ export interface NotificationProcessor {
}
/**
* 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).
* NotificationRecipientResolver interface is used to resolve the individual
* users to receive the notification.
*
* The function should return a list of user entity references that should receive the notification.
* The `resolveNotificationRecipients` is used to resolve notifications sent for
* entity references, and it should return object with a list of user
* entity references that should receive the notification. In case the function
* returns other than user entity references, those are ignored.
*
* @public
*/
export type NotificationRecipientResolver = (
entityRef: string | string[] | null,
excludeEntityRefs: string | string[],
) => Promise<string[]>;
export interface NotificationRecipientResolver {
resolveNotificationRecipients(options: {
entityRefs: string[];
excludedEntityRefs?: string[];
}): Promise<{ userEntityRefs: string[] }>;
}
/**
* @public