@primitivedotdev/sdk 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
- export { addDomain, createEndpoint, createFilter, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, downloadAttachments, downloadRawEmail, getAccount, getEmail, getSendPermissions, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, sendEmail, testEndpoint, updateAccount, updateDomain, updateEndpoint, updateFilter, verifyDomain } from './sdk.gen.js';
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';
@@ -432,3 +432,46 @@ export const sendEmail = (options) => (options.client ?? client).post({
432
432
  ...options.headers
433
433
  }
434
434
  });
435
+ /**
436
+ * List outbound sent emails
437
+ *
438
+ * Returns a paginated list of OUTBOUND emails the caller's
439
+ * org has sent via /send-mail (and /emails/{id}/reply, which
440
+ * forwards through /send-mail). Includes every recorded
441
+ * attempt, including gate-denied attempts that the agent
442
+ * never called and rows still in `queued` state.
443
+ *
444
+ * For inbound mail received at your verified domains, see
445
+ * /emails. There is no unified send/receive history endpoint;
446
+ * the two surfaces are intentionally separate because the
447
+ * underlying tables, statuses, and lifecycle differ.
448
+ *
449
+ * Email bodies (`body_text`, `body_html`) are NOT included on
450
+ * list rows so a 50-row page can't balloon into a multi-MB
451
+ * response when sends are near the 5MB body cap. Use
452
+ * /sent-emails/{id} to fetch a single row with bodies, or
453
+ * cross-reference by `client_idempotency_key` if the caller
454
+ * already has the body locally.
455
+ *
456
+ */
457
+ export const listSentEmails = (options) => (options?.client ?? client).get({
458
+ security: [{ scheme: 'bearer', type: 'http' }],
459
+ url: '/sent-emails',
460
+ ...options
461
+ });
462
+ /**
463
+ * Get a sent email by id
464
+ *
465
+ * Returns the full sent-email record by id, including
466
+ * `body_text` and `body_html` (omitted from the listing
467
+ * endpoint to keep paginated responses small). Use this when
468
+ * diagnosing a specific send, e.g. inspecting the receiver's
469
+ * SMTP response on a `bounced` row or pulling the gate
470
+ * denial detail on a `gate_denied` row.
471
+ *
472
+ */
473
+ export const getSentEmail = (options) => (options.client ?? client).get({
474
+ security: [{ scheme: 'bearer', type: 'http' }],
475
+ url: '/sent-emails/{id}',
476
+ ...options
477
+ });
@@ -1,2 +1,2 @@
1
- import { $ as AddDomainInput, $n as ListFiltersErrors, $r as UpdateAccountResponses, $t as Endpoint, A as getStorageStats, Ai as RequestOptions, An as ListDeliveriesData, Ar as SendMailInput, At as DeleteEndpointResponses, B as rotateWebhookSecret, Bn as ListEmailsData, Br as SuccessEnvelope, Bt as DownloadAttachmentsData, C as deleteEndpoint, Ci as VerifyDomainResponses, Cn as GetStorageStatsResponses, Cr as RotateWebhookSecretResponse, Ct as DeleteEmailErrors, D as getAccount, Di as Config, Dn as GetWebhookSecretResponse, Dr as SendEmailErrors, Dt as DeleteEndpointError, E as downloadRawEmail, Ei as ClientOptions$1, En as GetWebhookSecretErrors, Er as SendEmailError, Et as DeleteEndpointData, F as listEndpoints, Fn as ListDomainsData, Fr as SendPermissionRule, Ft as DeleteFilterResponses, G as updateEndpoint, Gn as ListEndpointsData, Gr as TestEndpointResponses, Gt as DownloadRawEmailData, H as testEndpoint, Hn as ListEmailsErrors, Hr as TestEndpointError, Ht as DownloadAttachmentsErrors, I as listFilters, In as ListDomainsError, Ir as SendPermissionYourDomain, It as DeliveryStatus, J as Account, Jn as ListEndpointsResponse, Jr as UpdateAccountData, Jt as DownloadRawEmailResponse, K as updateFilter, Kn as ListEndpointsError, Kr as TestResult, Kt as DownloadRawEmailError, L as replayDelivery, Ln as ListDomainsErrors, Lr as SendPermissionsMeta, Lt as DeliverySummary, M as listDeliveries, Mi as ResponseStyle, Mn as ListDeliveriesErrors, Mr as SendPermissionAddress, Mt as DeleteFilterError, N as listDomains, Ni as Auth, Nn as ListDeliveriesResponse, Nr as SendPermissionAnyRecipient, Nt as DeleteFilterErrors, O as getEmail, Oi as CreateClientConfig, On as GetWebhookSecretResponses, Or as SendEmailResponse, Ot as DeleteEndpointErrors, P as listEmails, Pn as ListDeliveriesResponses, Pr as SendPermissionManagedZone, Pt as DeleteFilterResponse, Q as AddDomainErrors, Qn as ListFiltersError, Qr as UpdateAccountResponse, Qt as EmailSummary, R as replayEmailWebhooks, Rn as ListDomainsResponse, Rr as SentEmailStatus, Rt as Domain, S as deleteEmail, Si as VerifyDomainResponse, Sn as GetStorageStatsResponse, Sr as RotateWebhookSecretErrors, St as DeleteEmailError, T as downloadAttachments, Ti as Client, Tn as GetWebhookSecretError, Tr as SendEmailData, Tt as DeleteEmailResponses, U as updateAccount, Un as ListEmailsResponse, Ur as TestEndpointErrors, Ut as DownloadAttachmentsResponse, V as sendEmail, Vn as ListEmailsError, Vr as TestEndpointData, Vt as DownloadAttachmentsError, W as updateDomain, Wn as ListEmailsResponses, Wr as TestEndpointResponse, Wt as DownloadAttachmentsResponses, X as AddDomainData, Xn as ListEnvelope, Xr as UpdateAccountErrors, Xt as EmailDetail, Y as AccountUpdated, Yn as ListEndpointsResponses, Yr as UpdateAccountError, Yt as DownloadRawEmailResponses, Z as AddDomainError, Zn as ListFiltersData, Zr as UpdateAccountInput, Zt as EmailDetailReply, _ as Options, _i as UpdateFilterResponses, _n as GetSendPermissionsResponse, _r as ReplyToEmailResponse, _t as DeleteDomainError, a as PrimitiveApiError, ai as UpdateDomainResponses, an as GetAccountError, ar as ReplayDeliveryErrors, at as CreateEndpointErrors, b as createFilter, bi as VerifyDomainError, bn as GetStorageStatsError, br as RotateWebhookSecretData, bt as DeleteDomainResponses, c as PrimitiveClientOptions, ci as UpdateEndpointErrors, cn as GetAccountResponses, cr as ReplayEmailWebhooksData, ct as CreateEndpointResponses, d as SendResult, di as UpdateEndpointResponses, dn as GetEmailErrors, dr as ReplayEmailWebhooksResponse, dt as CreateFilterErrors, ei as UpdateDomainData, en as ErrorResponse, er as ListFiltersResponse, et as AddDomainResponse, f as SendThreadInput, fi as UpdateFilterData, fn as GetEmailResponse, fr as ReplayEmailWebhooksResponses, ft as CreateFilterInput, g as operations, gi as UpdateFilterResponse, gn as GetSendPermissionsErrors, gr as ReplyToEmailErrors, gt as DeleteDomainData, h as createPrimitiveClient, hi as UpdateFilterInput, hn as GetSendPermissionsError, hr as ReplyToEmailError, ht as Cursor, i as PrimitiveApiClientOptions, ii as UpdateDomainResponse, in as GetAccountData, ir as ReplayDeliveryError, it as CreateEndpointError, j as getWebhookSecret, ji as RequestResult, jn as ListDeliveriesError, jr as SendMailResult, jt as DeleteFilterData, k as getSendPermissions, ki as Options$1, kn as Limit, kr as SendEmailResponses, kt as DeleteEndpointResponse, l as ReplyInput, li as UpdateEndpointInput, ln as GetEmailData, lr as ReplayEmailWebhooksError, lt as CreateFilterData, m as createPrimitiveApiClient, mi as UpdateFilterErrors, mn as GetSendPermissionsData, mr as ReplyToEmailData, mt as CreateFilterResponses, n as ForwardInput, ni as UpdateDomainErrors, nn as GateDenial, nr as PaginationMeta, nt as ClientOptions, o as PrimitiveApiErrorDetails, oi as UpdateEndpointData, on as GetAccountErrors, or as ReplayDeliveryResponse, ot as CreateEndpointInput, p as client, pi as UpdateFilterError, pn as GetEmailResponses, pr as ReplayResult, pt as CreateFilterResponse, q as verifyDomain, qn as ListEndpointsErrors, qr as UnverifiedDomain, qt as DownloadRawEmailErrors, r as PrimitiveApiClient, ri as UpdateDomainInput, rn as GateFix, rr as ReplayDeliveryData, rt as CreateEndpointData, s as PrimitiveClient, si as UpdateEndpointError, sn as GetAccountResponse, sr as ReplayDeliveryResponses, st as CreateEndpointResponse, t as DEFAULT_BASE_URL, ti as UpdateDomainError, tn as Filter, tr as ListFiltersResponses, tt as AddDomainResponses, u as SendInput, ui as UpdateEndpointResponse, un as GetEmailError, ur as ReplayEmailWebhooksErrors, ut as CreateFilterError, v as addDomain, vi as VerifiedDomain, vn as GetSendPermissionsResponses, vr as ReplyToEmailResponses, vt as DeleteDomainErrors, w as deleteFilter, wi as WebhookSecret, wn as GetWebhookSecretData, wr as RotateWebhookSecretResponses, wt as DeleteEmailResponse, x as deleteDomain, xi as VerifyDomainErrors, xn as GetStorageStatsErrors, xr as RotateWebhookSecretError, xt as DeleteEmailData, y as createEndpoint, yi as VerifyDomainData, yn as GetStorageStatsData, yr as ResourceId, yt as DeleteDomainResponse, z as replyToEmail, zn as ListDomainsResponses, zr as StorageStats, zt as DomainVerifyResult } from "../index-ChLFXxTa.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, 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, 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, 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, SentEmailStatus, 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, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, operations, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, sendEmail, testEndpoint, updateAccount, updateDomain, updateEndpoint, updateFilter, verifyDomain };
1
+ import { $ as AddDomainError, $n as ListEndpointsError, $r as StorageStats, $t as EmailDetailReply, A as getSentEmail, Ai as UpdateFilterResponse, An as GetStorageStatsResponses, Ar as ReplyToEmailResponses, At as DeleteEndpointErrors, B as replayEmailWebhooks, Bi as ClientOptions$1, Bn as ListDeliveriesResponse, Br as SendEmailResponse, Bt as Domain, C as deleteEndpoint, Ci as UpdateEndpointInput, Cn as GetSentEmailErrors, Cr as ReplayEmailWebhooksResponse, Ct as DeleteEmailData, D as getAccount, Di as UpdateFilterError, Dn as GetStorageStatsError, Dr as ReplyToEmailError, Dt as DeleteEmailResponses, E as downloadRawEmail, Ei as UpdateFilterData, En as GetStorageStatsData, Er as ReplyToEmailData, Et as DeleteEmailResponse, F as listEmails, Fi as VerifyDomainErrors, Fn as GetWebhookSecretResponses, Fr as RotateWebhookSecretResponse, Ft as DeleteFilterErrors, G as updateAccount, Gi as RequestResult, Gn as ListDomainsResponse, Gr as SendPermissionAnyRecipient, Gt as DownloadAttachmentsResponse, H as rotateWebhookSecret, Hi as CreateClientConfig, Hn as ListDomainsData, Hr as SendMailInput, Ht as DownloadAttachmentsData, I as listEndpoints, Ii as VerifyDomainResponse, In as Limit, Ir as RotateWebhookSecretResponses, It as DeleteFilterResponse, J as updateFilter, Jn as ListEmailsError, Jr as SendPermissionYourDomain, Jt as DownloadRawEmailError, K as updateDomain, Ki as ResponseStyle, Kn as ListDomainsResponses, Kr as SendPermissionManagedZone, Kt as DownloadAttachmentsResponses, L as listFilters, Li as VerifyDomainResponses, Ln as ListDeliveriesData, Lr as SendEmailData, Lt as DeleteFilterResponses, M as getWebhookSecret, Mi as VerifiedDomain, Mn as GetWebhookSecretError, Mr as RotateWebhookSecretData, Mt as DeleteEndpointResponses, N as listDeliveries, Ni as VerifyDomainData, Nn as GetWebhookSecretErrors, Nr as RotateWebhookSecretError, Nt as DeleteFilterData, O as getEmail, Oi as UpdateFilterErrors, On as GetStorageStatsErrors, Or as ReplyToEmailErrors, Ot as DeleteEndpointData, P as listDomains, Pi as VerifyDomainError, Pn as GetWebhookSecretResponse, Pr as RotateWebhookSecretErrors, Pt as DeleteFilterError, Q as AddDomainData, Qn as ListEndpointsData, Qr as SentEmailSummary, Qt as EmailDetail, R as listSentEmails, Ri as WebhookSecret, Rn as ListDeliveriesError, Rr as SendEmailError, Rt as DeliveryStatus, S as deleteEmail, Si as UpdateEndpointErrors, Sn as GetSentEmailError, Sr as ReplayEmailWebhooksErrors, St as DeleteDomainResponses, T as downloadAttachments, Ti as UpdateEndpointResponses, Tn as GetSentEmailResponses, Tr as ReplayResult, Tt as DeleteEmailErrors, U as sendEmail, Ui as Options$1, Un as ListDomainsError, Ur as SendMailResult, Ut as DownloadAttachmentsError, V as replyToEmail, Vi as Config, Vn as ListDeliveriesResponses, Vr as SendEmailResponses, Vt as DomainVerifyResult, W as testEndpoint, Wi as RequestOptions, Wn as ListDomainsErrors, Wr as SendPermissionAddress, Wt as DownloadAttachmentsErrors, X as Account, Xn as ListEmailsResponse, Xr as SentEmailDetail, Xt as DownloadRawEmailResponse, Y as verifyDomain, Yn as ListEmailsErrors, Yr as SendPermissionsMeta, Yt as DownloadRawEmailErrors, Z as AccountUpdated, Zn as ListEmailsResponses, Zr as SentEmailStatus, Zt as DownloadRawEmailResponses, _ as Options, _i as UpdateDomainInput, _n as GetSendPermissionsError, _r as ReplayDeliveryErrors, _t as Cursor, a as PrimitiveApiError, ai as TestEndpointResponses, an as GateFix, ar as ListFiltersError, at as CreateEndpointData, b as createFilter, bi as UpdateEndpointData, bn as GetSendPermissionsResponses, br as ReplayEmailWebhooksData, bt as DeleteDomainErrors, c as PrimitiveClientOptions, ci as UpdateAccountData, cn as GetAccountErrors, cr as ListFiltersResponses, ct as CreateEndpointInput, d as SendResult, di as UpdateAccountInput, dn as GetEmailData, dr as ListSentEmailsErrors, dt as CreateFilterData, ei as SuccessEnvelope, en as EmailSummary, er as ListEndpointsErrors, et as AddDomainErrors, f as SendThreadInput, fi as UpdateAccountResponse, fn as GetEmailError, fr as ListSentEmailsResponse, ft as CreateFilterError, g as operations, gi as UpdateDomainErrors, gn as GetSendPermissionsData, gr as ReplayDeliveryError, gt as CreateFilterResponses, h as createPrimitiveClient, hi as UpdateDomainError, hn as GetEmailResponses, hr as ReplayDeliveryData, ht as CreateFilterResponse, i as PrimitiveApiClientOptions, ii as TestEndpointResponse, in as GateDenial, ir as ListFiltersData, it as ClientOptions, j as getStorageStats, ji as UpdateFilterResponses, jn as GetWebhookSecretData, jr as ResourceId, jt as DeleteEndpointResponse, k as getSendPermissions, ki as UpdateFilterInput, kn as GetStorageStatsResponse, kr as ReplyToEmailResponse, kt as DeleteEndpointError, l as ReplyInput, li as UpdateAccountError, ln as GetAccountResponse, lr as ListSentEmailsData, lt as CreateEndpointResponse, m as createPrimitiveApiClient, mi as UpdateDomainData, mn as GetEmailResponse, mr as PaginationMeta, mt as CreateFilterInput, n as ForwardInput, ni as TestEndpointError, nn as ErrorResponse, nr as ListEndpointsResponses, nt as AddDomainResponse, o as PrimitiveApiErrorDetails, oi as TestResult, on as GetAccountData, or as ListFiltersErrors, ot as CreateEndpointError, p as client, pi as UpdateAccountResponses, pn as GetEmailErrors, pr as ListSentEmailsResponses, pt as CreateFilterErrors, q as updateEndpoint, qi as Auth, qn as ListEmailsData, qr as SendPermissionRule, qt as DownloadRawEmailData, r as PrimitiveApiClient, ri as TestEndpointErrors, rn as Filter, rr as ListEnvelope, rt as AddDomainResponses, s as PrimitiveClient, si as UnverifiedDomain, sn as GetAccountError, sr as ListFiltersResponse, st as CreateEndpointErrors, t as DEFAULT_BASE_URL, ti as TestEndpointData, tn as Endpoint, tr as ListEndpointsResponse, tt as AddDomainInput, u as SendInput, ui as UpdateAccountErrors, un as GetAccountResponses, ur as ListSentEmailsError, ut as CreateEndpointResponses, v as addDomain, vi as UpdateDomainResponse, vn as GetSendPermissionsErrors, vr as ReplayDeliveryResponse, vt as DeleteDomainData, w as deleteFilter, wi as UpdateEndpointResponse, wn as GetSentEmailResponse, wr as ReplayEmailWebhooksResponses, wt as DeleteEmailError, x as deleteDomain, xi as UpdateEndpointError, xn as GetSentEmailData, xr as ReplayEmailWebhooksError, xt as DeleteDomainResponse, y as createEndpoint, yi as UpdateDomainResponses, yn as GetSendPermissionsResponse, yr as ReplayDeliveryResponses, yt as DeleteDomainError, z as replayDelivery, zi as Client, zn as ListDeliveriesErrors, zr as SendEmailErrors, zt as DeliverySummary } from "../index-Cts9r1sL.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, 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 };
@@ -625,6 +625,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
625
625
  getAccount: () => getAccount,
