mymx 0.3.7 → 0.3.9

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.
@@ -1,4 +1,4 @@
1
- import { EmailAddress, EmailReceivedEvent, ParsedDataComplete, ParsedDataFailed, ParsedError, RawContentDownloadOnly, RawContentInline, WEBHOOK_VERSION$1 as WEBHOOK_VERSION, WebhookAttachment } from "./types-C8JlcpcT.js";
1
+ import { EmailAddress, EmailAuth, EmailReceivedEvent, ParsedDataComplete, ParsedDataFailed, ParsedError, RawContentDownloadOnly, RawContentInline, WEBHOOK_VERSION$1 as WEBHOOK_VERSION, WebhookAttachment } from "./types-CNRE7-kR.js";
2
2
  import { SignResult, signWebhookPayload$1 as signWebhookPayload } from "./signing-Ecohrukk.js";
3
3
 
4
4
  //#region src/contract.d.ts
@@ -84,6 +84,8 @@ interface EmailReceivedEventInput {
84
84
  attachments_download_url: string | null;
85
85
  /** Parsed email content (optional, defaults to failed state) */
86
86
  parsed?: ParsedInput;
87
+ /** Email authentication results (SPF, DKIM, DMARC) */
88
+ auth: EmailAuth;
87
89
  }
88
90
  /**
89
91
  * Generate a stable event ID for webhook deduplication.
@@ -143,4 +145,4 @@ declare function buildEmailReceivedEvent(input: EmailReceivedEventInput, options
143
145
  /** Override attempted_at timestamp (for testing) */
144
146
  attempted_at?: string;
145
147
  }): EmailReceivedEvent; //#endregion
146
- export { EmailAddress, EmailReceivedEvent, EmailReceivedEventInput, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedInput, ParsedInputComplete, ParsedInputFailed, RAW_EMAIL_INLINE_THRESHOLD, RawContentDownloadOnly, RawContentInline, SignResult, WEBHOOK_VERSION, WebhookAttachment, buildEmailReceivedEvent, generateEventId, signWebhookPayload };
148
+ export { EmailAddress, EmailAuth, EmailReceivedEvent, EmailReceivedEventInput, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedInput, ParsedInputComplete, ParsedInputFailed, RAW_EMAIL_INLINE_THRESHOLD, RawContentDownloadOnly, RawContentInline, SignResult, WEBHOOK_VERSION, WebhookAttachment, buildEmailReceivedEvent, generateEventId, signWebhookPayload };
package/dist/contract.js CHANGED
@@ -174,7 +174,8 @@ function buildEmailReceivedEvent(input, options) {
174
174
  expires_at: validateTimestamp(input.download_expires_at, "download_expires_at")
175
175
  }
176
176
  },
177
- parsed: parsedData
177
+ parsed: parsedData,
178
+ auth: input.auth
178
179
  }
179
180
  };
180
181
  }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AuthConfidence, AuthVerdict, DkimSignature, DkimSignatureResult, DmarcPolicy, DmarcResult, EmailAddress, EmailAuth, EmailReceivedEvent, KnownWebhookEvent, ParsedData, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedStatus, RawContent, RawContentDownloadOnly, RawContentInline, SpfResult, UnknownEvent, ValidateEmailAuthResult, WEBHOOK_VERSION$1 as WEBHOOK_VERSION, WebhookAttachment, WebhookEvent } from "./types-C8JlcpcT.js";
1
+ import { AuthConfidence, AuthVerdict, DkimResult, DkimSignature, DmarcPolicy, DmarcResult, EmailAddress, EmailAuth, EmailReceivedEvent, EventType, KnownWebhookEvent, ParsedData, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedStatus, RawContent, RawContentDownloadOnly, RawContentInline, SpfResult, UnknownEvent, ValidateEmailAuthResult, WEBHOOK_VERSION$1 as WEBHOOK_VERSION, WebhookAttachment, WebhookEvent } from "./types-CNRE7-kR.js";
2
2
  import { MYMX_CONFIRMED_HEADER$1 as MYMX_CONFIRMED_HEADER, MYMX_SIGNATURE_HEADER$1 as MYMX_SIGNATURE_HEADER, VerifyOptions, verifyWebhookSignature$1 as verifyWebhookSignature } from "./signing-Ecohrukk.js";
