@lovable.dev/email-js 0.1.1 → 0.2.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 +26 -0
- package/dist/index.cjs +220 -313
- package/dist/index.d.cts +120 -112
- package/dist/index.d.ts +120 -112
- package/dist/index.js +218 -275
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,158 +1,166 @@
|
|
|
1
|
-
import { ReactElement } from
|
|
2
|
-
import { EmailWebhookPayload } from
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { EmailWebhookPayload, EmailWebhookPayload as EmailWebhookPayload$1 } from "@lovable.dev/webhooks-js";
|
|
3
|
+
//#region src/types.d.ts
|
|
5
4
|
interface EmailSendRequest {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
run_id?: string;
|
|
6
|
+
to: string;
|
|
7
|
+
from: string;
|
|
8
|
+
sender_domain?: string;
|
|
9
|
+
subject: string;
|
|
10
|
+
html: string;
|
|
11
|
+
text: string;
|
|
12
|
+
purpose?: string;
|
|
13
|
+
reply_to?: string;
|
|
14
|
+
/** Visible in the Cc header. Max 5 recipients per send across to, cc, and bcc. */
|
|
15
|
+
cc?: string[];
|
|
16
|
+
/** Hidden — delivered via the envelope only, never in a header. Counts toward the 5-recipient cap. */
|
|
17
|
+
bcc?: string[];
|
|
18
|
+
identity_id?: string;
|
|
19
|
+
test_mode?: boolean;
|
|
20
|
+
label?: string;
|
|
21
|
+
idempotency_key?: string;
|
|
22
|
+
unsubscribe_token?: string;
|
|
23
|
+
message_id?: string;
|
|
21
24
|
}
|
|
22
25
|
interface EmailSendResponse {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
success: boolean;
|
|
27
|
+
message_id?: string;
|
|
28
|
+
workflow_id?: string;
|
|
29
|
+
status?: string;
|
|
27
30
|
}
|
|
28
31
|
interface SendEmailOptions {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
apiKey: string;
|
|
33
|
+
authHeader?: string;
|
|
34
|
+
apiBaseUrl?: string;
|
|
35
|
+
sendUrl?: string | undefined;
|
|
36
|
+
idempotencyKey?: string;
|
|
34
37
|
}
|
|
35
38
|
interface EmailClientOptions {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
apiKey: string;
|
|
40
|
+
authHeader?: string;
|
|
41
|
+
apiBaseUrl?: string;
|
|
39
42
|
}
|
|
40
43
|
interface ListEmailLogsFilters {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
recipient?: string;
|
|
45
|
+
event_type?: string;
|
|
46
|
+
status?: string;
|
|
47
|
+
tag?: string;
|
|
48
|
+
since?: string;
|
|
49
|
+
until?: string;
|
|
50
|
+
limit?: number;
|
|
51
|
+
cursor?: string;
|
|
49
52
|
}
|
|
50
53
|
interface EmailEvent {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
timestamp: string;
|
|
55
|
+
recipient: string;
|
|
56
|
+
event_type: string;
|
|
57
|
+
status?: string;
|
|
58
|
+
message_id?: string;
|
|
59
|
+
tags?: string[] | null;
|
|
57
60
|
}
|
|
58
61
|
interface EmailLogsPagination {
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
next_cursor: string | null;
|
|
63
|
+
has_more: boolean;
|
|
61
64
|
}
|
|
62
65
|
interface ListEmailLogsResponse {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
data: EmailEvent[];
|
|
67
|
+
pagination: EmailLogsPagination;
|
|
68
|
+
/** Earliest timestamp visible under the workspace plan's retention window; an older `since` is clamped to it. */
|
|
69
|
+
history_starts_at: string;
|
|
67
70
|
}
|
|
68
71
|
interface GetEmailUnsubscribeRequest {
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
recipient: string;
|
|
73
|
+
domain: string;
|
|
71
74
|
}
|
|
72
75
|
interface SetEmailUnsubscribeRequest {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
recipient: string;
|
|
77
|
+
domain: string;
|
|
78
|
+
subscribed: boolean;
|
|
76
79
|
}
|
|
77
80
|
interface EmailUnsubscribeResponse {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
recipient: string;
|
|
82
|
+
domain: string;
|
|
83
|
+
subscribed: boolean;
|
|
81
84
|
}
|
|
82
85
|
type EmailWebhookEventType = "email.bounced" | "email.complaint" | "email.unsubscribed" | "email.resubscribed";
|
|
83
86
|
interface WebhookEnvelope<Type extends string, Data> {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
event_id: string;
|
|
88
|
+
run_id: string;
|
|
89
|
+
type: Type;
|
|
90
|
+
project_id: string;
|
|
91
|
+
environment: "dev" | "prod";
|
|
92
|
+
data: Data;
|
|
93
|
+
timestamp: string;
|
|
94
|
+
version: string;
|
|
95
|
+
replay_id?: string;
|
|
93
96
|
}
|
|
94
97
|
type EmailWebhookEvent<T extends EmailWebhookEventType = EmailWebhookEventType> = WebhookEnvelope<T, {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
event: T;
|
|
99
|
+
recipient: string;
|
|
100
|
+
message_id: string;
|
|
98
101
|
}>;
|
|
99
|
-
type EmailWebhookHandlers = {
|
|
100
|
-
[T in EmailWebhookEventType]?: (event: EmailWebhookEvent<T>) => void | Promise<void>;
|
|
101
|
-
};
|
|
102
|
+
type EmailWebhookHandlers = { [T in EmailWebhookEventType]?: (event: EmailWebhookEvent<T>) => void | Promise<void>; };
|
|
102
103
|
interface EmailWebhookHandlerOptions {
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
apiKey: string;
|
|
105
|
+
on: EmailWebhookHandlers;
|
|
105
106
|
}
|
|
106
107
|
type AuthEmailActionType = "signup" | "invite" | "magiclink" | "recovery" | "email_change" | "reauthentication";
|
|
107
108
|
interface AuthEmailHookData {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
109
|
+
action_type: AuthEmailActionType;
|
|
110
|
+
url: string;
|
|
111
|
+
email: string;
|
|
112
|
+
old_email: string | null;
|
|
113
|
+
new_email: string | null;
|
|
114
|
+
site_url: string | null;
|
|
115
|
+
token: string | null;
|
|
116
|
+
new_token: string | null;
|
|
117
|
+
callback_url?: string;
|
|
117
118
|
}
|
|
118
119
|
type AuthEmailWebhookPayload = WebhookEnvelope<"auth", AuthEmailHookData>;
|
|
119
120
|
interface AuthEmailContent {
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
subject: string;
|
|
122
|
+
element: ReactElement;
|
|
122
123
|
}
|
|
123
124
|
type AuthEmailDefinition = {
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
subject: string;
|
|
126
|
+
render: (data: AuthEmailHookData) => ReactElement | Promise<ReactElement>;
|
|
126
127
|
} | ((data: AuthEmailHookData) => AuthEmailContent | Promise<AuthEmailContent>);
|
|
127
128
|
type AuthEmailDefinitions = Record<AuthEmailActionType, AuthEmailDefinition>;
|
|
128
129
|
interface AuthEmailHandlerOptions {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
|
|
130
|
+
apiKey: string;
|
|
131
|
+
from: string;
|
|
132
|
+
/** Defaults to the domain of `from`. */
|
|
133
|
+
senderDomain?: string;
|
|
134
|
+
sendUrl?: string | undefined;
|
|
135
|
+
emails: AuthEmailDefinitions;
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/auth-email-handler.d.ts
|
|
137
139
|
declare function createAuthEmailHandler(options: AuthEmailHandlerOptions): (req: Request) => Promise<Response>;
|
|
138
|
-
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/email.d.ts
|
|
139
142
|
declare function sendLovableEmail(payload: EmailSendRequest, options: SendEmailOptions): Promise<EmailSendResponse>;
|
|
140
|
-
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/http.d.ts
|
|
141
145
|
declare class EmailAPIError extends Error {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
146
|
+
readonly status: number;
|
|
147
|
+
readonly retryAfterSeconds: number | null;
|
|
148
|
+
readonly code: string | null;
|
|
149
|
+
constructor(status: number, message: string, retryAfterSeconds: number | null, code?: string | null);
|
|
150
|
+
get retryable(): boolean;
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/logs.d.ts
|
|
149
154
|
declare function listEmailLogs(filters: ListEmailLogsFilters, options: EmailClientOptions): Promise<ListEmailLogsResponse>;
|
|
150
|
-
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/unsubscribe.d.ts
|
|
151
157
|
declare function getEmailUnsubscribe(request: GetEmailUnsubscribeRequest, options: EmailClientOptions): Promise<EmailUnsubscribeResponse>;
|
|
152
158
|
declare function setEmailUnsubscribe(request: SetEmailUnsubscribeRequest, options: EmailClientOptions): Promise<EmailUnsubscribeResponse>;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/webhook.d.ts
|
|
161
|
+
declare function parseEmailWebhookPayload(body: string): EmailWebhookPayload$1;
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/webhook-handler.d.ts
|
|
156
164
|
declare function createEmailWebhookHandler(options: EmailWebhookHandlerOptions): (req: Request) => Promise<Response>;
|
|
157
|
-
|
|
158
|
-
export { type AuthEmailActionType, type AuthEmailContent, type AuthEmailDefinition, type AuthEmailDefinitions, type AuthEmailHandlerOptions, type AuthEmailHookData, type AuthEmailWebhookPayload, EmailAPIError, type EmailClientOptions, type EmailEvent, type EmailLogsPagination, type EmailSendRequest, type EmailSendResponse, type EmailUnsubscribeResponse, type EmailWebhookEvent, type EmailWebhookEventType, type EmailWebhookHandlerOptions, type EmailWebhookHandlers, type GetEmailUnsubscribeRequest, type ListEmailLogsFilters, type ListEmailLogsResponse, type SendEmailOptions, type SetEmailUnsubscribeRequest, createAuthEmailHandler, createEmailWebhookHandler, getEmailUnsubscribe, listEmailLogs, parseEmailWebhookPayload, sendLovableEmail, setEmailUnsubscribe };
|
|
165
|
+
//#endregion
|
|
166
|
+
export { type AuthEmailActionType, type AuthEmailContent, type AuthEmailDefinition, type AuthEmailDefinitions, type AuthEmailHandlerOptions, type AuthEmailHookData, type AuthEmailWebhookPayload, EmailAPIError, type EmailClientOptions, type EmailEvent, type EmailLogsPagination, type EmailSendRequest, type EmailSendResponse, type EmailUnsubscribeResponse, type EmailWebhookEvent, type EmailWebhookEventType, type EmailWebhookHandlerOptions, type EmailWebhookHandlers, type EmailWebhookPayload, type GetEmailUnsubscribeRequest, type ListEmailLogsFilters, type ListEmailLogsResponse, type SendEmailOptions, type SetEmailUnsubscribeRequest, createAuthEmailHandler, createEmailWebhookHandler, getEmailUnsubscribe, listEmailLogs, parseEmailWebhookPayload, sendLovableEmail, setEmailUnsubscribe };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,158 +1,166 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { EmailWebhookPayload, EmailWebhookPayload as EmailWebhookPayload$1 } from "@lovable.dev/webhooks-js";
|
|
2
|
+
import { ReactElement } from "react";
|
|
3
|
+
//#region src/types.d.ts
|
|
5
4
|
interface EmailSendRequest {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
run_id?: string;
|
|
6
|
+
to: string;
|
|
7
|
+
from: string;
|
|
8
|
+
sender_domain?: string;
|
|
9
|
+
subject: string;
|
|
10
|
+
html: string;
|
|
11
|
+
text: string;
|
|
12
|
+
purpose?: string;
|
|
13
|
+
reply_to?: string;
|
|
14
|
+
/** Visible in the Cc header. Max 5 recipients per send across to, cc, and bcc. */
|
|
15
|
+
cc?: string[];
|
|
16
|
+
/** Hidden — delivered via the envelope only, never in a header. Counts toward the 5-recipient cap. */
|
|
17
|
+
bcc?: string[];
|
|
18
|
+
identity_id?: string;
|
|
19
|
+
test_mode?: boolean;
|
|
20
|
+
label?: string;
|
|
21
|
+
idempotency_key?: string;
|
|
22
|
+
unsubscribe_token?: string;
|
|
23
|
+
message_id?: string;
|
|
21
24
|
}
|
|
22
25
|
interface EmailSendResponse {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
success: boolean;
|
|
27
|
+
message_id?: string;
|
|
28
|
+
workflow_id?: string;
|
|
29
|
+
status?: string;
|
|
27
30
|
}
|
|
28
31
|
interface SendEmailOptions {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
apiKey: string;
|
|
33
|
+
authHeader?: string;
|
|
34
|
+
apiBaseUrl?: string;
|
|
35
|
+
sendUrl?: string | undefined;
|
|
36
|
+
idempotencyKey?: string;
|
|
34
37
|
}
|
|
35
38
|
interface EmailClientOptions {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
apiKey: string;
|
|
40
|
+
authHeader?: string;
|
|
41
|
+
apiBaseUrl?: string;
|
|
39
42
|
}
|
|
40
43
|
interface ListEmailLogsFilters {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
recipient?: string;
|
|
45
|
+
event_type?: string;
|
|
46
|
+
status?: string;
|
|
47
|
+
tag?: string;
|
|
48
|
+
since?: string;
|
|
49
|
+
until?: string;
|
|
50
|
+
limit?: number;
|
|
51
|
+
cursor?: string;
|
|
49
52
|
}
|
|
50
53
|
interface EmailEvent {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
timestamp: string;
|
|
55
|
+
recipient: string;
|
|
56
|
+
event_type: string;
|
|
57
|
+
status?: string;
|
|
58
|
+
message_id?: string;
|
|
59
|
+
tags?: string[] | null;
|
|
57
60
|
}
|
|
58
61
|
interface EmailLogsPagination {
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
next_cursor: string | null;
|
|
63
|
+
has_more: boolean;
|
|
61
64
|
}
|
|
62
65
|
interface ListEmailLogsResponse {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
data: EmailEvent[];
|
|
67
|
+
pagination: EmailLogsPagination;
|
|
68
|
+
/** Earliest timestamp visible under the workspace plan's retention window; an older `since` is clamped to it. */
|
|
69
|
+
history_starts_at: string;
|
|
67
70
|
}
|
|
68
71
|
interface GetEmailUnsubscribeRequest {
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
recipient: string;
|
|
73
|
+
domain: string;
|
|
71
74
|
}
|
|
72
75
|
interface SetEmailUnsubscribeRequest {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
recipient: string;
|
|
77
|
+
domain: string;
|
|
78
|
+
subscribed: boolean;
|
|
76
79
|
}
|
|
77
80
|
interface EmailUnsubscribeResponse {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
recipient: string;
|
|
82
|
+
domain: string;
|
|
83
|
+
subscribed: boolean;
|
|
81
84
|
}
|
|
82
85
|
type EmailWebhookEventType = "email.bounced" | "email.complaint" | "email.unsubscribed" | "email.resubscribed";
|
|
83
86
|
interface WebhookEnvelope<Type extends string, Data> {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
event_id: string;
|
|
88
|
+
run_id: string;
|
|
89
|
+
type: Type;
|
|
90
|
+
project_id: string;
|
|
91
|
+
environment: "dev" | "prod";
|
|
92
|
+
data: Data;
|
|
93
|
+
timestamp: string;
|
|
94
|
+
version: string;
|
|
95
|
+
replay_id?: string;
|
|
93
96
|
}
|
|
94
97
|
type EmailWebhookEvent<T extends EmailWebhookEventType = EmailWebhookEventType> = WebhookEnvelope<T, {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
event: T;
|
|
99
|
+
recipient: string;
|
|
100
|
+
message_id: string;
|
|
98
101
|
}>;
|
|
99
|
-
type EmailWebhookHandlers = {
|
|
100
|
-
[T in EmailWebhookEventType]?: (event: EmailWebhookEvent<T>) => void | Promise<void>;
|
|
101
|
-
};
|
|
102
|
+
type EmailWebhookHandlers = { [T in EmailWebhookEventType]?: (event: EmailWebhookEvent<T>) => void | Promise<void>; };
|
|
102
103
|
interface EmailWebhookHandlerOptions {
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
apiKey: string;
|
|
105
|
+
on: EmailWebhookHandlers;
|
|
105
106
|
}
|
|
106
107
|
type AuthEmailActionType = "signup" | "invite" | "magiclink" | "recovery" | "email_change" | "reauthentication";
|
|
107
108
|
interface AuthEmailHookData {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
109
|
+
action_type: AuthEmailActionType;
|
|
110
|
+
url: string;
|
|
111
|
+
email: string;
|
|
112
|
+
old_email: string | null;
|
|
113
|
+
new_email: string | null;
|
|
114
|
+
site_url: string | null;
|
|
115
|
+
token: string | null;
|
|
116
|
+
new_token: string | null;
|
|
117
|
+
callback_url?: string;
|
|
117
118
|
}
|
|
118
119
|
type AuthEmailWebhookPayload = WebhookEnvelope<"auth", AuthEmailHookData>;
|
|
119
120
|
interface AuthEmailContent {
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
subject: string;
|
|
122
|
+
element: ReactElement;
|
|
122
123
|
}
|
|
123
124
|
type AuthEmailDefinition = {
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
subject: string;
|
|
126
|
+
render: (data: AuthEmailHookData) => ReactElement | Promise<ReactElement>;
|
|
126
127
|
} | ((data: AuthEmailHookData) => AuthEmailContent | Promise<AuthEmailContent>);
|
|
127
128
|
type AuthEmailDefinitions = Record<AuthEmailActionType, AuthEmailDefinition>;
|
|
128
129
|
interface AuthEmailHandlerOptions {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
|
|
130
|
+
apiKey: string;
|
|
131
|
+
from: string;
|
|
132
|
+
/** Defaults to the domain of `from`. */
|
|
133
|
+
senderDomain?: string;
|
|
134
|
+
sendUrl?: string | undefined;
|
|
135
|
+
emails: AuthEmailDefinitions;
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/auth-email-handler.d.ts
|
|
137
139
|
declare function createAuthEmailHandler(options: AuthEmailHandlerOptions): (req: Request) => Promise<Response>;
|
|
138
|
-
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/email.d.ts
|
|
139
142
|
declare function sendLovableEmail(payload: EmailSendRequest, options: SendEmailOptions): Promise<EmailSendResponse>;
|
|
140
|
-
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/http.d.ts
|
|
141
145
|
declare class EmailAPIError extends Error {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
146
|
+
readonly status: number;
|
|
147
|
+
readonly retryAfterSeconds: number | null;
|
|
148
|
+
readonly code: string | null;
|
|
149
|
+
constructor(status: number, message: string, retryAfterSeconds: number | null, code?: string | null);
|
|
150
|
+
get retryable(): boolean;
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/logs.d.ts
|
|
149
154
|
declare function listEmailLogs(filters: ListEmailLogsFilters, options: EmailClientOptions): Promise<ListEmailLogsResponse>;
|
|
150
|
-
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/unsubscribe.d.ts
|
|
151
157
|
declare function getEmailUnsubscribe(request: GetEmailUnsubscribeRequest, options: EmailClientOptions): Promise<EmailUnsubscribeResponse>;
|
|
152
158
|
declare function setEmailUnsubscribe(request: SetEmailUnsubscribeRequest, options: EmailClientOptions): Promise<EmailUnsubscribeResponse>;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/webhook.d.ts
|
|
161
|
+
declare function parseEmailWebhookPayload(body: string): EmailWebhookPayload$1;
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/webhook-handler.d.ts
|
|
156
164
|
declare function createEmailWebhookHandler(options: EmailWebhookHandlerOptions): (req: Request) => Promise<Response>;
|
|
157
|
-
|
|
158
|
-
export { type AuthEmailActionType, type AuthEmailContent, type AuthEmailDefinition, type AuthEmailDefinitions, type AuthEmailHandlerOptions, type AuthEmailHookData, type AuthEmailWebhookPayload, EmailAPIError, type EmailClientOptions, type EmailEvent, type EmailLogsPagination, type EmailSendRequest, type EmailSendResponse, type EmailUnsubscribeResponse, type EmailWebhookEvent, type EmailWebhookEventType, type EmailWebhookHandlerOptions, type EmailWebhookHandlers, type GetEmailUnsubscribeRequest, type ListEmailLogsFilters, type ListEmailLogsResponse, type SendEmailOptions, type SetEmailUnsubscribeRequest, createAuthEmailHandler, createEmailWebhookHandler, getEmailUnsubscribe, listEmailLogs, parseEmailWebhookPayload, sendLovableEmail, setEmailUnsubscribe };
|
|
165
|
+
//#endregion
|
|
166
|
+
export { type AuthEmailActionType, type AuthEmailContent, type AuthEmailDefinition, type AuthEmailDefinitions, type AuthEmailHandlerOptions, type AuthEmailHookData, type AuthEmailWebhookPayload, EmailAPIError, type EmailClientOptions, type EmailEvent, type EmailLogsPagination, type EmailSendRequest, type EmailSendResponse, type EmailUnsubscribeResponse, type EmailWebhookEvent, type EmailWebhookEventType, type EmailWebhookHandlerOptions, type EmailWebhookHandlers, type EmailWebhookPayload, type GetEmailUnsubscribeRequest, type ListEmailLogsFilters, type ListEmailLogsResponse, type SendEmailOptions, type SetEmailUnsubscribeRequest, createAuthEmailHandler, createEmailWebhookHandler, getEmailUnsubscribe, listEmailLogs, parseEmailWebhookPayload, sendLovableEmail, setEmailUnsubscribe };
|