@primitivedotdev/sdk 0.26.1 → 0.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +2 -2
  2. package/dist/api/index.d.ts +5 -3
  3. package/dist/api/index.js +4 -406
  4. package/dist/{api-CnUa6o4r.js → api-CZIBnM4Q.js} +118 -92
  5. package/dist/contract/index.d.ts +2 -2
  6. package/dist/contract/index.js +1 -1
  7. package/dist/{errors-x91I_yEt.js → errors-BPJGp9I6.js} +1 -1
  8. package/dist/{errors-C53fe686.d.ts → errors-T_0JE528.d.ts} +1 -1
  9. package/dist/{index-BbEVpN5e.d.ts → index-9Rqocr-c.d.ts} +87 -75
  10. package/dist/{index-Dbx9udpX.d.ts → index-EQZK4vWT.d.ts} +2 -2
  11. package/dist/index.d.ts +4 -4
  12. package/dist/index.js +3 -3
  13. package/dist/openapi/index.d.ts +1 -52
  14. package/dist/openapi/index.js +2 -8
  15. package/dist/operations.generated-BJERV_56.d.ts +53 -0
  16. package/dist/operations.generated-T3exFpgJ.js +7632 -0
  17. package/dist/parser/index.d.ts +1 -1
  18. package/dist/parser/index.js +1 -1
  19. package/dist/webhook/index.d.ts +3 -3
  20. package/dist/webhook/index.js +2 -2
  21. package/dist/{webhook-DJkfUnFZ.js → webhook-Bra-g1q8.js} +1 -1
  22. package/package.json +9 -69
  23. package/bin/run.js +0 -20
  24. package/dist/api/generated/client/client.gen.js +0 -235
  25. package/dist/api/generated/client/index.js +0 -6
  26. package/dist/api/generated/client/types.gen.js +0 -2
  27. package/dist/api/generated/client/utils.gen.js +0 -228
  28. package/dist/api/generated/client.gen.js +0 -3
  29. package/dist/api/generated/core/auth.gen.js +0 -14
  30. package/dist/api/generated/core/bodySerializer.gen.js +0 -57
  31. package/dist/api/generated/core/params.gen.js +0 -100
  32. package/dist/api/generated/core/pathSerializer.gen.js +0 -106
  33. package/dist/api/generated/core/queryKeySerializer.gen.js +0 -92
  34. package/dist/api/generated/core/serverSentEvents.gen.js +0 -132
  35. package/dist/api/generated/core/types.gen.js +0 -2
  36. package/dist/api/generated/core/utils.gen.js +0 -87
  37. package/dist/api/generated/index.js +0 -2
  38. package/dist/api/generated/sdk.gen.js +0 -878
  39. package/dist/api/generated/types.gen.js +0 -2
  40. package/dist/api/verify-signature.js +0 -198
  41. package/dist/oclif/api-command.js +0 -755
  42. package/dist/oclif/auth.js +0 -223
  43. package/dist/oclif/commands/emails-latest.js +0 -185
  44. package/dist/oclif/commands/emails-poll.js +0 -121
  45. package/dist/oclif/commands/emails-wait.js +0 -171
  46. package/dist/oclif/commands/emails-watch.js +0 -165
  47. package/dist/oclif/commands/functions-deploy.js +0 -124
  48. package/dist/oclif/commands/functions-init.js +0 -256
  49. package/dist/oclif/commands/functions-redeploy.js +0 -113
  50. package/dist/oclif/commands/functions-set-secret.js +0 -213
  51. package/dist/oclif/commands/login.js +0 -237
  52. package/dist/oclif/commands/logout.js +0 -88
  53. package/dist/oclif/commands/send.js +0 -222
  54. package/dist/oclif/commands/whoami.js +0 -95
  55. package/dist/oclif/fish-completion.js +0 -87
  56. package/dist/oclif/index.js +0 -167
  57. package/dist/oclif/lint/raw-send-mail-fetch.js +0 -98
  58. package/dist/openapi/openapi.generated.js +0 -5754
  59. package/dist/openapi/operations.generated.js +0 -4626
  60. package/dist/parser/address-parser.js +0 -129
  61. package/dist/types.generated.js +0 -7
  62. package/dist/types.js +0 -53
  63. package/dist/webhook/errors.js +0 -224
  64. package/dist/webhook/received-email.js +0 -82
  65. package/oclif.manifest.json +0 -4380
  66. /package/dist/{address-parser-BYn8oW5r.js → address-parser-CQbFjgRC.js} +0 -0
  67. /package/dist/{types-9vXGZjPd.d.ts → types-Nslo1CU0.d.ts} +0 -0
