@classic-homes/notifications 0.1.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/README.md +277 -0
- package/dist/core/index.d.ts +163 -0
- package/dist/core/index.js +258 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +483 -0
- package/dist/svelte/index.d.ts +101 -0
- package/dist/svelte/index.js +382 -0
- package/dist/types-BSztr7EQ.d.ts +141 -0
- package/package.json +62 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { api } from '@classic-homes/auth/core';
|
|
2
|
+
|
|
3
|
+
// src/core/api.ts
|
|
4
|
+
var notificationsApi = {
|
|
5
|
+
// ============================================================================
|
|
6
|
+
// Notifications CRUD
|
|
7
|
+
// ============================================================================
|
|
8
|
+
/**
|
|
9
|
+
* List notifications with optional filters.
|
|
10
|
+
*/
|
|
11
|
+
async list(params, customFetch) {
|
|
12
|
+
const queryParams = new URLSearchParams();
|
|
13
|
+
const page = params?.page || 1;
|
|
14
|
+
const limit = params?.limit || 20;
|
|
15
|
+
const offset = (page - 1) * limit;
|
|
16
|
+
queryParams.append("limit", limit.toString());
|
|
17
|
+
queryParams.append("offset", offset.toString());
|
|
18
|
+
if (params?.unreadOnly) {
|
|
19
|
+
queryParams.append("read", "false");
|
|
20
|
+
} else if (params?.readOnly) {
|
|
21
|
+
queryParams.append("read", "true");
|
|
22
|
+
}
|
|
23
|
+
if (params?.type) {
|
|
24
|
+
queryParams.append("type", params.type);
|
|
25
|
+
}
|
|
26
|
+
const response = await api.get(
|
|
27
|
+
`/notifications?${queryParams.toString()}`,
|
|
28
|
+
true,
|
|
29
|
+
customFetch
|
|
30
|
+
);
|
|
31
|
+
return response;
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* Get a single notification by ID.
|
|
35
|
+
*/
|
|
36
|
+
async get(id, customFetch) {
|
|
37
|
+
const response = await api.get(
|
|
38
|
+
`/notifications/${id}`,
|
|
39
|
+
true,
|
|
40
|
+
customFetch
|
|
41
|
+
);
|
|
42
|
+
return response.notification;
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* Mark a notification as read.
|
|
46
|
+
*/
|
|
47
|
+
async markRead(id) {
|
|
48
|
+
await api.patch(`/notifications/${id}/read`, {}, true);
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* Mark multiple notifications as read.
|
|
52
|
+
*/
|
|
53
|
+
async markManyRead(ids) {
|
|
54
|
+
await api.post("/notifications/mark-read", { ids }, true);
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* Mark all notifications as read.
|
|
58
|
+
*/
|
|
59
|
+
async markAllRead() {
|
|
60
|
+
await api.post("/notifications/mark-read", { all: true }, true);
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* Dismiss (delete) a notification.
|
|
64
|
+
*/
|
|
65
|
+
async dismiss(id) {
|
|
66
|
+
await api.delete(`/notifications/${id}`, true);
|
|
67
|
+
},
|
|
68
|
+
/**
|
|
69
|
+
* Delete multiple notifications in bulk.
|
|
70
|
+
*/
|
|
71
|
+
async bulkDelete(ids) {
|
|
72
|
+
await api.post("/notifications/bulk-delete", { ids }, true);
|
|
73
|
+
},
|
|
74
|
+
/**
|
|
75
|
+
* Delete all notifications.
|
|
76
|
+
*/
|
|
77
|
+
async deleteAll() {
|
|
78
|
+
await api.post("/notifications/bulk-delete", { all: true }, true);
|
|
79
|
+
},
|
|
80
|
+
// ============================================================================
|
|
81
|
+
// Notification Channels
|
|
82
|
+
// ============================================================================
|
|
83
|
+
/**
|
|
84
|
+
* Get available notification channels.
|
|
85
|
+
*/
|
|
86
|
+
async getChannels(customFetch) {
|
|
87
|
+
const response = await api.get("/notifications/channels", true, customFetch);
|
|
88
|
+
return response;
|
|
89
|
+
},
|
|
90
|
+
// ============================================================================
|
|
91
|
+
// Notification Preferences
|
|
92
|
+
// ============================================================================
|
|
93
|
+
/**
|
|
94
|
+
* Get notification preferences.
|
|
95
|
+
*/
|
|
96
|
+
async getPreferences(params, customFetch) {
|
|
97
|
+
const queryParams = new URLSearchParams();
|
|
98
|
+
if (params?.channelId) queryParams.append("channelId", params.channelId);
|
|
99
|
+
if (params?.notificationType) queryParams.append("notificationType", params.notificationType);
|
|
100
|
+
const response = await api.get(
|
|
101
|
+
`/notifications/preferences?${queryParams.toString()}`,
|
|
102
|
+
true,
|
|
103
|
+
customFetch
|
|
104
|
+
);
|
|
105
|
+
return response;
|
|
106
|
+
},
|
|
107
|
+
/**
|
|
108
|
+
* Update a notification preference.
|
|
109
|
+
*/
|
|
110
|
+
async updatePreference(preference) {
|
|
111
|
+
const response = await api.put(
|
|
112
|
+
"/notifications/preferences",
|
|
113
|
+
preference,
|
|
114
|
+
true
|
|
115
|
+
);
|
|
116
|
+
return response;
|
|
117
|
+
},
|
|
118
|
+
/**
|
|
119
|
+
* Batch update notification preferences.
|
|
120
|
+
*/
|
|
121
|
+
async batchUpdatePreferences(preferences) {
|
|
122
|
+
const response = await api.post(
|
|
123
|
+
"/notifications/preferences/batch",
|
|
124
|
+
{ preferences },
|
|
125
|
+
true
|
|
126
|
+
);
|
|
127
|
+
const data = response;
|
|
128
|
+
return data.data || data;
|
|
129
|
+
},
|
|
130
|
+
/**
|
|
131
|
+
* Delete a notification preference.
|
|
132
|
+
*/
|
|
133
|
+
async deletePreference(subscriptionId) {
|
|
134
|
+
const response = await api.delete(
|
|
135
|
+
`/notifications/preferences/${subscriptionId}`,
|
|
136
|
+
true
|
|
137
|
+
);
|
|
138
|
+
return response;
|
|
139
|
+
},
|
|
140
|
+
// ============================================================================
|
|
141
|
+
// Test Notifications (Dev/Admin)
|
|
142
|
+
// ============================================================================
|
|
143
|
+
/**
|
|
144
|
+
* Generate test notifications.
|
|
145
|
+
*/
|
|
146
|
+
async generateTestNotifications(params) {
|
|
147
|
+
const response = await api.post(
|
|
148
|
+
"/notifications/test",
|
|
149
|
+
params || {},
|
|
150
|
+
true
|
|
151
|
+
);
|
|
152
|
+
const data = response;
|
|
153
|
+
return data.data ?? data;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// src/svelte/stores/notifications.svelte.ts
|
|
158
|
+
var NotificationStore = class {
|
|
159
|
+
constructor() {
|
|
160
|
+
this.subscribers = /* @__PURE__ */ new Set();
|
|
161
|
+
this.state = {
|
|
162
|
+
notifications: [],
|
|
163
|
+
unreadCount: 0,
|
|
164
|
+
isLoading: false,
|
|
165
|
+
error: null,
|
|
166
|
+
pagination: {
|
|
167
|
+
page: 1,
|
|
168
|
+
limit: 20,
|
|
169
|
+
total: 0,
|
|
170
|
+
totalPages: 0
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Subscribe to state changes (Svelte store contract).
|
|
176
|
+
*/
|
|
177
|
+
subscribe(subscriber) {
|
|
178
|
+
this.subscribers.add(subscriber);
|
|
179
|
+
subscriber(this.state);
|
|
180
|
+
return () => this.subscribers.delete(subscriber);
|
|
181
|
+
}
|
|
182
|
+
notify() {
|
|
183
|
+
this.subscribers.forEach((sub) => sub(this.state));
|
|
184
|
+
}
|
|
185
|
+
setState(partial) {
|
|
186
|
+
this.state = { ...this.state, ...partial };
|
|
187
|
+
this.notify();
|
|
188
|
+
}
|
|
189
|
+
// Getters for direct access
|
|
190
|
+
get notifications() {
|
|
191
|
+
return this.state.notifications;
|
|
192
|
+
}
|
|
193
|
+
get unreadCount() {
|
|
194
|
+
return this.state.unreadCount;
|
|
195
|
+
}
|
|
196
|
+
get isLoading() {
|
|
197
|
+
return this.state.isLoading;
|
|
198
|
+
}
|
|
199
|
+
get error() {
|
|
200
|
+
return this.state.error;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Fetch notifications from the API.
|
|
204
|
+
*/
|
|
205
|
+
async fetch(params) {
|
|
206
|
+
this.setState({ isLoading: true, error: null });
|
|
207
|
+
try {
|
|
208
|
+
const response = await notificationsApi.list(params);
|
|
209
|
+
this.setState({
|
|
210
|
+
notifications: response.notifications,
|
|
211
|
+
unreadCount: response.unreadCount,
|
|
212
|
+
pagination: response.pagination,
|
|
213
|
+
isLoading: false
|
|
214
|
+
});
|
|
215
|
+
} catch (error) {
|
|
216
|
+
this.setState({
|
|
217
|
+
error: error instanceof Error ? error.message : "Failed to fetch notifications",
|
|
218
|
+
isLoading: false
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Refresh notifications (re-fetch with current params).
|
|
224
|
+
*/
|
|
225
|
+
async refresh() {
|
|
226
|
+
await this.fetch({
|
|
227
|
+
page: this.state.pagination.page,
|
|
228
|
+
limit: this.state.pagination.limit
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Load more notifications (next page).
|
|
233
|
+
*/
|
|
234
|
+
async loadMore() {
|
|
235
|
+
if (this.state.pagination.page >= this.state.pagination.totalPages) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
this.setState({ isLoading: true, error: null });
|
|
239
|
+
try {
|
|
240
|
+
const response = await notificationsApi.list({
|
|
241
|
+
page: this.state.pagination.page + 1,
|
|
242
|
+
limit: this.state.pagination.limit
|
|
243
|
+
});
|
|
244
|
+
this.setState({
|
|
245
|
+
notifications: [...this.state.notifications, ...response.notifications],
|
|
246
|
+
unreadCount: response.unreadCount,
|
|
247
|
+
pagination: response.pagination,
|
|
248
|
+
isLoading: false
|
|
249
|
+
});
|
|
250
|
+
} catch (error) {
|
|
251
|
+
this.setState({
|
|
252
|
+
error: error instanceof Error ? error.message : "Failed to load more notifications",
|
|
253
|
+
isLoading: false
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Mark a notification as read.
|
|
259
|
+
*/
|
|
260
|
+
async markRead(id) {
|
|
261
|
+
try {
|
|
262
|
+
await notificationsApi.markRead(id);
|
|
263
|
+
const notifications2 = this.state.notifications.map(
|
|
264
|
+
(n) => n.id === id ? { ...n, read: true, readAt: (/* @__PURE__ */ new Date()).toISOString() } : n
|
|
265
|
+
);
|
|
266
|
+
const unreadCount2 = Math.max(0, this.state.unreadCount - 1);
|
|
267
|
+
this.setState({ notifications: notifications2, unreadCount: unreadCount2 });
|
|
268
|
+
} catch (error) {
|
|
269
|
+
this.setState({
|
|
270
|
+
error: error instanceof Error ? error.message : "Failed to mark notification as read"
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Mark multiple notifications as read.
|
|
276
|
+
*/
|
|
277
|
+
async markManyRead(ids) {
|
|
278
|
+
try {
|
|
279
|
+
await notificationsApi.markManyRead(ids);
|
|
280
|
+
const notifications2 = this.state.notifications.map(
|
|
281
|
+
(n) => ids.includes(n.id) ? { ...n, read: true, readAt: (/* @__PURE__ */ new Date()).toISOString() } : n
|
|
282
|
+
);
|
|
283
|
+
const readCount = this.state.notifications.filter(
|
|
284
|
+
(n) => ids.includes(n.id) && !n.read
|
|
285
|
+
).length;
|
|
286
|
+
const unreadCount2 = Math.max(0, this.state.unreadCount - readCount);
|
|
287
|
+
this.setState({ notifications: notifications2, unreadCount: unreadCount2 });
|
|
288
|
+
} catch (error) {
|
|
289
|
+
this.setState({
|
|
290
|
+
error: error instanceof Error ? error.message : "Failed to mark notifications as read"
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Mark all notifications as read.
|
|
296
|
+
*/
|
|
297
|
+
async markAllRead() {
|
|
298
|
+
try {
|
|
299
|
+
await notificationsApi.markAllRead();
|
|
300
|
+
const notifications2 = this.state.notifications.map((n) => ({
|
|
301
|
+
...n,
|
|
302
|
+
read: true,
|
|
303
|
+
readAt: n.readAt || (/* @__PURE__ */ new Date()).toISOString()
|
|
304
|
+
}));
|
|
305
|
+
this.setState({ notifications: notifications2, unreadCount: 0 });
|
|
306
|
+
} catch (error) {
|
|
307
|
+
this.setState({
|
|
308
|
+
error: error instanceof Error ? error.message : "Failed to mark all notifications as read"
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Dismiss (delete) a notification.
|
|
314
|
+
*/
|
|
315
|
+
async dismiss(id) {
|
|
316
|
+
try {
|
|
317
|
+
await notificationsApi.dismiss(id);
|
|
318
|
+
const dismissed = this.state.notifications.find((n) => n.id === id);
|
|
319
|
+
const notifications2 = this.state.notifications.filter((n) => n.id !== id);
|
|
320
|
+
const unreadCount2 = dismissed && !dismissed.read ? Math.max(0, this.state.unreadCount - 1) : this.state.unreadCount;
|
|
321
|
+
this.setState({ notifications: notifications2, unreadCount: unreadCount2 });
|
|
322
|
+
} catch (error) {
|
|
323
|
+
this.setState({
|
|
324
|
+
error: error instanceof Error ? error.message : "Failed to dismiss notification"
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Delete all notifications.
|
|
330
|
+
*/
|
|
331
|
+
async deleteAll() {
|
|
332
|
+
try {
|
|
333
|
+
await notificationsApi.deleteAll();
|
|
334
|
+
this.setState({ notifications: [], unreadCount: 0 });
|
|
335
|
+
} catch (error) {
|
|
336
|
+
this.setState({
|
|
337
|
+
error: error instanceof Error ? error.message : "Failed to delete all notifications"
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Clear the error state.
|
|
343
|
+
*/
|
|
344
|
+
clearError() {
|
|
345
|
+
this.setState({ error: null });
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Reset the store to initial state.
|
|
349
|
+
*/
|
|
350
|
+
reset() {
|
|
351
|
+
this.setState({
|
|
352
|
+
notifications: [],
|
|
353
|
+
unreadCount: 0,
|
|
354
|
+
isLoading: false,
|
|
355
|
+
error: null,
|
|
356
|
+
pagination: {
|
|
357
|
+
page: 1,
|
|
358
|
+
limit: 20,
|
|
359
|
+
total: 0,
|
|
360
|
+
totalPages: 0
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
var notificationStore = new NotificationStore();
|
|
366
|
+
var unreadCount = {
|
|
367
|
+
subscribe: (subscriber) => {
|
|
368
|
+
return notificationStore.subscribe((state) => subscriber(state.unreadCount));
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
var notifications = {
|
|
372
|
+
subscribe: (subscriber) => {
|
|
373
|
+
return notificationStore.subscribe((state) => subscriber(state.notifications));
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
var isLoadingNotifications = {
|
|
377
|
+
subscribe: (subscriber) => {
|
|
378
|
+
return notificationStore.subscribe((state) => subscriber(state.isLoading));
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
export { isLoadingNotifications, notificationStore, notifications, unreadCount };
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for notification-related data structures.
|
|
5
|
+
*/
|
|
6
|
+
type NotificationType = 'security' | 'system' | 'feature' | 'update' | 'alert' | 'info';
|
|
7
|
+
type NotificationPriority = 'urgent' | 'high' | 'normal' | 'low';
|
|
8
|
+
interface Notification {
|
|
9
|
+
id: string;
|
|
10
|
+
userId: string;
|
|
11
|
+
type: NotificationType;
|
|
12
|
+
category: string;
|
|
13
|
+
title: string;
|
|
14
|
+
message: string;
|
|
15
|
+
icon?: string;
|
|
16
|
+
color?: string;
|
|
17
|
+
priority: NotificationPriority;
|
|
18
|
+
read: boolean;
|
|
19
|
+
dismissed: boolean;
|
|
20
|
+
actionUrl?: string;
|
|
21
|
+
actionLabel?: string;
|
|
22
|
+
metadata?: Record<string, unknown>;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
readAt?: string;
|
|
25
|
+
dismissedAt?: string;
|
|
26
|
+
}
|
|
27
|
+
interface NotificationsListResponse {
|
|
28
|
+
notifications: Notification[];
|
|
29
|
+
unreadCount: number;
|
|
30
|
+
pagination: {
|
|
31
|
+
page: number;
|
|
32
|
+
limit: number;
|
|
33
|
+
total: number;
|
|
34
|
+
totalPages: number;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
interface NotificationListParams {
|
|
38
|
+
page?: number;
|
|
39
|
+
limit?: number;
|
|
40
|
+
unreadOnly?: boolean;
|
|
41
|
+
readOnly?: boolean;
|
|
42
|
+
type?: NotificationType;
|
|
43
|
+
}
|
|
44
|
+
type ChannelType = 'email' | 'sms' | 'push' | 'in_app';
|
|
45
|
+
interface NotificationChannel {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
displayName: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
enabled: boolean;
|
|
51
|
+
priority: number;
|
|
52
|
+
}
|
|
53
|
+
type NotificationFrequency = 'immediate' | 'digest_hourly' | 'digest_daily' | 'digest_weekly';
|
|
54
|
+
interface NotificationPreference {
|
|
55
|
+
id: string;
|
|
56
|
+
userId: string;
|
|
57
|
+
channelId: string;
|
|
58
|
+
notificationType: NotificationType;
|
|
59
|
+
notificationCategory?: string;
|
|
60
|
+
enabled: boolean;
|
|
61
|
+
frequency: NotificationFrequency;
|
|
62
|
+
quietHoursStart?: string;
|
|
63
|
+
quietHoursEnd?: string;
|
|
64
|
+
quietHoursTimezone?: string;
|
|
65
|
+
minPriority: NotificationPriority;
|
|
66
|
+
tags?: string[];
|
|
67
|
+
createdAt: string;
|
|
68
|
+
updatedAt?: string;
|
|
69
|
+
}
|
|
70
|
+
interface UpdatePreferenceData {
|
|
71
|
+
channelId: string;
|
|
72
|
+
notificationType: NotificationType;
|
|
73
|
+
notificationCategory?: string;
|
|
74
|
+
enabled: boolean;
|
|
75
|
+
frequency?: NotificationFrequency;
|
|
76
|
+
quietHoursStart?: string;
|
|
77
|
+
quietHoursEnd?: string;
|
|
78
|
+
quietHoursTimezone?: string;
|
|
79
|
+
minPriority?: NotificationPriority;
|
|
80
|
+
tags?: string[];
|
|
81
|
+
}
|
|
82
|
+
interface BatchPreferenceUpdate {
|
|
83
|
+
eventType: string;
|
|
84
|
+
channels?: ChannelType[];
|
|
85
|
+
enabled?: boolean;
|
|
86
|
+
minPriority?: NotificationPriority;
|
|
87
|
+
}
|
|
88
|
+
interface NotificationPreferenceResult {
|
|
89
|
+
subscriptionId: string;
|
|
90
|
+
eventType: string;
|
|
91
|
+
success: boolean;
|
|
92
|
+
error?: string;
|
|
93
|
+
}
|
|
94
|
+
interface NotificationError {
|
|
95
|
+
subscriptionId?: string;
|
|
96
|
+
eventType?: string;
|
|
97
|
+
message: string;
|
|
98
|
+
code?: string;
|
|
99
|
+
}
|
|
100
|
+
interface BulkPreferenceResponse {
|
|
101
|
+
success: boolean;
|
|
102
|
+
total: number;
|
|
103
|
+
successful: number;
|
|
104
|
+
failed: number;
|
|
105
|
+
results: NotificationPreferenceResult[];
|
|
106
|
+
errors?: NotificationError[];
|
|
107
|
+
}
|
|
108
|
+
interface ChannelsResponse {
|
|
109
|
+
success: boolean;
|
|
110
|
+
channels: NotificationChannel[];
|
|
111
|
+
}
|
|
112
|
+
interface PreferencesResponse {
|
|
113
|
+
success: boolean;
|
|
114
|
+
preferences: NotificationPreference[];
|
|
115
|
+
}
|
|
116
|
+
interface UpdatePreferenceResponse {
|
|
117
|
+
success: boolean;
|
|
118
|
+
message: string;
|
|
119
|
+
subscriptionId: string;
|
|
120
|
+
}
|
|
121
|
+
interface DeletePreferenceResponse {
|
|
122
|
+
success: boolean;
|
|
123
|
+
message: string;
|
|
124
|
+
}
|
|
125
|
+
interface TestNotificationParams {
|
|
126
|
+
userId?: string;
|
|
127
|
+
type?: NotificationType;
|
|
128
|
+
}
|
|
129
|
+
interface TestNotificationResponse {
|
|
130
|
+
message: string;
|
|
131
|
+
data: {
|
|
132
|
+
targetUserId: string;
|
|
133
|
+
notifications: Array<{
|
|
134
|
+
id: string;
|
|
135
|
+
type: string;
|
|
136
|
+
title: string;
|
|
137
|
+
}>;
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export type { BatchPreferenceUpdate as B, ChannelType as C, DeletePreferenceResponse as D, NotificationType as N, PreferencesResponse as P, TestNotificationParams as T, UpdatePreferenceData as U, NotificationPriority as a, Notification as b, NotificationsListResponse as c, NotificationListParams as d, NotificationChannel as e, NotificationFrequency as f, NotificationPreference as g, NotificationPreferenceResult as h, NotificationError as i, BulkPreferenceResponse as j, ChannelsResponse as k, UpdatePreferenceResponse as l, TestNotificationResponse as m };
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@classic-homes/notifications",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Notification services and Svelte bindings for Classic Theme apps",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./core": {
|
|
15
|
+
"types": "./dist/core/index.d.ts",
|
|
16
|
+
"import": "./dist/core/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./svelte": {
|
|
19
|
+
"types": "./dist/svelte/index.d.ts",
|
|
20
|
+
"import": "./dist/svelte/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsup",
|
|
28
|
+
"dev": "tsup --watch",
|
|
29
|
+
"clean": "rm -rf dist",
|
|
30
|
+
"typecheck": "tsc --noEmit"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"notifications",
|
|
34
|
+
"svelte",
|
|
35
|
+
"classic-theme"
|
|
36
|
+
],
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "https://github.com/Classic-Homes/classic-theme.git",
|
|
41
|
+
"directory": "packages/notifications"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@classic-homes/auth": "*"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"svelte": "^5.0.0"
|
|
51
|
+
},
|
|
52
|
+
"peerDependenciesMeta": {
|
|
53
|
+
"svelte": {
|
|
54
|
+
"optional": true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"svelte": "^5.0.0",
|
|
59
|
+
"tsup": "^8.0.0",
|
|
60
|
+
"typescript": "^5.3.0"
|
|
61
|
+
}
|
|
62
|
+
}
|