@visulima/email 2.1.6 → 2.1.8

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 (230) hide show
  1. package/CHANGELOG.md +15 -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-udCl3JXO.js} +6 -6
  14. package/dist/packem_shared/{DraftMailMessage-CGTVuy2z.js → DraftMailMessage-BgP1OF1G.js} +1 -1
  15. package/dist/packem_shared/EmailError-2CCyVX1S.js +1 -0
  16. package/dist/packem_shared/Mail-DduRntbB.js +1 -0
  17. package/dist/packem_shared/MailMessage-BRBT4Jea.js +1 -0
  18. package/dist/packem_shared/{RequiredOptionError-DuNNY_a5.js → RequiredOptionError-BmpC5whN.js} +1 -1
  19. package/dist/packem_shared/SmimeEncrypter-Dm9McVTQ.js +6 -0
  20. package/dist/packem_shared/SmimeSigner-B6hkacNk.js +8 -0
  21. package/dist/packem_shared/{address-formatter-BWR2Dddx.js → address-formatter-bfmGfQ83.js} +1 -1
  22. package/dist/packem_shared/{ahaSendProvider-DSuZIzaQ.js → ahaSendProvider-C6nBGCCa.js} +1 -1
  23. package/dist/packem_shared/arcMessageSignatureBase-B2uArM48.js +17 -0
  24. package/dist/packem_shared/attachment-processor-DjbjtJ6H.js +1 -0
  25. package/dist/packem_shared/{autoSendProvider-DqAoelWR.js → autoSendProvider-Dhig--Zo.js} +1 -1
  26. package/dist/packem_shared/{awsSesProvider-ClK1FUln.js → awsSesProvider-CMqAmU5N.js} +13 -13
  27. package/dist/packem_shared/azureProvider-C-bNOOil.js +1 -0
  28. package/dist/packem_shared/{brevoProvider-CIzuIDlt.js → brevoProvider-CkOjDyir.js} +1 -1
  29. package/dist/packem_shared/build-mime-message-t8KYiQkO.js +3 -0
  30. package/dist/packem_shared/{circuitBreakerMiddleware-D2SA_07f.js → circuitBreakerMiddleware-BSCPR72q.js} +1 -1
  31. package/dist/packem_shared/{cloudflareEmailProvider-B8mOEl3N.js → cloudflareEmailProvider-RCixPWnY.js} +1 -1
  32. package/dist/packem_shared/{createTestEmail-f12yLlWn.js → createTestEmail-XiF5E8vJ.js} +1 -1
  33. package/dist/packem_shared/dedupeMiddleware-CYYI_O7S.js +1 -0
  34. package/dist/packem_shared/{detectMimeType-DFH3kp6K.js → detectMimeType-B9_7ujpC.js} +1 -1
  35. package/dist/packem_shared/event-bus.d-BNQA-FZE.d.ts +104 -0
  36. package/dist/packem_shared/{failoverProvider-BgX6zfnY.js → failoverProvider-BkOOP7pt.js} +1 -1
  37. package/dist/packem_shared/generate-boundary-0xGe9GqK.js +1 -0
  38. package/dist/packem_shared/{httpProvider-aBfTXyCT.js → httpProvider-6idLfv-f.js} +1 -1
  39. package/dist/packem_shared/index-y0s2wQdc.js +11 -0
  40. package/dist/packem_shared/{infobipProvider-DxzsONUX.js → infobipProvider-CHHsqRXy.js} +1 -1
  41. package/dist/packem_shared/isValidSigningCertUrl-D7PuiRW4.js +3 -0
  42. package/dist/packem_shared/{loopsProvider-QBsAH6Ee.js → loopsProvider-Cl-dOuCN.js} +1 -1
  43. package/dist/packem_shared/mail.d-B9JyPxzq.d.ts +910 -0
  44. package/dist/packem_shared/{mailCrabProvider-DRE5snM9.js → mailCrabProvider-De2YxPlF.js} +1 -1
  45. package/dist/packem_shared/{mailPaceProvider-DCa-4ghl.js → mailPaceProvider-DwNTuFb2.js} +1 -1
  46. package/dist/packem_shared/{mailchannelsProvider-GiwkYBdD.js → mailchannelsProvider-Dwl0Typz.js} +1 -1
  47. package/dist/packem_shared/{mailerSendProvider-RK6IbUrL.js → mailerSendProvider-CyMIbqGq.js} +1 -1
  48. package/dist/packem_shared/mailgunProvider-DWKJYRKT.js +1 -0
  49. package/dist/packem_shared/mailjetProvider-DXPJQO1G.js +1 -0
  50. package/dist/packem_shared/{mailomatProvider-DPDpVS8r.js → mailomatProvider-DopZk27y.js} +1 -1
  51. package/dist/packem_shared/{mailtrapProvider-DtrS4Q34.js → mailtrapProvider-CTg4z3GN.js} +1 -1
  52. package/dist/packem_shared/{make-request-B9XjBynA.js → make-request-CDhxj-9b.js} +1 -1
  53. package/dist/packem_shared/{mandrillProvider-B84zH-eV.js → mandrillProvider-CAQeMtU_.js} +1 -1
  54. package/dist/packem_shared/{mockProvider-Behywbl1.js → mockProvider-EcpYlg-_.js} +1 -1
  55. package/dist/packem_shared/{netcoreProvider-D-wtCyJj.js → netcoreProvider-ua1avx07.js} +1 -1
  56. package/dist/packem_shared/{nodemailerProvider-BFHobXxt.js → nodemailerProvider-BZmQfKlM.js} +1 -1
  57. package/dist/packem_shared/{opentelemetryProvider-ByHC01ub.js → opentelemetryProvider-CAfWpywa.js} +1 -1
  58. package/dist/packem_shared/{outlook365Provider-Btk4Emig.js → outlook365Provider-SFYELGDr.js} +1 -1
  59. package/dist/packem_shared/{plunkProvider-Bw8e6460.js → plunkProvider-9amwuQri.js} +1 -1
  60. package/dist/packem_shared/{postalProvider-CT8zr89z.js → postalProvider-CeF3TOIW.js} +1 -1
  61. package/dist/packem_shared/{postmarkProvider-CQSqZWDs.js → postmarkProvider-BPgKEkgF.js} +1 -1
  62. package/dist/packem_shared/{provider-base-C7PuopYK.js → provider-base-B-xhQSqE.js} +1 -1
  63. package/dist/packem_shared/{provider.d-J-y6iogK.d.ts → provider.d-Cx5YQJdP.d.ts} +9 -9
  64. package/dist/packem_shared/{resendProvider-drJYlvLP.js → resendProvider-C9_sM8bH.js} +1 -1
  65. package/dist/packem_shared/{retry-ipI5DRJ8.js → retry-D1Rh-6Z4.js} +1 -1
  66. package/dist/packem_shared/{roundRobinProvider-D1by5KGW.js → roundRobinProvider-BPzLWZf-.js} +1 -1
  67. package/dist/packem_shared/{scalewayProvider-DU5gXQrl.js → scalewayProvider-DfC7275i.js} +1 -1
  68. package/dist/packem_shared/{sendGridProvider-BuTbEXW8.js → sendGridProvider-CUBBHBzs.js} +1 -1
  69. package/dist/packem_shared/smtpProvider-9nBSGtQl.js +27 -0
  70. package/dist/packem_shared/{sparkpostProvider-UAsFYIjP.js → sparkpostProvider-Be_d7S8o.js} +1 -1
  71. package/dist/packem_shared/{sweegoProvider-SUz0LIcA.js → sweegoProvider-CP1cNC-d.js} +1 -1
  72. package/dist/packem_shared/{tracer.d-MU42G1jG.d.ts → tracer.d-sb5yrt_n.d.ts} +2 -2
  73. package/dist/packem_shared/types.d-B0t3PQ3t.d.ts +107 -0
  74. package/dist/packem_shared/{types.d-ejzh-xBP.d.ts → types.d-B9295M4_.d.ts} +82 -82
  75. package/dist/packem_shared/types.d-BzoHR9nB.d.ts +61 -0
  76. package/dist/packem_shared/types.d-C5geVKes.d.ts +51 -0
  77. package/dist/packem_shared/types.d-GKqPNk0I.d.ts +24 -0
  78. package/dist/packem_shared/types.d-I-KeZ5w2.d.ts +9 -0
  79. package/dist/packem_shared/types.d-kHO4kX9q.d.ts +69 -0
  80. package/dist/packem_shared/utils-DjEtR3qT.js +1 -0
  81. package/dist/packem_shared/verifyMailgunWebhook-DNk080BF.js +1 -0
  82. package/dist/packem_shared/verifyPostmarkWebhook-B4OIEHQF.js +1 -0
  83. package/dist/packem_shared/verifyResendWebhook-C7E32LZ1.js +1 -0
  84. package/dist/packem_shared/verifySendGridWebhook-DtFMgBRP.js +1 -0
  85. package/dist/packem_shared/withEvents-CytsykaK.js +1 -0
  86. package/dist/packem_shared/{withSuppression-DBaZDMAr.js → withSuppression-wDl4NTb-.js} +1 -1
  87. package/dist/packem_shared/{zeptomailProvider-DXNX9mG_.js → zeptomailProvider-BZ0fK0Lk.js} +1 -1
  88. package/dist/providers/ahasend/index.d.ts +18 -18
  89. package/dist/providers/ahasend/index.js +1 -1
  90. package/dist/providers/autosend/index.d.ts +30 -30
  91. package/dist/providers/autosend/index.js +1 -1
  92. package/dist/providers/aws-ses/index.d.ts +20 -20
  93. package/dist/providers/aws-ses/index.js +1 -1
  94. package/dist/providers/azure/index.d.ts +26 -26
  95. package/dist/providers/azure/index.js +1 -1
  96. package/dist/providers/brevo/index.d.ts +35 -35
  97. package/dist/providers/brevo/index.js +1 -1
  98. package/dist/providers/cloudflare-email/index.d.ts +25 -25
  99. package/dist/providers/cloudflare-email/index.js +1 -1
  100. package/dist/providers/failover/index.d.ts +14 -14
  101. package/dist/providers/failover/index.js +1 -1
  102. package/dist/providers/http/index.d.ts +15 -15
  103. package/dist/providers/http/index.js +1 -1
  104. package/dist/providers/infobip/index.d.ts +28 -28
  105. package/dist/providers/infobip/index.js +1 -1
  106. package/dist/providers/loops/index.d.ts +25 -25
  107. package/dist/providers/loops/index.js +1 -1
  108. package/dist/providers/mailchannels/index.d.ts +13 -13
  109. package/dist/providers/mailchannels/index.js +1 -1
  110. package/dist/providers/mailcrab/index.d.ts +17 -17
  111. package/dist/providers/mailcrab/index.js +1 -1
  112. package/dist/providers/mailersend/index.d.ts +24 -24
  113. package/dist/providers/mailersend/index.js +1 -1
  114. package/dist/providers/mailgun/index.d.ts +37 -37
  115. package/dist/providers/mailgun/index.js +1 -1
  116. package/dist/providers/mailjet/index.d.ts +36 -36
  117. package/dist/providers/mailjet/index.js +1 -1
  118. package/dist/providers/mailomat/index.d.ts +20 -20
  119. package/dist/providers/mailomat/index.js +1 -1
  120. package/dist/providers/mailpace/index.d.ts +24 -24
  121. package/dist/providers/mailpace/index.js +1 -1
  122. package/dist/providers/mailtrap/index.d.ts +22 -22
  123. package/dist/providers/mailtrap/index.js +1 -1
  124. package/dist/providers/mandrill/index.d.ts +36 -36
  125. package/dist/providers/mandrill/index.js +1 -1
  126. package/dist/providers/mock/index.d.ts +8 -8
  127. package/dist/providers/mock/index.js +1 -1
  128. package/dist/providers/netcore/index.d.ts +17 -17
  129. package/dist/providers/netcore/index.js +1 -1
  130. package/dist/providers/nodemailer/index.d.ts +22 -22
  131. package/dist/providers/nodemailer/index.js +1 -1
  132. package/dist/providers/opentelemetry/index.d.ts +20 -20
  133. package/dist/providers/opentelemetry/index.js +1 -1
  134. package/dist/providers/outlook365/index.d.ts +82 -82
  135. package/dist/providers/outlook365/index.js +1 -1
  136. package/dist/providers/plunk/index.d.ts +18 -18
  137. package/dist/providers/plunk/index.js +1 -1
  138. package/dist/providers/postal/index.d.ts +24 -24
  139. package/dist/providers/postal/index.js +1 -1
  140. package/dist/providers/postmark/index.d.ts +30 -30
  141. package/dist/providers/postmark/index.js +1 -1
  142. package/dist/providers/resend/index.d.ts +24 -24
  143. package/dist/providers/resend/index.js +1 -1
  144. package/dist/providers/roundrobin/index.d.ts +14 -14
  145. package/dist/providers/roundrobin/index.js +1 -1
  146. package/dist/providers/scaleway/index.d.ts +22 -22
  147. package/dist/providers/scaleway/index.js +1 -1
  148. package/dist/providers/sendgrid/index.d.ts +25 -25
  149. package/dist/providers/sendgrid/index.js +1 -1
  150. package/dist/providers/smtp/index.d.ts +11 -11
  151. package/dist/providers/smtp/index.js +1 -1
  152. package/dist/providers/sparkpost/index.d.ts +21 -21
  153. package/dist/providers/sparkpost/index.js +1 -1
  154. package/dist/providers/sweego/index.d.ts +20 -20
  155. package/dist/providers/sweego/index.js +1 -1
  156. package/dist/providers/zeptomail/index.d.ts +17 -17
  157. package/dist/providers/zeptomail/index.js +1 -1
  158. package/dist/queue/bullmq-queue.d.ts +26 -26
  159. package/dist/queue/index.d.ts +86 -86
  160. package/dist/queue/pg-boss-queue.d.ts +13 -13
  161. package/dist/queue/sqs-queue.d.ts +20 -20
  162. package/dist/queue/unstorage-queue.d.ts +47 -47
  163. package/dist/queue/unstorage-queue.js +1 -1
  164. package/dist/render/cid.d.ts +12 -12
  165. package/dist/render/css-inline.d.ts +12 -12
  166. package/dist/render/css-inline.js +1 -1
  167. package/dist/render/dark-mode.d.ts +12 -12
  168. package/dist/render/preheader.d.ts +16 -16
  169. package/dist/template-engines/handlebars.d.ts +19 -19
  170. package/dist/template-engines/handlebars.js +1 -1
  171. package/dist/template-engines/html-to-text.d.ts +12 -12
  172. package/dist/template-engines/html-to-text.js +1 -1
  173. package/dist/template-engines/i18n.d.ts +43 -43
  174. package/dist/template-engines/i18n.js +1 -1
  175. package/dist/template-engines/jsx-email.d.ts +8 -8
  176. package/dist/template-engines/jsx-email.js +1 -1
  177. package/dist/template-engines/liquid.d.ts +9 -9
  178. package/dist/template-engines/liquid.js +1 -1
  179. package/dist/template-engines/mjml.d.ts +9 -9
  180. package/dist/template-engines/mjml.js +1 -1
  181. package/dist/template-engines/react-email.d.ts +8 -8
  182. package/dist/template-engines/react-email.js +1 -1
  183. package/dist/template-engines/vue-email.d.ts +8 -8
  184. package/dist/template-engines/vue-email.js +1 -1
  185. package/dist/test/index.d.ts +89 -89
  186. package/dist/test/index.js +1 -1
  187. package/dist/utils/cache.d.ts +27 -27
  188. package/dist/utils/format-email-address.d.ts +6 -6
  189. package/dist/utils/format-email-address.js +1 -1
  190. package/dist/utils/normalize-email-aliases.d.ts +19 -19
  191. package/dist/utils/parse-address.d.ts +16 -16
  192. package/dist/utils/parse-eml.d.ts +18 -18
  193. package/dist/utils/parse-eml.js +3 -3
  194. package/dist/utils/result.d.ts +30 -30
  195. package/dist/utils/result.js +1 -1
  196. package/dist/utils/validation/check-feature-support.d.ts +33 -33
  197. package/dist/utils/validation/validate-email.d.ts +4 -4
  198. package/dist/webhooks/index.d.ts +134 -134
  199. package/dist/webhooks/index.js +1 -1
  200. package/package.json +1 -1
  201. package/dist/packem_shared/EmailError-B-sEf3bp.js +0 -1
  202. package/dist/packem_shared/Mail-CYAwMRnX.js +0 -1
  203. package/dist/packem_shared/MailMessage-DQRgs5Dz.js +0 -1
  204. package/dist/packem_shared/SmimeEncrypter-DavopRlE.js +0 -6
  205. package/dist/packem_shared/SmimeSigner-0onWksAv.js +0 -8
  206. package/dist/packem_shared/arcMessageSignatureBase-DDLEHW2E.js +0 -17
  207. package/dist/packem_shared/attachment-processor-CMp7qqMI.js +0 -1
  208. package/dist/packem_shared/azureProvider-Cw_Tmde6.js +0 -1
  209. package/dist/packem_shared/build-mime-message-BW5FQ2Bt.js +0 -3
  210. package/dist/packem_shared/dedupeMiddleware-B6ajWOTi.js +0 -1
  211. package/dist/packem_shared/event-bus.d-DEl3w_EW.d.ts +0 -104
  212. package/dist/packem_shared/generate-boundary-DQbzDiOI.js +0 -1
  213. package/dist/packem_shared/index-BoZvzveg.js +0 -11
  214. package/dist/packem_shared/isValidSigningCertUrl-Bii1AMGC.js +0 -3
  215. package/dist/packem_shared/mail.d-B9SSqyy0.d.ts +0 -909
  216. package/dist/packem_shared/mailgunProvider-D9HUWGKN.js +0 -1
  217. package/dist/packem_shared/mailjetProvider-DelLs2Vt.js +0 -1
  218. package/dist/packem_shared/smtpProvider-5MI3-EPh.js +0 -25
  219. package/dist/packem_shared/types.d-BId55FW2.d.ts +0 -107
  220. package/dist/packem_shared/types.d-CmoWvdZi.d.ts +0 -61
  221. package/dist/packem_shared/types.d-DCkecJse.d.ts +0 -51
  222. package/dist/packem_shared/types.d-Mpu0HZoG.d.ts +0 -24
  223. package/dist/packem_shared/types.d-lcJZmwRK.d.ts +0 -69
  224. package/dist/packem_shared/types.d-nyR1ty1Q.d.ts +0 -9
  225. package/dist/packem_shared/utils-BfYfPB_I.js +0 -1
  226. package/dist/packem_shared/verifyMailgunWebhook-Cwl0OD3P.js +0 -1
  227. package/dist/packem_shared/verifyPostmarkWebhook-C72ZvbrG.js +0 -1
  228. package/dist/packem_shared/verifyResendWebhook-YK2zNDXR.js +0 -1
  229. package/dist/packem_shared/verifySendGridWebhook-Dbwc1tfG.js +0 -1
  230. package/dist/packem_shared/withEvents-CCVblSqj.js +0 -1
