@visulima/email 2.1.6 → 2.1.7

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.
Files changed (225) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/crypto/index.d.ts +183 -183
  3. package/dist/crypto/index.js +1 -1
  4. package/dist/deliverability/dmarc-report.d.ts +43 -43
  5. package/dist/deliverability/dmarc-report.js +1 -1
  6. package/dist/deliverability/index.d.ts +201 -201
  7. package/dist/events/index.d.ts +17 -17
  8. package/dist/inbound/index.d.ts +180 -180
  9. package/dist/index.d.ts +35 -46
  10. package/dist/index.js +1 -1
  11. package/dist/middleware/index.d.ts +213 -216
  12. package/dist/middleware/index.js +1 -1
  13. package/dist/packem_shared/{DkimSigner-CiLBaXrg.js → DkimSigner-sLcIw9bp.js} +6 -6
  14. package/dist/packem_shared/{DraftMailMessage-CGTVuy2z.js → DraftMailMessage-C3YTXqWo.js} +1 -1
  15. package/dist/packem_shared/EmailError-CDvYwuqz.js +1 -0
  16. package/dist/packem_shared/{Mail-CYAwMRnX.js → Mail-CIyxkmxu.js} +1 -1
  17. package/dist/packem_shared/MailMessage-DuEXJiCg.js +1 -0
  18. package/dist/packem_shared/{RequiredOptionError-DuNNY_a5.js → RequiredOptionError-DU2lxzk3.js} +1 -1
  19. package/dist/packem_shared/SmimeEncrypter-CzTbQM-z.js +6 -0
  20. package/dist/packem_shared/SmimeSigner-DjLShaOw.js +8 -0
  21. package/dist/packem_shared/{ahaSendProvider-DSuZIzaQ.js → ahaSendProvider-br1yB2un.js} +1 -1
  22. package/dist/packem_shared/arcMessageSignatureBase-D54jQIWu.js +17 -0
  23. package/dist/packem_shared/attachment-processor-D1cbAhQi.js +1 -0
  24. package/dist/packem_shared/{autoSendProvider-DqAoelWR.js → autoSendProvider-BSP8ueOC.js} +1 -1
  25. package/dist/packem_shared/{awsSesProvider-ClK1FUln.js → awsSesProvider-zRICW1pH.js} +13 -13
  26. package/dist/packem_shared/azureProvider-DwN4c5dC.js +1 -0
  27. package/dist/packem_shared/{brevoProvider-CIzuIDlt.js → brevoProvider-C491beE_.js} +1 -1
  28. package/dist/packem_shared/{build-mime-message-BW5FQ2Bt.js → build-mime-message-DT67qfMp.js} +1 -1
  29. package/dist/packem_shared/{circuitBreakerMiddleware-D2SA_07f.js → circuitBreakerMiddleware-N0CKF90q.js} +1 -1
  30. package/dist/packem_shared/{cloudflareEmailProvider-B8mOEl3N.js → cloudflareEmailProvider-8JxzLbpX.js} +1 -1
  31. package/dist/packem_shared/{createTestEmail-f12yLlWn.js → createTestEmail-D_ksEez3.js} +1 -1
  32. package/dist/packem_shared/dedupeMiddleware-CYYI_O7S.js +1 -0
  33. package/dist/packem_shared/{detectMimeType-DFH3kp6K.js → detectMimeType-CmYmWDXE.js} +1 -1
  34. package/dist/packem_shared/event-bus.d-BNQA-FZE.d.ts +104 -0
  35. package/dist/packem_shared/{failoverProvider-BgX6zfnY.js → failoverProvider-6qwE_HSJ.js} +1 -1
  36. package/dist/packem_shared/generate-boundary-0xGe9GqK.js +1 -0
  37. package/dist/packem_shared/{httpProvider-aBfTXyCT.js → httpProvider-BqrdZhGw.js} +1 -1
  38. package/dist/packem_shared/index-Gd7m-UQA.js +11 -0
  39. package/dist/packem_shared/{infobipProvider-DxzsONUX.js → infobipProvider-C2FU6VMP.js} +1 -1
  40. package/dist/packem_shared/isValidSigningCertUrl-DNxPA0Q-.js +3 -0
  41. package/dist/packem_shared/{loopsProvider-QBsAH6Ee.js → loopsProvider-Bz63so6m.js} +1 -1
  42. package/dist/packem_shared/mail.d-xKtvoKMK.d.ts +909 -0
  43. package/dist/packem_shared/{mailCrabProvider-DRE5snM9.js → mailCrabProvider-bkQy-2a1.js} +1 -1
  44. package/dist/packem_shared/{mailPaceProvider-DCa-4ghl.js → mailPaceProvider-S1AB-AYq.js} +1 -1
  45. package/dist/packem_shared/{mailchannelsProvider-GiwkYBdD.js → mailchannelsProvider-B_K6X4VY.js} +1 -1
  46. package/dist/packem_shared/{mailerSendProvider-RK6IbUrL.js → mailerSendProvider-DPEww2H1.js} +1 -1
  47. package/dist/packem_shared/mailgunProvider-DKxzVbDW.js +1 -0
  48. package/dist/packem_shared/mailjetProvider-C2TQcujL.js +1 -0
  49. package/dist/packem_shared/{mailomatProvider-DPDpVS8r.js → mailomatProvider-B8-5bQsu.js} +1 -1
  50. package/dist/packem_shared/{mailtrapProvider-DtrS4Q34.js → mailtrapProvider-DW7TLOdG.js} +1 -1
  51. package/dist/packem_shared/{make-request-B9XjBynA.js → make-request-CylyuRaN.js} +1 -1
  52. package/dist/packem_shared/{mandrillProvider-B84zH-eV.js → mandrillProvider-S-0lKNGd.js} +1 -1
  53. package/dist/packem_shared/{mockProvider-Behywbl1.js → mockProvider-BAl292mW.js} +1 -1
  54. package/dist/packem_shared/{netcoreProvider-D-wtCyJj.js → netcoreProvider-DajMprlo.js} +1 -1
  55. package/dist/packem_shared/{nodemailerProvider-BFHobXxt.js → nodemailerProvider-DRo0lJ6g.js} +1 -1
  56. package/dist/packem_shared/{opentelemetryProvider-ByHC01ub.js → opentelemetryProvider-C6spx2CD.js} +1 -1
  57. package/dist/packem_shared/{outlook365Provider-Btk4Emig.js → outlook365Provider-B0o7UZBW.js} +1 -1
  58. package/dist/packem_shared/{plunkProvider-Bw8e6460.js → plunkProvider-DJzEUEtU.js} +1 -1
  59. package/dist/packem_shared/{postalProvider-CT8zr89z.js → postalProvider-DHFjFE3Y.js} +1 -1
  60. package/dist/packem_shared/{postmarkProvider-CQSqZWDs.js → postmarkProvider-Dt1EGGBA.js} +1 -1
  61. package/dist/packem_shared/{provider-base-C7PuopYK.js → provider-base-DjPzWncP.js} +1 -1
  62. package/dist/packem_shared/{provider.d-J-y6iogK.d.ts → provider.d-Cx5YQJdP.d.ts} +9 -9
  63. package/dist/packem_shared/{resendProvider-drJYlvLP.js → resendProvider-qjI86j_d.js} +1 -1
  64. package/dist/packem_shared/{retry-ipI5DRJ8.js → retry-CG9iT2wF.js} +1 -1
  65. package/dist/packem_shared/{roundRobinProvider-D1by5KGW.js → roundRobinProvider-CO5YvhgR.js} +1 -1
  66. package/dist/packem_shared/{scalewayProvider-DU5gXQrl.js → scalewayProvider-CihQKhw6.js} +1 -1
  67. package/dist/packem_shared/{sendGridProvider-BuTbEXW8.js → sendGridProvider-Dkc5AKlC.js} +1 -1
  68. package/dist/packem_shared/{smtpProvider-5MI3-EPh.js → smtpProvider-CIXMxPu-.js} +12 -12
  69. package/dist/packem_shared/{sparkpostProvider-UAsFYIjP.js → sparkpostProvider-CKxQhpyB.js} +1 -1
  70. package/dist/packem_shared/{sweegoProvider-SUz0LIcA.js → sweegoProvider-DjmAs6La.js} +1 -1
  71. package/dist/packem_shared/{tracer.d-MU42G1jG.d.ts → tracer.d-sb5yrt_n.d.ts} +2 -2
  72. package/dist/packem_shared/types.d-B0t3PQ3t.d.ts +107 -0
  73. package/dist/packem_shared/{types.d-ejzh-xBP.d.ts → types.d-B9295M4_.d.ts} +82 -82
  74. package/dist/packem_shared/types.d-BzoHR9nB.d.ts +61 -0
  75. package/dist/packem_shared/types.d-C5geVKes.d.ts +51 -0
  76. package/dist/packem_shared/types.d-GKqPNk0I.d.ts +24 -0
  77. package/dist/packem_shared/types.d-I-KeZ5w2.d.ts +9 -0
  78. package/dist/packem_shared/types.d-kHO4kX9q.d.ts +69 -0
  79. package/dist/packem_shared/utils-DjEtR3qT.js +1 -0
  80. package/dist/packem_shared/verifyMailgunWebhook-DNk080BF.js +1 -0
  81. package/dist/packem_shared/verifyPostmarkWebhook-B4OIEHQF.js +1 -0
  82. package/dist/packem_shared/verifyResendWebhook-C7E32LZ1.js +1 -0
  83. package/dist/packem_shared/verifySendGridWebhook-1l9bqIMw.js +1 -0
  84. package/dist/packem_shared/withEvents-CytsykaK.js +1 -0
  85. package/dist/packem_shared/{withSuppression-DBaZDMAr.js → withSuppression-BoaO4Qdz.js} +1 -1
  86. package/dist/packem_shared/{zeptomailProvider-DXNX9mG_.js → zeptomailProvider-DSTC9pUi.js} +1 -1
  87. package/dist/providers/ahasend/index.d.ts +18 -18
  88. package/dist/providers/ahasend/index.js +1 -1
  89. package/dist/providers/autosend/index.d.ts +30 -30
  90. package/dist/providers/autosend/index.js +1 -1
  91. package/dist/providers/aws-ses/index.d.ts +20 -20
  92. package/dist/providers/aws-ses/index.js +1 -1
  93. package/dist/providers/azure/index.d.ts +26 -26
  94. package/dist/providers/azure/index.js +1 -1
  95. package/dist/providers/brevo/index.d.ts +35 -35
  96. package/dist/providers/brevo/index.js +1 -1
  97. package/dist/providers/cloudflare-email/index.d.ts +25 -25
  98. package/dist/providers/cloudflare-email/index.js +1 -1
  99. package/dist/providers/failover/index.d.ts +14 -14
  100. package/dist/providers/failover/index.js +1 -1
  101. package/dist/providers/http/index.d.ts +15 -15
  102. package/dist/providers/http/index.js +1 -1
  103. package/dist/providers/infobip/index.d.ts +28 -28
  104. package/dist/providers/infobip/index.js +1 -1
  105. package/dist/providers/loops/index.d.ts +25 -25
  106. package/dist/providers/loops/index.js +1 -1
  107. package/dist/providers/mailchannels/index.d.ts +13 -13
  108. package/dist/providers/mailchannels/index.js +1 -1
  109. package/dist/providers/mailcrab/index.d.ts +17 -17
  110. package/dist/providers/mailcrab/index.js +1 -1
  111. package/dist/providers/mailersend/index.d.ts +24 -24
  112. package/dist/providers/mailersend/index.js +1 -1
  113. package/dist/providers/mailgun/index.d.ts +37 -37
  114. package/dist/providers/mailgun/index.js +1 -1
  115. package/dist/providers/mailjet/index.d.ts +36 -36
  116. package/dist/providers/mailjet/index.js +1 -1
  117. package/dist/providers/mailomat/index.d.ts +20 -20
  118. package/dist/providers/mailomat/index.js +1 -1
  119. package/dist/providers/mailpace/index.d.ts +24 -24
  120. package/dist/providers/mailpace/index.js +1 -1
  121. package/dist/providers/mailtrap/index.d.ts +22 -22
  122. package/dist/providers/mailtrap/index.js +1 -1
  123. package/dist/providers/mandrill/index.d.ts +36 -36
  124. package/dist/providers/mandrill/index.js +1 -1
  125. package/dist/providers/mock/index.d.ts +8 -8
  126. package/dist/providers/mock/index.js +1 -1
  127. package/dist/providers/netcore/index.d.ts +17 -17
  128. package/dist/providers/netcore/index.js +1 -1
  129. package/dist/providers/nodemailer/index.d.ts +22 -22
  130. package/dist/providers/nodemailer/index.js +1 -1
  131. package/dist/providers/opentelemetry/index.d.ts +20 -20
  132. package/dist/providers/opentelemetry/index.js +1 -1
  133. package/dist/providers/outlook365/index.d.ts +82 -82
  134. package/dist/providers/outlook365/index.js +1 -1
  135. package/dist/providers/plunk/index.d.ts +18 -18
  136. package/dist/providers/plunk/index.js +1 -1
  137. package/dist/providers/postal/index.d.ts +24 -24
  138. package/dist/providers/postal/index.js +1 -1
  139. package/dist/providers/postmark/index.d.ts +30 -30
  140. package/dist/providers/postmark/index.js +1 -1
  141. package/dist/providers/resend/index.d.ts +24 -24
  142. package/dist/providers/resend/index.js +1 -1
  143. package/dist/providers/roundrobin/index.d.ts +14 -14
  144. package/dist/providers/roundrobin/index.js +1 -1
  145. package/dist/providers/scaleway/index.d.ts +22 -22
  146. package/dist/providers/scaleway/index.js +1 -1
  147. package/dist/providers/sendgrid/index.d.ts +25 -25
  148. package/dist/providers/sendgrid/index.js +1 -1
  149. package/dist/providers/smtp/index.d.ts +11 -11
  150. package/dist/providers/smtp/index.js +1 -1
  151. package/dist/providers/sparkpost/index.d.ts +21 -21
  152. package/dist/providers/sparkpost/index.js +1 -1
  153. package/dist/providers/sweego/index.d.ts +20 -20
  154. package/dist/providers/sweego/index.js +1 -1
  155. package/dist/providers/zeptomail/index.d.ts +17 -17
  156. package/dist/providers/zeptomail/index.js +1 -1
  157. package/dist/queue/bullmq-queue.d.ts +26 -26
  158. package/dist/queue/index.d.ts +86 -86
  159. package/dist/queue/pg-boss-queue.d.ts +13 -13
  160. package/dist/queue/sqs-queue.d.ts +20 -20
  161. package/dist/queue/unstorage-queue.d.ts +47 -47
  162. package/dist/queue/unstorage-queue.js +1 -1
  163. package/dist/render/cid.d.ts +12 -12
  164. package/dist/render/css-inline.d.ts +12 -12
  165. package/dist/render/css-inline.js +1 -1
  166. package/dist/render/dark-mode.d.ts +12 -12
  167. package/dist/render/preheader.d.ts +16 -16
  168. package/dist/template-engines/handlebars.d.ts +19 -19
  169. package/dist/template-engines/handlebars.js +1 -1
  170. package/dist/template-engines/html-to-text.d.ts +12 -12
  171. package/dist/template-engines/html-to-text.js +1 -1
  172. package/dist/template-engines/i18n.d.ts +43 -43
  173. package/dist/template-engines/i18n.js +1 -1
  174. package/dist/template-engines/jsx-email.d.ts +8 -8
  175. package/dist/template-engines/jsx-email.js +1 -1
  176. package/dist/template-engines/liquid.d.ts +9 -9
  177. package/dist/template-engines/liquid.js +1 -1
  178. package/dist/template-engines/mjml.d.ts +9 -9
  179. package/dist/template-engines/mjml.js +1 -1
  180. package/dist/template-engines/react-email.d.ts +8 -8
  181. package/dist/template-engines/react-email.js +1 -1
  182. package/dist/template-engines/vue-email.d.ts +8 -8
  183. package/dist/template-engines/vue-email.js +1 -1
  184. package/dist/test/index.d.ts +89 -89
  185. package/dist/test/index.js +1 -1
  186. package/dist/utils/cache.d.ts +27 -27
  187. package/dist/utils/format-email-address.d.ts +6 -6
  188. package/dist/utils/format-email-address.js +1 -1
  189. package/dist/utils/normalize-email-aliases.d.ts +19 -19
  190. package/dist/utils/parse-address.d.ts +16 -16
  191. package/dist/utils/parse-eml.d.ts +18 -18
  192. package/dist/utils/result.d.ts +30 -30
  193. package/dist/utils/result.js +1 -1
  194. package/dist/utils/validation/check-feature-support.d.ts +33 -33
  195. package/dist/utils/validation/validate-email.d.ts +4 -4
  196. package/dist/webhooks/index.d.ts +134 -134
  197. package/dist/webhooks/index.js +1 -1
  198. package/package.json +1 -1
  199. package/dist/packem_shared/EmailError-B-sEf3bp.js +0 -1
  200. package/dist/packem_shared/MailMessage-DQRgs5Dz.js +0 -1
  201. package/dist/packem_shared/SmimeEncrypter-DavopRlE.js +0 -6
  202. package/dist/packem_shared/SmimeSigner-0onWksAv.js +0 -8
  203. package/dist/packem_shared/arcMessageSignatureBase-DDLEHW2E.js +0 -17
  204. package/dist/packem_shared/attachment-processor-CMp7qqMI.js +0 -1
  205. package/dist/packem_shared/azureProvider-Cw_Tmde6.js +0 -1
  206. package/dist/packem_shared/dedupeMiddleware-B6ajWOTi.js +0 -1
  207. package/dist/packem_shared/event-bus.d-DEl3w_EW.d.ts +0 -104
  208. package/dist/packem_shared/generate-boundary-DQbzDiOI.js +0 -1
  209. package/dist/packem_shared/index-BoZvzveg.js +0 -11
  210. package/dist/packem_shared/isValidSigningCertUrl-Bii1AMGC.js +0 -3
  211. package/dist/packem_shared/mail.d-B9SSqyy0.d.ts +0 -909
  212. package/dist/packem_shared/mailgunProvider-D9HUWGKN.js +0 -1
  213. package/dist/packem_shared/mailjetProvider-DelLs2Vt.js +0 -1
  214. package/dist/packem_shared/types.d-BId55FW2.d.ts +0 -107
  215. package/dist/packem_shared/types.d-CmoWvdZi.d.ts +0 -61
  216. package/dist/packem_shared/types.d-DCkecJse.d.ts +0 -51
  217. package/dist/packem_shared/types.d-Mpu0HZoG.d.ts +0 -24
  218. package/dist/packem_shared/types.d-lcJZmwRK.d.ts +0 -69
  219. package/dist/packem_shared/types.d-nyR1ty1Q.d.ts +0 -9
  220. package/dist/packem_shared/utils-BfYfPB_I.js +0 -1
  221. package/dist/packem_shared/verifyMailgunWebhook-Cwl0OD3P.js +0 -1
  222. package/dist/packem_shared/verifyPostmarkWebhook-C72ZvbrG.js +0 -1
  223. package/dist/packem_shared/verifyResendWebhook-YK2zNDXR.js +0 -1
  224. package/dist/packem_shared/verifySendGridWebhook-Dbwc1tfG.js +0 -1
  225. package/dist/packem_shared/withEvents-CCVblSqj.js +0 -1
