@visulima/email 1.0.0-alpha.8 → 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.
- package/CHANGELOG.md +786 -0
- package/LICENSE.md +541 -847
- package/README.md +212 -191
- package/dist/crypto/index.d.ts +304 -4
- package/dist/crypto/index.js +1 -1
- package/dist/deliverability/dmarc-report.d.ts +95 -0
- package/dist/deliverability/dmarc-report.js +1 -0
- package/dist/deliverability/index.d.ts +360 -0
- package/dist/deliverability/index.js +1 -0
- package/dist/events/index.d.ts +31 -0
- package/dist/events/index.js +1 -0
- package/dist/inbound/index.d.ts +375 -0
- package/dist/inbound/index.js +1 -0
- package/dist/index.d.ts +94 -9
- package/dist/index.js +1 -1
- package/dist/middleware/index.d.ts +346 -0
- package/dist/middleware/index.js +1 -0
- package/dist/packem_shared/ALL_EVENTS-3kwh5CBE.js +1 -0
- package/dist/packem_shared/DkimSigner-BuSbnos1.js +18 -0
- package/dist/packem_shared/DraftMailMessage-BxqGSLMN.js +1 -0
- package/dist/packem_shared/EmailError-B-sEf3bp.js +1 -0
- package/dist/packem_shared/Mail-BEuzrB00.js +1 -0
- package/dist/packem_shared/MailMessage-D9k5gYrd.js +1 -0
- package/dist/packem_shared/MemoryEventStore-CuhfO9aj.js +1 -0
- package/dist/packem_shared/MemoryQueue-Dl1Fa6OJ.js +1 -0
- package/dist/packem_shared/MemorySuppressionStore-DZnbz-_B.js +1 -0
- package/dist/packem_shared/RATE_LIMIT_PRESETS-BPADLgcA.js +1 -0
- package/dist/packem_shared/RequiredOptionError-DuNNY_a5.js +1 -0
- package/dist/packem_shared/SmimeEncrypter-C7usORKF.js +6 -0
- package/dist/packem_shared/SmimeSigner-DgAApLPS.js +8 -0
- package/dist/packem_shared/addDarkModeSupport-DZYxULjl.js +1 -0
- package/dist/packem_shared/address-formatter-BWR2Dddx.js +1 -0
- package/dist/packem_shared/aggregate-features-BqEjPd42.js +1 -0
- package/dist/packem_shared/ahaSendProvider-D81_wUA1.js +1 -0
- package/dist/packem_shared/arcMessageSignatureBase-BY4j0TxM.js +17 -0
- package/dist/packem_shared/attachment-processor-CMp7qqMI.js +1 -0
- package/dist/packem_shared/awsSesProvider-BGZJUIep.js +32 -0
- package/dist/packem_shared/azureProvider-CmcK4bsf.js +1 -0
- package/dist/packem_shared/brevoProvider-C1BDXr41.js +1 -0
- package/dist/packem_shared/build-mime-message-B6927SQy.js +3 -0
- package/dist/packem_shared/buildListUnsubscribe-Cdr8MvR_.js +1 -0
- package/dist/packem_shared/buildMtaStsPolicy-oEQg8y_C.js +6 -0
- package/dist/packem_shared/circuitBreakerMiddleware-D2SA_07f.js +1 -0
- package/dist/packem_shared/cloudflareEmailProvider-Bv-ty-74.js +1 -0
- package/dist/packem_shared/composeMiddleware-BHwLLEzK.js +1 -0
- package/dist/packem_shared/create-logger-BQTS3f-I.js +1 -0
- package/dist/packem_shared/createSuppressionStore-CeAZKCbY.js +1 -0
- package/dist/packem_shared/createTestEmail-CF_RUjqo.js +1 -0
- package/dist/packem_shared/createWorker-_-yMWcNQ.js +1 -0
- package/dist/packem_shared/dedupeMiddleware-B6ajWOTi.js +1 -0
- package/dist/packem_shared/defineInboundHandler-CnL2BzlL.js +1 -0
- package/dist/packem_shared/defineProvider-C9q-7iwt.js +1 -0
- package/dist/packem_shared/detectMimeType-Dxv4MjZ7.js +1 -0
- package/dist/packem_shared/emailMatchers-DZDkrZ_3.js +1 -0
- package/dist/packem_shared/event-bus.d-DEl3w_EW.d.ts +104 -0
- package/dist/packem_shared/extractCidReferences-BuoTREMp.js +1 -0
- package/dist/packem_shared/extractReply-BUjIBt9A.js +5 -0
- package/dist/packem_shared/failoverProvider-BgX6zfnY.js +1 -0
- package/dist/packem_shared/format-address-DTl-9O70.js +1 -0
- package/dist/packem_shared/generate-boundary-DQbzDiOI.js +1 -0
- package/dist/packem_shared/generate-message-id-gXAuMz4g.js +1 -0
- package/dist/packem_shared/headers-to-record-De1Eg951.js +1 -0
- package/dist/packem_shared/httpProvider-DJAsYSun.js +1 -0
- package/dist/packem_shared/index-yDU-1zOZ.js +11 -0
- package/dist/packem_shared/infobipProvider-lHyGrXgZ.js +1 -0
- package/dist/packem_shared/injectPreheader-CF9WHZ7J.js +1 -0
- package/dist/packem_shared/inlineCss-BQ7d2Cyz.js +1 -0
- package/dist/packem_shared/isValidSigningCertUrl-Bii1AMGC.js +3 -0
- package/dist/packem_shared/loggingMiddleware-CZIiVMVp.js +1 -0
- package/dist/packem_shared/loopsProvider-DyloxzNC.js +1 -0
- package/dist/packem_shared/mail.d-B9SSqyy0.d.ts +909 -0
- package/dist/packem_shared/{mailCrabProvider-CM_CFDca.js → mailCrabProvider-CPtBT6Th.js} +1 -1
- package/dist/packem_shared/mailPaceProvider-CJEvOFBh.js +1 -0
- package/dist/packem_shared/mailchannelsProvider-osRkW_tz.js +1 -0
- package/dist/packem_shared/mailerSendProvider-C_6LzARK.js +1 -0
- package/dist/packem_shared/mailgunProvider-DkISvMPe.js +1 -0
- package/dist/packem_shared/mailjetProvider-CV0i4Xzh.js +1 -0
- package/dist/packem_shared/mailomatProvider-B5YFonEO.js +1 -0
- package/dist/packem_shared/mailtrapProvider-C4ZquIPz.js +1 -0
- package/dist/packem_shared/make-request-BlK_B72c.js +1 -0
- package/dist/packem_shared/mandrillProvider-DWPFh_Sj.js +1 -0
- package/dist/packem_shared/mockProvider-Behywbl1.js +1 -0
- package/dist/packem_shared/netcoreProvider-C5TEciaN.js +1 -0
- package/dist/packem_shared/nodemailerProvider-BFHobXxt.js +1 -0
- package/dist/packem_shared/normalizeMessageId-DAx2pGe2.js +1 -0
- package/dist/packem_shared/oauth2Middleware-CodqXkyj.js +1 -0
- package/dist/packem_shared/opentelemetryProvider-ByHC01ub.js +1 -0
- package/dist/packem_shared/outlook365Provider-63ggDpqV.js +1 -0
- package/dist/packem_shared/parseAddress-DdbViBAJ.js +1 -0
- package/dist/packem_shared/parseArfReport-Ds6S3c4J.js +6 -0
- package/dist/packem_shared/parseCloudflareInbound-C__j-oNa.js +1 -0
- package/dist/packem_shared/parseDmarcRecord-DXZ-_rF0.js +1 -0
- package/dist/packem_shared/parseMailgunInbound-BpC6uPNe.js +1 -0
- package/dist/packem_shared/parsePostmarkInbound-Co3_c6-9.js +1 -0
- package/dist/packem_shared/parseSendGridInbound-DsALoijO.js +4 -0
- package/dist/packem_shared/parseSesInbound-CH5tHIjp.js +1 -0
- package/dist/packem_shared/parseTlsReport-wPe1lIDs.js +1 -0
- package/dist/packem_shared/plunkProvider-yTlrJVEp.js +1 -0
- package/dist/packem_shared/postProcessHtml-DqKi2Ucg.js +1 -0
- package/dist/packem_shared/postalProvider-CRX_bMYD.js +1 -0
- package/dist/packem_shared/postmarkProvider-CDx85Yge.js +1 -0
- package/dist/packem_shared/provider-base-C7PuopYK.js +1 -0
- package/dist/packem_shared/provider.d-J-y6iogK.d.ts +28 -0
- package/dist/packem_shared/quoted-printable-nSGDA1tA.js +7 -0
- package/dist/packem_shared/resendProvider-CiclWxzr.js +1 -0
- package/dist/packem_shared/retry-3pnxTuNs.js +1 -0
- package/dist/packem_shared/retryMiddleware-DbViDX4r.js +1 -0
- package/dist/packem_shared/roundRobinProvider-D1by5KGW.js +1 -0
- package/dist/packem_shared/sanitize-header-DJhgZl3y.js +1 -0
- package/dist/packem_shared/scalewayProvider-BcND48qO.js +1 -0
- package/dist/packem_shared/sendGridProvider-D8ZLgY62.js +1 -0
- package/dist/packem_shared/smtpProvider-Bm0yP97W.js +25 -0
- package/dist/packem_shared/sparkpostProvider-CTYfSRaV.js +1 -0
- package/dist/packem_shared/sweegoProvider-DOoin_vi.js +1 -0
- package/dist/packem_shared/toEmailSnapshot-DeRqM5SJ.js +1 -0
- package/dist/packem_shared/tracer.d-MU42G1jG.d.ts +494 -0
- package/dist/packem_shared/types.d-BId55FW2.d.ts +107 -0
- package/dist/packem_shared/types.d-CmoWvdZi.d.ts +61 -0
- package/dist/packem_shared/types.d-DCkecJse.d.ts +51 -0
- package/dist/packem_shared/types.d-Mpu0HZoG.d.ts +24 -0
- package/dist/packem_shared/types.d-ejzh-xBP.d.ts +209 -0
- package/dist/packem_shared/types.d-lcJZmwRK.d.ts +69 -0
- package/dist/packem_shared/types.d-nyR1ty1Q.d.ts +9 -0
- package/dist/packem_shared/utils-BfYfPB_I.js +1 -0
- package/dist/packem_shared/validate-email-options-mCM9dVug.js +1 -0
- package/dist/packem_shared/verifyMailgunWebhook-Cwl0OD3P.js +1 -0
- package/dist/packem_shared/verifyPostmarkWebhook-C72ZvbrG.js +1 -0
- package/dist/packem_shared/verifyResendWebhook-YK2zNDXR.js +1 -0
- package/dist/packem_shared/verifySendGridWebhook-Dbwc1tfG.js +1 -0
- package/dist/packem_shared/withEvents-CCVblSqj.js +1 -0
- package/dist/packem_shared/withMetrics-DWywX_6M.js +1 -0
- package/dist/packem_shared/withRender-VP9wE5Yr.js +1 -0
- package/dist/packem_shared/withSuppression-DBaZDMAr.js +1 -0
- package/dist/packem_shared/withTelemetry-DL2qo0Hp.js +1 -0
- package/dist/packem_shared/zeptomailProvider-DKBPSHPj.js +1 -0
- package/dist/providers/ahasend/index.d.ts +36 -3
- package/dist/providers/ahasend/index.js +1 -1
- package/dist/providers/aws-ses/index.d.ts +47 -3
- package/dist/providers/aws-ses/index.js +1 -1
- package/dist/providers/azure/index.d.ts +52 -3
- package/dist/providers/azure/index.js +1 -1
- package/dist/providers/brevo/index.d.ts +65 -3
- package/dist/providers/brevo/index.js +1 -1
- package/dist/providers/cloudflare-email/index.d.ts +36 -0
- package/dist/providers/cloudflare-email/index.js +1 -0
- package/dist/providers/failover/index.d.ts +27 -3
- package/dist/providers/failover/index.js +1 -1
- package/dist/providers/http/index.d.ts +35 -3
- package/dist/providers/http/index.js +1 -1
- package/dist/providers/infobip/index.d.ts +56 -3
- package/dist/providers/infobip/index.js +1 -1
- package/dist/providers/loops/index.d.ts +47 -0
- package/dist/providers/loops/index.js +1 -0
- package/dist/providers/mailchannels/index.d.ts +26 -0
- package/dist/providers/mailchannels/index.js +1 -0
- package/dist/providers/mailcrab/index.d.ts +32 -3
- package/dist/providers/mailcrab/index.js +1 -1
- package/dist/providers/mailersend/index.d.ts +51 -3
- package/dist/providers/mailersend/index.js +1 -1
- package/dist/providers/mailgun/index.d.ts +73 -3
- package/dist/providers/mailgun/index.js +1 -1
- package/dist/providers/mailjet/index.d.ts +72 -3
- package/dist/providers/mailjet/index.js +1 -1
- package/dist/providers/mailomat/index.d.ts +40 -3
- package/dist/providers/mailomat/index.js +1 -1
- package/dist/providers/mailpace/index.d.ts +52 -3
- package/dist/providers/mailpace/index.js +1 -1
- package/dist/providers/mailtrap/index.d.ts +44 -3
- package/dist/providers/mailtrap/index.js +1 -1
- package/dist/providers/mandrill/index.d.ts +87 -3
- package/dist/providers/mandrill/index.js +1 -1
- package/dist/providers/mock/index.d.ts +12 -3
- package/dist/providers/mock/index.js +1 -1
- package/dist/providers/netcore/index.d.ts +35 -0
- package/dist/providers/netcore/index.js +1 -0
- package/dist/providers/nodemailer/index.d.ts +38 -3
- package/dist/providers/nodemailer/index.js +1 -1
- package/dist/providers/opentelemetry/index.d.ts +37 -3
- package/dist/providers/opentelemetry/index.js +1 -1
- package/dist/providers/outlook365/index.d.ts +48 -0
- package/dist/providers/outlook365/index.js +1 -0
- package/dist/providers/plunk/index.d.ts +38 -3
- package/dist/providers/plunk/index.js +1 -1
- package/dist/providers/postal/index.d.ts +48 -3
- package/dist/providers/postal/index.js +1 -1
- package/dist/providers/postmark/index.d.ts +60 -3
- package/dist/providers/postmark/index.js +1 -1
- package/dist/providers/resend/index.d.ts +51 -3
- package/dist/providers/resend/index.js +1 -1
- package/dist/providers/roundrobin/index.d.ts +27 -3
- package/dist/providers/roundrobin/index.js +1 -1
- package/dist/providers/scaleway/index.d.ts +44 -3
- package/dist/providers/scaleway/index.js +1 -1
- package/dist/providers/sendgrid/index.d.ts +84 -3
- package/dist/providers/sendgrid/index.js +1 -1
- package/dist/providers/smtp/index.d.ts +71 -3
- package/dist/providers/smtp/index.js +1 -1
- package/dist/providers/sparkpost/index.d.ts +43 -0
- package/dist/providers/sparkpost/index.js +1 -0
- package/dist/providers/sweego/index.d.ts +40 -3
- package/dist/providers/sweego/index.js +1 -1
- package/dist/providers/zeptomail/index.d.ts +37 -3
- package/dist/providers/zeptomail/index.js +1 -1
- package/dist/queue/bullmq-queue.d.ts +46 -0
- package/dist/queue/bullmq-queue.js +1 -0
- package/dist/queue/index.d.ts +147 -0
- package/dist/queue/index.js +1 -0
- package/dist/queue/pg-boss-queue.d.ts +41 -0
- package/dist/queue/pg-boss-queue.js +1 -0
- package/dist/queue/sqs-queue.d.ts +72 -0
- package/dist/queue/sqs-queue.js +1 -0
- package/dist/queue/unstorage-queue.d.ts +199 -0
- package/dist/queue/unstorage-queue.js +1 -0
- package/dist/render/index.d.ts +107 -0
- package/dist/render/index.js +1 -0
- package/dist/template-engines/handlebars.d.ts +23 -22
- package/dist/template-engines/handlebars.js +1 -1
- package/dist/template-engines/html-to-text.d.ts +24 -24
- package/dist/template-engines/html-to-text.js +1 -1
- package/dist/template-engines/i18n.d.ts +61 -0
- package/dist/template-engines/i18n.js +1 -0
- package/dist/template-engines/jsx-email.d.ts +11 -0
- package/dist/template-engines/jsx-email.js +1 -0
- package/dist/template-engines/liquid.d.ts +12 -0
- package/dist/template-engines/liquid.js +1 -0
- package/dist/template-engines/mjml.d.ts +10 -10
- package/dist/template-engines/mjml.js +1 -1
- package/dist/template-engines/react-email.d.ts +9 -9
- package/dist/template-engines/react-email.js +1 -1
- package/dist/template-engines/vue-email.d.ts +9 -9
- package/dist/template-engines/vue-email.js +1 -1
- package/dist/test/index.d.ts +155 -0
- package/dist/test/index.js +1 -0
- package/dist/utils/cache.d.ts +49 -48
- package/dist/utils/cache.js +1 -1
- package/dist/utils/format-email-address.d.ts +8 -7
- package/dist/utils/format-email-address.js +1 -1
- package/dist/utils/normalize-email-aliases.d.ts +20 -20
- package/dist/utils/normalize-email-aliases.js +1 -1
- package/dist/utils/parse-address.d.ts +18 -17
- package/dist/utils/parse-address.js +1 -1
- package/dist/utils/parse-eml.d.ts +22 -0
- package/dist/utils/parse-eml.js +6 -0
- package/dist/utils/result.d.ts +49 -0
- package/dist/utils/result.js +1 -0
- package/dist/utils/validation/check-feature-support.d.ts +53 -0
- package/dist/utils/validation/check-feature-support.js +1 -0
- package/dist/utils/validation/validate-email.d.ts +5 -5
- package/dist/utils/validation/validate-email.js +1 -1
- package/dist/webhooks/index.d.ts +231 -0
- package/dist/webhooks/index.js +1 -0
- package/package.json +177 -67
- package/dist/attachment-helpers.d.ts +0 -64
- package/dist/crypto/dkim-signer.d.ts +0 -48
- package/dist/crypto/smime-encrypter.d.ts +0 -53
- package/dist/crypto/smime-signer.d.ts +0 -48
- package/dist/crypto/types.d.ts +0 -101
- package/dist/draft-mail-message.d.ts +0 -13
- package/dist/errors/email-error.d.ts +0 -17
- package/dist/errors/required-option-error.d.ts +0 -10
- package/dist/mail-message.d.ts +0 -425
- package/dist/mail.d.ts +0 -206
- package/dist/packem_shared/DkimSigner-pFd4c3fZ.js +0 -18
- package/dist/packem_shared/EmailError-zm2ffVav.js +0 -1
- package/dist/packem_shared/Mail-6Bltpy_p.js +0 -1
- package/dist/packem_shared/MailMessage-B76GPBBA.js +0 -1
- package/dist/packem_shared/RequiredOptionError-CevW3u2K.js +0 -1
- package/dist/packem_shared/SmimeEncrypter-CBevU534.js +0 -6
- package/dist/packem_shared/SmimeSigner-CObA4jzT.js +0 -8
- package/dist/packem_shared/address-formatter-Cm_E_ZMa.js +0 -1
- package/dist/packem_shared/ahaSendProvider-DlFKEQ6D.js +0 -1
- package/dist/packem_shared/attachment-processor-2rHmfa7j.js +0 -1
- package/dist/packem_shared/awsSesProvider-Ba-eVJxZ.js +0 -32
- package/dist/packem_shared/azureProvider-CQYAkgVF.js +0 -1
- package/dist/packem_shared/brevoProvider-5p6jjiK9.js +0 -1
- package/dist/packem_shared/build-mime-message-IYaUqqPJ.js +0 -2
- package/dist/packem_shared/create-logger-BiWdqFNg.js +0 -1
- package/dist/packem_shared/defineProvider-B9rSklAJ.js +0 -1
- package/dist/packem_shared/detectMimeType-S8WRsNtY.js +0 -1
- package/dist/packem_shared/failoverProvider-CAHQQueo.js +0 -1
- package/dist/packem_shared/generate-boundary-Cx8nXYS0.js +0 -1
- package/dist/packem_shared/generate-message-id-D4uA8gkj.js +0 -1
- package/dist/packem_shared/headers-to-record-Qo124ImV.js +0 -1
- package/dist/packem_shared/httpProvider-CZD6LZX3.js +0 -1
- package/dist/packem_shared/infobipProvider-CtLwrUaP.js +0 -1
- package/dist/packem_shared/mailPaceProvider-B6yKvh6z.js +0 -1
- package/dist/packem_shared/mailerSendProvider-CeeIXFnW.js +0 -1
- package/dist/packem_shared/mailgunProvider-mmjKzouh.js +0 -1
- package/dist/packem_shared/mailjetProvider-DwN6i0VA.js +0 -1
- package/dist/packem_shared/mailomatProvider-DMQmjKHT.js +0 -1
- package/dist/packem_shared/mailtrapProvider-BN3UBEQw.js +0 -1
- package/dist/packem_shared/make-request-BDzF9W9D.js +0 -1
- package/dist/packem_shared/mandrillProvider-370y7CLu.js +0 -1
- package/dist/packem_shared/mockProvider-DN5ZwutD.js +0 -1
- package/dist/packem_shared/nodemailerProvider-_w8QXMU-.js +0 -1
- package/dist/packem_shared/opentelemetryProvider-C_ZXOLSd.js +0 -1
- package/dist/packem_shared/plunkProvider-DfJumQ4U.js +0 -1
- package/dist/packem_shared/postalProvider-Bavx2FcH.js +0 -1
- package/dist/packem_shared/postmarkProvider-DFC0uvjO.js +0 -1
- package/dist/packem_shared/provider-base-Cmzx6BTO.js +0 -1
- package/dist/packem_shared/readFile-BlZxbhCU-C8bCdiA2.js +0 -1
- package/dist/packem_shared/resendProvider-CfqU7UdE.js +0 -1
- package/dist/packem_shared/roundRobinProvider-1WQnuKR8.js +0 -1
- package/dist/packem_shared/sanitize-header-wWav-Scu.js +0 -1
- package/dist/packem_shared/scalewayProvider-be1HPimL.js +0 -1
- package/dist/packem_shared/sendGridProvider-BVI1sq3n.js +0 -1
- package/dist/packem_shared/smtpProvider-BV-ufR53.js +0 -23
- package/dist/packem_shared/sweegoProvider-7419CSAq.js +0 -1
- package/dist/packem_shared/validate-email-options-DfJ7llf8.js +0 -1
- package/dist/packem_shared/zeptomailProvider-C2lh0Xmo.js +0 -1
- package/dist/providers/ahasend/provider.d.ts +0 -7
- package/dist/providers/ahasend/types.d.ts +0 -28
- package/dist/providers/aws-ses/provider.d.ts +0 -8
- package/dist/providers/aws-ses/types.d.ts +0 -38
- package/dist/providers/azure/provider.d.ts +0 -7
- package/dist/providers/azure/types.d.ts +0 -44
- package/dist/providers/brevo/provider.d.ts +0 -7
- package/dist/providers/brevo/types.d.ts +0 -57
- package/dist/providers/failover/provider.d.ts +0 -7
- package/dist/providers/failover/types.d.ts +0 -19
- package/dist/providers/http/provider.d.ts +0 -7
- package/dist/providers/http/types.d.ts +0 -27
- package/dist/providers/infobip/provider.d.ts +0 -7
- package/dist/providers/infobip/types.d.ts +0 -48
- package/dist/providers/mailcrab/provider.d.ts +0 -9
- package/dist/providers/mailcrab/types.d.ts +0 -22
- package/dist/providers/mailersend/provider.d.ts +0 -7
- package/dist/providers/mailersend/types.d.ts +0 -43
- package/dist/providers/mailgun/provider.d.ts +0 -7
- package/dist/providers/mailgun/types.d.ts +0 -65
- package/dist/providers/mailjet/provider.d.ts +0 -7
- package/dist/providers/mailjet/types.d.ts +0 -64
- package/dist/providers/mailomat/provider.d.ts +0 -7
- package/dist/providers/mailomat/types.d.ts +0 -32
- package/dist/providers/mailpace/provider.d.ts +0 -7
- package/dist/providers/mailpace/types.d.ts +0 -44
- package/dist/providers/mailtrap/provider.d.ts +0 -7
- package/dist/providers/mailtrap/types.d.ts +0 -36
- package/dist/providers/mandrill/provider.d.ts +0 -7
- package/dist/providers/mandrill/types.d.ts +0 -79
- package/dist/providers/mock/provider.d.ts +0 -8
- package/dist/providers/mock/types.d.ts +0 -50
- package/dist/providers/nodemailer/provider.d.ts +0 -7
- package/dist/providers/nodemailer/types.d.ts +0 -30
- package/dist/providers/opentelemetry/provider.d.ts +0 -8
- package/dist/providers/opentelemetry/types.d.ts +0 -31
- package/dist/providers/plunk/provider.d.ts +0 -7
- package/dist/providers/plunk/types.d.ts +0 -30
- package/dist/providers/postal/provider.d.ts +0 -7
- package/dist/providers/postal/types.d.ts +0 -40
- package/dist/providers/postmark/provider.d.ts +0 -7
- package/dist/providers/postmark/types.d.ts +0 -52
- package/dist/providers/provider.d.ts +0 -27
- package/dist/providers/resend/provider.d.ts +0 -7
- package/dist/providers/resend/types.d.ts +0 -43
- package/dist/providers/roundrobin/provider.d.ts +0 -7
- package/dist/providers/roundrobin/types.d.ts +0 -19
- package/dist/providers/scaleway/provider.d.ts +0 -7
- package/dist/providers/scaleway/types.d.ts +0 -36
- package/dist/providers/sendgrid/provider.d.ts +0 -7
- package/dist/providers/sendgrid/types.d.ts +0 -76
- package/dist/providers/smtp/provider.d.ts +0 -7
- package/dist/providers/smtp/types.d.ts +0 -63
- package/dist/providers/sweego/provider.d.ts +0 -7
- package/dist/providers/sweego/types.d.ts +0 -32
- package/dist/providers/utils/address-formatter.d.ts +0 -139
- package/dist/providers/utils/attachment-processor.d.ts +0 -58
- package/dist/providers/utils/index.d.ts +0 -4
- package/dist/providers/utils/payload-builder.d.ts +0 -78
- package/dist/providers/utils/provider-base.d.ts +0 -69
- package/dist/providers/zeptomail/provider.d.ts +0 -7
- package/dist/providers/zeptomail/types.d.ts +0 -29
- package/dist/template-engines/types.d.ts +0 -8
- package/dist/types.d.ts +0 -203
- package/dist/utils/build-mime-message.d.ts +0 -8
- package/dist/utils/create-logger.d.ts +0 -16
- package/dist/utils/format-email-addresses.d.ts +0 -8
- package/dist/utils/generate-boundary.d.ts +0 -7
- package/dist/utils/generate-message-id.d.ts +0 -6
- package/dist/utils/headers-to-record.d.ts +0 -9
- package/dist/utils/is-port-available.d.ts +0 -9
- package/dist/utils/make-request.d.ts +0 -18
- package/dist/utils/retry.d.ts +0 -10
- package/dist/utils/sanitize-header.d.ts +0 -14
- package/dist/utils/to-base64.d.ts +0 -8
- package/dist/utils/validation/check-mx-records.d.ts +0 -42
- package/dist/utils/validation/check-mx-records.js +0 -1
- package/dist/utils/validation/disposable-email-domains.d.ts +0 -13
- package/dist/utils/validation/disposable-email-domains.js +0 -1
- package/dist/utils/validation/role-accounts.d.ts +0 -21
- package/dist/utils/validation/role-accounts.js +0 -1
- package/dist/utils/validation/validate-email-options.d.ts +0 -8
- package/dist/utils/validation/verify-email.d.ts +0 -47
- package/dist/utils/validation/verify-email.js +0 -1
- package/dist/utils/validation/verify-smtp.d.ts +0 -39
- package/dist/utils/validation/verify-smtp.js +0 -4
|
@@ -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;
|
package/dist/crypto/types.d.ts
DELETED
|
@@ -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;
|
package/dist/mail-message.d.ts
DELETED
|
@@ -1,425 +0,0 @@
|
|
|
1
|
-
import type { ICalCalendar } from "ical-generator";
|
|
2
|
-
import type { AttachmentDataOptions, AttachmentOptions } from './attachment-helpers.d.ts';
|
|
3
|
-
import type { EmailEncrypter, EmailSigner } from './crypto/index.d.ts';
|
|
4
|
-
import type { TemplateRenderer } from './template-engines/types.d.ts';
|
|
5
|
-
import type { Attachment, CalendarEventOptions, EmailAddress, EmailHeaders, EmailOptions, Priority } from './types.d.ts';
|
|
6
|
-
type AddressInput = EmailAddress | EmailAddress[] | string | string[];
|
|
7
|
-
/**
|
|
8
|
-
* Mail message builder - provides fluent interface for building emails.
|
|
9
|
-
*/
|
|
10
|
-
export declare class MailMessage {
|
|
11
|
-
private fromAddress?;
|
|
12
|
-
private toAddresses;
|
|
13
|
-
private ccAddresses;
|
|
14
|
-
private bccAddresses;
|
|
15
|
-
private subjectText;
|
|
16
|
-
private textContent?;
|
|
17
|
-
private textCharset;
|
|
18
|
-
private autoTextEnabled;
|
|
19
|
-
private htmlContent?;
|
|
20
|
-
private htmlCharset;
|
|
21
|
-
private dateValue?;
|
|
22
|
-
private returnPathAddress?;
|
|
23
|
-
private senderAddress?;
|
|
24
|
-
private headers;
|
|
25
|
-
private attachments;
|
|
26
|
-
private replyToAddress?;
|
|
27
|
-
private priorityValue?;
|
|
28
|
-
private tagsValue;
|
|
29
|
-
private signer?;
|
|
30
|
-
private encrypter?;
|
|
31
|
-
private logger?;
|
|
32
|
-
private icalEventData?;
|
|
33
|
-
/**
|
|
34
|
-
* Sets the sender address.
|
|
35
|
-
* @param address The sender email address (string or EmailAddress object).
|
|
36
|
-
* @returns This instance for method chaining.
|
|
37
|
-
*/
|
|
38
|
-
from(address: EmailAddress | string): this;
|
|
39
|
-
/**
|
|
40
|
-
* Sets the recipient address(es).
|
|
41
|
-
* @param address The recipient email address(es) (string, EmailAddress, or arrays of either).
|
|
42
|
-
* @returns This instance for method chaining.
|
|
43
|
-
*/
|
|
44
|
-
to(address: AddressInput): this;
|
|
45
|
-
/**
|
|
46
|
-
* Sets the CC recipient address(es).
|
|
47
|
-
* @param address The CC recipient email address(es) (string, EmailAddress, or arrays of either).
|
|
48
|
-
* @returns This instance for method chaining.
|
|
49
|
-
*/
|
|
50
|
-
cc(address: AddressInput): this;
|
|
51
|
-
/**
|
|
52
|
-
* Sets the BCC recipient address(es).
|
|
53
|
-
* @param address The BCC recipient email address(es) (string, EmailAddress, or arrays of either).
|
|
54
|
-
* @returns This instance for method chaining.
|
|
55
|
-
*/
|
|
56
|
-
bcc(address: AddressInput): this;
|
|
57
|
-
/**
|
|
58
|
-
* Sets the subject line for the email message.
|
|
59
|
-
* @param text The subject text to set.
|
|
60
|
-
* @returns This instance for method chaining.
|
|
61
|
-
*/
|
|
62
|
-
subject(text: string): this;
|
|
63
|
-
/**
|
|
64
|
-
* Sets the plain text content of the email.
|
|
65
|
-
* @param content The plain text content to set.
|
|
66
|
-
* @param charset Optional charset for the text content (default: 'utf8').
|
|
67
|
-
* @returns This instance for method chaining.
|
|
68
|
-
*/
|
|
69
|
-
text(content: string, charset?: string): this;
|
|
70
|
-
/**
|
|
71
|
-
* Sets the HTML content of the email.
|
|
72
|
-
* @param content The HTML content to set.
|
|
73
|
-
* @param charset Optional charset for the HTML content (default: 'utf8').
|
|
74
|
-
* @returns This instance for method chaining.
|
|
75
|
-
*/
|
|
76
|
-
html(content: string, charset?: string): this;
|
|
77
|
-
/**
|
|
78
|
-
* Sets a custom email header.
|
|
79
|
-
* @param name The header name to set.
|
|
80
|
-
* @param value The header value to set.
|
|
81
|
-
* @returns This instance for method chaining.
|
|
82
|
-
*/
|
|
83
|
-
header(name: string, value: string): this;
|
|
84
|
-
/**
|
|
85
|
-
* Sets multiple headers.
|
|
86
|
-
* Accepts both Record<string, string> and ImmutableHeaders.
|
|
87
|
-
* @param headers The headers to set (Record or ImmutableHeaders).
|
|
88
|
-
* @returns This instance for method chaining.
|
|
89
|
-
*/
|
|
90
|
-
setHeaders(headers: EmailHeaders): this;
|
|
91
|
-
/**
|
|
92
|
-
* Attaches a file from path (reads file from filesystem).
|
|
93
|
-
* Similar to Laravel's attach() method.
|
|
94
|
-
* @param filePath The absolute or relative filesystem path to the file to attach.
|
|
95
|
-
* @param options Optional attachment configuration (filename, contentType, etc.).
|
|
96
|
-
* @returns This instance for method chaining.
|
|
97
|
-
* @example
|
|
98
|
-
* ```ts
|
|
99
|
-
* message.attachFromPath('/path/to/file.pdf')
|
|
100
|
-
* message.attachFromPath('/path/to/file.pdf', { filename: 'custom-name.pdf' })
|
|
101
|
-
* ```
|
|
102
|
-
*/
|
|
103
|
-
attachFromPath(filePath: string, options?: AttachmentOptions): Promise<this>;
|
|
104
|
-
/**
|
|
105
|
-
* Attaches raw data (string or Buffer).
|
|
106
|
-
* Similar to Laravel's attachData() method.
|
|
107
|
-
* @param content The content to attach (string or Buffer).
|
|
108
|
-
* @param options Attachment options including filename.
|
|
109
|
-
* @returns This instance for method chaining.
|
|
110
|
-
* @example
|
|
111
|
-
* ```ts
|
|
112
|
-
* message.attachData(Buffer.from('content'), 'file.txt')
|
|
113
|
-
* message.attachData('content', 'file.txt', { contentType: 'text/plain' })
|
|
114
|
-
* ```
|
|
115
|
-
*/
|
|
116
|
-
attachData(content: string | Buffer, options: AttachmentDataOptions): this;
|
|
117
|
-
/**
|
|
118
|
-
* Embeds an inline attachment from file path (for images in HTML).
|
|
119
|
-
* Similar to Laravel's embed() method.
|
|
120
|
-
* Returns the Content-ID that can be used in HTML: <img src="cid:{cid}">.
|
|
121
|
-
* @param filePath The path to the file to embed.
|
|
122
|
-
* @param options Optional attachment options (filename, contentType, etc.).
|
|
123
|
-
* @returns The Content-ID string that can be used in HTML.
|
|
124
|
-
* @example
|
|
125
|
-
* ```ts
|
|
126
|
-
* const cid = await message.embedFromPath('/path/to/logo.png')
|
|
127
|
-
* message.html(`<img src="cid:${cid}">`)
|
|
128
|
-
* ```
|
|
129
|
-
*/
|
|
130
|
-
embedFromPath(filePath: string, options?: Omit<AttachmentOptions, "contentDisposition" | "cid">): Promise<string>;
|
|
131
|
-
/**
|
|
132
|
-
* Embeds raw data as inline attachment (for images in HTML).
|
|
133
|
-
* Similar to Laravel's embedData() method.
|
|
134
|
-
* Returns the Content-ID that can be used in HTML: <img src="cid:{cid}">.
|
|
135
|
-
* @param content The content to embed (string or Buffer).
|
|
136
|
-
* @param filename The filename for the embedded attachment.
|
|
137
|
-
* @param options Optional attachment options (contentType, etc.).
|
|
138
|
-
* @returns The Content-ID string that can be used in HTML.
|
|
139
|
-
* @example
|
|
140
|
-
* ```ts
|
|
141
|
-
* const imageBuffer = Buffer.from('...')
|
|
142
|
-
* const cid = message.embedData(imageBuffer, 'logo.png', { contentType: 'image/png' })
|
|
143
|
-
* message.html(`<img src="cid:${cid}">`)
|
|
144
|
-
* ```
|
|
145
|
-
*/
|
|
146
|
-
embedData(content: string | Buffer, filename: string, options?: Omit<AttachmentDataOptions, "filename" | "contentDisposition" | "cid">): string;
|
|
147
|
-
/**
|
|
148
|
-
* Sets the reply-to address.
|
|
149
|
-
* @param address The reply-to email address (string or EmailAddress object).
|
|
150
|
-
* @returns This instance for method chaining.
|
|
151
|
-
*/
|
|
152
|
-
replyTo(address: EmailAddress | string): this;
|
|
153
|
-
/**
|
|
154
|
-
* Sets the date header for the email.
|
|
155
|
-
* @param date The date to set (Date object or ISO string).
|
|
156
|
-
* @returns This instance for method chaining.
|
|
157
|
-
*/
|
|
158
|
-
date(date: Date | string): this;
|
|
159
|
-
/**
|
|
160
|
-
* Sets the return-path address (bounce address).
|
|
161
|
-
* @param address The return-path email address (string or EmailAddress object).
|
|
162
|
-
* @returns This instance for method chaining.
|
|
163
|
-
*/
|
|
164
|
-
returnPath(address: EmailAddress | string): this;
|
|
165
|
-
/**
|
|
166
|
-
* Sets the sender address (different from From - used when From contains multiple addresses).
|
|
167
|
-
* @param address The sender email address (string or EmailAddress object).
|
|
168
|
-
* @returns This instance for method chaining.
|
|
169
|
-
*/
|
|
170
|
-
sender(address: EmailAddress | string): this;
|
|
171
|
-
/**
|
|
172
|
-
* Adds recipient address(es) without replacing existing ones.
|
|
173
|
-
* @param address The recipient email address(es) (string, EmailAddress, or arrays of either).
|
|
174
|
-
* @returns This instance for method chaining.
|
|
175
|
-
*/
|
|
176
|
-
addTo(address: AddressInput): this;
|
|
177
|
-
/**
|
|
178
|
-
* Adds CC recipient address(es) without replacing existing ones.
|
|
179
|
-
* @param address The CC recipient email address(es) (string, EmailAddress, or arrays of either).
|
|
180
|
-
* @returns This instance for method chaining.
|
|
181
|
-
*/
|
|
182
|
-
addCc(address: AddressInput): this;
|
|
183
|
-
/**
|
|
184
|
-
* Adds BCC recipient address(es) without replacing existing ones.
|
|
185
|
-
* @param address The BCC recipient email address(es) (string, EmailAddress, or arrays of either).
|
|
186
|
-
* @returns This instance for method chaining.
|
|
187
|
-
*/
|
|
188
|
-
addBcc(address: AddressInput): this;
|
|
189
|
-
/**
|
|
190
|
-
* Adds reply-to address(es) without replacing existing ones.
|
|
191
|
-
* @param address The reply-to email address(es) (string, EmailAddress, or arrays of either).
|
|
192
|
-
* @returns This instance for method chaining.
|
|
193
|
-
*/
|
|
194
|
-
addReplyTo(address: EmailAddress | string | (EmailAddress | string)[]): this;
|
|
195
|
-
/**
|
|
196
|
-
* Adds from address(es) without replacing existing ones.
|
|
197
|
-
* @param address The sender email address(es) (string, EmailAddress, or arrays of either).
|
|
198
|
-
* @returns This instance for method chaining.
|
|
199
|
-
*/
|
|
200
|
-
addFrom(address: EmailAddress | string | (EmailAddress | string)[]): this;
|
|
201
|
-
/**
|
|
202
|
-
* Sets the email priority.
|
|
203
|
-
* @param priority The priority level ('high', 'normal', or 'low').
|
|
204
|
-
* @returns This instance for method chaining.
|
|
205
|
-
*/
|
|
206
|
-
priority(priority: Priority): this;
|
|
207
|
-
/**
|
|
208
|
-
* Sets email tags for categorization.
|
|
209
|
-
* @param tags The tags to set (string or array of strings).
|
|
210
|
-
* @returns This instance for method chaining.
|
|
211
|
-
*/
|
|
212
|
-
tags(tags: string | string[]): this;
|
|
213
|
-
/**
|
|
214
|
-
* Signs the email message using a signer (DKIM or S/MIME).
|
|
215
|
-
* @param signer The signer instance to use.
|
|
216
|
-
* @example
|
|
217
|
-
* ```ts
|
|
218
|
-
* import { createDkimSigner } from '@visulima/email/crypto';
|
|
219
|
-
* const signer = createDkimSigner({
|
|
220
|
-
* domainName: 'example.com',
|
|
221
|
-
* keySelector: 'default',
|
|
222
|
-
* privateKey: '-----BEGIN PRIVATE KEY-----...'
|
|
223
|
-
* });
|
|
224
|
-
* message.sign(signer)
|
|
225
|
-
* ```
|
|
226
|
-
*/
|
|
227
|
-
sign(signer: EmailSigner): this;
|
|
228
|
-
/**
|
|
229
|
-
* Encrypts the email message using an encrypter (S/MIME).
|
|
230
|
-
* @param encrypter The encrypter instance to use.
|
|
231
|
-
* @example
|
|
232
|
-
* ```ts
|
|
233
|
-
* import { createSmimeEncrypter } from '@visulima/email/crypto';
|
|
234
|
-
* const encrypter = createSmimeEncrypter({
|
|
235
|
-
* certificates: '/path/to/certificate.crt'
|
|
236
|
-
* });
|
|
237
|
-
* message.encrypt(encrypter)
|
|
238
|
-
* ```
|
|
239
|
-
*/
|
|
240
|
-
encrypt(encrypter: EmailEncrypter): this;
|
|
241
|
-
/**
|
|
242
|
-
* Sets the logger instance for this message.
|
|
243
|
-
* @param logger The logger instance (Console) to use for logging.
|
|
244
|
-
* @returns This instance for method chaining.
|
|
245
|
-
* @example
|
|
246
|
-
* ```ts
|
|
247
|
-
* message.logger(console)
|
|
248
|
-
* ```
|
|
249
|
-
*/
|
|
250
|
-
setLogger(logger: Console): this;
|
|
251
|
-
/**
|
|
252
|
-
* Attach a calendar event and define contents as string or function.
|
|
253
|
-
* @param contents The calendar content as a string or a function that receives an ICalCalendar instance.
|
|
254
|
-
* @param options Optional calendar event options (method, alternativeText).
|
|
255
|
-
* @returns This instance for method chaining.
|
|
256
|
-
* @example
|
|
257
|
-
* ```ts
|
|
258
|
-
* message.icalEvent((calendar) => {
|
|
259
|
-
* calendar.createEvent({
|
|
260
|
-
* start: new Date(),
|
|
261
|
-
* summary: 'Meeting'
|
|
262
|
-
* });
|
|
263
|
-
* })
|
|
264
|
-
* message.icalEvent('BEGIN:VCALENDAR...')
|
|
265
|
-
* ```
|
|
266
|
-
*/
|
|
267
|
-
icalEvent(contents: ((calendar: ICalCalendar) => void) | string, options?: CalendarEventOptions): this;
|
|
268
|
-
/**
|
|
269
|
-
* Attach a calendar event and load contents from a file.
|
|
270
|
-
* @param file The file path (string or URL) to load the calendar event from.
|
|
271
|
-
* @param options Optional calendar event options (method, alternativeText).
|
|
272
|
-
* @returns This instance for method chaining.
|
|
273
|
-
* @example
|
|
274
|
-
* ```ts
|
|
275
|
-
* message.icalEventFromFile('/path/to/event.ics')
|
|
276
|
-
* message.icalEventFromFile(new URL('file:///path/to/event.ics'))
|
|
277
|
-
* ```
|
|
278
|
-
*/
|
|
279
|
-
icalEventFromFile(file: string | URL, options?: CalendarEventOptions): this;
|
|
280
|
-
/**
|
|
281
|
-
* Attach a calendar event and load contents from a URL.
|
|
282
|
-
* @param url The URL to fetch the calendar event from.
|
|
283
|
-
* @param options Optional calendar event options (method, alternativeText).
|
|
284
|
-
* @returns This instance for method chaining.
|
|
285
|
-
* @example
|
|
286
|
-
* ```ts
|
|
287
|
-
* message.icalEventFromUrl('https://example.com/event.ics')
|
|
288
|
-
* ```
|
|
289
|
-
*/
|
|
290
|
-
icalEventFromUrl(url: string, options?: CalendarEventOptions): this;
|
|
291
|
-
/**
|
|
292
|
-
* Renders a template and sets as HTML content.
|
|
293
|
-
* Accepts a render function for flexible template engine support.
|
|
294
|
-
* @param render The template renderer function.
|
|
295
|
-
* @param template The template content (string, React component, etc.).
|
|
296
|
-
* @param data Optional data/variables to pass to the template.
|
|
297
|
-
* @param options Optional renderer-specific options.
|
|
298
|
-
* @param options.autoText Whether to auto-generate text version from HTML (default: true).
|
|
299
|
-
* @returns This instance for method chaining.
|
|
300
|
-
* @example
|
|
301
|
-
* ```ts
|
|
302
|
-
* import { renderHandlebars } from '@visulima/email/template/handlebars';
|
|
303
|
-
* message.view(renderHandlebars, '<h1>Hello {{name}}!</h1>', { name: 'John' })
|
|
304
|
-
*
|
|
305
|
-
* import { renderMjml } from '@visulima/email/template/mjml';
|
|
306
|
-
* message.view(renderMjml, mjmlTemplate)
|
|
307
|
-
*
|
|
308
|
-
* import { renderReactEmail } from '@visulima/email/template/react-email';
|
|
309
|
-
* message.view(renderReactEmail, <WelcomeEmail name="John" />)
|
|
310
|
-
* ```
|
|
311
|
-
*/
|
|
312
|
-
view(render: TemplateRenderer, template: unknown, data?: Record<string, unknown>, options?: {
|
|
313
|
-
[key: string]: unknown;
|
|
314
|
-
autoText?: boolean;
|
|
315
|
-
}): Promise<this>;
|
|
316
|
-
/**
|
|
317
|
-
* Renders a text template and sets as text content.
|
|
318
|
-
* @param render The template renderer function.
|
|
319
|
-
* @param template The text template content.
|
|
320
|
-
* @param data Optional data/variables to pass to the template.
|
|
321
|
-
* @param options Optional renderer-specific options.
|
|
322
|
-
* @returns This instance for method chaining.
|
|
323
|
-
* @example
|
|
324
|
-
* ```ts
|
|
325
|
-
* import { renderHandlebars } from '@visulima/email/template/handlebars';
|
|
326
|
-
* message.viewText(renderHandlebars, 'Hello {{name}}!', { name: 'John' })
|
|
327
|
-
* ```
|
|
328
|
-
*/
|
|
329
|
-
viewText(render: TemplateRenderer, template: string, data?: Record<string, unknown>, options?: Record<string, unknown>): Promise<this>;
|
|
330
|
-
/**
|
|
331
|
-
* Builds the email options.
|
|
332
|
-
* @returns The built email options ready for sending.
|
|
333
|
-
* @throws {Error} When required fields (from, to, subject, content) are missing.
|
|
334
|
-
*/
|
|
335
|
-
build(): Promise<EmailOptions>;
|
|
336
|
-
/**
|
|
337
|
-
* Gets the subject of the email.
|
|
338
|
-
* @returns The subject text or empty string if not set.
|
|
339
|
-
*/
|
|
340
|
-
getSubject(): string;
|
|
341
|
-
/**
|
|
342
|
-
* Gets the from address.
|
|
343
|
-
* @returns The from address or undefined if not set.
|
|
344
|
-
*/
|
|
345
|
-
getFrom(): EmailAddress | undefined;
|
|
346
|
-
/**
|
|
347
|
-
* Gets the recipient addresses.
|
|
348
|
-
* @returns Array of recipient addresses.
|
|
349
|
-
*/
|
|
350
|
-
getTo(): EmailAddress[];
|
|
351
|
-
/**
|
|
352
|
-
* Gets the CC recipient addresses.
|
|
353
|
-
* @returns Array of CC recipient addresses.
|
|
354
|
-
*/
|
|
355
|
-
getCc(): EmailAddress[];
|
|
356
|
-
/**
|
|
357
|
-
* Gets the BCC recipient addresses.
|
|
358
|
-
* @returns Array of BCC recipient addresses.
|
|
359
|
-
*/
|
|
360
|
-
getBcc(): EmailAddress[];
|
|
361
|
-
/**
|
|
362
|
-
* Gets the reply-to address.
|
|
363
|
-
* @returns The reply-to address or undefined if not set.
|
|
364
|
-
*/
|
|
365
|
-
getReplyTo(): EmailAddress | undefined;
|
|
366
|
-
/**
|
|
367
|
-
* Gets the sender address.
|
|
368
|
-
* @returns The sender address or undefined if not set.
|
|
369
|
-
*/
|
|
370
|
-
getSender(): EmailAddress | undefined;
|
|
371
|
-
/**
|
|
372
|
-
* Gets the return-path address.
|
|
373
|
-
* @returns The return-path address or undefined if not set.
|
|
374
|
-
*/
|
|
375
|
-
getReturnPath(): EmailAddress | undefined;
|
|
376
|
-
/**
|
|
377
|
-
* Gets the date header.
|
|
378
|
-
* @returns The date or undefined if not set.
|
|
379
|
-
*/
|
|
380
|
-
getDate(): Date | undefined;
|
|
381
|
-
/**
|
|
382
|
-
* Gets the priority of the email.
|
|
383
|
-
* @returns The priority ('high', 'normal', 'low') or undefined if not set.
|
|
384
|
-
*/
|
|
385
|
-
getPriority(): Priority | undefined;
|
|
386
|
-
/**
|
|
387
|
-
* Gets the plain text content.
|
|
388
|
-
* @returns The text content or undefined if not set.
|
|
389
|
-
*/
|
|
390
|
-
getTextBody(): string | undefined;
|
|
391
|
-
/**
|
|
392
|
-
* Gets the charset for the text content.
|
|
393
|
-
* @returns The text charset (default: 'utf8').
|
|
394
|
-
*/
|
|
395
|
-
getTextCharset(): string;
|
|
396
|
-
/**
|
|
397
|
-
* Gets the HTML content.
|
|
398
|
-
* @returns The HTML content or undefined if not set.
|
|
399
|
-
*/
|
|
400
|
-
getHtmlBody(): string | undefined;
|
|
401
|
-
/**
|
|
402
|
-
* Gets the charset for the HTML content.
|
|
403
|
-
* @returns The HTML charset (default: 'utf8').
|
|
404
|
-
*/
|
|
405
|
-
getHtmlCharset(): string;
|
|
406
|
-
/**
|
|
407
|
-
* Gets the attachments.
|
|
408
|
-
* @returns Array of attachments.
|
|
409
|
-
*/
|
|
410
|
-
getAttachments(): Attachment[];
|
|
411
|
-
/**
|
|
412
|
-
* Attempts to auto-generate text content from HTML.
|
|
413
|
-
* @param html The HTML content to convert.
|
|
414
|
-
* @private
|
|
415
|
-
*/
|
|
416
|
-
private tryAutoGenerateText;
|
|
417
|
-
/**
|
|
418
|
-
* Creates an error, logs it, and throws it.
|
|
419
|
-
* @param message Error message to throw.
|
|
420
|
-
* @param logMessage Optional log message (defaults to message).
|
|
421
|
-
* @private
|
|
422
|
-
*/
|
|
423
|
-
private throwAndLogError;
|
|
424
|
-
}
|
|
425
|
-
export default MailMessage;
|