@novu/js 3.7.1-nightly.20250723 → 3.8.1-nightly.20250813.014483f9e1

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-Gnea9ink.js';
2
- import { N as NotificationFilter } from './types-Y8PRbRbj.js';
3
- 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.js';
1
+ import { N as Notification } from './novu-D6fucMvr.js';
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-D6fucMvr.js';
3
+ import { N as NotificationFilter } from './types-CiFWY1AG.js';
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-CiFWY1AG.js';
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 };
package/dist/cjs/index.js CHANGED
@@ -1,36 +1,44 @@
1
1
  'use strict';
2
2
 
3
- var chunkFZQYUNQH_js = require('./chunk-FZQYUNQH.js');
4
- require('./chunk-QFZ5WJGI.js');
3
+ var chunkHCIYXVYN_js = require('./chunk-HCIYXVYN.js');
4
+ require('./chunk-ZB7IPCHY.js');
5
5
  require('./chunk-7B52C2XE.js');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "ChannelType", {
10
10
  enumerable: true,
11
- get: function () { return chunkFZQYUNQH_js.ChannelType; }
11
+ get: function () { return chunkHCIYXVYN_js.ChannelType; }
12
12
  });
13
13
  Object.defineProperty(exports, "NotificationStatus", {
14
14
  enumerable: true,
15
- get: function () { return chunkFZQYUNQH_js.NotificationStatus; }
15
+ get: function () { return chunkHCIYXVYN_js.NotificationStatus; }
16
16
  });
17
17
  Object.defineProperty(exports, "Novu", {
18
18
  enumerable: true,
19
- get: function () { return chunkFZQYUNQH_js.Novu; }
19
+ get: function () { return chunkHCIYXVYN_js.Novu; }
20
20
  });
21
21
  Object.defineProperty(exports, "PreferenceLevel", {
22
22
  enumerable: true,
23
- get: function () { return chunkFZQYUNQH_js.PreferenceLevel; }
23
+ get: function () { return chunkHCIYXVYN_js.PreferenceLevel; }
24
24
  });
25
25
  Object.defineProperty(exports, "WebSocketEvent", {
26
26
  enumerable: true,
27
- get: function () { return chunkFZQYUNQH_js.WebSocketEvent; }
27
+ get: function () { return chunkHCIYXVYN_js.WebSocketEvent; }
28
28
  });
29
29
  Object.defineProperty(exports, "areTagsEqual", {
30
30
  enumerable: true,
31
- get: function () { return chunkFZQYUNQH_js.areTagsEqual; }
31
+ get: function () { return chunkHCIYXVYN_js.areTagsEqual; }
32
+ });
33
+ Object.defineProperty(exports, "checkNotificationDataFilter", {
34
+ enumerable: true,
35
+ get: function () { return chunkHCIYXVYN_js.checkNotificationDataFilter; }
36
+ });
37
+ Object.defineProperty(exports, "checkNotificationMatchesFilter", {
38
+ enumerable: true,
39
+ get: function () { return chunkHCIYXVYN_js.checkNotificationMatchesFilter; }
32
40
  });
33
41
  Object.defineProperty(exports, "isSameFilter", {
34
42
  enumerable: true,
35
- get: function () { return chunkFZQYUNQH_js.isSameFilter; }
43
+ get: function () { return chunkHCIYXVYN_js.isSameFilter; }
36
44
  });
@@ -1,4 +1,9 @@
1
- import { f as Subscriber } from '../types-Y8PRbRbj.js';
1
+ import { f as Subscriber } from '../types-CiFWY1AG.js';
2
+
3
+ declare function buildSubscriber({ subscriberId, subscriber, }: {
4
+ subscriberId: string | undefined;
5
+ subscriber: Subscriber | string | undefined;
6
+ }): Subscriber;
2
7
 