626
626
  getEmail: () => getEmail,
627
627
  getSendPermissions: () => getSendPermissions,
628
+ getSentEmail: () => getSentEmail,
628
629
  getStorageStats: () => getStorageStats,
629
630
  getWebhookSecret: () => getWebhookSecret,
630
631
  listDeliveries: () => listDeliveries,
@@ -632,6 +633,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
632
633
  listEmails: () => listEmails,
633
634
  listEndpoints: () => listEndpoints,
634
635
  listFilters: () => listFilters,
636
+ listSentEmails: () => listSentEmails,
635
637
  replayDelivery: () => replayDelivery,
636
638
  replayEmailWebhooks: () => replayEmailWebhooks,
637
639
  replyToEmail: () => replyToEmail,
@@ -1166,6 +1168,55 @@ const sendEmail = (options) => (options.client ?? client$1).post({
1166
1168
  ...options.headers
1167
1169
  }
1168
1170
  });
1171
+ /**
1172
+ * List outbound sent emails
1173
+ *
1174
+ * Returns a paginated list of OUTBOUND emails the caller's
1175
+ * org has sent via /send-mail (and /emails/{id}/reply, which
1176
+ * forwards through /send-mail). Includes every recorded
1177
+ * attempt, including gate-denied attempts that the agent
1178
+ * never called and rows still in `queued` state.
1179
+ *
1180
+ * For inbound mail received at your verified domains, see
1181
+ * /emails. There is no unified send/receive history endpoint;
1182
+ * the two surfaces are intentionally separate because the
1183
+ * underlying tables, statuses, and lifecycle differ.
1184
+ *
1185
+ * Email bodies (`body_text`, `body_html`) are NOT included on
1186
+ * list rows so a 50-row page can't balloon into a multi-MB
1187
+ * response when sends are near the 5MB body cap. Use
1188
+ * /sent-emails/{id} to fetch a single row with bodies, or
1189
+ * cross-reference by `client_idempotency_key` if the caller
1190
+ * already has the body locally.
1191
+ *
1192
+ */
1193
+ const listSentEmails = (options) => (options?.client ?? client$1).get({
1194
+ security: [{
1195
+ scheme: "bearer",
1196
+ type: "http"
1197
+ }],
1198
+ url: "/sent-emails",
1199
+ ...options
1200
+ });
1201
+ /**
1202
+ * Get a sent email by id
1203
+ *
1204
+ * Returns the full sent-email record by id, including
1205
+ * `body_text` and `body_html` (omitted from the listing
1206
+ * endpoint to keep paginated responses small). Use this when
1207
+ * diagnosing a specific send, e.g. inspecting the receiver's
1208
+ * SMTP response on a `bounced` row or pulling the gate
1209
+ * denial detail on a `gate_denied` row.
1210
+ *
1211
+ */
1212
+ const getSentEmail = (options) => (options.client ?? client$1).get({
1213
+ security: [{
1214
+ scheme: "bearer",
1215
+ type: "http"
1216
+ }],
1217
+ url: "/sent-emails/{id}",
1218
+ ...options
1219
+ });
1169
1220
  //#endregion