@@ -1,49 +1,49 @@
1
1
  /**
2
- * Generic cache interface for caching any type of data.
3
- * Implementations can use in-memory cache, LRU cache, Redis, etc.
4
- */
2
+ * Generic cache interface for caching any type of data.
3
+ * Implementations can use in-memory cache, LRU cache, Redis, etc.
4
+ */
5
5
  interface Cache<T = unknown> {
6
6
  /**
7
- * Clears all cached entries.
8
- */
7
+ * Clears all cached entries.
8
+ */
9
9
  clear: () => Promise<void>;
10
10
  /**
11
- * Deletes a cached entry.
12
- * @param key The cache key.
13
- */
11
+ * Deletes a cached entry.
12
+ * @param key The cache key.
13
+ */
14
14
  delete: (key: string) => Promise<void>;
15
15
  /**
16
- * Gets a cached value.
17
- * @param key The cache key.
18
- * @returns The cached value or undefined if not found or expired.
19
- */
16
+ * Gets a cached value.
17
+ * @param key The cache key.
18
+ * @returns The cached value or undefined if not found or expired.
19
+ */
20
20
  get: (key: string) => Promise<T | undefined>;
21
21
  /**
22
- * Sets a cached value.
23
- * @param key The cache key.
24
- * @param value The value to cache.
25
- * @param ttl Time-to-live in milliseconds.
26
- */
22
+ * Sets a cached value.
23
+ * @param key The cache key.
24
+ * @param value The value to cache.
25
+ * @param ttl Time-to-live in milliseconds.
26
+ */
27
27
  set: (key: string, value: T, ttl: number) => Promise<void>;
28
28
  }
