@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
|
@@ -1,360 +1,360 @@
|
|
|
1
|
-
import { c as EmailAddress } from "../packem_shared/types.d-
|
|
2
|
-
import { S as SuppressionReason, a as SuppressionEntry, b as SuppressionStore } from "../packem_shared/types.d-
|
|
1
|
+
import { c as EmailAddress } from "../packem_shared/types.d-B9295M4_.js";
|
|
2
|
+
import { S as SuppressionReason, a as SuppressionEntry, b as SuppressionStore } from "../packem_shared/types.d-BzoHR9nB.js";
|
|
3
3
|
import 'node:buffer';
|
|
4
4
|
/**
|
|
5
|
-
* A parsed [ARF](https://www.rfc-editor.org/rfc/rfc5965) (Abuse Reporting Format) feedback report,
|
|
6
|
-
* as delivered by mailbox-provider feedback loops (FBLs) on spam complaints.
|
|
7
|
-
*/
|
|
5
|
+
* A parsed [ARF](https://www.rfc-editor.org/rfc/rfc5965) (Abuse Reporting Format) feedback report,
|
|
6
|
+
* as delivered by mailbox-provider feedback loops (FBLs) on spam complaints.
|
|
7
|
+
*/
|
|
8
8
|
interface ArfReport {
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
* When the offending message arrived, if reported.
|
|
11
|
+
*/
|
|
12
12
|
arrivalDate?: string;
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
* The type of feedback — `abuse` for spam complaints, `auth-failure`, `fraud`, etc.
|
|
15
|
+
*/
|
|
16
16
|
feedbackType?: string;
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
* All parsed fields from the `message/feedback-report` part, lower-cased keys.
|
|
19
|
+
*/
|
|
20
20
|
fields: Record<string, string>;
|
|
21
21
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
* The envelope sender of the original message, if reported.
|
|
23
|
+
*/
|
|
24
24
|
originalMailFrom?: string;
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
* The recipient(s) that complained — the address(es) to suppress.
|
|
27
|
+
*/
|
|
28
28
|
originalRcptTo?: string;
|
|
29
29
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
* The domain the report concerns.
|
|
31
|
+
*/
|
|
32
32
|
reportedDomain?: string;
|
|
33
33
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
* The source IP of the original message, if reported.
|
|
35
|
+
*/
|
|
36
36
|
sourceIp?: string;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* Parses an ARF feedback-loop complaint report into a structured object.
|
|
40
|
-
*
|
|
41
|
-
* Pass either the full raw ARF email or just its `message/feedback-report` part. Use
|
|
42
|
-
* {@link ArfReport.originalRcptTo} to drive suppression of complaining recipients.
|
|
43
|
-
* @param raw The raw ARF email text.
|
|
44
|
-
* @returns The parsed report. See {@link ArfReport}.
|
|
45
|
-
*/
|
|
39
|
+
* Parses an ARF feedback-loop complaint report into a structured object.
|
|
40
|
+
*
|
|
41
|
+
* Pass either the full raw ARF email or just its `message/feedback-report` part. Use
|
|
42
|
+
* {@link ArfReport.originalRcptTo} to drive suppression of complaining recipients.
|
|
43
|
+
* @param raw The raw ARF email text.
|
|
44
|
+
* @returns The parsed report. See {@link ArfReport}.
|
|
45
|
+
*/
|
|
46
46
|
declare const parseArfReport: (raw: string) => ArfReport;
|
|
47
47
|
/**
|
|
48
|
-
* A parsed DMARC DNS policy record (the `_dmarc.<domain>` TXT record).
|
|
49
|
-
*/
|
|
48
|
+
* A parsed DMARC DNS policy record (the `_dmarc.<domain>` TXT record).
|
|
49
|
+
*/
|
|
50
50
|
interface DmarcRecord {
|
|
51
51
|
/**
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
* DKIM identifier alignment: `r` (relaxed, default) or `s` (strict).
|
|
53
|
+
*/
|
|
54
54
|
adkim?: "r" | "s";
|
|
55
55
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
* SPF identifier alignment: `r` (relaxed, default) or `s` (strict).
|
|
57
|
+
*/
|
|
58
58
|
aspf?: "r" | "s";
|
|
59
59
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
* Failure reporting options (`fo`): `0`, `1`, `d`, `s`, or a colon-joined combination.
|
|
61
|
+
*/
|
|
62
62
|
fo?: string;
|
|
63
63
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
* Percentage of messages the policy applies to (`pct`, 0–100).
|
|
65
|
+
*/
|
|
66
66
|
percent?: number;
|
|
67
67
|
/**
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
* Requested policy (`p`): `none`, `quarantine`, or `reject`.
|
|
69
|
+
*/
|
|
70
70
|
policy?: "none" | "quarantine" | "reject";
|
|
71
71
|
/**
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
* Aggregate report URIs (`rua`).
|
|
73
|
+
*/
|
|
74
74
|
rua?: string[];
|
|
75
75
|
/**
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
* Failure (forensic) report URIs (`ruf`).
|
|
77
|
+
*/
|
|
78
78
|
ruf?: string[];
|
|
79
79
|
/**
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
* Subdomain policy (`sp`).
|
|
81
|
+
*/
|
|
82
82
|
subdomainPolicy?: "none" | "quarantine" | "reject";
|
|
83
83
|
/**
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
* All raw tag/value pairs, keyed by tag.
|
|
85
|
+
*/
|
|
86
86
|
tags: Record<string, string>;
|
|
87
87
|
/**
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
* Whether the record is a syntactically valid DMARC1 record (starts with `v=DMARC1`).
|
|
89
|
+
*/
|
|
90
90
|
valid: boolean;
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
|
-
* Parses a DMARC policy record (the TXT record at `_dmarc.<domain>`).
|
|
94
|
-
* @param record The raw TXT record value (e.g. `v=DMARC1; p=reject; rua=mailto:agg@example.com`).
|
|
95
|
-
* @returns The parsed record. See {@link DmarcRecord}.
|
|
96
|
-
*/
|
|
93
|
+
* Parses a DMARC policy record (the TXT record at `_dmarc.<domain>`).
|
|
94
|
+
* @param record The raw TXT record value (e.g. `v=DMARC1; p=reject; rua=mailto:agg@example.com`).
|
|
95
|
+
* @returns The parsed record. See {@link DmarcRecord}.
|
|
96
|
+
*/
|
|
97
97
|
declare const parseDmarcRecord: (record: string) => DmarcRecord;
|
|
98
98
|
/**
|
|
99
|
-
* Options for {@link buildListUnsubscribe}.
|
|
100
|
-
*/
|
|
99
|
+
* Options for {@link buildListUnsubscribe}.
|
|
100
|
+
*/
|
|
101
101
|
interface ListUnsubscribeOptions {
|
|
102
102
|
/**
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
* A `mailto:` target the recipient can email to unsubscribe.
|
|
104
|
+
*
|
|
105
|
+
* Provide a bare address (`unsub@example.com`) or a full `mailto:` URI with query parameters.
|
|
106
|
+
*/
|
|
107
107
|
mailto?: string;
|
|
108
108
|
/**
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
* The default `subject` to attach to a bare `mailto` address.
|
|
110
|
+
* @default "unsubscribe"
|
|
111
|
+
*/
|
|
112
112
|
mailtoSubject?: string;
|
|
113
113
|
/**
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
114
|
+
* Enable [RFC 8058](https://www.rfc-editor.org/rfc/rfc8058) one-click unsubscribe.
|
|
115
|
+
*
|
|
116
|
+
* Requires {@link ListUnsubscribeOptions.url} to be an `https:` endpoint that accepts a POST with
|
|
117
|
+
* the body `List-Unsubscribe=One-Click`.
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
120
|
oneClick?: boolean;
|
|
121
121
|
/**
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
* An `https:` URL the recipient (or their mail client) can use to unsubscribe.
|
|
123
|
+
*/
|
|
124
124
|
url?: string;
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
|
-
* The headers produced by {@link buildListUnsubscribe}.
|
|
128
|
-
*/
|
|
127
|
+
* The headers produced by {@link buildListUnsubscribe}.
|
|
128
|
+
*/
|
|
129
129
|
interface ListUnsubscribeHeaders {
|
|
130
130
|
"List-Unsubscribe": string;
|
|
131
131
|
"List-Unsubscribe-Post"?: string;
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
|
-
* Builds `List-Unsubscribe` (and, when requested, `List-Unsubscribe-Post`) headers.
|
|
135
|
-
*
|
|
136
|
-
* Gmail and Yahoo's 2024 bulk-sender requirements expect bulk senders to expose a one-click
|
|
137
|
-
* unsubscribe. Pass an `https:` {@link ListUnsubscribeOptions.url} with `oneClick: true` to emit the
|
|
138
|
-
* RFC 8058 `List-Unsubscribe-Post: List-Unsubscribe=One-Click` header alongside it.
|
|
139
|
-
* @param options At least one of `url` or `mailto` must be provided. See {@link ListUnsubscribeOptions}.
|
|
140
|
-
* @returns The header record to merge into an email's headers.
|
|
141
|
-
* @throws {TypeError} When neither `url` nor `mailto` is provided, or `oneClick` is set without an `https:` url.
|
|
142
|
-
* @example
|
|
143
|
-
* ```ts
|
|
144
|
-
* const headers = buildListUnsubscribe({
|
|
145
|
-
* url: "https://example.com/unsub?id=abc",
|
|
146
|
-
* mailto: "unsubscribe@example.com",
|
|
147
|
-
* oneClick: true,
|
|
148
|
-
* });
|
|
149
|
-
* // {
|
|
150
|
-
* // "List-Unsubscribe": "<https://example.com/unsub?id=abc>, <mailto:unsubscribe@example.com?subject=unsubscribe>",
|
|
151
|
-
* // "List-Unsubscribe-Post": "List-Unsubscribe=One-Click",
|
|
152
|
-
* // }
|
|
153
|
-
* ```
|
|
154
|
-
*/
|
|
134
|
+
* Builds `List-Unsubscribe` (and, when requested, `List-Unsubscribe-Post`) headers.
|
|
135
|
+
*
|
|
136
|
+
* Gmail and Yahoo's 2024 bulk-sender requirements expect bulk senders to expose a one-click
|
|
137
|
+
* unsubscribe. Pass an `https:` {@link ListUnsubscribeOptions.url} with `oneClick: true` to emit the
|
|
138
|
+
* RFC 8058 `List-Unsubscribe-Post: List-Unsubscribe=One-Click` header alongside it.
|
|
139
|
+
* @param options At least one of `url` or `mailto` must be provided. See {@link ListUnsubscribeOptions}.
|
|
140
|
+
* @returns The header record to merge into an email's headers.
|
|
141
|
+
* @throws {TypeError} When neither `url` nor `mailto` is provided, or `oneClick` is set without an `https:` url.
|
|
142
|
+
* @example
|
|
143
|
+
* ```ts
|
|
144
|
+
* const headers = buildListUnsubscribe({
|
|
145
|
+
* url: "https://example.com/unsub?id=abc",
|
|
146
|
+
* mailto: "unsubscribe@example.com",
|
|
147
|
+
* oneClick: true,
|
|
148
|
+
* });
|
|
149
|
+
* // {
|
|
150
|
+
* // "List-Unsubscribe": "<https://example.com/unsub?id=abc>, <mailto:unsubscribe@example.com?subject=unsubscribe>",
|
|
151
|
+
* // "List-Unsubscribe-Post": "List-Unsubscribe=One-Click",
|
|
152
|
+
* // }
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
155
|
declare const buildListUnsubscribe: (options: ListUnsubscribeOptions) => ListUnsubscribeHeaders;
|
|
156
156
|
/**
|
|
157
|
-
* Parses a `List-Unsubscribe` header value into its individual targets.
|
|
158
|
-
* @param header The raw `List-Unsubscribe` header value containing angle-bracketed targets.
|
|
159
|
-
* @returns The list of unwrapped targets (URLs / mailto URIs).
|
|
160
|
-
*/
|
|
157
|
+
* Parses a `List-Unsubscribe` header value into its individual targets.
|
|
158
|
+
* @param header The raw `List-Unsubscribe` header value containing angle-bracketed targets.
|
|
159
|
+
* @returns The list of unwrapped targets (URLs / mailto URIs).
|
|
160
|
+
*/
|
|
161
161
|
declare const parseListUnsubscribe: (header: string) => string[];
|
|
162
162
|
/**
|
|
163
|
-
* A parsed [MTA-STS](https://www.rfc-editor.org/rfc/rfc8461) policy
|
|
164
|
-
* (`https://mta-sts.<domain>/.well-known/mta-sts.txt`).
|
|
165
|
-
*/
|
|
163
|
+
* A parsed [MTA-STS](https://www.rfc-editor.org/rfc/rfc8461) policy
|
|
164
|
+
* (`https://mta-sts.<domain>/.well-known/mta-sts.txt`).
|
|
165
|
+
*/
|
|
166
166
|
interface MtaStsPolicy {
|
|
167
167
|
/**
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
* Maximum policy lifetime in seconds (`max_age`).
|
|
169
|
+
*/
|
|
170
170
|
maxAge?: number;
|
|
171
171
|
/**
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
* Enforcement mode: `enforce`, `testing`, or `none`.
|
|
173
|
+
*/
|
|
174
174
|
mode?: "enforce" | "none" | "testing";
|
|
175
175
|
/**
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
* Allowed MX host patterns (may include a leading `*.` wildcard).
|
|
177
|
+
*/
|
|
178
178
|
mx: string[];
|
|
179
179
|
/**
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
* Whether the policy is a syntactically valid `STSv1` policy.
|
|
181
|
+
*/
|
|
182
182
|
valid: boolean;
|
|
183
183
|
/**
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
* The policy version (`STSv1`).
|
|
185
|
+
*/
|
|
186
186
|
version?: string;
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
|
-
* Parses an MTA-STS policy file.
|
|
190
|
-
* @param policy The raw policy text.
|
|
191
|
-
* @returns The parsed policy. See {@link MtaStsPolicy}.
|
|
192
|
-
*/
|
|
189
|
+
* Parses an MTA-STS policy file.
|
|
190
|
+
* @param policy The raw policy text.
|
|
191
|
+
* @returns The parsed policy. See {@link MtaStsPolicy}.
|
|
192
|
+
*/
|
|
193
193
|
declare const parseMtaStsPolicy: (policy: string) => MtaStsPolicy;
|
|
194
194
|
/**
|
|
195
|
-
* Input for {@link buildMtaStsPolicy}.
|
|
196
|
-
*/
|
|
195
|
+
* Input for {@link buildMtaStsPolicy}.
|
|
196
|
+
*/
|
|
197
197
|
interface MtaStsPolicyInput {
|
|
198
198
|
/**
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
* Maximum policy lifetime in seconds (`max_age`), e.g. `604800` (one week).
|
|
200
|
+
*/
|
|
201
201
|
maxAge: number;
|
|
202
202
|
/**
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
* Enforcement mode.
|
|
204
|
+
*/
|
|
205
205
|
mode: "enforce" | "none" | "testing";
|
|
206
206
|
/**
|
|
207
|
-
|
|
208
|
-
|
|
207
|
+
* Allowed MX host patterns (a leading `*.` wildcard is permitted).
|
|
208
|
+
*/
|
|
209
209
|
mx: string[];
|
|
210
210
|
}
|
|
211
211
|
/**
|
|
212
|
-
* Generates an MTA-STS policy file to serve at `https://mta-sts.<domain>/.well-known/mta-sts.txt`.
|
|
213
|
-
* @param input The policy contents. See {@link MtaStsPolicyInput}.
|
|
214
|
-
* @returns The policy file text (CRLF-terminated lines, per RFC 8461).
|
|
215
|
-
*/
|
|
212
|
+
* Generates an MTA-STS policy file to serve at `https://mta-sts.<domain>/.well-known/mta-sts.txt`.
|
|
213
|
+
* @param input The policy contents. See {@link MtaStsPolicyInput}.
|
|
214
|
+
* @returns The policy file text (CRLF-terminated lines, per RFC 8461).
|
|
215
|
+
*/
|
|
216
216
|
declare const buildMtaStsPolicy: (input: MtaStsPolicyInput) => string;
|
|
217
217
|
/**
|
|
218
|
-
* An in-memory {@link SuppressionStore}, suitable for tests, single-process apps, and as a write-through
|
|
219
|
-
* cache in front of a durable store.
|
|
220
|
-
*/
|
|
218
|
+
* An in-memory {@link SuppressionStore}, suitable for tests, single-process apps, and as a write-through
|
|
219
|
+
* cache in front of a durable store.
|
|
220
|
+
*/
|
|
221
221
|
declare class MemorySuppressionStore implements SuppressionStore {
|
|
222
222
|
private readonly entries;
|
|
223
223
|
/**
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
* Seeds the store with existing entries.
|
|
225
|
+
* @param initial Optional addresses to pre-suppress.
|
|
226
|
+
*/
|
|
227
227
|
constructor(initial?: Iterable<{
|
|
228
228
|
address: string;
|
|
229
229
|
metadata?: Record<string, unknown>;
|
|
230
230
|
reason: SuppressionReason;
|
|
231
231
|
}>);
|
|
232
232
|
/**
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
233
|
+
* Adds or refreshes an address on the suppression list.
|
|
234
|
+
* @param address The recipient address.
|
|
235
|
+
* @param reason Why it is suppressed.
|
|
236
|
+
* @param metadata Optional context to persist with the entry.
|
|
237
|
+
*/
|
|
238
238
|
add(address: string, reason: SuppressionReason, metadata?: Record<string, unknown>): void;
|
|
239
239
|
/**
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
240
|
+
* Returns the suppression entry for an address, if present.
|
|
241
|
+
* @param address The recipient address.
|
|
242
|
+
* @returns The entry, or `undefined` when not suppressed.
|
|
243
|
+
*/
|
|
244
244
|
get(address: string): SuppressionEntry | undefined;
|
|
245
245
|
/**
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
246
|
+
* Reports whether an address is currently suppressed.
|
|
247
|
+
* @param address The recipient address.
|
|
248
|
+
* @returns `true` when the address is on the list.
|
|
249
|
+
*/
|
|
250
250
|
has(address: string): boolean;
|
|
251
251
|
/**
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
252
|
+
* Lists every suppression entry.
|
|
253
|
+
* @returns An iterable over the stored entries.
|
|
254
|
+
*/
|
|
255
255
|
list(): Iterable<SuppressionEntry>;
|
|
256
256
|
/**
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
257
|
+
* Removes an address from the suppression list.
|
|
258
|
+
* @param address The recipient address.
|
|
259
|
+
* @returns `true` when an entry was removed.
|
|
260
|
+
*/
|
|
261
261
|
remove(address: string): boolean;
|
|
262
262
|
/**
|
|
263
|
-
|
|
264
|
-
|
|
263
|
+
* The number of suppressed addresses.
|
|
264
|
+
*/
|
|
265
265
|
get size(): number;
|
|
266
266
|
}
|
|
267
267
|
/**
|
|
268
|
-
* Result of {@link filterSuppressed}.
|
|
269
|
-
*/
|
|
268
|
+
* Result of {@link filterSuppressed}.
|
|
269
|
+
*/
|
|
270
270
|
interface FilterSuppressedResult {
|
|
271
271
|
/**
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
* Recipients that are allowed (not suppressed).
|
|
273
|
+
*/
|
|
274
274
|
allowed: EmailAddress[];
|
|
275
275
|
/**
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
* Recipients that were suppressed and removed.
|
|
277
|
+
*/
|
|
278
278
|
suppressed: EmailAddress[];
|
|
279
279
|
}
|
|
280
280
|
/**
|
|
281
|
-
* Partitions a recipient list into allowed and suppressed addresses.
|
|
282
|
-
* @param recipients One or more recipients.
|
|
283
|
-
* @param store The suppression store to check against.
|
|
284
|
-
* @returns The allowed and suppressed recipients. See {@link FilterSuppressedResult}.
|
|
285
|
-
*/
|
|
281
|
+
* Partitions a recipient list into allowed and suppressed addresses.
|
|
282
|
+
* @param recipients One or more recipients.
|
|
283
|
+
* @param store The suppression store to check against.
|
|
284
|
+
* @returns The allowed and suppressed recipients. See {@link FilterSuppressedResult}.
|
|
285
|
+
*/
|
|
286
286
|
declare const filterSuppressed: (recipients: EmailAddress | EmailAddress[], store: SuppressionStore) => Promise<FilterSuppressedResult>;
|
|
287
287
|
/**
|
|
288
|
-
* Convenience factory for an in-memory suppression store.
|
|
289
|
-
* @param initial Optional addresses to pre-suppress.
|
|
290
|
-
* @returns A new {@link MemorySuppressionStore}.
|
|
291
|
-
*/
|
|
288
|
+
* Convenience factory for an in-memory suppression store.
|
|
289
|
+
* @param initial Optional addresses to pre-suppress.
|
|
290
|
+
* @returns A new {@link MemorySuppressionStore}.
|
|
291
|
+
*/
|
|
292
292
|
declare const createSuppressionStore: (initial?: Iterable<{
|
|
293
293
|
address: string;
|
|
294
294
|
metadata?: Record<string, unknown>;
|
|
295
295
|
reason: SuppressionReason;
|
|
296
296
|
}>) => MemorySuppressionStore;
|
|
297
297
|
/**
|
|
298
|
-
* A parsed TLS-RPT DNS record (`_smtp._tls.<domain>` TXT record).
|
|
299
|
-
*/
|
|
298
|
+
* A parsed TLS-RPT DNS record (`_smtp._tls.<domain>` TXT record).
|
|
299
|
+
*/
|
|
300
300
|
interface TlsRptRecord {
|
|
301
301
|
/**
|
|
302
|
-
|
|
303
|
-
|
|
302
|
+
* Report destination URIs (`rua`): `mailto:` and/or `https:` endpoints.
|
|
303
|
+
*/
|
|
304
304
|
rua: string[];
|
|
305
305
|
/**
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
* Whether the record is a syntactically valid `TLSRPTv1` record.
|
|
307
|
+
*/
|
|
308
308
|
valid: boolean;
|
|
309
309
|
/**
|
|
310
|
-
|
|
311
|
-
|
|
310
|
+
* The record version (`TLSRPTv1`).
|
|
311
|
+
*/
|
|
312
312
|
version?: string;
|
|
313
313
|
}
|
|
314
314
|
/**
|
|
315
|
-
* A normalized [TLS-RPT](https://www.rfc-editor.org/rfc/rfc8460) report.
|
|
316
|
-
*/
|
|
315
|
+
* A normalized [TLS-RPT](https://www.rfc-editor.org/rfc/rfc8460) report.
|
|
316
|
+
*/
|
|
317
317
|
interface TlsReport {
|
|
318
318
|
/**
|
|
319
|
-
|
|
320
|
-
|
|
319
|
+
* Report end timestamp (ISO 8601), from `date-range.end-datetime`.
|
|
320
|
+
*/
|
|
321
321
|
endDate?: string;
|
|
322
322
|
/**
|
|
323
|
-
|
|
324
|
-
|
|
323
|
+
* The reporting organization (`organization-name`).
|
|
324
|
+
*/
|
|
325
325
|
organizationName?: string;
|
|
326
326
|
/**
|
|
327
|
-
|
|
328
|
-
|
|
327
|
+
* The raw `policies` array, for provider-specific detail.
|
|
328
|
+
*/
|
|
329
329
|
policies: unknown[];
|
|
330
330
|
/**
|
|
331
|
-
|
|
332
|
-
|
|
331
|
+
* The unique report id (`report-id`).
|
|
332
|
+
*/
|
|
333
333
|
reportId?: string;
|
|
334
334
|
/**
|
|
335
|
-
|
|
336
|
-
|
|
335
|
+
* Report start timestamp (ISO 8601), from `date-range.start-datetime`.
|
|
336
|
+
*/
|
|
337
337
|
startDate?: string;
|
|
338
338
|
/**
|
|
339
|
-
|
|
340
|
-
|
|
339
|
+
* Total failed TLS sessions across all policies.
|
|
340
|
+
*/
|
|
341
341
|
totalFailure: number;
|
|
342
342
|
/**
|
|
343
|
-
|
|
344
|
-
|
|
343
|
+
* Total successful TLS sessions across all policies.
|
|
344
|
+
*/
|
|
345
345
|
totalSuccessful: number;
|
|
346
346
|
}
|
|
347
347
|
/**
|
|
348
|
-
* Parses a TLS-RPT policy record (the TXT record at `_smtp._tls.<domain>`).
|
|
349
|
-
* @param record The raw TXT record value (e.g. `v=TLSRPTv1; rua=mailto:tlsrpt@example.com`).
|
|
350
|
-
* @returns The parsed record. See {@link TlsRptRecord}.
|
|
351
|
-
*/
|
|
348
|
+
* Parses a TLS-RPT policy record (the TXT record at `_smtp._tls.<domain>`).
|
|
349
|
+
* @param record The raw TXT record value (e.g. `v=TLSRPTv1; rua=mailto:tlsrpt@example.com`).
|
|
350
|
+
* @returns The parsed record. See {@link TlsRptRecord}.
|
|
351
|
+
*/
|
|
352
352
|
declare const parseTlsRptRecord: (record: string) => TlsRptRecord;
|
|
353
353
|
/**
|
|
354
|
-
* Parses a TLS-RPT JSON report into a normalized summary.
|
|
355
|
-
* @param report The report as a JSON string or already-parsed object.
|
|
356
|
-
* @returns The normalized report. See {@link TlsReport}.
|
|
357
|
-
* @throws {SyntaxError} When a string is provided that is not valid JSON.
|
|
358
|
-
*/
|
|
354
|
+
* Parses a TLS-RPT JSON report into a normalized summary.
|
|
355
|
+
* @param report The report as a JSON string or already-parsed object.
|
|
356
|
+
* @returns The normalized report. See {@link TlsReport}.
|
|
357
|
+
* @throws {SyntaxError} When a string is provided that is not valid JSON.
|
|
358
|
+
*/
|
|
359
359
|
declare const parseTlsReport: (report: Record<string, unknown> | string) => TlsReport;
|
|
360
360
|
export { type ArfReport, type DmarcRecord, type FilterSuppressedResult, type ListUnsubscribeHeaders, type ListUnsubscribeOptions, MemorySuppressionStore, type MtaStsPolicy, type MtaStsPolicyInput, type SuppressionEntry, type SuppressionReason, type SuppressionStore, type TlsReport, type TlsRptRecord, buildListUnsubscribe, buildMtaStsPolicy, createSuppressionStore, filterSuppressed, parseArfReport, parseDmarcRecord, parseListUnsubscribe, parseMtaStsPolicy, parseTlsReport, parseTlsRptRecord };
|
package/dist/events/index.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { E as EmailEvent, a as EventStore } from "../packem_shared/event-bus.d-
|
|
2
|
-
export { A as ALL_EVENTS, type b as EmailEventListener, type c as EmailEventType, d as EventBus } from "../packem_shared/event-bus.d-
|
|
1
|
+
import { E as EmailEvent, a as EventStore } from "../packem_shared/event-bus.d-BNQA-FZE.js";
|
|
2
|
+
export { A as ALL_EVENTS, type b as EmailEventListener, type c as EmailEventType, d as EventBus } from "../packem_shared/event-bus.d-BNQA-FZE.js";
|
|
3
3
|
/**
|
|
4
|
-
* An in-memory {@link EventStore}. Events are grouped by `messageId`; events without one are kept
|
|
5
|
-
* under a shared `__unkeyed` bucket so nothing is silently dropped.
|
|
6
|
-
*/
|
|
4
|
+
* An in-memory {@link EventStore}. Events are grouped by `messageId`; events without one are kept
|
|
5
|
+
* under a shared `__unkeyed` bucket so nothing is silently dropped.
|
|
6
|
+
*/
|
|
7
7
|
declare class MemoryEventStore implements EventStore {
|
|
8
8
|
private static readonly UNKEYED;
|
|
9
9
|
private readonly byMessage;
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
* Appends an event to its message's bucket.
|
|
12
|
+
* @param event The event to store.
|
|
13
|
+
*/
|
|
14
14
|
append(event: EmailEvent): void;
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
* Reconstructs the time-ordered timeline for a single message.
|
|
17
|
+
* @param messageId The message to reconstruct.
|
|
18
|
+
* @returns The message's events, oldest first.
|
|
19
|
+
*/
|
|
20
20
|
timeline(messageId: string): EmailEvent[];
|
|
21
21
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
* Returns every stored event, ordered by timestamp.
|
|
23
|
+
* @returns All events.
|
|
24
|
+
*/
|
|
25
25
|
all(): EmailEvent[];
|
|
26
26
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
* Removes all stored events.
|
|
28
|
+
*/
|
|
29
29
|
clear(): void;
|
|
30
30
|
}
|
|
31
31
|
export { type EmailEvent, type EventStore, MemoryEventStore };
|