@visulima/email 1.0.0-alpha.9 → 1.0.0

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 (396) hide show
  1. package/CHANGELOG.md +775 -0
  2. package/LICENSE.md +541 -847
  3. package/README.md +212 -191
  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-BxqGSLMN.js +1 -0
  21. package/dist/packem_shared/EmailError-B-sEf3bp.js +1 -0
  22. package/dist/packem_shared/Mail-BEuzrB00.js +1 -0
  23. package/dist/packem_shared/MailMessage-D9k5gYrd.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-D81_wUA1.js +1 -0
  35. package/dist/packem_shared/arcMessageSignatureBase-BY4j0TxM.js +17 -0
  36. package/dist/packem_shared/attachment-processor-CMp7qqMI.js +1 -0
  37. package/dist/packem_shared/awsSesProvider-BGZJUIep.js +32 -0
  38. package/dist/packem_shared/azureProvider-CmcK4bsf.js +1 -0
  39. package/dist/packem_shared/brevoProvider-C1BDXr41.js +1 -0
  40. package/dist/packem_shared/build-mime-message-B6927SQy.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-Bv-ty-74.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-CF_RUjqo.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-lHyGrXgZ.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-DyloxzNC.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-CPtBT6Th.js} +1 -1
  73. package/dist/packem_shared/mailPaceProvider-CJEvOFBh.js +1 -0
  74. package/dist/packem_shared/mailchannelsProvider-osRkW_tz.js +1 -0
  75. package/dist/packem_shared/mailerSendProvider-C_6LzARK.js +1 -0
  76. package/dist/packem_shared/mailgunProvider-DkISvMPe.js +1 -0
  77. package/dist/packem_shared/mailjetProvider-CV0i4Xzh.js +1 -0
  78. package/dist/packem_shared/mailomatProvider-B5YFonEO.js +1 -0
  79. package/dist/packem_shared/mailtrapProvider-C4ZquIPz.js +1 -0
  80. package/dist/packem_shared/make-request-BlK_B72c.js +1 -0
  81. package/dist/packem_shared/mandrillProvider-DWPFh_Sj.js +1 -0
  82. package/dist/packem_shared/mockProvider-Behywbl1.js +1 -0
  83. package/dist/packem_shared/netcoreProvider-C5TEciaN.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-63ggDpqV.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-yTlrJVEp.js +1 -0
  99. package/dist/packem_shared/postProcessHtml-DqKi2Ucg.js +1 -0
  100. package/dist/packem_shared/postalProvider-CRX_bMYD.js +1 -0
  101. package/dist/packem_shared/postmarkProvider-CDx85Yge.js +1 -0
  102. package/dist/packem_shared/provider-base-C7PuopYK.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-CiclWxzr.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-BcND48qO.js +1 -0
  111. package/dist/packem_shared/sendGridProvider-D8ZLgY62.js +1 -0
  112. package/dist/packem_shared/smtpProvider-Bm0yP97W.js +25 -0
  113. package/dist/packem_shared/sparkpostProvider-CTYfSRaV.js +1 -0
  114. package/dist/packem_shared/sweegoProvider-DOoin_vi.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-DKBPSHPj.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 +155 -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/validate-email.d.ts +5 -5
  249. package/dist/utils/validation/validate-email.js +1 -1
  250. package/dist/webhooks/index.d.ts +231 -0
  251. package/dist/webhooks/index.js +1 -0
  252. package/package.json +177 -67
  253. package/dist/attachment-helpers.d.ts +0 -64
  254. package/dist/crypto/dkim-signer.d.ts +0 -48
  255. package/dist/crypto/smime-encrypter.d.ts +0 -53
  256. package/dist/crypto/smime-signer.d.ts +0 -48
  257. package/dist/crypto/types.d.ts +0 -101
  258. package/dist/draft-mail-message.d.ts +0 -13
  259. package/dist/errors/email-error.d.ts +0 -17
  260. package/dist/errors/required-option-error.d.ts +0 -10
  261. package/dist/mail-message.d.ts +0 -425
  262. package/dist/mail.d.ts +0 -206
  263. package/dist/packem_shared/DkimSigner-pFd4c3fZ.js +0 -18
  264. package/dist/packem_shared/EmailError-zm2ffVav.js +0 -1
  265. package/dist/packem_shared/Mail-6Bltpy_p.js +0 -1
  266. package/dist/packem_shared/MailMessage-B76GPBBA.js +0 -1
  267. package/dist/packem_shared/RequiredOptionError-CevW3u2K.js +0 -1
  268. package/dist/packem_shared/SmimeEncrypter-CBevU534.js +0 -6
  269. package/dist/packem_shared/SmimeSigner-CObA4jzT.js +0 -8
  270. package/dist/packem_shared/address-formatter-Cm_E_ZMa.js +0 -1
  271. package/dist/packem_shared/ahaSendProvider-DlFKEQ6D.js +0 -1
  272. package/dist/packem_shared/attachment-processor-2rHmfa7j.js +0 -1
  273. package/dist/packem_shared/awsSesProvider-Ba-eVJxZ.js +0 -32
  274. package/dist/packem_shared/azureProvider-CQYAkgVF.js +0 -1
  275. package/dist/packem_shared/brevoProvider-5p6jjiK9.js +0 -1
  276. package/dist/packem_shared/build-mime-message-IYaUqqPJ.js +0 -2
  277. package/dist/packem_shared/create-logger-BiWdqFNg.js +0 -1
  278. package/dist/packem_shared/defineProvider-B9rSklAJ.js +0 -1
  279. package/dist/packem_shared/detectMimeType-S8WRsNtY.js +0 -1
  280. package/dist/packem_shared/failoverProvider-CAHQQueo.js +0 -1
  281. package/dist/packem_shared/generate-boundary-Cx8nXYS0.js +0 -1
  282. package/dist/packem_shared/generate-message-id-D4uA8gkj.js +0 -1
  283. package/dist/packem_shared/headers-to-record-Qo124ImV.js +0 -1
  284. package/dist/packem_shared/httpProvider-CZD6LZX3.js +0 -1
  285. package/dist/packem_shared/infobipProvider-CtLwrUaP.js +0 -1
  286. package/dist/packem_shared/mailPaceProvider-B6yKvh6z.js +0 -1
  287. package/dist/packem_shared/mailerSendProvider-CeeIXFnW.js +0 -1
  288. package/dist/packem_shared/mailgunProvider-mmjKzouh.js +0 -1
  289. package/dist/packem_shared/mailjetProvider-DwN6i0VA.js +0 -1
  290. package/dist/packem_shared/mailomatProvider-DMQmjKHT.js +0 -1
  291. package/dist/packem_shared/mailtrapProvider-BN3UBEQw.js +0 -1
  292. package/dist/packem_shared/make-request-BDzF9W9D.js +0 -1
  293. package/dist/packem_shared/mandrillProvider-370y7CLu.js +0 -1
  294. package/dist/packem_shared/mockProvider-DN5ZwutD.js +0 -1
  295. package/dist/packem_shared/nodemailerProvider-_w8QXMU-.js +0 -1
  296. package/dist/packem_shared/opentelemetryProvider-C_ZXOLSd.js +0 -1
  297. package/dist/packem_shared/plunkProvider-DfJumQ4U.js +0 -1
  298. package/dist/packem_shared/postalProvider-Bavx2FcH.js +0 -1
  299. package/dist/packem_shared/postmarkProvider-DFC0uvjO.js +0 -1
  300. package/dist/packem_shared/provider-base-Cmzx6BTO.js +0 -1
  301. package/dist/packem_shared/readFile-BlZxbhCU-C8bCdiA2.js +0 -1
  302. package/dist/packem_shared/resendProvider-CfqU7UdE.js +0 -1
  303. package/dist/packem_shared/roundRobinProvider-1WQnuKR8.js +0 -1
  304. package/dist/packem_shared/sanitize-header-wWav-Scu.js +0 -1
  305. package/dist/packem_shared/scalewayProvider-be1HPimL.js +0 -1
  306. package/dist/packem_shared/sendGridProvider-BVI1sq3n.js +0 -1
  307. package/dist/packem_shared/smtpProvider-BV-ufR53.js +0 -23
  308. package/dist/packem_shared/sweegoProvider-7419CSAq.js +0 -1
  309. package/dist/packem_shared/validate-email-options-DfJ7llf8.js +0 -1
  310. package/dist/packem_shared/zeptomailProvider-C2lh0Xmo.js +0 -1
  311. package/dist/providers/ahasend/provider.d.ts +0 -7
  312. package/dist/providers/ahasend/types.d.ts +0 -28
  313. package/dist/providers/aws-ses/provider.d.ts +0 -8
  314. package/dist/providers/aws-ses/types.d.ts +0 -38
  315. package/dist/providers/azure/provider.d.ts +0 -7
  316. package/dist/providers/azure/types.d.ts +0 -44
  317. package/dist/providers/brevo/provider.d.ts +0 -7
  318. package/dist/providers/brevo/types.d.ts +0 -57
  319. package/dist/providers/failover/provider.d.ts +0 -7
  320. package/dist/providers/failover/types.d.ts +0 -19
  321. package/dist/providers/http/provider.d.ts +0 -7
  322. package/dist/providers/http/types.d.ts +0 -27
  323. package/dist/providers/infobip/provider.d.ts +0 -7
  324. package/dist/providers/infobip/types.d.ts +0 -48
  325. package/dist/providers/mailcrab/provider.d.ts +0 -9
  326. package/dist/providers/mailcrab/types.d.ts +0 -22
  327. package/dist/providers/mailersend/provider.d.ts +0 -7
  328. package/dist/providers/mailersend/types.d.ts +0 -43
  329. package/dist/providers/mailgun/provider.d.ts +0 -7
  330. package/dist/providers/mailgun/types.d.ts +0 -65
  331. package/dist/providers/mailjet/provider.d.ts +0 -7
  332. package/dist/providers/mailjet/types.d.ts +0 -64
  333. package/dist/providers/mailomat/provider.d.ts +0 -7
  334. package/dist/providers/mailomat/types.d.ts +0 -32
  335. package/dist/providers/mailpace/provider.d.ts +0 -7
  336. package/dist/providers/mailpace/types.d.ts +0 -44
  337. package/dist/providers/mailtrap/provider.d.ts +0 -7
  338. package/dist/providers/mailtrap/types.d.ts +0 -36
  339. package/dist/providers/mandrill/provider.d.ts +0 -7
  340. package/dist/providers/mandrill/types.d.ts +0 -79
  341. package/dist/providers/mock/provider.d.ts +0 -8
  342. package/dist/providers/mock/types.d.ts +0 -50
  343. package/dist/providers/nodemailer/provider.d.ts +0 -7
  344. package/dist/providers/nodemailer/types.d.ts +0 -30
  345. package/dist/providers/opentelemetry/provider.d.ts +0 -8
  346. package/dist/providers/opentelemetry/types.d.ts +0 -31
  347. package/dist/providers/plunk/provider.d.ts +0 -7
  348. package/dist/providers/plunk/types.d.ts +0 -30
  349. package/dist/providers/postal/provider.d.ts +0 -7
  350. package/dist/providers/postal/types.d.ts +0 -40
  351. package/dist/providers/postmark/provider.d.ts +0 -7
  352. package/dist/providers/postmark/types.d.ts +0 -52
  353. package/dist/providers/provider.d.ts +0 -27
  354. package/dist/providers/resend/provider.d.ts +0 -7
  355. package/dist/providers/resend/types.d.ts +0 -43
  356. package/dist/providers/roundrobin/provider.d.ts +0 -7
  357. package/dist/providers/roundrobin/types.d.ts +0 -19
  358. package/dist/providers/scaleway/provider.d.ts +0 -7
  359. package/dist/providers/scaleway/types.d.ts +0 -36
  360. package/dist/providers/sendgrid/provider.d.ts +0 -7
  361. package/dist/providers/sendgrid/types.d.ts +0 -76
  362. package/dist/providers/smtp/provider.d.ts +0 -7
  363. package/dist/providers/smtp/types.d.ts +0 -63
  364. package/dist/providers/sweego/provider.d.ts +0 -7
  365. package/dist/providers/sweego/types.d.ts +0 -32
  366. package/dist/providers/utils/address-formatter.d.ts +0 -139
  367. package/dist/providers/utils/attachment-processor.d.ts +0 -58
  368. package/dist/providers/utils/index.d.ts +0 -4
  369. package/dist/providers/utils/payload-builder.d.ts +0 -78
  370. package/dist/providers/utils/provider-base.d.ts +0 -69
  371. package/dist/providers/zeptomail/provider.d.ts +0 -7
  372. package/dist/providers/zeptomail/types.d.ts +0 -29
  373. package/dist/template-engines/types.d.ts +0 -8
  374. package/dist/types.d.ts +0 -203
  375. package/dist/utils/build-mime-message.d.ts +0 -8
  376. package/dist/utils/create-logger.d.ts +0 -16
  377. package/dist/utils/format-email-addresses.d.ts +0 -8
  378. package/dist/utils/generate-boundary.d.ts +0 -7
  379. package/dist/utils/generate-message-id.d.ts +0 -6
  380. package/dist/utils/headers-to-record.d.ts +0 -9
  381. package/dist/utils/is-port-available.d.ts +0 -9
  382. package/dist/utils/make-request.d.ts +0 -18
  383. package/dist/utils/retry.d.ts +0 -10
  384. package/dist/utils/sanitize-header.d.ts +0 -14
  385. package/dist/utils/to-base64.d.ts +0 -8
  386. package/dist/utils/validation/check-mx-records.d.ts +0 -42
  387. package/dist/utils/validation/check-mx-records.js +0 -1
  388. package/dist/utils/validation/disposable-email-domains.d.ts +0 -13
  389. package/dist/utils/validation/disposable-email-domains.js +0 -1
  390. package/dist/utils/validation/role-accounts.d.ts +0 -21
  391. package/dist/utils/validation/role-accounts.js +0 -1
  392. package/dist/utils/validation/validate-email-options.d.ts +0 -8
  393. package/dist/utils/validation/verify-email.d.ts +0 -47
  394. package/dist/utils/validation/verify-email.js +0 -1
  395. package/dist/utils/validation/verify-smtp.d.ts +0 -39
  396. package/dist/utils/validation/verify-smtp.js +0 -4
