@primitivedotdev/sdk 0.24.0 → 0.25.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.
@@ -0,0 +1,287 @@
1
+ import { n as parseFromHeaderLoose } from "./address-parser-BYn8oW5r.js";
2
+ //#region src/webhook/received-email.ts
3
+ const REPLY_PREFIX_RE = /^re\s*:/i;
4
+ const FORWARD_PREFIX_RE = /^(fwd?|fw)\s*:/i;
5
+ function normalizeReceivedEmail(event) {
6
+ const receivedBy = event.email.smtp.rcpt_to[0];
7
+ if (!receivedBy) throw new Error("email.smtp.rcpt_to must contain at least one recipient");
8
+ const sender = parseHeaderAddress(event.email.headers.from) ?? {
9
+ address: event.email.smtp.mail_from.trim().toLowerCase(),
10
+ name: null
11
+ };
12
+ const replyTarget = firstStructuredAddress(event.email.parsed.reply_to) ?? sender;
13
+ const subject = event.email.headers.subject ?? null;
14
+ const references = event.email.parsed.references ?? [];
15
+ const messageId = event.email.headers.message_id ?? null;
16
+ return {
17
+ id: event.email.id,
18
+ eventId: event.id,
19
+ receivedAt: event.email.received_at,
20
+ sender,
21
+ replyTarget,
22
+ receivedBy,
23
+ receivedByAll: [...event.email.smtp.rcpt_to],
24
+ subject,
25
+ replySubject: buildReplySubject(subject),
26
+ forwardSubject: buildForwardSubject(subject),
27
+ text: event.email.parsed.body_text ?? null,
28
+ thread: {
29
+ messageId,
30
+ inReplyTo: event.email.parsed.in_reply_to ?? [],
31
+ references
32
+ },
33
+ attachments: event.email.parsed.attachments ?? [],
34
+ auth: event.email.auth,
35
+ analysis: event.email.analysis,
36
+ raw: event
37
+ };
38
+ }
39
+ function buildReplySubject(subject) {
40
+ const trimmed = subject?.trim() ?? "";
41
+ if (trimmed.length === 0) return "Re:";
42
+ return REPLY_PREFIX_RE.test(trimmed) ? trimmed : `Re: ${trimmed}`;
43
+ }
44
+ function buildForwardSubject(subject) {
45
+ const trimmed = subject?.trim() ?? "";
46
+ if (trimmed.length === 0) return "Fwd:";
47
+ return FORWARD_PREFIX_RE.test(trimmed) ? trimmed : `Fwd: ${trimmed}`;
48
+ }
49
+ function formatAddress(address) {
50
+ return address.name ? `${address.name} <${address.address}>` : address.address;
51
+ }
52
+ function firstStructuredAddress(addresses) {
53
+ const address = addresses?.[0];
54
+ if (!address) return null;
55
+ return {
56
+ address: address.address.trim().toLowerCase(),
57
+ name: address.name ?? null
58
+ };
59
+ }
60
+ function parseHeaderAddress(value) {
61
+ const parsed = parseFromHeaderLoose(value);
62
+ if (!parsed) return null;
63
+ return {
64
+ address: parsed.address,
65
+ name: parsed.name?.trim() || null
66
+ };
67
+ }
68
+ //#endregion
69
+ //#region src/webhook/errors.ts
70
+ /**
71
+ * Verification error definitions.
72
+ * Use these for documentation, dashboards, and i18n.
73
+ */
74
+ const VERIFICATION_ERRORS = {
75
+ INVALID_SIGNATURE_HEADER: {
76
+ message: "Missing or malformed Primitive-Signature header",
77
+ suggestion: "Check that you're reading the correct header (Primitive-Signature) and it's being passed correctly from your web framework."
78
+ },
79
+ TIMESTAMP_OUT_OF_RANGE: {
80
+ message: "Timestamp is too old (possible replay attack)",
81
+ suggestion: "This could indicate a replay attack, network delay, or server clock drift. Check your server's time is synced."
82
+ },
83
+ SIGNATURE_MISMATCH: {
84
+ message: "Signature doesn't match expected value",
85
+ suggestion: "Verify the webhook secret matches and you're using the raw request body (not re-serialized JSON)."
86
+ },
87
+ MISSING_SECRET: {
88
+ message: "No webhook secret was provided",
89
+ suggestion: "Pass your webhook secret from the Primitive dashboard. Check that the environment variable is set."
90
+ }
91
+ };
92
+ /**
93
+ * Payload parsing error definitions.
94
+ * Use these for documentation, dashboards, and i18n.
95
+ */
96
+ const PAYLOAD_ERRORS = {
97
+ PAYLOAD_NULL: {
98
+ message: "Webhook payload is null",
99
+ suggestion: "Ensure you're passing the parsed JSON body, not null. Check your framework's body parsing middleware."
100
+ },
101
+ PAYLOAD_UNDEFINED: {
102
+ message: "Webhook payload is undefined",
103
+ suggestion: "The payload was not provided. Make sure you're passing the request body to the handler."
104
+ },
105
+ PAYLOAD_WRONG_TYPE: {
106
+ message: "Webhook payload must be an object",
107
+ suggestion: "The payload should be a parsed JSON object. Check that you're not passing a string or other primitive."
108
+ },
109
+ PAYLOAD_IS_ARRAY: {
110
+ message: "Webhook payload is an array, expected object",
111
+ suggestion: "Primitive webhooks are single event objects, not arrays. Check the payload structure."
112
+ },
113
+ PAYLOAD_MISSING_EVENT: {
114
+ message: "Webhook payload missing 'event' field",
115
+ suggestion: "All webhook payloads must have an 'event' field. This may not be a valid Primitive webhook."
116
+ },
117
+ PAYLOAD_UNKNOWN_EVENT: {
118
+ message: "Unknown webhook event type",
119
+ suggestion: "This event type is not recognized. You may need to update your SDK or handle unknown events gracefully."
120
+ },
121
+ PAYLOAD_EMPTY_BODY: {
122
+ message: "Request body is empty",
123
+ suggestion: "The request body was empty. Ensure the webhook is sending data and your framework is parsing it correctly."
124
+ },
125
+ JSON_PARSE_FAILED: {
126
+ message: "Failed to parse JSON body",
127
+ suggestion: "The request body is not valid JSON. Check the raw body content and Content-Type header."
128
+ },
129
+ INVALID_ENCODING: {
130
+ message: "Invalid body encoding",
131
+ suggestion: "The request body encoding is not supported. Primitive webhooks use UTF-8 encoded JSON."
132
+ }
133
+ };
134
+ /**
135
+ * Raw email decode error definitions.
136
+ * Use these for documentation, dashboards, and i18n.
137
+ */
138
+ const RAW_EMAIL_ERRORS = {
139
+ NOT_INCLUDED: {
140
+ message: "Raw email content not included inline",
141
+ suggestion: "Use the download URL at event.email.content.download.url to fetch the raw email."
142
+ },
143
+ INVALID_BASE64: {
144
+ message: "Raw email content is not valid base64",
145
+ suggestion: "The raw email data is malformed. Fetch the raw email from the download URL or regenerate the webhook payload."
146
+ },
147
+ HASH_MISMATCH: {
148
+ message: "SHA-256 hash verification failed",
149
+ suggestion: "The raw email data may be corrupted. Try downloading from the URL instead."
150
+ }
151
+ };
152
+ /**
153
+ * Base class for all Primitive webhook errors.
154
+ *
155
+ * Catch this to handle any error from the SDK in a single catch block.
156
+ *
157
+ * @example
158
+ * ```typescript
159
+ * import { handleWebhook, PrimitiveWebhookError } from '@primitivedotdev/sdk';
160
+ *
161
+ * try {
162
+ * const event = handleWebhook({ body, headers, secret });
163
+ * } catch (err) {
164
+ * if (err instanceof PrimitiveWebhookError) {
165
+ * console.error(`[${err.code}] ${err.message}`);
166
+ * return res.status(400).json({ error: err.code });
167
+ * }
168
+ * throw err;
169
+ * }
170
+ * ```
171
+ */
172
+ var PrimitiveWebhookError = class extends Error {
173
+ /**
174
+ * Formats the error for logging/display.
175
+ */
176
+ toString() {
177
+ return `${this.name} [${this.code}]: ${this.message}\n\nSuggestion: ${this.suggestion}`;
178
+ }
179
+ /**
180
+ * Serializes cleanly for structured logging (Datadog, CloudWatch, etc.)
181
+ */
182
+ toJSON() {
183
+ return {
184
+ name: this.name,
185
+ code: this.code,
186
+ message: this.message,
187
+ suggestion: this.suggestion
188
+ };
189
+ }
190
+ };
191
+ /**
192
+ * Error thrown when webhook signature verification fails.
193
+ *
194
+ * Use the `code` property to programmatically handle specific error cases.
195
+ */
196
+ var WebhookVerificationError = class extends PrimitiveWebhookError {
197
+ code;
198
+ suggestion;
199
+ constructor(code, message, suggestion) {
200
+ super(message ?? VERIFICATION_ERRORS[code].message);
201
+ this.name = "WebhookVerificationError";
202
+ this.code = code;
203
+ this.suggestion = suggestion ?? VERIFICATION_ERRORS[code].suggestion;
204
+ }
205
+ };
206
+ /**
207
+ * Error thrown when webhook payload parsing fails (lightweight parser).
208
+ *
209
+ * Use the `code` property for programmatic handling and monitoring.
210
+ * The `suggestion` property contains actionable guidance for fixing the issue.
211
+ */
212
+ var WebhookPayloadError = class extends PrimitiveWebhookError {
213
+ code;
214
+ suggestion;
215
+ /** Original error if this wraps another error (e.g., JSON.parse failure) */
216
+ cause;
217
+ constructor(code, message, suggestion, cause) {
218
+ super(message ?? PAYLOAD_ERRORS[code].message);
219
+ this.name = "WebhookPayloadError";
220
+ this.code = code;
221
+ this.suggestion = suggestion ?? PAYLOAD_ERRORS[code].suggestion;
222
+ this.cause = cause;
223
+ }
224
+ };
225
+ /**
226
+ * Error thrown when schema validation fails.
227
+ */
228
+ var WebhookValidationError = class extends PrimitiveWebhookError {
229
+ code = "SCHEMA_VALIDATION_FAILED";
230
+ suggestion;
231
+ /** The specific field path that failed (e.g., "email.headers.from") */
232
+ field;
233
+ /** Original schema validation errors for advanced debugging */
234
+ validationErrors;
235
+ /** Number of additional validation errors beyond the first */
236
+ additionalErrorCount;
237
+ constructor(field, message, suggestion, validationErrors) {
238
+ super(message);
239
+ this.name = "WebhookValidationError";
240
+ this.field = field;
241
+ this.suggestion = suggestion;
242
+ this.validationErrors = validationErrors;
243
+ this.additionalErrorCount = Math.max(0, validationErrors.length - 1);
244
+ }
245
+ /**
246
+ * Formats the error for logging/display.
247
+ * Includes error count and suggestion.
248
+ */
249
+ toString() {
250
+ let output = `${this.name} [${this.code}]: ${this.message}`;
251
+ if (this.additionalErrorCount > 0) output += ` (and ${this.additionalErrorCount} more validation error${this.additionalErrorCount > 1 ? "s" : ""})`;
252
+ output += `\n\nSuggestion: ${this.suggestion}`;
253
+ return output;
254
+ }
255
+ /**
256
+ * Serializes cleanly for structured logging (Datadog, CloudWatch, etc.)
257
+ */
258
+ toJSON() {
259
+ return {
260
+ name: this.name,
261
+ code: this.code,
262
+ field: this.field,
263
+ message: this.message,
264
+ suggestion: this.suggestion,
265
+ additionalErrorCount: this.additionalErrorCount
266
+ };
267
+ }
268
+ };
269
+ /**
270
+ * Error thrown when raw email decoding or verification fails.
271
+ *
272
+ * Use the `code` property to determine the failure reason:
273
+ * - `NOT_INCLUDED`: Raw email not inline, must download from URL
274
+ * - `HASH_MISMATCH`: SHA-256 verification failed, content may be corrupted
275
+ */
276
+ var RawEmailDecodeError = class extends PrimitiveWebhookError {
277
+ code;
278
+ suggestion;
279
+ constructor(code, message) {
280
+ super(message ?? RAW_EMAIL_ERRORS[code].message);
281
+ this.name = "RawEmailDecodeError";
282
+ this.code = code;
283
+ this.suggestion = RAW_EMAIL_ERRORS[code].suggestion;
284
+ }
285
+ };
286
+ //#endregion
287
+ export { VERIFICATION_ERRORS as a, WebhookVerificationError as c, formatAddress as d, normalizeReceivedEmail as f, RawEmailDecodeError as i, buildForwardSubject as l, PrimitiveWebhookError as n, WebhookPayloadError as o, parseHeaderAddress as p, RAW_EMAIL_ERRORS as r, WebhookValidationError as s, PAYLOAD_ERRORS as t, buildReplySubject as u };
@@ -1,214 +1,6 @@
1
1
  import { N as WebhookEvent, j as ValidateEmailAuthResult, l as EmailAuth, u as EmailReceivedEvent } from "./types-9vXGZjPd.js";