3
3
  import { MyMXWebhookError$1 as MyMXWebhookError, PAYLOAD_ERRORS$1 as PAYLOAD_ERRORS, RAW_EMAIL_ERRORS$1 as RAW_EMAIL_ERRORS, RawEmailDecodeError$1 as RawEmailDecodeError, RawEmailDecodeErrorCode, VERIFICATION_ERRORS$1 as VERIFICATION_ERRORS, WebhookErrorCode, WebhookPayloadError$1 as WebhookPayloadError, WebhookPayloadErrorCode, WebhookValidationError$1 as WebhookValidationError, WebhookValidationErrorCode, WebhookVerificationError$1 as WebhookVerificationError, WebhookVerificationErrorCode } from "./errors-CSPHzZB_.js";
4
4
 
@@ -173,10 +173,10 @@ declare const emailReceivedEventJsonSchema: {
173
173
  };
174
174
  readonly auth: {
175
175
  readonly $ref: "#/definitions/EmailAuth";
176
- readonly description: "Email authentication results (SPF, DKIM, DMARC). May be absent if authentication was not performed.";
176
+ readonly description: "Email authentication results (SPF, DKIM, DMARC).";
177
177
  };
178
178
  };
179
- readonly required: ["id", "received_at", "smtp", "headers", "content", "parsed"];
179
+ readonly required: ["id", "received_at", "smtp", "headers", "content", "parsed", "auth"];
180
180
  readonly additionalProperties: false;
181
181
  readonly description: "The email that triggered this event.";
182
182
  };
@@ -561,7 +561,7 @@ declare const emailReceivedEventJsonSchema: {
561
561
  readonly description: "The DKIM selector used to locate the public key (s= tag). Combined with the domain to form the DNS lookup: `selector._domainkey.domain`";
562
562
  };
563
563
  readonly result: {
564
- readonly $ref: "#/definitions/DkimSignatureResult";
564
+ readonly $ref: "#/definitions/DkimResult";
565
565
  readonly description: "Verification result for this specific signature.";
566
566
  };
