@primitivedotdev/sdk 0.25.1 → 0.26.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,2 +1,2 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
- export { addDomain, cliLogout, createEndpoint, createFilter, createFunction, createFunctionSecret, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, deleteFunction, deleteFunctionSecret, discardEmailContent, downloadAttachments, downloadRawEmail, getAccount, getEmail, getFunction, getSendPermissions, getSentEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, listFunctions, listFunctionSecrets, listSentEmails, pollCliLogin, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, searchEmails, sendEmail, setFunctionSecret, startCliLogin, testEndpoint, testFunction, updateAccount, updateDomain, updateEndpoint, updateFilter, updateFunction, verifyDomain } from './sdk.gen.js';
2
+ export { addDomain, cliLogout, createEndpoint, createFilter, createFunction, createFunctionSecret, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, deleteFunction, deleteFunctionSecret, discardEmailContent, downloadAttachments, downloadRawEmail, getAccount, getEmail, getFunction, getSendPermissions, getSentEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, listFunctionLogs, listFunctions, listFunctionSecrets, listSentEmails, pollCliLogin, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, searchEmails, sendEmail, setFunctionSecret, startCliLogin, testEndpoint, testFunction, updateAccount, updateDomain, updateEndpoint, updateFilter, updateFunction, verifyDomain } from './sdk.gen.js';
@@ -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
@@ -854,3 +857,22 @@ export const setFunctionSecret = (options) => (options.client ?? client).put({
854
857
  ...options.headers
855
858
  }
856
859
  });
860
+ /**
861
+ * List a function's execution logs
862
+ *
863
+ * Returns the most recent `function_logs` rows for the function,
864
+ * newest first. Each row is a single `console.log` / `console.error`
865
+ * invocation captured from the running handler.
866
+ *
867
+ * Page through history with the opaque `cursor` returned as
868
+ * `next_cursor`; pass it back as the `cursor` query param on the
869
+ * next call. `next_cursor` is `null` when there are no further
870
+ * rows. The cursor format is an implementation detail and should
871
+ * not be parsed by callers.
872
+ *
873
+ */
874
+ export const listFunctionLogs = (options) => (options.client ?? client).get({
875
+ security: [{ scheme: 'bearer', type: 'http' }],
876
+ url: '/functions/{id}/logs',
877
+ ...options
878
+ });
@@ -1,3 +1,3 @@
1
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 };
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
+ 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 };
@@ -640,6 +640,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
640
640
  listEmails: () => listEmails,
641
641
  listEndpoints: () => listEndpoints,
642
642
  listFilters: () => listFilters,
643
+ listFunctionLogs: () => listFunctionLogs,
643
644
  listFunctionSecrets: () => listFunctionSecrets,
644
645
  listFunctions: () => listFunctions,
645
646
  listSentEmails: () => listSentEmails,
