@primitivedotdev/sdk 1.18.0 → 1.19.0

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 { I as WebhookAttachment, d as EmailAuth, f as EmailReceivedEvent, u as EmailAnalysis } from "./types-DVjBmOg0.js";
1
+ import { F as ValidateEmailAuthResult, I as WebhookAttachment, d as EmailAuth, f as EmailReceivedEvent, u as EmailAnalysis } from "./types-DVjBmOg0.js";
2
2
  import { ErrorObject } from "ajv";
3
3
 
4
4
  //#region src/webhook/received-email.d.ts
@@ -35,6 +35,179 @@ declare function buildForwardSubject(subject: string | null | undefined): string
35
35
  declare function formatAddress(address: ReceivedEmailAddress): string;
36
36
  declare function parseHeaderAddress(value: string | null | undefined): ReceivedEmailAddress | null;
37
37
  //#endregion
38
+ //#region src/webhook/auth.d.ts
39
+ /**
40
+ * Validate email authentication and compute a verdict.
41
+ *
42
+ * This function analyzes SPF, DKIM, and DMARC results to determine
43
+ * whether an email is likely authentic ("legit"), potentially spoofed
44
+ * ("suspicious"), or indeterminate ("unknown").
45
+ *
46
+ * ## Verdict Logic
47
+ *
48
+ * **Legit (high confidence):**
49
+ * - DMARC pass with DKIM alignment (cryptographic proof of authenticity)
50
+ *
51
+ * **Legit (medium confidence):**
52
+ * - DMARC pass with SPF alignment only (no DKIM)
53
+ * - Note: SPF can break through forwarding, but DMARC pass is still meaningful
54
+ *
55
+ * **Suspicious (high confidence):**
56
+ * - DMARC fail when domain has `reject` or `quarantine` policy
57
+ * - The domain owner explicitly says to distrust failing emails
58
+ * - SPF explicitly fails (IP not authorized by sender)
59
+ *
60
+ * **Suspicious (low confidence):**
61
+ * - DMARC fail when domain has `none` policy (monitoring mode)
62
+ * - No DMARC record but SPF/DKIM fail
63
+ *
64
+ * **Unknown:**
65
+ * - No DMARC record and no clear pass/fail
66
+ * - Temporary errors during authentication
67
+ * - No authentication data available
68
+ *
69
+ * A `legit` verdict means the email authenticated as its own From
70
+ * domain, not as any particular domain you trust. For authorization
71
+ * decisions, pair the verdict with a domain anchor via
72
+ * {@link isTrustedSender} instead of checking the verdict alone.
73
+ *
74
+ * @param auth - Email authentication results from the webhook
75
+ * @returns Verdict, confidence level, and explanatory reasons
76
+ *
77
+ * @example
78
+ * ```typescript
79
+ * const result = validateEmailAuth({
80
+ * spf: 'pass',
81
+ * dmarc: 'pass',
82
+ * dmarcPolicy: 'reject',
83
+ * dmarcFromDomain: 'example.com',
84
+ * dmarcSpfAligned: true,
85
+ * dmarcDkimAligned: true,
86
+ * dmarcSpfStrict: false,
87
+ * dmarcDkimStrict: false,
88
+ * dkimSignatures: [{
89
+ * domain: 'example.com',
90
+ * selector: 'default',
91
+ * result: 'pass',
92
+ * aligned: true,
93
+ * keyBits: 2048,
94
+ * algo: 'rsa-sha256',
95
+ * }],
96
+ * });
97
+ *
98
+ * // result.verdict === 'legit'
99
+ * // result.confidence === 'high'
100
+ * // result.reasons === ['DMARC passed with DKIM alignment']
101
+ * ```
102
+ */
103
+ declare function validateEmailAuth(auth: EmailAuth): ValidateEmailAuthResult;
104
+ //#endregion
105
+ //#region src/webhook/trust.d.ts
106
+ /**
107
+ * Why an email was or was not trusted. Stable machine-readable codes,
108
+ * ordered here by the sequence in which the checks run:
109
+ *
110
+ * - `trusted`: every check passed.
111
+ * - `auth-missing`: the event carries no usable `email.auth` object.
112
+ * - `auth-suspicious`: `validateEmailAuth` returned a `suspicious`
113
+ * verdict (DMARC/SPF failure signals).
114
+ * - `dmarc-temperror`: DMARC evaluation hit a temporary DNS error. The
115
+ * only retryable reason; the same email may verify cleanly once DNS
116
+ * recovers.
117
+ * - `auth-unknown`: authenticity could not be determined and the cause
118
+ * is not transient (most commonly the sender domain publishes no
119
+ * DMARC record, or evaluation hit a permanent error).
120
+ * - `dmarc-domain-mismatch`: the email authenticated, but the domain
121
+ * DMARC evaluated (the RFC 5322 From domain seen by the server) is
122
+ * not the expected domain.
123
+ * - `from-header-multiple-addresses`: the From header lists more than
124
+ * one address, which is ambiguous as an identity.
125
+ * - `from-header-invalid`: the From header is missing, malformed, uses
126
+ * group syntax, or fails address validation.
127
+ * - `from-domain-mismatch`: the parsed From address's domain is not the
128
+ * expected domain.
129
+ * - `sender-mismatch`: `options.sender` was given and the parsed From
130
+ * address is a different address.
131
+ */
132
+ type TrustReason = "trusted" | "auth-missing" | "auth-suspicious" | "dmarc-temperror" | "auth-unknown" | "dmarc-domain-mismatch" | "from-header-multiple-addresses" | "from-header-invalid" | "from-domain-mismatch" | "sender-mismatch";
133
+ interface TrustedSenderOptions {
134
+ /**
135
+ * The domain the email must be authenticated as (the RFC 5322 From
136
+ * domain). Matched exactly, case-insensitively: mail from a subdomain
137
+ * of `domain` does not match. Pass the subdomain itself to accept it.
138
+ */
139
+ domain: string;
140
+ /**
141
+ * Optional exact sender to require, as a bare address
142
+ * (`user@example.com`). Compared case-insensitively against the
143
+ * parsed From address. Note that DMARC authenticates the domain, not
144
+ * the local part: the domain owner's infrastructure controls which
145
+ * local parts it signs mail for.
146
+ */
147
+ sender?: string;
148
+ }
149
+ interface TrustedSenderResult {
150
+ /** True when the email is authenticated as the expected domain (and sender, if given). */
151
+ trusted: boolean;
152
+ /**
153
+ * True only for transient failures (`dmarc-temperror`). Callers that
154
+ * respond with a 5xx let webhook redelivery retry the same email
155
+ * after DNS recovers. All other untrusted reasons are permanent for
156
+ * this email.
157
+ */
158
+ retryable: boolean;
159
+ /** Machine-readable code for the first check that failed, or `trusted`. */
160
+ reason: TrustReason;
161
+ /** The underlying `validateEmailAuth` result, for logging and diagnostics. */
162
+ auth: ValidateEmailAuthResult;
163
+ }
164
+ /**
165
+ * Check whether an inbound email is authenticated as an expected domain
166
+ * (and optionally an exact sender address).
167
+ *
168
+ * `trusted` is true only when ALL of the following hold:
169
+ *
170
+ * 1. `validateEmailAuth(event.email.auth)` returns a `legit` verdict.
171
+ * 2. `event.email.auth.dmarcFromDomain` (the domain the server's DMARC
172
+ * evaluation ran against) equals `options.domain`.
173
+ * 3. The From header strict-parses to exactly one valid address whose
174
+ * domain equals `options.domain`.
175
+ * 4. When `options.sender` is given, the parsed From address equals it
176
+ * exactly (case-insensitive).
177
+ *
178
+ * ## Why the extra checks beyond the verdict
179
+ *
180
+ * The verdict alone says an email was authenticated, not which domain
181
+ * it was authenticated as: a fully authenticated email from an
182
+ * attacker-controlled domain is `legit`. Anchoring `dmarcFromDomain`
183
+ * closes that. The strict From parse defends the remaining gaps:
184
+ *
185
+ * - Naively regexing the raw From header is unsafe. A header like
186
+ * `From: "trusted@example.com" <x@evil.com>` plants an allowlisted
187
+ * address in the display name while DMARC evaluates (and passes for)
188
+ * `evil.com`. The strict parser extracts only the real addr-spec and
189
+ * rejects multi-address and group forms outright.
190
+ * - `normalizeReceivedEmail().sender` is NOT a safe anchor for
191
+ * authorization: it uses a lenient parser and falls back to the SMTP
192
+ * envelope sender (`smtp.mail_from`), which the sender fully
193
+ * controls. The same goes for Reply-To (`replyTarget`). This function
194
+ * never consults either.
195
+ * - An `unknown` verdict is not one thing: a DMARC temperror is
196
+ * transient (surfaced as `retryable: true`, respond 5xx and let
197
+ * webhook redelivery retry), while "no DMARC record" is permanent
198
+ * for the email and surfaced as non-retryable.
199
+ *
200
+ * Never throws for malformed event content; malformed input yields an
201
+ * untrusted result with a reason. Throws `TypeError` only for invalid
202
+ * `options` (programmer error).
203
+ *
204
+ * @param event - The verified `email.received` webhook event
205
+ * @param options - Expected domain and optional exact sender
206
+ * @returns Trust decision with a stable reason code and the underlying
207
+ * auth result
208
+ */
209
+ declare function isTrustedSender(event: EmailReceivedEvent, options: TrustedSenderOptions): TrustedSenderResult;
210
+ //#endregion
38
211
  //#region src/webhook/errors.d.ts