@@ -0,0 +1,494 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ interface Context {
5
+ /**
6
+ * Get a value from the context.
7
+ *
8
+ * @param key key which identifies a context value
9
+ */
10
+ getValue(key: symbol): unknown;
11
+ /**
12
+ * Create a new context which inherits from this context and has
13
+ * the given key set to the given value.
14
+ *
15
+ * @param key context key for which to set the value
16
+ * @param value value to set for the given key
17
+ */
18
+ setValue(key: symbol, value: unknown): Context;
19
+ /**
20
+ * Return a new context which inherits from this context but does
21
+ * not contain a value for the given key.
22
+ *
23
+ * @param key context key for which to clear a value
24
+ */
25
+ deleteValue(key: symbol): Context;
26
+ }
27
+ /**
28
+ * Attributes is a map from string to attribute values.
29
+ *
30
+ * Note: only the own enumerable keys are counted as valid attribute keys.
31
+ *
32
+ * @since 1.3.0
33
+ */
34
+ interface Attributes {
35
+ [attributeKey: string]: AttributeValue | undefined;
36
+ }
37
+ /**
38
+ * Attribute values may be any non-nullish primitive value except an object.
39
+ *
40
+ * null or undefined attribute values are invalid and will result in undefined behavior.
41
+ *
42
+ * @since 1.3.0
43
+ */
44
+ type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
45
+ interface ExceptionWithCode {
46
+ code: string | number;
47
+ name?: string;
48
+ message?: string;
49
+ stack?: string;
50
+ }
51
+ interface ExceptionWithMessage {
52
+ code?: string | number;
53
+ message: string;
54
+ name?: string;
55
+ stack?: string;
56
+ }
57
+ interface ExceptionWithName {
58
+ code?: string | number;
59
+ message?: string;
60
+ name: string;
61
+ stack?: string;
62
+ }
63
+ /**
64
+ * Defines Exception.
65
+ *
66
+ * string or an object with one of (message or name or code) and optional stack
67
+ *
68
+ * @since 1.0.0
69
+ */
70
+ type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string;
71
+ /**
72
+ * Defines High-Resolution Time.
73
+ *
74
+ * The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970.
75
+ * The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds.
76
+ * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150.
77
+ * The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds:
78
+ * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210.
79
+ * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:
80
+ * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000.
81
+ * This is represented in HrTime format as [1609504210, 150000000].
82
+ *
83
+ * @since 1.0.0
84
+ */
85
+ type HrTime = [number, number];
86
+ /**
87
+ * Defines TimeInput.
88
+ *
89
+ * hrtime, epoch milliseconds, performance.now() or Date
90
+ *
91
+ * @since 1.0.0
92
+ */
93
+ type TimeInput = HrTime | number | Date;
94
+ /**
95
+ * @deprecated please use {@link Attributes}
96
+ * @since 1.0.0
97
+ */
98
+ type SpanAttributes = Attributes;
99
+ /**
100
+ * @deprecated please use {@link AttributeValue}
101
+ * @since 1.0.0
102
+ */
103
+ type SpanAttributeValue = AttributeValue;
104
+ /**
105
+ * @since 1.0.0
106
+ */
107
+ interface TraceState {
108
+ /**
109
+ * Create a new TraceState which inherits from this TraceState and has the
110
+ * given key set.
111
+ * The new entry will always be added in the front of the list of states.
112
+ *
113
+ * @param key key of the TraceState entry.
114
+ * @param value value of the TraceState entry.
115
+ */
116
+ set(key: string, value: string): TraceState;
117
+ /**
118
+ * Return a new TraceState which inherits from this TraceState but does not
119
+ * contain the given key.
120
+ *
121
+ * @param key the key for the TraceState entry to be removed.
122
+ */
123
+ unset(key: string): TraceState;
124
+ /**
125
+ * Returns the value to which the specified key is mapped, or `undefined` if
126
+ * this map contains no mapping for the key.
127
+ *
128
+ * @param key with which the specified value is to be associated.
129
+ * @returns the value to which the specified key is mapped, or `undefined` if
130
+ * this map contains no mapping for the key.
131
+ */
132
+ get(key: string): string | undefined;
133
+ /**
134
+ * Serializes the TraceState to a `list` as defined below. The `list` is a
135
+ * series of `list-members` separated by commas `,`, and a list-member is a
136
+ * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs
137
+ * surrounding `list-members` are ignored. There can be a maximum of 32
138
+ * `list-members` in a `list`.
139
+ *
140
+ * @returns the serialized string.
141
+ */
142
+ serialize(): string;
143
+ }
144
+ /**
145
+ * A SpanContext represents the portion of a {@link Span} which must be
146
+ * serialized and propagated along side of a {@link Baggage}.
147
+ *
148
+ * @since 1.0.0
149
+ */
150
+ interface SpanContext {
151
+ /**
152
+ * The ID of the trace that this span belongs to. It is worldwide unique
153
+ * with practically sufficient probability by being made as 16 randomly
154
+ * generated bytes, encoded as a 32 lowercase hex characters corresponding to
155
+ * 128 bits.
156
+ */
157
+ traceId: string;
158
+ /**
159
+ * The ID of the Span. It is globally unique with practically sufficient
160
+ * probability by being made as 8 randomly generated bytes, encoded as a 16
161
+ * lowercase hex characters corresponding to 64 bits.
162
+ */
163
+ spanId: string;
164
+ /**
165
+ * Only true if the SpanContext was propagated from a remote parent.
166
+ */
167
+ isRemote?: boolean;
168
+ /**
169
+ * Trace flags to propagate.
170
+ *
171
+ * It is represented as 1 byte (bitmap). Bit to represent whether trace is
172
+ * sampled or not. When set, the least significant bit documents that the
173
+ * caller may have recorded trace data. A caller who does not record trace
174
+ * data out-of-band leaves this flag unset.
175
+ *
176
+ * see {@link TraceFlags} for valid flag values.
177
+ */
178
+ traceFlags: number;
179
+ /**
180
+ * Tracing-system-specific info to propagate.
181
+ *
182
+ * The tracestate field value is a `list` as defined below. The `list` is a
183
+ * series of `list-members` separated by commas `,`, and a list-member is a
184
+ * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs
185
+ * surrounding `list-members` are ignored. There can be a maximum of 32
186
+ * `list-members` in a `list`.
187
+ * More Info: https://www.w3.org/TR/trace-context/#tracestate-field
188
+ *
189
+ * Examples:
190
+ * Single tracing system (generic format):
191
+ * tracestate: rojo=00f067aa0ba902b7
192
+ * Multiple tracing systems (with different formatting):
193
+ * tracestate: rojo=00f067aa0ba902b7,congo=t61rcWkgMzE
194
+ */
195
+ traceState?: TraceState;
196
+ }
197
+ /**
198
+ * @since 1.0.0
199
+ */
200
+ interface SpanStatus {
201
+ /** The status code of this message. */
202
+ code: SpanStatusCode;
203
+ /** A developer-facing error message. */
204
+ message?: string;
205
+ }
206
+ /**
207
+ * An enumeration of status codes.
208
+ *
209
+ * @since 1.0.0
210
+ */
211
+ declare enum SpanStatusCode {
212
+ /**
213
+ * The default status.
214
+ */
215
+ UNSET = 0,
216
+ /**
217
+ * The operation has been validated by an Application developer or
218
+ * Operator to have completed successfully.
219
+ */
220
+ OK = 1,
221
+ /**
222
+ * The operation contains an error.
223
+ */
224
+ ERROR = 2,
225
+ }
226
+ /**
227
+ * A pointer from the current {@link Span} to another span in the same trace or
228
+ * in a different trace.
229
+ * Few examples of Link usage.
230
+ * 1. Batch Processing: A batch of elements may contain elements associated
231
+ * with one or more traces/spans. Since there can only be one parent
232
+ * SpanContext, Link is used to keep reference to SpanContext of all
233
+ * elements in the batch.
234
+ * 2. Public Endpoint: A SpanContext in incoming client request on a public
235
+ * endpoint is untrusted from service provider perspective. In such case it
236
+ * is advisable to start a new trace with appropriate sampling decision.
237
+ * However, it is desirable to associate incoming SpanContext to new trace
238
+ * initiated on service provider side so two traces (from Client and from
239
+ * Service Provider) can be correlated.
240
+ *
241
+ * @since 1.0.0
242
+ */
243
+ interface Link {
244
+ /** The {@link SpanContext} of a linked span. */
245
+ context: SpanContext;
246
+ /** A set of {@link SpanAttributes} on the link. */
247
+ attributes?: SpanAttributes;
248
+ /** Count of attributes of the link that were dropped due to collection limits */
249
+ droppedAttributesCount?: number;
250
+ }
251
+ /**
252
+ * An interface that represents a span. A span represents a single operation
253
+ * within a trace. Examples of span might include remote procedure calls or a
254
+ * in-process function calls to sub-components. A Trace has a single, top-level
255
+ * "root" Span that in turn may have zero or more child Spans, which in turn
256
+ * may have children.
257
+ *
258
+ * Spans are created by the {@link Tracer.startSpan} method.
259
+ *
260
+ * @since 1.0.0
261
+ */
262
+ interface Span {
263
+ /**
264
+ * Returns the {@link SpanContext} object associated with this Span.
265
+ *
266
+ * Get an immutable, serializable identifier for this span that can be used
267
+ * to create new child spans. Returned SpanContext is usable even after the
268
+ * span ends.
269
+ *
270
+ * @returns the SpanContext object associated with this Span.
271
+ */
272
+ spanContext(): SpanContext;
273
+ /**
274
+ * Sets an attribute to the span.
275
+ *
276
+ * Sets a single Attribute with the key and value passed as arguments.
277
+ *
278
+ * @param key the key for this attribute.
279
+ * @param value the value for this attribute. Setting a value null or
280
+ * undefined is invalid and will result in undefined behavior.
281
+ */
282
+ setAttribute(key: string, value: SpanAttributeValue): this;
283
+ /**
284
+ * Sets attributes to the span.
285
+ *
286
+ * @param attributes the attributes that will be added.
287
+ * null or undefined attribute values
288
+ * are invalid and will result in undefined behavior.
289
+ */
290
+ setAttributes(attributes: SpanAttributes): this;
291
+ /**
292
+ * Adds an event to the Span.
293
+ *
294
+ * @param name the name of the event.
295
+ * @param [attributesOrStartTime] the attributes that will be added; these are
296
+ * associated with this event. Can be also a start time
297
+ * if type is {@type TimeInput} and 3rd param is undefined
298
+ * @param [startTime] start time of the event.
299
+ */
300
+ addEvent(name: string, attributesOrStartTime?: SpanAttributes | TimeInput, startTime?: TimeInput): this;
301
+ /**
302
+ * Adds a single link to the span.
303
+ *
304
+ * Links added after the creation will not affect the sampling decision.
305
+ * It is preferred span links be added at span creation.
306
+ *
307
+ * @param link the link to add.
308
+ */
309
+ addLink(link: Link): this;
310
+ /**
311
+ * Adds multiple links to the span.
312
+ *
313
+ * Links added after the creation will not affect the sampling decision.
314
+ * It is preferred span links be added at span creation.
315
+ *
316
+ * @param links the links to add.
317
+ */
318
+ addLinks(links: Link[]): this;
319
+ /**
320
+ * Sets the status of the span.
321
+ *
322
+ * By default, a span has status {@link SpanStatusCode.UNSET}.
323
+ * Calling this method overrides that default.
324
+ *
325
+ * The status codes have a total order: `OK > ERROR > UNSET`.
326
+ *
327
+ * - Once {@link SpanStatusCode.OK} is set, any further attempts to change
328
+ * the status are ignored.
329
+ * - Any attempt to set {@link SpanStatusCode.UNSET} is always ignored.
330
+ *
331
+ * The `message` field is only used when {@link SpanStatusCode.ERROR} is set.
332
+ * For all other status codes, `message` is ignored.
333
+ *
334
+ * @param status The {@link SpanStatus} to set.
335
+ */
336
+ setStatus(status: SpanStatus): this;
337
+ /**
338
+ * Updates the Span name.
339
+ *
340
+ * This will override the name provided via {@link Tracer.startSpan}.
341
+ *
342
+ * Upon this update, any sampling behavior based on Span name will depend on
343
+ * the implementation.
344
+ *
345
+ * @param name the Span name.
346
+ */
347
+ updateName(name: string): this;
348
+ /**
349
+ * Marks the end of Span execution.
350
+ *
351
+ * Call to End of a Span MUST not have any effects on child spans. Those may
352
+ * still be running and can be ended later.
353
+ *
354
+ * Do not return `this`. The Span generally should not be used after it
355
+ * is ended so chaining is not desired in this context.
356
+ *
357
+ * @param [endTime] the time to set as Span's end time. If not provided,
358
+ * use the current time as the span's end time.
359
+ */
360
+ end(endTime?: TimeInput): void;
361
+ /**
362
+ * Returns the flag whether this span will be recorded.
363
+ *
364
+ * @returns true if this Span is active and recording information like events
365
+ * with the `AddEvent` operation and attributes using `setAttributes`.
366
+ */
367
+ isRecording(): boolean;
368
+ /**
369
+ * Sets exception as a span event
370
+ * @param exception the exception the only accepted values are string or Error
371
+ * @param [time] the time to set as Span's event time. If not provided,
372
+ * use the current time.
373
+ */
374
+ recordException(exception: Exception, time?: TimeInput): void;
375
+ }
376
+ /**
377
+ * @since 1.0.0
378
+ */
379
+ declare enum SpanKind {
380
+ /** Default value. Indicates that the span is used internally. */
381
+ INTERNAL = 0,
382
+ /**
383
+ * Indicates that the span covers server-side handling of an RPC or other
384
+ * remote request.
385
+ */
386
+ SERVER = 1,
387
+ /**
388
+ * Indicates that the span covers the client-side wrapper around an RPC or
389
+ * other remote request.
390
+ */
391
+ CLIENT = 2,
392
+ /**
393
+ * Indicates that the span describes producer sending a message to a
394
+ * broker. Unlike client and server, there is no direct critical path latency
395
+ * relationship between producer and consumer spans.
396
+ */
397
+ PRODUCER = 3,
398
+ /**
399
+ * Indicates that the span describes consumer receiving a message from a
400
+ * broker. Unlike client and server, there is no direct critical path latency
401
+ * relationship between producer and consumer spans.
402
+ */
403
+ CONSUMER = 4,
404
+ }
405
+ /**
406
+ * Options needed for span creation
407
+ *
408
+ * @since 1.0.0
409
+ */
410
+ interface SpanOptions {
411
+ /**
412
+ * The SpanKind of a span
413
+ * @default {@link SpanKind.INTERNAL}
414
+ */
415
+ kind?: SpanKind;
416
+ /** A span's attributes */
417
+ attributes?: Attributes;
418
+ /** {@link Link}s span to other spans */
419
+ links?: Link[];
420
+ /** A manually specified start time for the created `Span` object. */
421
+ startTime?: TimeInput;
422
+ /** The new span should be a root span. (Ignore parent from context). */
423
+ root?: boolean;
424
+ }
425
+ /**
426
+ * Tracer provides an interface for creating {@link Span}s.
427
+ *
428
+ * @since 1.0.0
429
+ */
430
+ interface Tracer {
431
+ /**
432
+ * Starts a new {@link Span}. Start the span without setting it on context.
433
+ *
434
+ * This method do NOT modify the current Context.
435
+ *
436
+ * @param name The name of the span
437
+ * @param [options] SpanOptions used for span creation
438
+ * @param [context] Context to use to extract parent
439
+ * @returns Span The newly created span
440
+ * @example
441
+ * const span = tracer.startSpan('op');
442
+ * span.setAttribute('key', 'value');
443
+ * span.end();
444
+ */
445
+ startSpan(name: string, options?: SpanOptions, context?: Context): Span;
446
+ /**
447
+ * Starts a new {@link Span} and calls the given function passing it the
448
+ * created span as first argument.
449
+ * Additionally the new span gets set in context and this context is activated
450
+ * for the duration of the function call.
451
+ *
452
+ * @param name The name of the span
453
+ * @param [options] SpanOptions used for span creation
454
+ * @param [context] Context to use to extract parent
455
+ * @param fn function called in the context of the span and receives the newly created span as an argument
456
+ * @returns return value of fn
457
+ * @example
458
+ * const something = tracer.startActiveSpan('op', span => {
459
+ * try {
460
+ * do some work
461
+ * span.setStatus({code: SpanStatusCode.OK});
462
+ * return something;
463
+ * } catch (err) {
464
+ * span.setStatus({
465
+ * code: SpanStatusCode.ERROR,
466
+ * message: err.message,
467
+ * });
468
+ * throw err;
469
+ * } finally {
470
+ * span.end();
471
+ * }
472
+ * });
473
+ *
474
+ * @example
475
+ * const span = tracer.startActiveSpan('op', span => {
476
+ * try {
477
+ * do some work
478
+ * return span;
479
+ * } catch (err) {
480
+ * span.setStatus({
481
+ * code: SpanStatusCode.ERROR,
482
+ * message: err.message,
483
+ * });
484
+ * throw err;
485
+ * }
486
+ * });
487
+ * do some more work
488
+ * span.end();
489
+ */
490
+ startActiveSpan<F extends (span: Span) => unknown>(name: string, fn: F): ReturnType<F>;
491
+ startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, fn: F): ReturnType<F>;
492
+ startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, context: Context, fn: F): ReturnType<F>;
493
+ }
494
+ export { Tracer as T };
@@ -0,0 +1,107 @@
1
+ import { E as EmailOptions } from "./types.d-ejzh-xBP.js";
2
+ /**
3
+ * Options for DKIM signing
4
+ */
5
+ interface DkimOptions {
6
+ /**
7
+ * Signature algorithm. 'rsa-sha256' (default, RFC 6376) or 'ed25519-sha256' (RFC 8463).
8
+ * Default: 'rsa-sha256'
9
+ */
10
+ algorithm?: "ed25519-sha256" | "rsa-sha256";
11
+ /**
12
+ * Body canonicalization algorithm ('simple' or 'relaxed')
13
+ * Default: 'simple'
14
+ */
15
+ bodyCanon?: "relaxed" | "simple";
16
+ /**
17
+ * Domain name used for DKIM signing
18
+ */
19
+ domainName: string;
20
+ /**
21
+ * Header canonicalization algorithm ('simple' or 'relaxed')
22
+ * Default: 'simple'
23
+ */
24
+ headerCanon?: "relaxed" | "simple";
25
+ /**
26
+ * List of header names to ignore when signing
27
+ */
28
+ headersToIgnore?: string[];
29
+ /**
30
+ * Key selector used for DNS lookup
31
+ */
32
+ keySelector: string;
33
+ /**
34
+ * Passphrase for the private key (if encrypted)
35
+ */
36
+ passphrase?: string;
37
+ /**
38
+ * Private key for signing (PEM format)
39
+ * Can be a string with the key content or a path prefixed with 'file://'
40
+ */
41
+ privateKey: string;
42
+ }
43
+ /**
44
+ * Options for S/MIME signing
45
+ */
46
+ interface SmimeSignOptions {
47
+ /**
48
+ * Path to the certificate file (PEM format)
49
+ */
50
+ certificate: string;
51
+ /**
52
+ * Path to intermediate certificates (optional)
53
+ */
54
+ intermediateCerts?: string[];
55
+ /**
56
+ * Signing options flags
57
+ * Reserved for future use
58
+ */
59
+ options?: number;
60
+ /**
61
+ * Passphrase for the private key (if encrypted)
62
+ */
63
+ passphrase?: string;
64
+ /**
65
+ * Path to the private key file (PEM format)
66
+ */
67
+ privateKey: string;
68
+ }
69
+ /**
70
+ * Options for S/MIME encryption
71
+ */
72
+ interface SmimeEncryptOptions {
73
+ /**
74
+ * Encryption algorithm (cipher)
75
+ * Supported: 'aes-256-cbc', 'aes-192-cbc', 'aes-128-cbc'
76
+ * Default: 'aes-256-cbc'
77
+ */
78
+ algorithm?: string;
79
+ /**
80
+ * Certificate(s) for encryption
81
+ * Can be a single certificate path or a map of email -> certificate path
82
+ */
83
+ certificates: string | Record<string, string>;
84
+ }
85
+ /**
86
+ * Interface for email signers
87
+ */
88
+ interface EmailSigner {
89
+ /**
90
+ * Sign an email message
91
+ * @param email The email options to sign
92
+ * @returns The signed email options (may include additional headers or modified content)
93
+ */
94
+ sign: (email: EmailOptions) => Promise<EmailOptions>;
95
+ }
96
+ /**
97
+ * Interface for email encrypters
98
+ */
99
+ interface EmailEncrypter {
100
+ /**
101
+ * Encrypt an email message
102
+ * @param email The email options to encrypt
103
+ * @returns The encrypted email options (content will be encrypted)
104
+ */
105
+ encrypt: (email: EmailOptions) => Promise<EmailOptions>;
106
+ }
107
+ export { DkimOptions as D, EmailSigner as E, SmimeEncryptOptions as S, EmailEncrypter as a, SmimeSignOptions as b };
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Why a recipient address is suppressed from future sends.
3
+ */
4
+ type SuppressionReason = "bounce" | "complaint" | "manual" | "unsubscribe";
5
+ /**
6
+ * A suppression-list entry.
7
+ */
8
+ interface SuppressionEntry {
9
+ /**
10
+ * The normalized (lower-cased) email address.
11
+ */
12
+ address: string;
13
+ /**
14
+ * When the address was added.
15
+ */
16
+ createdAt: Date;
17
+ /**
18
+ * Optional free-form context (e.g. the bounce sub-type, or who suppressed it manually).
19
+ */
20
+ metadata?: Record<string, unknown>;
21
+ /**
22
+ * Why the address was suppressed.
23
+ */
24
+ reason: SuppressionReason;
25
+ }
26
+ /**
27
+ * A pluggable suppression store. Implementations back the in-memory default with a durable store
28
+ * (Redis, Postgres, `unstorage`, a provider's native suppression API, etc.).
29
+ *
30
+ * Addresses must be matched case-insensitively; implementations are expected to normalize on write.
31
+ */
32
+ interface SuppressionStore {
33
+ /**
34
+ * Adds (or refreshes) an address on the suppression list.
35
+ * @param address The recipient address.
36
+ * @param reason Why it is suppressed.
37
+ * @param metadata Optional context to persist with the entry.
38
+ */
39
+ add: (address: string, reason: SuppressionReason, metadata?: Record<string, unknown>) => Promise<void> | void;
40
+ /**
41
+ * Returns the suppression entry for an address, or `undefined` when it is not suppressed.
42
+ * @param address The recipient address.
43
+ */
44
+ get: (address: string) => (SuppressionEntry | undefined) | Promise<SuppressionEntry | undefined>;
45
+ /**
46
+ * Returns whether an address is currently suppressed.
47
+ * @param address The recipient address.
48
+ */
49
+ has: (address: string) => boolean | Promise<boolean>;
50
+ /**
51
+ * Lists all suppression entries. Optional — stores backed by huge datasets may omit it.
52
+ */
53
+ list?: () => Iterable<SuppressionEntry> | Promise<Iterable<SuppressionEntry>>;
54
+ /**
55
+ * Removes an address from the suppression list.
56
+ * @param address The recipient address.
57
+ * @returns `true` when an entry was removed.
58
+ */
59
+ remove: (address: string) => boolean | Promise<boolean>;
60
+ }
61
+ export { SuppressionReason as S, SuppressionEntry as a, SuppressionStore as b };
@@ -0,0 +1,51 @@
1
+ import { b as Receipt, B as BaseConfig, E as EmailOptions, a as EmailResult } from "./types.d-ejzh-xBP.js";
2
+ /**
3
+ * Random delay range configuration
4
+ */
5
+ interface RandomDelayRange {
6
+ max: number;
7
+ min: number;
8
+ }
9
+ /**
10
+ * Mock configuration for testing
11
+ */
12
+ interface MockConfig extends BaseConfig {
13
+ /**
14
+ * Default response to return for send operations
15
+ */
16
+ defaultResponse?: Receipt;
17
+ /**
18
+ * Delay in milliseconds before resolving (default: 0)
19
+ * Useful for testing async behavior
20
+ */
21
+ delay?: number;
22
+ /**
23
+ * Failure rate (0-1) for simulating random failures (default: 0)
24
+ * 0 = never fail, 1 = always fail
25
+ */
26
+ failureRate?: number;
27
+ /**
28
+ * Random delay range in milliseconds
29
+ * When set, delay will be randomly chosen between min and max
30
+ */
31
+ randomDelayRange?: RandomDelayRange;
32
+ /**
33
+ * Whether to simulate failures (default: false)
34
+ * When true, sendEmail will return an error
35
+ */
36
+ simulateFailure?: boolean;
37
+ }
38
+ /**
39
+ * Mock-specific email options
40
+ */
41
+ type MockEmailOptions = EmailOptions;
42
+ /**
43
+ * Stored email entry in mock provider
44
+ */
45
+ interface MockEmailEntry {
46
+ id: string;
47
+ options: EmailOptions;
48
+ result: EmailResult;
49
+ timestamp: Date;
50
+ }
51
+ export { MockConfig as M, RandomDelayRange as R, MockEmailEntry as a, MockEmailOptions as b };