@primitivedotdev/sdk 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/generated/index.js +1 -1
- package/dist/api/generated/sdk.gen.js +47 -1
- package/dist/api/index.d.ts +2 -2
- package/dist/{api-DH-YKt7a.js → api-CTf0cUsi.js} +52 -2
- package/dist/{index-Cts9r1sL.d.ts → index-SK_HbwVN.d.ts} +210 -11
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/oclif/commands/emails-latest.js +44 -7
- package/dist/oclif/commands/send.js +1 -0
- package/dist/oclif/index.js +10 -1
- package/dist/openapi/index.d.ts +6 -0
- package/dist/openapi/openapi.generated.js +113 -48
- package/dist/openapi/operations.generated.js +2267 -18
- package/oclif.manifest.json +57 -14
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
export { addDomain, createEndpoint, createFilter, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, downloadAttachments, downloadRawEmail, getAccount, getEmail, getSendPermissions, getSentEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, listSentEmails, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, sendEmail, testEndpoint, updateAccount, updateDomain, updateEndpoint, updateFilter, verifyDomain } from './sdk.gen.js';
|
|
2
|
+
export { addDomain, createEndpoint, createFilter, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, discardEmailContent, downloadAttachments, downloadRawEmail, getAccount, getEmail, getSendPermissions, getSentEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, listSentEmails, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, sendEmail, testEndpoint, updateAccount, updateDomain, updateEndpoint, updateFilter, verifyDomain } from './sdk.gen.js';
|
|
@@ -147,7 +147,30 @@ export const deleteEmail = (options) => (options.client ?? client).delete({
|
|
|
147
147
|
...options
|
|
148
148
|
});
|
|
149
149
|
/**
|
|
150
|
-
* Get email
|
|
150
|
+
* Get inbound email by id
|
|
151
|
+
*
|
|
152
|
+
* Returns the full record for an inbound email received at one
|
|
153
|
+
* of your verified domains, including the parsed text and HTML
|
|
154
|
+
* bodies, threading metadata, SMTP envelope detail, webhook
|
|
155
|
+
* delivery state, and a `replies` array for any outbound sends
|
|
156
|
+
* recorded as replies to this inbound.
|
|
157
|
+
*
|
|
158
|
+
* For listing inbound emails (with cursor pagination, status
|
|
159
|
+
* and date filters, and free-text search), use
|
|
160
|
+
* `/emails`. Outbound (sent) email records are NOT returned
|
|
161
|
+
* here; use `/sent-emails/{id}` for those.
|
|
162
|
+
*
|
|
163
|
+
* The response carries four sender-shaped fields whose
|
|
164
|
+
* meanings overlap. `from_email` is the canonical "who sent
|
|
165
|
+
* this" field for most use cases (parsed bare address from
|
|
166
|
+
* the `From:` header, with a `sender` fallback). `from_header`
|
|
167
|
+
* is the raw header including any display name. `sender` and
|
|
168
|
+
* `smtp_mail_from` both carry the SMTP envelope MAIL FROM
|
|
169
|
+
* (return-path) and are equal by construction; `sender` is
|
|
170
|
+
* the older field name retained for compatibility. See
|
|
171
|
+
* `primitive describe emails:get-email | jq '.responseSchema.properties'`
|
|
172
|
+
* for per-field detail.
|
|
173
|
+
*
|
|
151
174
|
*/
|
|
152
175
|
export const getEmail = (options) => (options.client ?? client).get({
|
|
153
176
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
@@ -229,6 +252,29 @@ export const replayEmailWebhooks = (options) => (options.client ?? client).post(
|
|
|
229
252
|
url: '/emails/{id}/replay',
|
|
230
253
|
...options
|
|
231
254
|
});
|
|
255
|
+
/**
|
|
256
|
+
* Discard email content
|
|
257
|
+
*
|
|
258
|
+
* Permanently deletes the email's raw bytes, parsed body (text + HTML),
|
|
259
|
+
* and attachments while preserving metadata (sender, recipient,
|
|
260
|
+
* subject, timestamps, hashes, attachment manifest) for audit logs.
|
|
261
|
+
* Idempotent: a second call returns success with
|
|
262
|
+
* `already_discarded: true` and does no work.
|
|
263
|
+
*
|
|
264
|
+
* **Gated** on the customer's discard-content opt-in (managed in the
|
|
265
|
+
* dashboard at Settings > Webhooks). When the toggle is off, this
|
|
266
|
+
* endpoint returns `403` with code `discard_not_enabled` and a
|
|
267
|
+
* message pointing the human at the dashboard. There is intentionally
|
|
268
|
+
* no API to flip this toggle — opting in to a destructive,
|
|
269
|
+
* non-reversible operation must be a deliberate human click in the
|
|
270
|
+
* UI.
|
|
271
|
+
*
|
|
272
|
+
*/
|
|
273
|
+
export const discardEmailContent = (options) => (options.client ?? client).post({
|
|
274
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
275
|
+
url: '/emails/{id}/discard-content',
|
|
276
|
+
...options
|
|
277
|
+
});
|
|
232
278
|
/**
|
|
233
279
|
* List webhook endpoints
|
|
234
280
|
*
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { Account, AccountUpdated, AddDomainData, AddDomainError, AddDomainErrors, AddDomainInput, AddDomainResponse, AddDomainResponses, Auth, ClientOptions, CreateClientConfig, CreateEndpointData, CreateEndpointError, CreateEndpointErrors, CreateEndpointInput, CreateEndpointResponse, CreateEndpointResponses, CreateFilterData, CreateFilterError, CreateFilterErrors, CreateFilterInput, CreateFilterResponse, CreateFilterResponses, Cursor, DEFAULT_BASE_URL, DeleteDomainData, DeleteDomainError, DeleteDomainErrors, DeleteDomainResponse, DeleteDomainResponses, DeleteEmailData, DeleteEmailError, DeleteEmailErrors, DeleteEmailResponse, DeleteEmailResponses, DeleteEndpointData, DeleteEndpointError, DeleteEndpointErrors, DeleteEndpointResponse, DeleteEndpointResponses, DeleteFilterData, DeleteFilterError, DeleteFilterErrors, DeleteFilterResponse, DeleteFilterResponses, DeliveryStatus, DeliverySummary, Domain, DomainVerifyResult, DownloadAttachmentsData, DownloadAttachmentsError, DownloadAttachmentsErrors, DownloadAttachmentsResponse, DownloadAttachmentsResponses, DownloadRawEmailData, DownloadRawEmailError, DownloadRawEmailErrors, DownloadRawEmailResponse, DownloadRawEmailResponses, EmailDetail, EmailDetailReply, EmailSummary, Endpoint, ErrorResponse, Filter, ForwardInput, GateDenial, GateFix, GetAccountData, GetAccountError, GetAccountErrors, GetAccountResponse, GetAccountResponses, GetEmailData, GetEmailError, GetEmailErrors, GetEmailResponse, GetEmailResponses, 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, ListSentEmailsData, ListSentEmailsError, ListSentEmailsErrors, ListSentEmailsResponse, ListSentEmailsResponses, Options, PaginationMeta, 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, ResourceId, ResponseStyle, RotateWebhookSecretData, RotateWebhookSecretError, RotateWebhookSecretErrors, RotateWebhookSecretResponse, RotateWebhookSecretResponses, SendEmailData, SendEmailError, SendEmailErrors, SendEmailResponse, SendEmailResponses, SendInput, SendMailInput, SendMailResult, SendPermissionAddress, SendPermissionAnyRecipient, SendPermissionManagedZone, SendPermissionRule, SendPermissionYourDomain, SendPermissionsMeta, SendResult, SendThreadInput, SentEmailDetail, SentEmailStatus, SentEmailSummary, StorageStats, SuccessEnvelope, TestEndpointData, TestEndpointError, TestEndpointErrors, TestEndpointResponse, TestEndpointResponses, 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, VerifiedDomain, VerifyDomainData, VerifyDomainError, VerifyDomainErrors, VerifyDomainResponse, VerifyDomainResponses, WebhookSecret, addDomain, client, createEndpoint, createFilter, createPrimitiveApiClient, createPrimitiveClient, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, downloadAttachments, downloadRawEmail, getAccount, getEmail, getSendPermissions, getSentEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, listSentEmails, operations, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, sendEmail, testEndpoint, updateAccount, updateDomain, updateEndpoint, updateFilter, verifyDomain };
|
|
1
|
+
import { $ as AddDomainData, $i as RequestOptions, $n as ListDomainsErrors, $r as SendPermissionAddress, $t as DownloadAttachmentsResponses, A as getSendPermissions, Ai as UpdateEndpointError, An as GetSentEmailData, Ar as ReplayEmailWebhooksError, At as DeleteEndpointError, B as replayDelivery, Bi as UpdateFilterResponses, Bn as GetWebhookSecretData, Br as ResourceId, Bt as DeliverySummary, C as deleteEndpoint, Ci as UpdateDomainData, Cn as GetEmailResponse, Cr as PaginationMeta, Ct as DeleteDomainResponses, D as downloadRawEmail, Di as UpdateDomainResponse, Dn as GetSendPermissionsErrors, Dr as ReplayDeliveryResponse, Dt as DeleteEmailResponse, E as downloadAttachments, Ei as UpdateDomainInput, En as GetSendPermissionsError, Er as ReplayDeliveryErrors, Et as DeleteEmailErrors, F as listDomains, Fi as UpdateFilterData, Fn as GetStorageStatsData, Fr as ReplyToEmailData, Ft as DeleteFilterError, G as testEndpoint, Gi as VerifyDomainResponse, Gn as Limit, Gr as RotateWebhookSecretResponses, Gt as DiscardEmailContentResponse, H as replyToEmail, Hi as VerifyDomainData, Hn as GetWebhookSecretErrors, Hr as RotateWebhookSecretError, Ht as DiscardEmailContentData, I as listEmails, Ii as UpdateFilterError, In as GetStorageStatsError, Ir as ReplyToEmailError, It as DeleteFilterErrors, J as updateEndpoint, Ji as Client, Jn as ListDeliveriesErrors, Jr as SendEmailErrors, Jt as DomainVerifyResult, K as updateAccount, Ki as VerifyDomainResponses, Kn as ListDeliveriesData, Kr as SendEmailData, Kt as DiscardEmailContentResponses, L as listEndpoints, Li as UpdateFilterErrors, Ln as GetStorageStatsErrors, Lr as ReplyToEmailErrors, Lt as DeleteFilterResponse, M as getStorageStats, Mi as UpdateEndpointInput, Mn as GetSentEmailErrors, Mr as ReplayEmailWebhooksResponse, Mt as DeleteEndpointResponse, N as getWebhookSecret, Ni as UpdateEndpointResponse, Nn as GetSentEmailResponse, Nr as ReplayEmailWebhooksResponses, Nt as DeleteEndpointResponses, O as getAccount, Oi as UpdateDomainResponses, On as GetSendPermissionsResponse, Or as ReplayDeliveryResponses, Ot as DeleteEmailResponses, P as listDeliveries, Pi as UpdateEndpointResponses, Pn as GetSentEmailResponses, Pr as ReplayResult, Pt as DeleteFilterData, Q as AccountUpdated, Qi as Options$1, Qn as ListDomainsError, Qr as SendMailResult, Qt as DownloadAttachmentsResponse, R as listFilters, Ri as UpdateFilterInput, Rn as GetStorageStatsResponse, Rr as ReplyToEmailResponse, Rt as DeleteFilterResponses, S as deleteEmail, Si as UpdateAccountResponses, Sn as GetEmailErrors, Sr as ListSentEmailsResponses, St as DeleteDomainResponse, T as discardEmailContent, Ti as UpdateDomainErrors, Tn as GetSendPermissionsData, Tr as ReplayDeliveryError, Tt as DeleteEmailError, U as rotateWebhookSecret, Ui as VerifyDomainError, Un as GetWebhookSecretResponse, Ur as RotateWebhookSecretErrors, Ut as DiscardEmailContentError, V as replayEmailWebhooks, Vi as VerifiedDomain, Vn as GetWebhookSecretError, Vr as RotateWebhookSecretData, Vt as DiscardContentResult, W as sendEmail, Wi as VerifyDomainErrors, Wn as GetWebhookSecretResponses, Wr as RotateWebhookSecretResponse, Wt as DiscardEmailContentErrors, X as verifyDomain, Xi as Config, Xn as ListDeliveriesResponses, Xr as SendEmailResponses, Xt as DownloadAttachmentsError, Y as updateFilter, Yi as ClientOptions$1, Yn as ListDeliveriesResponse, Yr as SendEmailResponse, Yt as DownloadAttachmentsData, Z as Account, Zi as CreateClientConfig, Zn as ListDomainsData, Zr as SendMailInput, Zt as DownloadAttachmentsErrors, _ as Options, _i as UpdateAccountData, _n as GetAccountErrors, _r as ListFiltersResponses, _t as CreateFilterResponses, a as PrimitiveApiError, ai as SentEmailDetail, an as EmailDetail, ar as ListEmailsResponse, at as ClientOptions, b as createFilter, bi as UpdateAccountInput, bn as GetEmailData, br as ListSentEmailsErrors, bt as DeleteDomainError, c as PrimitiveClientOptions, ci as StorageStats, cn as EmailSummary, cr as ListEndpointsError, ct as CreateEndpointErrors, d as SendResult, di as TestEndpointError, dn as ErrorResponse, dr as ListEndpointsResponses, dt as CreateEndpointResponses, ea as RequestResult, ei as SendPermissionAnyRecipient, en as DownloadRawEmailData, er as ListDomainsResponse, et as AddDomainError, f as SendThreadInput, fi as TestEndpointErrors, fn as Filter, fr as ListEnvelope, ft as CreateFilterData, g as operations, gi as UnverifiedDomain, gn as GetAccountError, gr as ListFiltersResponse, gt as CreateFilterResponse, h as createPrimitiveClient, hi as TestResult, hn as GetAccountData, hr as ListFiltersErrors, ht as CreateFilterInput, i as PrimitiveApiClientOptions, ii as SendPermissionsMeta, in as DownloadRawEmailResponses, ir as ListEmailsErrors, it as AddDomainResponses, j as getSentEmail, ji as UpdateEndpointErrors, jn as GetSentEmailError, jr as ReplayEmailWebhooksErrors, jt as DeleteEndpointErrors, k as getEmail, ki as UpdateEndpointData, kn as GetSendPermissionsResponses, kr as ReplayEmailWebhooksData, kt as DeleteEndpointData, l as ReplyInput, li as SuccessEnvelope, ln as EmailWebhookStatus, lr as ListEndpointsErrors, lt as CreateEndpointInput, m as createPrimitiveApiClient, mi as TestEndpointResponses, mn as GateFix, mr as ListFiltersError, mt as CreateFilterErrors, n as ForwardInput, na as Auth, ni as SendPermissionRule, nn as DownloadRawEmailErrors, nr as ListEmailsData, nt as AddDomainInput, o as PrimitiveApiErrorDetails, oi as SentEmailStatus, on as EmailDetailReply, or as ListEmailsResponses, ot as CreateEndpointData, p as client, pi as TestEndpointResponse, pn as GateDenial, pr as ListFiltersData, pt as CreateFilterError, q as updateDomain, qi as WebhookSecret, qn as ListDeliveriesError, qr as SendEmailError, qt as Domain, r as PrimitiveApiClient, ri as SendPermissionYourDomain, rn as DownloadRawEmailResponse, rr as ListEmailsError, rt as AddDomainResponse, s as PrimitiveClient, si as SentEmailSummary, sn as EmailStatus, sr as ListEndpointsData, st as CreateEndpointError, t as DEFAULT_BASE_URL, ta as ResponseStyle, ti as SendPermissionManagedZone, tn as DownloadRawEmailError, tr as ListDomainsResponses, tt as AddDomainErrors, u as SendInput, ui as TestEndpointData, un as Endpoint, ur as ListEndpointsResponse, ut as CreateEndpointResponse, v as addDomain, vi as UpdateAccountError, vn as GetAccountResponse, vr as ListSentEmailsData, vt as Cursor, w as deleteFilter, wi as UpdateDomainError, wn as GetEmailResponses, wr as ReplayDeliveryData, wt as DeleteEmailData, x as deleteDomain, xi as UpdateAccountResponse, xn as GetEmailError, xr as ListSentEmailsResponse, xt as DeleteDomainErrors, y as createEndpoint, yi as UpdateAccountErrors, yn as GetAccountResponses, yr as ListSentEmailsError, yt as DeleteDomainData, z as listSentEmails, zi as UpdateFilterResponse, zn as GetStorageStatsResponses, zr as ReplyToEmailResponses, zt as DeliveryStatus } from "../index-SK_HbwVN.js";
|
|
2
|
+
export { Account, AccountUpdated, AddDomainData, AddDomainError, AddDomainErrors, AddDomainInput, AddDomainResponse, AddDomainResponses, Auth, ClientOptions, CreateClientConfig, CreateEndpointData, CreateEndpointError, CreateEndpointErrors, CreateEndpointInput, CreateEndpointResponse, CreateEndpointResponses, CreateFilterData, CreateFilterError, CreateFilterErrors, CreateFilterInput, CreateFilterResponse, CreateFilterResponses, Cursor, DEFAULT_BASE_URL, DeleteDomainData, DeleteDomainError, DeleteDomainErrors, DeleteDomainResponse, DeleteDomainResponses, DeleteEmailData, DeleteEmailError, DeleteEmailErrors, DeleteEmailResponse, DeleteEmailResponses, DeleteEndpointData, DeleteEndpointError, DeleteEndpointErrors, DeleteEndpointResponse, DeleteEndpointResponses, DeleteFilterData, DeleteFilterError, DeleteFilterErrors, DeleteFilterResponse, DeleteFilterResponses, DeliveryStatus, DeliverySummary, DiscardContentResult, DiscardEmailContentData, DiscardEmailContentError, DiscardEmailContentErrors, DiscardEmailContentResponse, DiscardEmailContentResponses, Domain, DomainVerifyResult, DownloadAttachmentsData, DownloadAttachmentsError, DownloadAttachmentsErrors, DownloadAttachmentsResponse, DownloadAttachmentsResponses, DownloadRawEmailData, DownloadRawEmailError, DownloadRawEmailErrors, DownloadRawEmailResponse, DownloadRawEmailResponses, EmailDetail, EmailDetailReply, EmailStatus, EmailSummary, EmailWebhookStatus, Endpoint, ErrorResponse, Filter, ForwardInput, GateDenial, GateFix, GetAccountData, GetAccountError, GetAccountErrors, GetAccountResponse, GetAccountResponses, GetEmailData, GetEmailError, GetEmailErrors, GetEmailResponse, GetEmailResponses, 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, ListSentEmailsData, ListSentEmailsError, ListSentEmailsErrors, ListSentEmailsResponse, ListSentEmailsResponses, Options, PaginationMeta, 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, ResourceId, ResponseStyle, RotateWebhookSecretData, RotateWebhookSecretError, RotateWebhookSecretErrors, RotateWebhookSecretResponse, RotateWebhookSecretResponses, SendEmailData, SendEmailError, SendEmailErrors, SendEmailResponse, SendEmailResponses, SendInput, SendMailInput, SendMailResult, SendPermissionAddress, SendPermissionAnyRecipient, SendPermissionManagedZone, SendPermissionRule, SendPermissionYourDomain, SendPermissionsMeta, SendResult, SendThreadInput, SentEmailDetail, SentEmailStatus, SentEmailSummary, StorageStats, SuccessEnvelope, TestEndpointData, TestEndpointError, TestEndpointErrors, TestEndpointResponse, TestEndpointResponses, 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, VerifiedDomain, VerifyDomainData, VerifyDomainError, VerifyDomainErrors, VerifyDomainResponse, VerifyDomainResponses, WebhookSecret, addDomain, client, createEndpoint, createFilter, createPrimitiveApiClient, createPrimitiveClient, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, discardEmailContent, downloadAttachments, downloadRawEmail, getAccount, getEmail, getSendPermissions, getSentEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, listSentEmails, operations, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, sendEmail, testEndpoint, updateAccount, updateDomain, updateEndpoint, updateFilter, verifyDomain };
|
|
@@ -620,6 +620,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
620
620
|
deleteEmail: () => deleteEmail,
|
|
621
621
|
deleteEndpoint: () => deleteEndpoint,
|
|
622
622
|
deleteFilter: () => deleteFilter,
|
|
623
|
+
discardEmailContent: () => discardEmailContent,
|
|
623
624
|
downloadAttachments: () => downloadAttachments,
|
|
624
625
|
downloadRawEmail: () => downloadRawEmail,
|
|
625
626
|
getAccount: () => getAccount,
|
|
@@ -829,7 +830,30 @@ const deleteEmail = (options) => (options.client ?? client$1).delete({
|
|
|
829
830
|
...options
|
|
830
831
|
});
|
|
831
832
|
/**
|
|
832
|
-
* Get email
|
|
833
|
+
* Get inbound email by id
|
|
834
|
+
*
|
|
835
|
+
* Returns the full record for an inbound email received at one
|
|
836
|
+
* of your verified domains, including the parsed text and HTML
|
|
837
|
+
* bodies, threading metadata, SMTP envelope detail, webhook
|
|
838
|
+
* delivery state, and a `replies` array for any outbound sends
|
|
839
|
+
* recorded as replies to this inbound.
|
|
840
|
+
*
|
|
841
|
+
* For listing inbound emails (with cursor pagination, status
|
|
842
|
+
* and date filters, and free-text search), use
|
|
843
|
+
* `/emails`. Outbound (sent) email records are NOT returned
|
|
844
|
+
* here; use `/sent-emails/{id}` for those.
|
|
845
|
+
*
|
|
846
|
+
* The response carries four sender-shaped fields whose
|
|
847
|
+
* meanings overlap. `from_email` is the canonical "who sent
|
|
848
|
+
* this" field for most use cases (parsed bare address from
|
|
849
|
+
* the `From:` header, with a `sender` fallback). `from_header`
|
|
850
|
+
* is the raw header including any display name. `sender` and
|
|
851
|
+
* `smtp_mail_from` both carry the SMTP envelope MAIL FROM
|
|
852
|
+
* (return-path) and are equal by construction; `sender` is
|
|
853
|
+
* the older field name retained for compatibility. See
|
|
854
|
+
* `primitive describe emails:get-email | jq '.responseSchema.properties'`
|
|
855
|
+
* for per-field detail.
|
|
856
|
+
*
|
|
833
857
|
*/
|
|
834
858
|
const getEmail = (options) => (options.client ?? client$1).get({
|
|
835
859
|
security: [{
|
|
@@ -927,6 +951,32 @@ const replayEmailWebhooks = (options) => (options.client ?? client$1).post({
|
|
|
927
951
|
...options
|
|
928
952
|
});
|
|
929
953
|
/**
|
|
954
|
+
* Discard email content
|
|
955
|
+
*
|
|
956
|
+
* Permanently deletes the email's raw bytes, parsed body (text + HTML),
|
|
957
|
+
* and attachments while preserving metadata (sender, recipient,
|
|
958
|
+
* subject, timestamps, hashes, attachment manifest) for audit logs.
|
|
959
|
+
* Idempotent: a second call returns success with
|
|
960
|
+
* `already_discarded: true` and does no work.
|
|
961
|
+
*
|
|
962
|
+
* **Gated** on the customer's discard-content opt-in (managed in the
|
|
963
|
+
* dashboard at Settings > Webhooks). When the toggle is off, this
|
|
964
|
+
* endpoint returns `403` with code `discard_not_enabled` and a
|
|
965
|
+
* message pointing the human at the dashboard. There is intentionally
|
|
966
|
+
* no API to flip this toggle — opting in to a destructive,
|
|
967
|
+
* non-reversible operation must be a deliberate human click in the
|
|
968
|
+
* UI.
|
|
969
|
+
*
|
|
970
|
+
*/
|
|
971
|
+
const discardEmailContent = (options) => (options.client ?? client$1).post({
|
|
972
|
+
security: [{
|
|
973
|
+
scheme: "bearer",
|
|
974
|
+
type: "http"
|
|
975
|
+
}],
|
|
976
|
+
url: "/emails/{id}/discard-content",
|
|
977
|
+
...options
|
|
978
|
+
});
|
|
979
|
+
/**
|
|
930
980
|
* List webhook endpoints
|
|
931
981
|
*
|
|
932
982
|
* Returns all active (non-deleted) webhook endpoints.
|
|
@@ -1463,4 +1513,4 @@ function client(options = {}) {
|
|
|
1463
1513
|
}
|
|
1464
1514
|
const operations = sdk_gen_exports;
|
|
1465
1515
|
//#endregion
|
|
1466
|
-
export {
|
|
1516
|
+
export { listSentEmails as A, updateFilter as B, getStorageStats as C, listEmails as D, listDomains as E, sendEmail as F, testEndpoint as I, updateAccount as L, replayEmailWebhooks as M, replyToEmail as N, listEndpoints as O, rotateWebhookSecret as P, updateDomain as R, getSentEmail as S, listDeliveries as T, verifyDomain as V, downloadAttachments as _, client as a, getEmail as b, operations as c, createFilter as d, deleteDomain as f, discardEmailContent as g, deleteFilter as h, PrimitiveClient as i, replayDelivery as j, listFilters as k, addDomain as l, deleteEndpoint as m, PrimitiveApiClient as n, createPrimitiveApiClient as o, deleteEmail as p, PrimitiveApiError as r, createPrimitiveClient as s, DEFAULT_BASE_URL as t, createEndpoint as u, downloadRawEmail as v, getWebhookSecret as w, getSendPermissions as x, getAccount as y, updateEndpoint as z };
|
|
@@ -347,7 +347,7 @@ type PaginationMeta = {
|
|
|
347
347
|
type ErrorResponse = {
|
|
348
348
|
success: boolean;
|
|
349
349
|
error: {
|
|
350
|
-
code: 'unauthorized' | 'forbidden' | 'not_found' | 'validation_error' | 'rate_limit_exceeded' | 'internal_error' | 'conflict' | 'mx_conflict' | 'outbound_disabled' | 'cannot_send_from_domain' | 'recipient_not_allowed' | 'outbound_key_missing' | 'outbound_unreachable' | 'outbound_key_invalid' | 'outbound_capacity_exhausted' | 'outbound_response_malformed' | 'outbound_relay_failed' | 'inbound_not_repliable';
|
|
350
|
+
code: 'unauthorized' | 'forbidden' | 'not_found' | 'validation_error' | 'rate_limit_exceeded' | 'internal_error' | 'conflict' | 'mx_conflict' | 'outbound_disabled' | 'cannot_send_from_domain' | 'recipient_not_allowed' | 'outbound_key_missing' | 'outbound_unreachable' | 'outbound_key_invalid' | 'outbound_capacity_exhausted' | 'outbound_response_malformed' | 'outbound_relay_failed' | 'discard_not_enabled' | 'inbound_not_repliable';
|
|
351
351
|
message: string;
|
|
352
352
|
/**
|
|
353
353
|
* Optional structured data that callers can inspect to recover
|
|
@@ -559,7 +559,7 @@ type EmailSummary = {
|
|
|
559
559
|
message_id?: string | null;
|
|
560
560
|
domain_id?: string | null;
|
|
561
561
|
org_id?: string | null;
|
|
562
|
-
status:
|
|
562
|
+
status: EmailStatus;
|
|
563
563
|
/**
|
|
564
564
|
* SMTP envelope sender (return-path) the inbound mail server
|
|
565
565
|
* accepted. For most legitimate mail this equals the bare
|
|
@@ -580,7 +580,7 @@ type EmailSummary = {
|
|
|
580
580
|
created_at: string;
|
|
581
581
|
received_at: string;
|
|
582
582
|
raw_size_bytes?: number | null;
|
|
583
|
-
webhook_status?:
|
|
583
|
+
webhook_status?: EmailWebhookStatus;
|
|
584
584
|
webhook_attempt_count: number;
|
|
585
585
|
};
|
|
586
586
|
type EmailDetail = {
|
|
@@ -613,7 +613,7 @@ type EmailDetail = {
|
|
|
613
613
|
* HTML body parsed from the inbound MIME, matching the `email.parsed.body_html` field on the webhook payload. Null when the message had no HTML part or parsing failed.
|
|
614
614
|
*/
|
|
615
615
|
body_html?: string | null;
|
|
616
|
-
status:
|
|
616
|
+
status: EmailStatus;
|
|
617
617
|
domain: string;
|
|
618
618
|
spam_score?: number | null;
|
|
619
619
|
raw_size_bytes?: number | null;
|
|
@@ -621,7 +621,7 @@ type EmailDetail = {
|
|
|
621
621
|
created_at: string;
|
|
622
622
|
received_at: string;
|
|
623
623
|
rejection_reason?: string | null;
|
|
624
|
-
webhook_status?:
|
|
624
|
+
webhook_status?: EmailWebhookStatus;
|
|
625
625
|
webhook_attempt_count: number;
|
|
626
626
|
webhook_last_attempt_at?: string | null;
|
|
627
627
|
webhook_last_status_code?: number | null;
|
|
@@ -746,6 +746,63 @@ type SendMailInput = {
|
|
|
746
746
|
*/
|
|
747
747
|
wait_timeout_ms?: number;
|
|
748
748
|
};
|
|
749
|
+
/**
|
|
750
|
+
* Lifecycle status of an INBOUND email (a row in the `emails`
|
|
751
|
+
* table). Distinct from `SentEmailStatus`, which describes
|
|
752
|
+
* the OUTBOUND lifecycle (the `sent_emails` table) and uses
|
|
753
|
+
* a different vocabulary because the lifecycles differ.
|
|
754
|
+
* Possible values:
|
|
755
|
+
*
|
|
756
|
+
* - `pending`: the row was inserted at ingestion (mx_main)
|
|
757
|
+
* and has not yet completed the spam / filter / auth
|
|
758
|
+
* pipeline. Body and parsed fields are present; webhook
|
|
759
|
+
* delivery is not yet scheduled. Most rows transition out
|
|
760
|
+
* of `pending` within seconds.
|
|
761
|
+
* - `accepted`: the inbound passed the policy gates and is
|
|
762
|
+
* queued for webhook delivery. The `webhook_status` field
|
|
763
|
+
* tracks the separate webhook-delivery lifecycle from
|
|
764
|
+
* this point.
|
|
765
|
+
* - `completed`: terminal success. Webhook delivery
|
|
766
|
+
* attempted and acknowledged by every active endpoint, OR
|
|
767
|
+
* no endpoints are configured, so the row is durably
|
|
768
|
+
* archived.
|
|
769
|
+
* - `rejected`: terminal failure at ingestion (spam, blocked
|
|
770
|
+
* sender, filter rule, malformed). The body and metadata
|
|
771
|
+
* are stored for auditing but no webhook fires and the
|
|
772
|
+
* row is not repliable.
|
|
773
|
+
*
|
|
774
|
+
* See also `webhook_status` (separate enum tracking the
|
|
775
|
+
* webhook-delivery state machine) and `SentEmailStatus` (the
|
|
776
|
+
* outbound vocabulary).
|
|
777
|
+
*
|
|
778
|
+
*/
|
|
779
|
+
type EmailStatus = 'pending' | 'accepted' | 'completed' | 'rejected';
|
|
780
|
+
/**
|
|
781
|
+
* Webhook-delivery state for an inbound email. Tracks a
|
|
782
|
+
* SEPARATE lifecycle from the email's `status` field; the
|
|
783
|
+
* same row carries both. Possible values:
|
|
784
|
+
*
|
|
785
|
+
* - `pending`: ingestion is past `pending` (the email itself
|
|
786
|
+
* is `accepted`) but the webhook fan-out has not yet
|
|
787
|
+
* started for this row.
|
|
788
|
+
* - `in_flight`: at least one delivery attempt is in flight.
|
|
789
|
+
* - `fired`: terminal success. Every active endpoint
|
|
790
|
+
* acknowledged the delivery (or accepted it after retries).
|
|
791
|
+
* - `failed`: terminal partial-failure. At least one endpoint
|
|
792
|
+
* exhausted its retry budget; some endpoints may still
|
|
793
|
+
* have succeeded.
|
|
794
|
+
* - `exhausted`: terminal failure. Every endpoint exhausted
|
|
795
|
+
* its retry budget without success.
|
|
796
|
+
* - `null`: no endpoints configured, so no webhook lifecycle
|
|
797
|
+
* applies.
|
|
798
|
+
*
|
|
799
|
+
* Note that the value `pending` here does NOT mean the email
|
|
800
|
+
* is `pending`; it means the email is past ingestion but
|
|
801
|
+
* webhook delivery has not yet begun. Two overlapping uses
|
|
802
|
+
* of the word `pending` for distinct lifecycle phases.
|
|
803
|
+
*
|
|
804
|
+
*/
|
|
805
|
+
type EmailWebhookStatus = 'pending' | 'in_flight' | 'fired' | 'failed' | 'exhausted' | null;
|
|
749
806
|
/**
|
|
750
807
|
* Lifecycle status of a sent_emails row. Possible values:
|
|
751
808
|
*
|
|
@@ -767,6 +824,25 @@ type SendMailInput = {
|
|
|
767
824
|
*
|
|
768
825
|
*/
|
|
769
826
|
type SentEmailStatus = 'queued' | 'submitted_to_agent' | 'agent_failed' | 'gate_denied' | 'unknown' | 'delivered' | 'bounced' | 'deferred' | 'wait_timeout';
|
|
827
|
+
/**
|
|
828
|
+
* Narrower enum covering only the four terminal delivery
|
|
829
|
+
* outcomes returned to a synchronous `wait: true` send.
|
|
830
|
+
*
|
|
831
|
+
* On the SendMailResult shape, `delivery_status` is always
|
|
832
|
+
* equal to `status` whenever both are present (i.e. on
|
|
833
|
+
* terminal-state replays and live wait=true responses).
|
|
834
|
+
* The two fields exist so callers that want to type-narrow
|
|
835
|
+
* on "this is a delivery outcome" can pattern-match against
|
|
836
|
+
* the four-value enum without handling the broader
|
|
837
|
+
* SentEmailStatus value set (which also covers `queued`,
|
|
838
|
+
* `submitted_to_agent`, `agent_failed`, `gate_denied`,
|
|
839
|
+
* `unknown`).
|
|
840
|
+
*
|
|
841
|
+
* On async-mode and pre-terminal responses, `delivery_status`
|
|
842
|
+
* is absent and only `status` is populated. Use `status` if
|
|
843
|
+
* you want a single field that's always present.
|
|
844
|
+
*
|
|
845
|
+
*/
|
|
770
846
|
type DeliveryStatus = 'delivered' | 'bounced' | 'deferred' | 'wait_timeout';
|
|
771
847
|
/**
|
|
772
848
|
* List-row projection of a sent-email record. Drops
|
|
@@ -1020,7 +1096,20 @@ type SendMailResult = {
|
|
|
1020
1096
|
*/
|
|
1021
1097
|
from: string;
|
|
1022
1098
|
/**
|
|
1023
|
-
* Message identifier assigned by Primitive's
|
|
1099
|
+
* Message identifier assigned by Primitive's OUTBOUND relay
|
|
1100
|
+
* (the box that signs your mail and submits it to the
|
|
1101
|
+
* receiving MTA). NOT the receiver's queue id.
|
|
1102
|
+
*
|
|
1103
|
+
* The receiver may also report its own queue id in
|
|
1104
|
+
* `smtp_response_text` (e.g. `"250 2.0.0 Ok: queued as
|
|
1105
|
+
* 99D111927CDA"` from a Postfix receiver). Those two ids
|
|
1106
|
+
* refer to different mail systems and are NOT comparable.
|
|
1107
|
+
* Treat `queue_id` as Primitive-internal and the
|
|
1108
|
+
* receiver's id as remote-system-internal.
|
|
1109
|
+
*
|
|
1110
|
+
* Null on rows that never reached the relay (queued,
|
|
1111
|
+
* gate_denied, agent_failed before signing).
|
|
1112
|
+
*
|
|
1024
1113
|
*/
|
|
1025
1114
|
queue_id: string | null;
|
|
1026
1115
|
/**
|
|
@@ -1334,6 +1423,22 @@ type ReplayResult = {
|
|
|
1334
1423
|
*/
|
|
1335
1424
|
failed: number;
|
|
1336
1425
|
};
|
|
1426
|
+
type DiscardContentResult = {
|
|
1427
|
+
/**
|
|
1428
|
+
* Always `true` on a 2xx response. The content is either now
|
|
1429
|
+
* discarded as a result of this call, or was already discarded
|
|
1430
|
+
* before this call ran.
|
|
1431
|
+
*
|
|
1432
|
+
*/
|
|
1433
|
+
discarded: boolean;
|
|
1434
|
+
/**
|
|
1435
|
+
* `true` if the email's content was already discarded before
|
|
1436
|
+
* this call ran (no work was done). `false` if this call was
|
|
1437
|
+
* the one that performed the discard.
|
|
1438
|
+
*
|
|
1439
|
+
*/
|
|
1440
|
+
already_discarded: boolean;
|
|
1441
|
+
};
|
|
1337
1442
|
/**
|
|
1338
1443
|
* Resource UUID
|
|
1339
1444
|
*/
|
|
@@ -1676,9 +1781,14 @@ type ListEmailsData = {
|
|
|
1676
1781
|
*/
|
|
1677
1782
|
domain_id?: string;
|
|
1678
1783
|
/**
|
|
1679
|
-
* Filter by
|
|
1784
|
+
* Filter inbound rows by lifecycle status. See `EmailStatus`
|
|
1785
|
+
* for what each value means. Note that the webhook delivery
|
|
1786
|
+
* state is a SEPARATE lifecycle on the same row; filter by
|
|
1787
|
+
* `webhook_status` semantics is not currently supported on
|
|
1788
|
+
* this endpoint.
|
|
1789
|
+
*
|
|
1680
1790
|
*/
|
|
1681
|
-
status?:
|
|
1791
|
+
status?: EmailStatus;
|
|
1682
1792
|
/**
|
|
1683
1793
|
* Search subject, sender, and recipient (case-insensitive)
|
|
1684
1794
|
*/
|
|
@@ -1963,6 +2073,53 @@ type ReplayEmailWebhooksResponses = {
|
|
|
1963
2073
|
};
|
|
1964
2074
|
};
|
|
1965
2075
|
type ReplayEmailWebhooksResponse = ReplayEmailWebhooksResponses[keyof ReplayEmailWebhooksResponses];
|
|
2076
|
+
type DiscardEmailContentData = {
|
|
2077
|
+
body?: never;
|
|
2078
|
+
path: {
|
|
2079
|
+
/**
|
|
2080
|
+
* Resource UUID
|
|
2081
|
+
*/
|
|
2082
|
+
id: string;
|
|
2083
|
+
};
|
|
2084
|
+
query?: never;
|
|
2085
|
+
url: '/emails/{id}/discard-content';
|
|
2086
|
+
};
|
|
2087
|
+
type DiscardEmailContentErrors = {
|
|
2088
|
+
/**
|
|
2089
|
+
* Invalid request parameters
|
|
2090
|
+
*/
|
|
2091
|
+
400: ErrorResponse;
|
|
2092
|
+
/**
|
|
2093
|
+
* Invalid or missing API key
|
|
2094
|
+
*/
|
|
2095
|
+
401: ErrorResponse;
|
|
2096
|
+
/**
|
|
2097
|
+
* Authenticated caller lacks permission for the operation
|
|
2098
|
+
*/
|
|
2099
|
+
403: ErrorResponse;
|
|
2100
|
+
/**
|
|
2101
|
+
* Resource not found
|
|
2102
|
+
*/
|
|
2103
|
+
404: ErrorResponse;
|
|
2104
|
+
/**
|
|
2105
|
+
* Rate limit exceeded
|
|
2106
|
+
*/
|
|
2107
|
+
429: ErrorResponse;
|
|
2108
|
+
/**
|
|
2109
|
+
* Primitive encountered an internal error
|
|
2110
|
+
*/
|
|
2111
|
+
500: ErrorResponse;
|
|
2112
|
+
};
|
|
2113
|
+
type DiscardEmailContentError = DiscardEmailContentErrors[keyof DiscardEmailContentErrors];
|
|
2114
|
+
type DiscardEmailContentResponses = {
|
|
2115
|
+
/**
|
|
2116
|
+
* Discard result
|
|
2117
|
+
*/
|
|
2118
|
+
200: SuccessEnvelope & {
|
|
2119
|
+
data: DiscardContentResult;
|
|
2120
|
+
};
|
|
2121
|
+
};
|
|
2122
|
+
type DiscardEmailContentResponse = DiscardEmailContentResponses[keyof DiscardEmailContentResponses];
|
|
1966
2123
|
type ListEndpointsData = {
|
|
1967
2124
|
body?: never;
|
|
1968
2125
|
path?: never;
|
|
@@ -2524,7 +2681,7 @@ type GetSentEmailResponses = {
|
|
|
2524
2681
|
};
|
|
2525
2682
|
type GetSentEmailResponse = GetSentEmailResponses[keyof GetSentEmailResponses];
|
|
2526
2683
|
declare namespace sdk_gen_d_exports {
|
|
2527
|
-
export { Options, addDomain, createEndpoint, createFilter, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, downloadAttachments, downloadRawEmail, getAccount, getEmail, getSendPermissions, getSentEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, listSentEmails, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, sendEmail, testEndpoint, updateAccount, updateDomain, updateEndpoint, updateFilter, verifyDomain };
|
|
2684
|
+
export { Options, addDomain, createEndpoint, createFilter, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, discardEmailContent, downloadAttachments, downloadRawEmail, getAccount, getEmail, getSendPermissions, getSentEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, listSentEmails, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, sendEmail, testEndpoint, updateAccount, updateDomain, updateEndpoint, updateFilter, verifyDomain };
|
|
2528
2685
|
}
|
|
2529
2686
|
type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
|
|
2530
2687
|
/**
|
|
@@ -2626,7 +2783,30 @@ declare const listEmails: <ThrowOnError extends boolean = false>(options?: Optio
|
|
|
2626
2783
|
*/
|
|
2627
2784
|
declare const deleteEmail: <ThrowOnError extends boolean = false>(options: Options<DeleteEmailData, ThrowOnError>) => RequestResult<DeleteEmailResponses, DeleteEmailErrors, ThrowOnError, "fields">;
|
|
2628
2785
|
/**
|
|
2629
|
-
* Get email
|
|
2786
|
+
* Get inbound email by id
|
|
2787
|
+
*
|
|
2788
|
+
* Returns the full record for an inbound email received at one
|
|
2789
|
+
* of your verified domains, including the parsed text and HTML
|
|
2790
|
+
* bodies, threading metadata, SMTP envelope detail, webhook
|
|
2791
|
+
* delivery state, and a `replies` array for any outbound sends
|
|
2792
|
+
* recorded as replies to this inbound.
|
|
2793
|
+
*
|
|
2794
|
+
* For listing inbound emails (with cursor pagination, status
|
|
2795
|
+
* and date filters, and free-text search), use
|
|
2796
|
+
* `/emails`. Outbound (sent) email records are NOT returned
|
|
2797
|
+
* here; use `/sent-emails/{id}` for those.
|
|
2798
|
+
*
|
|
2799
|
+
* The response carries four sender-shaped fields whose
|
|
2800
|
+
* meanings overlap. `from_email` is the canonical "who sent
|
|
2801
|
+
* this" field for most use cases (parsed bare address from
|
|
2802
|
+
* the `From:` header, with a `sender` fallback). `from_header`
|
|
2803
|
+
* is the raw header including any display name. `sender` and
|
|
2804
|
+
* `smtp_mail_from` both carry the SMTP envelope MAIL FROM
|
|
2805
|
+
* (return-path) and are equal by construction; `sender` is
|
|
2806
|
+
* the older field name retained for compatibility. See
|
|
2807
|
+
* `primitive describe emails:get-email | jq '.responseSchema.properties'`
|
|
2808
|
+
* for per-field detail.
|
|
2809
|
+
*
|
|
2630
2810
|
*/
|
|
2631
2811
|
declare const getEmail: <ThrowOnError extends boolean = false>(options: Options<GetEmailData, ThrowOnError>) => RequestResult<GetEmailResponses, GetEmailErrors, ThrowOnError, "fields">;
|
|
2632
2812
|
/**
|
|
@@ -2676,6 +2856,25 @@ declare const replyToEmail: <ThrowOnError extends boolean = false>(options: Opti
|
|
|
2676
2856
|
*
|
|
2677
2857
|
*/
|
|
2678
2858
|
declare const replayEmailWebhooks: <ThrowOnError extends boolean = false>(options: Options<ReplayEmailWebhooksData, ThrowOnError>) => RequestResult<ReplayEmailWebhooksResponses, ReplayEmailWebhooksErrors, ThrowOnError, "fields">;
|
|
2859
|
+
/**
|
|
2860
|
+
* Discard email content
|
|
2861
|
+
*
|
|
2862
|
+
* Permanently deletes the email's raw bytes, parsed body (text + HTML),
|
|
2863
|
+
* and attachments while preserving metadata (sender, recipient,
|
|
2864
|
+
* subject, timestamps, hashes, attachment manifest) for audit logs.
|
|
2865
|
+
* Idempotent: a second call returns success with
|
|
2866
|
+
* `already_discarded: true` and does no work.
|
|
2867
|
+
*
|
|
2868
|
+
* **Gated** on the customer's discard-content opt-in (managed in the
|
|
2869
|
+
* dashboard at Settings > Webhooks). When the toggle is off, this
|
|
2870
|
+
* endpoint returns `403` with code `discard_not_enabled` and a
|
|
2871
|
+
* message pointing the human at the dashboard. There is intentionally
|
|
2872
|
+
* no API to flip this toggle — opting in to a destructive,
|
|
2873
|
+
* non-reversible operation must be a deliberate human click in the
|
|
2874
|
+
* UI.
|
|
2875
|
+
*
|
|
2876
|
+
*/
|
|
2877
|
+
declare const discardEmailContent: <ThrowOnError extends boolean = false>(options: Options<DiscardEmailContentData, ThrowOnError>) => RequestResult<DiscardEmailContentResponses, DiscardEmailContentErrors, ThrowOnError, "fields">;
|
|
2679
2878
|
/**
|
|
2680
2879
|
* List webhook endpoints
|
|
2681
2880
|
*
|
|
@@ -2969,4 +3168,4 @@ declare function createPrimitiveClient(options?: PrimitiveClientOptions): Primit
|
|
|
2969
3168
|
declare function client(options?: PrimitiveClientOptions): PrimitiveClient;
|
|
2970
3169
|
declare const operations: typeof sdk_gen_d_exports;
|
|
2971
3170
|
//#endregion
|
|
2972
|
-
export {
|
|
3171
|
+
export { AddDomainData as $, RequestOptions as $i, ListDomainsErrors as $n, SendPermissionAddress as $r, DownloadAttachmentsResponses as $t, getSendPermissions as A, UpdateEndpointError as Ai, GetSentEmailData as An, ReplayEmailWebhooksError as Ar, DeleteEndpointError as At, replayDelivery as B, UpdateFilterResponses as Bi, GetWebhookSecretData as Bn, ResourceId as Br, DeliverySummary as Bt, deleteEndpoint as C, UpdateDomainData as Ci, GetEmailResponse as Cn, PaginationMeta as Cr, DeleteDomainResponses as Ct, downloadRawEmail as D, UpdateDomainResponse as Di, GetSendPermissionsErrors as Dn, ReplayDeliveryResponse as Dr, DeleteEmailResponse as Dt, downloadAttachments as E, UpdateDomainInput as Ei, GetSendPermissionsError as En, ReplayDeliveryErrors as Er, DeleteEmailErrors as Et, listDomains as F, UpdateFilterData as Fi, GetStorageStatsData as Fn, ReplyToEmailData as Fr, DeleteFilterError as Ft, testEndpoint as G, VerifyDomainResponse as Gi, Limit as Gn, RotateWebhookSecretResponses as Gr, DiscardEmailContentResponse as Gt, replyToEmail as H, VerifyDomainData as Hi, GetWebhookSecretErrors as Hn, RotateWebhookSecretError as Hr, DiscardEmailContentData as Ht, listEmails as I, UpdateFilterError as Ii, GetStorageStatsError as In, ReplyToEmailError as Ir, DeleteFilterErrors as It, updateEndpoint as J, Client as Ji, ListDeliveriesErrors as Jn, SendEmailErrors as Jr, DomainVerifyResult as Jt, updateAccount as K, VerifyDomainResponses as Ki, ListDeliveriesData as Kn, SendEmailData as Kr, DiscardEmailContentResponses as Kt, listEndpoints as L, UpdateFilterErrors as Li, GetStorageStatsErrors as Ln, ReplyToEmailErrors as Lr, DeleteFilterResponse as Lt, getStorageStats as M, UpdateEndpointInput as Mi, GetSentEmailErrors as Mn, ReplayEmailWebhooksResponse as Mr, DeleteEndpointResponse as Mt, getWebhookSecret as N, UpdateEndpointResponse as Ni, GetSentEmailResponse as Nn, ReplayEmailWebhooksResponses as Nr, DeleteEndpointResponses as Nt, getAccount as O, UpdateDomainResponses as Oi, GetSendPermissionsResponse as On, ReplayDeliveryResponses as Or, DeleteEmailResponses as Ot, listDeliveries as P, UpdateEndpointResponses as Pi, GetSentEmailResponses as Pn, ReplayResult as Pr, DeleteFilterData as Pt, AccountUpdated as Q, Options$1 as Qi, ListDomainsError as Qn, SendMailResult as Qr, DownloadAttachmentsResponse as Qt, listFilters as R, UpdateFilterInput as Ri, GetStorageStatsResponse as Rn, ReplyToEmailResponse as Rr, DeleteFilterResponses as Rt, deleteEmail as S, UpdateAccountResponses as Si, GetEmailErrors as Sn, ListSentEmailsResponses as Sr, DeleteDomainResponse as St, discardEmailContent as T, UpdateDomainErrors as Ti, GetSendPermissionsData as Tn, ReplayDeliveryError as Tr, DeleteEmailError as Tt, rotateWebhookSecret as U, VerifyDomainError as Ui, GetWebhookSecretResponse as Un, RotateWebhookSecretErrors as Ur, DiscardEmailContentError as Ut, replayEmailWebhooks as V, VerifiedDomain as Vi, GetWebhookSecretError as Vn, RotateWebhookSecretData as Vr, DiscardContentResult as Vt, sendEmail as W, VerifyDomainErrors as Wi, GetWebhookSecretResponses as Wn, RotateWebhookSecretResponse as Wr, DiscardEmailContentErrors as Wt, verifyDomain as X, Config as Xi, ListDeliveriesResponses as Xn, SendEmailResponses as Xr, DownloadAttachmentsError as Xt, updateFilter as Y, ClientOptions$1 as Yi, ListDeliveriesResponse as Yn, SendEmailResponse as Yr, DownloadAttachmentsData as Yt, Account as Z, CreateClientConfig as Zi, ListDomainsData as Zn, SendMailInput as Zr, DownloadAttachmentsErrors as Zt, Options as _, UpdateAccountData as _i, GetAccountErrors as _n, ListFiltersResponses as _r, CreateFilterResponses as _t, PrimitiveApiError as a, SentEmailDetail as ai, EmailDetail as an, ListEmailsResponse as ar, ClientOptions as at, createFilter as b, UpdateAccountInput as bi, GetEmailData as bn, ListSentEmailsErrors as br, DeleteDomainError as bt, PrimitiveClientOptions as c, StorageStats as ci, EmailSummary as cn, ListEndpointsError as cr, CreateEndpointErrors as ct, SendResult as d, TestEndpointError as di, ErrorResponse as dn, ListEndpointsResponses as dr, CreateEndpointResponses as dt, RequestResult as ea, SendPermissionAnyRecipient as ei, DownloadRawEmailData as en, ListDomainsResponse as er, AddDomainError as et, SendThreadInput as f, TestEndpointErrors as fi, Filter as fn, ListEnvelope as fr, CreateFilterData as ft, operations as g, UnverifiedDomain as gi, GetAccountError as gn, ListFiltersResponse as gr, CreateFilterResponse as gt, createPrimitiveClient as h, TestResult as hi, GetAccountData as hn, ListFiltersErrors as hr, CreateFilterInput as ht, PrimitiveApiClientOptions as i, SendPermissionsMeta as ii, DownloadRawEmailResponses as in, ListEmailsErrors as ir, AddDomainResponses as it, getSentEmail as j, UpdateEndpointErrors as ji, GetSentEmailError as jn, ReplayEmailWebhooksErrors as jr, DeleteEndpointErrors as jt, getEmail as k, UpdateEndpointData as ki, GetSendPermissionsResponses as kn, ReplayEmailWebhooksData as kr, DeleteEndpointData as kt, ReplyInput as l, SuccessEnvelope as li, EmailWebhookStatus as ln, ListEndpointsErrors as lr, CreateEndpointInput as lt, createPrimitiveApiClient as m, TestEndpointResponses as mi, GateFix as mn, ListFiltersError as mr, CreateFilterErrors as mt, ForwardInput as n, Auth as na, SendPermissionRule as ni, DownloadRawEmailErrors as nn, ListEmailsData as nr, AddDomainInput as nt, PrimitiveApiErrorDetails as o, SentEmailStatus as oi, EmailDetailReply as on, ListEmailsResponses as or, CreateEndpointData as ot, client as p, TestEndpointResponse as pi, GateDenial as pn, ListFiltersData as pr, CreateFilterError as pt, updateDomain as q, WebhookSecret as qi, ListDeliveriesError as qn, SendEmailError as qr, Domain as qt, PrimitiveApiClient as r, SendPermissionYourDomain as ri, DownloadRawEmailResponse as rn, ListEmailsError as rr, AddDomainResponse as rt, PrimitiveClient as s, SentEmailSummary as si, EmailStatus as sn, ListEndpointsData as sr, CreateEndpointError as st, DEFAULT_BASE_URL as t, ResponseStyle as ta, SendPermissionManagedZone as ti, DownloadRawEmailError as tn, ListDomainsResponses as tr, AddDomainErrors as tt, SendInput as u, TestEndpointData as ui, Endpoint as un, ListEndpointsResponse as ur, CreateEndpointResponse as ut, addDomain as v, UpdateAccountError as vi, GetAccountResponse as vn, ListSentEmailsData as vr, Cursor as vt, deleteFilter as w, UpdateDomainError as wi, GetEmailResponses as wn, ReplayDeliveryData as wr, DeleteEmailData as wt, deleteDomain as x, UpdateAccountResponse as xi, GetEmailError as xn, ListSentEmailsResponse as xr, DeleteDomainErrors as xt, createEndpoint as y, UpdateAccountErrors as yi, GetAccountResponses as yn, ListSentEmailsError as yr, DeleteDomainData as yt, listSentEmails as z, UpdateFilterResponse as zi, GetStorageStatsResponses as zn, ReplyToEmailResponses as zr, DeliveryStatus as zt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as UnknownEvent, C as ParsedDataFailed, D as RawContentDownloadOnly, E as RawContent, M as WebhookAttachment, N as WebhookEvent, O as RawContentInline, S as ParsedDataComplete, T as ParsedStatus, _ as ForwardResultInline, a as DmarcPolicy, b as KnownWebhookEvent, c as EmailAnalysis, d as EventType, f as ForwardAnalysis, g as ForwardResultAttachmentSkipped, h as ForwardResultAttachmentAnalyzed, i as DkimSignature, j as ValidateEmailAuthResult, k as SpfResult, l as EmailAuth, m as ForwardResult, n as AuthVerdict, o as DmarcResult, p as ForwardOriginalSender, r as DkimResult, s as EmailAddress, t as AuthConfidence, u as EmailReceivedEvent, v as ForwardVerdict, w as ParsedError, x as ParsedData, y as ForwardVerification } from "./types-9vXGZjPd.js";
|
|
2
2
|
import { a as buildReplySubject, c as parseHeaderAddress, i as buildForwardSubject, n as ReceivedEmailAddress, o as formatAddress, r as ReceivedEmailThread, s as normalizeReceivedEmail, t as ReceivedEmail } from "./received-email-DNjpq_Wt.js";
|
|
3
|
-
import { a as PrimitiveApiError, c as PrimitiveClientOptions, d as SendResult, f as SendThreadInput, h as createPrimitiveClient, l as ReplyInput, n as ForwardInput, p as client, s as PrimitiveClient, u as SendInput } from "./index-
|
|
3
|
+
import { a as PrimitiveApiError, c as PrimitiveClientOptions, d as SendResult, f as SendThreadInput, h as createPrimitiveClient, l as ReplyInput, n as ForwardInput, p as client, s as PrimitiveClient, u as SendInput } from "./index-SK_HbwVN.js";
|
|
4
4
|
import { A as VerifyOptions, B as PAYLOAD_ERRORS, C as signStandardWebhooksPayload, D as PRIMITIVE_CONFIRMED_HEADER, E as LEGACY_SIGNATURE_HEADER, F as VerifyDownloadTokenResult, G as VERIFICATION_ERRORS, H as RAW_EMAIL_ERRORS, I as generateDownloadToken, J as WebhookPayloadErrorCode, K as WebhookErrorCode, L as verifyDownloadToken, M as verifyWebhookSignature, N as GenerateDownloadTokenOptions, O as PRIMITIVE_SIGNATURE_HEADER, P as VerifyDownloadTokenOptions, Q as WebhookVerificationErrorCode, R as safeValidateEmailReceivedEvent, S as StandardWebhooksVerifyOptions, T as LEGACY_CONFIRMED_HEADER, U as RawEmailDecodeError, V as PrimitiveWebhookError, W as RawEmailDecodeErrorCode, X as WebhookValidationErrorCode, Y as WebhookValidationError, Z as WebhookVerificationError, _ as emailReceivedEventJsonSchema, a as confirmedHeaders, b as STANDARD_WEBHOOK_TIMESTAMP_HEADER, c as handleWebhook, d as isRawIncluded, f as parseWebhookEvent, g as validateEmailAuth, h as WEBHOOK_VERSION, i as WebhookHeaders, j as signWebhookPayload, k as SignResult, l as isDownloadExpired, m as verifyRawEmailDownload, n as HandleWebhookOptions, o as decodeRawEmail, p as receive, q as WebhookPayloadError, r as ReceiveRequestOptions, s as getDownloadTimeRemaining, t as DecodeRawEmailOptions, u as isEmailReceivedEvent, v as STANDARD_WEBHOOK_ID_HEADER, w as verifyStandardWebhooksSignature, x as StandardWebhooksSignResult, y as STANDARD_WEBHOOK_SIGNATURE_HEADER, z as validateEmailReceivedEvent } from "./index-CbEivn3S.js";
|
|
5
5
|
|
|
6
6
|
//#region src/index.d.ts
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as parseHeaderAddress, i as normalizeReceivedEmail, n as buildReplySubject, r as formatAddress, t as buildForwardSubject } from "./received-email-D6tKtWwW.js";
|
|
2
|
-
import { a as client, i as PrimitiveClient, r as PrimitiveApiError, s as createPrimitiveClient } from "./api-
|
|
2
|
+
import { a as client, i as PrimitiveClient, r as PrimitiveApiError, s as createPrimitiveClient } from "./api-CTf0cUsi.js";
|
|
3
3
|
import { A as PRIMITIVE_CONFIRMED_HEADER, B as RAW_EMAIL_ERRORS, C as STANDARD_WEBHOOK_ID_HEADER, D as verifyStandardWebhooksSignature, E as signStandardWebhooksPayload, F as verifyDownloadToken, G as WebhookVerificationError, H as VERIFICATION_ERRORS, I as safeValidateEmailReceivedEvent, L as validateEmailReceivedEvent, M as signWebhookPayload, N as verifyWebhookSignature, O as LEGACY_CONFIRMED_HEADER, P as generateDownloadToken, R as PAYLOAD_ERRORS, S as emailReceivedEventJsonSchema, T as STANDARD_WEBHOOK_TIMESTAMP_HEADER, U as WebhookPayloadError, V as RawEmailDecodeError, W as WebhookValidationError, _ as DmarcResult, a as isDownloadExpired, b as ParsedStatus, c as parseWebhookEvent, d as WEBHOOK_VERSION, f as validateEmailAuth, g as DmarcPolicy, h as DkimResult, i as handleWebhook, j as PRIMITIVE_SIGNATURE_HEADER, k as LEGACY_SIGNATURE_HEADER, l as receive, m as AuthVerdict, n as decodeRawEmail, o as isEmailReceivedEvent, p as AuthConfidence, r as getDownloadTimeRemaining, s as isRawIncluded, t as confirmedHeaders, u as verifyRawEmailDownload, v as EventType, w as STANDARD_WEBHOOK_SIGNATURE_HEADER, x as SpfResult, y as ForwardVerdict, z as PrimitiveWebhookError } from "./webhook-zkN4wUTs.js";
|
|
4
4
|
//#region src/index.ts
|
|
5
5
|
const primitive = {
|