1170
1221
  //#region src/api/index.ts
1171
1222
  const DEFAULT_BASE_URL = "https://www.primitive.dev/api/v1";
@@ -1412,4 +1463,4 @@ function client(options = {}) {
1412
1463
  }
1413
1464
  const operations = sdk_gen_exports;
1414
1465
  //#endregion
1415
- export { replyToEmail as A, listDeliveries as C, listFilters as D, listEndpoints as E, updateDomain as F, updateEndpoint as I, updateFilter as L, sendEmail as M, testEndpoint as N, replayDelivery as O, updateAccount as P, verifyDomain as R, getWebhookSecret as S, listEmails as T, downloadRawEmail as _, client as a, getSendPermissions as b, operations as c, createFilter as d, deleteDomain as f, downloadAttachments as g, deleteFilter as h, PrimitiveClient as i, rotateWebhookSecret as j, replayEmailWebhooks 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, getAccount as v, listDomains as w, getStorageStats as x, getEmail as y };
1466
+ export { replayDelivery as A, verifyDomain as B, getWebhookSecret as C, listEndpoints as D, listEmails as E, testEndpoint as F, updateAccount as I, updateDomain as L, replyToEmail as M, rotateWebhookSecret as N, listFilters as O, sendEmail as P, updateEndpoint as R, getStorageStats as S, listDomains as T, downloadRawEmail as _, client as a, getSendPermissions as b, operations as c, createFilter as d, deleteDomain as f, downloadAttachments as g, deleteFilter as h, PrimitiveClient as i, replayEmailWebhooks as j, listSentEmails 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, getAccount as v, listDeliveries as w, getSentEmail as x, getEmail as y, updateFilter as z };
@@ -746,8 +746,220 @@ type SendMailInput = {
746
746
  */
747
747
  wait_timeout_ms?: number;
748
748
  };
