@visulima/email 2.1.6 → 2.1.7
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 +7 -0
- package/dist/crypto/index.d.ts +183 -183
- package/dist/crypto/index.js +1 -1
- package/dist/deliverability/dmarc-report.d.ts +43 -43
- package/dist/deliverability/dmarc-report.js +1 -1
- package/dist/deliverability/index.d.ts +201 -201
- package/dist/events/index.d.ts +17 -17
- package/dist/inbound/index.d.ts +180 -180
- package/dist/index.d.ts +35 -46
- package/dist/index.js +1 -1
- package/dist/middleware/index.d.ts +213 -216
- package/dist/middleware/index.js +1 -1
- package/dist/packem_shared/{DkimSigner-CiLBaXrg.js → DkimSigner-sLcIw9bp.js} +6 -6
- package/dist/packem_shared/{DraftMailMessage-CGTVuy2z.js → DraftMailMessage-C3YTXqWo.js} +1 -1
- package/dist/packem_shared/EmailError-CDvYwuqz.js +1 -0
- package/dist/packem_shared/{Mail-CYAwMRnX.js → Mail-CIyxkmxu.js} +1 -1
- package/dist/packem_shared/MailMessage-DuEXJiCg.js +1 -0
- package/dist/packem_shared/{RequiredOptionError-DuNNY_a5.js → RequiredOptionError-DU2lxzk3.js} +1 -1
- package/dist/packem_shared/SmimeEncrypter-CzTbQM-z.js +6 -0
- package/dist/packem_shared/SmimeSigner-DjLShaOw.js +8 -0
- package/dist/packem_shared/{ahaSendProvider-DSuZIzaQ.js → ahaSendProvider-br1yB2un.js} +1 -1
- package/dist/packem_shared/arcMessageSignatureBase-D54jQIWu.js +17 -0
- package/dist/packem_shared/attachment-processor-D1cbAhQi.js +1 -0
- package/dist/packem_shared/{autoSendProvider-DqAoelWR.js → autoSendProvider-BSP8ueOC.js} +1 -1
- package/dist/packem_shared/{awsSesProvider-ClK1FUln.js → awsSesProvider-zRICW1pH.js} +13 -13
- package/dist/packem_shared/azureProvider-DwN4c5dC.js +1 -0
- package/dist/packem_shared/{brevoProvider-CIzuIDlt.js → brevoProvider-C491beE_.js} +1 -1
- package/dist/packem_shared/{build-mime-message-BW5FQ2Bt.js → build-mime-message-DT67qfMp.js} +1 -1
- package/dist/packem_shared/{circuitBreakerMiddleware-D2SA_07f.js → circuitBreakerMiddleware-N0CKF90q.js} +1 -1
- package/dist/packem_shared/{cloudflareEmailProvider-B8mOEl3N.js → cloudflareEmailProvider-8JxzLbpX.js} +1 -1
- package/dist/packem_shared/{createTestEmail-f12yLlWn.js → createTestEmail-D_ksEez3.js} +1 -1
- package/dist/packem_shared/dedupeMiddleware-CYYI_O7S.js +1 -0
- package/dist/packem_shared/{detectMimeType-DFH3kp6K.js → detectMimeType-CmYmWDXE.js} +1 -1
- package/dist/packem_shared/event-bus.d-BNQA-FZE.d.ts +104 -0
- package/dist/packem_shared/{failoverProvider-BgX6zfnY.js → failoverProvider-6qwE_HSJ.js} +1 -1
- package/dist/packem_shared/generate-boundary-0xGe9GqK.js +1 -0
- package/dist/packem_shared/{httpProvider-aBfTXyCT.js → httpProvider-BqrdZhGw.js} +1 -1
- package/dist/packem_shared/index-Gd7m-UQA.js +11 -0
- package/dist/packem_shared/{infobipProvider-DxzsONUX.js → infobipProvider-C2FU6VMP.js} +1 -1
- package/dist/packem_shared/isValidSigningCertUrl-DNxPA0Q-.js +3 -0
- package/dist/packem_shared/{loopsProvider-QBsAH6Ee.js → loopsProvider-Bz63so6m.js} +1 -1
- package/dist/packem_shared/mail.d-xKtvoKMK.d.ts +909 -0
- package/dist/packem_shared/{mailCrabProvider-DRE5snM9.js → mailCrabProvider-bkQy-2a1.js} +1 -1
- package/dist/packem_shared/{mailPaceProvider-DCa-4ghl.js → mailPaceProvider-S1AB-AYq.js} +1 -1
- package/dist/packem_shared/{mailchannelsProvider-GiwkYBdD.js → mailchannelsProvider-B_K6X4VY.js} +1 -1
- package/dist/packem_shared/{mailerSendProvider-RK6IbUrL.js → mailerSendProvider-DPEww2H1.js} +1 -1
- package/dist/packem_shared/mailgunProvider-DKxzVbDW.js +1 -0
- package/dist/packem_shared/mailjetProvider-C2TQcujL.js +1 -0
- package/dist/packem_shared/{mailomatProvider-DPDpVS8r.js → mailomatProvider-B8-5bQsu.js} +1 -1
- package/dist/packem_shared/{mailtrapProvider-DtrS4Q34.js → mailtrapProvider-DW7TLOdG.js} +1 -1
- package/dist/packem_shared/{make-request-B9XjBynA.js → make-request-CylyuRaN.js} +1 -1
- package/dist/packem_shared/{mandrillProvider-B84zH-eV.js → mandrillProvider-S-0lKNGd.js} +1 -1
- package/dist/packem_shared/{mockProvider-Behywbl1.js → mockProvider-BAl292mW.js} +1 -1
- package/dist/packem_shared/{netcoreProvider-D-wtCyJj.js → netcoreProvider-DajMprlo.js} +1 -1
- package/dist/packem_shared/{nodemailerProvider-BFHobXxt.js → nodemailerProvider-DRo0lJ6g.js} +1 -1
- package/dist/packem_shared/{opentelemetryProvider-ByHC01ub.js → opentelemetryProvider-C6spx2CD.js} +1 -1
- package/dist/packem_shared/{outlook365Provider-Btk4Emig.js → outlook365Provider-B0o7UZBW.js} +1 -1
- package/dist/packem_shared/{plunkProvider-Bw8e6460.js → plunkProvider-DJzEUEtU.js} +1 -1
- package/dist/packem_shared/{postalProvider-CT8zr89z.js → postalProvider-DHFjFE3Y.js} +1 -1
- package/dist/packem_shared/{postmarkProvider-CQSqZWDs.js → postmarkProvider-Dt1EGGBA.js} +1 -1
- package/dist/packem_shared/{provider-base-C7PuopYK.js → provider-base-DjPzWncP.js} +1 -1
- package/dist/packem_shared/{provider.d-J-y6iogK.d.ts → provider.d-Cx5YQJdP.d.ts} +9 -9
- package/dist/packem_shared/{resendProvider-drJYlvLP.js → resendProvider-qjI86j_d.js} +1 -1
- package/dist/packem_shared/{retry-ipI5DRJ8.js → retry-CG9iT2wF.js} +1 -1
- package/dist/packem_shared/{roundRobinProvider-D1by5KGW.js → roundRobinProvider-CO5YvhgR.js} +1 -1
- package/dist/packem_shared/{scalewayProvider-DU5gXQrl.js → scalewayProvider-CihQKhw6.js} +1 -1
- package/dist/packem_shared/{sendGridProvider-BuTbEXW8.js → sendGridProvider-Dkc5AKlC.js} +1 -1
- package/dist/packem_shared/{smtpProvider-5MI3-EPh.js → smtpProvider-CIXMxPu-.js} +12 -12
- package/dist/packem_shared/{sparkpostProvider-UAsFYIjP.js → sparkpostProvider-CKxQhpyB.js} +1 -1
- package/dist/packem_shared/{sweegoProvider-SUz0LIcA.js → sweegoProvider-DjmAs6La.js} +1 -1
- package/dist/packem_shared/{tracer.d-MU42G1jG.d.ts → tracer.d-sb5yrt_n.d.ts} +2 -2
- package/dist/packem_shared/types.d-B0t3PQ3t.d.ts +107 -0
- package/dist/packem_shared/{types.d-ejzh-xBP.d.ts → types.d-B9295M4_.d.ts} +82 -82
- package/dist/packem_shared/types.d-BzoHR9nB.d.ts +61 -0
- package/dist/packem_shared/types.d-C5geVKes.d.ts +51 -0
- package/dist/packem_shared/types.d-GKqPNk0I.d.ts +24 -0
- package/dist/packem_shared/types.d-I-KeZ5w2.d.ts +9 -0
- package/dist/packem_shared/types.d-kHO4kX9q.d.ts +69 -0
- package/dist/packem_shared/utils-DjEtR3qT.js +1 -0
- package/dist/packem_shared/verifyMailgunWebhook-DNk080BF.js +1 -0
- package/dist/packem_shared/verifyPostmarkWebhook-B4OIEHQF.js +1 -0
- package/dist/packem_shared/verifyResendWebhook-C7E32LZ1.js +1 -0
- package/dist/packem_shared/verifySendGridWebhook-1l9bqIMw.js +1 -0
- package/dist/packem_shared/withEvents-CytsykaK.js +1 -0
- package/dist/packem_shared/{withSuppression-DBaZDMAr.js → withSuppression-BoaO4Qdz.js} +1 -1
- package/dist/packem_shared/{zeptomailProvider-DXNX9mG_.js → zeptomailProvider-DSTC9pUi.js} +1 -1
- package/dist/providers/ahasend/index.d.ts +18 -18
- package/dist/providers/ahasend/index.js +1 -1
- package/dist/providers/autosend/index.d.ts +30 -30
- package/dist/providers/autosend/index.js +1 -1
- package/dist/providers/aws-ses/index.d.ts +20 -20
- package/dist/providers/aws-ses/index.js +1 -1
- package/dist/providers/azure/index.d.ts +26 -26
- package/dist/providers/azure/index.js +1 -1
- package/dist/providers/brevo/index.d.ts +35 -35
- package/dist/providers/brevo/index.js +1 -1
- package/dist/providers/cloudflare-email/index.d.ts +25 -25
- package/dist/providers/cloudflare-email/index.js +1 -1
- package/dist/providers/failover/index.d.ts +14 -14
- package/dist/providers/failover/index.js +1 -1
- package/dist/providers/http/index.d.ts +15 -15
- package/dist/providers/http/index.js +1 -1
- package/dist/providers/infobip/index.d.ts +28 -28
- package/dist/providers/infobip/index.js +1 -1
- package/dist/providers/loops/index.d.ts +25 -25
- package/dist/providers/loops/index.js +1 -1
- package/dist/providers/mailchannels/index.d.ts +13 -13
- package/dist/providers/mailchannels/index.js +1 -1
- package/dist/providers/mailcrab/index.d.ts +17 -17
- package/dist/providers/mailcrab/index.js +1 -1
- package/dist/providers/mailersend/index.d.ts +24 -24
- package/dist/providers/mailersend/index.js +1 -1
- package/dist/providers/mailgun/index.d.ts +37 -37
- package/dist/providers/mailgun/index.js +1 -1
- package/dist/providers/mailjet/index.d.ts +36 -36
- package/dist/providers/mailjet/index.js +1 -1
- package/dist/providers/mailomat/index.d.ts +20 -20
- package/dist/providers/mailomat/index.js +1 -1
- package/dist/providers/mailpace/index.d.ts +24 -24
- package/dist/providers/mailpace/index.js +1 -1
- package/dist/providers/mailtrap/index.d.ts +22 -22
- package/dist/providers/mailtrap/index.js +1 -1
- package/dist/providers/mandrill/index.d.ts +36 -36
- package/dist/providers/mandrill/index.js +1 -1
- package/dist/providers/mock/index.d.ts +8 -8
- package/dist/providers/mock/index.js +1 -1
- package/dist/providers/netcore/index.d.ts +17 -17
- package/dist/providers/netcore/index.js +1 -1
- package/dist/providers/nodemailer/index.d.ts +22 -22
- package/dist/providers/nodemailer/index.js +1 -1
- package/dist/providers/opentelemetry/index.d.ts +20 -20
- package/dist/providers/opentelemetry/index.js +1 -1
- package/dist/providers/outlook365/index.d.ts +82 -82
- package/dist/providers/outlook365/index.js +1 -1
- package/dist/providers/plunk/index.d.ts +18 -18
- package/dist/providers/plunk/index.js +1 -1
- package/dist/providers/postal/index.d.ts +24 -24
- package/dist/providers/postal/index.js +1 -1
- package/dist/providers/postmark/index.d.ts +30 -30
- package/dist/providers/postmark/index.js +1 -1
- package/dist/providers/resend/index.d.ts +24 -24
- package/dist/providers/resend/index.js +1 -1
- package/dist/providers/roundrobin/index.d.ts +14 -14
- package/dist/providers/roundrobin/index.js +1 -1
- package/dist/providers/scaleway/index.d.ts +22 -22
- package/dist/providers/scaleway/index.js +1 -1
- package/dist/providers/sendgrid/index.d.ts +25 -25
- package/dist/providers/sendgrid/index.js +1 -1
- package/dist/providers/smtp/index.d.ts +11 -11
- package/dist/providers/smtp/index.js +1 -1
- package/dist/providers/sparkpost/index.d.ts +21 -21
- package/dist/providers/sparkpost/index.js +1 -1
- package/dist/providers/sweego/index.d.ts +20 -20
- package/dist/providers/sweego/index.js +1 -1
- package/dist/providers/zeptomail/index.d.ts +17 -17
- package/dist/providers/zeptomail/index.js +1 -1
- package/dist/queue/bullmq-queue.d.ts +26 -26
- package/dist/queue/index.d.ts +86 -86
- package/dist/queue/pg-boss-queue.d.ts +13 -13
- package/dist/queue/sqs-queue.d.ts +20 -20
- package/dist/queue/unstorage-queue.d.ts +47 -47
- package/dist/queue/unstorage-queue.js +1 -1
- package/dist/render/cid.d.ts +12 -12
- package/dist/render/css-inline.d.ts +12 -12
- package/dist/render/css-inline.js +1 -1
- package/dist/render/dark-mode.d.ts +12 -12
- package/dist/render/preheader.d.ts +16 -16
- package/dist/template-engines/handlebars.d.ts +19 -19
- package/dist/template-engines/handlebars.js +1 -1
- package/dist/template-engines/html-to-text.d.ts +12 -12
- package/dist/template-engines/html-to-text.js +1 -1
- package/dist/template-engines/i18n.d.ts +43 -43
- package/dist/template-engines/i18n.js +1 -1
- package/dist/template-engines/jsx-email.d.ts +8 -8
- package/dist/template-engines/jsx-email.js +1 -1
- package/dist/template-engines/liquid.d.ts +9 -9
- package/dist/template-engines/liquid.js +1 -1
- package/dist/template-engines/mjml.d.ts +9 -9
- package/dist/template-engines/mjml.js +1 -1
- package/dist/template-engines/react-email.d.ts +8 -8
- package/dist/template-engines/react-email.js +1 -1
- package/dist/template-engines/vue-email.d.ts +8 -8
- package/dist/template-engines/vue-email.js +1 -1
- package/dist/test/index.d.ts +89 -89
- package/dist/test/index.js +1 -1
- package/dist/utils/cache.d.ts +27 -27
- package/dist/utils/format-email-address.d.ts +6 -6
- package/dist/utils/format-email-address.js +1 -1
- package/dist/utils/normalize-email-aliases.d.ts +19 -19
- package/dist/utils/parse-address.d.ts +16 -16
- package/dist/utils/parse-eml.d.ts +18 -18
- package/dist/utils/result.d.ts +30 -30
- package/dist/utils/result.js +1 -1
- package/dist/utils/validation/check-feature-support.d.ts +33 -33
- package/dist/utils/validation/validate-email.d.ts +4 -4
- package/dist/webhooks/index.d.ts +134 -134
- package/dist/webhooks/index.js +1 -1
- package/package.json +1 -1
- package/dist/packem_shared/EmailError-B-sEf3bp.js +0 -1
- package/dist/packem_shared/MailMessage-DQRgs5Dz.js +0 -1
- package/dist/packem_shared/SmimeEncrypter-DavopRlE.js +0 -6
- package/dist/packem_shared/SmimeSigner-0onWksAv.js +0 -8
- package/dist/packem_shared/arcMessageSignatureBase-DDLEHW2E.js +0 -17
- package/dist/packem_shared/attachment-processor-CMp7qqMI.js +0 -1
- package/dist/packem_shared/azureProvider-Cw_Tmde6.js +0 -1
- package/dist/packem_shared/dedupeMiddleware-B6ajWOTi.js +0 -1
- package/dist/packem_shared/event-bus.d-DEl3w_EW.d.ts +0 -104
- package/dist/packem_shared/generate-boundary-DQbzDiOI.js +0 -1
- package/dist/packem_shared/index-BoZvzveg.js +0 -11
- package/dist/packem_shared/isValidSigningCertUrl-Bii1AMGC.js +0 -3
- package/dist/packem_shared/mail.d-B9SSqyy0.d.ts +0 -909
- package/dist/packem_shared/mailgunProvider-D9HUWGKN.js +0 -1
- package/dist/packem_shared/mailjetProvider-DelLs2Vt.js +0 -1
- package/dist/packem_shared/types.d-BId55FW2.d.ts +0 -107
- package/dist/packem_shared/types.d-CmoWvdZi.d.ts +0 -61
- package/dist/packem_shared/types.d-DCkecJse.d.ts +0 -51
- package/dist/packem_shared/types.d-Mpu0HZoG.d.ts +0 -24
- package/dist/packem_shared/types.d-lcJZmwRK.d.ts +0 -69
- package/dist/packem_shared/types.d-nyR1ty1Q.d.ts +0 -9
- package/dist/packem_shared/utils-BfYfPB_I.js +0 -1
- package/dist/packem_shared/verifyMailgunWebhook-Cwl0OD3P.js +0 -1
- package/dist/packem_shared/verifyPostmarkWebhook-C72ZvbrG.js +0 -1
- package/dist/packem_shared/verifyResendWebhook-YK2zNDXR.js +0 -1
- package/dist/packem_shared/verifySendGridWebhook-Dbwc1tfG.js +0 -1
- package/dist/packem_shared/withEvents-CCVblSqj.js +0 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { E as EmailOptions, a as EmailResult, R as Result } from "./types.d-B9295M4_.js";
|
|
2
|
+
/**
|
|
3
|
+
* The terminal send function a middleware wraps — ultimately the provider's `sendEmail`.
|
|
4
|
+
*/
|
|
5
|
+
type SendFunction = (options: EmailOptions) => Promise<Result<EmailResult>>;
|
|
6
|
+
/**
|
|
7
|
+
* A send middleware. Receives the (fully-resolved) message and the `next` function in the chain;
|
|
8
|
+
* may short-circuit, retry, mutate, or observe.
|
|
9
|
+
*
|
|
10
|
+
* Middlewares run in registration order, wrapping outward-in (the first registered runs first and is
|
|
11
|
+
* the outermost wrapper around the provider call).
|
|
12
|
+
* @param options The resolved email options.
|
|
13
|
+
* @param next The next middleware (or the provider send) in the chain.
|
|
14
|
+
* @returns The send result.
|
|
15
|
+
*/
|
|
16
|
+
type Middleware = (options: EmailOptions, next: SendFunction) => Promise<Result<EmailResult>>;
|
|
17
|
+
/**
|
|
18
|
+
* Composes a middleware stack around a terminal send function.
|
|
19
|
+
* @param middlewares The middlewares, in registration order.
|
|
20
|
+
* @param terminal The provider send call at the centre of the chain.
|
|
21
|
+
* @returns A single {@link SendFunction} that runs the whole chain.
|
|
22
|
+
*/
|
|
23
|
+
declare const composeMiddleware: (middlewares: ReadonlyArray<Middleware>, terminal: SendFunction) => SendFunction;
|
|
24
|
+
export { Middleware as M, SendFunction as S, composeMiddleware as c };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template render function type.
|
|
3
|
+
* @param template Template content (string, React component, etc.).
|
|
4
|
+
* @param data Data/variables to pass to the template.
|
|
5
|
+
* @param options Options specific to the template engine.
|
|
6
|
+
* @returns Rendered HTML string.
|
|
7
|
+
*/
|
|
8
|
+
type TemplateRenderer = (template: unknown, data?: Record<string, unknown>, options?: Record<string, unknown>) => string | Promise<string>;
|
|
9
|
+
export { TemplateRenderer as T };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { E as EmailOptions } from "./types.d-B9295M4_.js";
|
|
2
|
+
/**
|
|
3
|
+
* A queued email job.
|
|
4
|
+
*/
|
|
5
|
+
interface QueueJob {
|
|
6
|
+
/**
|
|
7
|
+
* Number of delivery attempts so far.
|
|
8
|
+
*/
|
|
9
|
+
attempts: number;
|
|
10
|
+
/**
|
|
11
|
+
* Unique job id.
|
|
12
|
+
*/
|
|
13
|
+
id: string;
|
|
14
|
+
/**
|
|
15
|
+
* The message to send.
|
|
16
|
+
*/
|
|
17
|
+
message: EmailOptions;
|
|
18
|
+
/**
|
|
19
|
+
* Earliest time (ms since epoch) the job may be delivered. Used for `scheduledAt` and retry backoff.
|
|
20
|
+
*/
|
|
21
|
+
scheduledAt: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Options when enqueueing a message.
|
|
25
|
+
*/
|
|
26
|
+
interface EnqueueOptions {
|
|
27
|
+
/**
|
|
28
|
+
* Deliver no earlier than this time. Accepts a `Date` or epoch milliseconds.
|
|
29
|
+
*/
|
|
30
|
+
scheduledAt?: Date | number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A durable email queue. The in-memory default (`MemoryQueue`) implements this; adapters can
|
|
34
|
+
* back it with Redis/BullMQ, pg-boss, SQS, or `unstorage`.
|
|
35
|
+
*
|
|
36
|
+
* Delivery is reserve → ack/retry: {@link EmailQueue.reserve} hands out a job and hides it for a
|
|
37
|
+
* visibility window; the worker then {@link EmailQueue.ack}s it on success or {@link EmailQueue.retry}s
|
|
38
|
+
* it on failure.
|
|
39
|
+
*/
|
|
40
|
+
interface EmailQueue {
|
|
41
|
+
/**
|
|
42
|
+
* Marks a reserved job as successfully processed and removes it.
|
|
43
|
+
* @param id The job id.
|
|
44
|
+
*/
|
|
45
|
+
ack: (id: string) => Promise<void> | void;
|
|
46
|
+
/**
|
|
47
|
+
* Adds a message to the queue.
|
|
48
|
+
* @param message The message to send later.
|
|
49
|
+
* @param options Optional scheduling. See {@link EnqueueOptions}.
|
|
50
|
+
* @returns The new job id.
|
|
51
|
+
*/
|
|
52
|
+
enqueue: (message: EmailOptions, options?: EnqueueOptions) => Promise<string> | string;
|
|
53
|
+
/**
|
|
54
|
+
* Reserves the next ready job, hiding it from other workers for a visibility window.
|
|
55
|
+
* @returns The next job, or `undefined` when none is ready.
|
|
56
|
+
*/
|
|
57
|
+
reserve: () => (QueueJob | undefined) | Promise<QueueJob | undefined>;
|
|
58
|
+
/**
|
|
59
|
+
* Returns a reserved job to the queue, optionally after a delay, incrementing its attempt count.
|
|
60
|
+
* @param id The job id.
|
|
61
|
+
* @param delayMs Milliseconds to wait before the job becomes ready again.
|
|
62
|
+
*/
|
|
63
|
+
retry: (id: string, delayMs?: number) => Promise<void> | void;
|
|
64
|
+
/**
|
|
65
|
+
* The number of jobs not yet acked (ready + reserved).
|
|
66
|
+
*/
|
|
67
|
+
size: () => number | Promise<number>;
|
|
68
|
+
}
|
|
69
|
+
export { EnqueueOptions as E, QueueJob as Q, EmailQueue as a };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as c}from"node:module";let f;const u=e=>(f??=c(import.meta.url))(e),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,a=e=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[t,r]=s.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return s.getBuiltinModule(e)}return u(e)},{Buffer:i}=a("node:buffer"),{timingSafeEqual:l}=a("node:crypto"),_=(e,t)=>{if(e instanceof Headers)return e.get(t)??void 0;const r=t.toLowerCase();for(const[o,n]of Object.entries(e))if(o.toLowerCase()===r)return Array.isArray(n)?n[0]:n},g=(e,t)=>{const r=i.from(e),o=i.from(t);return r.length!==o.length?!1:l(r,o)},m=(e,t,r=Date.now())=>t<=0?!0:Number.isFinite(e)?Math.abs(r/1e3-e)<=t:!1;export{_ as g,m as i,g as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as l}from"node:module";import{i as g,t as _}from"./utils-DjEtR3qT.js";let m;const p=e=>(m??=l(import.meta.url))(e),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[t,s]=r.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return r.getBuiltinModule(e)}return p(e)},{createHmac:d}=f("node:crypto"),v=e=>{const{now:t,signature:s,signingKey:n,timestamp:i,token:o,tolerance:a=300}=e,c=typeof i=="number"?i:Number.parseInt(i,10);if(!g(c,a,t))return{reason:"timestamp-out-of-tolerance",valid:!1};const u=d("sha256",n).update(`${String(i)}${o}`).digest("hex");return _(s,u)?{valid:!0}:{reason:"signature-mismatch",valid:!1}};export{v as verifyMailgunWebhook};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as a}from"node:module";import{t as d}from"./utils-DjEtR3qT.js";let c;const u=e=>(c??=a(import.meta.url))(e),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[s,t]=r.versions.node.split(".").map(Number);if(s>22||s===22&&t>=3||s===20&&t>=16)return r.getBuiltinModule(e)}return u(e)},{Buffer:l}=f("node:buffer"),p=e=>{const{authorization:s,password:t,username:i}=e;if(!s?.startsWith("Basic "))return{reason:"missing-credentials",valid:!1};const o=l.from(s.slice(6),"base64").toString("utf8"),n=`${i}:${t}`;return d(o,n)?{valid:!0}:{reason:"credentials-mismatch",valid:!1}};export{p as verifyPostmarkWebhook};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as v}from"node:module";import{g as t,i as q,t as w}from"./utils-DjEtR3qT.js";let y;const j=e=>(y??=v(import.meta.url))(e),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[s,o]=r.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return r.getBuiltinModule(e)}return j(e)},{Buffer:u}=l("node:buffer"),{createHmac:k}=l("node:crypto"),T="v1",W=e=>e.startsWith("whsec_")?u.from(e.slice(6),"base64"):u.from(e,"utf8"),x=e=>{const{headers:s,now:o,payload:d,secret:f,tolerance:m=300}=e,n=t(s,"webhook-id")??t(s,"svix-id"),i=t(s,"webhook-timestamp")??t(s,"svix-timestamp"),a=t(s,"webhook-signature")??t(s,"svix-signature");if(!n||!i||!a)return{reason:"missing-headers",valid:!1};const p=Number.parseInt(i,10);if(!q(p,m,o))return{reason:"timestamp-out-of-tolerance",valid:!1};const h=`${n}.${i}.${d}`,_=k("sha256",W(f)).update(h).digest("base64");return a.split(" ").some(g=>{const[b,c]=g.split(",");return b!==T||!c?!1:w(c,_)})?{valid:!0}:{reason:"signature-mismatch",valid:!1}},B=e=>x(e);export{B as verifyResendWebhook,x as verifyStandardWebhook};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as y}from"node:module";import g from"./EmailError-CDvYwuqz.js";import{i as v}from"./utils-DjEtR3qT.js";let _;const b=e=>(_??=y(import.meta.url))(e),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=e=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[r,o]=s.versions.node.split(".").map(Number);if(r>22||r===22&&o>=3||r===20&&o>=16)return s.getBuiltinModule(e)}return b(e)},{Buffer:i}=d("node:buffer"),{verify:h,createPublicKey:l}=d("node:crypto"),j=e=>e.includes("-----BEGIN")?l(e):l({format:"der",key:i.from(e,"base64"),type:"spki"}),w=e=>{const{now:r,payload:o,publicKey:f,signature:n,timestamp:t,tolerance:u=300}=e;if(!n||!t)return{reason:"missing-headers",valid:!1};let a;try{a=j(f)}catch(p){throw new g("webhooks","Failed to parse SendGrid verification key",{cause:p})}const m=i.from(t+o,"utf8");let c;try{c=h("sha256",m,{dsaEncoding:"der",key:a},i.from(n,"base64"))}catch{return{reason:"signature-malformed",valid:!1}}return c?v(Number.parseInt(t,10),u,r)?{valid:!0}:{reason:"timestamp-out-of-tolerance",valid:!1}:{reason:"signature-mismatch",valid:!1}};export{w as verifySendGridWebhook};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as d}from"node:module";let p;const m=e=>(p??=d(import.meta.url))(e),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=e=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[s,t]=i.versions.node.split(".").map(Number);if(s>22||s===22&&t>=3||s===20&&t>=16)return i.getBuiltinModule(e)}return m(e)},{randomUUID:_}=u("node:crypto"),l=e=>(Array.isArray(e)?e[0]:e)?.email,y=(e,s={})=>{const{idFactory:t=_,now:o=Date.now}=s;return async(a,c)=>{const n=l(a.to);e.emit({id:t(),recipient:n,timestamp:new Date(o()),type:"queued"});const r=await c(a);return r.success?e.emit({id:t(),messageId:r.data?.messageId,provider:r.data?.provider,recipient:n,timestamp:new Date(o()),type:"sent"}):e.emit({data:{error:r.error instanceof Error?r.error.message:String(r.error)},id:t(),recipient:n,timestamp:new Date(o()),type:"failed"}),r}};export{y as withEvents};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{filterSuppressed as d}from"./createSuppressionStore-CeAZKCbY.js";import w from"./EmailError-
|
|
1
|
+
import{filterSuppressed as d}from"./createSuppressionStore-CeAZKCbY.js";import w from"./EmailError-CDvYwuqz.js";const u=(o,c={})=>async(e,p)=>{const t={allowed:[],suppressed:[]},r=await d(e.to,o),l=e.cc?await d(e.cc,o):t,s=e.bcc?await d(e.bcc,o):t,a=[...r.suppressed,...l.suppressed,...s.suppressed];return a.length>0&&c.onSuppressed?.(a),r.allowed.length===0&&l.allowed.length===0&&s.allowed.length===0?{error:new w("middleware","All recipients are suppressed",{code:"ALL_SUPPRESSED"}),success:!1}:p({...e,bcc:s.allowed.length>0?s.allowed:void 0,cc:l.allowed.length>0?l.allowed:void 0,to:r.allowed})};export{u as withSuppression};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import l from"./EmailError-
|
|
1
|
+
import l from"./EmailError-CDvYwuqz.js";import y from"./RequiredOptionError-DU2lxzk3.js";import{e as b}from"./generate-message-id-gXAuMz4g.js";import{s as k}from"./headers-to-record-De1Eg951.js";import{m as v}from"./make-request-CylyuRaN.js";import{i as w}from"./retry-CG9iT2wF.js";import{s as A,a as z}from"./sanitize-header-DtQwAnzg.js";import{f as _}from"./validate-email-options-mCM9dVug.js";import{defineProvider as j}from"./defineProvider-C9q-7iwt.js";import{P,h as I,c as T}from"./provider-base-DjPzWncP.js";import{n as h}from"./address-formatter-BWR2Dddx.js";const i="zeptomail",O="https://api.zeptomail.com/v1.1",Z=3e4,E=3,L=j((s={})=>{if(!s.token)throw new y(i,"token");if(!s.token.startsWith("Zoho-enczapikey "))throw new l(i,'Token should be in the format "Zoho-enczapikey <your_api_key>"');const o={debug:s.debug??!1,endpoint:s.endpoint??O,logger:s.logger,retries:s.retries??E,timeout:s.timeout??Z,token:s.token},u=new P,n=T(i,s.logger);return{features:{attachments:!0,batchSending:!1,customHeaders:!0,html:!0,replyTo:!0,scheduling:!1,tagging:!1,templates:!1,tracking:!0},async initialize(){await u.ensureInitialized(async()=>{if(!await this.isAvailable())throw new l(i,"Zeptomail API not available or invalid token");n.debug("Provider initialized successfully")},i)},async isAvailable(){try{return o.token&&o.token.startsWith("Zoho-enczapikey ")?(n.debug("Token format is valid, assuming Zeptomail is available"),!0):!1}catch(e){return n.debug("Error checking availability:",e),!1}},name:i,options:o,async sendEmail(e){try{const m=_(e);if(m.length>0)return{error:new l(i,`Invalid email options: ${m.join(", ")}`),success:!1};await u.ensureInitialized(()=>this.initialize(),i);const a={from:h(e.from).address,subject:e.subject};if(Array.isArray(e.to)?a.to=e.to.length===1?e.to[0].email:e.to.map(t=>t.email):a.to=e.to.email,e.text&&(a.textbody=e.text),e.html&&(a.htmlbody=e.html),e.cc&&(Array.isArray(e.cc)?a.cc=e.cc.length===1?e.cc[0].email:e.cc.map(t=>t.email):a.cc=e.cc.email),e.bcc&&(Array.isArray(e.bcc)?a.bcc=e.bcc.length===1?e.bcc[0].email:e.bcc.map(t=>t.email):a.bcc=e.bcc.email),e.replyTo&&(a.reply_to=[h(e.replyTo).address]),e.trackClicks!==void 0&&(a.track_clicks=e.trackClicks),e.trackOpens!==void 0&&(a.track_opens=e.trackOpens),e.clientReference&&(a.client_reference=e.clientReference),e.mimeHeaders&&Object.keys(e.mimeHeaders).length>0){const t={};for(const[r,d]of Object.entries(e.mimeHeaders))t[r]=d;a.mime_headers=t}if(e.headers){const t=k(e.headers);Object.keys(t).length>0&&(a.mime_headers??={},Object.entries(t).forEach(([r,d])=>{a.mime_headers&&(a.mime_headers[A(r)]=z(d))}))}e.attachments&&e.attachments.length>0&&(a.attachments=e.attachments.map(t=>{const r={name:t.filename};return t.content?(r.content=typeof t.content=="string"?t.content:t.content.toString("base64"),t.contentType&&(r.mime_type=t.contentType)):t.path&&(r.file_cache_key=t.path),r})),n.debug("Sending email via Zeptomail API",{subject:a.subject,to:a.to});const g={Accept:"application/json",Authorization:o.token,"Content-Type":"application/json"},c=await w(async()=>v(`${o.endpoint}/email`,{headers:g,method:"POST",timeout:o.timeout},JSON.stringify(a)),o.retries);if(!c.success){n.debug("API request failed",c.error);let t=c.error instanceof Error?c.error.message:"Unknown error";const r=c.data;return r?.body?.message?t+=` Details: ${r.body.message}`:r?.body?.error?.message&&(t+=` Details: ${r.body.error.message}`),{error:new l(i,`Failed to send email: ${t}`,{cause:c.error}),success:!1}}const p=c.data?.body,f=p?.request_id??b();return n.debug("Email sent successfully",{messageId:f}),{data:{messageId:f,provider:i,response:p,sent:!0,timestamp:new Date},success:!0}}catch(m){return{error:I(i,"send email",m,n),success:!1}}},async validateCredentials(){return this.isAvailable()}}});export{L as default};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { P as ProviderFactory } from "../../packem_shared/provider.d-
|
|
2
|
-
export type { a as Provider } from "../../packem_shared/provider.d-
|
|
3
|
-
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-
|
|
1
|
+
import { P as ProviderFactory } from "../../packem_shared/provider.d-Cx5YQJdP.js";
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-Cx5YQJdP.js";
|
|
3
|
+
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-B9295M4_.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
6
|
-
* AhaSend configuration
|
|
7
|
-
*/
|
|
6
|
+
* AhaSend configuration
|
|
7
|
+
*/
|
|
8
8
|
interface AhaSendConfig extends BaseConfig {
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
* AhaSend API key
|
|
11
|
+
*/
|
|
12
12
|
apiKey: string;
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
* AhaSend API endpoint
|
|
15
|
+
* Defaults to: https://api.ahasend.com
|
|
16
|
+
*/
|
|
17
17
|
endpoint?: string;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* AhaSend-specific email options
|
|
21
|
-
*/
|
|
20
|
+
* AhaSend-specific email options
|
|
21
|
+
*/
|
|
22
22
|
interface AhaSendEmailOptions extends EmailOptions {
|
|
23
23
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
* AhaSend template ID for template-based emails
|
|
25
|
+
*/
|
|
26
26
|
templateId?: string;
|
|
27
27
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
* Template variables for AhaSend templates
|
|
29
|
+
*/
|
|
30
30
|
templateVariables?: Record<string, unknown>;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
* AhaSend Provider for sending emails through AhaSend API
|
|
34
|
-
*/
|
|
33
|
+
* AhaSend Provider for sending emails through AhaSend API
|
|
34
|
+
*/
|
|
35
35
|
declare const ahaSendProvider: ProviderFactory<AhaSendConfig>;
|
|
36
36
|
export { type AhaSendConfig, type AhaSendEmailOptions, type ProviderFactory, ahaSendProvider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as r}from"../../packem_shared/ahaSendProvider-
|
|
1
|
+
import{default as r}from"../../packem_shared/ahaSendProvider-br1yB2un.js";export{r as ahaSendProvider};
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { P as ProviderFactory } from "../../packem_shared/provider.d-
|
|
2
|
-
export type { a as Provider } from "../../packem_shared/provider.d-
|
|
3
|
-
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-
|
|
1
|
+
import { P as ProviderFactory } from "../../packem_shared/provider.d-Cx5YQJdP.js";
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-Cx5YQJdP.js";
|
|
3
|
+
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-B9295M4_.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
6
|
-
* AutoSend configuration.
|
|
7
|
-
*/
|
|
6
|
+
* AutoSend configuration.
|
|
7
|
+
*/
|
|
8
8
|
interface AutoSendConfig extends BaseConfig {
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
* AutoSend API key (sent as a Bearer token).
|
|
11
|
+
*/
|
|
12
12
|
apiKey: string;
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
* API endpoint override (default `https://api.autosend.com/v1`).
|
|
15
|
+
*/
|
|
16
16
|
endpoint?: string;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* AutoSend-specific email options.
|
|
20
|
-
*
|
|
21
|
-
* See the [send reference](https://docs.autosend.com/api-reference/mails/send). AutoSend's
|
|
22
|
-
* `/mails/send` takes exactly one `to` recipient — pass a single address, and use `cc`/`bcc`
|
|
23
|
-
* for additional ones.
|
|
24
|
-
*/
|
|
19
|
+
* AutoSend-specific email options.
|
|
20
|
+
*
|
|
21
|
+
* See the [send reference](https://docs.autosend.com/api-reference/mails/send). AutoSend's
|
|
22
|
+
* `/mails/send` takes exactly one `to` recipient — pass a single address, and use `cc`/`bcc`
|
|
23
|
+
* for additional ones.
|
|
24
|
+
*/
|
|
25
25
|
interface AutoSendEmailOptions extends EmailOptions {
|
|
26
26
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
* Sends even if the recipient is on the suppression list. Use sparingly: suppressions exist
|
|
28
|
+
* to protect the sending domain's reputation.
|
|
29
|
+
*/
|
|
30
30
|
bypassSuppressions?: boolean;
|
|
31
31
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
* Values substituted into Handlebars placeholders (`{{ name }}`) in the template or `html`.
|
|
33
|
+
*/
|
|
34
34
|
dynamicData?: Record<string, unknown>;
|
|
35
35
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
* An AutoSend template id, used instead of `html` / `text`.
|
|
37
|
+
*/
|
|
38
38
|
templateId?: string;
|
|
39
39
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
* Enables click tracking for this message.
|
|
41
|
+
*/
|
|
42
42
|
trackingClick?: boolean;
|
|
43
43
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
* Enables open tracking for this message.
|
|
45
|
+
*/
|
|
46
46
|
trackingOpen?: boolean;
|
|
47
47
|
/**
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
* The unsubscribe group this message belongs to.
|
|
49
|
+
*/
|
|
50
50
|
unsubscribeGroupId?: string;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* AutoSend provider — sends through the [AutoSend send endpoint](https://docs.autosend.com/api-reference/mails/send).
|
|
54
|
-
*/
|
|
53
|
+
* AutoSend provider — sends through the [AutoSend send endpoint](https://docs.autosend.com/api-reference/mails/send).
|
|
54
|
+
*/
|
|
55
55
|
declare const autoSendProvider: ProviderFactory<AutoSendConfig, unknown, AutoSendEmailOptions>;
|
|
56
56
|
export { type AutoSendConfig, type AutoSendEmailOptions, type ProviderFactory, autoSendProvider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as r}from"../../packem_shared/autoSendProvider-
|
|
1
|
+
import{default as r}from"../../packem_shared/autoSendProvider-BSP8ueOC.js";export{r as autoSendProvider};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { P as ProviderFactory } from "../../packem_shared/provider.d-
|
|
2
|
-
export type { a as Provider } from "../../packem_shared/provider.d-
|
|
3
|
-
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-
|
|
1
|
+
import { P as ProviderFactory } from "../../packem_shared/provider.d-Cx5YQJdP.js";
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-Cx5YQJdP.js";
|
|
3
|
+
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-B9295M4_.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
6
|
-
* AWS SES configuration
|
|
7
|
-
*/
|
|
6
|
+
* AWS SES configuration
|
|
7
|
+
*/
|
|
8
8
|
interface AwsSesConfig extends BaseConfig {
|
|
9
9
|
accessKeyId: string;
|
|
10
10
|
apiVersion?: string;
|
|
@@ -15,33 +15,33 @@ interface AwsSesConfig extends BaseConfig {
|
|
|
15
15
|
sessionToken?: string;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* AWS SES-specific email options
|
|
19
|
-
*/
|
|
18
|
+
* AWS SES-specific email options
|
|
19
|
+
*/
|
|
20
20
|
interface AwsSesEmailOptions extends EmailOptions {
|
|
21
21
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
* Configuration set name
|
|
23
|
+
*/
|
|
24
24
|
configurationSetName?: string;
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
* Message tags as key-value pairs
|
|
27
|
+
*/
|
|
28
28
|
messageTags?: Record<string, string>;
|
|
29
29
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
* Return path email address
|
|
31
|
+
*/
|
|
32
32
|
returnPath?: string;
|
|
33
33
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
* Return path ARN
|
|
35
|
+
*/
|
|
36
36
|
returnPathArn?: string;
|
|
37
37
|
/**
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
* Source ARN for sending authorization
|
|
39
|
+
*/
|
|
40
40
|
sourceArn?: string;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
* AWS SES Email Provider Implementation - Zero dependency version
|
|
44
|
-
* Uses native Node.js APIs instead of AWS SDK
|
|
45
|
-
*/
|
|
43
|
+
* AWS SES Email Provider Implementation - Zero dependency version
|
|
44
|
+
* Uses native Node.js APIs instead of AWS SDK
|
|
45
|
+
*/
|
|
46
46
|
declare const awsSesProvider: ProviderFactory<AwsSesConfig>;
|
|
47
47
|
export { type AwsSesConfig, type AwsSesEmailOptions, type ProviderFactory, awsSesProvider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as a}from"../../packem_shared/awsSesProvider-
|
|
1
|
+
import{default as a}from"../../packem_shared/awsSesProvider-zRICW1pH.js";export{a as awsSesProvider};
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { P as ProviderFactory } from "../../packem_shared/provider.d-
|
|
2
|
-
export type { a as Provider } from "../../packem_shared/provider.d-
|
|
3
|
-
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-
|
|
1
|
+
import { P as ProviderFactory } from "../../packem_shared/provider.d-Cx5YQJdP.js";
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-Cx5YQJdP.js";
|
|
3
|
+
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-B9295M4_.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
6
|
-
* Azure Communication Services configuration
|
|
7
|
-
*/
|
|
6
|
+
* Azure Communication Services configuration
|
|
7
|
+
*/
|
|
8
8
|
interface AzureConfig extends BaseConfig {
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
* Azure AD access token (for OAuth2 authentication)
|
|
11
|
+
*/
|
|
12
12
|
accessToken?: string;
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
* Azure Communication Services connection string or access token
|
|
15
|
+
*/
|
|
16
16
|
connectionString?: string;
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
* Azure Communication Services endpoint
|
|
19
|
+
* Defaults to: https://{region}.communication.azure.com
|
|
20
|
+
*/
|
|
21
21
|
endpoint?: string;
|
|
22
22
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
* Azure region (e.g., "eastus", "westus")
|
|
24
|
+
*/
|
|
25
25
|
region: string;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* Azure-specific email options
|
|
29
|
-
*/
|
|
28
|
+
* Azure-specific email options
|
|
29
|
+
*/
|
|
30
30
|
interface AzureEmailOptions extends EmailOptions {
|
|
31
31
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
* Custom headers
|
|
33
|
+
*/
|
|
34
34
|
headers?: Record<string, string>;
|
|
35
35
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
* Importance level (normal, high)
|
|
37
|
+
*/
|
|
38
38
|
importance?: "normal" | "high";
|
|
39
39
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
* Azure template ID for template-based emails
|
|
41
|
+
*/
|
|
42
42
|
templateId?: string;
|
|
43
43
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
* Template variables for Azure templates
|
|
45
|
+
*/
|
|
46
46
|
templateVariables?: Record<string, unknown>;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* Azure Communication Services Provider for sending emails through Azure API
|
|
50
|
-
*/
|
|
49
|
+
* Azure Communication Services Provider for sending emails through Azure API
|
|
50
|
+
*/
|
|
51
51
|
declare const azureProvider: ProviderFactory<AzureConfig, unknown, AzureEmailOptions>;
|
|
52
52
|
export { type AzureConfig, type AzureEmailOptions, type ProviderFactory, azureProvider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as a}from"../../packem_shared/azureProvider-
|
|
1
|
+
import{default as a}from"../../packem_shared/azureProvider-DwN4c5dC.js";export{a as azureProvider};
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import { P as ProviderFactory } from "../../packem_shared/provider.d-
|
|
2
|
-
export type { a as Provider } from "../../packem_shared/provider.d-
|
|
3
|
-
import { B as BaseConfig, E as EmailOptions, c as EmailAddress } from "../../packem_shared/types.d-
|
|
1
|
+
import { P as ProviderFactory } from "../../packem_shared/provider.d-Cx5YQJdP.js";
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-Cx5YQJdP.js";
|
|
3
|
+
import { B as BaseConfig, E as EmailOptions, c as EmailAddress } from "../../packem_shared/types.d-B9295M4_.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
6
|
-
* Brevo configuration
|
|
7
|
-
*/
|
|
6
|
+
* Brevo configuration
|
|
7
|
+
*/
|
|
8
8
|
interface BrevoConfig extends BaseConfig {
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
* Brevo API key
|
|
11
|
+
*/
|
|
12
12
|
apiKey: string;
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
* Brevo API endpoint
|
|
15
|
+
* Defaults to: https://api.brevo.com/v3
|
|
16
|
+
*/
|
|
17
17
|
endpoint?: string;
|
|
18
18
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
* Enable hard validation for replyTo addresses.
|
|
20
|
+
* If true, arrays will be rejected. If false, the first address from an array will be used.
|
|
21
|
+
* Defaults to: false
|
|
22
|
+
*/
|
|
23
23
|
hardValidation?: boolean;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
* Brevo-specific email options
|
|
27
|
-
*/
|
|
26
|
+
* Brevo-specific email options
|
|
27
|
+
*/
|
|
28
28
|
interface BrevoEmailOptions extends Omit<EmailOptions, "replyTo"> {
|
|
29
29
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
* Batch ID for batch sending
|
|
31
|
+
*/
|
|
32
32
|
batchId?: string;
|
|
33
33
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
* Headers (custom headers)
|
|
35
|
+
*/
|
|
36
36
|
headers?: Record<string, string>;
|
|
37
37
|
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
* Reply-to email address (can override base replyTo).
|
|
39
|
+
* Only one address is allowed. If an array is provided and hardValidation is false, the first address will be used.
|
|
40
|
+
*/
|
|
41
41
|
replyTo?: EmailAddress | EmailAddress[];
|
|
42
42
|
/**
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
* Scheduled date/time
|
|
44
|
+
* - If string: ISO 8601 format (e.g., "2025-01-15T10:00:00Z")
|
|
45
|
+
* - If number: Unix timestamp in seconds (not milliseconds)
|
|
46
|
+
*/
|
|
47
47
|
scheduledAt?: string | number;
|
|
48
48
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
* Tags for categorization
|
|
50
|
+
*/
|
|
51
51
|
tags?: string[];
|
|
52
52
|
/**
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
* Brevo template ID for template-based emails
|
|
54
|
+
*/
|
|
55
55
|
templateId?: number;
|
|
56
56
|
/**
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
* Template parameters for Brevo templates
|
|
58
|
+
*/
|
|
59
59
|
templateParams?: Record<string, unknown>;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
|
-
* Brevo Provider for sending emails through Brevo API
|
|
63
|
-
*/
|
|
62
|
+
* Brevo Provider for sending emails through Brevo API
|
|
63
|
+
*/
|
|
64
64
|
declare const brevoProvider: ProviderFactory<BrevoConfig, unknown, BrevoEmailOptions>;
|
|
65
65
|
export { type BrevoConfig, type BrevoEmailOptions, type ProviderFactory, brevoProvider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as o}from"../../packem_shared/brevoProvider-
|
|
1
|
+
import{default as o}from"../../packem_shared/brevoProvider-C491beE_.js";export{o as brevoProvider};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { P as ProviderFactory } from "../../packem_shared/provider.d-
|
|
2
|
-
export type { a as Provider } from "../../packem_shared/provider.d-
|
|
3
|
-
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-
|
|
1
|
+
import { P as ProviderFactory } from "../../packem_shared/provider.d-Cx5YQJdP.js";
|
|
2
|
+
export type { a as Provider } from "../../packem_shared/provider.d-Cx5YQJdP.js";
|
|
3
|
+
import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-B9295M4_.js";
|
|
4
4
|
import 'node:buffer';
|
|
5
5
|
/**
|
|
6
|
-
* Cloudflare Email Workers configuration.
|
|
7
|
-
*
|
|
8
|
-
* Cloudflare's send binding lives in the Workers runtime, so you wire it up yourself and pass a thin
|
|
9
|
-
* `send` function — keeping this provider runtime-agnostic and testable.
|
|
10
|
-
*/
|
|
6
|
+
* Cloudflare Email Workers configuration.
|
|
7
|
+
*
|
|
8
|
+
* Cloudflare's send binding lives in the Workers runtime, so you wire it up yourself and pass a thin
|
|
9
|
+
* `send` function — keeping this provider runtime-agnostic and testable.
|
|
10
|
+
*/
|
|
11
11
|
interface CloudflareEmailConfig extends BaseConfig {
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
* Sends a raw RFC 822 message via your Worker's Email binding.
|
|
14
|
+
* @param from The envelope-from address.
|
|
15
|
+
* @param to The single recipient address.
|
|
16
|
+
* @param raw The full RFC 822 (EML) message.
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* send: async (from, to, raw) => {
|
|
20
|
+
* const { EmailMessage } = await import("cloudflare:email");
|
|
21
|
+
* await env.SEND_EMAIL.send(new EmailMessage(from, to, raw));
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
25
|
send: (from: string, to: string, raw: string) => Promise<void>;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* Cloudflare Email-specific options.
|
|
29
|
-
*/
|
|
28
|
+
* Cloudflare Email-specific options.
|
|
29
|
+
*/
|
|
30
30
|
type CloudflareEmailOptions = EmailOptions;
|
|
31
31
|
/**
|
|
32
|
-
* Cloudflare Email Workers provider — sends a raw RFC 822 message through a Worker's Email send
|
|
33
|
-
* binding (supplied via {@link CloudflareEmailConfig.send}). Single-recipient only, per the binding.
|
|
34
|
-
*/
|
|
32
|
+
* Cloudflare Email Workers provider — sends a raw RFC 822 message through a Worker's Email send
|
|
33
|
+
* binding (supplied via {@link CloudflareEmailConfig.send}). Single-recipient only, per the binding.
|
|
34
|
+
*/
|
|
35
35
|
declare const cloudflareEmailProvider: ProviderFactory<CloudflareEmailConfig>;
|
|
36
36
|
export { type CloudflareEmailConfig, type CloudflareEmailOptions, type ProviderFactory, cloudflareEmailProvider };
|