39
212
  /**
40
213
  * Verification error definitions.
@@ -242,4 +415,4 @@ declare class RawEmailDecodeError extends PrimitiveWebhookError {
242
415
  constructor(code: RawEmailDecodeErrorCode, message?: string);
243
416
  }
244
417
  //#endregion
245
- export { buildForwardSubject as _, RawEmailDecodeErrorCode as a, normalizeReceivedEmail as b, WebhookPayloadError as c, WebhookValidationErrorCode as d, WebhookVerificationError as f, ReceivedEmailThread as g, ReceivedEmailAddress as h, RawEmailDecodeError as i, WebhookPayloadErrorCode as l, ReceivedEmail as m, PrimitiveWebhookError as n, VERIFICATION_ERRORS as o, WebhookVerificationErrorCode as p, RAW_EMAIL_ERRORS as r, WebhookErrorCode as s, PAYLOAD_ERRORS as t, WebhookValidationError as u, buildReplySubject as v, parseHeaderAddress as x, formatAddress as y };
418
+ export { buildReplySubject as C, parseHeaderAddress as E, buildForwardSubject as S, normalizeReceivedEmail as T, isTrustedSender as _, RawEmailDecodeErrorCode as a, ReceivedEmailAddress as b, WebhookPayloadError as c, WebhookValidationErrorCode as d, WebhookVerificationError as f, TrustedSenderResult as g, TrustedSenderOptions as h, RawEmailDecodeError as i, WebhookPayloadErrorCode as l, TrustReason as m, PrimitiveWebhookError as n, VERIFICATION_ERRORS as o, WebhookVerificationErrorCode as p, RAW_EMAIL_ERRORS as r, WebhookErrorCode as s, PAYLOAD_ERRORS as t, WebhookValidationError as u, validateEmailAuth as v, formatAddress as w, ReceivedEmailThread as x, ReceivedEmail as y };
@@ -1,5 +1,5 @@
1
- import { F as ValidateEmailAuthResult, L as WebhookEvent, d as EmailAuth, f as EmailReceivedEvent } from "./types-DVjBmOg0.js";
2
- import { m as ReceivedEmail, u as WebhookValidationError } from "./errors-BTHBQqJa.js";
1
+ import { L as WebhookEvent, f as EmailReceivedEvent } from "./types-DVjBmOg0.js";
2
+ import { u as WebhookValidationError, y as ReceivedEmail } from "./errors-DAHv2kWU.js";
3
3
 
4
4
  //#region src/validation.d.ts
5
5
  interface ValidationSuccess<T> {
@@ -1380,68 +1380,6 @@ declare const emailReceivedEventJsonSchema: {
1380
1380
  };
1381
1381
  };
1382
1382
  //#endregion
1383
- //#region src/webhook/auth.d.ts
1384
- /**
1385
- * Validate email authentication and compute a verdict.
1386
- *
1387
- * This function analyzes SPF, DKIM, and DMARC results to determine
1388
- * whether an email is likely authentic ("legit"), potentially spoofed
1389
- * ("suspicious"), or indeterminate ("unknown").
1390
- *
1391
- * ## Verdict Logic
1392
- *
1393
- * **Legit (high confidence):**
1394
- * - DMARC pass with DKIM alignment (cryptographic proof of authenticity)
1395
- *
1396
- * **Legit (medium confidence):**
1397
- * - DMARC pass with SPF alignment only (no DKIM)
1398
- * - Note: SPF can break through forwarding, but DMARC pass is still meaningful
1399
- *
1400
- * **Suspicious (high confidence):**
1401
- * - DMARC fail when domain has `reject` or `quarantine` policy
1402
- * - The domain owner explicitly says to distrust failing emails
1403
- * - SPF explicitly fails (IP not authorized by sender)
1404
- *
1405
- * **Suspicious (low confidence):**
1406
- * - DMARC fail when domain has `none` policy (monitoring mode)
1407
- * - No DMARC record but SPF/DKIM fail
1408
- *
1409
- * **Unknown:**
1410
- * - No DMARC record and no clear pass/fail
1411
- * - Temporary errors during authentication
1412
- * - No authentication data available
1413
- *
1414
- * @param auth - Email authentication results from the webhook
1415
- * @returns Verdict, confidence level, and explanatory reasons
1416
- *
1417
- * @example
1418
- * ```typescript
1419
- * const result = validateEmailAuth({
1420
- * spf: 'pass',
1421
- * dmarc: 'pass',
1422
- * dmarcPolicy: 'reject',
1423
- * dmarcFromDomain: 'example.com',
1424
- * dmarcSpfAligned: true,
1425
- * dmarcDkimAligned: true,
1426
- * dmarcSpfStrict: false,
1427
- * dmarcDkimStrict: false,
1428
- * dkimSignatures: [{
1429
- * domain: 'example.com',
1430
- * selector: 'default',
1431
- * result: 'pass',
1432
- * aligned: true,
1433
- * keyBits: 2048,
1434
- * algo: 'rsa-sha256',
1435
- * }],
1436
- * });
1437
- *
1438
- * // result.verdict === 'legit'
1439
- * // result.confidence === 'high'
1440
- * // result.reasons === ['DMARC passed with DKIM alignment']
1441
- * ```
1442
- */
1443
- declare function validateEmailAuth(auth: EmailAuth): ValidateEmailAuthResult;
1444
- //#endregion
1445
1383
  //#region src/webhook/version.d.ts
1446
1384
  /**
1447
1385
  * Webhook API Version
@@ -1726,4 +1664,4 @@ declare function decodeRawEmail(event: EmailReceivedEvent, options?: DecodeRawEm
1726
1664
  */
1727
1665
  declare function verifyRawEmailDownload(downloaded: Buffer | ArrayBuffer | Uint8Array, event: EmailReceivedEvent): Buffer;
1728
1666
  //#endregion
1729
- export { PRIMITIVE_SIGNATURE_HEADER as A, safeValidateEmailReceivedEvent as B, StandardWebhooksSignResult as C, LEGACY_CONFIRMED_HEADER as D, verifyStandardWebhooksSignature as E, GenerateDownloadTokenOptions as F, VerifyDownloadTokenOptions as I, VerifyDownloadTokenResult as L, VerifyOptions as M, signWebhookPayload as N, LEGACY_SIGNATURE_HEADER as O, verifyWebhookSignature as P, generateDownloadToken as R, STANDARD_WEBHOOK_TIMESTAMP_HEADER as S, signStandardWebhooksPayload as T, validateEmailReceivedEvent as V, WEBHOOK_VERSION as _, WebhookHeaders as a, STANDARD_WEBHOOK_ID_HEADER as b, getDownloadTimeRemaining as c, handleWebhookEvent as d, isDownloadExpired as f, verifyRawEmailDownload as g, receive as h, WEBHOOK_EVENT_HEADER as i, SignResult as j, PRIMITIVE_CONFIRMED_HEADER as k, getEventHeader as l, parseWebhookEvent as m, HandleWebhookOptions as n, confirmedHeaders as o, isRawIncluded as p, ReceiveRequestOptions as r, decodeRawEmail as s, DecodeRawEmailOptions as t, handleWebhook as u, validateEmailAuth as v, StandardWebhooksVerifyOptions as w, STANDARD_WEBHOOK_SIGNATURE_HEADER as x, emailReceivedEventJsonSchema as y, verifyDownloadToken as z };
1667
+ export { SignResult as A, validateEmailReceivedEvent as B, StandardWebhooksVerifyOptions as C, LEGACY_SIGNATURE_HEADER as D, LEGACY_CONFIRMED_HEADER as E, VerifyDownloadTokenOptions as F, VerifyDownloadTokenResult as I, generateDownloadToken as L, signWebhookPayload as M, verifyWebhookSignature as N, PRIMITIVE_CONFIRMED_HEADER as O, GenerateDownloadTokenOptions as P, verifyDownloadToken as R, StandardWebhooksSignResult as S, verifyStandardWebhooksSignature as T, WEBHOOK_VERSION as _, WebhookHeaders as a, STANDARD_WEBHOOK_SIGNATURE_HEADER as b, getDownloadTimeRemaining as c, handleWebhookEvent as d, isDownloadExpired as f, verifyRawEmailDownload as g, receive as h, WEBHOOK_EVENT_HEADER as i, VerifyOptions as j, PRIMITIVE_SIGNATURE_HEADER as k, getEventHeader as l, parseWebhookEvent as m, HandleWebhookOptions as n, confirmedHeaders as o, isRawIncluded as p, ReceiveRequestOptions as r, decodeRawEmail as s, DecodeRawEmailOptions as t, handleWebhook as u, emailReceivedEventJsonSchema as v, signStandardWebhooksPayload as w, STANDARD_WEBHOOK_TIMESTAMP_HEADER as x, STANDARD_WEBHOOK_ID_HEADER as y, safeValidateEmailReceivedEvent as z };
@@ -1,4 +1,4 @@
1
- import { m as ReceivedEmail } from "./errors-BTHBQqJa.js";
1
+ import { y as ReceivedEmail } from "./errors-DAHv2kWU.js";
2
2
 
