@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
package/dist/types.d.ts
DELETED
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import type { Buffer } from "node:buffer";
|
|
2
|
-
/**
|
|
3
|
-
* Utility type for values that can be promises
|
|
4
|
-
*/
|
|
5
|
-
export type MaybePromise<T> = T | Promise<T>;
|
|
6
|
-
/**
|
|
7
|
-
* Feature flags indicating what capabilities a provider supports
|
|
8
|
-
*/
|
|
9
|
-
export interface FeatureFlags {
|
|
10
|
-
attachments?: boolean;
|
|
11
|
-
batchSending?: boolean;
|
|
12
|
-
customHeaders?: boolean;
|
|
13
|
-
html?: boolean;
|
|
14
|
-
replyTo?: boolean;
|
|
15
|
-
scheduling?: boolean;
|
|
16
|
-
tagging?: boolean;
|
|
17
|
-
templates?: boolean;
|
|
18
|
-
tracking?: boolean;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Base configuration for all providers
|
|
22
|
-
*/
|
|
23
|
-
export interface BaseConfig {
|
|
24
|
-
debug?: boolean;
|
|
25
|
-
logger?: Console;
|
|
26
|
-
retries?: number;
|
|
27
|
-
timeout?: number;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Email address with optional name
|
|
31
|
-
*/
|
|
32
|
-
export interface EmailAddress {
|
|
33
|
-
email: string;
|
|
34
|
-
name?: string;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Email attachment
|
|
38
|
-
*/
|
|
39
|
-
export interface Attachment {
|
|
40
|
-
/**
|
|
41
|
-
* Content-ID for inline attachments (used in HTML with cid:)
|
|
42
|
-
*/
|
|
43
|
-
cid?: string;
|
|
44
|
-
/**
|
|
45
|
-
* Attachment content (string, Buffer, or Promise<Uint8Array> for async loading)
|
|
46
|
-
* Required if path, href, or raw are not provided
|
|
47
|
-
*/
|
|
48
|
-
content?: string | Buffer | Promise<Uint8Array>;
|
|
49
|
-
/**
|
|
50
|
-
* Content disposition: 'attachment' (default) or 'inline'
|
|
51
|
-
*/
|
|
52
|
-
contentDisposition?: "attachment" | "inline";
|
|
53
|
-
/**
|
|
54
|
-
* MIME type of the attachment
|
|
55
|
-
*/
|
|
56
|
-
contentType?: string;
|
|
57
|
-
/**
|
|
58
|
-
* Content transfer encoding (e.g., 'base64', '7bit', 'quoted-printable')
|
|
59
|
-
*/
|
|
60
|
-
encoding?: string;
|
|
61
|
-
/**
|
|
62
|
-
* Filename for the attachment
|
|
63
|
-
*/
|
|
64
|
-
filename: string;
|
|
65
|
-
/**
|
|
66
|
-
* Custom headers for this attachment
|
|
67
|
-
*/
|
|
68
|
-
headers?: Record<string, string>;
|
|
69
|
-
/**
|
|
70
|
-
* URL to fetch attachment from
|
|
71
|
-
* Alternative to content or path
|
|
72
|
-
*/
|
|
73
|
-
href?: string;
|
|
74
|
-
/**
|
|
75
|
-
* HTTP headers to use when fetching from href
|
|
76
|
-
*/
|
|
77
|
-
httpHeaders?: Record<string, string>;
|
|
78
|
-
/**
|
|
79
|
-
* File path to read attachment from
|
|
80
|
-
* Alternative to content
|
|
81
|
-
*/
|
|
82
|
-
path?: string;
|
|
83
|
-
/**
|
|
84
|
-
* Raw attachment data (alternative to content)
|
|
85
|
-
* Can be used for pre-encoded content
|
|
86
|
-
*/
|
|
87
|
-
raw?: string | Buffer;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Email tag for categorization
|
|
91
|
-
*/
|
|
92
|
-
export interface EmailTag {
|
|
93
|
-
name: string;
|
|
94
|
-
value: string;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Priority levels for email messages
|
|
98
|
-
*/
|
|
99
|
-
export type Priority = "high" | "normal" | "low";
|
|
100
|
-
/**
|
|
101
|
-
* Represents the headers of an email message.
|
|
102
|
-
* This type is a supertype of the standard `Headers` class, which is used to manage HTTP headers.
|
|
103
|
-
* Note that this type does not include methods for modifying the headers,
|
|
104
|
-
* such as `append`, `delete`, or `set`. It is intended to be used for
|
|
105
|
-
* read-only access to the headers of an email message.
|
|
106
|
-
*/
|
|
107
|
-
export type ImmutableHeaders = Omit<Headers, "append" | "delete" | "set">;
|
|
108
|
-
/**
|
|
109
|
-
* Email headers can be either a plain object or an ImmutableHeaders instance
|
|
110
|
-
*/
|
|
111
|
-
export type EmailHeaders = Record<string, string> | ImmutableHeaders;
|
|
112
|
-
/**
|
|
113
|
-
* Options for calendar event attachments
|
|
114
|
-
*/
|
|
115
|
-
export interface CalendarEventOptions {
|
|
116
|
-
/**
|
|
117
|
-
* Alternative text for the calendar event
|
|
118
|
-
*/
|
|
119
|
-
alternativeText?: string;
|
|
120
|
-
/**
|
|
121
|
-
* Method for the calendar event (e.g., 'REQUEST', 'CANCEL', 'REPLY')
|
|
122
|
-
*/
|
|
123
|
-
method?: string;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Common email options that all providers support
|
|
127
|
-
*/
|
|
128
|
-
export interface EmailOptions {
|
|
129
|
-
attachments?: Attachment[];
|
|
130
|
-
bcc?: EmailAddress | EmailAddress[];
|
|
131
|
-
cc?: EmailAddress | EmailAddress[];
|
|
132
|
-
from: EmailAddress;
|
|
133
|
-
headers?: EmailHeaders;
|
|
134
|
-
html?: string;
|
|
135
|
-
icalEvent?: CalendarEventOptions & {
|
|
136
|
-
content?: string;
|
|
137
|
-
href?: string;
|
|
138
|
-
path?: string;
|
|
139
|
-
};
|
|
140
|
-
priority?: Priority;
|
|
141
|
-
replyTo?: EmailAddress;
|
|
142
|
-
subject: string;
|
|
143
|
-
tags?: string[];
|
|
144
|
-
text?: string;
|
|
145
|
-
to: EmailAddress | EmailAddress[];
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Result of sending an email
|
|
149
|
-
*/
|
|
150
|
-
export interface EmailResult {
|
|
151
|
-
messageId: string;
|
|
152
|
-
provider?: string;
|
|
153
|
-
response?: unknown;
|
|
154
|
-
sent: boolean;
|
|
155
|
-
timestamp: Date;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Receipt type for email sending results
|
|
159
|
-
* Uses discriminated union for type safety
|
|
160
|
-
*/
|
|
161
|
-
export type Receipt = {
|
|
162
|
-
/**
|
|
163
|
-
* The unique identifier for the message that was sent
|
|
164
|
-
*/
|
|
165
|
-
readonly messageId: string;
|
|
166
|
-
/**
|
|
167
|
-
* Optional provider name
|
|
168
|
-
*/
|
|
169
|
-
readonly provider?: string;
|
|
170
|
-
/**
|
|
171
|
-
* Optional response data from provider
|
|
172
|
-
*/
|
|
173
|
-
readonly response?: unknown;
|
|
174
|
-
/**
|
|
175
|
-
* Indicates that the email was sent successfully
|
|
176
|
-
*/
|
|
177
|
-
readonly successful: true;
|
|
178
|
-
/**
|
|
179
|
-
* Timestamp when email was sent
|
|
180
|
-
*/
|
|
181
|
-
readonly timestamp: Date;
|
|
182
|
-
} | {
|
|
183
|
-
/**
|
|
184
|
-
* An array of error messages that occurred during the sending process
|
|
185
|
-
*/
|
|
186
|
-
readonly errorMessages: ReadonlyArray<string>;
|
|
187
|
-
/**
|
|
188
|
-
* Optional provider name
|
|
189
|
-
*/
|
|
190
|
-
readonly provider?: string;
|
|
191
|
-
/**
|
|
192
|
-
* Indicates that the email failed to send
|
|
193
|
-
*/
|
|
194
|
-
readonly successful: false;
|
|
195
|
-
};
|
|
196
|
-
/**
|
|
197
|
-
* Generic result type
|
|
198
|
-
*/
|
|
199
|
-
export interface Result<T = unknown> {
|
|
200
|
-
data?: T;
|
|
201
|
-
error?: Error | unknown;
|
|
202
|
-
success: boolean;
|
|
203
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { EmailOptions } from "../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Builds a MIME-formatted email message from email options.
|
|
4
|
-
* @param options The email options to build the MIME message from.
|
|
5
|
-
* @returns The MIME-formatted email message as a string.
|
|
6
|
-
*/
|
|
7
|
-
declare const buildMimeMessage: <T extends EmailOptions>(options: T) => Promise<string>;
|
|
8
|
-
export default buildMimeMessage;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Logger interface with debug, error, info, and warn methods.
|
|
3
|
-
*/
|
|
4
|
-
export type Logger = {
|
|
5
|
-
debug: (message: string, ...args: unknown[]) => void;
|
|
6
|
-
error: (message: string, ...args: unknown[]) => void;
|
|
7
|
-
info: (message: string, ...args: unknown[]) => void;
|
|
8
|
-
warn: (message: string, ...args: unknown[]) => void;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Creates a logger instance for a provider with optional console output.
|
|
12
|
-
* @param providerName The name of the provider (used as prefix in log messages).
|
|
13
|
-
* @param logger Optional Console instance. If provided, logs will be displayed with prefixes. If not provided, returns a no-op logger.
|
|
14
|
-
* @returns A logger instance with debug, error, info, and warn methods.
|
|
15
|
-
*/
|
|
16
|
-
export declare const createLogger: (providerName: string, logger?: Console) => Logger;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { EmailAddress } from "../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Formats a list of email addresses into a comma-separated string.
|
|
4
|
-
* @param addresses The email address(es) to format (single or array).
|
|
5
|
-
* @returns The formatted email addresses string (comma-separated if multiple).
|
|
6
|
-
*/
|
|
7
|
-
declare const formatEmailAddresses: (addresses: EmailAddress | EmailAddress[]) => string;
|
|
8
|
-
export default formatEmailAddresses;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates a unique boundary string for MIME multipart email messages.
|
|
3
|
-
* Works across Node.js, Deno, Bun, and Workers.
|
|
4
|
-
* @returns A unique boundary string for MIME multipart messages.
|
|
5
|
-
*/
|
|
6
|
-
declare const generateBoundary: () => string;
|
|
7
|
-
export default generateBoundary;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { EmailHeaders } from "../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Converts EmailHeaders (Record<string, string> or ImmutableHeaders) to Record<string, string>.
|
|
4
|
-
* This allows us to work with headers uniformly regardless of their input type.
|
|
5
|
-
* @param headers The headers to convert (Record or ImmutableHeaders).
|
|
6
|
-
* @returns A plain object Record<string, string> representation of the headers.
|
|
7
|
-
*/
|
|
8
|
-
declare const headersToRecord: (headers: EmailHeaders) => Record<string, string>;
|
|
9
|
-
export default headersToRecord;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if a port is available on a host.
|
|
3
|
-
* Works across environments with polyfills.
|
|
4
|
-
* @param host The hostname or IP address to check.
|
|
5
|
-
* @param port The port number to check.
|
|
6
|
-
* @returns Promise that resolves to true if the port is available, false otherwise.
|
|
7
|
-
*/
|
|
8
|
-
declare const isPortAvailable: (host: string, port: number) => Promise<boolean>;
|
|
9
|
-
export default isPortAvailable;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Result } from "../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Request options compatible with both Fetch API and Node.js http
|
|
4
|
-
*/
|
|
5
|
-
export interface RequestOptions {
|
|
6
|
-
[key: string]: unknown;
|
|
7
|
-
headers?: Record<string, string>;
|
|
8
|
-
method?: string;
|
|
9
|
-
timeout?: number;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Makes an HTTP request using Fetch API (compatible with Node.js 20.19+, Deno, Bun, Cloudflare Workers).
|
|
13
|
-
* @param url The URL to make the request to.
|
|
14
|
-
* @param options Request options including method, headers, and timeout.
|
|
15
|
-
* @param data Optional request body data (string, Buffer, or Uint8Array).
|
|
16
|
-
* @returns A result object containing the response data or error.
|
|
17
|
-
*/
|
|
18
|
-
export declare const makeRequest: (url: string | URL, options?: RequestOptions, data?: string | Buffer | Uint8Array) => Promise<Result<unknown>>;
|
package/dist/utils/retry.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Result } from "../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Helper function to retry an async function with exponential backoff.
|
|
4
|
-
* @param function_ The async function to retry.
|
|
5
|
-
* @param retries Number of retry attempts (default: 3).
|
|
6
|
-
* @param delay Initial delay in milliseconds (default: 300, doubles on each retry).
|
|
7
|
-
* @returns A result object containing the function result or error.
|
|
8
|
-
*/
|
|
9
|
-
declare const retry: <T>(function_: () => Promise<Result<T>>, retries?: number, delay?: number) => Promise<Result<T>>;
|
|
10
|
-
export default retry;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sanitizes header values to prevent CRLF injection attacks.
|
|
3
|
-
* Removes carriage return (\r) and line feed (\n) characters.
|
|
4
|
-
* @param value The header value to sanitize.
|
|
5
|
-
* @returns The sanitized header value with CR/LF characters removed.
|
|
6
|
-
*/
|
|
7
|
-
export declare const sanitizeHeaderValue: (value: string) => string;
|
|
8
|
-
/**
|
|
9
|
-
* Sanitizes header names to prevent CRLF injection attacks.
|
|
10
|
-
* Removes carriage return (\r) and line feed (\n) characters.
|
|
11
|
-
* @param name The header name to sanitize.
|
|
12
|
-
* @returns The sanitized header name with CR/LF characters removed.
|
|
13
|
-
*/
|
|
14
|
-
export declare const sanitizeHeaderName: (name: string) => string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts content to a base64-encoded string.
|
|
3
|
-
* Works across Node.js, Deno, Bun, and Workers.
|
|
4
|
-
* @param content The content to convert (string, Buffer, Uint8Array, or ArrayLike<number>).
|
|
5
|
-
* @returns The base64-encoded string.
|
|
6
|
-
*/
|
|
7
|
-
declare const toBase64: (content: string | Buffer | Uint8Array | ArrayLike<number>) => string;
|
|
8
|
-
export default toBase64;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { Cache } from "../cache.d.ts";
|
|
2
|
-
export type { Cache, InMemoryCache } from "../cache.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* MX record information.
|
|
5
|
-
*/
|
|
6
|
-
export interface MxRecord {
|
|
7
|
-
exchange: string;
|
|
8
|
-
priority: number;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Result of MX record check.
|
|
12
|
-
*/
|
|
13
|
-
export interface MxCheckResult {
|
|
14
|
-
error?: string;
|
|
15
|
-
records?: MxRecord[];
|
|
16
|
-
valid: boolean;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Options for MX record checking.
|
|
20
|
-
*/
|
|
21
|
-
export interface MxCheckOptions {
|
|
22
|
-
cache?: Cache<MxCheckResult>;
|
|
23
|
-
ttl?: number;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Checks MX records for a domain.
|
|
27
|
-
* @param domain The domain to check MX records for.
|
|
28
|
-
* @param options Options for MX record checking, including caching.
|
|
29
|
-
* @returns Result containing MX records or error.
|
|
30
|
-
* @example
|
|
31
|
-
* ```ts
|
|
32
|
-
* import { checkMxRecords } from "@visulima/email/validation/check-mx-records";
|
|
33
|
-
* import { InMemoryCache } from "@visulima/email/utils/cache";
|
|
34
|
-
*
|
|
35
|
-
* const cache = new InMemoryCache();
|
|
36
|
-
* const result = await checkMxRecords("example.com", { cache });
|
|
37
|
-
* if (result.valid) {
|
|
38
|
-
* console.log("MX records:", result.records);
|
|
39
|
-
* }
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
export declare const checkMxRecords: (domain: string, options?: MxCheckOptions) => Promise<MxCheckResult>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var d=Object.defineProperty;var n=(r,e)=>d(r,"name",{value:e,configurable:!0});import{createRequire as l}from"node:module";const u=l(import.meta.url),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,p=n(r=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[e,o]=c.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return c.getBuiltinModule(r)}return u(r)},"__cjs_getBuiltinModule"),{resolveMx:h}=p("node:dns/promises");var f=Object.defineProperty,g=n((r,e)=>f(r,"name",{value:e,configurable:!0}),"h");const v=g(async(r,e={})=>{const o=e.ttl??36e5;if(e.cache){const t=await e.cache.get(r);if(t!==void 0)return t}try{const t=(await h(r)).map(i=>({exchange:i.exchange,priority:i.priority})),s={records:t.toSorted((i,a)=>i.priority-a.priority),valid:t.length>0};return e.cache&&await e.cache.set(r,s,o),s}catch(t){const s={error:t instanceof Error?t.message:String(t),valid:!1};return e.cache&&await e.cache.set(r,s,o),s}},"checkMxRecords");export{v as checkMxRecords};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Re-exports all functionality from @visulima/disposable-email-domains.
|
|
3
|
-
* This provides access to disposable email domain checking utilities.
|
|
4
|
-
* @example
|
|
5
|
-
* ```ts
|
|
6
|
-
* import { isDisposableEmail, isDisposableDomain, getDomainList } from "\@visulima/email/validation/disposable-email-domains";
|
|
7
|
-
*
|
|
8
|
-
* if (isDisposableEmail("user@mailinator.com")) {
|
|
9
|
-
* console.log("Disposable email detected!");
|
|
10
|
-
* }
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
export * from "@visulima/disposable-email-domains";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"@visulima/disposable-email-domains";
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Common role account prefixes that indicate non-personal email addresses.
|
|
3
|
-
* Includes RFC 2142 standard role accounts and common business/operational prefixes.
|
|
4
|
-
*/
|
|
5
|
-
declare const ROLE_ACCOUNT_PREFIXES: Set<string>;
|
|
6
|
-
/**
|
|
7
|
-
* Checks if an email address is a role account (non-personal).
|
|
8
|
-
* @param email The email address to check.
|
|
9
|
-
* @param customPrefixes Optional set of additional role account prefixes.
|
|
10
|
-
* @returns True if the email is a role account, false otherwise.
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* import { isRoleAccount } from "@visulima/email/validation/role-accounts";
|
|
14
|
-
*
|
|
15
|
-
* if (isRoleAccount("noreply@example.com")) {
|
|
16
|
-
* console.log("This is a role account");
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export declare const isRoleAccount: (email: string, customPrefixes?: Set<string>) => boolean;
|
|
21
|
-
export { ROLE_ACCOUNT_PREFIXES };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var l=Object.defineProperty;var u=(e,r)=>l(e,"name",{value:r,configurable:!0});var p=Object.defineProperty,i=u((e,r)=>p(e,"name",{value:r,configurable:!0}),"n");const m=new Set(["abuse","accounts","admin","adminhelp","administrator","adminoffice","adminteam","affiliates","alarms","alert","alternative","analytics","anonymous","archive","audit","automated","autoreply","backoffice","backup","batch","billing","board","bot","bounce","bug","bugreport","build","careers","cert","chapter","chatbot","ci","compliance","contact","continuousintegration","cron","csirt","customer-care","customercare","customerservice","customersupport","cvs","daemon","default","demo","deploy","deployment","dev","development","devops","digest","director","dnsadmin","docs","donotreply","enquiry","errors","events","executive","faculty","failover","feed","feedback","finance","forensics","ftp","git","guardian","guest","help","helpdesk","helpsec","hostmaster","hr","incident","incidents","indexer","info","ingest","inquiry","issues","it","jobs","legal","list","list-request","log","logistics","logs","maildaemon","mailer-daemon","malicious","management","manager","marketing","media","membership","metrics","mod","moderator","mods","monitor","network","news","newsletter","no-reply","noc","noreply","notifications","notify","operations","operator","owner","owners","parent","partners","patches","payments","phish","phishing","pipeline","post","postmaster","pr","press","privacy","procurement","qa","recruitment","redundancy","registrar","releases","reminder","reminders","reply","report","reports","request","resource","root","sales","scheduler","secondary","secops","secretariat","secretary","security","server","service","spam","spamreport","staff","standby","student","subscribe","subscriptions","summaries","supervisor","supplychain","support","supportteam","svn","sync","sysadmin","system","system-alert","system-msg","team","tech","techsupport","temp","tertiary","test","threat","threats","tracker","trial","unknown","unsubscribe","update","updates","usenet","usergroup","uucp","volunteer","vuln","vulnerability","webinars","webmaster","www"]),o=i((e,r)=>m.has(e)||(r?.has(e)??!1),"checkRolePrefix"),d=i((e,r)=>{if(e.length<2)return!1;const t=["-",".","_"];for(const s of t){const n=`${e[0]}${s}${e[1]}`;if(o(n,r))return!0}return!1},"checkCombinedParts"),f=i((e,r)=>{for(const t of e)if(!o(t,r))return!1;return!0},"checkAllPartsAreRoleAccounts"),h=i((e,r)=>{if(!e||typeof e!="string")return!1;const t=e.toLowerCase().trim(),s=t.indexOf("@");if(s===-1||s===0)return!1;const n=t.slice(0,s);if(o(n,r))return!0;const a=n.split(/[+._-]/);if(a.length===1){const c=a[0];return c===void 0?!1:o(c,r)}return d(a,r)?!0:f(a,r)},"isRoleAccount");export{m as ROLE_ACCOUNT_PREFIXES,h as isRoleAccount};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { EmailOptions } from "../../types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Validates email options and returns any validation errors.
|
|
4
|
-
* @param options The email options to validate.
|
|
5
|
-
* @returns Array of error messages (empty if validation passes).
|
|
6
|
-
*/
|
|
7
|
-
declare const validateEmailOptions: <T extends EmailOptions>(options: T) => string[];
|
|
8
|
-
export default validateEmailOptions;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { SmtpVerificationOptions } from "./verify-smtp.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Options for comprehensive email verification.
|
|
4
|
-
*/
|
|
5
|
-
export interface EmailVerificationOptions extends SmtpVerificationOptions {
|
|
6
|
-
checkDisposable?: boolean;
|
|
7
|
-
checkMx?: boolean;
|
|
8
|
-
checkRoleAccount?: boolean;
|
|
9
|
-
checkSmtp?: boolean;
|
|
10
|
-
customDisposableDomains?: Set<string>;
|
|
11
|
-
customRolePrefixes?: Set<string>;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Result of comprehensive email verification.
|
|
15
|
-
*/
|
|
16
|
-
export interface EmailVerificationResult {
|
|
17
|
-
disposable?: boolean;
|
|
18
|
-
errors: string[];
|
|
19
|
-
formatValid: boolean;
|
|
20
|
-
mxValid?: boolean;
|
|
21
|
-
roleAccount?: boolean;
|
|
22
|
-
smtpValid?: boolean;
|
|
23
|
-
valid: boolean;
|
|
24
|
-
warnings: string[];
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Comprehensive email verification combining multiple checks.
|
|
28
|
-
* @param email The email address to verify.
|
|
29
|
-
* @param options Verification options.
|
|
30
|
-
* @returns Detailed verification result.
|
|
31
|
-
* @example
|
|
32
|
-
* ```ts
|
|
33
|
-
* import { verifyEmail } from "@visulima/email/validation/verify-email";
|
|
34
|
-
*
|
|
35
|
-
* const result = await verifyEmail("user@example.com", {
|
|
36
|
-
* checkDisposable: true,
|
|
37
|
-
* checkRoleAccount: true,
|
|
38
|
-
* checkMx: true,
|
|
39
|
-
* checkSmtp: false
|
|
40
|
-
* });
|
|
41
|
-
*
|
|
42
|
-
* if (result.valid) {
|
|
43
|
-
* console.log("Email is valid!");
|
|
44
|
-
* }
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
export declare const verifyEmail: (email: string, options?: EmailVerificationOptions) => Promise<EmailVerificationResult>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var V=Object.defineProperty;var f=(e,r)=>V(e,"name",{value:r,configurable:!0});import{checkMxRecords as y}from"./check-mx-records.js";import{isRoleAccount as k}from"./role-accounts.js";import w from"./validate-email.js";import{verifySmtp as E}from"./verify-smtp.js";import{isDisposableEmail as A}from"@visulima/disposable-email-domains";var D=Object.defineProperty,M=f((e,r)=>D(e,"name",{value:r,configurable:!0}),"f");const N=M(async(e,r={})=>{const{checkDisposable:p=!0,checkMx:d=!0,checkRoleAccount:u=!0,checkSmtp:h=!1,customDisposableDomains:v,customRolePrefixes:b,...g}=r,c=w(e),a=[],i=[];if(!c)return a.push("Invalid email format"),{errors:a,formatValid:!1,valid:!1,warnings:i};let s,l,m,n;if(p)try{s=A(e,v),s&&i.push("Email is from a disposable email service")}catch{}if(u&&(l=k(e,b),l&&i.push("Email appears to be a role account (non-personal)")),d){const o=e.split("@")[1];if(!o)return a.push("Invalid email format: missing domain"),{disposable:s,errors:a,formatValid:!1,mxValid:!1,roleAccount:l,valid:!1,warnings:i};const t=await y(o,{cache:r.cache});m=t.valid,t.valid||a.push(t.error||"No valid MX records found")}if(h){const o=await E(e,{...g,cache:r.cache,smtpCache:r.smtpCache});n=o.valid,!o.valid&&o.error&&a.push(`SMTP verification failed: ${o.error}`)}const x=c&&a.length===0;return{disposable:s,errors:a,formatValid:c,mxValid:m,roleAccount:l,smtpValid:n,valid:x,warnings:i}},"verifyEmail");export{N as verifyEmail};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { Cache } from "../cache.d.ts";
|
|
2
|
-
import type { MxCheckResult, MxRecord } from "./check-mx-records.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Options for SMTP verification.
|
|
5
|
-
*/
|
|
6
|
-
export interface SmtpVerificationOptions {
|
|
7
|
-
cache?: Cache<MxCheckResult>;
|
|
8
|
-
fromEmail?: string;
|
|
9
|
-
port?: number;
|
|
10
|
-
smtpCache?: Cache<SmtpVerificationResult>;
|
|
11
|
-
timeout?: number;
|
|
12
|
-
ttl?: number;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Detailed result of SMTP verification attempt.
|
|
16
|
-
*/
|
|
17
|
-
export interface SmtpVerificationResult {
|
|
18
|
-
error?: string;
|
|
19
|
-
mxRecords?: MxRecord[];
|
|
20
|
-
smtpResponse?: string;
|
|
21
|
-
valid: boolean;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Verifies an email address by checking MX records and attempting SMTP verification.
|
|
25
|
-
* Note: Many mail servers block SMTP verification to prevent email harvesting.
|
|
26
|
-
* @param email The email address to verify.
|
|
27
|
-
* @param options Verification options.
|
|
28
|
-
* @returns Result containing verification status.
|
|
29
|
-
* @example
|
|
30
|
-
* ```ts
|
|
31
|
-
* import { verifySmtp } from "@visulima/email/validation/verify-smtp";
|
|
32
|
-
*
|
|
33
|
-
* const result = await verifySmtp("user@example.com", {
|
|
34
|
-
* timeout: 5000,
|
|
35
|
-
* fromEmail: "test@example.com"
|
|
36
|
-
* });
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
export declare const verifySmtp: (email: string, options?: SmtpVerificationOptions) => Promise<SmtpVerificationResult>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var j=Object.defineProperty;var R=(t,e)=>j(t,"name",{value:e,configurable:!0});import{createRequire as S}from"node:module";import{checkMxRecords as C}from"./check-mx-records.js";const $=S(import.meta.url),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,O=R(t=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,d]=u.versions.node.split(".").map(Number);if(e>22||e===22&&d>=3||e===20&&d>=16)return u.getBuiltinModule(t)}return $(t)},"__cjs_getBuiltinModule"),{Socket:P}=O("node:net");var E=Object.defineProperty,p=R((t,e)=>E(t,"name",{value:e,configurable:!0}),"n");const A=p(async(t,e={})=>{const{fromEmail:d="test@example.com",port:x=25,timeout:M=5e3,ttl:_=36e5}=e;if(!t||typeof t!="string")return{error:"Invalid email address",valid:!1};const l=t.toLowerCase().trim(),h=l.indexOf("@");if(h===-1||h===l.length-1)return{error:"Invalid email format",valid:!1};const{smtpCache:c}=e,g=`smtp:${l}:${d}:${x}`;if(c){const n=await c.get(g);if(n!==void 0)return n}const w=l.slice(h+1),W=e.cache,r=await C(w,{cache:W});if(!r.valid||!r.records||r.records.length===0){const n={error:r.error||"No MX records found",mxRecords:r.records,valid:!1};return c&&await c.set(g,n,_),n}const y=r.records[0];return new Promise(n=>{const o=new P;let v="",s="connected";const m=p(()=>{o.removeAllListeners(),o.destroy()},"cleanup"),f=p(a=>{c&&c.set(g,a,_).catch(()=>{}),n(a)},"cacheAndResolve"),T=p(a=>{m(),f({error:a.message,mxRecords:r.records,valid:!1})},"onError"),b=p(()=>{m(),f({error:"SMTP connection timeout",mxRecords:r.records,valid:!1})},"onTimeout");o.setTimeout(M),o.on("error",T),o.on("timeout",b),o.on("data",a=>{v+=a.toString();const i=v.slice(-3);s==="connected"&&(i.startsWith("220")||i.startsWith("250"))?(s="helo",o.write(`HELO ${w}\r
|
|
2
|
-
`)):s==="helo"&&i.startsWith("250")?(s="mail-from",o.write(`MAIL FROM:<${d}>\r
|
|
3
|
-
`)):s==="mail-from"&&i.startsWith("250")?(s="rcpt-to",o.write(`RCPT TO:<${l}>\r
|
|
4
|
-
`)):s==="rcpt-to"&&i.startsWith("250")?(m(),f({mxRecords:r.records,smtpResponse:v,valid:!0})):s==="rcpt-to"&&(i.startsWith("550")||i.startsWith("551")||i.startsWith("553"))&&(m(),f({error:"Email address does not exist",mxRecords:r.records,smtpResponse:v,valid:!1}))}),y?o.connect(x,y.exchange):(m(),f({error:"No MX record available",mxRecords:r.records,valid:!1}))})},"verifySmtp");export{A as verifySmtp};
|