resend 2.1.0 → 3.0.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.d.mts +83 -45
- package/dist/index.d.ts +83 -45
- package/dist/index.js +23 -22
- package/dist/index.mjs +23 -22
- package/package.json +12 -12
package/dist/index.d.mts
CHANGED
|
@@ -53,18 +53,19 @@ interface CreateApiKeyResponse {
|
|
|
53
53
|
error: ErrorResponse | null;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
interface
|
|
57
|
-
name: string;
|
|
58
|
-
id: string;
|
|
56
|
+
interface ApiKey {
|
|
59
57
|
created_at: string;
|
|
58
|
+
id: string;
|
|
59
|
+
name: string;
|
|
60
60
|
}
|
|
61
|
+
|
|
62
|
+
type ListApiKeysResponseSuccess = Pick<ApiKey, 'name' | 'id' | 'created_at'>[];
|
|
61
63
|
interface ListApiKeysResponse {
|
|
62
|
-
data: ListApiKeysResponseSuccess
|
|
64
|
+
data: ListApiKeysResponseSuccess | null;
|
|
63
65
|
error: ErrorResponse | null;
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
interface RemoveApiKeyResponseSuccess {
|
|
67
|
-
id: string;
|
|
68
69
|
}
|
|
69
70
|
interface RemoveApiKeyResponse {
|
|
70
71
|
data: RemoveApiKeyResponseSuccess | null;
|
|
@@ -90,19 +91,14 @@ interface CreateAudienceOptions {
|
|
|
90
91
|
}
|
|
91
92
|
interface CreateAudienceRequestOptions extends PostOptions {
|
|
92
93
|
}
|
|
93
|
-
interface CreateAudienceResponseSuccess extends Pick<Audience, 'name' | 'id'
|
|
94
|
+
interface CreateAudienceResponseSuccess extends Pick<Audience, 'name' | 'id'> {
|
|
95
|
+
object: 'audience';
|
|
94
96
|
}
|
|
95
97
|
interface CreateAudienceResponse {
|
|
96
98
|
data: CreateAudienceResponseSuccess | null;
|
|
97
99
|
error: ErrorResponse | null;
|
|
98
100
|
}
|
|
99
101
|
|
|
100
|
-
type ListAudiencesResponseSuccess = Audience[];
|
|
101
|
-
interface ListAudiencesResponse {
|
|
102
|
-
data: ListAudiencesResponseSuccess | null;
|
|
103
|
-
error: ErrorResponse | null;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
102
|
interface GetAudienceResponseSuccess extends Pick<Audience, 'id' | 'name' | 'created_at'> {
|
|
107
103
|
object: 'audience';
|
|
108
104
|
}
|
|
@@ -111,7 +107,19 @@ interface GetAudienceResponse {
|
|
|
111
107
|
error: ErrorResponse | null;
|
|
112
108
|
}
|
|
113
109
|
|
|
114
|
-
type
|
|
110
|
+
type ListAudiencesResponseSuccess = {
|
|
111
|
+
object: 'list';
|
|
112
|
+
data: Audience[];
|
|
113
|
+
};
|
|
114
|
+
interface ListAudiencesResponse {
|
|
115
|
+
data: ListAudiencesResponseSuccess | null;
|
|
116
|
+
error: ErrorResponse | null;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
interface RemoveAudiencesResponseSuccess extends Pick<Audience, 'id'> {
|
|
120
|
+
object: 'audience';
|
|
121
|
+
deleted: boolean;
|
|
122
|
+
}
|
|
115
123
|
interface RemoveAudiencesResponse {
|
|
116
124
|
data: RemoveAudiencesResponseSuccess | null;
|
|
117
125
|
error: ErrorResponse | null;
|
|
@@ -129,6 +137,7 @@ declare class Audiences {
|
|
|
129
137
|
type RequireAtLeastOne<T> = {
|
|
130
138
|
[K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>;
|
|
131
139
|
}[keyof T];
|
|
140
|
+
|
|
132
141
|
interface EmailRenderOptions {
|
|
133
142
|
/**
|
|
134
143
|
* The React component used to write the message.
|
|
@@ -265,32 +274,34 @@ interface PatchOptions {
|
|
|
265
274
|
interface Contact {
|
|
266
275
|
created_at: string;
|
|
267
276
|
id: string;
|
|
268
|
-
|
|
277
|
+
email: string;
|
|
278
|
+
first_name?: string;
|
|
279
|
+
last_name?: string;
|
|
280
|
+
unsubscribed: boolean;
|
|
269
281
|
}
|
|
270
282
|
|
|
271
283
|
interface CreateContactOptions {
|
|
272
|
-
|
|
284
|
+
audienceId: string;
|
|
273
285
|
email: string;
|
|
274
286
|
unsubscribed?: boolean;
|
|
275
|
-
|
|
276
|
-
|
|
287
|
+
firstName?: string;
|
|
288
|
+
lastName?: string;
|
|
277
289
|
}
|
|
278
290
|
interface CreateContactRequestOptions extends PostOptions {
|
|
279
291
|
}
|
|
280
|
-
interface CreateContactResponseSuccess extends Pick<Contact, '
|
|
292
|
+
interface CreateContactResponseSuccess extends Pick<Contact, 'id'> {
|
|
293
|
+
object: 'contact';
|
|
281
294
|
}
|
|
282
295
|
interface CreateContactResponse {
|
|
283
296
|
data: CreateContactResponseSuccess | null;
|
|
284
297
|
error: ErrorResponse | null;
|
|
285
298
|
}
|
|
286
299
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
error: ErrorResponse | null;
|
|
300
|
+
interface GetContactOptions {
|
|
301
|
+
audienceId: string;
|
|
302
|
+
id: string;
|
|
291
303
|
}
|
|
292
|
-
|
|
293
|
-
interface GetContactResponseSuccess extends Pick<Contact, 'id' | 'name' | 'created_at'> {
|
|
304
|
+
interface GetContactResponseSuccess extends Pick<Contact, 'id' | 'email' | 'created_at' | 'first_name' | 'last_name' | 'unsubscribed'> {
|
|
294
305
|
object: 'contact';
|
|
295
306
|
}
|
|
296
307
|
interface GetContactResponse {
|
|
@@ -298,7 +309,40 @@ interface GetContactResponse {
|
|
|
298
309
|
error: ErrorResponse | null;
|
|
299
310
|
}
|
|
300
311
|
|
|
301
|
-
|
|
312
|
+
interface ListContactsOptions {
|
|
313
|
+
audienceId: string;
|
|
314
|
+
}
|
|
315
|
+
interface ListContactsResponseSuccess {
|
|
316
|
+
object: 'list';
|
|
317
|
+
data: Contact[];
|
|
318
|
+
}
|
|
319
|
+
interface ListContactsResponse {
|
|
320
|
+
data: ListContactsResponseSuccess | null;
|
|
321
|
+
error: ErrorResponse | null;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
type RemoveContactsResponseSuccess = {
|
|
325
|
+
object: 'contact';
|
|
326
|
+
deleted: boolean;
|
|
327
|
+
contact: string;
|
|
328
|
+
};
|
|
329
|
+
interface RemoveByOptions {
|
|
330
|
+
/**
|
|
331
|
+
* The contact id.
|
|
332
|
+
*
|
|
333
|
+
* @link https://resend.com/api-reference/contacts/delete-contact#body-parameters
|
|
334
|
+
*/
|
|
335
|
+
id?: string;
|
|
336
|
+
/**
|
|
337
|
+
* The contact email.
|
|
338
|
+
*
|
|
339
|
+
* @link https://resend.com/api-reference/contacts/delete-contact#body-parameters
|
|
340
|
+
*/
|
|
341
|
+
email?: string;
|
|
342
|
+
}
|
|
343
|
+
interface RemoveContactOptions extends RemoveByOptions {
|
|
344
|
+
audienceId: string;
|
|
345
|
+
}
|
|
302
346
|
interface RemoveContactsResponse {
|
|
303
347
|
data: RemoveContactsResponseSuccess | null;
|
|
304
348
|
error: ErrorResponse | null;
|
|
@@ -306,10 +350,10 @@ interface RemoveContactsResponse {
|
|
|
306
350
|
|
|
307
351
|
interface UpdateContactOptions {
|
|
308
352
|
id: string;
|
|
309
|
-
|
|
353
|
+
audienceId: string;
|
|
310
354
|
unsubscribed?: boolean;
|
|
311
|
-
|
|
312
|
-
|
|
355
|
+
fistName?: string;
|
|
356
|
+
lastName?: string;
|
|
313
357
|
}
|
|
314
358
|
type UpdateContactResponseSuccess = Pick<Contact, 'id'>;
|
|
315
359
|
interface UpdateContactResponse {
|
|
@@ -321,18 +365,10 @@ declare class Contacts {
|
|
|
321
365
|
private readonly resend;
|
|
322
366
|
constructor(resend: Resend);
|
|
323
367
|
create(payload: CreateContactOptions, options?: CreateContactRequestOptions): Promise<CreateContactResponse>;
|
|
324
|
-
list(
|
|
325
|
-
|
|
326
|
-
}): Promise<ListContactsResponse>;
|
|
327
|
-
get({ audience_id, id, }: {
|
|
328
|
-
audience_id: string;
|
|
329
|
-
id: string;
|
|
330
|
-
}): Promise<GetContactResponse>;
|
|
368
|
+
list(options: ListContactsOptions): Promise<ListContactsResponse>;
|
|
369
|
+
get(options: GetContactOptions): Promise<GetContactResponse>;
|
|
331
370
|
update(payload: UpdateContactOptions): Promise<UpdateContactResponse>;
|
|
332
|
-
remove(
|
|
333
|
-
audience_id: string;
|
|
334
|
-
id: string;
|
|
335
|
-
}): Promise<RemoveContactsResponse>;
|
|
371
|
+
remove(payload: RemoveContactOptions): Promise<RemoveContactsResponse>;
|
|
336
372
|
}
|
|
337
373
|
|
|
338
374
|
type DomainRegion = 'us-east-1' | 'eu-west-1' | 'sa-east-1';
|
|
@@ -382,12 +418,6 @@ interface CreateDomainResponse {
|
|
|
382
418
|
error: ErrorResponse | null;
|
|
383
419
|
}
|
|
384
420
|
|
|
385
|
-
type ListDomainsResponseSuccess = Domain[];
|
|
386
|
-
interface ListDomainsResponse {
|
|
387
|
-
data: ListDomainsResponseSuccess | null;
|
|
388
|
-
error: ErrorResponse | null;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
421
|
interface GetDomainResponseSuccess extends Pick<Domain, 'id' | 'name' | 'created_at' | 'region' | 'status'> {
|
|
392
422
|
object: 'domain';
|
|
393
423
|
records: DomainRecords[];
|
|
@@ -397,6 +427,14 @@ interface GetDomainResponse {
|
|
|
397
427
|
error: ErrorResponse | null;
|
|
398
428
|
}
|
|
399
429
|
|
|
430
|
+
type ListDomainsResponseSuccess = {
|
|
431
|
+
data: Domain[];
|
|
432
|
+
};
|
|
433
|
+
interface ListDomainsResponse {
|
|
434
|
+
data: ListDomainsResponseSuccess | null;
|
|
435
|
+
error: ErrorResponse | null;
|
|
436
|
+
}
|
|
437
|
+
|
|
400
438
|
type RemoveDomainsResponseSuccess = Pick<Domain, 'id'>;
|
|
401
439
|
interface RemoveDomainsResponse {
|
|
402
440
|
data: RemoveDomainsResponseSuccess | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -53,18 +53,19 @@ interface CreateApiKeyResponse {
|
|
|
53
53
|
error: ErrorResponse | null;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
interface
|
|
57
|
-
name: string;
|
|
58
|
-
id: string;
|
|
56
|
+
interface ApiKey {
|
|
59
57
|
created_at: string;
|
|
58
|
+
id: string;
|
|
59
|
+
name: string;
|
|
60
60
|
}
|
|
61
|
+
|
|
62
|
+
type ListApiKeysResponseSuccess = Pick<ApiKey, 'name' | 'id' | 'created_at'>[];
|
|
61
63
|
interface ListApiKeysResponse {
|
|
62
|
-
data: ListApiKeysResponseSuccess
|
|
64
|
+
data: ListApiKeysResponseSuccess | null;
|
|
63
65
|
error: ErrorResponse | null;
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
interface RemoveApiKeyResponseSuccess {
|
|
67
|
-
id: string;
|
|
68
69
|
}
|
|
69
70
|
interface RemoveApiKeyResponse {
|
|
70
71
|
data: RemoveApiKeyResponseSuccess | null;
|
|
@@ -90,19 +91,14 @@ interface CreateAudienceOptions {
|
|
|
90
91
|
}
|
|
91
92
|
interface CreateAudienceRequestOptions extends PostOptions {
|
|
92
93
|
}
|
|
93
|
-
interface CreateAudienceResponseSuccess extends Pick<Audience, 'name' | 'id'
|
|
94
|
+
interface CreateAudienceResponseSuccess extends Pick<Audience, 'name' | 'id'> {
|
|
95
|
+
object: 'audience';
|
|
94
96
|
}
|
|
95
97
|
interface CreateAudienceResponse {
|
|
96
98
|
data: CreateAudienceResponseSuccess | null;
|
|
97
99
|
error: ErrorResponse | null;
|
|
98
100
|
}
|
|
99
101
|
|
|
100
|
-
type ListAudiencesResponseSuccess = Audience[];
|
|
101
|
-
interface ListAudiencesResponse {
|
|
102
|
-
data: ListAudiencesResponseSuccess | null;
|
|
103
|
-
error: ErrorResponse | null;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
102
|
interface GetAudienceResponseSuccess extends Pick<Audience, 'id' | 'name' | 'created_at'> {
|
|
107
103
|
object: 'audience';
|
|
108
104
|
}
|
|
@@ -111,7 +107,19 @@ interface GetAudienceResponse {
|
|
|
111
107
|
error: ErrorResponse | null;
|
|
112
108
|
}
|
|
113
109
|
|
|
114
|
-
type
|
|
110
|
+
type ListAudiencesResponseSuccess = {
|
|
111
|
+
object: 'list';
|
|
112
|
+
data: Audience[];
|
|
113
|
+
};
|
|
114
|
+
interface ListAudiencesResponse {
|
|
115
|
+
data: ListAudiencesResponseSuccess | null;
|
|
116
|
+
error: ErrorResponse | null;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
interface RemoveAudiencesResponseSuccess extends Pick<Audience, 'id'> {
|
|
120
|
+
object: 'audience';
|
|
121
|
+
deleted: boolean;
|
|
122
|
+
}
|
|
115
123
|
interface RemoveAudiencesResponse {
|
|
116
124
|
data: RemoveAudiencesResponseSuccess | null;
|
|
117
125
|
error: ErrorResponse | null;
|
|
@@ -129,6 +137,7 @@ declare class Audiences {
|
|
|
129
137
|
type RequireAtLeastOne<T> = {
|
|
130
138
|
[K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>;
|
|
131
139
|
}[keyof T];
|
|
140
|
+
|
|
132
141
|
interface EmailRenderOptions {
|
|
133
142
|
/**
|
|
134
143
|
* The React component used to write the message.
|
|
@@ -265,32 +274,34 @@ interface PatchOptions {
|
|
|
265
274
|
interface Contact {
|
|
266
275
|
created_at: string;
|
|
267
276
|
id: string;
|
|
268
|
-
|
|
277
|
+
email: string;
|
|
278
|
+
first_name?: string;
|
|
279
|
+
last_name?: string;
|
|
280
|
+
unsubscribed: boolean;
|
|
269
281
|
}
|
|
270
282
|
|
|
271
283
|
interface CreateContactOptions {
|
|
272
|
-
|
|
284
|
+
audienceId: string;
|
|
273
285
|
email: string;
|
|
274
286
|
unsubscribed?: boolean;
|
|
275
|
-
|
|
276
|
-
|
|
287
|
+
firstName?: string;
|
|
288
|
+
lastName?: string;
|
|
277
289
|
}
|
|
278
290
|
interface CreateContactRequestOptions extends PostOptions {
|
|
279
291
|
}
|
|
280
|
-
interface CreateContactResponseSuccess extends Pick<Contact, '
|
|
292
|
+
interface CreateContactResponseSuccess extends Pick<Contact, 'id'> {
|
|
293
|
+
object: 'contact';
|
|
281
294
|
}
|
|
282
295
|
interface CreateContactResponse {
|
|
283
296
|
data: CreateContactResponseSuccess | null;
|
|
284
297
|
error: ErrorResponse | null;
|
|
285
298
|
}
|
|
286
299
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
error: ErrorResponse | null;
|
|
300
|
+
interface GetContactOptions {
|
|
301
|
+
audienceId: string;
|
|
302
|
+
id: string;
|
|
291
303
|
}
|
|
292
|
-
|
|
293
|
-
interface GetContactResponseSuccess extends Pick<Contact, 'id' | 'name' | 'created_at'> {
|
|
304
|
+
interface GetContactResponseSuccess extends Pick<Contact, 'id' | 'email' | 'created_at' | 'first_name' | 'last_name' | 'unsubscribed'> {
|
|
294
305
|
object: 'contact';
|
|
295
306
|
}
|
|
296
307
|
interface GetContactResponse {
|
|
@@ -298,7 +309,40 @@ interface GetContactResponse {
|
|
|
298
309
|
error: ErrorResponse | null;
|
|
299
310
|
}
|
|
300
311
|
|
|
301
|
-
|
|
312
|
+
interface ListContactsOptions {
|
|
313
|
+
audienceId: string;
|
|
314
|
+
}
|
|
315
|
+
interface ListContactsResponseSuccess {
|
|
316
|
+
object: 'list';
|
|
317
|
+
data: Contact[];
|
|
318
|
+
}
|
|
319
|
+
interface ListContactsResponse {
|
|
320
|
+
data: ListContactsResponseSuccess | null;
|
|
321
|
+
error: ErrorResponse | null;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
type RemoveContactsResponseSuccess = {
|
|
325
|
+
object: 'contact';
|
|
326
|
+
deleted: boolean;
|
|
327
|
+
contact: string;
|
|
328
|
+
};
|
|
329
|
+
interface RemoveByOptions {
|
|
330
|
+
/**
|
|
331
|
+
* The contact id.
|
|
332
|
+
*
|
|
333
|
+
* @link https://resend.com/api-reference/contacts/delete-contact#body-parameters
|
|
334
|
+
*/
|
|
335
|
+
id?: string;
|
|
336
|
+
/**
|
|
337
|
+
* The contact email.
|
|
338
|
+
*
|
|
339
|
+
* @link https://resend.com/api-reference/contacts/delete-contact#body-parameters
|
|
340
|
+
*/
|
|
341
|
+
email?: string;
|
|
342
|
+
}
|
|
343
|
+
interface RemoveContactOptions extends RemoveByOptions {
|
|
344
|
+
audienceId: string;
|
|
345
|
+
}
|
|
302
346
|
interface RemoveContactsResponse {
|
|
303
347
|
data: RemoveContactsResponseSuccess | null;
|
|
304
348
|
error: ErrorResponse | null;
|
|
@@ -306,10 +350,10 @@ interface RemoveContactsResponse {
|
|
|
306
350
|
|
|
307
351
|
interface UpdateContactOptions {
|
|
308
352
|
id: string;
|
|
309
|
-
|
|
353
|
+
audienceId: string;
|
|
310
354
|
unsubscribed?: boolean;
|
|
311
|
-
|
|
312
|
-
|
|
355
|
+
fistName?: string;
|
|
356
|
+
lastName?: string;
|
|
313
357
|
}
|
|
314
358
|
type UpdateContactResponseSuccess = Pick<Contact, 'id'>;
|
|
315
359
|
interface UpdateContactResponse {
|
|
@@ -321,18 +365,10 @@ declare class Contacts {
|
|
|
321
365
|
private readonly resend;
|
|
322
366
|
constructor(resend: Resend);
|
|
323
367
|
create(payload: CreateContactOptions, options?: CreateContactRequestOptions): Promise<CreateContactResponse>;
|
|
324
|
-
list(
|
|
325
|
-
|
|
326
|
-
}): Promise<ListContactsResponse>;
|
|
327
|
-
get({ audience_id, id, }: {
|
|
328
|
-
audience_id: string;
|
|
329
|
-
id: string;
|
|
330
|
-
}): Promise<GetContactResponse>;
|
|
368
|
+
list(options: ListContactsOptions): Promise<ListContactsResponse>;
|
|
369
|
+
get(options: GetContactOptions): Promise<GetContactResponse>;
|
|
331
370
|
update(payload: UpdateContactOptions): Promise<UpdateContactResponse>;
|
|
332
|
-
remove(
|
|
333
|
-
audience_id: string;
|
|
334
|
-
id: string;
|
|
335
|
-
}): Promise<RemoveContactsResponse>;
|
|
371
|
+
remove(payload: RemoveContactOptions): Promise<RemoveContactsResponse>;
|
|
336
372
|
}
|
|
337
373
|
|
|
338
374
|
type DomainRegion = 'us-east-1' | 'eu-west-1' | 'sa-east-1';
|
|
@@ -382,12 +418,6 @@ interface CreateDomainResponse {
|
|
|
382
418
|
error: ErrorResponse | null;
|
|
383
419
|
}
|
|
384
420
|
|
|
385
|
-
type ListDomainsResponseSuccess = Domain[];
|
|
386
|
-
interface ListDomainsResponse {
|
|
387
|
-
data: ListDomainsResponseSuccess | null;
|
|
388
|
-
error: ErrorResponse | null;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
421
|
interface GetDomainResponseSuccess extends Pick<Domain, 'id' | 'name' | 'created_at' | 'region' | 'status'> {
|
|
392
422
|
object: 'domain';
|
|
393
423
|
records: DomainRecords[];
|
|
@@ -397,6 +427,14 @@ interface GetDomainResponse {
|
|
|
397
427
|
error: ErrorResponse | null;
|
|
398
428
|
}
|
|
399
429
|
|
|
430
|
+
type ListDomainsResponseSuccess = {
|
|
431
|
+
data: Domain[];
|
|
432
|
+
};
|
|
433
|
+
interface ListDomainsResponse {
|
|
434
|
+
data: ListDomainsResponseSuccess | null;
|
|
435
|
+
error: ErrorResponse | null;
|
|
436
|
+
}
|
|
437
|
+
|
|
400
438
|
type RemoveDomainsResponseSuccess = Pick<Domain, 'id'>;
|
|
401
439
|
interface RemoveDomainsResponse {
|
|
402
440
|
data: RemoveDomainsResponseSuccess | null;
|
package/dist/index.js
CHANGED
|
@@ -59,7 +59,7 @@ __export(src_exports, {
|
|
|
59
59
|
module.exports = __toCommonJS(src_exports);
|
|
60
60
|
|
|
61
61
|
// package.json
|
|
62
|
-
var version = "
|
|
62
|
+
var version = "3.0.0";
|
|
63
63
|
|
|
64
64
|
// src/api-keys/api-keys.ts
|
|
65
65
|
var ApiKeys = class {
|
|
@@ -168,30 +168,30 @@ var Contacts = class {
|
|
|
168
168
|
create(_0) {
|
|
169
169
|
return __async(this, arguments, function* (payload, options = {}) {
|
|
170
170
|
const data = yield this.resend.post(
|
|
171
|
-
`/audiences/${payload.
|
|
172
|
-
|
|
171
|
+
`/audiences/${payload.audienceId}/contacts`,
|
|
172
|
+
{
|
|
173
|
+
unsubscribed: payload.unsubscribed,
|
|
174
|
+
email: payload.email,
|
|
175
|
+
first_name: payload.firstName,
|
|
176
|
+
last_name: payload.lastName
|
|
177
|
+
},
|
|
173
178
|
options
|
|
174
179
|
);
|
|
175
180
|
return data;
|
|
176
181
|
});
|
|
177
182
|
}
|
|
178
|
-
list(
|
|
179
|
-
return __async(this,
|
|
180
|
-
audience_id
|
|
181
|
-
}) {
|
|
183
|
+
list(options) {
|
|
184
|
+
return __async(this, null, function* () {
|
|
182
185
|
const data = yield this.resend.get(
|
|
183
|
-
`/audiences/${
|
|
186
|
+
`/audiences/${options.audienceId}/contacts`
|
|
184
187
|
);
|
|
185
188
|
return data;
|
|
186
189
|
});
|
|
187
190
|
}
|
|
188
|
-
get(
|
|
189
|
-
return __async(this,
|
|
190
|
-
audience_id,
|
|
191
|
-
id
|
|
192
|
-
}) {
|
|
191
|
+
get(options) {
|
|
192
|
+
return __async(this, null, function* () {
|
|
193
193
|
const data = yield this.resend.get(
|
|
194
|
-
`/audiences/${
|
|
194
|
+
`/audiences/${options.audienceId}/contacts/${options.id}`
|
|
195
195
|
);
|
|
196
196
|
return data;
|
|
197
197
|
});
|
|
@@ -199,19 +199,20 @@ var Contacts = class {
|
|
|
199
199
|
update(payload) {
|
|
200
200
|
return __async(this, null, function* () {
|
|
201
201
|
const data = yield this.resend.patch(
|
|
202
|
-
`/audiences/${payload.
|
|
203
|
-
|
|
202
|
+
`/audiences/${payload.audienceId}/contacts/${payload.id}`,
|
|
203
|
+
{
|
|
204
|
+
unsubscribed: payload.unsubscribed,
|
|
205
|
+
first_name: payload.fistName,
|
|
206
|
+
last_name: payload.lastName
|
|
207
|
+
}
|
|
204
208
|
);
|
|
205
209
|
return data;
|
|
206
210
|
});
|
|
207
211
|
}
|
|
208
|
-
remove(
|
|
209
|
-
return __async(this,
|
|
210
|
-
audience_id,
|
|
211
|
-
id
|
|
212
|
-
}) {
|
|
212
|
+
remove(payload) {
|
|
213
|
+
return __async(this, null, function* () {
|
|
213
214
|
const data = yield this.resend.delete(
|
|
214
|
-
`/audiences/${
|
|
215
|
+
`/audiences/${payload.audienceId}/contacts/${(payload == null ? void 0 : payload.email) ? payload == null ? void 0 : payload.email : payload == null ? void 0 : payload.id}`
|
|
215
216
|
);
|
|
216
217
|
return data;
|
|
217
218
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -36,7 +36,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
// package.json
|
|
39
|
-
var version = "
|
|
39
|
+
var version = "3.0.0";
|
|
40
40
|
|
|
41
41
|
// src/api-keys/api-keys.ts
|
|
42
42
|
var ApiKeys = class {
|
|
@@ -145,30 +145,30 @@ var Contacts = class {
|
|
|
145
145
|
create(_0) {
|
|
146
146
|
return __async(this, arguments, function* (payload, options = {}) {
|
|
147
147
|
const data = yield this.resend.post(
|
|
148
|
-
`/audiences/${payload.
|
|
149
|
-
|
|
148
|
+
`/audiences/${payload.audienceId}/contacts`,
|
|
149
|
+
{
|
|
150
|
+
unsubscribed: payload.unsubscribed,
|
|
151
|
+
email: payload.email,
|
|
152
|
+
first_name: payload.firstName,
|
|
153
|
+
last_name: payload.lastName
|
|
154
|
+
},
|
|
150
155
|
options
|
|
151
156
|
);
|
|
152
157
|
return data;
|
|
153
158
|
});
|
|
154
159
|
}
|
|
155
|
-
list(
|
|
156
|
-
return __async(this,
|
|
157
|
-
audience_id
|
|
158
|
-
}) {
|
|
160
|
+
list(options) {
|
|
161
|
+
return __async(this, null, function* () {
|
|
159
162
|
const data = yield this.resend.get(
|
|
160
|
-
`/audiences/${
|
|
163
|
+
`/audiences/${options.audienceId}/contacts`
|
|
161
164
|
);
|
|
162
165
|
return data;
|
|
163
166
|
});
|
|
164
167
|
}
|
|
165
|
-
get(
|
|
166
|
-
return __async(this,
|
|
167
|
-
audience_id,
|
|
168
|
-
id
|
|
169
|
-
}) {
|
|
168
|
+
get(options) {
|
|
169
|
+
return __async(this, null, function* () {
|
|
170
170
|
const data = yield this.resend.get(
|
|
171
|
-
`/audiences/${
|
|
171
|
+
`/audiences/${options.audienceId}/contacts/${options.id}`
|
|
172
172
|
);
|
|
173
173
|
return data;
|
|
174
174
|
});
|
|
@@ -176,19 +176,20 @@ var Contacts = class {
|
|
|
176
176
|
update(payload) {
|
|
177
177
|
return __async(this, null, function* () {
|
|
178
178
|
const data = yield this.resend.patch(
|
|
179
|
-
`/audiences/${payload.
|
|
180
|
-
|
|
179
|
+
`/audiences/${payload.audienceId}/contacts/${payload.id}`,
|
|
180
|
+
{
|
|
181
|
+
unsubscribed: payload.unsubscribed,
|
|
182
|
+
first_name: payload.fistName,
|
|
183
|
+
last_name: payload.lastName
|
|
184
|
+
}
|
|
181
185
|
);
|
|
182
186
|
return data;
|
|
183
187
|
});
|
|
184
188
|
}
|
|
185
|
-
remove(
|
|
186
|
-
return __async(this,
|
|
187
|
-
audience_id,
|
|
188
|
-
id
|
|
189
|
-
}) {
|
|
189
|
+
remove(payload) {
|
|
190
|
+
return __async(this, null, function* () {
|
|
190
191
|
const data = yield this.resend.delete(
|
|
191
|
-
`/audiences/${
|
|
192
|
+
`/audiences/${payload.audienceId}/contacts/${(payload == null ? void 0 : payload.email) ? payload == null ? void 0 : payload.email : payload == null ? void 0 : payload.id}`
|
|
192
193
|
);
|
|
193
194
|
return data;
|
|
194
195
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resend",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Node.js library for the Resend API",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
|
-
"packageManager": "yarn@3.
|
|
26
|
+
"packageManager": "yarn@3.7.0",
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
29
29
|
"test": "jest",
|
|
@@ -44,21 +44,21 @@
|
|
|
44
44
|
},
|
|
45
45
|
"homepage": "https://github.com/resendlabs/resend-node#readme",
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@react-email/render": "0.0.
|
|
47
|
+
"@react-email/render": "0.0.11"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@types/jest": "29.5.
|
|
51
|
-
"@types/node": "18.
|
|
52
|
-
"@types/react": "18.2.
|
|
53
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
54
|
-
"@typescript-eslint/parser": "6.
|
|
55
|
-
"eslint": "8.
|
|
50
|
+
"@types/jest": "29.5.11",
|
|
51
|
+
"@types/node": "18.19.7",
|
|
52
|
+
"@types/react": "18.2.48",
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "6.19.0",
|
|
54
|
+
"@typescript-eslint/parser": "6.19.0",
|
|
55
|
+
"eslint": "8.56.0",
|
|
56
56
|
"jest": "29.7.0",
|
|
57
57
|
"jest-fetch-mock": "3.0.3",
|
|
58
|
-
"prettier": "3.
|
|
58
|
+
"prettier": "3.2.4",
|
|
59
59
|
"ts-jest": "29.1.1",
|
|
60
|
-
"ts-node": "10.9.
|
|
60
|
+
"ts-node": "10.9.2",
|
|
61
61
|
"tsup": "7.2.0",
|
|
62
|
-
"typescript": "5.
|
|
62
|
+
"typescript": "5.3.3"
|
|
63
63
|
}
|
|
64
64
|
}
|