@novu/js 3.6.0 → 3.7.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.
- package/dist/cjs/{chunk-RN7LHLHM.js → chunk-FDWMGQIF.js} +187 -32
- package/dist/cjs/{chunk-ERC62PGI.js → chunk-QFZ5WJGI.js} +15 -0
- package/dist/cjs/index.d.ts +3 -2
- package/dist/cjs/index.js +9 -8
- package/dist/cjs/internal/index.d.ts +8 -1
- package/dist/cjs/internal/index.js +6 -2
- package/dist/{esm/novu-CnZkqUKP.d.mts → cjs/novu-Gnea9ink.d.ts} +38 -165
- package/dist/cjs/themes/index.d.ts +3 -2
- package/dist/{esm/types-DKUFj4Oc.d.mts → cjs/types-C4qukwbH.d.ts} +2 -1
- package/dist/cjs/types-Y8PRbRbj.d.ts +165 -0
- package/dist/cjs/ui/index.d.ts +4 -4
- package/dist/cjs/ui/index.js +386 -132
- package/dist/esm/{chunk-P4R443TU.mjs → chunk-AIY4HF7H.mjs} +187 -33
- package/dist/esm/{chunk-GPV65U5R.mjs → chunk-KYYDDVBR.mjs} +15 -1
- package/dist/esm/index.d.mts +3 -2
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/internal/index.d.mts +8 -1
- package/dist/esm/internal/index.mjs +1 -1
- package/dist/{cjs/novu-CnZkqUKP.d.ts → esm/novu-DiZKRUW5.d.mts} +38 -165
- package/dist/esm/themes/index.d.mts +3 -2
- package/dist/{cjs/types-BSZsDqkz.d.ts → esm/types-D_hCZpTY.d.mts} +2 -1
- package/dist/esm/types-Y8PRbRbj.d.mts +165 -0
- package/dist/esm/ui/index.d.mts +4 -4
- package/dist/esm/ui/index.mjs +380 -126
- package/dist/novu.min.js +12 -12
- package/dist/novu.min.js.gz +0 -0
- package/package.json +3 -2
|
@@ -1,3 +1,5 @@
|
|
|
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';
|
|
2
|
+
|
|
1
3
|
type HttpClientOptions = {
|
|
2
4
|
apiVersion?: string;
|
|
3
5
|
apiUrl?: string;
|
|
@@ -5,11 +7,6 @@ type HttpClientOptions = {
|
|
|
5
7
|
headers?: Record<string, string>;
|
|
6
8
|
};
|
|
7
9
|
|
|
8
|
-
declare class NovuError extends Error {
|
|
9
|
-
originalError: Error;
|
|
10
|
-
constructor(message: string, originalError: unknown);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
10
|
type ListPreferencesArgs = {
|
|
14
11
|
tags?: string[];
|
|
15
12
|
};
|
|
@@ -55,162 +52,6 @@ declare class Preference {
|
|
|
55
52
|
}>): Result<Preference>;
|
|
56
53
|
}
|
|
57
54
|
|
|
58
|
-
declare global {
|
|
59
|
-
/**
|
|
60
|
-
* If you want to provide custom types for the notification.data object,
|
|
61
|
-
* simply redeclare this rule in the global namespace.
|
|
62
|
-
* Every notification object will use the provided type.
|
|
63
|
-
*/
|
|
64
|
-
interface NotificationData {
|
|
65
|
-
[k: string]: unknown;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
declare enum NotificationStatus {
|
|
69
|
-
READ = "read",
|
|
70
|
-
SEEN = "seen",
|
|
71
|
-
SNOOZED = "snoozed",
|
|
72
|
-
UNREAD = "unread",
|
|
73
|
-
UNSEEN = "unseen",
|
|
74
|
-
UNSNOOZED = "unsnoozed"
|
|
75
|
-
}
|
|
76
|
-
declare enum PreferenceLevel {
|
|
77
|
-
GLOBAL = "global",
|
|
78
|
-
TEMPLATE = "template"
|
|
79
|
-
}
|
|
80
|
-
declare enum ChannelType {
|
|
81
|
-
IN_APP = "in_app",
|
|
82
|
-
EMAIL = "email",
|
|
83
|
-
SMS = "sms",
|
|
84
|
-
CHAT = "chat",
|
|
85
|
-
PUSH = "push"
|
|
86
|
-
}
|
|
87
|
-
declare enum WebSocketEvent {
|
|
88
|
-
RECEIVED = "notification_received",
|
|
89
|
-
UNREAD = "unread_count_changed",
|
|
90
|
-
UNSEEN = "unseen_count_changed"
|
|
91
|
-
}
|
|
92
|
-
type Session = {
|
|
93
|
-
token: string;
|
|
94
|
-
totalUnreadCount: number;
|
|
95
|
-
removeNovuBranding: boolean;
|
|
96
|
-
isDevelopmentMode: boolean;
|
|
97
|
-
maxSnoozeDurationHours: number;
|
|
98
|
-
applicationIdentifier?: string;
|
|
99
|
-
};
|
|
100
|
-
type Subscriber = {
|
|
101
|
-
id?: string;
|
|
102
|
-
subscriberId: string;
|
|
103
|
-
firstName?: string;
|
|
104
|
-
lastName?: string;
|
|
105
|
-
email?: string;
|
|
106
|
-
phone?: string;
|
|
107
|
-
avatar?: string;
|
|
108
|
-
locale?: string;
|
|
109
|
-
data?: Record<string, unknown>;
|
|
110
|
-
timezone?: string;
|
|
111
|
-
};
|
|
112
|
-
type Redirect = {
|
|
113
|
-
url: string;
|
|
114
|
-
target?: '_self' | '_blank' | '_parent' | '_top' | '_unfencedTop';
|
|
115
|
-
};
|
|
116
|
-
declare enum ActionTypeEnum {
|
|
117
|
-
PRIMARY = "primary",
|
|
118
|
-
SECONDARY = "secondary"
|
|
119
|
-
}
|
|
120
|
-
type Action = {
|
|
121
|
-
label: string;
|
|
122
|
-
isCompleted: boolean;
|
|
123
|
-
redirect?: Redirect;
|
|
124
|
-
};
|
|
125
|
-
type Workflow = {
|
|
126
|
-
id: string;
|
|
127
|
-
identifier: string;
|
|
128
|
-
name: string;
|
|
129
|
-
critical: boolean;
|
|
130
|
-
tags?: string[];
|
|
131
|
-
};
|
|
132
|
-
type InboxNotification = {
|
|
133
|
-
id: string;
|
|
134
|
-
subject?: string;
|
|
135
|
-
body: string;
|
|
136
|
-
to: Subscriber;
|
|
137
|
-
isRead: boolean;
|
|
138
|
-
isArchived: boolean;
|
|
139
|
-
isSnoozed: boolean;
|
|
140
|
-
snoozedUntil?: string | null;
|
|
141
|
-
deliveredAt?: string[];
|
|
142
|
-
createdAt: string;
|
|
143
|
-
readAt?: string | null;
|
|
144
|
-
archivedAt?: string | null;
|
|
145
|
-
avatar?: string;
|
|
146
|
-
primaryAction?: Action;
|
|
147
|
-
secondaryAction?: Action;
|
|
148
|
-
channelType: ChannelType;
|
|
149
|
-
tags?: string[];
|
|
150
|
-
data?: NotificationData;
|
|
151
|
-
redirect?: Redirect;
|
|
152
|
-
workflow?: Workflow;
|
|
153
|
-
};
|
|
154
|
-
type NotificationFilter = {
|
|
155
|
-
tags?: string[];
|
|
156
|
-
read?: boolean;
|
|
157
|
-
archived?: boolean;
|
|
158
|
-
snoozed?: boolean;
|
|
159
|
-
data?: Record<string, unknown>;
|
|
160
|
-
};
|
|
161
|
-
type ChannelPreference = {
|
|
162
|
-
email?: boolean;
|
|
163
|
-
sms?: boolean;
|
|
164
|
-
in_app?: boolean;
|
|
165
|
-
chat?: boolean;
|
|
166
|
-
push?: boolean;
|
|
167
|
-
};
|
|
168
|
-
type PreferencesResponse = {
|
|
169
|
-
level: PreferenceLevel;
|
|
170
|
-
enabled: boolean;
|
|
171
|
-
channels: ChannelPreference;
|
|
172
|
-
overrides?: IPreferenceOverride[];
|
|
173
|
-
workflow?: Workflow;
|
|
174
|
-
};
|
|
175
|
-
declare enum PreferenceOverrideSourceEnum {
|
|
176
|
-
SUBSCRIBER = "subscriber",
|
|
177
|
-
TEMPLATE = "template",
|
|
178
|
-
WORKFLOW_OVERRIDE = "workflowOverride"
|
|
179
|
-
}
|
|
180
|
-
type IPreferenceOverride = {
|
|
181
|
-
channel: ChannelType;
|
|
182
|
-
source: PreferenceOverrideSourceEnum;
|
|
183
|
-
};
|
|
184
|
-
type Result<D = undefined, E = NovuError> = Promise<{
|
|
185
|
-
data?: D;
|
|
186
|
-
error?: E;
|
|
187
|
-
}>;
|
|
188
|
-
type KeylessNovuOptions = {} & {
|
|
189
|
-
[K in string]?: never;
|
|
190
|
-
};
|
|
191
|
-
type StandardNovuOptions = {
|
|
192
|
-
/** @deprecated Use apiUrl instead */
|
|
193
|
-
backendUrl?: string;
|
|
194
|
-
/** @internal Should be used internally for testing purposes */
|
|
195
|
-
__userAgent?: string;
|
|
196
|
-
applicationIdentifier: string;
|
|
197
|
-
subscriberHash?: string;
|
|
198
|
-
apiUrl?: string;
|
|
199
|
-
socketUrl?: string;
|
|
200
|
-
useCache?: boolean;
|
|
201
|
-
} & ({
|
|
202
|
-
/** @deprecated Use subscriber prop instead */
|
|
203
|
-
subscriberId: string;
|
|
204
|
-
subscriber?: never;
|
|
205
|
-
} | {
|
|
206
|
-
subscriber: Subscriber | string;
|
|
207
|
-
subscriberId?: never;
|
|
208
|
-
});
|
|
209
|
-
type NovuOptions = KeylessNovuOptions | StandardNovuOptions;
|
|
210
|
-
type Prettify<T> = {
|
|
211
|
-
[K in keyof T]: T[K];
|
|
212
|
-
} & {};
|
|
213
|
-
|
|
214
55
|
type InboxServiceOptions = HttpClientOptions;
|
|
215
56
|
declare class InboxService {
|
|
216
57
|
#private;
|
|
@@ -221,11 +62,12 @@ declare class InboxService {
|
|
|
221
62
|
subscriberHash?: string;
|
|
222
63
|
subscriber?: Subscriber;
|
|
223
64
|
}): Promise<Session>;
|
|
224
|
-
fetchNotifications({ after, archived, limit, offset, read, tags, snoozed, data, }: {
|
|
65
|
+
fetchNotifications({ after, archived, limit, offset, read, tags, snoozed, seen, data, }: {
|
|
225
66
|
tags?: string[];
|
|
226
67
|
read?: boolean;
|
|
227
68
|
archived?: boolean;
|
|
228
69
|
snoozed?: boolean;
|
|
70
|
+
seen?: boolean;
|
|
229
71
|
limit?: number;
|
|
230
72
|
after?: string;
|
|
231
73
|
offset?: number;
|
|
@@ -240,6 +82,8 @@ declare class InboxService {
|
|
|
240
82
|
tags?: string[];
|
|
241
83
|
read?: boolean;
|
|
242
84
|
archived?: boolean;
|
|
85
|
+
snoozed?: boolean;
|
|
86
|
+
seen?: boolean;
|
|
243
87
|
data?: Record<string, unknown>;
|
|
244
88
|
}>;
|
|
245
89
|
}): Promise<{
|
|
@@ -266,6 +110,12 @@ declare class InboxService {
|
|
|
266
110
|
tags?: string[];
|
|
267
111
|
data?: Record<string, unknown>;
|
|
268
112
|
}): Promise<void>;
|
|
113
|
+
markAsSeen({ notificationIds, tags, data, }: {
|
|
114
|
+
notificationIds?: string[];
|
|
115
|
+
tags?: string[];
|
|
116
|
+
data?: Record<string, unknown>;
|
|
117
|
+
}): Promise<void>;
|
|
118
|
+
seen(notificationId: string): Promise<void>;
|
|
269
119
|
completeAction({ actionType, notificationId, }: {
|
|
270
120
|
notificationId: string;
|
|
271
121
|
actionType: ActionTypeEnum;
|
|
@@ -306,12 +156,14 @@ declare class Notification implements Pick<NovuEventEmitter, 'on'>, InboxNotific
|
|
|
306
156
|
readonly body: InboxNotification['body'];
|
|
307
157
|
readonly to: InboxNotification['to'];
|
|
308
158
|
readonly isRead: InboxNotification['isRead'];
|
|
159
|
+
readonly isSeen: InboxNotification['isSeen'];
|
|
309
160
|
readonly isArchived: InboxNotification['isArchived'];
|
|
310
161
|
readonly isSnoozed: InboxNotification['isSnoozed'];
|
|
311
162
|
readonly snoozedUntil?: InboxNotification['snoozedUntil'];
|
|
312
163
|
readonly deliveredAt?: InboxNotification['deliveredAt'];
|
|
313
164
|
readonly createdAt: InboxNotification['createdAt'];
|
|
314
165
|
readonly readAt?: InboxNotification['readAt'];
|
|
166
|
+
readonly firstSeenAt?: InboxNotification['firstSeenAt'];
|
|
315
167
|
readonly archivedAt?: InboxNotification['archivedAt'];
|
|
316
168
|
readonly avatar?: InboxNotification['avatar'];
|
|
317
169
|
readonly primaryAction?: InboxNotification['primaryAction'];
|
|
@@ -324,6 +176,7 @@ declare class Notification implements Pick<NovuEventEmitter, 'on'>, InboxNotific
|
|
|
324
176
|
constructor(notification: InboxNotification, emitter: NovuEventEmitter, inboxService: InboxService);
|
|
325
177
|
read(): Result<Notification>;
|
|
326
178
|
unread(): Result<Notification>;
|
|
179
|
+
seen(): Result<Notification>;
|
|
327
180
|
archive(): Result<Notification>;
|
|
328
181
|
unarchive(): Result<Notification>;
|
|
329
182
|
snooze(snoozeUntil: string): Result<Notification>;
|
|
@@ -346,6 +199,7 @@ type ListNotificationsArgs = {
|
|
|
346
199
|
data?: Record<string, unknown>;
|
|
347
200
|
archived?: boolean;
|
|
348
201
|
snoozed?: boolean;
|
|
202
|
+
seen?: boolean;
|
|
349
203
|
limit?: number;
|
|
350
204
|
after?: string;
|
|
351
205
|
offset?: number;
|
|
@@ -362,6 +216,7 @@ type FilterCountArgs = {
|
|
|
362
216
|
read?: boolean;
|
|
363
217
|
archived?: boolean;
|
|
364
218
|
snoozed?: boolean;
|
|
219
|
+
seen?: boolean;
|
|
365
220
|
};
|
|
366
221
|
type FiltersCountArgs = {
|
|
367
222
|
filters: Array<{
|
|
@@ -369,6 +224,7 @@ type FiltersCountArgs = {
|
|
|
369
224
|
read?: boolean;
|
|
370
225
|
archived?: boolean;
|
|
371
226
|
snoozed?: boolean;
|
|
227
|
+
seen?: boolean;
|
|
372
228
|
data?: Record<string, unknown>;
|
|
373
229
|
}>;
|
|
374
230
|
};
|
|
@@ -394,6 +250,7 @@ type ReadArgs = BaseArgs | InstanceArgs;
|
|
|
394
250
|
type UnreadArgs = BaseArgs | InstanceArgs;
|
|
395
251
|
type ArchivedArgs = BaseArgs | InstanceArgs;
|
|
396
252
|
type UnarchivedArgs = BaseArgs | InstanceArgs;
|
|
253
|
+
type SeenArgs = BaseArgs | InstanceArgs;
|
|
397
254
|
type SnoozeArgs = (BaseArgs | InstanceArgs) & {
|
|
398
255
|
snoozeUntil: string;
|
|
399
256
|
};
|
|
@@ -431,6 +288,7 @@ declare class Notifications extends BaseModule {
|
|
|
431
288
|
inboxServiceInstance: InboxService;
|
|
432
289
|
eventEmitterInstance: NovuEventEmitter;
|
|
433
290
|
});
|
|
291
|
+
get inboxService(): InboxService;
|
|
434
292
|
list({ limit, ...restOptions }?: ListNotificationsArgs): Result<ListNotificationsResponse>;
|
|
435
293
|
count(args?: FilterCountArgs): Result<FilterCountResponse>;
|
|
436
294
|
count(args?: FiltersCountArgs): Result<FiltersCountResponse>;
|
|
@@ -438,6 +296,8 @@ declare class Notifications extends BaseModule {
|
|
|
438
296
|
read(args: InstanceArgs): Result<Notification>;
|
|
439
297
|
unread(args: BaseArgs): Result<Notification>;
|
|
440
298
|
unread(args: InstanceArgs): Result<Notification>;
|
|
299
|
+
seen(args: BaseArgs): Result<Notification>;
|
|
300
|
+
seen(args: InstanceArgs): Result<Notification>;
|
|
441
301
|
archive(args: BaseArgs): Result<Notification>;
|
|
442
302
|
archive(args: InstanceArgs): Result<Notification>;
|
|
443
303
|
unarchive(args: BaseArgs): Result<Notification>;
|
|
@@ -457,12 +317,18 @@ declare class Notifications extends BaseModule {
|
|
|
457
317
|
tags?: NotificationFilter['tags'];
|
|
458
318
|
data?: Record<string, unknown>;
|
|
459
319
|
}): Result<void>;
|
|
320
|
+
seenAll(args?: {
|
|
321
|
+
notificationIds: string[];
|
|
322
|
+
} | {
|
|
323
|
+
tags?: NotificationFilter['tags'];
|
|
324
|
+
data?: Record<string, unknown>;
|
|
325
|
+
} | {}): Result<void>;
|
|
460
326
|
archiveAll({ tags, data, }?: {
|
|
461
327
|
tags?: NotificationFilter['tags'];
|
|
462
328
|
data?: Record<string, unknown>;
|
|
463
329
|
}): Result<void>;
|
|
464
330
|
archiveAllRead({ tags, data, }?: {
|
|
465
|
-
tags?:
|
|
331
|
+
tags?: string[];
|
|
466
332
|
data?: Record<string, unknown>;
|
|
467
333
|
}): Result<void>;
|
|
468
334
|
clearCache({ filter }?: {
|
|
@@ -498,6 +364,7 @@ type NotificationsFetchEvents = BaseEvents<'notifications.list', ListNotificatio
|
|
|
498
364
|
type NotificationsFetchCountEvents = BaseEvents<'notifications.count', CountArgs, CountResponse>;
|
|
499
365
|
type NotificationReadEvents = BaseEvents<'notification.read', ReadArgs, Notification>;
|
|
500
366
|
type NotificationUnreadEvents = BaseEvents<'notification.unread', UnreadArgs, Notification>;
|
|
367
|
+
type NotificationSeenEvents = BaseEvents<'notification.seen', SeenArgs, Notification>;
|
|
501
368
|
type NotificationArchiveEvents = BaseEvents<'notification.archive', ArchivedArgs, Notification>;
|
|
502
369
|
type NotificationUnarchiveEvents = BaseEvents<'notification.unarchive', UnarchivedArgs, Notification>;
|
|
503
370
|
type NotificationSnoozeEvents = BaseEvents<'notification.snooze', SnoozeArgs, Notification>;
|
|
@@ -508,6 +375,12 @@ type NotificationsReadAllEvents = BaseEvents<'notifications.read_all', {
|
|
|
508
375
|
tags?: string[];
|
|
509
376
|
data?: Record<string, unknown>;
|
|
510
377
|
}, Notification[]>;
|
|
378
|
+
type NotificationsSeenAllEvents = BaseEvents<'notifications.seen_all', {
|
|
379
|
+
notificationIds: string[];
|
|
380
|
+
} | {
|
|
381
|
+
tags?: string[];
|
|
382
|
+
data?: Record<string, unknown>;
|
|
383
|
+
} | {}, Notification[]>;
|
|
511
384
|
type NotificationsArchivedAllEvents = BaseEvents<'notifications.archive_all', {
|
|
512
385
|
tags?: string[];
|
|
513
386
|
data?: Record<string, unknown>;
|
|
@@ -558,7 +431,7 @@ type Events = SessionInitializeEvents & NotificationsFetchEvents & {
|
|
|
558
431
|
'preferences.list.updated': {
|
|
559
432
|
data: Preference[];
|
|
560
433
|
};
|
|
561
|
-
} & PreferenceUpdateEvents & PreferencesBulkUpdateEvents & SocketConnectEvents & SocketEvents & NotificationReadEvents & NotificationUnreadEvents & NotificationArchiveEvents & NotificationUnarchiveEvents & NotificationSnoozeEvents & NotificationUnsnoozeEvents & NotificationCompleteActionEvents & NotificationRevertActionEvents & NotificationsReadAllEvents & NotificationsArchivedAllEvents & NotificationsReadArchivedAllEvents;
|
|
434
|
+
} & PreferenceUpdateEvents & PreferencesBulkUpdateEvents & SocketConnectEvents & SocketEvents & NotificationReadEvents & NotificationUnreadEvents & NotificationSeenEvents & NotificationArchiveEvents & NotificationUnarchiveEvents & NotificationSnoozeEvents & NotificationUnsnoozeEvents & NotificationCompleteActionEvents & NotificationRevertActionEvents & NotificationsReadAllEvents & NotificationsSeenAllEvents & NotificationsArchivedAllEvents & NotificationsReadArchivedAllEvents;
|
|
562
435
|
type EventNames = keyof Events;
|
|
563
436
|
type SocketEventNames = keyof SocketEvents;
|
|
564
437
|
type EventHandler<T = unknown> = (event: T) => void;
|
|
@@ -612,4 +485,4 @@ declare class Novu implements Pick<NovuEventEmitter, 'on'> {
|
|
|
612
485
|
}): Promise<void>;
|
|
613
486
|
}
|
|
614
487
|
|
|
615
|
-
export { type
|
|
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 };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
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';
|
|
2
3
|
|
|
3
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"];
|
|
4
5
|
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
declare class NovuError extends Error {
|
|
2
|
+
originalError: Error;
|
|
3
|
+
constructor(message: string, originalError: unknown);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
declare global {
|
|
7
|
+
/**
|
|
8
|
+
* If you want to provide custom types for the notification.data object,
|
|
9
|
+
* simply redeclare this rule in the global namespace.
|
|
10
|
+
* Every notification object will use the provided type.
|
|
11
|
+
*/
|
|
12
|
+
interface NotificationData {
|
|
13
|
+
[k: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
declare enum NotificationStatus {
|
|
17
|
+
READ = "read",
|
|
18
|
+
SEEN = "seen",
|
|
19
|
+
SNOOZED = "snoozed",
|
|
20
|
+
UNREAD = "unread",
|
|
21
|
+
UNSEEN = "unseen",
|
|
22
|
+
UNSNOOZED = "unsnoozed"
|
|
23
|
+
}
|
|
24
|
+
declare enum PreferenceLevel {
|
|
25
|
+
GLOBAL = "global",
|
|
26
|
+
TEMPLATE = "template"
|
|
27
|
+
}
|
|
28
|
+
declare enum ChannelType {
|
|
29
|
+
IN_APP = "in_app",
|
|
30
|
+
EMAIL = "email",
|
|
31
|
+
SMS = "sms",
|
|
32
|
+
CHAT = "chat",
|
|
33
|
+
PUSH = "push"
|
|
34
|
+
}
|
|
35
|
+
declare enum WebSocketEvent {
|
|
36
|
+
RECEIVED = "notification_received",
|
|
37
|
+
UNREAD = "unread_count_changed",
|
|
38
|
+
UNSEEN = "unseen_count_changed"
|
|
39
|
+
}
|
|
40
|
+
type Session = {
|
|
41
|
+
token: string;
|
|
42
|
+
totalUnreadCount: number;
|
|
43
|
+
removeNovuBranding: boolean;
|
|
44
|
+
isDevelopmentMode: boolean;
|
|
45
|
+
maxSnoozeDurationHours: number;
|
|
46
|
+
applicationIdentifier?: string;
|
|
47
|
+
};
|
|
48
|
+
type Subscriber = {
|
|
49
|
+
id?: string;
|
|
50
|
+
subscriberId: string;
|
|
51
|
+
firstName?: string;
|
|
52
|
+
lastName?: string;
|
|
53
|
+
email?: string;
|
|
54
|
+
phone?: string;
|
|
55
|
+
avatar?: string;
|
|
56
|
+
locale?: string;
|
|
57
|
+
data?: Record<string, unknown>;
|
|
58
|
+
timezone?: string;
|
|
59
|
+
};
|
|
60
|
+
type Redirect = {
|
|
61
|
+
url: string;
|
|
62
|
+
target?: '_self' | '_blank' | '_parent' | '_top' | '_unfencedTop';
|
|
63
|
+
};
|
|
64
|
+
declare enum ActionTypeEnum {
|
|
65
|
+
PRIMARY = "primary",
|
|
66
|
+
SECONDARY = "secondary"
|
|
67
|
+
}
|
|
68
|
+
type Action = {
|
|
69
|
+
label: string;
|
|
70
|
+
isCompleted: boolean;
|
|
71
|
+
redirect?: Redirect;
|
|
72
|
+
};
|
|
73
|
+
type Workflow = {
|
|
74
|
+
id: string;
|
|
75
|
+
identifier: string;
|
|
76
|
+
name: string;
|
|
77
|
+
critical: boolean;
|
|
78
|
+
tags?: string[];
|
|
79
|
+
};
|
|
80
|
+
type InboxNotification = {
|
|
81
|
+
id: string;
|
|
82
|
+
subject?: string;
|
|
83
|
+
body: string;
|
|
84
|
+
to: Subscriber;
|
|
85
|
+
isRead: boolean;
|
|
86
|
+
isSeen: boolean;
|
|
87
|
+
isArchived: boolean;
|
|
88
|
+
isSnoozed: boolean;
|
|
89
|
+
snoozedUntil?: string | null;
|
|
90
|
+
deliveredAt?: string[];
|
|
91
|
+
createdAt: string;
|
|
92
|
+
readAt?: string | null;
|
|
93
|
+
firstSeenAt?: string | null;
|
|
94
|
+
archivedAt?: string | null;
|
|
95
|
+
avatar?: string;
|
|
96
|
+
primaryAction?: Action;
|
|
97
|
+
secondaryAction?: Action;
|
|
98
|
+
channelType: ChannelType;
|
|
99
|
+
tags?: string[];
|
|
100
|
+
data?: NotificationData;
|
|
101
|
+
redirect?: Redirect;
|
|
102
|
+
workflow?: Workflow;
|
|
103
|
+
};
|
|
104
|
+
type NotificationFilter = {
|
|
105
|
+
tags?: string[];
|
|
106
|
+
read?: boolean;
|
|
107
|
+
archived?: boolean;
|
|
108
|
+
snoozed?: boolean;
|
|
109
|
+
seen?: boolean;
|
|
110
|
+
data?: Record<string, unknown>;
|
|
111
|
+
};
|
|
112
|
+
type ChannelPreference = {
|
|
113
|
+
email?: boolean;
|
|
114
|
+
sms?: boolean;
|
|
115
|
+
in_app?: boolean;
|
|
116
|
+
chat?: boolean;
|
|
117
|
+
push?: boolean;
|
|
118
|
+
};
|
|
119
|
+
type PreferencesResponse = {
|
|
120
|
+
level: PreferenceLevel;
|
|
121
|
+
enabled: boolean;
|
|
122
|
+
channels: ChannelPreference;
|
|
123
|
+
overrides?: IPreferenceOverride[];
|
|
124
|
+
workflow?: Workflow;
|
|
125
|
+
};
|
|
126
|
+
declare enum PreferenceOverrideSourceEnum {
|
|
127
|
+
SUBSCRIBER = "subscriber",
|
|
128
|
+
TEMPLATE = "template",
|
|
129
|
+
WORKFLOW_OVERRIDE = "workflowOverride"
|
|
130
|
+
}
|
|
131
|
+
type IPreferenceOverride = {
|
|
132
|
+
channel: ChannelType;
|
|
133
|
+
source: PreferenceOverrideSourceEnum;
|
|
134
|
+
};
|
|
135
|
+
type Result<D = undefined, E = NovuError> = Promise<{
|
|
136
|
+
data?: D;
|
|
137
|
+
error?: E;
|
|
138
|
+
}>;
|
|
139
|
+
type KeylessNovuOptions = {} & {
|
|
140
|
+
[K in string]?: never;
|
|
141
|
+
};
|
|
142
|
+
type StandardNovuOptions = {
|
|
143
|
+
/** @deprecated Use apiUrl instead */
|
|
144
|
+
backendUrl?: string;
|
|
145
|
+
/** @internal Should be used internally for testing purposes */
|
|
146
|
+
__userAgent?: string;
|
|
147
|
+
applicationIdentifier: string;
|
|
148
|
+
subscriberHash?: string;
|
|
149
|
+
apiUrl?: string;
|
|
150
|
+
socketUrl?: string;
|
|
151
|
+
useCache?: boolean;
|
|
152
|
+
} & ({
|
|
153
|
+
/** @deprecated Use subscriber prop instead */
|
|
154
|
+
subscriberId: string;
|
|
155
|
+
subscriber?: never;
|
|
156
|
+
} | {
|
|
157
|
+
subscriber: Subscriber | string;
|
|
158
|
+
subscriberId?: never;
|
|
159
|
+
});
|
|
160
|
+
type NovuOptions = KeylessNovuOptions | StandardNovuOptions;
|
|
161
|
+
type Prettify<T> = {
|
|
162
|
+
[K in keyof T]: T[K];
|
|
163
|
+
} & {};
|
|
164
|
+
|
|
165
|
+
export { ActionTypeEnum as A, type ChannelPreference as C, type InboxNotification as I, type NotificationFilter as N, PreferenceLevel as P, type Result as R, type StandardNovuOptions as S, WebSocketEvent as W, ChannelType as a, NotificationStatus as b, NovuError as c, type NovuOptions as d, type PreferencesResponse as e, type Subscriber as f, type Workflow as g, type Prettify as h, type Session as i };
|
package/dist/esm/ui/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
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-
|
|
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-
|
|
1
|
+
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';
|
|
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';
|