package/README.md CHANGED
@@ -4,7 +4,7 @@ The official Node.js library for [Primitive](https://primitive.dev), an email AP
4
4
 
5
5
  ## Looking for the CLI?
6
6
 
7
- The `primitive` CLI now ships as a separate package, [`@primitivedotdev/cli`](https://www.npmjs.com/package/@primitivedotdev/cli). Install it with:
7
+ The `primitive` CLI ships as a separate package, [`@primitivedotdev/cli`](https://www.npmjs.com/package/@primitivedotdev/cli). Install it with:
8
8
 
9
9
  ```bash
10
10
  npm install -g @primitivedotdev/cli
@@ -12,7 +12,7 @@ npm install -g @primitivedotdev/cli
12
12
  npx @primitivedotdev/cli@latest <command>
13
13
  ```
14
14
 
15
- This package retains the CLI for a few minor releases for backward compatibility (`npx @primitivedotdev/sdk@latest <command>` still works and prints a one-line migration banner). The retained CLI snapshot will be removed in a future minor release.
15
+ This package no longer ships a `primitive` bin. Install `@primitivedotdev/cli` to get the CLI.
16
16
 
17
17
  ## Install
18
18
 
@@ -1,3 +1,5 @@
1
- import { f as WebhookVerificationError, p as WebhookVerificationErrorCode } from "../errors-C53fe686.js";
2
- import { $ as listSentEmails, $a as SetFunctionSecretResponses, $i as PollCliLoginData, $n as DownloadRawEmailError, $o as VerifyDomainError, $r as GetStorageStatsResponses, $t as CreateFunctionResult, A as deleteEmail, Aa as SearchEmailsResponse, Ai as ListFiltersResponse, An as DeleteFunctionResponse, Ao as UpdateDomainInput, Ar as GetEmailError, At as CliLogoutInput, B as getFunction, Ba as SendPermissionAnyRecipient, Bi as ListFunctionSecretsResponse, Bn as DiscardEmailContentData, Bo as UpdateFilterError, Br as GetSendPermissionsError, Bt as CreateEndpointResponses, C as addDomain, Ca as RotateWebhookSecretError, Ci as ListEndpointsErrors, Cn as DeleteFilterError, Co as UpdateAccountErrors, Cr as GateFix, Ct as AddDomainResponse, D as createFunction, Da as SearchEmailsData, Di as ListFiltersData, Dn as DeleteFunctionData, Do as UpdateDomainData, Dr as GetAccountResponse, Dt as CliLogoutData, E as createFilter, Ea as RotateWebhookSecretResponses, Ei as ListEnvelope, En as DeleteFilterResponses, Eo as UpdateAccountResponses, Er as GetAccountErrors, Et as CliLoginStartResult, F as discardEmailContent, Fa as SendEmailResponse, Fi as ListFunctionLogsResponse, Fn as DeleteFunctionSecretResponse, Fo as UpdateEndpointErrors, Fr as GetFunctionError, Ft as CreateEndpointData, G as listDeliveries, Ga as SentEmailDetail, Gi as ListFunctionsResponse, Gn as Domain, Go as UpdateFunctionData, Gr as GetSentEmailError, Gt as CreateFilterResponse, H as getSentEmail, Ha as SendPermissionRule, Hi as ListFunctionsData, Hn as DiscardEmailContentErrors, Ho as UpdateFilterInput, Hr as GetSendPermissionsResponse, Ht as CreateFilterError, I as downloadAttachments, Ia as SendEmailResponses, Ii as ListFunctionLogsResponses, In as DeleteFunctionSecretResponses, Io as UpdateEndpointInput, Ir as GetFunctionErrors, It as CreateEndpointError, J as listEndpoints, Ja as SetFunctionSecretData, Ji as ListSentEmailsError, Jn as DownloadAttachmentsError, Jo as UpdateFunctionInput, Jr as GetSentEmailResponses, Jt as CreateFunctionError, K as listDomains, Ka as SentEmailStatus, Ki as ListFunctionsResponses, Kn as DomainVerifyResult, Ko as UpdateFunctionError, Kr as GetSentEmailErrors, Kt as CreateFilterResponses, L as downloadRawEmail, La as SendMailInput, Li as ListFunctionSecretsData, Ln as DeliveryStatus, Lo as UpdateEndpointResponse, Lr as GetFunctionResponse, Lt as CreateEndpointErrors, M as deleteFilter, Ma as SendEmailData, Mi as ListFunctionLogsData, Mn as DeleteFunctionSecretData, Mo as UpdateDomainResponses, Mr as GetEmailResponse, Mt as CliLogoutResponses, N as deleteFunction, Na as SendEmailError, Ni as ListFunctionLogsError, Nn as DeleteFunctionSecretError, No as UpdateEndpointData, Nr as GetEmailResponses, Nt as CliLogoutResult, O as createFunctionSecret, Oa as SearchEmailsError, Oi as ListFiltersError, On as DeleteFunctionError, Oo as UpdateDomainError, Or as GetAccountResponses, Ot as CliLogoutError, P as deleteFunctionSecret, Pa as SendEmailErrors, Pi as ListFunctionLogsErrors, Pn as DeleteFunctionSecretErrors, Po as UpdateEndpointError, Pr as GetFunctionData, Pt as ClientOptions, Q as listFunctions, Qa as SetFunctionSecretResponse, Qi as PaginationMeta, Qn as DownloadRawEmailData, Qo as VerifyDomainData, Qr as GetStorageStatsResponse, Qt as CreateFunctionResponses, R as getAccount, Ra as SendMailResult, Ri as ListFunctionSecretsError, Rn as DeliverySummary, Ro as UpdateEndpointResponses, Rr as GetFunctionResponses, Rt as CreateEndpointInput, S as Options, Sa as RotateWebhookSecretData, Si as ListEndpointsError, Sn as DeleteFilterData, So as UpdateAccountError, Sr as GateDenial, St as AddDomainInput, T as createEndpoint, Ta as RotateWebhookSecretResponse, Ti as ListEndpointsResponses, Tn as DeleteFilterResponse, To as UpdateAccountResponse, Tr as GetAccountError, Tt as CliLoginPollResult, U as getStorageStats, Ua as SendPermissionYourDomain, Ui as ListFunctionsError, Un as DiscardEmailContentResponse, Uo as UpdateFilterResponse, Ur as GetSendPermissionsResponses, Ut as CreateFilterErrors, V as getSendPermissions, Va as SendPermissionManagedZone, Vi as ListFunctionSecretsResponses, Vn as DiscardEmailContentError, Vo as UpdateFilterErrors, Vr as GetSendPermissionsErrors, Vt as CreateFilterData, W as getWebhookSecret, Wa as SendPermissionsMeta, Wi as ListFunctionsErrors, Wn as DiscardEmailContentResponses, Wo as UpdateFilterResponses, Wr as GetSentEmailData, Wt as CreateFilterInput, X as listFunctionLogs, Xa as SetFunctionSecretErrors, Xi as ListSentEmailsResponse, Xn as DownloadAttachmentsResponse, Xo as UpdateFunctionResponses, Xr as GetStorageStatsError, Xt as CreateFunctionInput, Y as listFilters, Ya as SetFunctionSecretError, Yi as ListSentEmailsErrors, Yn as DownloadAttachmentsErrors, Yo as UpdateFunctionResponse, Yr as GetStorageStatsData, Yt as CreateFunctionErrors, Z as listFunctionSecrets, Za as SetFunctionSecretInput, Zi as ListSentEmailsResponses, Zn as DownloadAttachmentsResponses, Zo as VerifiedDomain, Zr as GetStorageStatsErrors, Zt as CreateFunctionResponse, _ as createPrimitiveClient, _a as ReplyToEmailError, _i as ListEmailsError, _n as DeleteEndpointData, _o as TestFunctionResponses, _r as FunctionDetail, _t as Account, a as PrimitiveApiClientOptions, aa as ReplayDeliveryData, ai as Limit, an as CreateFunctionSecretResponses, ao as StartCliLoginResponses, ar as EmailSearchFacetBucket, as as ClientOptions$1, at as searchEmails, b as VerifyOptions, ba as ReplyToEmailResponses, bi as ListEmailsResponses, bn as DeleteEndpointResponse, bo as UnverifiedDomain, br as FunctionSecretListItem, bt as AddDomainError, c as PrimitiveClient, ca as ReplayDeliveryResponse, ci as ListDeliveriesErrors, cn as DeleteDomainError, co as TestEndpointData, cr as EmailSearchMeta, cs as Options$1, ct as startCliLogin, d as RequestOptions$1, da as ReplayEmailWebhooksError, di as ListDomainsData, dn as DeleteDomainResponses, do as TestEndpointResponse, dr as EmailSummary, ds as ResponseStyle, dt as updateAccount, ea as PollCliLoginError, ei as GetWebhookSecretData, en as CreateFunctionSecretData, eo as StartCliLoginData, er as DownloadRawEmailErrors, es as VerifyDomainErrors, et as pollCliLogin, f as SendInput, fa as ReplayEmailWebhooksErrors, fi as ListDomainsError, fn as DeleteEmailData, fo as TestEndpointResponses, fr as EmailWebhookStatus, fs as Auth, ft as updateDomain, g as createPrimitiveApiClient, ga as ReplyToEmailData, gi as ListEmailsData, gn as DeleteEmailResponses, go as TestFunctionResponse, gr as FunctionDeployStatus, gt as verifyDomain, h as client, ha as ReplayResult, hi as ListDomainsResponses, hn as DeleteEmailResponse, ho as TestFunctionErrors, hr as Filter, ht as updateFunction, i as PrimitiveApiClient, ia as PollCliLoginResponses, ii as GetWebhookSecretResponses, in as CreateFunctionSecretResponse, io as StartCliLoginResponse, ir as EmailDetailReply, is as Client, it as rotateWebhookSecret, j as deleteEndpoint, ja as SearchEmailsResponses, ji as ListFiltersResponses, jn as DeleteFunctionResponses, jo as UpdateDomainResponse, jr as GetEmailErrors, jt as CliLogoutResponse, k as deleteDomain, ka as SearchEmailsErrors, ki as ListFiltersErrors, kn as DeleteFunctionErrors, ko as UpdateDomainErrors, kr as GetEmailData, kt as CliLogoutErrors, l as PrimitiveClientOptions, la as ReplayDeliveryResponses, li as ListDeliveriesResponse, ln as DeleteDomainErrors, lo as TestEndpointError, lr as EmailSearchResult, ls as RequestOptions, lt as testEndpoint, m as SendThreadInput, ma as ReplayEmailWebhooksResponses, mi as ListDomainsResponse, mn as DeleteEmailErrors, mo as TestFunctionError, mr as ErrorResponse, mt as updateFilter, n as DEFAULT_API_BASE_URL_2, na as PollCliLoginInput, ni as GetWebhookSecretErrors, nn as CreateFunctionSecretErrors, no as StartCliLoginErrors, nr as DownloadRawEmailResponses, ns as VerifyDomainResponses, nt as replayEmailWebhooks, o as PrimitiveApiError, oa as ReplayDeliveryError, oi as ListDeliveriesData, on as Cursor, oo as StorageStats, or as EmailSearchFacets, os as Config, ot as sendEmail, p as SendResult, pa as ReplayEmailWebhooksResponse, pi as ListDomainsErrors, pn as DeleteEmailError, po as TestFunctionData, pr as Endpoint, pt as updateEndpoint, q as listEmails, qa as SentEmailSummary, qi as ListSentEmailsData, qn as DownloadAttachmentsData, qo as UpdateFunctionErrors, qr as GetSentEmailResponse, qt as CreateFunctionData, r as ForwardInput, ra as PollCliLoginResponse, ri as GetWebhookSecretResponse, rn as CreateFunctionSecretInput, ro as StartCliLoginInput, rr as EmailDetail, rs as WebhookSecret, rt as replyToEmail, s as PrimitiveApiErrorDetails, sa as ReplayDeliveryErrors, si as ListDeliveriesError, sn as DeleteDomainData, so as SuccessEnvelope, sr as EmailSearchHighlights, ss as CreateClientConfig, st as setFunctionSecret, t as DEFAULT_API_BASE_URL_1, ta as PollCliLoginErrors, ti as GetWebhookSecretError, tn as CreateFunctionSecretError, to as StartCliLoginError, tr as DownloadRawEmailResponse, ts as VerifyDomainResponse, tt as replayDelivery, u as ReplyInput, ua as ReplayEmailWebhooksData, ui as ListDeliveriesResponses, un as DeleteDomainResponse, uo as TestEndpointErrors, ur as EmailStatus, us as RequestResult, ut as testFunction, v as operations, va as ReplyToEmailErrors, vi as ListEmailsErrors, vn as DeleteEndpointError, vo as TestInvocationResult, vr as FunctionListItem, vt as AccountUpdated, w as cliLogout, wa as RotateWebhookSecretErrors, wi as ListEndpointsResponse, wn as DeleteFilterErrors, wo as UpdateAccountInput, wr as GetAccountData, wt as AddDomainResponses, x as verifyWebhookSignature, xa as ResourceId, xi as ListEndpointsData, xn as DeleteEndpointResponses, xo as UpdateAccountData, xr as FunctionSecretWriteResult, xt as AddDomainErrors, y as PRIMITIVE_SIGNATURE_HEADER, ya as ReplyToEmailResponse, yi as ListEmailsResponse, yn as DeleteEndpointErrors, yo as TestResult, yr as FunctionLogRow, yt as AddDomainData, z as getEmail, za as SendPermissionAddress, zi as ListFunctionSecretsErrors, zn as DiscardContentResult, zo as UpdateFilterData, zr as GetSendPermissionsData, zt as CreateEndpointResponse } from "../index-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 };
1
+ import { $ as pollCliLogin, $a as StartCliLoginData, $i as PollCliLoginError, $n as DownloadRawEmailErrors, $o as VerifyDomainErrors, $r as GetWebhookSecretData, $t as CreateFunctionSecretData, A as deleteEndpoint, Aa as SearchEmailsResponses, Ai as ListFiltersResponses, An as DeleteFunctionResponses, Ao as UpdateDomainResponse, Ar as GetEmailErrors, At as CliLogoutInput, B as getSendPermissions, Ba as SendPermissionManagedZone, Bi as ListFunctionSecretsResponses, Bn as DiscardEmailContentError, Bo as UpdateFilterErrors, Br as GetSendPermissionsErrors, Bt as CreateFilterData, C as cliLogout, Ca as RotateWebhookSecretErrors, Ci as ListEndpointsResponse, Cn as DeleteFilterErrors, Co as UpdateAccountInput, Cr as GetAccountData, Ct as AddDomainResponse, D as createFunctionSecret, Da as SearchEmailsError, Di as ListFiltersError, Dn as DeleteFunctionError, Do as UpdateDomainError, Dr as GetAccountResponses, Dt as CliLogoutData, E as createFunction, Ea as SearchEmailsData, Ei as ListFiltersData, En as DeleteFunctionData, Eo as UpdateDomainData, Er as GetAccountResponse, Et as CliLoginStartResult, F as downloadAttachments, Fa as SendEmailResponses, Fi as ListFunctionLogsResponses, Fn as DeleteFunctionSecretResponses, Fo as UpdateEndpointInput, Fr as GetFunctionErrors, Ft as CreateEndpointError, G as listDomains, Ga as SentEmailStatus, Gi as ListFunctionsResponses, Gn as DomainVerifyResult, Go as UpdateFunctionError, Gr as GetSentEmailErrors, Gt as CreateFilterResponses, H as getStorageStats, Ha as SendPermissionYourDomain, Hi as ListFunctionsError, Hn as DiscardEmailContentResponse, Ho as UpdateFilterResponse, Hr as GetSendPermissionsResponses, Ht as CreateFilterErrors, I as downloadRawEmail, Ia as SendMailInput, Ii as ListFunctionSecretsData, In as DeliveryStatus, Io as UpdateEndpointResponse, Ir as GetFunctionResponse, It as CreateEndpointErrors, J as listFilters, Ja as SetFunctionSecretError, Ji as ListSentEmailsErrors, Jn as DownloadAttachmentsErrors, Jo as UpdateFunctionResponse, Jr as GetStorageStatsData, Jt as CreateFunctionErrors, K as listEmails, Ka as SentEmailSummary, Ki as ListSentEmailsData, Kn as DownloadAttachmentsData, Ko as UpdateFunctionErrors, Kr as GetSentEmailResponse, Kt as CreateFunctionData, L as getAccount, La as SendMailResult, Li as ListFunctionSecretsError, Ln as DeliverySummary, Lo as UpdateEndpointResponses, Lr as GetFunctionResponses, Lt as CreateEndpointInput, M as deleteFunction, Ma as SendEmailError, Mi as ListFunctionLogsError, Mn as DeleteFunctionSecretError, Mo as UpdateEndpointData, Mr as GetEmailResponses, Mt as CliLogoutResponses, N as deleteFunctionSecret, Na as SendEmailErrors, Ni as ListFunctionLogsErrors, Nn as DeleteFunctionSecretErrors, No as UpdateEndpointError, Nr as GetFunctionData, Nt as CliLogoutResult, O as deleteDomain, Oa as SearchEmailsErrors, Oi as ListFiltersErrors, On as DeleteFunctionErrors, Oo as UpdateDomainErrors, Or as GetEmailData, Ot as CliLogoutError, P as discardEmailContent, Pa as SendEmailResponse, Pi as ListFunctionLogsResponse, Pn as DeleteFunctionSecretResponse, Po as UpdateEndpointErrors, Pr as GetFunctionError, Pt as CreateEndpointData, Q as listSentEmails, Qa as SetFunctionSecretResponses, Qi as PollCliLoginData, Qn as DownloadRawEmailError, Qo as VerifyDomainError, Qr as GetStorageStatsResponses, Qt as CreateFunctionResult, R as getEmail, Ra as SendPermissionAddress, Ri as ListFunctionSecretsErrors, Rn as DiscardContentResult, Ro as UpdateFilterData, Rr as GetSendPermissionsData, Rt as CreateEndpointResponse, S as addDomain, Sa as RotateWebhookSecretError, Si as ListEndpointsErrors, Sn as DeleteFilterError, So as UpdateAccountErrors, Sr as GateFix, St as AddDomainInput, T as createFilter, Ta as RotateWebhookSecretResponses, Ti as ListEnvelope, Tn as DeleteFilterResponses, To as UpdateAccountResponses, Tr as GetAccountErrors, Tt as CliLoginPollResult, U as getWebhookSecret, Ua as SendPermissionsMeta, Ui as ListFunctionsErrors, Un as DiscardEmailContentResponses, Uo as UpdateFilterResponses, Ur as GetSentEmailData, Ut as CreateFilterInput, V as getSentEmail, Va as SendPermissionRule, Vi as ListFunctionsData, Vn as DiscardEmailContentErrors, Vo as UpdateFilterInput, Vr as GetSendPermissionsResponse, Vt as CreateFilterError, W as listDeliveries, Wa as SentEmailDetail, Wi as ListFunctionsResponse, Wn as Domain, Wo as UpdateFunctionData, Wr as GetSentEmailError, Wt as CreateFilterResponse, X as listFunctionSecrets, Xa as SetFunctionSecretInput, Xi as ListSentEmailsResponses, Xn as DownloadAttachmentsResponses, Xo as VerifiedDomain, Xr as GetStorageStatsErrors, Xt as CreateFunctionResponse, Y as listFunctionLogs, Ya as SetFunctionSecretErrors, Yi as ListSentEmailsResponse, Yn as DownloadAttachmentsResponse, Yo as UpdateFunctionResponses, Yr as GetStorageStatsError, Yt as CreateFunctionInput, Z as listFunctions, Za as SetFunctionSecretResponse, Zi as PaginationMeta, Zn as DownloadRawEmailData, Zo as VerifyDomainData, Zr as GetStorageStatsResponse, Zt as CreateFunctionResponses, _ as PrimitiveApiClientOptions, _a as ReplyToEmailErrors, _i as ListEmailsErrors, _n as DeleteEndpointError, _o as TestInvocationResult, _r as FunctionListItem, _t as Account, a as RequestOptions$2, aa as ReplayDeliveryError, ai as ListDeliveriesData, an as Cursor, ao as StorageStats, ar as EmailSearchFacets, as as ClientOptions, at as searchEmails, b as RequestOptions$1, ba as ResourceId, bi as ListEndpointsData, bn as DeleteEndpointResponses, bo as UpdateAccountData, br as FunctionSecretWriteResult, bt as AddDomainError, c as SendThreadInput, ca as ReplayDeliveryResponses, ci as ListDeliveriesResponse, cn as DeleteDomainErrors, co as TestEndpointError, cr as EmailSearchResult, cs as Options, ct as startCliLogin, d as PRIMITIVE_SIGNATURE_HEADER, da as ReplayEmailWebhooksErrors, di as ListDomainsError, dn as DeleteEmailData, do as TestEndpointResponses, dr as EmailWebhookStatus, ds as ResponseStyle, dt as updateAccount, ea as PollCliLoginErrors, ei as GetWebhookSecretError, en as CreateFunctionSecretError, eo as StartCliLoginError, er as DownloadRawEmailResponse, es as VerifyDomainResponse, et as replayDelivery, f as VerifyOptions, fa as ReplayEmailWebhooksResponse, fi as ListDomainsErrors, fn as DeleteEmailError, fo as TestFunctionData, fr as Endpoint, fs as createConfig, ft as updateDomain, g as PrimitiveApiClient, ga as ReplyToEmailError, gi as ListEmailsError, gn as DeleteEndpointData, go as TestFunctionResponses, gr as FunctionDetail, gt as verifyDomain, h as DEFAULT_API_BASE_URL_2, ha as ReplyToEmailData, hi as ListEmailsData, hn as DeleteEmailResponses, ho as TestFunctionResponse, hr as FunctionDeployStatus, ht as updateFunction, i as ReplyInput, ia as ReplayDeliveryData, ii as Limit, in as CreateFunctionSecretResponses, io as StartCliLoginResponses, ir as EmailSearchFacetBucket, is as Client, it as sdk_gen_d_exports, j as deleteFilter, ja as SendEmailData, ji as ListFunctionLogsData, jn as DeleteFunctionSecretData, jo as UpdateDomainResponses, jr as GetEmailResponse, jt as CliLogoutResponse, k as deleteEmail, ka as SearchEmailsResponse, ki as ListFiltersResponse, kn as DeleteFunctionResponse, ko as UpdateDomainInput, kr as GetEmailError, kt as CliLogoutErrors, l as client, la as ReplayEmailWebhooksData, li as ListDeliveriesResponses, ln as DeleteDomainResponse, lo as TestEndpointErrors, lr as EmailStatus, ls as RequestOptions, lt as testEndpoint, m as DEFAULT_API_BASE_URL_1, ma as ReplayResult, mi as ListDomainsResponses, mn as DeleteEmailResponse, mo as TestFunctionErrors, mr as Filter, mt as updateFilter, n as PrimitiveClient, na as PollCliLoginResponse, ni as GetWebhookSecretResponse, nn as CreateFunctionSecretInput, no as StartCliLoginInput, nr as EmailDetail, ns as WebhookSecret, nt as replyToEmail, o as SendInput, oa as ReplayDeliveryErrors, oi as ListDeliveriesError, on as DeleteDomainData, oo as SuccessEnvelope, or as EmailSearchHighlights, os as Config, ot as sendEmail, p as verifyWebhookSignature, pa as ReplayEmailWebhooksResponses, pi as ListDomainsResponse, pn as DeleteEmailErrors, po as TestFunctionError, pr as ErrorResponse, ps as Auth, pt as updateEndpoint, q as listEndpoints, qa as SetFunctionSecretData, qi as ListSentEmailsError, qn as DownloadAttachmentsError, qo as UpdateFunctionInput, qr as GetSentEmailResponses, qt as CreateFunctionError, r as PrimitiveClientOptions, ra as PollCliLoginResponses, ri as GetWebhookSecretResponses, rn as CreateFunctionSecretResponse, ro as StartCliLoginResponse, rr as EmailDetailReply, rs as createClient, rt as rotateWebhookSecret, s as SendResult, sa as ReplayDeliveryResponse, si as ListDeliveriesErrors, sn as DeleteDomainError, so as TestEndpointData, sr as EmailSearchMeta, ss as CreateClientConfig, st as setFunctionSecret, t as ForwardInput, ta as PollCliLoginInput, ti as GetWebhookSecretErrors, tn as CreateFunctionSecretErrors, to as StartCliLoginErrors, tr as DownloadRawEmailResponses, ts as VerifyDomainResponses, tt as replayEmailWebhooks, u as createPrimitiveClient, ua as ReplayEmailWebhooksError, ui as ListDomainsData, un as DeleteDomainResponses, uo as TestEndpointResponse, ur as EmailSummary, us as RequestResult, ut as testFunction, v as PrimitiveApiError, va as ReplyToEmailResponse, vi as ListEmailsResponse, vn as DeleteEndpointErrors, vo as TestResult, vr as FunctionLogRow, vt as AccountUpdated, w as createEndpoint, wa as RotateWebhookSecretResponse, wi as ListEndpointsResponses, wn as DeleteFilterResponse, wo as UpdateAccountResponse, wr as GetAccountError, wt as AddDomainResponses, x as createPrimitiveApiClient, xa as RotateWebhookSecretData, xi as ListEndpointsError, xn as DeleteFilterData, xo as UpdateAccountError, xr as GateDenial, xt as AddDomainErrors, y as PrimitiveApiErrorDetails, ya as ReplyToEmailResponses, yi as ListEmailsResponses, yn as DeleteEndpointResponse, yo as UnverifiedDomain, yr as FunctionSecretListItem, yt as AddDomainData, z as getFunction, za as SendPermissionAnyRecipient, zi as ListFunctionSecretsResponse, zn as DiscardEmailContentData, zo as UpdateFilterError, zr as GetSendPermissionsError, zt as CreateEndpointResponses } from "../index-9Rqocr-c.js";
2
+ import { i as openapiDocument, n as PrimitiveParameterManifest, r as operationManifest, t as PrimitiveOperationManifest } from "../operations.generated-BJERV_56.js";
3
+ import { u as EmailReceivedEvent } from "../types-Nslo1CU0.js";
4
+ import { b as normalizeReceivedEmail, f as WebhookVerificationError, g as ReceivedEmailThread, h as ReceivedEmailAddress, m as ReceivedEmail, p as WebhookVerificationErrorCode } from "../errors-T_0JE528.js";
5
+ export { Account, AccountUpdated, AddDomainData, AddDomainError, AddDomainErrors, AddDomainInput, AddDomainResponse, AddDomainResponses, Auth, CliLoginPollResult, CliLoginStartResult, CliLogoutData, CliLogoutError, CliLogoutErrors, CliLogoutInput, CliLogoutResponse, CliLogoutResponses, CliLogoutResult, Client, Client as PrimitiveGeneratedApiClient, ClientOptions, ClientOptions as PrimitiveGeneratedApiClientOptions, Config, Config as PrimitiveGeneratedApiConfig, 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, EmailReceivedEvent, 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, Options as PrimitiveGeneratedApiOptions, PRIMITIVE_SIGNATURE_HEADER, PaginationMeta, PollCliLoginData, PollCliLoginError, PollCliLoginErrors, PollCliLoginInput, PollCliLoginResponse, PollCliLoginResponses, PrimitiveApiClient, PrimitiveApiClientOptions, PrimitiveApiError, PrimitiveApiErrorDetails, PrimitiveClient, PrimitiveClientOptions, RequestOptions as PrimitiveGeneratedApiRequestOptions, RequestResult as PrimitiveGeneratedApiRequestResult, RequestResult, PrimitiveOperationManifest, PrimitiveParameterManifest, RequestOptions$1 as PrimitiveRequestOptions, ReceivedEmail, ReceivedEmailAddress, ReceivedEmailThread, ReplayDeliveryData, ReplayDeliveryError, ReplayDeliveryErrors, ReplayDeliveryResponse, ReplayDeliveryResponses, ReplayEmailWebhooksData, ReplayEmailWebhooksError, ReplayEmailWebhooksErrors, ReplayEmailWebhooksResponse, ReplayEmailWebhooksResponses, ReplayResult, ReplyInput, ReplyToEmailData, ReplyToEmailError, ReplyToEmailErrors, ReplyToEmailResponse, ReplyToEmailResponses, RequestOptions$2 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, createClient, createConfig, 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, normalizeReceivedEmail, openapiDocument, operationManifest, sdk_gen_d_exports as operations, pollCliLogin, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, searchEmails, sendEmail, setFunctionSecret, startCliLogin, testEndpoint, testFunction, updateAccount, updateDomain, updateEndpoint, updateFilter, updateFunction, verifyDomain, verifyWebhookSignature };
package/dist/api/index.js CHANGED
@@ -1,406 +1,4 @@
1
- /**
2
- * Primitive API client module.
3
- *
4
- * Generated operations are exported directly, and `PrimitiveApiClient`
5
- * provides a configured fetch client for those operations.
6
- */
7
- import { formatAddress } from "../webhook/received-email.js";
8
- import { createClient, createConfig, } from "./generated/client/index.js";
9
- import * as generatedOperations from "./generated/sdk.gen.js";
10
- // Default production hosts. Two-host split exists because /send-mail
11
- // needs a larger body cap than Vercel allows; host 2 is a Cloudflare
12
- // Worker that accepts ~30 MiB raw. Host 1 carries everything else.
13
- // Customers don't see this split: PrimitiveClient.send() always routes
14
- // to host 2 internally, every other operation routes to host 1.
15
- //
16
- // Both base URLs are independently overridable via constructor options.
17
- // Override is for internal staging/local testing; not part of the
18
- // publicly-supported surface.
19
- export const DEFAULT_API_BASE_URL_1 = "https://www.primitive.dev/api/v1";
20
- export const DEFAULT_API_BASE_URL_2 = "https://api.primitive.dev/v1";
21
- const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
22
- const MAX_THREAD_REFERENCES = 100;
23
- const MAX_THREAD_HEADER_BYTES = 8 * 1024;
24
- const MAX_FROM_HEADER_LENGTH = 998;
25
- const MAX_TO_HEADER_LENGTH = 320;
26
- function createDefaultAuth(apiKey) {
27
- return (security) => {
28
- if (security.type === "http" && security.scheme === "bearer") {
29
- return apiKey;
30
- }
31
- return undefined;
32
- };
33
- }
34
- function validateAddressHeader(field, value) {
35
- const trimmed = value.trim();
36
- const maxLength = field === "from" ? MAX_FROM_HEADER_LENGTH : MAX_TO_HEADER_LENGTH;
37
- if (trimmed.length < 3) {
38
- throw new TypeError(`${field} must be at least 3 characters`);
39
- }
40
- if (trimmed.length > maxLength) {
41
- throw new TypeError(`${field} must be at most ${maxLength} characters`);
42
- }
43
- }
44
- function validateEmailAddress(field, value) {
45
- if (!EMAIL_REGEX.test(value) &&
46
- !/^.+<[^\s@]+@[^\s@]+\.[^\s@]+>$/.test(value)) {
47
- throw new TypeError(`${field} must be a valid email address`);
48
- }
49
- }
50
- function validateThreadHeaderValue(field, value) {
51
- if (value.trim().length === 0) {
52
- throw new TypeError(`${field} must be a non-empty string`);
53
- }
54
- if ([...value].some((char) => {
55
- const code = char.charCodeAt(0);
56
- return code <= 0x1f || code === 0x7f;
57
- })) {
58
- throw new TypeError(`${field} must not contain control characters`);
59
- }
60
- if (value.length > 998) {
61
- throw new TypeError(`${field} must be at most 998 characters`);
62
- }
63
- }
64
- function validateSendInput(input) {
65
- validateAddressHeader("from", input.from);
66
- validateAddressHeader("to", input.to);
67
- validateEmailAddress("to", input.to);
68
- if (input.subject.trim().length === 0) {
69
- throw new TypeError("subject must be a non-empty string");
70
- }
71
- if (!input.bodyText && !input.bodyHtml) {
72
- throw new TypeError("one of bodyText or bodyHtml is required");
73
- }
74
- if (input.thread?.inReplyTo) {
75
- validateThreadHeaderValue("thread.inReplyTo", input.thread.inReplyTo);
76
- }
77
- if (input.thread?.references) {
78
- if (input.thread.references.length > MAX_THREAD_REFERENCES) {
79
- throw new TypeError(`thread.references must contain at most ${MAX_THREAD_REFERENCES} values`);
80
- }
81
- for (const [index, reference] of input.thread.references.entries()) {
82
- validateThreadHeaderValue(`thread.references[${index}]`, reference);
83
- }
84
- if (input.thread.references.join(" ").length > MAX_THREAD_HEADER_BYTES) {
85
- throw new TypeError(`thread.references header must be at most ${MAX_THREAD_HEADER_BYTES} characters`);
86
- }
87
- }
88
- if (input.waitTimeoutMs !== undefined) {
89
- if (!Number.isInteger(input.waitTimeoutMs)) {
90
- throw new TypeError("waitTimeoutMs must be an integer");
91
- }
92
- if (input.waitTimeoutMs < 1000 || input.waitTimeoutMs > 30000) {
93
- throw new TypeError("waitTimeoutMs must be between 1000 and 30000");
94
- }
95
- }
96
- }
97
- function validateForwardInput(input) {
98
- validateEmailAddress("to", input.to);
99
- if (input.subject !== undefined && input.subject.trim().length === 0) {
100
- throw new TypeError("subject must be a non-empty string");
101
- }
102
- }
103
- function parseApiErrorPayload(payload) {
104
- const fallback = {
105
- message: "Primitive API request failed",
106
- code: undefined,
107
- gates: undefined,
108
- requestId: undefined,
109
- details: undefined,
110
- };
111
- if (!payload || typeof payload !== "object") {
112
- return fallback;
113
- }
114
- if ("error" in payload &&
115
- payload.error &&
116
- typeof payload.error === "object") {
117
- const err = payload.error;
118
- return {
119
- message: typeof err.message === "string" ? err.message : fallback.message,
120
- code: typeof err.code === "string" ? err.code : undefined,
121
- gates: Array.isArray(err.gates) ? err.gates : undefined,
122
- requestId: typeof err.request_id === "string" ? err.request_id : undefined,
123
- details: err.details && typeof err.details === "object"
124
- ? err.details
125
- : undefined,
126
- };
127
- }
128
- if ("message" in payload && typeof payload.message === "string") {
129
- return { ...fallback, message: payload.message };
130
- }
131
- return fallback;
132
- }
133
- export class PrimitiveApiError extends Error {
134
- status;
135
- code;
136
- gates;
137
- requestId;
138
- retryAfter;
139
- details;
140
- payload;
141
- constructor(message, options) {
142
- super(message);
143
- this.name = "PrimitiveApiError";
144
- this.payload = options.payload;
145
- this.status = options.status;
146
- this.code = options.code;
147
- this.gates = options.gates;
148
- this.requestId = options.requestId;
149
- this.retryAfter = options.retryAfter;
150
- this.details = options.details;
151
- }
152
- }
153
- function isAbortLikeError(error) {
154
- if (!(error instanceof Error))
155
- return false;
156
- return error.name === "AbortError" || error.name === "TimeoutError";
157
- }
158
- function parseRetryAfterHeader(response) {
159
- if (!response)
160
- return undefined;
161
- const raw = response.headers.get("retry-after");
162
- if (!raw)
163
- return undefined;
164
- const seconds = Number.parseInt(raw, 10);
165
- return Number.isFinite(seconds) ? seconds : undefined;
166
- }
167
- export class PrimitiveApiClient {
168
- /**
169
- * Generated client targeting the primary API host (apiBaseUrl1). Use
170
- * this when passing `client: ...` to a generated operation function
171
- * for every endpoint EXCEPT /send-mail. The hand-written
172
- * PrimitiveClient.send / .reply / .forward methods on the subclass
173
- * route /send-mail to the host-2 client internally.
174
- */
175
- client;
176
- /**
177
- * @internal Generated client targeting the attachments-supporting
178
- * send host (apiBaseUrl2). Used by PrimitiveClient.send() under the
179
- * hood. Exposed for the CLI's hand-rolled send command, which calls
180
- * the generated sendEmail directly; not part of the publicly-
181
- * documented SDK surface. Customer code should call .send() on the
182
- * subclass instead.
183
- */
184
- _sendClient;
185
- constructor(options = {}) {
186
- const { apiKey, auth, apiBaseUrl1 = DEFAULT_API_BASE_URL_1, apiBaseUrl2 = DEFAULT_API_BASE_URL_2, ...config } = options;
187
- const resolvedAuth = auth ?? createDefaultAuth(apiKey);
188
- this.client = createClient(createConfig({
189
- ...config,
190
- auth: resolvedAuth,
191
- baseUrl: apiBaseUrl1,
192
- }));
193
- this._sendClient = createClient(createConfig({
194
- ...config,
195
- auth: resolvedAuth,
196
- baseUrl: apiBaseUrl2,
197
- }));
198
- }
199
- getConfig() {
200
- return this.client.getConfig();
201
- }
202
- setConfig(config) {
203
- return this.client.setConfig(config);
204
- }
205
- }
206
- function resolveRequestOptions(options) {
207
- const signals = [];
208
- if (options?.signal)
209
- signals.push(options.signal);
210
- if (options?.timeout !== undefined) {
211
- signals.push(AbortSignal.timeout(options.timeout));
212
- }
213
- const signal = signals.length === 0
214
- ? undefined
215
- : signals.length === 1
216
- ? signals[0]
217
- : AbortSignal.any(signals);
218
- const headers = {
219
- ...(options?.headers ?? {}),
220
- ...(options?.idempotencyKey
221
- ? { "Idempotency-Key": options.idempotencyKey }
222
- : {}),
223
- };
224
- const resolved = {};
225
- if (signal)
226
- resolved.signal = signal;
227
- if (Object.keys(headers).length > 0)
228
- resolved.headers = headers;
229
- return resolved;
230
- }
231
- export class PrimitiveClient extends PrimitiveApiClient {
232
- async send(input, options) {
233
- validateSendInput(input);
234
- const body = {
235
- from: input.from,
236
- to: input.to,
237
- subject: input.subject,
238
- ...(input.bodyText !== undefined ? { body_text: input.bodyText } : {}),
239
- ...(input.bodyHtml !== undefined ? { body_html: input.bodyHtml } : {}),
240
- ...(input.thread?.inReplyTo
241
- ? { in_reply_to: input.thread.inReplyTo }
242
- : {}),
243
- ...(input.thread?.references?.length
244
- ? { references: input.thread.references }
245
- : {}),
246
- ...(input.wait !== undefined ? { wait: input.wait } : {}),
247
- ...(input.waitTimeoutMs !== undefined
248
- ? { wait_timeout_ms: input.waitTimeoutMs }
249
- : {}),
250
- };
251
- const result = await generatedOperations.sendEmail({
252
- body,
253
- ...resolveRequestOptions(options),
254
- // /send-mail goes to the host that supports attachments. Same
255
- // request body shape on both hosts; the host swap is the only
256
- // difference. Callers don't see or configure this.
257
- client: this._sendClient,
258
- responseStyle: "fields",
259
- });
260
- return unwrapSendResult(result);
261
- }
262
- /**
263
- * Reply to an inbound email.
264
- *
265
- * Calls `POST /emails/{id}/reply`. The server derives recipients
266
- * (Reply-To, then From, then sender), subject (`Re: <parent>` with
267
- * idempotent prefix), and threading headers (`In-Reply-To`,
268
- * `References`) from the stored inbound row. The customer controls
269
- * only the body, an optional `from` override, and the `wait` flag.
270
- *
271
- * Subject overrides are intentionally not supported: Gmail's
272
- * Conversation View needs both a References match and a normalized-
273
- * subject match to thread, so a custom subject silently breaks the
274
- * thread for half the recipient population.
275
- */
276
- async reply(email, input, options) {
277
- const resolved = typeof input === "string" ? { text: input } : input;
278
- // Reject the subject override at runtime so a JS caller (no TS
279
- // types) gets the same loud error as a TS caller. Without this,
280
- // `client.reply(email, { text, subject: "Custom" })` silently
281
- // dropped subject and sent a "Re:" reply, breaking Gmail
282
- // threading without telling the caller. Mirrors Python's
283
- // ValueError. Checked before the empty-body check so passing
284
- // ONLY a subject surfaces the more informative error.
285
- if ("subject" in resolved) {
286
- throw new TypeError("reply does not support a subject override; the server prepends 'Re:' to the parent's subject for thread continuity");
287
- }
288
- if (!resolved.text && !resolved.html) {
289
- throw new TypeError("reply requires text or html");
290
- }
291
- const body = {
292
- ...(resolved.text !== undefined ? { body_text: resolved.text } : {}),
293
- ...(resolved.html !== undefined ? { body_html: resolved.html } : {}),
294
- ...(resolved.from !== undefined ? { from: resolved.from } : {}),
295
- ...(resolved.wait !== undefined ? { wait: resolved.wait } : {}),
296
- };
297
- const result = await generatedOperations.replyToEmail({
298
- body,
299
- path: { id: email.id },
300
- ...resolveRequestOptions(options),
301
- client: this.client,
302
- responseStyle: "fields",
303
- });
304
- return unwrapSendResult(result);
305
- }
306
- async forward(email, input, options) {
307
- validateForwardInput(input);
308
- return this.send({
309
- from: input.from ?? email.receivedBy,
310
- to: input.to,
311
- subject: input.subject ?? email.forwardSubject,
312
- bodyText: buildForwardText(email, input.bodyText),
313
- }, options);
314
- }
315
- }
316
- function buildForwardText(email, intro) {
317
- const lines = [
318
- ...(intro ? [intro.trim(), ""] : []),
319
- "---------- Forwarded message ----------",
320
- `From: ${formatAddress(email.sender)}`,
321
- `To: ${email.raw.email.headers.to}`,
322
- `Subject: ${email.subject ?? ""}`,
323
- ...(email.raw.email.headers.date
324
- ? [`Date: ${email.raw.email.headers.date}`]
325
- : []),
326
- ...(email.thread.messageId
327
- ? [`Message-ID: ${email.thread.messageId}`]
328
- : []),
329
- "",
330
- email.text ?? "",
331
- ];
332
- return lines.join("\n").trimEnd();
333
- }
334
- /**
335
- * Shared response handler for `send`, `reply`, and any future
336
- * operation that returns a SendMailResult envelope. Unifies the
337
- * error-mapping path so the network call sites only have to invoke
338
- * the generated operation.
339
- */
340
- function unwrapSendResult(result) {
341
- const response = result.response;
342
- if (result.error) {
343
- if (isAbortLikeError(result.error)) {
344
- throw result.error;
345
- }
346
- const parsed = parseApiErrorPayload(result.error);
347
- throw new PrimitiveApiError(parsed.message, {
348
- payload: result.error,
349
- status: response?.status,
350
- code: parsed.code,
351
- gates: parsed.gates,
352
- requestId: parsed.requestId,
353
- retryAfter: parseRetryAfterHeader(response),
354
- details: parsed.details,
355
- });
356
- }
357
- if (!result.data?.data) {
358
- throw new PrimitiveApiError("Primitive API returned no send result", {
359
- payload: result,
360
- status: response?.status,
361
- });
362
- }
363
- return mapSendResult(result.data.data);
364
- }
365
- function mapSendResult(result) {
366
- return {
367
- id: result.id,
368
- status: result.status,
369
- queueId: result.queue_id,
370
- accepted: result.accepted,
371
- rejected: result.rejected,
372
- clientIdempotencyKey: result.client_idempotency_key,
373
- requestId: result.request_id,
374
- contentHash: result.content_hash,
375
- // Default to false if the server omits the field (old-format
376
- // response, mocked partial response in a customer's tests). The
377
- // type signature claims `boolean`, so undefined would be a lie.
378
- idempotentReplay: result.idempotent_replay ?? false,
379
- ...(result.delivery_status !== undefined
380
- ? { deliveryStatus: result.delivery_status }
381
- : {}),
382
- ...(result.smtp_response_code !== undefined
383
- ? { smtpResponseCode: result.smtp_response_code }
384
- : {}),
385
- ...(result.smtp_response_text !== undefined
386
- ? { smtpResponseText: result.smtp_response_text }
387
- : {}),
388
- };
389
- }
390
- export function createPrimitiveApiClient(options = {}) {
391
- return new PrimitiveApiClient(options);
392
- }
393
- export function createPrimitiveClient(options = {}) {
394
- return new PrimitiveClient(options);
395
- }
396
- export function client(options = {}) {
397
- return new PrimitiveClient(options);
398
- }
399
- export const operations = generatedOperations;
400
- export * from "./generated/index.js";
401
- // Web Crypto verifier for in-handler webhook verification. Mirrors
402
- // the surface of `verifyWebhookSignature` from `@primitivedotdev/sdk`
403
- // (the Node version) but implements HMAC-SHA256 with `crypto.subtle`
404
- // so it can be bundled into a Primitive Function without pulling in
405
- // a `node:crypto` polyfill.
406
- export { PRIMITIVE_SIGNATURE_HEADER, verifyWebhookSignature, WebhookVerificationError, } from "./verify-signature.js";
1
+ import { $ as testFunction, A as getSentEmail, B as listFunctions, C as discardEmailContent, D as getEmail, E as getAccount, F as listEmails, G as replyToEmail, H as pollCliLogin, I as listEndpoints, J as searchEmails, K as rotateWebhookSecret, L as listFilters, M as getWebhookSecret, N as listDeliveries, O as getFunction, P as listDomains, Q as testEndpoint, R as listFunctionLogs, S as deleteFunctionSecret, T as downloadRawEmail, U as replayDelivery, V as listSentEmails, W as replayEmailWebhooks, X as setFunctionSecret, Y as sendEmail, Z as startCliLogin, _ as deleteDomain, a as verifyWebhookSignature, at as verifyDomain, b as deleteFilter, c as PrimitiveApiClient, d as addDomain, et as updateAccount, f as cliLogout, g as createFunctionSecret, h as createFunction, i as PRIMITIVE_SIGNATURE_HEADER, it as updateFunction, j as getStorageStats, k as getSendPermissions, l as PrimitiveApiError, m as createFilter, n as client, nt as updateEndpoint, o as DEFAULT_API_BASE_URL_1, ot as createClient, p as createEndpoint, q as sdk_gen_exports, r as createPrimitiveClient, rt as updateFilter, s as DEFAULT_API_BASE_URL_2, st as createConfig, t as PrimitiveClient, tt as updateDomain, u as createPrimitiveApiClient, v as deleteEmail, w as downloadAttachments, x as deleteFunction, y as deleteEndpoint, z as listFunctionSecrets } from "../api-CZIBnM4Q.js";
2
+ import { n as openapiDocument, t as operationManifest } from "../operations.generated-T3exFpgJ.js";
3
+ import { c as WebhookVerificationError, f as normalizeReceivedEmail } from "../errors-BPJGp9I6.js";
4
+ export { DEFAULT_API_BASE_URL_1, DEFAULT_API_BASE_URL_2, PRIMITIVE_SIGNATURE_HEADER, PrimitiveApiClient, PrimitiveApiError, PrimitiveClient, WebhookVerificationError, addDomain, cliLogout, client, createClient, createConfig, 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, normalizeReceivedEmail, openapiDocument, operationManifest, sdk_gen_exports as operations, pollCliLogin, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, searchEmails, sendEmail, setFunctionSecret, startCliLogin, testEndpoint, testFunction, updateAccount, updateDomain, updateEndpoint, updateFilter, updateFunction, verifyDomain, verifyWebhookSignature };