@novu/js 3.7.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,15 @@
1
- export { E as EventHandler, a as Events, F as FiltersCountResponse, L as ListNotificationsResponse, b as Notification, N as Novu, P as Preference, S as SocketEventNames } from './novu-DiZKRUW5.mjs';
1
+ import { N as Notification } from './novu-CimEIa5g.mjs';
2
+ export { E as EventHandler, a as Events, F as FiltersCountResponse, L as ListNotificationsResponse, b as Novu, P as Preference, S as SocketEventNames } from './novu-CimEIa5g.mjs';
2
3
  import { N as NotificationFilter } from './types-Y8PRbRbj.mjs';
3
4
  export { C as ChannelPreference, a as ChannelType, I as InboxNotification, b as NotificationStatus, c as NovuError, d as NovuOptions, P as PreferenceLevel, e as PreferencesResponse, S as StandardNovuOptions, f as Subscriber, W as WebSocketEvent } from './types-Y8PRbRbj.mjs';
4
5
 
5
6
  declare const areTagsEqual: (tags1?: string[], tags2?: string[]) => boolean;
6
7
  declare const isSameFilter: (filter1: NotificationFilter, filter2: NotificationFilter) => boolean;
8
+ declare function checkNotificationDataFilter(notificationData: Notification['data'], filterData: NotificationFilter['data']): boolean;
9
+ /**
10
+ * Complete notification filter check combining all criteria.
11
+ * This is the main function that should be used by both React and SolidJS implementations.
12
+ */
13
+ declare function checkNotificationMatchesFilter(notification: Notification, filter: NotificationFilter): boolean;
7
14
 
8
- export { NotificationFilter, areTagsEqual, isSameFilter };
15
+ export { Notification, NotificationFilter, areTagsEqual, checkNotificationDataFilter, checkNotificationMatchesFilter, isSameFilter };
@@ -1,3 +1,3 @@
1
- export { ChannelType, NotificationStatus, Novu, PreferenceLevel, WebSocketEvent, areTagsEqual, isSameFilter } from './chunk-AIY4HF7H.mjs';
2
- import './chunk-KYYDDVBR.mjs';
1
+ export { ChannelType, NotificationStatus, Novu, PreferenceLevel, WebSocketEvent, areTagsEqual, checkNotificationDataFilter, checkNotificationMatchesFilter, isSameFilter } from './chunk-EIKKISYN.mjs';
2
+ import './chunk-QOD7NZ77.mjs';
3
3
  import './chunk-STZMOEWR.mjs';
@@ -1,14 +1,14 @@
1
1
  import { f as Subscriber } from '../types-Y8PRbRbj.mjs';
2
2
 
3
+ declare function buildSubscriber({ subscriberId, subscriber, }: {
4
+ subscriberId: string | undefined;
5
+ subscriber: Subscriber | string | undefined;
6
+ }): Subscriber;
7
+
3
8
  interface Token {
4
9
  type: 'bold' | 'text';
5
10
  content: string;
6
11
  }
7
12
  declare const parseMarkdownIntoTokens: (text: string) => Token[];
8
13
 
9
- declare function buildSubscriber({ subscriberId, subscriber, }: {
10
- subscriberId: string | undefined;
11
- subscriber: Subscriber | string | undefined;
12
- }): Subscriber;
13
-
14
14
  export { type Token, buildSubscriber, parseMarkdownIntoTokens };
@@ -1,2 +1,2 @@
1
- export { buildSubscriber, parseMarkdownIntoTokens } from '../chunk-KYYDDVBR.mjs';
1
+ export { buildSubscriber, parseMarkdownIntoTokens } from '../chunk-QOD7NZ77.mjs';
2
2
  import '../chunk-STZMOEWR.mjs';
@@ -136,19 +136,6 @@ declare class InboxService {
136
136
  triggerHelloWorldEvent(): Promise<any>;
137
137
  }
138
138
 
139
- declare class BaseModule {
140
- #private;
141
- protected _inboxService: InboxService;
142
- protected _emitter: NovuEventEmitter;
143
- constructor({ inboxServiceInstance, eventEmitterInstance, }: {
144
- inboxServiceInstance: InboxService;
145
- eventEmitterInstance: NovuEventEmitter;
146
- });
147
- protected onSessionSuccess(_: Session): void;
148
- protected onSessionError(_: unknown): void;
149
- callWithSession<T>(fn: () => Result<T>): Result<T>;
150
- }
151
-
152
139
  declare class Notification implements Pick<NovuEventEmitter, 'on'>, InboxNotification {
153
140
  #private;
154
141
  readonly id: InboxNotification['id'];
@@ -193,6 +180,41 @@ declare class Notification implements Pick<NovuEventEmitter, 'on'>, InboxNotific
193
180
  off<Key extends EventNames>(eventName: Key, listener: EventHandler<Events[Key]>): void;
194
181
  }
