@primitivedotdev/sdk 0.2.0 → 0.2.1
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/index.d.ts +1 -1
- package/dist/contract/index.js +1 -1
- package/dist/{index-C9pON-wY.d.ts → index-pNcbeqPI.d.ts} +6 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/parser/index.d.ts +6 -1
- package/dist/parser/index.js +119 -2
- package/dist/webhook/index.d.ts +2 -2
- package/dist/webhook/index.js +2 -2
- package/dist/{webhook-h24dbQEE.js → webhook-CqFsX50W.js} +28 -8
- package/package.json +4 -2
package/dist/contract/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EmailAddress, EmailAnalysis, EmailAuth, EmailReceivedEvent, ParsedDataComplete, ParsedDataFailed, ParsedError, RawContentDownloadOnly, RawContentInline, WebhookAttachment } from "../types-C6M6oCRS.js";
|
|
2
|
-
import { SignResult, WEBHOOK_VERSION$1 as WEBHOOK_VERSION, signWebhookPayload$1 as signWebhookPayload } from "../index-
|
|
2
|
+
import { SignResult, WEBHOOK_VERSION$1 as WEBHOOK_VERSION, signWebhookPayload$1 as signWebhookPayload } from "../index-pNcbeqPI.js";
|
|
3
3
|
|
|
4
4
|
//#region src/contract/contract.d.ts
|
|
5
5
|
/** Maximum raw email size for inline inclusion (256 KB). */
|
package/dist/contract/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WEBHOOK_VERSION, signWebhookPayload, validateEmailReceivedEvent } from "../webhook-
|
|
1
|
+
import { WEBHOOK_VERSION, signWebhookPayload, validateEmailReceivedEvent } from "../webhook-CqFsX50W.js";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
|
|
4
4
|
//#region src/contract/contract.ts
|
|
@@ -242,8 +242,12 @@ declare function safeValidateEmailReceivedEvent(input: unknown): ValidationResul
|
|
|
242
242
|
*/
|
|
243
243
|
/** Header name for incoming webhook signature */
|
|
244
244
|
declare const PRIMITIVE_SIGNATURE_HEADER = "Primitive-Signature";
|
|
245
|
+
/** Legacy header name kept for backward compatibility with older servers */
|
|
246
|
+
declare const LEGACY_SIGNATURE_HEADER = "MyMX-Signature";
|
|
245
247
|
/** Header name to confirm webhook was processed (prevents retries) */
|
|
246
248
|
declare const PRIMITIVE_CONFIRMED_HEADER = "X-Primitive-Confirmed";
|
|
249
|
+
/** Legacy confirmed header name kept for backward compatibility */
|
|
250
|
+
declare const LEGACY_CONFIRMED_HEADER = "X-MyMX-Confirmed";
|
|
247
251
|
/**
|
|
248
252
|
* Result from signing a webhook payload
|
|
249
253
|
*/
|
|
@@ -1350,6 +1354,7 @@ declare function handleWebhook(options: HandleWebhookOptions): EmailReceivedEven
|
|
|
1350
1354
|
*/
|
|
1351
1355
|
declare function confirmedHeaders(): {
|
|
1352
1356
|
"X-Primitive-Confirmed": "true";
|
|
1357
|
+
"X-MyMX-Confirmed": "true";
|
|
1353
1358
|
};
|
|
1354
1359
|
/**
|
|
1355
1360
|
* Check if the download URL for a webhook event has expired.
|
|
@@ -1471,4 +1476,4 @@ declare function decodeRawEmail(event: EmailReceivedEvent, options?: DecodeRawEm
|
|
|
1471
1476
|
declare function verifyRawEmailDownload(downloaded: Buffer | ArrayBuffer | Uint8Array, event: EmailReceivedEvent): Buffer;
|
|
1472
1477
|
|
|
1473
1478
|
//#endregion
|
|
1474
|
-
export { DecodeRawEmailOptions, HandleWebhookOptions, PAYLOAD_ERRORS as PAYLOAD_ERRORS$1, PRIMITIVE_CONFIRMED_HEADER as PRIMITIVE_CONFIRMED_HEADER$1, PRIMITIVE_SIGNATURE_HEADER as PRIMITIVE_SIGNATURE_HEADER$1, PrimitiveWebhookError as PrimitiveWebhookError$1, RAW_EMAIL_ERRORS as RAW_EMAIL_ERRORS$1, RawEmailDecodeError as RawEmailDecodeError$1, RawEmailDecodeErrorCode, SignResult, VERIFICATION_ERRORS as VERIFICATION_ERRORS$1, VerifyOptions, WEBHOOK_VERSION as WEBHOOK_VERSION$1, WebhookErrorCode, WebhookHeaders, WebhookPayloadError as WebhookPayloadError$1, WebhookPayloadErrorCode, WebhookValidationError as WebhookValidationError$1, WebhookValidationErrorCode, WebhookVerificationError as WebhookVerificationError$1, WebhookVerificationErrorCode, confirmedHeaders as confirmedHeaders$1, decodeRawEmail as decodeRawEmail$1, emailReceivedEventJsonSchema as emailReceivedEventJsonSchema$1, getDownloadTimeRemaining as getDownloadTimeRemaining$1, handleWebhook as handleWebhook$1, isDownloadExpired as isDownloadExpired$1, isEmailReceivedEvent as isEmailReceivedEvent$1, isRawIncluded as isRawIncluded$1, parseWebhookEvent as parseWebhookEvent$1, safeValidateEmailReceivedEvent as safeValidateEmailReceivedEvent$1, signWebhookPayload as signWebhookPayload$1, validateEmailAuth as validateEmailAuth$1, validateEmailReceivedEvent as validateEmailReceivedEvent$1, verifyRawEmailDownload as verifyRawEmailDownload$1, verifyWebhookSignature as verifyWebhookSignature$1 };
|
|
1479
|
+
export { DecodeRawEmailOptions, HandleWebhookOptions, LEGACY_CONFIRMED_HEADER as LEGACY_CONFIRMED_HEADER$1, LEGACY_SIGNATURE_HEADER as LEGACY_SIGNATURE_HEADER$1, PAYLOAD_ERRORS as PAYLOAD_ERRORS$1, PRIMITIVE_CONFIRMED_HEADER as PRIMITIVE_CONFIRMED_HEADER$1, PRIMITIVE_SIGNATURE_HEADER as PRIMITIVE_SIGNATURE_HEADER$1, PrimitiveWebhookError as PrimitiveWebhookError$1, RAW_EMAIL_ERRORS as RAW_EMAIL_ERRORS$1, RawEmailDecodeError as RawEmailDecodeError$1, RawEmailDecodeErrorCode, SignResult, VERIFICATION_ERRORS as VERIFICATION_ERRORS$1, VerifyOptions, WEBHOOK_VERSION as WEBHOOK_VERSION$1, WebhookErrorCode, WebhookHeaders, WebhookPayloadError as WebhookPayloadError$1, WebhookPayloadErrorCode, WebhookValidationError as WebhookValidationError$1, WebhookValidationErrorCode, WebhookVerificationError as WebhookVerificationError$1, WebhookVerificationErrorCode, confirmedHeaders as confirmedHeaders$1, decodeRawEmail as decodeRawEmail$1, emailReceivedEventJsonSchema as emailReceivedEventJsonSchema$1, getDownloadTimeRemaining as getDownloadTimeRemaining$1, handleWebhook as handleWebhook$1, isDownloadExpired as isDownloadExpired$1, isEmailReceivedEvent as isEmailReceivedEvent$1, isRawIncluded as isRawIncluded$1, parseWebhookEvent as parseWebhookEvent$1, safeValidateEmailReceivedEvent as safeValidateEmailReceivedEvent$1, signWebhookPayload as signWebhookPayload$1, validateEmailAuth as validateEmailAuth$1, validateEmailReceivedEvent as validateEmailReceivedEvent$1, verifyRawEmailDownload as verifyRawEmailDownload$1, verifyWebhookSignature as verifyWebhookSignature$1 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AuthConfidence$1 as AuthConfidence, AuthVerdict$1 as AuthVerdict, DkimResult$1 as DkimResult, DkimSignature, DmarcPolicy$1 as DmarcPolicy, DmarcResult$1 as DmarcResult, EmailAddress, EmailAnalysis, EmailAuth, EmailReceivedEvent, EventType$1 as EventType, ForwardAnalysis, ForwardOriginalSender, ForwardResult, ForwardResultAttachmentAnalyzed, ForwardResultAttachmentSkipped, ForwardResultInline, ForwardVerdict$1 as ForwardVerdict, ForwardVerification, KnownWebhookEvent, ParsedData, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedStatus$1 as ParsedStatus, RawContent, RawContentDownloadOnly, RawContentInline, SpfResult$1 as SpfResult, UnknownEvent, ValidateEmailAuthResult, WebhookAttachment, WebhookEvent } from "./types-C6M6oCRS.js";
|
|
2
|
-
import { DecodeRawEmailOptions, HandleWebhookOptions, PAYLOAD_ERRORS$1 as PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER$1 as PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER$1 as PRIMITIVE_SIGNATURE_HEADER, PrimitiveWebhookError$1 as PrimitiveWebhookError, RAW_EMAIL_ERRORS$1 as RAW_EMAIL_ERRORS, RawEmailDecodeError$1 as RawEmailDecodeError, RawEmailDecodeErrorCode, SignResult, VERIFICATION_ERRORS$1 as VERIFICATION_ERRORS, VerifyOptions, WEBHOOK_VERSION$1 as WEBHOOK_VERSION, WebhookErrorCode, WebhookHeaders, WebhookPayloadError$1 as WebhookPayloadError, WebhookPayloadErrorCode, WebhookValidationError$1 as WebhookValidationError, WebhookValidationErrorCode, WebhookVerificationError$1 as WebhookVerificationError, WebhookVerificationErrorCode, confirmedHeaders$1 as confirmedHeaders, decodeRawEmail$1 as decodeRawEmail, emailReceivedEventJsonSchema$1 as emailReceivedEventJsonSchema, getDownloadTimeRemaining$1 as getDownloadTimeRemaining, handleWebhook$1 as handleWebhook, isDownloadExpired$1 as isDownloadExpired, isEmailReceivedEvent$1 as isEmailReceivedEvent, isRawIncluded$1 as isRawIncluded, parseWebhookEvent$1 as parseWebhookEvent, safeValidateEmailReceivedEvent$1 as safeValidateEmailReceivedEvent, signWebhookPayload$1 as signWebhookPayload, validateEmailAuth$1 as validateEmailAuth, validateEmailReceivedEvent$1 as validateEmailReceivedEvent, verifyRawEmailDownload$1 as verifyRawEmailDownload, verifyWebhookSignature$1 as verifyWebhookSignature } from "./index-
|
|
3
|
-
export { AuthConfidence, AuthVerdict, DecodeRawEmailOptions, DkimResult, DkimSignature, DmarcPolicy, DmarcResult, EmailAddress, EmailAnalysis, EmailAuth, EmailReceivedEvent, EventType, ForwardAnalysis, ForwardOriginalSender, ForwardResult, ForwardResultAttachmentAnalyzed, ForwardResultAttachmentSkipped, ForwardResultInline, ForwardVerdict, ForwardVerification, HandleWebhookOptions, KnownWebhookEvent, PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedData, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedStatus, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawContent, RawContentDownloadOnly, RawContentInline, RawEmailDecodeError, RawEmailDecodeErrorCode, SignResult, 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, safeValidateEmailReceivedEvent, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyRawEmailDownload, verifyWebhookSignature };
|
|
2
|
+
import { DecodeRawEmailOptions, HandleWebhookOptions, LEGACY_CONFIRMED_HEADER$1 as LEGACY_CONFIRMED_HEADER, LEGACY_SIGNATURE_HEADER$1 as LEGACY_SIGNATURE_HEADER, PAYLOAD_ERRORS$1 as PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER$1 as PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER$1 as PRIMITIVE_SIGNATURE_HEADER, PrimitiveWebhookError$1 as PrimitiveWebhookError, RAW_EMAIL_ERRORS$1 as RAW_EMAIL_ERRORS, RawEmailDecodeError$1 as RawEmailDecodeError, RawEmailDecodeErrorCode, SignResult, VERIFICATION_ERRORS$1 as VERIFICATION_ERRORS, VerifyOptions, WEBHOOK_VERSION$1 as WEBHOOK_VERSION, WebhookErrorCode, WebhookHeaders, WebhookPayloadError$1 as WebhookPayloadError, WebhookPayloadErrorCode, WebhookValidationError$1 as WebhookValidationError, WebhookValidationErrorCode, WebhookVerificationError$1 as WebhookVerificationError, WebhookVerificationErrorCode, confirmedHeaders$1 as confirmedHeaders, decodeRawEmail$1 as decodeRawEmail, emailReceivedEventJsonSchema$1 as emailReceivedEventJsonSchema, getDownloadTimeRemaining$1 as getDownloadTimeRemaining, handleWebhook$1 as handleWebhook, isDownloadExpired$1 as isDownloadExpired, isEmailReceivedEvent$1 as isEmailReceivedEvent, isRawIncluded$1 as isRawIncluded, parseWebhookEvent$1 as parseWebhookEvent, safeValidateEmailReceivedEvent$1 as safeValidateEmailReceivedEvent, signWebhookPayload$1 as signWebhookPayload, validateEmailAuth$1 as validateEmailAuth, validateEmailReceivedEvent$1 as validateEmailReceivedEvent, verifyRawEmailDownload$1 as verifyRawEmailDownload, verifyWebhookSignature$1 as verifyWebhookSignature } from "./index-pNcbeqPI.js";
|
|
3
|
+
export { AuthConfidence, AuthVerdict, DecodeRawEmailOptions, DkimResult, DkimSignature, DmarcPolicy, DmarcResult, EmailAddress, EmailAnalysis, EmailAuth, EmailReceivedEvent, EventType, ForwardAnalysis, ForwardOriginalSender, ForwardResult, ForwardResultAttachmentAnalyzed, ForwardResultAttachmentSkipped, ForwardResultInline, ForwardVerdict, ForwardVerification, HandleWebhookOptions, KnownWebhookEvent, LEGACY_CONFIRMED_HEADER, LEGACY_SIGNATURE_HEADER, PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedData, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedStatus, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawContent, RawContentDownloadOnly, RawContentInline, RawEmailDecodeError, RawEmailDecodeErrorCode, SignResult, 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, safeValidateEmailReceivedEvent, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyRawEmailDownload, verifyWebhookSignature };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AuthConfidence, AuthVerdict, DkimResult, DmarcPolicy, DmarcResult, EventType, ForwardVerdict, PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedStatus, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawEmailDecodeError, SpfResult, VERIFICATION_ERRORS, WEBHOOK_VERSION, WebhookPayloadError, WebhookValidationError, WebhookVerificationError, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, getDownloadTimeRemaining, handleWebhook, isDownloadExpired, isEmailReceivedEvent, isRawIncluded, parseWebhookEvent, safeValidateEmailReceivedEvent, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyRawEmailDownload, verifyWebhookSignature } from "./webhook-
|
|
1
|
+
import { AuthConfidence, AuthVerdict, DkimResult, DmarcPolicy, DmarcResult, EventType, ForwardVerdict, LEGACY_CONFIRMED_HEADER, LEGACY_SIGNATURE_HEADER, PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedStatus, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawEmailDecodeError, SpfResult, VERIFICATION_ERRORS, WEBHOOK_VERSION, WebhookPayloadError, WebhookValidationError, WebhookVerificationError, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, getDownloadTimeRemaining, handleWebhook, isDownloadExpired, isEmailReceivedEvent, isRawIncluded, parseWebhookEvent, safeValidateEmailReceivedEvent, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyRawEmailDownload, verifyWebhookSignature } from "./webhook-CqFsX50W.js";
|
|
2
2
|
|
|
3
|
-
export { AuthConfidence, AuthVerdict, DkimResult, DmarcPolicy, DmarcResult, EventType, ForwardVerdict, PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedStatus, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawEmailDecodeError, SpfResult, VERIFICATION_ERRORS, WEBHOOK_VERSION, WebhookPayloadError, WebhookValidationError, WebhookVerificationError, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, getDownloadTimeRemaining, handleWebhook, isDownloadExpired, isEmailReceivedEvent, isRawIncluded, parseWebhookEvent, safeValidateEmailReceivedEvent, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyRawEmailDownload, verifyWebhookSignature };
|
|
3
|
+
export { AuthConfidence, AuthVerdict, DkimResult, DmarcPolicy, DmarcResult, EventType, ForwardVerdict, LEGACY_CONFIRMED_HEADER, LEGACY_SIGNATURE_HEADER, PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedStatus, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawEmailDecodeError, SpfResult, VERIFICATION_ERRORS, WEBHOOK_VERSION, WebhookPayloadError, WebhookValidationError, WebhookVerificationError, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, getDownloadTimeRemaining, handleWebhook, isDownloadExpired, isEmailReceivedEvent, isRawIncluded, parseWebhookEvent, safeValidateEmailReceivedEvent, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyRawEmailDownload, verifyWebhookSignature };
|
package/dist/parser/index.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ interface ParsedEmailWithAttachments {
|
|
|
47
47
|
*/
|
|
48
48
|
declare function parseEmailWithAttachments(emlBuffer: Buffer, options?: {
|
|
49
49
|
generateAttachmentId?: () => string;
|
|
50
|
+
skipHtmlSanitization?: boolean;
|
|
50
51
|
}): Promise<ParsedEmailWithAttachments>;
|
|
51
52
|
/**
|
|
52
53
|
* Normalize a Content-Type to lowercase media type without parameters.
|
|
@@ -182,4 +183,8 @@ declare function toCanonicalHeaders(parsed: ParsedEmailWithAttachments): {
|
|
|
182
183
|
};
|
|
183
184
|
|
|
184
185
|
//#endregion
|
|
185
|
-
|
|
186
|
+
//#region src/parser/sanitize-html.d.ts
|
|
187
|
+
declare function sanitizeHtml(html: string): string;
|
|
188
|
+
|
|
189
|
+
//#endregion
|
|
190
|
+
export { AttachmentMetadata, BundleResult, ParsedAttachment, ParsedEmail, ParsedEmailWithAttachments, attachmentMetadataToWebhookAttachments, bundleAttachments, extractAttachmentMetadata, getAttachmentsStorageKey, normalizeContentType, parseEmail, parseEmailWithAttachments, sanitizeFilename, sanitizeHtml, sha256Hex, toCanonicalHeaders, toParsedDataComplete, toWebhookAttachments };
|
package/dist/parser/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { PassThrough } from "node:stream";
|
|
3
|
+
import DOMPurify from "isomorphic-dompurify";
|
|
3
4
|
|
|
4
5
|
//#region src/parser/attachment-bundler.ts
|
|
5
6
|
async function loadArchiver() {
|
|
@@ -104,6 +105,122 @@ function getAttachmentsStorageKey(emailId, sha256) {
|
|
|
104
105
|
return `attachments/${emailId}_${hash8}.tar.gz`;
|
|
105
106
|
}
|
|
106
107
|
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/parser/sanitize-html.ts
|
|
110
|
+
const ALLOWED_TAGS = [
|
|
111
|
+
"div",
|
|
112
|
+
"span",
|
|
113
|
+
"p",
|
|
114
|
+
"br",
|
|
115
|
+
"hr",
|
|
116
|
+
"b",
|
|
117
|
+
"i",
|
|
118
|
+
"u",
|
|
119
|
+
"strong",
|
|
120
|
+
"em",
|
|
121
|
+
"small",
|
|
122
|
+
"sub",
|
|
123
|
+
"sup",
|
|
124
|
+
"s",
|
|
125
|
+
"strike",
|
|
126
|
+
"h1",
|
|
127
|
+
"h2",
|
|
128
|
+
"h3",
|
|
129
|
+
"h4",
|
|
130
|
+
"h5",
|
|
131
|
+
"h6",
|
|
132
|
+
"ul",
|
|
133
|
+
"ol",
|
|
134
|
+
"li",
|
|
135
|
+
"dl",
|
|
136
|
+
"dt",
|
|
137
|
+
"dd",
|
|
138
|
+
"table",
|
|
139
|
+
"thead",
|
|
140
|
+
"tbody",
|
|
141
|
+
"tfoot",
|
|
142
|
+
"tr",
|
|
143
|
+
"th",
|
|
144
|
+
"td",
|
|
145
|
+
"colgroup",
|
|
146
|
+
"col",
|
|
147
|
+
"caption",
|
|
148
|
+
"a",
|
|
149
|
+
"img",
|
|
150
|
+
"blockquote",
|
|
151
|
+
"pre",
|
|
152
|
+
"code",
|
|
153
|
+
"address",
|
|
154
|
+
"center",
|
|
155
|
+
"font",
|
|
156
|
+
"big"
|
|
157
|
+
];
|
|
158
|
+
const ALLOWED_ATTRS = [
|
|
159
|
+
"class",
|
|
160
|
+
"id",
|
|
161
|
+
"dir",
|
|
162
|
+
"lang",
|
|
163
|
+
"href",
|
|
164
|
+
"title",
|
|
165
|
+
"target",
|
|
166
|
+
"rel",
|
|
167
|
+
"src",
|
|
168
|
+
"alt",
|
|
169
|
+
"width",
|
|
170
|
+
"height",
|
|
171
|
+
"border",
|
|
172
|
+
"cellpadding",
|
|
173
|
+
"cellspacing",
|
|
174
|
+
"align",
|
|
175
|
+
"valign",
|
|
176
|
+
"bgcolor",
|
|
177
|
+
"colspan",
|
|
178
|
+
"rowspan",
|
|
179
|
+
"span",
|
|
180
|
+
"color",
|
|
181
|
+
"size",
|
|
182
|
+
"face"
|
|
183
|
+
];
|
|
184
|
+
const ALLOWED_URI_REGEXP = /^(data:|mailto:|#)/i;
|
|
185
|
+
function sanitizeHtml(html) {
|
|
186
|
+
DOMPurify.addHook("uponSanitizeAttribute", (_node, data) => {
|
|
187
|
+
if (data.attrName.startsWith("on")) data.keepAttr = false;
|
|
188
|
+
if (data.attrName === "style") data.keepAttr = false;
|
|
189
|
+
});
|
|
190
|
+
DOMPurify.addHook("afterSanitizeAttributes", (node) => {
|
|
191
|
+
if (node.tagName === "A") {
|
|
192
|
+
const target = node.getAttribute("target");
|
|
193
|
+
if (target === "_blank") node.setAttribute("rel", "noopener noreferrer");
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
const result = DOMPurify.sanitize(html, {
|
|
197
|
+
ALLOWED_TAGS,
|
|
198
|
+
ALLOWED_ATTR: ALLOWED_ATTRS,
|
|
199
|
+
ALLOW_DATA_ATTR: false,
|
|
200
|
+
ALLOW_UNKNOWN_PROTOCOLS: false,
|
|
201
|
+
ALLOWED_URI_REGEXP,
|
|
202
|
+
FORBID_TAGS: [
|
|
203
|
+
"style",
|
|
204
|
+
"script",
|
|
205
|
+
"iframe",
|
|
206
|
+
"object",
|
|
207
|
+
"embed",
|
|
208
|
+
"form",
|
|
209
|
+
"input",
|
|
210
|
+
"button",
|
|
211
|
+
"select",
|
|
212
|
+
"textarea",
|
|
213
|
+
"link",
|
|
214
|
+
"meta",
|
|
215
|
+
"base",
|
|
216
|
+
"svg",
|
|
217
|
+
"math"
|
|
218
|
+
]
|
|
219
|
+
});
|
|
220
|
+
DOMPurify.removeAllHooks();
|
|
221
|
+
return result;
|
|
222
|
+
}
|
|
223
|
+
|
|
107
224
|
//#endregion
|
|
108
225
|
//#region src/parser/attachment-parser.ts
|
|
109
226
|
async function loadMailparser$1() {
|
|
@@ -169,7 +286,7 @@ async function parseEmailWithAttachments(emlBuffer, options) {
|
|
|
169
286
|
});
|
|
170
287
|
}
|
|
171
288
|
let bodyHtml = null;
|
|
172
|
-
if (parsed.html && typeof parsed.html === "string") bodyHtml = parsed.html;
|
|
289
|
+
if (parsed.html && typeof parsed.html === "string") bodyHtml = options?.skipHtmlSanitization ? parsed.html : sanitizeHtml(parsed.html);
|
|
173
290
|
return {
|
|
174
291
|
bodyText: parsed.text ?? null,
|
|
175
292
|
bodyHtml,
|
|
@@ -435,4 +552,4 @@ function requireNonEmptyHeader(value, headerName) {
|
|
|
435
552
|
}
|
|
436
553
|
|
|
437
554
|
//#endregion
|
|
438
|
-
export { attachmentMetadataToWebhookAttachments, bundleAttachments, extractAttachmentMetadata, getAttachmentsStorageKey, normalizeContentType, parseEmail, parseEmailWithAttachments, sanitizeFilename, sha256Hex, toCanonicalHeaders, toParsedDataComplete, toWebhookAttachments };
|
|
555
|
+
export { attachmentMetadataToWebhookAttachments, bundleAttachments, extractAttachmentMetadata, getAttachmentsStorageKey, normalizeContentType, parseEmail, parseEmailWithAttachments, sanitizeFilename, sanitizeHtml, sha256Hex, toCanonicalHeaders, toParsedDataComplete, toWebhookAttachments };
|
package/dist/webhook/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AuthConfidence$1 as AuthConfidence, AuthVerdict$1 as AuthVerdict, DkimResult$1 as DkimResult, DkimSignature, DmarcPolicy$1 as DmarcPolicy, DmarcResult$1 as DmarcResult, EmailAddress, EmailAnalysis, EmailAuth, EmailReceivedEvent, EventType$1 as EventType, ForwardAnalysis, ForwardOriginalSender, ForwardResult, ForwardResultAttachmentAnalyzed, ForwardResultAttachmentSkipped, ForwardResultInline, ForwardVerdict$1 as ForwardVerdict, ForwardVerification, KnownWebhookEvent, ParsedData, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedStatus$1 as ParsedStatus, RawContent, RawContentDownloadOnly, RawContentInline, SpfResult$1 as SpfResult, UnknownEvent, ValidateEmailAuthResult, WebhookAttachment, WebhookEvent } from "../types-C6M6oCRS.js";
|
|
2
|
-
import { DecodeRawEmailOptions, HandleWebhookOptions, PAYLOAD_ERRORS$1 as PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER$1 as PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER$1 as PRIMITIVE_SIGNATURE_HEADER, PrimitiveWebhookError$1 as PrimitiveWebhookError, RAW_EMAIL_ERRORS$1 as RAW_EMAIL_ERRORS, RawEmailDecodeError$1 as RawEmailDecodeError, RawEmailDecodeErrorCode, SignResult, VERIFICATION_ERRORS$1 as VERIFICATION_ERRORS, VerifyOptions, WEBHOOK_VERSION$1 as WEBHOOK_VERSION, WebhookErrorCode, WebhookHeaders, WebhookPayloadError$1 as WebhookPayloadError, WebhookPayloadErrorCode, WebhookValidationError$1 as WebhookValidationError, WebhookValidationErrorCode, WebhookVerificationError$1 as WebhookVerificationError, WebhookVerificationErrorCode, confirmedHeaders$1 as confirmedHeaders, decodeRawEmail$1 as decodeRawEmail, emailReceivedEventJsonSchema$1 as emailReceivedEventJsonSchema, getDownloadTimeRemaining$1 as getDownloadTimeRemaining, handleWebhook$1 as handleWebhook, isDownloadExpired$1 as isDownloadExpired, isEmailReceivedEvent$1 as isEmailReceivedEvent, isRawIncluded$1 as isRawIncluded, parseWebhookEvent$1 as parseWebhookEvent, safeValidateEmailReceivedEvent$1 as safeValidateEmailReceivedEvent, signWebhookPayload$1 as signWebhookPayload, validateEmailAuth$1 as validateEmailAuth, validateEmailReceivedEvent$1 as validateEmailReceivedEvent, verifyRawEmailDownload$1 as verifyRawEmailDownload, verifyWebhookSignature$1 as verifyWebhookSignature } from "../index-
|
|
3
|
-
export { AuthConfidence, AuthVerdict, DecodeRawEmailOptions, DkimResult, DkimSignature, DmarcPolicy, DmarcResult, EmailAddress, EmailAnalysis, EmailAuth, EmailReceivedEvent, EventType, ForwardAnalysis, ForwardOriginalSender, ForwardResult, ForwardResultAttachmentAnalyzed, ForwardResultAttachmentSkipped, ForwardResultInline, ForwardVerdict, ForwardVerification, HandleWebhookOptions, KnownWebhookEvent, PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedData, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedStatus, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawContent, RawContentDownloadOnly, RawContentInline, RawEmailDecodeError, RawEmailDecodeErrorCode, SignResult, 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, safeValidateEmailReceivedEvent, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyRawEmailDownload, verifyWebhookSignature };
|
|
2
|
+
import { DecodeRawEmailOptions, HandleWebhookOptions, LEGACY_CONFIRMED_HEADER$1 as LEGACY_CONFIRMED_HEADER, LEGACY_SIGNATURE_HEADER$1 as LEGACY_SIGNATURE_HEADER, PAYLOAD_ERRORS$1 as PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER$1 as PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER$1 as PRIMITIVE_SIGNATURE_HEADER, PrimitiveWebhookError$1 as PrimitiveWebhookError, RAW_EMAIL_ERRORS$1 as RAW_EMAIL_ERRORS, RawEmailDecodeError$1 as RawEmailDecodeError, RawEmailDecodeErrorCode, SignResult, VERIFICATION_ERRORS$1 as VERIFICATION_ERRORS, VerifyOptions, WEBHOOK_VERSION$1 as WEBHOOK_VERSION, WebhookErrorCode, WebhookHeaders, WebhookPayloadError$1 as WebhookPayloadError, WebhookPayloadErrorCode, WebhookValidationError$1 as WebhookValidationError, WebhookValidationErrorCode, WebhookVerificationError$1 as WebhookVerificationError, WebhookVerificationErrorCode, confirmedHeaders$1 as confirmedHeaders, decodeRawEmail$1 as decodeRawEmail, emailReceivedEventJsonSchema$1 as emailReceivedEventJsonSchema, getDownloadTimeRemaining$1 as getDownloadTimeRemaining, handleWebhook$1 as handleWebhook, isDownloadExpired$1 as isDownloadExpired, isEmailReceivedEvent$1 as isEmailReceivedEvent, isRawIncluded$1 as isRawIncluded, parseWebhookEvent$1 as parseWebhookEvent, safeValidateEmailReceivedEvent$1 as safeValidateEmailReceivedEvent, signWebhookPayload$1 as signWebhookPayload, validateEmailAuth$1 as validateEmailAuth, validateEmailReceivedEvent$1 as validateEmailReceivedEvent, verifyRawEmailDownload$1 as verifyRawEmailDownload, verifyWebhookSignature$1 as verifyWebhookSignature } from "../index-pNcbeqPI.js";
|
|
3
|
+
export { AuthConfidence, AuthVerdict, DecodeRawEmailOptions, DkimResult, DkimSignature, DmarcPolicy, DmarcResult, EmailAddress, EmailAnalysis, EmailAuth, EmailReceivedEvent, EventType, ForwardAnalysis, ForwardOriginalSender, ForwardResult, ForwardResultAttachmentAnalyzed, ForwardResultAttachmentSkipped, ForwardResultInline, ForwardVerdict, ForwardVerification, HandleWebhookOptions, KnownWebhookEvent, LEGACY_CONFIRMED_HEADER, LEGACY_SIGNATURE_HEADER, PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedData, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedStatus, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawContent, RawContentDownloadOnly, RawContentInline, RawEmailDecodeError, RawEmailDecodeErrorCode, SignResult, 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, safeValidateEmailReceivedEvent, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyRawEmailDownload, verifyWebhookSignature };
|
package/dist/webhook/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AuthConfidence, AuthVerdict, DkimResult, DmarcPolicy, DmarcResult, EventType, ForwardVerdict, PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedStatus, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawEmailDecodeError, SpfResult, VERIFICATION_ERRORS, WEBHOOK_VERSION, WebhookPayloadError, WebhookValidationError, WebhookVerificationError, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, getDownloadTimeRemaining, handleWebhook, isDownloadExpired, isEmailReceivedEvent, isRawIncluded, parseWebhookEvent, safeValidateEmailReceivedEvent, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyRawEmailDownload, verifyWebhookSignature } from "../webhook-
|
|
1
|
+
import { AuthConfidence, AuthVerdict, DkimResult, DmarcPolicy, DmarcResult, EventType, ForwardVerdict, LEGACY_CONFIRMED_HEADER, LEGACY_SIGNATURE_HEADER, PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedStatus, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawEmailDecodeError, SpfResult, VERIFICATION_ERRORS, WEBHOOK_VERSION, WebhookPayloadError, WebhookValidationError, WebhookVerificationError, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, getDownloadTimeRemaining, handleWebhook, isDownloadExpired, isEmailReceivedEvent, isRawIncluded, parseWebhookEvent, safeValidateEmailReceivedEvent, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyRawEmailDownload, verifyWebhookSignature } from "../webhook-CqFsX50W.js";
|
|
2
2
|
|
|
3
|
-
export { AuthConfidence, AuthVerdict, DkimResult, DmarcPolicy, DmarcResult, EventType, ForwardVerdict, PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedStatus, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawEmailDecodeError, SpfResult, VERIFICATION_ERRORS, WEBHOOK_VERSION, WebhookPayloadError, WebhookValidationError, WebhookVerificationError, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, getDownloadTimeRemaining, handleWebhook, isDownloadExpired, isEmailReceivedEvent, isRawIncluded, parseWebhookEvent, safeValidateEmailReceivedEvent, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyRawEmailDownload, verifyWebhookSignature };
|
|
3
|
+
export { AuthConfidence, AuthVerdict, DkimResult, DmarcPolicy, DmarcResult, EventType, ForwardVerdict, LEGACY_CONFIRMED_HEADER, LEGACY_SIGNATURE_HEADER, PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedStatus, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawEmailDecodeError, SpfResult, VERIFICATION_ERRORS, WEBHOOK_VERSION, WebhookPayloadError, WebhookValidationError, WebhookVerificationError, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, getDownloadTimeRemaining, handleWebhook, isDownloadExpired, isEmailReceivedEvent, isRawIncluded, parseWebhookEvent, safeValidateEmailReceivedEvent, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyRawEmailDownload, verifyWebhookSignature };
|
|
@@ -6024,8 +6024,12 @@ function hashSecret(secret) {
|
|
|
6024
6024
|
}
|
|
6025
6025
|
/** Header name for incoming webhook signature */
|
|
6026
6026
|
const PRIMITIVE_SIGNATURE_HEADER = "Primitive-Signature";
|
|
6027
|
+
/** Legacy header name kept for backward compatibility with older servers */
|
|
6028
|
+
const LEGACY_SIGNATURE_HEADER = "MyMX-Signature";
|
|
6027
6029
|
/** Header name to confirm webhook was processed (prevents retries) */
|
|
6028
6030
|
const PRIMITIVE_CONFIRMED_HEADER = "X-Primitive-Confirmed";
|
|
6031
|
+
/** Legacy confirmed header name kept for backward compatibility */
|
|
6032
|
+
const LEGACY_CONFIRMED_HEADER = "X-MyMX-Confirmed";
|
|
6029
6033
|
/** Default max age for webhook requests (5 minutes) */
|
|
6030
6034
|
const DEFAULT_TOLERANCE_SECONDS = 5 * 60;
|
|
6031
6035
|
/** Future clock skew tolerance (1 minute) */
|
|
@@ -7424,17 +7428,30 @@ function isEmailReceivedEvent(event) {
|
|
|
7424
7428
|
return false;
|
|
7425
7429
|
}
|
|
7426
7430
|
}
|
|
7431
|
+
const SIGNATURE_HEADER_NAMES = ["primitive-signature", "mymx-signature"];
|
|
7427
7432
|
/**
|
|
7428
7433
|
* Extract signature header from various header formats.
|
|
7434
|
+
* Checks for Primitive-Signature first, then falls back to the legacy
|
|
7435
|
+
* MyMX-Signature for backward compatibility with older servers.
|
|
7429
7436
|
*/
|
|
7430
7437
|
function getSignatureHeader(headers) {
|
|
7431
|
-
if (headers instanceof Headers)
|
|
7438
|
+
if (headers instanceof Headers) {
|
|
7439
|
+
for (const name of SIGNATURE_HEADER_NAMES) {
|
|
7440
|
+
const value = headers.get(name);
|
|
7441
|
+
if (value) return value;
|
|
7442
|
+
}
|
|
7443
|
+
return "";
|
|
7444
|
+
}
|
|
7432
7445
|
const obj = headers;
|
|
7433
|
-
const
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7446
|
+
const keys = Object.keys(obj);
|
|
7447
|
+
for (const name of SIGNATURE_HEADER_NAMES) {
|
|
7448
|
+
const key = keys.find((k) => k.toLowerCase() === name);
|
|
7449
|
+
if (!key) continue;
|
|
7450
|
+
const value = obj[key];
|
|
7451
|
+
if (Array.isArray(value)) return value[0] ?? "";
|
|
7452
|
+
if (value) return value;
|
|
7453
|
+
}
|
|
7454
|
+
return "";
|
|
7438
7455
|
}
|
|
7439
7456
|
/**
|
|
7440
7457
|
* Verify, parse, and validate a webhook in one call.
|
|
@@ -7521,7 +7538,10 @@ function handleWebhook(options) {
|
|
|
7521
7538
|
* ```
|
|
7522
7539
|
*/
|
|
7523
7540
|
function confirmedHeaders() {
|
|
7524
|
-
return {
|
|
7541
|
+
return {
|
|
7542
|
+
[PRIMITIVE_CONFIRMED_HEADER]: "true",
|
|
7543
|
+
[LEGACY_CONFIRMED_HEADER]: "true"
|
|
7544
|
+
};
|
|
7525
7545
|
}
|
|
7526
7546
|
/**
|
|
7527
7547
|
* Check if the download URL for a webhook event has expired.
|
|
@@ -7658,4 +7678,4 @@ function verifyRawEmailDownload(downloaded, event) {
|
|
|
7658
7678
|
}
|
|
7659
7679
|
|
|
7660
7680
|
//#endregion
|
|
7661
|
-
export { AuthConfidence, AuthVerdict, DkimResult, DmarcPolicy, DmarcResult, EventType, ForwardVerdict, PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedStatus, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawEmailDecodeError, SpfResult, VERIFICATION_ERRORS, WEBHOOK_VERSION, WebhookPayloadError, WebhookValidationError, WebhookVerificationError, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, getDownloadTimeRemaining, handleWebhook, isDownloadExpired, isEmailReceivedEvent, isRawIncluded, parseWebhookEvent, safeValidateEmailReceivedEvent, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyRawEmailDownload, verifyWebhookSignature };
|
|
7681
|
+
export { AuthConfidence, AuthVerdict, DkimResult, DmarcPolicy, DmarcResult, EventType, ForwardVerdict, LEGACY_CONFIRMED_HEADER, LEGACY_SIGNATURE_HEADER, PAYLOAD_ERRORS, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedStatus, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawEmailDecodeError, SpfResult, VERIFICATION_ERRORS, WEBHOOK_VERSION, WebhookPayloadError, WebhookValidationError, WebhookVerificationError, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, getDownloadTimeRemaining, handleWebhook, isDownloadExpired, isEmailReceivedEvent, isRawIncluded, parseWebhookEvent, safeValidateEmailReceivedEvent, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyRawEmailDownload, verifyWebhookSignature };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primitivedotdev/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Official Primitive Node.js SDK — webhook, contract, and parser modules",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -62,17 +62,19 @@
|
|
|
62
62
|
},
|
|
63
63
|
"homepage": "https://primitive.dev",
|
|
64
64
|
"engines": {
|
|
65
|
-
"node": ">=
|
|
65
|
+
"node": ">=22"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"ajv": "^8.17.1",
|
|
69
69
|
"ajv-formats": "^3.0.1",
|
|
70
70
|
"archiver": "^7.0.1",
|
|
71
|
+
"isomorphic-dompurify": "^3.8.0",
|
|
71
72
|
"mailparser": "^3.9.0"
|
|
72
73
|
},
|
|
73
74
|
"devDependencies": {
|
|
74
75
|
"@biomejs/biome": "^2.4.10",
|
|
75
76
|
"@types/archiver": "^7.0.0",
|
|
77
|
+
"@types/dompurify": "^3.2.0",
|
|
76
78
|
"@types/json-schema": "^7.0.15",
|
|
77
79
|
"@types/mailparser": "^3.4.6",
|
|
78
80
|
"@types/node": "^22.10.2",
|