@visulima/email 1.0.0-alpha.4 → 1.0.0-alpha.40

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 (395) hide show
  1. package/CHANGELOG.md +525 -0
  2. package/LICENSE.md +541 -847
  3. package/README.md +207 -5
  4. package/dist/crypto/index.d.ts +304 -4
  5. package/dist/crypto/index.js +1 -1
  6. package/dist/deliverability/dmarc-report.d.ts +95 -0
  7. package/dist/deliverability/dmarc-report.js +1 -0
  8. package/dist/deliverability/index.d.ts +360 -0
  9. package/dist/deliverability/index.js +1 -0
  10. package/dist/events/index.d.ts +31 -0
  11. package/dist/events/index.js +1 -0
  12. package/dist/inbound/index.d.ts +375 -0
  13. package/dist/inbound/index.js +1 -0
  14. package/dist/index.d.ts +94 -9
  15. package/dist/index.js +1 -1
  16. package/dist/middleware/index.d.ts +346 -0
  17. package/dist/middleware/index.js +1 -0
  18. package/dist/packem_shared/ALL_EVENTS-3kwh5CBE.js +1 -0
  19. package/dist/packem_shared/DkimSigner-BuSbnos1.js +18 -0
  20. package/dist/packem_shared/DraftMailMessage-C9tevR8K.js +1 -0
  21. package/dist/packem_shared/EmailError-B-sEf3bp.js +1 -0
  22. package/dist/packem_shared/Mail-DpjH0Exh.js +1 -0
  23. package/dist/packem_shared/MailMessage-L-Q9yc5v.js +1 -0
  24. package/dist/packem_shared/MemoryEventStore-CuhfO9aj.js +1 -0
  25. package/dist/packem_shared/MemoryQueue-Dl1Fa6OJ.js +1 -0
  26. package/dist/packem_shared/MemorySuppressionStore-DZnbz-_B.js +1 -0
  27. package/dist/packem_shared/RATE_LIMIT_PRESETS-BPADLgcA.js +1 -0
  28. package/dist/packem_shared/RequiredOptionError-DuNNY_a5.js +1 -0
  29. package/dist/packem_shared/SmimeEncrypter-C7usORKF.js +6 -0
  30. package/dist/packem_shared/SmimeSigner-DgAApLPS.js +8 -0
  31. package/dist/packem_shared/addDarkModeSupport-DZYxULjl.js +1 -0
  32. package/dist/packem_shared/address-formatter-BWR2Dddx.js +1 -0
  33. package/dist/packem_shared/aggregate-features-BqEjPd42.js +1 -0
  34. package/dist/packem_shared/ahaSendProvider-Dq5mElHZ.js +1 -0
  35. package/dist/packem_shared/arcMessageSignatureBase-BY4j0TxM.js +17 -0
  36. package/dist/packem_shared/attachment-processor-BjTNoMyb.js +1 -0
  37. package/dist/packem_shared/awsSesProvider-BGZJUIep.js +32 -0
  38. package/dist/packem_shared/azureProvider-DlM6UWUv.js +1 -0
  39. package/dist/packem_shared/brevoProvider-D_Hhc0Z-.js +1 -0
  40. package/dist/packem_shared/build-mime-message-Be6TOi1T.js +3 -0
  41. package/dist/packem_shared/buildListUnsubscribe-Cdr8MvR_.js +1 -0
  42. package/dist/packem_shared/buildMtaStsPolicy-oEQg8y_C.js +6 -0
  43. package/dist/packem_shared/circuitBreakerMiddleware-D2SA_07f.js +1 -0
  44. package/dist/packem_shared/cloudflareEmailProvider-D4adkOjA.js +1 -0
  45. package/dist/packem_shared/composeMiddleware-BHwLLEzK.js +1 -0
  46. package/dist/packem_shared/create-logger-BQTS3f-I.js +1 -0
  47. package/dist/packem_shared/createSuppressionStore-CeAZKCbY.js +1 -0
  48. package/dist/packem_shared/createTestEmail-BM3iNznm.js +1 -0
  49. package/dist/packem_shared/createWorker-_-yMWcNQ.js +1 -0
  50. package/dist/packem_shared/dedupeMiddleware-B6ajWOTi.js +1 -0
  51. package/dist/packem_shared/defineInboundHandler-CnL2BzlL.js +1 -0
  52. package/dist/packem_shared/defineProvider-C9q-7iwt.js +1 -0
  53. package/dist/packem_shared/detectMimeType-Dxv4MjZ7.js +1 -0
  54. package/dist/packem_shared/emailMatchers-DZDkrZ_3.js +1 -0
  55. package/dist/packem_shared/event-bus.d-DEl3w_EW.d.ts +104 -0
  56. package/dist/packem_shared/extractCidReferences-BuoTREMp.js +1 -0
  57. package/dist/packem_shared/extractReply-BUjIBt9A.js +5 -0
  58. package/dist/packem_shared/failoverProvider-BgX6zfnY.js +1 -0
  59. package/dist/packem_shared/format-address-DTl-9O70.js +1 -0
  60. package/dist/packem_shared/generate-boundary-DQbzDiOI.js +1 -0
  61. package/dist/packem_shared/generate-message-id-gXAuMz4g.js +1 -0
  62. package/dist/packem_shared/headers-to-record-De1Eg951.js +1 -0
  63. package/dist/packem_shared/httpProvider-DJAsYSun.js +1 -0
  64. package/dist/packem_shared/index-yDU-1zOZ.js +11 -0
  65. package/dist/packem_shared/infobipProvider-oOL-ThpP.js +1 -0
  66. package/dist/packem_shared/injectPreheader-CF9WHZ7J.js +1 -0
  67. package/dist/packem_shared/inlineCss-BQ7d2Cyz.js +1 -0
  68. package/dist/packem_shared/isValidSigningCertUrl-Bii1AMGC.js +3 -0
  69. package/dist/packem_shared/loggingMiddleware-CZIiVMVp.js +1 -0
  70. package/dist/packem_shared/loopsProvider-BXr0KSjB.js +1 -0
  71. package/dist/packem_shared/mail.d-B9SSqyy0.d.ts +909 -0
  72. package/dist/packem_shared/{mailCrabProvider-CM_CFDca.js → mailCrabProvider-C7Ao5H9p.js} +1 -1
  73. package/dist/packem_shared/mailPaceProvider-DklGeGEM.js +1 -0
  74. package/dist/packem_shared/mailchannelsProvider-DPfQVzUd.js +1 -0
  75. package/dist/packem_shared/mailerSendProvider-B8iT5Uhb.js +1 -0
  76. package/dist/packem_shared/mailgunProvider-Ctyrs9d0.js +1 -0
  77. package/dist/packem_shared/mailjetProvider-v55nFDsr.js +1 -0
  78. package/dist/packem_shared/mailomatProvider-BCyB4Q4B.js +1 -0
  79. package/dist/packem_shared/mailtrapProvider-DcVw3sxR.js +1 -0
  80. package/dist/packem_shared/make-request-BlK_B72c.js +1 -0
  81. package/dist/packem_shared/mandrillProvider-gqMFMwgs.js +1 -0
  82. package/dist/packem_shared/mockProvider-Behywbl1.js +1 -0
  83. package/dist/packem_shared/netcoreProvider-XMWO_Aoa.js +1 -0
  84. package/dist/packem_shared/nodemailerProvider-BFHobXxt.js +1 -0
  85. package/dist/packem_shared/normalizeMessageId-DAx2pGe2.js +1 -0
  86. package/dist/packem_shared/oauth2Middleware-CodqXkyj.js +1 -0
  87. package/dist/packem_shared/opentelemetryProvider-ByHC01ub.js +1 -0
  88. package/dist/packem_shared/outlook365Provider-BoNtxqIx.js +1 -0
  89. package/dist/packem_shared/parseAddress-DdbViBAJ.js +1 -0
  90. package/dist/packem_shared/parseArfReport-Ds6S3c4J.js +6 -0
  91. package/dist/packem_shared/parseCloudflareInbound-C__j-oNa.js +1 -0
  92. package/dist/packem_shared/parseDmarcRecord-DXZ-_rF0.js +1 -0
  93. package/dist/packem_shared/parseMailgunInbound-BpC6uPNe.js +1 -0
  94. package/dist/packem_shared/parsePostmarkInbound-Co3_c6-9.js +1 -0
  95. package/dist/packem_shared/parseSendGridInbound-DsALoijO.js +4 -0
  96. package/dist/packem_shared/parseSesInbound-CH5tHIjp.js +1 -0
  97. package/dist/packem_shared/parseTlsReport-wPe1lIDs.js +1 -0
  98. package/dist/packem_shared/plunkProvider-C0LO-1E3.js +1 -0
  99. package/dist/packem_shared/postProcessHtml-DqKi2Ucg.js +1 -0
  100. package/dist/packem_shared/postalProvider-B26IqgxE.js +1 -0
  101. package/dist/packem_shared/postmarkProvider-DWQJv5_M.js +1 -0
  102. package/dist/packem_shared/provider-base-gIoUu9so.js +1 -0
  103. package/dist/packem_shared/provider.d-J-y6iogK.d.ts +28 -0
  104. package/dist/packem_shared/quoted-printable-nSGDA1tA.js +7 -0
  105. package/dist/packem_shared/resendProvider-DhvKVyCD.js +1 -0
  106. package/dist/packem_shared/retry-3pnxTuNs.js +1 -0
  107. package/dist/packem_shared/retryMiddleware-DbViDX4r.js +1 -0
  108. package/dist/packem_shared/roundRobinProvider-D1by5KGW.js +1 -0
  109. package/dist/packem_shared/sanitize-header-DJhgZl3y.js +1 -0
  110. package/dist/packem_shared/scalewayProvider-D8dmHuwZ.js +1 -0
  111. package/dist/packem_shared/sendGridProvider-CChhLr7s.js +1 -0
  112. package/dist/packem_shared/smtpProvider-x4WBN-3W.js +25 -0
  113. package/dist/packem_shared/sparkpostProvider-BytvwqjP.js +1 -0
  114. package/dist/packem_shared/sweegoProvider-7xhOvagC.js +1 -0
  115. package/dist/packem_shared/toEmailSnapshot-DeRqM5SJ.js +1 -0
  116. package/dist/packem_shared/tracer.d-MU42G1jG.d.ts +494 -0
  117. package/dist/packem_shared/types.d-BId55FW2.d.ts +107 -0
  118. package/dist/packem_shared/types.d-CmoWvdZi.d.ts +61 -0
  119. package/dist/packem_shared/types.d-DCkecJse.d.ts +51 -0
  120. package/dist/packem_shared/types.d-Mpu0HZoG.d.ts +24 -0
  121. package/dist/packem_shared/types.d-ejzh-xBP.d.ts +209 -0
  122. package/dist/packem_shared/types.d-lcJZmwRK.d.ts +69 -0
  123. package/dist/packem_shared/types.d-nyR1ty1Q.d.ts +9 -0
  124. package/dist/packem_shared/utils-BfYfPB_I.js +1 -0
  125. package/dist/packem_shared/validate-email-options-mCM9dVug.js +1 -0
  126. package/dist/packem_shared/verifyMailgunWebhook-Cwl0OD3P.js +1 -0
  127. package/dist/packem_shared/verifyPostmarkWebhook-C72ZvbrG.js +1 -0
  128. package/dist/packem_shared/verifyResendWebhook-YK2zNDXR.js +1 -0
  129. package/dist/packem_shared/verifySendGridWebhook-Dbwc1tfG.js +1 -0
  130. package/dist/packem_shared/withEvents-CCVblSqj.js +1 -0
  131. package/dist/packem_shared/withMetrics-DWywX_6M.js +1 -0
  132. package/dist/packem_shared/withRender-VP9wE5Yr.js +1 -0
  133. package/dist/packem_shared/withSuppression-DBaZDMAr.js +1 -0
  134. package/dist/packem_shared/withTelemetry-DL2qo0Hp.js +1 -0
  135. package/dist/packem_shared/zeptomailProvider-D3nQKXRf.js +1 -0
  136. package/dist/providers/ahasend/index.d.ts +36 -3
  137. package/dist/providers/ahasend/index.js +1 -1
  138. package/dist/providers/aws-ses/index.d.ts +47 -3
  139. package/dist/providers/aws-ses/index.js +1 -1
  140. package/dist/providers/azure/index.d.ts +52 -3
  141. package/dist/providers/azure/index.js +1 -1
  142. package/dist/providers/brevo/index.d.ts +65 -3
  143. package/dist/providers/brevo/index.js +1 -1
  144. package/dist/providers/cloudflare-email/index.d.ts +36 -0
  145. package/dist/providers/cloudflare-email/index.js +1 -0
  146. package/dist/providers/failover/index.d.ts +27 -3
  147. package/dist/providers/failover/index.js +1 -1
  148. package/dist/providers/http/index.d.ts +35 -3
  149. package/dist/providers/http/index.js +1 -1
  150. package/dist/providers/infobip/index.d.ts +56 -3
  151. package/dist/providers/infobip/index.js +1 -1
  152. package/dist/providers/loops/index.d.ts +47 -0
  153. package/dist/providers/loops/index.js +1 -0
  154. package/dist/providers/mailchannels/index.d.ts +26 -0
  155. package/dist/providers/mailchannels/index.js +1 -0
  156. package/dist/providers/mailcrab/index.d.ts +32 -3
  157. package/dist/providers/mailcrab/index.js +1 -1
  158. package/dist/providers/mailersend/index.d.ts +51 -3
  159. package/dist/providers/mailersend/index.js +1 -1
  160. package/dist/providers/mailgun/index.d.ts +73 -3
  161. package/dist/providers/mailgun/index.js +1 -1
  162. package/dist/providers/mailjet/index.d.ts +72 -3
  163. package/dist/providers/mailjet/index.js +1 -1
  164. package/dist/providers/mailomat/index.d.ts +40 -3
  165. package/dist/providers/mailomat/index.js +1 -1
  166. package/dist/providers/mailpace/index.d.ts +52 -3
  167. package/dist/providers/mailpace/index.js +1 -1
  168. package/dist/providers/mailtrap/index.d.ts +44 -3
  169. package/dist/providers/mailtrap/index.js +1 -1
  170. package/dist/providers/mandrill/index.d.ts +87 -3
  171. package/dist/providers/mandrill/index.js +1 -1
  172. package/dist/providers/mock/index.d.ts +12 -3
  173. package/dist/providers/mock/index.js +1 -1
  174. package/dist/providers/netcore/index.d.ts +35 -0
  175. package/dist/providers/netcore/index.js +1 -0
  176. package/dist/providers/nodemailer/index.d.ts +38 -3
  177. package/dist/providers/nodemailer/index.js +1 -1
  178. package/dist/providers/opentelemetry/index.d.ts +37 -3
  179. package/dist/providers/opentelemetry/index.js +1 -1
  180. package/dist/providers/outlook365/index.d.ts +48 -0
  181. package/dist/providers/outlook365/index.js +1 -0
  182. package/dist/providers/plunk/index.d.ts +38 -3
  183. package/dist/providers/plunk/index.js +1 -1
  184. package/dist/providers/postal/index.d.ts +48 -3
  185. package/dist/providers/postal/index.js +1 -1
  186. package/dist/providers/postmark/index.d.ts +60 -3
  187. package/dist/providers/postmark/index.js +1 -1
  188. package/dist/providers/resend/index.d.ts +51 -3
  189. package/dist/providers/resend/index.js +1 -1
  190. package/dist/providers/roundrobin/index.d.ts +27 -3
  191. package/dist/providers/roundrobin/index.js +1 -1
  192. package/dist/providers/scaleway/index.d.ts +44 -3
  193. package/dist/providers/scaleway/index.js +1 -1
  194. package/dist/providers/sendgrid/index.d.ts +84 -3
  195. package/dist/providers/sendgrid/index.js +1 -1
  196. package/dist/providers/smtp/index.d.ts +71 -3
  197. package/dist/providers/smtp/index.js +1 -1
  198. package/dist/providers/sparkpost/index.d.ts +43 -0
  199. package/dist/providers/sparkpost/index.js +1 -0
  200. package/dist/providers/sweego/index.d.ts +40 -3
  201. package/dist/providers/sweego/index.js +1 -1
  202. package/dist/providers/zeptomail/index.d.ts +37 -3
  203. package/dist/providers/zeptomail/index.js +1 -1
  204. package/dist/queue/bullmq-queue.d.ts +46 -0
  205. package/dist/queue/bullmq-queue.js +1 -0
  206. package/dist/queue/index.d.ts +147 -0
  207. package/dist/queue/index.js +1 -0
  208. package/dist/queue/pg-boss-queue.d.ts +41 -0
  209. package/dist/queue/pg-boss-queue.js +1 -0
  210. package/dist/queue/sqs-queue.d.ts +72 -0
  211. package/dist/queue/sqs-queue.js +1 -0
  212. package/dist/queue/unstorage-queue.d.ts +199 -0
  213. package/dist/queue/unstorage-queue.js +1 -0
  214. package/dist/render/index.d.ts +107 -0
  215. package/dist/render/index.js +1 -0
  216. package/dist/template-engines/handlebars.d.ts +23 -22
  217. package/dist/template-engines/handlebars.js +1 -1
  218. package/dist/template-engines/html-to-text.d.ts +24 -24
  219. package/dist/template-engines/html-to-text.js +1 -1
  220. package/dist/template-engines/i18n.d.ts +61 -0
  221. package/dist/template-engines/i18n.js +1 -0
  222. package/dist/template-engines/jsx-email.d.ts +11 -0
  223. package/dist/template-engines/jsx-email.js +1 -0
  224. package/dist/template-engines/liquid.d.ts +12 -0
  225. package/dist/template-engines/liquid.js +1 -0
  226. package/dist/template-engines/mjml.d.ts +10 -10
  227. package/dist/template-engines/mjml.js +1 -1
  228. package/dist/template-engines/react-email.d.ts +9 -9
  229. package/dist/template-engines/react-email.js +1 -1
  230. package/dist/template-engines/vue-email.d.ts +9 -9
  231. package/dist/template-engines/vue-email.js +1 -1
  232. package/dist/test/index.d.ts +159 -0
  233. package/dist/test/index.js +1 -0
  234. package/dist/utils/cache.d.ts +49 -48
  235. package/dist/utils/cache.js +1 -1
  236. package/dist/utils/format-email-address.d.ts +8 -7
  237. package/dist/utils/format-email-address.js +1 -1
  238. package/dist/utils/normalize-email-aliases.d.ts +20 -20
  239. package/dist/utils/normalize-email-aliases.js +1 -1
  240. package/dist/utils/parse-address.d.ts +18 -17
  241. package/dist/utils/parse-address.js +1 -1
  242. package/dist/utils/parse-eml.d.ts +22 -0
  243. package/dist/utils/parse-eml.js +6 -0
  244. package/dist/utils/result.d.ts +49 -0
  245. package/dist/utils/result.js +1 -0
  246. package/dist/utils/validation/check-feature-support.d.ts +53 -0
  247. package/dist/utils/validation/check-feature-support.js +1 -0
  248. package/dist/utils/validation/check-mx-records.d.ts +36 -35
  249. package/dist/utils/validation/check-mx-records.js +1 -1
  250. package/dist/utils/validation/disposable-email-domains.d.ts +1 -13
  251. package/dist/utils/validation/role-accounts.d.ts +18 -18
  252. package/dist/utils/validation/role-accounts.js +1 -1
  253. package/dist/utils/validation/validate-email.d.ts +5 -5
  254. package/dist/utils/validation/validate-email.js +1 -1
  255. package/dist/utils/validation/verify-email.d.ts +45 -42
  256. package/dist/utils/validation/verify-email.js +1 -1
  257. package/dist/utils/validation/verify-smtp.d.ts +35 -34
  258. package/dist/utils/validation/verify-smtp.js +4 -4
  259. package/dist/webhooks/index.d.ts +231 -0
  260. package/dist/webhooks/index.js +1 -0
  261. package/package.json +181 -48
  262. package/dist/attachment-helpers.d.ts +0 -64
  263. package/dist/crypto/dkim-signer.d.ts +0 -48
  264. package/dist/crypto/smime-encrypter.d.ts +0 -53
  265. package/dist/crypto/smime-signer.d.ts +0 -48
  266. package/dist/crypto/types.d.ts +0 -101
  267. package/dist/draft-mail-message.d.ts +0 -13
  268. package/dist/errors/email-error.d.ts +0 -17
  269. package/dist/errors/required-option-error.d.ts +0 -10
  270. package/dist/mail-message.d.ts +0 -425
  271. package/dist/mail.d.ts +0 -206
  272. package/dist/packem_shared/DkimSigner-pFd4c3fZ.js +0 -18
  273. package/dist/packem_shared/EmailError-zm2ffVav.js +0 -1
  274. package/dist/packem_shared/Mail-6Bltpy_p.js +0 -1
  275. package/dist/packem_shared/MailMessage-B76GPBBA.js +0 -1
  276. package/dist/packem_shared/RequiredOptionError-CevW3u2K.js +0 -1
  277. package/dist/packem_shared/SmimeEncrypter-CBevU534.js +0 -6
  278. package/dist/packem_shared/SmimeSigner-CObA4jzT.js +0 -8
  279. package/dist/packem_shared/address-formatter-Cm_E_ZMa.js +0 -1
  280. package/dist/packem_shared/ahaSendProvider-DlFKEQ6D.js +0 -1
  281. package/dist/packem_shared/attachment-processor-2rHmfa7j.js +0 -1
  282. package/dist/packem_shared/awsSesProvider-Ba-eVJxZ.js +0 -32
  283. package/dist/packem_shared/azureProvider-CQYAkgVF.js +0 -1
  284. package/dist/packem_shared/brevoProvider-5p6jjiK9.js +0 -1
  285. package/dist/packem_shared/build-mime-message-IYaUqqPJ.js +0 -2
  286. package/dist/packem_shared/create-logger-BiWdqFNg.js +0 -1
  287. package/dist/packem_shared/defineProvider-B9rSklAJ.js +0 -1
  288. package/dist/packem_shared/detectMimeType-S8WRsNtY.js +0 -1
  289. package/dist/packem_shared/failoverProvider-CAHQQueo.js +0 -1
  290. package/dist/packem_shared/generate-boundary-Cx8nXYS0.js +0 -1
  291. package/dist/packem_shared/generate-message-id-D4uA8gkj.js +0 -1
  292. package/dist/packem_shared/headers-to-record-Qo124ImV.js +0 -1
  293. package/dist/packem_shared/httpProvider-CZD6LZX3.js +0 -1
  294. package/dist/packem_shared/infobipProvider-CtLwrUaP.js +0 -1
  295. package/dist/packem_shared/mailPaceProvider-B6yKvh6z.js +0 -1
  296. package/dist/packem_shared/mailerSendProvider-CeeIXFnW.js +0 -1
  297. package/dist/packem_shared/mailgunProvider-mmjKzouh.js +0 -1
  298. package/dist/packem_shared/mailjetProvider-DwN6i0VA.js +0 -1
  299. package/dist/packem_shared/mailomatProvider-DMQmjKHT.js +0 -1
  300. package/dist/packem_shared/mailtrapProvider-BN3UBEQw.js +0 -1
  301. package/dist/packem_shared/make-request-BDzF9W9D.js +0 -1
  302. package/dist/packem_shared/mandrillProvider-370y7CLu.js +0 -1
  303. package/dist/packem_shared/mockProvider-DN5ZwutD.js +0 -1
  304. package/dist/packem_shared/nodemailerProvider-_w8QXMU-.js +0 -1
  305. package/dist/packem_shared/opentelemetryProvider-C_ZXOLSd.js +0 -1
  306. package/dist/packem_shared/plunkProvider-DfJumQ4U.js +0 -1
  307. package/dist/packem_shared/postalProvider-Bavx2FcH.js +0 -1
  308. package/dist/packem_shared/postmarkProvider-DFC0uvjO.js +0 -1
  309. package/dist/packem_shared/provider-base-Cmzx6BTO.js +0 -1
  310. package/dist/packem_shared/readFile-BlZxbhCU-C8bCdiA2.js +0 -1
  311. package/dist/packem_shared/resendProvider-CfqU7UdE.js +0 -1
  312. package/dist/packem_shared/roundRobinProvider-1WQnuKR8.js +0 -1
  313. package/dist/packem_shared/sanitize-header-wWav-Scu.js +0 -1
  314. package/dist/packem_shared/scalewayProvider-be1HPimL.js +0 -1
  315. package/dist/packem_shared/sendGridProvider-BVI1sq3n.js +0 -1
  316. package/dist/packem_shared/smtpProvider-BV-ufR53.js +0 -23
  317. package/dist/packem_shared/sweegoProvider-7419CSAq.js +0 -1
  318. package/dist/packem_shared/validate-email-options-DfJ7llf8.js +0 -1
  319. package/dist/packem_shared/zeptomailProvider-C2lh0Xmo.js +0 -1
  320. package/dist/providers/ahasend/provider.d.ts +0 -7
  321. package/dist/providers/ahasend/types.d.ts +0 -28
  322. package/dist/providers/aws-ses/provider.d.ts +0 -8
  323. package/dist/providers/aws-ses/types.d.ts +0 -38
  324. package/dist/providers/azure/provider.d.ts +0 -7
  325. package/dist/providers/azure/types.d.ts +0 -44
  326. package/dist/providers/brevo/provider.d.ts +0 -7
  327. package/dist/providers/brevo/types.d.ts +0 -57
  328. package/dist/providers/failover/provider.d.ts +0 -7
  329. package/dist/providers/failover/types.d.ts +0 -19
  330. package/dist/providers/http/provider.d.ts +0 -7
  331. package/dist/providers/http/types.d.ts +0 -27
  332. package/dist/providers/infobip/provider.d.ts +0 -7
  333. package/dist/providers/infobip/types.d.ts +0 -48
  334. package/dist/providers/mailcrab/provider.d.ts +0 -9
  335. package/dist/providers/mailcrab/types.d.ts +0 -22
  336. package/dist/providers/mailersend/provider.d.ts +0 -7
  337. package/dist/providers/mailersend/types.d.ts +0 -43
  338. package/dist/providers/mailgun/provider.d.ts +0 -7
  339. package/dist/providers/mailgun/types.d.ts +0 -65
  340. package/dist/providers/mailjet/provider.d.ts +0 -7
  341. package/dist/providers/mailjet/types.d.ts +0 -64
  342. package/dist/providers/mailomat/provider.d.ts +0 -7
  343. package/dist/providers/mailomat/types.d.ts +0 -32
  344. package/dist/providers/mailpace/provider.d.ts +0 -7
  345. package/dist/providers/mailpace/types.d.ts +0 -44
  346. package/dist/providers/mailtrap/provider.d.ts +0 -7
  347. package/dist/providers/mailtrap/types.d.ts +0 -36
  348. package/dist/providers/mandrill/provider.d.ts +0 -7
  349. package/dist/providers/mandrill/types.d.ts +0 -79
  350. package/dist/providers/mock/provider.d.ts +0 -8
  351. package/dist/providers/mock/types.d.ts +0 -50
  352. package/dist/providers/nodemailer/provider.d.ts +0 -7
  353. package/dist/providers/nodemailer/types.d.ts +0 -30
  354. package/dist/providers/opentelemetry/provider.d.ts +0 -8
  355. package/dist/providers/opentelemetry/types.d.ts +0 -31
  356. package/dist/providers/plunk/provider.d.ts +0 -7
  357. package/dist/providers/plunk/types.d.ts +0 -30
  358. package/dist/providers/postal/provider.d.ts +0 -7
  359. package/dist/providers/postal/types.d.ts +0 -40
  360. package/dist/providers/postmark/provider.d.ts +0 -7
  361. package/dist/providers/postmark/types.d.ts +0 -52
  362. package/dist/providers/provider.d.ts +0 -27
  363. package/dist/providers/resend/provider.d.ts +0 -7
  364. package/dist/providers/resend/types.d.ts +0 -43
  365. package/dist/providers/roundrobin/provider.d.ts +0 -7
  366. package/dist/providers/roundrobin/types.d.ts +0 -19
  367. package/dist/providers/scaleway/provider.d.ts +0 -7
  368. package/dist/providers/scaleway/types.d.ts +0 -36
  369. package/dist/providers/sendgrid/provider.d.ts +0 -7
  370. package/dist/providers/sendgrid/types.d.ts +0 -76
  371. package/dist/providers/smtp/provider.d.ts +0 -7
  372. package/dist/providers/smtp/types.d.ts +0 -63
  373. package/dist/providers/sweego/provider.d.ts +0 -7
  374. package/dist/providers/sweego/types.d.ts +0 -32
  375. package/dist/providers/utils/address-formatter.d.ts +0 -139
  376. package/dist/providers/utils/attachment-processor.d.ts +0 -58
  377. package/dist/providers/utils/index.d.ts +0 -4
  378. package/dist/providers/utils/payload-builder.d.ts +0 -78
  379. package/dist/providers/utils/provider-base.d.ts +0 -69
  380. package/dist/providers/zeptomail/provider.d.ts +0 -7
  381. package/dist/providers/zeptomail/types.d.ts +0 -29
  382. package/dist/template-engines/types.d.ts +0 -8
  383. package/dist/types.d.ts +0 -203
  384. package/dist/utils/build-mime-message.d.ts +0 -8
  385. package/dist/utils/create-logger.d.ts +0 -16
  386. package/dist/utils/format-email-addresses.d.ts +0 -8
  387. package/dist/utils/generate-boundary.d.ts +0 -7
  388. package/dist/utils/generate-message-id.d.ts +0 -6
  389. package/dist/utils/headers-to-record.d.ts +0 -9
  390. package/dist/utils/is-port-available.d.ts +0 -9
  391. package/dist/utils/make-request.d.ts +0 -18
  392. package/dist/utils/retry.d.ts +0 -10
  393. package/dist/utils/sanitize-header.d.ts +0 -14
  394. package/dist/utils/to-base64.d.ts +0 -8
  395. package/dist/utils/validation/validate-email-options.d.ts +0 -8
