@primitivedotdev/sdk 0.11.0 → 0.13.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, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, 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
  *
@@ -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 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 };
@@ -624,6 +624,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
624
624
  downloadRawEmail: () => downloadRawEmail,
625
625
  getAccount: () => getAccount,
626
626
  getEmail: () => getEmail,
627
+ getSendPermissions: () => getSendPermissions,
627
628
  getStorageStats: () => getStorageStats,
628
629
  getWebhookSecret: () => getWebhookSecret,
629
630
  listDeliveries: () => listDeliveries,
@@ -795,11 +796,15 @@ const verifyDomain = (options) => (options.client ?? client$1).post({
795
796
  ...options
796
797
  });
797
798
  /**
798
- * List emails
799
+ * List inbound emails
799
800
  *
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.
801
+ * Returns a paginated list of INBOUND emails received at your
802
+ * verified domains. Outbound messages sent via /send-mail are not
803
+ * included; this endpoint is the inbox view, not a unified
804
+ * send/receive history.
805
+ *
806
+ * Supports filtering by domain, status, date range, and free-text
807
+ * search across subject, sender, and recipient fields.
803
808
  *
804
809
  */
805
810
  const listEmails = (options) => (options?.client ?? client$1).get({
@@ -1099,6 +1104,49 @@ const replayDelivery = (options) => (options.client ?? client$1).post({
1099
1104
  ...options
1100
1105
  });
1101
1106
  /**
1107
+ * List send-permission rules
1108
+ *
1109
+ * Returns a flat list of rules describing every recipient the
1110
+ * caller may send to. Each rule has a `type`, a kind-specific
1111
+ * payload, and a human-readable `description`. If any rule
1112
+ * matches the recipient, /send-mail will accept the send under
1113
+ * the recipient-scope check.
1114
+ *
1115
+ * The endpoint is the answer to "where can I send" without
1116
+ * exposing internal entitlement names. Agents that don't
1117
+ * recognize a `type` can still read the `description` prose
1118
+ * and act on it.
1119
+ *
1120
+ * Rule kinds, ordered broadest-first so an agent can stop
1121
+ * scanning at the first match:
1122
+ *
1123
+ * 1. `any_recipient` (one entry, only when the org can send
1124
+ * anywhere): every other rule below it is redundant.
1125
+ * 2. `managed_zone` (always emitted, one per Primitive-managed
1126
+ * zone): sends to any address at *.primitive.email or
1127
+ * *.email.works always succeed; no entitlement required.
1128
+ * 3. `your_domain` (one per active verified outbound domain
1129
+ * owned by the org): sends to that domain are approved.
1130
+ * 4. `address` (one per address that has authenticated
1131
+ * inbound mail to the org, capped at `meta.address_cap`):
1132
+ * sends to that exact address are approved.
1133
+ *
1134
+ * The list is informational, not an authorization check.
1135
+ * /send-mail remains the source of truth on whether an
1136
+ * individual send will succeed (it also enforces the
1137
+ * from-address and the `send_mail` entitlement, which are
1138
+ * not recipient-scope concerns and are not represented here).
1139
+ *
1140
+ */
1141
+ const getSendPermissions = (options) => (options?.client ?? client$1).get({
1142
+ security: [{
1143
+ scheme: "bearer",
1144
+ type: "http"
1145
+ }],
1146
+ url: "/send-permissions",
1147
+ ...options
1148
+ });
1149
+ /**
1102
1150
  * Send outbound email
1103
1151
  *
1104
1152
  * Sends an outbound email through Primitive's outbound relay. By default
@@ -1364,4 +1412,4 @@ function client(options = {}) {
1364
1412
  }
1365
1413
  const operations = sdk_gen_exports;
1366
1414
  //#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 };
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 };
@@ -560,6 +560,18 @@ type EmailSummary = {
560
560
  domain_id?: string | null;
561
561
  org_id?: string | null;
562
562
  status: 'pending' | 'accepted' | 'completed' | 'rejected';
563
+ /**
564
+ * SMTP envelope sender (return-path) the inbound mail server
565
+ * accepted. For most legitimate mail this equals the bare
566
+ * address in the From header; for mailing lists, bounce
567
+ * handlers, and forwarders it is typically the bounce address
568
+ * rather than the human-visible sender.
569
+ *
570
+ * For the parsed From-header value (with display name handling
571
+ * and a sender-fallback when the header is unparseable), GET
572
+ * the email by id and use `from_email`.
573
+ *
574
+ */
563
575
  sender: string;
564
576
  recipient: string;
565
577
  subject?: string | null;
@@ -576,6 +588,20 @@ type EmailDetail = {
576
588
  message_id?: string | null;
577
589
  domain_id?: string | null;
578
590
  org_id?: string | null;
591
+ /**
592
+ * SMTP envelope sender (return-path) the inbound mail server
593
+ * accepted. Same value as `smtp_mail_from`; both fields exist
594
+ * so protocol-aware tooling can use whichever name it expects.
595
+ *
596
+ * For most legitimate mail this equals `from_email`; for
597
+ * mailing lists, bounce handlers, and forwarders it is
598
+ * typically the bounce-handling address rather than the
599
+ * human-visible sender.
600
+ *
601
+ * **For the canonical "who sent this email" value, use
602
+ * `from_email`.**
603
+ *
604
+ */
579
605
  sender: string;
580
606
  recipient: string;
581
607
  subject?: string | null;
@@ -602,13 +628,43 @@ type EmailDetail = {
602
628
  webhook_last_error?: string | null;
603
629
  webhook_fired_at?: string | null;
604
630
  smtp_helo?: string | null;
631
+ /**
632
+ * SMTP envelope MAIL FROM (return-path), as accepted by the
633
+ * inbound mail server. Same value as `sender`; both fields
634
+ * exist so protocol-aware tooling can use whichever name it
635
+ * expects.
636
+ *
637
+ * For the canonical "who sent this email" value (display name
638
+ * stripped, From-header preferred), use `from_email`.
639
+ *
640
+ */
605
641
  smtp_mail_from?: string | null;
606
642
  smtp_rcpt_to?: Array<string> | null;
643
+ /**
644
+ * Raw `From:` header from the message body, including any
645
+ * display name (e.g. `"Alice Example" <alice@example.com>`).
646
+ * Use this when you need the display name for rendering.
647
+ *
648
+ * For the bare email address (display name stripped), use
649
+ * `from_email`.
650
+ *
651
+ */
607
652
  from_header?: string | null;
608
653
  content_discarded_at?: string | null;
609
654
  content_discarded_by_delivery_id?: string | null;
610
655
  /**
611
- * Parsed from address (from_header or sender fallback)
656
+ * Bare email address parsed from the `From:` header, with
657
+ * display name stripped (e.g. `alice@example.com`). Falls
658
+ * back to `sender` (the SMTP envelope MAIL FROM) when the
659
+ * `From:` header cannot be parsed.
660
+ *
661
+ * **This is the canonical "who sent this email" field for
662
+ * most use cases**, including comparing against allowlists,
663
+ * routing replies, or displaying the sender to a user. Use
664
+ * `from_header` when you specifically need the display name,
665
+ * or `sender`/`smtp_mail_from` when you need the SMTP
666
+ * envelope value (e.g. to follow a bounce).
667
+ *
612
668
  */
613
669
  from_email: string;
614
670
  /**
@@ -779,6 +835,135 @@ type SendMailResult = {
779
835
  */
780
836
  idempotent_replay: boolean;
781
837
  };
838
+ /**
839
+ * One recipient-scope rule describing a destination the caller
840
+ * may send to. Discriminated on `type`. Each rule carries a
841
+ * human-prose `description` field intended for display.
842
+ *
843
+ * Rule kinds are stable within an SDK release. A response
844
+ * containing a `type` value not enumerated in this schema
845
+ * means the server is running a newer version than the SDK;
846
+ * upgrade the SDK to the release that matches the server's
847
+ * schema. Strict-parsing SDKs (Go, Python) will raise a
848
+ * decode error in that case rather than silently dropping
849
+ * the unknown rule, since silent drops would let an outbound
850
+ * agent reason from an incomplete view of its own permissions.
851
+ *
852
+ */
853
+ type SendPermissionRule = ({
854
+ type: 'any_recipient';
855
+ } & SendPermissionAnyRecipient) | ({
856
+ type: 'managed_zone';
857
+ } & SendPermissionManagedZone) | ({
858
+ type: 'your_domain';
859
+ } & SendPermissionYourDomain) | ({
860
+ type: 'address';
861
+ } & SendPermissionAddress);
862
+ /**
863
+ * The caller can send to any recipient. When this rule is
864
+ * present, every other rule in the response is redundant.
865
+ *
866
+ */
867
+ type SendPermissionAnyRecipient = {
868
+ type: 'any_recipient';
869
+ /**
870
+ * Human-prose summary of the rule.
871
+ */
872
+ description: string;
873
+ };
874
+ /**
875
+ * The caller can send to any address at the named
876
+ * Primitive-managed zone. Always emitted (no entitlement
877
+ * required) because Primitive owns the zone and every mailbox
878
+ * belongs to a Primitive customer by construction.
879
+ *
880
+ */
881
+ type SendPermissionManagedZone = {
882
+ type: 'managed_zone';
883
+ /**
884
+ * The managed apex domain. Sends are accepted to any
885
+ * address at the apex itself or any subdomain (e.g.
886
+ * `alice@primitive.email` and `alice@acme.primitive.email`
887
+ * both match the `primitive.email` zone rule).
888
+ *
889
+ */
890
+ zone: string;
891
+ /**
892
+ * Human-prose summary of the rule.
893
+ */
894
+ description: string;
895
+ };
896
+ /**
897
+ * The caller can send to any address at one of their own
898
+ * verified outbound domains. Emitted once per active row in
899
+ * the org's `domains` table.
900
+ *
901
+ */
902
+ type SendPermissionYourDomain = {
903
+ type: 'your_domain';
904
+ /**
905
+ * A verified outbound domain owned by the caller's org.
906
+ */
907
+ domain: string;
908
+ /**
909
+ * Human-prose summary of the rule.
910
+ */
911
+ description: string;
912
+ };
913
+ /**
914
+ * The caller can send to a specific address that has
915
+ * authenticated inbound mail to the org. Emitted once per row
916
+ * in the org's `known_send_addresses` table, capped at
917
+ * `meta.address_cap`.
918
+ *
919
+ */
920
+ type SendPermissionAddress = {
921
+ type: 'address';
922
+ /**
923
+ * The bare email address this rule grants sends to.
924
+ */
925
+ address: string;
926
+ /**
927
+ * Most recent inbound email from this address that
928
+ * authenticated successfully (DMARC pass + DKIM/SPF
929
+ * alignment). Updated on each new authenticated receipt.
930
+ *
931
+ */
932
+ last_received_at: string;
933
+ /**
934
+ * Total number of authenticated inbound emails from this
935
+ * address. Increments only when `last_received_at` advances.
936
+ *
937
+ */
938
+ received_count: number;
939
+ /**
940
+ * Human-prose summary of the rule.
941
+ */
942
+ description: string;
943
+ };
944
+ /**
945
+ * Response metadata for /send-permissions. The `address_cap`
946
+ * bounds the size of the `address` rule subset; orgs with more
947
+ * than `address_cap` known addresses almost always also hold a
948
+ * broader rule type (`any_recipient` or `your_domain`), so the
949
+ * cap is a response-size bound rather than a meaningful
950
+ * product limit.
951
+ *
952
+ */
953
+ type SendPermissionsMeta = {
954
+ /**
955
+ * Maximum number of `address` rules included in `data`.
956
+ */
957
+ address_cap: number;
958
+ /**
959
+ * True when the org has more than `address_cap` known
960
+ * addresses and the list was truncated. False when every
961
+ * known address is represented or when the org holds no
962
+ * address rules at all.
963
+ *
964
+ */
965
+ truncated: boolean;
966
+ };
782
967
  type Endpoint = {
783
968
  id: string;
784
969
  org_id: string;
@@ -1926,6 +2111,29 @@ type ReplayDeliveryResponses = {
1926
2111
  };
1927
2112
  };
1928
2113
  type ReplayDeliveryResponse = ReplayDeliveryResponses[keyof ReplayDeliveryResponses];
2114
+ type GetSendPermissionsData = {
2115
+ body?: never;
2116
+ path?: never;
2117
+ query?: never;
2118
+ url: '/send-permissions';
2119
+ };
2120
+ type GetSendPermissionsErrors = {
2121
+ /**
2122
+ * Invalid or missing API key
2123
+ */
2124
+ 401: ErrorResponse;
2125
+ };
2126
+ type GetSendPermissionsError = GetSendPermissionsErrors[keyof GetSendPermissionsErrors];
2127
+ type GetSendPermissionsResponses = {
2128
+ /**
2129
+ * Send-permission rules for the caller's org
2130
+ */
2131
+ 200: SuccessEnvelope & {
2132
+ data: Array<SendPermissionRule>;
2133
+ meta: SendPermissionsMeta;
2134
+ };
2135
+ };
2136
+ type GetSendPermissionsResponse = GetSendPermissionsResponses[keyof GetSendPermissionsResponses];
1929
2137
  type SendEmailData = {
1930
2138
  body: SendMailInput;
1931
2139
  headers?: {
@@ -1982,7 +2190,7 @@ type SendEmailResponses = {
1982
2190
  };
1983
2191
  type SendEmailResponse = SendEmailResponses[keyof SendEmailResponses];
1984
2192
  declare namespace sdk_gen_d_exports {
1985
- export { Options, 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 };
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 };
1986
2194
  }
1987
2195
  type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
1988
2196
  /**
@@ -2067,11 +2275,15 @@ declare const updateDomain: <ThrowOnError extends boolean = false>(options: Opti
2067
2275
  */
2068
2276
  declare const verifyDomain: <ThrowOnError extends boolean = false>(options: Options<VerifyDomainData, ThrowOnError>) => RequestResult<VerifyDomainResponses, VerifyDomainErrors, ThrowOnError, "fields">;
2069
2277
  /**
2070
- * List emails
2278
+ * List inbound emails
2279
+ *
2280
+ * Returns a paginated list of INBOUND emails received at your
2281
+ * verified domains. Outbound messages sent via /send-mail are not
2282
+ * included; this endpoint is the inbox view, not a unified
2283
+ * send/receive history.
2071
2284
  *
2072
- * Returns a paginated list of received emails. Supports filtering by
2073
- * domain, status, date range, and free-text search across subject,
2074
- * sender, and recipient fields.
2285
+ * Supports filtering by domain, status, date range, and free-text
2286
+ * search across subject, sender, and recipient fields.
2075
2287
  *
2076
2288
  */
2077
2289
  declare const listEmails: <ThrowOnError extends boolean = false>(options?: Options<ListEmailsData, ThrowOnError>) => RequestResult<ListEmailsResponses, ListEmailsErrors, ThrowOnError, "fields">;
@@ -2216,6 +2428,42 @@ declare const listDeliveries: <ThrowOnError extends boolean = false>(options?: O
2216
2428
  *
2217
2429
  */
2218
2430
  declare const replayDelivery: <ThrowOnError extends boolean = false>(options: Options<ReplayDeliveryData, ThrowOnError>) => RequestResult<ReplayDeliveryResponses, ReplayDeliveryErrors, ThrowOnError, "fields">;
2431
+ /**
2432
+ * List send-permission rules
2433
+ *
2434
+ * Returns a flat list of rules describing every recipient the
2435
+ * caller may send to. Each rule has a `type`, a kind-specific
2436
+ * payload, and a human-readable `description`. If any rule
2437
+ * matches the recipient, /send-mail will accept the send under
2438
+ * the recipient-scope check.
2439
+ *
2440
+ * The endpoint is the answer to "where can I send" without
2441
+ * exposing internal entitlement names. Agents that don't
2442
+ * recognize a `type` can still read the `description` prose
2443
+ * and act on it.
2444
+ *
2445
+ * Rule kinds, ordered broadest-first so an agent can stop
2446
+ * scanning at the first match:
2447
+ *
2448
+ * 1. `any_recipient` (one entry, only when the org can send
2449
+ * anywhere): every other rule below it is redundant.
2450
+ * 2. `managed_zone` (always emitted, one per Primitive-managed
2451
+ * zone): sends to any address at *.primitive.email or
2452
+ * *.email.works always succeed; no entitlement required.
2453
+ * 3. `your_domain` (one per active verified outbound domain
2454
+ * owned by the org): sends to that domain are approved.
2455
+ * 4. `address` (one per address that has authenticated
2456
+ * inbound mail to the org, capped at `meta.address_cap`):
2457
+ * sends to that exact address are approved.
2458
+ *
2459
+ * The list is informational, not an authorization check.
2460
+ * /send-mail remains the source of truth on whether an
2461
+ * individual send will succeed (it also enforces the
2462
+ * from-address and the `send_mail` entitlement, which are
2463
+ * not recipient-scope concerns and are not represented here).
2464
+ *
2465
+ */
2466
+ declare const getSendPermissions: <ThrowOnError extends boolean = false>(options?: Options<GetSendPermissionsData, ThrowOnError>) => RequestResult<GetSendPermissionsResponses, GetSendPermissionsErrors, ThrowOnError, "fields">;
2219
2467
  /**
2220
2468
  * Send outbound email
2221
2469
  *
@@ -2352,4 +2600,4 @@ declare function createPrimitiveClient(options?: PrimitiveClientOptions): Primit
2352
2600
  declare function client(options?: PrimitiveClientOptions): PrimitiveClient;
2353
2601
  declare const operations: typeof sdk_gen_d_exports;
2354
2602
  //#endregion
2355
- export { AddDomainResponse as $, ReplayDeliveryErrors as $n, UpdateEndpointResponses as $r, ErrorResponse as $t, getWebhookSecret as A, ListDomainsError as An, TestEndpointError as Ar, DeleteFilterData as At, sendEmail as B, ListEndpointsError as Bn, UpdateAccountResponse as Br, DownloadAttachmentsError as Bt, deleteEndpoint as C, Limit as Cn, SendEmailResponses as Cr, DeleteEmailResponse as Ct, getAccount as D, ListDeliveriesResponse as Dn, StorageStats as Dr, DeleteEndpointErrors as Dt, downloadRawEmail as E, ListDeliveriesErrors as En, SentEmailStatus as Er, DeleteEndpointError as Et, listFilters as F, ListEmailsError as Fn, UnverifiedDomain as Fr, DeliveryStatus as Ft, updateFilter as G, ListFiltersData as Gn, UpdateDomainInput as Gr, DownloadRawEmailError as Gt, updateAccount as H, ListEndpointsResponse as Hn, UpdateDomainData as Hr, DownloadAttachmentsResponse as Ht, replayDelivery as I, ListEmailsErrors as In, UpdateAccountData as Ir, DeliverySummary as It, AccountUpdated as J, ListFiltersResponse as Jn, UpdateEndpointData as Jr, DownloadRawEmailResponses as Jt, verifyDomain as K, ListFiltersError as Kn, UpdateDomainResponse as Kr, DownloadRawEmailErrors as Kt, replayEmailWebhooks as L, ListEmailsResponse as Ln, UpdateAccountError as Lr, Domain as Lt, listDomains as M, ListDomainsResponse as Mn, TestEndpointResponse as Mr, DeleteFilterErrors as Mt, listEmails as N, ListDomainsResponses as Nn, TestEndpointResponses as Nr, DeleteFilterResponse as Nt, getEmail as O, ListDeliveriesResponses as On, SuccessEnvelope as Or, DeleteEndpointResponse as Ot, listEndpoints as P, ListEmailsData as Pn, TestResult as Pr, DeleteFilterResponses as Pt, AddDomainInput as Q, ReplayDeliveryError as Qn, UpdateEndpointResponse as Qr, Endpoint as Qt, replyToEmail as R, ListEmailsResponses as Rn, UpdateAccountErrors as Rr, DomainVerifyResult as Rt, deleteEmail as S, GetWebhookSecretResponses as Sn, SendEmailResponse as Sr, DeleteEmailErrors as St, downloadAttachments as T, ListDeliveriesError as Tn, SendMailResult as Tr, DeleteEndpointData as Tt, updateDomain as U, ListEndpointsResponses as Un, UpdateDomainError as Ur, DownloadAttachmentsResponses as Ut, testEndpoint as V, ListEndpointsErrors as Vn, UpdateAccountResponses as Vr, DownloadAttachmentsErrors as Vt, updateEndpoint as W, ListEnvelope as Wn, UpdateDomainErrors as Wr, DownloadRawEmailData as Wt, AddDomainError as X, PaginationMeta as Xn, UpdateEndpointErrors as Xr, EmailDetailReply as Xt, AddDomainData as Y, ListFiltersResponses as Yn, UpdateEndpointError as Yr, EmailDetail as Yt, AddDomainErrors as Z, ReplayDeliveryData as Zn, UpdateEndpointInput as Zr, EmailSummary as Zt, Options as _, Options$1 as _i, GetStorageStatsResponses as _n, RotateWebhookSecretResponse as _r, DeleteDomainErrors as _t, PrimitiveApiError as a, UpdateFilterResponses as ai, GetAccountErrors as an, ReplayEmailWebhooksResponse as ar, CreateEndpointInput as at, createFilter as b, ResponseStyle as bi, GetWebhookSecretErrors as bn, SendEmailError as br, DeleteEmailData as bt, PrimitiveClientOptions as c, VerifyDomainError as ci, GetEmailData as cn, ReplyToEmailData as cr, CreateFilterData as ct, SendResult as d, VerifyDomainResponses as di, GetEmailResponse as dn, ReplyToEmailResponse as dr, CreateFilterInput as dt, UpdateFilterData as ei, Filter as en, ReplayDeliveryResponse as er, AddDomainResponses as et, SendThreadInput as f, WebhookSecret as fi, GetEmailResponses as fn, ReplyToEmailResponses as fr, CreateFilterResponse as ft, operations as g, CreateClientConfig as gi, GetStorageStatsResponse as gn, RotateWebhookSecretErrors as gr, DeleteDomainError as gt, createPrimitiveClient as h, Config as hi, GetStorageStatsErrors as hn, RotateWebhookSecretError as hr, DeleteDomainData as ht, PrimitiveApiClientOptions as i, UpdateFilterResponse as ii, GetAccountError as in, ReplayEmailWebhooksErrors as ir, CreateEndpointErrors as it, listDeliveries as j, ListDomainsErrors as jn, TestEndpointErrors as jr, DeleteFilterError as jt, getStorageStats as k, ListDomainsData as kn, TestEndpointData as kr, DeleteEndpointResponses as kt, ReplyInput as l, VerifyDomainErrors as li, GetEmailError as ln, ReplyToEmailError as lr, CreateFilterError as lt, createPrimitiveApiClient as m, ClientOptions$1 as mi, GetStorageStatsError as mn, RotateWebhookSecretData as mr, Cursor as mt, ForwardInput as n, UpdateFilterErrors as ni, GateFix as nn, ReplayEmailWebhooksData as nr, CreateEndpointData as nt, PrimitiveApiErrorDetails as o, VerifiedDomain as oi, GetAccountResponse as on, ReplayEmailWebhooksResponses as or, CreateEndpointResponse as ot, client as p, Client as pi, GetStorageStatsData as pn, ResourceId as pr, CreateFilterResponses as pt, Account as q, ListFiltersErrors as qn, UpdateDomainResponses as qr, DownloadRawEmailResponse as qt, PrimitiveApiClient as r, UpdateFilterInput as ri, GetAccountData as rn, ReplayEmailWebhooksError as rr, CreateEndpointError as rt, PrimitiveClient as s, VerifyDomainData as si, GetAccountResponses as sn, ReplayResult as sr, CreateEndpointResponses as st, DEFAULT_BASE_URL as t, UpdateFilterError as ti, GateDenial as tn, ReplayDeliveryResponses as tr, ClientOptions as tt, SendInput as u, VerifyDomainResponse as ui, GetEmailErrors as un, ReplyToEmailErrors as ur, CreateFilterErrors as ut, addDomain as v, RequestOptions as vi, GetWebhookSecretData as vn, RotateWebhookSecretResponses as vr, DeleteDomainResponse as vt, deleteFilter as w, ListDeliveriesData as wn, SendMailInput as wr, DeleteEmailResponses as wt, deleteDomain as x, Auth as xi, GetWebhookSecretResponse as xn, SendEmailErrors as xr, DeleteEmailError as xt, createEndpoint as y, RequestResult as yi, GetWebhookSecretError as yn, SendEmailData as yr, DeleteDomainResponses as yt, rotateWebhookSecret as z, ListEndpointsData as zn, UpdateAccountInput as zr, DownloadAttachmentsData as zt };
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 };
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-K4KbjppU.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";
4
4
  import { A as VerifyOptions, B as PAYLOAD_ERRORS, C as signStandardWebhooksPayload, D as PRIMITIVE_CONFIRMED_HEADER, E as LEGACY_SIGNATURE_HEADER, F as VerifyDownloadTokenResult, G as VERIFICATION_ERRORS, H as RAW_EMAIL_ERRORS, I as generateDownloadToken, J as WebhookPayloadErrorCode, K as WebhookErrorCode, L as verifyDownloadToken, M as verifyWebhookSignature, N as GenerateDownloadTokenOptions, O as PRIMITIVE_SIGNATURE_HEADER, P as VerifyDownloadTokenOptions, Q as WebhookVerificationErrorCode, R as safeValidateEmailReceivedEvent, S as StandardWebhooksVerifyOptions, T as LEGACY_CONFIRMED_HEADER, U as RawEmailDecodeError, V as PrimitiveWebhookError, W as RawEmailDecodeErrorCode, X as WebhookValidationErrorCode, Y as WebhookValidationError, Z as WebhookVerificationError, _ as emailReceivedEventJsonSchema, a as confirmedHeaders, b as STANDARD_WEBHOOK_TIMESTAMP_HEADER, c as handleWebhook, d as isRawIncluded, f as parseWebhookEvent, g as validateEmailAuth, h as WEBHOOK_VERSION, i as WebhookHeaders, j as signWebhookPayload, k as SignResult, l as isDownloadExpired, m as verifyRawEmailDownload, n as HandleWebhookOptions, o as decodeRawEmail, p as receive, q as WebhookPayloadError, r as ReceiveRequestOptions, s as getDownloadTimeRemaining, t as DecodeRawEmailOptions, u as isEmailReceivedEvent, v as STANDARD_WEBHOOK_ID_HEADER, w as verifyStandardWebhooksSignature, x as StandardWebhooksSignResult, y as STANDARD_WEBHOOK_SIGNATURE_HEADER, z as validateEmailReceivedEvent } from "./index-CbEivn3S.js";
5
5
 
6
6
  //#region src/index.d.ts
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as parseHeaderAddress, i as normalizeReceivedEmail, n as buildReplySubject, r as formatAddress, t as buildForwardSubject } from "./received-email-D6tKtWwW.js";
2
- import { a as client, i as PrimitiveClient, r as PrimitiveApiError, s as createPrimitiveClient } from "./api-CLLpjjWy.js";
2
+ import { a as client, i as PrimitiveClient, r as PrimitiveApiError, s as createPrimitiveClient } from "./api-DvJpdOJ8.js";
3
3
  import { A as PRIMITIVE_CONFIRMED_HEADER, B as RAW_EMAIL_ERRORS, C as STANDARD_WEBHOOK_ID_HEADER, D as verifyStandardWebhooksSignature, E as signStandardWebhooksPayload, F as verifyDownloadToken, G as WebhookVerificationError, H as VERIFICATION_ERRORS, I as safeValidateEmailReceivedEvent, L as validateEmailReceivedEvent, M as signWebhookPayload, N as verifyWebhookSignature, O as LEGACY_CONFIRMED_HEADER, P as generateDownloadToken, R as PAYLOAD_ERRORS, S as emailReceivedEventJsonSchema, T as STANDARD_WEBHOOK_TIMESTAMP_HEADER, U as WebhookPayloadError, V as RawEmailDecodeError, W as WebhookValidationError, _ as DmarcResult, a as isDownloadExpired, b as ParsedStatus, c as parseWebhookEvent, d as WEBHOOK_VERSION, f as validateEmailAuth, g as DmarcPolicy, h as DkimResult, i as handleWebhook, j as PRIMITIVE_SIGNATURE_HEADER, k as LEGACY_SIGNATURE_HEADER, l as receive, m as AuthVerdict, n as decodeRawEmail, o as isEmailReceivedEvent, p as AuthConfidence, r as getDownloadTimeRemaining, s as isRawIncluded, t as confirmedHeaders, u as verifyRawEmailDownload, v as EventType, w as STANDARD_WEBHOOK_SIGNATURE_HEADER, x as SpfResult, y as ForwardVerdict, z as PrimitiveWebhookError } from "./webhook-zkN4wUTs.js";
4
4
  //#region src/index.ts
5
5
  const primitive = {