Skip to main content

Interface: INotificationClient

notification.types.INotificationClient

Methods

deleteNotifications

deleteNotifications(notifications): Promise<void>

Tells the service to perform the delete actions on the notification(s)

throws Error If no error is thrown the service has received the notifications successfully

Parameters

NameTypeDescription
notificationsINotification[]Array of notifications

Returns

Promise<void>


fetchHistory

fetchHistory(options?, filter?): Promise<INotification[]>

Used by UI components that need to display a list of historical notifications.

throws Error

Parameters

NameTypeDescription
options?string | INotificationHistoryOptionsISO8601 formatted string to fetch notifications from.
filter?IFilterto match to notifications.

Returns

Promise<INotification[]>

array of notifications.


getLastIssuedAt

getLastIssuedAt(source?): Promise<string>

Return an ISO8601 formatted date a notification matching the specified source was issued.

throws Error

Parameters

NameTypeDescription
source?stringidentify which notification to save lastUpdated time for.

Returns

Promise<string>

last issued at date string in the ISO8601 date format.


getMuteFilters

getMuteFilters(): Promise<IMuteFilter[]>

Gets the current mute filters for Notification sources in Finsemble.

Returns

Promise<IMuteFilter[]>

an arrray with all the mute filters.


getPreferences

getPreferences(): Promise<Object>

Gets the current notifications preferences object. It tries to load the configs saved in the user preferences and will fallback to config/schema defaults if none are present.

Returns

Promise<Object>

The notification preferences object.


getSources

getSources(): Promise<string[]>

Gets the available notification sources in Finsemble.

Returns

Promise<string[]>

A string array with all the configured sources in Finsemble.


mute

mute(filter): Promise<void>

Sets the user preference on which notifications to mute. All future notifications that match the filter will have the mute flag set to true

throws Error If no error is thrown the service has performed the mute successfully.

Parameters

NameTypeDescription
filterIMuteFilter | IMuteFilter[]Notifications to apply action to.

Returns

Promise<void>


notify

notify(notifications): Promise<void>

Creates or updates notifications in Finsemble.

throws Error If no error is thrown the service has received the notifications successfully

Parameters

NameTypeDescription
notificationsINotification | INotification[]Array of INotification

Returns

Promise<void>


performAction

performAction(notifications, action): Promise<void>

Tells the service to perform the action on the notification(s)

throws Error If no error is thrown the service has received the request to perform the action successfully. Note a successful resolution of the promise does not mean successful completion of the action.

Parameters

NameTypeDescription
notificationsINotification[]Notifications to apply action to.
actionIActionwhich has been triggered by user.

Returns

Promise<void>


subscribe

subscribe(subscription, onSubscriptionSuccess, onSubscriptionFault): Promise<string>

Subscribe to a notification stream given a set of name/value pair filters. Returns subscriptionId

throws Error

Parameters

NameTypeDescription
subscriptionISubscriptionwith name value pair used to match on.
onSubscriptionSuccessFunctioncalled when subscription is successfully created.
onSubscriptionFaultFunctionif there is an error creating the subscription.

Returns

Promise<string>


unmute

unmute(filter): Promise<void>

Sets the filter preference on which muted notifications to unmute. All future notifications that match the filter will have the mute flag set to false

throws Error If no error is thrown the service has performed the unmute successfully.

Parameters

NameTypeDescription
filterIMuteFilter | IMuteFilter[]Notifications to apply action to.

Returns

Promise<void>


unsubscribe

unsubscribe(subscriptionId): Promise<void>

Used to unsubscribe to a notification stream.

throws Error

Parameters

NameTypeDescription
subscriptionIdstringwhich was returned when subscription was created.

Returns

Promise<void>