resend 6.4.1 → 6.5.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/dist/index.cjs +902 -0
- package/dist/index.d.cts +1453 -0
- package/dist/index.d.mts +1076 -976
- package/dist/index.mjs +821 -1126
- package/package.json +15 -9
- package/dist/index.d.ts +0 -1353
- package/dist/index.js +0 -1241
package/dist/index.d.mts
CHANGED
|
@@ -1,1353 +1,1453 @@
|
|
|
1
|
-
import * as React$1 from
|
|
1
|
+
import * as React$1 from "react";
|
|
2
2
|
|
|
3
|
+
//#region src/api-keys/interfaces/api-key.d.ts
|
|
3
4
|
interface ApiKey {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
created_at: string;
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/domains/interfaces/domain.d.ts
|
|
11
|
+
type DomainRegion = 'us-east-1' | 'eu-west-1' | 'sa-east-1' | 'ap-northeast-1';
|
|
12
|
+
type DomainCapabilityStatus = 'enabled' | 'disabled';
|
|
13
|
+
interface DomainCapabilities {
|
|
14
|
+
sending: DomainCapabilityStatus;
|
|
15
|
+
receiving: DomainCapabilityStatus;
|
|
16
|
+
}
|
|
17
|
+
type DomainNameservers = 'Amazon Route 53' | 'Cloudflare' | 'Digital Ocean' | 'GoDaddy' | 'Google Domains' | 'Namecheap' | 'Unidentified' | 'Vercel';
|
|
18
|
+
type DomainStatus = 'pending' | 'verified' | 'failed' | 'temporary_failure' | 'not_started';
|
|
19
|
+
type DomainRecords = DomainSpfRecord | DomainDkimRecord | ReceivingRecord;
|
|
20
|
+
interface DomainSpfRecord {
|
|
21
|
+
record: 'SPF';
|
|
22
|
+
name: string;
|
|
23
|
+
value: string;
|
|
24
|
+
type: 'MX' | 'TXT';
|
|
25
|
+
ttl: string;
|
|
26
|
+
status: DomainStatus;
|
|
27
|
+
routing_policy?: string;
|
|
28
|
+
priority?: number;
|
|
29
|
+
proxy_status?: 'enable' | 'disable';
|
|
30
|
+
}
|
|
31
|
+
interface DomainDkimRecord {
|
|
32
|
+
record: 'DKIM';
|
|
33
|
+
name: string;
|
|
34
|
+
value: string;
|
|
35
|
+
type: 'CNAME' | 'TXT';
|
|
36
|
+
ttl: string;
|
|
37
|
+
status: DomainStatus;
|
|
38
|
+
routing_policy?: string;
|
|
39
|
+
priority?: number;
|
|
40
|
+
proxy_status?: 'enable' | 'disable';
|
|
41
|
+
}
|
|
42
|
+
interface ReceivingRecord {
|
|
43
|
+
record: 'Receiving';
|
|
44
|
+
name: string;
|
|
45
|
+
value: string;
|
|
46
|
+
type: 'MX';
|
|
47
|
+
ttl: string;
|
|
48
|
+
status: DomainStatus;
|
|
49
|
+
priority: number;
|
|
50
|
+
}
|
|
51
|
+
interface Domain {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
status: DomainStatus;
|
|
55
|
+
created_at: string;
|
|
56
|
+
region: DomainRegion;
|
|
57
|
+
capabilities: DomainCapabilities;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/common/interfaces/domain-api-options.interface.d.ts
|
|
9
61
|
interface DomainApiOptions {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
62
|
+
name: string;
|
|
63
|
+
region?: string;
|
|
64
|
+
custom_return_path?: string;
|
|
65
|
+
capabilities?: Partial<DomainCapabilities>;
|
|
13
66
|
}
|
|
14
|
-
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/interfaces.d.ts
|
|
15
69
|
declare const RESEND_ERROR_CODES_BY_KEY: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
70
|
+
readonly missing_required_field: 422;
|
|
71
|
+
readonly invalid_idempotency_key: 400;
|
|
72
|
+
readonly invalid_idempotent_request: 409;
|
|
73
|
+
readonly concurrent_idempotent_requests: 409;
|
|
74
|
+
readonly invalid_access: 422;
|
|
75
|
+
readonly invalid_parameter: 422;
|
|
76
|
+
readonly invalid_region: 422;
|
|
77
|
+
readonly rate_limit_exceeded: 429;
|
|
78
|
+
readonly missing_api_key: 401;
|
|
79
|
+
readonly invalid_api_key: 403;
|
|
80
|
+
readonly suspended_api_key: 403;
|
|
81
|
+
readonly invalid_from_address: 403;
|
|
82
|
+
readonly validation_error: 403;
|
|
83
|
+
readonly not_found: 404;
|
|
84
|
+
readonly method_not_allowed: 405;
|
|
85
|
+
readonly application_error: 500;
|
|
86
|
+
readonly internal_server_error: 500;
|
|
33
87
|
};
|
|
34
88
|
type RESEND_ERROR_CODE_KEY = keyof typeof RESEND_ERROR_CODES_BY_KEY;
|
|
35
89
|
type Response<T> = ({
|
|
36
|
-
|
|
37
|
-
|
|
90
|
+
data: T;
|
|
91
|
+
error: null;
|
|
38
92
|
} | {
|
|
39
|
-
|
|
40
|
-
|
|
93
|
+
error: ErrorResponse;
|
|
94
|
+
data: null;
|
|
41
95
|
}) & {
|
|
42
|
-
|
|
96
|
+
headers: Record<string, string> | null;
|
|
43
97
|
};
|
|
44
98
|
type ErrorResponse = {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
99
|
+
message: string;
|
|
100
|
+
statusCode: number | null;
|
|
101
|
+
name: RESEND_ERROR_CODE_KEY;
|
|
48
102
|
};
|
|
49
103
|
type Tag$1 = {
|
|
50
|
-
|
|
51
|
-
|
|
104
|
+
name: string;
|
|
105
|
+
value: string;
|
|
52
106
|
};
|
|
53
|
-
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/common/interfaces/email-api-options.interface.d.ts
|
|
54
109
|
interface EmailApiAttachment {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
110
|
+
content?: string | Buffer;
|
|
111
|
+
filename?: string | false | undefined;
|
|
112
|
+
path?: string;
|
|
113
|
+
content_type?: string;
|
|
114
|
+
content_id?: string;
|
|
60
115
|
}
|
|
61
116
|
interface EmailApiOptions {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
117
|
+
from?: string;
|
|
118
|
+
to: string | string[];
|
|
119
|
+
subject?: string;
|
|
120
|
+
region?: string;
|
|
121
|
+
headers?: Record<string, string>;
|
|
122
|
+
html?: string;
|
|
123
|
+
text?: string;
|
|
124
|
+
bcc?: string | string[];
|
|
125
|
+
cc?: string | string[];
|
|
126
|
+
reply_to?: string | string[];
|
|
127
|
+
topic_id?: string | null;
|
|
128
|
+
scheduled_at?: string;
|
|
129
|
+
tags?: Tag$1[];
|
|
130
|
+
attachments?: EmailApiAttachment[];
|
|
131
|
+
template?: {
|
|
132
|
+
id: string;
|
|
133
|
+
variables?: Record<string, string | number>;
|
|
134
|
+
};
|
|
80
135
|
}
|
|
81
|
-
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/common/interfaces/get-option.interface.d.ts
|
|
82
138
|
interface GetOptions {
|
|
83
|
-
|
|
84
|
-
|
|
139
|
+
query?: Record<string, unknown>;
|
|
140
|
+
headers?: HeadersInit;
|
|
85
141
|
}
|
|
86
|
-
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region src/common/interfaces/idempotent-request.interface.d.ts
|
|
87
144
|
interface IdempotentRequest {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Unique key that ensures the same operation is not processed multiple times.
|
|
147
|
+
* Allows for safe retries without duplicating operations.
|
|
148
|
+
* If provided, will be sent as the `Idempotency-Key` header.
|
|
149
|
+
*/
|
|
150
|
+
idempotencyKey?: string;
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/common/interfaces/pagination-options.interface.d.ts
|
|
96
154
|
type PaginationOptions = {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
155
|
+
/**
|
|
156
|
+
* Maximum number of items to return (1-100, default: 20)
|
|
157
|
+
*/
|
|
158
|
+
limit?: number;
|
|
101
159
|
} & ({
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
160
|
+
/**
|
|
161
|
+
* Get items after this cursor (cannot be used with 'before')
|
|
162
|
+
*/
|
|
163
|
+
after?: string;
|
|
164
|
+
before?: never;
|
|
107
165
|
} | {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
166
|
+
/**
|
|
167
|
+
* Get items before this cursor (cannot be used with 'after')
|
|
168
|
+
*/
|
|
169
|
+
before?: string;
|
|
170
|
+
after?: never;
|
|
113
171
|
});
|
|
114
172
|
type PaginatedData<Data> = {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
173
|
+
object: 'list';
|
|
174
|
+
data: Data;
|
|
175
|
+
has_more: boolean;
|
|
118
176
|
};
|
|
119
|
-
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/common/interfaces/patch-option.interface.d.ts
|
|
120
179
|
interface PatchOptions {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
180
|
+
query?: {
|
|
181
|
+
[key: string]: unknown;
|
|
182
|
+
};
|
|
183
|
+
headers?: HeadersInit;
|
|
125
184
|
}
|
|
126
|
-
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/common/interfaces/post-option.interface.d.ts
|
|
127
187
|
interface PostOptions {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
188
|
+
query?: {
|
|
189
|
+
[key: string]: unknown;
|
|
190
|
+
};
|
|
191
|
+
headers?: HeadersInit;
|
|
132
192
|
}
|
|
133
|
-
|
|
193
|
+
//#endregion
|
|
194
|
+
//#region src/common/interfaces/put-option.interface.d.ts
|
|
134
195
|
interface PutOptions {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
196
|
+
query?: {
|
|
197
|
+
[key: string]: unknown;
|
|
198
|
+
};
|
|
199
|
+
headers?: HeadersInit;
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region src/common/interfaces/require-at-least-one.d.ts
|
|
203
|
+
type RequireAtLeastOne<T> = { [K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>> }[keyof T];
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region src/api-keys/interfaces/create-api-key-options.interface.d.ts
|
|
145
206
|
interface CreateApiKeyOptions {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
interface CreateApiKeyRequestOptions extends PostOptions {
|
|
207
|
+
name: string;
|
|
208
|
+
permission?: 'full_access' | 'sending_access';
|
|
209
|
+
domain_id?: string;
|
|
151
210
|
}
|
|
211
|
+
interface CreateApiKeyRequestOptions extends PostOptions {}
|
|
152
212
|
interface CreateApiKeyResponseSuccess {
|
|
153
|
-
|
|
154
|
-
|
|
213
|
+
token: string;
|
|
214
|
+
id: string;
|
|
155
215
|
}
|
|
156
216
|
type CreateApiKeyResponse = Response<CreateApiKeyResponseSuccess>;
|
|
157
|
-
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/api-keys/interfaces/list-api-keys.interface.d.ts
|
|
158
219
|
type ListApiKeysOptions = PaginationOptions;
|
|
159
220
|
type ListApiKeysResponseSuccess = {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
221
|
+
object: 'list';
|
|
222
|
+
has_more: boolean;
|
|
223
|
+
data: Pick<ApiKey, 'name' | 'id' | 'created_at'>[];
|
|
163
224
|
};
|
|
164
225
|
type ListApiKeysResponse = Response<ListApiKeysResponseSuccess>;
|
|
165
|
-
|
|
226
|
+
//#endregion
|
|
227
|
+
//#region src/api-keys/interfaces/remove-api-keys.interface.d.ts
|
|
166
228
|
type RemoveApiKeyResponseSuccess = {};
|
|
167
229
|
type RemoveApiKeyResponse = Response<RemoveApiKeyResponseSuccess>;
|
|
168
|
-
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region src/emails/interfaces/create-email-options.interface.d.ts
|
|
169
232
|
interface EmailRenderOptions$1 {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
233
|
+
/**
|
|
234
|
+
* The React component used to write the message.
|
|
235
|
+
*
|
|
236
|
+
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
237
|
+
*/
|
|
238
|
+
react: React$1.ReactNode;
|
|
239
|
+
/**
|
|
240
|
+
* The HTML version of the message.
|
|
241
|
+
*
|
|
242
|
+
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
243
|
+
*/
|
|
244
|
+
html: string;
|
|
245
|
+
/**
|
|
246
|
+
* The plain text version of the message.
|
|
247
|
+
*
|
|
248
|
+
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
249
|
+
*/
|
|
250
|
+
text: string;
|
|
188
251
|
}
|
|
189
252
|
interface EmailTemplateOptions {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
253
|
+
template: {
|
|
254
|
+
id: string;
|
|
255
|
+
variables?: Record<string, string | number>;
|
|
256
|
+
};
|
|
194
257
|
}
|
|
195
258
|
interface CreateEmailBaseOptionsWithTemplate extends Omit<CreateEmailBaseOptions, 'from' | 'subject'> {
|
|
196
|
-
|
|
197
|
-
|
|
259
|
+
from?: string;
|
|
260
|
+
subject?: string;
|
|
198
261
|
}
|
|
199
262
|
interface CreateEmailBaseOptions {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
263
|
+
/**
|
|
264
|
+
* Filename and content of attachments (max 40mb per email)
|
|
265
|
+
*
|
|
266
|
+
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
267
|
+
*/
|
|
268
|
+
attachments?: Attachment[];
|
|
269
|
+
/**
|
|
270
|
+
* Blind carbon copy recipient email address. For multiple addresses, send as an array of strings.
|
|
271
|
+
*
|
|
272
|
+
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
273
|
+
*/
|
|
274
|
+
bcc?: string | string[];
|
|
275
|
+
/**
|
|
276
|
+
* Carbon copy recipient email address. For multiple addresses, send as an array of strings.
|
|
277
|
+
*
|
|
278
|
+
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
279
|
+
*/
|
|
280
|
+
cc?: string | string[];
|
|
281
|
+
/**
|
|
282
|
+
* Sender email address. To include a friendly name, use the format `"Your Name <sender@domain.com>"`
|
|
283
|
+
*
|
|
284
|
+
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
285
|
+
*/
|
|
286
|
+
from: string;
|
|
287
|
+
/**
|
|
288
|
+
* Custom headers to add to the email.
|
|
289
|
+
*
|
|
290
|
+
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
291
|
+
*/
|
|
292
|
+
headers?: Record<string, string>;
|
|
293
|
+
/**
|
|
294
|
+
* Reply-to email address. For multiple addresses, send as an array of strings.
|
|
295
|
+
*
|
|
296
|
+
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
297
|
+
*/
|
|
298
|
+
replyTo?: string | string[];
|
|
299
|
+
/**
|
|
300
|
+
* Email subject.
|
|
301
|
+
*
|
|
302
|
+
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
303
|
+
*/
|
|
304
|
+
subject: string;
|
|
305
|
+
/**
|
|
306
|
+
* Email tags
|
|
307
|
+
*
|
|
308
|
+
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
309
|
+
*/
|
|
310
|
+
tags?: Tag[];
|
|
311
|
+
/**
|
|
312
|
+
* Recipient email address. For multiple addresses, send as an array of strings. Max 50.
|
|
313
|
+
*
|
|
314
|
+
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
315
|
+
*/
|
|
316
|
+
to: string | string[];
|
|
317
|
+
/**
|
|
318
|
+
* The id of the topic you want to send to
|
|
319
|
+
*
|
|
320
|
+
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
321
|
+
*/
|
|
322
|
+
topicId?: string | null;
|
|
323
|
+
/**
|
|
324
|
+
* Schedule email to be sent later.
|
|
325
|
+
* The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z).
|
|
326
|
+
*
|
|
327
|
+
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
328
|
+
*/
|
|
329
|
+
scheduledAt?: string;
|
|
267
330
|
}
|
|
268
331
|
type CreateEmailOptions = ((RequireAtLeastOne<EmailRenderOptions$1> & CreateEmailBaseOptions) & {
|
|
269
|
-
|
|
332
|
+
template?: never;
|
|
270
333
|
}) | ((EmailTemplateOptions & CreateEmailBaseOptionsWithTemplate) & {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
334
|
+
react?: never;
|
|
335
|
+
html?: never;
|
|
336
|
+
text?: never;
|
|
274
337
|
});
|
|
275
|
-
interface CreateEmailRequestOptions extends PostOptions, IdempotentRequest {
|
|
276
|
-
}
|
|
338
|
+
interface CreateEmailRequestOptions extends PostOptions, IdempotentRequest {}
|
|
277
339
|
interface CreateEmailResponseSuccess {
|
|
278
|
-
|
|
279
|
-
|
|
340
|
+
/** The ID of the newly created email. */
|
|
341
|
+
id: string;
|
|
280
342
|
}
|
|
281
343
|
type CreateEmailResponse = Response<CreateEmailResponseSuccess>;
|
|
282
|
-
interface Attachment
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
344
|
+
interface Attachment {
|
|
345
|
+
/** Content of an attached file. */
|
|
346
|
+
content?: string | Buffer;
|
|
347
|
+
/** Name of attached file. */
|
|
348
|
+
filename?: string | false | undefined;
|
|
349
|
+
/** Path where the attachment file is hosted */
|
|
350
|
+
path?: string;
|
|
351
|
+
/** Optional content type for the attachment, if not set will be derived from the filename property */
|
|
352
|
+
contentType?: string;
|
|
353
|
+
/**
|
|
354
|
+
* Optional content ID for the attachment, to be used as a reference in the HTML content.
|
|
355
|
+
* If set, this attachment will be sent as an inline attachment and you can reference it in the HTML content using the `cid:` prefix.
|
|
356
|
+
*/
|
|
357
|
+
contentId?: string;
|
|
296
358
|
}
|
|
297
359
|
type Tag = {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
360
|
+
/**
|
|
361
|
+
* The name of the email tag. It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-). It can contain no more than 256 characters.
|
|
362
|
+
*/
|
|
363
|
+
name: string;
|
|
364
|
+
/**
|
|
365
|
+
* The value of the email tag. It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-). It can contain no more than 256 characters.
|
|
366
|
+
*/
|
|
367
|
+
value: string;
|
|
306
368
|
};
|
|
307
|
-
|
|
369
|
+
//#endregion
|
|
370
|
+
//#region src/batch/interfaces/create-batch-options.interface.d.ts
|
|
308
371
|
type CreateBatchOptions = CreateEmailOptions[];
|
|
309
372
|
interface CreateBatchRequestOptions extends PostOptions, IdempotentRequest {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
373
|
+
/**
|
|
374
|
+
* @default 'strict'
|
|
375
|
+
*/
|
|
376
|
+
batchValidation?: 'strict' | 'permissive';
|
|
314
377
|
}
|
|
315
378
|
type CreateBatchSuccessResponse<Options extends CreateBatchRequestOptions = CreateBatchRequestOptions> = {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
379
|
+
data: {
|
|
380
|
+
/** The ID of the newly created email. */
|
|
381
|
+
id: string;
|
|
382
|
+
}[];
|
|
320
383
|
} & (Options['batchValidation'] extends 'permissive' ? {
|
|
384
|
+
/**
|
|
385
|
+
* Only present when header "x-batch-validation" is set to 'permissive'.
|
|
386
|
+
*/
|
|
387
|
+
errors: {
|
|
388
|
+
/**
|
|
389
|
+
* The index of the failed email in the batch
|
|
390
|
+
*/
|
|
391
|
+
index: number;
|
|
321
392
|
/**
|
|
322
|
-
*
|
|
393
|
+
* The error message for the failed email
|
|
323
394
|
*/
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
* The index of the failed email in the batch
|
|
327
|
-
*/
|
|
328
|
-
index: number;
|
|
329
|
-
/**
|
|
330
|
-
* The error message for the failed email
|
|
331
|
-
*/
|
|
332
|
-
message: string;
|
|
333
|
-
}[];
|
|
395
|
+
message: string;
|
|
396
|
+
}[];
|
|
334
397
|
} : Record<string, never>);
|
|
335
398
|
type CreateBatchResponse<Options extends CreateBatchRequestOptions> = Response<CreateBatchSuccessResponse<Options>>;
|
|
336
|
-
|
|
399
|
+
//#endregion
|
|
400
|
+
//#region src/broadcasts/interfaces/broadcast.d.ts
|
|
337
401
|
interface Broadcast {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
}
|
|
354
|
-
|
|
402
|
+
id: string;
|
|
403
|
+
name: string;
|
|
404
|
+
segment_id: string | null;
|
|
405
|
+
audience_id: string | null;
|
|
406
|
+
from: string | null;
|
|
407
|
+
subject: string | null;
|
|
408
|
+
reply_to: string[] | null;
|
|
409
|
+
preview_text: string | null;
|
|
410
|
+
status: 'draft' | 'sent' | 'queued';
|
|
411
|
+
created_at: string;
|
|
412
|
+
scheduled_at: string | null;
|
|
413
|
+
sent_at: string | null;
|
|
414
|
+
topic_id?: string | null;
|
|
415
|
+
html: string | null;
|
|
416
|
+
text: string | null;
|
|
417
|
+
}
|
|
418
|
+
//#endregion
|
|
419
|
+
//#region src/broadcasts/interfaces/create-broadcast-options.interface.d.ts
|
|
355
420
|
interface EmailRenderOptions {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
421
|
+
/**
|
|
422
|
+
* The React component used to write the message.
|
|
423
|
+
*
|
|
424
|
+
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
425
|
+
*/
|
|
426
|
+
react: React$1.ReactNode;
|
|
427
|
+
/**
|
|
428
|
+
* The HTML version of the message.
|
|
429
|
+
*
|
|
430
|
+
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
431
|
+
*/
|
|
432
|
+
html: string;
|
|
433
|
+
/**
|
|
434
|
+
* The plain text version of the message.
|
|
435
|
+
*
|
|
436
|
+
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
437
|
+
*/
|
|
438
|
+
text: string;
|
|
374
439
|
}
|
|
375
440
|
interface SegmentOptions {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
441
|
+
/**
|
|
442
|
+
* The id of the segment you want to send to
|
|
443
|
+
*
|
|
444
|
+
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
445
|
+
*/
|
|
446
|
+
segmentId: string;
|
|
447
|
+
/**
|
|
448
|
+
* @deprecated Use segmentId instead
|
|
449
|
+
*/
|
|
450
|
+
audienceId: string;
|
|
386
451
|
}
|
|
387
452
|
interface CreateBroadcastBaseOptions {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
453
|
+
/**
|
|
454
|
+
* The name of the broadcast
|
|
455
|
+
*
|
|
456
|
+
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
457
|
+
*/
|
|
458
|
+
name?: string;
|
|
459
|
+
/**
|
|
460
|
+
* A short snippet of text displayed as a preview in recipients' inboxes, often shown below or beside the subject line.
|
|
461
|
+
*
|
|
462
|
+
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
463
|
+
*/
|
|
464
|
+
previewText?: string;
|
|
465
|
+
/**
|
|
466
|
+
* Sender email address. To include a friendly name, use the format `"Your Name <sender@domain.com>"`
|
|
467
|
+
*
|
|
468
|
+
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
469
|
+
*/
|
|
470
|
+
from: string;
|
|
471
|
+
/**
|
|
472
|
+
* Reply-to email address. For multiple addresses, send as an array of strings.
|
|
473
|
+
*
|
|
474
|
+
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
475
|
+
*/
|
|
476
|
+
replyTo?: string | string[];
|
|
477
|
+
/**
|
|
478
|
+
* Email subject.
|
|
479
|
+
*
|
|
480
|
+
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
481
|
+
*/
|
|
482
|
+
subject: string;
|
|
483
|
+
/**
|
|
484
|
+
* The id of the topic you want to send to
|
|
485
|
+
*
|
|
486
|
+
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
487
|
+
*/
|
|
488
|
+
topicId?: string | null;
|
|
424
489
|
}
|
|
425
490
|
type CreateBroadcastOptions = RequireAtLeastOne<EmailRenderOptions> & RequireAtLeastOne<SegmentOptions> & CreateBroadcastBaseOptions;
|
|
426
|
-
interface CreateBroadcastRequestOptions extends PostOptions {
|
|
427
|
-
}
|
|
491
|
+
interface CreateBroadcastRequestOptions extends PostOptions {}
|
|
428
492
|
interface CreateBroadcastResponseSuccess {
|
|
429
|
-
|
|
430
|
-
|
|
493
|
+
/** The ID of the newly sent broadcasts. */
|
|
494
|
+
id: string;
|
|
431
495
|
}
|
|
432
496
|
type CreateBroadcastResponse = Response<CreateBroadcastResponseSuccess>;
|
|
433
|
-
|
|
497
|
+
//#endregion
|
|
498
|
+
//#region src/broadcasts/interfaces/get-broadcast.interface.d.ts
|
|
434
499
|
interface GetBroadcastResponseSuccess extends Broadcast {
|
|
435
|
-
|
|
500
|
+
object: 'broadcast';
|
|
436
501
|
}
|
|
437
502
|
type GetBroadcastResponse = Response<GetBroadcastResponseSuccess>;
|
|
438
|
-
|
|
503
|
+
//#endregion
|
|
504
|
+
//#region src/broadcasts/interfaces/list-broadcasts.interface.d.ts
|
|
439
505
|
type ListBroadcastsOptions = PaginationOptions;
|
|
440
506
|
type ListBroadcastsResponseSuccess = {
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
507
|
+
object: 'list';
|
|
508
|
+
has_more: boolean;
|
|
509
|
+
data: Pick<Broadcast, 'id' | 'name' | 'audience_id' | 'segment_id' | 'status' | 'created_at' | 'scheduled_at' | 'sent_at'>[];
|
|
444
510
|
};
|
|
445
511
|
type ListBroadcastsResponse = Response<ListBroadcastsResponseSuccess>;
|
|
446
|
-
|
|
512
|
+
//#endregion
|
|
513
|
+
//#region src/broadcasts/interfaces/remove-broadcast.interface.d.ts
|
|
447
514
|
interface RemoveBroadcastResponseSuccess extends Pick<Broadcast, 'id'> {
|
|
448
|
-
|
|
449
|
-
|
|
515
|
+
object: 'broadcast';
|
|
516
|
+
deleted: boolean;
|
|
450
517
|
}
|
|
451
518
|
type RemoveBroadcastResponse = Response<RemoveBroadcastResponseSuccess>;
|
|
452
|
-
|
|
519
|
+
//#endregion
|
|
520
|
+
//#region src/broadcasts/interfaces/send-broadcast-options.interface.d.ts
|
|
453
521
|
interface SendBroadcastBaseOptions {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
522
|
+
/**
|
|
523
|
+
* Schedule email to be sent later.
|
|
524
|
+
* The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z)
|
|
525
|
+
* or relative time (eg: in 2 days).
|
|
526
|
+
*
|
|
527
|
+
* @link https://resend.com/docs/api-reference/broadcasts/send#body-parameters
|
|
528
|
+
*/
|
|
529
|
+
scheduledAt?: string;
|
|
462
530
|
}
|
|
463
531
|
type SendBroadcastOptions = SendBroadcastBaseOptions;
|
|
464
|
-
interface SendBroadcastRequestOptions extends PostOptions {
|
|
465
|
-
}
|
|
532
|
+
interface SendBroadcastRequestOptions extends PostOptions {}
|
|
466
533
|
interface SendBroadcastResponseSuccess {
|
|
467
|
-
|
|
468
|
-
|
|
534
|
+
/** The ID of the sent broadcast. */
|
|
535
|
+
id: string;
|
|
469
536
|
}
|
|
470
537
|
type SendBroadcastResponse = Response<SendBroadcastResponseSuccess>;
|
|
471
|
-
|
|
538
|
+
//#endregion
|
|
539
|
+
//#region src/broadcasts/interfaces/update-broadcast.interface.d.ts
|
|
472
540
|
interface UpdateBroadcastResponseSuccess {
|
|
473
|
-
|
|
541
|
+
id: string;
|
|
474
542
|
}
|
|
475
543
|
type UpdateBroadcastOptions = {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
544
|
+
name?: string;
|
|
545
|
+
segmentId?: string;
|
|
546
|
+
/**
|
|
547
|
+
* @deprecated Use segmentId instead
|
|
548
|
+
*/
|
|
549
|
+
audienceId?: string;
|
|
550
|
+
from?: string;
|
|
551
|
+
html?: string;
|
|
552
|
+
react?: React.ReactNode;
|
|
553
|
+
text?: string;
|
|
554
|
+
subject?: string;
|
|
555
|
+
replyTo?: string[];
|
|
556
|
+
previewText?: string;
|
|
557
|
+
topicId?: string | null;
|
|
490
558
|
};
|
|
491
559
|
type UpdateBroadcastResponse = Response<UpdateBroadcastResponseSuccess>;
|
|
492
|
-
|
|
560
|
+
//#endregion
|
|
561
|
+
//#region src/contacts/interfaces/contact.d.ts
|
|
493
562
|
interface Contact {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
563
|
+
created_at: string;
|
|
564
|
+
id: string;
|
|
565
|
+
email: string;
|
|
566
|
+
first_name?: string;
|
|
567
|
+
last_name?: string;
|
|
568
|
+
unsubscribed: boolean;
|
|
500
569
|
}
|
|
501
570
|
type SelectingField = {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
571
|
+
/**
|
|
572
|
+
* The contact id.
|
|
573
|
+
*
|
|
574
|
+
* @link https://resend.com/docs/api-reference/contacts/delete-contact#body-parameters
|
|
575
|
+
*/
|
|
576
|
+
id: string;
|
|
577
|
+
/**
|
|
578
|
+
* The contact email.
|
|
579
|
+
*
|
|
580
|
+
* @link https://resend.com/docs/api-reference/contacts/delete-contact#body-parameters
|
|
581
|
+
*/
|
|
582
|
+
email?: undefined | null;
|
|
514
583
|
} | {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
584
|
+
/**
|
|
585
|
+
* The contact id.
|
|
586
|
+
*
|
|
587
|
+
* @link https://resend.com/docs/api-reference/contacts/delete-contact#body-parameters
|
|
588
|
+
*/
|
|
589
|
+
id?: undefined | null;
|
|
590
|
+
/**
|
|
591
|
+
* The contact email.
|
|
592
|
+
*
|
|
593
|
+
* @link https://resend.com/docs/api-reference/contacts/delete-contact#body-parameters
|
|
594
|
+
*/
|
|
595
|
+
email: string;
|
|
527
596
|
};
|
|
528
|
-
|
|
597
|
+
//#endregion
|
|
598
|
+
//#region src/contacts/interfaces/create-contact-options.interface.d.ts
|
|
529
599
|
interface CreateContactPropertiesOptions {
|
|
530
|
-
|
|
600
|
+
[key: string]: string | number | null;
|
|
531
601
|
}
|
|
532
602
|
interface CreateContactOptions {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
}
|
|
540
|
-
interface CreateContactRequestOptions extends PostOptions {
|
|
541
|
-
}
|
|
603
|
+
audienceId?: string;
|
|
604
|
+
email: string;
|
|
605
|
+
unsubscribed?: boolean;
|
|
606
|
+
firstName?: string;
|
|
607
|
+
lastName?: string;
|
|
608
|
+
properties?: CreateContactPropertiesOptions;
|
|
609
|
+
}
|
|
610
|
+
interface CreateContactRequestOptions extends PostOptions {}
|
|
542
611
|
interface CreateContactResponseSuccess extends Pick<Contact, 'id'> {
|
|
543
|
-
|
|
612
|
+
object: 'contact';
|
|
544
613
|
}
|
|
545
614
|
type CreateContactResponse = Response<CreateContactResponseSuccess>;
|
|
546
|
-
|
|
615
|
+
//#endregion
|
|
616
|
+
//#region src/contacts/interfaces/get-contact.interface.d.ts
|
|
547
617
|
type GetContactOptions = string | ({
|
|
548
|
-
|
|
618
|
+
audienceId?: string;
|
|
549
619
|
} & SelectingField);
|
|
550
620
|
type ContactPropertyValue = {
|
|
551
|
-
|
|
552
|
-
|
|
621
|
+
type: 'string';
|
|
622
|
+
value: string;
|
|
553
623
|
} | {
|
|
554
|
-
|
|
555
|
-
|
|
624
|
+
type: 'number';
|
|
625
|
+
value: number;
|
|
556
626
|
};
|
|
557
627
|
interface ContactProperties$1 {
|
|
558
|
-
|
|
628
|
+
[key: string]: ContactPropertyValue;
|
|
559
629
|
}
|
|
560
630
|
interface GetContactResponseSuccess extends Pick<Contact, 'id' | 'email' | 'created_at' | 'first_name' | 'last_name' | 'unsubscribed'> {
|
|
561
|
-
|
|
562
|
-
|
|
631
|
+
object: 'contact';
|
|
632
|
+
properties: ContactProperties$1;
|
|
563
633
|
}
|
|
564
634
|
type GetContactResponse = Response<GetContactResponseSuccess>;
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
audienceId: string;
|
|
568
|
-
} & PaginationOptions;
|
|
635
|
+
//#endregion
|
|
636
|
+
//#region src/contacts/interfaces/list-contacts.interface.d.ts
|
|
569
637
|
type ListContactsOptions = PaginationOptions & {
|
|
570
|
-
|
|
638
|
+
segmentId?: string;
|
|
639
|
+
/**
|
|
640
|
+
* @deprecated Use segmentId instead to filter by segment
|
|
641
|
+
*/
|
|
642
|
+
audienceId?: string;
|
|
571
643
|
};
|
|
572
644
|
interface ListContactsResponseSuccess {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
645
|
+
object: 'list';
|
|
646
|
+
data: Contact[];
|
|
647
|
+
has_more: boolean;
|
|
576
648
|
}
|
|
577
649
|
type ListContactsResponse = Response<ListContactsResponseSuccess>;
|
|
578
|
-
|
|
650
|
+
//#endregion
|
|
651
|
+
//#region src/contacts/interfaces/remove-contact.interface.d.ts
|
|
579
652
|
type RemoveContactsResponseSuccess = {
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
653
|
+
object: 'contact';
|
|
654
|
+
deleted: boolean;
|
|
655
|
+
contact: string;
|
|
583
656
|
};
|
|
584
657
|
type RemoveContactOptions = string | (SelectingField & {
|
|
585
|
-
|
|
658
|
+
audienceId?: string;
|
|
586
659
|
});
|
|
587
660
|
type RemoveContactsResponse = Response<RemoveContactsResponseSuccess>;
|
|
588
|
-
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region src/contacts/interfaces/update-contact.interface.d.ts
|
|
589
663
|
interface UpdateContactPropertiesOptions {
|
|
590
|
-
|
|
664
|
+
[key: string]: string | number | null;
|
|
591
665
|
}
|
|
592
666
|
type UpdateContactOptions = {
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
667
|
+
audienceId?: string;
|
|
668
|
+
unsubscribed?: boolean;
|
|
669
|
+
firstName?: string;
|
|
670
|
+
lastName?: string;
|
|
671
|
+
properties?: UpdateContactPropertiesOptions;
|
|
598
672
|
} & SelectingField;
|
|
599
673
|
type UpdateContactResponseSuccess = Pick<Contact, 'id'> & {
|
|
600
|
-
|
|
674
|
+
object: 'contact';
|
|
601
675
|
};
|
|
602
676
|
type UpdateContactResponse = Response<UpdateContactResponseSuccess>;
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
type DomainNameservers = 'Amazon Route 53' | 'Cloudflare' | 'Digital Ocean' | 'GoDaddy' | 'Google Domains' | 'Namecheap' | 'Unidentified' | 'Vercel';
|
|
606
|
-
type DomainStatus = 'pending' | 'verified' | 'failed' | 'temporary_failure' | 'not_started';
|
|
607
|
-
type DomainRecords = DomainSpfRecord | DomainDkimRecord | ReceivingRecord;
|
|
608
|
-
interface DomainSpfRecord {
|
|
609
|
-
record: 'SPF';
|
|
610
|
-
name: string;
|
|
611
|
-
value: string;
|
|
612
|
-
type: 'MX' | 'TXT';
|
|
613
|
-
ttl: string;
|
|
614
|
-
status: DomainStatus;
|
|
615
|
-
routing_policy?: string;
|
|
616
|
-
priority?: number;
|
|
617
|
-
proxy_status?: 'enable' | 'disable';
|
|
618
|
-
}
|
|
619
|
-
interface DomainDkimRecord {
|
|
620
|
-
record: 'DKIM';
|
|
621
|
-
name: string;
|
|
622
|
-
value: string;
|
|
623
|
-
type: 'CNAME' | 'TXT';
|
|
624
|
-
ttl: string;
|
|
625
|
-
status: DomainStatus;
|
|
626
|
-
routing_policy?: string;
|
|
627
|
-
priority?: number;
|
|
628
|
-
proxy_status?: 'enable' | 'disable';
|
|
629
|
-
}
|
|
630
|
-
interface ReceivingRecord {
|
|
631
|
-
record: 'Receiving';
|
|
632
|
-
name: string;
|
|
633
|
-
value: string;
|
|
634
|
-
type: 'MX';
|
|
635
|
-
ttl: string;
|
|
636
|
-
status: DomainStatus;
|
|
637
|
-
priority: number;
|
|
638
|
-
}
|
|
639
|
-
interface Domain {
|
|
640
|
-
id: string;
|
|
641
|
-
name: string;
|
|
642
|
-
status: DomainStatus;
|
|
643
|
-
created_at: string;
|
|
644
|
-
region: DomainRegion;
|
|
645
|
-
}
|
|
646
|
-
|
|
677
|
+
//#endregion
|
|
678
|
+
//#region src/domains/interfaces/create-domain-options.interface.d.ts
|
|
647
679
|
interface CreateDomainOptions {
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
interface CreateDomainRequestOptions extends PostOptions {
|
|
680
|
+
name: string;
|
|
681
|
+
region?: DomainRegion;
|
|
682
|
+
customReturnPath?: string;
|
|
683
|
+
capabilities?: Partial<DomainCapabilities>;
|
|
653
684
|
}
|
|
685
|
+
interface CreateDomainRequestOptions extends PostOptions {}
|
|
654
686
|
interface CreateDomainResponseSuccess extends Pick<Domain, 'name' | 'id' | 'status' | 'created_at' | 'region'> {
|
|
655
|
-
|
|
687
|
+
records: DomainRecords[];
|
|
688
|
+
capabilities: DomainCapabilities;
|
|
656
689
|
}
|
|
657
690
|
type CreateDomainResponse = Response<CreateDomainResponseSuccess>;
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
691
|
+
//#endregion
|
|
692
|
+
//#region src/domains/interfaces/get-domain.interface.d.ts
|
|
693
|
+
interface GetDomainResponseSuccess extends Pick<Domain, 'id' | 'name' | 'created_at' | 'region' | 'status' | 'capabilities'> {
|
|
694
|
+
object: 'domain';
|
|
695
|
+
records: DomainRecords[];
|
|
662
696
|
}
|
|
663
697
|
type GetDomainResponse = Response<GetDomainResponseSuccess>;
|
|
664
|
-
|
|
698
|
+
//#endregion
|
|
699
|
+
//#region src/domains/interfaces/list-domains.interface.d.ts
|
|
665
700
|
type ListDomainsOptions = PaginationOptions;
|
|
666
701
|
type ListDomainsResponseSuccess = {
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
702
|
+
data: Domain[];
|
|
703
|
+
object: 'list';
|
|
704
|
+
has_more: boolean;
|
|
670
705
|
};
|
|
671
706
|
type ListDomainsResponse = Response<ListDomainsResponseSuccess>;
|
|
672
|
-
|
|
707
|
+
//#endregion
|
|
708
|
+
//#region src/domains/interfaces/remove-domain.interface.d.ts
|
|
673
709
|
type RemoveDomainsResponseSuccess = Pick<Domain, 'id'> & {
|
|
674
|
-
|
|
675
|
-
|
|
710
|
+
object: 'domain';
|
|
711
|
+
deleted: boolean;
|
|
676
712
|
};
|
|
677
713
|
type RemoveDomainsResponse = Response<RemoveDomainsResponseSuccess>;
|
|
678
|
-
|
|
714
|
+
//#endregion
|
|
715
|
+
//#region src/domains/interfaces/update-domain.interface.d.ts
|
|
679
716
|
interface UpdateDomainsOptions {
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
717
|
+
id: string;
|
|
718
|
+
clickTracking?: boolean;
|
|
719
|
+
openTracking?: boolean;
|
|
720
|
+
tls?: 'enforced' | 'opportunistic';
|
|
721
|
+
capabilities?: Partial<DomainCapabilities>;
|
|
684
722
|
}
|
|
685
723
|
type UpdateDomainsResponseSuccess = Pick<Domain, 'id'> & {
|
|
686
|
-
|
|
724
|
+
object: 'domain';
|
|
687
725
|
};
|
|
688
726
|
type UpdateDomainsResponse = Response<UpdateDomainsResponseSuccess>;
|
|
689
|
-
|
|
727
|
+
//#endregion
|
|
728
|
+
//#region src/domains/interfaces/verify-domain.interface.d.ts
|
|
690
729
|
type VerifyDomainsResponseSuccess = Pick<Domain, 'id'> & {
|
|
691
|
-
|
|
730
|
+
object: 'domain';
|
|
692
731
|
};
|
|
693
732
|
type VerifyDomainsResponse = Response<VerifyDomainsResponseSuccess>;
|
|
694
|
-
|
|
695
|
-
interface
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
733
|
+
//#endregion
|
|
734
|
+
//#region src/common/interfaces/attachment.interface.d.ts
|
|
735
|
+
interface Attachment$1 {
|
|
736
|
+
id: string;
|
|
737
|
+
filename?: string;
|
|
738
|
+
size: number;
|
|
739
|
+
content_type: string;
|
|
740
|
+
content_disposition: 'inline' | 'attachment';
|
|
741
|
+
content_id?: string;
|
|
742
|
+
download_url: string;
|
|
743
|
+
expires_at: string;
|
|
744
|
+
}
|
|
745
|
+
//#endregion
|
|
746
|
+
//#region src/emails/attachments/interfaces/get-attachment.interface.d.ts
|
|
706
747
|
interface GetAttachmentOptions {
|
|
707
|
-
|
|
708
|
-
|
|
748
|
+
emailId: string;
|
|
749
|
+
id: string;
|
|
709
750
|
}
|
|
710
751
|
type GetAttachmentResponseSuccess = {
|
|
711
|
-
|
|
712
|
-
} & Attachment;
|
|
752
|
+
object: 'attachment';
|
|
753
|
+
} & Attachment$1;
|
|
713
754
|
type GetAttachmentResponse = Response<GetAttachmentResponseSuccess>;
|
|
714
|
-
|
|
755
|
+
//#endregion
|
|
756
|
+
//#region src/emails/attachments/interfaces/list-attachments.interface.d.ts
|
|
715
757
|
type ListAttachmentsOptions = PaginationOptions & {
|
|
716
|
-
|
|
758
|
+
emailId: string;
|
|
717
759
|
};
|
|
718
760
|
interface ListAttachmentsApiResponse {
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
761
|
+
object: 'list';
|
|
762
|
+
has_more: boolean;
|
|
763
|
+
data: Attachment$1[];
|
|
722
764
|
}
|
|
723
765
|
interface ListAttachmentsResponseSuccess {
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
766
|
+
object: 'list';
|
|
767
|
+
has_more: boolean;
|
|
768
|
+
data: Attachment$1[];
|
|
727
769
|
}
|
|
728
770
|
type ListAttachmentsResponse = Response<ListAttachmentsResponseSuccess>;
|
|
729
|
-
|
|
771
|
+
//#endregion
|
|
772
|
+
//#region src/emails/interfaces/cancel-email-options.interface.d.ts
|
|
730
773
|
interface CancelEmailResponseSuccess {
|
|
731
|
-
|
|
732
|
-
|
|
774
|
+
object: 'email';
|
|
775
|
+
id: string;
|
|
733
776
|
}
|
|
734
777
|
type CancelEmailResponse = Response<CancelEmailResponseSuccess>;
|
|
735
|
-
|
|
778
|
+
//#endregion
|
|
779
|
+
//#region src/emails/interfaces/get-email-options.interface.d.ts
|
|
736
780
|
interface GetEmailResponseSuccess {
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
781
|
+
bcc: string[] | null;
|
|
782
|
+
cc: string[] | null;
|
|
783
|
+
created_at: string;
|
|
784
|
+
from: string;
|
|
785
|
+
html: string | null;
|
|
786
|
+
id: string;
|
|
787
|
+
last_event: 'bounced' | 'canceled' | 'clicked' | 'complained' | 'delivered' | 'delivery_delayed' | 'failed' | 'opened' | 'queued' | 'scheduled' | 'sent';
|
|
788
|
+
reply_to: string[] | null;
|
|
789
|
+
subject: string;
|
|
790
|
+
text: string | null;
|
|
791
|
+
tags?: {
|
|
792
|
+
name: string;
|
|
793
|
+
value: string;
|
|
794
|
+
}[];
|
|
795
|
+
to: string[];
|
|
796
|
+
topic_id?: string | null;
|
|
797
|
+
scheduled_at: string | null;
|
|
798
|
+
object: 'email';
|
|
755
799
|
}
|
|
756
800
|
type GetEmailResponse = Response<GetEmailResponseSuccess>;
|
|
757
|
-
|
|
801
|
+
//#endregion
|
|
802
|
+
//#region src/emails/interfaces/update-email-options.interface.d.ts
|
|
758
803
|
interface UpdateEmailOptions {
|
|
759
|
-
|
|
760
|
-
|
|
804
|
+
id: string;
|
|
805
|
+
scheduledAt: string;
|
|
761
806
|
}
|
|
762
807
|
interface UpdateEmailResponseSuccess {
|
|
763
|
-
|
|
764
|
-
|
|
808
|
+
id: string;
|
|
809
|
+
object: 'email';
|
|
765
810
|
}
|
|
766
811
|
type UpdateEmailResponse = Response<UpdateEmailResponseSuccess>;
|
|
767
|
-
|
|
812
|
+
//#endregion
|
|
813
|
+
//#region src/emails/receiving/interfaces/get-receiving-email.interface.d.ts
|
|
768
814
|
interface GetReceivingEmailResponseSuccess {
|
|
769
|
-
|
|
815
|
+
object: 'email';
|
|
816
|
+
id: string;
|
|
817
|
+
to: string[];
|
|
818
|
+
from: string;
|
|
819
|
+
created_at: string;
|
|
820
|
+
subject: string;
|
|
821
|
+
bcc: string[] | null;
|
|
822
|
+
cc: string[] | null;
|
|
823
|
+
reply_to: string[] | null;
|
|
824
|
+
html: string | null;
|
|
825
|
+
text: string | null;
|
|
826
|
+
headers: Record<string, string>;
|
|
827
|
+
message_id: string;
|
|
828
|
+
attachments: Array<{
|
|
770
829
|
id: string;
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
reply_to: string[] | null;
|
|
778
|
-
html: string | null;
|
|
779
|
-
text: string | null;
|
|
780
|
-
headers: Record<string, string>;
|
|
781
|
-
message_id: string;
|
|
782
|
-
attachments: Array<{
|
|
783
|
-
id: string;
|
|
784
|
-
filename: string;
|
|
785
|
-
size: number;
|
|
786
|
-
content_type: string;
|
|
787
|
-
content_id: string;
|
|
788
|
-
content_disposition: string;
|
|
789
|
-
}>;
|
|
830
|
+
filename: string;
|
|
831
|
+
size: number;
|
|
832
|
+
content_type: string;
|
|
833
|
+
content_id: string;
|
|
834
|
+
content_disposition: string;
|
|
835
|
+
}>;
|
|
790
836
|
}
|
|
791
837
|
type GetReceivingEmailResponse = Response<GetReceivingEmailResponseSuccess>;
|
|
792
|
-
|
|
838
|
+
//#endregion
|
|
839
|
+
//#region src/emails/receiving/interfaces/list-receiving-emails.interface.d.ts
|
|
793
840
|
type ListReceivingEmailsOptions = PaginationOptions;
|
|
794
841
|
type ListReceivingEmail = Omit<GetReceivingEmailResponseSuccess, 'html' | 'text' | 'headers' | 'object'>;
|
|
795
842
|
interface ListReceivingEmailsResponseSuccess {
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
843
|
+
object: 'list';
|
|
844
|
+
has_more: boolean;
|
|
845
|
+
data: ListReceivingEmail[];
|
|
799
846
|
}
|
|
800
847
|
type ListReceivingEmailsResponse = {
|
|
801
|
-
|
|
802
|
-
|
|
848
|
+
data: ListReceivingEmailsResponseSuccess;
|
|
849
|
+
error: null;
|
|
803
850
|
} | {
|
|
804
|
-
|
|
805
|
-
|
|
851
|
+
data: null;
|
|
852
|
+
error: ErrorResponse;
|
|
806
853
|
};
|
|
807
|
-
|
|
854
|
+
//#endregion
|
|
855
|
+
//#region src/api-keys/api-keys.d.ts
|
|
808
856
|
declare class ApiKeys {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
}
|
|
815
|
-
|
|
857
|
+
private readonly resend;
|
|
858
|
+
constructor(resend: Resend);
|
|
859
|
+
create(payload: CreateApiKeyOptions, options?: CreateApiKeyRequestOptions): Promise<CreateApiKeyResponse>;
|
|
860
|
+
list(options?: ListApiKeysOptions): Promise<ListApiKeysResponse>;
|
|
861
|
+
remove(id: string): Promise<RemoveApiKeyResponse>;
|
|
862
|
+
}
|
|
863
|
+
//#endregion
|
|
864
|
+
//#region src/batch/batch.d.ts
|
|
816
865
|
declare class Batch {
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
866
|
+
private readonly resend;
|
|
867
|
+
constructor(resend: Resend);
|
|
868
|
+
send<Options extends CreateBatchRequestOptions>(payload: CreateBatchOptions, options?: Options): Promise<CreateBatchResponse<Options>>;
|
|
869
|
+
create<Options extends CreateBatchRequestOptions>(payload: CreateBatchOptions, options?: Options): Promise<CreateBatchResponse<Options>>;
|
|
821
870
|
}
|
|
822
|
-
|
|
871
|
+
//#endregion
|
|
872
|
+
//#region src/broadcasts/broadcasts.d.ts
|
|
823
873
|
declare class Broadcasts {
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
}
|
|
833
|
-
|
|
874
|
+
private readonly resend;
|
|
875
|
+
constructor(resend: Resend);
|
|
876
|
+
create(payload: CreateBroadcastOptions, options?: CreateBroadcastRequestOptions): Promise<SendBroadcastResponse>;
|
|
877
|
+
send(id: string, payload?: SendBroadcastOptions): Promise<SendBroadcastResponse>;
|
|
878
|
+
list(options?: ListBroadcastsOptions): Promise<ListBroadcastsResponse>;
|
|
879
|
+
get(id: string): Promise<GetBroadcastResponse>;
|
|
880
|
+
remove(id: string): Promise<RemoveBroadcastResponse>;
|
|
881
|
+
update(id: string, payload: UpdateBroadcastOptions): Promise<UpdateBroadcastResponse>;
|
|
882
|
+
}
|
|
883
|
+
//#endregion
|
|
884
|
+
//#region src/contact-properties/interfaces/contact-property.d.ts
|
|
834
885
|
type StringBaseContactProperty = {
|
|
835
|
-
|
|
836
|
-
|
|
886
|
+
type: 'string';
|
|
887
|
+
fallbackValue: string | null;
|
|
837
888
|
};
|
|
838
889
|
type NumberBaseContactProperty = {
|
|
839
|
-
|
|
840
|
-
|
|
890
|
+
type: 'number';
|
|
891
|
+
fallbackValue: number | null;
|
|
841
892
|
};
|
|
842
893
|
type ContactProperty = {
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
894
|
+
id: string;
|
|
895
|
+
createdAt: string;
|
|
896
|
+
key: string;
|
|
846
897
|
} & (StringBaseContactProperty | NumberBaseContactProperty);
|
|
847
|
-
|
|
898
|
+
//#endregion
|
|
899
|
+
//#region src/contact-properties/interfaces/create-contact-property-options.interface.d.ts
|
|
848
900
|
type StringBaseContactPropertyOptions = {
|
|
849
|
-
|
|
850
|
-
|
|
901
|
+
type: 'string';
|
|
902
|
+
fallbackValue?: string | null;
|
|
851
903
|
};
|
|
852
904
|
type NumberBaseContactPropertyOptions = {
|
|
853
|
-
|
|
854
|
-
|
|
905
|
+
type: 'number';
|
|
906
|
+
fallbackValue?: number | null;
|
|
855
907
|
};
|
|
856
908
|
type CreateContactPropertyOptions = {
|
|
857
|
-
|
|
909
|
+
key: string;
|
|
858
910
|
} & (StringBaseContactPropertyOptions | NumberBaseContactPropertyOptions);
|
|
859
911
|
type CreateContactPropertyResponseSuccess = Pick<ContactProperty, 'id'> & {
|
|
860
|
-
|
|
912
|
+
object: 'contact_property';
|
|
861
913
|
};
|
|
862
914
|
type CreateContactPropertyResponse = Response<CreateContactPropertyResponseSuccess>;
|
|
863
|
-
|
|
915
|
+
//#endregion
|
|
916
|
+
//#region src/contact-properties/interfaces/delete-contact-property-options.interface.d.ts
|
|
864
917
|
type RemoveContactPropertyResponseSuccess = Pick<ContactProperty, 'id'> & {
|
|
865
|
-
|
|
866
|
-
|
|
918
|
+
object: 'contact_property';
|
|
919
|
+
deleted: boolean;
|
|
867
920
|
};
|
|
868
921
|
type RemoveContactPropertyResponse = Response<RemoveContactPropertyResponseSuccess>;
|
|
869
|
-
|
|
922
|
+
//#endregion
|
|
923
|
+
//#region src/contact-properties/interfaces/get-contact-property.interface.d.ts
|
|
870
924
|
type GetContactPropertyResponse = Response<ContactProperty & {
|
|
871
|
-
|
|
925
|
+
object: 'contact_property';
|
|
872
926
|
}>;
|
|
873
|
-
|
|
927
|
+
//#endregion
|
|
928
|
+
//#region src/contact-properties/interfaces/list-contact-properties-options.interface.d.ts
|
|
874
929
|
type ListContactPropertiesOptions = PaginationOptions;
|
|
875
930
|
type ListContactPropertiesResponse = Response<{
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
931
|
+
object: 'list';
|
|
932
|
+
has_more: boolean;
|
|
933
|
+
data: ContactProperty[];
|
|
879
934
|
}>;
|
|
880
|
-
|
|
935
|
+
//#endregion
|
|
936
|
+
//#region src/contact-properties/interfaces/update-contact-property-options.interface.d.ts
|
|
881
937
|
type UpdateContactPropertyOptions = {
|
|
882
|
-
|
|
883
|
-
|
|
938
|
+
id: string;
|
|
939
|
+
fallbackValue?: string | number | null;
|
|
884
940
|
};
|
|
885
941
|
type UpdateContactPropertyResponseSuccess = Pick<ContactProperty, 'id'> & {
|
|
886
|
-
|
|
942
|
+
object: 'contact_property';
|
|
887
943
|
};
|
|
888
944
|
type UpdateContactPropertyResponse = Response<UpdateContactPropertyResponseSuccess>;
|
|
889
|
-
|
|
945
|
+
//#endregion
|
|
946
|
+
//#region src/contact-properties/contact-properties.d.ts
|
|
890
947
|
declare class ContactProperties {
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
}
|
|
899
|
-
|
|
948
|
+
private readonly resend;
|
|
949
|
+
constructor(resend: Resend);
|
|
950
|
+
create(options: CreateContactPropertyOptions): Promise<CreateContactPropertyResponse>;
|
|
951
|
+
list(options?: ListContactPropertiesOptions): Promise<ListContactPropertiesResponse>;
|
|
952
|
+
get(id: string): Promise<GetContactPropertyResponse>;
|
|
953
|
+
update(payload: UpdateContactPropertyOptions): Promise<UpdateContactPropertyResponse>;
|
|
954
|
+
remove(id: string): Promise<RemoveContactPropertyResponse>;
|
|
955
|
+
}
|
|
956
|
+
//#endregion
|
|
957
|
+
//#region src/contacts/segments/interfaces/contact-segments.interface.d.ts
|
|
900
958
|
type ContactSegmentsBaseOptions = {
|
|
901
|
-
|
|
902
|
-
|
|
959
|
+
contactId: string;
|
|
960
|
+
email?: never;
|
|
903
961
|
} | {
|
|
904
|
-
|
|
905
|
-
|
|
962
|
+
contactId?: never;
|
|
963
|
+
email: string;
|
|
906
964
|
};
|
|
907
|
-
|
|
965
|
+
//#endregion
|
|
966
|
+
//#region src/contacts/segments/interfaces/add-contact-segment.interface.d.ts
|
|
908
967
|
type AddContactSegmentOptions = ContactSegmentsBaseOptions & {
|
|
909
|
-
|
|
968
|
+
segmentId: string;
|
|
910
969
|
};
|
|
911
970
|
interface AddContactSegmentResponseSuccess {
|
|
912
|
-
|
|
971
|
+
id: string;
|
|
913
972
|
}
|
|
914
973
|
type AddContactSegmentResponse = Response<AddContactSegmentResponseSuccess>;
|
|
915
|
-
|
|
974
|
+
//#endregion
|
|
975
|
+
//#region src/segments/interfaces/segment.d.ts
|
|
916
976
|
interface Segment {
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
977
|
+
created_at: string;
|
|
978
|
+
id: string;
|
|
979
|
+
name: string;
|
|
920
980
|
}
|
|
921
|
-
|
|
981
|
+
//#endregion
|
|
982
|
+
//#region src/contacts/segments/interfaces/list-contact-segments.interface.d.ts
|
|
922
983
|
type ListContactSegmentsOptions = PaginationOptions & ContactSegmentsBaseOptions;
|
|
923
984
|
type ListContactSegmentsResponseSuccess = PaginatedData<Segment[]>;
|
|
924
985
|
type ListContactSegmentsResponse = Response<ListContactSegmentsResponseSuccess>;
|
|
925
|
-
|
|
986
|
+
//#endregion
|
|
987
|
+
//#region src/contacts/segments/interfaces/remove-contact-segment.interface.d.ts
|
|
926
988
|
type RemoveContactSegmentOptions = ContactSegmentsBaseOptions & {
|
|
927
|
-
|
|
989
|
+
segmentId: string;
|
|
928
990
|
};
|
|
929
991
|
interface RemoveContactSegmentResponseSuccess {
|
|
930
|
-
|
|
931
|
-
|
|
992
|
+
id: string;
|
|
993
|
+
deleted: boolean;
|
|
932
994
|
}
|
|
933
995
|
type RemoveContactSegmentResponse = Response<RemoveContactSegmentResponseSuccess>;
|
|
934
|
-
|
|
996
|
+
//#endregion
|
|
997
|
+
//#region src/contacts/segments/contact-segments.d.ts
|
|
935
998
|
declare class ContactSegments {
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
}
|
|
942
|
-
|
|
999
|
+
private readonly resend;
|
|
1000
|
+
constructor(resend: Resend);
|
|
1001
|
+
list(options: ListContactSegmentsOptions): Promise<ListContactSegmentsResponse>;
|
|
1002
|
+
add(options: AddContactSegmentOptions): Promise<AddContactSegmentResponse>;
|
|
1003
|
+
remove(options: RemoveContactSegmentOptions): Promise<RemoveContactSegmentResponse>;
|
|
1004
|
+
}
|
|
1005
|
+
//#endregion
|
|
1006
|
+
//#region src/contacts/topics/interfaces/list-contact-topics.interface.d.ts
|
|
943
1007
|
interface ListContactTopicsBaseOptions {
|
|
944
|
-
|
|
945
|
-
|
|
1008
|
+
id?: string;
|
|
1009
|
+
email?: string;
|
|
946
1010
|
}
|
|
947
1011
|
type ListContactTopicsOptions = ListContactTopicsBaseOptions & PaginationOptions;
|
|
948
1012
|
interface ContactTopic {
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1013
|
+
id: string;
|
|
1014
|
+
name: string;
|
|
1015
|
+
description: string | null;
|
|
1016
|
+
subscription: 'opt_in' | 'opt_out';
|
|
953
1017
|
}
|
|
954
1018
|
type ListContactTopicsResponseSuccess = PaginatedData<ContactTopic[]>;
|
|
955
1019
|
type ListContactTopicsResponse = Response<ListContactTopicsResponseSuccess>;
|
|
956
|
-
|
|
1020
|
+
//#endregion
|
|
1021
|
+
//#region src/contacts/topics/interfaces/update-contact-topics.interface.d.ts
|
|
957
1022
|
interface UpdateContactTopicsBaseOptions {
|
|
958
|
-
|
|
959
|
-
|
|
1023
|
+
id?: string;
|
|
1024
|
+
email?: string;
|
|
960
1025
|
}
|
|
961
1026
|
interface UpdateContactTopicsOptions extends UpdateContactTopicsBaseOptions {
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
1027
|
+
topics: {
|
|
1028
|
+
id: string;
|
|
1029
|
+
subscription: 'opt_in' | 'opt_out';
|
|
1030
|
+
}[];
|
|
966
1031
|
}
|
|
967
1032
|
interface UpdateContactTopicsResponseSuccess {
|
|
968
|
-
|
|
1033
|
+
id: string;
|
|
969
1034
|
}
|
|
970
1035
|
type UpdateContactTopicsResponse = Response<UpdateContactTopicsResponseSuccess>;
|
|
971
|
-
|
|
1036
|
+
//#endregion
|
|
1037
|
+
//#region src/contacts/topics/contact-topics.d.ts
|
|
972
1038
|
declare class ContactTopics {
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
1039
|
+
private readonly resend;
|
|
1040
|
+
constructor(resend: Resend);
|
|
1041
|
+
update(payload: UpdateContactTopicsOptions): Promise<UpdateContactTopicsResponse>;
|
|
1042
|
+
list(options: ListContactTopicsOptions): Promise<ListContactTopicsResponse>;
|
|
977
1043
|
}
|
|
978
|
-
|
|
1044
|
+
//#endregion
|
|
1045
|
+
//#region src/contacts/contacts.d.ts
|
|
979
1046
|
declare class Contacts {
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
}
|
|
990
|
-
|
|
1047
|
+
private readonly resend;
|
|
1048
|
+
readonly topics: ContactTopics;
|
|
1049
|
+
readonly segments: ContactSegments;
|
|
1050
|
+
constructor(resend: Resend);
|
|
1051
|
+
create(payload: CreateContactOptions, options?: CreateContactRequestOptions): Promise<CreateContactResponse>;
|
|
1052
|
+
list(options?: ListContactsOptions): Promise<ListContactsResponse>;
|
|
1053
|
+
get(options: GetContactOptions): Promise<GetContactResponse>;
|
|
1054
|
+
update(options: UpdateContactOptions): Promise<UpdateContactResponse>;
|
|
1055
|
+
remove(payload: RemoveContactOptions): Promise<RemoveContactsResponse>;
|
|
1056
|
+
}
|
|
1057
|
+
//#endregion
|
|
1058
|
+
//#region src/domains/domains.d.ts
|
|
991
1059
|
declare class Domains {
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1060
|
+
private readonly resend;
|
|
1061
|
+
constructor(resend: Resend);
|
|
1062
|
+
create(payload: CreateDomainOptions, options?: CreateDomainRequestOptions): Promise<CreateDomainResponse>;
|
|
1063
|
+
list(options?: ListDomainsOptions): Promise<ListDomainsResponse>;
|
|
1064
|
+
get(id: string): Promise<GetDomainResponse>;
|
|
1065
|
+
update(payload: UpdateDomainsOptions): Promise<UpdateDomainsResponse>;
|
|
1066
|
+
remove(id: string): Promise<RemoveDomainsResponse>;
|
|
1067
|
+
verify(id: string): Promise<VerifyDomainsResponse>;
|
|
1068
|
+
}
|
|
1069
|
+
//#endregion
|
|
1070
|
+
//#region src/emails/attachments/attachments.d.ts
|
|
1071
|
+
declare class Attachments {
|
|
1072
|
+
private readonly resend;
|
|
1073
|
+
constructor(resend: Resend);
|
|
1074
|
+
get(options: GetAttachmentOptions): Promise<GetAttachmentResponse>;
|
|
1075
|
+
list(options: ListAttachmentsOptions): Promise<ListAttachmentsResponse>;
|
|
1007
1076
|
}
|
|
1008
|
-
|
|
1077
|
+
//#endregion
|
|
1078
|
+
//#region src/emails/interfaces/list-emails-options.interface.d.ts
|
|
1009
1079
|
type ListEmailsOptions = PaginationOptions;
|
|
1010
1080
|
type ListEmail = Omit<GetEmailResponseSuccess, 'html' | 'text' | 'tags' | 'object'>;
|
|
1011
1081
|
type ListEmailsResponseSuccess = {
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1082
|
+
object: 'list';
|
|
1083
|
+
has_more: boolean;
|
|
1084
|
+
data: ListEmail[];
|
|
1015
1085
|
};
|
|
1016
1086
|
type ListEmailsResponse = Response<ListEmailsResponseSuccess>;
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1087
|
+
//#endregion
|
|
1088
|
+
//#region src/emails/receiving/attachments/attachments.d.ts
|
|
1089
|
+
declare class Attachments$1 {
|
|
1090
|
+
private readonly resend;
|
|
1091
|
+
constructor(resend: Resend);
|
|
1092
|
+
get(options: GetAttachmentOptions): Promise<GetAttachmentResponse>;
|
|
1093
|
+
list(options: ListAttachmentsOptions): Promise<ListAttachmentsResponse>;
|
|
1023
1094
|
}
|
|
1024
|
-
|
|
1095
|
+
//#endregion
|
|
1096
|
+
//#region src/emails/receiving/receiving.d.ts
|
|
1025
1097
|
declare class Receiving {
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1098
|
+
private readonly resend;
|
|
1099
|
+
readonly attachments: Attachments$1;
|
|
1100
|
+
constructor(resend: Resend);
|
|
1101
|
+
get(id: string): Promise<GetReceivingEmailResponse>;
|
|
1102
|
+
list(options?: ListReceivingEmailsOptions): Promise<ListReceivingEmailsResponse>;
|
|
1103
|
+
}
|
|
1104
|
+
//#endregion
|
|
1105
|
+
//#region src/emails/emails.d.ts
|
|
1033
1106
|
declare class Emails {
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1107
|
+
private readonly resend;
|
|
1108
|
+
readonly attachments: Attachments;
|
|
1109
|
+
readonly receiving: Receiving;
|
|
1110
|
+
constructor(resend: Resend);
|
|
1111
|
+
send(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
|
|
1112
|
+
create(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
|
|
1113
|
+
get(id: string): Promise<GetEmailResponse>;
|
|
1114
|
+
list(options?: ListEmailsOptions): Promise<ListEmailsResponse>;
|
|
1115
|
+
update(payload: UpdateEmailOptions): Promise<UpdateEmailResponse>;
|
|
1116
|
+
cancel(id: string): Promise<CancelEmailResponse>;
|
|
1117
|
+
}
|
|
1118
|
+
//#endregion
|
|
1119
|
+
//#region src/segments/interfaces/create-segment-options.interface.d.ts
|
|
1046
1120
|
interface CreateSegmentOptions {
|
|
1047
|
-
|
|
1048
|
-
}
|
|
1049
|
-
interface CreateSegmentRequestOptions extends PostOptions {
|
|
1121
|
+
name: string;
|
|
1050
1122
|
}
|
|
1123
|
+
interface CreateSegmentRequestOptions extends PostOptions {}
|
|
1051
1124
|
interface CreateSegmentResponseSuccess extends Pick<Segment, 'name' | 'id'> {
|
|
1052
|
-
|
|
1125
|
+
object: 'segment';
|
|
1053
1126
|
}
|
|
1054
1127
|
type CreateSegmentResponse = Response<CreateSegmentResponseSuccess>;
|
|
1055
|
-
|
|
1128
|
+
//#endregion
|
|
1129
|
+
//#region src/segments/interfaces/get-segment.interface.d.ts
|
|
1056
1130
|
interface GetSegmentResponseSuccess extends Pick<Segment, 'id' | 'name' | 'created_at'> {
|
|
1057
|
-
|
|
1131
|
+
object: 'segment';
|
|
1058
1132
|
}
|
|
1059
1133
|
type GetSegmentResponse = Response<GetSegmentResponseSuccess>;
|
|
1060
|
-
|
|
1134
|
+
//#endregion
|
|
1135
|
+
//#region src/segments/interfaces/list-segments.interface.d.ts
|
|
1061
1136
|
type ListSegmentsOptions = PaginationOptions;
|
|
1062
1137
|
type ListSegmentsResponseSuccess = {
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1138
|
+
object: 'list';
|
|
1139
|
+
data: Segment[];
|
|
1140
|
+
has_more: boolean;
|
|
1066
1141
|
};
|
|
1067
1142
|
type ListSegmentsResponse = Response<ListSegmentsResponseSuccess>;
|
|
1068
|
-
|
|
1143
|
+
//#endregion
|
|
1144
|
+
//#region src/segments/interfaces/remove-segment.interface.d.ts
|
|
1069
1145
|
interface RemoveSegmentResponseSuccess extends Pick<Segment, 'id'> {
|
|
1070
|
-
|
|
1071
|
-
|
|
1146
|
+
object: 'segment';
|
|
1147
|
+
deleted: boolean;
|
|
1072
1148
|
}
|
|
1073
1149
|
type RemoveSegmentResponse = Response<RemoveSegmentResponseSuccess>;
|
|
1074
|
-
|
|
1150
|
+
//#endregion
|
|
1151
|
+
//#region src/segments/segments.d.ts
|
|
1075
1152
|
declare class Segments {
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1153
|
+
private readonly resend;
|
|
1154
|
+
constructor(resend: Resend);
|
|
1155
|
+
create(payload: CreateSegmentOptions, options?: CreateSegmentRequestOptions): Promise<CreateSegmentResponse>;
|
|
1156
|
+
list(options?: ListSegmentsOptions): Promise<ListSegmentsResponse>;
|
|
1157
|
+
get(id: string): Promise<GetSegmentResponse>;
|
|
1158
|
+
remove(id: string): Promise<RemoveSegmentResponse>;
|
|
1159
|
+
}
|
|
1160
|
+
//#endregion
|
|
1161
|
+
//#region src/templates/interfaces/template.d.ts
|
|
1084
1162
|
interface Template {
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1163
|
+
id: string;
|
|
1164
|
+
name: string;
|
|
1165
|
+
subject: string | null;
|
|
1166
|
+
html: string;
|
|
1167
|
+
text: string | null;
|
|
1168
|
+
status: 'draft' | 'published';
|
|
1169
|
+
variables: TemplateVariable[] | null;
|
|
1170
|
+
alias: string | null;
|
|
1171
|
+
from: string | null;
|
|
1172
|
+
reply_to: string[] | null;
|
|
1173
|
+
published_at: string | null;
|
|
1174
|
+
created_at: string;
|
|
1175
|
+
updated_at: string;
|
|
1176
|
+
has_unpublished_versions: boolean;
|
|
1177
|
+
current_version_id: string;
|
|
1100
1178
|
}
|
|
1101
1179
|
interface TemplateVariable {
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1180
|
+
key: string;
|
|
1181
|
+
fallback_value: string | number | null;
|
|
1182
|
+
type: 'string' | 'number';
|
|
1183
|
+
created_at: string;
|
|
1184
|
+
updated_at: string;
|
|
1185
|
+
}
|
|
1186
|
+
//#endregion
|
|
1187
|
+
//#region src/templates/interfaces/create-template-options.interface.d.ts
|
|
1109
1188
|
type TemplateContentCreationOptions = RequireAtLeastOne<{
|
|
1110
|
-
|
|
1111
|
-
|
|
1189
|
+
html: string;
|
|
1190
|
+
react: React.ReactNode;
|
|
1112
1191
|
}>;
|
|
1113
1192
|
type TemplateVariableCreationOptions = Pick<TemplateVariable, 'key' | 'type'> & ({
|
|
1114
|
-
|
|
1115
|
-
|
|
1193
|
+
type: 'string';
|
|
1194
|
+
fallbackValue?: string | null;
|
|
1116
1195
|
} | {
|
|
1117
|
-
|
|
1118
|
-
|
|
1196
|
+
type: 'number';
|
|
1197
|
+
fallbackValue?: number | null;
|
|
1119
1198
|
});
|
|
1120
1199
|
type TemplateOptionalFieldsForCreation = Partial<Pick<Template, 'subject' | 'text' | 'alias' | 'from'>> & {
|
|
1121
|
-
|
|
1122
|
-
|
|
1200
|
+
replyTo?: string[] | string;
|
|
1201
|
+
variables?: TemplateVariableCreationOptions[];
|
|
1123
1202
|
};
|
|
1124
1203
|
type CreateTemplateOptions = Pick<Template, 'name'> & TemplateOptionalFieldsForCreation & TemplateContentCreationOptions;
|
|
1125
1204
|
interface CreateTemplateResponseSuccess extends Pick<Template, 'id'> {
|
|
1126
|
-
|
|
1205
|
+
object: 'template';
|
|
1127
1206
|
}
|
|
1128
1207
|
type CreateTemplateResponse = Response<CreateTemplateResponseSuccess>;
|
|
1129
|
-
|
|
1208
|
+
//#endregion
|
|
1209
|
+
//#region src/templates/interfaces/duplicate-template.interface.d.ts
|
|
1130
1210
|
interface DuplicateTemplateResponseSuccess extends Pick<Template, 'id'> {
|
|
1131
|
-
|
|
1211
|
+
object: 'template';
|
|
1132
1212
|
}
|
|
1133
1213
|
type DuplicateTemplateResponse = Response<DuplicateTemplateResponseSuccess>;
|
|
1134
|
-
|
|
1214
|
+
//#endregion
|
|
1215
|
+
//#region src/templates/interfaces/publish-template.interface.d.ts
|
|
1135
1216
|
interface PublishTemplateResponseSuccess extends Pick<Template, 'id'> {
|
|
1136
|
-
|
|
1217
|
+
object: 'template';
|
|
1137
1218
|
}
|
|
1138
1219
|
type PublishTemplateResponse = Response<PublishTemplateResponseSuccess>;
|
|
1139
|
-
|
|
1220
|
+
//#endregion
|
|
1221
|
+
//#region src/templates/chainable-template-result.d.ts
|
|
1140
1222
|
declare class ChainableTemplateResult<T extends CreateTemplateResponse | DuplicateTemplateResponse> implements PromiseLike<T> {
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
}
|
|
1147
|
-
|
|
1223
|
+
private readonly promise;
|
|
1224
|
+
private readonly publishFn;
|
|
1225
|
+
constructor(promise: Promise<T>, publishFn: (id: string) => Promise<PublishTemplateResponse>);
|
|
1226
|
+
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
|
|
1227
|
+
publish(): Promise<PublishTemplateResponse>;
|
|
1228
|
+
}
|
|
1229
|
+
//#endregion
|
|
1230
|
+
//#region src/templates/interfaces/get-template.interface.d.ts
|
|
1148
1231
|
interface GetTemplateResponseSuccess extends Template {
|
|
1149
|
-
|
|
1232
|
+
object: 'template';
|
|
1150
1233
|
}
|
|
1151
1234
|
type GetTemplateResponse = Response<GetTemplateResponseSuccess>;
|
|
1152
|
-
|
|
1153
|
-
interface
|
|
1154
|
-
}
|
|
1235
|
+
//#endregion
|
|
1236
|
+
//#region src/templates/interfaces/list-templates.interface.d.ts
|
|
1237
|
+
interface TemplateListItem extends Pick<Template, 'id' | 'name' | 'created_at' | 'updated_at' | 'status' | 'published_at' | 'alias'> {}
|
|
1155
1238
|
interface ListTemplatesResponseSuccess {
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1239
|
+
object: 'list';
|
|
1240
|
+
data: TemplateListItem[];
|
|
1241
|
+
has_more: boolean;
|
|
1159
1242
|
}
|
|
1160
1243
|
type ListTemplatesResponse = Response<ListTemplatesResponseSuccess>;
|
|
1161
|
-
|
|
1244
|
+
//#endregion
|
|
1245
|
+
//#region src/templates/interfaces/remove-template.interface.d.ts
|
|
1162
1246
|
interface RemoveTemplateResponseSuccess {
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1247
|
+
object: 'template';
|
|
1248
|
+
id: string;
|
|
1249
|
+
deleted: boolean;
|
|
1166
1250
|
}
|
|
1167
1251
|
type RemoveTemplateResponse = Response<RemoveTemplateResponseSuccess>;
|
|
1168
|
-
|
|
1252
|
+
//#endregion
|
|
1253
|
+
//#region src/templates/interfaces/update-template.interface.d.ts
|
|
1169
1254
|
type TemplateVariableUpdateOptions = Pick<TemplateVariable, 'key' | 'type'> & ({
|
|
1170
|
-
|
|
1171
|
-
|
|
1255
|
+
type: 'string';
|
|
1256
|
+
fallbackValue?: string | null;
|
|
1172
1257
|
} | {
|
|
1173
|
-
|
|
1174
|
-
|
|
1258
|
+
type: 'number';
|
|
1259
|
+
fallbackValue?: number | null;
|
|
1175
1260
|
});
|
|
1176
1261
|
interface UpdateTemplateOptions extends Partial<Pick<Template, 'name' | 'subject' | 'html' | 'text' | 'from' | 'alias'>> {
|
|
1177
|
-
|
|
1178
|
-
|
|
1262
|
+
variables?: TemplateVariableUpdateOptions[];
|
|
1263
|
+
replyTo?: string[] | string;
|
|
1179
1264
|
}
|
|
1180
1265
|
interface UpdateTemplateResponseSuccess extends Pick<Template, 'id'> {
|
|
1181
|
-
|
|
1266
|
+
object: 'template';
|
|
1182
1267
|
}
|
|
1183
1268
|
type UpdateTemplateResponse = Response<UpdateTemplateResponseSuccess>;
|
|
1184
|
-
|
|
1269
|
+
//#endregion
|
|
1270
|
+
//#region src/templates/templates.d.ts
|
|
1185
1271
|
declare class Templates {
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1272
|
+
private readonly resend;
|
|
1273
|
+
private renderAsync?;
|
|
1274
|
+
constructor(resend: Resend);
|
|
1275
|
+
create(payload: CreateTemplateOptions): ChainableTemplateResult<CreateTemplateResponse>;
|
|
1276
|
+
private performCreate;
|
|
1277
|
+
remove(identifier: string): Promise<RemoveTemplateResponse>;
|
|
1278
|
+
get(identifier: string): Promise<GetTemplateResponse>;
|
|
1279
|
+
list(options?: PaginationOptions): Promise<ListTemplatesResponse>;
|
|
1280
|
+
duplicate(identifier: string): ChainableTemplateResult<DuplicateTemplateResponse>;
|
|
1281
|
+
publish(identifier: string): Promise<PublishTemplateResponse>;
|
|
1282
|
+
update(identifier: string, payload: UpdateTemplateOptions): Promise<UpdateTemplateResponse>;
|
|
1283
|
+
}
|
|
1284
|
+
//#endregion
|
|
1285
|
+
//#region src/topics/interfaces/topic.d.ts
|
|
1199
1286
|
interface Topic {
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1287
|
+
id: string;
|
|
1288
|
+
name: string;
|
|
1289
|
+
description?: string;
|
|
1290
|
+
defaultSubscription: 'opt_in' | 'opt_out';
|
|
1291
|
+
created_at: string;
|
|
1292
|
+
}
|
|
1293
|
+
//#endregion
|
|
1294
|
+
//#region src/topics/interfaces/create-topic-options.interface.d.ts
|
|
1207
1295
|
interface CreateTopicOptions {
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1296
|
+
name: string;
|
|
1297
|
+
description?: string;
|
|
1298
|
+
defaultSubscription: 'opt_in' | 'opt_out';
|
|
1211
1299
|
}
|
|
1212
1300
|
type CreateTopicResponseSuccess = Pick<Topic, 'id'>;
|
|
1213
1301
|
type CreateTopicResponse = Response<CreateTopicResponseSuccess>;
|
|
1214
|
-
|
|
1302
|
+
//#endregion
|
|
1303
|
+
//#region src/topics/interfaces/get-contact.interface.d.ts
|
|
1215
1304
|
type GetTopicResponseSuccess = Topic;
|
|
1216
1305
|
type GetTopicResponse = Response<GetTopicResponseSuccess>;
|
|
1217
|
-
|
|
1306
|
+
//#endregion
|
|
1307
|
+
//#region src/topics/interfaces/list-topics.interface.d.ts
|
|
1218
1308
|
interface ListTopicsResponseSuccess {
|
|
1219
|
-
|
|
1309
|
+
data: Topic[];
|
|
1220
1310
|
}
|
|
1221
1311
|
type ListTopicsResponse = Response<ListTopicsResponseSuccess>;
|
|
1222
|
-
|
|
1312
|
+
//#endregion
|
|
1313
|
+
//#region src/topics/interfaces/remove-topic.interface.d.ts
|
|
1223
1314
|
type RemoveTopicResponseSuccess = Pick<Topic, 'id'> & {
|
|
1224
|
-
|
|
1225
|
-
|
|
1315
|
+
object: 'topic';
|
|
1316
|
+
deleted: boolean;
|
|
1226
1317
|
};
|
|
1227
1318
|
type RemoveTopicResponse = Response<RemoveTopicResponseSuccess>;
|
|
1228
|
-
|
|
1319
|
+
//#endregion
|
|
1320
|
+
//#region src/topics/interfaces/update-topic.interface.d.ts
|
|
1229
1321
|
interface UpdateTopicOptions {
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1322
|
+
id: string;
|
|
1323
|
+
name?: string;
|
|
1324
|
+
description?: string;
|
|
1233
1325
|
}
|
|
1234
1326
|
type UpdateTopicResponseSuccess = Pick<Topic, 'id'>;
|
|
1235
1327
|
type UpdateTopicResponse = Response<UpdateTopicResponseSuccess>;
|
|
1236
|
-
|
|
1328
|
+
//#endregion
|
|
1329
|
+
//#region src/topics/topics.d.ts
|
|
1237
1330
|
declare class Topics {
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1331
|
+
private readonly resend;
|
|
1332
|
+
constructor(resend: Resend);
|
|
1333
|
+
create(payload: CreateTopicOptions): Promise<CreateTopicResponse>;
|
|
1334
|
+
list(): Promise<ListTopicsResponse>;
|
|
1335
|
+
get(id: string): Promise<GetTopicResponse>;
|
|
1336
|
+
update(payload: UpdateTopicOptions): Promise<UpdateTopicResponse>;
|
|
1337
|
+
remove(id: string): Promise<RemoveTopicResponse>;
|
|
1338
|
+
}
|
|
1339
|
+
//#endregion
|
|
1340
|
+
//#region src/webhooks/interfaces/webhook-event.interface.d.ts
|
|
1247
1341
|
type WebhookEvent = 'email.sent' | 'email.delivered' | 'email.delivery_delayed' | 'email.complained' | 'email.bounced' | 'email.opened' | 'email.clicked' | 'email.received' | 'email.failed' | 'contact.created' | 'contact.updated' | 'contact.deleted' | 'domain.created' | 'domain.updated' | 'domain.deleted';
|
|
1248
|
-
|
|
1342
|
+
//#endregion
|
|
1343
|
+
//#region src/webhooks/interfaces/create-webhook-options.interface.d.ts
|
|
1249
1344
|
interface CreateWebhookOptions {
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
}
|
|
1253
|
-
interface CreateWebhookRequestOptions extends PostOptions {
|
|
1345
|
+
endpoint: string;
|
|
1346
|
+
events: WebhookEvent[];
|
|
1254
1347
|
}
|
|
1348
|
+
interface CreateWebhookRequestOptions extends PostOptions {}
|
|
1255
1349
|
interface CreateWebhookResponseSuccess {
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1350
|
+
object: 'webhook';
|
|
1351
|
+
id: string;
|
|
1352
|
+
signing_secret: string;
|
|
1259
1353
|
}
|
|
1260
1354
|
type CreateWebhookResponse = Response<CreateWebhookResponseSuccess>;
|
|
1261
|
-
|
|
1355
|
+
//#endregion
|
|
1356
|
+
//#region src/webhooks/interfaces/get-webhook.interface.d.ts
|
|
1262
1357
|
interface GetWebhookResponseSuccess {
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1358
|
+
object: 'webhook';
|
|
1359
|
+
id: string;
|
|
1360
|
+
created_at: string;
|
|
1361
|
+
status: 'enabled' | 'disabled';
|
|
1362
|
+
endpoint: string;
|
|
1363
|
+
events: WebhookEvent[] | null;
|
|
1364
|
+
signing_secret: string;
|
|
1270
1365
|
}
|
|
1271
1366
|
type GetWebhookResponse = Response<GetWebhookResponseSuccess>;
|
|
1272
|
-
|
|
1367
|
+
//#endregion
|
|
1368
|
+
//#region src/webhooks/interfaces/list-webhooks.interface.d.ts
|
|
1273
1369
|
type ListWebhooksOptions = PaginationOptions;
|
|
1274
1370
|
interface Webhook {
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1371
|
+
id: string;
|
|
1372
|
+
endpoint: string;
|
|
1373
|
+
created_at: string;
|
|
1374
|
+
status: 'enabled' | 'disabled';
|
|
1375
|
+
events: WebhookEvent[] | null;
|
|
1280
1376
|
}
|
|
1281
1377
|
type ListWebhooksResponseSuccess = {
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1378
|
+
object: 'list';
|
|
1379
|
+
has_more: boolean;
|
|
1380
|
+
data: Webhook[];
|
|
1285
1381
|
};
|
|
1286
1382
|
type ListWebhooksResponse = Response<ListWebhooksResponseSuccess>;
|
|
1287
|
-
|
|
1383
|
+
//#endregion
|
|
1384
|
+
//#region src/webhooks/interfaces/remove-webhook.interface.d.ts
|
|
1288
1385
|
type RemoveWebhookResponseSuccess = Pick<Webhook, 'id'> & {
|
|
1289
|
-
|
|
1290
|
-
|
|
1386
|
+
object: 'webhook';
|
|
1387
|
+
deleted: boolean;
|
|
1291
1388
|
};
|
|
1292
1389
|
type RemoveWebhookResponse = Response<RemoveWebhookResponseSuccess>;
|
|
1293
|
-
|
|
1390
|
+
//#endregion
|
|
1391
|
+
//#region src/webhooks/interfaces/update-webhook.interface.d.ts
|
|
1294
1392
|
interface UpdateWebhookOptions {
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1393
|
+
endpoint?: string;
|
|
1394
|
+
events?: WebhookEvent[];
|
|
1395
|
+
status?: 'enabled' | 'disabled';
|
|
1298
1396
|
}
|
|
1299
1397
|
interface UpdateWebhookResponseSuccess {
|
|
1300
|
-
|
|
1301
|
-
|
|
1398
|
+
object: 'webhook';
|
|
1399
|
+
id: string;
|
|
1302
1400
|
}
|
|
1303
1401
|
type UpdateWebhookResponse = Response<UpdateWebhookResponseSuccess>;
|
|
1304
|
-
|
|
1402
|
+
//#endregion
|
|
1403
|
+
//#region src/webhooks/webhooks.d.ts
|
|
1305
1404
|
interface Headers {
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1405
|
+
id: string;
|
|
1406
|
+
timestamp: string;
|
|
1407
|
+
signature: string;
|
|
1309
1408
|
}
|
|
1310
1409
|
interface VerifyWebhookOptions {
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1410
|
+
payload: string;
|
|
1411
|
+
headers: Headers;
|
|
1412
|
+
webhookSecret: string;
|
|
1314
1413
|
}
|
|
1315
1414
|
declare class Webhooks {
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
}
|
|
1325
|
-
|
|
1415
|
+
private readonly resend;
|
|
1416
|
+
constructor(resend: Resend);
|
|
1417
|
+
create(payload: CreateWebhookOptions, options?: CreateWebhookRequestOptions): Promise<CreateWebhookResponse>;
|
|
1418
|
+
get(id: string): Promise<GetWebhookResponse>;
|
|
1419
|
+
list(options?: ListWebhooksOptions): Promise<ListWebhooksResponse>;
|
|
1420
|
+
update(id: string, payload: UpdateWebhookOptions): Promise<UpdateWebhookResponse>;
|
|
1421
|
+
remove(id: string): Promise<RemoveWebhookResponse>;
|
|
1422
|
+
verify(payload: VerifyWebhookOptions): unknown;
|
|
1423
|
+
}
|
|
1424
|
+
//#endregion
|
|
1425
|
+
//#region src/resend.d.ts
|
|
1326
1426
|
declare class Resend {
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
export {
|
|
1427
|
+
readonly key?: string | undefined;
|
|
1428
|
+
private readonly headers;
|
|
1429
|
+
readonly apiKeys: ApiKeys;
|
|
1430
|
+
readonly segments: Segments;
|
|
1431
|
+
/**
|
|
1432
|
+
* @deprecated Use segments instead
|
|
1433
|
+
*/
|
|
1434
|
+
readonly audiences: Segments;
|
|
1435
|
+
readonly batch: Batch;
|
|
1436
|
+
readonly broadcasts: Broadcasts;
|
|
1437
|
+
readonly contacts: Contacts;
|
|
1438
|
+
readonly contactProperties: ContactProperties;
|
|
1439
|
+
readonly domains: Domains;
|
|
1440
|
+
readonly emails: Emails;
|
|
1441
|
+
readonly webhooks: Webhooks;
|
|
1442
|
+
readonly templates: Templates;
|
|
1443
|
+
readonly topics: Topics;
|
|
1444
|
+
constructor(key?: string | undefined);
|
|
1445
|
+
fetchRequest<T>(path: string, options?: {}): Promise<Response<T>>;
|
|
1446
|
+
post<T>(path: string, entity?: unknown, options?: PostOptions & IdempotentRequest): Promise<Response<T>>;
|
|
1447
|
+
get<T>(path: string, options?: GetOptions): Promise<Response<T>>;
|
|
1448
|
+
put<T>(path: string, entity: unknown, options?: PutOptions): Promise<Response<T>>;
|
|
1449
|
+
patch<T>(path: string, entity: unknown, options?: PatchOptions): Promise<Response<T>>;
|
|
1450
|
+
delete<T>(path: string, query?: unknown): Promise<Response<T>>;
|
|
1451
|
+
}
|
|
1452
|
+
//#endregion
|
|
1453
|
+
export { ApiKey, Attachment, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, Contact, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, Domain, DomainApiOptions, DomainCapabilities, DomainCapabilityStatus, DomainDkimRecord, DomainNameservers, DomainRecords, DomainRegion, DomainSpfRecord, DomainStatus, EmailApiAttachment, EmailApiOptions, type ErrorResponse, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetBroadcastResponse, GetBroadcastResponseSuccess, GetContactOptions, GetContactResponse, GetContactResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, GetOptions, GetReceivingEmailResponse, GetReceivingEmailResponseSuccess, GetSegmentResponse, GetSegmentResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, IdempotentRequest, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsApiResponse, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, ListReceivingEmail, ListReceivingEmailsOptions, ListReceivingEmailsResponse, ListReceivingEmailsResponseSuccess, ListSegmentsOptions, ListSegmentsResponse, ListSegmentsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, PaginatedData, PaginationOptions, PatchOptions, PostOptions, PutOptions, ReceivingRecord, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveBroadcastResponse, RemoveBroadcastResponseSuccess, RemoveContactOptions, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, RemoveSegmentResponse, RemoveSegmentResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, RequireAtLeastOne, Resend, type Response, Segment, SelectingField, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, Tag, UpdateBroadcastOptions, UpdateBroadcastResponse, UpdateBroadcastResponseSuccess, UpdateContactOptions, UpdateContactResponse, UpdateContactResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, UpdateEmailOptions, UpdateEmailResponse, UpdateEmailResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, Webhook, WebhookEvent };
|