29
29
  /**
30
- * Options for creating an in-memory cache.
31
- */
30
+ * Options for creating an in-memory cache.
31
+ */
32
32
  interface InMemoryCacheOptions {
33
33
  /**
34
- * Maximum number of entries in the cache.
35
- * @default 500
36
- */
34
+ * Maximum number of entries in the cache.
35
+ * @default 500
36
+ */
37
37
  max?: number;
38
38
  /**
39
- * Default TTL in milliseconds for entries.
40
- * @default 3600000 (1 hour)
41
- */
39
+ * Default TTL in milliseconds for entries.
40
+ * @default 3600000 (1 hour)
41
+ */
42
42
  ttl?: number;
43
43
  }
44
44
  /**
45
- * Default in-memory cache implementation using LRU cache.
46
- */
45
+ * Default in-memory cache implementation using LRU cache.
46
+ */
47
47
  declare class InMemoryCache<T extends object = Record<string, unknown>> implements Cache<T> {
48
48
  private readonly cache;
49
49
  constructor(options?: InMemoryCacheOptions);
@@ -1,10 +1,10 @@
1
- import { c as EmailAddress } from "../packem_shared/types.d-ejzh-xBP.js";
1
+ import { c as EmailAddress } from "../packem_shared/types.d-B9295M4_.js";
2
2
  import 'node:buffer';
3
3
  /**
4
- * Formats an email address as "Name &lt;email@example.com>" or just "email@example.com" if no name is provided.
5
- * @param address The email address object to format.
6
- * @returns The formatted email address string in RFC 5322 format.
7
- * @throws {EmailError} When the email address is invalid.
8
- */
4
+ * Formats an email address as "Name &lt;email@example.com>" or just "email@example.com" if no name is provided.
5
+ * @param address The email address object to format.
6
+ * @returns The formatted email address string in RFC 5322 format.
7
+ * @throws {EmailError} When the email address is invalid.
8
+ */
9
9
  declare const formatEmailAddress: (address: EmailAddress) => string;
10
10
  export { formatEmailAddress as default };
@@ -1 +1 @@
1
- import{s as m}from"../packem_shared/format-address-DTl-9O70.js";import r from"../packem_shared/EmailError-B-sEf3bp.js";import i from"./validation/validate-email.js";const n=a=>{if(!i(a.email))throw new r("email",`Invalid email address: ${a.email}`);if(a.name){const e=m(a.name);if(e)return`"${e}" <${a.email}>`}return a.email};export{n as default};
1
+ import{s as m}from"../packem_shared/format-address-DTl-9O70.js";import r from"../packem_shared/EmailError-CDvYwuqz.js";import i from"./validation/validate-email.js";const n=a=>{if(!i(a.email))throw new r("email",`Invalid email address: ${a.email}`);if(a.name){const e=m(a.name);if(e)return`"${e}" <${a.email}>`}return a.email};export{n as default};
@@ -1,22 +1,22 @@
1
1
  /**
2
- * Normalizes email aliases for supported email providers.
3
- * For example: example@gmail.com and example+another@gmail.com point to the same email address.
4
- * This function normalizes aliases to their canonical form.
5
- *
6
- * Supported providers:
7
- * - Gmail: Removes dots and plus aliases (example+test@gmail.com → example@gmail.com)
8
- * - Yahoo, Outlook, Hotmail, Live, MSN, iCloud, ProtonMail, Zoho, FastMail, Mail.com, GMX: Removes plus aliases only
9
- * @param email The email address to normalize.
10
- * @returns The normalized email address, or the original email if not supported or invalid.
11
- * @example
12
- * ```ts
13
- * import { normalizeEmailAliases } from "@visulima/email/utils/normalize-email-aliases";
14
- *
15
- * normalizeEmailAliases("example+test@gmail.com"); // "example@gmail.com"
16
- * normalizeEmailAliases("ex.ample@gmail.com"); // "example@gmail.com"
17
- * normalizeEmailAliases("user+tag@yahoo.com"); // "user@yahoo.com"
18
- * normalizeEmailAliases("user@example.com"); // "user@example.com" (unchanged)
19
- * ```
20
- */
2
+ * Normalizes email aliases for supported email providers.
3
+ * For example: example@gmail.com and example+another@gmail.com point to the same email address.
4
+ * This function normalizes aliases to their canonical form.
5
+ *
6
+ * Supported providers:
7
+ * - Gmail: Removes dots and plus aliases (example+test@gmail.com → example@gmail.com)
8
+ * - Yahoo, Outlook, Hotmail, Live, MSN, iCloud, ProtonMail, Zoho, FastMail, Mail.com, GMX: Removes plus aliases only
9
+ * @param email The email address to normalize.
10
+ * @returns The normalized email address, or the original email if not supported or invalid.
11
+ * @example
12
+ * ```ts
13
+ * import { normalizeEmailAliases } from "@visulima/email/utils/normalize-email-aliases";
14
+ *
15
+ * normalizeEmailAliases("example+test@gmail.com"); // "example@gmail.com"
16
+ * normalizeEmailAliases("ex.ample@gmail.com"); // "example@gmail.com"
17
+ * normalizeEmailAliases("user+tag@yahoo.com"); // "user@yahoo.com"
18
+ * normalizeEmailAliases("user@example.com"); // "user@example.com" (unchanged)
19
+ * ```
20
+ */
21
21
  declare const normalizeEmailAliases: (email: string) => string;
22
22
  export { normalizeEmailAliases as default };
@@ -1,20 +1,20 @@
1
- import { c as EmailAddress } from "../packem_shared/types.d-ejzh-xBP.js";
1
+ import { c as EmailAddress } from "../packem_shared/types.d-B9295M4_.js";
2
2
  import 'node:buffer';
3
3
  /**
4
- * Parses a string representation of an email address into an EmailAddress object.
5
- * Supports formats: "email@example.com", "Name &lt;email@example.com>", "&lt;email@example.com>".
6
- * @example Parsing an address with a name
7
- * ```ts
8
- * const address = parseAddress("John Doe <john@example.com>");
9
- * // { name: "John Doe", email: "john@example.com" }
10
- * ```
11
- * @example Parsing an address without a name
12
- * ```ts
13
- * const address = parseAddress("jane@example.com");
14
- * // { email: "jane@example.com" }
15
- * ```
16
- * @param address The string representation of the address to parse.
17
- * @returns An EmailAddress object if parsing is successful, or undefined if invalid.
18
- */
4
+ * Parses a string representation of an email address into an EmailAddress object.
5
+ * Supports formats: "email@example.com", "Name &lt;email@example.com>", "&lt;email@example.com>".
6
+ * @example Parsing an address with a name
7
+ * ```ts
8
+ * const address = parseAddress("John Doe <john@example.com>");
9
+ * // { name: "John Doe", email: "john@example.com" }
10
+ * ```
11
+ * @example Parsing an address without a name
12
+ * ```ts
13
+ * const address = parseAddress("jane@example.com");
14
+ * // { email: "jane@example.com" }
15
+ * ```
16
+ * @param address The string representation of the address to parse.
17
+ * @returns An EmailAddress object if parsing is successful, or undefined if invalid.
18
+ */
19
19
  declare const parseAddress: (address: string) => EmailAddress | undefined;
20
20
  export { parseAddress as default };
@@ -1,22 +1,22 @@
1
- import { E as EmailOptions } from "../packem_shared/types.d-ejzh-xBP.js";
1
+ import { E as EmailOptions } from "../packem_shared/types.d-B9295M4_.js";
2
2
  import 'node:buffer';
3
3
  /**
4
- * Parses a raw EML / RFC 5322 MIME message back into {@link EmailOptions}.
5
- *
6
- * This closes the round-trip story for {@link "../mail".Mail.draft}: serialise a
7
- * message to EML, persist/transmit it, then `parseEml()` it back into options you
8
- * can hand to `mail.send()`. It understands the multipart layout produced by this
9
- * library's own `buildMimeMessage` (text/plain + text/html parts, quoted-printable
10
- * and base64 transfer encodings, RFC 2047 encoded headers) and common
11
- * single-part messages.
12
- *
13
- * Scope: it extracts `from`, `to`, `cc`, `bcc`, `replyTo`, `subject`, `text`,
14
- * `html`, `priority`, and remaining custom `headers`. Attachment bodies are not
15
- * decoded into {@link "../types".Attachment} objects (use a full MIME parser such
16
- * as `mailparser` for that); attachment parts are skipped.
17
- * @param eml The raw EML/MIME message string.
18
- * @returns The parsed email options.
19
- * @throws {Error} When the message has no `From` or `To`/`Cc`/`Bcc` recipient and therefore cannot satisfy the required {@link EmailOptions} shape.
20
- */
4
+ * Parses a raw EML / RFC 5322 MIME message back into {@link EmailOptions}.
5
+ *
6
+ * This closes the round-trip story for {@link "../mail".Mail.draft}: serialise a
7
+ * message to EML, persist/transmit it, then `parseEml()` it back into options you
8
+ * can hand to `mail.send()`. It understands the multipart layout produced by this
9
+ * library's own `buildMimeMessage` (text/plain + text/html parts, quoted-printable
10
+ * and base64 transfer encodings, RFC 2047 encoded headers) and common
11
+ * single-part messages.
12
+ *
13
+ * Scope: it extracts `from`, `to`, `cc`, `bcc`, `replyTo`, `subject`, `text`,
14
+ * `html`, `priority`, and remaining custom `headers`. Attachment bodies are not
15
+ * decoded into {@link "../types".Attachment} objects (use a full MIME parser such
16
+ * as `mailparser` for that); attachment parts are skipped.
17
+ * @param eml The raw EML/MIME message string.
18
+ * @returns The parsed email options.
19
+ * @throws {Error} When the message has no `From` or `To`/`Cc`/`Bcc` recipient and therefore cannot satisfy the required {@link EmailOptions} shape.
20
+ */
21
21
  declare const parseEml: (eml: string) => EmailOptions;
