@primitivedotdev/sdk 0.27.0 → 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.
- package/dist/api/index.d.ts +5 -3
- package/dist/api/index.js +4 -3
- package/dist/{api-CnUa6o4r.js → api-CZIBnM4Q.js} +118 -92
- package/dist/contract/index.d.ts +2 -2
- package/dist/contract/index.js +1 -1
- package/dist/{errors-x91I_yEt.js → errors-BPJGp9I6.js} +1 -1
- package/dist/{errors-C53fe686.d.ts → errors-T_0JE528.d.ts} +1 -1
- package/dist/{index-BbEVpN5e.d.ts → index-9Rqocr-c.d.ts} +87 -75
- package/dist/{index-Dbx9udpX.d.ts → index-EQZK4vWT.d.ts} +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/openapi/index.d.ts +1 -52
- package/dist/openapi/index.js +1 -7631
- package/dist/operations.generated-BJERV_56.d.ts +53 -0
- package/dist/operations.generated-T3exFpgJ.js +7632 -0
- package/dist/parser/index.d.ts +1 -1
- package/dist/parser/index.js +1 -1
- package/dist/webhook/index.d.ts +3 -3
- package/dist/webhook/index.js +2 -2
- package/dist/{webhook-DJkfUnFZ.js → webhook-Bra-g1q8.js} +1 -1
- package/package.json +5 -8
- /package/dist/{address-parser-BYn8oW5r.js → address-parser-CQbFjgRC.js} +0 -0
- /package/dist/{types-9vXGZjPd.d.ts → types-Nslo1CU0.d.ts} +0 -0
package/dist/api/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
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,3 +1,4 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import {
|
|
3
|
-
|
|
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 };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-pbuEa-1d.js";
|
|
2
|
-
import { c as WebhookVerificationError, d as formatAddress } from "./errors-
|
|
3
|
-
//#region src/api/
|
|
2
|
+
import { c as WebhookVerificationError, d as formatAddress } from "./errors-BPJGp9I6.js";
|
|
3
|
+
//#region ../packages/api-core/src/api/core/bodySerializer.gen.ts
|
|
4
4
|
const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
|
|
5
5
|
//#endregion
|
|
6
|
-
//#region src/api/
|
|
6
|
+
//#region ../packages/api-core/src/api/core/serverSentEvents.gen.ts
|
|
7
7
|
function createSseClient({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }) {
|
|
8
8
|
let lastEventId;
|
|
9
9
|
const sleep = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
@@ -95,7 +95,7 @@ function createSseClient({ onRequest, onSseError, onSseEvent, responseTransforme
|
|
|
95
95
|
return { stream: createStream() };
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
|
-
//#region src/api/
|
|
98
|
+
//#region ../packages/api-core/src/api/core/pathSerializer.gen.ts
|
|
99
99
|
const separatorArrayExplode = (style) => {
|
|
100
100
|
switch (style) {
|
|
101
101
|
case "label": return ".";
|
|
@@ -174,7 +174,7 @@ const serializeObjectParam = ({ allowReserved, explode, name, style, value, valu
|
|
|
174
174
|
return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
|
|
175
175
|
};
|
|
176
176
|
//#endregion
|
|
177
|
-
//#region src/api/
|
|
177
|
+
//#region ../packages/api-core/src/api/core/utils.gen.ts
|
|
178
178
|
const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
179
179
|
const defaultPathSerializer = ({ path, url: _url }) => {
|
|
180
180
|
let url = _url;
|
|
@@ -248,7 +248,7 @@ function getValidRequestBody(options) {
|
|
|
248
248
|
if (hasBody) return options.body;
|
|
249
249
|
}
|
|
250
250
|
//#endregion
|
|
251
|
-
//#region src/api/
|
|
251
|
+
//#region ../packages/api-core/src/api/core/auth.gen.ts
|
|
252
252
|
const getAuthToken = async (auth, callback) => {
|
|
253
253
|
const token = typeof callback === "function" ? await callback(auth) : callback;
|
|
254
254
|
if (!token) return;
|
|
@@ -257,7 +257,7 @@ const getAuthToken = async (auth, callback) => {
|
|
|
257
257
|
return token;
|
|
258
258
|
};
|
|
259
259
|
//#endregion
|
|
260
|
-
//#region src/api/
|
|
260
|
+
//#region ../packages/api-core/src/api/client/utils.gen.ts
|
|
261
261
|
const createQuerySerializer = ({ parameters = {}, ...args } = {}) => {
|
|
262
262
|
const querySerializer = (queryParams) => {
|
|
263
263
|
const search = [];
|
|
@@ -429,7 +429,7 @@ const createConfig = (override = {}) => ({
|
|
|
429
429
|
...override
|
|
430
430
|
});
|
|
431
431
|
//#endregion
|
|
432
|
-
//#region src/api/
|
|
432
|
+
//#region ../packages/api-core/src/api/client/client.gen.ts
|
|
433
433
|
const createClient = (config = {}) => {
|
|
434
434
|
let _config = mergeConfigs(createConfig(), config);
|
|
435
435
|
const getConfig = () => ({ ..._config });
|
|
@@ -608,10 +608,10 @@ const createClient = (config = {}) => {
|
|
|
608
608
|
};
|
|
609
609
|
};
|
|
610
610
|
//#endregion
|
|
611
|
-
//#region src/api/
|
|
611
|
+
//#region ../packages/api-core/src/api/client.gen.ts
|
|
612
612
|
const client$1 = createClient(createConfig({ baseUrl: "https://www.primitive.dev/api/v1" }));
|
|
613
613
|
//#endregion
|
|
614
|
-
//#region src/api/
|
|
614
|
+
//#region ../packages/api-core/src/api/sdk.gen.ts
|
|
615
615
|
var sdk_gen_exports = /* @__PURE__ */ __exportAll({
|
|
616
616
|
addDomain: () => addDomain,
|
|
617
617
|
cliLogout: () => cliLogout,
|
|
@@ -1677,6 +1677,86 @@ const listFunctionLogs = (options) => (options.client ?? client$1).get({
|
|
|
1677
1677
|
...options
|
|
1678
1678
|
});
|
|
1679
1679
|
//#endregion
|
|
1680
|
+
//#region ../packages/api-core/src/client.ts
|
|
1681
|
+
/**
|
|
1682
|
+
* Host-aware Primitive API client and shared error type.
|
|
1683
|
+
*
|
|
1684
|
+
* Lives in api-core (instead of sdk-node) so the CLI can build a
|
|
1685
|
+
* configured request client without taking a dependency on sdk-node.
|
|
1686
|
+
* The higher-level `PrimitiveClient` (with `.send`, `.reply`,
|
|
1687
|
+
* `.forward`) still lives in sdk-node because it needs the
|
|
1688
|
+
* `ReceivedEmail` type from the webhook parsing surface.
|
|
1689
|
+
*/
|
|
1690
|
+
const DEFAULT_API_BASE_URL_1 = "https://www.primitive.dev/api/v1";
|
|
1691
|
+
const DEFAULT_API_BASE_URL_2 = "https://api.primitive.dev/v1";
|
|
1692
|
+
function createDefaultAuth(apiKey) {
|
|
1693
|
+
return (security) => {
|
|
1694
|
+
if (security.type === "http" && security.scheme === "bearer") return apiKey;
|
|
1695
|
+
};
|
|
1696
|
+
}
|
|
1697
|
+
var PrimitiveApiError = class extends Error {
|
|
1698
|
+
status;
|
|
1699
|
+
code;
|
|
1700
|
+
gates;
|
|
1701
|
+
requestId;
|
|
1702
|
+
retryAfter;
|
|
1703
|
+
details;
|
|
1704
|
+
payload;
|
|
1705
|
+
constructor(message, options) {
|
|
1706
|
+
super(message);
|
|
1707
|
+
this.name = "PrimitiveApiError";
|
|
1708
|
+
this.payload = options.payload;
|
|
1709
|
+
this.status = options.status;
|
|
1710
|
+
this.code = options.code;
|
|
1711
|
+
this.gates = options.gates;
|
|
1712
|
+
this.requestId = options.requestId;
|
|
1713
|
+
this.retryAfter = options.retryAfter;
|
|
1714
|
+
this.details = options.details;
|
|
1715
|
+
}
|
|
1716
|
+
};
|
|
1717
|
+
var PrimitiveApiClient = class {
|
|
1718
|
+
/**
|
|
1719
|
+
* Generated client targeting the primary API host (apiBaseUrl1). Use
|
|
1720
|
+
* this when passing `client: ...` to a generated operation function
|
|
1721
|
+
* for every endpoint EXCEPT /send-mail. The hand-written
|
|
1722
|
+
* PrimitiveClient.send / .reply / .forward methods on the subclass
|
|
1723
|
+
* route /send-mail to the host-2 client internally.
|
|
1724
|
+
*/
|
|
1725
|
+
client;
|
|
1726
|
+
/**
|
|
1727
|
+
* @internal Generated client targeting the attachments-supporting
|
|
1728
|
+
* send host (apiBaseUrl2). Used by PrimitiveClient.send() under the
|
|
1729
|
+
* hood. Exposed for the CLI's hand-rolled send command, which calls
|
|
1730
|
+
* the generated sendEmail directly; not part of the publicly-
|
|
1731
|
+
* documented SDK surface. Customer code should call .send() on the
|
|
1732
|
+
* subclass instead.
|
|
1733
|
+
*/
|
|
1734
|
+
_sendClient;
|
|
1735
|
+
constructor(options = {}) {
|
|
1736
|
+
const { apiKey, auth, apiBaseUrl1 = DEFAULT_API_BASE_URL_1, apiBaseUrl2 = DEFAULT_API_BASE_URL_2, ...config } = options;
|
|
1737
|
+
const resolvedAuth = auth ?? createDefaultAuth(apiKey);
|
|
1738
|
+
this.client = createClient(createConfig({
|
|
1739
|
+
...config,
|
|
1740
|
+
auth: resolvedAuth,
|
|
1741
|
+
baseUrl: apiBaseUrl1
|
|
1742
|
+
}));
|
|
1743
|
+
this._sendClient = createClient(createConfig({
|
|
1744
|
+
...config,
|
|
1745
|
+
auth: resolvedAuth,
|
|
1746
|
+
baseUrl: apiBaseUrl2
|
|
1747
|
+
}));
|
|
1748
|
+
}
|
|
1749
|
+
getConfig() {
|
|
1750
|
+
return this.client.getConfig();
|
|
1751
|
+
}
|
|
1752
|
+
setConfig(config) {
|
|
1753
|
+
return this.client.setConfig(config);
|
|
1754
|
+
}
|
|
1755
|
+
};
|
|
1756
|
+
function createPrimitiveApiClient(options = {}) {
|
|
1757
|
+
return new PrimitiveApiClient(options);
|
|
1758
|
+
}
|
|
1759
|
+
//#endregion
|
|
1680
1760
|
//#region src/api/verify-signature.ts
|
|
1681
1761
|
/**
|
|
1682
1762
|
* Workers-safe webhook signature verification.
|
|
@@ -1817,18 +1897,27 @@ async function verifyWebhookSignature(opts) {
|
|
|
1817
1897
|
}
|
|
1818
1898
|
//#endregion
|
|
1819
1899
|
//#region src/api/index.ts
|
|
1820
|
-
|
|
1821
|
-
|
|
1900
|
+
/**
|
|
1901
|
+
* Primitive API client module.
|
|
1902
|
+
*
|
|
1903
|
+
* The generated API surface (operations, types, host-aware client,
|
|
1904
|
+
* shared error type) lives in the workspace-internal
|
|
1905
|
+
* `@primitivedotdev/api-core` package. The bundler inlines that
|
|
1906
|
+
* code into the published `@primitivedotdev/sdk` tarball, so
|
|
1907
|
+
* consumers see a single package; the split exists only to keep
|
|
1908
|
+
* sdk-node and cli-node decoupled at the source level.
|
|
1909
|
+
*
|
|
1910
|
+
* This module re-exports the api-core surface and adds the
|
|
1911
|
+
* higher-level `PrimitiveClient` (send / reply / forward) on top.
|
|
1912
|
+
* Those high-level methods depend on the parsed `ReceivedEmail`
|
|
1913
|
+
* shape from sdk-node's webhook module, which is why they live
|
|
1914
|
+
* here rather than in api-core.
|
|
1915
|
+
*/
|
|
1822
1916
|
const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
1823
1917
|
const MAX_THREAD_REFERENCES = 100;
|
|
1824
1918
|
const MAX_THREAD_HEADER_BYTES = 8 * 1024;
|
|
1825
1919
|
const MAX_FROM_HEADER_LENGTH = 998;
|
|
1826
1920
|
const MAX_TO_HEADER_LENGTH = 320;
|
|
1827
|
-
function createDefaultAuth(apiKey) {
|
|
1828
|
-
return (security) => {
|
|
1829
|
-
if (security.type === "http" && security.scheme === "bearer") return apiKey;
|
|
1830
|
-
};
|
|
1831
|
-
}
|
|
1832
1921
|
function validateAddressHeader(field, value) {
|
|
1833
1922
|
const trimmed = value.trim();
|
|
1834
1923
|
const maxLength = field === "from" ? MAX_FROM_HEADER_LENGTH : MAX_TO_HEADER_LENGTH;
|
|
@@ -1867,6 +1956,17 @@ function validateForwardInput(input) {
|
|
|
1867
1956
|
validateEmailAddress("to", input.to);
|
|
1868
1957
|
if (input.subject !== void 0 && input.subject.trim().length === 0) throw new TypeError("subject must be a non-empty string");
|
|
1869
1958
|
}
|
|
1959
|
+
function isAbortLikeError(error) {
|
|
1960
|
+
if (!(error instanceof Error)) return false;
|
|
1961
|
+
return error.name === "AbortError" || error.name === "TimeoutError";
|
|
1962
|
+
}
|
|
1963
|
+
function parseRetryAfterHeader(response) {
|
|
1964
|
+
if (!response) return void 0;
|
|
1965
|
+
const raw = response.headers.get("retry-after");
|
|
1966
|
+
if (!raw) return void 0;
|
|
1967
|
+
const seconds = Number.parseInt(raw, 10);
|
|
1968
|
+
return Number.isFinite(seconds) ? seconds : void 0;
|
|
1969
|
+
}
|
|
1870
1970
|
function parseApiErrorPayload(payload) {
|
|
1871
1971
|
const fallback = {
|
|
1872
1972
|
message: "Primitive API request failed",
|
|
@@ -1892,76 +1992,6 @@ function parseApiErrorPayload(payload) {
|
|
|
1892
1992
|
};
|
|
1893
1993
|
return fallback;
|
|
1894
1994
|
}
|
|
1895
|
-
var PrimitiveApiError = class extends Error {
|
|
1896
|
-
status;
|
|
1897
|
-
code;
|
|
1898
|
-
gates;
|
|
1899
|
-
requestId;
|
|
1900
|
-
retryAfter;
|
|
1901
|
-
details;
|
|
1902
|
-
payload;
|
|
1903
|
-
constructor(message, options) {
|
|
1904
|
-
super(message);
|
|
1905
|
-
this.name = "PrimitiveApiError";
|
|
1906
|
-
this.payload = options.payload;
|
|
1907
|
-
this.status = options.status;
|
|
1908
|
-
this.code = options.code;
|
|
1909
|
-
this.gates = options.gates;
|
|
1910
|
-
this.requestId = options.requestId;
|
|
1911
|
-
this.retryAfter = options.retryAfter;
|
|
1912
|
-
this.details = options.details;
|
|
1913
|
-
}
|
|
1914
|
-
};
|
|
1915
|
-
function isAbortLikeError(error) {
|
|
1916
|
-
if (!(error instanceof Error)) return false;
|
|
1917
|
-
return error.name === "AbortError" || error.name === "TimeoutError";
|
|
1918
|
-
}
|
|
1919
|
-
function parseRetryAfterHeader(response) {
|
|
1920
|
-
if (!response) return void 0;
|
|
1921
|
-
const raw = response.headers.get("retry-after");
|
|
1922
|
-
if (!raw) return void 0;
|
|
1923
|
-
const seconds = Number.parseInt(raw, 10);
|
|
1924
|
-
return Number.isFinite(seconds) ? seconds : void 0;
|
|
1925
|
-
}
|
|
1926
|
-
var PrimitiveApiClient = class {
|
|
1927
|
-
/**
|
|
1928
|
-
* Generated client targeting the primary API host (apiBaseUrl1). Use
|
|
1929
|
-
* this when passing `client: ...` to a generated operation function
|
|
1930
|
-
* for every endpoint EXCEPT /send-mail. The hand-written
|
|
1931
|
-
* PrimitiveClient.send / .reply / .forward methods on the subclass
|
|
1932
|
-
* route /send-mail to the host-2 client internally.
|
|
1933
|
-
*/
|
|
1934
|
-
client;
|
|
1935
|
-
/**
|
|
1936
|
-
* @internal Generated client targeting the attachments-supporting
|
|
1937
|
-
* send host (apiBaseUrl2). Used by PrimitiveClient.send() under the
|
|
1938
|
-
* hood. Exposed for the CLI's hand-rolled send command, which calls
|
|
1939
|
-
* the generated sendEmail directly; not part of the publicly-
|
|
1940
|
-
* documented SDK surface. Customer code should call .send() on the
|
|
1941
|
-
* subclass instead.
|
|
1942
|
-
*/
|
|
1943
|
-
_sendClient;
|
|
1944
|
-
constructor(options = {}) {
|
|
1945
|
-
const { apiKey, auth, apiBaseUrl1 = DEFAULT_API_BASE_URL_1, apiBaseUrl2 = DEFAULT_API_BASE_URL_2, ...config } = options;
|
|
1946
|
-
const resolvedAuth = auth ?? createDefaultAuth(apiKey);
|
|
1947
|
-
this.client = createClient(createConfig({
|
|
1948
|
-
...config,
|
|
1949
|
-
auth: resolvedAuth,
|
|
1950
|
-
baseUrl: apiBaseUrl1
|
|
1951
|
-
}));
|
|
1952
|
-
this._sendClient = createClient(createConfig({
|
|
1953
|
-
...config,
|
|
1954
|
-
auth: resolvedAuth,
|
|
1955
|
-
baseUrl: apiBaseUrl2
|
|
1956
|
-
}));
|
|
1957
|
-
}
|
|
1958
|
-
getConfig() {
|
|
1959
|
-
return this.client.getConfig();
|
|
1960
|
-
}
|
|
1961
|
-
setConfig(config) {
|
|
1962
|
-
return this.client.setConfig(config);
|
|
1963
|
-
}
|
|
1964
|
-
};
|
|
1965
1995
|
function resolveRequestOptions(options) {
|
|
1966
1996
|
const signals = [];
|
|
1967
1997
|
if (options?.signal) signals.push(options.signal);
|
|
@@ -2093,15 +2123,11 @@ function mapSendResult(result) {
|
|
|
2093
2123
|
...result.smtp_response_text !== void 0 ? { smtpResponseText: result.smtp_response_text } : {}
|
|
2094
2124
|
};
|
|
2095
2125
|
}
|
|
2096
|
-
function createPrimitiveApiClient(options = {}) {
|
|
2097
|
-
return new PrimitiveApiClient(options);
|
|
2098
|
-
}
|
|
2099
2126
|
function createPrimitiveClient(options = {}) {
|
|
2100
2127
|
return new PrimitiveClient(options);
|
|
2101
2128
|
}
|
|
2102
2129
|
function client(options = {}) {
|
|
2103
2130
|
return new PrimitiveClient(options);
|
|
2104
2131
|
}
|
|
2105
|
-
const operations = sdk_gen_exports;
|
|
2106
2132
|
//#endregion
|
|
2107
|
-
export { testFunction as $,
|
|
2133
|
+
export { testFunction as $, getSentEmail as A, listFunctions as B, discardEmailContent as C, getEmail as D, getAccount as E, listEmails as F, replyToEmail as G, pollCliLogin as H, listEndpoints as I, searchEmails as J, rotateWebhookSecret as K, listFilters as L, getWebhookSecret as M, listDeliveries as N, getFunction as O, listDomains as P, testEndpoint as Q, listFunctionLogs as R, deleteFunctionSecret as S, downloadRawEmail as T, replayDelivery as U, listSentEmails as V, replayEmailWebhooks as W, setFunctionSecret as X, sendEmail as Y, startCliLogin as Z, deleteDomain as _, verifyWebhookSignature as a, verifyDomain as at, deleteFilter as b, PrimitiveApiClient as c, addDomain as d, updateAccount as et, cliLogout as f, createFunctionSecret as g, createFunction as h, PRIMITIVE_SIGNATURE_HEADER as i, updateFunction as it, getStorageStats as j, getSendPermissions as k, PrimitiveApiError as l, createFilter as m, client as n, updateEndpoint as nt, DEFAULT_API_BASE_URL_1 as o, createClient as ot, createEndpoint as p, sdk_gen_exports as q, createPrimitiveClient as r, updateFilter as rt, DEFAULT_API_BASE_URL_2 as s, createConfig as st, PrimitiveClient as t, updateDomain as tt, createPrimitiveApiClient as u, deleteEmail as v, downloadAttachments as w, deleteFunction as x, deleteEndpoint as y, listFunctionSecrets as z };
|
package/dist/contract/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ParsedDataFailed, D as RawContentDownloadOnly, M as WebhookAttachment, O as RawContentInline, S as ParsedDataComplete, c as EmailAnalysis, l as EmailAuth, s as EmailAddress, u as EmailReceivedEvent, w as ParsedError } from "../types-
|
|
2
|
-
import { C as signStandardWebhooksPayload, h as WEBHOOK_VERSION, j as signWebhookPayload, k as SignResult, x as StandardWebhooksSignResult } from "../index-
|
|
1
|
+
import { C as ParsedDataFailed, D as RawContentDownloadOnly, M as WebhookAttachment, O as RawContentInline, S as ParsedDataComplete, c as EmailAnalysis, l as EmailAuth, s as EmailAddress, u as EmailReceivedEvent, w as ParsedError } from "../types-Nslo1CU0.js";
|
|
2
|
+
import { C as signStandardWebhooksPayload, h as WEBHOOK_VERSION, j as signWebhookPayload, k as SignResult, x as StandardWebhooksSignResult } from "../index-EQZK4vWT.js";
|
|
3
3
|
|
|
4
4
|
//#region src/contract/contract.d.ts
|
|
5
5
|
/** Maximum raw email size for inline inclusion (256 KB). */
|
package/dist/contract/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as signStandardWebhooksPayload, L as validateEmailReceivedEvent, M as signWebhookPayload, d as WEBHOOK_VERSION } from "../webhook-
|
|
1
|
+
import { E as signStandardWebhooksPayload, L as validateEmailReceivedEvent, M as signWebhookPayload, d as WEBHOOK_VERSION } from "../webhook-Bra-g1q8.js";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
//#region src/contract/contract.ts
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as parseFromHeaderLoose } from "./address-parser-
|
|
1
|
+
import { n as parseFromHeaderLoose } from "./address-parser-CQbFjgRC.js";
|
|
2
2
|
//#region src/webhook/received-email.ts
|
|
3
3
|
const REPLY_PREFIX_RE = /^re\s*:/i;
|
|
4
4
|
const FORWARD_PREFIX_RE = /^(fwd?|fw)\s*:/i;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as WebhookAttachment, c as EmailAnalysis, l as EmailAuth, u as EmailReceivedEvent } from "./types-
|
|
1
|
+
import { M as WebhookAttachment, c as EmailAnalysis, l as EmailAuth, u as EmailReceivedEvent } from "./types-Nslo1CU0.js";
|
|
2
2
|
import { ErrorObject } from "ajv";
|
|
3
3
|
|
|
4
4
|
//#region src/webhook/received-email.d.ts
|