749
- type SentEmailStatus = 'queued' | 'submitted_to_agent' | 'agent_failed' | 'unknown' | 'delivered' | 'bounced' | 'deferred' | 'wait_timeout';
749
+ /**
750
+ * Lifecycle status of a sent_emails row. Possible values:
751
+ *
752
+ * - `queued`: pre-call INSERT; the outbound agent has not
753
+ * yet replied.
754
+ * - `submitted_to_agent`: agent accepted; `queue_id` is set.
755
+ * - `agent_failed`: agent rejected; `error_code` and
756
+ * `error_message` carry the reason.
757
+ * - `gate_denied`: a recipient-scope gate denied the send;
758
+ * the agent was never called. The `gates` array carries
759
+ * the denial detail. /send-mail returns 403 in this case
760
+ * so callers see the denial synchronously; /sent-emails
761
+ * additionally records the row for historical lookup,
762
+ * which is when this status appears in a listing.
763
+ * - `unknown`: terminal indeterminate; the on-box log
764
+ * poller couldn't classify the receiver's response.
765
+ * - `delivered` / `bounced` / `deferred` / `wait_timeout`:
766
+ * terminal delivery outcomes (see DeliveryStatus).
767
+ *
768
+ */
769
+ type SentEmailStatus = 'queued' | 'submitted_to_agent' | 'agent_failed' | 'gate_denied' | 'unknown' | 'delivered' | 'bounced' | 'deferred' | 'wait_timeout';
750
770
  type DeliveryStatus = 'delivered' | 'bounced' | 'deferred' | 'wait_timeout';