22
22
  export { parseEml as default };
@@ -1,49 +1,49 @@
1
- import { R as Result } from "../packem_shared/types.d-ejzh-xBP.js";
1
+ import { R as Result } from "../packem_shared/types.d-B9295M4_.js";
2
2
  import 'node:buffer';
3
3
  /**
4
- * A successful {@link Result} with its data narrowed to be present.
5
- */
4
+ * A successful {@link Result} with its data narrowed to be present.
5
+ */
6
6
  type OkResult<T> = Result<T> & {
7
7
  data: T;
8
8
  success: true;
9
9
  };
10
10
  /**
11
- * Returns whether a {@link Result} succeeded, narrowing `data` to be present.
12
- * @param result The result to test.
13
- * @returns `true` when the result is successful.
14
- */
11
+ * Returns whether a {@link Result} succeeded, narrowing `data` to be present.
12
+ * @param result The result to test.
13
+ * @returns `true` when the result is successful.
14
+ */
15
15
  declare const isOk: <T>(result: Result<T>) => result is OkResult<T>;
16
16
  /**
17
- * Returns whether a {@link Result} failed.
18
- * @param result The result to test.
19
- * @returns `true` when the result is a failure.
20
- */
17
+ * Returns whether a {@link Result} failed.
18
+ * @param result The result to test.
19
+ * @returns `true` when the result is a failure.
20
+ */
21
21
  declare const isErr: <T>(result: Result<T>) => boolean;
