@primitivedotdev/sdk 0.17.0 → 0.19.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.
@@ -614,6 +614,7 @@ const client$1 = createClient(createConfig({ baseUrl: "https://www.primitive.dev
614
614
  //#region src/api/generated/sdk.gen.ts
615
615
  var sdk_gen_exports = /* @__PURE__ */ __exportAll({
616
616
  addDomain: () => addDomain,
617
+ cliLogout: () => cliLogout,
617
618
  createEndpoint: () => createEndpoint,
618
619
  createFilter: () => createFilter,
619
620
  deleteDomain: () => deleteDomain,
@@ -635,11 +636,13 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
635
636
  listEndpoints: () => listEndpoints,
636
637
  listFilters: () => listFilters,
637
638
  listSentEmails: () => listSentEmails,
639
+ pollCliLogin: () => pollCliLogin,
638
640
  replayDelivery: () => replayDelivery,
639
641
  replayEmailWebhooks: () => replayEmailWebhooks,
640
642
  replyToEmail: () => replyToEmail,
641
643
  rotateWebhookSecret: () => rotateWebhookSecret,
642
644
  sendEmail: () => sendEmail,
645
+ startCliLogin: () => startCliLogin,
643
646
  testEndpoint: () => testEndpoint,
644
647
  updateAccount: () => updateAccount,
645
648
  updateDomain: () => updateDomain,
@@ -648,6 +651,57 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
648
651
  verifyDomain: () => verifyDomain
649
652
  });
650
653
  /**
654
+ * Start CLI browser login
655
+ *
656
+ * Starts a browser-assisted CLI login session. The response includes a
657
+ * device code for polling and a user code that the user approves in the
658
+ * browser. This endpoint does not require an API key.
659
+ *
660
+ */
661
+ const startCliLogin = (options) => (options?.client ?? client$1).post({
662
+ url: "/cli/login/start",
663
+ ...options,
664
+ headers: {
665
+ "Content-Type": "application/json",
666
+ ...options?.headers
667
+ }
668
+ });
669
+ /**
670
+ * Poll CLI browser login
671
+ *
672
+ * Polls a CLI login session until the browser approval either succeeds,
673
+ * is denied, expires, or is polled too quickly. The API key is generated
674
+ * only after approval and is returned exactly once.
675
+ *
676
+ */
677
+ const pollCliLogin = (options) => (options.client ?? client$1).post({
678
+ url: "/cli/login/poll",
679
+ ...options,
680
+ headers: {
681
+ "Content-Type": "application/json",
682
+ ...options.headers
683
+ }
684
+ });
685
+ /**
686
+ * Revoke the current CLI API key
687
+ *
688
+ * Revokes the API key used to authenticate the request. CLI clients use
689
+ * this endpoint during `primitive logout` before removing local credentials.
690
+ *
691
+ */
692
+ const cliLogout = (options) => (options?.client ?? client$1).post({
693
+ security: [{
694
+ scheme: "bearer",
695
+ type: "http"
696
+ }],
697
+ url: "/cli/logout",
698
+ ...options,
699
+ headers: {
700
+ "Content-Type": "application/json",
701
+ ...options?.headers
702
+ }
703
+ });
704
+ /**
651
705
  * Get account info
652
706
  */
653
707
  const getAccount = (options) => (options?.client ?? client$1).get({
@@ -988,7 +1042,7 @@ const replayEmailWebhooks = (options) => (options.client ?? client$1).post({
988
1042
  * dashboard at Settings > Webhooks). When the toggle is off, this
989
1043
  * endpoint returns `403` with code `discard_not_enabled` and a
990
1044
  * message pointing the human at the dashboard. There is intentionally
991
- * no API to flip this toggle opting in to a destructive,
1045
+ * no API to flip this toggle. Opting in to a destructive,
992
1046
  * non-reversible operation must be a deliberate human click in the
993
1047
  * UI.
994
1048
  *
@@ -1401,6 +1455,10 @@ var PrimitiveApiError = class extends Error {
1401
1455
  this.details = options.details;
1402
1456
  }
1403
1457
  };
1458
+ function isAbortLikeError(error) {
1459
+ if (!(error instanceof Error)) return false;
1460
+ return error.name === "AbortError" || error.name === "TimeoutError";
1461
+ }
1404
1462
  function parseRetryAfterHeader(response) {
1405
1463
  if (!response) return void 0;
1406
1464
  const raw = response.headers.get("retry-after");
@@ -1425,8 +1483,22 @@ var PrimitiveApiClient = class {
1425
1483
  return this.client.setConfig(config);
1426
1484
  }
1427
1485
  };
1486
+ function resolveRequestOptions(options) {
1487
+ const signals = [];
1488
+ if (options?.signal) signals.push(options.signal);
1489
+ if (options?.timeout !== void 0) signals.push(AbortSignal.timeout(options.timeout));
1490
+ const signal = signals.length === 0 ? void 0 : signals.length === 1 ? signals[0] : AbortSignal.any(signals);
1491
+ const headers = {
1492
+ ...options?.headers ?? {},
1493
+ ...options?.idempotencyKey ? { "Idempotency-Key": options.idempotencyKey } : {}
1494
+ };
1495
+ const resolved = {};
1496
+ if (signal) resolved.signal = signal;
1497
+ if (Object.keys(headers).length > 0) resolved.headers = headers;
1498
+ return resolved;
1499
+ }
1428
1500
  var PrimitiveClient = class extends PrimitiveApiClient {
1429
- async send(input) {
1501
+ async send(input, options) {
1430
1502
  validateSendInput(input);
1431
1503
  return unwrapSendResult(await sendEmail({
1432
1504
  body: {
@@ -1440,7 +1512,7 @@ var PrimitiveClient = class extends PrimitiveApiClient {
1440
1512
  ...input.wait !== void 0 ? { wait: input.wait } : {},
1441
1513
  ...input.waitTimeoutMs !== void 0 ? { wait_timeout_ms: input.waitTimeoutMs } : {}
1442
1514
  },
1443
- ...input.idempotencyKey ? { headers: { "Idempotency-Key": input.idempotencyKey } } : {},
1515
+ ...resolveRequestOptions(options),
1444
1516
  client: this.client,
1445
1517
  responseStyle: "fields"
1446
1518
  }));
@@ -1459,7 +1531,7 @@ var PrimitiveClient = class extends PrimitiveApiClient {
1459
1531
  * subject match to thread, so a custom subject silently breaks the
1460
1532
  * thread for half the recipient population.
1461
1533
  */
1462
- async reply(email, input) {
1534
+ async reply(email, input, options) {
1463
1535
  const resolved = typeof input === "string" ? { text: input } : input;
1464
1536
  if ("subject" in resolved) throw new TypeError("reply does not support a subject override; the server prepends 'Re:' to the parent's subject for thread continuity");
1465
1537
  if (!resolved.text && !resolved.html) throw new TypeError("reply requires text or html");
@@ -1471,18 +1543,19 @@ var PrimitiveClient = class extends PrimitiveApiClient {
1471
1543
  ...resolved.wait !== void 0 ? { wait: resolved.wait } : {}
1472
1544
  },
1473
1545
  path: { id: email.id },
1546
+ ...resolveRequestOptions(options),
1474
1547
  client: this.client,
1475
1548
  responseStyle: "fields"
1476
1549
  }));
1477
1550
  }
1478
- async forward(email, input) {
1551
+ async forward(email, input, options) {
1479
1552
  validateForwardInput(input);
1480
1553
  return this.send({
1481
1554
  from: input.from ?? email.receivedBy,
1482
1555
  to: input.to,
1483
1556
  subject: input.subject ?? email.forwardSubject,
1484
1557
  bodyText: buildForwardText(email, input.bodyText)
1485
- });
1558
+ }, options);
1486
1559
  }
1487
1560
  };
1488
1561
  function buildForwardText(email, intro) {
@@ -1507,6 +1580,7 @@ function buildForwardText(email, intro) {
1507
1580
  function unwrapSendResult(result) {
1508
1581
  const response = result.response;
1509
1582
  if (result.error) {
1583
+ if (isAbortLikeError(result.error)) throw result.error;
1510
1584
  const parsed = parseApiErrorPayload(result.error);
1511
1585
  throw new PrimitiveApiError(parsed.message, {
1512
1586
  payload: result.error,
@@ -1551,4 +1625,4 @@ function client(options = {}) {
1551
1625
  }
1552
1626
  const operations = sdk_gen_exports;
1553
1627
  //#endregion
1554
- export { listSentEmails as A, updateFilter as B, getStorageStats as C, listEmails as D, listDomains as E, sendEmail as F, testEndpoint as I, updateAccount as L, replayEmailWebhooks as M, replyToEmail as N, listEndpoints as O, rotateWebhookSecret as P, updateDomain as R, getSentEmail as S, listDeliveries as T, verifyDomain as V, downloadAttachments as _, client as a, getEmail as b, operations as c, createFilter as d, deleteDomain as f, discardEmailContent as g, deleteFilter as h, PrimitiveClient as i, replayDelivery as j, listFilters as k, addDomain as l, deleteEndpoint as m, PrimitiveApiClient as n, createPrimitiveApiClient as o, deleteEmail as p, PrimitiveApiError as r, createPrimitiveClient as s, DEFAULT_BASE_URL as t, createEndpoint as u, downloadRawEmail as v, getWebhookSecret as w, getSendPermissions as x, getAccount as y, updateEndpoint as z };
1628
+ export { listFilters as A, updateAccount as B, getSentEmail as C, listDomains as D, listDeliveries as E, replyToEmail as F, updateEndpoint as H, rotateWebhookSecret as I, sendEmail as L, pollCliLogin as M, replayDelivery as N, listEmails as O, replayEmailWebhooks as P, startCliLogin as R, getSendPermissions as S, getWebhookSecret as T, updateFilter as U, updateDomain as V, verifyDomain as W, discardEmailContent as _, client as a, getAccount as b, operations as c, createEndpoint as d, createFilter as f, deleteFilter as g, deleteEndpoint as h, PrimitiveClient as i, listSentEmails as j, listEndpoints as k, addDomain as l, deleteEmail as m, PrimitiveApiClient as n, createPrimitiveApiClient as o, deleteDomain as p, PrimitiveApiError as r, createPrimitiveClient as s, DEFAULT_BASE_URL as t, cliLogout as u, downloadAttachments as v, getStorageStats as w, getEmail as x, downloadRawEmail as y, testEndpoint as z };
@@ -1,5 +1,5 @@
1
1
  import { C as ParsedDataFailed, D as RawContentDownloadOnly, M as WebhookAttachment, O as RawContentInline, S as ParsedDataComplete, c as EmailAnalysis, l as EmailAuth, s as EmailAddress, u as EmailReceivedEvent, w as ParsedError } from "../types-9vXGZjPd.js";
2
- import { C as signStandardWebhooksPayload, h as WEBHOOK_VERSION, j as signWebhookPayload, k as SignResult, x as StandardWebhooksSignResult } from "../index-CbEivn3S.js";
2
+ import { C as signStandardWebhooksPayload, h as WEBHOOK_VERSION, j as signWebhookPayload, k as SignResult, x as StandardWebhooksSignResult } from "../index-CDlwyxdp.js";
3
3
 
4
4
  //#region src/contract/contract.d.ts
5
5
  /** Maximum raw email size for inline inclusion (256 KB). */
@@ -180,7 +180,7 @@ interface BuildEventFromParsedDataOptions {
180
180
  downloadExpiresAt: string;
181
181
  /**
182
182
  * Download URL for the attachments tarball.
183
- * Must be null iff `parsed.attachments` is empty mismatch throws.
183
+ * Must be null iff `parsed.attachments` is empty. Mismatch throws.
184
184
  */
185
185
  attachmentsDownloadUrl: string | null;
186
186
  /** Delivery attempt number, starting at 1. */
@@ -1,4 +1,4 @@
1
- import { E as signStandardWebhooksPayload, L as validateEmailReceivedEvent, M as signWebhookPayload, d as WEBHOOK_VERSION } from "../webhook-zkN4wUTs.js";
1
+ import { E as signStandardWebhooksPayload, L as validateEmailReceivedEvent, M as signWebhookPayload, d as WEBHOOK_VERSION } from "../webhook-rUjGV6Zu.js";
2
2
  import { createHash } from "node:crypto";
3
3
  //#region src/contract/contract.ts
4
4
  /**
@@ -230,10 +230,10 @@ declare function safeValidateEmailReceivedEvent(input: unknown): ValidationResul
230
230
  * specific email's raw bytes or attachment bundle from a per-deployment
231
231
  * download endpoint. It binds:
232
232
  *
233
- * - `email_id` the specific email the token authorizes.
234
- * - `aud` a caller-chosen audience label (e.g. the resource kind being
233
+ * - `email_id`: the specific email the token authorizes.
234
+ * - `aud`: a caller-chosen audience label (e.g. the resource kind being
235
235
  * downloaded). Tokens minted for one audience will not verify under another.
236
- * - `exp` an absolute expiration time (unix seconds).
236
+ * - `exp`: an absolute expiration time (unix seconds).
237
237
  *
238
238
  * Format: `<base64url(payload)>.<base64url(signature)>` where `signature`
239
239
  * is HMAC-SHA256 over the base64url-encoded payload using the shared secret.
@@ -277,9 +277,9 @@ declare function generateDownloadToken(params: GenerateDownloadTokenOptions): st
277
277
  interface VerifyDownloadTokenOptions {
278
278
  /** The token string to verify. */
279
279
  token: string;
280
- /** Expected email ID must match the token payload exactly. */
280
+ /** Expected email ID. Must match the token payload exactly. */
281
281
  emailId: string;
282
- /** Expected audience must match the token payload exactly. */
282
+ /** Expected audience. Must match the token payload exactly. */
283
283
  audience: string;
284
284
  /** Shared HMAC secret. */
285
285
  secret: string;
@@ -290,7 +290,7 @@ interface VerifyDownloadTokenOptions {
290
290
  * Result of verifying a download token.
291
291
  *
292
292
  * On failure, `error` is a short human-readable reason suitable for logs.
293
- * Do not surface it to untrusted clients it may reveal which check failed.
293
+ * Do not surface it to untrusted clients; it may reveal which check failed.
294
294
  */
295
295
  type VerifyDownloadTokenResult = {
296
296
  valid: true;
@@ -302,7 +302,7 @@ type VerifyDownloadTokenResult = {
302
302
  * Verify a signed download token.
303
303
  *
304
304
  * Returns a discriminated-union result. The function never throws for
305
- * verification failures only malformed inputs at the crypto layer would
305
+ * verification failures. Only malformed inputs at the crypto layer would
306
306
  * surface. Callers should check `result.valid` and log `result.error`.
307
307
  *
308
308
  * @param params - Verification inputs.
@@ -248,7 +248,7 @@ interface Config<T extends ClientOptions$1 = ClientOptions$1> extends Omit<Reque
248
248
  */
249
249
  throwOnError?: T['throwOnError'];
250
250
  }
251
- interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
251
+ interface RequestOptions$1<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
252
252
  responseStyle: TResponseStyle;
253
253
  throwOnError: ThrowOnError;
254
254
  }>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
@@ -266,7 +266,7 @@ interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle =
266
266
  security?: ReadonlyArray<Auth>;
267
267
  url: Url;
268
268
  }
269
- interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
269
+ interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions$1<unknown, TResponseStyle, ThrowOnError, Url> {
270
270
  serializedBody?: string;
271
271
  }
272
272
  type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
@@ -288,9 +288,9 @@ interface ClientOptions$1 {
288
288
  responseStyle?: ResponseStyle;
289
289
  throwOnError?: boolean;
290
290
  }
291
- type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
292
- type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
293
- type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
291
+ type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions$1<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
292
+ type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions$1<never, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
293
+ type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions$1<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions$1<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
294
294
  type BuildUrlFn = <TData extends {
295
295
  body?: unknown;
296
296
  path?: Record<string, unknown>;
@@ -317,7 +317,7 @@ interface TDataShape {
317
317
  url: string;
318
318
  }
319
319
  type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
320
- type Options$1<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
320
+ type Options$1<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions$1<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
321
321
  //#endregion
322
322
  //#region src/api/generated/types.gen.d.ts
323
323
  type ClientOptions = {
@@ -347,7 +347,7 @@ type PaginationMeta = {
347
347
  type ErrorResponse = {
348
348
  success: boolean;
349
349
  error: {
350
- code: 'unauthorized' | 'forbidden' | 'not_found' | 'validation_error' | 'rate_limit_exceeded' | 'internal_error' | 'conflict' | 'mx_conflict' | 'outbound_disabled' | 'cannot_send_from_domain' | 'recipient_not_allowed' | 'outbound_key_missing' | 'outbound_unreachable' | 'outbound_key_invalid' | 'outbound_capacity_exhausted' | 'outbound_response_malformed' | 'outbound_relay_failed' | 'discard_not_enabled' | 'inbound_not_repliable';
350
+ code: 'unauthorized' | 'forbidden' | 'not_found' | 'validation_error' | 'rate_limit_exceeded' | 'internal_error' | 'conflict' | 'mx_conflict' | 'outbound_disabled' | 'cannot_send_from_domain' | 'recipient_not_allowed' | 'outbound_key_missing' | 'outbound_unreachable' | 'outbound_key_invalid' | 'outbound_capacity_exhausted' | 'outbound_response_malformed' | 'outbound_relay_failed' | 'discard_not_enabled' | 'inbound_not_repliable' | 'authorization_pending' | 'slow_down' | 'access_denied' | 'expired_token' | 'invalid_device_code';
351
351
  message: string;
352
352
  /**
353
353
  * Optional structured data that callers can inspect to recover
@@ -430,6 +430,67 @@ type GateFix = {
430
430
  */
431
431
  subject: string;
432
432
  };
433
+ type StartCliLoginInput = {
434
+ /**
435
+ * Human-readable device name shown during browser approval
436
+ */
437
+ device_name?: string;
438
+ /**
439
+ * Optional client metadata stored with the login session; serialized JSON must be 2048 bytes or fewer
440
+ */
441
+ metadata?: {
442
+ [key: string]: unknown;
443
+ };
444
+ };
445
+ type CliLoginStartResult = {
446
+ /**
447
+ * Opaque code used by the CLI to poll for approval
448
+ */
449
+ device_code: string;
450
+ /**
451
+ * Short code the user confirms in the browser
452
+ */
453
+ user_code: string;
454
+ /**
455
+ * Browser URL where the user approves the login
456
+ */
457
+ verification_uri: string;
458
+ /**
459
+ * Browser URL with the user code prefilled
460
+ */
461
+ verification_uri_complete: string;
462
+ /**
463
+ * Seconds until the login session expires
464
+ */
465
+ expires_in: number;
466
+ /**
467
+ * Minimum seconds between poll requests
468
+ */
469
+ interval: number;
470
+ };
471
+ type PollCliLoginInput = {
472
+ device_code: string;
473
+ };
474
+ type CliLoginPollResult = {
475
+ /**
476
+ * Newly-created API key for CLI authentication
477
+ */
478
+ api_key: string;
479
+ key_id: string;
480
+ key_prefix: string;
481
+ org_id: string;
482
+ org_name: string | null;
483
+ };
484
+ type CliLogoutInput = {
485
+ /**
486
+ * Optional key id guard; when provided it must match the authenticated API key
487
+ */
488
+ key_id?: string;
489
+ };
490
+ type CliLogoutResult = {
491
+ revoked: boolean;
492
+ key_id: string;
493
+ };
433
494
  type Account = {
434
495
  id: string;
435
496
  email: string;
@@ -1453,6 +1514,92 @@ type Cursor = string;
1453
1514
  * Number of results per page
1454
1515
  */
1455
1516
  type Limit = number;
1517
+ type StartCliLoginData = {
1518
+ body?: StartCliLoginInput;
1519
+ path?: never;
1520
+ query?: never;
1521
+ url: '/cli/login/start';
1522
+ };
1523
+ type StartCliLoginErrors = {
1524
+ /**
1525
+ * Invalid request parameters
1526
+ */
1527
+ 400: ErrorResponse;
1528
+ /**
1529
+ * Rate limit exceeded
1530
+ */
1531
+ 429: ErrorResponse;
1532
+ };
1533
+ type StartCliLoginError = StartCliLoginErrors[keyof StartCliLoginErrors];
1534
+ type StartCliLoginResponses = {
1535
+ /**
1536
+ * CLI login session created
1537
+ */
1538
+ 201: SuccessEnvelope & {
1539
+ data?: CliLoginStartResult;
1540
+ };
1541
+ };
1542
+ type StartCliLoginResponse = StartCliLoginResponses[keyof StartCliLoginResponses];
1543
+ type PollCliLoginData = {
1544
+ body: PollCliLoginInput;
1545
+ path?: never;
1546
+ query?: never;
1547
+ url: '/cli/login/poll';
1548
+ };
1549
+ type PollCliLoginErrors = {
1550
+ /**
1551
+ * Invalid request, pending authorization, slow polling, expired token, or invalid device code
1552
+ */
1553
+ 400: ErrorResponse;
1554
+ /**
1555
+ * CLI login was denied in the browser
1556
+ */
1557
+ 403: ErrorResponse;
1558
+ };
1559
+ type PollCliLoginError = PollCliLoginErrors[keyof PollCliLoginErrors];
1560
+ type PollCliLoginResponses = {
1561
+ /**
1562
+ * CLI login approved and API key created
1563
+ */
1564
+ 200: SuccessEnvelope & {
1565
+ data?: CliLoginPollResult;
1566
+ };
1567
+ };
1568
+ type PollCliLoginResponse = PollCliLoginResponses[keyof PollCliLoginResponses];
1569
+ type CliLogoutData = {
1570
+ body?: CliLogoutInput;
1571
+ path?: never;
1572
+ query?: never;
1573
+ url: '/cli/logout';
1574
+ };
1575
+ type CliLogoutErrors = {
1576
+ /**
1577
+ * Invalid request parameters
1578
+ */
1579
+ 400: ErrorResponse;
1580
+ /**
1581
+ * Invalid or missing API key
1582
+ */
1583
+ 401: ErrorResponse;
1584
+ /**
1585
+ * Authenticated caller lacks permission for the operation
1586
+ */
1587
+ 403: ErrorResponse;
1588
+ /**
1589
+ * Resource not found
1590
+ */
1591
+ 404: ErrorResponse;
1592
+ };
1593
+ type CliLogoutError = CliLogoutErrors[keyof CliLogoutErrors];
1594
+ type CliLogoutResponses = {
1595
+ /**
1596
+ * CLI API key revoked
1597
+ */
1598
+ 200: SuccessEnvelope & {
1599
+ data?: CliLogoutResult;
1600
+ };
1601
+ };
1602
+ type CliLogoutResponse = CliLogoutResponses[keyof CliLogoutResponses];
1456
1603
  type GetAccountData = {
1457
1604
  body?: never;
1458
1605
  path?: never;
@@ -2681,7 +2828,7 @@ type GetSentEmailResponses = {
2681
2828
  };
2682
2829
  type GetSentEmailResponse = GetSentEmailResponses[keyof GetSentEmailResponses];
2683
2830
  declare namespace sdk_gen_d_exports {
2684
- export { Options, addDomain, createEndpoint, createFilter, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, discardEmailContent, downloadAttachments, downloadRawEmail, getAccount, getEmail, getSendPermissions, getSentEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, listSentEmails, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, sendEmail, testEndpoint, updateAccount, updateDomain, updateEndpoint, updateFilter, verifyDomain };
2831
+ export { Options, addDomain, cliLogout, createEndpoint, createFilter, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, discardEmailContent, downloadAttachments, downloadRawEmail, getAccount, getEmail, getSendPermissions, getSentEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, listSentEmails, pollCliLogin, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, sendEmail, startCliLogin, testEndpoint, updateAccount, updateDomain, updateEndpoint, updateFilter, verifyDomain };
2685
2832
  }
2686
2833
  type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
2687
2834
  /**
@@ -2696,6 +2843,32 @@ type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean
2696
2843
  */
2697
2844
  meta?: Record<string, unknown>;
2698
2845
  };
2846
+ /**
2847
+ * Start CLI browser login
2848
+ *
2849
+ * Starts a browser-assisted CLI login session. The response includes a
2850
+ * device code for polling and a user code that the user approves in the
2851
+ * browser. This endpoint does not require an API key.
2852
+ *
2853
+ */
2854
+ declare const startCliLogin: <ThrowOnError extends boolean = false>(options?: Options<StartCliLoginData, ThrowOnError>) => RequestResult<StartCliLoginResponses, StartCliLoginErrors, ThrowOnError, "fields">;
2855
+ /**
2856
+ * Poll CLI browser login
2857
+ *
2858
+ * Polls a CLI login session until the browser approval either succeeds,
2859
+ * is denied, expires, or is polled too quickly. The API key is generated
2860
+ * only after approval and is returned exactly once.
2861
+ *
2862
+ */
2863
+ declare const pollCliLogin: <ThrowOnError extends boolean = false>(options: Options<PollCliLoginData, ThrowOnError>) => RequestResult<PollCliLoginResponses, PollCliLoginErrors, ThrowOnError, "fields">;
2864
+ /**
2865
+ * Revoke the current CLI API key
2866
+ *
2867
+ * Revokes the API key used to authenticate the request. CLI clients use
2868
+ * this endpoint during `primitive logout` before removing local credentials.
2869
+ *
2870
+ */
2871
+ declare const cliLogout: <ThrowOnError extends boolean = false>(options?: Options<CliLogoutData, ThrowOnError>) => RequestResult<CliLogoutResponses, CliLogoutErrors, ThrowOnError, "fields">;
2699
2872
  /**
2700
2873
  * Get account info
2701
2874
  */
@@ -2894,7 +3067,7 @@ declare const replayEmailWebhooks: <ThrowOnError extends boolean = false>(option
2894
3067
  * dashboard at Settings > Webhooks). When the toggle is off, this
2895
3068
  * endpoint returns `403` with code `discard_not_enabled` and a
2896
3069
  * message pointing the human at the dashboard. There is intentionally
2897
- * no API to flip this toggle opting in to a destructive,
3070
+ * no API to flip this toggle. Opting in to a destructive,
2898
3071
  * non-reversible operation must be a deliberate human click in the
2899
3072
  * UI.
2900
3073
  *
@@ -3100,6 +3273,15 @@ interface SendInput {
3100
3273
  thread?: SendThreadInput;
3101
3274
  wait?: boolean;
3102
3275
  waitTimeoutMs?: number;
3276
+ }
3277
+ interface RequestOptions {
3278
+ /** Cancel the in-flight request when this signal fires. Surfaces as AbortError. */
3279
+ signal?: AbortSignal;
3280
+ /** Per-call timeout in milliseconds. Composed with `signal` via AbortSignal.any so either fires AbortError. */
3281
+ timeout?: number;
3282
+ /** Per-call headers merged on top of client-level headers. Last write wins. */
3283
+ headers?: Record<string, string>;
3284
+ /** Idempotency key for safe retries. Sent as the Idempotency-Key request header. */
3103
3285
  idempotencyKey?: string;
3104
3286
  }
3105
3287
  /**
@@ -3183,7 +3365,7 @@ declare class PrimitiveApiClient {
3183
3365
  }
3184
3366
  type PrimitiveClientOptions = PrimitiveApiClientOptions;
3185
3367
  declare class PrimitiveClient extends PrimitiveApiClient {
3186
- send(input: SendInput): Promise<SendResult>;
3368
+ send(input: SendInput, options?: RequestOptions): Promise<SendResult>;
3187
3369
  /**
3188
3370
  * Reply to an inbound email.
3189
3371
  *
@@ -3198,12 +3380,12 @@ declare class PrimitiveClient extends PrimitiveApiClient {
3198
3380
  * subject match to thread, so a custom subject silently breaks the
3199
3381
  * thread for half the recipient population.
3200
3382
  */
3201
- reply(email: ReceivedEmail, input: ReplyInput): Promise<SendResult>;
3202
- forward(email: ReceivedEmail, input: ForwardInput): Promise<SendResult>;
3383
+ reply(email: ReceivedEmail, input: ReplyInput, options?: RequestOptions): Promise<SendResult>;
3384
+ forward(email: ReceivedEmail, input: ForwardInput, options?: RequestOptions): Promise<SendResult>;
3203
3385
  }
3204
3386
  declare function createPrimitiveApiClient(options?: PrimitiveApiClientOptions): PrimitiveApiClient;
3205
3387
  declare function createPrimitiveClient(options?: PrimitiveClientOptions): PrimitiveClient;
3206
3388
  declare function client(options?: PrimitiveClientOptions): PrimitiveClient;
3207
3389
  declare const operations: typeof sdk_gen_d_exports;
3208
3390
  //#endregion
3209
- export { AddDomainData as $, RequestOptions as $i, ListDomainsErrors as $n, SendPermissionAddress as $r, DownloadAttachmentsResponses as $t, getSendPermissions as A, UpdateEndpointError as Ai, GetSentEmailData as An, ReplayEmailWebhooksError as Ar, DeleteEndpointError as At, replayDelivery as B, UpdateFilterResponses as Bi, GetWebhookSecretData as Bn, ResourceId as Br, DeliverySummary as Bt, deleteEndpoint as C, UpdateDomainData as Ci, GetEmailResponse as Cn, PaginationMeta as Cr, DeleteDomainResponses as Ct, downloadRawEmail as D, UpdateDomainResponse as Di, GetSendPermissionsErrors as Dn, ReplayDeliveryResponse as Dr, DeleteEmailResponse as Dt, downloadAttachments as E, UpdateDomainInput as Ei, GetSendPermissionsError as En, ReplayDeliveryErrors as Er, DeleteEmailErrors as Et, listDomains as F, UpdateFilterData as Fi, GetStorageStatsData as Fn, ReplyToEmailData as Fr, DeleteFilterError as Ft, testEndpoint as G, VerifyDomainResponse as Gi, Limit as Gn, RotateWebhookSecretResponses as Gr, DiscardEmailContentResponse as Gt, replyToEmail as H, VerifyDomainData as Hi, GetWebhookSecretErrors as Hn, RotateWebhookSecretError as Hr, DiscardEmailContentData as Ht, listEmails as I, UpdateFilterError as Ii, GetStorageStatsError as In, ReplyToEmailError as Ir, DeleteFilterErrors as It, updateEndpoint as J, Client as Ji, ListDeliveriesErrors as Jn, SendEmailErrors as Jr, DomainVerifyResult as Jt, updateAccount as K, VerifyDomainResponses as Ki, ListDeliveriesData as Kn, SendEmailData as Kr, DiscardEmailContentResponses as Kt, listEndpoints as L, UpdateFilterErrors as Li, GetStorageStatsErrors as Ln, ReplyToEmailErrors as Lr, DeleteFilterResponse as Lt, getStorageStats as M, UpdateEndpointInput as Mi, GetSentEmailErrors as Mn, ReplayEmailWebhooksResponse as Mr, DeleteEndpointResponse as Mt, getWebhookSecret as N, UpdateEndpointResponse as Ni, GetSentEmailResponse as Nn, ReplayEmailWebhooksResponses as Nr, DeleteEndpointResponses as Nt, getAccount as O, UpdateDomainResponses as Oi, GetSendPermissionsResponse as On, ReplayDeliveryResponses as Or, DeleteEmailResponses as Ot, listDeliveries as P, UpdateEndpointResponses as Pi, GetSentEmailResponses as Pn, ReplayResult as Pr, DeleteFilterData as Pt, AccountUpdated as Q, Options$1 as Qi, ListDomainsError as Qn, SendMailResult as Qr, DownloadAttachmentsResponse as Qt, listFilters as R, UpdateFilterInput as Ri, GetStorageStatsResponse as Rn, ReplyToEmailResponse as Rr, DeleteFilterResponses as Rt, deleteEmail as S, UpdateAccountResponses as Si, GetEmailErrors as Sn, ListSentEmailsResponses as Sr, DeleteDomainResponse as St, discardEmailContent as T, UpdateDomainErrors as Ti, GetSendPermissionsData as Tn, ReplayDeliveryError as Tr, DeleteEmailError as Tt, rotateWebhookSecret as U, VerifyDomainError as Ui, GetWebhookSecretResponse as Un, RotateWebhookSecretErrors as Ur, DiscardEmailContentError as Ut, replayEmailWebhooks as V, VerifiedDomain as Vi, GetWebhookSecretError as Vn, RotateWebhookSecretData as Vr, DiscardContentResult as Vt, sendEmail as W, VerifyDomainErrors as Wi, GetWebhookSecretResponses as Wn, RotateWebhookSecretResponse as Wr, DiscardEmailContentErrors as Wt, verifyDomain as X, Config as Xi, ListDeliveriesResponses as Xn, SendEmailResponses as Xr, DownloadAttachmentsError as Xt, updateFilter as Y, ClientOptions$1 as Yi, ListDeliveriesResponse as Yn, SendEmailResponse as Yr, DownloadAttachmentsData as Yt, Account as Z, CreateClientConfig as Zi, ListDomainsData as Zn, SendMailInput as Zr, DownloadAttachmentsErrors as Zt, Options as _, UpdateAccountData as _i, GetAccountErrors as _n, ListFiltersResponses as _r, CreateFilterResponses as _t, PrimitiveApiError as a, SentEmailDetail as ai, EmailDetail as an, ListEmailsResponse as ar, ClientOptions as at, createFilter as b, UpdateAccountInput as bi, GetEmailData as bn, ListSentEmailsErrors as br, DeleteDomainError as bt, PrimitiveClientOptions as c, StorageStats as ci, EmailSummary as cn, ListEndpointsError as cr, CreateEndpointErrors as ct, SendResult as d, TestEndpointError as di, ErrorResponse as dn, ListEndpointsResponses as dr, CreateEndpointResponses as dt, RequestResult as ea, SendPermissionAnyRecipient as ei, DownloadRawEmailData as en, ListDomainsResponse as er, AddDomainError as et, SendThreadInput as f, TestEndpointErrors as fi, Filter as fn, ListEnvelope as fr, CreateFilterData as ft, operations as g, UnverifiedDomain as gi, GetAccountError as gn, ListFiltersResponse as gr, CreateFilterResponse as gt, createPrimitiveClient as h, TestResult as hi, GetAccountData as hn, ListFiltersErrors as hr, CreateFilterInput as ht, PrimitiveApiClientOptions as i, SendPermissionsMeta as ii, DownloadRawEmailResponses as in, ListEmailsErrors as ir, AddDomainResponses as it, getSentEmail as j, UpdateEndpointErrors as ji, GetSentEmailError as jn, ReplayEmailWebhooksErrors as jr, DeleteEndpointErrors as jt, getEmail as k, UpdateEndpointData as ki, GetSendPermissionsResponses as kn, ReplayEmailWebhooksData as kr, DeleteEndpointData as kt, ReplyInput as l, SuccessEnvelope as li, EmailWebhookStatus as ln, ListEndpointsErrors as lr, CreateEndpointInput as lt, createPrimitiveApiClient as m, TestEndpointResponses as mi, GateFix as mn, ListFiltersError as mr, CreateFilterErrors as mt, ForwardInput as n, Auth as na, SendPermissionRule as ni, DownloadRawEmailErrors as nn, ListEmailsData as nr, AddDomainInput as nt, PrimitiveApiErrorDetails as o, SentEmailStatus as oi, EmailDetailReply as on, ListEmailsResponses as or, CreateEndpointData as ot, client as p, TestEndpointResponse as pi, GateDenial as pn, ListFiltersData as pr, CreateFilterError as pt, updateDomain as q, WebhookSecret as qi, ListDeliveriesError as qn, SendEmailError as qr, Domain as qt, PrimitiveApiClient as r, SendPermissionYourDomain as ri, DownloadRawEmailResponse as rn, ListEmailsError as rr, AddDomainResponse as rt, PrimitiveClient as s, SentEmailSummary as si, EmailStatus as sn, ListEndpointsData as sr, CreateEndpointError as st, DEFAULT_BASE_URL as t, ResponseStyle as ta, SendPermissionManagedZone as ti, DownloadRawEmailError as tn, ListDomainsResponses as tr, AddDomainErrors as tt, SendInput as u, TestEndpointData as ui, Endpoint as un, ListEndpointsResponse as ur, CreateEndpointResponse as ut, addDomain as v, UpdateAccountError as vi, GetAccountResponse as vn, ListSentEmailsData as vr, Cursor as vt, deleteFilter as w, UpdateDomainError as wi, GetEmailResponses as wn, ReplayDeliveryData as wr, DeleteEmailData as wt, deleteDomain as x, UpdateAccountResponse as xi, GetEmailError as xn, ListSentEmailsResponse as xr, DeleteDomainErrors as xt, createEndpoint as y, UpdateAccountErrors as yi, GetAccountResponses as yn, ListSentEmailsError as yr, DeleteDomainData as yt, listSentEmails as z, UpdateFilterResponse as zi, GetStorageStatsResponses as zn, ReplyToEmailResponses as zr, DeliveryStatus as zt };
3391
+ export { updateFilter as $, UpdateDomainResponses as $i, GetWebhookSecretData as $n, ReplayResult as $r, DeliverySummary as $t, getAccount as A, StartCliLoginInput as Ai, GetAccountErrors as An, ListFiltersResponses as Ar, CreateFilterResponses as At, listFilters as B, TestResult as Bi, GetSendPermissionsErrors as Bn, PollCliLoginInput as Br, DeleteEmailResponse as Bt, deleteDomain as C, Options$1 as Ca, SendPermissionsMeta as Ci, Endpoint as Cn, ListEndpointsResponse as Cr, CreateEndpointResponse as Ct, discardEmailContent as D, Auth as Da, StartCliLoginData as Di, GateFix as Dn, ListFiltersError as Dr, CreateFilterErrors as Dt, deleteFilter as E, ResponseStyle as Ea, SentEmailSummary as Ei, GateDenial as En, ListFiltersData as Er, CreateFilterError as Et, getWebhookSecret as F, TestEndpointData as Fi, GetEmailErrors as Fn, ListSentEmailsResponses as Fr, DeleteDomainResponse as Ft, replyToEmail as G, UpdateAccountInput as Gi, GetSentEmailErrors as Gn, ReplayDeliveryErrors as Gr, DeleteEndpointResponse as Gt, pollCliLogin as H, UpdateAccountData as Hi, GetSendPermissionsResponses as Hn, PollCliLoginResponses as Hr, DeleteEndpointData as Ht, listDeliveries as I, TestEndpointError as Ii, GetEmailResponse as In, PaginationMeta as Ir, DeleteDomainResponses as It, startCliLogin as J, UpdateDomainData as Ji, GetStorageStatsData as Jn, ReplayEmailWebhooksData as Jr, DeleteFilterError as Jt, rotateWebhookSecret as K, UpdateAccountResponse as Ki, GetSentEmailResponse as Kn, ReplayDeliveryResponse as Kr, DeleteEndpointResponses as Kt, listDomains as L, TestEndpointErrors as Li, GetEmailResponses as Ln, PollCliLoginData as Lr, DeleteEmailData as Lt, getSendPermissions as M, StartCliLoginResponses as Mi, GetAccountResponses as Mn, ListSentEmailsError as Mr, DeleteDomainData as Mt, getSentEmail as N, StorageStats as Ni, GetEmailData as Nn, ListSentEmailsErrors as Nr, DeleteDomainError as Nt, downloadAttachments as O, StartCliLoginError as Oi, GetAccountData as On, ListFiltersErrors as Or, CreateFilterInput as Ot, getStorageStats as P, SuccessEnvelope as Pi, GetEmailError as Pn, ListSentEmailsResponse as Pr, DeleteDomainErrors as Pt, updateEndpoint as Q, UpdateDomainResponse as Qi, GetStorageStatsResponses as Qn, ReplayEmailWebhooksResponses as Qr, DeliveryStatus as Qt, listEmails as R, TestEndpointResponse as Ri, GetSendPermissionsData as Rn, PollCliLoginError as Rr, DeleteEmailError as Rt, createFilter as S, CreateClientConfig as Sa, SendPermissionYourDomain as Si, EmailWebhookStatus as Sn, ListEndpointsErrors as Sr, CreateEndpointInput as St, deleteEndpoint as T, RequestResult as Ta, SentEmailStatus as Ti, Filter as Tn, ListEnvelope as Tr, CreateFilterData as Tt, replayDelivery as U, UpdateAccountError as Ui, GetSentEmailData as Un, ReplayDeliveryData as Ur, DeleteEndpointError as Ut, listSentEmails as V, UnverifiedDomain as Vi, GetSendPermissionsResponse as Vn, PollCliLoginResponse as Vr, DeleteEmailResponses as Vt, replayEmailWebhooks as W, UpdateAccountErrors as Wi, GetSentEmailError as Wn, ReplayDeliveryError as Wr, DeleteEndpointErrors as Wt, updateAccount as X, UpdateDomainErrors as Xi, GetStorageStatsErrors as Xn, ReplayEmailWebhooksErrors as Xr, DeleteFilterResponse as Xt, testEndpoint as Y, UpdateDomainError as Yi, GetStorageStatsError as Yn, ReplayEmailWebhooksError as Yr, DeleteFilterErrors as Yt, updateDomain as Z, UpdateDomainInput as Zi, GetStorageStatsResponse as Zn, ReplayEmailWebhooksResponse as Zr, DeleteFilterResponses as Zt, operations as _, VerifyDomainResponses as _a, SendMailResult as _i, DownloadRawEmailResponses as _n, ListEmailsErrors as _r, CliLogoutResult as _t, PrimitiveApiError as a, UpdateEndpointResponses as aa, ResourceId as ai, DiscardEmailContentResponses as an, ListDeliveriesData as ar, AddDomainErrors as at, cliLogout as b, ClientOptions$1 as ba, SendPermissionManagedZone as bi, EmailStatus as bn, ListEndpointsData as br, CreateEndpointError as bt, PrimitiveClientOptions as c, UpdateFilterErrors as ca, RotateWebhookSecretErrors as ci, DownloadAttachmentsData as cn, ListDeliveriesResponse as cr, AddDomainResponses as ct, SendInput as d, UpdateFilterResponses as da, SendEmailData as di, DownloadAttachmentsResponse as dn, ListDomainsError as dr, CliLogoutData as dt, UpdateEndpointData as ea, ReplyToEmailData as ei, DiscardContentResult as en, GetWebhookSecretError as er, verifyDomain as et, SendResult as f, VerifiedDomain as fa, SendEmailError as fi, DownloadAttachmentsResponses as fn, ListDomainsErrors as fr, CliLogoutError as ft, createPrimitiveClient as g, VerifyDomainResponse as ga, SendMailInput as gi, DownloadRawEmailResponse as gn, ListEmailsError as gr, CliLogoutResponses as gt, createPrimitiveApiClient as h, VerifyDomainErrors as ha, SendEmailResponses as hi, DownloadRawEmailErrors as hn, ListEmailsData as hr, CliLogoutResponse as ht, PrimitiveApiClientOptions as i, UpdateEndpointResponse as ia, ReplyToEmailResponses as ii, DiscardEmailContentResponse as in, Limit as ir, AddDomainError as it, getEmail as j, StartCliLoginResponse as ji, GetAccountResponse as jn, ListSentEmailsData as jr, Cursor as jt, downloadRawEmail as k, StartCliLoginErrors as ki, GetAccountError as kn, ListFiltersResponse as kr, CreateFilterResponse as kt, ReplyInput as l, UpdateFilterInput as la, RotateWebhookSecretResponse as li, DownloadAttachmentsError as ln, ListDeliveriesResponses as lr, CliLoginPollResult as lt, client as m, VerifyDomainError as ma, SendEmailResponse as mi, DownloadRawEmailError as mn, ListDomainsResponses as mr, CliLogoutInput as mt, ForwardInput as n, UpdateEndpointErrors as na, ReplyToEmailErrors as ni, DiscardEmailContentError as nn, GetWebhookSecretResponse as nr, AccountUpdated as nt, PrimitiveApiErrorDetails as o, UpdateFilterData as oa, RotateWebhookSecretData as oi, Domain as on, ListDeliveriesError as or, AddDomainInput as ot, SendThreadInput as p, VerifyDomainData as pa, SendEmailErrors as pi, DownloadRawEmailData as pn, ListDomainsResponse as pr, CliLogoutErrors as pt, sendEmail as q, UpdateAccountResponses as qi, GetSentEmailResponses as qn, ReplayDeliveryResponses as qr, DeleteFilterData as qt, PrimitiveApiClient as r, UpdateEndpointInput as ra, ReplyToEmailResponse as ri, DiscardEmailContentErrors as rn, GetWebhookSecretResponses as rr, AddDomainData as rt, PrimitiveClient as s, UpdateFilterError as sa, RotateWebhookSecretError as si, DomainVerifyResult as sn, ListDeliveriesErrors as sr, AddDomainResponse as st, DEFAULT_BASE_URL as t, UpdateEndpointError as ta, ReplyToEmailError as ti, DiscardEmailContentData as tn, GetWebhookSecretErrors as tr, Account as tt, RequestOptions as u, UpdateFilterResponse as ua, RotateWebhookSecretResponses as ui, DownloadAttachmentsErrors as un, ListDomainsData as ur, CliLoginStartResult as ut, Options as v, WebhookSecret as va, SendPermissionAddress as vi, EmailDetail as vn, ListEmailsResponse as vr, ClientOptions as vt, deleteEmail as w, RequestOptions$1 as wa, SentEmailDetail as wi, ErrorResponse as wn, ListEndpointsResponses as wr, CreateEndpointResponses as wt, createEndpoint as x, Config as xa, SendPermissionRule as xi, EmailSummary as xn, ListEndpointsError as xr, CreateEndpointErrors as xt, addDomain as y, Client as ya, SendPermissionAnyRecipient as yi, EmailDetailReply as yn, ListEmailsResponses as yr, CreateEndpointData as yt, listEndpoints as z, TestEndpointResponses as zi, GetSendPermissionsError as zn, PollCliLoginErrors as zr, DeleteEmailErrors as zt };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
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-CHWqMBs6.js";
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";
3
+ import { a as PrimitiveApiError, c as PrimitiveClientOptions, d as SendInput, f as SendResult, g as createPrimitiveClient, l as ReplyInput, m as client, n as ForwardInput, p as SendThreadInput, s as PrimitiveClient } from "./index-oRkCqj6u.js";
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-CDlwyxdp.js";
5
5
 
6
6
  //#region src/index.d.ts
7
7
  declare const primitive: {
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
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-DrAZhxS-.js";
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";
2
+ import { a as client, i as PrimitiveClient, r as PrimitiveApiError, s as createPrimitiveClient } from "./api-C5VR_Opg.js";
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-rUjGV6Zu.js";
4
4
  //#region src/index.ts
5
5
  const primitive = {
6
6
  client,