@@ -1,26 +1,26 @@
1
- import { T as TemplateRenderer } from "../packem_shared/types.d-nyR1ty1Q.js";
1
+ import { T as TemplateRenderer } from "../packem_shared/types.d-I-KeZ5w2.js";
2
2
  /**
3
- * Renders Handlebars template.
4
- * @param template Handlebars template string.
5
- * @param data Data to pass to the template.
6
- * @param options Handlebars compile options.
7
- * @returns Rendered HTML string.
8
- * @throws {TypeError} When template is not a string.
9
- * @throws {EmailError} When Handlebars is not installed or rendering fails.
10
- */
3
+ * Renders Handlebars template.
4
+ * @param template Handlebars template string.
5
+ * @param data Data to pass to the template.
6
+ * @param options Handlebars compile options.
7
+ * @returns Rendered HTML string.
8
+ * @throws {TypeError} When template is not a string.
9
+ * @throws {EmailError} When Handlebars is not installed or rendering fails.
10
+ */
11
11
  declare const renderHandlebars: TemplateRenderer;
12
12
  /**
13
- * Registers a Handlebars helper function for use in templates.
14
- * @param name The name of the helper to register.
15
- * @param helper The helper function to register.
16
- * @throws {EmailError} When Handlebars is not installed.
17
- */
13
+ * Registers a Handlebars helper function for use in templates.
14
+ * @param name The name of the helper to register.
15
+ * @param helper The helper function to register.
16
+ * @throws {EmailError} When Handlebars is not installed.
17
+ */
18
18
  declare const registerHandlebarsHelper: (name: string, helper: unknown) => void;