22
22
  /**
23
- * Returns the data of a successful {@link Result}, or throws its error.
24
- * @param result The result to unwrap.
25
- * @returns The contained data.
26
- * @throws {EmailError} The result's error (wrapped when it is not already an `Error`).
27
- */
23
+ * Returns the data of a successful {@link Result}, or throws its error.
24
+ * @param result The result to unwrap.
25
+ * @returns The contained data.
26
+ * @throws {EmailError} The result's error (wrapped when it is not already an `Error`).
27
+ */
28
28
  declare const unwrap: <T>(result: Result<T>) => T;
29
29
  /**
30
- * Returns the data of a successful {@link Result}, or a fallback when it failed.
31
- * @param result The result to unwrap.
32
- * @param fallback The value to return on failure.
33
- * @returns The data, or the fallback.
34
- */
30
+ * Returns the data of a successful {@link Result}, or a fallback when it failed.
31
+ * @param result The result to unwrap.
32
+ * @param fallback The value to return on failure.
33
+ * @returns The data, or the fallback.
34
+ */
35
35
  declare const unwrapOr: <T>(result: Result<T>, fallback: T) => T;
36
36
  /**
37
- * Maps the data of a successful {@link Result}, passing failures through unchanged.
38
- * @param result The result to map.
39
- * @param function_ The mapper applied to the data on success.
40
- * @returns A new result with the mapped data, or the original failure.
41
- */
37
+ * Maps the data of a successful {@link Result}, passing failures through unchanged.
38
+ * @param result The result to map.
39
+ * @param function_ The mapper applied to the data on success.
40
+ * @returns A new result with the mapped data, or the original failure.
41
+ */
42
42
  declare const mapOk: <T, U>(result: Result<T>, function_: (data: T) => U) => Result<U>;