package/package.json CHANGED
@@ -1,57 +1,70 @@
1
1
  {
2
2
  "name": "@visulima/email",
3
- "version": "1.0.0-alpha.4",
3
+ "version": "1.0.0-alpha.40",
4
4
  "description": "A comprehensive email library with multi-provider support, crypto utilities, and template engines",
5
5
  "keywords": [
6
- "visulima",
7
- "email",
8
- "mail",
9
- "better-mail",
10
- "smtp",
11
- "resend",
6
+ "ahasend",
7
+ "arc",
12
8
  "aws-ses",
13
- "zeptomail",
14
- "http",
9
+ "azure",
10
+ "batch",
11
+ "better-mail",
12
+ "brevo",
13
+ "crypto",
14
+ "deliverability",
15
+ "disposable-email",
16
+ "disposable-email-domains",
17
+ "dkim",
18
+ "dmarc",
19
+ "email",
20
+ "encryption",
21
+ "i18n",
22
+ "inbound-email",
23
+ "jsx-email",
24
+ "liquid",
25
+ "list-unsubscribe",
26
+ "middleware",
27
+ "queue",
28
+ "webhook",
15
29
  "failover",
16
- "roundrobin",
30
+ "handlebars",
31
+ "html-to-text",
32
+ "http",
33
+ "infobip",
34
+ "mail",
17
35
  "mailcrab",
18
- "nodemailer",
19
- "opentelemetry",
20
- "plunk",
21
- "mock",
22
- "sendgrid",
36
+ "mailersend",
23
37
  "mailgun",
24
- "postmark",
25
- "brevo",
26
38
  "mailjet",
27
- "mailersend",
39
+ "mailomat",
40
+ "mailpace",
41
+ "mailtrap",
28
42
  "mandrill",
43
+ "mjml",
44
+ "mock",
45
+ "netcore",
46
+ "nodemailer",
47
+ "opentelemetry",
48
+ "outlook365",
49
+ "plunk",
29
50
  "postal",
30
- "mailtrap",
31
- "mailpace",
32
- "azure",
33
- "infobip",
51
+ "postmark",
52
+ "sparkpost",
53
+ "react-email",
54
+ "resend",
55
+ "roundrobin",
34
56
  "scaleway",
35
- "ahasend",
36
- "mailomat",
37
- "sweego",
38
- "dkim",
39
- "smime",
40
- "encryption",
57
+ "sendgrid",
41
58
  "signing",
42
- "crypto",
43
- "disposable-email",
44
- "disposable-email-domains",
45
- "handlebars",
46
- "mjml",
47
- "react-email",
59
+ "smime",
60
+ "smtp",
61
+ "sweego",
62
+ "visulima",
48
63
  "vue-email",
49
- "html-to-text"
64
+ "zeptomail"
50
65
  ],
51
66
  "homepage": "https://visulima.com/packages/email",
52
- "bugs": {
53
- "url": "https://github.com/visulima/visulima/issues"
54
- },
67
+ "bugs": "https://github.com/visulima/visulima/issues",
55
68
  "repository": {
56
69
  "type": "git",
57
70
  "url": "git+https://github.com/visulima/visulima.git",
@@ -99,6 +112,18 @@
99
112
  "types": "./dist/template-engines/html-to-text.d.ts",
100
113
  "default": "./dist/template-engines/html-to-text.js"
101
114
  },
115
+ "./template/liquid": {
116
+ "types": "./dist/template-engines/liquid.d.ts",
117
+ "default": "./dist/template-engines/liquid.js"
118
+ },
119
+ "./template/jsx-email": {
120
+ "types": "./dist/template-engines/jsx-email.d.ts",
121
+ "default": "./dist/template-engines/jsx-email.js"
122
+ },
123
+ "./template/i18n": {
124
+ "types": "./dist/template-engines/i18n.d.ts",
125
+ "default": "./dist/template-engines/i18n.js"
126
+ },
102
127
  "./providers/aws-ses": {
103
128
  "types": "./dist/providers/aws-ses/index.d.ts",
104
129
  "default": "./dist/providers/aws-ses/index.js"
@@ -151,6 +176,58 @@
151
176
  "types": "./dist/crypto/index.d.ts",
152
177
  "default": "./dist/crypto/index.js"
153
178
  },
179
+ "./render": {
180
+ "types": "./dist/render/index.d.ts",
181
+ "default": "./dist/render/index.js"
182
+ },
183
+ "./webhooks": {
184
+ "types": "./dist/webhooks/index.d.ts",
185
+ "default": "./dist/webhooks/index.js"
186
+ },
187
+ "./deliverability": {
188
+ "types": "./dist/deliverability/index.d.ts",
189
+ "default": "./dist/deliverability/index.js"
190
+ },
191
+ "./deliverability/dmarc-report": {
192
+ "types": "./dist/deliverability/dmarc-report.d.ts",
193
+ "default": "./dist/deliverability/dmarc-report.js"
194
+ },
195
+ "./inbound": {
196
+ "types": "./dist/inbound/index.d.ts",
197
+ "default": "./dist/inbound/index.js"
198
+ },
199
+ "./events": {
200
+ "types": "./dist/events/index.d.ts",
201
+ "default": "./dist/events/index.js"
202
+ },
203
+ "./middleware": {
204
+ "types": "./dist/middleware/index.d.ts",
205
+ "default": "./dist/middleware/index.js"
206
+ },
207
+ "./queue": {
208
+ "types": "./dist/queue/index.d.ts",
209
+ "default": "./dist/queue/index.js"
210
+ },
211
+ "./queue/unstorage": {
212
+ "types": "./dist/queue/unstorage-queue.d.ts",
213
+ "default": "./dist/queue/unstorage-queue.js"
214
+ },
215
+ "./queue/sqs": {
216
+ "types": "./dist/queue/sqs-queue.d.ts",
217
+ "default": "./dist/queue/sqs-queue.js"
218
+ },
219
+ "./queue/pg-boss": {
220
+ "types": "./dist/queue/pg-boss-queue.d.ts",
221
+ "default": "./dist/queue/pg-boss-queue.js"
222
+ },
223
+ "./queue/bullmq": {
224
+ "types": "./dist/queue/bullmq-queue.d.ts",
225
+ "default": "./dist/queue/bullmq-queue.js"
226
+ },
227
+ "./test": {
228
+ "types": "./dist/test/index.d.ts",
229
+ "default": "./dist/test/index.js"
230
+ },
154
231
  "./providers/sendgrid": {
155
232
  "types": "./dist/providers/sendgrid/index.d.ts",
156
233
  "default": "./dist/providers/sendgrid/index.js"
@@ -215,10 +292,42 @@
215
292
  "types": "./dist/providers/sweego/index.d.ts",
216
293
  "default": "./dist/providers/sweego/index.js"
217
294
  },
295
+ "./providers/mailchannels": {
296
+ "types": "./dist/providers/mailchannels/index.d.ts",
297
+ "default": "./dist/providers/mailchannels/index.js"
298
+ },
299
+ "./providers/cloudflare-email": {
300
+ "types": "./dist/providers/cloudflare-email/index.d.ts",
301
+ "default": "./dist/providers/cloudflare-email/index.js"
302
+ },
303
+ "./providers/loops": {
304
+ "types": "./dist/providers/loops/index.d.ts",
305
+ "default": "./dist/providers/loops/index.js"
306
+ },
307
+ "./providers/sparkpost": {
308
+ "types": "./dist/providers/sparkpost/index.d.ts",
309
+ "default": "./dist/providers/sparkpost/index.js"
310
+ },
311
+ "./providers/netcore": {
312
+ "types": "./dist/providers/netcore/index.d.ts",
313
+ "default": "./dist/providers/netcore/index.js"
314
+ },
315
+ "./providers/outlook365": {
316
+ "types": "./dist/providers/outlook365/index.d.ts",
317
+ "default": "./dist/providers/outlook365/index.js"
318
+ },
218
319
  "./utils/parse-address": {
219
320
  "types": "./dist/utils/parse-address.d.ts",
220
321
  "default": "./dist/utils/parse-address.js"
221
322
  },
323
+ "./utils/parse-eml": {
324
+ "types": "./dist/utils/parse-eml.d.ts",
325
+ "default": "./dist/utils/parse-eml.js"
326
+ },
327
+ "./utils/result": {
328
+ "types": "./dist/utils/result.d.ts",
329
+ "default": "./dist/utils/result.js"
330
+ },
222
331
  "./utils/format-email-address": {
223
332
  "types": "./dist/utils/format-email-address.d.ts",
224
333
  "default": "./dist/utils/format-email-address.js"
@@ -251,6 +360,10 @@
251
360
  "types": "./dist/utils/validation/verify-email.d.ts",
252
361
  "default": "./dist/utils/validation/verify-email.js"
253
362
  },
363
+ "./validation/check-feature-support": {
364
+ "types": "./dist/utils/validation/check-feature-support.d.ts",
365
+ "default": "./dist/utils/validation/check-feature-support.js"
366
+ },
254
367
  "./utils/normalize-email-aliases": {
255
368
  "types": "./dist/utils/normalize-email-aliases.d.ts",
256
369
  "default": "./dist/utils/normalize-email-aliases.js"
@@ -263,21 +376,26 @@
263
376
  "CHANGELOG.md"
264
377
  ],
265
378
  "dependencies": {
266
- "@visulima/disposable-email-domains": "1.0.0-alpha.3",
267
- "html-to-text": "^9.0.5",
268
- "ical-generator": "^10.0.0",
269
- "lru-cache": "^11.2.4",
379
+ "@visulima/disposable-email-domains": "1.0.0-alpha.17",
380
+ "html-to-text": "^10.0.0",
381
+ "ical-generator": "11.0.0",
382
+ "lru-cache": "11.5.1",
270
383
  "mime": "^4.1.0"
271
384
  },
272
385
  "peerDependencies": {
273
386
  "@opentelemetry/api": "^1.0.0 || ^2.0.0",
274
- "@react-email/render": "^2.0.0",
387
+ "@react-email/render": "^2.0.9",
275
388
  "@vue-email/render": "0.0.9",
276
- "asn1js": "^3.0.0",
277
- "handlebars": "^4.7.8",
278
- "mjml": "^4.15.3",
389
+ "asn1js": "3.0.10",
390
+ "fast-xml-parser": "^4.5.0",
391
+ "handlebars": "4.7.9",
392
+ "jsx-email": "^2.0.0",
393
+ "juice": "^11.0.0",
394
+ "liquidjs": "^10.0.0",
395
+ "mjml": "5.3.0",
279
396
  "nodemailer": ">=7",
280
- "pkijs": "^3.0.0"
397
+ "pkijs": "3.4.0",
398
+ "unstorage": "^1.13.0"
281
399
  },
282
400
  "peerDependenciesMeta": {
283
401
  "@opentelemetry/api": {
@@ -292,9 +410,21 @@
292
410
  "asn1js": {
293
411
  "optional": true
294
412
  },
413
+ "fast-xml-parser": {
414
+ "optional": true
415
+ },
295
416
  "handlebars": {
296
417
  "optional": true
297
418
  },
419
+ "jsx-email": {
420
+ "optional": true
421
+ },
422
+ "juice": {
423
+ "optional": true
424
+ },
425
+ "liquidjs": {
426
+ "optional": true
427
+ },
298
428
  "mjml": {
299
429
  "optional": true
300
430
  },
@@ -303,10 +433,13 @@
303
433
  },
304
434
  "pkijs": {
305
435
  "optional": true
436
+ },
437
+ "unstorage": {
438
+ "optional": true
306
439
  }
307
440
  },
308
441
  "engines": {
309
- "node": ">=22.13 <=25.x"
442
+ "node": "^22.14.0 || >=24.10.0"
310
443
  },
311
444
  "publishConfig": {
312
445
  "access": "public",
@@ -1,64 +0,0 @@
1
- import type { Buffer } from "node:buffer";
2
- /**
3
- * Detects MIME type from filename using mime package.
4
- * Falls back to application/octet-stream if not found.
5
- * @param filename The filename or path.
6
- * @returns MIME type or application/octet-stream as fallback.
7
- */
8
- export declare const detectMimeType: (filename: string) => string;
9
- /**
10
- * Generates a Content-ID for inline attachments.
11
- * @param filename The filename to generate CID from.
12
- * @returns A unique Content-ID string.
13
- */
14
- export declare const generateContentId: (filename: string) => string;
15
- /**
16
- * Reads file and returns its content as Buffer.
17
- * @param filePath Path to the file.
18
- * @returns Buffer containing file content.
19
- */
20
- export declare const readFileAsBuffer: (filePath: string) => Promise<Buffer>;
21
- /**
22
- * Attachment options for helper methods
23
- */
24
- export interface AttachmentOptions {
25
- /**
26
- * Content-ID for inline attachments (used in HTML with cid:).
27
- * If not provided and contentDisposition is 'inline', will be auto-generated.
28
- */
29
- cid?: string;
30
- /**
31
- * Content disposition type.
32
- * 'attachment' (default) or 'inline'.
33
- */
34
- contentDisposition?: "attachment" | "inline";
35
- /**
36
- * MIME type of the attachment.
37
- * If not provided, will be detected from filename.
38
- */
39
- contentType?: string;
40
- /**
41
- * Content transfer encoding.
42
- * Examples: 'base64', '7bit', 'quoted-printable'.
43
- */
44
- encoding?: string;
45
- /**
46
- * Custom filename.
47
- * Used when different from the file path.
48
- */
49
- filename?: string;
50
- /**
51
- * Custom headers for this attachment.
52
- */
53
- headers?: Record<string, string>;
54
- }
55
- /**
56
- * Attachment data options (for raw data attachments)
57
- */
58
- export interface AttachmentDataOptions extends AttachmentOptions {
59
- /**
60
- * Filename for the attachment.
61
- * Required for raw data attachments.
62
- */
63
- filename: string;
64
- }
@@ -1,48 +0,0 @@
1
- import type { EmailOptions } from "../types.d.ts";
2
- import type { DkimOptions, EmailSigner } from "./types.d.ts";
3
- /**
4
- * DKIM signer implementation
5
- */
6
- export declare class DkimSigner implements EmailSigner {
7
- /**
8
- * Sanitizes a display name for use in quoted email headers per RFC 5322.
9
- * Removes/replaces CR, LF, tabs with space, escapes backslashes and quotes,
10
- * and strips non-printable control characters.
11
- * @param name The display name to sanitize.
12
- * @returns The sanitized display name, or empty string if nothing remains.
13
- */
14
- private static sanitizeDisplayName;
15
- /**
16
- * Formats an email address for use in email headers.
17
- * @param address The email address object to format.
18
- * @param address.email The email address string.
19
- * @param address.name Optional display name for the email address.
20
- * @returns The formatted email address string in RFC 5322 format.
21
- */
22
- private static formatAddress;
23
- /**
24
- * Formats email addresses for headers.
25
- * @param addresses The email address(es) to format (single or array).
26
- * @returns The formatted email addresses string (comma-separated if multiple).
27
- */
28
- private static formatAddresses;
29
- private readonly options;
30
- /**
31
- * Creates a new DKIM signer.
32
- * @param options DKIM signing options.
33
- */
34
- constructor(options: DkimOptions);
35
- /**
36
- * Signs an email message with DKIM.
37
- * @param email The email options to sign.
38
- * @returns The email options with DKIM signature header added.
39
- * @throws {Error} When signing fails (e.g., invalid private key).
40
- */
41
- sign(email: EmailOptions): Promise<EmailOptions>;
42
- }
43
- /**
44
- * Creates a DKIM signer instance.
45
- * @param options DKIM signing options.
46
- * @returns A new DkimSigner instance.
47
- */
48
- export declare const createDkimSigner: (options: DkimOptions) => DkimSigner;
@@ -1,53 +0,0 @@
1
- import type { EmailOptions } from "../types.d.ts";
2
- import type { EmailEncrypter, SmimeEncryptOptions } from "./types.d.ts";
3
- /**
4
- * S/MIME encrypter implementation using PKIjs
5
- * Note: Requires pkijs and asn1js for S/MIME operations
6
- * Uses Node.js crypto for all cryptographic operations
7
- */
8
- export declare class SmimeEncrypter implements EmailEncrypter {
9
- /**
10
- * Collects and normalizes all recipients (to, cc, bcc) from email options.
11
- * Normalizes each to an array, extracts email addresses, and deduplicates.
12
- * @param email The email options containing recipients.
13
- * @returns An array of unique email addresses (strings).
14
- */
15
- private static collectRecipients;
16
- /**
17
- * Formats an email address for use in email headers.
18
- * @param address The email address to format (string or EmailAddress object).
19
- * @returns The formatted email address string in RFC 5322 format.
20
- */
21
- private static formatAddress;
22
- /**
23
- * Formats email addresses for use in email headers.
24
- * @param addresses The email addresses to format (single or array, string or EmailAddress objects).
25
- * @returns The formatted email addresses string (comma-separated if multiple).
26
- */
27
- private static formatAddresses;
28
- private readonly options;
29
- /**
30
- * Creates a new S/MIME encrypter.
31
- * @param options S/MIME encryption options.
32
- */
33
- constructor(options: SmimeEncryptOptions);
34
- /**
35
- * Encrypts an email message with S/MIME.
36
- * @param email The email options to encrypt.
37
- * @returns The encrypted email options.
38
- * @throws {Error} When encryption fails (e.g., invalid certificate).
39
- */
40
- encrypt(email: EmailOptions): Promise<EmailOptions>;
41
- /**
42
- * Builds the email message string from email options.
43
- * @param email The email options to build the message from.
44
- * @returns The formatted email message as a string.
45
- */
46
- private buildMessage;
47
- }
48
- /**
49
- * Creates a new S/MIME encrypter instance.
50
- * @param options The S/MIME encryption options.
51
- * @returns A new SmimeEncrypter instance ready to encrypt emails.
52
- */
53
- export declare const createSmimeEncrypter: (options: SmimeEncryptOptions) => SmimeEncrypter;
@@ -1,48 +0,0 @@
1
- import type { EmailOptions } from "../types.d.ts";
2
- import type { EmailSigner, SmimeSignOptions } from "./types.d.ts";
3
- /**
4
- * S/MIME signer implementation using PKIjs
5
- * Note: Requires pkijs and asn1js for S/MIME operations
6
- * Uses Node.js crypto for all cryptographic operations
7
- */
8
- export declare class SmimeSigner implements EmailSigner {
9
- /**
10
- * Formats an email address for use in email headers.
11
- * @param address The email address object to format.
12
- * @param address.email The email address string.
13
- * @param address.name Optional display name for the email address.
14
- * @returns The formatted email address string in RFC 5322 format.
15
- */
16
- private static formatAddress;
17
- private readonly options;
18
- /**
19
- * Creates a new S/MIME signer.
20
- * @param options S/MIME signing options.
21
- */
22
- constructor(options: SmimeSignOptions);
23
- /**
24
- * Signs an email message with S/MIME.
25
- * @param email The email options to sign.
26
- * @returns The email options with S/MIME signature.
27
- * @throws {Error} When signing fails (e.g., invalid certificate/key).
28
- */
29
- sign(email: EmailOptions): Promise<EmailOptions>;
30
- /**
31
- * Builds the email message string from email options.
32
- * @param email The email options to build the message from.
33
- * @returns The formatted email message as a string.
34
- */
35
- private buildMessage;
36
- /**
37
- * Formats email addresses for use in email headers.
38
- * @param addresses The email addresses to format (single or array).
39
- * @returns The formatted email addresses string (comma-separated if multiple).
40
- */
41
- private formatAddresses;
42
- }
43
- /**
44
- * Creates a new S/MIME signer instance.
45
- * @param options The S/MIME signing options.
46
- * @returns A new SmimeSigner instance ready to sign emails.
47
- */
48
- export declare const createSmimeSigner: (options: SmimeSignOptions) => SmimeSigner;
@@ -1,101 +0,0 @@
1
- import type { EmailOptions } from "../types.d.ts";
2
- /**
3
- * Options for DKIM signing
4
- */
5
- export interface DkimOptions {
6
- /**
7
- * Body canonicalization algorithm ('simple' or 'relaxed')
8
- * Default: 'simple'
9
- */
10
- bodyCanon?: "relaxed" | "simple";
11
- /**
12
- * Domain name used for DKIM signing
13
- */
14
- domainName: string;
15
- /**
16
- * Header canonicalization algorithm ('simple' or 'relaxed')
17
- * Default: 'simple'
18
- */
19
- headerCanon?: "relaxed" | "simple";
20
- /**
21
- * List of header names to ignore when signing
22
- */
23
- headersToIgnore?: string[];
24
- /**
25
- * Key selector used for DNS lookup
26
- */
27
- keySelector: string;
28
- /**
29
- * Passphrase for the private key (if encrypted)
30
- */
31
- passphrase?: string;
32
- /**
33
- * Private key for signing (PEM format)
34
- * Can be a string with the key content or a path prefixed with 'file://'
35
- */
36
- privateKey: string;
37
- }
38
- /**
39
- * Options for S/MIME signing
40
- */
41
- export interface SmimeSignOptions {
42
- /**
43
- * Path to the certificate file (PEM format)
44
- */
45
- certificate: string;
46
- /**
47
- * Path to intermediate certificates (optional)
48
- */
49
- intermediateCerts?: string[];
50
- /**
51
- * Signing options flags
52
- * Reserved for future use
53
- */
54
- options?: number;
55
- /**
56
- * Passphrase for the private key (if encrypted)
57
- */
58
- passphrase?: string;
59
- /**
60
- * Path to the private key file (PEM format)
61
- */
62
- privateKey: string;
63
- }
64
- /**
65
- * Options for S/MIME encryption
66
- */
67
- export interface SmimeEncryptOptions {
68
- /**
69
- * Encryption algorithm (cipher)
70
- * Supported: 'aes-256-cbc', 'aes-192-cbc', 'aes-128-cbc'
71
- * Default: 'aes-256-cbc'
72
- */
73
- algorithm?: string;
74
- /**
75
- * Certificate(s) for encryption
76
- * Can be a single certificate path or a map of email -> certificate path
77
- */
78
- certificates: string | Record<string, string>;
79
- }
80
- /**
81
- * Interface for email signers
82
- */
83
- export interface EmailSigner {
84
- /**
85
- * Sign an email message
86
- * @param email The email options to sign
87
- * @returns The signed email options (may include additional headers or modified content)
88
- */
89
- sign: (email: EmailOptions) => Promise<EmailOptions>;
90
- }
91
- /**
92
- * Interface for email encrypters
93
- */
94
- export interface EmailEncrypter {
95
- /**
96
- * Encrypt an email message
97
- * @param email The email options to encrypt
98
- * @returns The encrypted email options (content will be encrypted)
99
- */
100
- encrypt: (email: EmailOptions) => Promise<EmailOptions>;
101
- }
@@ -1,13 +0,0 @@
1
- import MailMessage from "./mail-message.d.ts";
2
- /**
3
- * Draft mail message - extends MailMessage with X-Unsent header automatically set.
4
- * Draft messages cannot be sent directly - they must be converted to regular messages first.
5
- */
6
- export declare class DraftMailMessage extends MailMessage {
7
- /**
8
- * Creates a new draft mail message.
9
- * The X-Unsent header is automatically set to '1' to mark this as a draft.
10
- */
11
- constructor();
12
- }
13
- export default DraftMailMessage;
@@ -1,17 +0,0 @@
1
- import { VisulimaError } from "@visulima/error";
2
- /**
3
- * Base error class for email package operations.
4
- * @param component The component name where the error occurred.
5
- * @param message The error message describing what went wrong.
6
- * @param options Optional error options including cause, code, and hint.
7
- */
8
- declare class EmailError extends VisulimaError {
9
- readonly component: string;
10
- readonly code?: string;
11
- constructor(component: string, message: string, options?: {
12
- cause?: Error | unknown;
13
- code?: string;
14
- hint?: string | string[];
15
- });
16
- }
17
- export default EmailError;
@@ -1,10 +0,0 @@
1
- import EmailError from "./email-error.d.ts";
2
- /**
3
- * Error for missing required options
4
- * @param component The component name where the error occurred
5
- * @param name The name(s) of the missing required option(s)
6
- */
7
- declare class RequiredOptionError extends EmailError {
8
- constructor(component: string, name: string | string[]);
9
- }
10
- export default RequiredOptionError;