3
8
  interface Token {
4
9
  type: 'bold' | 'text';
@@ -6,9 +11,4 @@ interface Token {
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,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var chunkQFZ5WJGI_js = require('../chunk-QFZ5WJGI.js');
3
+ var chunkZB7IPCHY_js = require('../chunk-ZB7IPCHY.js');
4
4
  require('../chunk-7B52C2XE.js');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "buildSubscriber", {
9
9
  enumerable: true,
10
- get: function () { return chunkQFZ5WJGI_js.buildSubscriber; }
10
+ get: function () { return chunkZB7IPCHY_js.buildSubscriber; }
11
11
  });
12
12
  Object.defineProperty(exports, "parseMarkdownIntoTokens", {
13
13
  enumerable: true,
14
- get: function () { return chunkQFZ5WJGI_js.parseMarkdownIntoTokens; }
14
+ get: function () { return chunkZB7IPCHY_js.parseMarkdownIntoTokens; }
15
15
  });
@@ -1,4 +1,4 @@
1
- import { C as ChannelPreference, P as PreferenceLevel, g as Workflow, h as Prettify, R as Result, f as Subscriber, i as Session, I as InboxNotification, N as NotificationFilter, A as ActionTypeEnum, e as PreferencesResponse, W as WebSocketEvent, d as NovuOptions } from './types-Y8PRbRbj.mjs';
1
+ import { C as ChannelPreference, P as PreferenceLevel, g as Workflow, h as Prettify, R as Result, f as Subscriber, i as Session, I as InboxNotification, N as NotificationFilter, A as ActionTypeEnum, e as PreferencesResponse, W as WebSocketEvent, d as NovuOptions } from './types-CiFWY1AG.js';
2
2
 
3
3
  type HttpClientOptions = {
4
4
  apiVersion?: string;
@@ -136,22 +136,10 @@ 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'];
142
+ readonly transactionId: InboxNotification['transactionId'];
155
143
  readonly subject?: InboxNotification['subject'];
156
144
  readonly body: InboxNotification['body'];
157
145
  readonly to: InboxNotification['to'];
@@ -193,6 +181,41 @@ declare class Notification implements Pick<NovuEventEmitter, 'on'>, InboxNotific
193
181
  off<Key extends EventNames>(eventName: Key, listener: EventHandler<Events[Key]>): void;
194
182
  }
195
183
 
184
+ declare class BaseModule {
185
+ #private;
186
+ protected _inboxService: InboxService;
187
+ protected _emitter: NovuEventEmitter;
188
+ constructor({ inboxServiceInstance, eventEmitterInstance, }: {
189
+ inboxServiceInstance: InboxService;
190
+ eventEmitterInstance: NovuEventEmitter;
191
+ });
192
+ protected onSessionSuccess(_: Session): void;
193
+ protected onSessionError(_: unknown): void;
194
+ callWithSession<T>(fn: () => Result<T>): Result<T>;
195
+ }
196
+
197
+ declare class NotificationsCache {
198
+ #private;
199
+ constructor({ emitter }: {
200
+ emitter: NovuEventEmitter;
201
+ });
202
+ private updateNotification;
203
+ private removeNotification;
204
+ private handleNotificationEvent;
205
+ private getAggregated;
206
+ has(args: ListNotificationsArgs): boolean;
207
+ set(args: ListNotificationsArgs, data: ListNotificationsResponse): void;
208
+ update(args: ListNotificationsArgs, data: ListNotificationsResponse): void;
209
+ getAll(args: ListNotificationsArgs): ListNotificationsResponse | undefined;
210
+ /**
211
+ * Get unique notifications based on specified filter fields.
212
+ * The same tags and data can be applied to multiple filters which means that the same notification can be duplicated.
213
+ */
214
+ getUniqueNotifications({ tags, read, data, }: Pick<ListNotificationsArgs, 'tags' | 'read' | 'data'>): Array<Notification>;
215
+ clear(filter: NotificationFilter): void;
216
+ clearAll(): void;
217
+ }
218
+
196
219
  type ListNotificationsArgs = {
197
220
  tags?: string[];
198
221
  read?: boolean;
@@ -258,28 +281,6 @@ type UnsnoozeArgs = BaseArgs | InstanceArgs;
258
281
  type CompleteArgs = BaseArgs | InstanceArgs;
259
282
  type RevertArgs = BaseArgs | InstanceArgs;
260
283
 
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
284
  declare class Notifications extends BaseModule {
284
285
  #private;
285
286
  readonly cache: NotificationsCache;
@@ -327,7 +328,7 @@ declare class Notifications extends BaseModule {
327
328
  tags?: NotificationFilter['tags'];
328
329
  data?: Record<string, unknown>;
329
330
  }): Result<void>;
330
- archiveAllRead({ tags, data, }?: {
331
+ archiveAllRead({ tags, data }?: {
331
332
  tags?: string[];
332
333
  data?: Record<string, unknown>;
333
334
  }): Result<void>;
@@ -485,4 +486,4 @@ declare class Novu implements Pick<NovuEventEmitter, 'on'> {
485
486
  }): Promise<void>;
486
487
  }
487
488
 
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 };
489
+ 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-C4qukwbH.js';
2
- import '../types-Y8PRbRbj.js';
3
- import '../novu-Gnea9ink.js';
1
+ import { m as Theme } from '../types-B3PJouaR.js';
2
+ import '../novu-D6fucMvr.js';
3
+ import '../types-CiFWY1AG.js';
4
4
 
5
5
  declare const dark: Theme;
6
6
 
@@ -1,5 +1,5 @@
1
- import { N as NotificationFilter, d as NovuOptions } from './types-Y8PRbRbj.js';
2
- import { b as Notification, N as Novu, P as Preference } from './novu-Gnea9ink.js';
1
+ import { N as Notification, b as Novu, P as Preference } from './novu-D6fucMvr.js';
2
+ import { N as NotificationFilter, d as NovuOptions } from './types-CiFWY1AG.js';
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 };
@@ -79,6 +79,7 @@ type Workflow = {
79
79
  };
80
80
  type InboxNotification = {
81
81
  id: string;
82
+ transactionId: string;
82
83
  subject?: string;
83
84
  body: string;
84
85
  to: Subscriber;
@@ -1,7 +1,7 @@
1
- import { d as NovuOptions } from '../types-Y8PRbRbj.js';
2
- export { b as Notification } from '../novu-Gnea9ink.js';
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-C4qukwbH.js';
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-C4qukwbH.js';
1
+ export { N as Notification } from '../novu-D6fucMvr.js';
2
+ import { d as NovuOptions } from '../types-CiFWY1AG.js';
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-B3PJouaR.js';
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-B3PJouaR.js';
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';