3
3
  //#region ../packages/api-core/src/api/core/auth.gen.d.ts
4
4
  type AuthToken = string | undefined;
@@ -187,7 +187,11 @@ type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> =
187
187
  };
188
188
  //#endregion
189
189
  //#region ../packages/api-core/src/api/client/utils.gen.d.ts
190
- type ErrInterceptor<Err, Res, Req, Options> = (error: Err, response: Res, request: Req, options: Options) => Err | Promise<Err>;
190
+ type ErrInterceptor<Err, Res, Req, Options> = (error: Err, /** response may be undefined due to a network error where no response object is produced */
191
+
192
+ response: Res | undefined, /** request may be undefined, because error may be from building the request object itself */
193
+
194
+ request: Req | undefined, options: Options) => Err | Promise<Err>;
191
195
  type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
192
196
  type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
193
197
  declare class Interceptors<Interceptor> {
@@ -268,6 +272,7 @@ interface RequestOptions$2<TData = unknown, TResponseStyle extends ResponseStyle
268
272
  url: Url;
269
273
  }
270
274
  interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions$2<unknown, TResponseStyle, ThrowOnError, Url> {
275
+ headers: Headers;
271
276
  serializedBody?: string;
272
277
  }
273
278
  type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
@@ -281,8 +286,8 @@ type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boole
281
286
  data: undefined;
282
287
  error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
283
288
  }) & {
284
- request: Request;
285
- response: Response;
289
+ /** request may be undefined, because error may be from building the request object itself */request?: Request; /** response may be undefined, because error may be from building the request object itself or from a network error */
290
+ response?: Response;
286
291
  }>;
