@base44-preview/sdk 0.8.19-pr.131.ff1af44 → 0.8.19-pr.132.2bf3dc4
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.
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export type NotificationChannel = "email" | "sms" | "push" | "in_app";
|
|
2
|
+
export type NotificationPriority = "low" | "normal" | "high" | "urgent";
|
|
3
|
+
/**
|
|
4
|
+
* A notification recipient.
|
|
5
|
+
*/
|
|
6
|
+
export type NotificationRecipient = {
|
|
7
|
+
userId: string;
|
|
8
|
+
channels?: NotificationChannel[];
|
|
9
|
+
};
|
|
10
|
+
export type NotificationTemplate = {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
subject?: string;
|
|
14
|
+
body: string;
|
|
15
|
+
channel: NotificationChannel;
|
|
16
|
+
};
|
|
17
|
+
export type SendNotificationParams = {
|
|
18
|
+
recipientId: string;
|
|
19
|
+
templateId?: string;
|
|
20
|
+
channel: NotificationChannel;
|
|
21
|
+
subject?: string;
|
|
22
|
+
body: string;
|
|
23
|
+
priority?: NotificationPriority;
|
|
24
|
+
metadata?: Record<string, string | number | boolean>;
|
|
25
|
+
scheduledAt?: string;
|
|
26
|
+
};
|
|
27
|
+
export type BulkNotificationParams = {
|
|
28
|
+
recipientIds: string[];
|
|
29
|
+
templateId: string;
|
|
30
|
+
channel: NotificationChannel;
|
|
31
|
+
variables?: Record<string, string>;
|
|
32
|
+
priority?: NotificationPriority;
|
|
33
|
+
};
|
|
34
|
+
export type NotificationResult = {
|
|
35
|
+
id: string;
|
|
36
|
+
status: "queued" | "sent" | "delivered" | "failed";
|
|
37
|
+
sentAt?: string;
|
|
38
|
+
error?: string;
|
|
39
|
+
};
|
|
40
|
+
export type NotificationPreferences = {
|
|
41
|
+
userId: string;
|
|
42
|
+
enabledChannels: NotificationChannel[];
|
|
43
|
+
quietHoursStart?: string;
|
|
44
|
+
quietHoursEnd?: string;
|
|
45
|
+
unsubscribedTopics: string[];
|
|
46
|
+
};
|
|
47
|
+
export type ListNotificationsParams = {
|
|
48
|
+
status?: "queued" | "sent" | "delivered" | "failed";
|
|
49
|
+
channel?: NotificationChannel;
|
|
50
|
+
limit?: number;
|
|
51
|
+
skip?: number;
|
|
52
|
+
};
|
|
53
|
+
export interface NotificationsModule {
|
|
54
|
+
send(params: SendNotificationParams): Promise<NotificationResult>;
|
|
55
|
+
sendBulk(params: BulkNotificationParams): Promise<NotificationResult[]>;
|
|
56
|
+
getPreferences(userId: string): Promise<NotificationPreferences>;
|
|
57
|
+
updatePreferences(userId: string, preferences: Partial<Omit<NotificationPreferences, "userId">>): Promise<NotificationPreferences>;
|
|
58
|
+
list(params?: ListNotificationsParams): Promise<NotificationResult[]>;
|
|
59
|
+
/**
|
|
60
|
+
* Cancels a scheduled notification before it is sent.
|
|
61
|
+
*
|
|
62
|
+
* @param notificationId - The ID of the notification to cancel.
|
|
63
|
+
* @returns Promise resolving to `true` if the notification was successfully cancelled.
|
|
64
|
+
*/
|
|
65
|
+
cancel(notificationId: string): Promise<boolean>;
|
|
66
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|