567
567
  readonly aligned: {
@@ -581,7 +581,7 @@ declare const emailReceivedEventJsonSchema: {
581
581
  readonly additionalProperties: false;
582
582
  readonly description: "Details about a single DKIM signature found in the email.\n\nAn email may have multiple DKIM signatures (e.g., one from the sending domain and one from the ESP). Each signature is verified independently.";
583
583
  };
584
- readonly DkimSignatureResult: {
584
+ readonly DkimResult: {
585
585
  readonly type: "string";
586
586
  readonly enum: ["pass", "fail", "temperror", "permerror"];
587
587
  readonly description: "DKIM signature verification result for a single signature.";
@@ -927,4 +927,4 @@ declare function decodeRawEmail(event: EmailReceivedEvent, options?: DecodeRawEm
927
927
  declare function verifyRawEmailDownload(downloaded: Buffer | ArrayBuffer | Uint8Array, event: EmailReceivedEvent): Buffer;
928
928
 
929
929
  //#endregion
930
- export { AuthConfidence, AuthVerdict, DecodeRawEmailOptions, DkimSignature, DkimSignatureResult, DmarcPolicy, DmarcResult, EmailAddress, EmailAuth, EmailReceivedEvent, HandleWebhookOptions, KnownWebhookEvent, MYMX_CONFIRMED_HEADER, MYMX_SIGNATURE_HEADER, MyMXWebhookError, PAYLOAD_ERRORS, ParsedData, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedStatus, RAW_EMAIL_ERRORS, RawContent, RawContentDownloadOnly, RawContentInline, RawEmailDecodeError, RawEmailDecodeErrorCode, SpfResult, UnknownEvent, VERIFICATION_ERRORS, ValidateEmailAuthResult, VerifyOptions, WEBHOOK_VERSION, WebhookAttachment, WebhookErrorCode, WebhookEvent, WebhookHeaders, WebhookPayloadError, WebhookPayloadErrorCode, WebhookValidationError, WebhookValidationErrorCode, WebhookVerificationError, WebhookVerificationErrorCode, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, getDownloadTimeRemaining, handleWebhook, isDownloadExpired, isEmailReceivedEvent, isRawIncluded, parseWebhookEvent, validateEmailAuth, verifyRawEmailDownload, verifyWebhookSignature };
930
+ export { AuthConfidence, AuthVerdict, DecodeRawEmailOptions, DkimResult, DkimSignature, DmarcPolicy, DmarcResult, EmailAddress, EmailAuth, EmailReceivedEvent, EventType, HandleWebhookOptions, KnownWebhookEvent, MYMX_CONFIRMED_HEADER, MYMX_SIGNATURE_HEADER, MyMXWebhookError, PAYLOAD_ERRORS, ParsedData, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedStatus, RAW_EMAIL_ERRORS, RawContent, RawContentDownloadOnly, RawContentInline, RawEmailDecodeError, RawEmailDecodeErrorCode, SpfResult, UnknownEvent, VERIFICATION_ERRORS, ValidateEmailAuthResult, VerifyOptions, WEBHOOK_VERSION, WebhookAttachment, WebhookErrorCode, WebhookEvent, WebhookHeaders, WebhookPayloadError, WebhookPayloadErrorCode, WebhookValidationError, WebhookValidationErrorCode, WebhookVerificationError, WebhookVerificationErrorCode, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, getDownloadTimeRemaining, handleWebhook, isDownloadExpired, isEmailReceivedEvent, isRawIncluded, parseWebhookEvent, validateEmailAuth, verifyRawEmailDownload, verifyWebhookSignature };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { MyMXWebhookError, PAYLOAD_ERRORS, RAW_EMAIL_ERRORS, RawEmailDecodeError, VERIFICATION_ERRORS, WEBHOOK_VERSION, WebhookPayloadError, WebhookValidationError, WebhookVerificationError } from "./errors-2CwICC_t.js";
2
2
  import { MYMX_CONFIRMED_HEADER, MYMX_SIGNATURE_HEADER, bufferToString, verifyWebhookSignature } from "./signing-kfnmqAcK.js";
3
- import { validateEmailReceivedEvent } from "./zod-CalKEwR4.js";
3
+ import { validateEmailReceivedEvent } from "./zod-Df95bIDs.js";
4
4
  import { createHash } from "node:crypto";
5
5
 
6
6
  //#region src/schema.generated.ts
@@ -170,7 +170,7 @@ const emailReceivedEventJsonSchema = {
170
170
  },
171
171
  "auth": {
172
172
  "$ref": "#/definitions/EmailAuth",
173
- "description": "Email authentication results (SPF, DKIM, DMARC). May be absent if authentication was not performed."
173
+ "description": "Email authentication results (SPF, DKIM, DMARC)."
174
174
  }
175
175
  },
176
176
  "required": [
@@ -179,7 +179,8 @@ const emailReceivedEventJsonSchema = {
179
179
  "smtp",
180
180
  "headers",
181
181
  "content",
182
- "parsed"
182
+ "parsed",
183
+ "auth"
183
184
  ],
184
185
  "additionalProperties": false,
185
186
  "description": "The email that triggered this event."
@@ -614,7 +615,7 @@ const emailReceivedEventJsonSchema = {
614
615
  "description": "The DKIM selector used to locate the public key (s= tag). Combined with the domain to form the DNS lookup: `selector._domainkey.domain`"
615
616
  },
616
617
  "result": {
617
- "$ref": "#/definitions/DkimSignatureResult",
618
+ "$ref": "#/definitions/DkimResult",
618
619
  "description": "Verification result for this specific signature."
619
620
  },
620
621
  "aligned": {
@@ -641,7 +642,7 @@ const emailReceivedEventJsonSchema = {
641
642
  "additionalProperties": false,
642
643
  "description": "Details about a single DKIM signature found in the email.\n\nAn email may have multiple DKIM signatures (e.g., one from the sending domain and one from the ESP). Each signature is verified independently."
643
644
  },
644
- "DkimSignatureResult": {
645
+ "DkimResult": {
645
646
  "type": "string",
646
647
  "enum": [
647
648
  "pass",
@@ -654,6 +655,51 @@ const emailReceivedEventJsonSchema = {
654
655
  }
655
656
  };
656
657
 
658
+ //#endregion
659
+ //#region src/types.ts
660
+ const EventType = { EmailReceived: "email.received" };
661
+ const SpfResult = {
662
+ Pass: "pass",
663
+ Fail: "fail",
664
+ Softfail: "softfail",
665
+ Neutral: "neutral",
666
+ None: "none",
667
+ Temperror: "temperror",
668
+ Permerror: "permerror"
669
+ };
670
+ const DmarcResult = {
671
+ Pass: "pass",
672
+ Fail: "fail",
673
+ None: "none",
674
+ Temperror: "temperror",
675
+ Permerror: "permerror"
676
+ };
677
+ const DmarcPolicy = {
678
+ Reject: "reject",
679
+ Quarantine: "quarantine",
680
+ None: "none"
681
+ };
682
+ const DkimResult = {
683
+ Pass: "pass",
684
+ Fail: "fail",
685
+ Temperror: "temperror",
686
+ Permerror: "permerror"
687
+ };
688
+ const AuthVerdict = {
689
+ Legit: "legit",
690
+ Suspicious: "suspicious",
691
+ Unknown: "unknown"
692
+ };
693
+ const AuthConfidence = {
694
+ High: "high",
695
+ Medium: "medium",
696
+ Low: "low"
697
+ };
698
+ const ParsedStatus = {
699
+ Complete: "complete",
700
+ Failed: "failed"
701
+ };
702
+
657
703
  //#endregion
658
704
  //#region src/auth.ts
659
705
  /**
@@ -1183,4 +1229,4 @@ function verifyRawEmailDownload(downloaded, event) {
1183
1229
  }
1184
1230
 
1185
1231
  //#endregion
1186
- export { MYMX_CONFIRMED_HEADER, MYMX_SIGNATURE_HEADER, MyMXWebhookError, PAYLOAD_ERRORS, RAW_EMAIL_ERRORS, RawEmailDecodeError, VERIFICATION_ERRORS, WEBHOOK_VERSION, WebhookPayloadError, WebhookValidationError, WebhookVerificationError, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, getDownloadTimeRemaining, handleWebhook, isDownloadExpired, isEmailReceivedEvent, isRawIncluded, parseWebhookEvent, validateEmailAuth, verifyRawEmailDownload, verifyWebhookSignature };
1232
+ export { AuthConfidence, AuthVerdict, DkimResult, DmarcPolicy, DmarcResult, EventType, MYMX_CONFIRMED_HEADER, MYMX_SIGNATURE_HEADER, MyMXWebhookError, PAYLOAD_ERRORS, ParsedStatus, RAW_EMAIL_ERRORS, RawEmailDecodeError, SpfResult, VERIFICATION_ERRORS, WEBHOOK_VERSION, WebhookPayloadError, WebhookValidationError, WebhookVerificationError, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, getDownloadTimeRemaining, handleWebhook, isDownloadExpired, isEmailReceivedEvent, isRawIncluded, parseWebhookEvent, validateEmailAuth, verifyRawEmailDownload, verifyWebhookSignature };
@@ -289,6 +289,13 @@ interface RawContentDownloadOnly {
289
289
  * ```
290
290
  */
291
291
  type RawContent = RawContentInline | RawContentDownloadOnly;
292
+ declare const EventType: {
293
+ readonly EmailReceived: "email.received";
294
+ };
295
+ /**
296
+ * Webhook event type.
297
+ */
298
+ type EventType = (typeof EventType)[keyof typeof EventType];
292
299
  /**
293
300
  * Webhook payload for the `email.received` event.
294
301
  *
@@ -468,23 +475,43 @@ interface EmailReceivedEvent {
468
475
  };
469
476
  /**
470
477
  * Email authentication results (SPF, DKIM, DMARC).
471
- * May be absent if authentication was not performed.
472
478
  */
473
- auth?: EmailAuth;
479
+ auth: EmailAuth;
474
480
  };
475
481
  }
482
+ declare const SpfResult: {
483
+ readonly Pass: "pass";
484
+ readonly Fail: "fail";
485
+ readonly Softfail: "softfail";
486
+ readonly Neutral: "neutral";
487
+ readonly None: "none";
488
+ readonly Temperror: "temperror";
489
+ readonly Permerror: "permerror";
490
+ };
476
491
  /**
477
492
  * SPF verification result.
478
493
  *
479
494
  * @see https://datatracker.ietf.org/doc/html/rfc7208
480
495
  */
481
- type SpfResult = "pass" | "fail" | "softfail" | "neutral" | "none" | "temperror" | "permerror";
496
+ type SpfResult = (typeof SpfResult)[keyof typeof SpfResult];
497
+ declare const DmarcResult: {
498
+ readonly Pass: "pass";
499
+ readonly Fail: "fail";
500
+ readonly None: "none";
501
+ readonly Temperror: "temperror";
502
+ readonly Permerror: "permerror";
503
+ };
482
504
  /**
483
505
  * DMARC verification result.
484
506
  *
485
507
  * @see https://datatracker.ietf.org/doc/html/rfc7489
486
508
  */
487
- type DmarcResult = "pass" | "fail" | "none" | "temperror" | "permerror";
509
+ type DmarcResult = (typeof DmarcResult)[keyof typeof DmarcResult];
510
+ declare const DmarcPolicy: {
511
+ readonly Reject: "reject";
512
+ readonly Quarantine: "quarantine";
513
+ readonly None: "none";
514
+ };
488
515
  /**
489
516
  * DMARC policy action specified in the domain's DMARC record.
490
517
  *
@@ -493,11 +520,21 @@ type DmarcResult = "pass" | "fail" | "none" | "temperror" | "permerror";
493
520
  * - `none`: The domain owner is only monitoring (no action requested)
494
521
  * - `null`: No DMARC policy was found for the domain
495
522
  */
496
- type DmarcPolicy = "reject" | "quarantine" | "none" | null;
523
+ type DmarcPolicy = (typeof DmarcPolicy)[keyof typeof DmarcPolicy] | null;
524
+ declare const DkimResult: {
525
+ readonly Pass: "pass";
526
+ readonly Fail: "fail";
527
+ readonly Temperror: "temperror";
528
+ readonly Permerror: "permerror";
529
+ };
497
530
  /**
498
531
  * DKIM signature verification result for a single signature.
499
532
  */
500
- type DkimSignatureResult = "pass" | "fail" | "temperror" | "permerror";
533
+ type DkimResult = (typeof DkimResult)[keyof typeof DkimResult];
534
+ /**
535
+ * @deprecated Use `DkimResult` instead. This alias is for backwards compatibility.
536
+ */
537
+
501
538
  /**
502
539
  * Details about a single DKIM signature found in the email.
503
540
  *
@@ -518,7 +555,7 @@ interface DkimSignature {
518
555
  /**
519
556
  * Verification result for this specific signature.
520
557
  */
521
- result: DkimSignatureResult;
558
+ result: DkimResult;
522
559
  /**
523
560
  * Whether this signature's domain aligns with the From: domain (for DMARC).
524
561
  *
@@ -548,12 +585,10 @@ interface DkimSignature {
548
585
  * import { handleWebhook, validateEmailAuth } from 'mymx';
549
586
  *
550
587
  * const event = handleWebhook({ body, headers, secret });
588
+ * const result = validateEmailAuth(event.email.auth);
551
589
  *
552
- * if (event.email.auth) {
553
- * const result = validateEmailAuth(event.email.auth);
554
- * if (result.verdict === 'legit') {
555
- * // Email passed authentication
556
- * }
590
+ * if (result.verdict === 'legit') {
591
+ * // Email passed authentication
557
592
  * }
558
593
  * ```
559
594
  */
@@ -624,6 +659,11 @@ interface EmailAuth {
624
659
  */
625
660
  dkimSignatures: DkimSignature[];
626
661
  }
662
+ declare const AuthVerdict: {
663
+ readonly Legit: "legit";
664
+ readonly Suspicious: "suspicious";
665
+ readonly Unknown: "unknown";
666
+ };
627
667
  /**
628
668
  * Overall verdict from email authentication validation.
629
669
  *
@@ -631,7 +671,12 @@ interface EmailAuth {
631
671
  * - `suspicious`: Evidence suggests the email may be spoofed
632
672
  * - `unknown`: Not enough information to determine authenticity
633
673
  */
634
- type AuthVerdict = "legit" | "suspicious" | "unknown";
674
+ type AuthVerdict = (typeof AuthVerdict)[keyof typeof AuthVerdict];
675
+ declare const AuthConfidence: {
676
+ readonly High: "high";
677
+ readonly Medium: "medium";
678
+ readonly Low: "low";
679
+ };
635
680
  /**
636
681
  * Confidence level for the authentication verdict.
637
682
  *
@@ -639,7 +684,7 @@ type AuthVerdict = "legit" | "suspicious" | "unknown";
639
684
  * - `medium`: Good evidence but with caveats (SPF-only alignment)
640
685
  * - `low`: Weak evidence (missing authentication or unclear results)
641
686
  */
642
- type AuthConfidence = "high" | "medium" | "low";
687
+ type AuthConfidence = (typeof AuthConfidence)[keyof typeof AuthConfidence];
643
688
  /**
644
689
  * Result of validating email authentication.
645
690
  *
@@ -723,8 +768,12 @@ type KnownWebhookEvent = EmailReceivedEvent;
723
768
  * for known events and forward-compatibility for unknown events.
724
769
  */
725
770
  type WebhookEvent = KnownWebhookEvent | UnknownEvent;
771
+ declare const ParsedStatus: {
772
+ readonly Complete: "complete";
773
+ readonly Failed: "failed";
774
+ };
726
775
  /**
727
776
  * Possible values for the `status` field in {@link ParsedData}.
728
777
  */
729
- type ParsedStatus = "complete" | "failed"; //#endregion
730
- export { AuthConfidence, AuthVerdict, DkimSignature, DkimSignatureResult, DmarcPolicy, DmarcResult, EmailAddress, EmailAuth, EmailReceivedEvent, KnownWebhookEvent, ParsedData, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedStatus, RawContent, RawContentDownloadOnly, RawContentInline, SpfResult, UnknownEvent, ValidateEmailAuthResult, WEBHOOK_VERSION as WEBHOOK_VERSION$1, WebhookAttachment, WebhookEvent };
778
+ type ParsedStatus = (typeof ParsedStatus)[keyof typeof ParsedStatus]; //#endregion
779
+ export { AuthConfidence, AuthVerdict, DkimResult, DkimSignature, DmarcPolicy, DmarcResult, EmailAddress, EmailAuth, EmailReceivedEvent, EventType, KnownWebhookEvent, ParsedData, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedStatus, RawContent, RawContentDownloadOnly, RawContentInline, SpfResult, UnknownEvent, ValidateEmailAuthResult, WEBHOOK_VERSION as WEBHOOK_VERSION$1, WebhookAttachment, WebhookEvent };
@@ -152,7 +152,7 @@ const emailReceivedEventSchema = z.object({
152
152
  }),
153
153
  parsed: parsedDataSchema,
154
154
  analysis: z.object({ spamassassin: z.object({ score: z.number() }) }).optional(),
155
- auth: emailAuthSchema.optional()
155
+ auth: emailAuthSchema
156
156
  })
157
157
  });
158
158
  /**
package/dist/zod.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { EmailReceivedEvent } from "./types-C8JlcpcT.js";
1
+ import { EmailReceivedEvent } from "./types-CNRE7-kR.js";
2
2
  import { WebhookValidationError$1 as WebhookValidationError, WebhookValidationErrorCode } from "./errors-CSPHzZB_.js";
3
3
  import { z } from "zod";
4
4
 
@@ -1006,7 +1006,7 @@ declare const emailReceivedEventSchema: z.ZodObject<{
1006
1006
  score: number;
1007
1007
  };
1008
1008
  }>>;
1009
- auth: z.ZodOptional<z.ZodObject<{
1009
+ auth: z.ZodObject<{
1010
1010
  spf: z.ZodEnum<["pass", "fail", "softfail", "neutral", "none", "temperror", "permerror"]>;
1011
1011
  dmarc: z.ZodEnum<["pass", "fail", "none", "temperror", "permerror"]>;
1012
1012
  dmarcPolicy: z.ZodNullable<z.ZodEnum<["reject", "quarantine", "none"]>>;
@@ -1071,7 +1071,7 @@ declare const emailReceivedEventSchema: z.ZodObject<{
1071
1071
  keyBits: number | null;
1072
1072
  algo: string;
1073
1073
  }[];
1074
- }>>;
1074
+ }>;
1075
1075
  }, "strip", z.ZodTypeAny, {
1076
1076
  id: string;
1077
1077
  received_at: string;
@@ -1159,12 +1159,7 @@ declare const emailReceivedEventSchema: z.ZodObject<{
1159
1159
  }[];
1160
1160
  attachments_download_url: null;
1161
1161
  };
1162
- analysis?: {
1163
- spamassassin: {
1164
- score: number;
1165
- };
1166
- } | undefined;
1167
- auth?: {
1162
+ auth: {
1168
1163
  spf: "pass" | "fail" | "softfail" | "neutral" | "none" | "temperror" | "permerror";
1169
1164
  dmarc: "pass" | "fail" | "none" | "temperror" | "permerror";
1170
1165
  dmarcPolicy: "none" | "reject" | "quarantine" | null;
@@ -1181,6 +1176,11 @@ declare const emailReceivedEventSchema: z.ZodObject<{
1181
1176
  keyBits: number | null;
1182
1177
  algo: string;
1183
1178
  }[];
1179
+ };
1180
+ analysis?: {
1181
+ spamassassin: {
1182
+ score: number;
1183
+ };
1184
1184
  } | undefined;
1185
1185
  }, {
1186
1186
  id: string;
@@ -1269,12 +1269,7 @@ declare const emailReceivedEventSchema: z.ZodObject<{
1269
1269
  }[];
1270
1270
  attachments_download_url: null;
1271
1271
  };
1272
- analysis?: {
1273
- spamassassin: {
1274
- score: number;
1275
- };
1276
- } | undefined;
1277
- auth?: {
1272
+ auth: {
1278
1273
  spf: "pass" | "fail" | "softfail" | "neutral" | "none" | "temperror" | "permerror";
1279
1274
  dmarc: "pass" | "fail" | "none" | "temperror" | "permerror";
1280
1275
  dmarcPolicy: "none" | "reject" | "quarantine" | null;
@@ -1291,6 +1286,11 @@ declare const emailReceivedEventSchema: z.ZodObject<{
1291
1286
  keyBits: number | null;
1292
1287
  algo: string;
1293
1288
  }[];
1289
+ };
1290
+ analysis?: {
1291
+ spamassassin: {
1292
+ score: number;
1293
+ };
1294
1294
  } | undefined;
1295
1295
  }>;
1296
1296
  }, "strip", z.ZodTypeAny, {
@@ -1389,12 +1389,7 @@ declare const emailReceivedEventSchema: z.ZodObject<{
1389
1389
  }[];
1390
1390
  attachments_download_url: null;
1391
1391
  };
1392
- analysis?: {
1393
- spamassassin: {
1394
- score: number;
1395
- };
1396
- } | undefined;
1397
- auth?: {
1392
+ auth: {
1398
1393
  spf: "pass" | "fail" | "softfail" | "neutral" | "none" | "temperror" | "permerror";
1399
1394
  dmarc: "pass" | "fail" | "none" | "temperror" | "permerror";
1400
1395
  dmarcPolicy: "none" | "reject" | "quarantine" | null;
@@ -1411,6 +1406,11 @@ declare const emailReceivedEventSchema: z.ZodObject<{
1411
1406
  keyBits: number | null;
1412
1407
  algo: string;
1413
1408
  }[];
1409
+ };
1410
+ analysis?: {
1411
+ spamassassin: {
1412
+ score: number;
1413
+ };
1414
1414
  } | undefined;
1415
1415
  };
1416
1416
  }, {
@@ -1509,12 +1509,7 @@ declare const emailReceivedEventSchema: z.ZodObject<{
1509
1509
  }[];
1510
1510
  attachments_download_url: null;
1511
1511
  };
1512
- analysis?: {
1513
- spamassassin: {
1514
- score: number;
1515
- };
1516
- } | undefined;
1517
- auth?: {
1512
+ auth: {
1518
1513
  spf: "pass" | "fail" | "softfail" | "neutral" | "none" | "temperror" | "permerror";
1519
1514
  dmarc: "pass" | "fail" | "none" | "temperror" | "permerror";
1520
1515
  dmarcPolicy: "none" | "reject" | "quarantine" | null;
@@ -1531,6 +1526,11 @@ declare const emailReceivedEventSchema: z.ZodObject<{
1531
1526
  keyBits: number | null;
1532
1527
  algo: string;
1533
1528
  }[];
1529
+ };
1530
+ analysis?: {
1531
+ spamassassin: {
1532
+ score: number;
1533
+ };
1534
1534
  } | undefined;
1535
1535
  };
1536
1536
  }>;
package/dist/zod.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { WebhookValidationError } from "./errors-2CwICC_t.js";
2
- import { dkimSignatureResultSchema, dkimSignatureSchema, dmarcPolicySchema, dmarcResultSchema, emailAddressSchema, emailAuthSchema, emailReceivedEventSchema, parsedDataCompleteSchema, parsedDataFailedSchema, parsedDataSchema, parsedErrorSchema, rawContentDownloadOnlySchema, rawContentInlineSchema, rawContentSchema, safeValidateEmailReceivedEvent, spfResultSchema, validateEmailReceivedEvent, webhookAttachmentSchema } from "./zod-CalKEwR4.js";
2
+ import { dkimSignatureResultSchema, dkimSignatureSchema, dmarcPolicySchema, dmarcResultSchema, emailAddressSchema, emailAuthSchema, emailReceivedEventSchema, parsedDataCompleteSchema, parsedDataFailedSchema, parsedDataSchema, parsedErrorSchema, rawContentDownloadOnlySchema, rawContentInlineSchema, rawContentSchema, safeValidateEmailReceivedEvent, spfResultSchema, validateEmailReceivedEvent, webhookAttachmentSchema } from "./zod-Df95bIDs.js";
3
3
 
4
4
  export { WebhookValidationError, dkimSignatureResultSchema, dkimSignatureSchema, dmarcPolicySchema, dmarcResultSchema, emailAddressSchema, emailAuthSchema, emailReceivedEventSchema, parsedDataCompleteSchema, parsedDataFailedSchema, parsedDataSchema, parsedErrorSchema, rawContentDownloadOnlySchema, rawContentInlineSchema, rawContentSchema, safeValidateEmailReceivedEvent, spfResultSchema, validateEmailReceivedEvent, webhookAttachmentSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mymx",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "description": "Official MyMX Node.js SDK for webhook signature verification",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",