771
+ /**
772
+ * List-row projection of a sent-email record. Drops
773
+ * `body_text` and `body_html` to keep paginated responses
774
+ * small; fetch /sent-emails/{id} for the full record with
775
+ * bodies.
776
+ *
777
+ */
778
+ type SentEmailSummary = {
779
+ id: string;
780
+ status: SentEmailStatus;
781
+ /**
782
+ * Timestamp of the most recent status transition.
783
+ * Polling clients should treat `status='queued'` AND
784
+ * `status_changed_at` older than 5 minutes as
785
+ * "stuck-queued" (the post-tx UPDATE failed and the
786
+ * actual delivery state is recoverable from on-box logs
787
+ * via `queue_id` when populated, or `request_id`).
788
+ *
789
+ */
790
+ status_changed_at: string;
791
+ created_at: string;
792
+ updated_at: string;
793
+ /**
794
+ * Effective idempotency key used for this send. If the
795
+ * caller passed the `Idempotency-Key` header, this is
796
+ * that value; otherwise it's a server-derived hash of
797
+ * the canonical request payload.
798
+ *
799
+ */
800
+ client_idempotency_key?: string | null;
801
+ /**
802
+ * Stable hash of the canonical send payload.
803
+ */
804
+ content_hash: string;
805
+ /**
806
+ * Raw `From:` header as sent on the wire, including any
807
+ * display name (e.g. `"Acme Support" <agent@acme.test>`).
808
+ *
809
+ */
810
+ from_header: string;
811
+ /**
812
+ * Bare email address parsed from `from_header`.
813
+ */
814
+ from_address: string;
815
+ /**
816
+ * Raw `To:` header as sent on the wire, including any
817
+ * display name.
818
+ *
819
+ */
820
+ to_header: string;
821
+ /**
822
+ * Bare email address parsed from `to_header`.
823
+ */
824
+ to_address: string;
825
+ subject: string;
826
+ /**
827
+ * Total UTF-8 byte length of `body_text` + `body_html`.
828
+ * Surfaced on the list endpoint so callers can see "this
829
+ * row has a 4MB body" without fetching it.
830
+ *
831
+ */
832
+ body_size_bytes: number;
833
+ /**
834
+ * Timestamp at which the bodies were discarded by an
835
+ * entitlement-driven retention policy. Null when bodies
836
+ * are still present. The detail endpoint returns
837
+ * null-valued `body_text`/`body_html` for discarded rows.
838
+ *
839
+ */
840
+ content_discarded_at?: string | null;
841
+ /**
842
+ * Wire-level Message-ID assigned to the outbound message
843
+ * (RFC 5322). Null on rows that never reached signing
844
+ * (queued, gate_denied, agent_failed before signing).
845
+ *
846
+ */
847
+ message_id?: string | null;
848
+ /**
849
+ * Wire-level In-Reply-To header value, when this send
850
+ * was a reply.
851
+ *
852
+ */
853
+ in_reply_to?: string | null;
854
+ /**
855
+ * Wire-level References header value, when this send
856
+ * was a reply.
857
+ *
858
+ */
859
+ email_references?: string | null;
860
+ /**
861
+ * Reference to the inbound `emails.id` that this send
862
+ * replied to, when known. Populated when the caller used
863
+ * /emails/{id}/reply or when /send-mail's `in_reply_to`
864
+ * matched a stored inbound message_id in the same org.
865
+ *
866
+ */
867
+ in_reply_to_email_id?: string | null;
868
+ /**
869
+ * Message identifier assigned by Primitive's outbound
870
+ * relay once the agent accepts the message. Null on
871
+ * queued, gate_denied, and agent_failed rows.
872
+ *
873
+ */
874
+ queue_id?: string | null;
875
+ /**
876
+ * Receiver's 3-digit SMTP code (e.g. 250, 550, 451).
877
+ * Populated on terminal delivery statuses; may be null
878
+ * on a deferred where the agent never got an SMTP-level
879
+ * response (TCP refused, DNS failed, TLS handshake
880
+ * failed). `smtp_response_text` still carries Postfix's
881
+ * descriptive text in those cases.
882
+ *
883
+ */
884
+ smtp_response_code?: number | null;
885
+ /**
886
+ * Free-form text portion of the receiver's SMTP
887
+ * response. The most useful debugging signal on a
888
+ * `bounced` or `deferred` row.
889
+ *
890
+ */
891
+ smtp_response_text?: string | null;
892
+ /**
893
+ * RFC 3463 enhanced status code (e.g. `5.1.1` for "Bad
894
+ * destination mailbox address"). Distinct from
895
+ * `smtp_response_code`: the basic 3-digit code is coarse
896
+ * (550 = "permanent failure"), the enhanced code is
897
+ * finer-grained.
898
+ *
899
+ */
900
+ smtp_enhanced_status_code?: string | null;
901
+ /**
902
+ * DKIM selector used to sign the outbound message.
903
+ * Public DNS data; useful for diagnosing why a downstream
904
+ * verifier rejected the signature.
905
+ *
906
+ */
907
+ dkim_selector?: string | null;
908
+ /**
909
+ * DKIM signing domain.
910
+ */
911
+ dkim_domain?: string | null;
912
+ /**
913
+ * Stable public error code on `agent_failed` rows. The
914
+ * agent's internal codes are remapped to a stable public
915
+ * taxonomy (see `publicAgentError` in the server) so this
916
+ * field is safe to branch on across agent versions.
917
+ *
918
+ */
919
+ error_code?: string | null;
920
+ /**
921
+ * Free-form error message accompanying `error_code`.
922
+ */
923
+ error_message?: string | null;
924
+ /**
925
+ * Gate-denial detail on `gate_denied` rows. Mirrors the
926
+ * synchronous /send-mail 403 contract so a caller's
927
+ * GateDenial handler is the same across live denies and
928
+ * historical lookups. Null on every other status.
929
+ *
930
+ */
931
+ gates?: Array<GateDenial> | null;
932
+ /**
933
+ * Server-issued request identifier from the original
934
+ * /send-mail call. Surfaced as the `X-Request-Id`
935
+ * response header on the live send and recorded here
936
+ * for support escalation.
937
+ *
938
+ */
939
+ request_id?: string | null;
940
+ };
941
+ /**
942
+ * Full sent-email record, including `body_text` and
943
+ * `body_html`. Returned by /sent-emails/{id}.
944
+ *
945
+ */
946
+ type SentEmailDetail = SentEmailSummary & {
947
+ /**
948
+ * Plain-text body sent on the wire. Null when the
949
+ * send carried only an HTML body, or when bodies have
950
+ * been discarded post-send (`content_discarded_at`
951
+ * set).
952
+ *
953
+ */
954
+ body_text?: string | null;
955
+ /**
956
+ * HTML body sent on the wire. Null when the send
957
+ * carried only a plain-text body, or when bodies
958
+ * have been discarded post-send.
959
+ *
960
+ */
961
+ body_html?: string | null;
962
+ };
751
963
  /**
752
964
  * Body shape for `/emails/{id}/reply`. Intentionally narrow:
753
965
  * recipients (`to`), subject, and threading headers
@@ -792,6 +1004,21 @@ type SendMailResult = {
792
1004
  */
793
1005
  id: string;
794
1006
  status: SentEmailStatus;
1007
+ /**
1008
+ * Bare from-address actually written on the wire. Echoed
1009
+ * on every success branch so callers can confirm what
1010
+ * went out, particularly useful for the /emails/{id}/reply
1011
+ * path where `from` is server-derived from the inbound's
1012
+ * recipient when the caller doesn't override.
1013
+ *
1014
+ * For sends where the caller passed a from-header that
1015
+ * included a display name (e.g. `"Acme Support" <support@acme.test>`),
1016
+ * this field is the parsed bare address (`support@acme.test`).
1017
+ * The display name was sent on the wire intact; this field
1018
+ * just makes the address easy to compare against allowlists.
1019
+ *
1020
+ */
1021
+ from: string;
795
1022
  /**
796
1023
  * Message identifier assigned by Primitive's outbound relay, when available.
797
1024
  */
@@ -2189,8 +2416,115 @@ type SendEmailResponses = {
2189
2416
  };
2190
2417
  };
2191
2418
  type SendEmailResponse = SendEmailResponses[keyof SendEmailResponses];