2
- import { t as ReceivedEmail } from "./received-email-DNjpq_Wt.js";
3
- import { ErrorObject } from "ajv";
2
+ import { m as ReceivedEmail, u as WebhookValidationError } from "./errors-C53fe686.js";
4
3
 
5
- //#region src/webhook/errors.d.ts
6
- /**
7
- * Verification error definitions.
8
- * Use these for documentation, dashboards, and i18n.
9
- */
10
- declare const VERIFICATION_ERRORS: {
11
- readonly INVALID_SIGNATURE_HEADER: {
12
- readonly message: "Missing or malformed Primitive-Signature header";
13
- readonly suggestion: "Check that you're reading the correct header (Primitive-Signature) and it's being passed correctly from your web framework.";
14
- };
15
- readonly TIMESTAMP_OUT_OF_RANGE: {
16
- readonly message: "Timestamp is too old (possible replay attack)";
17
- readonly suggestion: "This could indicate a replay attack, network delay, or server clock drift. Check your server's time is synced.";
18
- };
19
- readonly SIGNATURE_MISMATCH: {
20
- readonly message: "Signature doesn't match expected value";
21
- readonly suggestion: "Verify the webhook secret matches and you're using the raw request body (not re-serialized JSON).";
22
- };
23
- readonly MISSING_SECRET: {
24
- readonly message: "No webhook secret was provided";
25
- readonly suggestion: "Pass your webhook secret from the Primitive dashboard. Check that the environment variable is set.";
26
- };
27
- };
28
- /**
29
- * Payload parsing error definitions.
30
- * Use these for documentation, dashboards, and i18n.
31
- */
32
- declare const PAYLOAD_ERRORS: {
33
- readonly PAYLOAD_NULL: {
34
- readonly message: "Webhook payload is null";
35
- readonly suggestion: "Ensure you're passing the parsed JSON body, not null. Check your framework's body parsing middleware.";
36
- };
37
- readonly PAYLOAD_UNDEFINED: {
38
- readonly message: "Webhook payload is undefined";
39
- readonly suggestion: "The payload was not provided. Make sure you're passing the request body to the handler.";
40
- };
41
- readonly PAYLOAD_WRONG_TYPE: {
42
- readonly message: "Webhook payload must be an object";
43
- readonly suggestion: "The payload should be a parsed JSON object. Check that you're not passing a string or other primitive.";
44
- };
45
- readonly PAYLOAD_IS_ARRAY: {
46
- readonly message: "Webhook payload is an array, expected object";
47
- readonly suggestion: "Primitive webhooks are single event objects, not arrays. Check the payload structure.";
48
- };
49
- readonly PAYLOAD_MISSING_EVENT: {
50
- readonly message: "Webhook payload missing 'event' field";
51
- readonly suggestion: "All webhook payloads must have an 'event' field. This may not be a valid Primitive webhook.";
52
- };
53
- readonly PAYLOAD_UNKNOWN_EVENT: {
54
- readonly message: "Unknown webhook event type";
55
- readonly suggestion: "This event type is not recognized. You may need to update your SDK or handle unknown events gracefully.";
56
- };
57
- readonly PAYLOAD_EMPTY_BODY: {
58
- readonly message: "Request body is empty";
59
- readonly suggestion: "The request body was empty. Ensure the webhook is sending data and your framework is parsing it correctly.";
60
- };
61
- readonly JSON_PARSE_FAILED: {
62
- readonly message: "Failed to parse JSON body";
63
- readonly suggestion: "The request body is not valid JSON. Check the raw body content and Content-Type header.";
64
- };
65
- readonly INVALID_ENCODING: {
66
- readonly message: "Invalid body encoding";
67
- readonly suggestion: "The request body encoding is not supported. Primitive webhooks use UTF-8 encoded JSON.";
68
- };
69
- };
70
- /**
71
- * Raw email decode error definitions.
72
- * Use these for documentation, dashboards, and i18n.
73
- */
74
- declare const RAW_EMAIL_ERRORS: {
75
- readonly NOT_INCLUDED: {
76
- readonly message: "Raw email content not included inline";
77
- readonly suggestion: "Use the download URL at event.email.content.download.url to fetch the raw email.";
78
- };
79
- readonly INVALID_BASE64: {
80
- readonly message: "Raw email content is not valid base64";
81
- readonly suggestion: "The raw email data is malformed. Fetch the raw email from the download URL or regenerate the webhook payload.";
82
- };
83
- readonly HASH_MISMATCH: {
84
- readonly message: "SHA-256 hash verification failed";
85
- readonly suggestion: "The raw email data may be corrupted. Try downloading from the URL instead.";
86
- };
87
- };
88
- /**
89
- * All error codes that can be thrown by the SDK.
90
- */
91
- type WebhookErrorCode = WebhookVerificationErrorCode | WebhookPayloadErrorCode | WebhookValidationErrorCode | RawEmailDecodeErrorCode;
92
- type RawEmailDecodeErrorCode = keyof typeof RAW_EMAIL_ERRORS;
93
- /**
94
- * Base class for all Primitive webhook errors.
95
- *
96
- * Catch this to handle any error from the SDK in a single catch block.
97
- *
98
- * @example
99
- * ```typescript
100
- * import { handleWebhook, PrimitiveWebhookError } from '@primitivedotdev/sdk';
101
- *
102
- * try {
103
- * const event = handleWebhook({ body, headers, secret });
104
- * } catch (err) {
105
- * if (err instanceof PrimitiveWebhookError) {
106
- * console.error(`[${err.code}] ${err.message}`);
107
- * return res.status(400).json({ error: err.code });
108
- * }
109
- * throw err;
110
- * }
111
- * ```
112
- */
113
- declare abstract class PrimitiveWebhookError extends Error {
114
- /** Programmatic error code for monitoring and handling */
115
- abstract readonly code: WebhookErrorCode;
116
- /** Actionable guidance for fixing the issue */
117
- abstract readonly suggestion: string;
118
- /**
119
- * Formats the error for logging/display.
120
- */
121
- toString(): string;
122
- /**
123
- * Serializes cleanly for structured logging (Datadog, CloudWatch, etc.)
124
- */
125
- toJSON(): {
126
- name: string;
127
- code: WebhookErrorCode;
128
- message: string;
129
- suggestion: string;
130
- };
131
- }
132
- /**
133
- * Error codes for webhook verification failures.
134
- * Derived from VERIFICATION_ERRORS keys.
135
- */
136
- type WebhookVerificationErrorCode = keyof typeof VERIFICATION_ERRORS;
137
- /**
138
- * Error thrown when webhook signature verification fails.
139
- *
140
- * Use the `code` property to programmatically handle specific error cases.
141
- */
142
- declare class WebhookVerificationError extends PrimitiveWebhookError {
143
- readonly code: WebhookVerificationErrorCode;
144
- readonly suggestion: string;
145
- constructor(code: WebhookVerificationErrorCode, message?: string, suggestion?: string);
146
- }
147
- /**
148
- * Error codes for webhook payload parsing failures.
149
- * Derived from PAYLOAD_ERRORS keys.
150
- */
151
- type WebhookPayloadErrorCode = keyof typeof PAYLOAD_ERRORS;
152
- /**
153
- * Error thrown when webhook payload parsing fails (lightweight parser).
154
- *
155
- * Use the `code` property for programmatic handling and monitoring.
156
- * The `suggestion` property contains actionable guidance for fixing the issue.
157
- */
158
- declare class WebhookPayloadError extends PrimitiveWebhookError {
159
- readonly code: WebhookPayloadErrorCode;
160
- readonly suggestion: string;
161
- /** Original error if this wraps another error (e.g., JSON.parse failure) */
162
- readonly cause?: Error;
163
- constructor(code: WebhookPayloadErrorCode, message?: string, suggestion?: string, cause?: Error);
164
- }
165
- /**
166
- * Error code for schema validation failures.
167
- */
168
- type WebhookValidationErrorCode = "SCHEMA_VALIDATION_FAILED";
169
- /**
170
- * Error thrown when schema validation fails.
171
- */
172
- declare class WebhookValidationError extends PrimitiveWebhookError {
173
- readonly code: WebhookValidationErrorCode;
174
- readonly suggestion: string;
175
- /** The specific field path that failed (e.g., "email.headers.from") */
176
- readonly field: string;
177
- /** Original schema validation errors for advanced debugging */
178
- readonly validationErrors: readonly ErrorObject[];
179
- /** Number of additional validation errors beyond the first */
180
- readonly additionalErrorCount: number;
181
- constructor(field: string, message: string, suggestion: string, validationErrors: readonly ErrorObject[]);
182
- /**
183
- * Formats the error for logging/display.
184
- * Includes error count and suggestion.
185
- */
186
- toString(): string;
187
- /**
188
- * Serializes cleanly for structured logging (Datadog, CloudWatch, etc.)
189
- */
190
- toJSON(): {
191
- name: string;
192
- code: "SCHEMA_VALIDATION_FAILED";
193
- field: string;
194
- message: string;
195
- suggestion: string;
196
- additionalErrorCount: number;
197
- };
198
- }
199
- /**
200
- * Error thrown when raw email decoding or verification fails.
201
- *
202
- * Use the `code` property to determine the failure reason:
203
- * - `NOT_INCLUDED`: Raw email not inline, must download from URL
204
- * - `HASH_MISMATCH`: SHA-256 verification failed, content may be corrupted
205
- */
206
- declare class RawEmailDecodeError extends PrimitiveWebhookError {
207
- readonly code: RawEmailDecodeErrorCode;
208
- readonly suggestion: string;
209
- constructor(code: RawEmailDecodeErrorCode, message?: string);
210
- }
211
- //#endregion
212
4
  //#region src/validation.d.ts