19
19
  /**
20
- * Registers a Handlebars partial template for reuse in other templates.
21
- * @param name The name of the partial to register.
22
- * @param partial The partial template string to register.
23
- * @throws {EmailError} When Handlebars is not installed.
24
- */
20
+ * Registers a Handlebars partial template for reuse in other templates.
21
+ * @param name The name of the partial to register.
22
+ * @param partial The partial template string to register.
23
+ * @throws {EmailError} When Handlebars is not installed.
24
+ */
25
25
  declare const registerHandlebarsPartial: (name: string, partial: string) => void;
26
26
  export { registerHandlebarsHelper, registerHandlebarsPartial, renderHandlebars };
@@ -1 +1 @@
1
- import t from"handlebars";import s from"../packem_shared/EmailError-B-sEf3bp.js";const i=(a,r,e)=>{try{if(typeof a!="string")throw new TypeError("Handlebars template must be a string");return t.compile(a,e)(r??{})}catch(n){throw n instanceof Error&&n.message.includes("Cannot find module")?new s("handlebars","Handlebars is not installed. Please install it: pnpm add handlebars",{cause:n}):new s("handlebars",`Failed to render Handlebars template: ${n.message}`,{cause:n})}},o=(a,r)=>{try{t.registerHelper(a,r)}catch(e){throw e instanceof Error&&e.message.includes("Cannot find module")?new s("handlebars","Handlebars is not installed. Please install it: pnpm add handlebars",{cause:e}):e}},c=(a,r)=>{try{t.registerPartial(a,r)}catch(e){throw e instanceof Error&&e.message.includes("Cannot find module")?new s("handlebars","Handlebars is not installed. Please install it: pnpm add handlebars",{cause:e}):e}};export{o as registerHandlebarsHelper,c as registerHandlebarsPartial,i as renderHandlebars};
1
+ import t from"handlebars";import s from"../packem_shared/EmailError-2CCyVX1S.js";const i=(a,r,e)=>{try{if(typeof a!="string")throw new TypeError("Handlebars template must be a string");return t.compile(a,e)(r??{})}catch(n){throw n instanceof Error&&n.message.includes("Cannot find module")?new s("handlebars","Handlebars is not installed. Please install it: pnpm add handlebars",{cause:n}):new s("handlebars",`Failed to render Handlebars template: ${n.message}`,{cause:n})}},o=(a,r)=>{try{t.registerHelper(a,r)}catch(e){throw e instanceof Error&&e.message.includes("Cannot find module")?new s("handlebars","Handlebars is not installed. Please install it: pnpm add handlebars",{cause:e}):e}},c=(a,r)=>{try{t.registerPartial(a,r)}catch(e){throw e instanceof Error&&e.message.includes("Cannot find module")?new s("handlebars","Handlebars is not installed. Please install it: pnpm add handlebars",{cause:e}):e}};export{o as registerHandlebarsHelper,c as registerHandlebarsPartial,i as renderHandlebars};
@@ -1,16 +1,16 @@
1
1
  /**
2
- * Converts HTML content to plain text format.
3
- * @param html The HTML string to convert.
4
- * @param options Configuration options for the html-to-text conversion.
5
- * @param options.longWordSplit Options for handling long words that exceed the word wrap limit.
6
- * @param options.longWordSplit.forceWrapOnLimit Whether to force wrap on the limit.
7
- * @param options.longWordSplit.wrapCharacters Characters to use for wrapping.
8
- * @param options.preserveNewlines Whether to preserve newlines in the output.
9
- * @param options.selectors Custom selectors for formatting specific HTML elements.
10
- * @param options.wordwrap The word wrap limit (number of characters) or false to disable.
11
- * @returns The converted plain text string.
12
- * @throws {EmailError} When html-to-text is not installed or conversion fails.
13
- */
2
+ * Converts HTML content to plain text format.
3
+ * @param html The HTML string to convert.
4
+ * @param options Configuration options for the html-to-text conversion.
5
+ * @param options.longWordSplit Options for handling long words that exceed the word wrap limit.
6
+ * @param options.longWordSplit.forceWrapOnLimit Whether to force wrap on the limit.
7
+ * @param options.longWordSplit.wrapCharacters Characters to use for wrapping.
8
+ * @param options.preserveNewlines Whether to preserve newlines in the output.
9
+ * @param options.selectors Custom selectors for formatting specific HTML elements.
10
+ * @param options.wordwrap The word wrap limit (number of characters) or false to disable.
11
+ * @returns The converted plain text string.
12
+ * @throws {EmailError} When html-to-text is not installed or conversion fails.
13
+ */
14
14
  declare const htmlToText: (html: string, options?: {
15
15
  longWordSplit?: {
16
16
  forceWrapOnLimit?: boolean;
@@ -1 +1 @@
1
- import{convert as s}from"html-to-text";import o from"../packem_shared/EmailError-B-sEf3bp.js";const a=(r,e)=>{try{return s(r,{longWordSplit:e?.longWordSplit,preserveNewlines:e?.preserveNewlines??!1,selectors:e?.selectors,wordwrap:e?.wordwrap??80})}catch(t){throw t instanceof Error&&t.message.includes("Cannot find module")?new o("html-to-text","html-to-text is not installed. Please install it: pnpm add html-to-text",{cause:t}):new o("html-to-text",`Failed to convert HTML to text: ${t.message}`,{cause:t})}};export{a as default};
1
+ import{convert as s}from"html-to-text";import o from"../packem_shared/EmailError-2CCyVX1S.js";const a=(r,e)=>{try{return s(r,{longWordSplit:e?.longWordSplit,preserveNewlines:e?.preserveNewlines??!1,selectors:e?.selectors,wordwrap:e?.wordwrap??80})}catch(t){throw t instanceof Error&&t.message.includes("Cannot find module")?new o("html-to-text","html-to-text is not installed. Please install it: pnpm add html-to-text",{cause:t}):new o("html-to-text",`Failed to convert HTML to text: ${t.message}`,{cause:t})}};export{a as default};
@@ -1,61 +1,61 @@
1
- import { T as TemplateRenderer } from "../packem_shared/types.d-nyR1ty1Q.js";
1
+ import { T as TemplateRenderer } from "../packem_shared/types.d-I-KeZ5w2.js";
2
2
  /**
3
- * A map of locale code (e.g. `en`, `en-US`, `de`) to that locale's template.
4
- *
5
- * The template value is whatever the underlying {@link TemplateRenderer} accepts (a string for
6
- * Handlebars/MJML/Liquid, a component for react-email/jsx-email, etc.).
7
- */
3
+ * A map of locale code (e.g. `en`, `en-US`, `de`) to that locale's template.
4
+ *
5
+ * The template value is whatever the underlying {@link TemplateRenderer} accepts (a string for
6
+ * Handlebars/MJML/Liquid, a component for react-email/jsx-email, etc.).
7
+ */
8
8
  type LocaleTemplates = Record<string, unknown>;
9
9
  /**
10
- * Options for {@link renderI18n} and {@link createI18nRenderer}.
11
- */
10
+ * Options for {@link renderI18n} and {@link createI18nRenderer}.
11
+ */
12
12
  interface I18nRenderOptions {
13
13
  /**
14
- * Locale to fall back to when the requested locale (and its language root) is missing.
15
- */
14
+ * Locale to fall back to when the requested locale (and its language root) is missing.
15
+ */
16
16
  defaultLocale?: string;
17
17
  /**
18
- * Options forwarded to the underlying renderer.
19
- */
18
+ * Options forwarded to the underlying renderer.
19
+ */
20
20
  rendererOptions?: Record<string, unknown>;
21
21
  }
22
22
  /**
23
- * Resolves the best-matching available locale key: exact match, then the language subtag
24
- * (`en-US` → `en`), then the default locale.
25
- * @param templates The available locale templates.
26
- * @param locale The requested locale.
27
- * @param defaultLocale Optional fallback locale.
28
- * @returns The matching key, or `undefined` when nothing matches.
29
- */
23
+ * Resolves the best-matching available locale key: exact match, then the language subtag
24
+ * (`en-US` → `en`), then the default locale.
25
+ * @param templates The available locale templates.
26
+ * @param locale The requested locale.
27
+ * @param defaultLocale Optional fallback locale.
28
+ * @returns The matching key, or `undefined` when nothing matches.
29
+ */
30
30
  declare const resolveLocale: (templates: LocaleTemplates, locale: string, defaultLocale?: string) => string | undefined;
31
31
  /**
32
- * Renders the template for a given locale using the supplied engine, with locale fallback.
33
- * @param templates The per-locale templates. See {@link LocaleTemplates}.
34
- * @param locale The requested locale (e.g. `de-AT`).
35
- * @param renderer The underlying template engine (Handlebars, MJML, Liquid, react-email, …).
36
- * @param data Data/variables passed to the renderer.
37
- * @param options Fallback locale and renderer options. See {@link I18nRenderOptions}.
38
- * @returns The rendered output for the resolved locale.
39
- * @throws {EmailError} When no template matches the locale or the fallback.
40
- */
32
+ * Renders the template for a given locale using the supplied engine, with locale fallback.
33
+ * @param templates The per-locale templates. See {@link LocaleTemplates}.
34
+ * @param locale The requested locale (e.g. `de-AT`).
35
+ * @param renderer The underlying template engine (Handlebars, MJML, Liquid, react-email, …).
36
+ * @param data Data/variables passed to the renderer.
37
+ * @param options Fallback locale and renderer options. See {@link I18nRenderOptions}.
38
+ * @returns The rendered output for the resolved locale.
39
+ * @throws {EmailError} When no template matches the locale or the fallback.
40
+ */
41
41
  declare const renderI18n: (templates: LocaleTemplates, locale: string, renderer: TemplateRenderer, data?: Record<string, unknown>, options?: I18nRenderOptions) => Promise<string>;
42
42
  /**
43
- * A locale-resolving renderer produced by {@link createI18nRenderer}.
44
- */
43
+ * A locale-resolving renderer produced by {@link createI18nRenderer}.
44
+ */
45
45
  type LocalizedRenderer = (templates: LocaleTemplates, locale: string, data?: Record<string, unknown>, rendererOptions?: Record<string, unknown>) => Promise<string>;
46
46
  /**
47
- * Creates a reusable localized renderer bound to an engine and default locale.
48
- * @param renderer The underlying template engine.
49
- * @param defaultLocale Optional default/fallback locale applied to every call.
50
- * @returns A {@link LocalizedRenderer}.
51
- * @example
52
- * ```ts
53
- * import { renderHandlebars } from "@visulima/email/template/handlebars";
54
- * import { createI18nRenderer } from "@visulima/email/template/i18n";
55
- *
56
- * const render = createI18nRenderer(renderHandlebars, "en");
57
- * await render({ en: "Hello {{name}}", de: "Hallo {{name}}" }, "de", { name: "Ada" });
58
- * ```
59
- */
47
+ * Creates a reusable localized renderer bound to an engine and default locale.
48
+ * @param renderer The underlying template engine.
49
+ * @param defaultLocale Optional default/fallback locale applied to every call.
50
+ * @returns A {@link LocalizedRenderer}.
51
+ * @example
52
+ * ```ts
53
+ * import { renderHandlebars } from "@visulima/email/template/handlebars";
54
+ * import { createI18nRenderer } from "@visulima/email/template/i18n";
55
+ *
56
+ * const render = createI18nRenderer(renderHandlebars, "en");
57
+ * await render({ en: "Hello {{name}}", de: "Hallo {{name}}" }, "de", { name: "Ada" });
58
+ * ```
59
+ */
60
60
  declare const createI18nRenderer: (renderer: TemplateRenderer, defaultLocale?: string) => LocalizedRenderer;
61
61
  export { I18nRenderOptions, LocaleTemplates, LocalizedRenderer, createI18nRenderer, renderI18n, resolveLocale };
@@ -1 +1 @@
1
- import l from"../packem_shared/EmailError-B-sEf3bp.js";const c=(t,r,a)=>{const n=new Map(Object.keys(t).map(o=>[o.toLowerCase(),o])),e=o=>{if(o!==void 0)return n.get(o.toLowerCase())};return e(r)??e(r.split("-")[0])??e(a)},d=async(t,r,a,n,e)=>{const o=c(t,r,e?.defaultLocale);if(o===void 0)throw new l("i18n",`No template found for locale "${r}"${e?.defaultLocale?` or default "${e.defaultLocale}"`:""}`);return await a(t[o],n,e?.rendererOptions)},f=(t,r)=>(a,n,e,o)=>d(a,n,t,e,{defaultLocale:r,rendererOptions:o});export{f as createI18nRenderer,d as renderI18n,c as resolveLocale};
1
+ import l from"../packem_shared/EmailError-2CCyVX1S.js";const c=(t,r,a)=>{const n=new Map(Object.keys(t).map(o=>[o.toLowerCase(),o])),e=o=>{if(o!==void 0)return n.get(o.toLowerCase())};return e(r)??e(r.split("-")[0])??e(a)},d=async(t,r,a,n,e)=>{const o=c(t,r,e?.defaultLocale);if(o===void 0)throw new l("i18n",`No template found for locale "${r}"${e?.defaultLocale?` or default "${e.defaultLocale}"`:""}`);return await a(t[o],n,e?.rendererOptions)},f=(t,r)=>(a,n,e,o)=>d(a,n,t,e,{defaultLocale:r,rendererOptions:o});export{f as createI18nRenderer,d as renderI18n,c as resolveLocale};
@@ -1,11 +1,11 @@
1
- import { T as TemplateRenderer } from "../packem_shared/types.d-nyR1ty1Q.js";
1
+ import { T as TemplateRenderer } from "../packem_shared/types.d-I-KeZ5w2.js";
2
2
  /**
3
- * Renders a [jsx-email](https://jsx.email/) component to HTML.
4
- * @param template The jsx-email component element to render.
5
- * @param _data Data object (unused; jsx-email components receive props directly).
6
- * @param options Render options (`plainText`, `pretty`).
7
- * @returns The rendered HTML (or plain text) string.
8
- * @throws {EmailError} When `jsx-email` is not installed or rendering fails.
9
- */
3
+ * Renders a [jsx-email](https://jsx.email/) component to HTML.
4
+ * @param template The jsx-email component element to render.
5
+ * @param _data Data object (unused; jsx-email components receive props directly).
6
+ * @param options Render options (`plainText`, `pretty`).
7
+ * @returns The rendered HTML (or plain text) string.
8
+ * @throws {EmailError} When `jsx-email` is not installed or rendering fails.
9
+ */
10
10
  declare const jsxEmail: TemplateRenderer;
11
11
  export { jsxEmail as default };
@@ -1 +1 @@
1
- import t from"../packem_shared/EmailError-B-sEf3bp.js";const l=async(n,s,a)=>{try{const{render:e}=await import("jsx-email");return await e(n,{plainText:a?.plainText,pretty:a?.pretty})}catch(e){throw e instanceof Error&&(e.code==="ERR_MODULE_NOT_FOUND"||e.message.includes("Cannot find module")||e.message.includes("Cannot find package"))?new t("jsx-email","jsx-email is not installed. Please install it: pnpm add jsx-email",{cause:e}):new t("jsx-email",`Failed to render jsx-email component: ${e.message}`,{cause:e})}};export{l as default};
1
+ import t from"../packem_shared/EmailError-2CCyVX1S.js";const l=async(n,s,a)=>{try{const{render:e}=await import("jsx-email");return await e(n,{plainText:a?.plainText,pretty:a?.pretty})}catch(e){throw e instanceof Error&&(e.code==="ERR_MODULE_NOT_FOUND"||e.message.includes("Cannot find module")||e.message.includes("Cannot find package"))?new t("jsx-email","jsx-email is not installed. Please install it: pnpm add jsx-email",{cause:e}):new t("jsx-email",`Failed to render jsx-email component: ${e.message}`,{cause:e})}};export{l as default};
@@ -1,12 +1,12 @@
1
- import { T as TemplateRenderer } from "../packem_shared/types.d-nyR1ty1Q.js";
1
+ import { T as TemplateRenderer } from "../packem_shared/types.d-I-KeZ5w2.js";
2
2
  /**
3
- * Renders a [LiquidJS](https://liquidjs.com/) template to a string.
4
- * @param template The Liquid template string.
5
- * @param data The data/variables exposed to the template.
6
- * @param options LiquidJS engine options (passed to the `Liquid` constructor).
7
- * @returns The rendered output.
8
- * @throws {TypeError} When the template is not a string.
9
- * @throws {EmailError} When `liquidjs` is not installed or rendering fails.
10
- */
3
+ * Renders a [LiquidJS](https://liquidjs.com/) template to a string.
4
+ * @param template The Liquid template string.
5
+ * @param data The data/variables exposed to the template.
6
+ * @param options LiquidJS engine options (passed to the `Liquid` constructor).
7
+ * @returns The rendered output.
8
+ * @throws {TypeError} When the template is not a string.
9
+ * @throws {EmailError} When `liquidjs` is not installed or rendering fails.
10
+ */
11
11
  declare const liquid: TemplateRenderer;
12
12
  export { liquid as default };
@@ -1 +1 @@
1
- import t from"../packem_shared/EmailError-B-sEf3bp.js";const r=async(i,a,n)=>{try{if(typeof i!="string")throw new TypeError("Liquid template must be a string");const{Liquid:e}=await import("liquidjs");return await new e(n??{}).parseAndRender(i,a??{})}catch(e){throw e instanceof TypeError?e:e instanceof Error&&(e.code==="ERR_MODULE_NOT_FOUND"||e.message.includes("Cannot find module")||e.message.includes("Cannot find package"))?new t("liquid","liquidjs is not installed. Please install it: pnpm add liquidjs",{cause:e}):new t("liquid",`Failed to render Liquid template: ${e.message}`,{cause:e})}};export{r as default};
1
+ import t from"../packem_shared/EmailError-2CCyVX1S.js";const r=async(i,a,n)=>{try{if(typeof i!="string")throw new TypeError("Liquid template must be a string");const{Liquid:e}=await import("liquidjs");return await new e(n??{}).parseAndRender(i,a??{})}catch(e){throw e instanceof TypeError?e:e instanceof Error&&(e.code==="ERR_MODULE_NOT_FOUND"||e.message.includes("Cannot find module")||e.message.includes("Cannot find package"))?new t("liquid","liquidjs is not installed. Please install it: pnpm add liquidjs",{cause:e}):new t("liquid",`Failed to render Liquid template: ${e.message}`,{cause:e})}};export{r as default};
@@ -1,12 +1,12 @@
1
- import { T as TemplateRenderer } from "../packem_shared/types.d-nyR1ty1Q.js";
1
+ import { T as TemplateRenderer } from "../packem_shared/types.d-I-KeZ5w2.js";
2
2
  /**
3
- * Renders MJML to HTML.
4
- * @param template MJML template string.
5
- * @param _data Data (not used for MJML).
6
- * @param options MJML options (beautify, fonts, keepComments, minify, validationLevel).
7
- * @returns Rendered HTML string.
8
- * @throws {TypeError} When template is not a string.
9
- * @throws {EmailError} When MJML is not installed, validation fails, or rendering fails.
10
- */
3
+ * Renders MJML to HTML.
4
+ * @param template MJML template string.
5
+ * @param _data Data (not used for MJML).
6
+ * @param options MJML options (beautify, fonts, keepComments, minify, validationLevel).
7
+ * @returns Rendered HTML string.
8
+ * @throws {TypeError} When template is not a string.
9
+ * @throws {EmailError} When MJML is not installed, validation fails, or rendering fails.
10
+ */
11
11
  declare const mjml: TemplateRenderer;
12
12
  export { mjml as default };
@@ -1 +1 @@
1
- import r from"mjml";import n from"../packem_shared/EmailError-B-sEf3bp.js";const f=(s,i,t)=>{try{if(typeof s!="string")throw new TypeError("MJML template must be a string");const e=r(s,{beautify:t?.beautify??!1,fonts:t?.fonts,keepComments:t?.keepComments??!0,minify:t?.minify??!1,validationLevel:t?.validationLevel??"soft"});if(e.errors&&e.errors.length>0){const o=e.errors.map(a=>a.message).join("; ");throw new n("mjml",`MJML validation errors: ${o}`)}return e.html}catch(e){throw e instanceof Error&&e.message.includes("Cannot find module")?new n("mjml","MJML is not installed. Please install it: pnpm add mjml",{cause:e}):e instanceof n?e:new n("mjml",`Failed to render MJML: ${e.message}`,{cause:e})}};export{f as default};
1
+ import r from"mjml";import n from"../packem_shared/EmailError-2CCyVX1S.js";const f=(s,i,t)=>{try{if(typeof s!="string")throw new TypeError("MJML template must be a string");const e=r(s,{beautify:t?.beautify??!1,fonts:t?.fonts,keepComments:t?.keepComments??!0,minify:t?.minify??!1,validationLevel:t?.validationLevel??"soft"});if(e.errors&&e.errors.length>0){const o=e.errors.map(a=>a.message).join("; ");throw new n("mjml",`MJML validation errors: ${o}`)}return e.html}catch(e){throw e instanceof Error&&e.message.includes("Cannot find module")?new n("mjml","MJML is not installed. Please install it: pnpm add mjml",{cause:e}):e instanceof n?e:new n("mjml",`Failed to render MJML: ${e.message}`,{cause:e})}};export{f as default};
@@ -1,11 +1,11 @@
1
- import { T as TemplateRenderer } from "../packem_shared/types.d-nyR1ty1Q.js";
1
+ import { T as TemplateRenderer } from "../packem_shared/types.d-I-KeZ5w2.js";
2
2
  /**
3
- * Renders a React Email component to HTML.
4
- * @param template The React component from \@react-email/components to render.
5
- * @param _data Data object (not used for React Email, but kept for API compatibility).
6
- * @param options Render options including plainText and pretty formatting.
7
- * @returns The rendered HTML string.
8
- * @throws {EmailError} When \@react-email/render is not installed or rendering fails.
9
- */
3
+ * Renders a React Email component to HTML.
4
+ * @param template The React component from \@react-email/components to render.
5
+ * @param _data Data object (not used for React Email, but kept for API compatibility).
6
+ * @param options Render options including plainText and pretty formatting.
7
+ * @returns The rendered HTML string.
8
+ * @throws {EmailError} When \@react-email/render is not installed or rendering fails.
9
+ */
10
10
  declare const reactEmail: TemplateRenderer;
11
11
  export { reactEmail as default };
@@ -1 +1 @@
1
- import{render as n}from"@react-email/render";import a from"../packem_shared/EmailError-B-sEf3bp.js";const s=async(r,i,t)=>{try{return await n(r,{plainText:t?.plainText,pretty:t?.pretty})}catch(e){throw e instanceof Error&&e.message.includes("Cannot find module")?new a("react-email","@react-email/render is not installed. Please install it: pnpm add @react-email/render",{cause:e}):new a("react-email",`Failed to render React Email component: ${e.message}`,{cause:e})}};export{s as default};
1
+ import{render as n}from"@react-email/render";import a from"../packem_shared/EmailError-2CCyVX1S.js";const s=async(r,i,t)=>{try{return await n(r,{plainText:t?.plainText,pretty:t?.pretty})}catch(e){throw e instanceof Error&&e.message.includes("Cannot find module")?new a("react-email","@react-email/render is not installed. Please install it: pnpm add @react-email/render",{cause:e}):new a("react-email",`Failed to render React Email component: ${e.message}`,{cause:e})}};export{s as default};
@@ -1,11 +1,11 @@
1
- import { T as TemplateRenderer } from "../packem_shared/types.d-nyR1ty1Q.js";
1
+ import { T as TemplateRenderer } from "../packem_shared/types.d-I-KeZ5w2.js";
2
2
  /**
3
- * Renders a Vue Email component to HTML.
4
- * @param template The Vue component from \@vue-email/components to render.
5
- * @param data Data and variables to pass to the template.
6
- * @param options Render options including pretty formatting, plainText output, and htmlToTextOptions.
7
- * @returns The rendered HTML or plain text string.
8
- * @throws {EmailError} When \@vue-email/render is not installed or rendering fails.
9
- */
3
+ * Renders a Vue Email component to HTML.
4
+ * @param template The Vue component from \@vue-email/components to render.
5
+ * @param data Data and variables to pass to the template.
6
+ * @param options Render options including pretty formatting, plainText output, and htmlToTextOptions.
7
+ * @returns The rendered HTML or plain text string.
8
+ * @throws {EmailError} When \@vue-email/render is not installed or rendering fails.
9
+ */
10
10
  declare const vueEmail: TemplateRenderer;
11
11
  export { vueEmail as default };
@@ -1 +1 @@
1
- import{render as i}from"@vue-email/render";import a from"../packem_shared/EmailError-B-sEf3bp.js";const s=async(n,r,t)=>{try{return await i(n,r??{},{htmlToTextOptions:t?.htmlToTextOptions,plainText:t?.plainText,pretty:t?.pretty})}catch(e){throw e instanceof Error&&e.message.includes("Cannot find module")?new a("vue-email","@vue-email/render is not installed. Please install it: pnpm add @vue-email/render",{cause:e}):new a("vue-email",`Failed to render Vue Email component: ${e.message}`,{cause:e})}};export{s as default};
1
+ import{render as i}from"@vue-email/render";import a from"../packem_shared/EmailError-2CCyVX1S.js";const s=async(n,r,t)=>{try{return await i(n,r??{},{htmlToTextOptions:t?.htmlToTextOptions,plainText:t?.plainText,pretty:t?.pretty})}catch(e){throw e instanceof Error&&e.message.includes("Cannot find module")?new a("vue-email","@vue-email/render is not installed. Please install it: pnpm add @vue-email/render",{cause:e}):new a("vue-email",`Failed to render Vue Email component: ${e.message}`,{cause:e})}};export{s as default};
@@ -1,99 +1,99 @@
1
- import { a as MockEmailEntry } from "../packem_shared/types.d-DCkecJse.js";
2
- import { E as EmailOptions } from "../packem_shared/types.d-ejzh-xBP.js";
3
- import { M as Mail } from "../packem_shared/mail.d-B9SSqyy0.js";
1
+ import { a as MockEmailEntry } from "../packem_shared/types.d-C5geVKes.js";
2
+ import { E as EmailOptions } from "../packem_shared/types.d-B9295M4_.js";
3
+ import { M as Mail } from "../packem_shared/mail.d-B9JyPxzq.js";
4
4
  import 'node:buffer';
5
5
  import 'ical-generator';
6
6
  import 'node:crypto';
7
- import "../packem_shared/types.d-BId55FW2.js";
8
- import "../packem_shared/types.d-nyR1ty1Q.js";
9
- import "../packem_shared/types.d-Mpu0HZoG.js";
10
- import "../packem_shared/provider.d-J-y6iogK.js";
7
+ import "../packem_shared/types.d-B0t3PQ3t.js";
8
+ import "../packem_shared/types.d-I-KeZ5w2.js";
9
+ import "../packem_shared/types.d-GKqPNk0I.js";
10
+ import "../packem_shared/provider.d-Cx5YQJdP.js";
11
11
  /**
12
- * A test harness around the in-memory mock provider: a ready-to-use {@link Mail} instance plus
13
- * helpers to inspect, wait on, and reset the captured outbox.
14
- */
12
+ * A test harness around the in-memory mock provider: a ready-to-use {@link Mail} instance plus
13
+ * helpers to inspect, wait on, and reset the captured outbox.
14
+ */
15
15
  interface TestEmail {
16
16
  /**
17
- * The {@link Mail} instance wired to the mock provider. Use it exactly like a real one.
18
- */
17
+ * The {@link Mail} instance wired to the mock provider. Use it exactly like a real one.
18
+ */
19
19
  mail: Mail;
20
20
  /**
21
- * Removes all captured messages.
22
- */
21
+ * Removes all captured messages.
22
+ */
23
23
  reset: () => void;
24
24
  /**
25
- * Returns the captured messages, oldest first.
26
- */
25
+ * Returns the captured messages, oldest first.
26
+ */
27
27
  sent: () => ReadonlyArray<MockEmailEntry>;
28
28
  /**
29
- * Resolves with the first captured message matching `predicate`, polling until `timeout`.
30
- * @param predicate The match condition.
31
- * @param options Optional `timeout` (ms, default 1000) and `interval` (ms, default 10).
32
- * @param options.interval Poll interval in milliseconds.
33
- * @param options.timeout Maximum time to wait in milliseconds.
34
- */
29
+ * Resolves with the first captured message matching `predicate`, polling until `timeout`.
30
+ * @param predicate The match condition.
31
+ * @param options Optional `timeout` (ms, default 1000) and `interval` (ms, default 10).
32
+ * @param options.interval Poll interval in milliseconds.
33
+ * @param options.timeout Maximum time to wait in milliseconds.
34
+ */
35
35
  waitFor: (predicate: (message: MockEmailEntry) => boolean, options?: {
36
36
  interval?: number;
37
37
  timeout?: number;
38
38
  }) => Promise<MockEmailEntry>;
39
39
  }
40
40
  /**
41
- * Creates a {@link TestEmail} harness backed by the in-memory mock provider.
42
- *
43
- * Nothing is sent over the network; every message is captured for assertion via the
44
- * {@link https://vitest.dev/ Vitest} matchers exported from `@visulima/email/test`.
45
- * @returns The test harness. See {@link TestEmail}.
46
- * @example
47
- * ```ts
48
- * const email = createTestEmail();
49
- * await email.mail.send({ from: { email: "a@x.com" }, to: { email: "b@x.com" }, subject: "Hi", text: "yo" });
50
- * expect(email).toHaveSentTo("b@x.com");
51
- * ```
52
- */
41
+ * Creates a {@link TestEmail} harness backed by the in-memory mock provider.
42
+ *
43
+ * Nothing is sent over the network; every message is captured for assertion via the
44
+ * {@link https://vitest.dev/ Vitest} matchers exported from `@visulima/email/test`.
45
+ * @returns The test harness. See {@link TestEmail}.
46
+ * @example
47
+ * ```ts
48
+ * const email = createTestEmail();
49
+ * await email.mail.send({ from: { email: "a@x.com" }, to: { email: "b@x.com" }, subject: "Hi", text: "yo" });
50
+ * expect(email).toHaveSentTo("b@x.com");
51
+ * ```
52
+ */
53
53
  declare const createTestEmail: () => TestEmail;
54
54
  /**
55
- * The minimal result shape a Vitest/Jest matcher must return.
56
- */
55
+ * The minimal result shape a Vitest/Jest matcher must return.
56
+ */
57
57
  interface MatcherResult {
58
58
  message: () => string;
59
59
  pass: boolean;
60
60
  }
61
61
  /**
62
- * A value the email matchers can assert against: a {@link TestEmail} harness or a raw list of captured
63
- * entries.
64
- */
62
+ * A value the email matchers can assert against: a {@link TestEmail} harness or a raw list of captured
63
+ * entries.
64
+ */
65
65
  type MatcherTarget = ReadonlyArray<MockEmailEntry> | TestEmail;
66
66
  /**
67
- * Asserts that at least one captured message was addressed to `address` (in To, Cc, or Bcc).
68
- * @param target The {@link TestEmail} harness or captured entries.
69
- * @param address The recipient address to look for (case-insensitive).
70
- * @returns The matcher result.
71
- */
67
+ * Asserts that at least one captured message was addressed to `address` (in To, Cc, or Bcc).
68
+ * @param target The {@link TestEmail} harness or captured entries.
69
+ * @param address The recipient address to look for (case-insensitive).
70
+ * @returns The matcher result.
71
+ */
72
72
  declare const toHaveSentTo: (target: MatcherTarget, address: string) => MatcherResult;
73
73
  /**
74
- * Asserts that at least one captured message has a subject equal to (or matching) `expected`.
75
- * @param target The {@link TestEmail} harness or captured entries.
76
- * @param expected An exact subject string or a `RegExp`.
77
- * @returns The matcher result.
78
- */
74
+ * Asserts that at least one captured message has a subject equal to (or matching) `expected`.
75
+ * @param target The {@link TestEmail} harness or captured entries.
76
+ * @param expected An exact subject string or a `RegExp`.
77
+ * @returns The matcher result.
78
+ */
79
79
  declare const toHaveSentWithSubject: (target: MatcherTarget, expected: RegExp | string) => MatcherResult;
80
80
  /**
81
- * Asserts that at least one captured message carried an attachment (optionally with a given filename).
82
- * @param target The {@link TestEmail} harness or captured entries.
83
- * @param filename When provided, requires an attachment with this exact filename.
84
- * @returns The matcher result.
85
- */
81
+ * Asserts that at least one captured message carried an attachment (optionally with a given filename).
82
+ * @param target The {@link TestEmail} harness or captured entries.
83
+ * @param filename When provided, requires an attachment with this exact filename.
84
+ * @returns The matcher result.
85
+ */
86
86
  declare const toHaveSentWithAttachment: (target: MatcherTarget, filename?: string) => MatcherResult;
87
87
  /**
88
- * Asserts that at least one captured message matches a predicate or a partial {@link EmailOptions}.
89
- * @param target The {@link TestEmail} harness or captured entries.
90
- * @param matcher A predicate over the sent options, or a partial options object to shallow-match.
91
- * @returns The matcher result.
92
- */
88
+ * Asserts that at least one captured message matches a predicate or a partial {@link EmailOptions}.
89
+ * @param target The {@link TestEmail} harness or captured entries.
90
+ * @param matcher A predicate over the sent options, or a partial options object to shallow-match.
91
+ * @returns The matcher result.
92
+ */
93
93
  declare const toHaveSentMatching: (target: MatcherTarget, matcher: Partial<EmailOptions> | ((options: EmailOptions) => boolean)) => MatcherResult;
94
94
  /**
95
- * The matcher map, suitable for passing to Vitest/Jest `expect.extend(...)`.
96
- */
95
+ * The matcher map, suitable for passing to Vitest/Jest `expect.extend(...)`.
96
+ */
97
97
  declare const emailMatchers: {
98
98
  toHaveSentMatching: typeof toHaveSentMatching;
99
99
  toHaveSentTo: typeof toHaveSentTo;
@@ -101,31 +101,31 @@ declare const emailMatchers: {
101
101
  toHaveSentWithSubject: typeof toHaveSentWithSubject;
102
102
  };
103
103
  /**
104
- * A Vitest/Jest-compatible `expect` exposing `.extend(...)`.
105
- */
104
+ * A Vitest/Jest-compatible `expect` exposing `.extend(...)`.
105
+ */
106
106
  interface ExpectLike {
107
107
  extend: (matchers: Record<string, unknown>) => void;
108
108
  }
109
109
  /**
110
- * Registers the email matchers with a Vitest/Jest-compatible `expect`.
111
- *
112
- * Kept dependency-free by accepting `expect` as an argument rather than importing `vitest` into the
113
- * shipped bundle. Add the matching type augmentation to a `vitest.d.ts` in your project for typed
114
- * `expect(...).toHaveSentTo(...)` calls.
115
- * @param expectInstance The `expect` object exposing `.extend(...)`.
116
- * @example
117
- * ```ts
118
- * import { expect } from "vitest";
119
- * import { registerEmailMatchers } from "@visulima/email/test";
120
- *
121
- * registerEmailMatchers(expect);
122
- * ```
123
- */
110
+ * Registers the email matchers with a Vitest/Jest-compatible `expect`.
111
+ *
112
+ * Kept dependency-free by accepting `expect` as an argument rather than importing `vitest` into the
113
+ * shipped bundle. Add the matching type augmentation to a `vitest.d.ts` in your project for typed
114
+ * `expect(...).toHaveSentTo(...)` calls.
115
+ * @param expectInstance The `expect` object exposing `.extend(...)`.
116
+ * @example
117
+ * ```ts
118
+ * import { expect } from "vitest";
119
+ * import { registerEmailMatchers } from "@visulima/email/test";
120
+ *
121
+ * registerEmailMatchers(expect);
122
+ * ```
123
+ */
124
124
  declare const registerEmailMatchers: (expectInstance: ExpectLike) => void;
125
125
  /**
126
- * A stable, snapshot-friendly view of a sent message — volatile fields (message id, timestamp) are
127
- * omitted so the snapshot doesn't churn between runs.
128
- */
126
+ * A stable, snapshot-friendly view of a sent message — volatile fields (message id, timestamp) are
127
+ * omitted so the snapshot doesn't churn between runs.
128
+ */
129
129
  interface EmailSnapshot {
130
130
  attachments?: {
131
131
  contentType?: string;
@@ -142,14 +142,14 @@ interface EmailSnapshot {
142
142
  to: string[];
143
143
  }
144
144
  /**
145
- * Normalizes a captured message (a `createTestEmail` outbox entry or raw {@link EmailOptions}) into a
146
- * deterministic {@link EmailSnapshot} for use with Vitest/Jest `toMatchSnapshot()`.
147
- * @param source A mock-provider outbox entry or an `EmailOptions` object.
148
- * @returns The snapshot view.
149
- * @example
150
- * ```ts
151
- * expect(toEmailSnapshot(email.sent()[0])).toMatchSnapshot();
152
- * ```
153
- */
145
+ * Normalizes a captured message (a `createTestEmail` outbox entry or raw {@link EmailOptions}) into a
146
+ * deterministic {@link EmailSnapshot} for use with Vitest/Jest `toMatchSnapshot()`.
147
+ * @param source A mock-provider outbox entry or an `EmailOptions` object.
148
+ * @returns The snapshot view.
149
+ * @example
150
+ * ```ts
151
+ * expect(toEmailSnapshot(email.sent()[0])).toMatchSnapshot();
152
+ * ```
153
+ */
154
154
  declare const toEmailSnapshot: (source: EmailOptions | MockEmailEntry) => EmailSnapshot;
155
155
  export { type EmailSnapshot, type MatcherResult, type MatcherTarget, type TestEmail, createTestEmail, emailMatchers, registerEmailMatchers, toEmailSnapshot, toHaveSentMatching, toHaveSentTo, toHaveSentWithAttachment, toHaveSentWithSubject };
@@ -1 +1 @@
1
- import{emailMatchers as a,registerEmailMatchers as o,toHaveSentMatching as r,toHaveSentTo as i,toHaveSentWithAttachment as m,toHaveSentWithSubject as h}from"../packem_shared/emailMatchers-DZDkrZ_3.js";import{toEmailSnapshot as c}from"../packem_shared/toEmailSnapshot-DeRqM5SJ.js";import{createTestEmail as s}from"../packem_shared/createTestEmail-f12yLlWn.js";export{s as createTestEmail,a as emailMatchers,o as registerEmailMatchers,c as toEmailSnapshot,r as toHaveSentMatching,i as toHaveSentTo,m as toHaveSentWithAttachment,h as toHaveSentWithSubject};
1
+ import{emailMatchers as a,registerEmailMatchers as o,toHaveSentMatching as r,toHaveSentTo as i,toHaveSentWithAttachment as m,toHaveSentWithSubject as h}from"../packem_shared/emailMatchers-DZDkrZ_3.js";import{toEmailSnapshot as c}from"../packem_shared/toEmailSnapshot-DeRqM5SJ.js";import{createTestEmail as s}from"../packem_shared/createTestEmail-XiF5E8vJ.js";export{s as createTestEmail,a as emailMatchers,o as registerEmailMatchers,c as toEmailSnapshot,r as toHaveSentMatching,i as toHaveSentTo,m as toHaveSentWithAttachment,h as toHaveSentWithSubject};