287
292
  interface ClientOptions {
288
293
  baseUrl?: string;
@@ -290,7 +295,7 @@ interface ClientOptions {
290
295
  throwOnError?: boolean;
291
296
  }
292
297
  type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions$2<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
293
- type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions$2<never, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
298
+ type SseFn = <TData = unknown, _TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions$2<never, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData>>;
294
299
  type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions$2<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions$2<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
295
300
  type BuildUrlFn = <TData extends {
296
301
  body?: unknown;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { A as createPrimitiveClient, Ar as CreateAgentAccountInput, C as SendAttachment, D as WaitForNextOptions, E as SendThreadInput, Ir as CreateAgentClaimLinkInput, O as client, R as PrimitiveApiError, T as SendResult, Xn as Account, _ as MemorySetInput, a as ForwardInput, ar as AgentAccountUpgradeHint, b as ReplyInput, c as InboxStreamOptions, cr as AgentClaimStartResult, d as MemoryGetInput, f as MemoryJsonValue, g as MemorySearchResponse, h as MemorySearchInput, i as CreatedAgent, ir as AgentAccountResult, k as createAgent, l as MemoriesResource, m as MemoryRecordWithValue, mg as VerifyAgentClaimInput, o as InboundEmail, or as AgentClaimLinkResult, p as MemoryRecord, r as CreateAgentOptions, s as InboxResource, sr as AgentClaimResult, t as AccountResource, u as MemoryDeleteInput, um as StartAgentClaimInput, v as PrimitiveClient, w as SendInput, wd as PlanLimits, y as PrimitiveClientOptions } from "./index-BUjhyU4u.js";
1
+ import { A as createPrimitiveClient, Ar as CreateAgentAccountInput, C as SendAttachment, D as WaitForNextOptions, E as SendThreadInput, Ir as CreateAgentClaimLinkInput, O as client, R as PrimitiveApiError, T as SendResult, Xn as Account, _ as MemorySetInput, a as ForwardInput, ar as AgentAccountUpgradeHint, b as ReplyInput, c as InboxStreamOptions, cr as AgentClaimStartResult, d as MemoryGetInput, f as MemoryJsonValue, g as MemorySearchResponse, h as MemorySearchInput, i as CreatedAgent, ir as AgentAccountResult, k as createAgent, l as MemoriesResource, m as MemoryRecordWithValue, mg as VerifyAgentClaimInput, o as InboundEmail, or as AgentClaimLinkResult, p as MemoryRecord, r as CreateAgentOptions, s as InboxResource, sr as AgentClaimResult, t as AccountResource, u as MemoryDeleteInput, um as StartAgentClaimInput, v as PrimitiveClient, w as SendInput, wd as PlanLimits, y as PrimitiveClientOptions } from "./index-d8WzbPv5.js";
2
2
  import { $ as isPaymentFailedEvent, A as RawContentInline, B as InteractionEvent, C as ParsedData, D as ParsedStatus, E as ParsedError, F as ValidateEmailAuthResult, G as PaymentFailedEvent, H as InteractionX402Suffix, I as WebhookAttachment, J as WebhookEventType, K as PaymentSettledEvent, L as WebhookEvent, M as SpfResult, N as TlsReportAnalysis, O as RawContent, P as UnknownEvent, Q as isPaymentEvent, R as EMAIL_EVENT_TYPES, S as KnownWebhookEvent, T as ParsedDataFailed, U as PAYMENT_EVENT_TYPES, V as InteractionX402Event, W as PaymentEvent, X as isInteractionX402Event, Y as isEmailReceivedEvent, Z as isKnownWebhookEventType, _ as ForwardResultAttachmentAnalyzed, a as DkimSignature, b as ForwardVerdict, c as DmarcResult, d as EmailAuth, et as isPaymentSettledEvent, f as EmailReceivedEvent, g as ForwardResult, h as ForwardOriginalSender, i as DkimResult, j as RoutingDecision, k as RawContentDownloadOnly, l as EmailAddress, m as ForwardAnalysis, n as AuthVerdict, o as DmarcPolicy, p as EventType, q as WEBHOOK_EVENT_TYPES, r as BounceAnalysis, s as DmarcReportAnalysis, t as AuthConfidence, u as EmailAnalysis, v as ForwardResultAttachmentSkipped, w as ParsedDataComplete, x as ForwardVerification, y as ForwardResultInline, z as INTERACTION_EVENT_TYPES } from "./types-DVjBmOg0.js";
3
- import { _ as buildForwardSubject, a as RawEmailDecodeErrorCode, b as normalizeReceivedEmail, c as WebhookPayloadError, d as WebhookValidationErrorCode, f as WebhookVerificationError, g as ReceivedEmailThread, h as ReceivedEmailAddress, i as RawEmailDecodeError, l as WebhookPayloadErrorCode, m as ReceivedEmail, n as PrimitiveWebhookError, o as VERIFICATION_ERRORS, p as WebhookVerificationErrorCode, r as RAW_EMAIL_ERRORS, s as WebhookErrorCode, t as PAYLOAD_ERRORS, u as WebhookValidationError, v as buildReplySubject, x as parseHeaderAddress, y as formatAddress } from "./errors-BTHBQqJa.js";
4
- import { A as PRIMITIVE_SIGNATURE_HEADER, B as safeValidateEmailReceivedEvent, C as StandardWebhooksSignResult, D as LEGACY_CONFIRMED_HEADER, E as verifyStandardWebhooksSignature, F as GenerateDownloadTokenOptions, I as VerifyDownloadTokenOptions, L as VerifyDownloadTokenResult, M as VerifyOptions, N as signWebhookPayload, O as LEGACY_SIGNATURE_HEADER, P as verifyWebhookSignature, R as generateDownloadToken, S as STANDARD_WEBHOOK_TIMESTAMP_HEADER, T as signStandardWebhooksPayload, V as validateEmailReceivedEvent, _ as WEBHOOK_VERSION, a as WebhookHeaders, b as STANDARD_WEBHOOK_ID_HEADER, c as getDownloadTimeRemaining, d as handleWebhookEvent, f as isDownloadExpired, g as verifyRawEmailDownload, h as receive, i as WEBHOOK_EVENT_HEADER, j as SignResult, k as PRIMITIVE_CONFIRMED_HEADER, l as getEventHeader, m as parseWebhookEvent, n as HandleWebhookOptions, o as confirmedHeaders, p as isRawIncluded, r as ReceiveRequestOptions, s as decodeRawEmail, t as DecodeRawEmailOptions, u as handleWebhook, v as validateEmailAuth, w as StandardWebhooksVerifyOptions, x as STANDARD_WEBHOOK_SIGNATURE_HEADER, y as emailReceivedEventJsonSchema, z as verifyDownloadToken } from "./index-D2nlv8DS.js";
3
+ import { C as buildReplySubject, E as parseHeaderAddress, S as buildForwardSubject, T as normalizeReceivedEmail, _ as isTrustedSender, a as RawEmailDecodeErrorCode, b as ReceivedEmailAddress, c as WebhookPayloadError, d as WebhookValidationErrorCode, f as WebhookVerificationError, g as TrustedSenderResult, h as TrustedSenderOptions, i as RawEmailDecodeError, l as WebhookPayloadErrorCode, m as TrustReason, n as PrimitiveWebhookError, o as VERIFICATION_ERRORS, p as WebhookVerificationErrorCode, r as RAW_EMAIL_ERRORS, s as WebhookErrorCode, t as PAYLOAD_ERRORS, u as WebhookValidationError, v as validateEmailAuth, w as formatAddress, x as ReceivedEmailThread, y as ReceivedEmail } from "./errors-DAHv2kWU.js";
4
+ import { A as SignResult, B as validateEmailReceivedEvent, C as StandardWebhooksVerifyOptions, D as LEGACY_SIGNATURE_HEADER, E as LEGACY_CONFIRMED_HEADER, F as VerifyDownloadTokenOptions, I as VerifyDownloadTokenResult, L as generateDownloadToken, M as signWebhookPayload, N as verifyWebhookSignature, O as PRIMITIVE_CONFIRMED_HEADER, P as GenerateDownloadTokenOptions, R as verifyDownloadToken, S as StandardWebhooksSignResult, T as verifyStandardWebhooksSignature, _ as WEBHOOK_VERSION, a as WebhookHeaders, b as STANDARD_WEBHOOK_SIGNATURE_HEADER, c as getDownloadTimeRemaining, d as handleWebhookEvent, f as isDownloadExpired, g as verifyRawEmailDownload, h as receive, i as WEBHOOK_EVENT_HEADER, j as VerifyOptions, k as PRIMITIVE_SIGNATURE_HEADER, l as getEventHeader, m as parseWebhookEvent, n as HandleWebhookOptions, o as confirmedHeaders, p as isRawIncluded, r as ReceiveRequestOptions, s as decodeRawEmail, t as DecodeRawEmailOptions, u as handleWebhook, v as emailReceivedEventJsonSchema, w as signStandardWebhooksPayload, x as STANDARD_WEBHOOK_TIMESTAMP_HEADER, y as STANDARD_WEBHOOK_ID_HEADER, z as safeValidateEmailReceivedEvent } from "./index-DJeUuGUn.js";
5
5
  import { NonceBinding, PayoutRegistrationMessageInput, TokenDomain, TransferAuthorization, X402Challenge, X402ChargeInput, X402Client, X402ClientOptions, X402DeclinedPayment, X402Error, X402PaymentPayload, X402PaymentRequirements, X402PayoutAddress, X402Receipt, X402Signer, X402SpendPolicy, buildPayoutRegistrationMessage, createX402Client, deriveEip3009Nonce, parseEmailChallengeFromPart } from "./x402/index.js";
6
6
 
7
7
  //#region src/index.d.ts
@@ -11,4 +11,4 @@ declare const primitive: {
11
11
  x402: typeof createX402Client;
12
12
  };
13
13
  //#endregion
14
- export { type Account, AccountResource, type AgentAccountResult, type AgentAccountUpgradeHint, type AgentClaimLinkResult, type AgentClaimResult, type AgentClaimStartResult, AuthConfidence, AuthVerdict, BounceAnalysis, type CreateAgentAccountInput, type CreateAgentClaimLinkInput, type CreateAgentOptions, type CreatedAgent, DecodeRawEmailOptions, DkimResult, DkimSignature, DmarcPolicy, DmarcReportAnalysis, DmarcResult, EMAIL_EVENT_TYPES, EmailAddress, EmailAnalysis, EmailAuth, EmailReceivedEvent, EventType, ForwardAnalysis, type ForwardInput, ForwardOriginalSender, ForwardResult, ForwardResultAttachmentAnalyzed, ForwardResultAttachmentSkipped, ForwardResultInline, ForwardVerdict, ForwardVerification, GenerateDownloadTokenOptions, HandleWebhookOptions, INTERACTION_EVENT_TYPES, type InboundEmail, InboxResource, type InboxStreamOptions, InteractionEvent, InteractionX402Event, InteractionX402Suffix, KnownWebhookEvent, LEGACY_CONFIRMED_HEADER, LEGACY_SIGNATURE_HEADER, MemoriesResource, type MemoryDeleteInput, type MemoryGetInput, type MemoryJsonValue, type MemoryRecord, type MemoryRecordWithValue, type MemorySearchInput, type MemorySearchResponse, type MemorySetInput, type NonceBinding, PAYLOAD_ERRORS, PAYMENT_EVENT_TYPES, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedData, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedStatus, PaymentEvent, PaymentFailedEvent, PaymentSettledEvent, type PayoutRegistrationMessageInput, type PlanLimits, PrimitiveApiError, PrimitiveClient, type PrimitiveClientOptions, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawContent, RawContentDownloadOnly, RawContentInline, RawEmailDecodeError, RawEmailDecodeErrorCode, ReceiveRequestOptions, ReceivedEmail, ReceivedEmailAddress, ReceivedEmailThread, type ReplyInput, RoutingDecision, STANDARD_WEBHOOK_ID_HEADER, STANDARD_WEBHOOK_SIGNATURE_HEADER, STANDARD_WEBHOOK_TIMESTAMP_HEADER, type SendAttachment, type SendInput, type SendResult, type SendThreadInput, SignResult, SpfResult, StandardWebhooksSignResult, StandardWebhooksVerifyOptions, type StartAgentClaimInput, TlsReportAnalysis, type TokenDomain, type TransferAuthorization, UnknownEvent, VERIFICATION_ERRORS, ValidateEmailAuthResult, type VerifyAgentClaimInput, VerifyDownloadTokenOptions, VerifyDownloadTokenResult, VerifyOptions, WEBHOOK_EVENT_HEADER, WEBHOOK_EVENT_TYPES, WEBHOOK_VERSION, type WaitForNextOptions, WebhookAttachment, WebhookErrorCode, WebhookEvent, WebhookEventType, WebhookHeaders, WebhookPayloadError, WebhookPayloadErrorCode, WebhookValidationError, WebhookValidationErrorCode, WebhookVerificationError, WebhookVerificationErrorCode, type X402Challenge, type X402ChargeInput, X402Client, type X402ClientOptions, type X402DeclinedPayment, X402Error, type X402PaymentPayload, type X402PaymentRequirements, type X402PayoutAddress, type X402Receipt, type X402Signer, type X402SpendPolicy, buildForwardSubject, buildPayoutRegistrationMessage, buildReplySubject, client, confirmedHeaders, createAgent, createPrimitiveClient, createX402Client, decodeRawEmail, primitive as default, deriveEip3009Nonce, emailReceivedEventJsonSchema, formatAddress, generateDownloadToken, getDownloadTimeRemaining, getEventHeader, handleWebhook, handleWebhookEvent, isDownloadExpired, isEmailReceivedEvent, isInteractionX402Event, isKnownWebhookEventType, isPaymentEvent, isPaymentFailedEvent, isPaymentSettledEvent, isRawIncluded, normalizeReceivedEmail, parseEmailChallengeFromPart, parseHeaderAddress, parseWebhookEvent, receive, safeValidateEmailReceivedEvent, signStandardWebhooksPayload, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyDownloadToken, verifyRawEmailDownload, verifyStandardWebhooksSignature, verifyWebhookSignature };
14
+ export { type Account, AccountResource, type AgentAccountResult, type AgentAccountUpgradeHint, type AgentClaimLinkResult, type AgentClaimResult, type AgentClaimStartResult, AuthConfidence, AuthVerdict, BounceAnalysis, type CreateAgentAccountInput, type CreateAgentClaimLinkInput, type CreateAgentOptions, type CreatedAgent, DecodeRawEmailOptions, DkimResult, DkimSignature, DmarcPolicy, DmarcReportAnalysis, DmarcResult, EMAIL_EVENT_TYPES, EmailAddress, EmailAnalysis, EmailAuth, EmailReceivedEvent, EventType, ForwardAnalysis, type ForwardInput, ForwardOriginalSender, ForwardResult, ForwardResultAttachmentAnalyzed, ForwardResultAttachmentSkipped, ForwardResultInline, ForwardVerdict, ForwardVerification, GenerateDownloadTokenOptions, HandleWebhookOptions, INTERACTION_EVENT_TYPES, type InboundEmail, InboxResource, type InboxStreamOptions, InteractionEvent, InteractionX402Event, InteractionX402Suffix, KnownWebhookEvent, LEGACY_CONFIRMED_HEADER, LEGACY_SIGNATURE_HEADER, MemoriesResource, type MemoryDeleteInput, type MemoryGetInput, type MemoryJsonValue, type MemoryRecord, type MemoryRecordWithValue, type MemorySearchInput, type MemorySearchResponse, type MemorySetInput, type NonceBinding, PAYLOAD_ERRORS, PAYMENT_EVENT_TYPES, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedData, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedStatus, PaymentEvent, PaymentFailedEvent, PaymentSettledEvent, type PayoutRegistrationMessageInput, type PlanLimits, PrimitiveApiError, PrimitiveClient, type PrimitiveClientOptions, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawContent, RawContentDownloadOnly, RawContentInline, RawEmailDecodeError, RawEmailDecodeErrorCode, ReceiveRequestOptions, ReceivedEmail, ReceivedEmailAddress, ReceivedEmailThread, type ReplyInput, RoutingDecision, STANDARD_WEBHOOK_ID_HEADER, STANDARD_WEBHOOK_SIGNATURE_HEADER, STANDARD_WEBHOOK_TIMESTAMP_HEADER, type SendAttachment, type SendInput, type SendResult, type SendThreadInput, SignResult, SpfResult, StandardWebhooksSignResult, StandardWebhooksVerifyOptions, type StartAgentClaimInput, TlsReportAnalysis, type TokenDomain, type TransferAuthorization, TrustReason, TrustedSenderOptions, TrustedSenderResult, UnknownEvent, VERIFICATION_ERRORS, ValidateEmailAuthResult, type VerifyAgentClaimInput, VerifyDownloadTokenOptions, VerifyDownloadTokenResult, VerifyOptions, WEBHOOK_EVENT_HEADER, WEBHOOK_EVENT_TYPES, WEBHOOK_VERSION, type WaitForNextOptions, WebhookAttachment, WebhookErrorCode, WebhookEvent, WebhookEventType, WebhookHeaders, WebhookPayloadError, WebhookPayloadErrorCode, WebhookValidationError, WebhookValidationErrorCode, WebhookVerificationError, WebhookVerificationErrorCode, type X402Challenge, type X402ChargeInput, X402Client, type X402ClientOptions, type X402DeclinedPayment, X402Error, type X402PaymentPayload, type X402PaymentRequirements, type X402PayoutAddress, type X402Receipt, type X402Signer, type X402SpendPolicy, buildForwardSubject, buildPayoutRegistrationMessage, buildReplySubject, client, confirmedHeaders, createAgent, createPrimitiveClient, createX402Client, decodeRawEmail, primitive as default, deriveEip3009Nonce, emailReceivedEventJsonSchema, formatAddress, generateDownloadToken, getDownloadTimeRemaining, getEventHeader, handleWebhook, handleWebhookEvent, isDownloadExpired, isEmailReceivedEvent, isInteractionX402Event, isKnownWebhookEventType, isPaymentEvent, isPaymentFailedEvent, isPaymentSettledEvent, isRawIncluded, isTrustedSender, normalizeReceivedEmail, parseEmailChallengeFromPart, parseHeaderAddress, parseWebhookEvent, receive, safeValidateEmailReceivedEvent, signStandardWebhooksPayload, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyDownloadToken, verifyRawEmailDownload, verifyStandardWebhooksSignature, verifyWebhookSignature };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { a as PrimitiveClient, c as createPrimitiveClient, i as MemoriesResource, m as PrimitiveApiError, o as client, r as InboxResource, s as createAgent, t as AccountResource } from "./api-B2sN3Xvi.js";
2
- import { a as VERIFICATION_ERRORS, c as WebhookVerificationError, d as formatAddress, f as normalizeReceivedEmail, i as RawEmailDecodeError, l as buildForwardSubject, n as PrimitiveWebhookError, o as WebhookPayloadError, p as parseHeaderAddress, r as RAW_EMAIL_ERRORS, s as WebhookValidationError, t as PAYLOAD_ERRORS, u as buildReplySubject } from "./errors-BPJGp9I6.js";
3
- import { A as LEGACY_CONFIRMED_HEADER, B as isEmailReceivedEvent, C as SpfResult, D as STANDARD_WEBHOOK_TIMESTAMP_HEADER, E as STANDARD_WEBHOOK_SIGNATURE_HEADER, F as verifyWebhookSignature, G as isPaymentSettledEvent, H as isKnownWebhookEventType, I as EMAIL_EVENT_TYPES, J as safeValidateEmailReceivedEvent, K as generateDownloadToken, L as INTERACTION_EVENT_TYPES, M as PRIMITIVE_CONFIRMED_HEADER, N as PRIMITIVE_SIGNATURE_HEADER, O as signStandardWebhooksPayload, P as signWebhookPayload, R as PAYMENT_EVENT_TYPES, S as ParsedStatus, T as STANDARD_WEBHOOK_ID_HEADER, U as isPaymentEvent, V as isInteractionX402Event, W as isPaymentFailedEvent, Y as validateEmailReceivedEvent, _ as DkimResult, a as getEventHeader, b as EventType, c as isDownloadExpired, d as receive, f as verifyRawEmailDownload, g as AuthVerdict, h as AuthConfidence, i as getDownloadTimeRemaining, j as LEGACY_SIGNATURE_HEADER, k as verifyStandardWebhooksSignature, l as isRawIncluded, m as validateEmailAuth, n as confirmedHeaders, o as handleWebhook, p as WEBHOOK_VERSION, q as verifyDownloadToken, r as decodeRawEmail, s as handleWebhookEvent, t as WEBHOOK_EVENT_HEADER, u as parseWebhookEvent, v as DmarcPolicy, w as emailReceivedEventJsonSchema, x as ForwardVerdict, y as DmarcResult, z as WEBHOOK_EVENT_TYPES } from "./webhook-BekIm0Uf.js";
1
+ import { a as PrimitiveClient, c as createPrimitiveClient, i as MemoriesResource, m as PrimitiveApiError, o as client, r as InboxResource, s as createAgent, t as AccountResource } from "./api-CnvYcgJ-.js";
2
+ import { C as normalizeReceivedEmail, S as formatAddress, _ as ForwardVerdict, a as VERIFICATION_ERRORS, b as buildForwardSubject, c as WebhookVerificationError, d as AuthConfidence, f as AuthVerdict, g as EventType, h as DmarcResult, i as RawEmailDecodeError, l as isTrustedSender, m as DmarcPolicy, n as PrimitiveWebhookError, o as WebhookPayloadError, p as DkimResult, r as RAW_EMAIL_ERRORS, s as WebhookValidationError, t as PAYLOAD_ERRORS, u as validateEmailAuth, v as ParsedStatus, w as parseHeaderAddress, x as buildReplySubject, y as SpfResult } from "./errors-D6WjisrD.js";
3
+ import { A as isEmailReceivedEvent, C as PRIMITIVE_SIGNATURE_HEADER, D as INTERACTION_EVENT_TYPES, E as EMAIL_EVENT_TYPES, F as isPaymentSettledEvent, I as generateDownloadToken, L as verifyDownloadToken, M as isKnownWebhookEventType, N as isPaymentEvent, O as PAYMENT_EVENT_TYPES, P as isPaymentFailedEvent, R as safeValidateEmailReceivedEvent, S as PRIMITIVE_CONFIRMED_HEADER, T as verifyWebhookSignature, _ as STANDARD_WEBHOOK_TIMESTAMP_HEADER, a as getEventHeader, b as LEGACY_CONFIRMED_HEADER, c as isDownloadExpired, d as receive, f as verifyRawEmailDownload, g as STANDARD_WEBHOOK_SIGNATURE_HEADER, h as STANDARD_WEBHOOK_ID_HEADER, i as getDownloadTimeRemaining, j as isInteractionX402Event, k as WEBHOOK_EVENT_TYPES, l as isRawIncluded, m as emailReceivedEventJsonSchema, n as confirmedHeaders, o as handleWebhook, p as WEBHOOK_VERSION, r as decodeRawEmail, s as handleWebhookEvent, t as WEBHOOK_EVENT_HEADER, u as parseWebhookEvent, v as signStandardWebhooksPayload, w as signWebhookPayload, x as LEGACY_SIGNATURE_HEADER, y as verifyStandardWebhooksSignature, z as validateEmailReceivedEvent } from "./webhook-1cz088XC.js";
4
4
  import { X402Client, X402Error, buildPayoutRegistrationMessage, createX402Client, deriveEip3009Nonce, parseEmailChallengeFromPart } from "./x402/index.js";
5
5
  //#region src/index.ts
6
6
  const primitive = {
@@ -10,4 +10,4 @@ const primitive = {
10
10
  x402: createX402Client
11
11
  };
12
12
  //#endregion
13
- export { AccountResource, AuthConfidence, AuthVerdict, DkimResult, DmarcPolicy, DmarcResult, EMAIL_EVENT_TYPES, EventType, ForwardVerdict, INTERACTION_EVENT_TYPES, InboxResource, LEGACY_CONFIRMED_HEADER, LEGACY_SIGNATURE_HEADER, MemoriesResource, PAYLOAD_ERRORS, PAYMENT_EVENT_TYPES, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedStatus, PrimitiveApiError, PrimitiveClient, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawEmailDecodeError, STANDARD_WEBHOOK_ID_HEADER, STANDARD_WEBHOOK_SIGNATURE_HEADER, STANDARD_WEBHOOK_TIMESTAMP_HEADER, SpfResult, VERIFICATION_ERRORS, WEBHOOK_EVENT_HEADER, WEBHOOK_EVENT_TYPES, WEBHOOK_VERSION, WebhookPayloadError, WebhookValidationError, WebhookVerificationError, X402Client, X402Error, buildForwardSubject, buildPayoutRegistrationMessage, buildReplySubject, client, confirmedHeaders, createAgent, createPrimitiveClient, createX402Client, decodeRawEmail, primitive as default, deriveEip3009Nonce, emailReceivedEventJsonSchema, formatAddress, generateDownloadToken, getDownloadTimeRemaining, getEventHeader, handleWebhook, handleWebhookEvent, isDownloadExpired, isEmailReceivedEvent, isInteractionX402Event, isKnownWebhookEventType, isPaymentEvent, isPaymentFailedEvent, isPaymentSettledEvent, isRawIncluded, normalizeReceivedEmail, parseEmailChallengeFromPart, parseHeaderAddress, parseWebhookEvent, receive, safeValidateEmailReceivedEvent, signStandardWebhooksPayload, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyDownloadToken, verifyRawEmailDownload, verifyStandardWebhooksSignature, verifyWebhookSignature };
13
+ export { AccountResource, AuthConfidence, AuthVerdict, DkimResult, DmarcPolicy, DmarcResult, EMAIL_EVENT_TYPES, EventType, ForwardVerdict, INTERACTION_EVENT_TYPES, InboxResource, LEGACY_CONFIRMED_HEADER, LEGACY_SIGNATURE_HEADER, MemoriesResource, PAYLOAD_ERRORS, PAYMENT_EVENT_TYPES, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedStatus, PrimitiveApiError, PrimitiveClient, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawEmailDecodeError, STANDARD_WEBHOOK_ID_HEADER, STANDARD_WEBHOOK_SIGNATURE_HEADER, STANDARD_WEBHOOK_TIMESTAMP_HEADER, SpfResult, VERIFICATION_ERRORS, WEBHOOK_EVENT_HEADER, WEBHOOK_EVENT_TYPES, WEBHOOK_VERSION, WebhookPayloadError, WebhookValidationError, WebhookVerificationError, X402Client, X402Error, buildForwardSubject, buildPayoutRegistrationMessage, buildReplySubject, client, confirmedHeaders, createAgent, createPrimitiveClient, createX402Client, decodeRawEmail, primitive as default, deriveEip3009Nonce, emailReceivedEventJsonSchema, formatAddress, generateDownloadToken, getDownloadTimeRemaining, getEventHeader, handleWebhook, handleWebhookEvent, isDownloadExpired, isEmailReceivedEvent, isInteractionX402Event, isKnownWebhookEventType, isPaymentEvent, isPaymentFailedEvent, isPaymentSettledEvent, isRawIncluded, isTrustedSender, normalizeReceivedEmail, parseEmailChallengeFromPart, parseHeaderAddress, parseWebhookEvent, receive, safeValidateEmailReceivedEvent, signStandardWebhooksPayload, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyDownloadToken, verifyRawEmailDownload, verifyStandardWebhooksSignature, verifyWebhookSignature };
@@ -1,4 +1,4 @@
1
1
  import { $ as isPaymentFailedEvent, A as RawContentInline, B as InteractionEvent, C as ParsedData, D as ParsedStatus, E as ParsedError, F as ValidateEmailAuthResult, G as PaymentFailedEvent, H as InteractionX402Suffix, I as WebhookAttachment, J as WebhookEventType, K as PaymentSettledEvent, L as WebhookEvent, M as SpfResult, N as TlsReportAnalysis, O as RawContent, P as UnknownEvent, Q as isPaymentEvent, R as EMAIL_EVENT_TYPES, S as KnownWebhookEvent, T as ParsedDataFailed, U as PAYMENT_EVENT_TYPES, V as InteractionX402Event, W as PaymentEvent, X as isInteractionX402Event, Y as isEmailReceivedEvent, Z as isKnownWebhookEventType, _ as ForwardResultAttachmentAnalyzed, a as DkimSignature, b as ForwardVerdict, c as DmarcResult, d as EmailAuth, et as isPaymentSettledEvent, f as EmailReceivedEvent, g as ForwardResult, h as ForwardOriginalSender, i as DkimResult, j as RoutingDecision, k as RawContentDownloadOnly, l as EmailAddress, m as ForwardAnalysis, n as AuthVerdict, o as DmarcPolicy, p as EventType, q as WEBHOOK_EVENT_TYPES, r as BounceAnalysis, s as DmarcReportAnalysis, t as AuthConfidence, u as EmailAnalysis, v as ForwardResultAttachmentSkipped, w as ParsedDataComplete, x as ForwardVerification, y as ForwardResultInline, z as INTERACTION_EVENT_TYPES } from "../types-DVjBmOg0.js";
2
- import { _ as buildForwardSubject, a as RawEmailDecodeErrorCode, b as normalizeReceivedEmail, c as WebhookPayloadError, d as WebhookValidationErrorCode, f as WebhookVerificationError, g as ReceivedEmailThread, h as ReceivedEmailAddress, i as RawEmailDecodeError, l as WebhookPayloadErrorCode, m as ReceivedEmail, n as PrimitiveWebhookError, o as VERIFICATION_ERRORS, p as WebhookVerificationErrorCode, r as RAW_EMAIL_ERRORS, s as WebhookErrorCode, t as PAYLOAD_ERRORS, u as WebhookValidationError, v as buildReplySubject, x as parseHeaderAddress, y as formatAddress } from "../errors-BTHBQqJa.js";
3
- import { A as PRIMITIVE_SIGNATURE_HEADER, B as safeValidateEmailReceivedEvent, C as StandardWebhooksSignResult, D as LEGACY_CONFIRMED_HEADER, E as verifyStandardWebhooksSignature, F as GenerateDownloadTokenOptions, I as VerifyDownloadTokenOptions, L as VerifyDownloadTokenResult, M as VerifyOptions, N as signWebhookPayload, O as LEGACY_SIGNATURE_HEADER, P as verifyWebhookSignature, R as generateDownloadToken, S as STANDARD_WEBHOOK_TIMESTAMP_HEADER, T as signStandardWebhooksPayload, V as validateEmailReceivedEvent, _ as WEBHOOK_VERSION, a as WebhookHeaders, b as STANDARD_WEBHOOK_ID_HEADER, c as getDownloadTimeRemaining, d as handleWebhookEvent, f as isDownloadExpired, g as verifyRawEmailDownload, h as receive, i as WEBHOOK_EVENT_HEADER, j as SignResult, k as PRIMITIVE_CONFIRMED_HEADER, l as getEventHeader, m as parseWebhookEvent, n as HandleWebhookOptions, o as confirmedHeaders, p as isRawIncluded, r as ReceiveRequestOptions, s as decodeRawEmail, t as DecodeRawEmailOptions, u as handleWebhook, v as validateEmailAuth, w as StandardWebhooksVerifyOptions, x as STANDARD_WEBHOOK_SIGNATURE_HEADER, y as emailReceivedEventJsonSchema, z as verifyDownloadToken } from "../index-D2nlv8DS.js";
4
- export { AuthConfidence, AuthVerdict, BounceAnalysis, DecodeRawEmailOptions, DkimResult, DkimSignature, DmarcPolicy, DmarcReportAnalysis, DmarcResult, EMAIL_EVENT_TYPES, EmailAddress, EmailAnalysis, EmailAuth, EmailReceivedEvent, EventType, ForwardAnalysis, ForwardOriginalSender, ForwardResult, ForwardResultAttachmentAnalyzed, ForwardResultAttachmentSkipped, ForwardResultInline, ForwardVerdict, ForwardVerification, GenerateDownloadTokenOptions, HandleWebhookOptions, INTERACTION_EVENT_TYPES, InteractionEvent, InteractionX402Event, InteractionX402Suffix, KnownWebhookEvent, LEGACY_CONFIRMED_HEADER, LEGACY_SIGNATURE_HEADER, PAYLOAD_ERRORS, PAYMENT_EVENT_TYPES, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedData, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedStatus, PaymentEvent, PaymentFailedEvent, PaymentSettledEvent, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawContent, RawContentDownloadOnly, RawContentInline, RawEmailDecodeError, RawEmailDecodeErrorCode, ReceiveRequestOptions, ReceivedEmail, ReceivedEmailAddress, ReceivedEmailThread, RoutingDecision, STANDARD_WEBHOOK_ID_HEADER, STANDARD_WEBHOOK_SIGNATURE_HEADER, STANDARD_WEBHOOK_TIMESTAMP_HEADER, SignResult, SpfResult, StandardWebhooksSignResult, StandardWebhooksVerifyOptions, TlsReportAnalysis, UnknownEvent, VERIFICATION_ERRORS, ValidateEmailAuthResult, VerifyDownloadTokenOptions, VerifyDownloadTokenResult, VerifyOptions, WEBHOOK_EVENT_HEADER, WEBHOOK_EVENT_TYPES, WEBHOOK_VERSION, WebhookAttachment, WebhookErrorCode, WebhookEvent, WebhookEventType, WebhookHeaders, WebhookPayloadError, WebhookPayloadErrorCode, WebhookValidationError, WebhookValidationErrorCode, WebhookVerificationError, WebhookVerificationErrorCode, buildForwardSubject, buildReplySubject, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, formatAddress, generateDownloadToken, getDownloadTimeRemaining, getEventHeader, handleWebhook, handleWebhookEvent, isDownloadExpired, isEmailReceivedEvent, isInteractionX402Event, isKnownWebhookEventType, isPaymentEvent, isPaymentFailedEvent, isPaymentSettledEvent, isRawIncluded, normalizeReceivedEmail, parseHeaderAddress, parseWebhookEvent, receive, safeValidateEmailReceivedEvent, signStandardWebhooksPayload, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyDownloadToken, verifyRawEmailDownload, verifyStandardWebhooksSignature, verifyWebhookSignature };
2
+ import { C as buildReplySubject, E as parseHeaderAddress, S as buildForwardSubject, T as normalizeReceivedEmail, _ as isTrustedSender, a as RawEmailDecodeErrorCode, b as ReceivedEmailAddress, c as WebhookPayloadError, d as WebhookValidationErrorCode, f as WebhookVerificationError, g as TrustedSenderResult, h as TrustedSenderOptions, i as RawEmailDecodeError, l as WebhookPayloadErrorCode, m as TrustReason, n as PrimitiveWebhookError, o as VERIFICATION_ERRORS, p as WebhookVerificationErrorCode, r as RAW_EMAIL_ERRORS, s as WebhookErrorCode, t as PAYLOAD_ERRORS, u as WebhookValidationError, v as validateEmailAuth, w as formatAddress, x as ReceivedEmailThread, y as ReceivedEmail } from "../errors-DAHv2kWU.js";
3
+ import { A as SignResult, B as validateEmailReceivedEvent, C as StandardWebhooksVerifyOptions, D as LEGACY_SIGNATURE_HEADER, E as LEGACY_CONFIRMED_HEADER, F as VerifyDownloadTokenOptions, I as VerifyDownloadTokenResult, L as generateDownloadToken, M as signWebhookPayload, N as verifyWebhookSignature, O as PRIMITIVE_CONFIRMED_HEADER, P as GenerateDownloadTokenOptions, R as verifyDownloadToken, S as StandardWebhooksSignResult, T as verifyStandardWebhooksSignature, _ as WEBHOOK_VERSION, a as WebhookHeaders, b as STANDARD_WEBHOOK_SIGNATURE_HEADER, c as getDownloadTimeRemaining, d as handleWebhookEvent, f as isDownloadExpired, g as verifyRawEmailDownload, h as receive, i as WEBHOOK_EVENT_HEADER, j as VerifyOptions, k as PRIMITIVE_SIGNATURE_HEADER, l as getEventHeader, m as parseWebhookEvent, n as HandleWebhookOptions, o as confirmedHeaders, p as isRawIncluded, r as ReceiveRequestOptions, s as decodeRawEmail, t as DecodeRawEmailOptions, u as handleWebhook, v as emailReceivedEventJsonSchema, w as signStandardWebhooksPayload, x as STANDARD_WEBHOOK_TIMESTAMP_HEADER, y as STANDARD_WEBHOOK_ID_HEADER, z as safeValidateEmailReceivedEvent } from "../index-DJeUuGUn.js";
4
+ export { AuthConfidence, AuthVerdict, BounceAnalysis, DecodeRawEmailOptions, DkimResult, DkimSignature, DmarcPolicy, DmarcReportAnalysis, DmarcResult, EMAIL_EVENT_TYPES, EmailAddress, EmailAnalysis, EmailAuth, EmailReceivedEvent, EventType, ForwardAnalysis, ForwardOriginalSender, ForwardResult, ForwardResultAttachmentAnalyzed, ForwardResultAttachmentSkipped, ForwardResultInline, ForwardVerdict, ForwardVerification, GenerateDownloadTokenOptions, HandleWebhookOptions, INTERACTION_EVENT_TYPES, InteractionEvent, InteractionX402Event, InteractionX402Suffix, KnownWebhookEvent, LEGACY_CONFIRMED_HEADER, LEGACY_SIGNATURE_HEADER, PAYLOAD_ERRORS, PAYMENT_EVENT_TYPES, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedData, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedStatus, PaymentEvent, PaymentFailedEvent, PaymentSettledEvent, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawContent, RawContentDownloadOnly, RawContentInline, RawEmailDecodeError, RawEmailDecodeErrorCode, ReceiveRequestOptions, ReceivedEmail, ReceivedEmailAddress, ReceivedEmailThread, RoutingDecision, STANDARD_WEBHOOK_ID_HEADER, STANDARD_WEBHOOK_SIGNATURE_HEADER, STANDARD_WEBHOOK_TIMESTAMP_HEADER, SignResult, SpfResult, StandardWebhooksSignResult, StandardWebhooksVerifyOptions, TlsReportAnalysis, TrustReason, TrustedSenderOptions, TrustedSenderResult, UnknownEvent, VERIFICATION_ERRORS, ValidateEmailAuthResult, VerifyDownloadTokenOptions, VerifyDownloadTokenResult, VerifyOptions, WEBHOOK_EVENT_HEADER, WEBHOOK_EVENT_TYPES, WEBHOOK_VERSION, WebhookAttachment, WebhookErrorCode, WebhookEvent, WebhookEventType, WebhookHeaders, WebhookPayloadError, WebhookPayloadErrorCode, WebhookValidationError, WebhookValidationErrorCode, WebhookVerificationError, WebhookVerificationErrorCode, buildForwardSubject, buildReplySubject, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, formatAddress, generateDownloadToken, getDownloadTimeRemaining, getEventHeader, handleWebhook, handleWebhookEvent, isDownloadExpired, isEmailReceivedEvent, isInteractionX402Event, isKnownWebhookEventType, isPaymentEvent, isPaymentFailedEvent, isPaymentSettledEvent, isRawIncluded, isTrustedSender, normalizeReceivedEmail, parseHeaderAddress, parseWebhookEvent, receive, safeValidateEmailReceivedEvent, signStandardWebhooksPayload, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyDownloadToken, verifyRawEmailDownload, verifyStandardWebhooksSignature, verifyWebhookSignature };
@@ -1,3 +1,3 @@
1
- import { a as VERIFICATION_ERRORS, c as WebhookVerificationError, d as formatAddress, f as normalizeReceivedEmail, i as RawEmailDecodeError, l as buildForwardSubject, n as PrimitiveWebhookError, o as WebhookPayloadError, p as parseHeaderAddress, r as RAW_EMAIL_ERRORS, s as WebhookValidationError, t as PAYLOAD_ERRORS, u as buildReplySubject } from "../errors-BPJGp9I6.js";
2
- import { A as LEGACY_CONFIRMED_HEADER, B as isEmailReceivedEvent, C as SpfResult, D as STANDARD_WEBHOOK_TIMESTAMP_HEADER, E as STANDARD_WEBHOOK_SIGNATURE_HEADER, F as verifyWebhookSignature, G as isPaymentSettledEvent, H as isKnownWebhookEventType, I as EMAIL_EVENT_TYPES, J as safeValidateEmailReceivedEvent, K as generateDownloadToken, L as INTERACTION_EVENT_TYPES, M as PRIMITIVE_CONFIRMED_HEADER, N as PRIMITIVE_SIGNATURE_HEADER, O as signStandardWebhooksPayload, P as signWebhookPayload, R as PAYMENT_EVENT_TYPES, S as ParsedStatus, T as STANDARD_WEBHOOK_ID_HEADER, U as isPaymentEvent, V as isInteractionX402Event, W as isPaymentFailedEvent, Y as validateEmailReceivedEvent, _ as DkimResult, a as getEventHeader, b as EventType, c as isDownloadExpired, d as receive, f as verifyRawEmailDownload, g as AuthVerdict, h as AuthConfidence, i as getDownloadTimeRemaining, j as LEGACY_SIGNATURE_HEADER, k as verifyStandardWebhooksSignature, l as isRawIncluded, m as validateEmailAuth, n as confirmedHeaders, o as handleWebhook, p as WEBHOOK_VERSION, q as verifyDownloadToken, r as decodeRawEmail, s as handleWebhookEvent, t as WEBHOOK_EVENT_HEADER, u as parseWebhookEvent, v as DmarcPolicy, w as emailReceivedEventJsonSchema, x as ForwardVerdict, y as DmarcResult, z as WEBHOOK_EVENT_TYPES } from "../webhook-BekIm0Uf.js";
3
- export { AuthConfidence, AuthVerdict, DkimResult, DmarcPolicy, DmarcResult, EMAIL_EVENT_TYPES, EventType, ForwardVerdict, INTERACTION_EVENT_TYPES, LEGACY_CONFIRMED_HEADER, LEGACY_SIGNATURE_HEADER, PAYLOAD_ERRORS, PAYMENT_EVENT_TYPES, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedStatus, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawEmailDecodeError, STANDARD_WEBHOOK_ID_HEADER, STANDARD_WEBHOOK_SIGNATURE_HEADER, STANDARD_WEBHOOK_TIMESTAMP_HEADER, SpfResult, VERIFICATION_ERRORS, WEBHOOK_EVENT_HEADER, WEBHOOK_EVENT_TYPES, WEBHOOK_VERSION, WebhookPayloadError, WebhookValidationError, WebhookVerificationError, buildForwardSubject, buildReplySubject, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, formatAddress, generateDownloadToken, getDownloadTimeRemaining, getEventHeader, handleWebhook, handleWebhookEvent, isDownloadExpired, isEmailReceivedEvent, isInteractionX402Event, isKnownWebhookEventType, isPaymentEvent, isPaymentFailedEvent, isPaymentSettledEvent, isRawIncluded, normalizeReceivedEmail, parseHeaderAddress, parseWebhookEvent, receive, safeValidateEmailReceivedEvent, signStandardWebhooksPayload, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyDownloadToken, verifyRawEmailDownload, verifyStandardWebhooksSignature, verifyWebhookSignature };
1
+ import { C as normalizeReceivedEmail, S as formatAddress, _ as ForwardVerdict, a as VERIFICATION_ERRORS, b as buildForwardSubject, c as WebhookVerificationError, d as AuthConfidence, f as AuthVerdict, g as EventType, h as DmarcResult, i as RawEmailDecodeError, l as isTrustedSender, m as DmarcPolicy, n as PrimitiveWebhookError, o as WebhookPayloadError, p as DkimResult, r as RAW_EMAIL_ERRORS, s as WebhookValidationError, t as PAYLOAD_ERRORS, u as validateEmailAuth, v as ParsedStatus, w as parseHeaderAddress, x as buildReplySubject, y as SpfResult } from "../errors-D6WjisrD.js";
2
+ import { A as isEmailReceivedEvent, C as PRIMITIVE_SIGNATURE_HEADER, D as INTERACTION_EVENT_TYPES, E as EMAIL_EVENT_TYPES, F as isPaymentSettledEvent, I as generateDownloadToken, L as verifyDownloadToken, M as isKnownWebhookEventType, N as isPaymentEvent, O as PAYMENT_EVENT_TYPES, P as isPaymentFailedEvent, R as safeValidateEmailReceivedEvent, S as PRIMITIVE_CONFIRMED_HEADER, T as verifyWebhookSignature, _ as STANDARD_WEBHOOK_TIMESTAMP_HEADER, a as getEventHeader, b as LEGACY_CONFIRMED_HEADER, c as isDownloadExpired, d as receive, f as verifyRawEmailDownload, g as STANDARD_WEBHOOK_SIGNATURE_HEADER, h as STANDARD_WEBHOOK_ID_HEADER, i as getDownloadTimeRemaining, j as isInteractionX402Event, k as WEBHOOK_EVENT_TYPES, l as isRawIncluded, m as emailReceivedEventJsonSchema, n as confirmedHeaders, o as handleWebhook, p as WEBHOOK_VERSION, r as decodeRawEmail, s as handleWebhookEvent, t as WEBHOOK_EVENT_HEADER, u as parseWebhookEvent, v as signStandardWebhooksPayload, w as signWebhookPayload, x as LEGACY_SIGNATURE_HEADER, y as verifyStandardWebhooksSignature, z as validateEmailReceivedEvent } from "../webhook-1cz088XC.js";
3
+ export { AuthConfidence, AuthVerdict, DkimResult, DmarcPolicy, DmarcResult, EMAIL_EVENT_TYPES, EventType, ForwardVerdict, INTERACTION_EVENT_TYPES, LEGACY_CONFIRMED_HEADER, LEGACY_SIGNATURE_HEADER, PAYLOAD_ERRORS, PAYMENT_EVENT_TYPES, PRIMITIVE_CONFIRMED_HEADER, PRIMITIVE_SIGNATURE_HEADER, ParsedStatus, PrimitiveWebhookError, RAW_EMAIL_ERRORS, RawEmailDecodeError, STANDARD_WEBHOOK_ID_HEADER, STANDARD_WEBHOOK_SIGNATURE_HEADER, STANDARD_WEBHOOK_TIMESTAMP_HEADER, SpfResult, VERIFICATION_ERRORS, WEBHOOK_EVENT_HEADER, WEBHOOK_EVENT_TYPES, WEBHOOK_VERSION, WebhookPayloadError, WebhookValidationError, WebhookVerificationError, buildForwardSubject, buildReplySubject, confirmedHeaders, decodeRawEmail, emailReceivedEventJsonSchema, formatAddress, generateDownloadToken, getDownloadTimeRemaining, getEventHeader, handleWebhook, handleWebhookEvent, isDownloadExpired, isEmailReceivedEvent, isInteractionX402Event, isKnownWebhookEventType, isPaymentEvent, isPaymentFailedEvent, isPaymentSettledEvent, isRawIncluded, isTrustedSender, normalizeReceivedEmail, parseHeaderAddress, parseWebhookEvent, receive, safeValidateEmailReceivedEvent, signStandardWebhooksPayload, signWebhookPayload, validateEmailAuth, validateEmailReceivedEvent, verifyDownloadToken, verifyRawEmailDownload, verifyStandardWebhooksSignature, verifyWebhookSignature };