@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,19 +0,0 @@
|
|
|
1
|
-
import type { BaseConfig, EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Round Robin configuration
|
|
4
|
-
*/
|
|
5
|
-
export interface RoundRobinConfig extends BaseConfig {
|
|
6
|
-
/**
|
|
7
|
-
* Array of provider instances or provider factories to use for round-robin distribution
|
|
8
|
-
* Can be Provider instances or ProviderFactory functions
|
|
9
|
-
*/
|
|
10
|
-
mailers: unknown[];
|
|
11
|
-
/**
|
|
12
|
-
* Time in milliseconds to wait before retrying with next provider if current is unavailable (default: 60)
|
|
13
|
-
*/
|
|
14
|
-
retryAfter?: number;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Round Robin-specific email options
|
|
18
|
-
*/
|
|
19
|
-
export type RoundRobinEmailOptions = EmailOptions;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ProviderFactory } from "../provider.d.ts";
|
|
2
|
-
import type { ScalewayConfig, ScalewayEmailOptions } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Scaleway Provider for sending emails through Scaleway API
|
|
5
|
-
*/
|
|
6
|
-
declare const scalewayProvider: ProviderFactory<ScalewayConfig, unknown, ScalewayEmailOptions>;
|
|
7
|
-
export default scalewayProvider;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { BaseConfig, EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Scaleway configuration
|
|
4
|
-
*/
|
|
5
|
-
export interface ScalewayConfig extends BaseConfig {
|
|
6
|
-
/**
|
|
7
|
-
* Scaleway API key
|
|
8
|
-
*/
|
|
9
|
-
apiKey: string;
|
|
10
|
-
/**
|
|
11
|
-
* Scaleway API endpoint
|
|
12
|
-
* Defaults to: https://api.scaleway.com/transactional-email/v1alpha1
|
|
13
|
-
*/
|
|
14
|
-
endpoint?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Scaleway region (e.g., "fr-par", "nl-ams")
|
|
17
|
-
*/
|
|
18
|
-
region: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Scaleway-specific email options
|
|
22
|
-
*/
|
|
23
|
-
export interface ScalewayEmailOptions extends EmailOptions {
|
|
24
|
-
/**
|
|
25
|
-
* Project ID (optional)
|
|
26
|
-
*/
|
|
27
|
-
projectId?: string;
|
|
28
|
-
/**
|
|
29
|
-
* Scaleway template ID for template-based emails
|
|
30
|
-
*/
|
|
31
|
-
templateId?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Template variables for Scaleway templates
|
|
34
|
-
*/
|
|
35
|
-
templateVariables?: Record<string, unknown>;
|
|
36
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ProviderFactory } from "../provider.d.ts";
|
|
2
|
-
import type { SendGridConfig, SendGridEmailOptions } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* SendGrid Provider for sending emails through SendGrid API
|
|
5
|
-
*/
|
|
6
|
-
declare const sendGridProvider: ProviderFactory<SendGridConfig, unknown, SendGridEmailOptions>;
|
|
7
|
-
export default sendGridProvider;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import type { BaseConfig, EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* SendGrid configuration
|
|
4
|
-
*/
|
|
5
|
-
export interface SendGridConfig extends BaseConfig {
|
|
6
|
-
apiKey: string;
|
|
7
|
-
endpoint?: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* SendGrid-specific email options
|
|
11
|
-
*/
|
|
12
|
-
export interface SendGridEmailOptions extends EmailOptions {
|
|
13
|
-
/**
|
|
14
|
-
* ASM (Advanced Suppression Management) group ID for unsubscribe
|
|
15
|
-
*/
|
|
16
|
-
asmGroupId?: number;
|
|
17
|
-
/**
|
|
18
|
-
* Batch ID for batch sending
|
|
19
|
-
*/
|
|
20
|
-
batchId?: string;
|
|
21
|
-
/**
|
|
22
|
-
* IP pool name
|
|
23
|
-
*/
|
|
24
|
-
ipPoolName?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Mail settings (click tracking, open tracking, etc.)
|
|
27
|
-
*/
|
|
28
|
-
mailSettings?: {
|
|
29
|
-
bypassListManagement?: boolean;
|
|
30
|
-
footer?: {
|
|
31
|
-
enable?: boolean;
|
|
32
|
-
html?: string;
|
|
33
|
-
text?: string;
|
|
34
|
-
};
|
|
35
|
-
sandboxMode?: boolean;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Send at timestamp (Unix timestamp)
|
|
39
|
-
*/
|
|
40
|
-
sendAt?: number;
|
|
41
|
-
/**
|
|
42
|
-
* Dynamic template data for SendGrid dynamic templates
|
|
43
|
-
*/
|
|
44
|
-
templateData?: Record<string, unknown>;
|
|
45
|
-
/**
|
|
46
|
-
* SendGrid template ID for template-based emails
|
|
47
|
-
*/
|
|
48
|
-
templateId?: string;
|
|
49
|
-
/**
|
|
50
|
-
* Tracking settings
|
|
51
|
-
*/
|
|
52
|
-
trackingSettings?: {
|
|
53
|
-
clickTracking?: {
|
|
54
|
-
enable?: boolean;
|
|
55
|
-
enableText?: boolean;
|
|
56
|
-
};
|
|
57
|
-
ganalytics?: {
|
|
58
|
-
enable?: boolean;
|
|
59
|
-
utmCampaign?: string;
|
|
60
|
-
utmContent?: string;
|
|
61
|
-
utmMedium?: string;
|
|
62
|
-
utmSource?: string;
|
|
63
|
-
utmTerm?: string;
|
|
64
|
-
};
|
|
65
|
-
openTracking?: {
|
|
66
|
-
enable?: boolean;
|
|
67
|
-
substitutionTag?: string;
|
|
68
|
-
};
|
|
69
|
-
subscriptionTracking?: {
|
|
70
|
-
enable?: boolean;
|
|
71
|
-
html?: string;
|
|
72
|
-
substitutionTag?: string;
|
|
73
|
-
text?: string;
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ProviderFactory } from "../provider.d.ts";
|
|
2
|
-
import type { SmtpConfig, SmtpEmailOptions } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* SMTP provider for sending emails via SMTP protocol
|
|
5
|
-
*/
|
|
6
|
-
declare const smtpProvider: ProviderFactory<SmtpConfig, unknown, SmtpEmailOptions>;
|
|
7
|
-
export default smtpProvider;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type { BaseConfig, EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* SMTP configuration
|
|
4
|
-
*/
|
|
5
|
-
export interface SmtpConfig extends BaseConfig {
|
|
6
|
-
authMethod?: "LOGIN" | "PLAIN" | "CRAM-MD5" | "OAUTH2";
|
|
7
|
-
dkim?: {
|
|
8
|
-
domainName: string;
|
|
9
|
-
keySelector: string;
|
|
10
|
-
privateKey: string;
|
|
11
|
-
};
|
|
12
|
-
host: string;
|
|
13
|
-
maxConnections?: number;
|
|
14
|
-
oauth2?: {
|
|
15
|
-
accessToken?: string;
|
|
16
|
-
clientId: string;
|
|
17
|
-
clientSecret: string;
|
|
18
|
-
expires?: number;
|
|
19
|
-
refreshToken: string;
|
|
20
|
-
user: string;
|
|
21
|
-
};
|
|
22
|
-
password?: string;
|
|
23
|
-
pool?: boolean;
|
|
24
|
-
port: number;
|
|
25
|
-
rejectUnauthorized?: boolean;
|
|
26
|
-
secure?: boolean;
|
|
27
|
-
user?: string;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* SMTP-specific email options
|
|
31
|
-
*/
|
|
32
|
-
export interface SmtpEmailOptions extends EmailOptions {
|
|
33
|
-
/**
|
|
34
|
-
* Delivery Status Notification options
|
|
35
|
-
*/
|
|
36
|
-
dsn?: {
|
|
37
|
-
/** Request notification on delay */
|
|
38
|
-
delay?: boolean;
|
|
39
|
-
/** Request notification on failure */
|
|
40
|
-
failure?: boolean;
|
|
41
|
-
/** Request successful delivery notification */
|
|
42
|
-
success?: boolean;
|
|
43
|
-
};
|
|
44
|
-
/** Special Google Mail headers */
|
|
45
|
-
googleMailHeaders?: {
|
|
46
|
-
/** Category for email organization */
|
|
47
|
-
category?: "primary" | "social" | "promotions" | "updates" | "forums";
|
|
48
|
-
/** Feedback ID for engagement tracking */
|
|
49
|
-
feedbackId?: string;
|
|
50
|
-
/** Mark as promotional content */
|
|
51
|
-
promotionalContent?: boolean;
|
|
52
|
-
};
|
|
53
|
-
/** Reference to a previous message ID (for threading) */
|
|
54
|
-
inReplyTo?: string;
|
|
55
|
-
/** List-Unsubscribe header for easy unsubscribe functionality */
|
|
56
|
-
listUnsubscribe?: string | string[];
|
|
57
|
-
/** Message priority: 'high', 'normal', or 'low' */
|
|
58
|
-
priority?: "high" | "normal" | "low";
|
|
59
|
-
/** References to related message IDs */
|
|
60
|
-
references?: string | string[];
|
|
61
|
-
/** Whether to sign the email with DKIM */
|
|
62
|
-
useDkim?: boolean;
|
|
63
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ProviderFactory } from "../provider.d.ts";
|
|
2
|
-
import type { SweegoConfig, SweegoEmailOptions } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Sweego Provider for sending emails through Sweego API
|
|
5
|
-
*/
|
|
6
|
-
declare const sweegoProvider: ProviderFactory<SweegoConfig, unknown, SweegoEmailOptions>;
|
|
7
|
-
export default sweegoProvider;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { BaseConfig, EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Sweego configuration
|
|
4
|
-
*/
|
|
5
|
-
export interface SweegoConfig extends BaseConfig {
|
|
6
|
-
/**
|
|
7
|
-
* Sweego API key
|
|
8
|
-
*/
|
|
9
|
-
apiKey: string;
|
|
10
|
-
/**
|
|
11
|
-
* Sweego API endpoint
|
|
12
|
-
* Defaults to: https://api.sweego.com
|
|
13
|
-
*/
|
|
14
|
-
endpoint?: string;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Sweego-specific email options
|
|
18
|
-
*/
|
|
19
|
-
export interface SweegoEmailOptions extends EmailOptions {
|
|
20
|
-
/**
|
|
21
|
-
* Tags for categorization
|
|
22
|
-
*/
|
|
23
|
-
tags?: string[];
|
|
24
|
-
/**
|
|
25
|
-
* Sweego template ID for template-based emails
|
|
26
|
-
*/
|
|
27
|
-
templateId?: string;
|
|
28
|
-
/**
|
|
29
|
-
* Template variables for Sweego templates
|
|
30
|
-
*/
|
|
31
|
-
templateVariables?: Record<string, unknown>;
|
|
32
|
-
}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import type { EmailAddress } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Formats a single email address as "Name <email>" or just "email" if no name is provided.
|
|
4
|
-
* @param address The email address object to format.
|
|
5
|
-
* @returns The formatted email address string.
|
|
6
|
-
*/
|
|
7
|
-
export declare const formatAddress: (address: EmailAddress) => string;
|
|
8
|
-
/**
|
|
9
|
-
* Formats an array of email addresses or a single address as "Name <email>" format.
|
|
10
|
-
* @param addresses The email address(es) to format (single or array).
|
|
11
|
-
* @returns An array of formatted email address strings.
|
|
12
|
-
*/
|
|
13
|
-
export declare const formatAddresses: (addresses: EmailAddress | EmailAddress[]) => string[];
|
|
14
|
-
/**
|
|
15
|
-
* Formats a single email address for SendGrid API format.
|
|
16
|
-
* @param address The email address object to format.
|
|
17
|
-
* @returns An object with email and optional name properties.
|
|
18
|
-
*/
|
|
19
|
-
export declare const formatSendGridAddress: (address: EmailAddress) => {
|
|
20
|
-
email: string;
|
|
21
|
-
name?: string;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Formats email addresses for SendGrid API format.
|
|
25
|
-
* @param addresses The email address(es) to format (single or array).
|
|
26
|
-
* @returns An array of objects with email and optional name properties.
|
|
27
|
-
*/
|
|
28
|
-
export declare const formatSendGridAddresses: (addresses: EmailAddress | EmailAddress[]) => {
|
|
29
|
-
email: string;
|
|
30
|
-
name?: string;
|
|
31
|
-
}[];
|
|
32
|
-
/**
|
|
33
|
-
* Formats email addresses as a simple string array containing only email addresses.
|
|
34
|
-
* @param addresses The email address(es) to format (single or array).
|
|
35
|
-
* @returns An array of email address strings.
|
|
36
|
-
*/
|
|
37
|
-
export declare const formatAddressEmails: (addresses: EmailAddress | EmailAddress[]) => string[];
|
|
38
|
-
/**
|
|
39
|
-
* Formats an email address for Azure API format.
|
|
40
|
-
* @param address The email address object to format.
|
|
41
|
-
* @returns An object with email and optional displayName properties.
|
|
42
|
-
*/
|
|
43
|
-
export declare const formatAzureAddress: (address: EmailAddress) => {
|
|
44
|
-
displayName?: string;
|
|
45
|
-
email: string;
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Formats email addresses for Azure API format.
|
|
49
|
-
* @param addresses The email address(es) to format (single or array).
|
|
50
|
-
* @returns An array of objects with email and optional displayName properties.
|
|
51
|
-
*/
|
|
52
|
-
export declare const formatAzureAddresses: (addresses: EmailAddress | EmailAddress[]) => {
|
|
53
|
-
displayName?: string;
|
|
54
|
-
email: string;
|
|
55
|
-
}[];
|
|
56
|
-
/**
|
|
57
|
-
* Formats an email address for Mailjet API format.
|
|
58
|
-
* @param address The email address object to format.
|
|
59
|
-
* @returns An object with Email and optional Name properties.
|
|
60
|
-
*/
|
|
61
|
-
export declare const formatMailjetAddress: (address: EmailAddress) => {
|
|
62
|
-
Email: string;
|
|
63
|
-
Name?: string;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Formats email addresses for Mailjet API format.
|
|
67
|
-
* @param addresses The email address(es) to format (single or array).
|
|
68
|
-
* @returns An array of objects with Email and optional Name properties.
|
|
69
|
-
*/
|
|
70
|
-
export declare const formatMailjetAddresses: (addresses: EmailAddress | EmailAddress[]) => {
|
|
71
|
-
Email: string;
|
|
72
|
-
Name?: string;
|
|
73
|
-
}[];
|
|
74
|
-
/**
|
|
75
|
-
* Formats an email address for Mandrill API format.
|
|
76
|
-
* @param address The email address object to format.
|
|
77
|
-
* @param type The recipient type (default: "to").
|
|
78
|
-
* @returns An object with email, optional name, and type properties.
|
|
79
|
-
*/
|
|
80
|
-
export declare const formatMandrillAddress: (address: EmailAddress, type?: string) => {
|
|
81
|
-
email: string;
|
|
82
|
-
name?: string;
|
|
83
|
-
type: string;
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* Formats email addresses for Mandrill API format.
|
|
87
|
-
* @param addresses The email address(es) to format (single or array).
|
|
88
|
-
* @param type The recipient type (default: "to").
|
|
89
|
-
* @returns An array of objects with email, optional name, and type properties.
|
|
90
|
-
*/
|
|
91
|
-
export declare const formatMandrillAddresses: (addresses: EmailAddress | EmailAddress[], type?: string) => {
|
|
92
|
-
email: string;
|
|
93
|
-
name?: string;
|
|
94
|
-
type: string;
|
|
95
|
-
}[];
|
|
96
|
-
/**
|
|
97
|
-
* Formats an email address for Postal API format.
|
|
98
|
-
* @param address The email address object to format.
|
|
99
|
-
* @returns An object with address and optional name properties.
|
|
100
|
-
*/
|
|
101
|
-
export declare const formatPostalAddress: (address: EmailAddress) => {
|
|
102
|
-
address: string;
|
|
103
|
-
name?: string;
|
|
104
|
-
};
|
|
105
|
-
/**
|
|
106
|
-
* Formats email addresses for Postal API format.
|
|
107
|
-
* @param addresses The email address(es) to format (single or array).
|
|
108
|
-
* @returns An array of objects with address and optional name properties.
|
|
109
|
-
*/
|
|
110
|
-
export declare const formatPostalAddresses: (addresses: EmailAddress | EmailAddress[]) => {
|
|
111
|
-
address: string;
|
|
112
|
-
name?: string;
|
|
113
|
-
}[];
|
|
114
|
-
/**
|
|
115
|
-
* Formats email addresses for MailPace API format as formatted strings.
|
|
116
|
-
* @param addresses The email address(es) to format (single or array).
|
|
117
|
-
* @returns An array of formatted email address strings.
|
|
118
|
-
*/
|
|
119
|
-
export declare const formatMailpaceAddresses: (addresses: EmailAddress | EmailAddress[]) => string[];
|
|
120
|
-
/**
|
|
121
|
-
* Formats an email address for Zeptomail API format.
|
|
122
|
-
* @param address The email address object to format.
|
|
123
|
-
* @returns An object with address and optional name properties.
|
|
124
|
-
*/
|
|
125
|
-
export declare const formatZeptomailAddress: (address: EmailAddress) => {
|
|
126
|
-
address: string;
|
|
127
|
-
name?: string;
|
|
128
|
-
};
|
|
129
|
-
/**
|
|
130
|
-
* Formats email addresses for Zeptomail API format.
|
|
131
|
-
* @param addresses The email address(es) to format (single or array).
|
|
132
|
-
* @returns An array of objects with email_address containing address and optional name properties.
|
|
133
|
-
*/
|
|
134
|
-
export declare const formatZeptomailAddresses: (addresses: EmailAddress | EmailAddress[]) => {
|
|
135
|
-
email_address: {
|
|
136
|
-
address: string;
|
|
137
|
-
name?: string;
|
|
138
|
-
};
|
|
139
|
-
}[];
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { Attachment } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Processes attachment content and converts it to a base64-encoded string.
|
|
4
|
-
* @param attachment The attachment object to process.
|
|
5
|
-
* @param providerName The name of the provider (for error messages).
|
|
6
|
-
* @returns The base64-encoded string representation of the attachment content.
|
|
7
|
-
* @throws {EmailError} When the attachment has no content.
|
|
8
|
-
*/
|
|
9
|
-
export declare const processAttachmentContent: (attachment: Attachment, providerName: string) => Promise<string>;
|
|
10
|
-
/**
|
|
11
|
-
* Creates a standardized attachment object for API payloads.
|
|
12
|
-
* @param attachment The attachment object to standardize.
|
|
13
|
-
* @param providerName The name of the provider (for error messages).
|
|
14
|
-
* @returns A standardized attachment object with content, contentType, disposition, filename, and optional contentId.
|
|
15
|
-
*/
|
|
16
|
-
export declare const createStandardAttachment: (attachment: Attachment, providerName: string) => Promise<{
|
|
17
|
-
content: string;
|
|
18
|
-
contentId?: string;
|
|
19
|
-
contentType: string;
|
|
20
|
-
disposition: string;
|
|
21
|
-
filename: string;
|
|
22
|
-
}>;
|
|
23
|
-
/**
|
|
24
|
-
* Creates a SendGrid-specific attachment format.
|
|
25
|
-
* @param attachment The attachment object to format.
|
|
26
|
-
* @param providerName The name of the provider (for error messages).
|
|
27
|
-
* @returns A SendGrid-formatted attachment object with content, type, disposition, filename, and optional content_id.
|
|
28
|
-
*/
|
|
29
|
-
export declare const createSendGridAttachment: (attachment: Attachment, providerName: string) => Promise<{
|
|
30
|
-
content: string;
|
|
31
|
-
content_id?: string;
|
|
32
|
-
disposition: string;
|
|
33
|
-
filename: string;
|
|
34
|
-
type: string;
|
|
35
|
-
}>;
|
|
36
|
-
/**
|
|
37
|
-
* Creates a Postmark-specific attachment format.
|
|
38
|
-
* @param attachment The attachment object to format.
|
|
39
|
-
* @param providerName The name of the provider (for error messages).
|
|
40
|
-
* @returns A Postmark-formatted attachment object with Content, ContentType, Name, and optional ContentID.
|
|
41
|
-
*/
|
|
42
|
-
export declare const createPostmarkAttachment: (attachment: Attachment, providerName: string) => Promise<{
|
|
43
|
-
Content: string;
|
|
44
|
-
ContentID?: string;
|
|
45
|
-
ContentType: string;
|
|
46
|
-
Name: string;
|
|
47
|
-
}>;
|
|
48
|
-
/**
|
|
49
|
-
* Creates a Mailgun-specific attachment format for form data.
|
|
50
|
-
* @param attachment The attachment object to format.
|
|
51
|
-
* @param providerName The name of the provider (for error messages).
|
|
52
|
-
* @param index The index of the attachment in the attachments array.
|
|
53
|
-
* @returns A Mailgun-formatted attachment object with content and key properties.
|
|
54
|
-
*/
|
|
55
|
-
export declare const createMailgunAttachment: (attachment: Attachment, providerName: string, index: number) => Promise<{
|
|
56
|
-
content: string;
|
|
57
|
-
key: string;
|
|
58
|
-
}>;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import type { EmailAddress, EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Common payload building utilities for email providers
|
|
4
|
-
*/
|
|
5
|
-
export declare class PayloadBuilder {
|
|
6
|
-
private payload;
|
|
7
|
-
constructor(initialPayload?: Record<string, unknown>);
|
|
8
|
-
/**
|
|
9
|
-
* Sets a field in the payload.
|
|
10
|
-
* @param key The field key to set.
|
|
11
|
-
* @param value The field value to set (undefined and null values are ignored).
|
|
12
|
-
* @returns This instance for method chaining.
|
|
13
|
-
*/
|
|
14
|
-
set(key: string, value: unknown): this;
|
|
15
|
-
/**
|
|
16
|
-
* Sets multiple fields conditionally in the payload.
|
|
17
|
-
* @param fields An object containing key-value pairs to set.
|
|
18
|
-
* @returns This instance for method chaining.
|
|
19
|
-
*/
|
|
20
|
-
setMultiple(fields: Record<string, unknown>): this;
|
|
21
|
-
/**
|
|
22
|
-
* Adds recipients (to, cc, bcc) to the payload using a formatter function.
|
|
23
|
-
* @param emailOptions The email options containing recipient addresses.
|
|
24
|
-
* @param formatter A function to format the addresses for the specific provider.
|
|
25
|
-
* @returns This instance for method chaining.
|
|
26
|
-
*/
|
|
27
|
-
addRecipients(emailOptions: EmailOptions, formatter: (addresses: EmailAddress | EmailAddress[]) => unknown): this;
|
|
28
|
-
/**
|
|
29
|
-
* Adds standard email fields (subject, html, text, replyTo) to the payload.
|
|
30
|
-
* @param emailOptions The email options containing the standard fields.
|
|
31
|
-
* @returns This instance for method chaining.
|
|
32
|
-
*/
|
|
33
|
-
addStandardFields(emailOptions: EmailOptions): this;
|
|
34
|
-
/**
|
|
35
|
-
* Adds template-related fields to the payload.
|
|
36
|
-
* @param emailOptions The email options containing template information.
|
|
37
|
-
* @param templateKey The key name to use for the template ID (default: "template_id").
|
|
38
|
-
* @returns This instance for method chaining.
|
|
39
|
-
*/
|
|
40
|
-
addTemplateFields(emailOptions: EmailOptions, templateKey?: string): this;
|
|
41
|
-
/**
|
|
42
|
-
* Adds scheduling fields to the payload for delayed sending.
|
|
43
|
-
* @param emailOptions The email options containing scheduling information.
|
|
44
|
-
* @returns This instance for method chaining.
|
|
45
|
-
*/
|
|
46
|
-
addSchedulingFields(emailOptions: EmailOptions): this;
|
|
47
|
-
/**
|
|
48
|
-
* Adds tags to the payload for email categorization.
|
|
49
|
-
* @param emailOptions The email options containing tags.
|
|
50
|
-
* @param formatter An optional function to format tags for the specific provider.
|
|
51
|
-
* @returns This instance for method chaining.
|
|
52
|
-
*/
|
|
53
|
-
addTags(emailOptions: EmailOptions, formatter?: (tags: unknown[]) => unknown): this;
|
|
54
|
-
/**
|
|
55
|
-
* Adds custom headers to the payload.
|
|
56
|
-
* @param emailOptions The email options containing custom headers.
|
|
57
|
-
* @param formatter An optional function to format headers for the specific provider.
|
|
58
|
-
* @returns This instance for method chaining.
|
|
59
|
-
*/
|
|
60
|
-
addHeaders(emailOptions: EmailOptions, formatter?: (headers: Record<string, string>) => unknown): this;
|
|
61
|
-
/**
|
|
62
|
-
* Adds a batch ID to the payload for batch email operations.
|
|
63
|
-
* @param emailOptions The email options containing the batch ID.
|
|
64
|
-
* @returns This instance for method chaining.
|
|
65
|
-
*/
|
|
66
|
-
addBatchId(emailOptions: EmailOptions): this;
|
|
67
|
-
/**
|
|
68
|
-
* Builds and returns the final payload object.
|
|
69
|
-
* @returns The complete payload object ready for API submission.
|
|
70
|
-
*/
|
|
71
|
-
build(): Record<string, unknown>;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Creates a new payload builder instance.
|
|
75
|
-
* @param initialPayload Optional initial payload object to start with.
|
|
76
|
-
* @returns A new PayloadBuilder instance.
|
|
77
|
-
*/
|
|
78
|
-
export declare const createPayloadBuilder: (initialPayload?: Record<string, unknown>) => PayloadBuilder;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import EmailError from "../../errors/email-error.d.ts";
|
|
2
|
-
import type { MaybePromise } from "../../types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Logger interface with debug, error, info, and warn methods
|
|
5
|
-
*/
|
|
6
|
-
type Logger = {
|
|
7
|
-
debug: (message: string, ...args: unknown[]) => void;
|
|
8
|
-
error: (message: string, ...args: unknown[]) => void;
|
|
9
|
-
info: (message: string, ...args: unknown[]) => void;
|
|
10
|
-
warn: (message: string, ...args: unknown[]) => void;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Common provider configuration interface
|
|
14
|
-
*/
|
|
15
|
-
export interface BaseProviderConfig {
|
|
16
|
-
debug?: boolean;
|
|
17
|
-
logger?: Console;
|
|
18
|
-
timeout?: number;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Provider initialization state management
|
|
22
|
-
*/
|
|
23
|
-
export declare class ProviderState {
|
|
24
|
-
private isInitialized;
|
|
25
|
-
/**
|
|
26
|
-
* Checks if the provider has been initialized.
|
|
27
|
-
* @returns True if the provider is initialized, false otherwise.
|
|
28
|
-
*/
|
|
29
|
-
get initialized(): boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Marks the provider as initialized.
|
|
32
|
-
*/
|
|
33
|
-
setInitialized(): void;
|
|
34
|
-
/**
|
|
35
|
-
* Ensures the provider is initialized, initializing it if not already done.
|
|
36
|
-
* @param initializeFunction The function to call for initialization.
|
|
37
|
-
* @param providerName The name of the provider (for error messages).
|
|
38
|
-
* @throws {EmailError} When initialization fails.
|
|
39
|
-
*/
|
|
40
|
-
ensureInitialized(initializeFunction: () => MaybePromise<void>, providerName: string): Promise<void>;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Creates a logger instance for a provider.
|
|
44
|
-
* @param providerName The name of the provider (used as prefix in log messages).
|
|
45
|
-
* @param customLogger Optional Console instance for logging output.
|
|
46
|
-
* @returns A logger instance with debug, error, info, and warn methods.
|
|
47
|
-
*/
|
|
48
|
-
export declare const createProviderLogger: (providerName: string, customLogger?: Console) => Logger;
|
|
49
|
-
/**
|
|
50
|
-
* Checks if an HTTP response indicates success (2xx status codes).
|
|
51
|
-
* @param result The result object containing response data and success status.
|
|
52
|
-
* @param result.data The response data object.
|
|
53
|
-
* @param result.success The success flag indicating if the request was successful.
|
|
54
|
-
* @returns True if the response indicates success, false otherwise.
|
|
55
|
-
*/
|
|
56
|
-
export declare const isSuccessfulResponse: (result: {
|
|
57
|
-
data?: unknown;
|
|
58
|
-
success: boolean;
|
|
59
|
-
}) => boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Handles errors from provider operations and converts them to EmailError instances.
|
|
62
|
-
* @param providerName The name of the provider where the error occurred.
|
|
63
|
-
* @param operation The operation that failed.
|
|
64
|
-
* @param error The error that occurred.
|
|
65
|
-
* @param logger Optional logger instance for debug messages.
|
|
66
|
-
* @returns An EmailError instance with appropriate error information.
|
|
67
|
-
*/
|
|
68
|
-
export declare const handleProviderError: (providerName: string, operation: string, error: unknown, logger?: Logger) => EmailError;
|
|
69
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ProviderFactory } from "../provider.d.ts";
|
|
2
|
-
import type { ZeptomailConfig, ZeptomailEmailOptions } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Zeptomail Provider for sending emails through Zeptomail API
|
|
5
|
-
*/
|
|
6
|
-
declare const zeptomailProvider: ProviderFactory<ZeptomailConfig, unknown, ZeptomailEmailOptions>;
|
|
7
|
-
export default zeptomailProvider;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { BaseConfig, EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Zeptomail configuration
|
|
4
|
-
*/
|
|
5
|
-
export interface ZeptomailConfig extends BaseConfig {
|
|
6
|
-
endpoint?: string;
|
|
7
|
-
token: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Zeptomail-specific email options
|
|
11
|
-
*/
|
|
12
|
-
export interface ZeptomailEmailOptions extends EmailOptions {
|
|
13
|
-
/**
|
|
14
|
-
* Client reference - identifier set by the user to track a particular transaction
|
|
15
|
-
*/
|
|
16
|
-
clientReference?: string;
|
|
17
|
-
/**
|
|
18
|
-
* MIME headers - additional headers sent in the email for reference
|
|
19
|
-
*/
|
|
20
|
-
mimeHeaders?: Record<string, string>;
|
|
21
|
-
/**
|
|
22
|
-
* Track email clicks - enables tracking for click events
|
|
23
|
-
*/
|
|
24
|
-
trackClicks?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Track email opens - enables tracking for open events
|
|
27
|
-
*/
|
|
28
|
-
trackOpens?: boolean;
|
|
29
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Template render function type.
|
|
3
|
-
* @param template Template content (string, React component, etc.).
|
|
4
|
-
* @param data Data/variables to pass to the template.
|
|
5
|
-
* @param options Options specific to the template engine.
|
|
6
|
-
* @returns Rendered HTML string.
|
|
7
|
-
*/
|
|
8
|
-
export type TemplateRenderer = (template: unknown, data?: Record<string, unknown>, options?: Record<string, unknown>) => string | Promise<string>;
|