mymx 0.3.8 → 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.
- package/dist/contract.d.ts +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +48 -3
- package/dist/{types-B5aR2RnG.d.ts → types-CNRE7-kR.d.ts} +61 -9
- package/dist/zod.d.ts +1 -1
- package/package.json +1 -1
package/dist/contract.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EmailAddress, EmailAuth, EmailReceivedEvent, ParsedDataComplete, ParsedDataFailed, ParsedError, RawContentDownloadOnly, RawContentInline, WEBHOOK_VERSION$1 as WEBHOOK_VERSION, WebhookAttachment } from "./types-
|
|
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
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthConfidence, AuthVerdict,
|
|
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
|
|
|
@@ -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/
|
|
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
|
|
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,
|
|
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
|
@@ -615,7 +615,7 @@ const emailReceivedEventJsonSchema = {
|
|
|
615
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`"
|
|
616
616
|
},
|
|
617
617
|
"result": {
|
|
618
|
-
"$ref": "#/definitions/
|
|
618
|
+
"$ref": "#/definitions/DkimResult",
|
|
619
619
|
"description": "Verification result for this specific signature."
|
|
620
620
|
},
|
|
621
621
|
"aligned": {
|
|
@@ -642,7 +642,7 @@ const emailReceivedEventJsonSchema = {
|
|
|
642
642
|
"additionalProperties": false,
|
|
643
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."
|
|
644
644
|
},
|
|
645
|
-
"
|
|
645
|
+
"DkimResult": {
|
|
646
646
|
"type": "string",
|
|
647
647
|
"enum": [
|
|
648
648
|
"pass",
|
|
@@ -655,6 +655,51 @@ const emailReceivedEventJsonSchema = {
|
|
|
655
655
|
}
|
|
656
656
|
};
|
|
657
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
|
+
|
|
658
703
|
//#endregion
|
|
659
704
|
//#region src/auth.ts
|
|
660
705
|
/**
|
|
@@ -1184,4 +1229,4 @@ function verifyRawEmailDownload(downloaded, event) {
|
|
|
1184
1229
|
}
|
|
1185
1230
|
|
|
1186
1231
|
//#endregion
|
|
1187
|
-
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
|
*
|
|
@@ -472,18 +479,39 @@ interface EmailReceivedEvent {
|
|
|
472
479
|
auth: EmailAuth;
|
|
473
480
|
};
|
|
474
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
|
+
};
|
|
475
491
|
/**
|
|
476
492
|
* SPF verification result.
|
|
477
493
|
*
|
|
478
494
|
* @see https://datatracker.ietf.org/doc/html/rfc7208
|
|
479
495
|
*/
|
|
480
|
-
type SpfResult =
|
|
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
|
+
};
|
|
481
504
|
/**
|
|
482
505
|
* DMARC verification result.
|
|
483
506
|
*
|
|
484
507
|
* @see https://datatracker.ietf.org/doc/html/rfc7489
|
|
485
508
|
*/
|
|
486
|
-
type DmarcResult =
|
|
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
|
+
};
|
|
487
515
|
/**
|
|
488
516
|
* DMARC policy action specified in the domain's DMARC record.
|
|
489
517
|
*
|
|
@@ -492,11 +520,21 @@ type DmarcResult = "pass" | "fail" | "none" | "temperror" | "permerror";
|
|
|
492
520
|
* - `none`: The domain owner is only monitoring (no action requested)
|
|
493
521
|
* - `null`: No DMARC policy was found for the domain
|
|
494
522
|
*/
|
|
495
|
-
type DmarcPolicy =
|
|
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
|
+
};
|
|
496
530
|
/**
|
|
497
531
|
* DKIM signature verification result for a single signature.
|
|
498
532
|
*/
|
|
499
|
-
type
|
|
533
|
+
type DkimResult = (typeof DkimResult)[keyof typeof DkimResult];
|
|
534
|
+
/**
|
|
535
|
+
* @deprecated Use `DkimResult` instead. This alias is for backwards compatibility.
|
|
536
|
+
*/
|
|
537
|
+
|
|
500
538
|
/**
|
|
501
539
|
* Details about a single DKIM signature found in the email.
|
|
502
540
|
*
|
|
@@ -517,7 +555,7 @@ interface DkimSignature {
|
|
|
517
555
|
/**
|
|
518
556
|
* Verification result for this specific signature.
|
|
519
557
|
*/
|
|
520
|
-
result:
|
|
558
|
+
result: DkimResult;
|
|
521
559
|
/**
|
|
522
560
|
* Whether this signature's domain aligns with the From: domain (for DMARC).
|
|
523
561
|
*
|
|
@@ -621,6 +659,11 @@ interface EmailAuth {
|
|
|
621
659
|
*/
|
|
622
660
|
dkimSignatures: DkimSignature[];
|
|
623
661
|
}
|
|
662
|
+
declare const AuthVerdict: {
|
|
663
|
+
readonly Legit: "legit";
|
|
664
|
+
readonly Suspicious: "suspicious";
|
|
665
|
+
readonly Unknown: "unknown";
|
|
666
|
+
};
|
|
624
667
|
/**
|
|
625
668
|
* Overall verdict from email authentication validation.
|
|
626
669
|
*
|
|
@@ -628,7 +671,12 @@ interface EmailAuth {
|
|
|
628
671
|
* - `suspicious`: Evidence suggests the email may be spoofed
|
|
629
672
|
* - `unknown`: Not enough information to determine authenticity
|
|
630
673
|
*/
|
|
631
|
-
type AuthVerdict =
|
|
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
|
+
};
|
|
632
680
|
/**
|
|
633
681
|
* Confidence level for the authentication verdict.
|
|
634
682
|
*
|
|
@@ -636,7 +684,7 @@ type AuthVerdict = "legit" | "suspicious" | "unknown";
|
|
|
636
684
|
* - `medium`: Good evidence but with caveats (SPF-only alignment)
|
|
637
685
|
* - `low`: Weak evidence (missing authentication or unclear results)
|
|
638
686
|
*/
|
|
639
|
-
type AuthConfidence =
|
|
687
|
+
type AuthConfidence = (typeof AuthConfidence)[keyof typeof AuthConfidence];
|
|
640
688
|
/**
|
|
641
689
|
* Result of validating email authentication.
|
|
642
690
|
*
|
|
@@ -720,8 +768,12 @@ type KnownWebhookEvent = EmailReceivedEvent;
|
|
|
720
768
|
* for known events and forward-compatibility for unknown events.
|
|
721
769
|
*/
|
|
722
770
|
type WebhookEvent = KnownWebhookEvent | UnknownEvent;
|
|
771
|
+
declare const ParsedStatus: {
|
|
772
|
+
readonly Complete: "complete";
|
|
773
|
+
readonly Failed: "failed";
|
|
774
|
+
};
|
|
723
775
|
/**
|
|
724
776
|
* Possible values for the `status` field in {@link ParsedData}.
|
|
725
777
|
*/
|
|
726
|
-
type ParsedStatus =
|
|
727
|
-
export { AuthConfidence, AuthVerdict,
|
|
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 };
|
package/dist/zod.d.ts
CHANGED