213
5
  interface ValidationSuccess<T> {
214
6
  success: true;
@@ -1624,4 +1416,4 @@ declare function decodeRawEmail(event: EmailReceivedEvent, options?: DecodeRawEm
1624
1416
  */
1625
1417
  declare function verifyRawEmailDownload(downloaded: Buffer | ArrayBuffer | Uint8Array, event: EmailReceivedEvent): Buffer;
1626
1418
  //#endregion
1627
- export { VerifyOptions as A, PAYLOAD_ERRORS as B, signStandardWebhooksPayload as C, PRIMITIVE_CONFIRMED_HEADER as D, LEGACY_SIGNATURE_HEADER as E, VerifyDownloadTokenResult as F, VERIFICATION_ERRORS as G, RAW_EMAIL_ERRORS as H, generateDownloadToken as I, WebhookPayloadErrorCode as J, WebhookErrorCode as K, verifyDownloadToken as L, verifyWebhookSignature as M, GenerateDownloadTokenOptions as N, PRIMITIVE_SIGNATURE_HEADER as O, VerifyDownloadTokenOptions as P, WebhookVerificationErrorCode as Q, safeValidateEmailReceivedEvent as R, StandardWebhooksVerifyOptions as S, LEGACY_CONFIRMED_HEADER as T, RawEmailDecodeError as U, PrimitiveWebhookError as V, RawEmailDecodeErrorCode as W, WebhookValidationErrorCode as X, WebhookValidationError as Y, WebhookVerificationError as Z, emailReceivedEventJsonSchema as _, confirmedHeaders as a, STANDARD_WEBHOOK_TIMESTAMP_HEADER as b, handleWebhook as c, isRawIncluded as d, parseWebhookEvent as f, validateEmailAuth as g, WEBHOOK_VERSION as h, WebhookHeaders as i, signWebhookPayload as j, SignResult as k, isDownloadExpired as l, verifyRawEmailDownload as m, HandleWebhookOptions as n, decodeRawEmail as o, receive as p, WebhookPayloadError as q, ReceiveRequestOptions as r, getDownloadTimeRemaining as s, DecodeRawEmailOptions as t, isEmailReceivedEvent as u, STANDARD_WEBHOOK_ID_HEADER as v, verifyStandardWebhooksSignature as w, StandardWebhooksSignResult as x, STANDARD_WEBHOOK_SIGNATURE_HEADER as y, validateEmailReceivedEvent as z };
1419
+ export { VerifyOptions as A, signStandardWebhooksPayload as C, PRIMITIVE_CONFIRMED_HEADER as D, LEGACY_SIGNATURE_HEADER as E, VerifyDownloadTokenResult as F, generateDownloadToken as I, verifyDownloadToken as L, verifyWebhookSignature as M, GenerateDownloadTokenOptions as N, PRIMITIVE_SIGNATURE_HEADER as O, VerifyDownloadTokenOptions as P, safeValidateEmailReceivedEvent as R, StandardWebhooksVerifyOptions as S, LEGACY_CONFIRMED_HEADER as T, emailReceivedEventJsonSchema as _, confirmedHeaders as a, STANDARD_WEBHOOK_TIMESTAMP_HEADER as b, handleWebhook as c, isRawIncluded as d, parseWebhookEvent as f, validateEmailAuth as g, WEBHOOK_VERSION as h, WebhookHeaders as i, signWebhookPayload as j, SignResult as k, isDownloadExpired as l, verifyRawEmailDownload as m, HandleWebhookOptions as n, decodeRawEmail as o, receive as p, ReceiveRequestOptions as r, getDownloadTimeRemaining as s, DecodeRawEmailOptions as t, isEmailReceivedEvent as u, STANDARD_WEBHOOK_ID_HEADER as v, verifyStandardWebhooksSignature as w, StandardWebhooksSignResult as x, STANDARD_WEBHOOK_SIGNATURE_HEADER as y, validateEmailReceivedEvent as z };