43
43
  /**
44
- * Runs an async function and captures its outcome as a {@link Result}, never throwing.
45
- * @param function_ The async function to run.
46
- * @returns A successful result with the value, or a failed result with the thrown error.
47
- */
44
+ * Runs an async function and captures its outcome as a {@link Result}, never throwing.
45
+ * @param function_ The async function to run.
46
+ * @returns A successful result with the value, or a failed result with the thrown error.
47
+ */
48
48
  declare const tryAsync: <T>(function_: () => Promise<T>) => Promise<Result<T>>;
49
49
  export { OkResult, isErr, isOk, mapOk, tryAsync, unwrap, unwrapOr };
@@ -1 +1 @@
1
- import e from"../packem_shared/EmailError-B-sEf3bp.js";const c=s=>s.success,t=s=>!s.success,u=s=>{if(s.success)return s.data;throw s.error instanceof Error?s.error:new e("result","Called unwrap() on a failed result",{cause:s.error})},o=(s,r)=>s.success?s.data:r,n=(s,r)=>s.success?{data:r(s.data),success:!0}:{error:s.error,success:!1},d=async s=>{try{return{data:await s(),success:!0}}catch(r){return{error:r,success:!1}}};export{t as isErr,c as isOk,n as mapOk,d as tryAsync,u as unwrap,o as unwrapOr};
1
+ import e from"../packem_shared/EmailError-CDvYwuqz.js";const c=s=>s.success,t=s=>!s.success,u=s=>{if(s.success)return s.data;throw s.error instanceof Error?s.error:new e("result","Called unwrap() on a failed result",{cause:s.error})},o=(s,r)=>s.success?s.data:r,n=(s,r)=>s.success?{data:r(s.data),success:!0}:{error:s.error,success:!1},d=async s=>{try{return{data:await s(),success:!0}}catch(r){return{error:r,success:!1}}};export{t as isErr,c as isOk,n as mapOk,d as tryAsync,u as unwrap,o as unwrapOr};
@@ -1,53 +1,53 @@
1
- import { F as FeatureFlags, E as EmailOptions } from "../../packem_shared/types.d-ejzh-xBP.js";
1
+ import { F as FeatureFlags, E as EmailOptions } from "../../packem_shared/types.d-B9295M4_.js";
2
2
  import 'node:buffer';
