@primitivedotdev/sdk 0.25.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.
- package/dist/api/index.d.ts +3 -2
- package/dist/api/index.js +6 -0
- package/dist/api/verify-signature.js +198 -0
- package/dist/{api-C3X14uId.js → api-CoP5vKPK.js} +141 -2
- package/dist/contract/index.d.ts +1 -1
- package/dist/contract/index.js +1 -1
- package/dist/errors-C53fe686.d.ts +245 -0
- package/dist/errors-x91I_yEt.js +287 -0
- package/dist/{index-CDlwyxdp.d.ts → index-Dbx9udpX.d.ts} +2 -210
- package/dist/{index-jLAAV6Sq.d.ts → index-DdITDPea.d.ts} +82 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/webhook/errors.js +224 -0
- package/dist/webhook/index.d.ts +2 -2
- package/dist/webhook/index.js +2 -2
- package/dist/{webhook-rUjGV6Zu.js → webhook-DJkfUnFZ.js} +2 -220
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/dist/received-email-D6tKtWwW.js +0 -69
- package/dist/received-email-DNjpq_Wt.d.ts +0 -37
package/dist/api/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { f as WebhookVerificationError, p as WebhookVerificationErrorCode } from "../errors-C53fe686.js";
|
|
2
|
+
import { $ as pollCliLogin, $a as StorageStats, $i as ReplayDeliveryError, $n as DownloadRawEmailErrors, $o as Config, $r as GetWebhookSecretError, $t as CreateFunctionSecretData, A as deleteEmail, Aa as SendMailInput, Ai as ListFunctionSecretsData, An as DeleteFunctionResponses, Ao as UpdateEndpointResponse, Ar as GetEmailResponse, At as CliLogoutResponse, B as getFunction, Ba as SentEmailSummary, Bi as ListSentEmailsData, Bn as DiscardEmailContentError, Bo as UpdateFunctionErrors, Br as GetSendPermissionsResponse, Bt as CreateFilterData, C as addDomain, Ca as SearchEmailsResponse, Ci as ListEndpointsResponses, Cn as DeleteFilterErrors, Co as UpdateDomainInput, Cr as GetAccountError, Ct as AddDomainResponses, D as createFunction, Da as SendEmailErrors, Di as ListFiltersErrors, Dn as DeleteFunctionError, Do as UpdateEndpointError, Dr as GetEmailData, Dt as CliLogoutError, E as createFilter, Ea as SendEmailError, Ei as ListFiltersError, En as DeleteFunctionData, Eo as UpdateEndpointData, Er as GetAccountResponses, Et as CliLogoutData, F as discardEmailContent, Fa as SendPermissionRule, Fi as ListFunctionsData, Fn as DeleteFunctionSecretResponses, Fo as UpdateFilterInput, Fr as GetFunctionResponse, Ft as CreateEndpointError, G as listDeliveries, Ga as SetFunctionSecretResponse, Gi as PaginationMeta, Gn as DomainVerifyResult, Go as VerifyDomainData, Gr as GetSentEmailResponse, Gt as CreateFilterResponses, H as getSentEmail, Ha as SetFunctionSecretError, Hi as ListSentEmailsErrors, Hn as DiscardEmailContentResponse, Ho as UpdateFunctionResponse, Hr as GetSentEmailData, Ht as CreateFilterErrors, I as downloadAttachments, Ia as SendPermissionYourDomain, Ii as ListFunctionsError, In as DeliveryStatus, Io as UpdateFilterResponse, Ir as GetFunctionResponses, It as CreateEndpointErrors, J as listEndpoints, Ja as StartCliLoginError, Ji as PollCliLoginErrors, Jn as DownloadAttachmentsErrors, Jo as VerifyDomainResponse, Jr as GetStorageStatsError, Jt as CreateFunctionErrors, K as listDomains, Ka as SetFunctionSecretResponses, Ki as PollCliLoginData, Kn as DownloadAttachmentsData, Ko as VerifyDomainError, Kr as GetSentEmailResponses, Kt as CreateFunctionData, L as downloadRawEmail, La as SendPermissionsMeta, Li as ListFunctionsErrors, Ln as DeliverySummary, Lo as UpdateFilterResponses, Lr as GetSendPermissionsData, Lt as CreateEndpointInput, M as deleteFilter, Ma as SendPermissionAddress, Mi as ListFunctionSecretsErrors, Mn as DeleteFunctionSecretError, Mo as UpdateFilterData, Mr as GetFunctionData, Mt as CliLogoutResult, N as deleteFunction, Na as SendPermissionAnyRecipient, Ni as ListFunctionSecretsResponse, Nn as DeleteFunctionSecretErrors, No as UpdateFilterError, Nr as GetFunctionError, Nt as ClientOptions, O as createFunctionSecret, Oa as SendEmailResponse, Oi as ListFiltersResponse, On as DeleteFunctionErrors, Oo as UpdateEndpointErrors, Or as GetEmailError, Ot as CliLogoutErrors, P as deleteFunctionSecret, Pa as SendPermissionManagedZone, Pi as ListFunctionSecretsResponses, Pn as DeleteFunctionSecretResponse, Po as UpdateFilterErrors, Pr as GetFunctionErrors, Pt as CreateEndpointData, Q as listSentEmails, Qa as StartCliLoginResponses, Qi as ReplayDeliveryData, Qn as DownloadRawEmailError, Qo as ClientOptions$1, Qr as GetWebhookSecretData, Qt as CreateFunctionResult, R as getAccount, Ra as SentEmailDetail, Ri as ListFunctionsResponse, Rn as DiscardContentResult, Ro as UpdateFunctionData, Rr as GetSendPermissionsError, Rt as CreateEndpointResponse, S as Options, Sa as SearchEmailsErrors, Si as ListEndpointsResponse, Sn as DeleteFilterError, So as UpdateDomainErrors, Sr as GetAccountData, St as AddDomainResponse, T as createEndpoint, Ta as SendEmailData, Ti as ListFiltersData, Tn as DeleteFilterResponses, To as UpdateDomainResponses, Tr as GetAccountResponse, Tt as CliLoginStartResult, U as getStorageStats, Ua as SetFunctionSecretErrors, Ui as ListSentEmailsResponse, Un as DiscardEmailContentResponses, Uo as UpdateFunctionResponses, Ur as GetSentEmailError, Ut as CreateFilterInput, V as getSendPermissions, Va as SetFunctionSecretData, Vi as ListSentEmailsError, Vn as DiscardEmailContentErrors, Vo as UpdateFunctionInput, Vr as GetSendPermissionsResponses, Vt as CreateFilterError, W as getWebhookSecret, Wa as SetFunctionSecretInput, Wi as ListSentEmailsResponses, Wn as Domain, Wo as VerifiedDomain, Wr as GetSentEmailErrors, Wt as CreateFilterResponse, X as listFunctionSecrets, Xa as StartCliLoginInput, Xi as PollCliLoginResponse, Xn as DownloadAttachmentsResponses, Xo as WebhookSecret, Xr as GetStorageStatsResponse, Xt as CreateFunctionResponse, Y as listFilters, Ya as StartCliLoginErrors, Yi as PollCliLoginInput, Yn as DownloadAttachmentsResponse, Yo as VerifyDomainResponses, Yr as GetStorageStatsErrors, Yt as CreateFunctionInput, Z as listFunctions, Za as StartCliLoginResponse, Zi as PollCliLoginResponses, Zn as DownloadRawEmailData, Zo as Client, Zr as GetStorageStatsResponses, Zt as CreateFunctionResponses, _ as createPrimitiveClient, _a as RotateWebhookSecretErrors, _i as ListEmailsResponse, _n as DeleteEndpointError, _o as UpdateAccountInput, _r as FunctionListItem, _t as AccountUpdated, a as PrimitiveApiClientOptions, aa as ReplayEmailWebhooksErrors, ai as ListDeliveriesError, an as Cursor, ao as TestEndpointResponses, ar as EmailSearchFacets, as as Auth, at as sendEmail, b as VerifyOptions, ba as SearchEmailsData, bi as ListEndpointsError, bn as DeleteEndpointResponses, bo as UpdateDomainData, br as GateDenial, bt as AddDomainErrors, c as PrimitiveClient, ca as ReplayResult, ci as ListDeliveriesResponses, cn as DeleteDomainErrors, co as TestFunctionErrors, cr as EmailSearchResult, ct as testEndpoint, d as RequestOptions$1, da as ReplyToEmailErrors, di as ListDomainsErrors, dn as DeleteEmailData, do as TestInvocationResult, dr as EmailWebhookStatus, dt as updateDomain, ea as ReplayDeliveryErrors, ei as GetWebhookSecretErrors, en as CreateFunctionSecretError, eo as SuccessEnvelope, er as DownloadRawEmailResponse, es as CreateClientConfig, et as replayDelivery, f as SendInput, fa as ReplyToEmailResponse, fi as ListDomainsResponse, fn as DeleteEmailError, fo as TestResult, fr as Endpoint, ft as updateEndpoint, g as createPrimitiveApiClient, ga as RotateWebhookSecretError, gi as ListEmailsErrors, gn as DeleteEndpointData, go as UpdateAccountErrors, gr as FunctionDetail, gt as Account, h as client, ha as RotateWebhookSecretData, hi as ListEmailsError, hn as DeleteEmailResponses, ho as UpdateAccountError, hr as FunctionDeployStatus, ht as verifyDomain, i as PrimitiveApiClient, ia as ReplayEmailWebhooksError, ii as ListDeliveriesData, in as CreateFunctionSecretResponses, io as TestEndpointResponse, ir as EmailSearchFacetBucket, is as ResponseStyle, it as searchEmails, j as deleteEndpoint, ja as SendMailResult, ji as ListFunctionSecretsError, jn as DeleteFunctionSecretData, jo as UpdateEndpointResponses, jr as GetEmailResponses, jt as CliLogoutResponses, k as deleteDomain, ka as SendEmailResponses, ki as ListFiltersResponses, kn as DeleteFunctionResponse, ko as UpdateEndpointInput, kr as GetEmailErrors, kt as CliLogoutInput, l as PrimitiveClientOptions, la as ReplyToEmailData, li as ListDomainsData, ln as DeleteDomainResponse, lo as TestFunctionResponse, lr as EmailStatus, lt as testFunction, m as SendThreadInput, ma as ResourceId, mi as ListEmailsData, mn as DeleteEmailResponse, mo as UpdateAccountData, mr as Filter, mt as updateFunction, n as DEFAULT_API_BASE_URL_2, na as ReplayDeliveryResponses, ni as GetWebhookSecretResponses, nn as CreateFunctionSecretInput, no as TestEndpointError, nr as EmailDetail, ns as RequestOptions, nt as replyToEmail, o as PrimitiveApiError, oa as ReplayEmailWebhooksResponse, oi as ListDeliveriesErrors, on as DeleteDomainData, oo as TestFunctionData, or as EmailSearchHighlights, ot as setFunctionSecret, p as SendResult, pa as ReplyToEmailResponses, pi as ListDomainsResponses, pn as DeleteEmailErrors, po as UnverifiedDomain, pr as ErrorResponse, pt as updateFilter, q as listEmails, qa as StartCliLoginData, qi as PollCliLoginError, qn as DownloadAttachmentsError, qo as VerifyDomainErrors, qr as GetStorageStatsData, qt as CreateFunctionError, r as ForwardInput, ra as ReplayEmailWebhooksData, ri as Limit, rn as CreateFunctionSecretResponse, ro as TestEndpointErrors, rr as EmailDetailReply, rs as RequestResult, rt as rotateWebhookSecret, s as PrimitiveApiErrorDetails, sa as ReplayEmailWebhooksResponses, si as ListDeliveriesResponse, sn as DeleteDomainError, so as TestFunctionError, sr as EmailSearchMeta, st as startCliLogin, t as DEFAULT_API_BASE_URL_1, ta as ReplayDeliveryResponse, ti as GetWebhookSecretResponse, tn as CreateFunctionSecretErrors, to as TestEndpointData, tr as DownloadRawEmailResponses, ts as Options$1, tt as replayEmailWebhooks, u as ReplyInput, ua as ReplyToEmailError, ui as ListDomainsError, un as DeleteDomainResponses, uo as TestFunctionResponses, ur as EmailSummary, ut as updateAccount, v as operations, va as RotateWebhookSecretResponse, vi as ListEmailsResponses, vn as DeleteEndpointErrors, vo as UpdateAccountResponse, vr as FunctionSecretListItem, vt as AddDomainData, w as cliLogout, wa as SearchEmailsResponses, wi as ListEnvelope, wn as DeleteFilterResponse, wo as UpdateDomainResponse, wr as GetAccountErrors, wt as CliLoginPollResult, x as verifyWebhookSignature, xa as SearchEmailsError, xi as ListEndpointsErrors, xn as DeleteFilterData, xo as UpdateDomainError, xr as GateFix, xt as AddDomainInput, y as PRIMITIVE_SIGNATURE_HEADER, ya as RotateWebhookSecretResponses, yi as ListEndpointsData, yn as DeleteEndpointResponse, yo as UpdateAccountResponses, yr as FunctionSecretWriteResult, yt as AddDomainError, z as getEmail, za as SentEmailStatus, zi as ListFunctionsResponses, zn as DiscardEmailContentData, zo as UpdateFunctionError, zr as GetSendPermissionsErrors, zt as CreateEndpointResponses } from "../index-DdITDPea.js";
|
|
3
|
+
export { Account, AccountUpdated, AddDomainData, AddDomainError, AddDomainErrors, AddDomainInput, AddDomainResponse, AddDomainResponses, Auth, CliLoginPollResult, CliLoginStartResult, CliLogoutData, CliLogoutError, CliLogoutErrors, CliLogoutInput, CliLogoutResponse, CliLogoutResponses, CliLogoutResult, ClientOptions, CreateClientConfig, CreateEndpointData, CreateEndpointError, CreateEndpointErrors, CreateEndpointInput, CreateEndpointResponse, CreateEndpointResponses, CreateFilterData, CreateFilterError, CreateFilterErrors, CreateFilterInput, CreateFilterResponse, CreateFilterResponses, CreateFunctionData, CreateFunctionError, CreateFunctionErrors, CreateFunctionInput, CreateFunctionResponse, CreateFunctionResponses, CreateFunctionResult, CreateFunctionSecretData, CreateFunctionSecretError, CreateFunctionSecretErrors, CreateFunctionSecretInput, CreateFunctionSecretResponse, CreateFunctionSecretResponses, Cursor, DEFAULT_API_BASE_URL_1, DEFAULT_API_BASE_URL_2, DeleteDomainData, DeleteDomainError, DeleteDomainErrors, DeleteDomainResponse, DeleteDomainResponses, DeleteEmailData, DeleteEmailError, DeleteEmailErrors, DeleteEmailResponse, DeleteEmailResponses, DeleteEndpointData, DeleteEndpointError, DeleteEndpointErrors, DeleteEndpointResponse, DeleteEndpointResponses, DeleteFilterData, DeleteFilterError, DeleteFilterErrors, DeleteFilterResponse, DeleteFilterResponses, DeleteFunctionData, DeleteFunctionError, DeleteFunctionErrors, DeleteFunctionResponse, DeleteFunctionResponses, DeleteFunctionSecretData, DeleteFunctionSecretError, DeleteFunctionSecretErrors, DeleteFunctionSecretResponse, DeleteFunctionSecretResponses, DeliveryStatus, DeliverySummary, DiscardContentResult, DiscardEmailContentData, DiscardEmailContentError, DiscardEmailContentErrors, DiscardEmailContentResponse, DiscardEmailContentResponses, Domain, DomainVerifyResult, DownloadAttachmentsData, DownloadAttachmentsError, DownloadAttachmentsErrors, DownloadAttachmentsResponse, DownloadAttachmentsResponses, DownloadRawEmailData, DownloadRawEmailError, DownloadRawEmailErrors, DownloadRawEmailResponse, DownloadRawEmailResponses, EmailDetail, EmailDetailReply, EmailSearchFacetBucket, EmailSearchFacets, EmailSearchHighlights, EmailSearchMeta, EmailSearchResult, EmailStatus, EmailSummary, EmailWebhookStatus, Endpoint, ErrorResponse, Filter, ForwardInput, FunctionDeployStatus, FunctionDetail, FunctionListItem, FunctionSecretListItem, FunctionSecretWriteResult, GateDenial, GateFix, GetAccountData, GetAccountError, GetAccountErrors, GetAccountResponse, GetAccountResponses, GetEmailData, GetEmailError, GetEmailErrors, GetEmailResponse, GetEmailResponses, GetFunctionData, GetFunctionError, GetFunctionErrors, GetFunctionResponse, GetFunctionResponses, GetSendPermissionsData, GetSendPermissionsError, GetSendPermissionsErrors, GetSendPermissionsResponse, GetSendPermissionsResponses, GetSentEmailData, GetSentEmailError, GetSentEmailErrors, GetSentEmailResponse, GetSentEmailResponses, GetStorageStatsData, GetStorageStatsError, GetStorageStatsErrors, GetStorageStatsResponse, GetStorageStatsResponses, GetWebhookSecretData, GetWebhookSecretError, GetWebhookSecretErrors, GetWebhookSecretResponse, GetWebhookSecretResponses, Limit, ListDeliveriesData, ListDeliveriesError, ListDeliveriesErrors, ListDeliveriesResponse, ListDeliveriesResponses, ListDomainsData, ListDomainsError, ListDomainsErrors, ListDomainsResponse, ListDomainsResponses, ListEmailsData, ListEmailsError, ListEmailsErrors, ListEmailsResponse, ListEmailsResponses, ListEndpointsData, ListEndpointsError, ListEndpointsErrors, ListEndpointsResponse, ListEndpointsResponses, ListEnvelope, ListFiltersData, ListFiltersError, ListFiltersErrors, ListFiltersResponse, ListFiltersResponses, ListFunctionSecretsData, ListFunctionSecretsError, ListFunctionSecretsErrors, ListFunctionSecretsResponse, ListFunctionSecretsResponses, ListFunctionsData, ListFunctionsError, ListFunctionsErrors, ListFunctionsResponse, ListFunctionsResponses, ListSentEmailsData, ListSentEmailsError, ListSentEmailsErrors, ListSentEmailsResponse, ListSentEmailsResponses, Options, PRIMITIVE_SIGNATURE_HEADER, PaginationMeta, PollCliLoginData, PollCliLoginError, PollCliLoginErrors, PollCliLoginInput, PollCliLoginResponse, PollCliLoginResponses, PrimitiveApiClient, PrimitiveApiClientOptions, PrimitiveApiError, PrimitiveApiErrorDetails, PrimitiveClient, PrimitiveClientOptions, Client as PrimitiveGeneratedApiClient, ClientOptions$1 as PrimitiveGeneratedApiClientOptions, Config as PrimitiveGeneratedApiConfig, Options$1 as PrimitiveGeneratedApiOptions, RequestOptions as PrimitiveGeneratedApiRequestOptions, RequestResult as PrimitiveGeneratedApiRequestResult, ReplayDeliveryData, ReplayDeliveryError, ReplayDeliveryErrors, ReplayDeliveryResponse, ReplayDeliveryResponses, ReplayEmailWebhooksData, ReplayEmailWebhooksError, ReplayEmailWebhooksErrors, ReplayEmailWebhooksResponse, ReplayEmailWebhooksResponses, ReplayResult, ReplyInput, ReplyToEmailData, ReplyToEmailError, ReplyToEmailErrors, ReplyToEmailResponse, ReplyToEmailResponses, RequestOptions$1 as RequestOptions, ResourceId, ResponseStyle, RotateWebhookSecretData, RotateWebhookSecretError, RotateWebhookSecretErrors, RotateWebhookSecretResponse, RotateWebhookSecretResponses, SearchEmailsData, SearchEmailsError, SearchEmailsErrors, SearchEmailsResponse, SearchEmailsResponses, SendEmailData, SendEmailError, SendEmailErrors, SendEmailResponse, SendEmailResponses, SendInput, SendMailInput, SendMailResult, SendPermissionAddress, SendPermissionAnyRecipient, SendPermissionManagedZone, SendPermissionRule, SendPermissionYourDomain, SendPermissionsMeta, SendResult, SendThreadInput, SentEmailDetail, SentEmailStatus, SentEmailSummary, SetFunctionSecretData, SetFunctionSecretError, SetFunctionSecretErrors, SetFunctionSecretInput, SetFunctionSecretResponse, SetFunctionSecretResponses, StartCliLoginData, StartCliLoginError, StartCliLoginErrors, StartCliLoginInput, StartCliLoginResponse, StartCliLoginResponses, StorageStats, SuccessEnvelope, TestEndpointData, TestEndpointError, TestEndpointErrors, TestEndpointResponse, TestEndpointResponses, TestFunctionData, TestFunctionError, TestFunctionErrors, TestFunctionResponse, TestFunctionResponses, TestInvocationResult, TestResult, UnverifiedDomain, UpdateAccountData, UpdateAccountError, UpdateAccountErrors, UpdateAccountInput, UpdateAccountResponse, UpdateAccountResponses, UpdateDomainData, UpdateDomainError, UpdateDomainErrors, UpdateDomainInput, UpdateDomainResponse, UpdateDomainResponses, UpdateEndpointData, UpdateEndpointError, UpdateEndpointErrors, UpdateEndpointInput, UpdateEndpointResponse, UpdateEndpointResponses, UpdateFilterData, UpdateFilterError, UpdateFilterErrors, UpdateFilterInput, UpdateFilterResponse, UpdateFilterResponses, UpdateFunctionData, UpdateFunctionError, UpdateFunctionErrors, UpdateFunctionInput, UpdateFunctionResponse, UpdateFunctionResponses, VerifiedDomain, VerifyDomainData, VerifyDomainError, VerifyDomainErrors, VerifyDomainResponse, VerifyDomainResponses, VerifyOptions as VerifyWebhookSignatureOptions, WebhookSecret, WebhookVerificationError, WebhookVerificationErrorCode, addDomain, cliLogout, client, createEndpoint, createFilter, createFunction, createFunctionSecret, createPrimitiveApiClient, createPrimitiveClient, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, deleteFunction, deleteFunctionSecret, discardEmailContent, downloadAttachments, downloadRawEmail, getAccount, getEmail, getFunction, getSendPermissions, getSentEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, listFunctionSecrets, listFunctions, listSentEmails, operations, pollCliLogin, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, searchEmails, sendEmail, setFunctionSecret, startCliLogin, testEndpoint, testFunction, updateAccount, updateDomain, updateEndpoint, updateFilter, updateFunction, verifyDomain, verifyWebhookSignature };
|
package/dist/api/index.js
CHANGED
|
@@ -398,3 +398,9 @@ export function client(options = {}) {
|
|
|
398
398
|
}
|
|
399
399
|
export const operations = generatedOperations;
|
|
400
400
|
export * from "./generated/index.js";
|
|
401
|
+
// Web Crypto verifier for in-handler webhook verification. Mirrors
|
|
402
|
+
// the surface of `verifyWebhookSignature` from `@primitivedotdev/sdk`
|
|
403
|
+
// (the Node version) but implements HMAC-SHA256 with `crypto.subtle`
|
|
404
|
+
// so it can be bundled into a Primitive Function without pulling in
|
|
405
|
+
// a `node:crypto` polyfill.
|
|
406
|
+
export { PRIMITIVE_SIGNATURE_HEADER, verifyWebhookSignature, WebhookVerificationError, } from "./verify-signature.js";
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workers-safe webhook signature verification.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors `verifyWebhookSignature` from `@primitivedotdev/sdk` but
|
|
5
|
+
* implements the HMAC-SHA256 step with the Web Crypto API
|
|
6
|
+
* (`crypto.subtle`) instead of `node:crypto`. The Node version is
|
|
7
|
+
* still the right choice for server-side handlers running on Node
|
|
8
|
+
* (it's measurably faster and supports Buffer bodies); this one
|
|
9
|
+
* exists so a Primitive Function handler can bundle the verifier
|
|
10
|
+
* without dragging in a `node:crypto` polyfill that inflates the
|
|
11
|
+
* deploy artifact past the size cap.
|
|
12
|
+
*
|
|
13
|
+
* Available natively in Workers, Node 22+, browsers, Deno, and Bun.
|
|
14
|
+
* Zero polyfill weight, zero new runtime dependencies.
|
|
15
|
+
*
|
|
16
|
+
* Surface contract matches the Node verifier exactly: same input
|
|
17
|
+
* shape, same `WebhookVerificationError` class, same set of error
|
|
18
|
+
* codes. Existing callers can swap the import path with no other
|
|
19
|
+
* code changes:
|
|
20
|
+
*
|
|
21
|
+
* // Node (existing):
|
|
22
|
+
* import { verifyWebhookSignature } from '@primitivedotdev/sdk';
|
|
23
|
+
*
|
|
24
|
+
* // Workers / in-handler (this file):
|
|
25
|
+
* import { verifyWebhookSignature } from '@primitivedotdev/sdk/api';
|
|
26
|
+
*/
|
|
27
|
+
import { WebhookVerificationError } from "../webhook/errors.js";
|
|
28
|
+
// Header name carrying the timestamp + signature. Must match the
|
|
29
|
+
// constant of the same name in `../webhook/signing.ts`. Kept in two
|
|
30
|
+
// places intentionally so this file has no dependency on the Node
|
|
31
|
+
// signing module (which would drag `node:crypto` into the bundle).
|
|
32
|
+
export const PRIMITIVE_SIGNATURE_HEADER = "Primitive-Signature";
|
|
33
|
+
// Re-export so consumers can `import { verifyWebhookSignature,
|
|
34
|
+
// WebhookVerificationError } from '@primitivedotdev/sdk/api'`
|
|
35
|
+
// without a second import statement against `/webhook`.
|
|
36
|
+
export { WebhookVerificationError } from "../webhook/errors.js";
|
|
37
|
+
// 5 minute max-age tolerance matches `webhook/signing.ts`.
|
|
38
|
+
const DEFAULT_TOLERANCE_SECONDS = 5 * 60;
|
|
39
|
+
// 60 second future tolerance for clock skew.
|
|
40
|
+
const FUTURE_TOLERANCE_SECONDS = 60;
|
|
41
|
+
// HMAC-SHA256 hex digest is 64 characters. Accept either case to
|
|
42
|
+
// stay byte-for-byte compatible with the Node verifier in
|
|
43
|
+
// `../webhook/signing.ts`, which uses the same pattern with the `/i`
|
|
44
|
+
// flag. Canonical Primitive signers emit lowercase, but tolerating
|
|
45
|
+
// uppercase keeps third-party signers (and tests that hand-build
|
|
46
|
+
// fixtures) from silently failing through to SIGNATURE_MISMATCH.
|
|
47
|
+
const HEX_PATTERN = /^[0-9a-f]+$/i;
|
|
48
|
+
const HEX_LENGTH = 64;
|
|
49
|
+
const UNIX_SECONDS_PATTERN = /^\d{1,10}$/;
|
|
50
|
+
function parseSignatureHeader(signatureHeader) {
|
|
51
|
+
if (!signatureHeader || typeof signatureHeader !== "string") {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
const parts = signatureHeader.split(",");
|
|
55
|
+
let timestamp = null;
|
|
56
|
+
const signatures = [];
|
|
57
|
+
for (const part of parts) {
|
|
58
|
+
const idx = part.indexOf("=");
|
|
59
|
+
if (idx === -1)
|
|
60
|
+
continue;
|
|
61
|
+
const key = part.slice(0, idx).trim();
|
|
62
|
+
const value = part.slice(idx + 1).trim();
|
|
63
|
+
if (!key || !value)
|
|
64
|
+
continue;
|
|
65
|
+
if (key === "t") {
|
|
66
|
+
if (!UNIX_SECONDS_PATTERN.test(value))
|
|
67
|
+
continue;
|
|
68
|
+
const parsed = Number(value);
|
|
69
|
+
if (Number.isSafeInteger(parsed)) {
|
|
70
|
+
timestamp = parsed;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else if (key === "v1") {
|
|
74
|
+
signatures.push(value);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (timestamp === null || signatures.length === 0) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
return { timestamp, signatures };
|
|
81
|
+
}
|
|
82
|
+
function isValidHex(str) {
|
|
83
|
+
return str.length === HEX_LENGTH && HEX_PATTERN.test(str);
|
|
84
|
+
}
|
|
85
|
+
function arrayBufferToHex(buffer) {
|
|
86
|
+
const bytes = new Uint8Array(buffer);
|
|
87
|
+
let hex = "";
|
|
88
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
89
|
+
// biome-ignore lint/style/noNonNullAssertion: bytes[i] is always defined for valid index
|
|
90
|
+
hex += bytes[i].toString(16).padStart(2, "0");
|
|
91
|
+
}
|
|
92
|
+
return hex;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Constant-time comparison of two equal-length hex strings. Returns
|
|
96
|
+
* false if lengths differ (intentionally not a security issue: lengths
|
|
97
|
+
* are public). Iterates the full length regardless of mismatch so the
|
|
98
|
+
* timing signal does not reveal the position of the first divergence.
|
|
99
|
+
*/
|
|
100
|
+
function timingSafeEqualHex(a, b) {
|
|
101
|
+
if (a.length !== b.length)
|
|
102
|
+
return false;
|
|
103
|
+
let diff = 0;
|
|
104
|
+
for (let i = 0; i < a.length; i++) {
|
|
105
|
+
diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
|
|
106
|
+
}
|
|
107
|
+
return diff === 0;
|
|
108
|
+
}
|
|
109
|
+
async function computeHmacHex(secret, payload) {
|
|
110
|
+
const encoder = new TextEncoder();
|
|
111
|
+
const keyData = encoder.encode(secret);
|
|
112
|
+
const key = await crypto.subtle.importKey("raw", keyData, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
113
|
+
const signature = await crypto.subtle.sign("HMAC", key, encoder.encode(payload));
|
|
114
|
+
return arrayBufferToHex(signature);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Verify a webhook signature using the Web Crypto API.
|
|
118
|
+
*
|
|
119
|
+
* Throws `WebhookVerificationError` on failure with a specific error
|
|
120
|
+
* code matching the Node verifier's set. Returns `true` on success.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```typescript
|
|
124
|
+
* import {
|
|
125
|
+
* verifyWebhookSignature,
|
|
126
|
+
* WebhookVerificationError,
|
|
127
|
+
* PRIMITIVE_SIGNATURE_HEADER,
|
|
128
|
+
* } from '@primitivedotdev/sdk/api';
|
|
129
|
+
*
|
|
130
|
+
* export default {
|
|
131
|
+
* async fetch(request: Request, env: { PRIMITIVE_WEBHOOK_SECRET: string }) {
|
|
132
|
+
* const rawBody = await request.text();
|
|
133
|
+
* try {
|
|
134
|
+
* await verifyWebhookSignature({
|
|
135
|
+
* rawBody,
|
|
136
|
+
* signatureHeader: request.headers.get(PRIMITIVE_SIGNATURE_HEADER) ?? '',
|
|
137
|
+
* secret: env.PRIMITIVE_WEBHOOK_SECRET,
|
|
138
|
+
* });
|
|
139
|
+
* } catch (err) {
|
|
140
|
+
* if (err instanceof WebhookVerificationError) {
|
|
141
|
+
* return new Response('invalid signature', { status: 401 });
|
|
142
|
+
* }
|
|
143
|
+
* throw err;
|
|
144
|
+
* }
|
|
145
|
+
* // ... process the webhook
|
|
146
|
+
* },
|
|
147
|
+
* };
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
export async function verifyWebhookSignature(opts) {
|
|
151
|
+
const { rawBody, signatureHeader, secret, toleranceSeconds = DEFAULT_TOLERANCE_SECONDS, nowSeconds, } = opts;
|
|
152
|
+
// `secret` is typed as `string` here (Node verifier also accepts
|
|
153
|
+
// Buffer, but Buffer isn't a thing in Workers and we deliberately
|
|
154
|
+
// don't include it in the Web Crypto API surface). `!secret` already
|
|
155
|
+
// catches undefined, null, and "" cleanly; no extra type guard
|
|
156
|
+
// needed.
|
|
157
|
+
if (!secret) {
|
|
158
|
+
throw new WebhookVerificationError("MISSING_SECRET", "Webhook secret is required but was empty or not provided");
|
|
159
|
+
}
|
|
160
|
+
const parsed = parseSignatureHeader(signatureHeader);
|
|
161
|
+
if (!parsed) {
|
|
162
|
+
throw new WebhookVerificationError("INVALID_SIGNATURE_HEADER", "Invalid Primitive-Signature header format. Expected: t={timestamp},v1={signature}");
|
|
163
|
+
}
|
|
164
|
+
const { timestamp, signatures } = parsed;
|
|
165
|
+
const now = nowSeconds ?? Math.floor(Date.now() / 1000);
|
|
166
|
+
const age = now - timestamp;
|
|
167
|
+
if (age > toleranceSeconds) {
|
|
168
|
+
throw new WebhookVerificationError("TIMESTAMP_OUT_OF_RANGE", `Webhook timestamp too old (${age}s). Max age is ${toleranceSeconds}s.`);
|
|
169
|
+
}
|
|
170
|
+
if (age < -FUTURE_TOLERANCE_SECONDS) {
|
|
171
|
+
throw new WebhookVerificationError("TIMESTAMP_OUT_OF_RANGE", "Webhook timestamp is too far in the future. Check server clock sync.");
|
|
172
|
+
}
|
|
173
|
+
const signedPayloadString = `${timestamp}.${rawBody}`;
|
|
174
|
+
const expectedHex = await computeHmacHex(secret, signedPayloadString);
|
|
175
|
+
// Walk every provided signature so a key-rotation header carrying
|
|
176
|
+
// [old, new] still verifies once the new key is live. Constant-time
|
|
177
|
+
// comparison per candidate so a partial-match attacker can't binary
|
|
178
|
+
// search hex characters by timing.
|
|
179
|
+
//
|
|
180
|
+
// Lowercase the candidate before comparing: HEX_PATTERN accepts
|
|
181
|
+
// either case (to match the Node verifier, which decodes via
|
|
182
|
+
// `Buffer.from(str, "hex")` and is case-insensitive), but
|
|
183
|
+
// expectedHex from `arrayBufferToHex` is always lowercase.
|
|
184
|
+
// Comparing raw `charCodeAt` would treat "AB" and "ab" as
|
|
185
|
+
// different and silently fail through to SIGNATURE_MISMATCH.
|
|
186
|
+
let anyMatch = false;
|
|
187
|
+
for (const candidate of signatures) {
|
|
188
|
+
if (!isValidHex(candidate))
|
|
189
|
+
continue;
|
|
190
|
+
if (timingSafeEqualHex(candidate.toLowerCase(), expectedHex)) {
|
|
191
|
+
anyMatch = true;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (!anyMatch) {
|
|
195
|
+
throw new WebhookVerificationError("SIGNATURE_MISMATCH", "Webhook signature did not match. The body may have been modified in transit, or the secret may be out of date.");
|
|
196
|
+
}
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-pbuEa-1d.js";
|
|
2
|
-
import {
|
|
2
|
+
import { c as WebhookVerificationError, d as formatAddress } from "./errors-x91I_yEt.js";
|
|
3
3
|
//#region src/api/generated/core/bodySerializer.gen.ts
|
|
4
4
|
const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
|
|
5
5
|
//#endregion
|
|
@@ -1651,6 +1651,145 @@ const setFunctionSecret = (options) => (options.client ?? client$1).put({
|
|
|
1651
1651
|
}
|
|
1652
1652
|
});
|
|
1653
1653
|
//#endregion
|
|
1654
|
+
//#region src/api/verify-signature.ts
|
|
1655
|
+
/**
|
|
1656
|
+
* Workers-safe webhook signature verification.
|
|
1657
|
+
*
|
|
1658
|
+
* Mirrors `verifyWebhookSignature` from `@primitivedotdev/sdk` but
|
|
1659
|
+
* implements the HMAC-SHA256 step with the Web Crypto API
|
|
1660
|
+
* (`crypto.subtle`) instead of `node:crypto`. The Node version is
|
|
1661
|
+
* still the right choice for server-side handlers running on Node
|
|
1662
|
+
* (it's measurably faster and supports Buffer bodies); this one
|
|
1663
|
+
* exists so a Primitive Function handler can bundle the verifier
|
|
1664
|
+
* without dragging in a `node:crypto` polyfill that inflates the
|
|
1665
|
+
* deploy artifact past the size cap.
|
|
1666
|
+
*
|
|
1667
|
+
* Available natively in Workers, Node 22+, browsers, Deno, and Bun.
|
|
1668
|
+
* Zero polyfill weight, zero new runtime dependencies.
|
|
1669
|
+
*
|
|
1670
|
+
* Surface contract matches the Node verifier exactly: same input
|
|
1671
|
+
* shape, same `WebhookVerificationError` class, same set of error
|
|
1672
|
+
* codes. Existing callers can swap the import path with no other
|
|
1673
|
+
* code changes:
|
|
1674
|
+
*
|
|
1675
|
+
* // Node (existing):
|
|
1676
|
+
* import { verifyWebhookSignature } from '@primitivedotdev/sdk';
|
|
1677
|
+
*
|
|
1678
|
+
* // Workers / in-handler (this file):
|
|
1679
|
+
* import { verifyWebhookSignature } from '@primitivedotdev/sdk/api';
|
|
1680
|
+
*/
|
|
1681
|
+
const PRIMITIVE_SIGNATURE_HEADER = "Primitive-Signature";
|
|
1682
|
+
const DEFAULT_TOLERANCE_SECONDS = 300;
|
|
1683
|
+
const FUTURE_TOLERANCE_SECONDS = 60;
|
|
1684
|
+
const HEX_PATTERN = /^[0-9a-f]+$/i;
|
|
1685
|
+
const HEX_LENGTH = 64;
|
|
1686
|
+
const UNIX_SECONDS_PATTERN = /^\d{1,10}$/;
|
|
1687
|
+
function parseSignatureHeader(signatureHeader) {
|
|
1688
|
+
if (!signatureHeader || typeof signatureHeader !== "string") return null;
|
|
1689
|
+
const parts = signatureHeader.split(",");
|
|
1690
|
+
let timestamp = null;
|
|
1691
|
+
const signatures = [];
|
|
1692
|
+
for (const part of parts) {
|
|
1693
|
+
const idx = part.indexOf("=");
|
|
1694
|
+
if (idx === -1) continue;
|
|
1695
|
+
const key = part.slice(0, idx).trim();
|
|
1696
|
+
const value = part.slice(idx + 1).trim();
|
|
1697
|
+
if (!key || !value) continue;
|
|
1698
|
+
if (key === "t") {
|
|
1699
|
+
if (!UNIX_SECONDS_PATTERN.test(value)) continue;
|
|
1700
|
+
const parsed = Number(value);
|
|
1701
|
+
if (Number.isSafeInteger(parsed)) timestamp = parsed;
|
|
1702
|
+
} else if (key === "v1") signatures.push(value);
|
|
1703
|
+
}
|
|
1704
|
+
if (timestamp === null || signatures.length === 0) return null;
|
|
1705
|
+
return {
|
|
1706
|
+
timestamp,
|
|
1707
|
+
signatures
|
|
1708
|
+
};
|
|
1709
|
+
}
|
|
1710
|
+
function isValidHex(str) {
|
|
1711
|
+
return str.length === HEX_LENGTH && HEX_PATTERN.test(str);
|
|
1712
|
+
}
|
|
1713
|
+
function arrayBufferToHex(buffer) {
|
|
1714
|
+
const bytes = new Uint8Array(buffer);
|
|
1715
|
+
let hex = "";
|
|
1716
|
+
for (let i = 0; i < bytes.length; i++) hex += bytes[i].toString(16).padStart(2, "0");
|
|
1717
|
+
return hex;
|
|
1718
|
+
}
|
|
1719
|
+
/**
|
|
1720
|
+
* Constant-time comparison of two equal-length hex strings. Returns
|
|
1721
|
+
* false if lengths differ (intentionally not a security issue: lengths
|
|
1722
|
+
* are public). Iterates the full length regardless of mismatch so the
|
|
1723
|
+
* timing signal does not reveal the position of the first divergence.
|
|
1724
|
+
*/
|
|
1725
|
+
function timingSafeEqualHex(a, b) {
|
|
1726
|
+
if (a.length !== b.length) return false;
|
|
1727
|
+
let diff = 0;
|
|
1728
|
+
for (let i = 0; i < a.length; i++) diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
|
|
1729
|
+
return diff === 0;
|
|
1730
|
+
}
|
|
1731
|
+
async function computeHmacHex(secret, payload) {
|
|
1732
|
+
const encoder = new TextEncoder();
|
|
1733
|
+
const keyData = encoder.encode(secret);
|
|
1734
|
+
const key = await crypto.subtle.importKey("raw", keyData, {
|
|
1735
|
+
name: "HMAC",
|
|
1736
|
+
hash: "SHA-256"
|
|
1737
|
+
}, false, ["sign"]);
|
|
1738
|
+
return arrayBufferToHex(await crypto.subtle.sign("HMAC", key, encoder.encode(payload)));
|
|
1739
|
+
}
|
|
1740
|
+
/**
|
|
1741
|
+
* Verify a webhook signature using the Web Crypto API.
|
|
1742
|
+
*
|
|
1743
|
+
* Throws `WebhookVerificationError` on failure with a specific error
|
|
1744
|
+
* code matching the Node verifier's set. Returns `true` on success.
|
|
1745
|
+
*
|
|
1746
|
+
* @example
|
|
1747
|
+
* ```typescript
|
|
1748
|
+
* import {
|
|
1749
|
+
* verifyWebhookSignature,
|
|
1750
|
+
* WebhookVerificationError,
|
|
1751
|
+
* PRIMITIVE_SIGNATURE_HEADER,
|
|
1752
|
+
* } from '@primitivedotdev/sdk/api';
|
|
1753
|
+
*
|
|
1754
|
+
* export default {
|
|
1755
|
+
* async fetch(request: Request, env: { PRIMITIVE_WEBHOOK_SECRET: string }) {
|
|
1756
|
+
* const rawBody = await request.text();
|
|
1757
|
+
* try {
|
|
1758
|
+
* await verifyWebhookSignature({
|
|
1759
|
+
* rawBody,
|
|
1760
|
+
* signatureHeader: request.headers.get(PRIMITIVE_SIGNATURE_HEADER) ?? '',
|
|
1761
|
+
* secret: env.PRIMITIVE_WEBHOOK_SECRET,
|
|
1762
|
+
* });
|
|
1763
|
+
* } catch (err) {
|
|
1764
|
+
* if (err instanceof WebhookVerificationError) {
|
|
1765
|
+
* return new Response('invalid signature', { status: 401 });
|
|
1766
|
+
* }
|
|
1767
|
+
* throw err;
|
|
1768
|
+
* }
|
|
1769
|
+
* // ... process the webhook
|
|
1770
|
+
* },
|
|
1771
|
+
* };
|
|
1772
|
+
* ```
|
|
1773
|
+
*/
|
|
1774
|
+
async function verifyWebhookSignature(opts) {
|
|
1775
|
+
const { rawBody, signatureHeader, secret, toleranceSeconds = DEFAULT_TOLERANCE_SECONDS, nowSeconds } = opts;
|
|
1776
|
+
if (!secret) throw new WebhookVerificationError("MISSING_SECRET", "Webhook secret is required but was empty or not provided");
|
|
1777
|
+
const parsed = parseSignatureHeader(signatureHeader);
|
|
1778
|
+
if (!parsed) throw new WebhookVerificationError("INVALID_SIGNATURE_HEADER", "Invalid Primitive-Signature header format. Expected: t={timestamp},v1={signature}");
|
|
1779
|
+
const { timestamp, signatures } = parsed;
|
|
1780
|
+
const age = (nowSeconds ?? Math.floor(Date.now() / 1e3)) - timestamp;
|
|
1781
|
+
if (age > toleranceSeconds) throw new WebhookVerificationError("TIMESTAMP_OUT_OF_RANGE", `Webhook timestamp too old (${age}s). Max age is ${toleranceSeconds}s.`);
|
|
1782
|
+
if (age < -FUTURE_TOLERANCE_SECONDS) throw new WebhookVerificationError("TIMESTAMP_OUT_OF_RANGE", "Webhook timestamp is too far in the future. Check server clock sync.");
|
|
1783
|
+
const expectedHex = await computeHmacHex(secret, `${timestamp}.${rawBody}`);
|
|
1784
|
+
let anyMatch = false;
|
|
1785
|
+
for (const candidate of signatures) {
|
|
1786
|
+
if (!isValidHex(candidate)) continue;
|
|
1787
|
+
if (timingSafeEqualHex(candidate.toLowerCase(), expectedHex)) anyMatch = true;
|
|
1788
|
+
}
|
|
1789
|
+
if (!anyMatch) throw new WebhookVerificationError("SIGNATURE_MISMATCH", "Webhook signature did not match. The body may have been modified in transit, or the secret may be out of date.");
|
|
1790
|
+
return true;
|
|
1791
|
+
}
|
|
1792
|
+
//#endregion
|
|
1654
1793
|
//#region src/api/index.ts
|
|
1655
1794
|
const DEFAULT_API_BASE_URL_1 = "https://www.primitive.dev/api/v1";
|
|
1656
1795
|
const DEFAULT_API_BASE_URL_2 = "https://api.primitive.dev/v1";
|
|
@@ -1939,4 +2078,4 @@ function client(options = {}) {
|
|
|
1939
2078
|
}
|
|
1940
2079
|
const operations = sdk_gen_exports;
|
|
1941
2080
|
//#endregion
|
|
1942
|
-
export {
|
|
2081
|
+
export { updateAccount as $, getSendPermissions as A, listFunctions as B, deleteFunctionSecret as C, getAccount as D, downloadRawEmail as E, listDomains as F, replyToEmail as G, pollCliLogin as H, listEmails as I, sendEmail as J, rotateWebhookSecret as K, listEndpoints as L, getStorageStats as M, getWebhookSecret as N, getEmail as O, listDeliveries as P, testFunction as Q, listFilters as R, deleteFunction as S, downloadAttachments as T, replayDelivery as U, listSentEmails as V, replayEmailWebhooks as W, startCliLogin as X, setFunctionSecret as Y, testEndpoint as Z, createFunctionSecret as _, PrimitiveClient as a, deleteEndpoint as b, createPrimitiveClient as c, verifyWebhookSignature as d, updateDomain as et, addDomain as f, createFunction as g, createFilter as h, PrimitiveApiError as i, verifyDomain as it, getSentEmail as j, getFunction as k, operations as l, createEndpoint as m, DEFAULT_API_BASE_URL_2 as n, updateFilter as nt, client as o, cliLogout as p, searchEmails as q, PrimitiveApiClient as r, updateFunction as rt, createPrimitiveApiClient as s, DEFAULT_API_BASE_URL_1 as t, updateEndpoint as tt, PRIMITIVE_SIGNATURE_HEADER as u, deleteDomain as v, discardEmailContent as w, deleteFilter as x, deleteEmail as y, listFunctionSecrets as z };
|
package/dist/contract/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as ParsedDataFailed, D as RawContentDownloadOnly, M as WebhookAttachment, O as RawContentInline, S as ParsedDataComplete, c as EmailAnalysis, l as EmailAuth, s as EmailAddress, u as EmailReceivedEvent, w as ParsedError } from "../types-9vXGZjPd.js";
|
|
2
|
-
import { C as signStandardWebhooksPayload, h as WEBHOOK_VERSION, j as signWebhookPayload, k as SignResult, x as StandardWebhooksSignResult } from "../index-
|
|
2
|
+
import { C as signStandardWebhooksPayload, h as WEBHOOK_VERSION, j as signWebhookPayload, k as SignResult, x as StandardWebhooksSignResult } from "../index-Dbx9udpX.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 { E as signStandardWebhooksPayload, L as validateEmailReceivedEvent, M as signWebhookPayload, d as WEBHOOK_VERSION } from "../webhook-
|
|
1
|
+
import { E as signStandardWebhooksPayload, L as validateEmailReceivedEvent, M as signWebhookPayload, d as WEBHOOK_VERSION } from "../webhook-DJkfUnFZ.js";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
//#region src/contract/contract.ts
|
|
4
4
|
/**
|