@visulima/email 1.0.0-alpha.9 → 1.0.1
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 +782 -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-CiLBaXrg.js +18 -0
- package/dist/packem_shared/DraftMailMessage-CGTVuy2z.js +1 -0
- package/dist/packem_shared/EmailError-B-sEf3bp.js +1 -0
- package/dist/packem_shared/Mail-C1zp-fqt.js +1 -0
- package/dist/packem_shared/MailMessage-DQRgs5Dz.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-DavopRlE.js +6 -0
- package/dist/packem_shared/SmimeSigner-0onWksAv.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-DDLEHW2E.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-D3XPGiHY.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-DFH3kp6K.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-BoZvzveg.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 +191 -81
- 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 +0,0 @@
|
|
|
1
|
-
var P=Object.defineProperty;var h=(r,l)=>P(r,"name",{value:l,configurable:!0});import{createRequire as A}from"node:module";import c from"./EmailError-zm2ffVav.js";import y from"./RequiredOptionError-CevW3u2K.js";import{s as E}from"./generate-message-id-D4uA8gkj.js";import{i as k}from"./headers-to-record-Qo124ImV.js";import{m as b}from"./make-request-BDzF9W9D.js";import{c as z,P as q,u as w,h as v}from"./provider-base-Cmzx6BTO.js";import{d as K}from"./validate-email-options-DfJ7llf8.js";import{defineProvider as C}from"./defineProvider-B9rSklAJ.js";import{f as p,a as x}from"./address-formatter-Cm_E_ZMa.js";const T=A(import.meta.url),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,S=h(r=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[l,s]=u.versions.node.split(".").map(Number);if(l>22||l===22&&s>=3||l===20&&s>=16)return u.getBuiltinModule(r)}return T(r)},"__cjs_getBuiltinModule"),{Buffer:_}=S("node:buffer"),a="scaleway",R="https://api.scaleway.com/transactional-email/v1alpha1",B=3e4,G=3,U=C((r={})=>{if(!r.apiKey)throw new y(a,"apiKey");if(!r.region)throw new y(a,"region");const l=r.endpoint||R,s={apiKey:r.apiKey,debug:r.debug||!1,endpoint:l,region:r.region,retries:r.retries||G,timeout:r.timeout||B,...r.logger&&{logger:r.logger}},f=new q,n=z(a,r.logger);return{features:{attachments:!0,batchSending:!1,customHeaders:!0,html:!0,replyTo:!0,scheduling:!1,tagging:!1,templates:!0,tracking:!1},async getEmail(e){try{if(!e)return{error:new c(a,"Email ID is required to retrieve email details"),success:!1};await f.ensureInitialized(()=>this.initialize(),a);const o={"Content-Type":"application/json","X-Auth-Token":s.apiKey};n.debug("Retrieving email details",{id:e});const t=await w(async()=>b(`${s.endpoint}/regions/${s.region}/emails/${e}`,{headers:o,method:"GET",timeout:s.timeout}),s.retries);return t.success?(n.debug("Email details retrieved successfully"),{data:t.data?.body,success:!0}):(n.debug("API request failed when retrieving email",t.error),{error:new c(a,`Failed to retrieve email: ${t.error instanceof Error?t.error.message:"Unknown error"}`,{cause:t.error}),success:!1})}catch(o){return{error:v(a,"retrieve email",o,n),success:!1}}},async initialize(){await f.ensureInitialized(async()=>{if(!await this.isAvailable())throw new c(a,"Scaleway API not available or invalid API key");n.debug("Provider initialized successfully")},a)},async isAvailable(){try{return n.debug("Checking Scaleway API availability"),!0}catch(e){return n.debug("Error checking availability:",e),!1}},name:a,options:s,async sendEmail(e){try{const o=K(e);if(o.length>0)return{error:new c(a,`Invalid email options: ${o.join(", ")}`),success:!1};await f.ensureInitialized(()=>this.initialize(),a);const t={from:{email:e.from.email,...e.from.name&&{name:e.from.name}},subject:e.subject,to:p(e.to)};if(e.html&&(t.html=e.html),e.text&&(t.text=e.text),e.cc&&(t.cc=p(e.cc)),e.bcc&&(t.bcc=p(e.bcc)),e.replyTo&&(t.replyTo=x(e.replyTo)),e.templateId&&(t.templateId=e.templateId,e.templateVariables&&(t.templateVariables=e.templateVariables)),e.projectId&&(t.projectId=e.projectId),e.headers){const i=k(e.headers);t.headers=i}e.attachments&&e.attachments.length>0&&(t.attachments=await Promise.all(e.attachments.map(async i=>{let d;if(i.content)if(typeof i.content=="string")d=i.content;else if(i.content instanceof Promise){const j=await i.content;d=_.from(j).toString("base64")}else d=i.content.toString("base64");else if(i.raw)d=typeof i.raw=="string"?i.raw:i.raw.toString("base64");else throw new c(a,`Attachment ${i.filename} has no content`);return{content:d,name:i.filename,type:i.contentType||"application/octet-stream"}}))),n.debug("Sending email via Scaleway API",{subject:t.subject,to:t.to});const I={"Content-Type":"application/json","X-Auth-Token":s.apiKey},m=await w(async()=>b(`${s.endpoint}/regions/${s.region}/emails`,{headers:I,method:"POST",timeout:s.timeout},JSON.stringify(t)),s.retries);if(!m.success)return n.debug("API request failed when sending email",m.error),{error:m.error||new c(a,"Failed to send email"),success:!1};const g=m.data?.body?.id||E();return n.debug("Email sent successfully",{messageId:g}),{data:{messageId:g,provider:a,response:m.data,sent:!0,timestamp:new Date},success:!0}}catch(o){return{error:v(a,"send email",o,n),success:!1}}},async validateCredentials(){return this.isAvailable()}}});export{U as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import l from"./EmailError-zm2ffVav.js";import A from"./RequiredOptionError-CevW3u2K.js";import{s as S}from"./generate-message-id-D4uA8gkj.js";import{i as P}from"./headers-to-record-Qo124ImV.js";import{m as h}from"./make-request-BDzF9W9D.js";import{c as $,P as j,u as b,h as v}from"./provider-base-Cmzx6BTO.js";import{d as G}from"./validate-email-options-DfJ7llf8.js";import{defineProvider as z}from"./defineProvider-B9rSklAJ.js";import{f,a as I}from"./address-formatter-Cm_E_ZMa.js";import{c as k}from"./attachment-processor-2rHmfa7j.js";const s="sendgrid",C="https://api.sendgrid.com/v3",E=3e4,T=3,R=z((o={})=>{if(!o.apiKey)throw new A(s,"apiKey");const a={apiKey:o.apiKey,debug:o.debug||!1,endpoint:o.endpoint||C,...o.logger&&{logger:o.logger},retries:o.retries||T,timeout:o.timeout||E},p=new j,i=$(s,o.logger);return{endpoint:a.endpoint,features:{attachments:!0,batchSending:!0,customHeaders:!0,html:!0,replyTo:!0,scheduling:!0,tagging:!0,templates:!0,tracking:!0},async getEmail(e){try{if(!e)return{error:new l(s,"Email ID is required to retrieve email details"),success:!1};await p.ensureInitialized(()=>this.initialize(),s);const t={Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json"};i.debug("Retrieving email details",{id:e});const r=await b(async()=>h(`${a.endpoint}/messages/${e}`,{headers:t,method:"GET",timeout:a.timeout}),a.retries);return r.success?(i.debug("Email details retrieved successfully"),{data:r.data?.body,success:!0}):(i.debug("API request failed when retrieving email",r.error),{error:new l(s,`Failed to retrieve email: ${r.error instanceof Error?r.error.message:"Unknown error"}`,{cause:r.error}),success:!1})}catch(t){return{error:v(s,"retrieve email",t,i),success:!1}}},async initialize(){await p.ensureInitialized(async()=>{if(!await this.isAvailable())throw new l(s,"SendGrid API not available or invalid API key");i.debug("Provider initialized successfully")},s)},async isAvailable(){try{if(a.apiKey&&a.apiKey.startsWith("SG."))return i.debug("API key format is valid, assuming SendGrid is available"),!0;const e={Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json"};i.debug("Checking SendGrid API availability");const t=await h(`${a.endpoint}/user/profile`,{headers:e,method:"GET",timeout:a.timeout});return i.debug("SendGrid API availability check response:",{error:t.error instanceof Error?t.error.message:void 0,statusCode:t.data?.statusCode,success:t.success}),!!(t.success&&t.data&&typeof t.data=="object"&&"statusCode"in t.data&&typeof t.data.statusCode=="number"&&t.data.statusCode>=200&&t.data.statusCode<300)}catch(e){return i.debug("Error checking availability:",e),!1}},name:s,options:a,async sendEmail(e){try{const t=G(e);if(t.length>0)return{error:new l(s,`Invalid email options: ${t.join(", ")}`),success:!1};await p.ensureInitialized(()=>this.initialize(),s);const r={to:f(e.to)};if(e.cc&&(r.cc=f(e.cc)),e.bcc&&(r.bcc=f(e.bcc)),e.subject&&(r.subject=e.subject),e.tags&&e.tags.length>0){const d={};for(let m=0;m<e.tags.length;m+=1)d[`tag_${m}`]=e.tags[m];r.customArgs=d}const n={from:I(e.from),personalizations:[r]},u=[];if(e.html&&u.push({type:"text/html",value:e.html}),e.text&&u.push({type:"text/plain",value:e.text}),u.length>0&&(n.content=u),e.replyTo&&(n.reply_to=I(e.replyTo)),e.subject&&(n.subject=e.subject),e.templateId&&(n.template_id=e.templateId,e.templateData&&(r.dynamicTemplateData=e.templateData)),e.sendAt&&(r.send_at=e.sendAt),e.batchId&&(n.batch_id=e.batchId),e.asmGroupId&&(n.asm={group_id:e.asmGroupId}),e.ipPoolName&&(n.ip_pool_name=e.ipPoolName),e.mailSettings&&(n.mail_settings=e.mailSettings),e.trackingSettings&&(n.tracking_settings=e.trackingSettings),e.headers){const d=P(e.headers);n.headers=d}e.attachments&&e.attachments.length>0&&(n.attachments=await Promise.all(e.attachments.map(async d=>k(d,s)))),i.debug("Sending email via SendGrid API",{subject:n.subject,to:r.to});const w={Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json"},c=await b(async()=>h(`${a.endpoint}/mail/send`,{headers:w,method:"POST",timeout:a.timeout},JSON.stringify(n)),a.retries);if(!c.success)return i.debug("API request failed when sending email",c.error),{error:c.error||new l(s,"Failed to send email"),success:!1};const g=c.data?.headers,y=(g&&g instanceof Headers?g.get("X-Message-Id"):void 0)||S();return i.debug("Email sent successfully",{messageId:y}),{data:{messageId:y,provider:s,response:c.data,sent:!0,timestamp:new Date},success:!0}}catch(t){return{error:v(s,"send email",t,i),success:!1}}},async validateCredentials(){return this.isAvailable()}}});export{R as default};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var X=Object.defineProperty;var C=(u,r)=>X(u,"name",{value:r,configurable:!0});import{createRequire as q}from"node:module";import m from"./EmailError-zm2ffVav.js";import J from"./RequiredOptionError-CevW3u2K.js";import{z as ee}from"./build-mime-message-IYaUqqPJ.js";import{s as te}from"./generate-message-id-D4uA8gkj.js";import{d as re}from"./validate-email-options-DfJ7llf8.js";import{defineProvider as oe}from"./defineProvider-B9rSklAJ.js";const W=q(import.meta.url),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,M=C(u=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[r,y]=k.versions.node.split(".").map(Number);if(r>22||r===22&&y>=3||r===20&&y>=16)return k.getBuiltinModule(u)}return W(u)},"__cjs_getBuiltinModule"),{Buffer:v}=M("node:buffer"),{createHmac:K,createHash:Y,createSign:Q}=M("node:crypto"),{Socket:V,createConnection:Z}=M("node:net"),{connect:z}=M("node:tls");var se=Object.defineProperty,_=C((u,r)=>se(u,"name",{value:r,configurable:!0}),"n");const ae=_((u,r)=>new Promise(y=>{const f=new V,g=_(()=>{f.destroy(),y(!1)},"onError");f.setTimeout(1e3),f.on("error",g),f.on("timeout",g),f.connect(r,u,()=>{f.end(),y(!0)})}),"isPortAvailable");var ne=Object.defineProperty,p=C((u,r)=>ne(u,"name",{value:r,configurable:!0}),"h");const l="smtp",ie=25,ce=465,ue=1e4,le=!1,me=5,x=3e4,be=oe((u={})=>{if(!u.host)throw new J(l,"host");const r={authMethod:u.authMethod||"LOGIN",debug:u.debug??!1,dkim:u.dkim,host:u.host,maxConnections:u.maxConnections??me,oauth2:u.oauth2,password:u.password,pool:u.pool??!1,port:u.port!==void 0?u.port:u.secure?ce:ie,rejectUnauthorized:u.rejectUnauthorized??!0,retries:u.retries??0,secure:u.secure??le,timeout:u.timeout??ue,user:u.user,...u.logger&&{logger:u.logger}};let y=!1;const f=[],g=[],b=p(e=>e.replaceAll(/[\r\n\t\v\f]/g," ").trim(),"sanitizeHeaderValue"),U=p(e=>{const c=e.split(`\r
|
|
2
|
-
`),s={};for(const i of c)if(i.startsWith("250-")||i.startsWith("250 ")){const n=i.slice(4).trim().split(" "),o=n[0];o&&(s[o]=n.slice(1))}return s},"parseEhloResponse"),h=p(async(e,c,s)=>new Promise((i,n)=>{const o=Array.isArray(s)?s:[s];let a="",t="";const d=setTimeout(()=>{w(),n(new m(l,`Command timeout after ${r.timeout}ms: ${c?.slice(0,50)}...`))},r.timeout),w=p(()=>{e.removeListener("data",$),e.removeListener("error",L),d&&clearTimeout(d)},"cleanup"),$=p(S=>{a+=S.toString();const j=a.split(`\r
|
|
3
|
-
`).filter(Boolean);if(j.length>0){const I=j[j.length-1];if(I){const O=I.match(/^(\d{3})[\s-]/);if(O){const[,R]=O;t=R,I[3]===" "&&(w(),o.includes(t)?i(a):n(new m(l,`Expected ${o.join(" or ")}, got ${t}: ${a.trim()}`)))}}}},"onData"),L=p(S=>{w(),n(new m(l,`Socket error: ${S.message}`,{cause:S}))},"onError");e.on("data",$),e.on("error",L),c&&e.write(`${c}\r
|
|
4
|
-
`)}),"sendSmtpCommand"),H=p(async()=>{if(r.pool&&f.length>0){const e=f.pop();if(e&&!e.destroyed)return e}return r.pool&&f.length+1>=r.maxConnections?new Promise((e,c)=>{const s={reject:c,resolve:e};s.timeout=setTimeout(()=>{const i=g.indexOf(s);i!==-1&&g.splice(i,1),c(new m(l,`Connection queue timeout after ${x}ms`))},x),g.push(s)}):new Promise((e,c)=>{let s,i=!1,n;const o=p(()=>{s&&clearTimeout(s)},"cleanup");s=setTimeout(()=>{i||(i=!0,n&&!n.destroyed&&n.destroy(),o(),c(new m(l,`Connection timeout to ${r.host}:${r.port} after ${r.timeout}ms`)))},r.timeout);try{n=r.secure?z({host:r.host,port:r.port,rejectUnauthorized:r.rejectUnauthorized}):Z(r.port,r.host),n.on("error",a=>{i||(i=!0,o(),c(new m(l,`Connection error: ${a.message}`,{cause:a})))}),n.once("data",a=>{if(!i&&n){i=!0,o();const t=a.toString();t.slice(0,3)==="220"?e(n):(n.destroy(),c(new m(l,`Unexpected server greeting: ${t.trim()}`)))}})}catch(a){i||(i=!0,o(),c(new m(l,`Failed to create connection: ${a.message}`,{cause:a})))}})},"createSmtpConnection"),D=p(async e=>new Promise((c,s)=>{let i,n=!1,o;const a=p(()=>{i&&clearTimeout(i)},"cleanup");i=setTimeout(()=>{n||(n=!0,o&&!o.destroyed&&o.destroy(),a(),s(new m(l,`TLS connection timeout after ${r.timeout}ms`)))},r.timeout);try{const t={host:r.host,rejectUnauthorized:r.rejectUnauthorized,socket:e};o=z(t),o.on("error",d=>{n||(n=!0,a(),s(new m(l,`TLS connection error: ${d.message}`,{cause:d})))}),o.once("secure",()=>{!n&&o&&(n=!0,a(),c(o))})}catch(t){n||(n=!0,a(),s(new m(l,`Failed to upgrade to TLS: ${t.message}`,{cause:t})))}}),"upgradeToTLS"),F=p(e=>{if(e.destroyed||!r.pool){try{e.destroy()}catch{}return}if(g.length>0){const c=g.shift();if(c){clearTimeout(c.timeout),c.resolve(e);return}}f.push(e)},"releaseConnection"),T=p(async(e,c=!1)=>new Promise(s=>{try{if(c){e.write(`RSET\r
|
|
5
|
-
`),F(e),s();return}e.write(`QUIT\r
|
|
6
|
-
`),e.end(),e.once("close",()=>s())}catch{s()}}),"closeConnection"),E=p(async e=>{if(!r.user)return;const c=await h(e,`EHLO ${r.host}`,"250"),s=U(c),i=Object.keys(s).find(a=>a.toUpperCase()==="AUTH");if(!i&&(r.user||r.password))throw new m(l,"Server does not support authentication");const n=i?s[i]||[]:[];let{authMethod:o}=r;if(o||(n.includes("CRAM-MD5")?o="CRAM-MD5":n.includes("LOGIN")?o="LOGIN":n.includes("PLAIN")&&(o="PLAIN")),!o)throw new m(l,"No supported authentication methods");if(o==="OAUTH2"&&r.oauth2)try{const{accessToken:a,user:t}=r.oauth2,d=`user=${t}auth=Bearer ${a}`,w=v.from(d).toString("base64");await h(e,`AUTH XOAUTH2 ${w}`,"235");return}catch(a){const t=a.message;throw t.includes("535")||t.includes("Authentication failed")?new m(l,"Authentication failed: Invalid OAuth2 credentials"):a}if(o==="CRAM-MD5"&&r.password)try{const a=(await h(e,"AUTH CRAM-MD5","334")).split(" ")[1];if(!a)throw new m(l,"Invalid CRAM-MD5 challenge response");const t=v.from(a,"base64").toString("utf8"),d=K("md5",r.password);d.update(t);const w=d.digest("hex"),$=`${r.user} ${w}`;await h(e,v.from($).toString("base64"),"235");return}catch(a){const t=a.message;throw t.includes("535")||t.includes("Authentication failed")?new m(l,"Authentication failed: Invalid username or password"):a}if(o==="LOGIN"&&r.password)try{await h(e,"AUTH LOGIN","334"),await h(e,v.from(r.user).toString("base64"),"334"),await h(e,v.from(r.password).toString("base64"),"235");return}catch(a){const t=a.message;throw t.includes("535")||t.includes("Authentication failed")?new m(l,"Authentication failed: Invalid username or password"):a}if(o==="PLAIN"&&r.password)try{const a=v.from(`\0${r.user}\0${r.password}`).toString("base64");await h(e,`AUTH PLAIN ${a}`,"235");return}catch(a){const t=a.message;throw t.includes("535")||t.includes("Authentication failed")?new m(l,"Authentication failed: Invalid username or password"):a}throw new m(l,"Authentication failed - no valid credentials or method")},"authenticate"),G=p(e=>{if(!r.dkim)return e;const{domainName:c,keySelector:s,privateKey:i}=r.dkim;try{const[n,o]=e.split(`\r
|
|
7
|
-
\r
|
|
8
|
-
`);if(!n||!o)return e;const a=n.split(`\r
|
|
9
|
-
`),t=p(A=>A.replaceAll(`\r
|
|
10
|
-
`,`
|
|
11
|
-
`).replaceAll(/\s+/g," ").trim(),"canonicalize"),d=t(o),w=Y("sha256").update(d).digest("base64"),$=["from","to","subject","date"],L=a.filter(A=>$.some(P=>A.toLowerCase().startsWith(`${P}:`))),S=L.map(A=>A.split(":")[0]?.toLowerCase()||"").filter(Boolean).join(":"),j=Math.floor(Date.now()/1e3),I={a:"rsa-sha256",bh:w,c:"relaxed/relaxed",d:c,h:S,s,t:j.toString(),v:"1"},O=`DKIM-Signature: ${Object.entries(I).map(([A,P])=>`${A}=${P}`).join("; ")}; b=`,R=[...L,O].map(A=>t(A)).join(`\r
|
|
12
|
-
`),N=Q("RSA-SHA256");N.update(R);const B=N.sign(i,"base64");return`${`${O}${B}`}\r
|
|
13
|
-
${a.join(`\r
|
|
14
|
-
`)}\r
|
|
15
|
-
\r
|
|
16
|
-
${o}`}catch(n){return console.error(`[${l}] DKIM signing error:`,n),e}},"signWithDkim");return{features:{attachments:!0,batchSending:r.pool,customHeaders:!0,html:!0,replyTo:!0,scheduling:!1,tagging:!1,templates:!1,tracking:!1},async initialize(){if(!y)try{if(!await this.isAvailable())throw new m(l,`SMTP server not available at ${r.host}:${r.port}`);y=!0}catch(e){throw new m(l,`Failed to initialize: ${e.message}`,{cause:e})}},async isAvailable(){try{if(!await ae(r.host,r.port))return!1;const e=await H();return await T(e),!0}catch{return!1}},name:l,options:r,async sendEmail(e){try{const c=re(e);if(c.length>0)return{error:new m(l,`Invalid email options: ${c.join(", ")}`),success:!1};y||await this.initialize();let s=await H();try{if(await h(s,`EHLO ${r.host}`,"250"),!r.secure)try{const t=await h(s,`EHLO ${r.host}`,"250"),d=U(t);Object.keys(d).includes("STARTTLS")&&(await h(s,"STARTTLS","220"),s=await D(s),await h(s,`EHLO ${r.host}`,"250"))}catch(t){if(r.rejectUnauthorized!==!1)throw new m(l,`STARTTLS failed or not supported: ${t.message}`,{cause:t})}await E(s),await h(s,`MAIL FROM:<${e.from.email}>`,"250");const i=[];Array.isArray(e.to)?i.push(...e.to.map(t=>t.email)):i.push(e.to.email),e.cc&&(Array.isArray(e.cc)?i.push(...e.cc.map(t=>t.email)):i.push(e.cc.email)),e.bcc&&(Array.isArray(e.bcc)?i.push(...e.bcc.map(t=>t.email)):i.push(e.bcc.email));for(const t of i)await h(s,`RCPT TO:<${t}>`,"250");await h(s,"DATA","354");let n=await ee(e);const o=[];if(e.dsn){const t=[];e.dsn.success&&t.push("SUCCESS"),e.dsn.failure&&t.push("FAILURE"),e.dsn.delay&&t.push("DELAY"),t.length>0&&o.push(`X-DSN-NOTIFY: ${t.join(",")}`)}if(e.priority){let t="";switch(e.priority){case"high":{t="1 (Highest)",o.push("Importance: High");break}case"low":{t="5 (Lowest)",o.push("Importance: Low");break}case"normal":{t="3 (Normal)",o.push("Importance: Normal");break}default:{t="3 (Normal)";break}}o.push(`X-Priority: ${t}`)}if(e.inReplyTo&&o.push(`In-Reply-To: ${b(e.inReplyTo)}`),e.references){const t=Array.isArray(e.references)?e.references.map(d=>b(d)).join(" "):b(e.references);o.push(`References: ${t}`)}if(e.listUnsubscribe){const t=Array.isArray(e.listUnsubscribe)?e.listUnsubscribe.map(d=>`<${b(d)}>`).join(", "):`<${b(e.listUnsubscribe)}>`;o.push(`List-Unsubscribe: ${t}`)}if(e.googleMailHeaders){const{googleMailHeaders:t}=e;t.feedbackId&&o.push(`Feedback-ID: ${b(t.feedbackId)}`),t.promotionalContent&&o.push("X-Google-Promotion: promotional"),t.category&&o.push(`X-Gmail-Labels: ${t.category}`)}if(o.length>0){const t=n.indexOf(`\r
|
|
17
|
-
\r
|
|
18
|
-
`);if(t!==-1){const d=n.slice(0,t),w=n.slice(t+4);n=`${d}\r
|
|
19
|
-
${o.join(`\r
|
|
20
|
-
`)}\r
|
|
21
|
-
\r
|
|
22
|
-
${w}`}}r.dkim&&(e.useDkim||e.useDkim===void 0)&&(n=G(n)),await h(s,`${n}\r
|
|
23
|
-
.`,"250");const a=te();return await T(s,r.pool),{data:{messageId:a,provider:l,response:"Message accepted",sent:!0,timestamp:new Date},success:!0}}catch(i){try{await T(s)}catch{}throw i}}catch(c){return{error:new m(l,`Failed to send email: ${c.message}`,{cause:c}),success:!1}}},async shutdown(){for(const e of f)try{await T(e)}catch{}f.length=0;for(const e of g)clearTimeout(e.timeout),e.reject(new Error("Provider shutdown"));g.length=0},async validateCredentials(){try{if(!await this.isAvailable())return!1;const e=await H();try{if(await h(e,`EHLO ${r.host}`,"250"),!r.secure)try{const c=await h(e,`EHLO ${r.host}`,"250"),s=U(c);if(Object.keys(s).includes("STARTTLS")){await h(e,"STARTTLS","220");const i=await D(e);Object.assign(e,i),await h(e,`EHLO ${r.host}`,"250")}}catch{if(r.rejectUnauthorized!==!1)return!1}return await E(e),await T(e),!0}catch{return await T(e),!1}}catch{return!1}}}});export{be as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var P=Object.defineProperty;var h=(i,a)=>P(i,"name",{value:a,configurable:!0});import{createRequire as A}from"node:module";import l from"./EmailError-zm2ffVav.js";import _ from"./RequiredOptionError-CevW3u2K.js";import{s as z}from"./generate-message-id-D4uA8gkj.js";import{i as E}from"./headers-to-record-Qo124ImV.js";import{m as y}from"./make-request-BDzF9W9D.js";import{c as q,P as k,u as b,h as w}from"./provider-base-Cmzx6BTO.js";import{d as K}from"./validate-email-options-DfJ7llf8.js";import{defineProvider as B}from"./defineProvider-B9rSklAJ.js";import{f,a as C}from"./address-formatter-Cm_E_ZMa.js";const j=A(import.meta.url),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,S=h(i=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[a,c]=u.versions.node.split(".").map(Number);if(a>22||a===22&&c>=3||a===20&&c>=16)return u.getBuiltinModule(i)}return j(i)},"__cjs_getBuiltinModule"),{Buffer:T}=S("node:buffer"),s="sweego",$="https://api.sweego.com",x=3e4,R=3,Q=B((i={})=>{if(!i.apiKey)throw new _(s,"apiKey");const a={apiKey:i.apiKey,debug:i.debug||!1,endpoint:i.endpoint||$,retries:i.retries||R,timeout:i.timeout||x,...i.logger&&{logger:i.logger}},c=new k,n=q(s,i.logger);return{features:{attachments:!0,batchSending:!0,customHeaders:!0,html:!0,replyTo:!0,scheduling:!1,tagging:!0,templates:!0,tracking:!0},async getEmail(e){try{if(!e)return{error:new l(s,"Email ID is required to retrieve email details"),success:!1};await c.ensureInitialized(()=>this.initialize(),s);const o={Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json"};n.debug("Retrieving email details",{id:e});const t=await b(async()=>y(`${a.endpoint}/emails/${e}`,{headers:o,method:"GET",timeout:a.timeout}),a.retries);return t.success?(n.debug("Email details retrieved successfully"),{data:t.data?.body,success:!0}):(n.debug("API request failed when retrieving email",t.error),{error:new l(s,`Failed to retrieve email: ${t.error instanceof Error?t.error.message:"Unknown error"}`,{cause:t.error}),success:!1})}catch(o){return{error:w(s,"retrieve email",o,n),success:!1}}},async initialize(){await c.ensureInitialized(async()=>{if(!await this.isAvailable())throw new l(s,"Sweego API not available or invalid API key");n.debug("Provider initialized successfully")},s)},async isAvailable(){try{return n.debug("Checking Sweego API availability"),!0}catch(e){return n.debug("Error checking availability:",e),!1}},name:s,options:a,async sendEmail(e){try{const o=K(e);if(o.length>0)return{error:new l(s,`Invalid email options: ${o.join(", ")}`),success:!1};await c.ensureInitialized(()=>this.initialize(),s);const t={from:{email:e.from.email,name:e.from.name},subject:e.subject,to:f(e.to)};if(e.html&&(t.html=e.html),e.text&&(t.text=e.text),e.cc&&(t.cc=f(e.cc)),e.bcc&&(t.bcc=f(e.bcc)),e.replyTo&&(t.replyTo=C(e.replyTo)),e.templateId&&(t.templateId=e.templateId,e.templateVariables&&(t.templateVariables=e.templateVariables)),e.tags&&e.tags.length>0&&(t.tags=e.tags),e.headers){const r=E(e.headers);t.headers=r}e.attachments&&e.attachments.length>0&&(t.attachments=await Promise.all(e.attachments.map(async r=>{let m;if(r.content)if(typeof r.content=="string")m=r.content;else if(r.content instanceof Promise){const I=await r.content;m=T.from(I).toString("base64")}else m=r.content.toString("base64");else if(r.raw)m=typeof r.raw=="string"?r.raw:r.raw.toString("base64");else throw new l(s,`Attachment ${r.filename} has no content`);return{content:m,contentType:r.contentType||"application/octet-stream",filename:r.filename,...r.cid&&{cid:r.cid}}}))),n.debug("Sending email via Sweego API",{subject:t.subject,to:t.to});const v={Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json"},d=await b(async()=>y(`${a.endpoint}/send`,{headers:v,method:"POST",timeout:a.timeout},JSON.stringify(t)),a.retries);if(!d.success)return n.debug("API request failed when sending email",d.error),{error:d.error||new l(s,"Failed to send email"),success:!1};const g=d.data?.body,p=g?.messageId||g?.id||z();return n.debug("Email sent successfully",{messageId:p}),{data:{messageId:p,provider:s,response:d.data,sent:!0,timestamp:new Date},success:!0}}catch(o){return{error:w(s,"send email",o,n),success:!1}}},async validateCredentials(){return this.isAvailable()}}});export{Q as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var d=Object.defineProperty;var l=(r,e)=>d(r,"name",{value:e,configurable:!0});import o from"../utils/validation/validate-email.js";var c=Object.defineProperty,t=l((r,e)=>c(r,"name",{value:e,configurable:!0}),"m");const f=t(r=>{const e=[];(!r.from||!r.from.email)&&e.push("Missing required field: from"),r.to||e.push("Missing required field: to"),r.subject||e.push("Missing required field: subject"),!r.text&&!r.html&&e.push("Either text or html content is required"),r.from&&r.from.email&&!o(r.from.email)&&e.push(`Invalid from email address: ${r.from.email}`);const s=t((i,m)=>{i&&(Array.isArray(i)?i:[i]).forEach(a=>{o(a.email)||e.push(`Invalid ${m} email address: ${a.email}`)})},"checkAddresses");return s(r.to,"to"),s(r.cc,"cc"),s(r.bcc,"bcc"),r.replyTo&&!o(r.replyTo.email)&&e.push(`Invalid replyTo email address: ${r.replyTo.email}`),e},"validateEmailOptions");export{f as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import l from"./EmailError-zm2ffVav.js";import y from"./RequiredOptionError-CevW3u2K.js";import{s as b}from"./generate-message-id-D4uA8gkj.js";import{i as k}from"./headers-to-record-Qo124ImV.js";import{m as v}from"./make-request-BDzF9W9D.js";import{c as w,P as A,u as _,h as z}from"./provider-base-Cmzx6BTO.js";import{s as j,a as P}from"./sanitize-header-wWav-Scu.js";import{d as I}from"./validate-email-options-DfJ7llf8.js";import{defineProvider as T}from"./defineProvider-B9rSklAJ.js";import{m as f}from"./address-formatter-Cm_E_ZMa.js";const i="zeptomail",$="https://api.zeptomail.com/v1.1",O=3e4,Z=3,F=T((s={})=>{if(!s.token)throw new y(i,"token");if(!s.token.startsWith("Zoho-enczapikey "))throw new l(i,'Token should be in the format "Zoho-enczapikey <your_api_key>"');const n={debug:s.debug||!1,endpoint:s.endpoint||$,logger:s.logger,retries:s.retries||Z,timeout:s.timeout||O,token:s.token},u=new A,o=w(i,s.logger);return{features:{attachments:!0,batchSending:!1,customHeaders:!0,html:!0,replyTo:!0,scheduling:!1,tagging:!1,templates:!1,tracking:!0},async initialize(){await u.ensureInitialized(async()=>{if(!await this.isAvailable())throw new l(i,"Zeptomail API not available or invalid token");o.debug("Provider initialized successfully")},i)},async isAvailable(){try{return n.token&&n.token.startsWith("Zoho-enczapikey ")?(o.debug("Token format is valid, assuming Zeptomail is available"),!0):!1}catch(e){return o.debug("Error checking availability:",e),!1}},name:i,options:n,async sendEmail(e){try{const m=I(e);if(m.length>0)return{error:new l(i,`Invalid email options: ${m.join(", ")}`),success:!1};await u.ensureInitialized(()=>this.initialize(),i);const a={from:f(e.from).address,subject:e.subject};if(Array.isArray(e.to)?a.to=e.to.length===1?e.to[0].email:e.to.map(t=>t.email):a.to=e.to.email,e.text&&(a.textbody=e.text),e.html&&(a.htmlbody=e.html),e.cc&&(Array.isArray(e.cc)?a.cc=e.cc.length===1?e.cc[0].email:e.cc.map(t=>t.email):a.cc=e.cc.email),e.bcc&&(Array.isArray(e.bcc)?a.bcc=e.bcc.length===1?e.bcc[0].email:e.bcc.map(t=>t.email):a.bcc=e.bcc.email),e.replyTo&&(a.reply_to=[f(e.replyTo).address]),e.trackClicks!==void 0&&(a.track_clicks=e.trackClicks),e.trackOpens!==void 0&&(a.track_opens=e.trackOpens),e.clientReference&&(a.client_reference=e.clientReference),e.mimeHeaders&&Object.keys(e.mimeHeaders).length>0){const t={};for(const[r,d]of Object.entries(e.mimeHeaders))t[r]=d;a.mime_headers=t}if(e.headers){const t=k(e.headers);Object.keys(t).length>0&&(a.mime_headers||(a.mime_headers={}),Object.entries(t).forEach(([r,d])=>{a.mime_headers&&(a.mime_headers[P(r)]=j(d))}))}e.attachments&&e.attachments.length>0&&(a.attachments=e.attachments.map(t=>{const r={name:t.filename};return t.content?(r.content=typeof t.content=="string"?t.content:t.content.toString("base64"),t.contentType&&(r.mime_type=t.contentType)):t.path&&(r.file_cache_key=t.path),r})),o.debug("Sending email via Zeptomail API",{subject:a.subject,to:a.to});const g={Accept:"application/json",Authorization:n.token,"Content-Type":"application/json"},c=await _(async()=>v(`${n.endpoint}/email`,{headers:g,method:"POST",timeout:n.timeout},JSON.stringify(a)),n.retries);if(!c.success){o.debug("API request failed",c.error);let t=c.error instanceof Error?c.error.message:"Unknown error";const r=c.data;return r?.body?.message?t+=` Details: ${r.body.message}`:r?.body?.error?.message&&(t+=` Details: ${r.body.error.message}`),{error:new l(i,`Failed to send email: ${t}`,{cause:c.error}),success:!1}}const p=c.data?.body,h=p?.request_id||b();return o.debug("Email sent successfully",{messageId:h}),{data:{messageId:h,provider:i,response:p,sent:!0,timestamp:new Date},success:!0}}catch(m){return{error:z(i,"send email",m,o),success:!1}}},async validateCredentials(){return this.isAvailable()}}});export{F as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ProviderFactory } from "../provider.d.ts";
|
|
2
|
-
import type { AhaSendConfig, AhaSendEmailOptions } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* AhaSend Provider for sending emails through AhaSend API
|
|
5
|
-
*/
|
|
6
|
-
declare const ahaSendProvider: ProviderFactory<AhaSendConfig, unknown, AhaSendEmailOptions>;
|
|
7
|
-
export default ahaSendProvider;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { BaseConfig, EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* AhaSend configuration
|
|
4
|
-
*/
|
|
5
|
-
export interface AhaSendConfig extends BaseConfig {
|
|
6
|
-
/**
|
|
7
|
-
* AhaSend API key
|
|
8
|
-
*/
|
|
9
|
-
apiKey: string;
|
|
10
|
-
/**
|
|
11
|
-
* AhaSend API endpoint
|
|
12
|
-
* Defaults to: https://api.ahasend.com
|
|
13
|
-
*/
|
|
14
|
-
endpoint?: string;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* AhaSend-specific email options
|
|
18
|
-
*/
|
|
19
|
-
export interface AhaSendEmailOptions extends EmailOptions {
|
|
20
|
-
/**
|
|
21
|
-
* AhaSend template ID for template-based emails
|
|
22
|
-
*/
|
|
23
|
-
templateId?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Template variables for AhaSend templates
|
|
26
|
-
*/
|
|
27
|
-
templateVariables?: Record<string, unknown>;
|
|
28
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ProviderFactory } from "../provider.d.ts";
|
|
2
|
-
import type { AwsSesConfig, AwsSesEmailOptions } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* AWS SES Email Provider Implementation - Zero dependency version
|
|
5
|
-
* Uses native Node.js APIs instead of AWS SDK
|
|
6
|
-
*/
|
|
7
|
-
declare const awsSesProvider: ProviderFactory<AwsSesConfig, unknown, AwsSesEmailOptions>;
|
|
8
|
-
export default awsSesProvider;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { BaseConfig, EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* AWS SES configuration
|
|
4
|
-
*/
|
|
5
|
-
export interface AwsSesConfig extends BaseConfig {
|
|
6
|
-
accessKeyId: string;
|
|
7
|
-
apiVersion?: string;
|
|
8
|
-
endpoint?: string;
|
|
9
|
-
maxAttempts?: number;
|
|
10
|
-
region: string;
|
|
11
|
-
secretAccessKey: string;
|
|
12
|
-
sessionToken?: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* AWS SES-specific email options
|
|
16
|
-
*/
|
|
17
|
-
export interface AwsSesEmailOptions extends EmailOptions {
|
|
18
|
-
/**
|
|
19
|
-
* Configuration set name
|
|
20
|
-
*/
|
|
21
|
-
configurationSetName?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Message tags as key-value pairs
|
|
24
|
-
*/
|
|
25
|
-
messageTags?: Record<string, string>;
|
|
26
|
-
/**
|
|
27
|
-
* Return path email address
|
|
28
|
-
*/
|
|
29
|
-
returnPath?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Return path ARN
|
|
32
|
-
*/
|
|
33
|
-
returnPathArn?: string;
|
|
34
|
-
/**
|
|
35
|
-
* Source ARN for sending authorization
|
|
36
|
-
*/
|
|
37
|
-
sourceArn?: string;
|
|
38
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ProviderFactory } from "../provider.d.ts";
|
|
2
|
-
import type { AzureConfig, AzureEmailOptions } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Azure Communication Services Provider for sending emails through Azure API
|
|
5
|
-
*/
|
|
6
|
-
declare const azureProvider: ProviderFactory<AzureConfig, unknown, AzureEmailOptions>;
|
|
7
|
-
export default azureProvider;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { BaseConfig, EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Azure Communication Services configuration
|
|
4
|
-
*/
|
|
5
|
-
export interface AzureConfig extends BaseConfig {
|
|
6
|
-
/**
|
|
7
|
-
* Azure AD access token (for OAuth2 authentication)
|
|
8
|
-
*/
|
|
9
|
-
accessToken?: string;
|
|
10
|
-
/**
|
|
11
|
-
* Azure Communication Services connection string or access token
|
|
12
|
-
*/
|
|
13
|
-
connectionString?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Azure Communication Services endpoint
|
|
16
|
-
* Defaults to: https://{region}.communication.azure.com
|
|
17
|
-
*/
|
|
18
|
-
endpoint?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Azure region (e.g., "eastus", "westus")
|
|
21
|
-
*/
|
|
22
|
-
region: string;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Azure-specific email options
|
|
26
|
-
*/
|
|
27
|
-
export interface AzureEmailOptions extends EmailOptions {
|
|
28
|
-
/**
|
|
29
|
-
* Custom headers
|
|
30
|
-
*/
|
|
31
|
-
headers?: Record<string, string>;
|
|
32
|
-
/**
|
|
33
|
-
* Importance level (normal, high)
|
|
34
|
-
*/
|
|
35
|
-
importance?: "normal" | "high";
|
|
36
|
-
/**
|
|
37
|
-
* Azure template ID for template-based emails
|
|
38
|
-
*/
|
|
39
|
-
templateId?: string;
|
|
40
|
-
/**
|
|
41
|
-
* Template variables for Azure templates
|
|
42
|
-
*/
|
|
43
|
-
templateVariables?: Record<string, unknown>;
|
|
44
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ProviderFactory } from "../provider.d.ts";
|
|
2
|
-
import type { BrevoConfig, BrevoEmailOptions } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Brevo Provider for sending emails through Brevo API
|
|
5
|
-
*/
|
|
6
|
-
declare const brevoProvider: ProviderFactory<BrevoConfig, unknown, BrevoEmailOptions>;
|
|
7
|
-
export default brevoProvider;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { BaseConfig, EmailAddress, EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Brevo configuration
|
|
4
|
-
*/
|
|
5
|
-
export interface BrevoConfig extends BaseConfig {
|
|
6
|
-
/**
|
|
7
|
-
* Brevo API key
|
|
8
|
-
*/
|
|
9
|
-
apiKey: string;
|
|
10
|
-
/**
|
|
11
|
-
* Brevo API endpoint
|
|
12
|
-
* Defaults to: https://api.brevo.com/v3
|
|
13
|
-
*/
|
|
14
|
-
endpoint?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Enable hard validation for replyTo addresses.
|
|
17
|
-
* If true, arrays will be rejected. If false, the first address from an array will be used.
|
|
18
|
-
* Defaults to: false
|
|
19
|
-
*/
|
|
20
|
-
hardValidation?: boolean;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Brevo-specific email options
|
|
24
|
-
*/
|
|
25
|
-
export interface BrevoEmailOptions extends Omit<EmailOptions, "replyTo"> {
|
|
26
|
-
/**
|
|
27
|
-
* Batch ID for batch sending
|
|
28
|
-
*/
|
|
29
|
-
batchId?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Headers (custom headers)
|
|
32
|
-
*/
|
|
33
|
-
headers?: Record<string, string>;
|
|
34
|
-
/**
|
|
35
|
-
* Reply-to email address (can override base replyTo).
|
|
36
|
-
* Only one address is allowed. If an array is provided and hardValidation is false, the first address will be used.
|
|
37
|
-
*/
|
|
38
|
-
replyTo?: EmailAddress | EmailAddress[];
|
|
39
|
-
/**
|
|
40
|
-
* Scheduled date/time
|
|
41
|
-
* - If string: ISO 8601 format (e.g., "2025-01-15T10:00:00Z")
|
|
42
|
-
* - If number: Unix timestamp in seconds (not milliseconds)
|
|
43
|
-
*/
|
|
44
|
-
scheduledAt?: string | number;
|
|
45
|
-
/**
|
|
46
|
-
* Tags for categorization
|
|
47
|
-
*/
|
|
48
|
-
tags?: string[];
|
|
49
|
-
/**
|
|
50
|
-
* Brevo template ID for template-based emails
|
|
51
|
-
*/
|
|
52
|
-
templateId?: number;
|
|
53
|
-
/**
|
|
54
|
-
* Template parameters for Brevo templates
|
|
55
|
-
*/
|
|
56
|
-
templateParams?: Record<string, unknown>;
|
|
57
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ProviderFactory } from "../provider.d.ts";
|
|
2
|
-
import type { FailoverConfig, FailoverEmailOptions } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Failover Provider for sending emails with automatic failover to backup providers.
|
|
5
|
-
*/
|
|
6
|
-
declare const provider: ProviderFactory<FailoverConfig, unknown, FailoverEmailOptions>;
|
|
7
|
-
export default provider;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { BaseConfig, EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Failover configuration
|
|
4
|
-
*/
|
|
5
|
-
export interface FailoverConfig extends BaseConfig {
|
|
6
|
-
/**
|
|
7
|
-
* Array of provider instances or provider factories to use in failover order
|
|
8
|
-
* Can be Provider instances or ProviderFactory functions
|
|
9
|
-
*/
|
|
10
|
-
mailers: unknown[];
|
|
11
|
-
/**
|
|
12
|
-
* Time in milliseconds to wait before trying the next provider (default: 60)
|
|
13
|
-
*/
|
|
14
|
-
retryAfter?: number;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Failover-specific email options
|
|
18
|
-
*/
|
|
19
|
-
export type FailoverEmailOptions = EmailOptions;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ProviderFactory } from "../provider.d.ts";
|
|
2
|
-
import type { HttpEmailConfig, HttpEmailOptions } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* HTTP Email Provider for sending emails via HTTP API.
|
|
5
|
-
*/
|
|
6
|
-
declare const httpProvider: ProviderFactory<HttpEmailConfig, unknown, HttpEmailOptions>;
|
|
7
|
-
export default httpProvider;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* HTTP email configuration
|
|
4
|
-
*/
|
|
5
|
-
export interface HttpEmailConfig {
|
|
6
|
-
apiKey?: string;
|
|
7
|
-
endpoint: string;
|
|
8
|
-
headers?: Record<string, string>;
|
|
9
|
-
method?: "GET" | "POST" | "PUT";
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* HTTP-specific email options
|
|
13
|
-
*/
|
|
14
|
-
export interface HttpEmailOptions extends EmailOptions {
|
|
15
|
-
/**
|
|
16
|
-
* Custom parameters to include in the request payload
|
|
17
|
-
*/
|
|
18
|
-
customParams?: Record<string, unknown>;
|
|
19
|
-
/**
|
|
20
|
-
* Override the endpoint for this specific email
|
|
21
|
-
*/
|
|
22
|
-
endpointOverride?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Override the HTTP method for this specific email
|
|
25
|
-
*/
|
|
26
|
-
methodOverride?: "GET" | "POST" | "PUT";
|
|
27
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ProviderFactory } from "../provider.d.ts";
|
|
2
|
-
import type { InfobipConfig, InfobipEmailOptions } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Infobip Provider for sending emails through Infobip API
|
|
5
|
-
*/
|
|
6
|
-
declare const infobipProvider: ProviderFactory<InfobipConfig, unknown, InfobipEmailOptions>;
|
|
7
|
-
export default infobipProvider;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { BaseConfig, EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Infobip configuration
|
|
4
|
-
*/
|
|
5
|
-
export interface InfobipConfig extends BaseConfig {
|
|
6
|
-
/**
|
|
7
|
-
* Infobip API key
|
|
8
|
-
*/
|
|
9
|
-
apiKey: string;
|
|
10
|
-
/**
|
|
11
|
-
* Infobip base URL (e.g., "https://api.infobip.com")
|
|
12
|
-
*/
|
|
13
|
-
baseUrl?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Infobip API endpoint
|
|
16
|
-
* Defaults to: https://{baseUrl}/email/3/send
|
|
17
|
-
*/
|
|
18
|
-
endpoint?: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Infobip-specific email options
|
|
22
|
-
*/
|
|
23
|
-
export interface InfobipEmailOptions extends EmailOptions {
|
|
24
|
-
/**
|
|
25
|
-
* Intermediate report (for delivery status updates)
|
|
26
|
-
*/
|
|
27
|
-
intermediateReport?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Notify URL (for delivery notifications)
|
|
30
|
-
*/
|
|
31
|
-
notifyUrl?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Send at (Unix timestamp in milliseconds)
|
|
34
|
-
*/
|
|
35
|
-
sendAt?: number;
|
|
36
|
-
/**
|
|
37
|
-
* Infobip template ID for template-based emails
|
|
38
|
-
*/
|
|
39
|
-
templateId?: number;
|
|
40
|
-
/**
|
|
41
|
-
* Template variables for Infobip templates
|
|
42
|
-
*/
|
|
43
|
-
templateVariables?: Record<string, unknown>;
|
|
44
|
-
/**
|
|
45
|
-
* Tracking URL (for click tracking)
|
|
46
|
-
*/
|
|
47
|
-
trackingUrl?: string;
|
|
48
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ProviderFactory } from "../provider.d.ts";
|
|
2
|
-
import type { MailCrabConfig, MailCrabEmailOptions } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* MailCrab Provider for local email testing
|
|
5
|
-
* MailCrab is a local SMTP server for testing emails during development
|
|
6
|
-
* This is a convenience wrapper around the SMTP provider with MailCrab defaults
|
|
7
|
-
*/
|
|
8
|
-
declare const mailCrabProvider: ProviderFactory<MailCrabConfig, unknown, MailCrabEmailOptions>;
|
|
9
|
-
export default mailCrabProvider;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { BaseConfig, EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* MailCrab configuration (for local development/testing)
|
|
4
|
-
*/
|
|
5
|
-
export interface MailCrabConfig extends BaseConfig {
|
|
6
|
-
/**
|
|
7
|
-
* MailCrab host (default: localhost)
|
|
8
|
-
*/
|
|
9
|
-
host?: string;
|
|
10
|
-
/**
|
|
11
|
-
* MailCrab port (default: 1025)
|
|
12
|
-
*/
|
|
13
|
-
port?: number;
|
|
14
|
-
/**
|
|
15
|
-
* Use secure connection (default: false)
|
|
16
|
-
*/
|
|
17
|
-
secure?: boolean;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* MailCrab-specific email options
|
|
21
|
-
*/
|
|
22
|
-
export type MailCrabEmailOptions = EmailOptions;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ProviderFactory } from "../provider.d.ts";
|
|
2
|
-
import type { MailerSendConfig, MailerSendEmailOptions } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* MailerSend Provider for sending emails through MailerSend API
|
|
5
|
-
*/
|
|
6
|
-
declare const mailerSendProvider: ProviderFactory<MailerSendConfig, unknown, MailerSendEmailOptions>;
|
|
7
|
-
export default mailerSendProvider;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { BaseConfig, EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* MailerSend configuration
|
|
4
|
-
*/
|
|
5
|
-
export interface MailerSendConfig extends BaseConfig {
|
|
6
|
-
/**
|
|
7
|
-
* MailerSend API token
|
|
8
|
-
*/
|
|
9
|
-
apiToken: string;
|
|
10
|
-
/**
|
|
11
|
-
* MailerSend API endpoint
|
|
12
|
-
* Defaults to: https://api.mailersend.com
|
|
13
|
-
*/
|
|
14
|
-
endpoint?: string;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* MailerSend-specific email options
|
|
18
|
-
*/
|
|
19
|
-
export interface MailerSendEmailOptions extends EmailOptions {
|
|
20
|
-
/**
|
|
21
|
-
* Domain ID (optional, for domain-specific sending)
|
|
22
|
-
*/
|
|
23
|
-
domainId?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Personalization (per-recipient variables)
|
|
26
|
-
*/
|
|
27
|
-
personalization?: {
|
|
28
|
-
data: Record<string, unknown>;
|
|
29
|
-
email: string;
|
|
30
|
-
}[];
|
|
31
|
-
/**
|
|
32
|
-
* Scheduled at (Unix timestamp)
|
|
33
|
-
*/
|
|
34
|
-
scheduledAt?: number;
|
|
35
|
-
/**
|
|
36
|
-
* MailerSend template ID for template-based emails
|
|
37
|
-
*/
|
|
38
|
-
templateId?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Template variables for MailerSend templates
|
|
41
|
-
*/
|
|
42
|
-
templateVariables?: Record<string, unknown>;
|
|
43
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ProviderFactory } from "../provider.d.ts";
|
|
2
|
-
import type { MailgunConfig, MailgunEmailOptions } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Mailgun Provider for sending emails through Mailgun API
|
|
5
|
-
*/
|
|
6
|
-
declare const mailgunProvider: ProviderFactory<MailgunConfig, unknown, MailgunEmailOptions>;
|
|
7
|
-
export default mailgunProvider;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { BaseConfig, EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Mailgun configuration
|
|
4
|
-
*/
|
|
5
|
-
export interface MailgunConfig extends BaseConfig {
|
|
6
|
-
/**
|
|
7
|
-
* Mailgun API key
|
|
8
|
-
*/
|
|
9
|
-
apiKey: string;
|
|
10
|
-
/**
|
|
11
|
-
* Mailgun domain (required for sending emails)
|
|
12
|
-
*/
|
|
13
|
-
domain: string;
|
|
14
|
-
/**
|
|
15
|
-
* Mailgun API endpoint
|
|
16
|
-
* Defaults to US endpoint: https://api.mailgun.net
|
|
17
|
-
* Use https://api.eu.mailgun.net for EU accounts
|
|
18
|
-
*/
|
|
19
|
-
endpoint?: string;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Mailgun-specific email options
|
|
23
|
-
*/
|
|
24
|
-
export interface MailgunEmailOptions extends EmailOptions {
|
|
25
|
-
/**
|
|
26
|
-
* Campaign ID for tracking
|
|
27
|
-
*/
|
|
28
|
-
campaignId?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Enable/disable click tracking
|
|
31
|
-
*/
|
|
32
|
-
clickTracking?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Delivery time (Unix timestamp or RFC 2822 date)
|
|
35
|
-
*/
|
|
36
|
-
deliveryTime?: string | number;
|
|
37
|
-
/**
|
|
38
|
-
* Enable/disable open tracking
|
|
39
|
-
*/
|
|
40
|
-
openTracking?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Require TLS
|
|
43
|
-
*/
|
|
44
|
-
requireTls?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Skip verification
|
|
47
|
-
*/
|
|
48
|
-
skipVerification?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Mailgun template name
|
|
51
|
-
*/
|
|
52
|
-
template?: string;
|
|
53
|
-
/**
|
|
54
|
-
* Template variables for Mailgun templates
|
|
55
|
-
*/
|
|
56
|
-
templateVariables?: Record<string, unknown>;
|
|
57
|
-
/**
|
|
58
|
-
* Test mode - emails won't actually be sent
|
|
59
|
-
*/
|
|
60
|
-
testMode?: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Enable/disable unsubscribe tracking
|
|
63
|
-
*/
|
|
64
|
-
unsubscribeTracking?: boolean;
|
|
65
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ProviderFactory } from "../provider.d.ts";
|
|
2
|
-
import type { MailjetConfig, MailjetEmailOptions } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Mailjet Provider for sending emails through Mailjet API.
|
|
5
|
-
*/
|
|
6
|
-
declare const provider: ProviderFactory<MailjetConfig, unknown, MailjetEmailOptions>;
|
|
7
|
-
export default provider;
|