@primitivedotdev/sdk 0.12.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, 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';
@@ -122,11 +122,15 @@ export const verifyDomain = (options) => (options.client ?? client).post({
122
122
  ...options
123
123
  });
124
124
  /**
125
- * List emails
125
+ * List inbound emails
126
126
  *
127
- * Returns a paginated list of received emails. Supports filtering by
128
- * domain, status, date range, and free-text search across subject,
129
- * sender, and recipient fields.
127
+ * Returns a paginated list of INBOUND emails received at your
128
+ * verified domains. Outbound messages sent via /send-mail are not
129
+ * included; this endpoint is the inbox view, not a unified
130
+ * send/receive history.
131
+ *
132
+ * Supports filtering by domain, status, date range, and free-text
133
+ * search across subject, sender, and recipient fields.
130
134
  *
131
135
  */
132
136
  export const listEmails = (options) => (options?.client ?? client).get({
@@ -371,6 +375,46 @@ export const replayDelivery = (options) => (options.client ?? client).post({
371
375
  url: '/webhooks/deliveries/{id}/replay',
372
376
  ...options
373
377
  });
378
+ /**
379
+ * List send-permission rules
380
+ *
381
+ * Returns a flat list of rules describing every recipient the
382
+ * caller may send to. Each rule has a `type`, a kind-specific
383
+ * payload, and a human-readable `description`. If any rule
384
+ * matches the recipient, /send-mail will accept the send under
385
+ * the recipient-scope check.
386
+ *
387
+ * The endpoint is the answer to "where can I send" without
388
+ * exposing internal entitlement names. Agents that don't
389
+ * recognize a `type` can still read the `description` prose
390
+ * and act on it.
391
+ *
392
+ * Rule kinds, ordered broadest-first so an agent can stop
393
+ * scanning at the first match:
394
+ *
395
+ * 1. `any_recipient` (one entry, only when the org can send
396
+ * anywhere): every other rule below it is redundant.
397
+ * 2. `managed_zone` (always emitted, one per Primitive-managed
398
+ * zone): sends to any address at *.primitive.email or
399
+ * *.email.works always succeed; no entitlement required.
400
+ * 3. `your_domain` (one per active verified outbound domain
401
+ * owned by the org): sends to that domain are approved.
402
+ * 4. `address` (one per address that has authenticated
403
+ * inbound mail to the org, capped at `meta.address_cap`):
404
+ * sends to that exact address are approved.
405
+ *
406
+ * The list is informational, not an authorization check.
407
+ * /send-mail remains the source of truth on whether an
408
+ * individual send will succeed (it also enforces the
409
+ * from-address and the `send_mail` entitlement, which are
410
+ * not recipient-scope concerns and are not represented here).
411
+ *
412
+ */
413
+ export const getSendPermissions = (options) => (options?.client ?? client).get({
414
+ security: [{ scheme: 'bearer', type: 'http' }],
415
+ url: '/send-permissions',
416
+ ...options
417
+ });
374
418
  /**
375
419
  * Send outbound email
376
420
  *
@@ -388,3 +432,46 @@ export const sendEmail = (options) => (options.client ?? client).post({
388
432
  ...options.headers
389
433
  }
390
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 AddDomainResponse, $n as ReplayDeliveryErrors, $r as UpdateEndpointResponses, $t as ErrorResponse, A as getWebhookSecret, An as ListDomainsError, Ar as TestEndpointError, At as DeleteFilterData, B as sendEmail, Bn as ListEndpointsError, Br as UpdateAccountResponse, Bt as DownloadAttachmentsError, C as deleteEndpoint, Cn as Limit, Cr as SendEmailResponses, Ct as DeleteEmailResponse, D as getAccount, Dn as ListDeliveriesResponse, Dr as StorageStats, Dt as DeleteEndpointErrors, E as downloadRawEmail, En as ListDeliveriesErrors, Er as SentEmailStatus, Et as DeleteEndpointError, F as listFilters, Fn as ListEmailsError, Fr as UnverifiedDomain, Ft as DeliveryStatus, G as updateFilter, Gn as ListFiltersData, Gr as UpdateDomainInput, Gt as DownloadRawEmailError, H as updateAccount, Hn as ListEndpointsResponse, Hr as UpdateDomainData, Ht as DownloadAttachmentsResponse, I as replayDelivery, In as ListEmailsErrors, Ir as UpdateAccountData, It as DeliverySummary, J as AccountUpdated, Jn as ListFiltersResponse, Jr as UpdateEndpointData, Jt as DownloadRawEmailResponses, K as verifyDomain, Kn as ListFiltersError, Kr as UpdateDomainResponse, Kt as DownloadRawEmailErrors, L as replayEmailWebhooks, Ln as ListEmailsResponse, Lr as UpdateAccountError, Lt as Domain, M as listDomains, Mn as ListDomainsResponse, Mr as TestEndpointResponse, Mt as DeleteFilterErrors, N as listEmails, Nn as ListDomainsResponses, Nr as TestEndpointResponses, Nt as DeleteFilterResponse, O as getEmail, On as ListDeliveriesResponses, Or as SuccessEnvelope, Ot as DeleteEndpointResponse, P as listEndpoints, Pn as ListEmailsData, Pr as TestResult, Pt as DeleteFilterResponses, Q as AddDomainInput, Qn as ReplayDeliveryError, Qr as UpdateEndpointResponse, Qt as Endpoint, R as replyToEmail, Rn as ListEmailsResponses, Rr as UpdateAccountErrors, Rt as DomainVerifyResult, S as deleteEmail, Sn as GetWebhookSecretResponses, Sr as SendEmailResponse, St as DeleteEmailErrors, T as downloadAttachments, Tn as ListDeliveriesError, Tr as SendMailResult, Tt as DeleteEndpointData, U as updateDomain, Un as ListEndpointsResponses, Ur as UpdateDomainError, Ut as DownloadAttachmentsResponses, V as testEndpoint, Vn as ListEndpointsErrors, Vr as UpdateAccountResponses, Vt as DownloadAttachmentsErrors, W as updateEndpoint, Wn as ListEnvelope, Wr as UpdateDomainErrors, Wt as DownloadRawEmailData, X as AddDomainError, Xn as PaginationMeta, Xr as UpdateEndpointErrors, Xt as EmailDetailReply, Y as AddDomainData, Yn as ListFiltersResponses, Yr as UpdateEndpointError, Yt as EmailDetail, Z as AddDomainErrors, Zn as ReplayDeliveryData, Zr as UpdateEndpointInput, Zt as EmailSummary, _ as Options, _i as Options$1, _n as GetStorageStatsResponses, _r as RotateWebhookSecretResponse, _t as DeleteDomainErrors, a as PrimitiveApiError, ai as UpdateFilterResponses, an as GetAccountErrors, ar as ReplayEmailWebhooksResponse, at as CreateEndpointInput, b as createFilter, bi as ResponseStyle, bn as GetWebhookSecretErrors, br as SendEmailError, bt as DeleteEmailData, c as PrimitiveClientOptions, ci as VerifyDomainError, cn as GetEmailData, cr as ReplyToEmailData, ct as CreateFilterData, d as SendResult, di as VerifyDomainResponses, dn as GetEmailResponse, dr as ReplyToEmailResponse, dt as CreateFilterInput, ei as UpdateFilterData, en as Filter, er as ReplayDeliveryResponse, et as AddDomainResponses, f as SendThreadInput, fi as WebhookSecret, fn as GetEmailResponses, fr as ReplyToEmailResponses, ft as CreateFilterResponse, g as operations, gi as CreateClientConfig, gn as GetStorageStatsResponse, gr as RotateWebhookSecretErrors, gt as DeleteDomainError, h as createPrimitiveClient, hi as Config, hn as GetStorageStatsErrors, hr as RotateWebhookSecretError, ht as DeleteDomainData, i as PrimitiveApiClientOptions, ii as UpdateFilterResponse, in as GetAccountError, ir as ReplayEmailWebhooksErrors, it as CreateEndpointErrors, j as listDeliveries, jn as ListDomainsErrors, jr as TestEndpointErrors, jt as DeleteFilterError, k as getStorageStats, kn as ListDomainsData, kr as TestEndpointData, kt as DeleteEndpointResponses, l as ReplyInput, li as VerifyDomainErrors, ln as GetEmailError, lr as ReplyToEmailError, lt as CreateFilterError, m as createPrimitiveApiClient, mi as ClientOptions$1, mn as GetStorageStatsError, mr as RotateWebhookSecretData, mt as Cursor, n as ForwardInput, ni as UpdateFilterErrors, nn as GateFix, nr as ReplayEmailWebhooksData, nt as CreateEndpointData, o as PrimitiveApiErrorDetails, oi as VerifiedDomain, on as GetAccountResponse, or as ReplayEmailWebhooksResponses, ot as CreateEndpointResponse, p as client, pi as Client, pn as GetStorageStatsData, pr as ResourceId, pt as CreateFilterResponses, q as Account, qn as ListFiltersErrors, qr as UpdateDomainResponses, qt as DownloadRawEmailResponse, r as PrimitiveApiClient, ri as UpdateFilterInput, rn as GetAccountData, rr as ReplayEmailWebhooksError, rt as CreateEndpointError, s as PrimitiveClient, si as VerifyDomainData, sn as GetAccountResponses, sr as ReplayResult, st as CreateEndpointResponses, t as DEFAULT_BASE_URL, ti as UpdateFilterError, tn as GateDenial, tr as ReplayDeliveryResponses, tt as ClientOptions, u as SendInput, ui as VerifyDomainResponse, un as GetEmailErrors, ur as ReplyToEmailErrors, ut as CreateFilterErrors, v as addDomain, vi as RequestOptions, vn as GetWebhookSecretData, vr as RotateWebhookSecretResponses, vt as DeleteDomainResponse, w as deleteFilter, wn as ListDeliveriesData, wr as SendMailInput, wt as DeleteEmailResponses, x as deleteDomain, xi as Auth, xn as GetWebhookSecretResponse, xr as SendEmailErrors, xt as DeleteEmailError, y as createEndpoint, yi as RequestResult, yn as GetWebhookSecretError, yr as SendEmailData, yt as DeleteDomainResponses, z as rotateWebhookSecret, zn as ListEndpointsData, zr as UpdateAccountInput, zt as DownloadAttachmentsData } from "../index-K4KbjppU.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, 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, 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, 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 };
@@ -624,6 +624,8 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
624
624
  downloadRawEmail: () => downloadRawEmail,
625
625
  getAccount: () => getAccount,
626
626
  getEmail: () => getEmail,
627
+ getSendPermissions: () => getSendPermissions,
628
+ getSentEmail: () => getSentEmail,
627
629
  getStorageStats: () => getStorageStats,
628
630
  getWebhookSecret: () => getWebhookSecret,
629
631
  listDeliveries: () => listDeliveries,
@@ -631,6 +633,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
631
633
  listEmails: () => listEmails,
632
634
  listEndpoints: () => listEndpoints,
633
635
  listFilters: () => listFilters,
636
+ listSentEmails: () => listSentEmails,
634
637
  replayDelivery: () => replayDelivery,
635
638
  replayEmailWebhooks: () => replayEmailWebhooks,
636
639
  replyToEmail: () => replyToEmail,
@@ -795,11 +798,15 @@ const verifyDomain = (options) => (options.client ?? client$1).post({
795
798
  ...options
796
799
  });
797
800
  /**
798
- * List emails
801
+ * List inbound emails
799
802
  *
800
- * Returns a paginated list of received emails. Supports filtering by
801
- * domain, status, date range, and free-text search across subject,
802
- * sender, and recipient fields.
803
+ * Returns a paginated list of INBOUND emails received at your
804
+ * verified domains. Outbound messages sent via /send-mail are not
805
+ * included; this endpoint is the inbox view, not a unified
806
+ * send/receive history.
807
+ *
808
+ * Supports filtering by domain, status, date range, and free-text
809
+ * search across subject, sender, and recipient fields.
803
810
  *
804
811
  */
805
812
  const listEmails = (options) => (options?.client ?? client$1).get({
@@ -1099,6 +1106,49 @@ const replayDelivery = (options) => (options.client ?? client$1).post({
1099
1106
  ...options
1100
1107
  });
1101
1108
  /**
1109
+ * List send-permission rules
1110
+ *
1111
+ * Returns a flat list of rules describing every recipient the
1112
+ * caller may send to. Each rule has a `type`, a kind-specific
1113
+ * payload, and a human-readable `description`. If any rule
1114
+ * matches the recipient, /send-mail will accept the send under
1115
+ * the recipient-scope check.
1116
+ *
1117
+ * The endpoint is the answer to "where can I send" without
1118
+ * exposing internal entitlement names. Agents that don't
1119
+ * recognize a `type` can still read the `description` prose
1120
+ * and act on it.
1121
+ *
1122
+ * Rule kinds, ordered broadest-first so an agent can stop
1123
+ * scanning at the first match:
1124
+ *
1125
+ * 1. `any_recipient` (one entry, only when the org can send
1126
+ * anywhere): every other rule below it is redundant.
1127
+ * 2. `managed_zone` (always emitted, one per Primitive-managed
1128
+ * zone): sends to any address at *.primitive.email or
1129
+ * *.email.works always succeed; no entitlement required.
1130
+ * 3. `your_domain` (one per active verified outbound domain
1131
+ * owned by the org): sends to that domain are approved.
1132
+ * 4. `address` (one per address that has authenticated
1133
+ * inbound mail to the org, capped at `meta.address_cap`):
1134
+ * sends to that exact address are approved.
1135
+ *
1136
+ * The list is informational, not an authorization check.
1137
+ * /send-mail remains the source of truth on whether an
1138
+ * individual send will succeed (it also enforces the
1139
+ * from-address and the `send_mail` entitlement, which are
1140
+ * not recipient-scope concerns and are not represented here).
1141
+ *
1142
+ */
1143
+ const getSendPermissions = (options) => (options?.client ?? client$1).get({
1144
+ security: [{
1145
+ scheme: "bearer",
1146
+ type: "http"
1147
+ }],
1148
+ url: "/send-permissions",
1149
+ ...options
1150
+ });
1151
+ /**
1102
1152
  * Send outbound email
1103
1153
  *
1104
1154
  * Sends an outbound email through Primitive's outbound relay. By default
@@ -1118,6 +1168,55 @@ const sendEmail = (options) => (options.client ?? client$1).post({
1118
1168
  ...options.headers
1119
1169
  }
1120
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
+ });
1121
1220
  //#endregion
1122
1221
  //#region src/api/index.ts
1123
1222
  const DEFAULT_BASE_URL = "https://www.primitive.dev/api/v1";
@@ -1364,4 +1463,4 @@ function client(options = {}) {
1364
1463
  }
1365
1464
  const operations = sdk_gen_exports;
1366
1465
  //#endregion
1367
- export { rotateWebhookSecret as A, listDomains as C, replayDelivery as D, listFilters as E, updateEndpoint as F, updateFilter as I, verifyDomain as L, testEndpoint as M, updateAccount as N, replayEmailWebhooks as O, updateDomain as P, listDeliveries as S, listEndpoints as T, downloadRawEmail as _, client as a, getStorageStats as b, operations as c, createFilter as d, deleteDomain as f, downloadAttachments as g, deleteFilter as h, PrimitiveClient as i, sendEmail as j, replyToEmail 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, listEmails as w, getWebhookSecret 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 };