3
3
  /**
4
- * A single capability that a message uses but the target provider cannot represent.
5
- */
4
+ * A single capability that a message uses but the target provider cannot represent.
5
+ */
6
6
  interface FeatureViolation {
7
7
  /**
8
- * The provider capability flag that is not supported.
9
- */
8
+ * The provider capability flag that is not supported.
9
+ */
10
10
  feature: keyof FeatureFlags;
11
11
  /**
12
- * The message field that triggered the check.
13
- */
12
+ * The message field that triggered the check.
13
+ */
14
14
  field: string;
15
15
  /**
16
- * Human-readable explanation of the violation.
17
- */
16
+ * Human-readable explanation of the violation.
17
+ */
18
18
  message: string;
19
19
  }
20
20
  /**
21
- * Result of a fail-fast provider capability check.
22
- */
21
+ * Result of a fail-fast provider capability check.
22
+ */
23
23
  interface FeatureSupportResult {
24
24
  /**
25
- * True when the message uses no capability the provider has explicitly disabled.
26
- */
25
+ * True when the message uses no capability the provider has explicitly disabled.
26
+ */
27
27
  supported: boolean;
28
28
  /**
29
- * The list of capabilities the message uses that the provider cannot represent.
30
- */
29
+ * The list of capabilities the message uses that the provider cannot represent.
30
+ */
31
31
  violations: FeatureViolation[];
32
32
  }
