@visulima/email 1.0.0-alpha.35 → 1.0.0-alpha.37
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 +36 -0
- package/LICENSE.md +57 -0
- package/README.md +19 -0
- package/dist/crypto/index.js +1 -1
- package/dist/deliverability/dmarc-report.js +1 -1
- package/dist/deliverability/index.js +1 -1
- package/dist/events/index.js +1 -1
- package/dist/inbound/index.js +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +1 -1
- package/dist/middleware/index.js +1 -1
- package/dist/packem_shared/ALL_EVENTS-3kwh5CBE.js +1 -0
- package/dist/packem_shared/DkimSigner-BuSbnos1.js +18 -0
- package/dist/packem_shared/DraftMailMessage-C9tevR8K.js +1 -0
- package/dist/packem_shared/EmailError-B-sEf3bp.js +1 -0
- package/dist/packem_shared/Mail-DpjH0Exh.js +1 -0
- package/dist/packem_shared/MailMessage-L-Q9yc5v.js +1 -0
- package/dist/packem_shared/MemoryEventStore-CuhfO9aj.js +1 -0
- package/dist/packem_shared/MemoryQueue-Dl1Fa6OJ.js +1 -0
- package/dist/packem_shared/MemorySuppressionStore-DZnbz-_B.js +1 -0
- package/dist/packem_shared/RATE_LIMIT_PRESETS-BPADLgcA.js +1 -0
- package/dist/packem_shared/RequiredOptionError-DuNNY_a5.js +1 -0
- package/dist/packem_shared/SmimeEncrypter-C7usORKF.js +6 -0
- package/dist/packem_shared/SmimeSigner-DgAApLPS.js +8 -0
- package/dist/packem_shared/addDarkModeSupport-DZYxULjl.js +1 -0
- package/dist/packem_shared/address-formatter-BWR2Dddx.js +1 -0
- package/dist/packem_shared/aggregate-features-BqEjPd42.js +1 -0
- package/dist/packem_shared/ahaSendProvider-Dq5mElHZ.js +1 -0
- package/dist/packem_shared/arcMessageSignatureBase-BY4j0TxM.js +17 -0
- package/dist/packem_shared/attachment-processor-BjTNoMyb.js +1 -0
- package/dist/packem_shared/awsSesProvider-BGZJUIep.js +32 -0
- package/dist/packem_shared/azureProvider-DlM6UWUv.js +1 -0
- package/dist/packem_shared/brevoProvider-D_Hhc0Z-.js +1 -0
- package/dist/packem_shared/build-mime-message-Be6TOi1T.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-D4adkOjA.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-BM3iNznm.js +1 -0
- package/dist/packem_shared/createWorker-_-yMWcNQ.js +1 -0
- package/dist/packem_shared/dedupeMiddleware-B6ajWOTi.js +1 -0
- package/dist/packem_shared/defineInboundHandler-CnL2BzlL.js +1 -0
- package/dist/packem_shared/defineProvider-C9q-7iwt.js +1 -0
- package/dist/packem_shared/detectMimeType-Dxv4MjZ7.js +1 -0
- package/dist/packem_shared/emailMatchers-DZDkrZ_3.js +1 -0
- package/dist/packem_shared/extractCidReferences-BuoTREMp.js +1 -0
- package/dist/packem_shared/extractReply-BUjIBt9A.js +5 -0
- package/dist/packem_shared/failoverProvider-BgX6zfnY.js +1 -0
- package/dist/packem_shared/format-address-DTl-9O70.js +1 -0
- package/dist/packem_shared/generate-boundary-DQbzDiOI.js +1 -0
- package/dist/packem_shared/generate-message-id-gXAuMz4g.js +1 -0
- package/dist/packem_shared/headers-to-record-De1Eg951.js +1 -0
- package/dist/packem_shared/httpProvider-DJAsYSun.js +1 -0
- package/dist/packem_shared/index-yDU-1zOZ.js +11 -0
- package/dist/packem_shared/infobipProvider-oOL-ThpP.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-DSedSU3q.js → loopsProvider-BXr0KSjB.js} +1 -1
- package/dist/packem_shared/{mail.d-LmrdSngG.d.ts → mail.d-B9SSqyy0.d.ts} +54 -6
- package/dist/packem_shared/{mailCrabProvider-xSLhA1CY.js → mailCrabProvider-C7Ao5H9p.js} +1 -1
- package/dist/packem_shared/{mailPaceProvider-CWBIjvvJ.js → mailPaceProvider-DklGeGEM.js} +1 -1
- package/dist/packem_shared/{mailchannelsProvider-zKcunGDQ.js → mailchannelsProvider-DPfQVzUd.js} +1 -1
- package/dist/packem_shared/mailerSendProvider-B8iT5Uhb.js +1 -0
- package/dist/packem_shared/mailgunProvider-Ctyrs9d0.js +1 -0
- package/dist/packem_shared/mailjetProvider-v55nFDsr.js +1 -0
- package/dist/packem_shared/mailomatProvider-BCyB4Q4B.js +1 -0
- package/dist/packem_shared/mailtrapProvider-DcVw3sxR.js +1 -0
- package/dist/packem_shared/make-request-BlK_B72c.js +1 -0
- package/dist/packem_shared/mandrillProvider-gqMFMwgs.js +1 -0
- package/dist/packem_shared/mockProvider-Behywbl1.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/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-C0LO-1E3.js +1 -0
- package/dist/packem_shared/postProcessHtml-DqKi2Ucg.js +1 -0
- package/dist/packem_shared/postalProvider-B26IqgxE.js +1 -0
- package/dist/packem_shared/{postmarkProvider-i9u0h26U.js → postmarkProvider-DWQJv5_M.js} +1 -1
- package/dist/packem_shared/provider-base-gIoUu9so.js +1 -0
- package/dist/packem_shared/quoted-printable-nSGDA1tA.js +7 -0
- package/dist/packem_shared/resendProvider-DhvKVyCD.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-D8dmHuwZ.js +1 -0
- package/dist/packem_shared/{sendGridProvider-CayLXvPO.js → sendGridProvider-CChhLr7s.js} +1 -1
- package/dist/packem_shared/smtpProvider-x4WBN-3W.js +25 -0
- package/dist/packem_shared/sweegoProvider-7xhOvagC.js +1 -0
- package/dist/packem_shared/toEmailSnapshot-DeRqM5SJ.js +1 -0
- package/dist/packem_shared/{types.d-BMpI2UXj.d.ts → types.d-DCkecJse.d.ts} +1 -1
- 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-D3nQKXRf.js +1 -0
- package/dist/providers/ahasend/index.d.ts +1 -1
- package/dist/providers/ahasend/index.js +1 -1
- package/dist/providers/aws-ses/index.d.ts +1 -1
- package/dist/providers/aws-ses/index.js +1 -1
- package/dist/providers/azure/index.d.ts +1 -1
- package/dist/providers/azure/index.js +1 -1
- package/dist/providers/brevo/index.d.ts +1 -1
- package/dist/providers/brevo/index.js +1 -1
- package/dist/providers/cloudflare-email/index.d.ts +1 -1
- package/dist/providers/cloudflare-email/index.js +1 -1
- package/dist/providers/failover/index.d.ts +1 -1
- package/dist/providers/failover/index.js +1 -1
- package/dist/providers/http/index.d.ts +1 -1
- package/dist/providers/http/index.js +1 -1
- package/dist/providers/infobip/index.d.ts +1 -1
- package/dist/providers/infobip/index.js +1 -1
- package/dist/providers/loops/index.d.ts +1 -1
- package/dist/providers/loops/index.js +1 -1
- package/dist/providers/mailchannels/index.d.ts +1 -1
- package/dist/providers/mailchannels/index.js +1 -1
- package/dist/providers/mailcrab/index.d.ts +1 -1
- package/dist/providers/mailcrab/index.js +1 -1
- package/dist/providers/mailersend/index.d.ts +1 -1
- package/dist/providers/mailersend/index.js +1 -1
- package/dist/providers/mailgun/index.d.ts +1 -1
- package/dist/providers/mailgun/index.js +1 -1
- package/dist/providers/mailjet/index.d.ts +1 -1
- package/dist/providers/mailjet/index.js +1 -1
- package/dist/providers/mailomat/index.d.ts +1 -1
- package/dist/providers/mailomat/index.js +1 -1
- package/dist/providers/mailpace/index.d.ts +1 -1
- package/dist/providers/mailpace/index.js +1 -1
- package/dist/providers/mailtrap/index.d.ts +1 -1
- package/dist/providers/mailtrap/index.js +1 -1
- package/dist/providers/mandrill/index.d.ts +1 -1
- package/dist/providers/mandrill/index.js +1 -1
- package/dist/providers/mock/index.d.ts +3 -3
- package/dist/providers/mock/index.js +1 -1
- package/dist/providers/nodemailer/index.d.ts +1 -1
- package/dist/providers/nodemailer/index.js +1 -1
- package/dist/providers/opentelemetry/index.js +1 -1
- package/dist/providers/plunk/index.d.ts +1 -1
- package/dist/providers/plunk/index.js +1 -1
- package/dist/providers/postal/index.d.ts +1 -1
- package/dist/providers/postal/index.js +1 -1
- package/dist/providers/postmark/index.d.ts +1 -1
- package/dist/providers/postmark/index.js +1 -1
- package/dist/providers/resend/index.d.ts +1 -1
- package/dist/providers/resend/index.js +1 -1
- package/dist/providers/roundrobin/index.d.ts +1 -1
- package/dist/providers/roundrobin/index.js +1 -1
- package/dist/providers/scaleway/index.d.ts +1 -1
- package/dist/providers/scaleway/index.js +1 -1
- package/dist/providers/sendgrid/index.d.ts +1 -1
- package/dist/providers/sendgrid/index.js +1 -1
- package/dist/providers/smtp/index.d.ts +1 -1
- package/dist/providers/smtp/index.js +1 -1
- package/dist/providers/sweego/index.d.ts +1 -1
- package/dist/providers/sweego/index.js +1 -1
- package/dist/providers/zeptomail/index.d.ts +1 -1
- package/dist/providers/zeptomail/index.js +1 -1
- package/dist/queue/bullmq-queue.js +1 -1
- package/dist/queue/index.d.ts +0 -1
- package/dist/queue/index.js +1 -1
- package/dist/queue/pg-boss-queue.js +1 -1
- package/dist/queue/sqs-queue.js +1 -1
- package/dist/queue/unstorage-queue.d.ts +119 -1
- package/dist/queue/unstorage-queue.js +1 -1
- package/dist/render/index.js +1 -1
- package/dist/template-engines/handlebars.js +1 -1
- package/dist/template-engines/html-to-text.js +1 -1
- package/dist/template-engines/i18n.js +1 -1
- package/dist/template-engines/jsx-email.js +1 -1
- package/dist/template-engines/liquid.js +1 -1
- package/dist/template-engines/mjml.js +1 -1
- package/dist/template-engines/react-email.js +1 -1
- package/dist/template-engines/vue-email.js +1 -1
- package/dist/test/index.d.ts +2 -2
- package/dist/test/index.js +1 -1
- package/dist/utils/cache.js +1 -1
- package/dist/utils/format-email-address.js +1 -1
- package/dist/utils/normalize-email-aliases.js +1 -1
- 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.js +1 -1
- package/dist/utils/validation/check-feature-support.js +1 -1
- package/dist/utils/validation/check-mx-records.d.ts +1 -1
- package/dist/utils/validation/check-mx-records.js +1 -1
- package/dist/utils/validation/role-accounts.js +1 -1
- package/dist/utils/validation/validate-email.js +1 -1
- package/dist/utils/validation/verify-email.js +1 -1
- package/dist/utils/validation/verify-smtp.js +4 -4
- package/dist/webhooks/index.js +1 -1
- package/package.json +10 -6
- package/dist/packem_shared/ALL_EVENTS-A0nTVOo0.js +0 -1
- package/dist/packem_shared/DkimSigner-dKZ45Csc.js +0 -18
- package/dist/packem_shared/EmailError-zm2ffVav.js +0 -1
- package/dist/packem_shared/Mail-B2QII2P9.js +0 -1
- package/dist/packem_shared/MailMessage-DB1zaWfM.js +0 -1
- package/dist/packem_shared/MemoryEventStore-BEKPxa-I.js +0 -1
- package/dist/packem_shared/MemoryQueue-C-CtRRG7.js +0 -1
- package/dist/packem_shared/MemorySuppressionStore-BKY1FrA1.js +0 -1
- package/dist/packem_shared/RATE_LIMIT_PRESETS-DQF78mdO.js +0 -1
- package/dist/packem_shared/RequiredOptionError-CevW3u2K.js +0 -1
- package/dist/packem_shared/SmimeEncrypter-BirIsrip.js +0 -6
- package/dist/packem_shared/SmimeSigner-CkyaShTs.js +0 -8
- package/dist/packem_shared/addDarkModeSupport-Ys9U2-GH.js +0 -1
- package/dist/packem_shared/address-formatter-CnPg51_n.js +0 -1
- package/dist/packem_shared/aggregate-features-BvgdYul-.js +0 -1
- package/dist/packem_shared/ahaSendProvider-yuqYMW0n.js +0 -1
- package/dist/packem_shared/arcMessageSignatureBase-Cpdnv-H8.js +0 -17
- package/dist/packem_shared/attachment-processor-CFUC3V45.js +0 -1
- package/dist/packem_shared/awsSesProvider-DX1630Ms.js +0 -32
- package/dist/packem_shared/azureProvider-CK_Wuw4r.js +0 -1
- package/dist/packem_shared/brevoProvider-CNwuzzBA.js +0 -1
- package/dist/packem_shared/build-mime-message-D8WEZejb.js +0 -3
- package/dist/packem_shared/buildListUnsubscribe-CIbz0rtk.js +0 -1
- package/dist/packem_shared/circuitBreakerMiddleware-B7DlzZSG.js +0 -1
- package/dist/packem_shared/cloudflareEmailProvider-C-G821Hg.js +0 -1
- package/dist/packem_shared/composeMiddleware-CkEhbDjL.js +0 -1
- package/dist/packem_shared/create-logger-BiWdqFNg.js +0 -1
- package/dist/packem_shared/createTestEmail-hHdtgmUM.js +0 -1
- package/dist/packem_shared/createWorker-Nkc1GHet.js +0 -1
- package/dist/packem_shared/dedupeMiddleware-JeJbff46.js +0 -1
- package/dist/packem_shared/defineProvider-CtLH0VBE.js +0 -1
- package/dist/packem_shared/detectMimeType-B4QMh7k8.js +0 -1
- package/dist/packem_shared/emailMatchers-CLANeU71.js +0 -1
- package/dist/packem_shared/extractReply-CCWnNRWe.js +0 -5
- package/dist/packem_shared/failoverProvider-D90MHT2T.js +0 -1
- package/dist/packem_shared/filterSuppressed-DntqRV0q.js +0 -1
- package/dist/packem_shared/format-address-Cv6uWTS5.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-DUg1AQfO.js +0 -1
- package/dist/packem_shared/infobipProvider-DdV62IAG.js +0 -1
- package/dist/packem_shared/injectPreheader-BxPjb0eJ.js +0 -1
- package/dist/packem_shared/inlineCss-BLaEi337.js +0 -1
- package/dist/packem_shared/isValidSigningCertUrl-CF_KuCAi.js +0 -3
- package/dist/packem_shared/loggingMiddleware-CyHzn37U.js +0 -1
- package/dist/packem_shared/mailerSendProvider-BEvPlBKB.js +0 -1
- package/dist/packem_shared/mailgunProvider-CfQAINTC.js +0 -1
- package/dist/packem_shared/mailjetProvider-DEfKptWc.js +0 -1
- package/dist/packem_shared/mailomatProvider-D5sHlxZh.js +0 -1
- package/dist/packem_shared/mailtrapProvider-DwgMKakk.js +0 -1
- package/dist/packem_shared/make-request-CaT4d5oC.js +0 -1
- package/dist/packem_shared/mandrillProvider-CdGjO3Td.js +0 -1
- package/dist/packem_shared/mockProvider-C0P1lKOy.js +0 -1
- package/dist/packem_shared/nodemailerProvider-DFcvoVFv.js +0 -1
- package/dist/packem_shared/normalizeMessageId-B_9mXlh4.js +0 -1
- package/dist/packem_shared/oauth2Middleware-B1xz58iP.js +0 -1
- package/dist/packem_shared/opentelemetryProvider-Dwv88G3O.js +0 -1
- package/dist/packem_shared/parseAddress-CrYOac3K.js +0 -1
- package/dist/packem_shared/parseArfReport-CUHb8WVj.js +0 -6
- package/dist/packem_shared/parseCloudflareInbound-BGgH5u7M.js +0 -1
- package/dist/packem_shared/parseDmarcRecord-DjNqCMZc.js +0 -1
- package/dist/packem_shared/parseInbound-BP-gEjhh.js +0 -1
- package/dist/packem_shared/parseMailgunInbound-C3sZ1TiH.js +0 -1
- package/dist/packem_shared/parseMtaStsPolicy-rFOOVXXK.js +0 -6
- package/dist/packem_shared/parsePostmarkInbound-C0Ttfroo.js +0 -1
- package/dist/packem_shared/parseSendGridInbound-BkvaoYRl.js +0 -4
- package/dist/packem_shared/parseSesInbound-BFS--T8X.js +0 -1
- package/dist/packem_shared/parseTlsRptRecord-DnLwAWsk.js +0 -1
- package/dist/packem_shared/plunkProvider-BIhMU2b5.js +0 -1
- package/dist/packem_shared/postProcessHtml-C73e0b9H.js +0 -1
- package/dist/packem_shared/postalProvider-CmmbCZSi.js +0 -1
- package/dist/packem_shared/provider-base-BpHE_uK8.js +0 -1
- package/dist/packem_shared/readFile-BkNfutxp-BS8Q2183.js +0 -1
- package/dist/packem_shared/resendProvider-BNduBn0w.js +0 -1
- package/dist/packem_shared/retry-UPd8F62N.js +0 -1
- package/dist/packem_shared/retryMiddleware-DHespsU2.js +0 -1
- package/dist/packem_shared/rewriteCidLinks-B-Sd5XHs.js +0 -1
- package/dist/packem_shared/roundRobinProvider-B_60F0BC.js +0 -1
- package/dist/packem_shared/sanitize-header-wWav-Scu.js +0 -1
- package/dist/packem_shared/scalewayProvider-8gb4sIOB.js +0 -1
- package/dist/packem_shared/smtpProvider-DoXVsN4p.js +0 -24
- package/dist/packem_shared/sweegoProvider-C0g9Ajdn.js +0 -1
- package/dist/packem_shared/toEmailSnapshot-CYpMmnAA.js +0 -1
- package/dist/packem_shared/utils-BwolsGlK.js +0 -1
- package/dist/packem_shared/validate-email-options-DPo3SgC0.js +0 -1
- package/dist/packem_shared/verifyMailgunWebhook-Df7n2Quh.js +0 -1
- package/dist/packem_shared/verifyPostmarkWebhook-D_eXt_Lq.js +0 -1
- package/dist/packem_shared/verifySendGridWebhook-XOSj5yTe.js +0 -1
- package/dist/packem_shared/verifyStandardWebhook-DdUTlIVh.js +0 -1
- package/dist/packem_shared/withEvents-Q9bwpCFG.js +0 -1
- package/dist/packem_shared/withMetrics-BPs3Kdxn.js +0 -1
- package/dist/packem_shared/withRender-DQM2zbbI.js +0 -1
- package/dist/packem_shared/withSuppression-DfjV_tbI.js +0 -1
- package/dist/packem_shared/withTelemetry-CsQsv1DV.js +0 -1
- package/dist/packem_shared/zeptomailProvider-BIbHieGJ.js +0 -1
|
@@ -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-CaT4d5oC.js";import{u as w}from"./retry-UPd8F62N.js";import{a as A,s as z}from"./sanitize-header-wWav-Scu.js";import{d as _}from"./validate-email-options-DPo3SgC0.js";import{defineProvider as j}from"./defineProvider-CtLH0VBE.js";import{c as P,P as I,h as T}from"./provider-base-BpHE_uK8.js";import{m as h}from"./address-formatter-CnPg51_n.js";const i="zeptomail",O="https://api.zeptomail.com/v1.1",$=3e4,Z=3,J=j((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 o={debug:s.debug??!1,endpoint:s.endpoint??O,logger:s.logger,retries:s.retries??Z,timeout:s.timeout??$,token:s.token},u=new I,n=P(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");n.debug("Provider initialized successfully")},i)},async isAvailable(){try{return o.token&&o.token.startsWith("Zoho-enczapikey ")?(n.debug("Token format is valid, assuming Zeptomail is available"),!0):!1}catch(e){return n.debug("Error checking availability:",e),!1}},name:i,options:o,async sendEmail(e){try{const m=_(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:h(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=[h(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??={},Object.entries(t).forEach(([r,d])=>{a.mime_headers&&(a.mime_headers[A(r)]=z(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})),n.debug("Sending email via Zeptomail API",{subject:a.subject,to:a.to});const g={Accept:"application/json",Authorization:o.token,"Content-Type":"application/json"},c=await w(async()=>v(`${o.endpoint}/email`,{headers:g,method:"POST",timeout:o.timeout},JSON.stringify(a)),o.retries);if(!c.success){n.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,f=p?.request_id??b();return n.debug("Email sent successfully",{messageId:f}),{data:{messageId:f,provider:i,response:p,sent:!0,timestamp:new Date},success:!0}}catch(m){return{error:T(i,"send email",m,n),success:!1}}},async validateCredentials(){return this.isAvailable()}}});export{J as default};
|