resend 6.9.0 → 6.9.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.cjs CHANGED
@@ -1,8 +1,36 @@
1
- let mailparser = require("mailparser");
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+ let postal_mime = require("postal-mime");
29
+ postal_mime = __toESM(postal_mime);
2
30
  let svix = require("svix");
3
31
 
4
32
  //#region package.json
5
- var version = "6.9.0";
33
+ var version = "6.9.2";
6
34
 
7
35
  //#endregion
8
36
  //#region src/common/utils/build-pagination-query.ts
@@ -587,13 +615,14 @@ var Receiving = class {
587
615
  },
588
616
  headers: null
589
617
  };
590
- const parsed = await (0, mailparser.simpleParser)(await rawResponse.text(), { skipImageLinks: true });
618
+ const rawEmailContent = await rawResponse.text();
619
+ const parsed = await postal_mime.default.parse(rawEmailContent, { attachmentEncoding: "base64" });
591
620
  const attachments = parsed.attachments.map((attachment) => {
592
621
  const contentId = attachment.contentId ? attachment.contentId.replace(/^<|>$/g, "") : void 0;
593
622
  return {
594
623
  filename: attachment.filename,
595
- content: attachment.content.toString("base64"),
596
- content_type: attachment.contentType,
624
+ content: attachment.content.toString(),
625
+ content_type: attachment.mimeType,
597
626
  content_id: contentId || void 0
598
627
  };
599
628
  });
package/dist/index.d.cts CHANGED
@@ -1,3 +1,5 @@
1
+ import * as React$1 from "react";
2
+
1
3
  //#region src/api-keys/interfaces/api-key.d.ts
