resend 4.7.0-preview-topics.0 → 4.7.0-preview-topics.2

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 CHANGED
@@ -224,6 +224,12 @@ interface CreateEmailBaseOptions {
224
224
  * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
225
225
  */
226
226
  to: string | string[];
227
+ /**
228
+ * The id of the topic you want to send to
229
+ *
230
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
231
+ */
232
+ topicId?: string | null;
227
233
  /**
228
234
  * Schedule email to be sent later.
229
235
  * The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z).
@@ -343,6 +349,12 @@ interface CreateBroadcastBaseOptions {
343
349
  * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
344
350
  */
345
351
  subject: string;
352
+ /**
353
+ * The id of the topic you want to send to
354
+ *
355
+ * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
356
+ */
357
+ topicId?: string | null;
346
358
  }
347
359
  type CreateBroadcastOptions = RequireAtLeastOne<EmailRenderOptions> & CreateBroadcastBaseOptions;
348
360
  interface CreateBroadcastRequestOptions extends PostOptions {
@@ -368,6 +380,7 @@ interface Broadcast {
368
380
  created_at: string;
369
381
  scheduled_at: string | null;
370
382
  sent_at: string | null;
383
+ topic_id?: string | null;
371
384
  }
372
385
 
373
386
  interface GetBroadcastResponseSuccess extends Broadcast {
@@ -430,6 +443,7 @@ interface UpdateBroadcastOptions {
430
443
  subject?: string;
431
444
  replyTo?: string[];
432
445
  previewText?: string;
446
+ topicId?: string | null;
433
447
  }
434
448
  interface UpdateBroadcastResponse {
435
449
  data: UpdateBroadcastResponseSuccess | null;
@@ -558,6 +572,8 @@ interface GetContactTopicsOptions extends GetContactTopicsBaseOptions {
558
572
  }
559
573
  interface ContactTopic {
560
574
  id: string;
575
+ name: string;
576
+ description: string | null;
561
577
  subscription: 'opt_in' | 'opt_out';
562
578
  }
563
579
  interface GetContactTopicsResponseSuccess {
@@ -574,8 +590,10 @@ interface UpdateContactTopicsBaseOptions {
574
590
  email?: string;
575
591
  }
576
592
  interface UpdateContactTopicsOptions extends UpdateContactTopicsBaseOptions {
577
- opt_in?: string | string[];
578
- opt_out?: string | string[];
593
+ topics: {
594
+ id: string;
595
+ subscription: 'opt_in' | 'opt_out';
596
+ }[];
579
597
  }
580
598
  interface UpdateContactTopicsResponseSuccess {
581
599
  id: string;
@@ -731,6 +749,7 @@ interface GetEmailResponseSuccess {
731
749
  subject: string;
732
750
  text: string | null;
733
751
  to: string[];
752
+ topic_id?: string | null;
734
753
  scheduled_at: string | null;
735
754
  object: 'email';
736
755
  }
package/dist/index.d.ts CHANGED
@@ -224,6 +224,12 @@ interface CreateEmailBaseOptions {
224
224
  * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
225
225
  */
226
226
  to: string | string[];
227
+ /**
228
+ * The id of the topic you want to send to
229
+ *
230
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
231
+ */
232
+ topicId?: string | null;
227
233
  /**
228
234
  * Schedule email to be sent later.
229
235
  * The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z).
@@ -343,6 +349,12 @@ interface CreateBroadcastBaseOptions {
343
349
  * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
344
350
  */
345
351
  subject: string;
352
+ /**
353
+ * The id of the topic you want to send to
354
+ *
355
+ * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
356
+ */
357
+ topicId?: string | null;
346
358
  }
347
359
  type CreateBroadcastOptions = RequireAtLeastOne<EmailRenderOptions> & CreateBroadcastBaseOptions;
348
360
  interface CreateBroadcastRequestOptions extends PostOptions {
@@ -368,6 +380,7 @@ interface Broadcast {
368
380
  created_at: string;
369
381
  scheduled_at: string | null;
370
382
  sent_at: string | null;
383
+ topic_id?: string | null;
371
384
  }
372
385
 
373
386
  interface GetBroadcastResponseSuccess extends Broadcast {
@@ -430,6 +443,7 @@ interface UpdateBroadcastOptions {
430
443
  subject?: string;
431
444
  replyTo?: string[];
432
445
  previewText?: string;
446
+ topicId?: string | null;
433
447
  }
434
448
  interface UpdateBroadcastResponse {
435
449
  data: UpdateBroadcastResponseSuccess | null;
@@ -558,6 +572,8 @@ interface GetContactTopicsOptions extends GetContactTopicsBaseOptions {
558
572
  }
559
573
  interface ContactTopic {
560
574
  id: string;
575
+ name: string;
576
+ description: string | null;
561
577
  subscription: 'opt_in' | 'opt_out';
562
578
  }
563
579
  interface GetContactTopicsResponseSuccess {
@@ -574,8 +590,10 @@ interface UpdateContactTopicsBaseOptions {
574
590
  email?: string;
575
591
  }
576
592
  interface UpdateContactTopicsOptions extends UpdateContactTopicsBaseOptions {
577
- opt_in?: string | string[];
578
- opt_out?: string | string[];
593
+ topics: {
594
+ id: string;
595
+ subscription: 'opt_in' | 'opt_out';
596
+ }[];
579
597
  }
580
598
  interface UpdateContactTopicsResponseSuccess {
581
599
  id: string;
@@ -731,6 +749,7 @@ interface GetEmailResponseSuccess {
731
749
  subject: string;
732
750
  text: string | null;
733
751
  to: string[];
752
+ topic_id?: string | null;
734
753
  scheduled_at: string | null;
735
754
  object: 'email';
736
755
  }
package/dist/index.js CHANGED
@@ -72,7 +72,7 @@ __export(src_exports, {
72
72
  module.exports = __toCommonJS(src_exports);
73
73
 
74
74
  // package.json
75
- var version = "4.7.0-preview-topics.0";
75
+ var version = "4.7.0-preview-topics.2";
76
76
 
77
77
  // src/api-keys/api-keys.ts
78
78
  var ApiKeys = class {
@@ -158,7 +158,8 @@ function parseEmailToApiOptions(email) {
158
158
  subject: email.subject,
159
159
  tags: email.tags,
160
160
  text: email.text,
161
- to: email.to
161
+ to: email.to,
162
+ topic_id: email.topicId
162
163
  };
163
164
  }
164
165
 
@@ -234,7 +235,8 @@ var Broadcasts = class {
234
235
  html: payload.html,
235
236
  reply_to: payload.replyTo,
236
237
  subject: payload.subject,
237
- text: payload.text
238
+ text: payload.text,
239
+ topic_id: payload.topicId
238
240
  },
239
241
  options
240
242
  );
@@ -284,7 +286,8 @@ var Broadcasts = class {
284
286
  text: payload.text,
285
287
  subject: payload.subject,
286
288
  reply_to: payload.replyTo,
287
- preview_text: payload.previewText
289
+ preview_text: payload.previewText,
290
+ topic_id: payload.topicId
288
291
  }
289
292
  );
290
293
  return data;
@@ -311,10 +314,7 @@ var ContactTopics = class {
311
314
  const identifier = payload.email ? payload.email : payload.id;
312
315
  const data = yield this.resend.patch(
313
316
  `/contacts/${identifier}/topics`,
314
- {
315
- opt_in: payload.opt_in,
316
- opt_out: payload.opt_out
317
- }
317
+ payload.topics
318
318
  );
319
319
  return data;
320
320
  });
package/dist/index.mjs CHANGED
@@ -39,7 +39,7 @@ var __async = (__this, __arguments, generator) => {
39
39
  };
40
40
 
41
41
  // package.json
42
- var version = "4.7.0-preview-topics.0";
42
+ var version = "4.7.0-preview-topics.2";
43
43
 
44
44
  // src/api-keys/api-keys.ts
45
45
  var ApiKeys = class {
@@ -125,7 +125,8 @@ function parseEmailToApiOptions(email) {
125
125
  subject: email.subject,
126
126
  tags: email.tags,
127
127
  text: email.text,
128
- to: email.to
128
+ to: email.to,
129
+ topic_id: email.topicId
129
130
  };
130
131
  }
131
132
 
@@ -201,7 +202,8 @@ var Broadcasts = class {
201
202
  html: payload.html,
202
203
  reply_to: payload.replyTo,
203
204
  subject: payload.subject,
204
- text: payload.text
205
+ text: payload.text,
206
+ topic_id: payload.topicId
205
207
  },
206
208
  options
207
209
  );
@@ -251,7 +253,8 @@ var Broadcasts = class {
251
253
  text: payload.text,
252
254
  subject: payload.subject,
253
255
  reply_to: payload.replyTo,
254
- preview_text: payload.previewText
256
+ preview_text: payload.previewText,
257
+ topic_id: payload.topicId
255
258
  }
256
259
  );
257
260
  return data;
@@ -278,10 +281,7 @@ var ContactTopics = class {
278
281
  const identifier = payload.email ? payload.email : payload.id;
279
282
  const data = yield this.resend.patch(
280
283
  `/contacts/${identifier}/topics`,
281
- {
282
- opt_in: payload.opt_in,
283
- opt_out: payload.opt_out
284
- }
284
+ payload.topics
285
285
  );
286
286
  return data;
287
287
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resend",
3
- "version": "4.7.0-preview-topics.0",
3
+ "version": "4.7.0-preview-topics.2",
4
4
  "description": "Node.js library for the Resend API",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",