2419
+ type ListSentEmailsData = {
2420
+ body?: never;
2421
+ path?: never;
2422
+ query?: {
2423
+ /**
2424
+ * Pagination cursor from a previous response's `meta.cursor` field.
2425
+ * Format: `{ISO-datetime}|{id}`
2426
+ *
2427
+ */
2428
+ cursor?: string;
2429
+ /**
2430
+ * Number of results per page
2431
+ */
2432
+ limit?: number;
2433
+ /**
2434
+ * Filter to rows in this status. Useful for polling
2435
+ * queued rows that haven't transitioned, auditing
2436
+ * gate-denied attempts, or listing only successful
2437
+ * deliveries.
2438
+ *
2439
+ */
2440
+ status?: SentEmailStatus;
2441
+ /**
2442
+ * Filter to the row matching a specific server-issued
2443
+ * `request_id`. The /send-mail response surfaces
2444
+ * `request_id` on every send; this lookup lets the
2445
+ * caller find the historical row for a given live call
2446
+ * without remembering its `id`.
2447
+ *
2448
+ */
2449
+ request_id?: string;
2450
+ /**
2451
+ * Filter to rows with the given `client_idempotency_key`.
2452
+ * Multiple rows can share a key (a retry that hit the
2453
+ * idempotent-replay path returns the same row, but a
2454
+ * retry with a DIFFERENT canonical payload under the
2455
+ * same key is rejected by /send-mail before the row is
2456
+ * written, so duplicates are bounded).
2457
+ *
2458
+ */
2459
+ idempotency_key?: string;
2460
+ /**
2461
+ * Inclusive lower bound on `created_at`.
2462
+ */
2463
+ date_from?: string;
2464
+ /**
2465
+ * Inclusive upper bound on `created_at`.
2466
+ */
2467
+ date_to?: string;
2468
+ };
2469
+ url: '/sent-emails';
2470
+ };
2471
+ type ListSentEmailsErrors = {
2472
+ /**
2473
+ * Invalid request parameters
2474
+ */
2475
+ 400: ErrorResponse;
2476
+ /**
2477
+ * Invalid or missing API key
2478
+ */
2479
+ 401: ErrorResponse;
2480
+ };
2481
+ type ListSentEmailsError = ListSentEmailsErrors[keyof ListSentEmailsErrors];
2482
+ type ListSentEmailsResponses = {
2483
+ /**
2484
+ * Page of sent-email summaries
2485
+ */
2486
+ 200: ListEnvelope & {
2487
+ data?: Array<SentEmailSummary>;
2488
+ };
2489
+ };
2490
+ type ListSentEmailsResponse = ListSentEmailsResponses[keyof ListSentEmailsResponses];
2491
+ type GetSentEmailData = {
2492
+ body?: never;
2493
+ path: {
2494
+ /**
2495
+ * Resource UUID
2496
+ */
2497
+ id: string;
2498
+ };
2499
+ query?: never;
2500
+ url: '/sent-emails/{id}';
2501
+ };
2502
+ type GetSentEmailErrors = {
2503
+ /**
2504
+ * Invalid request parameters
2505
+ */
2506
+ 400: ErrorResponse;
2507
+ /**
2508
+ * Invalid or missing API key
2509
+ */
2510
+ 401: ErrorResponse;
2511
+ /**
2512
+ * Resource not found
2513
+ */
2514
+ 404: ErrorResponse;
2515
+ };
2516
+ type GetSentEmailError = GetSentEmailErrors[keyof GetSentEmailErrors];
2517
+ type GetSentEmailResponses = {
2518
+ /**
2519
+ * Sent-email detail
2520
+ */
2521
+ 200: SuccessEnvelope & {
2522
+ data?: SentEmailDetail;
2523
+ };
2524
+ };
2525
+ type GetSentEmailResponse = GetSentEmailResponses[keyof GetSentEmailResponses];
2192
2526
  declare namespace sdk_gen_d_exports {
2193
- export { Options, addDomain, createEndpoint, createFilter, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, downloadAttachments, downloadRawEmail, getAccount, getEmail, getSendPermissions, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, sendEmail, testEndpoint, updateAccount, updateDomain, updateEndpoint, updateFilter, verifyDomain };
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 };
2194
2528
  }
2195
2529
  type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
2196
2530
  /**
@@ -2473,6 +2807,41 @@ declare const getSendPermissions: <ThrowOnError extends boolean = false>(options
2473
2807
  *
2474
2808
  */
2475
2809
  declare const sendEmail: <ThrowOnError extends boolean = false>(options: Options<SendEmailData, ThrowOnError>) => RequestResult<SendEmailResponses, SendEmailErrors, ThrowOnError, "fields">;
2810
+ /**
2811
+ * List outbound sent emails
2812
+ *
2813
+ * Returns a paginated list of OUTBOUND emails the caller's
2814
+ * org has sent via /send-mail (and /emails/{id}/reply, which
2815
+ * forwards through /send-mail). Includes every recorded
2816
+ * attempt, including gate-denied attempts that the agent
2817
+ * never called and rows still in `queued` state.
2818
+ *
2819
+ * For inbound mail received at your verified domains, see
2820
+ * /emails. There is no unified send/receive history endpoint;
2821
+ * the two surfaces are intentionally separate because the
2822
+ * underlying tables, statuses, and lifecycle differ.
2823
+ *
2824
+ * Email bodies (`body_text`, `body_html`) are NOT included on
2825
+ * list rows so a 50-row page can't balloon into a multi-MB
2826
+ * response when sends are near the 5MB body cap. Use
2827
+ * /sent-emails/{id} to fetch a single row with bodies, or
2828
+ * cross-reference by `client_idempotency_key` if the caller
2829
+ * already has the body locally.
2830
+ *
2831
+ */
2832
+ declare const listSentEmails: <ThrowOnError extends boolean = false>(options?: Options<ListSentEmailsData, ThrowOnError>) => RequestResult<ListSentEmailsResponses, ListSentEmailsErrors, ThrowOnError, "fields">;
2833
+ /**
2834
+ * Get a sent email by id
2835
+ *
2836
+ * Returns the full sent-email record by id, including
2837
+ * `body_text` and `body_html` (omitted from the listing
2838
+ * endpoint to keep paginated responses small). Use this when
2839
+ * diagnosing a specific send, e.g. inspecting the receiver's
2840
+ * SMTP response on a `bounced` row or pulling the gate
2841
+ * denial detail on a `gate_denied` row.
2842
+ *
2843
+ */
2844
+ declare const getSentEmail: <ThrowOnError extends boolean = false>(options: Options<GetSentEmailData, ThrowOnError>) => RequestResult<GetSentEmailResponses, GetSentEmailErrors, ThrowOnError, "fields">;
2476
2845
  //#endregion
2477
2846
  //#region src/api/index.d.ts
2478
2847
  declare const DEFAULT_BASE_URL = "https://www.primitive.dev/api/v1";
@@ -2600,4 +2969,4 @@ declare function createPrimitiveClient(options?: PrimitiveClientOptions): Primit
2600
2969
  declare function client(options?: PrimitiveClientOptions): PrimitiveClient;
2601
2970
  declare const operations: typeof sdk_gen_d_exports;
2602
2971
  //#endregion
