@primitivedotdev/sdk 0.25.2 → 0.26.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.
@@ -655,11 +655,14 @@ export const listFunctions = (options) => (options?.client ?? client).get({
655
655
  * Deploy a function
656
656
  *
657
657
  * Creates and deploys a new function. The handler must be a single
658
- * ESM module that exports a default async function receiving the
659
- * `email.received` event (see the Webhook payload section for the
660
- * full schema). Code is bundled before being uploaded; ship a
661
- * single self-contained file rather than relying on external
662
- * imports.
658
+ * ESM module whose default export is an object with an async
659
+ * `fetch(request, env)` method (Workers-style). The gateway
660
+ * HMAC-verifies the POST against the org's webhook secret before
661
+ * invoking the handler; the request body parses to an
662
+ * `email.received` event (see `EmailReceivedEvent` and the
663
+ * Webhook payload section for the full schema). Code is bundled
664
+ * before being uploaded; ship a single self-contained file rather
665
+ * than relying on external imports.
663
666
  *
664
667
  * **Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`
665
668
  * (optional) is capped at 5 MiB UTF-8 and is stored only on the
@@ -1,3 +1,3 @@
1
1
  import { f as WebhookVerificationError, p as WebhookVerificationErrorCode } from "../errors-C53fe686.js";
2
- import { $ as listSentEmails, $a as SetFunctionSecretResponses, $i as PollCliLoginData, $n as DownloadRawEmailError, $o as VerifyDomainError, $r as GetStorageStatsResponses, $t as CreateFunctionResult, A as deleteEmail, Aa as SearchEmailsResponse, Ai as ListFiltersResponse, An as DeleteFunctionResponse, Ao as UpdateDomainInput, Ar as GetEmailError, At as CliLogoutInput, B as getFunction, Ba as SendPermissionAnyRecipient, Bi as ListFunctionSecretsResponse, Bn as DiscardEmailContentData, Bo as UpdateFilterError, Br as GetSendPermissionsError, Bt as CreateEndpointResponses, C as addDomain, Ca as RotateWebhookSecretError, Ci as ListEndpointsErrors, Cn as DeleteFilterError, Co as UpdateAccountErrors, Cr as GateFix, Ct as AddDomainResponse, D as createFunction, Da as SearchEmailsData, Di as ListFiltersData, Dn as DeleteFunctionData, Do as UpdateDomainData, Dr as GetAccountResponse, Dt as CliLogoutData, E as createFilter, Ea as RotateWebhookSecretResponses, Ei as ListEnvelope, En as DeleteFilterResponses, Eo as UpdateAccountResponses, Er as GetAccountErrors, Et as CliLoginStartResult, F as discardEmailContent, Fa as SendEmailResponse, Fi as ListFunctionLogsResponse, Fn as DeleteFunctionSecretResponse, Fo as UpdateEndpointErrors, Fr as GetFunctionError, Ft as CreateEndpointData, G as listDeliveries, Ga as SentEmailDetail, Gi as ListFunctionsResponse, Gn as Domain, Go as UpdateFunctionData, Gr as GetSentEmailError, Gt as CreateFilterResponse, H as getSentEmail, Ha as SendPermissionRule, Hi as ListFunctionsData, Hn as DiscardEmailContentErrors, Ho as UpdateFilterInput, Hr as GetSendPermissionsResponse, Ht as CreateFilterError, I as downloadAttachments, Ia as SendEmailResponses, Ii as ListFunctionLogsResponses, In as DeleteFunctionSecretResponses, Io as UpdateEndpointInput, Ir as GetFunctionErrors, It as CreateEndpointError, J as listEndpoints, Ja as SetFunctionSecretData, Ji as ListSentEmailsError, Jn as DownloadAttachmentsError, Jo as UpdateFunctionInput, Jr as GetSentEmailResponses, Jt as CreateFunctionError, K as listDomains, Ka as SentEmailStatus, Ki as ListFunctionsResponses, Kn as DomainVerifyResult, Ko as UpdateFunctionError, Kr as GetSentEmailErrors, Kt as CreateFilterResponses, L as downloadRawEmail, La as SendMailInput, Li as ListFunctionSecretsData, Ln as DeliveryStatus, Lo as UpdateEndpointResponse, Lr as GetFunctionResponse, Lt as CreateEndpointErrors, M as deleteFilter, Ma as SendEmailData, Mi as ListFunctionLogsData, Mn as DeleteFunctionSecretData, Mo as UpdateDomainResponses, Mr as GetEmailResponse, Mt as CliLogoutResponses, N as deleteFunction, Na as SendEmailError, Ni as ListFunctionLogsError, Nn as DeleteFunctionSecretError, No as UpdateEndpointData, Nr as GetEmailResponses, Nt as CliLogoutResult, O as createFunctionSecret, Oa as SearchEmailsError, Oi as ListFiltersError, On as DeleteFunctionError, Oo as UpdateDomainError, Or as GetAccountResponses, Ot as CliLogoutError, P as deleteFunctionSecret, Pa as SendEmailErrors, Pi as ListFunctionLogsErrors, Pn as DeleteFunctionSecretErrors, Po as UpdateEndpointError, Pr as GetFunctionData, Pt as ClientOptions, Q as listFunctions, Qa as SetFunctionSecretResponse, Qi as PaginationMeta, Qn as DownloadRawEmailData, Qo as VerifyDomainData, Qr as GetStorageStatsResponse, Qt as CreateFunctionResponses, R as getAccount, Ra as SendMailResult, Ri as ListFunctionSecretsError, Rn as DeliverySummary, Ro as UpdateEndpointResponses, Rr as GetFunctionResponses, Rt as CreateEndpointInput, S as Options, Sa as RotateWebhookSecretData, Si as ListEndpointsError, Sn as DeleteFilterData, So as UpdateAccountError, Sr as GateDenial, St as AddDomainInput, T as createEndpoint, Ta as RotateWebhookSecretResponse, Ti as ListEndpointsResponses, Tn as DeleteFilterResponse, To as UpdateAccountResponse, Tr as GetAccountError, Tt as CliLoginPollResult, U as getStorageStats, Ua as SendPermissionYourDomain, Ui as ListFunctionsError, Un as DiscardEmailContentResponse, Uo as UpdateFilterResponse, Ur as GetSendPermissionsResponses, Ut as CreateFilterErrors, V as getSendPermissions, Va as SendPermissionManagedZone, Vi as ListFunctionSecretsResponses, Vn as DiscardEmailContentError, Vo as UpdateFilterErrors, Vr as GetSendPermissionsErrors, Vt as CreateFilterData, W as getWebhookSecret, Wa as SendPermissionsMeta, Wi as ListFunctionsErrors, Wn as DiscardEmailContentResponses, Wo as UpdateFilterResponses, Wr as GetSentEmailData, Wt as CreateFilterInput, X as listFunctionLogs, Xa as SetFunctionSecretErrors, Xi as ListSentEmailsResponse, Xn as DownloadAttachmentsResponse, Xo as UpdateFunctionResponses, Xr as GetStorageStatsError, Xt as CreateFunctionInput, Y as listFilters, Ya as SetFunctionSecretError, Yi as ListSentEmailsErrors, Yn as DownloadAttachmentsErrors, Yo as UpdateFunctionResponse, Yr as GetStorageStatsData, Yt as CreateFunctionErrors, Z as listFunctionSecrets, Za as SetFunctionSecretInput, Zi as ListSentEmailsResponses, Zn as DownloadAttachmentsResponses, Zo as VerifiedDomain, Zr as GetStorageStatsErrors, Zt as CreateFunctionResponse, _ as createPrimitiveClient, _a as ReplyToEmailError, _i as ListEmailsError, _n as DeleteEndpointData, _o as TestFunctionResponses, _r as FunctionDetail, _t as Account, a as PrimitiveApiClientOptions, aa as ReplayDeliveryData, ai as Limit, an as CreateFunctionSecretResponses, ao as StartCliLoginResponses, ar as EmailSearchFacetBucket, as as ClientOptions$1, at as searchEmails, b as VerifyOptions, ba as ReplyToEmailResponses, bi as ListEmailsResponses, bn as DeleteEndpointResponse, bo as UnverifiedDomain, br as FunctionSecretListItem, bt as AddDomainError, c as PrimitiveClient, ca as ReplayDeliveryResponse, ci as ListDeliveriesErrors, cn as DeleteDomainError, co as TestEndpointData, cr as EmailSearchMeta, cs as Options$1, ct as startCliLogin, d as RequestOptions$1, da as ReplayEmailWebhooksError, di as ListDomainsData, dn as DeleteDomainResponses, do as TestEndpointResponse, dr as EmailSummary, ds as ResponseStyle, dt as updateAccount, ea as PollCliLoginError, ei as GetWebhookSecretData, en as CreateFunctionSecretData, eo as StartCliLoginData, er as DownloadRawEmailErrors, es as VerifyDomainErrors, et as pollCliLogin, f as SendInput, fa as ReplayEmailWebhooksErrors, fi as ListDomainsError, fn as DeleteEmailData, fo as TestEndpointResponses, fr as EmailWebhookStatus, fs as Auth, ft as updateDomain, g as createPrimitiveApiClient, ga as ReplyToEmailData, gi as ListEmailsData, gn as DeleteEmailResponses, go as TestFunctionResponse, gr as FunctionDeployStatus, gt as verifyDomain, h as client, ha as ReplayResult, hi as ListDomainsResponses, hn as DeleteEmailResponse, ho as TestFunctionErrors, hr as Filter, ht as updateFunction, i as PrimitiveApiClient, ia as PollCliLoginResponses, ii as GetWebhookSecretResponses, in as CreateFunctionSecretResponse, io as StartCliLoginResponse, ir as EmailDetailReply, is as Client, it as rotateWebhookSecret, j as deleteEndpoint, ja as SearchEmailsResponses, ji as ListFiltersResponses, jn as DeleteFunctionResponses, jo as UpdateDomainResponse, jr as GetEmailErrors, jt as CliLogoutResponse, k as deleteDomain, ka as SearchEmailsErrors, ki as ListFiltersErrors, kn as DeleteFunctionErrors, ko as UpdateDomainErrors, kr as GetEmailData, kt as CliLogoutErrors, l as PrimitiveClientOptions, la as ReplayDeliveryResponses, li as ListDeliveriesResponse, ln as DeleteDomainErrors, lo as TestEndpointError, lr as EmailSearchResult, ls as RequestOptions, lt as testEndpoint, m as SendThreadInput, ma as ReplayEmailWebhooksResponses, mi as ListDomainsResponse, mn as DeleteEmailErrors, mo as TestFunctionError, mr as ErrorResponse, mt as updateFilter, n as DEFAULT_API_BASE_URL_2, na as PollCliLoginInput, ni as GetWebhookSecretErrors, nn as CreateFunctionSecretErrors, no as StartCliLoginErrors, nr as DownloadRawEmailResponses, ns as VerifyDomainResponses, nt as replayEmailWebhooks, o as PrimitiveApiError, oa as ReplayDeliveryError, oi as ListDeliveriesData, on as Cursor, oo as StorageStats, or as EmailSearchFacets, os as Config, ot as sendEmail, p as SendResult, pa as ReplayEmailWebhooksResponse, pi as ListDomainsErrors, pn as DeleteEmailError, po as TestFunctionData, pr as Endpoint, pt as updateEndpoint, q as listEmails, qa as SentEmailSummary, qi as ListSentEmailsData, qn as DownloadAttachmentsData, qo as UpdateFunctionErrors, qr as GetSentEmailResponse, qt as CreateFunctionData, r as ForwardInput, ra as PollCliLoginResponse, ri as GetWebhookSecretResponse, rn as CreateFunctionSecretInput, ro as StartCliLoginInput, rr as EmailDetail, rs as WebhookSecret, rt as replyToEmail, s as PrimitiveApiErrorDetails, sa as ReplayDeliveryErrors, si as ListDeliveriesError, sn as DeleteDomainData, so as SuccessEnvelope, sr as EmailSearchHighlights, ss as CreateClientConfig, st as setFunctionSecret, t as DEFAULT_API_BASE_URL_1, ta as PollCliLoginErrors, ti as GetWebhookSecretError, tn as CreateFunctionSecretError, to as StartCliLoginError, tr as DownloadRawEmailResponse, ts as VerifyDomainResponse, tt as replayDelivery, u as ReplyInput, ua as ReplayEmailWebhooksData, ui as ListDeliveriesResponses, un as DeleteDomainResponse, uo as TestEndpointErrors, ur as EmailStatus, us as RequestResult, ut as testFunction, v as operations, va as ReplyToEmailErrors, vi as ListEmailsErrors, vn as DeleteEndpointError, vo as TestInvocationResult, vr as FunctionListItem, vt as AccountUpdated, w as cliLogout, wa as RotateWebhookSecretErrors, wi as ListEndpointsResponse, wn as DeleteFilterErrors, wo as UpdateAccountInput, wr as GetAccountData, wt as AddDomainResponses, x as verifyWebhookSignature, xa as ResourceId, xi as ListEndpointsData, xn as DeleteEndpointResponses, xo as UpdateAccountData, xr as FunctionSecretWriteResult, xt as AddDomainErrors, y as PRIMITIVE_SIGNATURE_HEADER, ya as ReplyToEmailResponse, yi as ListEmailsResponse, yn as DeleteEndpointErrors, yo as TestResult, yr as FunctionLogRow, yt as AddDomainData, z as getEmail, za as SendPermissionAddress, zi as ListFunctionSecretsErrors, zn as DiscardContentResult, zo as UpdateFilterData, zr as GetSendPermissionsData, zt as CreateEndpointResponse } from "../index-DISHEO_u.js";
2
+ import { $ as listSentEmails, $a as SetFunctionSecretResponses, $i as PollCliLoginData, $n as DownloadRawEmailError, $o as VerifyDomainError, $r as GetStorageStatsResponses, $t as CreateFunctionResult, A as deleteEmail, Aa as SearchEmailsResponse, Ai as ListFiltersResponse, An as DeleteFunctionResponse, Ao as UpdateDomainInput, Ar as GetEmailError, At as CliLogoutInput, B as getFunction, Ba as SendPermissionAnyRecipient, Bi as ListFunctionSecretsResponse, Bn as DiscardEmailContentData, Bo as UpdateFilterError, Br as GetSendPermissionsError, Bt as CreateEndpointResponses, C as addDomain, Ca as RotateWebhookSecretError, Ci as ListEndpointsErrors, Cn as DeleteFilterError, Co as UpdateAccountErrors, Cr as GateFix, Ct as AddDomainResponse, D as createFunction, Da as SearchEmailsData, Di as ListFiltersData, Dn as DeleteFunctionData, Do as UpdateDomainData, Dr as GetAccountResponse, Dt as CliLogoutData, E as createFilter, Ea as RotateWebhookSecretResponses, Ei as ListEnvelope, En as DeleteFilterResponses, Eo as UpdateAccountResponses, Er as GetAccountErrors, Et as CliLoginStartResult, F as discardEmailContent, Fa as SendEmailResponse, Fi as ListFunctionLogsResponse, Fn as DeleteFunctionSecretResponse, Fo as UpdateEndpointErrors, Fr as GetFunctionError, Ft as CreateEndpointData, G as listDeliveries, Ga as SentEmailDetail, Gi as ListFunctionsResponse, Gn as Domain, Go as UpdateFunctionData, Gr as GetSentEmailError, Gt as CreateFilterResponse, H as getSentEmail, Ha as SendPermissionRule, Hi as ListFunctionsData, Hn as DiscardEmailContentErrors, Ho as UpdateFilterInput, Hr as GetSendPermissionsResponse, Ht as CreateFilterError, I as downloadAttachments, Ia as SendEmailResponses, Ii as ListFunctionLogsResponses, In as DeleteFunctionSecretResponses, Io as UpdateEndpointInput, Ir as GetFunctionErrors, It as CreateEndpointError, J as listEndpoints, Ja as SetFunctionSecretData, Ji as ListSentEmailsError, Jn as DownloadAttachmentsError, Jo as UpdateFunctionInput, Jr as GetSentEmailResponses, Jt as CreateFunctionError, K as listDomains, Ka as SentEmailStatus, Ki as ListFunctionsResponses, Kn as DomainVerifyResult, Ko as UpdateFunctionError, Kr as GetSentEmailErrors, Kt as CreateFilterResponses, L as downloadRawEmail, La as SendMailInput, Li as ListFunctionSecretsData, Ln as DeliveryStatus, Lo as UpdateEndpointResponse, Lr as GetFunctionResponse, Lt as CreateEndpointErrors, M as deleteFilter, Ma as SendEmailData, Mi as ListFunctionLogsData, Mn as DeleteFunctionSecretData, Mo as UpdateDomainResponses, Mr as GetEmailResponse, Mt as CliLogoutResponses, N as deleteFunction, Na as SendEmailError, Ni as ListFunctionLogsError, Nn as DeleteFunctionSecretError, No as UpdateEndpointData, Nr as GetEmailResponses, Nt as CliLogoutResult, O as createFunctionSecret, Oa as SearchEmailsError, Oi as ListFiltersError, On as DeleteFunctionError, Oo as UpdateDomainError, Or as GetAccountResponses, Ot as CliLogoutError, P as deleteFunctionSecret, Pa as SendEmailErrors, Pi as ListFunctionLogsErrors, Pn as DeleteFunctionSecretErrors, Po as UpdateEndpointError, Pr as GetFunctionData, Pt as ClientOptions, Q as listFunctions, Qa as SetFunctionSecretResponse, Qi as PaginationMeta, Qn as DownloadRawEmailData, Qo as VerifyDomainData, Qr as GetStorageStatsResponse, Qt as CreateFunctionResponses, R as getAccount, Ra as SendMailResult, Ri as ListFunctionSecretsError, Rn as DeliverySummary, Ro as UpdateEndpointResponses, Rr as GetFunctionResponses, Rt as CreateEndpointInput, S as Options, Sa as RotateWebhookSecretData, Si as ListEndpointsError, Sn as DeleteFilterData, So as UpdateAccountError, Sr as GateDenial, St as AddDomainInput, T as createEndpoint, Ta as RotateWebhookSecretResponse, Ti as ListEndpointsResponses, Tn as DeleteFilterResponse, To as UpdateAccountResponse, Tr as GetAccountError, Tt as CliLoginPollResult, U as getStorageStats, Ua as SendPermissionYourDomain, Ui as ListFunctionsError, Un as DiscardEmailContentResponse, Uo as UpdateFilterResponse, Ur as GetSendPermissionsResponses, Ut as CreateFilterErrors, V as getSendPermissions, Va as SendPermissionManagedZone, Vi as ListFunctionSecretsResponses, Vn as DiscardEmailContentError, Vo as UpdateFilterErrors, Vr as GetSendPermissionsErrors, Vt as CreateFilterData, W as getWebhookSecret, Wa as SendPermissionsMeta, Wi as ListFunctionsErrors, Wn as DiscardEmailContentResponses, Wo as UpdateFilterResponses, Wr as GetSentEmailData, Wt as CreateFilterInput, X as listFunctionLogs, Xa as SetFunctionSecretErrors, Xi as ListSentEmailsResponse, Xn as DownloadAttachmentsResponse, Xo as UpdateFunctionResponses, Xr as GetStorageStatsError, Xt as CreateFunctionInput, Y as listFilters, Ya as SetFunctionSecretError, Yi as ListSentEmailsErrors, Yn as DownloadAttachmentsErrors, Yo as UpdateFunctionResponse, Yr as GetStorageStatsData, Yt as CreateFunctionErrors, Z as listFunctionSecrets, Za as SetFunctionSecretInput, Zi as ListSentEmailsResponses, Zn as DownloadAttachmentsResponses, Zo as VerifiedDomain, Zr as GetStorageStatsErrors, Zt as CreateFunctionResponse, _ as createPrimitiveClient, _a as ReplyToEmailError, _i as ListEmailsError, _n as DeleteEndpointData, _o as TestFunctionResponses, _r as FunctionDetail, _t as Account, a as PrimitiveApiClientOptions, aa as ReplayDeliveryData, ai as Limit, an as CreateFunctionSecretResponses, ao as StartCliLoginResponses, ar as EmailSearchFacetBucket, as as ClientOptions$1, at as searchEmails, b as VerifyOptions, ba as ReplyToEmailResponses, bi as ListEmailsResponses, bn as DeleteEndpointResponse, bo as UnverifiedDomain, br as FunctionSecretListItem, bt as AddDomainError, c as PrimitiveClient, ca as ReplayDeliveryResponse, ci as ListDeliveriesErrors, cn as DeleteDomainError, co as TestEndpointData, cr as EmailSearchMeta, cs as Options$1, ct as startCliLogin, d as RequestOptions$1, da as ReplayEmailWebhooksError, di as ListDomainsData, dn as DeleteDomainResponses, do as TestEndpointResponse, dr as EmailSummary, ds as ResponseStyle, dt as updateAccount, ea as PollCliLoginError, ei as GetWebhookSecretData, en as CreateFunctionSecretData, eo as StartCliLoginData, er as DownloadRawEmailErrors, es as VerifyDomainErrors, et as pollCliLogin, f as SendInput, fa as ReplayEmailWebhooksErrors, fi as ListDomainsError, fn as DeleteEmailData, fo as TestEndpointResponses, fr as EmailWebhookStatus, fs as Auth, ft as updateDomain, g as createPrimitiveApiClient, ga as ReplyToEmailData, gi as ListEmailsData, gn as DeleteEmailResponses, go as TestFunctionResponse, gr as FunctionDeployStatus, gt as verifyDomain, h as client, ha as ReplayResult, hi as ListDomainsResponses, hn as DeleteEmailResponse, ho as TestFunctionErrors, hr as Filter, ht as updateFunction, i as PrimitiveApiClient, ia as PollCliLoginResponses, ii as GetWebhookSecretResponses, in as CreateFunctionSecretResponse, io as StartCliLoginResponse, ir as EmailDetailReply, is as Client, it as rotateWebhookSecret, j as deleteEndpoint, ja as SearchEmailsResponses, ji as ListFiltersResponses, jn as DeleteFunctionResponses, jo as UpdateDomainResponse, jr as GetEmailErrors, jt as CliLogoutResponse, k as deleteDomain, ka as SearchEmailsErrors, ki as ListFiltersErrors, kn as DeleteFunctionErrors, ko as UpdateDomainErrors, kr as GetEmailData, kt as CliLogoutErrors, l as PrimitiveClientOptions, la as ReplayDeliveryResponses, li as ListDeliveriesResponse, ln as DeleteDomainErrors, lo as TestEndpointError, lr as EmailSearchResult, ls as RequestOptions, lt as testEndpoint, m as SendThreadInput, ma as ReplayEmailWebhooksResponses, mi as ListDomainsResponse, mn as DeleteEmailErrors, mo as TestFunctionError, mr as ErrorResponse, mt as updateFilter, n as DEFAULT_API_BASE_URL_2, na as PollCliLoginInput, ni as GetWebhookSecretErrors, nn as CreateFunctionSecretErrors, no as StartCliLoginErrors, nr as DownloadRawEmailResponses, ns as VerifyDomainResponses, nt as replayEmailWebhooks, o as PrimitiveApiError, oa as ReplayDeliveryError, oi as ListDeliveriesData, on as Cursor, oo as StorageStats, or as EmailSearchFacets, os as Config, ot as sendEmail, p as SendResult, pa as ReplayEmailWebhooksResponse, pi as ListDomainsErrors, pn as DeleteEmailError, po as TestFunctionData, pr as Endpoint, pt as updateEndpoint, q as listEmails, qa as SentEmailSummary, qi as ListSentEmailsData, qn as DownloadAttachmentsData, qo as UpdateFunctionErrors, qr as GetSentEmailResponse, qt as CreateFunctionData, r as ForwardInput, ra as PollCliLoginResponse, ri as GetWebhookSecretResponse, rn as CreateFunctionSecretInput, ro as StartCliLoginInput, rr as EmailDetail, rs as WebhookSecret, rt as replyToEmail, s as PrimitiveApiErrorDetails, sa as ReplayDeliveryErrors, si as ListDeliveriesError, sn as DeleteDomainData, so as SuccessEnvelope, sr as EmailSearchHighlights, ss as CreateClientConfig, st as setFunctionSecret, t as DEFAULT_API_BASE_URL_1, ta as PollCliLoginErrors, ti as GetWebhookSecretError, tn as CreateFunctionSecretError, to as StartCliLoginError, tr as DownloadRawEmailResponse, ts as VerifyDomainResponse, tt as replayDelivery, u as ReplyInput, ua as ReplayEmailWebhooksData, ui as ListDeliveriesResponses, un as DeleteDomainResponse, uo as TestEndpointErrors, ur as EmailStatus, us as RequestResult, ut as testFunction, v as operations, va as ReplyToEmailErrors, vi as ListEmailsErrors, vn as DeleteEndpointError, vo as TestInvocationResult, vr as FunctionListItem, vt as AccountUpdated, w as cliLogout, wa as RotateWebhookSecretErrors, wi as ListEndpointsResponse, wn as DeleteFilterErrors, wo as UpdateAccountInput, wr as GetAccountData, wt as AddDomainResponses, x as verifyWebhookSignature, xa as ResourceId, xi as ListEndpointsData, xn as DeleteEndpointResponses, xo as UpdateAccountData, xr as FunctionSecretWriteResult, xt as AddDomainErrors, y as PRIMITIVE_SIGNATURE_HEADER, ya as ReplyToEmailResponse, yi as ListEmailsResponse, yn as DeleteEndpointErrors, yo as TestResult, yr as FunctionLogRow, yt as AddDomainData, z as getEmail, za as SendPermissionAddress, zi as ListFunctionSecretsErrors, zn as DiscardContentResult, zo as UpdateFilterData, zr as GetSendPermissionsData, zt as CreateEndpointResponse } from "../index-BbEVpN5e.js";
3
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, FunctionLogRow, 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, ListFunctionLogsData, ListFunctionLogsError, ListFunctionLogsErrors, ListFunctionLogsResponse, ListFunctionLogsResponses, 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, listFunctionLogs, listFunctionSecrets, listFunctions, listSentEmails, operations, pollCliLogin, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, searchEmails, sendEmail, setFunctionSecret, startCliLogin, testEndpoint, testFunction, updateAccount, updateDomain, updateEndpoint, updateFilter, updateFunction, verifyDomain, verifyWebhookSignature };
@@ -1425,11 +1425,14 @@ const listFunctions = (options) => (options?.client ?? client$1).get({
1425
1425
  * Deploy a function
1426
1426
  *
1427
1427
  * Creates and deploys a new function. The handler must be a single
1428
- * ESM module that exports a default async function receiving the
1429
- * `email.received` event (see the Webhook payload section for the
1430
- * full schema). Code is bundled before being uploaded; ship a
1431
- * single self-contained file rather than relying on external
1432
- * imports.
1428
+ * ESM module whose default export is an object with an async
1429
+ * `fetch(request, env)` method (Workers-style). The gateway
1430
+ * HMAC-verifies the POST against the org's webhook secret before
1431
+ * invoking the handler; the request body parses to an
1432
+ * `email.received` event (see `EmailReceivedEvent` and the
1433
+ * Webhook payload section for the full schema). Code is bundled
1434
+ * before being uploaded; ship a single self-contained file rather
1435
+ * than relying on external imports.
1433
1436
  *
1434
1437
  * **Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`
1435
1438
  * (optional) is capped at 5 MiB UTF-8 and is stored only on the
@@ -4154,11 +4154,14 @@ declare const listFunctions: <ThrowOnError extends boolean = false>(options?: Op
4154
4154
  * Deploy a function
4155
4155
  *
4156
4156
  * Creates and deploys a new function. The handler must be a single
4157
- * ESM module that exports a default async function receiving the
4158
- * `email.received` event (see the Webhook payload section for the
4159
- * full schema). Code is bundled before being uploaded; ship a
4160
- * single self-contained file rather than relying on external
4161
- * imports.
4157
+ * ESM module whose default export is an object with an async
4158
+ * `fetch(request, env)` method (Workers-style). The gateway
4159
+ * HMAC-verifies the POST against the org's webhook secret before
4160
+ * invoking the handler; the request body parses to an
4161
+ * `email.received` event (see `EmailReceivedEvent` and the
4162
+ * Webhook payload section for the full schema). Code is bundled
4163
+ * before being uploaded; ship a single self-contained file rather
4164
+ * than relying on external imports.
4162
4165
  *
4163
4166
  * **Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`
4164
4167
  * (optional) is capped at 5 MiB UTF-8 and is stored only on the
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { A as UnknownEvent, C as ParsedDataFailed, D as RawContentDownloadOnly, E as RawContent, M as WebhookAttachment, N as WebhookEvent, O as RawContentInline, S as ParsedDataComplete, T as ParsedStatus, _ as ForwardResultInline, a as DmarcPolicy, b as KnownWebhookEvent, c as EmailAnalysis, d as EventType, f as ForwardAnalysis, g as ForwardResultAttachmentSkipped, h as ForwardResultAttachmentAnalyzed, i as DkimSignature, j as ValidateEmailAuthResult, k as SpfResult, l as EmailAuth, m as ForwardResult, n as AuthVerdict, o as DmarcResult, p as ForwardOriginalSender, r as DkimResult, s as EmailAddress, t as AuthConfidence, u as EmailReceivedEvent, v as ForwardVerdict, w as ParsedError, x as ParsedData, y as ForwardVerification } from "./types-9vXGZjPd.js";
2
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-C53fe686.js";
3
- import { _ as createPrimitiveClient, c as PrimitiveClient, f as SendInput, h as client, l as PrimitiveClientOptions, m as SendThreadInput, o as PrimitiveApiError, p as SendResult, r as ForwardInput, u as ReplyInput } from "./index-DISHEO_u.js";
3
+ import { _ as createPrimitiveClient, c as PrimitiveClient, f as SendInput, h as client, l as PrimitiveClientOptions, m as SendThreadInput, o as PrimitiveApiError, p as SendResult, r as ForwardInput, u as ReplyInput } from "./index-BbEVpN5e.js";
4
4
  import { A as VerifyOptions, C as signStandardWebhooksPayload, D as PRIMITIVE_CONFIRMED_HEADER, E as LEGACY_SIGNATURE_HEADER, F as VerifyDownloadTokenResult, I as generateDownloadToken, L as verifyDownloadToken, M as verifyWebhookSignature, N as GenerateDownloadTokenOptions, O as PRIMITIVE_SIGNATURE_HEADER, P as VerifyDownloadTokenOptions, R as safeValidateEmailReceivedEvent, S as StandardWebhooksVerifyOptions, T as LEGACY_CONFIRMED_HEADER, _ as emailReceivedEventJsonSchema, a as confirmedHeaders, b as STANDARD_WEBHOOK_TIMESTAMP_HEADER, c as handleWebhook, d as isRawIncluded, f as parseWebhookEvent, g as validateEmailAuth, h as WEBHOOK_VERSION, i as WebhookHeaders, j as signWebhookPayload, k as SignResult, l as isDownloadExpired, m as verifyRawEmailDownload, n as HandleWebhookOptions, o as decodeRawEmail, p as receive, r as ReceiveRequestOptions, s as getDownloadTimeRemaining, t as DecodeRawEmailOptions, u as isEmailReceivedEvent, v as STANDARD_WEBHOOK_ID_HEADER, w as verifyStandardWebhooksSignature, x as StandardWebhooksSignResult, y as STANDARD_WEBHOOK_SIGNATURE_HEADER, z as validateEmailReceivedEvent } from "./index-Dbx9udpX.js";
5
5
 
6
6
  //#region src/index.d.ts
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
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-x91I_yEt.js";
2
- import { a as PrimitiveClient, c as createPrimitiveClient, i as PrimitiveApiError, o as client } from "./api-Cfj_U9RX.js";
2
+ import { a as PrimitiveClient, c as createPrimitiveClient, i as PrimitiveApiError, o as client } from "./api-CnUa6o4r.js";
3
3
  import { A as PRIMITIVE_CONFIRMED_HEADER, C as STANDARD_WEBHOOK_ID_HEADER, D as verifyStandardWebhooksSignature, E as signStandardWebhooksPayload, F as verifyDownloadToken, I as safeValidateEmailReceivedEvent, L as validateEmailReceivedEvent, M as signWebhookPayload, N as verifyWebhookSignature, O as LEGACY_CONFIRMED_HEADER, P as generateDownloadToken, S as emailReceivedEventJsonSchema, T as STANDARD_WEBHOOK_TIMESTAMP_HEADER, _ as DmarcResult, a as isDownloadExpired, b as ParsedStatus, c as parseWebhookEvent, d as WEBHOOK_VERSION, f as validateEmailAuth, g as DmarcPolicy, h as DkimResult, i as handleWebhook, j as PRIMITIVE_SIGNATURE_HEADER, k as LEGACY_SIGNATURE_HEADER, l as receive, m as AuthVerdict, n as decodeRawEmail, o as isEmailReceivedEvent, p as AuthConfidence, r as getDownloadTimeRemaining, s as isRawIncluded, t as confirmedHeaders, u as verifyRawEmailDownload, v as EventType, w as STANDARD_WEBHOOK_SIGNATURE_HEADER, x as SpfResult, y as ForwardVerdict } from "./webhook-DJkfUnFZ.js";
4
4
  //#region src/index.ts
5
5
  const primitive = {
@@ -69,7 +69,7 @@ export const openapiDocument = {
69
69
  },
70
70
  {
71
71
  "name": "Functions",
72
- "description": "Deploy JavaScript handlers that run on inbound mail. Each function\nexports a default async handler receiving the `email.received`\nevent. Code runs on Primitive's edge runtime; there is no\ninfrastructure to manage. Secrets land in `env` as encrypted\nbindings and are refreshed on every redeploy.\n"
72
+ "description": "Deploy JavaScript handlers that run on inbound mail. Each function\nis a single ESM module whose default export is an object with an\nasync `fetch(request, env)` method, in the shape of a Workers-style\nhandler. The gateway HMAC-verifies the inbound POST against the\norg's webhook secret before invoking `fetch`; the request body\nparses to an `email.received` event (see `EmailReceivedEvent` and\nthe Webhook payload section for the full schema). Code runs on\nPrimitive's edge runtime; there is no infrastructure to manage.\nSecrets land in `env` as encrypted bindings and are refreshed on\nevery redeploy.\n"
73
73
  }
74
74
  ],
75
75
  "paths": {
@@ -2380,7 +2380,7 @@ export const openapiDocument = {
2380
2380
  "post": {
2381
2381
  "operationId": "createFunction",
2382
2382
  "summary": "Deploy a function",
2383
- "description": "Creates and deploys a new function. The handler must be a single\nESM module that exports a default async function receiving the\n`email.received` event (see the Webhook payload section for the\nfull schema). Code is bundled before being uploaded; ship a\nsingle self-contained file rather than relying on external\nimports.\n\n**Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`\n(optional) is capped at 5 MiB UTF-8 and is stored only on the\nedge runtime side; it is not persisted in Primitive's database.\n\n**Auto-wiring.** On successful deploy, Primitive automatically\ncreates a webhook endpoint that delivers inbound mail to the\nfunction. There is nothing to configure on the Endpoints API\nfor this to work; the gateway URL returned here is for\nreference only and is not directly callable from outside.\n\n**Secrets.** New functions ship with the managed secrets\n(`PRIMITIVE_WEBHOOK_SECRET`, `PRIMITIVE_API_KEY`) already\nbound. Add user-set secrets via\n`POST /functions/{id}/secrets`; secret writes only land in the\nrunning handler on the next redeploy.\n",
2383
+ "description": "Creates and deploys a new function. The handler must be a single\nESM module whose default export is an object with an async\n`fetch(request, env)` method (Workers-style). The gateway\nHMAC-verifies the POST against the org's webhook secret before\ninvoking the handler; the request body parses to an\n`email.received` event (see `EmailReceivedEvent` and the\nWebhook payload section for the full schema). Code is bundled\nbefore being uploaded; ship a single self-contained file rather\nthan relying on external imports.\n\n**Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`\n(optional) is capped at 5 MiB UTF-8 and is stored only on the\nedge runtime side; it is not persisted in Primitive's database.\n\n**Auto-wiring.** On successful deploy, Primitive automatically\ncreates a webhook endpoint that delivers inbound mail to the\nfunction. There is nothing to configure on the Endpoints API\nfor this to work; the gateway URL returned here is for\nreference only and is not directly callable from outside.\n\n**Secrets.** New functions ship with the managed secrets\n(`PRIMITIVE_WEBHOOK_SECRET`, `PRIMITIVE_API_KEY`) already\nbound. Add user-set secrets via\n`POST /functions/{id}/secrets`; secret writes only land in the\nrunning handler on the next redeploy.\n",
2384
2384
  "tags": [
2385
2385
  "Functions"
2386
2386
  ],
@@ -2519,7 +2519,7 @@ export const operationManifest = [
2519
2519
  "binaryResponse": false,
2520
2520
  "bodyRequired": true,
2521
2521
  "command": "create-function",
2522
- "description": "Creates and deploys a new function. The handler must be a single\nESM module that exports a default async function receiving the\n`email.received` event (see the Webhook payload section for the\nfull schema). Code is bundled before being uploaded; ship a\nsingle self-contained file rather than relying on external\nimports.\n\n**Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`\n(optional) is capped at 5 MiB UTF-8 and is stored only on the\nedge runtime side; it is not persisted in Primitive's database.\n\n**Auto-wiring.** On successful deploy, Primitive automatically\ncreates a webhook endpoint that delivers inbound mail to the\nfunction. There is nothing to configure on the Endpoints API\nfor this to work; the gateway URL returned here is for\nreference only and is not directly callable from outside.\n\n**Secrets.** New functions ship with the managed secrets\n(`PRIMITIVE_WEBHOOK_SECRET`, `PRIMITIVE_API_KEY`) already\nbound. Add user-set secrets via\n`POST /functions/{id}/secrets`; secret writes only land in the\nrunning handler on the next redeploy.\n",
2522
+ "description": "Creates and deploys a new function. The handler must be a single\nESM module whose default export is an object with an async\n`fetch(request, env)` method (Workers-style). The gateway\nHMAC-verifies the POST against the org's webhook secret before\ninvoking the handler; the request body parses to an\n`email.received` event (see `EmailReceivedEvent` and the\nWebhook payload section for the full schema). Code is bundled\nbefore being uploaded; ship a single self-contained file rather\nthan relying on external imports.\n\n**Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`\n(optional) is capped at 5 MiB UTF-8 and is stored only on the\nedge runtime side; it is not persisted in Primitive's database.\n\n**Auto-wiring.** On successful deploy, Primitive automatically\ncreates a webhook endpoint that delivers inbound mail to the\nfunction. There is nothing to configure on the Endpoints API\nfor this to work; the gateway URL returned here is for\nreference only and is not directly callable from outside.\n\n**Secrets.** New functions ship with the managed secrets\n(`PRIMITIVE_WEBHOOK_SECRET`, `PRIMITIVE_API_KEY`) already\nbound. Add user-set secrets via\n`POST /functions/{id}/secrets`; secret writes only land in the\nrunning handler on the next redeploy.\n",
2523
2523
  "hasJsonBody": true,
2524
2524
  "method": "POST",
2525
2525
  "operationId": "createFunction",
@@ -3033,7 +3033,7 @@
3033
3033
  "functions:create-function": {
3034
3034
  "aliases": [],
3035
3035
  "args": {},
3036
- "description": "Creates and deploys a new function. The handler must be a single\nESM module that exports a default async function receiving the\n`email.received` event (see the Webhook payload section for the\nfull schema). Code is bundled before being uploaded; ship a\nsingle self-contained file rather than relying on external\nimports.\n\n**Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`\n(optional) is capped at 5 MiB UTF-8 and is stored only on the\nedge runtime side; it is not persisted in Primitive's database.\n\n**Auto-wiring.** On successful deploy, Primitive automatically\ncreates a webhook endpoint that delivers inbound mail to the\nfunction. There is nothing to configure on the Endpoints API\nfor this to work; the gateway URL returned here is for\nreference only and is not directly callable from outside.\n\n**Secrets.** New functions ship with the managed secrets\n(`PRIMITIVE_WEBHOOK_SECRET`, `PRIMITIVE_API_KEY`) already\nbound. Add user-set secrets via\n`POST /functions/{id}/secrets`; secret writes only land in the\nrunning handler on the next redeploy.\n\n\nTip: prefer `primitive functions:deploy --name <name> --file <bundle>` for file-input ergonomics. This raw command exists for callers passing JSON.",
3036
+ "description": "Creates and deploys a new function. The handler must be a single\nESM module whose default export is an object with an async\n`fetch(request, env)` method (Workers-style). The gateway\nHMAC-verifies the POST against the org's webhook secret before\ninvoking the handler; the request body parses to an\n`email.received` event (see `EmailReceivedEvent` and the\nWebhook payload section for the full schema). Code is bundled\nbefore being uploaded; ship a single self-contained file rather\nthan relying on external imports.\n\n**Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`\n(optional) is capped at 5 MiB UTF-8 and is stored only on the\nedge runtime side; it is not persisted in Primitive's database.\n\n**Auto-wiring.** On successful deploy, Primitive automatically\ncreates a webhook endpoint that delivers inbound mail to the\nfunction. There is nothing to configure on the Endpoints API\nfor this to work; the gateway URL returned here is for\nreference only and is not directly callable from outside.\n\n**Secrets.** New functions ship with the managed secrets\n(`PRIMITIVE_WEBHOOK_SECRET`, `PRIMITIVE_API_KEY`) already\nbound. Add user-set secrets via\n`POST /functions/{id}/secrets`; secret writes only land in the\nrunning handler on the next redeploy.\n\n\nTip: prefer `primitive functions:deploy --name <name> --file <bundle>` for file-input ergonomics. This raw command exists for callers passing JSON.",
3037
3037
  "flags": {
3038
3038
  "api-key": {
3039
3039
  "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
@@ -4376,5 +4376,5 @@
4376
4376
  "enableJsonFlag": false
4377
4377
  }
4378
4378
  },
4379
- "version": "0.25.2"
4379
+ "version": "0.26.1"
4380
4380
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primitivedotdev/sdk",
3
- "version": "0.25.2",
3
+ "version": "0.26.1",
4
4
  "description": "Official Primitive Node.js SDK: webhook, api, openapi, contract, and parser runtime modules. The CLI moved to @primitivedotdev/cli; this package retains the CLI as a deprecated alias for a few minor releases.",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -69,7 +69,7 @@
69
69
  "description": "Claim, verify, and manage email domains"
70
70
  },
71
71
  "emails": {
72
- "description": "List, inspect, and manage received emails. Use `primitive emails:latest` for a one-line-per-email summary of recent inbound mail."
72
+ "description": "List, inspect, and wait for received emails. `primitive emails:latest` lists the most recent inbound, `primitive emails:wait` blocks until matching inbound arrives (filter with --to/--from/--subject/--q; bounded by --timeout and --number; ideal for agents and CI), and `primitive emails:watch` streams new matches indefinitely for long-running terminals."
73
73
  },
74
74
  "sending": {
75
75
  "description": "Send outbound emails. For replies to inbound mail, use `sending:reply-to-email --id <inbound-id>` (threading and Re: subject derived server-side); for fresh sends, use `sending:send-email` or the `primitive send` shortcut."