33
33
  /**
34
- * Performs a fail-fast field-support check for a message against a provider's declared capabilities.
35
- *
36
- * A capability counts as a violation only when the message actually uses it **and** the provider
37
- * has explicitly declared it unsupported (`features[capability] === false`). Capabilities left
38
- * `undefined` are treated as "unknown" and never raise a violation, so providers that publish a
39
- * partial (or no) {@link FeatureFlags} map are never falsely rejected.
40
- * @param options The normalized email options about to be sent.
41
- * @param features The target provider's declared capabilities. When omitted the check is a no-op.
42
- * @returns A {@link FeatureSupportResult} describing any unsupported capabilities in use.
43
- * @example
44
- * ```ts
45
- * const { supported, violations } = checkFeatureSupport(message, provider.features);
46
- *
47
- * if (!supported) {
48
- * throw new Error(violations.map((v) => v.message).join(", "));
49
- * }
50
- * ```
51
- */
34
+ * Performs a fail-fast field-support check for a message against a provider's declared capabilities.
35
+ *
36
+ * A capability counts as a violation only when the message actually uses it **and** the provider
37
+ * has explicitly declared it unsupported (`features[capability] === false`). Capabilities left
38
+ * `undefined` are treated as "unknown" and never raise a violation, so providers that publish a
39
+ * partial (or no) {@link FeatureFlags} map are never falsely rejected.
40
+ * @param options The normalized email options about to be sent.
41
+ * @param features The target provider's declared capabilities. When omitted the check is a no-op.
42
+ * @returns A {@link FeatureSupportResult} describing any unsupported capabilities in use.
43
+ * @example
44
+ * ```ts
45
+ * const { supported, violations } = checkFeatureSupport(message, provider.features);
46
+ *
47
+ * if (!supported) {
48
+ * throw new Error(violations.map((v) => v.message).join(", "));
49
+ * }
50
+ * ```
51
+ */
52
52
  declare function checkFeatureSupport(options: EmailOptions, features?: FeatureFlags): FeatureSupportResult;
53
53
  export { FeatureSupportResult, FeatureViolation, checkFeatureSupport as default };
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Validates an email address format according to basic RFC standards.
3
- * @param email The email address string to validate.
4
- * @returns True if the email address is valid, false otherwise.
5
- */
2
+ * Validates an email address format according to basic RFC standards.
3
+ * @param email The email address string to validate.
4
+ * @returns True if the email address is valid, false otherwise.
5
+ */
6
6
  declare const validateEmail: (email: string) => boolean;
7
7
  export { validateEmail as default };