2603
- export { AddDomainInput as $, ListFiltersErrors as $n, UpdateAccountResponses as $r, Endpoint as $t, getStorageStats as A, RequestOptions as Ai, ListDeliveriesData as An, SendMailInput as Ar, DeleteEndpointResponses as At, rotateWebhookSecret as B, ListEmailsData as Bn, SuccessEnvelope as Br, DownloadAttachmentsData as Bt, deleteEndpoint as C, VerifyDomainResponses as Ci, GetStorageStatsResponses as Cn, RotateWebhookSecretResponse as Cr, DeleteEmailErrors as Ct, getAccount as D, Config as Di, GetWebhookSecretResponse as Dn, SendEmailErrors as Dr, DeleteEndpointError as Dt, downloadRawEmail as E, ClientOptions$1 as Ei, GetWebhookSecretErrors as En, SendEmailError as Er, DeleteEndpointData as Et, listEndpoints as F, ListDomainsData as Fn, SendPermissionRule as Fr, DeleteFilterResponses as Ft, updateEndpoint as G, ListEndpointsData as Gn, TestEndpointResponses as Gr, DownloadRawEmailData as Gt, testEndpoint as H, ListEmailsErrors as Hn, TestEndpointError as Hr, DownloadAttachmentsErrors as Ht, listFilters as I, ListDomainsError as In, SendPermissionYourDomain as Ir, DeliveryStatus as It, Account as J, ListEndpointsResponse as Jn, UpdateAccountData as Jr, DownloadRawEmailResponse as Jt, updateFilter as K, ListEndpointsError as Kn, TestResult as Kr, DownloadRawEmailError as Kt, replayDelivery as L, ListDomainsErrors as Ln, SendPermissionsMeta as Lr, DeliverySummary as Lt, listDeliveries as M, ResponseStyle as Mi, ListDeliveriesErrors as Mn, SendPermissionAddress as Mr, DeleteFilterError as Mt, listDomains as N, Auth as Ni, ListDeliveriesResponse as Nn, SendPermissionAnyRecipient as Nr, DeleteFilterErrors as Nt, getEmail as O, CreateClientConfig as Oi, GetWebhookSecretResponses as On, SendEmailResponse as Or, DeleteEndpointErrors as Ot, listEmails as P, ListDeliveriesResponses as Pn, SendPermissionManagedZone as Pr, DeleteFilterResponse as Pt, AddDomainErrors as Q, ListFiltersError as Qn, UpdateAccountResponse as Qr, EmailSummary as Qt, replayEmailWebhooks as R, ListDomainsResponse as Rn, SentEmailStatus as Rr, Domain as Rt, deleteEmail as S, VerifyDomainResponse as Si, GetStorageStatsResponse as Sn, RotateWebhookSecretErrors as Sr, DeleteEmailError as St, downloadAttachments as T, Client as Ti, GetWebhookSecretError as Tn, SendEmailData as Tr, DeleteEmailResponses as Tt, updateAccount as U, ListEmailsResponse as Un, TestEndpointErrors as Ur, DownloadAttachmentsResponse as Ut, sendEmail as V, ListEmailsError as Vn, TestEndpointData as Vr, DownloadAttachmentsError as Vt, updateDomain as W, ListEmailsResponses as Wn, TestEndpointResponse as Wr, DownloadAttachmentsResponses as Wt, AddDomainData as X, ListEnvelope as Xn, UpdateAccountErrors as Xr, EmailDetail as Xt, AccountUpdated as Y, ListEndpointsResponses as Yn, UpdateAccountError as Yr, DownloadRawEmailResponses as Yt, AddDomainError as Z, ListFiltersData as Zn, UpdateAccountInput as Zr, EmailDetailReply as Zt, Options as _, UpdateFilterResponses as _i, GetSendPermissionsResponse as _n, ReplyToEmailResponse as _r, DeleteDomainError as _t, PrimitiveApiError as a, UpdateDomainResponses as ai, GetAccountError as an, ReplayDeliveryErrors as ar, CreateEndpointErrors as at, createFilter as b, VerifyDomainError as bi, GetStorageStatsError as bn, RotateWebhookSecretData as br, DeleteDomainResponses as bt, PrimitiveClientOptions as c, UpdateEndpointErrors as ci, GetAccountResponses as cn, ReplayEmailWebhooksData as cr, CreateEndpointResponses as ct, SendResult as d, UpdateEndpointResponses as di, GetEmailErrors as dn, ReplayEmailWebhooksResponse as dr, CreateFilterErrors as dt, UpdateDomainData as ei, ErrorResponse as en, ListFiltersResponse as er, AddDomainResponse as et, SendThreadInput as f, UpdateFilterData as fi, GetEmailResponse as fn, ReplayEmailWebhooksResponses as fr, CreateFilterInput as ft, operations as g, UpdateFilterResponse as gi, GetSendPermissionsErrors as gn, ReplyToEmailErrors as gr, DeleteDomainData as gt, createPrimitiveClient as h, UpdateFilterInput as hi, GetSendPermissionsError as hn, ReplyToEmailError as hr, Cursor as ht, PrimitiveApiClientOptions as i, UpdateDomainResponse as ii, GetAccountData as in, ReplayDeliveryError as ir, CreateEndpointError as it, getWebhookSecret as j, RequestResult as ji, ListDeliveriesError as jn, SendMailResult as jr, DeleteFilterData as jt, getSendPermissions as k, Options$1 as ki, Limit as kn, SendEmailResponses as kr, DeleteEndpointResponse as kt, ReplyInput as l, UpdateEndpointInput as li, GetEmailData as ln, ReplayEmailWebhooksError as lr, CreateFilterData as lt, createPrimitiveApiClient as m, UpdateFilterErrors as mi, GetSendPermissionsData as mn, ReplyToEmailData as mr, CreateFilterResponses as mt, ForwardInput as n, UpdateDomainErrors as ni, GateDenial as nn, PaginationMeta as nr, ClientOptions as nt, PrimitiveApiErrorDetails as o, UpdateEndpointData as oi, GetAccountErrors as on, ReplayDeliveryResponse as or, CreateEndpointInput as ot, client as p, UpdateFilterError as pi, GetEmailResponses as pn, ReplayResult as pr, CreateFilterResponse as pt, verifyDomain as q, ListEndpointsErrors as qn, UnverifiedDomain as qr, DownloadRawEmailErrors as qt, PrimitiveApiClient as r, UpdateDomainInput as ri, GateFix as rn, ReplayDeliveryData as rr, CreateEndpointData as rt, PrimitiveClient as s, UpdateEndpointError as si, GetAccountResponse as sn, ReplayDeliveryResponses as sr, CreateEndpointResponse as st, DEFAULT_BASE_URL as t, UpdateDomainError as ti, Filter as tn, ListFiltersResponses as tr, AddDomainResponses as tt, SendInput as u, UpdateEndpointResponse as ui, GetEmailError as un, ReplayEmailWebhooksErrors as ur, CreateFilterError as ut, addDomain as v, VerifiedDomain as vi, GetSendPermissionsResponses as vn, ReplyToEmailResponses as vr, DeleteDomainErrors as vt, deleteFilter as w, WebhookSecret as wi, GetWebhookSecretData as wn, RotateWebhookSecretResponses as wr, DeleteEmailResponse as wt, deleteDomain as x, VerifyDomainErrors as xi, GetStorageStatsErrors as xn, RotateWebhookSecretError as xr, DeleteEmailData as xt, createEndpoint as y, VerifyDomainData as yi, GetStorageStatsData as yn, ResourceId as yr, DeleteDomainResponse as yt, replyToEmail as z, ListDomainsResponses as zn, StorageStats as zr, DomainVerifyResult as zt };
2972
+ export { AddDomainError as $, ListEndpointsError as $n, StorageStats as $r, EmailDetailReply as $t, getSentEmail as A, UpdateFilterResponse as Ai, GetStorageStatsResponses as An, ReplyToEmailResponses as Ar, DeleteEndpointErrors as At, replayEmailWebhooks as B, ClientOptions$1 as Bi, ListDeliveriesResponse as Bn, SendEmailResponse as Br, Domain as Bt, deleteEndpoint as C, UpdateEndpointInput as Ci, GetSentEmailErrors as Cn, ReplayEmailWebhooksResponse as Cr, DeleteEmailData as Ct, getAccount as D, UpdateFilterError as Di, GetStorageStatsError as Dn, ReplyToEmailError as Dr, DeleteEmailResponses as Dt, downloadRawEmail as E, UpdateFilterData as Ei, GetStorageStatsData as En, ReplyToEmailData as Er, DeleteEmailResponse as Et, listEmails as F, VerifyDomainErrors as Fi, GetWebhookSecretResponses as Fn, RotateWebhookSecretResponse as Fr, DeleteFilterErrors as Ft, updateAccount as G, RequestResult as Gi, ListDomainsResponse as Gn, SendPermissionAnyRecipient as Gr, DownloadAttachmentsResponse as Gt, rotateWebhookSecret as H, CreateClientConfig as Hi, ListDomainsData as Hn, SendMailInput as Hr, DownloadAttachmentsData as Ht, listEndpoints as I, VerifyDomainResponse as Ii, Limit as In, RotateWebhookSecretResponses as Ir, DeleteFilterResponse as It, updateFilter as J, ListEmailsError as Jn, SendPermissionYourDomain as Jr, DownloadRawEmailError as Jt, updateDomain as K, ResponseStyle as Ki, ListDomainsResponses as Kn, SendPermissionManagedZone as Kr, DownloadAttachmentsResponses as Kt, listFilters as L, VerifyDomainResponses as Li, ListDeliveriesData as Ln, SendEmailData as Lr, DeleteFilterResponses as Lt, getWebhookSecret as M, VerifiedDomain as Mi, GetWebhookSecretError as Mn, RotateWebhookSecretData as Mr, DeleteEndpointResponses as Mt, listDeliveries as N, VerifyDomainData as Ni, GetWebhookSecretErrors as Nn, RotateWebhookSecretError as Nr, DeleteFilterData as Nt, getEmail as O, UpdateFilterErrors as Oi, GetStorageStatsErrors as On, ReplyToEmailErrors as Or, DeleteEndpointData as Ot, listDomains as P, VerifyDomainError as Pi, GetWebhookSecretResponse as Pn, RotateWebhookSecretErrors as Pr, DeleteFilterError as Pt, AddDomainData as Q, ListEndpointsData as Qn, SentEmailSummary as Qr, EmailDetail as Qt, listSentEmails as R, WebhookSecret as Ri, ListDeliveriesError as Rn, SendEmailError as Rr, DeliveryStatus as Rt, deleteEmail as S, UpdateEndpointErrors as Si, GetSentEmailError as Sn, ReplayEmailWebhooksErrors as Sr, DeleteDomainResponses as St, downloadAttachments as T, UpdateEndpointResponses as Ti, GetSentEmailResponses as Tn, ReplayResult as Tr, DeleteEmailErrors as Tt, sendEmail as U, Options$1 as Ui, ListDomainsError as Un, SendMailResult as Ur, DownloadAttachmentsError as Ut, replyToEmail as V, Config as Vi, ListDeliveriesResponses as Vn, SendEmailResponses as Vr, DomainVerifyResult as Vt, testEndpoint as W, RequestOptions as Wi, ListDomainsErrors as Wn, SendPermissionAddress as Wr, DownloadAttachmentsErrors as Wt, Account as X, ListEmailsResponse as Xn, SentEmailDetail as Xr, DownloadRawEmailResponse as Xt, verifyDomain as Y, ListEmailsErrors as Yn, SendPermissionsMeta as Yr, DownloadRawEmailErrors as Yt, AccountUpdated as Z, ListEmailsResponses as Zn, SentEmailStatus as Zr, DownloadRawEmailResponses as Zt, Options as _, UpdateDomainInput as _i, GetSendPermissionsError as _n, ReplayDeliveryErrors as _r, Cursor as _t, PrimitiveApiError as a, TestEndpointResponses as ai, GateFix as an, ListFiltersError as ar, CreateEndpointData as at, createFilter as b, UpdateEndpointData as bi, GetSendPermissionsResponses as bn, ReplayEmailWebhooksData as br, DeleteDomainErrors as bt, PrimitiveClientOptions as c, UpdateAccountData as ci, GetAccountErrors as cn, ListFiltersResponses as cr, CreateEndpointInput as ct, SendResult as d, UpdateAccountInput as di, GetEmailData as dn, ListSentEmailsErrors as dr, CreateFilterData as dt, SuccessEnvelope as ei, EmailSummary as en, ListEndpointsErrors as er, AddDomainErrors as et, SendThreadInput as f, UpdateAccountResponse as fi, GetEmailError as fn, ListSentEmailsResponse as fr, CreateFilterError as ft, operations as g, UpdateDomainErrors as gi, GetSendPermissionsData as gn, ReplayDeliveryError as gr, CreateFilterResponses as gt, createPrimitiveClient as h, UpdateDomainError as hi, GetEmailResponses as hn, ReplayDeliveryData as hr, CreateFilterResponse as ht, PrimitiveApiClientOptions as i, TestEndpointResponse as ii, GateDenial as in, ListFiltersData as ir, ClientOptions as it, getStorageStats as j, UpdateFilterResponses as ji, GetWebhookSecretData as jn, ResourceId as jr, DeleteEndpointResponse as jt, getSendPermissions as k, UpdateFilterInput as ki, GetStorageStatsResponse as kn, ReplyToEmailResponse as kr, DeleteEndpointError as kt, ReplyInput as l, UpdateAccountError as li, GetAccountResponse as ln, ListSentEmailsData as lr, CreateEndpointResponse as lt, createPrimitiveApiClient as m, UpdateDomainData as mi, GetEmailResponse as mn, PaginationMeta as mr, CreateFilterInput as mt, ForwardInput as n, TestEndpointError as ni, ErrorResponse as nn, ListEndpointsResponses as nr, AddDomainResponse as nt, PrimitiveApiErrorDetails as o, TestResult as oi, GetAccountData as on, ListFiltersErrors as or, CreateEndpointError as ot, client as p, UpdateAccountResponses as pi, GetEmailErrors as pn, ListSentEmailsResponses as pr, CreateFilterErrors as pt, updateEndpoint as q, Auth as qi, ListEmailsData as qn, SendPermissionRule as qr, DownloadRawEmailData as qt, PrimitiveApiClient as r, TestEndpointErrors as ri, Filter as rn, ListEnvelope as rr, AddDomainResponses as rt, PrimitiveClient as s, UnverifiedDomain as si, GetAccountError as sn, ListFiltersResponse as sr, CreateEndpointErrors as st, DEFAULT_BASE_URL as t, TestEndpointData as ti, Endpoint as tn, ListEndpointsResponse as tr, AddDomainInput as tt, SendInput as u, UpdateAccountErrors as ui, GetAccountResponses as un, ListSentEmailsError as ur, CreateEndpointResponses as ut, addDomain as v, UpdateDomainResponse as vi, GetSendPermissionsErrors as vn, ReplayDeliveryResponse as vr, DeleteDomainData as vt, deleteFilter as w, UpdateEndpointResponse as wi, GetSentEmailResponse as wn, ReplayEmailWebhooksResponses as wr, DeleteEmailError as wt, deleteDomain as x, UpdateEndpointError as xi, GetSentEmailData as xn, ReplayEmailWebhooksError as xr, DeleteDomainResponse as xt, createEndpoint as y, UpdateDomainResponses as yi, GetSendPermissionsResponse as yn, ReplayDeliveryResponses as yr, DeleteDomainError as yt, replayDelivery as z, Client as zi, ListDeliveriesErrors as zn, SendEmailErrors as zr, DeliverySummary 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-ChLFXxTa.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-Cts9r1sL.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