@visulima/email 1.0.0-alpha.35 → 1.0.0-alpha.36
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 +34 -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 +9 -5
- 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,5 +1,5 @@
|
|
|
1
1
|
import { P as ProviderFactory } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
2
|
-
export {
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
3
3
|
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-ejzh-xBP.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as d}from"../../packem_shared/mandrillProvider-
|
|
1
|
+
import{default as d}from"../../packem_shared/mandrillProvider-gqMFMwgs.js";export{d as mandrillProvider};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { P as ProviderFactory } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
2
|
-
export {
|
|
3
|
-
import { M as MockConfig, a as MockEmailEntry } from "../../packem_shared/types.d-
|
|
4
|
-
export {
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
3
|
+
import { M as MockConfig, a as MockEmailEntry } from "../../packem_shared/types.d-DCkecJse.js";
|
|
4
|
+
export type { b as MockEmailOptions, R as RandomDelayRange } from "../../packem_shared/types.d-DCkecJse.js";
|
|
5
5
|
import "../../packem_shared/types.d-ejzh-xBP.js";
|
|
6
6
|
import 'node:buffer';
|
|
7
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"../../packem_shared/mockProvider-
|
|
1
|
+
import{default as e}from"../../packem_shared/mockProvider-Behywbl1.js";export{e as mockProvider};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { P as ProviderFactory } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
2
|
-
export {
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
3
3
|
import { c as EmailAddress, B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-ejzh-xBP.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as o}from"../../packem_shared/nodemailerProvider-
|
|
1
|
+
import{default as o}from"../../packem_shared/nodemailerProvider-BFHobXxt.js";export{o as nodemailerProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as o}from"../../packem_shared/opentelemetryProvider-
|
|
1
|
+
import{default as o}from"../../packem_shared/opentelemetryProvider-ByHC01ub.js";export{o as opentelemetryProvider};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { P as ProviderFactory } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
2
|
-
export {
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
3
3
|
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-ejzh-xBP.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as o}from"../../packem_shared/plunkProvider-
|
|
1
|
+
import{default as o}from"../../packem_shared/plunkProvider-C0LO-1E3.js";export{o as plunkProvider};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { P as ProviderFactory } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
2
|
-
export {
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
3
3
|
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-ejzh-xBP.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as a}from"../../packem_shared/postalProvider-
|
|
1
|
+
import{default as a}from"../../packem_shared/postalProvider-B26IqgxE.js";export{a as postalProvider};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { P as ProviderFactory } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
2
|
-
export {
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
3
3
|
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-ejzh-xBP.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as a}from"../../packem_shared/postmarkProvider-
|
|
1
|
+
import{default as a}from"../../packem_shared/postmarkProvider-DWQJv5_M.js";export{a as postmarkProvider};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { P as ProviderFactory } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
2
|
-
export {
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
3
3
|
import { B as BaseConfig, E as EmailOptions, d as EmailTag } from "../../packem_shared/types.d-ejzh-xBP.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as d}from"../../packem_shared/resendProvider-
|
|
1
|
+
import{default as d}from"../../packem_shared/resendProvider-DhvKVyCD.js";export{d as resendProvider};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { P as ProviderFactory } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
2
|
-
export {
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
3
3
|
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-ejzh-xBP.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as d}from"../../packem_shared/roundRobinProvider-
|
|
1
|
+
import{default as d}from"../../packem_shared/roundRobinProvider-D1by5KGW.js";export{d as roundRobinProvider};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { P as ProviderFactory } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
2
|
-
export {
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
3
3
|
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-ejzh-xBP.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as r}from"../../packem_shared/scalewayProvider-
|
|
1
|
+
import{default as r}from"../../packem_shared/scalewayProvider-D8dmHuwZ.js";export{r as scalewayProvider};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { P as ProviderFactory } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
2
|
-
export {
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
3
3
|
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-ejzh-xBP.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"../../packem_shared/sendGridProvider-
|
|
1
|
+
import{default as e}from"../../packem_shared/sendGridProvider-CChhLr7s.js";export{e as sendGridProvider};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { P as ProviderFactory } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
2
|
-
export {
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
3
3
|
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-ejzh-xBP.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as o}from"../../packem_shared/smtpProvider-
|
|
1
|
+
import{default as o}from"../../packem_shared/smtpProvider-x4WBN-3W.js";export{o as smtpProvider};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { P as ProviderFactory } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
2
|
-
export {
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
3
3
|
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-ejzh-xBP.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as r}from"../../packem_shared/sweegoProvider-
|
|
1
|
+
import{default as r}from"../../packem_shared/sweegoProvider-7xhOvagC.js";export{r as sweegoProvider};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { P as ProviderFactory } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
2
|
-
export {
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-J-y6iogK.js";
|
|
3
3
|
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-ejzh-xBP.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as r}from"../../packem_shared/zeptomailProvider-
|
|
1
|
+
import{default as r}from"../../packem_shared/zeptomailProvider-D3nQKXRf.js";export{r as zeptomailProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const s=async(a,t,e={},d="email")=>{let r;if(e.scheduledAt!==void 0){const o=e.scheduledAt instanceof Date?e.scheduledAt.getTime():e.scheduledAt;r=Math.max(0,o-Date.now())}return(await a.add(d,t,r===void 0?void 0:{delay:r})).id??""},c=a=>async t=>{const e=await a(t.data);if(!e.success||!e.data)throw e.error instanceof Error?e.error:new Error("Email send failed");return e.data};export{c as createBullmqProcessor,s as enqueueToBullmq};
|
package/dist/queue/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { E as EmailOptions, a as EmailResult, R as Result } from "../packem_shar
|
|
|
2
2
|
import { E as EnqueueOptions, Q as QueueJob, a as EmailQueue } from "../packem_shared/types.d-lcJZmwRK.js";
|
|
3
3
|
export { UnstorageQueue, type UnstorageQueueOptions, createUnstorageQueue } from "./unstorage-queue.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
|
-
import 'unstorage';
|
|
6
5
|
/**
|
|
7
6
|
* Options for {@link MemoryQueue}.
|
|
8
7
|
*/
|
package/dist/queue/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{MemoryQueue as o}from"../packem_shared/MemoryQueue-
|
|
1
|
+
import{MemoryQueue as o}from"../packem_shared/MemoryQueue-Dl1Fa6OJ.js";import{UnstorageQueue as u,createUnstorageQueue as a}from"./unstorage-queue.js";import{createWorker as f}from"../packem_shared/createWorker-_-yMWcNQ.js";export{o as MemoryQueue,u as UnstorageQueue,a as createUnstorageQueue,f as createWorker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
class u{boss;queueName;constructor(e,s){this.boss=e,this.queueName=s.queueName}async enqueue(e,s={}){const a=s.scheduledAt;return await this.boss.send(this.queueName,e,a===void 0?void 0:{startAfter:a})??""}async reserve(){const e=await this.boss.fetch(this.queueName,{batchSize:1,includeMetadata:!0});if(!e)return;const s=Array.isArray(e)?e[0]:e;if(s)return{attempts:s.retryCount??0,id:s.id,message:s.data,scheduledAt:0}}async ack(e){await this.boss.complete(this.queueName,e)}async retry(e){await this.boss.fail(this.queueName,e)}async size(){return this.boss.getQueueSize(this.queueName)}}const i=(t,e)=>new u(t,e);export{i as createPgBossQueue};
|
package/dist/queue/sqs-queue.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a="ApproximateNumberOfMessages",u="ApproximateNumberOfMessagesNotVisible",r=(i,e)=>{if(i===void 0)return 0;const t=i instanceof Date?i.getTime():i,s=Math.ceil((t-e)/1e3);return Math.max(0,s)};class n{client;queueUrl;visibilityTimeout;waitTimeSeconds;constructor(e,t){this.client=e,this.queueUrl=t.queueUrl,this.visibilityTimeout=t.visibilityTimeout??30,this.waitTimeSeconds=t.waitTimeSeconds??0}async enqueue(e,t={}){const s=r(t.scheduledAt,Date.now());if(s>900)throw new RangeError(`SQS supports a maximum scheduling delay of ${String(900)}s (15 minutes); use a scheduler for longer delays`);return(await this.client.sendMessage({DelaySeconds:s,MessageBody:JSON.stringify(e),QueueUrl:this.queueUrl})).MessageId??""}async reserve(){const e=(await this.client.receiveMessage({AttributeNames:["ApproximateReceiveCount"],MaxNumberOfMessages:1,QueueUrl:this.queueUrl,VisibilityTimeout:this.visibilityTimeout,WaitTimeSeconds:this.waitTimeSeconds})).Messages?.[0];if(!e?.ReceiptHandle)return;const t=Number(e.Attributes?.ApproximateReceiveCount??"1");let s;try{s=JSON.parse(e.Body??"{}")}catch{await this.client.deleteMessage({QueueUrl:this.queueUrl,ReceiptHandle:e.ReceiptHandle});return}return{attempts:Math.max(0,t-1),id:e.ReceiptHandle,message:s,scheduledAt:0}}async ack(e){await this.client.deleteMessage({QueueUrl:this.queueUrl,ReceiptHandle:e})}async retry(e,t=0){await this.client.changeMessageVisibility({QueueUrl:this.queueUrl,ReceiptHandle:e,VisibilityTimeout:Math.min(900,Math.max(0,Math.ceil(t/1e3)))})}async size(){const e=await this.client.getQueueAttributes({AttributeNames:[a,u],QueueUrl:this.queueUrl});return Number(e.Attributes?.[a]??0)+Number(e.Attributes?.[u]??0)}}const l=(i,e)=>new n(i,e);export{l as createSqsQueue};
|
|
@@ -1,7 +1,125 @@
|
|
|
1
|
-
import { Storage } from 'unstorage';
|
|
2
1
|
import { E as EmailOptions } from "../packem_shared/types.d-ejzh-xBP.js";
|
|
3
2
|
import { E as EnqueueOptions, Q as QueueJob, a as EmailQueue } from "../packem_shared/types.d-lcJZmwRK.js";
|
|
4
3
|
import 'node:buffer';
|
|
4
|
+
type StorageValue = null | string | number | boolean | object;
|
|
5
|
+
type WatchEvent = "update" | "remove";
|
|
6
|
+
type WatchCallback = (event: WatchEvent, key: string) => any;
|
|
7
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
8
|
+
type MaybeDefined<T> = T extends any ? T : any;
|
|
9
|
+
type Unwatch = () => MaybePromise<void>;
|
|
10
|
+
interface StorageMeta {
|
|
11
|
+
atime?: Date;
|
|
12
|
+
mtime?: Date;
|
|
13
|
+
ttl?: number;
|
|
14
|
+
[key: string]: StorageValue | Date | undefined;
|
|
15
|
+
}
|
|
16
|
+
type TransactionOptions = Record<string, any>;
|
|
17
|
+
type GetKeysOptions = TransactionOptions & {
|
|
18
|
+
maxDepth?: number;
|
|
19
|
+
};
|
|
20
|
+
interface DriverFlags {
|
|
21
|
+
maxDepth?: boolean;
|
|
22
|
+
ttl?: boolean;
|
|
23
|
+
}
|
|
24
|
+
interface Driver<OptionsT = any, InstanceT = any> {
|
|
25
|
+
name?: string;
|
|
26
|
+
flags?: DriverFlags;
|
|
27
|
+
options?: OptionsT;
|
|
28
|
+
getInstance?: () => InstanceT;
|
|
29
|
+
hasItem: (key: string, opts: TransactionOptions) => MaybePromise<boolean>;
|
|
30
|
+
getItem: (key: string, opts?: TransactionOptions) => MaybePromise<StorageValue>;
|
|
31
|
+
/** @experimental */
|
|
32
|
+
getItems?: (items: {
|
|
33
|
+
key: string;
|
|
34
|
+
options?: TransactionOptions;
|
|
35
|
+
}[], commonOptions?: TransactionOptions) => MaybePromise<{
|
|
36
|
+
key: string;
|
|
37
|
+
value: StorageValue;
|
|
38
|
+
}[]>;
|
|
39
|
+
/** @experimental */
|
|
40
|
+
getItemRaw?: (key: string, opts: TransactionOptions) => MaybePromise<unknown>;
|
|
41
|
+
setItem?: (key: string, value: string, opts: TransactionOptions) => MaybePromise<void>;
|
|
42
|
+
/** @experimental */
|
|
43
|
+
setItems?: (items: {
|
|
44
|
+
key: string;
|
|
45
|
+
value: string;
|
|
46
|
+
options?: TransactionOptions;
|
|
47
|
+
}[], commonOptions?: TransactionOptions) => MaybePromise<void>;
|
|
48
|
+
/** @experimental */
|
|
49
|
+
setItemRaw?: (key: string, value: any, opts: TransactionOptions) => MaybePromise<void>;
|
|
50
|
+
removeItem?: (key: string, opts: TransactionOptions) => MaybePromise<void>;
|
|
51
|
+
getMeta?: (key: string, opts: TransactionOptions) => MaybePromise<StorageMeta | null>;
|
|
52
|
+
getKeys: (base: string, opts: GetKeysOptions) => MaybePromise<string[]>;
|
|
53
|
+
clear?: (base: string, opts: TransactionOptions) => MaybePromise<void>;
|
|
54
|
+
dispose?: () => MaybePromise<void>;
|
|
55
|
+
watch?: (callback: WatchCallback) => MaybePromise<Unwatch>;
|
|
56
|
+
}
|
|
57
|
+
type StorageDefinition = {
|
|
58
|
+
items: unknown;
|
|
59
|
+
[key: string]: unknown;
|
|
60
|
+
};
|
|
61
|
+
type StorageItemMap<T> = T extends StorageDefinition ? T["items"] : T;
|
|
62
|
+
type StorageItemType<T, K> = K extends keyof StorageItemMap<T> ? StorageItemMap<T>[K] : T extends StorageDefinition ? StorageValue : T;
|
|
63
|
+
interface Storage<T extends StorageValue = StorageValue> {
|
|
64
|
+
hasItem<U extends Extract<T, StorageDefinition>, K extends keyof StorageItemMap<U>>(key: K, opts?: TransactionOptions): Promise<boolean>;
|
|
65
|
+
hasItem(key: string, opts?: TransactionOptions): Promise<boolean>;
|
|
66
|
+
getItem<U extends Extract<T, StorageDefinition>, K extends string & keyof StorageItemMap<U>>(key: K, ops?: TransactionOptions): Promise<StorageItemType<T, K> | null>;
|
|
67
|
+
getItem<R = StorageItemType<T, string>>(key: string, opts?: TransactionOptions): Promise<R | null>;
|
|
68
|
+
/** @experimental */
|
|
69
|
+
getItems: <U extends T>(items: (string | {
|
|
70
|
+
key: string;
|
|
71
|
+
options?: TransactionOptions;
|
|
72
|
+
})[], commonOptions?: TransactionOptions) => Promise<{
|
|
73
|
+
key: string;
|
|
74
|
+
value: U;
|
|
75
|
+
}[]>;
|
|
76
|
+
/** @experimental See https://github.com/unjs/unstorage/issues/142 */
|
|
77
|
+
getItemRaw: <T = any>(key: string, opts?: TransactionOptions) => Promise<MaybeDefined<T> | null>;
|
|
78
|
+
setItem<U extends Extract<T, StorageDefinition>, K extends keyof StorageItemMap<U>>(key: K, value: StorageItemType<T, K>, opts?: TransactionOptions): Promise<void>;
|
|
79
|
+
setItem<U extends T>(key: string, value: U, opts?: TransactionOptions): Promise<void>;
|
|
80
|
+
/** @experimental */
|
|
81
|
+
setItems: <U extends T>(items: {
|
|
82
|
+
key: string;
|
|
83
|
+
value: U;
|
|
84
|
+
options?: TransactionOptions;
|
|
85
|
+
}[], commonOptions?: TransactionOptions) => Promise<void>;
|
|
86
|
+
/** @experimental See https://github.com/unjs/unstorage/issues/142 */
|
|
87
|
+
setItemRaw: <T = any>(key: string, value: MaybeDefined<T>, opts?: TransactionOptions) => Promise<void>;
|
|
88
|
+
removeItem<U extends Extract<T, StorageDefinition>, K extends keyof StorageItemMap<U>>(key: K, opts?: (TransactionOptions & {
|
|
89
|
+
removeMeta?: boolean;
|
|
90
|
+
}) | boolean): Promise<void>;
|
|
91
|
+
removeItem(key: string, opts?: (TransactionOptions & {
|
|
92
|
+
removeMeta?: boolean;
|
|
93
|
+
}) | boolean): Promise<void>;
|
|
94
|
+
getMeta: (key: string, opts?: (TransactionOptions & {
|
|
95
|
+
nativeOnly?: boolean;
|
|
96
|
+
}) | boolean) => MaybePromise<StorageMeta>;
|
|
97
|
+
setMeta: (key: string, value: StorageMeta, opts?: TransactionOptions) => Promise<void>;
|
|
98
|
+
removeMeta: (key: string, opts?: TransactionOptions) => Promise<void>;
|
|
99
|
+
getKeys: (base?: string, opts?: GetKeysOptions) => Promise<string[]>;
|
|
100
|
+
clear: (base?: string, opts?: TransactionOptions) => Promise<void>;
|
|
101
|
+
dispose: () => Promise<void>;
|
|
102
|
+
watch: (callback: WatchCallback) => Promise<Unwatch>;
|
|
103
|
+
unwatch: () => Promise<void>;
|
|
104
|
+
mount: (base: string, driver: Driver) => Storage;
|
|
105
|
+
unmount: (base: string, dispose?: boolean) => Promise<void>;
|
|
106
|
+
getMount: (key?: string) => {
|
|
107
|
+
base: string;
|
|
108
|
+
driver: Driver;
|
|
109
|
+
};
|
|
110
|
+
getMounts: (base?: string, options?: {
|
|
111
|
+
parents?: boolean;
|
|
112
|
+
}) => {
|
|
113
|
+
base: string;
|
|
114
|
+
driver: Driver;
|
|
115
|
+
}[];
|
|
116
|
+
keys: Storage["getKeys"];
|
|
117
|
+
get: Storage<T>["getItem"];
|
|
118
|
+
set: Storage<T>["setItem"];
|
|
119
|
+
has: Storage<T>["hasItem"];
|
|
120
|
+
del: Storage<T>["removeItem"];
|
|
121
|
+
remove: Storage<T>["removeItem"];
|
|
122
|
+
}
|
|
5
123
|
/**
|
|
6
124
|
* Options for {@link UnstorageQueue}.
|
|
7
125
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{createRequire as n}from"node:module";const c=n(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=r=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[e,s]=o.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return o.getBuiltinModule(r)}return c(r)},{randomUUID:d}=u("node:crypto");class h{storage;prefix;visibilityTimeout;now;constructor(e,s={}){this.storage=e,this.prefix=s.prefix??"email:queue",this.visibilityTimeout=s.visibilityTimeout??3e4,this.now=s.now??Date.now}async enqueue(e,s={}){const i=d(),t=s.scheduledAt instanceof Date?s.scheduledAt.getTime():s.scheduledAt??this.now(),a={attempts:0,id:i,message:e,reservedUntil:0,scheduledAt:t};return await this.storage.setItem(this.keyOf(i),a),i}async reserve(){const e=this.now(),s=await this.storage.getKeys(this.prefix);for(const i of s){const t=await this.storage.getItem(i);if(t&&t.scheduledAt<=e&&t.reservedUntil<=e)return t.reservedUntil=e+this.visibilityTimeout,await this.storage.setItem(i,t),{attempts:t.attempts,id:t.id,message:t.message,scheduledAt:t.scheduledAt}}}async ack(e){await this.storage.removeItem(this.keyOf(e))}async retry(e,s=0){const i=this.keyOf(e),t=await this.storage.getItem(i);t&&(t.attempts+=1,t.reservedUntil=0,t.scheduledAt=this.now()+s,await this.storage.setItem(i,t))}async size(){return(await this.storage.getKeys(this.prefix)).length}keyOf(e){return`${this.prefix}:${e}`}}const m=(r,e)=>new h(r,e);export{h as UnstorageQueue,m as createUnstorageQueue};
|
package/dist/render/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{extractCidReferences as o,rewriteCidLinks as t}from"../packem_shared/
|
|
1
|
+
import{extractCidReferences as o,rewriteCidLinks as t}from"../packem_shared/extractCidReferences-BuoTREMp.js";import{default as s}from"../packem_shared/inlineCss-BQ7d2Cyz.js";import{addDarkModeSupport as f}from"../packem_shared/addDarkModeSupport-DZYxULjl.js";import{postProcessHtml as a}from"../packem_shared/postProcessHtml-DqKi2Ucg.js";import{injectPreheader as x}from"../packem_shared/injectPreheader-CF9WHZ7J.js";export{f as addDarkModeSupport,o as extractCidReferences,x as injectPreheader,s as inlineCss,a as postProcessHtml,t as rewriteCidLinks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import t from"handlebars";import s from"../packem_shared/EmailError-B-sEf3bp.js";const i=(a,r,e)=>{try{if(typeof a!="string")throw new TypeError("Handlebars template must be a string");return t.compile(a,e)(r??{})}catch(n){throw n instanceof Error&&n.message.includes("Cannot find module")?new s("handlebars","Handlebars is not installed. Please install it: pnpm add handlebars",{cause:n}):new s("handlebars",`Failed to render Handlebars template: ${n.message}`,{cause:n})}},o=(a,r)=>{try{t.registerHelper(a,r)}catch(e){throw e instanceof Error&&e.message.includes("Cannot find module")?new s("handlebars","Handlebars is not installed. Please install it: pnpm add handlebars",{cause:e}):e}},c=(a,r)=>{try{t.registerPartial(a,r)}catch(e){throw e instanceof Error&&e.message.includes("Cannot find module")?new s("handlebars","Handlebars is not installed. Please install it: pnpm add handlebars",{cause:e}):e}};export{o as registerHandlebarsHelper,c as registerHandlebarsPartial,i as renderHandlebars};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{convert as s}from"html-to-text";import o from"../packem_shared/EmailError-B-sEf3bp.js";const a=(r,e)=>{try{return s(r,{longWordSplit:e?.longWordSplit,preserveNewlines:e?.preserveNewlines??!1,selectors:e?.selectors,wordwrap:e?.wordwrap??80})}catch(t){throw t instanceof Error&&t.message.includes("Cannot find module")?new o("html-to-text","html-to-text is not installed. Please install it: pnpm add html-to-text",{cause:t}):new o("html-to-text",`Failed to convert HTML to text: ${t.message}`,{cause:t})}};export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import l from"../packem_shared/EmailError-B-sEf3bp.js";const c=(t,r,a)=>{const n=new Map(Object.keys(t).map(o=>[o.toLowerCase(),o])),e=o=>{if(o!==void 0)return n.get(o.toLowerCase())};return e(r)??e(r.split("-")[0])??e(a)},d=async(t,r,a,n,e)=>{const o=c(t,r,e?.defaultLocale);if(o===void 0)throw new l("i18n",`No template found for locale "${r}"${e?.defaultLocale?` or default "${e.defaultLocale}"`:""}`);return await a(t[o],n,e?.rendererOptions)},f=(t,r)=>(a,n,e,o)=>d(a,n,t,e,{defaultLocale:r,rendererOptions:o});export{f as createI18nRenderer,d as renderI18n,c as resolveLocale};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import t from"../packem_shared/EmailError-B-sEf3bp.js";const l=async(n,s,a)=>{try{const{render:e}=await import("jsx-email");return await e(n,{plainText:a?.plainText,pretty:a?.pretty})}catch(e){throw e instanceof Error&&(e.code==="ERR_MODULE_NOT_FOUND"||e.message.includes("Cannot find module")||e.message.includes("Cannot find package"))?new t("jsx-email","jsx-email is not installed. Please install it: pnpm add jsx-email",{cause:e}):new t("jsx-email",`Failed to render jsx-email component: ${e.message}`,{cause:e})}};export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import t from"../packem_shared/EmailError-B-sEf3bp.js";const r=async(i,a,n)=>{try{if(typeof i!="string")throw new TypeError("Liquid template must be a string");const{Liquid:e}=await import("liquidjs");return await new e(n??{}).parseAndRender(i,a??{})}catch(e){throw e instanceof TypeError?e:e instanceof Error&&(e.code==="ERR_MODULE_NOT_FOUND"||e.message.includes("Cannot find module")||e.message.includes("Cannot find package"))?new t("liquid","liquidjs is not installed. Please install it: pnpm add liquidjs",{cause:e}):new t("liquid",`Failed to render Liquid template: ${e.message}`,{cause:e})}};export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import r from"mjml";import n from"../packem_shared/EmailError-B-sEf3bp.js";const f=(s,i,t)=>{try{if(typeof s!="string")throw new TypeError("MJML template must be a string");const e=r(s,{beautify:t?.beautify??!1,fonts:t?.fonts,keepComments:t?.keepComments??!0,minify:t?.minify??!1,validationLevel:t?.validationLevel??"soft"});if(e.errors&&e.errors.length>0){const o=e.errors.map(a=>a.message).join("; ");throw new n("mjml",`MJML validation errors: ${o}`)}return e.html}catch(e){throw e instanceof Error&&e.message.includes("Cannot find module")?new n("mjml","MJML is not installed. Please install it: pnpm add mjml",{cause:e}):e instanceof n?e:new n("mjml",`Failed to render MJML: ${e.message}`,{cause:e})}};export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{render as n}from"@react-email/render";import a from"../packem_shared/EmailError-B-sEf3bp.js";const s=async(r,i,t)=>{try{return await n(r,{plainText:t?.plainText,pretty:t?.pretty})}catch(e){throw e instanceof Error&&e.message.includes("Cannot find module")?new a("react-email","@react-email/render is not installed. Please install it: pnpm add @react-email/render",{cause:e}):new a("react-email",`Failed to render React Email component: ${e.message}`,{cause:e})}};export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{render as i}from"@vue-email/render";import a from"../packem_shared/EmailError-B-sEf3bp.js";const s=async(n,r,t)=>{try{return await i(n,r??{},{htmlToTextOptions:t?.htmlToTextOptions,plainText:t?.plainText,pretty:t?.pretty})}catch(e){throw e instanceof Error&&e.message.includes("Cannot find module")?new a("vue-email","@vue-email/render is not installed. Please install it: pnpm add @vue-email/render",{cause:e}):new a("vue-email",`Failed to render Vue Email component: ${e.message}`,{cause:e})}};export{s as default};
|
package/dist/test/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as MockEmailEntry } from "../packem_shared/types.d-
|
|
1
|
+
import { a as MockEmailEntry } from "../packem_shared/types.d-DCkecJse.js";
|
|
2
2
|
import { E as EmailOptions } from "../packem_shared/types.d-ejzh-xBP.js";
|
|
3
|
-
import { M as Mail } from "../packem_shared/mail.d-
|
|
3
|
+
import { M as Mail } from "../packem_shared/mail.d-B9SSqyy0.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
import 'ical-generator';
|
|
6
6
|
import 'node:crypto';
|
package/dist/test/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{emailMatchers as a,registerEmailMatchers as o,toHaveSentMatching as r,toHaveSentTo as i,toHaveSentWithAttachment as m,toHaveSentWithSubject as h}from"../packem_shared/emailMatchers-
|
|
1
|
+
import{emailMatchers as a,registerEmailMatchers as o,toHaveSentMatching as r,toHaveSentTo as i,toHaveSentWithAttachment as m,toHaveSentWithSubject as h}from"../packem_shared/emailMatchers-DZDkrZ_3.js";import{toEmailSnapshot as c}from"../packem_shared/toEmailSnapshot-DeRqM5SJ.js";import{createTestEmail as s}from"../packem_shared/createTestEmail-BM3iNznm.js";export{s as createTestEmail,a as emailMatchers,o as registerEmailMatchers,c as toEmailSnapshot,r as toHaveSentMatching,i as toHaveSentTo,m as toHaveSentWithAttachment,h as toHaveSentWithSubject};
|
package/dist/utils/cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{LRUCache as a}from"lru-cache";class l{cache;constructor(c={}){const{max:e=500,ttl:t=36e5}=c;this.cache=new a({max:e,ttl:t})}clear=async()=>{this.cache.clear()};delete=async c=>{this.cache.delete(c)};get=async c=>this.cache.get(c);set=async(c,e,t)=>{this.cache.set(c,e,{ttl:t})}}export{l as InMemoryCache};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{s as m}from"../packem_shared/format-address-DTl-9O70.js";import r from"../packem_shared/EmailError-B-sEf3bp.js";import i from"./validation/validate-email.js";const n=a=>{if(!i(a.email))throw new r("email",`Invalid email address: ${a.email}`);if(a.name){const e=m(a.name);if(e)return`"${e}" <${a.email}>`}return a.email};export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const l=new Map([["fastmail.com",{domain:"fastmail.com",ignoreDots:!1,ignorePlus:!0}],["gmail.com",{domain:"gmail.com",ignoreDots:!0,ignorePlus:!0}],["gmx.com",{domain:"gmx.com",ignoreDots:!1,ignorePlus:!0}],["gmx.de",{domain:"gmx.de",ignoreDots:!1,ignorePlus:!0}],["gmx.net",{domain:"gmx.net",ignoreDots:!1,ignorePlus:!0}],["hotmail.com",{domain:"hotmail.com",ignoreDots:!1,ignorePlus:!0}],["icloud.com",{domain:"icloud.com",ignoreDots:!1,ignorePlus:!0}],["live.com",{domain:"live.com",ignoreDots:!1,ignorePlus:!0}],["mail.com",{domain:"mail.com",ignoreDots:!1,ignorePlus:!0}],["msn.com",{domain:"msn.com",ignoreDots:!1,ignorePlus:!0}],["outlook.com",{domain:"outlook.com",ignoreDots:!1,ignorePlus:!0}],["protonmail.com",{domain:"protonmail.com",ignoreDots:!1,ignorePlus:!0}],["yahoo.com",{domain:"yahoo.com",ignoreDots:!1,ignorePlus:!0}],["zoho.com",{domain:"zoho.com",ignoreDots:!1,ignorePlus:!0}]]),a=o=>{if(!o||typeof o!="string")return o;const i=o.trim().toLowerCase(),n=i.indexOf("@");if(n===-1||n===0||n===i.length-1)return o;const s=i.slice(0,n),r=i.slice(n+1);if(!s||!r)return o;const t=l.get(r);if(!t)return i;let e=s;if(t.ignorePlus){const m=e.indexOf("+");m!==-1&&(e=e.slice(0,m))}return t.ignoreDots&&(e=e.replaceAll(".","")),`${e}@${r}`};export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import u from"./validation/validate-email.js";const d=i=>{const e=i.replace(/^"(.+)"$/,"$1");return!(!e||e.length===0||e.includes("..")||e.startsWith(".")||e.endsWith("."))},c=i=>{const e=i.indexOf("@[");if(e>0&&i.endsWith("]")){const n=i.length-1,l=i.slice(e+2,n);if(l.includes("@["))return!1;const t=i.slice(0,e),s=l;return!s||s.trim().length===0||s.includes("]")?!1:t?d(t):!1}if(i.includes("@[")&&!i.includes("]"))return!1;const r=i.match(/^"((?:[^"\\]|\\.)+)"@(.+)$/);if(r?.[2]){const n=r[2];return n.startsWith("[")?!1:u(`test@${n}`)}return u(i)},h=i=>{if(!i||typeof i!="string")return;const e=i.trim();if(!e)return;const r=e.lastIndexOf("<"),n=e.lastIndexOf(">");if(r!==-1&&n>r){const t=e.slice(0,r).trim(),s=e.slice(r+1,n).trim();if(s&&c(s)){if(t){const f=t.replace(/^"(.+)"$/,"$1");return{email:s,name:f}}return{email:s}}}const l=e.match(/^<([^>]+)>$/);if(l?.[1]){const t=l[1].trim();return c(t)?{email:t}:void 0}if(!(e.includes("]")&&!e.includes("@["))&&!(e.includes('"')&&!e.startsWith('"')&&e.indexOf('"')<e.indexOf("@"))){if(e.startsWith('"')){let t=1,s=!1;for(;t<e.length;)if(e[t]==="\\"&&t+1<e.length)t+=2;else if(e[t]==='"'){if(t+1<e.length&&e[t+1]==="@"){s=!0;break}t+=1}else t+=1;if(!s&&e.includes("@")){const f=e.indexOf("@"),a=e.slice(1).indexOf('"');if(a===-1||f<a+1)return}}if(c(e))return{email:e}}};export{h as default};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { E as EmailOptions } from "../packem_shared/types.d-ejzh-xBP.js";
|
|
2
|
+
import 'node:buffer';
|
|
3
|
+
/**
|
|
4
|
+
* Parses a raw EML / RFC 5322 MIME message back into {@link EmailOptions}.
|
|
5
|
+
*
|
|
6
|
+
* This closes the round-trip story for {@link "../mail".Mail.draft}: serialise a
|
|
7
|
+
* message to EML, persist/transmit it, then `parseEml()` it back into options you
|
|
8
|
+
* can hand to `mail.send()`. It understands the multipart layout produced by this
|
|
9
|
+
* library's own `buildMimeMessage` (text/plain + text/html parts, quoted-printable
|
|
10
|
+
* and base64 transfer encodings, RFC 2047 encoded headers) and common
|
|
11
|
+
* single-part messages.
|
|
12
|
+
*
|
|
13
|
+
* Scope: it extracts `from`, `to`, `cc`, `bcc`, `replyTo`, `subject`, `text`,
|
|
14
|
+
* `html`, `priority`, and remaining custom `headers`. Attachment bodies are not
|
|
15
|
+
* decoded into {@link "../types".Attachment} objects (use a full MIME parser such
|
|
16
|
+
* as `mailparser` for that); attachment parts are skipped.
|
|
17
|
+
* @param eml The raw EML/MIME message string.
|
|
18
|
+
* @returns The parsed email options.
|
|
19
|
+
* @throws {Error} When the message has no `From` or `To`/`Cc`/`Bcc` recipient and therefore cannot satisfy the required {@link EmailOptions} shape.
|
|
20
|
+
*/
|
|
21
|
+
declare const parseEml: (eml: string) => EmailOptions;
|
|
22
|
+
export { parseEml as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import y from"./parse-address.js";import{p as $}from"../packem_shared/quoted-printable-nSGDA1tA.js";const T=globalThis.Buffer!==void 0,k=r=>{if(T)return Uint8Array.from(Buffer.from(r,"base64"));const t=atob(r),n=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)n[e]=t.charCodeAt(e);return n},E=r=>{const t=r.replaceAll("_"," "),n=[];for(let e=0;e<t.length;e+=1){const s=t[e];s==="="&&e+2<t.length?(n.push(Number.parseInt(t.slice(e+1,e+3),16)),e+=2):n.push(s.charCodeAt(0))}return Uint8Array.from(n)},U=/^utf-?8$/i,j=(r,t)=>{if(T&&U.test(t))return Buffer.from(r).toString("utf8");try{return new TextDecoder(t).decode(r)}catch{return new TextDecoder().decode(r)}},D=/=\?([^?]+)\?([bq])\?([^?]*)\?=/gi,M=r=>r.includes("=?")?r.replaceAll(/(\?=)\s+(=\?)/g,"$1$2").replaceAll(D,(t,n,e,s)=>{const o=e.toUpperCase()==="B"?k(s):E(s);return j(o,n)}):r,O=globalThis.Buffer!==void 0,S=/^[ \t]/,q=/boundary=(?:"([^"]+)"|([^";]+))/i,H=/^\r?\n/,L=/[\r\n]+$/,I=/\r?\n$/,N=/\s/g,P=/high|^1|^2/i,_=/low|^4|^5/i,B=r=>{const t=r.replaceAll(`\r
|
|
2
|
+
`,`
|
|
3
|
+
`),n=t.indexOf(`
|
|
4
|
+
|
|
5
|
+
`),e=n===-1?t:t.slice(0,n),s=n===-1?"":t.slice(n+2),o=[],f=new Map;let i="",c="";const h=()=>{if(i){const a=M(c.trim());o.push([i,a]),f.set(i.toLowerCase(),a)}};for(const a of e.split(`
|
|
6
|
+
`))if(S.test(a)&&i)c+=` ${a.trim()}`;else{h();const d=a.indexOf(":");d===-1?(i="",c=""):(i=a.slice(0,d).trim(),c=a.slice(d+1).trim())}return h(),{body:s,headers:{map:f,raw:o}}},b=r=>{if(!r)return[];const t=[];let n="",e=!1,s=!1;for(const o of r){switch(o){case'"':{e=!e;break}case"<":{s=!0;break}case">":{s=!1;break}}o===","&&!e&&!s?(t.push(n),n=""):n+=o}return n.trim()&&t.push(n),t.map(o=>y(o.trim())).filter(o=>o!==void 0)},F=r=>{if(!r)return;const t=q.exec(r);return t?.[1]??t?.[2]},w=(r,t)=>{const n=(t??"7bit").trim().toLowerCase();if(n==="quoted-printable")return $(r);if(n==="base64"){const e=r.replaceAll(N,"");return O?Buffer.from(e,"base64").toString("utf8"):new TextDecoder().decode(Uint8Array.from(atob(e),s=>s.codePointAt(0)))}return r},V=r=>{const{body:t,headers:n}=B(r),{map:e}=n,s=y(e.get("from")??"");if(!s)throw new Error("Cannot parse EML: missing or invalid `From` header");const o=b(e.get("to")??""),f=b(e.get("cc")??""),i=b(e.get("bcc")??"");if(o.length===0&&f.length===0&&i.length===0)throw new Error("Cannot parse EML: no recipient (`To`/`Cc`/`Bcc`) found");const c={from:s,subject:e.get("subject")??"",to:o.length===1?o[0]:o};f.length>0&&(c.cc=f.length===1?f[0]:f),i.length>0&&(c.bcc=i.length===1?i[0]:i);const h=e.get("reply-to")?y(e.get("reply-to")):void 0;h&&(c.replyTo=h);const a=e.get("content-type"),d=F(a);if(d&&a?.toLowerCase().includes("multipart")){const u=t.split(`--${d}`);for(const l of u){const p=l.replace(H,"");if(!(!p||p.startsWith("--"))){const{body:C,headers:g}=B(p),x=g.map.get("content-type")??"",A=g.map.get("content-transfer-encoding");(g.map.get("content-disposition")??"").toLowerCase().includes("attachment")||(x.toLowerCase().includes("text/plain")?c.text=w(C.replace(L,""),A):x.toLowerCase().includes("text/html")&&(c.html=w(C.replace(L,""),A)))}}}else{const u=e.get("content-transfer-encoding"),l=w(t.replace(I,""),u);a?.toLowerCase().includes("text/html")?c.html=l:l&&(c.text=l)}const v=new Set(["bcc","cc","content-transfer-encoding","content-type","from","mime-version","reply-to","subject","to"]),m={};for(const[u,l]of n.raw){const p=u.toLowerCase();(p==="x-priority"||p==="importance")&&(P.test(l)?c.priority="high":_.test(l)&&(c.priority="low")),v.has(p)||(m[u]=l)}return Object.keys(m).length>0&&(c.headers=m),c};export{V as default};
|
package/dist/utils/result.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import e from"../packem_shared/EmailError-B-sEf3bp.js";const c=s=>s.success,t=s=>!s.success,u=s=>{if(s.success)return s.data;throw s.error instanceof Error?s.error:new e("result","Called unwrap() on a failed result",{cause:s.error})},o=(s,r)=>s.success?s.data:r,n=(s,r)=>s.success?{data:r(s.data),success:!0}:{error:s.error,success:!1},d=async s=>{try{return{data:await s(),success:!0}}catch(r){return{error:r,success:!1}}};export{t as isErr,c as isOk,n as mapOk,d as tryAsync,u as unwrap,o as unwrapOr};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{s as o}from"../../packem_shared/headers-to-record-De1Eg951.js";const r=e=>Array.isArray(e)&&e.length>0,d=(e,s)=>s.find(t=>e[t]!==void 0),i=[{detect:e=>r(e.attachments)?"attachments":void 0,feature:"attachments",label:"attachments"},{detect:e=>typeof e.html=="string"&&e.html.length>0?"html":void 0,feature:"html",label:"HTML content"},{detect:e=>e.replyTo?"replyTo":void 0,feature:"replyTo",label:"a reply-to address"},{detect:e=>e.headers!==void 0&&Object.keys(o(e.headers)).length>0?"headers":void 0,feature:"customHeaders",label:"custom headers"},{detect:e=>r(e.tags)?"tags":void 0,feature:"tagging",label:"tags"},{detect:e=>d(e,["scheduledAt","sendAt"]),feature:"scheduling",label:"scheduled delivery"},{detect:e=>d(e,["templateId","template"]),feature:"templates",label:"provider templates"}];function u(e,s){if(!s)return{supported:!0,violations:[]};const t=[];for(const a of i){if(s[a.feature]!==!1)continue;const l=a.detect(e);l!==void 0&&t.push({feature:a.feature,field:l,message:`Message uses ${a.label} (field "${l}") but the provider does not support the "${a.feature}" capability`})}return{supported:t.length===0,violations:t}}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{createRequire as a}from"node:module";const d=a(import.meta.url),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=o=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[e,s]=c.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return c.getBuiltinModule(o)}return d(o)},{resolveMx:p}=l("node:dns/promises"),h=async(o,e={})=>{const s=e.ttl??36e5;if(e.cache){const r=await e.cache.get(o);if(r!==void 0)return r}try{const r=(await p(o)).map(i=>({exchange:i.exchange,priority:i.priority})),t={records:r.toSorted((i,n)=>i.priority-n.priority),valid:r.length>0};return e.cache&&await e.cache.set(o,t,s),t}catch(r){const t={error:r instanceof Error?r.message:String(r),valid:!1};return e.cache&&await e.cache.set(o,t,s),t}};export{h as checkMxRecords};
|