@@ -1424,11 +1425,14 @@ const listFunctions = (options) => (options?.client ?? client$1).get({
1424
1425
  * Deploy a function
1425
1426
  *
1426
1427
  * Creates and deploys a new function. The handler must be a single
1427
- * ESM module that exports a default async function receiving the
1428
- * `email.received` event (see the Webhook payload section for the
1429
- * full schema). Code is bundled before being uploaded; ship a
1430
- * single self-contained file rather than relying on external
1431
- * 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.
1432
1436
  *
1433
1437
  * **Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`
1434
1438
  * (optional) is capped at 5 MiB UTF-8 and is stored only on the
@@ -1650,6 +1654,28 @@ const setFunctionSecret = (options) => (options.client ?? client$1).put({
1650
1654
  ...options.headers
1651
1655
  }
1652
1656
  });
1657
+ /**
1658
+ * List a function's execution logs
1659
+ *
1660
+ * Returns the most recent `function_logs` rows for the function,
1661
+ * newest first. Each row is a single `console.log` / `console.error`
1662
+ * invocation captured from the running handler.
1663
+ *
1664
+ * Page through history with the opaque `cursor` returned as
1665
+ * `next_cursor`; pass it back as the `cursor` query param on the
1666
+ * next call. `next_cursor` is `null` when there are no further
1667
+ * rows. The cursor format is an implementation detail and should
1668
+ * not be parsed by callers.
1669
+ *
1670
+ */
1671
+ const listFunctionLogs = (options) => (options.client ?? client$1).get({
1672
+ security: [{
1673
+ scheme: "bearer",
1674
+ type: "http"
1675
+ }],
1676
+ url: "/functions/{id}/logs",
1677
+ ...options
1678
+ });
1653
1679
  //#endregion
1654
1680
  //#region src/api/verify-signature.ts
1655
1681
  /**
@@ -2078,4 +2104,4 @@ function client(options = {}) {
2078
2104
  }
2079
2105
  const operations = sdk_gen_exports;
2080
2106
  //#endregion
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 };
2107
+ export { testFunction as $, getSendPermissions as A, listFunctionSecrets as B, deleteFunctionSecret as C, getAccount as D, downloadRawEmail as E, listDomains as F, replayEmailWebhooks as G, listSentEmails as H, listEmails as I, searchEmails as J, replyToEmail as K, listEndpoints as L, getStorageStats as M, getWebhookSecret as N, getEmail as O, listDeliveries as P, testEndpoint as Q, listFilters as R, deleteFunction as S, downloadAttachments as T, pollCliLogin as U, listFunctions as V, replayDelivery as W, setFunctionSecret as X, sendEmail as Y, startCliLogin as Z, createFunctionSecret as _, PrimitiveClient as a, verifyDomain as at, deleteEndpoint as b, createPrimitiveClient as c, verifyWebhookSignature as d, updateAccount as et, addDomain as f, createFunction as g, createFilter as h, PrimitiveApiError as i, updateFunction as it, getSentEmail as j, getFunction as k, operations as l, createEndpoint as m, DEFAULT_API_BASE_URL_2 as n, updateEndpoint as nt, client as o, cliLogout as p, rotateWebhookSecret as q, PrimitiveApiClient as r, updateFilter as rt, createPrimitiveApiClient as s, DEFAULT_API_BASE_URL_1 as t, updateDomain as tt, PRIMITIVE_SIGNATURE_HEADER as u, deleteDomain as v, discardEmailContent as w, deleteFilter as x, deleteEmail as y, listFunctionLogs as z };
@@ -1707,6 +1707,52 @@ type TestInvocationResult = {
1707
1707
  */
1708
1708
  watch_url: string;
1709
1709
  };
1710
+ /**
1711
+ * One row from GET /functions/{id}/logs. Represents a single
1712
+ * captured log line emitted by the running handler (e.g. via
1713
+ * `console.log` / `console.error`).
1714
+ *
1715
+ */
1716
+ type FunctionLogRow = {
1717
+ /**
1718
+ * Unique log row id (stable across pages).
1719
+ */
1720
+ id: string;
1721
+ /**
1722
+ * The function this log row belongs to.
1723
+ */
1724
+ function_id: string;
1725
+ /**
1726
+ * Severity. `log` is the runtime's default for unannotated
1727
+ * `console.log` calls; the other levels match standard
1728
+ * `console.*` methods.
1729
+ *
1730
+ */
1731
+ level: 'debug' | 'log' | 'info' | 'warn' | 'error';
1732
+ /**
1733
+ * The textual message body. The runtime stringifies non-string
1734
+ * arguments before persisting, so this is always a plain
1735
+ * string.
1736
+ *
1737
+ */
1738
+ message: string;
1739
+ /**
1740
+ * When the handler emitted this line. Newest-first ordering
1741
+ * on this column drives pagination; clock is the runtime's,
1742
+ * not the gateway's.
1743
+ *
1744
+ */
1745
+ ts: string;
1746
+ /**
1747
+ * Optional structured payload the runtime attaches alongside
1748
+ * the message (e.g. extra args passed to `console.log`).
1749
+ * Shape is opaque; treat keys as untyped.
1750
+ *
1751
+ */
1752
+ metadata?: {
1753
+ [key: string]: unknown;
1754
+ } | null;
1755
+ };
1710
1756
  /**
1711
1757
  * One row from GET /functions/{id}/secrets. Discriminate on the
1712
1758
  * `managed` field:
@@ -3583,8 +3629,68 @@ type SetFunctionSecretResponses = {
3583
3629
  };
3584
3630
  };
3585
3631
  type SetFunctionSecretResponse = SetFunctionSecretResponses[keyof SetFunctionSecretResponses];
3632
+ type ListFunctionLogsData = {
3633
+ body?: never;
3634
+ path: {
3635
+ /**
3636
+ * Resource UUID
3637
+ */
3638
+ id: string;
3639
+ };
3640
+ query?: {
3641
+ /**
3642
+ * Maximum number of rows to return. Clamped to 1..200; default
3643
+ * 50.
3644
+ *
3645
+ */
3646
+ limit?: number;
3647
+ /**
3648
+ * Opaque pagination cursor from a previous response's
3649
+ * `next_cursor`. Omit on the first call.
3650
+ *
3651
+ */
3652
+ cursor?: string;
3653
+ };
3654
+ url: '/functions/{id}/logs';
3655
+ };
3656
+ type ListFunctionLogsErrors = {
3657
+ /**
3658
+ * Invalid request parameters
3659
+ */
3660
+ 400: ErrorResponse;
3661
+ /**
3662
+ * Invalid or missing API key
3663
+ */
3664
+ 401: ErrorResponse;
3665
+ /**
3666
+ * Authenticated caller lacks permission for the operation
3667
+ */
3668
+ 403: ErrorResponse;
3669
+ /**
3670
+ * Resource not found
3671
+ */
3672
+ 404: ErrorResponse;
3673
+ };
3674
+ type ListFunctionLogsError = ListFunctionLogsErrors[keyof ListFunctionLogsErrors];
3675
+ type ListFunctionLogsResponses = {
3676
+ /**
3677
+ * List of log rows (newest first) plus pagination cursor.
3678
+ */
3679
+ 200: SuccessEnvelope & {
3680
+ data?: {
3681
+ items: Array<FunctionLogRow>;
3682
+ /**
3683
+ * Pass back as `cursor` to fetch the next
3684
+ * page. `null` when no further rows exist.
3685
+ *
3686
+ */
3687
+ next_cursor: string | null;
3688
+ };
3689
+ };
3690
+ };
3691
+ type ListFunctionLogsResponse = ListFunctionLogsResponses[keyof ListFunctionLogsResponses];
3586
3692
  declare namespace sdk_gen_d_exports {
3587
- export { Options, addDomain, cliLogout, createEndpoint, createFilter, createFunction, createFunctionSecret, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, deleteFunction, deleteFunctionSecret, discardEmailContent, downloadAttachments, downloadRawEmail, getAccount, getEmail, getFunction, getSendPermissions, getSentEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, listFunctionSecrets, listFunctions, listSentEmails, pollCliLogin, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, searchEmails, sendEmail, setFunctionSecret, startCliLogin, testEndpoint, testFunction, updateAccount, updateDomain, updateEndpoint, updateFilter, updateFunction, verifyDomain };
3693
+ export { Options, addDomain, cliLogout, createEndpoint, createFilter, createFunction, createFunctionSecret, 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, pollCliLogin, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, searchEmails, sendEmail, setFunctionSecret, startCliLogin, testEndpoint, testFunction, updateAccount, updateDomain, updateEndpoint, updateFilter, updateFunction, verifyDomain };
3588
3694
  }
3589
3695
  type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
3590
3696
  /**
@@ -4048,11 +4154,14 @@ declare const listFunctions: <ThrowOnError extends boolean = false>(options?: Op
4048
4154
  * Deploy a function
4049
4155
  *
4050
4156
  * Creates and deploys a new function. The handler must be a single
4051
- * ESM module that exports a default async function receiving the
4052
- * `email.received` event (see the Webhook payload section for the
4053
- * full schema). Code is bundled before being uploaded; ship a
4054
- * single self-contained file rather than relying on external
4055
- * 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.
4056
4165
  *
4057
4166
  * **Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`
4058
4167
  * (optional) is capped at 5 MiB UTF-8 and is stored only on the
@@ -4191,6 +4300,21 @@ declare const deleteFunctionSecret: <ThrowOnError extends boolean = false>(optio
4191
4300
  *
4192
4301
  */
4193
4302
  declare const setFunctionSecret: <ThrowOnError extends boolean = false>(options: Options<SetFunctionSecretData, ThrowOnError>) => RequestResult<SetFunctionSecretResponses, SetFunctionSecretErrors, ThrowOnError, "fields">;
4303
+ /**
4304
+ * List a function's execution logs
4305
+ *
4306
+ * Returns the most recent `function_logs` rows for the function,
4307
+ * newest first. Each row is a single `console.log` / `console.error`
4308
+ * invocation captured from the running handler.
4309
+ *
4310
+ * Page through history with the opaque `cursor` returned as
4311
+ * `next_cursor`; pass it back as the `cursor` query param on the
4312
+ * next call. `next_cursor` is `null` when there are no further
4313
+ * rows. The cursor format is an implementation detail and should
4314
+ * not be parsed by callers.
4315
+ *
4316
+ */
4317
+ declare const listFunctionLogs: <ThrowOnError extends boolean = false>(options: Options<ListFunctionLogsData, ThrowOnError>) => RequestResult<ListFunctionLogsResponses, ListFunctionLogsErrors, ThrowOnError, "fields">;
4194
4318
  //#endregion
4195
4319
  //#region src/api/verify-signature.d.ts
4196
4320
  /**
@@ -4427,4 +4551,4 @@ declare function createPrimitiveClient(options?: PrimitiveClientOptions): Primit
4427
4551
  declare function client(options?: PrimitiveClientOptions): PrimitiveClient;
4428
4552
  declare const operations: typeof sdk_gen_d_exports;
4429
4553
  //#endregion
4430
- export { pollCliLogin as $, StorageStats as $a, ReplayDeliveryError as $i, DownloadRawEmailErrors as $n, Config as $o, GetWebhookSecretError as $r, CreateFunctionSecretData as $t, deleteEmail as A, SendMailInput as Aa, ListFunctionSecretsData as Ai, DeleteFunctionResponses as An, UpdateEndpointResponse as Ao, GetEmailResponse as Ar, CliLogoutResponse as At, getFunction as B, SentEmailSummary as Ba, ListSentEmailsData as Bi, DiscardEmailContentError as Bn, UpdateFunctionErrors as Bo, GetSendPermissionsResponse as Br, CreateFilterData as Bt, addDomain as C, SearchEmailsResponse as Ca, ListEndpointsResponses as Ci, DeleteFilterErrors as Cn, UpdateDomainInput as Co, GetAccountError as Cr, AddDomainResponses as Ct, createFunction as D, SendEmailErrors as Da, ListFiltersErrors as Di, DeleteFunctionError as Dn, UpdateEndpointError as Do, GetEmailData as Dr, CliLogoutError as Dt, createFilter as E, SendEmailError as Ea, ListFiltersError as Ei, DeleteFunctionData as En, UpdateEndpointData as Eo, GetAccountResponses as Er, CliLogoutData as Et, discardEmailContent as F, SendPermissionRule as Fa, ListFunctionsData as Fi, DeleteFunctionSecretResponses as Fn, UpdateFilterInput as Fo, GetFunctionResponse as Fr, CreateEndpointError as Ft, listDeliveries as G, SetFunctionSecretResponse as Ga, PaginationMeta as Gi, DomainVerifyResult as Gn, VerifyDomainData as Go, GetSentEmailResponse as Gr, CreateFilterResponses as Gt, getSentEmail as H, SetFunctionSecretError as Ha, ListSentEmailsErrors as Hi, DiscardEmailContentResponse as Hn, UpdateFunctionResponse as Ho, GetSentEmailData as Hr, CreateFilterErrors as Ht, downloadAttachments as I, SendPermissionYourDomain as Ia, ListFunctionsError as Ii, DeliveryStatus as In, UpdateFilterResponse as Io, GetFunctionResponses as Ir, CreateEndpointErrors as It, listEndpoints as J, StartCliLoginError as Ja, PollCliLoginErrors as Ji, DownloadAttachmentsErrors as Jn, VerifyDomainResponse as Jo, GetStorageStatsError as Jr, CreateFunctionErrors as Jt, listDomains as K, SetFunctionSecretResponses as Ka, PollCliLoginData as Ki, DownloadAttachmentsData as Kn, VerifyDomainError as Ko, GetSentEmailResponses as Kr, CreateFunctionData as Kt, downloadRawEmail as L, SendPermissionsMeta as La, ListFunctionsErrors as Li, DeliverySummary as Ln, UpdateFilterResponses as Lo, GetSendPermissionsData as Lr, CreateEndpointInput as Lt, deleteFilter as M, SendPermissionAddress as Ma, ListFunctionSecretsErrors as Mi, DeleteFunctionSecretError as Mn, UpdateFilterData as Mo, GetFunctionData as Mr, CliLogoutResult as Mt, deleteFunction as N, SendPermissionAnyRecipient as Na, ListFunctionSecretsResponse as Ni, DeleteFunctionSecretErrors as Nn, UpdateFilterError as No, GetFunctionError as Nr, ClientOptions as Nt, createFunctionSecret as O, SendEmailResponse as Oa, ListFiltersResponse as Oi, DeleteFunctionErrors as On, UpdateEndpointErrors as Oo, GetEmailError as Or, CliLogoutErrors as Ot, deleteFunctionSecret as P, SendPermissionManagedZone as Pa, ListFunctionSecretsResponses as Pi, DeleteFunctionSecretResponse as Pn, UpdateFilterErrors as Po, GetFunctionErrors as Pr, CreateEndpointData as Pt, listSentEmails as Q, StartCliLoginResponses as Qa, ReplayDeliveryData as Qi, DownloadRawEmailError as Qn, ClientOptions$1 as Qo, GetWebhookSecretData as Qr, CreateFunctionResult as Qt, getAccount as R, SentEmailDetail as Ra, ListFunctionsResponse as Ri, DiscardContentResult as Rn, UpdateFunctionData as Ro, GetSendPermissionsError as Rr, CreateEndpointResponse as Rt, Options as S, SearchEmailsErrors as Sa, ListEndpointsResponse as Si, DeleteFilterError as Sn, UpdateDomainErrors as So, GetAccountData as Sr, AddDomainResponse as St, createEndpoint as T, SendEmailData as Ta, ListFiltersData as Ti, DeleteFilterResponses as Tn, UpdateDomainResponses as To, GetAccountResponse as Tr, CliLoginStartResult as Tt, getStorageStats as U, SetFunctionSecretErrors as Ua, ListSentEmailsResponse as Ui, DiscardEmailContentResponses as Un, UpdateFunctionResponses as Uo, GetSentEmailError as Ur, CreateFilterInput as Ut, getSendPermissions as V, SetFunctionSecretData as Va, ListSentEmailsError as Vi, DiscardEmailContentErrors as Vn, UpdateFunctionInput as Vo, GetSendPermissionsResponses as Vr, CreateFilterError as Vt, getWebhookSecret as W, SetFunctionSecretInput as Wa, ListSentEmailsResponses as Wi, Domain as Wn, VerifiedDomain as Wo, GetSentEmailErrors as Wr, CreateFilterResponse as Wt, listFunctionSecrets as X, StartCliLoginInput as Xa, PollCliLoginResponse as Xi, DownloadAttachmentsResponses as Xn, WebhookSecret as Xo, GetStorageStatsResponse as Xr, CreateFunctionResponse as Xt, listFilters as Y, StartCliLoginErrors as Ya, PollCliLoginInput as Yi, DownloadAttachmentsResponse as Yn, VerifyDomainResponses as Yo, GetStorageStatsErrors as Yr, CreateFunctionInput as Yt, listFunctions as Z, StartCliLoginResponse as Za, PollCliLoginResponses as Zi, DownloadRawEmailData as Zn, Client as Zo, GetStorageStatsResponses as Zr, CreateFunctionResponses as Zt, createPrimitiveClient as _, RotateWebhookSecretErrors as _a, ListEmailsResponse as _i, DeleteEndpointError as _n, UpdateAccountInput as _o, FunctionListItem as _r, AccountUpdated as _t, PrimitiveApiClientOptions as a, ReplayEmailWebhooksErrors as aa, ListDeliveriesError as ai, Cursor as an, TestEndpointResponses as ao, EmailSearchFacets as ar, Auth as as, sendEmail as at, VerifyOptions as b, SearchEmailsData as ba, ListEndpointsError as bi, DeleteEndpointResponses as bn, UpdateDomainData as bo, GateDenial as br, AddDomainErrors as bt, PrimitiveClient as c, ReplayResult as ca, ListDeliveriesResponses as ci, DeleteDomainErrors as cn, TestFunctionErrors as co, EmailSearchResult as cr, testEndpoint as ct, RequestOptions as d, ReplyToEmailErrors as da, ListDomainsErrors as di, DeleteEmailData as dn, TestInvocationResult as do, EmailWebhookStatus as dr, updateDomain as dt, ReplayDeliveryErrors as ea, GetWebhookSecretErrors as ei, CreateFunctionSecretError as en, SuccessEnvelope as eo, DownloadRawEmailResponse as er, CreateClientConfig as es, replayDelivery as et, SendInput as f, ReplyToEmailResponse as fa, ListDomainsResponse as fi, DeleteEmailError as fn, TestResult as fo, Endpoint as fr, updateEndpoint as ft, createPrimitiveApiClient as g, RotateWebhookSecretError as ga, ListEmailsErrors as gi, DeleteEndpointData as gn, UpdateAccountErrors as go, FunctionDetail as gr, Account as gt, client as h, RotateWebhookSecretData as ha, ListEmailsError as hi, DeleteEmailResponses as hn, UpdateAccountError as ho, FunctionDeployStatus as hr, verifyDomain as ht, PrimitiveApiClient as i, ReplayEmailWebhooksError as ia, ListDeliveriesData as ii, CreateFunctionSecretResponses as in, TestEndpointResponse as io, EmailSearchFacetBucket as ir, ResponseStyle as is, searchEmails as it, deleteEndpoint as j, SendMailResult as ja, ListFunctionSecretsError as ji, DeleteFunctionSecretData as jn, UpdateEndpointResponses as jo, GetEmailResponses as jr, CliLogoutResponses as jt, deleteDomain as k, SendEmailResponses as ka, ListFiltersResponses as ki, DeleteFunctionResponse as kn, UpdateEndpointInput as ko, GetEmailErrors as kr, CliLogoutInput as kt, PrimitiveClientOptions as l, ReplyToEmailData as la, ListDomainsData as li, DeleteDomainResponse as ln, TestFunctionResponse as lo, EmailStatus as lr, testFunction as lt, SendThreadInput as m, ResourceId as ma, ListEmailsData as mi, DeleteEmailResponse as mn, UpdateAccountData as mo, Filter as mr, updateFunction as mt, DEFAULT_API_BASE_URL_2 as n, ReplayDeliveryResponses as na, GetWebhookSecretResponses as ni, CreateFunctionSecretInput as nn, TestEndpointError as no, EmailDetail as nr, RequestOptions$1 as ns, replyToEmail as nt, PrimitiveApiError as o, ReplayEmailWebhooksResponse as oa, ListDeliveriesErrors as oi, DeleteDomainData as on, TestFunctionData as oo, EmailSearchHighlights as or, setFunctionSecret as ot, SendResult as p, ReplyToEmailResponses as pa, ListDomainsResponses as pi, DeleteEmailErrors as pn, UnverifiedDomain as po, ErrorResponse as pr, updateFilter as pt, listEmails as q, StartCliLoginData as qa, PollCliLoginError as qi, DownloadAttachmentsError as qn, VerifyDomainErrors as qo, GetStorageStatsData as qr, CreateFunctionError as qt, ForwardInput as r, ReplayEmailWebhooksData as ra, Limit as ri, CreateFunctionSecretResponse as rn, TestEndpointErrors as ro, EmailDetailReply as rr, RequestResult as rs, rotateWebhookSecret as rt, PrimitiveApiErrorDetails as s, ReplayEmailWebhooksResponses as sa, ListDeliveriesResponse as si, DeleteDomainError as sn, TestFunctionError as so, EmailSearchMeta as sr, startCliLogin as st, DEFAULT_API_BASE_URL_1 as t, ReplayDeliveryResponse as ta, GetWebhookSecretResponse as ti, CreateFunctionSecretErrors as tn, TestEndpointData as to, DownloadRawEmailResponses as tr, Options$1 as ts, replayEmailWebhooks as tt, ReplyInput as u, ReplyToEmailError as ua, ListDomainsError as ui, DeleteDomainResponses as un, TestFunctionResponses as uo, EmailSummary as ur, updateAccount as ut, operations as v, RotateWebhookSecretResponse as va, ListEmailsResponses as vi, DeleteEndpointErrors as vn, UpdateAccountResponse as vo, FunctionSecretListItem as vr, AddDomainData as vt, cliLogout as w, SearchEmailsResponses as wa, ListEnvelope as wi, DeleteFilterResponse as wn, UpdateDomainResponse as wo, GetAccountErrors as wr, CliLoginPollResult as wt, verifyWebhookSignature as x, SearchEmailsError as xa, ListEndpointsErrors as xi, DeleteFilterData as xn, UpdateDomainError as xo, GateFix as xr, AddDomainInput as xt, PRIMITIVE_SIGNATURE_HEADER as y, RotateWebhookSecretResponses as ya, ListEndpointsData as yi, DeleteEndpointResponse as yn, UpdateAccountResponses as yo, FunctionSecretWriteResult as yr, AddDomainError as yt, getEmail as z, SentEmailStatus as za, ListFunctionsResponses as zi, DiscardEmailContentData as zn, UpdateFunctionError as zo, GetSendPermissionsErrors as zr, CreateEndpointResponses as zt };
4554
+ export { listSentEmails as $, SetFunctionSecretResponses as $a, PollCliLoginData as $i, DownloadRawEmailError as $n, VerifyDomainError as $o, GetStorageStatsResponses as $r, CreateFunctionResult as $t, deleteEmail as A, SearchEmailsResponse as Aa, ListFiltersResponse as Ai, DeleteFunctionResponse as An, UpdateDomainInput as Ao, GetEmailError as Ar, CliLogoutInput as At, getFunction as B, SendPermissionAnyRecipient as Ba, ListFunctionSecretsResponse as Bi, DiscardEmailContentData as Bn, UpdateFilterError as Bo, GetSendPermissionsError as Br, CreateEndpointResponses as Bt, addDomain as C, RotateWebhookSecretError as Ca, ListEndpointsErrors as Ci, DeleteFilterError as Cn, UpdateAccountErrors as Co, GateFix as Cr, AddDomainResponse as Ct, createFunction as D, SearchEmailsData as Da, ListFiltersData as Di, DeleteFunctionData as Dn, UpdateDomainData as Do, GetAccountResponse as Dr, CliLogoutData as Dt, createFilter as E, RotateWebhookSecretResponses as Ea, ListEnvelope as Ei, DeleteFilterResponses as En, UpdateAccountResponses as Eo, GetAccountErrors as Er, CliLoginStartResult as Et, discardEmailContent as F, SendEmailResponse as Fa, ListFunctionLogsResponse as Fi, DeleteFunctionSecretResponse as Fn, UpdateEndpointErrors as Fo, GetFunctionError as Fr, CreateEndpointData as Ft, listDeliveries as G, SentEmailDetail as Ga, ListFunctionsResponse as Gi, Domain as Gn, UpdateFunctionData as Go, GetSentEmailError as Gr, CreateFilterResponse as Gt, getSentEmail as H, SendPermissionRule as Ha, ListFunctionsData as Hi, DiscardEmailContentErrors as Hn, UpdateFilterInput as Ho, GetSendPermissionsResponse as Hr, CreateFilterError as Ht, downloadAttachments as I, SendEmailResponses as Ia, ListFunctionLogsResponses as Ii, DeleteFunctionSecretResponses as In, UpdateEndpointInput as Io, GetFunctionErrors as Ir, CreateEndpointError as It, listEndpoints as J, SetFunctionSecretData as Ja, ListSentEmailsError as Ji, DownloadAttachmentsError as Jn, UpdateFunctionInput as Jo, GetSentEmailResponses as Jr, CreateFunctionError as Jt, listDomains as K, SentEmailStatus as Ka, ListFunctionsResponses as Ki, DomainVerifyResult as Kn, UpdateFunctionError as Ko, GetSentEmailErrors as Kr, CreateFilterResponses as Kt, downloadRawEmail as L, SendMailInput as La, ListFunctionSecretsData as Li, DeliveryStatus as Ln, UpdateEndpointResponse as Lo, GetFunctionResponse as Lr, CreateEndpointErrors as Lt, deleteFilter as M, SendEmailData as Ma, ListFunctionLogsData as Mi, DeleteFunctionSecretData as Mn, UpdateDomainResponses as Mo, GetEmailResponse as Mr, CliLogoutResponses as Mt, deleteFunction as N, SendEmailError as Na, ListFunctionLogsError as Ni, DeleteFunctionSecretError as Nn, UpdateEndpointData as No, GetEmailResponses as Nr, CliLogoutResult as Nt, createFunctionSecret as O, SearchEmailsError as Oa, ListFiltersError as Oi, DeleteFunctionError as On, UpdateDomainError as Oo, GetAccountResponses as Or, CliLogoutError as Ot, deleteFunctionSecret as P, SendEmailErrors as Pa, ListFunctionLogsErrors as Pi, DeleteFunctionSecretErrors as Pn, UpdateEndpointError as Po, GetFunctionData as Pr, ClientOptions as Pt, listFunctions as Q, SetFunctionSecretResponse as Qa, PaginationMeta as Qi, DownloadRawEmailData as Qn, VerifyDomainData as Qo, GetStorageStatsResponse as Qr, CreateFunctionResponses as Qt, getAccount as R, SendMailResult as Ra, ListFunctionSecretsError as Ri, DeliverySummary as Rn, UpdateEndpointResponses as Ro, GetFunctionResponses as Rr, CreateEndpointInput as Rt, Options as S, RotateWebhookSecretData as Sa, ListEndpointsError as Si, DeleteFilterData as Sn, UpdateAccountError as So, GateDenial as Sr, AddDomainInput as St, createEndpoint as T, RotateWebhookSecretResponse as Ta, ListEndpointsResponses as Ti, DeleteFilterResponse as Tn, UpdateAccountResponse as To, GetAccountError as Tr, CliLoginPollResult as Tt, getStorageStats as U, SendPermissionYourDomain as Ua, ListFunctionsError as Ui, DiscardEmailContentResponse as Un, UpdateFilterResponse as Uo, GetSendPermissionsResponses as Ur, CreateFilterErrors as Ut, getSendPermissions as V, SendPermissionManagedZone as Va, ListFunctionSecretsResponses as Vi, DiscardEmailContentError as Vn, UpdateFilterErrors as Vo, GetSendPermissionsErrors as Vr, CreateFilterData as Vt, getWebhookSecret as W, SendPermissionsMeta as Wa, ListFunctionsErrors as Wi, DiscardEmailContentResponses as Wn, UpdateFilterResponses as Wo, GetSentEmailData as Wr, CreateFilterInput as Wt, listFunctionLogs as X, SetFunctionSecretErrors as Xa, ListSentEmailsResponse as Xi, DownloadAttachmentsResponse as Xn, UpdateFunctionResponses as Xo, GetStorageStatsError as Xr, CreateFunctionInput as Xt, listFilters as Y, SetFunctionSecretError as Ya, ListSentEmailsErrors as Yi, DownloadAttachmentsErrors as Yn, UpdateFunctionResponse as Yo, GetStorageStatsData as Yr, CreateFunctionErrors as Yt, listFunctionSecrets as Z, SetFunctionSecretInput as Za, ListSentEmailsResponses as Zi, DownloadAttachmentsResponses as Zn, VerifiedDomain as Zo, GetStorageStatsErrors as Zr, CreateFunctionResponse as Zt, createPrimitiveClient as _, ReplyToEmailError as _a, ListEmailsError as _i, DeleteEndpointData as _n, TestFunctionResponses as _o, FunctionDetail as _r, Account as _t, PrimitiveApiClientOptions as a, ReplayDeliveryData as aa, Limit as ai, CreateFunctionSecretResponses as an, StartCliLoginResponses as ao, EmailSearchFacetBucket as ar, ClientOptions$1 as as, searchEmails as at, VerifyOptions as b, ReplyToEmailResponses as ba, ListEmailsResponses as bi, DeleteEndpointResponse as bn, UnverifiedDomain as bo, FunctionSecretListItem as br, AddDomainError as bt, PrimitiveClient as c, ReplayDeliveryResponse as ca, ListDeliveriesErrors as ci, DeleteDomainError as cn, TestEndpointData as co, EmailSearchMeta as cr, Options$1 as cs, startCliLogin as ct, RequestOptions as d, ReplayEmailWebhooksError as da, ListDomainsData as di, DeleteDomainResponses as dn, TestEndpointResponse as do, EmailSummary as dr, ResponseStyle as ds, updateAccount as dt, PollCliLoginError as ea, GetWebhookSecretData as ei, CreateFunctionSecretData as en, StartCliLoginData as eo, DownloadRawEmailErrors as er, VerifyDomainErrors as es, pollCliLogin as et, SendInput as f, ReplayEmailWebhooksErrors as fa, ListDomainsError as fi, DeleteEmailData as fn, TestEndpointResponses as fo, EmailWebhookStatus as fr, Auth as fs, updateDomain as ft, createPrimitiveApiClient as g, ReplyToEmailData as ga, ListEmailsData as gi, DeleteEmailResponses as gn, TestFunctionResponse as go, FunctionDeployStatus as gr, verifyDomain as gt, client as h, ReplayResult as ha, ListDomainsResponses as hi, DeleteEmailResponse as hn, TestFunctionErrors as ho, Filter as hr, updateFunction as ht, PrimitiveApiClient as i, PollCliLoginResponses as ia, GetWebhookSecretResponses as ii, CreateFunctionSecretResponse as in, StartCliLoginResponse as io, EmailDetailReply as ir, Client as is, rotateWebhookSecret as it, deleteEndpoint as j, SearchEmailsResponses as ja, ListFiltersResponses as ji, DeleteFunctionResponses as jn, UpdateDomainResponse as jo, GetEmailErrors as jr, CliLogoutResponse as jt, deleteDomain as k, SearchEmailsErrors as ka, ListFiltersErrors as ki, DeleteFunctionErrors as kn, UpdateDomainErrors as ko, GetEmailData as kr, CliLogoutErrors as kt, PrimitiveClientOptions as l, ReplayDeliveryResponses as la, ListDeliveriesResponse as li, DeleteDomainErrors as ln, TestEndpointError as lo, EmailSearchResult as lr, RequestOptions$1 as ls, testEndpoint as lt, SendThreadInput as m, ReplayEmailWebhooksResponses as ma, ListDomainsResponse as mi, DeleteEmailErrors as mn, TestFunctionError as mo, ErrorResponse as mr, updateFilter as mt, DEFAULT_API_BASE_URL_2 as n, PollCliLoginInput as na, GetWebhookSecretErrors as ni, CreateFunctionSecretErrors as nn, StartCliLoginErrors as no, DownloadRawEmailResponses as nr, VerifyDomainResponses as ns, replayEmailWebhooks as nt, PrimitiveApiError as o, ReplayDeliveryError as oa, ListDeliveriesData as oi, Cursor as on, StorageStats as oo, EmailSearchFacets as or, Config as os, sendEmail as ot, SendResult as p, ReplayEmailWebhooksResponse as pa, ListDomainsErrors as pi, DeleteEmailError as pn, TestFunctionData as po, Endpoint as pr, updateEndpoint as pt, listEmails as q, SentEmailSummary as qa, ListSentEmailsData as qi, DownloadAttachmentsData as qn, UpdateFunctionErrors as qo, GetSentEmailResponse as qr, CreateFunctionData as qt, ForwardInput as r, PollCliLoginResponse as ra, GetWebhookSecretResponse as ri, CreateFunctionSecretInput as rn, StartCliLoginInput as ro, EmailDetail as rr, WebhookSecret as rs, replyToEmail as rt, PrimitiveApiErrorDetails as s, ReplayDeliveryErrors as sa, ListDeliveriesError as si, DeleteDomainData as sn, SuccessEnvelope as so, EmailSearchHighlights as sr, CreateClientConfig as ss, setFunctionSecret as st, DEFAULT_API_BASE_URL_1 as t, PollCliLoginErrors as ta, GetWebhookSecretError as ti, CreateFunctionSecretError as tn, StartCliLoginError as to, DownloadRawEmailResponse as tr, VerifyDomainResponse as ts, replayDelivery as tt, ReplyInput as u, ReplayEmailWebhooksData as ua, ListDeliveriesResponses as ui, DeleteDomainResponse as un, TestEndpointErrors as uo, EmailStatus as ur, RequestResult as us, testFunction as ut, operations as v, ReplyToEmailErrors as va, ListEmailsErrors as vi, DeleteEndpointError as vn, TestInvocationResult as vo, FunctionListItem as vr, AccountUpdated as vt, cliLogout as w, RotateWebhookSecretErrors as wa, ListEndpointsResponse as wi, DeleteFilterErrors as wn, UpdateAccountInput as wo, GetAccountData as wr, AddDomainResponses as wt, verifyWebhookSignature as x, ResourceId as xa, ListEndpointsData as xi, DeleteEndpointResponses as xn, UpdateAccountData as xo, FunctionSecretWriteResult as xr, AddDomainErrors as xt, PRIMITIVE_SIGNATURE_HEADER as y, ReplyToEmailResponse as ya, ListEmailsResponse as yi, DeleteEndpointErrors as yn, TestResult as yo, FunctionLogRow as yr, AddDomainData as yt, getEmail as z, SendPermissionAddress as za, ListFunctionSecretsErrors as zi, DiscardContentResult as zn, UpdateFilterData as zo, GetSendPermissionsData as zr, CreateEndpointResponse as zt };
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-DdITDPea.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-CoP5vKPK.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
  ],
@@ -2891,6 +2891,99 @@ export const openapiDocument = {
2891
2891
  }
2892
2892
  }
2893
2893
  }
2894
+ },
2895
+ "/functions/{id}/logs": {
2896
+ "parameters": [
2897
+ {
2898
+ "$ref": "#/components/parameters/ResourceId"
2899
+ }
2900
+ ],
2901
+ "get": {
2902
+ "operationId": "listFunctionLogs",
2903
+ "summary": "List a function's execution logs",
2904
+ "description": "Returns the most recent `function_logs` rows for the function,\nnewest first. Each row is a single `console.log` / `console.error`\ninvocation captured from the running handler.\n\nPage through history with the opaque `cursor` returned as\n`next_cursor`; pass it back as the `cursor` query param on the\nnext call. `next_cursor` is `null` when there are no further\nrows. The cursor format is an implementation detail and should\nnot be parsed by callers.\n",
2905
+ "tags": [
2906
+ "Functions"
2907
+ ],
2908
+ "parameters": [
2909
+ {
2910
+ "name": "limit",
2911
+ "in": "query",
2912
+ "required": false,
2913
+ "description": "Maximum number of rows to return. Clamped to 1..200; default\n50.\n",
2914
+ "schema": {
2915
+ "type": "integer",
2916
+ "minimum": 1,
2917
+ "maximum": 200,
2918
+ "default": 50
2919
+ }
2920
+ },
2921
+ {
2922
+ "name": "cursor",
2923
+ "in": "query",
2924
+ "required": false,
2925
+ "description": "Opaque pagination cursor from a previous response's\n`next_cursor`. Omit on the first call.\n",
2926
+ "schema": {
2927
+ "type": "string"
2928
+ }
2929
+ }
2930
+ ],
2931
+ "responses": {
2932
+ "200": {
2933
+ "description": "List of log rows (newest first) plus pagination cursor.",
2934
+ "content": {
2935
+ "application/json": {
2936
+ "schema": {
2937
+ "allOf": [
2938
+ {
2939
+ "$ref": "#/components/schemas/SuccessEnvelope"
2940
+ },
2941
+ {
2942
+ "type": "object",
2943
+ "properties": {
2944
+ "data": {
2945
+ "type": "object",
2946
+ "properties": {
2947
+ "items": {
2948
+ "type": "array",
2949
+ "items": {
2950
+ "$ref": "#/components/schemas/FunctionLogRow"
2951
+ }
2952
+ },
2953
+ "next_cursor": {
2954
+ "type": [
2955
+ "string",
2956
+ "null"
2957
+ ],
2958
+ "description": "Pass back as `cursor` to fetch the next\npage. `null` when no further rows exist.\n"
2959
+ }
2960
+ },
2961
+ "required": [
2962
+ "items",
2963
+ "next_cursor"
2964
+ ]
2965
+ }
2966
+ }
2967
+ }
2968
+ ]
2969
+ }
2970
+ }
2971
+ }
2972
+ },
2973
+ "400": {
2974
+ "$ref": "#/components/responses/ValidationError"
2975
+ },
2976
+ "401": {
2977
+ "$ref": "#/components/responses/Unauthorized"
2978
+ },
2979
+ "403": {
2980
+ "$ref": "#/components/responses/Forbidden"
2981
+ },
2982
+ "404": {
2983
+ "$ref": "#/components/responses/NotFound"
2984
+ }
2985
+ }
2986
+ }
2894
2987
  }
2895
2988
  },
2896
2989
  "components": {
@@ -5501,6 +5594,57 @@ export const openapiDocument = {
5501
5594
  "watch_url"
5502
5595
  ]
5503
5596
  },
5597
+ "FunctionLogRow": {
5598
+ "type": "object",
5599
+ "description": "One row from GET /functions/{id}/logs. Represents a single\ncaptured log line emitted by the running handler (e.g. via\n`console.log` / `console.error`).\n",
5600
+ "properties": {
5601
+ "id": {
5602
+ "type": "string",
5603
+ "format": "uuid",
5604
+ "description": "Unique log row id (stable across pages)."
5605
+ },
5606
+ "function_id": {
5607
+ "type": "string",
5608
+ "format": "uuid",
5609
+ "description": "The function this log row belongs to."
5610
+ },
5611
+ "level": {
5612
+ "type": "string",
5613
+ "enum": [
5614
+ "debug",
5615
+ "log",
5616
+ "info",
5617
+ "warn",
5618
+ "error"
5619
+ ],
5620
+ "description": "Severity. `log` is the runtime's default for unannotated\n`console.log` calls; the other levels match standard\n`console.*` methods.\n"
5621
+ },
5622
+ "message": {
5623
+ "type": "string",
5624
+ "description": "The textual message body. The runtime stringifies non-string\narguments before persisting, so this is always a plain\nstring.\n"
5625
+ },
5626
+ "ts": {
5627
+ "type": "string",
5628
+ "format": "date-time",
5629
+ "description": "When the handler emitted this line. Newest-first ordering\non this column drives pagination; clock is the runtime's,\nnot the gateway's.\n"
5630
+ },
5631
+ "metadata": {
5632
+ "type": [
5633
+ "object",
5634
+ "null"
5635
+ ],
5636
+ "additionalProperties": true,
5637
+ "description": "Optional structured payload the runtime attaches alongside\nthe message (e.g. extra args passed to `console.log`).\nShape is opaque; treat keys as untyped.\n"
5638
+ }
5639
+ },
5640
+ "required": [
5641
+ "id",
5642
+ "function_id",
5643
+ "level",
5644
+ "message",
5645
+ "ts"
5646
+ ]
5647
+ },
5504
5648
  "FunctionSecretListItem": {
5505
5649
  "type": "object",
5506
5650
  "description": "One row from GET /functions/{id}/secrets. Discriminate on the\n`managed` field:\n * `managed = true` — system secret provisioned by Primitive.\n `description` is set; `created_at` / `updated_at` are\n null because the row is virtual (resolved at deploy time\n from the managed registry, not stored in the secrets\n table).\n * `managed = false` — secret the user set via the API.\n `created_at` / `updated_at` are set; `description` is\n null.\n",
@@ -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",
@@ -2808,6 +2808,116 @@ export const operationManifest = [
2808
2808
  "tag": "Functions",
2809
2809
  "tagCommand": "functions"
2810
2810
  },
2811
+ {
2812
+ "binaryResponse": false,
2813
+ "bodyRequired": false,
2814
+ "command": "list-function-logs",
2815
+ "description": "Returns the most recent `function_logs` rows for the function,\nnewest first. Each row is a single `console.log` / `console.error`\ninvocation captured from the running handler.\n\nPage through history with the opaque `cursor` returned as\n`next_cursor`; pass it back as the `cursor` query param on the\nnext call. `next_cursor` is `null` when there are no further\nrows. The cursor format is an implementation detail and should\nnot be parsed by callers.\n",
2816
+ "hasJsonBody": false,
2817
+ "method": "GET",
2818
+ "operationId": "listFunctionLogs",
2819
+ "path": "/functions/{id}/logs",
2820
+ "pathParams": [
2821
+ {
2822
+ "description": "Resource UUID",
2823
+ "enum": null,
2824
+ "name": "id",
2825
+ "required": true,
2826
+ "type": "string"
2827
+ }
2828
+ ],
2829
+ "queryParams": [
2830
+ {
2831
+ "description": "Maximum number of rows to return. Clamped to 1..200; default\n50.\n",
2832
+ "enum": null,
2833
+ "name": "limit",
2834
+ "required": false,
2835
+ "type": "integer"
2836
+ },
2837
+ {
2838
+ "description": "Opaque pagination cursor from a previous response's\n`next_cursor`. Omit on the first call.\n",
2839
+ "enum": null,
2840
+ "name": "cursor",
2841
+ "required": false,
2842
+ "type": "string"
2843
+ }
2844
+ ],
2845
+ "requestSchema": null,
2846
+ "responseSchema": {
2847
+ "type": "object",
2848
+ "properties": {
2849
+ "items": {
2850
+ "type": "array",
2851
+ "items": {
2852
+ "type": "object",
2853
+ "description": "One row from GET /functions/{id}/logs. Represents a single\ncaptured log line emitted by the running handler (e.g. via\n`console.log` / `console.error`).\n",
2854
+ "properties": {
2855
+ "id": {
2856
+ "type": "string",
2857
+ "format": "uuid",
2858
+ "description": "Unique log row id (stable across pages)."
2859
+ },
2860
+ "function_id": {
2861
+ "type": "string",
2862
+ "format": "uuid",
2863
+ "description": "The function this log row belongs to."
2864
+ },
2865
+ "level": {
2866
+ "type": "string",
2867
+ "enum": [
2868
+ "debug",
2869
+ "log",
2870
+ "info",
2871
+ "warn",
2872
+ "error"
2873
+ ],
2874
+ "description": "Severity. `log` is the runtime's default for unannotated\n`console.log` calls; the other levels match standard\n`console.*` methods.\n"
2875
+ },
2876
+ "message": {
2877
+ "type": "string",
2878
+ "description": "The textual message body. The runtime stringifies non-string\narguments before persisting, so this is always a plain\nstring.\n"
2879
+ },
2880
+ "ts": {
2881
+ "type": "string",
2882
+ "format": "date-time",
2883
+ "description": "When the handler emitted this line. Newest-first ordering\non this column drives pagination; clock is the runtime's,\nnot the gateway's.\n"
2884
+ },
2885
+ "metadata": {
2886
+ "type": [
2887
+ "object",
2888
+ "null"
2889
+ ],
2890
+ "additionalProperties": true,
2891
+ "description": "Optional structured payload the runtime attaches alongside\nthe message (e.g. extra args passed to `console.log`).\nShape is opaque; treat keys as untyped.\n"
2892
+ }
2893
+ },
2894
+ "required": [
2895
+ "id",
2896
+ "function_id",
2897
+ "level",
2898
+ "message",
2899
+ "ts"
2900
+ ]
2901
+ }
2902
+ },
2903
+ "next_cursor": {
2904
+ "type": [
2905
+ "string",
2906
+ "null"
2907
+ ],
2908
+ "description": "Pass back as `cursor` to fetch the next\npage. `null` when no further rows exist.\n"
2909
+ }
2910
+ },
2911
+ "required": [
2912
+ "items",
2913
+ "next_cursor"
2914
+ ]
2915
+ },
2916
+ "sdkName": "listFunctionLogs",
2917
+ "summary": "List a function's execution logs",
2918
+ "tag": "Functions",
2919
+ "tagCommand": "functions"
2920
+ },
2811
2921
  {
2812
2922
  "binaryResponse": false,
2813
2923
  "bodyRequired": false,
@@ -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)",
@@ -3373,6 +3373,78 @@
3373
3373
  "summary": "Get a function",
3374
3374
  "enableJsonFlag": false
3375
3375
  },
3376
+ "functions:list-function-logs": {
3377
+ "aliases": [],
3378
+ "args": {},
3379
+ "description": "Returns the most recent `function_logs` rows for the function,\nnewest first. Each row is a single `console.log` / `console.error`\ninvocation captured from the running handler.\n\nPage through history with the opaque `cursor` returned as\n`next_cursor`; pass it back as the `cursor` query param on the\nnext call. `next_cursor` is `null` when there are no further\nrows. The cursor format is an implementation detail and should\nnot be parsed by callers.\n",
3380
+ "flags": {
3381
+ "api-key": {
3382
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
3383
+ "env": "PRIMITIVE_API_KEY",
3384
+ "name": "api-key",
3385
+ "hasDynamicHelp": false,
3386
+ "multiple": false,
3387
+ "type": "option"
3388
+ },
3389
+ "api-base-url-1": {
3390
+ "description": "Override the primary API base URL. Internal testing only; not documented to customers.",
3391
+ "env": "PRIMITIVE_API_BASE_URL_1",
3392
+ "hidden": true,
3393
+ "name": "api-base-url-1",
3394
+ "hasDynamicHelp": false,
3395
+ "multiple": false,
3396
+ "type": "option"
3397
+ },
3398
+ "api-base-url-2": {
3399
+ "description": "Override the attachments-supporting send host base URL. Internal testing only; not documented to customers.",
3400
+ "env": "PRIMITIVE_API_BASE_URL_2",
3401
+ "hidden": true,
3402
+ "name": "api-base-url-2",
3403
+ "hasDynamicHelp": false,
3404
+ "multiple": false,
3405
+ "type": "option"
3406
+ },
3407
+ "time": {
3408
+ "description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
3409
+ "name": "time",
3410
+ "allowNo": false,
3411
+ "type": "boolean"
3412
+ },
3413
+ "id": {
3414
+ "description": "Resource UUID",
3415
+ "name": "id",
3416
+ "required": true,
3417
+ "hasDynamicHelp": false,
3418
+ "multiple": false,
3419
+ "type": "option"
3420
+ },
3421
+ "limit": {
3422
+ "description": "Maximum number of rows to return. Clamped to 1..200; default\n50.\n",
3423
+ "name": "limit",
3424
+ "required": false,
3425
+ "hasDynamicHelp": false,
3426
+ "multiple": false,
3427
+ "type": "option"
3428
+ },
3429
+ "cursor": {
3430
+ "description": "Opaque pagination cursor from a previous response's\n`next_cursor`. Omit on the first call.\n",
3431
+ "name": "cursor",
3432
+ "required": false,
3433
+ "hasDynamicHelp": false,
3434
+ "multiple": false,
3435
+ "type": "option"
3436
+ }
3437
+ },
3438
+ "hasDynamicHelp": false,
3439
+ "hiddenAliases": [],
3440
+ "id": "functions:list-function-logs",
3441
+ "pluginAlias": "@primitivedotdev/sdk",
3442
+ "pluginName": "@primitivedotdev/sdk",
3443
+ "pluginType": "core",
3444
+ "strict": true,
3445
+ "summary": "List a function's execution logs",
3446
+ "enableJsonFlag": false
3447
+ },
3376
3448
  "functions:list-function-secrets": {
3377
3449
  "aliases": [],
3378
3450
  "args": {},
@@ -4304,5 +4376,5 @@
4304
4376
  "enableJsonFlag": false
4305
4377
  }
4306
4378
  },
4307
- "version": "0.25.1"
4379
+ "version": "0.26.0"
4308
4380
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primitivedotdev/sdk",
3
- "version": "0.25.1",
3
+ "version": "0.26.0",
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",