195
182
 
183
+ declare class BaseModule {
184
+ #private;
185
+ protected _inboxService: InboxService;
186
+ protected _emitter: NovuEventEmitter;
187
+ constructor({ inboxServiceInstance, eventEmitterInstance, }: {
188
+ inboxServiceInstance: InboxService;
189
+ eventEmitterInstance: NovuEventEmitter;
190
+ });
191
+ protected onSessionSuccess(_: Session): void;
192
+ protected onSessionError(_: unknown): void;
193
+ callWithSession<T>(fn: () => Result<T>): Result<T>;
194
+ }
195
+
196
+ declare class NotificationsCache {
197
+ #private;
198
+ constructor({ emitter }: {
199
+ emitter: NovuEventEmitter;
200
+ });
201
+ private updateNotification;
202
+ private removeNotification;
203
+ private handleNotificationEvent;
204
+ private getAggregated;
205
+ has(args: ListNotificationsArgs): boolean;
206
+ set(args: ListNotificationsArgs, data: ListNotificationsResponse): void;
207
+ update(args: ListNotificationsArgs, data: ListNotificationsResponse): void;
208
+ getAll(args: ListNotificationsArgs): ListNotificationsResponse | undefined;
209
+ /**
210
+ * Get unique notifications based on specified filter fields.
211
+ * The same tags and data can be applied to multiple filters which means that the same notification can be duplicated.
212
+ */
213
+ getUniqueNotifications({ tags, read, data, }: Pick<ListNotificationsArgs, 'tags' | 'read' | 'data'>): Array<Notification>;
214
+ clear(filter: NotificationFilter): void;
215
+ clearAll(): void;
216
+ }
217
+
196
218
  type ListNotificationsArgs = {
197
219
  tags?: string[];
198
220
  read?: boolean;
@@ -258,28 +280,6 @@ type UnsnoozeArgs = BaseArgs | InstanceArgs;
258
280
  type CompleteArgs = BaseArgs | InstanceArgs;
259
281
  type RevertArgs = BaseArgs | InstanceArgs;
260
282
 
261
- declare class NotificationsCache {
262
- #private;
263
- constructor({ emitter }: {
264
- emitter: NovuEventEmitter;
265
- });
266
- private updateNotification;
267
- private removeNotification;
268
- private handleNotificationEvent;
269
- private getAggregated;
270
- has(args: ListNotificationsArgs): boolean;
271
- set(args: ListNotificationsArgs, data: ListNotificationsResponse): void;
272
- update(args: ListNotificationsArgs, data: ListNotificationsResponse): void;
273
- getAll(args: ListNotificationsArgs): ListNotificationsResponse | undefined;
274
- /**
275
- * Get unique notifications based on specified filter fields.
276
- * The same tags and data can be applied to multiple filters which means that the same notification can be duplicated.
277
- */
278
- getUniqueNotifications({ tags, read, data, }: Pick<ListNotificationsArgs, 'tags' | 'read' | 'data'>): Array<Notification>;
279
- clear(filter: NotificationFilter): void;
280
- clearAll(): void;
281
- }
282
-
283
283
  declare class Notifications extends BaseModule {
284
284
  #private;
285
285
  readonly cache: NotificationsCache;
@@ -327,7 +327,7 @@ declare class Notifications extends BaseModule {
327
327
  tags?: NotificationFilter['tags'];
328
328
  data?: Record<string, unknown>;
329
329
  }): Result<void>;
330
- archiveAllRead({ tags, data, }?: {
330
+ archiveAllRead({ tags, data }?: {
331
331
  tags?: string[];
332
332
  data?: Record<string, unknown>;
333
333
  }): Result<void>;
@@ -485,4 +485,4 @@ declare class Novu implements Pick<NovuEventEmitter, 'on'> {
485
485
  }): Promise<void>;
486
486
  }
487
487
 
488
- export { type EventHandler as E, type FiltersCountResponse as F, type ListNotificationsResponse as L, Novu as N, Preference as P, type SocketEventNames as S, type Events as a, Notification as b };
488
+ export { type EventHandler as E, type FiltersCountResponse as F, type ListNotificationsResponse as L, Notification as N, Preference as P, type SocketEventNames as S, type Events as a, Novu as b };
@@ -1,6 +1,6 @@
1
- import { m as Theme } from '../types-D_hCZpTY.mjs';
1
+ import { m as Theme } from '../types-LCV8aocH.mjs';
2
+ import '../novu-CimEIa5g.mjs';
2
3
  import '../types-Y8PRbRbj.mjs';
3
- import '../novu-DiZKRUW5.mjs';
4
4
 
5
5
  declare const dark: Theme;
6
6
 
@@ -1,5 +1,5 @@
1
+ import { N as Notification, b as Novu, P as Preference } from './novu-CimEIa5g.mjs';
1
2
  import { N as NotificationFilter, d as NovuOptions } from './types-Y8PRbRbj.mjs';
2
- import { b as Notification, N as Novu, P as Preference } from './novu-DiZKRUW5.mjs';
3
3
 
4
4
  declare const appearanceKeys: readonly ["button", "input", "icon", "badge", "popoverContent", "popoverTrigger", "popoverClose", "dropdownContent", "dropdownTrigger", "dropdownItem", "dropdownItemLabel", "dropdownItemLabelContainer", "dropdownItemLeft__icon", "dropdownItemRight__icon", "dropdownItem__icon", "collapsible", "tooltipContent", "tooltipTrigger", "datePicker", "datePickerGrid", "datePickerGridRow", "datePickerGridCell", "datePickerGridCellTrigger", "datePickerTrigger", "datePickerGridHeader", "datePickerControl", "datePickerControlPrevTrigger", "datePickerControlNextTrigger", "datePickerControlPrevTrigger__icon", "datePickerControlNextTrigger__icon", "datePickerCalendar", "datePickerHeaderMonth", "datePickerCalendarDay__button", "timePicker", "timePicker__hourSelect", "timePicker__minuteSelect", "timePicker__periodSelect", "timePicker__separator", "timePickerHour__input", "timePickerMinute__input", "snoozeDatePicker", "snoozeDatePicker__actions", "snoozeDatePickerCancel__button", "snoozeDatePickerApply__button", "snoozeDatePicker__timePickerContainer", "snoozeDatePicker__timePickerLabel", "back__button", "skeletonText", "skeletonAvatar", "skeletonSwitch", "skeletonSwitchThumb", "tabsRoot", "tabsList", "tabsContent", "tabsTrigger", "dots", "root", "bellIcon", "lockIcon", "bellContainer", "bellDot", "preferences__button", "preferencesContainer", "inboxHeader", "loading", "inboxContent", "inbox__popoverTrigger", "inbox__popoverContent", "notificationListContainer", "notificationList", "notificationListEmptyNoticeContainer", "notificationListEmptyNoticeOverlay", "notificationListEmptyNoticeIcon", "notificationListEmptyNotice", "notificationList__skeleton", "notificationList__skeletonContent", "notificationList__skeletonItem", "notificationList__skeletonAvatar", "notificationList__skeletonText", "notificationListNewNotificationsNotice__button", "notification", "notificationContent", "notificationTextContainer", "notificationDot", "notificationSubject", "notificationSubject__strong", "notificationBody", "notificationBody__strong", "notificationBodyContainer", "notificationImage", "notificationImageLoadingFallback", "notificationDate", "notificationDateActionsContainer", "notificationDefaultActions", "notificationCustomActions", "notificationPrimaryAction__button", "notificationSecondaryAction__button", "notificationRead__button", "notificationUnread__button", "notificationArchive__button", "notificationUnarchive__button", "notificationSnooze__button", "notificationUnsnooze__button", "notificationRead__icon", "notificationUnread__icon", "notificationArchive__icon", "notificationUnarchive__icon", "notificationSnooze__icon", "notificationUnsnooze__icon", "notificationsTabs__tabsRoot", "notificationsTabs__tabsList", "notificationsTabs__tabsContent", "notificationsTabs__tabsTrigger", "notificationsTabsTriggerLabel", "notificationsTabsTriggerCount", "inboxStatus__title", "inboxStatus__dropdownTrigger", "inboxStatus__dropdownContent", "inboxStatus__dropdownItem", "inboxStatus__dropdownItemLabel", "inboxStatus__dropdownItemLabelContainer", "inboxStatus__dropdownItemLeft__icon", "inboxStatus__dropdownItemRight__icon", "inboxStatus__dropdownItem__icon", "inboxStatus__dropdownItemCheck__icon", "moreActionsContainer", "moreActions__dropdownTrigger", "moreActions__dropdownContent", "moreActions__dropdownItem", "moreActions__dropdownItemLabel", "moreActions__dropdownItemLeft__icon", "moreActions__dots", "moreTabs__button", "moreTabs__icon", "moreTabs__dropdownTrigger", "moreTabs__dropdownContent", "moreTabs__dropdownItem", "moreTabs__dropdownItemLabel", "moreTabs__dropdownItemRight__icon", "workflowContainer", "workflowLabel", "workflowLabelHeader", "workflowLabelHeaderContainer", "workflowLabelIcon", "workflowLabelContainer", "workflowContainerDisabledNotice", "workflowLabelDisabled__icon", "workflowContainerRight__icon", "workflowArrow__icon", "workflowDescription", "preferencesGroupContainer", "preferencesGroupHeader", "preferencesGroupLabelContainer", "preferencesGroupLabelIcon", "preferencesGroupLabel", "preferencesGroupActionsContainer", "preferencesGroupActionsContainerRight__icon", "preferencesGroupBody", "preferencesGroupChannels", "preferencesGroupInfo", "preferencesGroupInfoIcon", "preferencesGroupWorkflows", "channelContainer", "channelIconContainer", "channel__icon", "channelsContainerCollapsible", "channelsContainer", "channelLabel", "channelLabelContainer", "channelName", "channelSwitchContainer", "channelSwitch", "channelSwitchThumb", "preferencesHeader", "preferencesHeader__back__button", "preferencesHeader__back__button__icon", "preferencesHeader__title", "preferencesHeader__icon", "preferencesListEmptyNoticeContainer", "preferencesListEmptyNotice", "preferencesList__skeleton", "preferencesList__skeletonContent", "preferencesList__skeletonItem", "preferencesList__skeletonIcon", "preferencesList__skeletonSwitch", "preferencesList__skeletonSwitchThumb", "preferencesList__skeletonText", "notificationSnooze__dropdownContent", "notificationSnooze__dropdownItem", "notificationSnooze__dropdownItem__icon", "notificationSnoozeCustomTime_popoverContent", "notificationDeliveredAt__badge", "notificationDeliveredAt__icon", "notificationSnoozedUntil__icon", "strong"];
5
5
 
@@ -140,4 +140,4 @@ type PreferenceGroups = Array<{
140
140
  filter: PreferenceGroupFilter;
141
141
  }>;
142
142
 
143
- export { type Appearance as A, type BellRenderer as B, type Elements as E, type IconKey as I, type Localization as L, type NotificationClickHandler as N, type PreferencesFilter as P, type RouterPush as R, type SubjectRenderer as S, type Tab as T, type Variables as V, type NotificationActionClickHandler as a, type NotificationRenderer as b, type BodyRenderer as c, type NovuProviderProps as d, type BaseNovuProviderProps as e, type PreferenceGroups as f, type AppearanceKey as g, type ElementStyles as h, type IconOverrides as i, type IconRenderer as j, type LocalizationKey as k, NotificationStatus as l, type Theme as m };
143
+ export { type Appearance as A, type BellRenderer as B, type ElementStyles as E, type IconKey as I, type Localization as L, type NotificationClickHandler as N, type PreferencesFilter as P, type RouterPush as R, type SubjectRenderer as S, type Tab as T, type Variables as V, type NotificationActionClickHandler as a, type NotificationRenderer as b, type BodyRenderer as c, type NovuProviderProps as d, type BaseNovuProviderProps as e, type PreferenceGroups as f, type AppearanceKey as g, type Elements as h, type IconOverrides as i, type IconRenderer as j, type LocalizationKey as k, NotificationStatus as l, type Theme as m };
@@ -1,7 +1,7 @@
1
+ export { N as Notification } from '../novu-CimEIa5g.mjs';
1
2
  import { d as NovuOptions } from '../types-Y8PRbRbj.mjs';
2
- export { b as Notification } from '../novu-DiZKRUW5.mjs';
3
- import { B as BellRenderer, N as NotificationClickHandler, a as NotificationActionClickHandler, b as NotificationRenderer, S as SubjectRenderer, c as BodyRenderer, d as NovuProviderProps, e as BaseNovuProviderProps, A as Appearance, L as Localization, T as Tab, P as PreferencesFilter, f as PreferenceGroups, R as RouterPush } from '../types-D_hCZpTY.mjs';
4
- export { g as AppearanceKey, h as ElementStyles, E as Elements, I as IconKey, i as IconOverrides, j as IconRenderer, k as LocalizationKey, l as NotificationStatus, m as Theme, V as Variables } from '../types-D_hCZpTY.mjs';
3
+ import { B as BellRenderer, N as NotificationClickHandler, a as NotificationActionClickHandler, b as NotificationRenderer, S as SubjectRenderer, c as BodyRenderer, d as NovuProviderProps, e as BaseNovuProviderProps, A as Appearance, L as Localization, T as Tab, P as PreferencesFilter, f as PreferenceGroups, R as RouterPush } from '../types-LCV8aocH.mjs';
4
+ export { g as AppearanceKey, E as ElementStyles, h as Elements, I as IconKey, i as IconOverrides, j as IconRenderer, k as LocalizationKey, l as NotificationStatus, m as Theme, V as Variables } from '../types-LCV8aocH.mjs';
5
5
  import { Placement, OffsetOptions } from '@floating-ui/dom';
6
6
  import * as solid_js from 'solid-js';
7
7
  import { ComponentProps } from 'solid-js';