@distilled.cloud/resend 1.0.0-rc.20 → 1.0.0-rc.22
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 +73 -3
- package/lib/_bundle/sdk.js +1 -1
- package/lib/_bundle/sdk.js.map +1 -1
- package/lib/credentials.d.ts +9 -4
- package/lib/credentials.d.ts.map +1 -1
- package/lib/errors.d.ts +161 -0
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.lazy.js +1 -1
- package/lib/index.lazy.js.map +1 -1
- package/lib/pagination.d.ts.map +1 -1
- package/lib/protocol.d.ts +11 -12
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +1 -1
- package/lib/retry.d.ts.map +1 -1
- package/lib/services/index.d.ts +1 -0
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/index.js +1 -0
- package/lib/services/resend.d.ts +3313 -579
- package/lib/services/resend.d.ts.map +1 -1
- package/lib/services/resend.js +226 -102
- package/lib/services/resend.js.map +1 -1
- package/lib/services/webhook_events.d.ts +1011 -0
- package/lib/services/webhook_events.d.ts.map +1 -0
- package/lib/services/webhook_events.js +1 -0
- package/lib/services.lazy/index.js +2 -2
- package/lib/services.lazy/resend.js +3 -2
- package/lib/services.lazy/webhook_events.js +1 -0
- package/lib/traits.d.ts +1 -1
- package/lib/traits.d.ts.map +1 -1
- package/lib/traits.js +1 -1
- package/lib/webhooks.d.ts +42 -0
- package/lib/webhooks.d.ts.map +1 -0
- package/lib/webhooks.js +2 -0
- package/lib/webhooks.js.map +1 -0
- package/package.json +5 -5
- package/src/credentials.ts +24 -16
- package/src/errors.ts +168 -1
- package/src/index.ts +5 -6
- package/src/protocol.ts +20 -24
- package/src/services/index.ts +1 -0
- package/src/services/resend.ts +7881 -1893
- package/src/services/webhook_events.ts +1069 -0
- package/src/traits.ts +3 -0
- package/src/webhooks.ts +245 -0
|
@@ -0,0 +1,1011 @@
|
|
|
1
|
+
import { type ResendOpError, type ResendOpContext } from "../protocol.ts";
|
|
2
|
+
export type { ResendOpError, ResendOpContext };
|
|
3
|
+
/** The event type. */
|
|
4
|
+
export type ContactCreatedEventType = "contact.created";
|
|
5
|
+
/** Array of segment IDs the contact belongs to. */
|
|
6
|
+
export type ContactEventDataSegmentIdsList = Array<string>;
|
|
7
|
+
export interface ContactEventData {
|
|
8
|
+
/** Unique identifier for the contact. */
|
|
9
|
+
id: string;
|
|
10
|
+
/** Unique identifier for the audience this contact belongs to. */
|
|
11
|
+
audience_id?: string | undefined;
|
|
12
|
+
/** Array of segment IDs the contact belongs to. */
|
|
13
|
+
segment_ids?: ContactEventDataSegmentIdsList | undefined;
|
|
14
|
+
/** Timestamp when the contact was created. */
|
|
15
|
+
created_at: string;
|
|
16
|
+
/** Timestamp when the contact was last updated. */
|
|
17
|
+
updated_at: string;
|
|
18
|
+
/** Contact's email address. */
|
|
19
|
+
email: string;
|
|
20
|
+
/** Contact's first name. */
|
|
21
|
+
first_name?: string | null | undefined;
|
|
22
|
+
/** Contact's last name. */
|
|
23
|
+
last_name?: string | null | undefined;
|
|
24
|
+
/** Whether the contact has unsubscribed from all emails sent from your team. */
|
|
25
|
+
unsubscribed: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface ContactCreatedEvent {
|
|
28
|
+
/** The event type. */
|
|
29
|
+
type: ContactCreatedEventType;
|
|
30
|
+
/** Timestamp when the event was emitted. */
|
|
31
|
+
created_at: string;
|
|
32
|
+
data: ContactEventData;
|
|
33
|
+
}
|
|
34
|
+
/** The event type. */
|
|
35
|
+
export type ContactDeletedEventType = "contact.deleted";
|
|
36
|
+
export interface ContactDeletedEvent {
|
|
37
|
+
/** The event type. */
|
|
38
|
+
type: ContactDeletedEventType;
|
|
39
|
+
/** Timestamp when the event was emitted. */
|
|
40
|
+
created_at: string;
|
|
41
|
+
data: ContactEventData;
|
|
42
|
+
}
|
|
43
|
+
/** The event type. */
|
|
44
|
+
export type ContactTopicsUpdatedEventType = "contact.topics.updated";
|
|
45
|
+
/** The new subscription status for this topic. */
|
|
46
|
+
export type ContactTopicsEventDataTopicsItemSubscription = "opt_in" | "opt_out";
|
|
47
|
+
export interface ContactTopicsEventDataTopicsItem {
|
|
48
|
+
/** Unique identifier for the topic. */
|
|
49
|
+
id: string;
|
|
50
|
+
/** The new subscription status for this topic. */
|
|
51
|
+
subscription: ContactTopicsEventDataTopicsItemSubscription;
|
|
52
|
+
}
|
|
53
|
+
/** Topics whose subscription changed in this update. */
|
|
54
|
+
export type ContactTopicsEventDataTopicsList = Array<ContactTopicsEventDataTopicsItem>;
|
|
55
|
+
export interface ContactTopicsEventData {
|
|
56
|
+
/** Contact's email address. */
|
|
57
|
+
email: string;
|
|
58
|
+
/** Topics whose subscription changed in this update. */
|
|
59
|
+
topics: ContactTopicsEventDataTopicsList;
|
|
60
|
+
}
|
|
61
|
+
export interface ContactTopicsUpdatedEvent {
|
|
62
|
+
/** The event type. */
|
|
63
|
+
type: ContactTopicsUpdatedEventType;
|
|
64
|
+
/** Timestamp when the event was emitted. */
|
|
65
|
+
created_at: string;
|
|
66
|
+
data: ContactTopicsEventData;
|
|
67
|
+
}
|
|
68
|
+
/** The event type. */
|
|
69
|
+
export type ContactUpdatedEventType = "contact.updated";
|
|
70
|
+
export interface ContactUpdatedEvent {
|
|
71
|
+
/** The event type. */
|
|
72
|
+
type: ContactUpdatedEventType;
|
|
73
|
+
/** Timestamp when the event was emitted. */
|
|
74
|
+
created_at: string;
|
|
75
|
+
data: ContactEventData;
|
|
76
|
+
}
|
|
77
|
+
/** The event type. */
|
|
78
|
+
export type DomainCreatedEventType = "domain.created";
|
|
79
|
+
/** Aggregated verification status of the domain. */
|
|
80
|
+
export type DomainEventDataStatus = "verified" | "partially_verified" | "partially_failed" | "failed" | "pending" | "not_started";
|
|
81
|
+
/** AWS region where the domain is configured. */
|
|
82
|
+
export type DomainEventDataRegion = "us-east-1" | "eu-west-1" | "sa-east-1" | "ap-northeast-1";
|
|
83
|
+
/** The purpose of the DNS record (SPF and DKIM for sending; Receiving MX for inbound emails; Tracking and TrackingCAA for click and open tracking). */
|
|
84
|
+
export type WebhookDomainRecordRecord = "SPF" | "DKIM" | "Receiving MX" | "Tracking" | "TrackingCAA";
|
|
85
|
+
/** DNS record type. */
|
|
86
|
+
export type WebhookDomainRecordType = "MX" | "TXT" | "CNAME" | "CAA";
|
|
87
|
+
/** Verification status of this specific record. */
|
|
88
|
+
export type WebhookDomainRecordStatus = "pending" | "verified" | "failed" | "temporary_failure" | "not_started";
|
|
89
|
+
export interface WebhookDomainRecord {
|
|
90
|
+
/** The purpose of the DNS record (SPF and DKIM for sending; Receiving MX for inbound emails; Tracking and TrackingCAA for click and open tracking). */
|
|
91
|
+
record: WebhookDomainRecordRecord;
|
|
92
|
+
/** DNS record name or subdomain. */
|
|
93
|
+
name: string;
|
|
94
|
+
/** DNS record value to be set. */
|
|
95
|
+
value: string;
|
|
96
|
+
/** DNS record type. */
|
|
97
|
+
type: WebhookDomainRecordType;
|
|
98
|
+
/** Time to live for the DNS record (e.g., `Auto`, `60`). */
|
|
99
|
+
ttl: string;
|
|
100
|
+
/** Verification status of this specific record. */
|
|
101
|
+
status: WebhookDomainRecordStatus;
|
|
102
|
+
/** Priority value (only applicable for MX records). */
|
|
103
|
+
priority?: number | undefined;
|
|
104
|
+
}
|
|
105
|
+
/** DNS records required for domain verification. */
|
|
106
|
+
export type DomainEventDataRecordsList = Array<WebhookDomainRecord>;
|
|
107
|
+
export interface DomainEventData {
|
|
108
|
+
/** Unique identifier for the domain. */
|
|
109
|
+
id: string;
|
|
110
|
+
/** The domain name (e.g., `example.com`). */
|
|
111
|
+
name: string;
|
|
112
|
+
/** Aggregated verification status of the domain. */
|
|
113
|
+
status: DomainEventDataStatus;
|
|
114
|
+
/** Timestamp when the domain was created. */
|
|
115
|
+
created_at: string;
|
|
116
|
+
/** AWS region where the domain is configured. */
|
|
117
|
+
region: DomainEventDataRegion;
|
|
118
|
+
/** DNS records required for domain verification. */
|
|
119
|
+
records: DomainEventDataRecordsList;
|
|
120
|
+
}
|
|
121
|
+
export interface DomainCreatedEvent {
|
|
122
|
+
/** The event type. */
|
|
123
|
+
type: DomainCreatedEventType;
|
|
124
|
+
/** Timestamp when the event was emitted. */
|
|
125
|
+
created_at: string;
|
|
126
|
+
data: DomainEventData;
|
|
127
|
+
}
|
|
128
|
+
/** The event type. */
|
|
129
|
+
export type DomainDeletedEventType = "domain.deleted";
|
|
130
|
+
export interface DomainDeletedEvent {
|
|
131
|
+
/** The event type. */
|
|
132
|
+
type: DomainDeletedEventType;
|
|
133
|
+
/** Timestamp when the event was emitted. */
|
|
134
|
+
created_at: string;
|
|
135
|
+
data: DomainEventData;
|
|
136
|
+
}
|
|
137
|
+
/** The event type. */
|
|
138
|
+
export type DomainUpdatedEventType = "domain.updated";
|
|
139
|
+
export interface DomainUpdatedEvent {
|
|
140
|
+
/** The event type. */
|
|
141
|
+
type: DomainUpdatedEventType;
|
|
142
|
+
/** Timestamp when the event was emitted. */
|
|
143
|
+
created_at: string;
|
|
144
|
+
data: DomainEventData;
|
|
145
|
+
}
|
|
146
|
+
/** The event type. */
|
|
147
|
+
export type EmailBouncedEventType = "email.bounced";
|
|
148
|
+
/** Array of impacted recipient email addresses. */
|
|
149
|
+
export type EmailBouncedEventDataToList = Array<string>;
|
|
150
|
+
/** Tag key-value pairs associated with the email. */
|
|
151
|
+
export type EmailBouncedEventDataTagsMap = {
|
|
152
|
+
[key: string]: string | undefined;
|
|
153
|
+
};
|
|
154
|
+
export interface EmailBouncedEventDataHeadersItem {
|
|
155
|
+
name: string;
|
|
156
|
+
value: string;
|
|
157
|
+
}
|
|
158
|
+
/** Custom headers included with the email (omitted when no custom headers are set). */
|
|
159
|
+
export type EmailBouncedEventDataHeadersList = Array<EmailBouncedEventDataHeadersItem>;
|
|
160
|
+
/** Array of SMTP diagnostic responses from the receiving server, one entry per recipient (e.g., `smtp; 550 5.1.1 user unknown`). */
|
|
161
|
+
export type WebhookEventBounceDiagnosticCodeList = Array<string>;
|
|
162
|
+
/** Bounce sub-type. */
|
|
163
|
+
export type WebhookEventBounceSubType = "Undetermined" | "General" | "NoEmail" | "MailboxFull" | "MessageTooLarge" | "ContentRejected" | "AttachmentRejected";
|
|
164
|
+
/** Bounce type. */
|
|
165
|
+
export type WebhookEventBounceType = "Undetermined" | "Transient" | "Permanent";
|
|
166
|
+
export interface WebhookEventBounce {
|
|
167
|
+
/** Array of SMTP diagnostic responses from the receiving server, one entry per recipient (e.g., `smtp; 550 5.1.1 user unknown`). */
|
|
168
|
+
diagnosticCode: WebhookEventBounceDiagnosticCodeList;
|
|
169
|
+
/** Detailed bounce message describing why the email bounced. */
|
|
170
|
+
message: string;
|
|
171
|
+
/** Bounce sub-type. */
|
|
172
|
+
subType: WebhookEventBounceSubType;
|
|
173
|
+
/** Bounce type. */
|
|
174
|
+
type: WebhookEventBounceType;
|
|
175
|
+
}
|
|
176
|
+
export interface EmailBouncedEventData {
|
|
177
|
+
/** Unique identifier for the email. */
|
|
178
|
+
email_id: string;
|
|
179
|
+
/** Timestamp when the email was created. */
|
|
180
|
+
created_at: string;
|
|
181
|
+
/** Sender email address and name in the format `Name <email@domain.com>`. */
|
|
182
|
+
from: string;
|
|
183
|
+
/** Array of impacted recipient email addresses. */
|
|
184
|
+
to: EmailBouncedEventDataToList;
|
|
185
|
+
/** Email subject line. */
|
|
186
|
+
subject: string;
|
|
187
|
+
/** Unique identifier for the broadcast campaign, if applicable. */
|
|
188
|
+
broadcast_id?: string | undefined;
|
|
189
|
+
/** Unique identifier for the template used, if applicable. */
|
|
190
|
+
template_id?: string | undefined;
|
|
191
|
+
/** Tag key-value pairs associated with the email. */
|
|
192
|
+
tags?: EmailBouncedEventDataTagsMap | undefined;
|
|
193
|
+
/** Custom headers included with the email (omitted when no custom headers are set). */
|
|
194
|
+
headers?: EmailBouncedEventDataHeadersList | undefined;
|
|
195
|
+
bounce: WebhookEventBounce;
|
|
196
|
+
}
|
|
197
|
+
export interface EmailBouncedEvent {
|
|
198
|
+
/** The event type. */
|
|
199
|
+
type: EmailBouncedEventType;
|
|
200
|
+
/** Timestamp when the event was emitted. */
|
|
201
|
+
created_at: string;
|
|
202
|
+
data: EmailBouncedEventData;
|
|
203
|
+
}
|
|
204
|
+
/** The event type. */
|
|
205
|
+
export type EmailClickedEventType = "email.clicked";
|
|
206
|
+
/** Array of impacted recipient email addresses. */
|
|
207
|
+
export type EmailClickedEventDataToList = Array<string>;
|
|
208
|
+
/** Tag key-value pairs associated with the email. */
|
|
209
|
+
export type EmailClickedEventDataTagsMap = {
|
|
210
|
+
[key: string]: string | undefined;
|
|
211
|
+
};
|
|
212
|
+
export type EmailClickedEventDataHeadersItem = EmailBouncedEventDataHeadersItem;
|
|
213
|
+
/** Custom headers included with the email (omitted when no custom headers are set). */
|
|
214
|
+
export type EmailClickedEventDataHeadersList = Array<EmailBouncedEventDataHeadersItem>;
|
|
215
|
+
export interface WebhookEventClick {
|
|
216
|
+
/** IP address of the user who clicked the link. */
|
|
217
|
+
ipAddress: string;
|
|
218
|
+
/** The URL that was clicked. */
|
|
219
|
+
link: string;
|
|
220
|
+
/** Timestamp when the click occurred. */
|
|
221
|
+
timestamp: string;
|
|
222
|
+
/** User agent string of the browser that clicked the link. */
|
|
223
|
+
userAgent: string;
|
|
224
|
+
}
|
|
225
|
+
export interface EmailClickedEventData {
|
|
226
|
+
/** Unique identifier for the email. */
|
|
227
|
+
email_id: string;
|
|
228
|
+
/** Timestamp when the email was created. */
|
|
229
|
+
created_at: string;
|
|
230
|
+
/** Sender email address and name in the format `Name <email@domain.com>`. */
|
|
231
|
+
from: string;
|
|
232
|
+
/** Array of impacted recipient email addresses. */
|
|
233
|
+
to: EmailClickedEventDataToList;
|
|
234
|
+
/** Email subject line. */
|
|
235
|
+
subject: string;
|
|
236
|
+
/** Unique identifier for the broadcast campaign, if applicable. */
|
|
237
|
+
broadcast_id?: string | undefined;
|
|
238
|
+
/** Unique identifier for the template used, if applicable. */
|
|
239
|
+
template_id?: string | undefined;
|
|
240
|
+
/** Tag key-value pairs associated with the email. */
|
|
241
|
+
tags?: EmailClickedEventDataTagsMap | undefined;
|
|
242
|
+
/** Custom headers included with the email (omitted when no custom headers are set). */
|
|
243
|
+
headers?: EmailClickedEventDataHeadersList | undefined;
|
|
244
|
+
click: WebhookEventClick;
|
|
245
|
+
}
|
|
246
|
+
export interface EmailClickedEvent {
|
|
247
|
+
/** The event type. */
|
|
248
|
+
type: EmailClickedEventType;
|
|
249
|
+
/** Timestamp when the event was emitted. */
|
|
250
|
+
created_at: string;
|
|
251
|
+
data: EmailClickedEventData;
|
|
252
|
+
}
|
|
253
|
+
/** The event type. */
|
|
254
|
+
export type EmailComplainedEventType = "email.complained";
|
|
255
|
+
/** Array of impacted recipient email addresses. */
|
|
256
|
+
export type OutboundEmailEventDataToList = Array<string>;
|
|
257
|
+
/** Tag key-value pairs associated with the email. */
|
|
258
|
+
export type OutboundEmailEventDataTagsMap = {
|
|
259
|
+
[key: string]: string | undefined;
|
|
260
|
+
};
|
|
261
|
+
export type OutboundEmailEventDataHeadersItem = EmailBouncedEventDataHeadersItem;
|
|
262
|
+
/** Custom headers included with the email (omitted when no custom headers are set). */
|
|
263
|
+
export type OutboundEmailEventDataHeadersList = Array<EmailBouncedEventDataHeadersItem>;
|
|
264
|
+
export interface OutboundEmailEventData {
|
|
265
|
+
/** Unique identifier for the email. */
|
|
266
|
+
email_id: string;
|
|
267
|
+
/** Timestamp when the email was created. */
|
|
268
|
+
created_at: string;
|
|
269
|
+
/** Sender email address and name in the format `Name <email@domain.com>`. */
|
|
270
|
+
from: string;
|
|
271
|
+
/** Array of impacted recipient email addresses. */
|
|
272
|
+
to: OutboundEmailEventDataToList;
|
|
273
|
+
/** Email subject line. */
|
|
274
|
+
subject: string;
|
|
275
|
+
/** Unique identifier for the broadcast campaign, if applicable. */
|
|
276
|
+
broadcast_id?: string | undefined;
|
|
277
|
+
/** Unique identifier for the template used, if applicable. */
|
|
278
|
+
template_id?: string | undefined;
|
|
279
|
+
/** Tag key-value pairs associated with the email. */
|
|
280
|
+
tags?: OutboundEmailEventDataTagsMap | undefined;
|
|
281
|
+
/** Custom headers included with the email (omitted when no custom headers are set). */
|
|
282
|
+
headers?: OutboundEmailEventDataHeadersList | undefined;
|
|
283
|
+
}
|
|
284
|
+
export interface EmailComplainedEvent {
|
|
285
|
+
/** The event type. */
|
|
286
|
+
type: EmailComplainedEventType;
|
|
287
|
+
/** Timestamp when the event was emitted. */
|
|
288
|
+
created_at: string;
|
|
289
|
+
data: OutboundEmailEventData;
|
|
290
|
+
}
|
|
291
|
+
/** The event type. */
|
|
292
|
+
export type EmailDeliveredEventType = "email.delivered";
|
|
293
|
+
export interface EmailDeliveredEvent {
|
|
294
|
+
/** The event type. */
|
|
295
|
+
type: EmailDeliveredEventType;
|
|
296
|
+
/** Timestamp when the event was emitted. */
|
|
297
|
+
created_at: string;
|
|
298
|
+
data: OutboundEmailEventData;
|
|
299
|
+
}
|
|
300
|
+
/** The event type. */
|
|
301
|
+
export type EmailDeliveryDelayedEventType = "email.delivery_delayed";
|
|
302
|
+
export interface EmailDeliveryDelayedEvent {
|
|
303
|
+
/** The event type. */
|
|
304
|
+
type: EmailDeliveryDelayedEventType;
|
|
305
|
+
/** Timestamp when the event was emitted. */
|
|
306
|
+
created_at: string;
|
|
307
|
+
data: OutboundEmailEventData;
|
|
308
|
+
}
|
|
309
|
+
/** The event type. */
|
|
310
|
+
export type EmailFailedEventType = "email.failed";
|
|
311
|
+
/** Array of impacted recipient email addresses. */
|
|
312
|
+
export type EmailFailedEventDataToList = Array<string>;
|
|
313
|
+
/** Tag key-value pairs associated with the email. */
|
|
314
|
+
export type EmailFailedEventDataTagsMap = {
|
|
315
|
+
[key: string]: string | undefined;
|
|
316
|
+
};
|
|
317
|
+
export type EmailFailedEventDataHeadersItem = EmailBouncedEventDataHeadersItem;
|
|
318
|
+
/** Custom headers included with the email (omitted when no custom headers are set). */
|
|
319
|
+
export type EmailFailedEventDataHeadersList = Array<EmailBouncedEventDataHeadersItem>;
|
|
320
|
+
export interface WebhookEventFailed {
|
|
321
|
+
/** Reason for the email failure (e.g., `reached_daily_quota`). */
|
|
322
|
+
reason: string;
|
|
323
|
+
}
|
|
324
|
+
export interface EmailFailedEventData {
|
|
325
|
+
/** Unique identifier for the email. */
|
|
326
|
+
email_id: string;
|
|
327
|
+
/** Timestamp when the email was created. */
|
|
328
|
+
created_at: string;
|
|
329
|
+
/** Sender email address and name in the format `Name <email@domain.com>`. */
|
|
330
|
+
from: string;
|
|
331
|
+
/** Array of impacted recipient email addresses. */
|
|
332
|
+
to: EmailFailedEventDataToList;
|
|
333
|
+
/** Email subject line. */
|
|
334
|
+
subject: string;
|
|
335
|
+
/** Unique identifier for the broadcast campaign, if applicable. */
|
|
336
|
+
broadcast_id?: string | undefined;
|
|
337
|
+
/** Unique identifier for the template used, if applicable. */
|
|
338
|
+
template_id?: string | undefined;
|
|
339
|
+
/** Tag key-value pairs associated with the email. */
|
|
340
|
+
tags?: EmailFailedEventDataTagsMap | undefined;
|
|
341
|
+
/** Custom headers included with the email (omitted when no custom headers are set). */
|
|
342
|
+
headers?: EmailFailedEventDataHeadersList | undefined;
|
|
343
|
+
failed: WebhookEventFailed;
|
|
344
|
+
}
|
|
345
|
+
export interface EmailFailedEvent {
|
|
346
|
+
/** The event type. */
|
|
347
|
+
type: EmailFailedEventType;
|
|
348
|
+
/** Timestamp when the event was emitted. */
|
|
349
|
+
created_at: string;
|
|
350
|
+
data: EmailFailedEventData;
|
|
351
|
+
}
|
|
352
|
+
/** The event type. */
|
|
353
|
+
export type EmailOpenedEventType = "email.opened";
|
|
354
|
+
export interface EmailOpenedEvent {
|
|
355
|
+
/** The event type. */
|
|
356
|
+
type: EmailOpenedEventType;
|
|
357
|
+
/** Timestamp when the event was emitted. */
|
|
358
|
+
created_at: string;
|
|
359
|
+
data: OutboundEmailEventData;
|
|
360
|
+
}
|
|
361
|
+
/** The event type. */
|
|
362
|
+
export type EmailReceivedEventType = "email.received";
|
|
363
|
+
/** Array of recipient email addresses. */
|
|
364
|
+
export type EmailReceivedEventDataToList = Array<string>;
|
|
365
|
+
/** BCC recipients. */
|
|
366
|
+
export type EmailReceivedEventDataBccList = Array<string>;
|
|
367
|
+
/** CC recipients. */
|
|
368
|
+
export type EmailReceivedEventDataCcList = Array<string>;
|
|
369
|
+
/** The recipient addresses the email was forwarded for, taken from the `for` clause of the message's `Received` headers. */
|
|
370
|
+
export type EmailReceivedEventDataReceivedForList = Array<string>;
|
|
371
|
+
export interface WebhookEventAttachment {
|
|
372
|
+
/** Unique identifier for the attachment. */
|
|
373
|
+
id: string;
|
|
374
|
+
/** The filename of the attachment. */
|
|
375
|
+
filename?: string | undefined;
|
|
376
|
+
/** The MIME type of the attachment. */
|
|
377
|
+
content_type?: string | undefined;
|
|
378
|
+
/** The content disposition (e.g., `inline` or `attachment`). */
|
|
379
|
+
content_disposition?: string | undefined;
|
|
380
|
+
/** Content-ID header used for referencing inline images. */
|
|
381
|
+
content_id?: string | undefined;
|
|
382
|
+
}
|
|
383
|
+
/** Array of attachment metadata. */
|
|
384
|
+
export type EmailReceivedEventDataAttachmentsList = Array<WebhookEventAttachment>;
|
|
385
|
+
export interface EmailReceivedEventData {
|
|
386
|
+
/** Unique identifier for the email. */
|
|
387
|
+
email_id: string;
|
|
388
|
+
/** Timestamp when the email was received. */
|
|
389
|
+
created_at: string;
|
|
390
|
+
/** Sender email address. */
|
|
391
|
+
from: string;
|
|
392
|
+
/** Array of recipient email addresses. */
|
|
393
|
+
to: EmailReceivedEventDataToList;
|
|
394
|
+
/** Email subject line. */
|
|
395
|
+
subject: string;
|
|
396
|
+
/** The unique message ID from the email headers. */
|
|
397
|
+
message_id: string;
|
|
398
|
+
/** BCC recipients. */
|
|
399
|
+
bcc: EmailReceivedEventDataBccList;
|
|
400
|
+
/** CC recipients. */
|
|
401
|
+
cc: EmailReceivedEventDataCcList;
|
|
402
|
+
/** The recipient addresses the email was forwarded for, taken from the `for` clause of the message's `Received` headers. */
|
|
403
|
+
received_for?: EmailReceivedEventDataReceivedForList | undefined;
|
|
404
|
+
/** Array of attachment metadata. */
|
|
405
|
+
attachments: EmailReceivedEventDataAttachmentsList;
|
|
406
|
+
}
|
|
407
|
+
export interface EmailReceivedEvent {
|
|
408
|
+
/** The event type. */
|
|
409
|
+
type: EmailReceivedEventType;
|
|
410
|
+
/** Timestamp when the event was emitted. */
|
|
411
|
+
created_at: string;
|
|
412
|
+
data: EmailReceivedEventData;
|
|
413
|
+
}
|
|
414
|
+
/** The event type. */
|
|
415
|
+
export type EmailScheduledEventType = "email.scheduled";
|
|
416
|
+
export interface EmailScheduledEvent {
|
|
417
|
+
/** The event type. */
|
|
418
|
+
type: EmailScheduledEventType;
|
|
419
|
+
/** Timestamp when the event was emitted. */
|
|
420
|
+
created_at: string;
|
|
421
|
+
data: OutboundEmailEventData;
|
|
422
|
+
}
|
|
423
|
+
/** The event type. */
|
|
424
|
+
export type EmailSentEventType = "email.sent";
|
|
425
|
+
export interface EmailSentEvent {
|
|
426
|
+
/** The event type. */
|
|
427
|
+
type: EmailSentEventType;
|
|
428
|
+
/** Timestamp when the event was emitted. */
|
|
429
|
+
created_at: string;
|
|
430
|
+
data: OutboundEmailEventData;
|
|
431
|
+
}
|
|
432
|
+
/** The event type. */
|
|
433
|
+
export type EmailSuppressedEventType = "email.suppressed";
|
|
434
|
+
/** Array of impacted recipient email addresses. */
|
|
435
|
+
export type EmailSuppressedEventDataToList = Array<string>;
|
|
436
|
+
/** Tag key-value pairs associated with the email. */
|
|
437
|
+
export type EmailSuppressedEventDataTagsMap = {
|
|
438
|
+
[key: string]: string | undefined;
|
|
439
|
+
};
|
|
440
|
+
export type EmailSuppressedEventDataHeadersItem = EmailBouncedEventDataHeadersItem;
|
|
441
|
+
/** Custom headers included with the email (omitted when no custom headers are set). */
|
|
442
|
+
export type EmailSuppressedEventDataHeadersList = Array<EmailBouncedEventDataHeadersItem>;
|
|
443
|
+
/** Array of SMTP diagnostic responses from the receiving server, one entry per recipient. */
|
|
444
|
+
export type WebhookEventSuppressedDiagnosticCodeList = Array<string>;
|
|
445
|
+
/** Reason the address is suppressed. */
|
|
446
|
+
export type WebhookEventSuppressedReason = "previous_bounce" | "previous_complaint";
|
|
447
|
+
/** Suppression type. */
|
|
448
|
+
export type WebhookEventSuppressedType = "Suppressed" | "OnAccountSuppressionList";
|
|
449
|
+
export interface WebhookEventSuppressed {
|
|
450
|
+
/** Array of SMTP diagnostic responses from the receiving server, one entry per recipient. */
|
|
451
|
+
diagnosticCode: WebhookEventSuppressedDiagnosticCodeList;
|
|
452
|
+
/** Detailed suppression message describing why the email was suppressed. */
|
|
453
|
+
message: string;
|
|
454
|
+
/** Reason the address is suppressed. */
|
|
455
|
+
reason: WebhookEventSuppressedReason;
|
|
456
|
+
/** Suppression type. */
|
|
457
|
+
type: WebhookEventSuppressedType;
|
|
458
|
+
}
|
|
459
|
+
export interface EmailSuppressedEventData {
|
|
460
|
+
/** Unique identifier for the email. */
|
|
461
|
+
email_id: string;
|
|
462
|
+
/** Timestamp when the email was created. */
|
|
463
|
+
created_at: string;
|
|
464
|
+
/** Sender email address and name in the format `Name <email@domain.com>`. */
|
|
465
|
+
from: string;
|
|
466
|
+
/** Array of impacted recipient email addresses. */
|
|
467
|
+
to: EmailSuppressedEventDataToList;
|
|
468
|
+
/** Email subject line. */
|
|
469
|
+
subject: string;
|
|
470
|
+
/** Unique identifier for the broadcast campaign, if applicable. */
|
|
471
|
+
broadcast_id?: string | undefined;
|
|
472
|
+
/** Unique identifier for the template used, if applicable. */
|
|
473
|
+
template_id?: string | undefined;
|
|
474
|
+
/** Tag key-value pairs associated with the email. */
|
|
475
|
+
tags?: EmailSuppressedEventDataTagsMap | undefined;
|
|
476
|
+
/** Custom headers included with the email (omitted when no custom headers are set). */
|
|
477
|
+
headers?: EmailSuppressedEventDataHeadersList | undefined;
|
|
478
|
+
suppressed: WebhookEventSuppressed;
|
|
479
|
+
}
|
|
480
|
+
export interface EmailSuppressedEvent {
|
|
481
|
+
/** The event type. */
|
|
482
|
+
type: EmailSuppressedEventType;
|
|
483
|
+
/** Timestamp when the event was emitted. */
|
|
484
|
+
created_at: string;
|
|
485
|
+
data: EmailSuppressedEventData;
|
|
486
|
+
}
|
|
487
|
+
/** The event type. */
|
|
488
|
+
export type InboxCreatedEventType = "inbox.created";
|
|
489
|
+
/** What made the change. */
|
|
490
|
+
export type InboxEventSource = "api" | "dashboard" | "agent" | "system";
|
|
491
|
+
export interface Inbox {
|
|
492
|
+
/** The object type. Always `inbox`. */
|
|
493
|
+
object: string;
|
|
494
|
+
/** The ID of the inbox. */
|
|
495
|
+
id: string;
|
|
496
|
+
/** Internal name for the inbox. Recipients do not see it. Falls back to the inbox email address. */
|
|
497
|
+
name: string;
|
|
498
|
+
/** The address of the inbox. */
|
|
499
|
+
email_address: string;
|
|
500
|
+
/** The ID of the domain that owns the address. */
|
|
501
|
+
domain_id: string;
|
|
502
|
+
/** The address to forward mail to when forwarding is enabled. `null` otherwise. */
|
|
503
|
+
receiving_address: string | null;
|
|
504
|
+
/** The name recipients see when mail is sent from this inbox. `null` when not set. */
|
|
505
|
+
from_name: string | null;
|
|
506
|
+
/** The number of unread threads in the Inbox folder. */
|
|
507
|
+
unread: number;
|
|
508
|
+
/** The number of unsent drafts. */
|
|
509
|
+
drafts: number;
|
|
510
|
+
/** ISO 8601 timestamp of the newest received email in the Inbox folder. `null` when the folder has no received email. */
|
|
511
|
+
last_received: string | null;
|
|
512
|
+
/** ISO 8601 timestamp when the inbox was created. */
|
|
513
|
+
created_at: string;
|
|
514
|
+
/** ISO 8601 timestamp when the inbox was last updated. */
|
|
515
|
+
updated_at: string;
|
|
516
|
+
}
|
|
517
|
+
/** The data of an `inbox.created` or `inbox.updated` event. */
|
|
518
|
+
export interface InboxEventData {
|
|
519
|
+
source: InboxEventSource;
|
|
520
|
+
/** The ID of the inbox. */
|
|
521
|
+
inbox_id: string;
|
|
522
|
+
/** The inbox as it is when the webhook is sent. Absent when the inbox no longer exists. */
|
|
523
|
+
inbox?: Inbox | undefined;
|
|
524
|
+
}
|
|
525
|
+
export interface InboxCreatedEvent {
|
|
526
|
+
/** The event type. */
|
|
527
|
+
type: InboxCreatedEventType;
|
|
528
|
+
/** Timestamp when the event was emitted. */
|
|
529
|
+
created_at: string;
|
|
530
|
+
data: InboxEventData;
|
|
531
|
+
}
|
|
532
|
+
/** The event type. */
|
|
533
|
+
export type InboxDeletedEventType = "inbox.deleted";
|
|
534
|
+
/** The data of an `inbox.deleted` event. */
|
|
535
|
+
export interface InboxDeletedEventData {
|
|
536
|
+
source: InboxEventSource;
|
|
537
|
+
/** The ID of the inbox. */
|
|
538
|
+
inbox_id: string;
|
|
539
|
+
}
|
|
540
|
+
export interface InboxDeletedEvent {
|
|
541
|
+
/** The event type. */
|
|
542
|
+
type: InboxDeletedEventType;
|
|
543
|
+
/** Timestamp when the event was emitted. */
|
|
544
|
+
created_at: string;
|
|
545
|
+
data: InboxDeletedEventData;
|
|
546
|
+
}
|
|
547
|
+
/** The event type. */
|
|
548
|
+
export type InboxDraftCreatedEventType = "inbox.draft.created";
|
|
549
|
+
/** The folder the thread is in. */
|
|
550
|
+
export type InboxThreadSummaryFolder = "inbox" | "archive" | "spam" | "sent" | "trash";
|
|
551
|
+
export interface InboxThreadLabel {
|
|
552
|
+
/** The ID of the label. */
|
|
553
|
+
id: string;
|
|
554
|
+
/** The name of the label. */
|
|
555
|
+
name: string;
|
|
556
|
+
/** The color of the label, as a `#RRGGBB` hex color in uppercase. */
|
|
557
|
+
color: string;
|
|
558
|
+
}
|
|
559
|
+
/** The labels attached to the thread. */
|
|
560
|
+
export type InboxThreadSummaryLabelsList = Array<InboxThreadLabel>;
|
|
561
|
+
/** The summary of a single thread. */
|
|
562
|
+
export interface InboxThreadSummary {
|
|
563
|
+
/** The object type. */
|
|
564
|
+
object: string;
|
|
565
|
+
/** The ID of the thread. */
|
|
566
|
+
id: string;
|
|
567
|
+
/** The subject of the thread. */
|
|
568
|
+
subject: string | null;
|
|
569
|
+
/** The folder the thread is in. */
|
|
570
|
+
folder: InboxThreadSummaryFolder;
|
|
571
|
+
/** The labels attached to the thread. */
|
|
572
|
+
labels: InboxThreadSummaryLabelsList;
|
|
573
|
+
/** True only when every email in the thread is read. */
|
|
574
|
+
read: boolean;
|
|
575
|
+
}
|
|
576
|
+
/** `standalone` for a new conversation, or `reply`. */
|
|
577
|
+
export type InboxEventDraftType = "standalone" | "reply";
|
|
578
|
+
/** The recipients. */
|
|
579
|
+
export type InboxEventDraftToList = Array<string>;
|
|
580
|
+
/** The CC recipients. */
|
|
581
|
+
export type InboxEventDraftCcList = Array<string>;
|
|
582
|
+
/** The BCC recipients. */
|
|
583
|
+
export type InboxEventDraftBccList = Array<string>;
|
|
584
|
+
/** A file stored on a draft. */
|
|
585
|
+
export interface InboxDraftAttachment {
|
|
586
|
+
/** The ID of the attachment. */
|
|
587
|
+
id: string;
|
|
588
|
+
/** The filename of the attachment. */
|
|
589
|
+
filename: string;
|
|
590
|
+
/** The MIME type of the attachment. */
|
|
591
|
+
content_type: string;
|
|
592
|
+
/** The size of the attachment in bytes. */
|
|
593
|
+
size: number;
|
|
594
|
+
}
|
|
595
|
+
/** The files stored on the draft. */
|
|
596
|
+
export type InboxEventDraftAttachmentsList = Array<InboxDraftAttachment>;
|
|
597
|
+
/** The draft carried by an inbox webhook event. It has no `html` or `text`. */
|
|
598
|
+
export interface InboxEventDraft {
|
|
599
|
+
/** The object type. Always `inbox_draft`. */
|
|
600
|
+
object: string;
|
|
601
|
+
/** The ID of the draft. */
|
|
602
|
+
id: string;
|
|
603
|
+
/** `standalone` for a new conversation, or `reply`. */
|
|
604
|
+
type: InboxEventDraftType;
|
|
605
|
+
/** The recipients. */
|
|
606
|
+
to: InboxEventDraftToList | null;
|
|
607
|
+
/** The CC recipients. */
|
|
608
|
+
cc: InboxEventDraftCcList;
|
|
609
|
+
/** The BCC recipients. */
|
|
610
|
+
bcc: InboxEventDraftBccList;
|
|
611
|
+
/** The subject. */
|
|
612
|
+
subject: string | null;
|
|
613
|
+
/** The ID of the thread when this draft is a reply. Null otherwise. */
|
|
614
|
+
thread_id: string | null;
|
|
615
|
+
/** The ID of the email this draft replies to. Null otherwise. */
|
|
616
|
+
reply_to_email_id: string | null;
|
|
617
|
+
/** The ID of the queued outbound email after send. Null until then. */
|
|
618
|
+
email_id: string | null;
|
|
619
|
+
/** Timestamp when the draft was created. */
|
|
620
|
+
created_at: string;
|
|
621
|
+
/** Timestamp when the draft was last saved. */
|
|
622
|
+
updated_at: string;
|
|
623
|
+
/** The files stored on the draft. */
|
|
624
|
+
attachments: InboxEventDraftAttachmentsList;
|
|
625
|
+
}
|
|
626
|
+
/** The data of an `inbox.draft.created`, `inbox.draft.updated` or `inbox.draft.deleted` event. */
|
|
627
|
+
export interface InboxDraftEventData {
|
|
628
|
+
source: InboxEventSource;
|
|
629
|
+
/** The ID of the inbox. */
|
|
630
|
+
inbox_id: string;
|
|
631
|
+
/** The ID of the thread. Only on reply drafts. */
|
|
632
|
+
thread_id?: string | undefined;
|
|
633
|
+
/** The ID of the draft. */
|
|
634
|
+
draft_id: string;
|
|
635
|
+
/** The thread as it is when the webhook is sent. Absent when the thread no longer exists. Only on reply drafts. */
|
|
636
|
+
thread?: InboxThreadSummary | undefined;
|
|
637
|
+
/** The draft as it is when the webhook is sent, without `html` or `text`. Fetch the body with Retrieve Draft. Absent when the draft no longer exists. */
|
|
638
|
+
draft?: InboxEventDraft | undefined;
|
|
639
|
+
}
|
|
640
|
+
export interface InboxDraftCreatedEvent {
|
|
641
|
+
/** The event type. */
|
|
642
|
+
type: InboxDraftCreatedEventType;
|
|
643
|
+
/** Timestamp when the event was emitted. */
|
|
644
|
+
created_at: string;
|
|
645
|
+
data: InboxDraftEventData;
|
|
646
|
+
}
|
|
647
|
+
/** The event type. */
|
|
648
|
+
export type InboxDraftDeletedEventType = "inbox.draft.deleted";
|
|
649
|
+
export interface InboxDraftDeletedEvent {
|
|
650
|
+
/** The event type. */
|
|
651
|
+
type: InboxDraftDeletedEventType;
|
|
652
|
+
/** Timestamp when the event was emitted. */
|
|
653
|
+
created_at: string;
|
|
654
|
+
data: InboxDraftEventData;
|
|
655
|
+
}
|
|
656
|
+
/** The event type. */
|
|
657
|
+
export type InboxDraftSentEventType = "inbox.draft.sent";
|
|
658
|
+
/** Whether the email was received by the inbox or sent from it. */
|
|
659
|
+
export type InboxEventEmailDirection = "inbound" | "outbound";
|
|
660
|
+
/** The recipients of the email. */
|
|
661
|
+
export type InboxEventEmailToList = Array<string>;
|
|
662
|
+
/** The CC recipients of the email. */
|
|
663
|
+
export type InboxEventEmailCcList = Array<string>;
|
|
664
|
+
/** The BCC recipients of the email. */
|
|
665
|
+
export type InboxEventEmailBccList = Array<string>;
|
|
666
|
+
/** The Reply-To addresses. */
|
|
667
|
+
export type InboxEventEmailReplyToList = Array<string>;
|
|
668
|
+
/** An attachment on an email in an inbox webhook event. */
|
|
669
|
+
export interface InboxEventEmailAttachment {
|
|
670
|
+
/** The ID of the attachment. */
|
|
671
|
+
id: string;
|
|
672
|
+
/** The filename of the attachment. */
|
|
673
|
+
filename: string | null;
|
|
674
|
+
/** The size of the attachment in bytes. */
|
|
675
|
+
size: number | null;
|
|
676
|
+
}
|
|
677
|
+
/** The attachments on the email. */
|
|
678
|
+
export type InboxEventEmailAttachmentsList = Array<InboxEventEmailAttachment>;
|
|
679
|
+
/** The email carried by an inbox webhook event. It has no `html` or `text`. */
|
|
680
|
+
export interface InboxEventEmail {
|
|
681
|
+
/** The ID of the email. */
|
|
682
|
+
id: string;
|
|
683
|
+
/** Whether the email was received by the inbox or sent from it. */
|
|
684
|
+
direction: InboxEventEmailDirection;
|
|
685
|
+
/** The sender, as an address or as `Name <address>`. */
|
|
686
|
+
from: string;
|
|
687
|
+
/** The recipients of the email. */
|
|
688
|
+
to: InboxEventEmailToList;
|
|
689
|
+
/** The CC recipients of the email. */
|
|
690
|
+
cc: InboxEventEmailCcList;
|
|
691
|
+
/** The BCC recipients of the email. */
|
|
692
|
+
bcc: InboxEventEmailBccList;
|
|
693
|
+
/** The Reply-To addresses. */
|
|
694
|
+
reply_to: InboxEventEmailReplyToList;
|
|
695
|
+
/** The subject of the email. */
|
|
696
|
+
subject: string | null;
|
|
697
|
+
/** The Message-ID header of the email. */
|
|
698
|
+
message_id: string | null;
|
|
699
|
+
/** The attachments on the email. */
|
|
700
|
+
attachments: InboxEventEmailAttachmentsList;
|
|
701
|
+
/** Whether the email has been read. */
|
|
702
|
+
read: boolean;
|
|
703
|
+
/** Timestamp when the email arrived or was sent. */
|
|
704
|
+
received_at: string;
|
|
705
|
+
}
|
|
706
|
+
/** The data of an `inbox.draft.sent` event. */
|
|
707
|
+
export interface InboxDraftSentEventData {
|
|
708
|
+
source: InboxEventSource;
|
|
709
|
+
/** The ID of the inbox. */
|
|
710
|
+
inbox_id: string;
|
|
711
|
+
/** The ID of the thread. */
|
|
712
|
+
thread_id: string;
|
|
713
|
+
/** The ID of the email. */
|
|
714
|
+
email_id: string;
|
|
715
|
+
/** The ID of the draft. */
|
|
716
|
+
draft_id: string;
|
|
717
|
+
/** The thread as it is when the webhook is sent. Absent when the thread no longer exists. */
|
|
718
|
+
thread?: InboxThreadSummary | undefined;
|
|
719
|
+
/** The email as it is when the webhook is sent, without `html` or `text`. Fetch the body with Retrieve Thread Email. Only when the email is already on the thread when the webhook is sent. */
|
|
720
|
+
email?: InboxEventEmail | undefined;
|
|
721
|
+
/** The draft as it is when the webhook is sent, without `html` or `text`. Fetch the body with Retrieve Draft. Absent when the draft no longer exists. */
|
|
722
|
+
draft?: InboxEventDraft | undefined;
|
|
723
|
+
}
|
|
724
|
+
export interface InboxDraftSentEvent {
|
|
725
|
+
/** The event type. */
|
|
726
|
+
type: InboxDraftSentEventType;
|
|
727
|
+
/** Timestamp when the event was emitted. */
|
|
728
|
+
created_at: string;
|
|
729
|
+
data: InboxDraftSentEventData;
|
|
730
|
+
}
|
|
731
|
+
/** The event type. */
|
|
732
|
+
export type InboxDraftUpdatedEventType = "inbox.draft.updated";
|
|
733
|
+
export interface InboxDraftUpdatedEvent {
|
|
734
|
+
/** The event type. */
|
|
735
|
+
type: InboxDraftUpdatedEventType;
|
|
736
|
+
/** Timestamp when the event was emitted. */
|
|
737
|
+
created_at: string;
|
|
738
|
+
data: InboxDraftEventData;
|
|
739
|
+
}
|
|
740
|
+
/** The event type. */
|
|
741
|
+
export type InboxEmailReceivedEventType = "inbox.email.received";
|
|
742
|
+
/** The data of an `inbox.thread.created`, `inbox.email.received` or `inbox.email.sent` event. */
|
|
743
|
+
export interface InboxThreadEmailEventData {
|
|
744
|
+
source: InboxEventSource;
|
|
745
|
+
/** The ID of the inbox. */
|
|
746
|
+
inbox_id: string;
|
|
747
|
+
/** The ID of the thread. */
|
|
748
|
+
thread_id: string;
|
|
749
|
+
/** The ID of the email. */
|
|
750
|
+
email_id: string;
|
|
751
|
+
/** The thread as it is when the webhook is sent. Absent when the thread no longer exists. */
|
|
752
|
+
thread?: InboxThreadSummary | undefined;
|
|
753
|
+
/** The email as it is when the webhook is sent, without `html` or `text`. Fetch the body with Retrieve Thread Email. Absent when the email no longer exists. */
|
|
754
|
+
email?: InboxEventEmail | undefined;
|
|
755
|
+
}
|
|
756
|
+
export interface InboxEmailReceivedEvent {
|
|
757
|
+
/** The event type. */
|
|
758
|
+
type: InboxEmailReceivedEventType;
|
|
759
|
+
/** Timestamp when the event was emitted. */
|
|
760
|
+
created_at: string;
|
|
761
|
+
data: InboxThreadEmailEventData;
|
|
762
|
+
}
|
|
763
|
+
/** The event type. */
|
|
764
|
+
export type InboxEmailSentEventType = "inbox.email.sent";
|
|
765
|
+
export interface InboxEmailSentEvent {
|
|
766
|
+
/** The event type. */
|
|
767
|
+
type: InboxEmailSentEventType;
|
|
768
|
+
/** Timestamp when the event was emitted. */
|
|
769
|
+
created_at: string;
|
|
770
|
+
data: InboxThreadEmailEventData;
|
|
771
|
+
}
|
|
772
|
+
/** The event type. */
|
|
773
|
+
export type InboxThreadAssignedEventType = "inbox.thread.assigned";
|
|
774
|
+
/** The data of an `inbox.thread.assigned` event. */
|
|
775
|
+
export interface InboxThreadAssignedEventData {
|
|
776
|
+
/** The email of the member the thread is now assigned to. */
|
|
777
|
+
assignee_email: string | null;
|
|
778
|
+
/** The email of the member who made the assignment. Null when no member made it. */
|
|
779
|
+
assigned_by_email: string | null;
|
|
780
|
+
/** The email of the member the thread was assigned to before. Null when it was unassigned. */
|
|
781
|
+
previous_assignee_email: string | null;
|
|
782
|
+
source: InboxEventSource;
|
|
783
|
+
/** The ID of the inbox. */
|
|
784
|
+
inbox_id: string;
|
|
785
|
+
/** The ID of the thread. */
|
|
786
|
+
thread_id: string;
|
|
787
|
+
/** The thread as it is when the webhook is sent. Absent when the thread no longer exists. */
|
|
788
|
+
thread?: InboxThreadSummary | undefined;
|
|
789
|
+
}
|
|
790
|
+
export interface InboxThreadAssignedEvent {
|
|
791
|
+
/** The event type. */
|
|
792
|
+
type: InboxThreadAssignedEventType;
|
|
793
|
+
/** Timestamp when the event was emitted. */
|
|
794
|
+
created_at: string;
|
|
795
|
+
data: InboxThreadAssignedEventData;
|
|
796
|
+
}
|
|
797
|
+
/** The event type. */
|
|
798
|
+
export type InboxThreadCreatedEventType = "inbox.thread.created";
|
|
799
|
+
export interface InboxThreadCreatedEvent {
|
|
800
|
+
/** The event type. */
|
|
801
|
+
type: InboxThreadCreatedEventType;
|
|
802
|
+
/** Timestamp when the event was emitted. */
|
|
803
|
+
created_at: string;
|
|
804
|
+
data: InboxThreadEmailEventData;
|
|
805
|
+
}
|
|
806
|
+
/** The event type. */
|
|
807
|
+
export type InboxThreadFolderUpdatedEventType = "inbox.thread.folder.updated";
|
|
808
|
+
/** The folder the thread was in. */
|
|
809
|
+
export type InboxThreadFolderUpdatedEventDataFrom = "inbox" | "archive" | "spam" | "trash";
|
|
810
|
+
/** The folder the thread moved to. */
|
|
811
|
+
export type InboxThreadFolderUpdatedEventDataTo = "inbox" | "archive" | "spam" | "trash";
|
|
812
|
+
/** The data of an `inbox.thread.folder.updated` event. */
|
|
813
|
+
export interface InboxThreadFolderUpdatedEventData {
|
|
814
|
+
/** The folder the thread was in. */
|
|
815
|
+
from: InboxThreadFolderUpdatedEventDataFrom;
|
|
816
|
+
/** The folder the thread moved to. */
|
|
817
|
+
to: InboxThreadFolderUpdatedEventDataTo;
|
|
818
|
+
source: InboxEventSource;
|
|
819
|
+
/** The ID of the inbox. */
|
|
820
|
+
inbox_id: string;
|
|
821
|
+
/** The ID of the thread. */
|
|
822
|
+
thread_id: string;
|
|
823
|
+
/** The thread as it is when the webhook is sent. Absent when the thread no longer exists. */
|
|
824
|
+
thread?: InboxThreadSummary | undefined;
|
|
825
|
+
}
|
|
826
|
+
export interface InboxThreadFolderUpdatedEvent {
|
|
827
|
+
/** The event type. */
|
|
828
|
+
type: InboxThreadFolderUpdatedEventType;
|
|
829
|
+
/** Timestamp when the event was emitted. */
|
|
830
|
+
created_at: string;
|
|
831
|
+
data: InboxThreadFolderUpdatedEventData;
|
|
832
|
+
}
|
|
833
|
+
/** The event type. */
|
|
834
|
+
export type InboxThreadLabelsUpdatedEventType = "inbox.thread.labels.updated";
|
|
835
|
+
/** The labels applied to the thread. */
|
|
836
|
+
export type InboxThreadLabelsUpdatedEventDataAddedList = Array<InboxThreadLabel>;
|
|
837
|
+
/** The labels removed from the thread. */
|
|
838
|
+
export type InboxThreadLabelsUpdatedEventDataRemovedList = Array<InboxThreadLabel>;
|
|
839
|
+
/** The data of an `inbox.thread.labels.updated` event. Adding labels fills only `added`. Removing one label fills only `removed`. Setting the labels of a thread can fill both. */
|
|
840
|
+
export interface InboxThreadLabelsUpdatedEventData {
|
|
841
|
+
/** The labels applied to the thread. */
|
|
842
|
+
added: InboxThreadLabelsUpdatedEventDataAddedList;
|
|
843
|
+
/** The labels removed from the thread. */
|
|
844
|
+
removed: InboxThreadLabelsUpdatedEventDataRemovedList;
|
|
845
|
+
source: InboxEventSource;
|
|
846
|
+
/** The ID of the inbox. */
|
|
847
|
+
inbox_id: string;
|
|
848
|
+
/** The ID of the thread. */
|
|
849
|
+
thread_id: string;
|
|
850
|
+
/** The thread as it is when the webhook is sent. Absent when the thread no longer exists. */
|
|
851
|
+
thread?: InboxThreadSummary | undefined;
|
|
852
|
+
}
|
|
853
|
+
export interface InboxThreadLabelsUpdatedEvent {
|
|
854
|
+
/** The event type. */
|
|
855
|
+
type: InboxThreadLabelsUpdatedEventType;
|
|
856
|
+
/** Timestamp when the event was emitted. */
|
|
857
|
+
created_at: string;
|
|
858
|
+
data: InboxThreadLabelsUpdatedEventData;
|
|
859
|
+
}
|
|
860
|
+
/** The event type. */
|
|
861
|
+
export type InboxThreadUnassignedEventType = "inbox.thread.unassigned";
|
|
862
|
+
/** The data of an `inbox.thread.unassigned` event. */
|
|
863
|
+
export interface InboxThreadUnassignedEventData {
|
|
864
|
+
/** The email of the member the thread was assigned to. */
|
|
865
|
+
previous_assignee_email: string | null;
|
|
866
|
+
source: InboxEventSource;
|
|
867
|
+
/** The ID of the inbox. */
|
|
868
|
+
inbox_id: string;
|
|
869
|
+
/** The ID of the thread. */
|
|
870
|
+
thread_id: string;
|
|
871
|
+
/** The thread as it is when the webhook is sent. Absent when the thread no longer exists. */
|
|
872
|
+
thread?: InboxThreadSummary | undefined;
|
|
873
|
+
}
|
|
874
|
+
export interface InboxThreadUnassignedEvent {
|
|
875
|
+
/** The event type. */
|
|
876
|
+
type: InboxThreadUnassignedEventType;
|
|
877
|
+
/** Timestamp when the event was emitted. */
|
|
878
|
+
created_at: string;
|
|
879
|
+
data: InboxThreadUnassignedEventData;
|
|
880
|
+
}
|
|
881
|
+
/** The event type. */
|
|
882
|
+
export type InboxUpdatedEventType = "inbox.updated";
|
|
883
|
+
export interface InboxUpdatedEvent {
|
|
884
|
+
/** The event type. */
|
|
885
|
+
type: InboxUpdatedEventType;
|
|
886
|
+
/** Timestamp when the event was emitted. */
|
|
887
|
+
created_at: string;
|
|
888
|
+
data: InboxEventData;
|
|
889
|
+
}
|
|
890
|
+
/** The event type. */
|
|
891
|
+
export type SuppressionAddedEventType = "suppression.added";
|
|
892
|
+
/** Origin of the suppression. */
|
|
893
|
+
export type SuppressionEventDataOrigin = "bounce" | "complaint" | "manual";
|
|
894
|
+
export interface SuppressionEventData {
|
|
895
|
+
/** Unique identifier for the suppression. */
|
|
896
|
+
id: string;
|
|
897
|
+
/** Email address that is suppressed. */
|
|
898
|
+
email: string;
|
|
899
|
+
/** Origin of the suppression. */
|
|
900
|
+
origin: SuppressionEventDataOrigin;
|
|
901
|
+
/** Identifier of the event that caused the suppression, such as the email that bounced or complained. Null for manually added suppressions. */
|
|
902
|
+
source_id: string | null;
|
|
903
|
+
/** Timestamp when the suppression was created. */
|
|
904
|
+
created_at: string;
|
|
905
|
+
}
|
|
906
|
+
export interface SuppressionAddedEvent {
|
|
907
|
+
/** The event type. */
|
|
908
|
+
type: SuppressionAddedEventType;
|
|
909
|
+
/** Timestamp when the event was emitted. */
|
|
910
|
+
created_at: string;
|
|
911
|
+
data: SuppressionEventData;
|
|
912
|
+
}
|
|
913
|
+
/** The event type. */
|
|
914
|
+
export type SuppressionRemovedEventType = "suppression.removed";
|
|
915
|
+
export interface SuppressionRemovedEvent {
|
|
916
|
+
/** The event type. */
|
|
917
|
+
type: SuppressionRemovedEventType;
|
|
918
|
+
/** Timestamp when the event was emitted. */
|
|
919
|
+
created_at: string;
|
|
920
|
+
data: SuppressionEventData;
|
|
921
|
+
}
|
|
922
|
+
/** The event type. */
|
|
923
|
+
export type TopicCreatedEventType = "topic.created";
|
|
924
|
+
/** The default subscription status for the topic. */
|
|
925
|
+
export type TopicEventDataDefaultSubscription = "opt_in" | "opt_out";
|
|
926
|
+
export interface TopicEventData {
|
|
927
|
+
/** Unique identifier for the topic. */
|
|
928
|
+
id: string;
|
|
929
|
+
/** The name of the topic. */
|
|
930
|
+
name: string;
|
|
931
|
+
/** A description of the topic. */
|
|
932
|
+
description: string | null;
|
|
933
|
+
/** The default subscription status for the topic. */
|
|
934
|
+
default_subscription: TopicEventDataDefaultSubscription;
|
|
935
|
+
/** Whether the topic has been deleted. */
|
|
936
|
+
deleted: boolean;
|
|
937
|
+
/** Timestamp when the topic was created. */
|
|
938
|
+
created_at: string;
|
|
939
|
+
/** Timestamp when the topic was last updated. */
|
|
940
|
+
updated_at: string;
|
|
941
|
+
}
|
|
942
|
+
export interface TopicCreatedEvent {
|
|
943
|
+
/** The event type. */
|
|
944
|
+
type: TopicCreatedEventType;
|
|
945
|
+
/** Timestamp when the event was emitted. */
|
|
946
|
+
created_at: string;
|
|
947
|
+
data: TopicEventData;
|
|
948
|
+
}
|
|
949
|
+
/** The event type. */
|
|
950
|
+
export type TopicDeletedEventType = "topic.deleted";
|
|
951
|
+
export interface TopicDeletedEvent {
|
|
952
|
+
/** The event type. */
|
|
953
|
+
type: TopicDeletedEventType;
|
|
954
|
+
/** Timestamp when the event was emitted. */
|
|
955
|
+
created_at: string;
|
|
956
|
+
data: TopicEventData;
|
|
957
|
+
}
|
|
958
|
+
/** The event type. */
|
|
959
|
+
export type TopicUpdatedEventType = "topic.updated";
|
|
960
|
+
export interface TopicUpdatedEvent {
|
|
961
|
+
/** The event type. */
|
|
962
|
+
type: TopicUpdatedEventType;
|
|
963
|
+
/** Timestamp when the event was emitted. */
|
|
964
|
+
created_at: string;
|
|
965
|
+
data: TopicEventData;
|
|
966
|
+
}
|
|
967
|
+
/** Every event Resend delivers to a webhook endpoint, discriminated on `type`. */
|
|
968
|
+
export type WebhookEvent = ContactCreatedEvent | ContactDeletedEvent | ContactTopicsUpdatedEvent | ContactUpdatedEvent | DomainCreatedEvent | DomainDeletedEvent | DomainUpdatedEvent | EmailBouncedEvent | EmailClickedEvent | EmailComplainedEvent | EmailDeliveredEvent | EmailDeliveryDelayedEvent | EmailFailedEvent | EmailOpenedEvent | EmailReceivedEvent | EmailScheduledEvent | EmailSentEvent | EmailSuppressedEvent | InboxCreatedEvent | InboxDeletedEvent | InboxDraftCreatedEvent | InboxDraftDeletedEvent | InboxDraftSentEvent | InboxDraftUpdatedEvent | InboxEmailReceivedEvent | InboxEmailSentEvent | InboxThreadAssignedEvent | InboxThreadCreatedEvent | InboxThreadFolderUpdatedEvent | InboxThreadLabelsUpdatedEvent | InboxThreadUnassignedEvent | InboxUpdatedEvent | SuppressionAddedEvent | SuppressionRemovedEvent | TopicCreatedEvent | TopicDeletedEvent | TopicUpdatedEvent;
|
|
969
|
+
/** Every webhook payload, keyed by its event name (the payload's `type`). */
|
|
970
|
+
export interface WebhookEvents {
|
|
971
|
+
"contact.created": ContactCreatedEvent;
|
|
972
|
+
"contact.deleted": ContactDeletedEvent;
|
|
973
|
+
"contact.topics.updated": ContactTopicsUpdatedEvent;
|
|
974
|
+
"contact.updated": ContactUpdatedEvent;
|
|
975
|
+
"domain.created": DomainCreatedEvent;
|
|
976
|
+
"domain.deleted": DomainDeletedEvent;
|
|
977
|
+
"domain.updated": DomainUpdatedEvent;
|
|
978
|
+
"email.bounced": EmailBouncedEvent;
|
|
979
|
+
"email.clicked": EmailClickedEvent;
|
|
980
|
+
"email.complained": EmailComplainedEvent;
|
|
981
|
+
"email.delivered": EmailDeliveredEvent;
|
|
982
|
+
"email.delivery_delayed": EmailDeliveryDelayedEvent;
|
|
983
|
+
"email.failed": EmailFailedEvent;
|
|
984
|
+
"email.opened": EmailOpenedEvent;
|
|
985
|
+
"email.received": EmailReceivedEvent;
|
|
986
|
+
"email.scheduled": EmailScheduledEvent;
|
|
987
|
+
"email.sent": EmailSentEvent;
|
|
988
|
+
"email.suppressed": EmailSuppressedEvent;
|
|
989
|
+
"inbox.created": InboxCreatedEvent;
|
|
990
|
+
"inbox.deleted": InboxDeletedEvent;
|
|
991
|
+
"inbox.draft.created": InboxDraftCreatedEvent;
|
|
992
|
+
"inbox.draft.deleted": InboxDraftDeletedEvent;
|
|
993
|
+
"inbox.draft.sent": InboxDraftSentEvent;
|
|
994
|
+
"inbox.draft.updated": InboxDraftUpdatedEvent;
|
|
995
|
+
"inbox.email.received": InboxEmailReceivedEvent;
|
|
996
|
+
"inbox.email.sent": InboxEmailSentEvent;
|
|
997
|
+
"inbox.thread.assigned": InboxThreadAssignedEvent;
|
|
998
|
+
"inbox.thread.created": InboxThreadCreatedEvent;
|
|
999
|
+
"inbox.thread.folder.updated": InboxThreadFolderUpdatedEvent;
|
|
1000
|
+
"inbox.thread.labels.updated": InboxThreadLabelsUpdatedEvent;
|
|
1001
|
+
"inbox.thread.unassigned": InboxThreadUnassignedEvent;
|
|
1002
|
+
"inbox.updated": InboxUpdatedEvent;
|
|
1003
|
+
"suppression.added": SuppressionAddedEvent;
|
|
1004
|
+
"suppression.removed": SuppressionRemovedEvent;
|
|
1005
|
+
"topic.created": TopicCreatedEvent;
|
|
1006
|
+
"topic.deleted": TopicDeletedEvent;
|
|
1007
|
+
"topic.updated": TopicUpdatedEvent;
|
|
1008
|
+
}
|
|
1009
|
+
/** A webhook event name. */
|
|
1010
|
+
export type WebhookEventType = keyof WebhookEvents;
|
|
1011
|
+
//# sourceMappingURL=webhook_events.d.ts.map
|