@lssm/module.notifications 0.0.0-canary-20251217054315 → 0.0.0-canary-20251217060433
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/channels/index.d.ts +106 -0
- package/dist/contracts/index.d.ts +637 -0
- package/dist/entities/index.d.ts +182 -0
- package/dist/index.d.ts +6 -0
- package/dist/notifications.feature.d.ts +11 -0
- package/dist/templates/index.d.ts +91 -0
- package/package.json +12 -12
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//#region src/channels/index.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Notification channel interface.
|
|
4
|
+
*/
|
|
5
|
+
interface NotificationChannel {
|
|
6
|
+
/** Channel identifier */
|
|
7
|
+
readonly channelId: string;
|
|
8
|
+
/** Deliver a notification */
|
|
9
|
+
send(notification: ChannelNotification): Promise<ChannelDeliveryResult>;
|
|
10
|
+
/** Check if channel is available */
|
|
11
|
+
isAvailable(): Promise<boolean>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Notification to deliver via a channel.
|
|
15
|
+
*/
|
|
16
|
+
interface ChannelNotification {
|
|
17
|
+
id: string;
|
|
18
|
+
userId: string;
|
|
19
|
+
title: string;
|
|
20
|
+
body: string;
|
|
21
|
+
actionUrl?: string;
|
|
22
|
+
imageUrl?: string;
|
|
23
|
+
metadata?: Record<string, unknown>;
|
|
24
|
+
email?: {
|
|
25
|
+
to: string;
|
|
26
|
+
subject: string;
|
|
27
|
+
html?: string;
|
|
28
|
+
text?: string;
|
|
29
|
+
};
|
|
30
|
+
push?: {
|
|
31
|
+
token: string;
|
|
32
|
+
badge?: number;
|
|
33
|
+
sound?: string;
|
|
34
|
+
data?: Record<string, unknown>;
|
|
35
|
+
};
|
|
36
|
+
webhook?: {
|
|
37
|
+
url: string;
|
|
38
|
+
headers?: Record<string, string>;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Result of channel delivery attempt.
|
|
43
|
+
*/
|
|
44
|
+
interface ChannelDeliveryResult {
|
|
45
|
+
success: boolean;
|
|
46
|
+
externalId?: string;
|
|
47
|
+
responseCode?: string;
|
|
48
|
+
responseMessage?: string;
|
|
49
|
+
metadata?: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* In-app notification channel (stores in database).
|
|
53
|
+
*/
|
|
54
|
+
declare class InAppChannel implements NotificationChannel {
|
|
55
|
+
readonly channelId = "IN_APP";
|
|
56
|
+
send(notification: ChannelNotification): Promise<ChannelDeliveryResult>;
|
|
57
|
+
isAvailable(): Promise<boolean>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Console channel for development/testing.
|
|
61
|
+
*/
|
|
62
|
+
declare class ConsoleChannel implements NotificationChannel {
|
|
63
|
+
readonly channelId = "CONSOLE";
|
|
64
|
+
send(notification: ChannelNotification): Promise<ChannelDeliveryResult>;
|
|
65
|
+
isAvailable(): Promise<boolean>;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Email channel interface (to be implemented with provider).
|
|
69
|
+
*/
|
|
70
|
+
declare abstract class EmailChannel implements NotificationChannel {
|
|
71
|
+
readonly channelId = "EMAIL";
|
|
72
|
+
abstract send(notification: ChannelNotification): Promise<ChannelDeliveryResult>;
|
|
73
|
+
isAvailable(): Promise<boolean>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Push notification channel interface (to be implemented with provider).
|
|
77
|
+
*/
|
|
78
|
+
declare abstract class PushChannel implements NotificationChannel {
|
|
79
|
+
readonly channelId = "PUSH";
|
|
80
|
+
abstract send(notification: ChannelNotification): Promise<ChannelDeliveryResult>;
|
|
81
|
+
isAvailable(): Promise<boolean>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Webhook channel for external integrations.
|
|
85
|
+
*/
|
|
86
|
+
declare class WebhookChannel implements NotificationChannel {
|
|
87
|
+
readonly channelId = "WEBHOOK";
|
|
88
|
+
send(notification: ChannelNotification): Promise<ChannelDeliveryResult>;
|
|
89
|
+
isAvailable(): Promise<boolean>;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Channel registry for managing available channels.
|
|
93
|
+
*/
|
|
94
|
+
declare class ChannelRegistry {
|
|
95
|
+
private channels;
|
|
96
|
+
register(channel: NotificationChannel): void;
|
|
97
|
+
get(channelId: string): NotificationChannel | undefined;
|
|
98
|
+
getAll(): NotificationChannel[];
|
|
99
|
+
getAvailable(): Promise<NotificationChannel[]>;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Create a default channel registry with standard channels.
|
|
103
|
+
*/
|
|
104
|
+
declare function createChannelRegistry(): ChannelRegistry;
|
|
105
|
+
//#endregion
|
|
106
|
+
export { ChannelDeliveryResult, ChannelNotification, ChannelRegistry, ConsoleChannel, EmailChannel, InAppChannel, NotificationChannel, PushChannel, WebhookChannel, createChannelRegistry };
|
|
@@ -0,0 +1,637 @@
|
|
|
1
|
+
import * as _lssm_lib_schema142 from "@lssm/lib.schema";
|
|
2
|
+
import * as _lssm_lib_contracts0 from "@lssm/lib.contracts";
|
|
3
|
+
|
|
4
|
+
//#region src/contracts/index.d.ts
|
|
5
|
+
declare const NotificationFilterEnum: _lssm_lib_schema142.EnumType<[string, string, string]>;
|
|
6
|
+
declare const NotificationModel: _lssm_lib_schema142.SchemaModel<{
|
|
7
|
+
id: {
|
|
8
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
9
|
+
isOptional: false;
|
|
10
|
+
};
|
|
11
|
+
userId: {
|
|
12
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
13
|
+
isOptional: false;
|
|
14
|
+
};
|
|
15
|
+
title: {
|
|
16
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
17
|
+
isOptional: false;
|
|
18
|
+
};
|
|
19
|
+
body: {
|
|
20
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
21
|
+
isOptional: false;
|
|
22
|
+
};
|
|
23
|
+
type: {
|
|
24
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
25
|
+
isOptional: false;
|
|
26
|
+
};
|
|
27
|
+
status: {
|
|
28
|
+
type: _lssm_lib_schema142.EnumType<[string, string, string, string, string, string]>;
|
|
29
|
+
isOptional: false;
|
|
30
|
+
};
|
|
31
|
+
channels: {
|
|
32
|
+
type: _lssm_lib_schema142.EnumType<[string, string, string, string]>;
|
|
33
|
+
isArray: true;
|
|
34
|
+
isOptional: false;
|
|
35
|
+
};
|
|
36
|
+
actionUrl: {
|
|
37
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
38
|
+
isOptional: true;
|
|
39
|
+
};
|
|
40
|
+
readAt: {
|
|
41
|
+
type: _lssm_lib_schema142.FieldType<Date, string>;
|
|
42
|
+
isOptional: true;
|
|
43
|
+
};
|
|
44
|
+
createdAt: {
|
|
45
|
+
type: _lssm_lib_schema142.FieldType<Date, string>;
|
|
46
|
+
isOptional: false;
|
|
47
|
+
};
|
|
48
|
+
}>;
|
|
49
|
+
declare const NotificationPreferenceModel: _lssm_lib_schema142.SchemaModel<{
|
|
50
|
+
userId: {
|
|
51
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
52
|
+
isOptional: false;
|
|
53
|
+
};
|
|
54
|
+
globalEnabled: {
|
|
55
|
+
type: _lssm_lib_schema142.FieldType<boolean, boolean>;
|
|
56
|
+
isOptional: false;
|
|
57
|
+
};
|
|
58
|
+
channelPreferences: {
|
|
59
|
+
type: _lssm_lib_schema142.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
60
|
+
isOptional: false;
|
|
61
|
+
};
|
|
62
|
+
typePreferences: {
|
|
63
|
+
type: _lssm_lib_schema142.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
64
|
+
isOptional: false;
|
|
65
|
+
};
|
|
66
|
+
quietHoursStart: {
|
|
67
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
68
|
+
isOptional: true;
|
|
69
|
+
};
|
|
70
|
+
quietHoursEnd: {
|
|
71
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
72
|
+
isOptional: true;
|
|
73
|
+
};
|
|
74
|
+
timezone: {
|
|
75
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
76
|
+
isOptional: false;
|
|
77
|
+
};
|
|
78
|
+
digestEnabled: {
|
|
79
|
+
type: _lssm_lib_schema142.FieldType<boolean, boolean>;
|
|
80
|
+
isOptional: false;
|
|
81
|
+
};
|
|
82
|
+
digestFrequency: {
|
|
83
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
84
|
+
isOptional: true;
|
|
85
|
+
};
|
|
86
|
+
}>;
|
|
87
|
+
declare const SendNotificationInputModel: _lssm_lib_schema142.SchemaModel<{
|
|
88
|
+
userId: {
|
|
89
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
90
|
+
isOptional: false;
|
|
91
|
+
};
|
|
92
|
+
templateId: {
|
|
93
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
94
|
+
isOptional: true;
|
|
95
|
+
};
|
|
96
|
+
title: {
|
|
97
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
98
|
+
isOptional: true;
|
|
99
|
+
};
|
|
100
|
+
body: {
|
|
101
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
102
|
+
isOptional: true;
|
|
103
|
+
};
|
|
104
|
+
type: {
|
|
105
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
106
|
+
isOptional: false;
|
|
107
|
+
};
|
|
108
|
+
channels: {
|
|
109
|
+
type: _lssm_lib_schema142.EnumType<[string, string, string, string]>;
|
|
110
|
+
isArray: true;
|
|
111
|
+
isOptional: true;
|
|
112
|
+
};
|
|
113
|
+
actionUrl: {
|
|
114
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
115
|
+
isOptional: true;
|
|
116
|
+
};
|
|
117
|
+
variables: {
|
|
118
|
+
type: _lssm_lib_schema142.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
119
|
+
isOptional: true;
|
|
120
|
+
};
|
|
121
|
+
metadata: {
|
|
122
|
+
type: _lssm_lib_schema142.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
123
|
+
isOptional: true;
|
|
124
|
+
};
|
|
125
|
+
}>;
|
|
126
|
+
declare const ListNotificationsInputModel: _lssm_lib_schema142.SchemaModel<{
|
|
127
|
+
status: {
|
|
128
|
+
type: _lssm_lib_schema142.EnumType<[string, string, string]>;
|
|
129
|
+
isOptional: true;
|
|
130
|
+
};
|
|
131
|
+
type: {
|
|
132
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
133
|
+
isOptional: true;
|
|
134
|
+
};
|
|
135
|
+
limit: {
|
|
136
|
+
type: _lssm_lib_schema142.FieldType<number, number>;
|
|
137
|
+
isOptional: true;
|
|
138
|
+
defaultValue: number;
|
|
139
|
+
};
|
|
140
|
+
offset: {
|
|
141
|
+
type: _lssm_lib_schema142.FieldType<number, number>;
|
|
142
|
+
isOptional: true;
|
|
143
|
+
defaultValue: number;
|
|
144
|
+
};
|
|
145
|
+
}>;
|
|
146
|
+
declare const ListNotificationsOutputModel: _lssm_lib_schema142.SchemaModel<{
|
|
147
|
+
notifications: {
|
|
148
|
+
type: _lssm_lib_schema142.SchemaModel<{
|
|
149
|
+
id: {
|
|
150
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
151
|
+
isOptional: false;
|
|
152
|
+
};
|
|
153
|
+
userId: {
|
|
154
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
155
|
+
isOptional: false;
|
|
156
|
+
};
|
|
157
|
+
title: {
|
|
158
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
159
|
+
isOptional: false;
|
|
160
|
+
};
|
|
161
|
+
body: {
|
|
162
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
163
|
+
isOptional: false;
|
|
164
|
+
};
|
|
165
|
+
type: {
|
|
166
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
167
|
+
isOptional: false;
|
|
168
|
+
};
|
|
169
|
+
status: {
|
|
170
|
+
type: _lssm_lib_schema142.EnumType<[string, string, string, string, string, string]>;
|
|
171
|
+
isOptional: false;
|
|
172
|
+
};
|
|
173
|
+
channels: {
|
|
174
|
+
type: _lssm_lib_schema142.EnumType<[string, string, string, string]>;
|
|
175
|
+
isArray: true;
|
|
176
|
+
isOptional: false;
|
|
177
|
+
};
|
|
178
|
+
actionUrl: {
|
|
179
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
180
|
+
isOptional: true;
|
|
181
|
+
};
|
|
182
|
+
readAt: {
|
|
183
|
+
type: _lssm_lib_schema142.FieldType<Date, string>;
|
|
184
|
+
isOptional: true;
|
|
185
|
+
};
|
|
186
|
+
createdAt: {
|
|
187
|
+
type: _lssm_lib_schema142.FieldType<Date, string>;
|
|
188
|
+
isOptional: false;
|
|
189
|
+
};
|
|
190
|
+
}>;
|
|
191
|
+
isArray: true;
|
|
192
|
+
isOptional: false;
|
|
193
|
+
};
|
|
194
|
+
total: {
|
|
195
|
+
type: _lssm_lib_schema142.FieldType<number, number>;
|
|
196
|
+
isOptional: false;
|
|
197
|
+
};
|
|
198
|
+
unreadCount: {
|
|
199
|
+
type: _lssm_lib_schema142.FieldType<number, number>;
|
|
200
|
+
isOptional: false;
|
|
201
|
+
};
|
|
202
|
+
}>;
|
|
203
|
+
declare const UpdatePreferencesInputModel: _lssm_lib_schema142.SchemaModel<{
|
|
204
|
+
globalEnabled: {
|
|
205
|
+
type: _lssm_lib_schema142.FieldType<boolean, boolean>;
|
|
206
|
+
isOptional: true;
|
|
207
|
+
};
|
|
208
|
+
channelPreferences: {
|
|
209
|
+
type: _lssm_lib_schema142.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
210
|
+
isOptional: true;
|
|
211
|
+
};
|
|
212
|
+
typePreferences: {
|
|
213
|
+
type: _lssm_lib_schema142.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
214
|
+
isOptional: true;
|
|
215
|
+
};
|
|
216
|
+
quietHoursStart: {
|
|
217
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
218
|
+
isOptional: true;
|
|
219
|
+
};
|
|
220
|
+
quietHoursEnd: {
|
|
221
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
222
|
+
isOptional: true;
|
|
223
|
+
};
|
|
224
|
+
timezone: {
|
|
225
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
226
|
+
isOptional: true;
|
|
227
|
+
};
|
|
228
|
+
digestEnabled: {
|
|
229
|
+
type: _lssm_lib_schema142.FieldType<boolean, boolean>;
|
|
230
|
+
isOptional: true;
|
|
231
|
+
};
|
|
232
|
+
digestFrequency: {
|
|
233
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
234
|
+
isOptional: true;
|
|
235
|
+
};
|
|
236
|
+
}>;
|
|
237
|
+
/**
|
|
238
|
+
* Send a notification.
|
|
239
|
+
*/
|
|
240
|
+
declare const SendNotificationContract: _lssm_lib_contracts0.ContractSpec<_lssm_lib_schema142.SchemaModel<{
|
|
241
|
+
userId: {
|
|
242
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
243
|
+
isOptional: false;
|
|
244
|
+
};
|
|
245
|
+
templateId: {
|
|
246
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
247
|
+
isOptional: true;
|
|
248
|
+
};
|
|
249
|
+
title: {
|
|
250
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
251
|
+
isOptional: true;
|
|
252
|
+
};
|
|
253
|
+
body: {
|
|
254
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
255
|
+
isOptional: true;
|
|
256
|
+
};
|
|
257
|
+
type: {
|
|
258
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
259
|
+
isOptional: false;
|
|
260
|
+
};
|
|
261
|
+
channels: {
|
|
262
|
+
type: _lssm_lib_schema142.EnumType<[string, string, string, string]>;
|
|
263
|
+
isArray: true;
|
|
264
|
+
isOptional: true;
|
|
265
|
+
};
|
|
266
|
+
actionUrl: {
|
|
267
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
268
|
+
isOptional: true;
|
|
269
|
+
};
|
|
270
|
+
variables: {
|
|
271
|
+
type: _lssm_lib_schema142.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
272
|
+
isOptional: true;
|
|
273
|
+
};
|
|
274
|
+
metadata: {
|
|
275
|
+
type: _lssm_lib_schema142.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
276
|
+
isOptional: true;
|
|
277
|
+
};
|
|
278
|
+
}>, _lssm_lib_schema142.SchemaModel<{
|
|
279
|
+
id: {
|
|
280
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
281
|
+
isOptional: false;
|
|
282
|
+
};
|
|
283
|
+
userId: {
|
|
284
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
285
|
+
isOptional: false;
|
|
286
|
+
};
|
|
287
|
+
title: {
|
|
288
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
289
|
+
isOptional: false;
|
|
290
|
+
};
|
|
291
|
+
body: {
|
|
292
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
293
|
+
isOptional: false;
|
|
294
|
+
};
|
|
295
|
+
type: {
|
|
296
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
297
|
+
isOptional: false;
|
|
298
|
+
};
|
|
299
|
+
status: {
|
|
300
|
+
type: _lssm_lib_schema142.EnumType<[string, string, string, string, string, string]>;
|
|
301
|
+
isOptional: false;
|
|
302
|
+
};
|
|
303
|
+
channels: {
|
|
304
|
+
type: _lssm_lib_schema142.EnumType<[string, string, string, string]>;
|
|
305
|
+
isArray: true;
|
|
306
|
+
isOptional: false;
|
|
307
|
+
};
|
|
308
|
+
actionUrl: {
|
|
309
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
310
|
+
isOptional: true;
|
|
311
|
+
};
|
|
312
|
+
readAt: {
|
|
313
|
+
type: _lssm_lib_schema142.FieldType<Date, string>;
|
|
314
|
+
isOptional: true;
|
|
315
|
+
};
|
|
316
|
+
createdAt: {
|
|
317
|
+
type: _lssm_lib_schema142.FieldType<Date, string>;
|
|
318
|
+
isOptional: false;
|
|
319
|
+
};
|
|
320
|
+
}>, {
|
|
321
|
+
name: string;
|
|
322
|
+
version: number;
|
|
323
|
+
when: string;
|
|
324
|
+
payload: _lssm_lib_schema142.SchemaModel<{
|
|
325
|
+
id: {
|
|
326
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
327
|
+
isOptional: false;
|
|
328
|
+
};
|
|
329
|
+
userId: {
|
|
330
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
331
|
+
isOptional: false;
|
|
332
|
+
};
|
|
333
|
+
title: {
|
|
334
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
335
|
+
isOptional: false;
|
|
336
|
+
};
|
|
337
|
+
body: {
|
|
338
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
339
|
+
isOptional: false;
|
|
340
|
+
};
|
|
341
|
+
type: {
|
|
342
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
343
|
+
isOptional: false;
|
|
344
|
+
};
|
|
345
|
+
status: {
|
|
346
|
+
type: _lssm_lib_schema142.EnumType<[string, string, string, string, string, string]>;
|
|
347
|
+
isOptional: false;
|
|
348
|
+
};
|
|
349
|
+
channels: {
|
|
350
|
+
type: _lssm_lib_schema142.EnumType<[string, string, string, string]>;
|
|
351
|
+
isArray: true;
|
|
352
|
+
isOptional: false;
|
|
353
|
+
};
|
|
354
|
+
actionUrl: {
|
|
355
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
356
|
+
isOptional: true;
|
|
357
|
+
};
|
|
358
|
+
readAt: {
|
|
359
|
+
type: _lssm_lib_schema142.FieldType<Date, string>;
|
|
360
|
+
isOptional: true;
|
|
361
|
+
};
|
|
362
|
+
createdAt: {
|
|
363
|
+
type: _lssm_lib_schema142.FieldType<Date, string>;
|
|
364
|
+
isOptional: false;
|
|
365
|
+
};
|
|
366
|
+
}>;
|
|
367
|
+
}[]>;
|
|
368
|
+
/**
|
|
369
|
+
* List notifications for current user.
|
|
370
|
+
*/
|
|
371
|
+
declare const ListNotificationsContract: _lssm_lib_contracts0.ContractSpec<_lssm_lib_schema142.SchemaModel<{
|
|
372
|
+
status: {
|
|
373
|
+
type: _lssm_lib_schema142.EnumType<[string, string, string]>;
|
|
374
|
+
isOptional: true;
|
|
375
|
+
};
|
|
376
|
+
type: {
|
|
377
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
378
|
+
isOptional: true;
|
|
379
|
+
};
|
|
380
|
+
limit: {
|
|
381
|
+
type: _lssm_lib_schema142.FieldType<number, number>;
|
|
382
|
+
isOptional: true;
|
|
383
|
+
defaultValue: number;
|
|
384
|
+
};
|
|
385
|
+
offset: {
|
|
386
|
+
type: _lssm_lib_schema142.FieldType<number, number>;
|
|
387
|
+
isOptional: true;
|
|
388
|
+
defaultValue: number;
|
|
389
|
+
};
|
|
390
|
+
}>, _lssm_lib_schema142.SchemaModel<{
|
|
391
|
+
notifications: {
|
|
392
|
+
type: _lssm_lib_schema142.SchemaModel<{
|
|
393
|
+
id: {
|
|
394
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
395
|
+
isOptional: false;
|
|
396
|
+
};
|
|
397
|
+
userId: {
|
|
398
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
399
|
+
isOptional: false;
|
|
400
|
+
};
|
|
401
|
+
title: {
|
|
402
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
403
|
+
isOptional: false;
|
|
404
|
+
};
|
|
405
|
+
body: {
|
|
406
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
407
|
+
isOptional: false;
|
|
408
|
+
};
|
|
409
|
+
type: {
|
|
410
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
411
|
+
isOptional: false;
|
|
412
|
+
};
|
|
413
|
+
status: {
|
|
414
|
+
type: _lssm_lib_schema142.EnumType<[string, string, string, string, string, string]>;
|
|
415
|
+
isOptional: false;
|
|
416
|
+
};
|
|
417
|
+
channels: {
|
|
418
|
+
type: _lssm_lib_schema142.EnumType<[string, string, string, string]>;
|
|
419
|
+
isArray: true;
|
|
420
|
+
isOptional: false;
|
|
421
|
+
};
|
|
422
|
+
actionUrl: {
|
|
423
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
424
|
+
isOptional: true;
|
|
425
|
+
};
|
|
426
|
+
readAt: {
|
|
427
|
+
type: _lssm_lib_schema142.FieldType<Date, string>;
|
|
428
|
+
isOptional: true;
|
|
429
|
+
};
|
|
430
|
+
createdAt: {
|
|
431
|
+
type: _lssm_lib_schema142.FieldType<Date, string>;
|
|
432
|
+
isOptional: false;
|
|
433
|
+
};
|
|
434
|
+
}>;
|
|
435
|
+
isArray: true;
|
|
436
|
+
isOptional: false;
|
|
437
|
+
};
|
|
438
|
+
total: {
|
|
439
|
+
type: _lssm_lib_schema142.FieldType<number, number>;
|
|
440
|
+
isOptional: false;
|
|
441
|
+
};
|
|
442
|
+
unreadCount: {
|
|
443
|
+
type: _lssm_lib_schema142.FieldType<number, number>;
|
|
444
|
+
isOptional: false;
|
|
445
|
+
};
|
|
446
|
+
}>, undefined>;
|
|
447
|
+
/**
|
|
448
|
+
* Mark notification as read.
|
|
449
|
+
*/
|
|
450
|
+
declare const MarkNotificationReadContract: _lssm_lib_contracts0.ContractSpec<_lssm_lib_schema142.SchemaModel<{
|
|
451
|
+
notificationId: {
|
|
452
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
453
|
+
isOptional: false;
|
|
454
|
+
};
|
|
455
|
+
}>, _lssm_lib_schema142.SchemaModel<{
|
|
456
|
+
id: {
|
|
457
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
458
|
+
isOptional: false;
|
|
459
|
+
};
|
|
460
|
+
userId: {
|
|
461
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
462
|
+
isOptional: false;
|
|
463
|
+
};
|
|
464
|
+
title: {
|
|
465
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
466
|
+
isOptional: false;
|
|
467
|
+
};
|
|
468
|
+
body: {
|
|
469
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
470
|
+
isOptional: false;
|
|
471
|
+
};
|
|
472
|
+
type: {
|
|
473
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
474
|
+
isOptional: false;
|
|
475
|
+
};
|
|
476
|
+
status: {
|
|
477
|
+
type: _lssm_lib_schema142.EnumType<[string, string, string, string, string, string]>;
|
|
478
|
+
isOptional: false;
|
|
479
|
+
};
|
|
480
|
+
channels: {
|
|
481
|
+
type: _lssm_lib_schema142.EnumType<[string, string, string, string]>;
|
|
482
|
+
isArray: true;
|
|
483
|
+
isOptional: false;
|
|
484
|
+
};
|
|
485
|
+
actionUrl: {
|
|
486
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
487
|
+
isOptional: true;
|
|
488
|
+
};
|
|
489
|
+
readAt: {
|
|
490
|
+
type: _lssm_lib_schema142.FieldType<Date, string>;
|
|
491
|
+
isOptional: true;
|
|
492
|
+
};
|
|
493
|
+
createdAt: {
|
|
494
|
+
type: _lssm_lib_schema142.FieldType<Date, string>;
|
|
495
|
+
isOptional: false;
|
|
496
|
+
};
|
|
497
|
+
}>, undefined>;
|
|
498
|
+
/**
|
|
499
|
+
* Mark all notifications as read.
|
|
500
|
+
*/
|
|
501
|
+
declare const MarkAllNotificationsReadContract: _lssm_lib_contracts0.ContractSpec<_lssm_lib_schema142.AnySchemaModel, _lssm_lib_schema142.SchemaModel<{
|
|
502
|
+
markedCount: {
|
|
503
|
+
type: _lssm_lib_schema142.FieldType<number, number>;
|
|
504
|
+
isOptional: false;
|
|
505
|
+
};
|
|
506
|
+
}>, undefined>;
|
|
507
|
+
/**
|
|
508
|
+
* Get notification preferences.
|
|
509
|
+
*/
|
|
510
|
+
declare const GetNotificationPreferencesContract: _lssm_lib_contracts0.ContractSpec<_lssm_lib_schema142.AnySchemaModel, _lssm_lib_schema142.SchemaModel<{
|
|
511
|
+
userId: {
|
|
512
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
513
|
+
isOptional: false;
|
|
514
|
+
};
|
|
515
|
+
globalEnabled: {
|
|
516
|
+
type: _lssm_lib_schema142.FieldType<boolean, boolean>;
|
|
517
|
+
isOptional: false;
|
|
518
|
+
};
|
|
519
|
+
channelPreferences: {
|
|
520
|
+
type: _lssm_lib_schema142.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
521
|
+
isOptional: false;
|
|
522
|
+
};
|
|
523
|
+
typePreferences: {
|
|
524
|
+
type: _lssm_lib_schema142.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
525
|
+
isOptional: false;
|
|
526
|
+
};
|
|
527
|
+
quietHoursStart: {
|
|
528
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
529
|
+
isOptional: true;
|
|
530
|
+
};
|
|
531
|
+
quietHoursEnd: {
|
|
532
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
533
|
+
isOptional: true;
|
|
534
|
+
};
|
|
535
|
+
timezone: {
|
|
536
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
537
|
+
isOptional: false;
|
|
538
|
+
};
|
|
539
|
+
digestEnabled: {
|
|
540
|
+
type: _lssm_lib_schema142.FieldType<boolean, boolean>;
|
|
541
|
+
isOptional: false;
|
|
542
|
+
};
|
|
543
|
+
digestFrequency: {
|
|
544
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
545
|
+
isOptional: true;
|
|
546
|
+
};
|
|
547
|
+
}>, undefined>;
|
|
548
|
+
/**
|
|
549
|
+
* Update notification preferences.
|
|
550
|
+
*/
|
|
551
|
+
declare const UpdateNotificationPreferencesContract: _lssm_lib_contracts0.ContractSpec<_lssm_lib_schema142.SchemaModel<{
|
|
552
|
+
globalEnabled: {
|
|
553
|
+
type: _lssm_lib_schema142.FieldType<boolean, boolean>;
|
|
554
|
+
isOptional: true;
|
|
555
|
+
};
|
|
556
|
+
channelPreferences: {
|
|
557
|
+
type: _lssm_lib_schema142.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
558
|
+
isOptional: true;
|
|
559
|
+
};
|
|
560
|
+
typePreferences: {
|
|
561
|
+
type: _lssm_lib_schema142.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
562
|
+
isOptional: true;
|
|
563
|
+
};
|
|
564
|
+
quietHoursStart: {
|
|
565
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
566
|
+
isOptional: true;
|
|
567
|
+
};
|
|
568
|
+
quietHoursEnd: {
|
|
569
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
570
|
+
isOptional: true;
|
|
571
|
+
};
|
|
572
|
+
timezone: {
|
|
573
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
574
|
+
isOptional: true;
|
|
575
|
+
};
|
|
576
|
+
digestEnabled: {
|
|
577
|
+
type: _lssm_lib_schema142.FieldType<boolean, boolean>;
|
|
578
|
+
isOptional: true;
|
|
579
|
+
};
|
|
580
|
+
digestFrequency: {
|
|
581
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
582
|
+
isOptional: true;
|
|
583
|
+
};
|
|
584
|
+
}>, _lssm_lib_schema142.SchemaModel<{
|
|
585
|
+
userId: {
|
|
586
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
587
|
+
isOptional: false;
|
|
588
|
+
};
|
|
589
|
+
globalEnabled: {
|
|
590
|
+
type: _lssm_lib_schema142.FieldType<boolean, boolean>;
|
|
591
|
+
isOptional: false;
|
|
592
|
+
};
|
|
593
|
+
channelPreferences: {
|
|
594
|
+
type: _lssm_lib_schema142.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
595
|
+
isOptional: false;
|
|
596
|
+
};
|
|
597
|
+
typePreferences: {
|
|
598
|
+
type: _lssm_lib_schema142.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
599
|
+
isOptional: false;
|
|
600
|
+
};
|
|
601
|
+
quietHoursStart: {
|
|
602
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
603
|
+
isOptional: true;
|
|
604
|
+
};
|
|
605
|
+
quietHoursEnd: {
|
|
606
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
607
|
+
isOptional: true;
|
|
608
|
+
};
|
|
609
|
+
timezone: {
|
|
610
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
611
|
+
isOptional: false;
|
|
612
|
+
};
|
|
613
|
+
digestEnabled: {
|
|
614
|
+
type: _lssm_lib_schema142.FieldType<boolean, boolean>;
|
|
615
|
+
isOptional: false;
|
|
616
|
+
};
|
|
617
|
+
digestFrequency: {
|
|
618
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
619
|
+
isOptional: true;
|
|
620
|
+
};
|
|
621
|
+
}>, undefined>;
|
|
622
|
+
/**
|
|
623
|
+
* Delete a notification.
|
|
624
|
+
*/
|
|
625
|
+
declare const DeleteNotificationContract: _lssm_lib_contracts0.ContractSpec<_lssm_lib_schema142.SchemaModel<{
|
|
626
|
+
notificationId: {
|
|
627
|
+
type: _lssm_lib_schema142.FieldType<string, string>;
|
|
628
|
+
isOptional: false;
|
|
629
|
+
};
|
|
630
|
+
}>, _lssm_lib_schema142.SchemaModel<{
|
|
631
|
+
success: {
|
|
632
|
+
type: _lssm_lib_schema142.FieldType<boolean, boolean>;
|
|
633
|
+
isOptional: false;
|
|
634
|
+
};
|
|
635
|
+
}>, undefined>;
|
|
636
|
+
//#endregion
|
|
637
|
+
export { DeleteNotificationContract, GetNotificationPreferencesContract, ListNotificationsContract, ListNotificationsInputModel, ListNotificationsOutputModel, MarkAllNotificationsReadContract, MarkNotificationReadContract, NotificationFilterEnum, NotificationModel, NotificationPreferenceModel, SendNotificationContract, SendNotificationInputModel, UpdateNotificationPreferencesContract, UpdatePreferencesInputModel };
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import * as _lssm_lib_schema0 from "@lssm/lib.schema";
|
|
2
|
+
import { ModuleSchemaContribution } from "@lssm/lib.schema";
|
|
3
|
+
|
|
4
|
+
//#region src/entities/index.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Notification status enum.
|
|
7
|
+
*/
|
|
8
|
+
declare const NotificationStatusEnum: _lssm_lib_schema0.EntityEnumDef;
|
|
9
|
+
/**
|
|
10
|
+
* Notification channel enum.
|
|
11
|
+
*/
|
|
12
|
+
declare const NotificationChannelEnum: _lssm_lib_schema0.EntityEnumDef;
|
|
13
|
+
/**
|
|
14
|
+
* Notification entity - individual notification instance.
|
|
15
|
+
*/
|
|
16
|
+
declare const NotificationEntity: _lssm_lib_schema0.EntitySpec<{
|
|
17
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
18
|
+
userId: _lssm_lib_schema0.EntityScalarField;
|
|
19
|
+
orgId: _lssm_lib_schema0.EntityScalarField;
|
|
20
|
+
templateId: _lssm_lib_schema0.EntityScalarField;
|
|
21
|
+
title: _lssm_lib_schema0.EntityScalarField;
|
|
22
|
+
body: _lssm_lib_schema0.EntityScalarField;
|
|
23
|
+
actionUrl: _lssm_lib_schema0.EntityScalarField;
|
|
24
|
+
imageUrl: _lssm_lib_schema0.EntityScalarField;
|
|
25
|
+
type: _lssm_lib_schema0.EntityScalarField;
|
|
26
|
+
category: _lssm_lib_schema0.EntityScalarField;
|
|
27
|
+
priority: _lssm_lib_schema0.EntityEnumField;
|
|
28
|
+
channels: _lssm_lib_schema0.EntityScalarField;
|
|
29
|
+
status: _lssm_lib_schema0.EntityEnumField;
|
|
30
|
+
sentAt: _lssm_lib_schema0.EntityScalarField;
|
|
31
|
+
deliveredAt: _lssm_lib_schema0.EntityScalarField;
|
|
32
|
+
readAt: _lssm_lib_schema0.EntityScalarField;
|
|
33
|
+
metadata: _lssm_lib_schema0.EntityScalarField;
|
|
34
|
+
variables: _lssm_lib_schema0.EntityScalarField;
|
|
35
|
+
triggeredBy: _lssm_lib_schema0.EntityScalarField;
|
|
36
|
+
sourceId: _lssm_lib_schema0.EntityScalarField;
|
|
37
|
+
sourceType: _lssm_lib_schema0.EntityScalarField;
|
|
38
|
+
createdAt: _lssm_lib_schema0.EntityScalarField;
|
|
39
|
+
updatedAt: _lssm_lib_schema0.EntityScalarField;
|
|
40
|
+
expiresAt: _lssm_lib_schema0.EntityScalarField;
|
|
41
|
+
deliveryLogs: _lssm_lib_schema0.EntityRelationField;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* Notification priority enum.
|
|
45
|
+
*/
|
|
46
|
+
declare const NotificationPriorityEnum: _lssm_lib_schema0.EntityEnumDef;
|
|
47
|
+
/**
|
|
48
|
+
* NotificationTemplate entity - reusable notification templates.
|
|
49
|
+
*/
|
|
50
|
+
declare const NotificationTemplateEntity: _lssm_lib_schema0.EntitySpec<{
|
|
51
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
52
|
+
templateId: _lssm_lib_schema0.EntityScalarField;
|
|
53
|
+
name: _lssm_lib_schema0.EntityScalarField;
|
|
54
|
+
description: _lssm_lib_schema0.EntityScalarField;
|
|
55
|
+
emailSubject: _lssm_lib_schema0.EntityScalarField;
|
|
56
|
+
emailBody: _lssm_lib_schema0.EntityScalarField;
|
|
57
|
+
inAppTitle: _lssm_lib_schema0.EntityScalarField;
|
|
58
|
+
inAppBody: _lssm_lib_schema0.EntityScalarField;
|
|
59
|
+
pushTitle: _lssm_lib_schema0.EntityScalarField;
|
|
60
|
+
pushBody: _lssm_lib_schema0.EntityScalarField;
|
|
61
|
+
defaultChannels: _lssm_lib_schema0.EntityScalarField;
|
|
62
|
+
category: _lssm_lib_schema0.EntityScalarField;
|
|
63
|
+
priority: _lssm_lib_schema0.EntityEnumField;
|
|
64
|
+
variablesSchema: _lssm_lib_schema0.EntityScalarField;
|
|
65
|
+
enabled: _lssm_lib_schema0.EntityScalarField;
|
|
66
|
+
createdAt: _lssm_lib_schema0.EntityScalarField;
|
|
67
|
+
updatedAt: _lssm_lib_schema0.EntityScalarField;
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* NotificationPreference entity - user notification preferences.
|
|
71
|
+
*/
|
|
72
|
+
declare const NotificationPreferenceEntity: _lssm_lib_schema0.EntitySpec<{
|
|
73
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
74
|
+
userId: _lssm_lib_schema0.EntityScalarField;
|
|
75
|
+
globalEnabled: _lssm_lib_schema0.EntityScalarField;
|
|
76
|
+
quietHoursStart: _lssm_lib_schema0.EntityScalarField;
|
|
77
|
+
quietHoursEnd: _lssm_lib_schema0.EntityScalarField;
|
|
78
|
+
timezone: _lssm_lib_schema0.EntityScalarField;
|
|
79
|
+
channelPreferences: _lssm_lib_schema0.EntityScalarField;
|
|
80
|
+
typePreferences: _lssm_lib_schema0.EntityScalarField;
|
|
81
|
+
digestEnabled: _lssm_lib_schema0.EntityScalarField;
|
|
82
|
+
digestFrequency: _lssm_lib_schema0.EntityScalarField;
|
|
83
|
+
digestTime: _lssm_lib_schema0.EntityScalarField;
|
|
84
|
+
createdAt: _lssm_lib_schema0.EntityScalarField;
|
|
85
|
+
updatedAt: _lssm_lib_schema0.EntityScalarField;
|
|
86
|
+
}>;
|
|
87
|
+
/**
|
|
88
|
+
* DeliveryLog entity - track delivery attempts per channel.
|
|
89
|
+
*/
|
|
90
|
+
declare const DeliveryLogEntity: _lssm_lib_schema0.EntitySpec<{
|
|
91
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
92
|
+
notificationId: _lssm_lib_schema0.EntityScalarField;
|
|
93
|
+
channel: _lssm_lib_schema0.EntityEnumField;
|
|
94
|
+
status: _lssm_lib_schema0.EntityEnumField;
|
|
95
|
+
attemptedAt: _lssm_lib_schema0.EntityScalarField;
|
|
96
|
+
deliveredAt: _lssm_lib_schema0.EntityScalarField;
|
|
97
|
+
responseCode: _lssm_lib_schema0.EntityScalarField;
|
|
98
|
+
responseMessage: _lssm_lib_schema0.EntityScalarField;
|
|
99
|
+
externalId: _lssm_lib_schema0.EntityScalarField;
|
|
100
|
+
metadata: _lssm_lib_schema0.EntityScalarField;
|
|
101
|
+
notification: _lssm_lib_schema0.EntityRelationField;
|
|
102
|
+
}>;
|
|
103
|
+
/**
|
|
104
|
+
* All notification entities for schema composition.
|
|
105
|
+
*/
|
|
106
|
+
declare const notificationEntities: (_lssm_lib_schema0.EntitySpec<{
|
|
107
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
108
|
+
userId: _lssm_lib_schema0.EntityScalarField;
|
|
109
|
+
orgId: _lssm_lib_schema0.EntityScalarField;
|
|
110
|
+
templateId: _lssm_lib_schema0.EntityScalarField;
|
|
111
|
+
title: _lssm_lib_schema0.EntityScalarField;
|
|
112
|
+
body: _lssm_lib_schema0.EntityScalarField;
|
|
113
|
+
actionUrl: _lssm_lib_schema0.EntityScalarField;
|
|
114
|
+
imageUrl: _lssm_lib_schema0.EntityScalarField;
|
|
115
|
+
type: _lssm_lib_schema0.EntityScalarField;
|
|
116
|
+
category: _lssm_lib_schema0.EntityScalarField;
|
|
117
|
+
priority: _lssm_lib_schema0.EntityEnumField;
|
|
118
|
+
channels: _lssm_lib_schema0.EntityScalarField;
|
|
119
|
+
status: _lssm_lib_schema0.EntityEnumField;
|
|
120
|
+
sentAt: _lssm_lib_schema0.EntityScalarField;
|
|
121
|
+
deliveredAt: _lssm_lib_schema0.EntityScalarField;
|
|
122
|
+
readAt: _lssm_lib_schema0.EntityScalarField;
|
|
123
|
+
metadata: _lssm_lib_schema0.EntityScalarField;
|
|
124
|
+
variables: _lssm_lib_schema0.EntityScalarField;
|
|
125
|
+
triggeredBy: _lssm_lib_schema0.EntityScalarField;
|
|
126
|
+
sourceId: _lssm_lib_schema0.EntityScalarField;
|
|
127
|
+
sourceType: _lssm_lib_schema0.EntityScalarField;
|
|
128
|
+
createdAt: _lssm_lib_schema0.EntityScalarField;
|
|
129
|
+
updatedAt: _lssm_lib_schema0.EntityScalarField;
|
|
130
|
+
expiresAt: _lssm_lib_schema0.EntityScalarField;
|
|
131
|
+
deliveryLogs: _lssm_lib_schema0.EntityRelationField;
|
|
132
|
+
}> | _lssm_lib_schema0.EntitySpec<{
|
|
133
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
134
|
+
templateId: _lssm_lib_schema0.EntityScalarField;
|
|
135
|
+
name: _lssm_lib_schema0.EntityScalarField;
|
|
136
|
+
description: _lssm_lib_schema0.EntityScalarField;
|
|
137
|
+
emailSubject: _lssm_lib_schema0.EntityScalarField;
|
|
138
|
+
emailBody: _lssm_lib_schema0.EntityScalarField;
|
|
139
|
+
inAppTitle: _lssm_lib_schema0.EntityScalarField;
|
|
140
|
+
inAppBody: _lssm_lib_schema0.EntityScalarField;
|
|
141
|
+
pushTitle: _lssm_lib_schema0.EntityScalarField;
|
|
142
|
+
pushBody: _lssm_lib_schema0.EntityScalarField;
|
|
143
|
+
defaultChannels: _lssm_lib_schema0.EntityScalarField;
|
|
144
|
+
category: _lssm_lib_schema0.EntityScalarField;
|
|
145
|
+
priority: _lssm_lib_schema0.EntityEnumField;
|
|
146
|
+
variablesSchema: _lssm_lib_schema0.EntityScalarField;
|
|
147
|
+
enabled: _lssm_lib_schema0.EntityScalarField;
|
|
148
|
+
createdAt: _lssm_lib_schema0.EntityScalarField;
|
|
149
|
+
updatedAt: _lssm_lib_schema0.EntityScalarField;
|
|
150
|
+
}> | _lssm_lib_schema0.EntitySpec<{
|
|
151
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
152
|
+
userId: _lssm_lib_schema0.EntityScalarField;
|
|
153
|
+
globalEnabled: _lssm_lib_schema0.EntityScalarField;
|
|
154
|
+
quietHoursStart: _lssm_lib_schema0.EntityScalarField;
|
|
155
|
+
quietHoursEnd: _lssm_lib_schema0.EntityScalarField;
|
|
156
|
+
timezone: _lssm_lib_schema0.EntityScalarField;
|
|
157
|
+
channelPreferences: _lssm_lib_schema0.EntityScalarField;
|
|
158
|
+
typePreferences: _lssm_lib_schema0.EntityScalarField;
|
|
159
|
+
digestEnabled: _lssm_lib_schema0.EntityScalarField;
|
|
160
|
+
digestFrequency: _lssm_lib_schema0.EntityScalarField;
|
|
161
|
+
digestTime: _lssm_lib_schema0.EntityScalarField;
|
|
162
|
+
createdAt: _lssm_lib_schema0.EntityScalarField;
|
|
163
|
+
updatedAt: _lssm_lib_schema0.EntityScalarField;
|
|
164
|
+
}> | _lssm_lib_schema0.EntitySpec<{
|
|
165
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
166
|
+
notificationId: _lssm_lib_schema0.EntityScalarField;
|
|
167
|
+
channel: _lssm_lib_schema0.EntityEnumField;
|
|
168
|
+
status: _lssm_lib_schema0.EntityEnumField;
|
|
169
|
+
attemptedAt: _lssm_lib_schema0.EntityScalarField;
|
|
170
|
+
deliveredAt: _lssm_lib_schema0.EntityScalarField;
|
|
171
|
+
responseCode: _lssm_lib_schema0.EntityScalarField;
|
|
172
|
+
responseMessage: _lssm_lib_schema0.EntityScalarField;
|
|
173
|
+
externalId: _lssm_lib_schema0.EntityScalarField;
|
|
174
|
+
metadata: _lssm_lib_schema0.EntityScalarField;
|
|
175
|
+
notification: _lssm_lib_schema0.EntityRelationField;
|
|
176
|
+
}>)[];
|
|
177
|
+
/**
|
|
178
|
+
* Module schema contribution for notifications.
|
|
179
|
+
*/
|
|
180
|
+
declare const notificationsSchemaContribution: ModuleSchemaContribution;
|
|
181
|
+
//#endregion
|
|
182
|
+
export { DeliveryLogEntity, NotificationChannelEnum, NotificationEntity, NotificationPreferenceEntity, NotificationPriorityEnum, NotificationStatusEnum, NotificationTemplateEntity, notificationEntities, notificationsSchemaContribution };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ChannelDeliveryResult, ChannelNotification, ChannelRegistry, ConsoleChannel, EmailChannel, InAppChannel, NotificationChannel, PushChannel, WebhookChannel, createChannelRegistry } from "./channels/index.js";
|
|
2
|
+
import { DeleteNotificationContract, GetNotificationPreferencesContract, ListNotificationsContract, ListNotificationsInputModel, ListNotificationsOutputModel, MarkAllNotificationsReadContract, MarkNotificationReadContract, NotificationFilterEnum, NotificationModel, NotificationPreferenceModel, SendNotificationContract, SendNotificationInputModel, UpdateNotificationPreferencesContract, UpdatePreferencesInputModel } from "./contracts/index.js";
|
|
3
|
+
import { DeliveryLogEntity, NotificationChannelEnum, NotificationEntity, NotificationPreferenceEntity, NotificationPriorityEnum, NotificationStatusEnum, NotificationTemplateEntity, notificationEntities, notificationsSchemaContribution } from "./entities/index.js";
|
|
4
|
+
import { ChannelTemplateContent, MentionTemplate, NotificationTemplateDefinition, OrgInviteTemplate, RenderedNotification, TemplateRegistry, TemplateVariable, WelcomeTemplate, createTemplateRegistry, defineTemplate, renderNotificationTemplate, renderTemplate } from "./templates/index.js";
|
|
5
|
+
import { NotificationsFeature } from "./notifications.feature.js";
|
|
6
|
+
export { ChannelDeliveryResult, ChannelNotification, ChannelRegistry, ChannelTemplateContent, ConsoleChannel, DeleteNotificationContract, DeliveryLogEntity, EmailChannel, GetNotificationPreferencesContract, InAppChannel, ListNotificationsContract, ListNotificationsInputModel, ListNotificationsOutputModel, MarkAllNotificationsReadContract, MarkNotificationReadContract, MentionTemplate, NotificationChannel, NotificationChannelEnum, NotificationEntity, NotificationFilterEnum, NotificationModel, NotificationPreferenceEntity, NotificationPreferenceModel, NotificationPriorityEnum, NotificationStatusEnum, NotificationTemplateDefinition, NotificationTemplateEntity, NotificationsFeature, OrgInviteTemplate, PushChannel, RenderedNotification, SendNotificationContract, SendNotificationInputModel, TemplateRegistry, TemplateVariable, UpdateNotificationPreferencesContract, UpdatePreferencesInputModel, WebhookChannel, WelcomeTemplate, createChannelRegistry, createTemplateRegistry, defineTemplate, notificationEntities, notificationsSchemaContribution, renderNotificationTemplate, renderTemplate };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FeatureModuleSpec } from "@lssm/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/notifications.feature.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Notifications feature module that bundles notification sending,
|
|
7
|
+
* listing, marking as read, and preference management capabilities.
|
|
8
|
+
*/
|
|
9
|
+
declare const NotificationsFeature: FeatureModuleSpec;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { NotificationsFeature };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
//#region src/templates/index.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Template variable definition.
|
|
4
|
+
*/
|
|
5
|
+
interface TemplateVariable {
|
|
6
|
+
name: string;
|
|
7
|
+
type: 'string' | 'number' | 'boolean' | 'date' | 'url';
|
|
8
|
+
required?: boolean;
|
|
9
|
+
default?: string | number | boolean;
|
|
10
|
+
description?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Channel-specific template content.
|
|
14
|
+
*/
|
|
15
|
+
interface ChannelTemplateContent {
|
|
16
|
+
title?: string;
|
|
17
|
+
subject?: string;
|
|
18
|
+
body: string;
|
|
19
|
+
actionUrl?: string;
|
|
20
|
+
actionText?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Notification template definition.
|
|
24
|
+
*/
|
|
25
|
+
interface NotificationTemplateDefinition {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
category?: string;
|
|
30
|
+
variables?: TemplateVariable[];
|
|
31
|
+
defaultChannels?: string[];
|
|
32
|
+
channels: {
|
|
33
|
+
email?: ChannelTemplateContent;
|
|
34
|
+
inApp?: ChannelTemplateContent;
|
|
35
|
+
push?: ChannelTemplateContent;
|
|
36
|
+
webhook?: ChannelTemplateContent;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Rendered notification content.
|
|
41
|
+
*/
|
|
42
|
+
interface RenderedNotification {
|
|
43
|
+
title: string;
|
|
44
|
+
body: string;
|
|
45
|
+
actionUrl?: string;
|
|
46
|
+
email?: {
|
|
47
|
+
subject: string;
|
|
48
|
+
html: string;
|
|
49
|
+
text: string;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Define a notification template.
|
|
54
|
+
*/
|
|
55
|
+
declare function defineTemplate(def: NotificationTemplateDefinition): NotificationTemplateDefinition;
|
|
56
|
+
/**
|
|
57
|
+
* Render a template with variables.
|
|
58
|
+
*/
|
|
59
|
+
declare function renderTemplate(content: string, variables: Record<string, unknown>): string;
|
|
60
|
+
/**
|
|
61
|
+
* Render a notification template for a specific channel.
|
|
62
|
+
*/
|
|
63
|
+
declare function renderNotificationTemplate(template: NotificationTemplateDefinition, channel: keyof NotificationTemplateDefinition['channels'], variables: Record<string, unknown>): RenderedNotification | null;
|
|
64
|
+
/**
|
|
65
|
+
* Template registry for managing templates.
|
|
66
|
+
*/
|
|
67
|
+
declare class TemplateRegistry {
|
|
68
|
+
private templates;
|
|
69
|
+
register(template: NotificationTemplateDefinition): void;
|
|
70
|
+
get(templateId: string): NotificationTemplateDefinition | undefined;
|
|
71
|
+
getAll(): NotificationTemplateDefinition[];
|
|
72
|
+
getByCategory(category: string): NotificationTemplateDefinition[];
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Create a template registry.
|
|
76
|
+
*/
|
|
77
|
+
declare function createTemplateRegistry(): TemplateRegistry;
|
|
78
|
+
/**
|
|
79
|
+
* Welcome email template.
|
|
80
|
+
*/
|
|
81
|
+
declare const WelcomeTemplate: NotificationTemplateDefinition;
|
|
82
|
+
/**
|
|
83
|
+
* Organization invite template.
|
|
84
|
+
*/
|
|
85
|
+
declare const OrgInviteTemplate: NotificationTemplateDefinition;
|
|
86
|
+
/**
|
|
87
|
+
* Mention template.
|
|
88
|
+
*/
|
|
89
|
+
declare const MentionTemplate: NotificationTemplateDefinition;
|
|
90
|
+
//#endregion
|
|
91
|
+
export { ChannelTemplateContent, MentionTemplate, NotificationTemplateDefinition, OrgInviteTemplate, RenderedNotification, TemplateRegistry, TemplateVariable, WelcomeTemplate, createTemplateRegistry, defineTemplate, renderNotificationTemplate, renderTemplate };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/module.notifications",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251217060433",
|
|
4
4
|
"description": "Notification center module for ContractSpec applications",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -18,23 +18,23 @@
|
|
|
18
18
|
"lint:check": "eslint src"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@lssm/lib.schema": "0.0.0-canary-
|
|
22
|
-
"@lssm/lib.contracts": "0.0.0-canary-
|
|
23
|
-
"@lssm/lib.bus": "0.0.0-canary-
|
|
21
|
+
"@lssm/lib.schema": "0.0.0-canary-20251217060433",
|
|
22
|
+
"@lssm/lib.contracts": "0.0.0-canary-20251217060433",
|
|
23
|
+
"@lssm/lib.bus": "0.0.0-canary-20251217060433",
|
|
24
24
|
"zod": "^4.1.13"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@lssm/tool.typescript": "0.0.0-canary-
|
|
28
|
-
"@lssm/tool.tsdown": "0.0.0-canary-
|
|
27
|
+
"@lssm/tool.typescript": "0.0.0-canary-20251217060433",
|
|
28
|
+
"@lssm/tool.tsdown": "0.0.0-canary-20251217060433",
|
|
29
29
|
"typescript": "^5.9.3"
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
32
|
-
".": "./
|
|
33
|
-
"./channels": "./
|
|
34
|
-
"./contracts": "./
|
|
35
|
-
"./entities": "./
|
|
36
|
-
"./notifications.feature": "./
|
|
37
|
-
"./templates": "./
|
|
32
|
+
".": "./dist/index.js",
|
|
33
|
+
"./channels": "./dist/channels/index.js",
|
|
34
|
+
"./contracts": "./dist/contracts/index.js",
|
|
35
|
+
"./entities": "./dist/entities/index.js",
|
|
36
|
+
"./notifications.feature": "./dist/notifications.feature.js",
|
|
37
|
+
"./templates": "./dist/templates/index.js",
|
|
38
38
|
"./*": "./*"
|
|
39
39
|
},
|
|
40
40
|
"module": "./dist/index.js",
|