@primitivedotdev/sdk 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/dist/api/generated/index.js +1 -1
- package/dist/api/generated/sdk.gen.js +26 -0
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.js +72 -33
- package/dist/{api-COSr-Fqm.js → api-CLLpjjWy.js} +87 -31
- package/dist/{index-DVow4Fjd.d.ts → index-K4KbjppU.d.ts} +220 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/oclif/api-command.js +217 -47
- package/dist/oclif/commands/send.js +159 -0
- package/dist/oclif/index.js +6 -0
- package/dist/openapi/openapi.generated.js +190 -3
- package/dist/openapi/operations.generated.js +49 -0
- package/oclif.manifest.json +359 -25
- package/package.json +1 -1
|
@@ -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';
|
|
350
|
+
code: 'unauthorized' | 'forbidden' | 'not_found' | 'validation_error' | 'rate_limit_exceeded' | 'internal_error' | 'conflict' | 'mx_conflict' | 'outbound_disabled' | 'cannot_send_from_domain' | 'recipient_not_allowed' | 'outbound_key_missing' | 'outbound_unreachable' | 'outbound_key_invalid' | 'outbound_capacity_exhausted' | 'outbound_response_malformed' | 'outbound_relay_failed' | 'inbound_not_repliable';
|
|
351
351
|
message: string;
|
|
352
352
|
/**
|
|
353
353
|
* Optional structured data that callers can inspect to recover
|
|
@@ -579,6 +579,14 @@ type EmailDetail = {
|
|
|
579
579
|
sender: string;
|
|
580
580
|
recipient: string;
|
|
581
581
|
subject?: string | null;
|
|
582
|
+
/**
|
|
583
|
+
* Plain-text body parsed from the inbound MIME, matching the `email.parsed.body_text` field on the webhook payload. Null when the message had no text part or parsing failed.
|
|
584
|
+
*/
|
|
585
|
+
body_text?: string | null;
|
|
586
|
+
/**
|
|
587
|
+
* HTML body parsed from the inbound MIME, matching the `email.parsed.body_html` field on the webhook payload. Null when the message had no HTML part or parsing failed.
|
|
588
|
+
*/
|
|
589
|
+
body_html?: string | null;
|
|
582
590
|
status: 'pending' | 'accepted' | 'completed' | 'rejected';
|
|
583
591
|
domain: string;
|
|
584
592
|
spam_score?: number | null;
|
|
@@ -607,6 +615,42 @@ type EmailDetail = {
|
|
|
607
615
|
* Parsed to address (same as recipient)
|
|
608
616
|
*/
|
|
609
617
|
to_email: string;
|
|
618
|
+
/**
|
|
619
|
+
* True when the inbound's sender address has a matching grant
|
|
620
|
+
* in the org's known-send-addresses list. Advisory: a true
|
|
621
|
+
* value does not by itself guarantee that a reply will be
|
|
622
|
+
* accepted by send-mail's gates; the per-send check at send
|
|
623
|
+
* time remains authoritative.
|
|
624
|
+
*
|
|
625
|
+
*/
|
|
626
|
+
from_known_address?: boolean;
|
|
627
|
+
/**
|
|
628
|
+
* Sent emails recorded as replies to this inbound, in send
|
|
629
|
+
* order (ascending). Populated when a customer's send-mail
|
|
630
|
+
* request carries an `in_reply_to` Message-ID that matches
|
|
631
|
+
* this inbound's `message_id` in the same org. Includes
|
|
632
|
+
* attempts that were gate-denied, so the array reflects every
|
|
633
|
+
* recorded reply attempt regardless of outcome.
|
|
634
|
+
*
|
|
635
|
+
*/
|
|
636
|
+
replies: Array<EmailDetailReply>;
|
|
637
|
+
};
|
|
638
|
+
type EmailDetailReply = {
|
|
639
|
+
/**
|
|
640
|
+
* Sent-email row id.
|
|
641
|
+
*/
|
|
642
|
+
id: string;
|
|
643
|
+
status: SentEmailStatus;
|
|
644
|
+
/**
|
|
645
|
+
* Recipient address as recorded on the sent_emails row.
|
|
646
|
+
*/
|
|
647
|
+
to_address: string;
|
|
648
|
+
subject?: string | null;
|
|
649
|
+
created_at: string;
|
|
650
|
+
/**
|
|
651
|
+
* Outbound relay queue identifier when available.
|
|
652
|
+
*/
|
|
653
|
+
queue_id?: string | null;
|
|
610
654
|
};
|
|
611
655
|
type SendMailInput = {
|
|
612
656
|
/**
|
|
@@ -648,6 +692,44 @@ type SendMailInput = {
|
|
|
648
692
|
};
|
|
649
693
|
type SentEmailStatus = 'queued' | 'submitted_to_agent' | 'agent_failed' | 'unknown' | 'delivered' | 'bounced' | 'deferred' | 'wait_timeout';
|
|
650
694
|
type DeliveryStatus = 'delivered' | 'bounced' | 'deferred' | 'wait_timeout';
|
|
695
|
+
/**
|
|
696
|
+
* Body shape for `/emails/{id}/reply`. Intentionally narrow:
|
|
697
|
+
* recipients (`to`), subject, and threading headers
|
|
698
|
+
* (`in_reply_to`, `references`) are derived server-side from
|
|
699
|
+
* the inbound row referenced by the path id and are rejected by
|
|
700
|
+
* `additionalProperties` if passed (returns 400).
|
|
701
|
+
*
|
|
702
|
+
* `from` IS allowed because of legitimate use cases (display-name
|
|
703
|
+
* addition, replying from a different verified outbound address,
|
|
704
|
+
* multi-team triage). Send-mail's per-send `canSendFrom` gate
|
|
705
|
+
* validates the from-domain regardless, so the override carries
|
|
706
|
+
* no extra privilege.
|
|
707
|
+
*
|
|
708
|
+
*/
|
|
709
|
+
type ReplyInput$1 = {
|
|
710
|
+
/**
|
|
711
|
+
* Plain-text reply body. At least one of body_text or body_html is required. The combined UTF-8 byte length of body_text and body_html must be at most 262144 bytes (same cap as send-mail).
|
|
712
|
+
*/
|
|
713
|
+
body_text?: string;
|
|
714
|
+
/**
|
|
715
|
+
* HTML reply body. At least one of body_text or body_html is required.
|
|
716
|
+
*/
|
|
717
|
+
body_html?: string;
|
|
718
|
+
/**
|
|
719
|
+
* Optional override for the reply's From header. Defaults to
|
|
720
|
+
* the inbound's recipient. Use to add a display name (`"Acme
|
|
721
|
+
* Support" <agent@company.com>`) or to reply from a different
|
|
722
|
+
* verified outbound address (e.g. multi-team routing where
|
|
723
|
+
* support@ triages to billing@). The from-domain must be a
|
|
724
|
+
* verified outbound domain for your org, same as send-mail.
|
|
725
|
+
*
|
|
726
|
+
*/
|
|
727
|
+
from?: string;
|
|
728
|
+
/**
|
|
729
|
+
* When true, wait for the first downstream SMTP delivery outcome before returning, mirroring the send-mail `wait` semantics.
|
|
730
|
+
*/
|
|
731
|
+
wait?: boolean;
|
|
732
|
+
};
|
|
651
733
|
type SendMailResult = {
|
|
652
734
|
/**
|
|
653
735
|
* Persisted sent-email attempt ID.
|
|
@@ -687,6 +769,15 @@ type SendMailResult = {
|
|
|
687
769
|
* SMTP response text from the first downstream delivery outcome when wait is true.
|
|
688
770
|
*/
|
|
689
771
|
smtp_response_text?: string;
|
|
772
|
+
/**
|
|
773
|
+
* True when the response replays a previously-recorded send
|
|
774
|
+
* keyed by `client_idempotency_key` (same key, same canonical
|
|
775
|
+
* payload). False on a fresh send and on gate-denied
|
|
776
|
+
* responses. Lets callers branch on cache state without
|
|
777
|
+
* diffing fields.
|
|
778
|
+
*
|
|
779
|
+
*/
|
|
780
|
+
idempotent_replay: boolean;
|
|
690
781
|
};
|
|
691
782
|
type Endpoint = {
|
|
692
783
|
id: string;
|
|
@@ -1359,6 +1450,68 @@ type DownloadAttachmentsResponses = {
|
|
|
1359
1450
|
200: Blob | File;
|
|
1360
1451
|
};
|
|
1361
1452
|
type DownloadAttachmentsResponse = DownloadAttachmentsResponses[keyof DownloadAttachmentsResponses];
|
|
1453
|
+
type ReplyToEmailData = {
|
|
1454
|
+
body: ReplyInput$1;
|
|
1455
|
+
path: {
|
|
1456
|
+
/**
|
|
1457
|
+
* Resource UUID
|
|
1458
|
+
*/
|
|
1459
|
+
id: string;
|
|
1460
|
+
};
|
|
1461
|
+
query?: never;
|
|
1462
|
+
url: '/emails/{id}/reply';
|
|
1463
|
+
};
|
|
1464
|
+
type ReplyToEmailErrors = {
|
|
1465
|
+
/**
|
|
1466
|
+
* Invalid request parameters
|
|
1467
|
+
*/
|
|
1468
|
+
400: ErrorResponse;
|
|
1469
|
+
/**
|
|
1470
|
+
* Invalid or missing API key
|
|
1471
|
+
*/
|
|
1472
|
+
401: ErrorResponse;
|
|
1473
|
+
/**
|
|
1474
|
+
* Authenticated caller lacks permission for the operation
|
|
1475
|
+
*/
|
|
1476
|
+
403: ErrorResponse;
|
|
1477
|
+
/**
|
|
1478
|
+
* Resource not found
|
|
1479
|
+
*/
|
|
1480
|
+
404: ErrorResponse;
|
|
1481
|
+
/**
|
|
1482
|
+
* Inbound is not repliable: the row exists but lacks a
|
|
1483
|
+
* `message_id` (no thread anchor) or a `recipient` (cannot
|
|
1484
|
+
* derive the From address).
|
|
1485
|
+
*
|
|
1486
|
+
*/
|
|
1487
|
+
422: ErrorResponse;
|
|
1488
|
+
/**
|
|
1489
|
+
* Rate limit exceeded
|
|
1490
|
+
*/
|
|
1491
|
+
429: ErrorResponse;
|
|
1492
|
+
/**
|
|
1493
|
+
* Primitive encountered an internal error
|
|
1494
|
+
*/
|
|
1495
|
+
500: ErrorResponse;
|
|
1496
|
+
/**
|
|
1497
|
+
* Primitive could not complete the downstream SMTP request
|
|
1498
|
+
*/
|
|
1499
|
+
502: ErrorResponse;
|
|
1500
|
+
/**
|
|
1501
|
+
* Primitive is temporarily unable to process the request
|
|
1502
|
+
*/
|
|
1503
|
+
503: ErrorResponse;
|
|
1504
|
+
};
|
|
1505
|
+
type ReplyToEmailError = ReplyToEmailErrors[keyof ReplyToEmailErrors];
|
|
1506
|
+
type ReplyToEmailResponses = {
|
|
1507
|
+
/**
|
|
1508
|
+
* Outbound relay result
|
|
1509
|
+
*/
|
|
1510
|
+
200: SuccessEnvelope & {
|
|
1511
|
+
data?: SendMailResult;
|
|
1512
|
+
};
|
|
1513
|
+
};
|
|
1514
|
+
type ReplyToEmailResponse = ReplyToEmailResponses[keyof ReplyToEmailResponses];
|
|
1362
1515
|
type ReplayEmailWebhooksData = {
|
|
1363
1516
|
body?: never;
|
|
1364
1517
|
path: {
|
|
@@ -1829,7 +1982,7 @@ type SendEmailResponses = {
|
|
|
1829
1982
|
};
|
|
1830
1983
|
type SendEmailResponse = SendEmailResponses[keyof SendEmailResponses];
|
|
1831
1984
|
declare namespace sdk_gen_d_exports {
|
|
1832
|
-
export { Options, addDomain, createEndpoint, createFilter, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, downloadAttachments, downloadRawEmail, getAccount, getEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, replayDelivery, replayEmailWebhooks, rotateWebhookSecret, sendEmail, testEndpoint, updateAccount, updateDomain, updateEndpoint, updateFilter, verifyDomain };
|
|
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 };
|
|
1833
1986
|
}
|
|
1834
1987
|
type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
|
|
1835
1988
|
/**
|
|
@@ -1948,6 +2101,24 @@ declare const downloadRawEmail: <ThrowOnError extends boolean = false>(options:
|
|
|
1948
2101
|
*
|
|
1949
2102
|
*/
|
|
1950
2103
|
declare const downloadAttachments: <ThrowOnError extends boolean = false>(options: Options<DownloadAttachmentsData, ThrowOnError>) => RequestResult<DownloadAttachmentsResponses, DownloadAttachmentsErrors, ThrowOnError, "fields">;
|
|
2104
|
+
/**
|
|
2105
|
+
* Reply to an inbound email
|
|
2106
|
+
*
|
|
2107
|
+
* Sends an outbound reply to the inbound email identified by `id`.
|
|
2108
|
+
* Threading headers (`In-Reply-To`, `References`), recipient
|
|
2109
|
+
* derivation (Reply-To, then From, then bare sender), and the
|
|
2110
|
+
* `Re:` subject prefix are all derived server-side from the
|
|
2111
|
+
* stored inbound row. The request body carries only the message
|
|
2112
|
+
* body and optional `wait` flag; passing any header or recipient
|
|
2113
|
+
* override is rejected by the schema (`additionalProperties:
|
|
2114
|
+
* false`).
|
|
2115
|
+
*
|
|
2116
|
+
* Forwards through the same gates as `/send-mail`: the response
|
|
2117
|
+
* status, error envelope, and `idempotent_replay` flag mirror
|
|
2118
|
+
* the send-mail contract verbatim.
|
|
2119
|
+
*
|
|
2120
|
+
*/
|
|
2121
|
+
declare const replyToEmail: <ThrowOnError extends boolean = false>(options: Options<ReplyToEmailData, ThrowOnError>) => RequestResult<ReplyToEmailResponses, ReplyToEmailErrors, ThrowOnError, "fields">;
|
|
1951
2122
|
/**
|
|
1952
2123
|
* Replay email webhooks
|
|
1953
2124
|
*
|
|
@@ -2077,10 +2248,34 @@ interface SendInput {
|
|
|
2077
2248
|
waitTimeoutMs?: number;
|
|
2078
2249
|
idempotencyKey?: string;
|
|
2079
2250
|
}
|
|
2251
|
+
/**
|
|
2252
|
+
* Input shape for `client.reply(email, input)`.
|
|
2253
|
+
*
|
|
2254
|
+
* Can be a bare string (treated as `text`) or an object. The reply
|
|
2255
|
+
* operation calls the server's `/emails/{id}/reply` endpoint, which
|
|
2256
|
+
* derives recipients, subject (`Re: <parent>`), and threading headers
|
|
2257
|
+
* from the inbound row. The shape here is the small subset of fields
|
|
2258
|
+
* the customer can still control:
|
|
2259
|
+
*
|
|
2260
|
+
* - `text` / `html`: the reply body. At least one is required.
|
|
2261
|
+
* - `from`: optional override for the From header. Defaults server-
|
|
2262
|
+
* side to the address that received the inbound. Use to add a
|
|
2263
|
+
* display name (`"Acme Support" <agent@company.com>`) or to reply
|
|
2264
|
+
* from a different verified outbound address. The from-domain must
|
|
2265
|
+
* be a verified outbound domain for your org.
|
|
2266
|
+
* - `wait`: when true, wait for the first downstream SMTP delivery
|
|
2267
|
+
* outcome before resolving. Mirrors send-mail's `wait` semantics.
|
|
2268
|
+
*
|
|
2269
|
+
* `subject` is intentionally not accepted: a custom subject silently
|
|
2270
|
+
* breaks Gmail's threading because Gmail's Conversation View requires
|
|
2271
|
+
* both a References match and a normalized-subject match. Always
|
|
2272
|
+
* sends `Re: <parent>` with idempotent prefixing.
|
|
2273
|
+
*/
|
|
2080
2274
|
type ReplyInput = string | {
|
|
2081
|
-
text
|
|
2082
|
-
|
|
2275
|
+
text?: string;
|
|
2276
|
+
html?: string;
|
|
2083
2277
|
from?: string;
|
|
2278
|
+
wait?: boolean;
|
|
2084
2279
|
};
|
|
2085
2280
|
interface ForwardInput {
|
|
2086
2281
|
to: string;
|
|
@@ -2097,6 +2292,12 @@ interface SendResult {
|
|
|
2097
2292
|
clientIdempotencyKey: string;
|
|
2098
2293
|
requestId: string;
|
|
2099
2294
|
contentHash: string;
|
|
2295
|
+
/**
|
|
2296
|
+
* True when the response replays a previously-recorded send keyed by
|
|
2297
|
+
* `clientIdempotencyKey` (same key, same canonical payload). False on
|
|
2298
|
+
* a fresh send and on gate-denied responses.
|
|
2299
|
+
*/
|
|
2300
|
+
idempotentReplay: boolean;
|
|
2100
2301
|
deliveryStatus?: SendMailResult["delivery_status"];
|
|
2101
2302
|
smtpResponseCode?: number | null;
|
|
2102
2303
|
smtpResponseText?: string;
|
|
@@ -2129,6 +2330,20 @@ declare class PrimitiveApiClient {
|
|
|
2129
2330
|
type PrimitiveClientOptions = PrimitiveApiClientOptions;
|
|
2130
2331
|
declare class PrimitiveClient extends PrimitiveApiClient {
|
|
2131
2332
|
send(input: SendInput): Promise<SendResult>;
|
|
2333
|
+
/**
|
|
2334
|
+
* Reply to an inbound email.
|
|
2335
|
+
*
|
|
2336
|
+
* Calls `POST /emails/{id}/reply`. The server derives recipients
|
|
2337
|
+
* (Reply-To, then From, then sender), subject (`Re: <parent>` with
|
|
2338
|
+
* idempotent prefix), and threading headers (`In-Reply-To`,
|
|
2339
|
+
* `References`) from the stored inbound row. The customer controls
|
|
2340
|
+
* only the body, an optional `from` override, and the `wait` flag.
|
|
2341
|
+
*
|
|
2342
|
+
* Subject overrides are intentionally not supported: Gmail's
|
|
2343
|
+
* Conversation View needs both a References match and a normalized-
|
|
2344
|
+
* subject match to thread, so a custom subject silently breaks the
|
|
2345
|
+
* thread for half the recipient population.
|
|
2346
|
+
*/
|
|
2132
2347
|
reply(email: ReceivedEmail, input: ReplyInput): Promise<SendResult>;
|
|
2133
2348
|
forward(email: ReceivedEmail, input: ForwardInput): Promise<SendResult>;
|
|
2134
2349
|
}
|
|
@@ -2137,4 +2352,4 @@ declare function createPrimitiveClient(options?: PrimitiveClientOptions): Primit
|
|
|
2137
2352
|
declare function client(options?: PrimitiveClientOptions): PrimitiveClient;
|
|
2138
2353
|
declare const operations: typeof sdk_gen_d_exports;
|
|
2139
2354
|
//#endregion
|
|
2140
|
-
export {
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as UnknownEvent, C as ParsedDataFailed, D as RawContentDownloadOnly, E as RawContent, M as WebhookAttachment, N as WebhookEvent, O as RawContentInline, S as ParsedDataComplete, T as ParsedStatus, _ as ForwardResultInline, a as DmarcPolicy, b as KnownWebhookEvent, c as EmailAnalysis, d as EventType, f as ForwardAnalysis, g as ForwardResultAttachmentSkipped, h as ForwardResultAttachmentAnalyzed, i as DkimSignature, j as ValidateEmailAuthResult, k as SpfResult, l as EmailAuth, m as ForwardResult, n as AuthVerdict, o as DmarcResult, p as ForwardOriginalSender, r as DkimResult, s as EmailAddress, t as AuthConfidence, u as EmailReceivedEvent, v as ForwardVerdict, w as ParsedError, x as ParsedData, y as ForwardVerification } from "./types-9vXGZjPd.js";
|
|
2
2
|
import { a as buildReplySubject, c as parseHeaderAddress, i as buildForwardSubject, n as ReceivedEmailAddress, o as formatAddress, r as ReceivedEmailThread, s as normalizeReceivedEmail, t as ReceivedEmail } from "./received-email-DNjpq_Wt.js";
|
|
3
|
-
import { a as PrimitiveApiError, c as PrimitiveClientOptions, d as SendResult, f as SendThreadInput, h as createPrimitiveClient, l as ReplyInput, n as ForwardInput, p as client, s as PrimitiveClient, u as SendInput } from "./index-
|
|
3
|
+
import { a as PrimitiveApiError, c as PrimitiveClientOptions, d as SendResult, f as SendThreadInput, h as createPrimitiveClient, l as ReplyInput, n as ForwardInput, p as client, s as PrimitiveClient, u as SendInput } from "./index-K4KbjppU.js";
|
|
4
4
|
import { A as VerifyOptions, B as PAYLOAD_ERRORS, C as signStandardWebhooksPayload, D as PRIMITIVE_CONFIRMED_HEADER, E as LEGACY_SIGNATURE_HEADER, F as VerifyDownloadTokenResult, G as VERIFICATION_ERRORS, H as RAW_EMAIL_ERRORS, I as generateDownloadToken, J as WebhookPayloadErrorCode, K as WebhookErrorCode, L as verifyDownloadToken, M as verifyWebhookSignature, N as GenerateDownloadTokenOptions, O as PRIMITIVE_SIGNATURE_HEADER, P as VerifyDownloadTokenOptions, Q as WebhookVerificationErrorCode, R as safeValidateEmailReceivedEvent, S as StandardWebhooksVerifyOptions, T as LEGACY_CONFIRMED_HEADER, U as RawEmailDecodeError, V as PrimitiveWebhookError, W as RawEmailDecodeErrorCode, X as WebhookValidationErrorCode, Y as WebhookValidationError, Z as WebhookVerificationError, _ as emailReceivedEventJsonSchema, a as confirmedHeaders, b as STANDARD_WEBHOOK_TIMESTAMP_HEADER, c as handleWebhook, d as isRawIncluded, f as parseWebhookEvent, g as validateEmailAuth, h as WEBHOOK_VERSION, i as WebhookHeaders, j as signWebhookPayload, k as SignResult, l as isDownloadExpired, m as verifyRawEmailDownload, n as HandleWebhookOptions, o as decodeRawEmail, p as receive, q as WebhookPayloadError, r as ReceiveRequestOptions, s as getDownloadTimeRemaining, t as DecodeRawEmailOptions, u as isEmailReceivedEvent, v as STANDARD_WEBHOOK_ID_HEADER, w as verifyStandardWebhooksSignature, x as StandardWebhooksSignResult, y as STANDARD_WEBHOOK_SIGNATURE_HEADER, z as validateEmailReceivedEvent } from "./index-CbEivn3S.js";
|
|
5
5
|
|
|
6
6
|
//#region src/index.d.ts
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as parseHeaderAddress, i as normalizeReceivedEmail, n as buildReplySubject, r as formatAddress, t as buildForwardSubject } from "./received-email-D6tKtWwW.js";
|
|
2
|
-
import { a as client, i as PrimitiveClient, r as PrimitiveApiError, s as createPrimitiveClient } from "./api-
|
|
2
|
+
import { a as client, i as PrimitiveClient, r as PrimitiveApiError, s as createPrimitiveClient } from "./api-CLLpjjWy.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 = {
|