@novu/js 3.11.1 → 3.11.2-nightly.20251224.eb609546a3
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-MKYWGA37.js → chunk-C6V4UPCA.js} +1069 -294
- package/dist/cjs/{chunk-WFVHYVDM.js → chunk-CDGREQFE.js} +6 -0
- package/dist/cjs/index.d.ts +4 -3
- package/dist/cjs/index.js +26 -14
- package/dist/cjs/internal/index.d.ts +8 -2
- package/dist/cjs/internal/index.js +9 -5
- package/dist/{esm/novu-3CfttQ8e.d.mts → cjs/novu-DxuaDf-Z.d.ts} +28 -1
- package/dist/{esm/novu-event-emitter-C7GZ7-r1.d.mts → cjs/novu-event-emitter-BOA_6GfJ.d.ts} +195 -1
- package/dist/cjs/themes/index.d.ts +11 -5
- package/dist/cjs/themes/index.js +17 -1
- package/dist/cjs/types-Buzm23uF.d.ts +836 -0
- package/dist/cjs/ui/index.d.ts +74 -8
- package/dist/cjs/ui/index.js +1836 -261
- package/dist/esm/{chunk-76A4RQYD.mjs → chunk-NF4ANB6D.mjs} +1038 -265
- package/dist/esm/{chunk-GY4JXBST.mjs → chunk-SWKDFXVR.mjs} +6 -1
- package/dist/esm/index.d.mts +4 -3
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/internal/index.d.mts +8 -2
- package/dist/esm/internal/index.mjs +1 -1
- package/dist/{cjs/novu-CKWESYFZ.d.ts → esm/novu-DY8vwRGE.d.mts} +28 -1
- package/dist/{cjs/novu-event-emitter-C7GZ7-r1.d.ts → esm/novu-event-emitter-BOA_6GfJ.d.mts} +195 -1
- package/dist/esm/themes/index.d.mts +11 -5
- package/dist/esm/themes/index.mjs +16 -2
- package/dist/esm/types-xBjzv9ok.d.mts +836 -0
- package/dist/esm/ui/index.d.mts +74 -8
- package/dist/esm/ui/index.mjs +1833 -257
- package/dist/index.css +1 -1
- package/dist/novu.min.js +12 -12
- package/dist/novu.min.js.gz +0 -0
- package/package.json +2 -1
- package/dist/cjs/types-CeLsxWJg.d.ts +0 -537
- package/dist/esm/types-4YuozpWu.d.mts +0 -537
|
@@ -31,6 +31,11 @@ function buildSubscriber({
|
|
|
31
31
|
return { subscriberId: "" };
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
// src/ui/internal/buildSubscriptionIdentifier.ts
|
|
35
|
+
function buildSubscriptionIdentifier({ topicKey, subscriberId }) {
|
|
36
|
+
return `tk_${topicKey}:si_${subscriberId}`;
|
|
37
|
+
}
|
|
38
|
+
|
|
34
39
|
// src/types.ts
|
|
35
40
|
var NotificationStatus = /* @__PURE__ */ ((NotificationStatus2) => {
|
|
36
41
|
NotificationStatus2["READ"] = "read";
|
|
@@ -777,6 +782,7 @@ exports.archiveAll = archiveAll;
|
|
|
777
782
|
exports.archiveAllRead = archiveAllRead;
|
|
778
783
|
exports.buildContextKey = buildContextKey;
|
|
779
784
|
exports.buildSubscriber = buildSubscriber;
|
|
785
|
+
exports.buildSubscriptionIdentifier = buildSubscriptionIdentifier;
|
|
780
786
|
exports.completeAction = completeAction;
|
|
781
787
|
exports.createNotification = createNotification;
|
|
782
788
|
exports.deleteAll = deleteAll;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
1
|
+
export * from 'json-logic-js';
|
|
2
|
+
import { S as SeverityLevelEnum, N as NotificationFilter, a as Notification } from './novu-event-emitter-BOA_6GfJ.js';
|
|
3
|
+
export { B as BaseDeleteSubscriptionArgs, f as BaseUpdateSubscriptionArgs, j as ChannelPreference, k as ChannelType, l as Context, C as CreateSubscriptionArgs, m as DaySchedule, n as DefaultSchedule, D as DeleteSubscriptionArgs, E as EventHandler, b as Events, F as FiltersCountResponse, G as GetSubscriptionArgs, o as InboxNotification, I as InstanceDeleteSubscriptionArgs, g as InstanceUpdateSubscriptionArgs, p as ListNotificationsResponse, L as ListSubscriptionsArgs, q as NotificationStatus, K as NovuError, r as NovuOptions, s as Preference, P as PreferenceFilter, t as PreferenceLevel, u as PreferencesResponse, v as Schedule, c as SocketEventNames, w as StandardNovuOptions, x as Subscriber, h as SubscriptionPreference, y as TimeRange, T as TopicSubscription, z as UnreadCount, U as UpdateSubscriptionArgs, i as UpdateSubscriptionPreferenceArgs, A as WebSocketEvent, H as WeeklySchedule, J as WorkflowCriticalityEnum, W as WorkflowFilter, d as WorkflowGroupFilter, e as WorkflowIdentifierOrId } from './novu-event-emitter-BOA_6GfJ.js';
|
|
4
|
+
export { N as Novu } from './novu-DxuaDf-Z.js';
|
|
4
5
|
|
|
5
6
|
declare const areTagsEqual: (tags1?: string[], tags2?: string[]) => boolean;
|
|
6
7
|
declare const areSeveritiesEqual: (el1?: SeverityLevelEnum | SeverityLevelEnum[], el2?: SeverityLevelEnum | SeverityLevelEnum[]) => boolean;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,56 +1,68 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkC6V4UPCA_js = require('./chunk-C6V4UPCA.js');
|
|
4
|
+
var chunkCDGREQFE_js = require('./chunk-CDGREQFE.js');
|
|
5
5
|
require('./chunk-7B52C2XE.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "Novu", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkC6V4UPCA_js.Novu; }
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "SubscriptionPreference", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return chunkC6V4UPCA_js.SubscriptionPreference; }
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "TopicSubscription", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return chunkC6V4UPCA_js.TopicSubscription; }
|
|
12
20
|
});
|
|
13
21
|
Object.defineProperty(exports, "areSeveritiesEqual", {
|
|
14
22
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkC6V4UPCA_js.areSeveritiesEqual; }
|
|
16
24
|
});
|
|
17
25
|
Object.defineProperty(exports, "areTagsEqual", {
|
|
18
26
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkC6V4UPCA_js.areTagsEqual; }
|
|
20
28
|
});
|
|
21
29
|
Object.defineProperty(exports, "checkNotificationDataFilter", {
|
|
22
30
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkC6V4UPCA_js.checkNotificationDataFilter; }
|
|
24
32
|
});
|
|
25
33
|
Object.defineProperty(exports, "checkNotificationMatchesFilter", {
|
|
26
34
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkC6V4UPCA_js.checkNotificationMatchesFilter; }
|
|
28
36
|
});
|
|
29
37
|
Object.defineProperty(exports, "isSameFilter", {
|
|
30
38
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkC6V4UPCA_js.isSameFilter; }
|
|
32
40
|
});
|
|
33
41
|
Object.defineProperty(exports, "ChannelType", {
|
|
34
42
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkCDGREQFE_js.ChannelType; }
|
|
36
44
|
});
|
|
37
45
|
Object.defineProperty(exports, "NotificationStatus", {
|
|
38
46
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkCDGREQFE_js.NotificationStatus; }
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "NovuError", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function () { return chunkCDGREQFE_js.NovuError; }
|
|
40
52
|
});
|
|
41
53
|
Object.defineProperty(exports, "PreferenceLevel", {
|
|
42
54
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunkCDGREQFE_js.PreferenceLevel; }
|
|
44
56
|
});
|
|
45
57
|
Object.defineProperty(exports, "SeverityLevelEnum", {
|
|
46
58
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunkCDGREQFE_js.SeverityLevelEnum; }
|
|
48
60
|
});
|
|
49
61
|
Object.defineProperty(exports, "WebSocketEvent", {
|
|
50
62
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunkCDGREQFE_js.WebSocketEvent; }
|
|
52
64
|
});
|
|
53
65
|
Object.defineProperty(exports, "WorkflowCriticalityEnum", {
|
|
54
66
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunkCDGREQFE_js.WorkflowCriticalityEnum; }
|
|
56
68
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as Context, x as Subscriber, O as NovuEventEmitter, M as InboxService, o as InboxNotification, a as Notification } from '../novu-event-emitter-BOA_6GfJ.js';
|
|
2
|
+
import 'json-logic-js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Builds a compact, stable string key from context objects by extracting only type:id pairs.
|
|
@@ -19,6 +20,11 @@ declare function buildSubscriber({ subscriberId, subscriber, }: {
|
|
|
19
20
|
subscriber: Subscriber | string | undefined;
|
|
20
21
|
}): Subscriber;
|
|
21
22
|
|
|
23
|
+
declare function buildSubscriptionIdentifier({ topicKey, subscriberId }: {
|
|
24
|
+
topicKey: string;
|
|
25
|
+
subscriberId?: string;
|
|
26
|
+
}): string;
|
|
27
|
+
|
|
22
28
|
declare function createNotification({ emitter, inboxService, notification, }: {
|
|
23
29
|
emitter: NovuEventEmitter;
|
|
24
30
|
inboxService: InboxService;
|
|
@@ -31,4 +37,4 @@ interface Token {
|
|
|
31
37
|
}
|
|
32
38
|
declare const parseMarkdownIntoTokens: (text: string) => Token[];
|
|
33
39
|
|
|
34
|
-
export { type Token, buildContextKey, buildSubscriber, createNotification, parseMarkdownIntoTokens };
|
|
40
|
+
export { type Token, buildContextKey, buildSubscriber, buildSubscriptionIdentifier, createNotification, parseMarkdownIntoTokens };
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkCDGREQFE_js = require('../chunk-CDGREQFE.js');
|
|
4
4
|
require('../chunk-7B52C2XE.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "buildContextKey", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkCDGREQFE_js.buildContextKey; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "buildSubscriber", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkCDGREQFE_js.buildSubscriber; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "buildSubscriptionIdentifier", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return chunkCDGREQFE_js.buildSubscriptionIdentifier; }
|
|
15
19
|
});
|
|
16
20
|
Object.defineProperty(exports, "createNotification", {
|
|
17
21
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkCDGREQFE_js.createNotification; }
|
|
19
23
|
});
|
|
20
24
|
Object.defineProperty(exports, "parseMarkdownIntoTokens", {
|
|
21
25
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkCDGREQFE_js.parseMarkdownIntoTokens; }
|
|
23
27
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { M as InboxService, O as NovuEventEmitter, Q as Session, R as Result, V as ScheduleCache, v as Schedule, X as UpdateScheduleArgs, Y as PreferencesCache, Z as ListPreferencesArgs, s as Preference, _ as BasePreferenceArgs, $ as InstancePreferenceArgs, a0 as ListNotificationsArgs, p as ListNotificationsResponse, o as InboxNotification, a as Notification, N as NotificationFilter, a1 as FilterCountArgs, a2 as FilterCountResponse, a3 as FiltersCountArgs, F as FiltersCountResponse, a4 as BaseArgs, a5 as InstanceArgs, a6 as SnoozeArgs, a7 as SubscriptionsCache, x as Subscriber, L as ListSubscriptionsArgs, a8 as Options, T as TopicSubscription, G as GetSubscriptionArgs, C as CreateSubscriptionArgs, f as BaseUpdateSubscriptionArgs, g as InstanceUpdateSubscriptionArgs, B as BaseDeleteSubscriptionArgs, I as InstanceDeleteSubscriptionArgs, c as SocketEventNames, a9 as EventNames, E as EventHandler, b as Events, aa as ContextValue, r as NovuOptions, l as Context } from './novu-event-emitter-BOA_6GfJ.js';
|
|
2
2
|
|
|
3
3
|
declare class BaseModule {
|
|
4
4
|
#private;
|
|
@@ -130,6 +130,24 @@ declare class Notifications extends BaseModule {
|
|
|
130
130
|
triggerHelloWorldEvent(): Promise<any>;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
declare class Subscriptions extends BaseModule {
|
|
134
|
+
#private;
|
|
135
|
+
readonly cache: SubscriptionsCache;
|
|
136
|
+
constructor({ useCache, inboxServiceInstance, eventEmitterInstance, subscriber, }: {
|
|
137
|
+
useCache: boolean;
|
|
138
|
+
inboxServiceInstance: InboxService;
|
|
139
|
+
eventEmitterInstance: NovuEventEmitter;
|
|
140
|
+
subscriber: Subscriber;
|
|
141
|
+
});
|
|
142
|
+
list(args: ListSubscriptionsArgs, options?: Options): Result<TopicSubscription[]>;
|
|
143
|
+
get(args: GetSubscriptionArgs, options?: Options): Result<TopicSubscription | null>;
|
|
144
|
+
create(args: CreateSubscriptionArgs): Result<TopicSubscription>;
|
|
145
|
+
update(args: BaseUpdateSubscriptionArgs): Result<TopicSubscription>;
|
|
146
|
+
update(args: InstanceUpdateSubscriptionArgs): Result<TopicSubscription>;
|
|
147
|
+
delete(args: BaseDeleteSubscriptionArgs): Result<void>;
|
|
148
|
+
delete(args: InstanceDeleteSubscriptionArgs): Result<void>;
|
|
149
|
+
}
|
|
150
|
+
|
|
133
151
|
interface BaseSocketInterface {
|
|
134
152
|
isSocketEvent(eventName: string): eventName is SocketEventNames;
|
|
135
153
|
connect(): Result<void>;
|
|
@@ -140,6 +158,7 @@ declare class Novu implements Pick<NovuEventEmitter, 'on'> {
|
|
|
140
158
|
#private;
|
|
141
159
|
readonly notifications: Notifications;
|
|
142
160
|
readonly preferences: Preferences;
|
|
161
|
+
readonly subscriptions: Subscriptions;
|
|
143
162
|
readonly socket: BaseSocketInterface;
|
|
144
163
|
on: <Key extends EventNames>(eventName: Key, listener: EventHandler<Events[Key]>) => () => void;
|
|
145
164
|
/**
|
|
@@ -150,12 +169,20 @@ declare class Novu implements Pick<NovuEventEmitter, 'on'> {
|
|
|
150
169
|
get applicationIdentifier(): string | undefined;
|
|
151
170
|
get subscriberId(): string | undefined;
|
|
152
171
|
get context(): Partial<Record<string, ContextValue>> | undefined;
|
|
172
|
+
get options(): NovuOptions;
|
|
153
173
|
get contextKey(): string;
|
|
154
174
|
constructor(options: NovuOptions);
|
|
175
|
+
private clearCache;
|
|
176
|
+
/**
|
|
177
|
+
* @deprecated
|
|
178
|
+
*/
|
|
155
179
|
changeSubscriber(options: {
|
|
156
180
|
subscriber: Subscriber;
|
|
157
181
|
subscriberHash?: string;
|
|
158
182
|
}): Promise<void>;
|
|
183
|
+
/**
|
|
184
|
+
* @deprecated
|
|
185
|
+
*/
|
|
159
186
|
changeContext(options: {
|
|
160
187
|
context: Context;
|
|
161
188
|
contextHash?: string;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { RulesLogic } from 'json-logic-js';
|
|
2
|
+
|
|
1
3
|
type HttpClientOptions = {
|
|
2
4
|
apiVersion?: string;
|
|
3
5
|
apiUrl?: string;
|
|
@@ -5,6 +7,32 @@ type HttpClientOptions = {
|
|
|
5
7
|
headers?: Record<string, string>;
|
|
6
8
|
};
|
|
7
9
|
|
|
10
|
+
declare class SubscriptionsCache {
|
|
11
|
+
#private;
|
|
12
|
+
constructor({ emitterInstance, inboxServiceInstance, useCache, }: {
|
|
13
|
+
emitterInstance: NovuEventEmitter;
|
|
14
|
+
inboxServiceInstance: InboxService;
|
|
15
|
+
useCache: boolean;
|
|
16
|
+
});
|
|
17
|
+
private handleCreate;
|
|
18
|
+
private handleUpdate;
|
|
19
|
+
private handlePreferenceUpdate;
|
|
20
|
+
private handleBulkPreferenceUpdate;
|
|
21
|
+
private updateSubscriptionPreferences;
|
|
22
|
+
private createUpdatedSubscription;
|
|
23
|
+
private handleDelete;
|
|
24
|
+
private handleDeleteById;
|
|
25
|
+
has(args: ListSubscriptionsArgs): boolean;
|
|
26
|
+
set(args: ListSubscriptionsArgs, data: TopicSubscription[]): void;
|
|
27
|
+
setOne(args: GetSubscriptionArgs, data: TopicSubscription): void;
|
|
28
|
+
getAll(args: ListSubscriptionsArgs): TopicSubscription[] | undefined;
|
|
29
|
+
get(args: GetSubscriptionArgs): TopicSubscription | undefined;
|
|
30
|
+
invalidate(args: {
|
|
31
|
+
topicKey: string;
|
|
32
|
+
}): void;
|
|
33
|
+
clearAll(): void;
|
|
34
|
+
}
|
|
35
|
+
|
|
8
36
|
declare class NovuError extends Error {
|
|
9
37
|
originalError: Error;
|
|
10
38
|
constructor(message: string, originalError: unknown);
|
|
@@ -258,6 +286,8 @@ type Context = Partial<Record<string, ContextValue>>;
|
|
|
258
286
|
type PreferencesResponse = {
|
|
259
287
|
level: PreferenceLevel;
|
|
260
288
|
enabled: boolean;
|
|
289
|
+
condition?: RulesLogic;
|
|
290
|
+
subscriptionId?: string;
|
|
261
291
|
channels: ChannelPreference;
|
|
262
292
|
overrides?: IPreferenceOverride[];
|
|
263
293
|
workflow?: Workflow;
|
|
@@ -275,6 +305,20 @@ type IPreferenceOverride = {
|
|
|
275
305
|
channel: ChannelType;
|
|
276
306
|
source: PreferenceOverrideSourceEnum;
|
|
277
307
|
};
|
|
308
|
+
type SubscriptionPreferenceResponse = Omit<PreferencesResponse, 'subscriptionId' | 'workflow' | 'schedule' | 'level' | 'channels'> & {
|
|
309
|
+
subscriptionId: string;
|
|
310
|
+
workflow: Workflow;
|
|
311
|
+
};
|
|
312
|
+
type SubscriptionResponse = {
|
|
313
|
+
id: string;
|
|
314
|
+
identifier: string;
|
|
315
|
+
name?: string;
|
|
316
|
+
preferences?: Array<SubscriptionPreferenceResponse>;
|
|
317
|
+
};
|
|
318
|
+
type Options = {
|
|
319
|
+
refetch?: boolean;
|
|
320
|
+
useCache?: boolean;
|
|
321
|
+
};
|
|
278
322
|
type Result<D = undefined, E = NovuError> = Promise<{
|
|
279
323
|
data?: D;
|
|
280
324
|
error?: E;
|
|
@@ -308,6 +352,99 @@ type Prettify<T> = {
|
|
|
308
352
|
[K in keyof T]: T[K];
|
|
309
353
|
} & {};
|
|
310
354
|
|
|
355
|
+
declare class SubscriptionPreference {
|
|
356
|
+
#private;
|
|
357
|
+
readonly subscriptionId: string;
|
|
358
|
+
readonly workflow: Workflow;
|
|
359
|
+
readonly enabled: boolean;
|
|
360
|
+
readonly condition?: RulesLogic;
|
|
361
|
+
constructor(preference: SubscriptionPreferenceResponse, emitter: NovuEventEmitter, inboxService: InboxService, cache: SubscriptionsCache, useCache?: boolean);
|
|
362
|
+
update(args: {
|
|
363
|
+
value: boolean | RulesLogic;
|
|
364
|
+
}): Result<SubscriptionPreference>;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
declare class TopicSubscription {
|
|
368
|
+
#private;
|
|
369
|
+
readonly id: string;
|
|
370
|
+
readonly identifier: string;
|
|
371
|
+
readonly topicKey: string;
|
|
372
|
+
readonly preferences?: Array<SubscriptionPreference> | undefined;
|
|
373
|
+
constructor(subscription: SubscriptionResponse & {
|
|
374
|
+
topicKey: string;
|
|
375
|
+
}, emitter: NovuEventEmitter, inboxService: InboxService, cache: SubscriptionsCache, useCache?: boolean);
|
|
376
|
+
update(args: BaseUpdateSubscriptionArgs): Result<TopicSubscription>;
|
|
377
|
+
update(args: InstanceUpdateSubscriptionArgs): Result<TopicSubscription>;
|
|
378
|
+
updatePreference(args: BaseSubscriptionPreferenceArgs): Result<SubscriptionPreference>;
|
|
379
|
+
updatePreference(args: InstanceSubscriptionPreferenceArgs): Result<SubscriptionPreference>;
|
|
380
|
+
bulkUpdatePreferences(args: Array<BaseSubscriptionPreferenceArgs>): Result<SubscriptionPreference[]>;
|
|
381
|
+
bulkUpdatePreferences(args: Array<InstanceSubscriptionPreferenceArgs>): Result<SubscriptionPreference[]>;
|
|
382
|
+
delete(): Result<void>;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
type WorkflowIdentifierOrId = string;
|
|
386
|
+
type WorkflowFilter = {
|
|
387
|
+
workflowId: WorkflowIdentifierOrId;
|
|
388
|
+
enabled?: boolean;
|
|
389
|
+
condition?: RulesLogic;
|
|
390
|
+
filter?: never;
|
|
391
|
+
};
|
|
392
|
+
type WorkflowGroupFilter = {
|
|
393
|
+
filter: {
|
|
394
|
+
workflowIds?: Array<WorkflowIdentifierOrId>;
|
|
395
|
+
tags?: string[];
|
|
396
|
+
};
|
|
397
|
+
enabled?: boolean;
|
|
398
|
+
condition?: RulesLogic;
|
|
399
|
+
workflowId?: never;
|
|
400
|
+
};
|
|
401
|
+
type PreferenceFilter = WorkflowIdentifierOrId | WorkflowFilter | WorkflowGroupFilter;
|
|
402
|
+
type ListSubscriptionsArgs = {
|
|
403
|
+
topicKey: string;
|
|
404
|
+
};
|
|
405
|
+
type GetSubscriptionArgs = {
|
|
406
|
+
topicKey: string;
|
|
407
|
+
identifier?: string;
|
|
408
|
+
workflowIds?: string[];
|
|
409
|
+
tags?: string[];
|
|
410
|
+
};
|
|
411
|
+
type CreateSubscriptionArgs = {
|
|
412
|
+
topicKey: string;
|
|
413
|
+
topicName?: string;
|
|
414
|
+
identifier?: string;
|
|
415
|
+
name?: string;
|
|
416
|
+
preferences?: Array<PreferenceFilter> | undefined;
|
|
417
|
+
};
|
|
418
|
+
type BaseUpdateSubscriptionArgs = {
|
|
419
|
+
topicKey: string;
|
|
420
|
+
subscriptionId: string;
|
|
421
|
+
name?: string;
|
|
422
|
+
preferences?: Array<PreferenceFilter>;
|
|
423
|
+
};
|
|
424
|
+
type InstanceUpdateSubscriptionArgs = {
|
|
425
|
+
subscription: TopicSubscription;
|
|
426
|
+
name?: string;
|
|
427
|
+
preferences?: Array<PreferenceFilter>;
|
|
428
|
+
};
|
|
429
|
+
type UpdateSubscriptionArgs = BaseUpdateSubscriptionArgs | InstanceUpdateSubscriptionArgs;
|
|
430
|
+
type BaseSubscriptionPreferenceArgs = {
|
|
431
|
+
workflowId: string;
|
|
432
|
+
value: boolean | RulesLogic;
|
|
433
|
+
};
|
|
434
|
+
type InstanceSubscriptionPreferenceArgs = {
|
|
435
|
+
preference: SubscriptionPreference;
|
|
436
|
+
value: boolean | RulesLogic;
|
|
437
|
+
};
|
|
438
|
+
type UpdateSubscriptionPreferenceArgs = BaseSubscriptionPreferenceArgs | InstanceSubscriptionPreferenceArgs;
|
|
439
|
+
type BaseDeleteSubscriptionArgs = {
|
|
440
|
+
subscriptionId: string;
|
|
441
|
+
topicKey: string;
|
|
442
|
+
};
|
|
443
|
+
type InstanceDeleteSubscriptionArgs = {
|
|
444
|
+
subscription: TopicSubscription;
|
|
445
|
+
};
|
|
446
|
+
type DeleteSubscriptionArgs = BaseDeleteSubscriptionArgs | InstanceDeleteSubscriptionArgs;
|
|
447
|
+
|
|
311
448
|
type InboxServiceOptions = HttpClientOptions;
|
|
312
449
|
declare class InboxService {
|
|
313
450
|
#private;
|
|
@@ -410,6 +547,47 @@ declare class InboxService {
|
|
|
410
547
|
}): Promise<PreferencesResponse>;
|
|
411
548
|
fetchGlobalPreferences(): Promise<PreferencesResponse>;
|
|
412
549
|
triggerHelloWorldEvent(): Promise<unknown>;
|
|
550
|
+
fetchSubscriptions(topicKey: string): Promise<SubscriptionResponse[]>;
|
|
551
|
+
getSubscription(topicKey: string, identifier?: string, workflowIds?: string[], tags?: string[]): Promise<SubscriptionResponse | undefined>;
|
|
552
|
+
createSubscription({ identifier, name, topicKey, topicName, preferences, }: {
|
|
553
|
+
identifier?: string;
|
|
554
|
+
name?: string;
|
|
555
|
+
topicKey: string;
|
|
556
|
+
topicName?: string;
|
|
557
|
+
preferences?: Array<PreferenceFilter>;
|
|
558
|
+
}): Promise<SubscriptionResponse>;
|
|
559
|
+
updateSubscription({ topicKey, subscriptionId, name, preferences, }: {
|
|
560
|
+
topicKey: string;
|
|
561
|
+
subscriptionId: string;
|
|
562
|
+
name?: string;
|
|
563
|
+
preferences?: Array<PreferenceFilter>;
|
|
564
|
+
}): Promise<SubscriptionResponse>;
|
|
565
|
+
updateSubscriptionPreference({ subscriptionId, workflowId, enabled, condition, email, sms, in_app, chat, push, }: {
|
|
566
|
+
subscriptionId: string;
|
|
567
|
+
workflowId: string;
|
|
568
|
+
enabled?: boolean;
|
|
569
|
+
condition?: RulesLogic;
|
|
570
|
+
email?: boolean;
|
|
571
|
+
sms?: boolean;
|
|
572
|
+
in_app?: boolean;
|
|
573
|
+
chat?: boolean;
|
|
574
|
+
push?: boolean;
|
|
575
|
+
}): Promise<SubscriptionPreferenceResponse>;
|
|
576
|
+
bulkUpdateSubscriptionPreferences(preferences: Array<{
|
|
577
|
+
subscriptionIdOrIdentifier: string;
|
|
578
|
+
workflowId: string;
|
|
579
|
+
enabled?: boolean;
|
|
580
|
+
condition?: RulesLogic;
|
|
581
|
+
email?: boolean;
|
|
582
|
+
sms?: boolean;
|
|
583
|
+
in_app?: boolean;
|
|
584
|
+
chat?: boolean;
|
|
585
|
+
push?: boolean;
|
|
586
|
+
}>): Promise<SubscriptionPreferenceResponse[]>;
|
|
587
|
+
deleteSubscription({ topicKey, subscriptionId }: {
|
|
588
|
+
topicKey: string;
|
|
589
|
+
subscriptionId: string;
|
|
590
|
+
}): Promise<void>;
|
|
413
591
|
}
|
|
414
592
|
|
|
415
593
|
declare class Notification implements Pick<NovuEventEmitter, 'on'>, InboxNotification {
|
|
@@ -593,6 +771,15 @@ type PreferenceUpdateEvents = BaseEvents<'preference.update', UpdatePreferenceAr
|
|
|
593
771
|
type PreferencesBulkUpdateEvents = BaseEvents<'preferences.bulk_update', Array<UpdatePreferenceArgs>, Preference[]>;
|
|
594
772
|
type PreferenceScheduleGetEvents = BaseEvents<'preference.schedule.get', undefined, Schedule>;
|
|
595
773
|
type PreferenceScheduleUpdateEvents = BaseEvents<'preference.schedule.update', UpdateScheduleArgs, Schedule>;
|
|
774
|
+
type SubscriptionsFetchEvents = BaseEvents<'subscriptions.list', ListSubscriptionsArgs, TopicSubscription[]>;
|
|
775
|
+
type SubscriptionGetEvents = BaseEvents<'subscription.get', GetSubscriptionArgs, TopicSubscription | null>;
|
|
776
|
+
type SubscriptionCreateEvents = BaseEvents<'subscription.create', CreateSubscriptionArgs, TopicSubscription>;
|
|
777
|
+
type SubscriptionUpdateEvents = BaseEvents<'subscription.update', UpdateSubscriptionArgs, TopicSubscription>;
|
|
778
|
+
type SubscriptionPreferenceUpdateEvents = BaseEvents<'subscription.preference.update', UpdateSubscriptionPreferenceArgs, SubscriptionPreference>;
|
|
779
|
+
type SubscriptionPreferencesBulkUpdateEvents = BaseEvents<'subscription.preferences.bulk_update', Array<UpdateSubscriptionPreferenceArgs & {
|
|
780
|
+
subscriptionId: string;
|
|
781
|
+
}>, SubscriptionPreference[]>;
|
|
782
|
+
type SubscriptionDeleteEvents = BaseEvents<'subscription.delete', DeleteSubscriptionArgs, void>;
|
|
596
783
|
type SocketConnectEvents = BaseEvents<'socket.connect', {
|
|
597
784
|
socketUrl: string;
|
|
598
785
|
}, undefined>;
|
|
@@ -639,6 +826,13 @@ type Events = SessionInitializeEvents & NotificationsFetchEvents & {
|
|
|
639
826
|
'preference.schedule.get.updated': {
|
|
640
827
|
data: Schedule;
|
|
641
828
|
};
|
|
829
|
+
} & SubscriptionsFetchEvents & SubscriptionGetEvents & SubscriptionCreateEvents & SubscriptionPreferenceUpdateEvents & SubscriptionUpdateEvents & SubscriptionPreferencesBulkUpdateEvents & SubscriptionDeleteEvents & {
|
|
830
|
+
'subscriptions.list.updated': {
|
|
831
|
+
data: {
|
|
832
|
+
topicKey: string;
|
|
833
|
+
subscriptions: TopicSubscription[];
|
|
834
|
+
};
|
|
835
|
+
};
|
|
642
836
|
} & SocketConnectEvents & SocketEvents & NotificationReadEvents & NotificationUnreadEvents & NotificationSeenEvents & NotificationArchiveEvents & NotificationUnarchiveEvents & NotificationDeleteEvents & NotificationSnoozeEvents & NotificationUnsnoozeEvents & NotificationCompleteActionEvents & NotificationRevertActionEvents & NotificationsReadAllEvents & NotificationsSeenAllEvents & NotificationsArchivedAllEvents & NotificationsReadArchivedAllEvents & NotificationsDeletedAllEvents;
|
|
643
837
|
type EventNames = keyof Events;
|
|
644
838
|
type SocketEventNames = keyof SocketEvents;
|
|
@@ -652,4 +846,4 @@ declare class NovuEventEmitter {
|
|
|
652
846
|
emit<Key extends EventNames>(type: Key, event?: Events[Key]): void;
|
|
653
847
|
}
|
|
654
848
|
|
|
655
|
-
export { type
|
|
849
|
+
export { type InstancePreferenceArgs as $, WebSocketEvent as A, type BaseDeleteSubscriptionArgs as B, type CreateSubscriptionArgs as C, type DeleteSubscriptionArgs as D, type EventHandler as E, type FiltersCountResponse as F, type GetSubscriptionArgs as G, type WeeklySchedule as H, type InstanceDeleteSubscriptionArgs as I, WorkflowCriticalityEnum as J, NovuError as K, type ListSubscriptionsArgs as L, InboxService as M, type NotificationFilter as N, NovuEventEmitter as O, type PreferenceFilter as P, type Session as Q, type Result as R, SeverityLevelEnum as S, TopicSubscription as T, type UpdateSubscriptionArgs as U, ScheduleCache as V, type WorkflowFilter as W, type UpdateScheduleArgs as X, PreferencesCache as Y, type ListPreferencesArgs as Z, type BasePreferenceArgs as _, Notification as a, type ListNotificationsArgs as a0, type FilterCountArgs as a1, type FilterCountResponse as a2, type FiltersCountArgs as a3, type BaseArgs as a4, type InstanceArgs as a5, type SnoozeArgs as a6, SubscriptionsCache as a7, type Options as a8, type EventNames as a9, type ContextValue as aa, type Events as b, type SocketEventNames as c, type WorkflowGroupFilter as d, type WorkflowIdentifierOrId as e, type BaseUpdateSubscriptionArgs as f, type InstanceUpdateSubscriptionArgs as g, SubscriptionPreference as h, type UpdateSubscriptionPreferenceArgs as i, type ChannelPreference as j, ChannelType as k, type Context as l, type DaySchedule as m, type DefaultSchedule as n, type InboxNotification as o, type ListNotificationsResponse as p, NotificationStatus as q, type NovuOptions as r, Preference as s, PreferenceLevel as t, type PreferencesResponse as u, Schedule as v, type StandardNovuOptions as w, type Subscriber as x, type TimeRange as y, type UnreadCount as z };
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '../novu-event-emitter-
|
|
3
|
-
import '
|
|
1
|
+
import { G as InboxTheme, Y as SubscriptionTheme } from '../types-Buzm23uF.js';
|
|
2
|
+
import '../novu-event-emitter-BOA_6GfJ.js';
|
|
3
|
+
import 'json-logic-js';
|
|
4
|
+
import '../novu-DxuaDf-Z.js';
|
|
4
5
|
|
|
5
|
-
declare const
|
|
6
|
+
declare const inboxDarkTheme: InboxTheme;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Use inboxDarkTheme instead
|
|
9
|
+
*/
|
|
10
|
+
declare const dark: InboxTheme;
|
|
11
|
+
declare const subscriptionDarkTheme: SubscriptionTheme;
|
|
6
12
|
|
|
7
|
-
export { dark };
|
|
13
|
+
export { dark, inboxDarkTheme, subscriptionDarkTheme };
|
package/dist/cjs/themes/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
require('../chunk-7B52C2XE.js');
|
|
4
4
|
|
|
5
5
|
// src/ui/themes/dark.ts
|
|
6
|
-
var
|
|
6
|
+
var inboxDarkTheme = {
|
|
7
7
|
variables: {
|
|
8
8
|
colorNeutral: "white",
|
|
9
9
|
colorBackground: "#1A1A1A",
|
|
@@ -25,5 +25,21 @@ var dark = {
|
|
|
25
25
|
bellSeverityGlow: "nt-bg-severity-none-alpha-300 before:nt-bg-severity-none-alpha-300"
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
+
var dark = inboxDarkTheme;
|
|
29
|
+
var subscriptionDarkTheme = {
|
|
30
|
+
variables: {
|
|
31
|
+
colorNeutral: "white",
|
|
32
|
+
colorBackground: "#1A1A1A",
|
|
33
|
+
colorForeground: "#EDEDEF",
|
|
34
|
+
colorSecondary: "#383838",
|
|
35
|
+
colorSecondaryForeground: "#EDEDEF",
|
|
36
|
+
colorShadow: "black",
|
|
37
|
+
colorRing: "#E1E4EA",
|
|
38
|
+
colorStripes: "#FF8447"
|
|
39
|
+
},
|
|
40
|
+
elements: {}
|
|
41
|
+
};
|
|
28
42
|
|
|
29
43
|
exports.dark = dark;
|
|
44
|
+
exports.inboxDarkTheme = inboxDarkTheme;
|
|
45
|
+
exports.subscriptionDarkTheme = subscriptionDarkTheme;
|