2
4
  interface ApiKey {
3
5
  created_at: string;
@@ -217,7 +219,7 @@ interface EmailRenderOptions$1 {
217
219
  *
218
220
  * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
219
221
  */
220
- react: void 0;
222
+ react: React$1.ReactNode;
221
223
  /**
222
224
  * The HTML version of the message.
223
225
  *
@@ -404,7 +406,7 @@ interface EmailRenderOptions {
404
406
  *
405
407
  * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
406
408
  */
407
- react: void 0;
409
+ react: React$1.ReactNode;
408
410
  /**
409
411
  * The HTML version of the message.
410
412
  *
@@ -707,6 +709,8 @@ interface CreateContactPropertiesOptions {
707
709
  interface LegacyCreateContactOptions {
708
710
  /**
709
711
  * @deprecated Use `segments` instead to add one or more segments to the new contact
712
+ *
713
+ * @see https://resend.com/docs/dashboard/segments/migrating-from-audiences-to-segments
710
714
  */
711
715
  audienceId: string;
712
716
  email: string;
@@ -714,8 +718,6 @@ interface LegacyCreateContactOptions {
714
718
  firstName?: string;
715
719
  lastName?: string;
716
720
  properties?: CreateContactPropertiesOptions;
717
- segments?: never;
718
- topics?: never;
719
721
  }
720
722
  interface CreateContactOptions {
721
723
  email: string;
@@ -730,10 +732,6 @@ interface CreateContactOptions {
730
732
  id: string;
731
733
  subscription: 'opt_in' | 'opt_out';
732
734
  }[];
733
- /**
734
- * @deprecated Use `segments` instead to add one or more segments to the new contact
735
- */
736
- audienceId?: never;
737
735
  }
738
736
  interface CreateContactRequestOptions extends PostOptions {}
739
737
  interface CreateContactResponseSuccess extends Pick<Contact, 'id'> {
@@ -1061,11 +1059,11 @@ interface GetReceivingEmailResponseSuccess {
1061
1059
  } | null;
1062
1060
  attachments: Array<{
1063
1061
  id: string;
1064
- filename: string;
1062
+ filename: string | null;
1065
1063
  size: number;
1066
1064
  content_type: string;
1067
- content_id: string;
1068
- content_disposition: string;
1065
+ content_id: string | null;
1066
+ content_disposition: string | null;
1069
1067
  }>;
1070
1068
  }
1071
1069
  type GetReceivingEmailResponse = Response<GetReceivingEmailResponseSuccess>;
@@ -1149,7 +1147,8 @@ declare class Contacts {
1149
1147
  readonly topics: ContactTopics;
1150
1148
  readonly segments: ContactSegments;
1151
1149
  constructor(resend: Resend);
1152
- create(payload: CreateContactOptions | LegacyCreateContactOptions, options?: CreateContactRequestOptions): Promise<CreateContactResponse>;
1150
+ create(paylaod: CreateContactOptions, options?: CreateContactRequestOptions): Promise<CreateContactResponse>;
1151
+ create(paylaod: LegacyCreateContactOptions, options?: CreateContactRequestOptions): Promise<CreateContactResponse>;
1153
1152
  list(options?: ListContactsOptions): Promise<ListContactsResponse>;
1154
1153
  get(options: GetContactOptions): Promise<GetContactResponse>;
1155
1154
  update(options: UpdateContactOptions): Promise<UpdateContactResponse>;
@@ -1393,7 +1392,7 @@ interface Topic {
1393
1392
  id: string;
1394
1393
  name: string;
1395
1394
  description?: string;
1396
- defaultSubscription: 'opt_in' | 'opt_out';
1395
+ default_subscription: 'opt_in' | 'opt_out';
1397
1396
  created_at: string;
1398
1397
  }
1399
1398
  //#endregion
@@ -1478,10 +1477,10 @@ interface EmailSuppressed {
1478
1477
  }
1479
1478
  interface ReceivedEmailAttachment {
1480
1479
  id: string;
1481
- filename: string;
1480
+ filename: string | null;
1482
1481
  content_type: string;
1483
- content_disposition: string;
1484
- content_id?: string;
1482
+ content_disposition: string | null;
1483
+ content_id: string | null;
1485
1484
  }
1486
1485
  interface ReceivedEmailEventData {
1487
1486
  email_id: string;
package/dist/index.d.mts CHANGED
@@ -1,3 +1,5 @@
1
+ import * as React$1 from "react";
2
+
1
3
  //#region src/api-keys/interfaces/api-key.d.ts
2
4
  interface ApiKey {
3
5
  created_at: string;
@@ -217,7 +219,7 @@ interface EmailRenderOptions$1 {
217
219
  *
218
220
  * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
219
221
  */
220
- react: void 0;
222
+ react: React$1.ReactNode;
221
223
  /**
222
224
  * The HTML version of the message.
223
225
  *
@@ -404,7 +406,7 @@ interface EmailRenderOptions {
404
406
  *
405
407
  * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
406
408
  */
407
- react: void 0;
409
+ react: React$1.ReactNode;
408
410
  /**
409
411
  * The HTML version of the message.
410
412
  *
@@ -707,6 +709,8 @@ interface CreateContactPropertiesOptions {
707
709
  interface LegacyCreateContactOptions {
708
710
  /**
709
711
  * @deprecated Use `segments` instead to add one or more segments to the new contact
712
+ *
713
+ * @see https://resend.com/docs/dashboard/segments/migrating-from-audiences-to-segments
710
714
  */
711
715
  audienceId: string;
712
716
  email: string;
@@ -714,8 +718,6 @@ interface LegacyCreateContactOptions {
714
718
  firstName?: string;
715
719
  lastName?: string;
716
720
  properties?: CreateContactPropertiesOptions;
717
- segments?: never;
718
- topics?: never;
719
721
  }
720
722
  interface CreateContactOptions {
721
723
  email: string;
@@ -730,10 +732,6 @@ interface CreateContactOptions {
730
732
  id: string;
731
733
  subscription: 'opt_in' | 'opt_out';
732
734
  }[];
733
- /**
734
- * @deprecated Use `segments` instead to add one or more segments to the new contact
735
- */
736
- audienceId?: never;
737
735
  }
738
736
  interface CreateContactRequestOptions extends PostOptions {}
739
737
  interface CreateContactResponseSuccess extends Pick<Contact, 'id'> {
@@ -1061,11 +1059,11 @@ interface GetReceivingEmailResponseSuccess {
1061
1059
  } | null;
1062
1060
  attachments: Array<{
1063
1061
  id: string;
1064
- filename: string;
1062
+ filename: string | null;
1065
1063
  size: number;
1066
1064
  content_type: string;
1067
- content_id: string;
1068
- content_disposition: string;
1065
+ content_id: string | null;
1066
+ content_disposition: string | null;
1069
1067
  }>;
1070
1068
  }
1071
1069
  type GetReceivingEmailResponse = Response<GetReceivingEmailResponseSuccess>;
@@ -1149,7 +1147,8 @@ declare class Contacts {
1149
1147
  readonly topics: ContactTopics;
1150
1148
  readonly segments: ContactSegments;
1151
1149
  constructor(resend: Resend);
1152
- create(payload: CreateContactOptions | LegacyCreateContactOptions, options?: CreateContactRequestOptions): Promise<CreateContactResponse>;
1150
+ create(paylaod: CreateContactOptions, options?: CreateContactRequestOptions): Promise<CreateContactResponse>;
1151
+ create(paylaod: LegacyCreateContactOptions, options?: CreateContactRequestOptions): Promise<CreateContactResponse>;
1153
1152
  list(options?: ListContactsOptions): Promise<ListContactsResponse>;
1154
1153
  get(options: GetContactOptions): Promise<GetContactResponse>;
1155
1154
  update(options: UpdateContactOptions): Promise<UpdateContactResponse>;
@@ -1393,7 +1392,7 @@ interface Topic {
1393
1392
  id: string;
1394
1393
  name: string;
1395
1394
  description?: string;
1396
- defaultSubscription: 'opt_in' | 'opt_out';
1395
+ default_subscription: 'opt_in' | 'opt_out';
1397
1396
  created_at: string;
1398
1397
  }
1399
1398
  //#endregion
@@ -1478,10 +1477,10 @@ interface EmailSuppressed {
1478
1477
  }
1479
1478
  interface ReceivedEmailAttachment {
1480
1479
  id: string;
1481
- filename: string;
1480
+ filename: string | null;
1482
1481
  content_type: string;
1483
- content_disposition: string;
1484
- content_id?: string;
1482
+ content_disposition: string | null;
1483
+ content_id: string | null;
1485
1484
  }
1486
1485
  interface ReceivedEmailEventData {
1487
1486
  email_id: string;
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { simpleParser } from "mailparser";
1
+ import PostalMime from "postal-mime";
2
2
  import { Webhook } from "svix";
3
3
 
4
4
  //#region package.json
5
- var version = "6.9.0";
5
+ var version = "6.9.2";
6
6
 
7
7
  //#endregion
8
8
  //#region src/common/utils/build-pagination-query.ts
@@ -587,13 +587,14 @@ var Receiving = class {
587
587
  },
588
588
  headers: null
589
589
  };
590
- const parsed = await simpleParser(await rawResponse.text(), { skipImageLinks: true });
590
+ const rawEmailContent = await rawResponse.text();
591
+ const parsed = await PostalMime.parse(rawEmailContent, { attachmentEncoding: "base64" });
591
592
  const attachments = parsed.attachments.map((attachment) => {
592
593
  const contentId = attachment.contentId ? attachment.contentId.replace(/^<|>$/g, "") : void 0;
593
594
  return {
594
595
  filename: attachment.filename,
595
- content: attachment.content.toString("base64"),
596
- content_type: attachment.contentType,
596
+ content: attachment.content.toString(),
597
+ content_type: attachment.mimeType,
597
598
  content_id: contentId || void 0
598
599
  };
599
600
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resend",
3
- "version": "6.9.0",
3
+ "version": "6.9.2",
4
4
  "description": "Node.js library for the Resend API",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "homepage": "https://github.com/resend/resend-node#readme",
42
42
  "dependencies": {
43
- "mailparser": "3.7.2",
43
+ "postal-mime": "2.7.3",
44
44
  "svix": "1.84.1"
45
45
  },
46
46
  "peerDependencies": {
@@ -52,16 +52,18 @@
52
52
  }
53
53
  },
54
54
  "devDependencies": {
55
- "@biomejs/biome": "2.3.12",
55
+ "@biomejs/biome": "2.3.13",
56
56
  "@pollyjs/adapter-fetch": "6.0.7",
57
57
  "@pollyjs/core": "6.0.6",
58
58
  "@pollyjs/persister-fs": "6.0.6",
59
- "@types/mailparser": "3.4.5",
59
+ "@types/mailparser": "3.4.6",
60
60
  "@types/node": "24.10.9",
61
- "@types/react": "19.2.9",
61
+ "@types/react": "19.2.10",
62
62
  "cross-env": "10.1.0",
63
63
  "dotenv": "17.2.3",
64
64
  "pkg-pr-new": "0.0.62",
65
+ "react": "19.2.4",
66
+ "react-dom": "19.2.4",
65
67
  "rimraf": "6.1.2",
66
68
  "tsdown": "0.20.1",
67
69
  "typescript": "5.9.3",