@visulima/email 2.1.5 → 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 +14 -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
package/dist/inbound/index.d.ts
CHANGED
|
@@ -1,175 +1,175 @@
|
|
|
1
|
-
import { M as MaybePromise } from "../packem_shared/types.d-
|
|
1
|
+
import { M as MaybePromise } from "../packem_shared/types.d-B9295M4_.js";
|
|
2
2
|
import 'node:buffer';
|
|
3
3
|
/**
|
|
4
|
-
* A parsed address from an inbound message.
|
|
5
|
-
*/
|
|
4
|
+
* A parsed address from an inbound message.
|
|
5
|
+
*/
|
|
6
6
|
interface InboundAddress {
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
* The email address.
|
|
9
|
+
*/
|
|
10
10
|
email: string;
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
* The display name, when present.
|
|
13
|
+
*/
|
|
14
14
|
name?: string;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* An attachment on an inbound message.
|
|
18
|
-
*/
|
|
17
|
+
* An attachment on an inbound message.
|
|
18
|
+
*/
|
|
19
19
|
interface InboundAttachment {
|
|
20
20
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
* The Content-ID, for inline attachments.
|
|
22
|
+
*/
|
|
23
23
|
cid?: string;
|
|
24
24
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
* Base64-encoded content, when the provider includes it inline.
|
|
26
|
+
*/
|
|
27
27
|
content?: string;
|
|
28
28
|
/**
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
* The MIME type.
|
|
30
|
+
*/
|
|
31
31
|
contentType?: string;
|
|
32
32
|
/**
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
* The filename.
|
|
34
|
+
*/
|
|
35
35
|
filename: string;
|
|
36
36
|
/**
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
* The size in bytes, when reported.
|
|
38
|
+
*/
|
|
39
39
|
size?: number;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
|
-
* A normalized inbound email, produced from any provider's inbound webhook/event payload.
|
|
43
|
-
*
|
|
44
|
-
* This is the common shape every `parse*Inbound` adapter maps onto, so downstream code is
|
|
45
|
-
* provider-agnostic.
|
|
46
|
-
*/
|
|
42
|
+
* A normalized inbound email, produced from any provider's inbound webhook/event payload.
|
|
43
|
+
*
|
|
44
|
+
* This is the common shape every `parse*Inbound` adapter maps onto, so downstream code is
|
|
45
|
+
* provider-agnostic.
|
|
46
|
+
*/
|
|
47
47
|
interface InboundEmail {
|
|
48
48
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
* Attachments included on the message.
|
|
50
|
+
*/
|
|
51
51
|
attachments: InboundAttachment[];
|
|
52
52
|
/**
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
* Blind carbon-copy recipients.
|
|
54
|
+
*/
|
|
55
55
|
bcc: InboundAddress[];
|
|
56
56
|
/**
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
* Carbon-copy recipients.
|
|
58
|
+
*/
|
|
59
59
|
cc: InboundAddress[];
|
|
60
60
|
/**
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
* The sender.
|
|
62
|
+
*/
|
|
63
63
|
from?: InboundAddress;
|
|
64
64
|
/**
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
* All headers, keyed by lower-cased name.
|
|
66
|
+
*/
|
|
67
67
|
headers: Record<string, string>;
|
|
68
68
|
/**
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
* The HTML body, when present.
|
|
70
|
+
*/
|
|
71
71
|
html?: string;
|
|
72
72
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
* The `In-Reply-To` header value (a Message-ID), when present.
|
|
74
|
+
*/
|
|
75
75
|
inReplyTo?: string;
|
|
76
76
|
/**
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
* The canonical `Message-ID` of this message, when present.
|
|
78
|
+
*/
|
|
79
79
|
messageId?: string;
|
|
80
80
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
* The provider this message was parsed from.
|
|
82
|
+
*/
|
|
83
83
|
provider: string;
|
|
84
84
|
/**
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
* The raw payload the adapter received, for provider-specific fields.
|
|
86
|
+
*/
|
|
87
87
|
raw?: unknown;
|
|
88
88
|
/**
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
* Message-IDs from the `References` header, oldest first.
|
|
90
|
+
*/
|
|
91
91
|
references: string[];
|
|
92
92
|
/**
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
* The `Reply-To` address, when present.
|
|
94
|
+
*/
|
|
95
95
|
replyTo?: InboundAddress;
|
|
96
96
|
/**
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
* The subject line.
|
|
98
|
+
*/
|
|
99
99
|
subject?: string;
|
|
100
100
|
/**
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
* The plain-text body, when present.
|
|
102
|
+
*/
|
|
103
103
|
text?: string;
|
|
104
104
|
/**
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
* Primary (`To`) recipients.
|
|
106
|
+
*/
|
|
107
107
|
to: InboundAddress[];
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
|
-
* The inbound providers {@link parseInbound} can normalize.
|
|
111
|
-
*/
|
|
110
|
+
* The inbound providers {@link parseInbound} can normalize.
|
|
111
|
+
*/
|
|
112
112
|
type InboundProvider = "cloudflare" | "mailgun" | "postmark" | "sendgrid" | "ses";
|
|
113
113
|
/**
|
|
114
|
-
* Normalizes a provider-specific inbound webhook payload into the common {@link InboundEmail} shape.
|
|
115
|
-
* @param provider The provider the payload came from.
|
|
116
|
-
* @param payload The raw (already JSON/form-decoded) payload.
|
|
117
|
-
* @returns The normalized inbound email.
|
|
118
|
-
*/
|
|
114
|
+
* Normalizes a provider-specific inbound webhook payload into the common {@link InboundEmail} shape.
|
|
115
|
+
* @param provider The provider the payload came from.
|
|
116
|
+
* @param payload The raw (already JSON/form-decoded) payload.
|
|
117
|
+
* @returns The normalized inbound email.
|
|
118
|
+
*/
|
|
119
119
|
declare const parseInbound: (provider: InboundProvider, payload: unknown) => InboundEmail;
|
|
120
120
|
/**
|
|
121
|
-
* Options for {@link defineInboundHandler}.
|
|
122
|
-
*/
|
|
121
|
+
* Options for {@link defineInboundHandler}.
|
|
122
|
+
*/
|
|
123
123
|
interface InboundHandlerOptions {
|
|
124
124
|
/**
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
* Invoked when a payload fails to parse or `onMessage` throws. When omitted, the error propagates.
|
|
126
|
+
* @param error The thrown error.
|
|
127
|
+
* @param provider The provider being handled.
|
|
128
|
+
* @param payload The offending payload.
|
|
129
|
+
*/
|
|
130
130
|
onError?: (error: unknown, provider: InboundProvider, payload: unknown) => MaybePromise<void>;
|
|
131
131
|
/**
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
* Invoked with each normalized inbound message.
|
|
133
|
+
* @param email The normalized inbound email.
|
|
134
|
+
*/
|
|
135
135
|
onMessage: (email: InboundEmail) => MaybePromise<void>;
|
|
136
136
|
/**
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
* Strip quoted history from the plain-text body (via {@link extractReply}) before `onMessage`.
|
|
138
|
+
* @default false
|
|
139
|
+
*/
|
|
140
140
|
stripReply?: boolean;
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
|
-
* A unified inbound handler created by {@link defineInboundHandler}.
|
|
144
|
-
*/
|
|
143
|
+
* A unified inbound handler created by {@link defineInboundHandler}.
|
|
144
|
+
*/
|
|
145
145
|
interface InboundHandler {
|
|
146
146
|
/**
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
147
|
+
* Parses a provider payload, optionally strips quoted history, and dispatches it to `onMessage`.
|
|
148
|
+
* @param provider The provider the payload came from.
|
|
149
|
+
* @param payload The raw payload.
|
|
150
|
+
* @returns The normalized email, or `undefined` when an error was handled by `onError`.
|
|
151
|
+
*/
|
|
152
152
|
handle: (provider: InboundProvider, payload: unknown) => Promise<InboundEmail | undefined>;
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
|
-
* Creates a single inbound entry point over the five provider parsers — parse, optionally strip the
|
|
156
|
-
* reply quote, then dispatch to your `onMessage` callback.
|
|
157
|
-
* @param options Handler options. See {@link InboundHandlerOptions}.
|
|
158
|
-
* @returns The handler. See {@link InboundHandler}.
|
|
159
|
-
* @example
|
|
160
|
-
* ```ts
|
|
161
|
-
* const handler = defineInboundHandler({ stripReply: true, onMessage: (email) => saveReply(email) });
|
|
162
|
-
*
|
|
163
|
-
* app.post("/inbound/postmark", async (req) => { await handler.handle("postmark", req.body); });
|
|
164
|
-
* ```
|
|
165
|
-
*/
|
|
155
|
+
* Creates a single inbound entry point over the five provider parsers — parse, optionally strip the
|
|
156
|
+
* reply quote, then dispatch to your `onMessage` callback.
|
|
157
|
+
* @param options Handler options. See {@link InboundHandlerOptions}.
|
|
158
|
+
* @returns The handler. See {@link InboundHandler}.
|
|
159
|
+
* @example
|
|
160
|
+
* ```ts
|
|
161
|
+
* const handler = defineInboundHandler({ stripReply: true, onMessage: (email) => saveReply(email) });
|
|
162
|
+
*
|
|
163
|
+
* app.post("/inbound/postmark", async (req) => { await handler.handle("postmark", req.body); });
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
166
|
declare const defineInboundHandler: (options: InboundHandlerOptions) => InboundHandler;
|
|
167
167
|
/**
|
|
168
|
-
* The shape of a Cloudflare Email Workers message, narrowed to what the parser reads.
|
|
169
|
-
*
|
|
170
|
-
* Cloudflare delivers a `ForwardableEmailMessage` with `from`, `to`, and a `Headers` object; the body
|
|
171
|
-
* arrives as a raw stream you must parse yourself, so pass the decoded `text`/`html` alongside it.
|
|
172
|
-
*/
|
|
168
|
+
* The shape of a Cloudflare Email Workers message, narrowed to what the parser reads.
|
|
169
|
+
*
|
|
170
|
+
* Cloudflare delivers a `ForwardableEmailMessage` with `from`, `to`, and a `Headers` object; the body
|
|
171
|
+
* arrives as a raw stream you must parse yourself, so pass the decoded `text`/`html` alongside it.
|
|
172
|
+
*/
|
|
173
173
|
interface CloudflareEmailLike {
|
|
174
174
|
from?: string;
|
|
175
175
|
headers?: Headers | Record<string, string>;
|
|
@@ -178,14 +178,14 @@ interface CloudflareEmailLike {
|
|
|
178
178
|
to?: string;
|
|
179
179
|
}
|
|
180
180
|
/**
|
|
181
|
-
* Parses a [Cloudflare Email Workers](https://developers.cloudflare.com/email-routing/email-workers/)
|
|
182
|
-
* message into the normalized {@link InboundEmail} shape.
|
|
183
|
-
*
|
|
184
|
-
* Because Cloudflare exposes the body only as a raw stream, decode it first and pass the result via
|
|
185
|
-
* `text`/`html`.
|
|
186
|
-
* @param message The Cloudflare email message (plus optionally the decoded body).
|
|
187
|
-
* @returns The normalized inbound email.
|
|
188
|
-
*/
|
|
181
|
+
* Parses a [Cloudflare Email Workers](https://developers.cloudflare.com/email-routing/email-workers/)
|
|
182
|
+
* message into the normalized {@link InboundEmail} shape.
|
|
183
|
+
*
|
|
184
|
+
* Because Cloudflare exposes the body only as a raw stream, decode it first and pass the result via
|
|
185
|
+
* `text`/`html`.
|
|
186
|
+
* @param message The Cloudflare email message (plus optionally the decoded body).
|
|
187
|
+
* @returns The normalized inbound email.
|
|
188
|
+
*/
|
|
189
189
|
declare const parseCloudflareInbound: (message: CloudflareEmailLike) => InboundEmail;
|
|
190
190
|
interface MailgunInboundPayload {
|
|
191
191
|
[key: string]: unknown;
|
|
@@ -203,11 +203,11 @@ interface MailgunInboundPayload {
|
|
|
203
203
|
To?: string;
|
|
204
204
|
}
|
|
205
205
|
/**
|
|
206
|
-
* Parses a [Mailgun inbound](https://documentation.mailgun.com/docs/mailgun/user-manual/receive-forward-store/)
|
|
207
|
-
* route payload into the normalized {@link InboundEmail} shape.
|
|
208
|
-
* @param payload The parsed form fields of the Mailgun inbound request.
|
|
209
|
-
* @returns The normalized inbound email.
|
|
210
|
-
*/
|
|
206
|
+
* Parses a [Mailgun inbound](https://documentation.mailgun.com/docs/mailgun/user-manual/receive-forward-store/)
|
|
207
|
+
* route payload into the normalized {@link InboundEmail} shape.
|
|
208
|
+
* @param payload The parsed form fields of the Mailgun inbound request.
|
|
209
|
+
* @returns The normalized inbound email.
|
|
210
|
+
*/
|
|
211
211
|
declare const parseMailgunInbound: (payload: MailgunInboundPayload) => InboundEmail;
|
|
212
212
|
interface PostmarkFullAddress {
|
|
213
213
|
Email?: string;
|
|
@@ -237,11 +237,11 @@ interface PostmarkInboundPayload {
|
|
|
237
237
|
ToFull?: PostmarkFullAddress[];
|
|
238
238
|
}
|
|
239
239
|
/**
|
|
240
|
-
* Parses a [Postmark inbound](https://postmarkapp.com/developer/webhooks/inbound-webhook) webhook
|
|
241
|
-
* payload into the normalized {@link InboundEmail} shape.
|
|
242
|
-
* @param payload The parsed JSON body of the Postmark inbound webhook.
|
|
243
|
-
* @returns The normalized inbound email.
|
|
244
|
-
*/
|
|
240
|
+
* Parses a [Postmark inbound](https://postmarkapp.com/developer/webhooks/inbound-webhook) webhook
|
|
241
|
+
* payload into the normalized {@link InboundEmail} shape.
|
|
242
|
+
* @param payload The parsed JSON body of the Postmark inbound webhook.
|
|
243
|
+
* @returns The normalized inbound email.
|
|
244
|
+
*/
|
|
245
245
|
declare const parsePostmarkInbound: (payload: PostmarkInboundPayload) => InboundEmail;
|
|
246
246
|
interface SendGridInboundPayload {
|
|
247
247
|
[key: string]: unknown;
|
|
@@ -254,12 +254,12 @@ interface SendGridInboundPayload {
|
|
|
254
254
|
to?: string;
|
|
255
255
|
}
|
|
256
256
|
/**
|
|
257
|
-
* Parses a [SendGrid Inbound Parse](https://www.twilio.com/docs/sendgrid/for-developers/parsing-email/setting-up-the-inbound-parse-webhook)
|
|
258
|
-
* payload (the multipart fields, already decoded into an object) into the normalized
|
|
259
|
-
* {@link InboundEmail} shape.
|
|
260
|
-
* @param payload The decoded Inbound Parse fields.
|
|
261
|
-
* @returns The normalized inbound email.
|
|
262
|
-
*/
|
|
257
|
+
* Parses a [SendGrid Inbound Parse](https://www.twilio.com/docs/sendgrid/for-developers/parsing-email/setting-up-the-inbound-parse-webhook)
|
|
258
|
+
* payload (the multipart fields, already decoded into an object) into the normalized
|
|
259
|
+
* {@link InboundEmail} shape.
|
|
260
|
+
* @param payload The decoded Inbound Parse fields.
|
|
261
|
+
* @returns The normalized inbound email.
|
|
262
|
+
*/
|
|
263
263
|
declare const parseSendGridInbound: (payload: SendGridInboundPayload) => InboundEmail;
|
|
264
264
|
interface SesCommonHeaders {
|
|
265
265
|
cc?: string[];
|
|
@@ -286,90 +286,90 @@ interface SesInboundPayload {
|
|
|
286
286
|
text?: string;
|
|
287
287
|
}
|
|
288
288
|
/**
|
|
289
|
-
* Parses an [Amazon SES inbound](https://docs.aws.amazon.com/ses/latest/dg/receiving-email-action-lambda.html)
|
|
290
|
-
* notification (the `mail` object, typically delivered via SNS/Lambda) into the normalized
|
|
291
|
-
* {@link InboundEmail} shape.
|
|
292
|
-
*
|
|
293
|
-
* SES does not include the decoded body in the notification — fetch it from S3 (or pass it directly)
|
|
294
|
-
* and supply it via `text`/`html`.
|
|
295
|
-
* @param payload The SES notification, with optional decoded body.
|
|
296
|
-
* @returns The normalized inbound email.
|
|
297
|
-
*/
|
|
289
|
+
* Parses an [Amazon SES inbound](https://docs.aws.amazon.com/ses/latest/dg/receiving-email-action-lambda.html)
|
|
290
|
+
* notification (the `mail` object, typically delivered via SNS/Lambda) into the normalized
|
|
291
|
+
* {@link InboundEmail} shape.
|
|
292
|
+
*
|
|
293
|
+
* SES does not include the decoded body in the notification — fetch it from S3 (or pass it directly)
|
|
294
|
+
* and supply it via `text`/`html`.
|
|
295
|
+
* @param payload The SES notification, with optional decoded body.
|
|
296
|
+
* @returns The normalized inbound email.
|
|
297
|
+
*/
|
|
298
298
|
declare const parseSesInbound: (payload: SesInboundPayload) => InboundEmail;
|
|
299
299
|
/**
|
|
300
|
-
* Options for {@link extractReply}.
|
|
301
|
-
*/
|
|
300
|
+
* Options for {@link extractReply}.
|
|
301
|
+
*/
|
|
302
302
|
interface ExtractReplyOptions {
|
|
303
303
|
/**
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
304
|
+
* Also strip a trailing signature block (everything after a `-- ` delimiter line).
|
|
305
|
+
* @default true
|
|
306
|
+
*/
|
|
307
307
|
stripSignature?: boolean;
|
|
308
308
|
}
|
|
309
309
|
/**
|
|
310
|
-
* Extracts the new reply text from a plain-text email body, stripping quoted history and (optionally)
|
|
311
|
-
* the trailing signature.
|
|
312
|
-
*
|
|
313
|
-
* Uses the same heuristics email clients use: quote markers (`>`), localized attribution lines
|
|
314
|
-
* (EN/DE/FR/ES/TR), Outlook/`Original Message` separators, and the RFC 3676 `-- ` signature delimiter.
|
|
315
|
-
* @param text The plain-text body.
|
|
316
|
-
* @param options Extraction options. See {@link ExtractReplyOptions}.
|
|
317
|
-
* @returns The trimmed reply text with quoted history removed.
|
|
318
|
-
*/
|
|
310
|
+
* Extracts the new reply text from a plain-text email body, stripping quoted history and (optionally)
|
|
311
|
+
* the trailing signature.
|
|
312
|
+
*
|
|
313
|
+
* Uses the same heuristics email clients use: quote markers (`>`), localized attribution lines
|
|
314
|
+
* (EN/DE/FR/ES/TR), Outlook/`Original Message` separators, and the RFC 3676 `-- ` signature delimiter.
|
|
315
|
+
* @param text The plain-text body.
|
|
316
|
+
* @param options Extraction options. See {@link ExtractReplyOptions}.
|
|
317
|
+
* @returns The trimmed reply text with quoted history removed.
|
|
318
|
+
*/
|
|
319
319
|
declare const extractReply: (text: string, options?: ExtractReplyOptions) => string;
|
|
320
320
|
/**
|
|
321
|
-
* A group of inbound messages belonging to the same conversation.
|
|
322
|
-
*/
|
|
321
|
+
* A group of inbound messages belonging to the same conversation.
|
|
322
|
+
*/
|
|
323
323
|
interface EmailThread {
|
|
324
324
|
/**
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
325
|
+
* A stable identifier for the thread: the union-find root, which is a normalized root Message-ID
|
|
326
|
+
* or a synthetic `__index_<n>` key when a message has no Message-ID.
|
|
327
|
+
*/
|
|
328
328
|
id: string;
|
|
329
329
|
/**
|
|
330
|
-
|
|
331
|
-
|
|
330
|
+
* The messages in the thread. Order reflects input order (callers can sort by date if needed).
|
|
331
|
+
*/
|
|
332
332
|
messages: InboundEmail[];
|
|
333
333
|
}
|
|
334
334
|
/**
|
|
335
|
-
* Strips angle brackets and surrounding whitespace from a Message-ID for consistent matching.
|
|
336
|
-
* @param id A raw Message-ID, optionally wrapped in angle brackets.
|
|
337
|
-
* @returns The bare Message-ID.
|
|
338
|
-
*/
|
|
335
|
+
* Strips angle brackets and surrounding whitespace from a Message-ID for consistent matching.
|
|
336
|
+
* @param id A raw Message-ID, optionally wrapped in angle brackets.
|
|
337
|
+
* @returns The bare Message-ID.
|
|
338
|
+
*/
|
|
339
339
|
declare const normalizeMessageId: (id: string) => string;
|
|
340
340
|
/**
|
|
341
|
-
* Normalizes a subject for fallback threading: strips leading `Re:`/`Fwd:`/`Aw:`/`Wg:` prefixes and
|
|
342
|
-
* collapses whitespace. Uses a linear loop rather than a backtracking regex.
|
|
343
|
-
* @param subject The raw subject.
|
|
344
|
-
* @returns The normalized subject key.
|
|
345
|
-
*/
|
|
341
|
+
* Normalizes a subject for fallback threading: strips leading `Re:`/`Fwd:`/`Aw:`/`Wg:` prefixes and
|
|
342
|
+
* collapses whitespace. Uses a linear loop rather than a backtracking regex.
|
|
343
|
+
* @param subject The raw subject.
|
|
344
|
+
* @returns The normalized subject key.
|
|
345
|
+
*/
|
|
346
346
|
declare const normalizeSubject: (subject: string) => string;
|
|
347
347
|
/**
|
|
348
|
-
* Groups inbound messages into conversation threads.
|
|
349
|
-
*
|
|
350
|
-
* Messages are linked via their `In-Reply-To` and `References` Message-IDs (RFC 5322 threading).
|
|
351
|
-
* Messages that share no references but have an identical normalized subject are stitched together as
|
|
352
|
-
* a fallback, matching how mail clients group conversations.
|
|
353
|
-
* @param messages The inbound messages to thread.
|
|
354
|
-
* @returns The detected threads. See {@link EmailThread}.
|
|
355
|
-
*/
|
|
348
|
+
* Groups inbound messages into conversation threads.
|
|
349
|
+
*
|
|
350
|
+
* Messages are linked via their `In-Reply-To` and `References` Message-IDs (RFC 5322 threading).
|
|
351
|
+
* Messages that share no references but have an identical normalized subject are stitched together as
|
|
352
|
+
* a fallback, matching how mail clients group conversations.
|
|
353
|
+
* @param messages The inbound messages to thread.
|
|
354
|
+
* @returns The detected threads. See {@link EmailThread}.
|
|
355
|
+
*/
|
|
356
356
|
declare const stitchThreads: (messages: InboundEmail[]) => EmailThread[];
|
|
357
357
|
/**
|
|
358
|
-
* Parses a single RFC 5322 address such as `John Doe <john@example.com>` or `john@example.com`.
|
|
359
|
-
* @param value The address string.
|
|
360
|
-
* @returns The parsed address, or `undefined` when empty.
|
|
361
|
-
*/
|
|
358
|
+
* Parses a single RFC 5322 address such as `John Doe <john@example.com>` or `john@example.com`.
|
|
359
|
+
* @param value The address string.
|
|
360
|
+
* @returns The parsed address, or `undefined` when empty.
|
|
361
|
+
*/
|
|
362
362
|
declare const parseAddress: (value: string | undefined | null) => InboundAddress | undefined;
|
|
363
363
|
/**
|
|
364
|
-
* Splits and parses a comma-separated address list, respecting commas inside quoted display names.
|
|
365
|
-
* @param value The address-list string.
|
|
366
|
-
* @returns The parsed addresses (empty when none).
|
|
367
|
-
*/
|
|
364
|
+
* Splits and parses a comma-separated address list, respecting commas inside quoted display names.
|
|
365
|
+
* @param value The address-list string.
|
|
366
|
+
* @returns The parsed addresses (empty when none).
|
|
367
|
+
*/
|
|
368
368
|
declare const parseAddressList: (value: string | undefined | null) => InboundAddress[];
|
|
369
369
|
/**
|
|
370
|
-
* Splits a `References` header value into individual Message-IDs.
|
|
371
|
-
* @param value The raw `References` header.
|
|
372
|
-
* @returns The Message-IDs in document order (oldest first).
|
|
373
|
-
*/
|
|
370
|
+
* Splits a `References` header value into individual Message-IDs.
|
|
371
|
+
* @param value The raw `References` header.
|
|
372
|
+
* @returns The Message-IDs in document order (oldest first).
|
|
373
|
+
*/
|
|
374
374
|
declare const parseReferences: (value: string | undefined | null) => string[];
|
|
375
375
|
export { type CloudflareEmailLike, type EmailThread, type ExtractReplyOptions, type InboundAddress, type InboundAttachment, type InboundEmail, type InboundHandler, type InboundHandlerOptions, type InboundProvider, defineInboundHandler, extractReply, normalizeMessageId, normalizeSubject, parseAddress, parseAddressList, parseCloudflareInbound, parseInbound, parseMailgunInbound, parsePostmarkInbound, parseReferences, parseSendGridInbound, parseSesInbound, stitchThreads };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export { type A as AttachmentDataOptions, type a as AttachmentOptions, type B as BatchBase, type b as BatchRenderer, D as DraftMailMessage, type F as FeatureCheckMode, M as Mail, type c as MailGlobalConfig, d as MailMessage, type e as MailOptions, type P as Personalization, type S as SendBatchOptions, type f as SendableMessage, g as createMail, h as detectMimeType, i as generateContentId, r as readFileAsBuffer } from "./packem_shared/mail.d-
|
|
2
|
-
export type { M as Middleware, S as SendFunction } from "./packem_shared/types.d-
|
|
3
|
-
export { type a as Provider, type P as ProviderFactory, d as defineProvider } from "./packem_shared/provider.d-
|
|
4
|
-
export type { T as TemplateRenderer } from "./packem_shared/types.d-
|
|
5
|
-
export type { A as Attachment, B as BaseConfig, C as CalendarEventOptions, c as EmailAddress, e as EmailHeaders, E as EmailOptions, a as EmailResult, d as EmailTag, F as FeatureFlags, I as ImmutableHeaders, M as MaybePromise, P as Priority, b as Receipt, R as Result } from "./packem_shared/types.d-
|
|
1
|
+
export { type A as AttachmentDataOptions, type a as AttachmentOptions, type B as BatchBase, type b as BatchRenderer, D as DraftMailMessage, type F as FeatureCheckMode, M as Mail, type c as MailGlobalConfig, d as MailMessage, type e as MailOptions, type P as Personalization, type S as SendBatchOptions, type f as SendableMessage, g as createMail, h as detectMimeType, i as generateContentId, r as readFileAsBuffer } from "./packem_shared/mail.d-xKtvoKMK.js";
|
|
2
|
+
export type { M as Middleware, S as SendFunction } from "./packem_shared/types.d-GKqPNk0I.js";
|
|
3
|
+
export { type a as Provider, type P as ProviderFactory, d as defineProvider } from "./packem_shared/provider.d-Cx5YQJdP.js";
|
|
4
|
+
export type { T as TemplateRenderer } from "./packem_shared/types.d-I-KeZ5w2.js";
|
|
5
|
+
export type { A as Attachment, B as BaseConfig, C as CalendarEventOptions, c as EmailAddress, e as EmailHeaders, E as EmailOptions, a as EmailResult, d as EmailTag, F as FeatureFlags, I as ImmutableHeaders, M as MaybePromise, P as Priority, b as Receipt, R as Result } from "./packem_shared/types.d-B9295M4_.js";
|
|
6
6
|
export { default as parseEml } from "./utils/parse-eml.js";
|
|
7
7
|
export { type OkResult, isErr, isOk, mapOk, tryAsync, unwrap, unwrapOr } from "./utils/result.js";
|
|
8
8
|
export { type FeatureSupportResult, type FeatureViolation, default as checkFeatureSupport } from "./utils/validation/check-feature-support.js";
|
|
9
9
|
import 'ical-generator';
|
|
10
10
|
import 'node:buffer';
|
|
11
11
|
import 'node:crypto';
|
|
12
|
-
import "./packem_shared/types.d-
|
|
12
|
+
import "./packem_shared/types.d-B0t3PQ3t.js";
|
|
13
13
|
interface ErrorProperties {
|
|
14
14
|
cause?: unknown;
|
|
15
15
|
hint?: ErrorHint;
|
|
@@ -25,55 +25,44 @@ interface ErrorLocation {
|
|
|
25
25
|
line?: number;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* A message that explains to the user how they can fix the error.
|
|
29
|
-
* @example
|
|
30
|
-
* ```ts
|
|
31
|
-
* const error = new VisulimaError({
|
|
32
|
-
* hint: "Try running `npm install` to install missing dependencies.",
|
|
33
|
-
* location: {
|
|
34
|
-
* file: "src/index.ts",
|
|
35
|
-
* line: 1,
|
|
36
|
-
* column: 1,
|
|
37
|
-
* },
|
|
38
|
-
* message: "Cannot find module 'react'",
|
|
39
|
-
* name: "ModuleNotFoundError",
|
|
40
|
-
* });
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
|
-
* For more complex hints, you can pass an array of strings or a single string in markdown format.
|
|
44
|
-
*/
|
|
28
|
+
* A message that explains to the user how they can fix the error.
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const error = new VisulimaError({
|
|
32
|
+
* hint: "Try running `npm install` to install missing dependencies.",
|
|
33
|
+
* location: {
|
|
34
|
+
* file: "src/index.ts",
|
|
35
|
+
* line: 1,
|
|
36
|
+
* column: 1,
|
|
37
|
+
* },
|
|
38
|
+
* message: "Cannot find module 'react'",
|
|
39
|
+
* name: "ModuleNotFoundError",
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* For more complex hints, you can pass an array of strings or a single string in markdown format.
|
|
44
|
+
*/
|
|
45
45
|
type ErrorHint = string[] | string;
|
|
46
46
|
declare class VisulimaError extends Error {
|
|
47
47
|
loc: ErrorLocation | undefined;
|
|
48
48
|
title: string | undefined;
|
|
49
49
|
/**
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
* A message that explains to the user how they can fix the error.
|
|
51
|
+
*/
|
|
52
52
|
hint: ErrorHint | undefined;
|
|
53
53
|
type: string;
|
|
54
|
-
constructor({
|
|
55
|
-
cause,
|
|
56
|
-
hint,
|
|
57
|
-
location,
|
|
58
|
-
message,
|
|
59
|
-
name,
|
|
60
|
-
stack,
|
|
61
|
-
title
|
|
62
|
-
}: ErrorProperties);
|
|
54
|
+
constructor({ cause, hint, location, message, name, stack, title }: ErrorProperties);
|
|
63
55
|
setLocation(location: ErrorLocation): void;
|
|
64
56
|
setName(name: string): void;
|
|
65
57
|
setMessage(message: string): void;
|
|
66
58
|
setHint(hint: ErrorHint): void;
|
|
67
59
|
}
|
|
68
60
|
/**
|
|
69
|
-
*
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
*
|
|
73
|
-
|
|
74
|
-
* @param message The error message describing what went wrong.
|
|
75
|
-
* @param options Optional error options including cause, code, and hint.
|
|
76
|
-
*/
|
|
61
|
+
* Base error class for email package operations.
|
|
62
|
+
* @param component The component name where the error occurred.
|
|
63
|
+
* @param message The error message describing what went wrong.
|
|
64
|
+
* @param options Optional error options including cause, code, and hint.
|
|
65
|
+
*/
|
|
77
66
|
declare class EmailError extends VisulimaError {
|
|
78
67
|
readonly component: string;
|
|
79
68
|
readonly code?: string;
|
|
@@ -84,10 +73,10 @@ declare class EmailError extends VisulimaError {
|
|
|
84
73
|
});
|
|
85
74
|
}
|
|
86
75
|
/**
|
|
87
|
-
* Error for missing required options
|
|
88
|
-
* @param component The component name where the error occurred
|
|
89
|
-
* @param name The name(s) of the missing required option(s)
|
|
90
|
-
*/
|
|
76
|
+
* Error for missing required options
|
|
77
|
+
* @param component The component name where the error occurred
|
|
78
|
+
* @param name The name(s) of the missing required option(s)
|
|
79
|
+
*/
|
|
91
80
|
declare class RequiredOptionError extends EmailError {
|
|
92
81
|
constructor(component: string, name: string | string[]);
|
|
93
82
|
}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{detectMimeType as a,generateContentId as t,readFileAsBuffer as o}from"./packem_shared/detectMimeType-
|
|
1
|
+
import{detectMimeType as a,generateContentId as t,readFileAsBuffer as o}from"./packem_shared/detectMimeType-CmYmWDXE.js";import{default as p}from"./packem_shared/DraftMailMessage-C3YTXqWo.js";import{default as m}from"./packem_shared/EmailError-CDvYwuqz.js";import{default as l}from"./packem_shared/RequiredOptionError-DU2lxzk3.js";import{Mail as u,createMail as x}from"./packem_shared/Mail-CIyxkmxu.js";import{default as M}from"./packem_shared/MailMessage-DuEXJiCg.js";import{defineProvider as E}from"./packem_shared/defineProvider-C9q-7iwt.js";import{default as g}from"./utils/parse-eml.js";import{isErr as y,isOk as w,mapOk as A,tryAsync as F,unwrap as h,unwrapOr as q}from"./utils/result.js";import{default as B}from"./utils/validation/check-feature-support.js";export{p as DraftMailMessage,m as EmailError,u as Mail,M as MailMessage,l as RequiredOptionError,B as checkFeatureSupport,x as createMail,E as defineProvider,a as detectMimeType,t as generateContentId,y as isErr,w as isOk,A as mapOk,g as parseEml,o as readFileAsBuffer,F as tryAsync,h as unwrap,q as unwrapOr};
|