shipmail 0.1.31 → 0.1.33
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 +80 -0
- package/dist/index.cjs +162 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +250 -37
- package/dist/index.d.ts +250 -37
- package/dist/index.js +161 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ type ShipMailConfig = {
|
|
|
18
18
|
readonly timeout?: number | undefined;
|
|
19
19
|
readonly fetch?: typeof fetch | undefined;
|
|
20
20
|
readonly defaultHeaders?: Record<string, string> | undefined;
|
|
21
|
+
readonly organizationId?: string | undefined;
|
|
21
22
|
};
|
|
22
23
|
type PaginationParams = {
|
|
23
24
|
readonly cursor?: string | undefined;
|
|
@@ -31,6 +32,8 @@ type PaginatedResponse<T> = {
|
|
|
31
32
|
readonly limit: number;
|
|
32
33
|
};
|
|
33
34
|
};
|
|
35
|
+
type DataMode = "live" | "test";
|
|
36
|
+
type SandboxOutcome = "delivered" | "bounced" | "complained";
|
|
34
37
|
type ErrorType = "validation_error" | "authentication_error" | "authorization_error" | "quota_exceeded" | "not_found" | "rate_limit_error" | "conflict" | "internal_error";
|
|
35
38
|
type ApiErrorBody = {
|
|
36
39
|
readonly error: {
|
|
@@ -50,8 +53,10 @@ type EmailRecipient = {
|
|
|
50
53
|
readonly name?: string | null | undefined;
|
|
51
54
|
};
|
|
52
55
|
type EmailRecipientInput = EmailRecipient | string;
|
|
53
|
-
declare const WEBHOOK_EVENT_TYPES: readonly ["message.received", "message.sent", "message.delivered", "message.bounced", "message.complained", "domain.verified", "domain.verification_failed", "domain.degraded", "org.reputation_warning", "org.sending_throttled", "org.sending_suspended", "org.reputation_recovered"];
|
|
56
|
+
declare const WEBHOOK_EVENT_TYPES: readonly ["message.received", "message.sent", "message.delivered", "message.bounced", "message.complained", "mailbox.rule_matched", "domain.verified", "domain.verification_failed", "domain.degraded", "org.reputation_warning", "org.sending_throttled", "org.sending_suspended", "org.reputation_recovered"];
|
|
54
57
|
type WebhookEventType = (typeof WEBHOOK_EVENT_TYPES)[number];
|
|
58
|
+
declare const WEBHOOK_DELIVERY_EVENT_TYPES: readonly ["webhook.test", "message.received", "message.sent", "message.delivered", "message.bounced", "message.complained", "mailbox.rule_matched", "domain.verified", "domain.verification_failed", "domain.degraded", "org.reputation_warning", "org.sending_throttled", "org.sending_suspended", "org.reputation_recovered"];
|
|
59
|
+
type WebhookDeliveryEventType = (typeof WEBHOOK_DELIVERY_EVENT_TYPES)[number];
|
|
55
60
|
type StatusResponse = {
|
|
56
61
|
readonly status: string;
|
|
57
62
|
readonly version: string;
|
|
@@ -71,6 +76,7 @@ type MethodOptions = {
|
|
|
71
76
|
readonly signal?: AbortSignal | undefined;
|
|
72
77
|
readonly headers?: Record<string, string> | undefined;
|
|
73
78
|
readonly idempotencyKey?: string | undefined;
|
|
79
|
+
readonly organizationId?: string | undefined;
|
|
74
80
|
};
|
|
75
81
|
|
|
76
82
|
type MergeFields = Record<string, string | number | boolean | null>;
|
|
@@ -161,6 +167,8 @@ declare class Audiences extends ApiResource {
|
|
|
161
167
|
delete(id: string, options?: MethodOptions): Promise<void>;
|
|
162
168
|
}
|
|
163
169
|
|
|
170
|
+
declare const CONFERENCING_PROVIDER_IDS: readonly ["zoom", "google_meet"];
|
|
171
|
+
type ConferencingProviderId = (typeof CONFERENCING_PROVIDER_IDS)[number];
|
|
164
172
|
type BookingPage = {
|
|
165
173
|
readonly object: "booking_page";
|
|
166
174
|
readonly id: string;
|
|
@@ -177,6 +185,7 @@ type BookingPage = {
|
|
|
177
185
|
readonly buffer_minutes: number;
|
|
178
186
|
readonly minimum_notice_minutes: number;
|
|
179
187
|
readonly max_advance_days: number;
|
|
188
|
+
readonly conferencing_provider: ConferencingProviderId | null;
|
|
180
189
|
readonly active: boolean;
|
|
181
190
|
readonly created_at: string;
|
|
182
191
|
readonly updated_at: string;
|
|
@@ -195,6 +204,7 @@ type CreateBookingPageParams = {
|
|
|
195
204
|
readonly buffer_minutes?: number | undefined;
|
|
196
205
|
readonly minimum_notice_minutes?: number | undefined;
|
|
197
206
|
readonly max_advance_days?: number | undefined;
|
|
207
|
+
readonly conferencing_provider?: ConferencingProviderId | null | undefined;
|
|
198
208
|
readonly active?: boolean | undefined;
|
|
199
209
|
};
|
|
200
210
|
type UpdateBookingPageParams = {
|
|
@@ -210,6 +220,7 @@ type UpdateBookingPageParams = {
|
|
|
210
220
|
readonly buffer_minutes?: number | undefined;
|
|
211
221
|
readonly minimum_notice_minutes?: number | undefined;
|
|
212
222
|
readonly max_advance_days?: number | undefined;
|
|
223
|
+
readonly conferencing_provider?: ConferencingProviderId | null | undefined;
|
|
213
224
|
readonly active?: boolean | undefined;
|
|
214
225
|
};
|
|
215
226
|
|
|
@@ -414,6 +425,26 @@ type DomainVerificationResult = {
|
|
|
414
425
|
readonly dmarc_record_value: string | null;
|
|
415
426
|
readonly dmarc_managed_externally: boolean;
|
|
416
427
|
};
|
|
428
|
+
type DomainDnsRecordKey = "mx" | "spf" | "mail_from_mx" | "mail_from_spf" | "dkim" | "dmarc";
|
|
429
|
+
type DomainDnsRecordStatus = "verified" | "not_found" | "mismatch" | "pending";
|
|
430
|
+
type DomainDnsRecord = {
|
|
431
|
+
readonly key: DomainDnsRecordKey;
|
|
432
|
+
readonly type: "MX" | "TXT";
|
|
433
|
+
readonly host: string;
|
|
434
|
+
readonly value: string | null;
|
|
435
|
+
readonly priority: number | null;
|
|
436
|
+
readonly ttl: number;
|
|
437
|
+
readonly status: DomainDnsRecordStatus;
|
|
438
|
+
readonly found_values: readonly string[];
|
|
439
|
+
};
|
|
440
|
+
type DomainDnsRecordSet = {
|
|
441
|
+
readonly object: "dns_record_set";
|
|
442
|
+
readonly domain_id: string;
|
|
443
|
+
readonly domain_name: string;
|
|
444
|
+
readonly all_verified: boolean;
|
|
445
|
+
readonly checked_at: string;
|
|
446
|
+
readonly records: readonly DomainDnsRecord[];
|
|
447
|
+
};
|
|
417
448
|
type DomainSearchResult = {
|
|
418
449
|
readonly domain_name: string;
|
|
419
450
|
readonly available: boolean;
|
|
@@ -456,6 +487,7 @@ declare class Domains extends ApiResource {
|
|
|
456
487
|
list(params?: ListDomainsParams, options?: MethodOptions): Promise<PaginatedResponse<Domain>>;
|
|
457
488
|
listAutoPaginating(params?: Omit<ListDomainsParams, "cursor">): Page<Domain>;
|
|
458
489
|
get(id: string, options?: MethodOptions): Promise<Domain>;
|
|
490
|
+
getDnsRecords(id: string, options?: MethodOptions): Promise<DomainDnsRecordSet>;
|
|
459
491
|
update(id: string, params: UpdateDomainParams, options?: MethodOptions): Promise<Domain>;
|
|
460
492
|
delete(id: string, options?: MethodOptions): Promise<void>;
|
|
461
493
|
verify(id: string, options?: MethodOptions): Promise<DomainVerificationResult>;
|
|
@@ -566,6 +598,7 @@ type AutoReply = {
|
|
|
566
598
|
readonly from_date: string | null;
|
|
567
599
|
readonly to_date: string | null;
|
|
568
600
|
};
|
|
601
|
+
type MailboxSuspensionReason = "billing" | "manual" | "security";
|
|
569
602
|
type Mailbox = {
|
|
570
603
|
readonly object: "mailbox";
|
|
571
604
|
readonly id: string;
|
|
@@ -573,11 +606,32 @@ type Mailbox = {
|
|
|
573
606
|
readonly address: string;
|
|
574
607
|
readonly display_name: string | null;
|
|
575
608
|
readonly suspended_at: string | null;
|
|
609
|
+
readonly suspension_reasons: readonly MailboxSuspensionReason[];
|
|
576
610
|
readonly spam_filter_threshold: number;
|
|
577
611
|
readonly auto_reply: AutoReply;
|
|
578
612
|
readonly created_at: string;
|
|
579
613
|
readonly updated_at: string;
|
|
580
614
|
};
|
|
615
|
+
type MailboxExportStatus = "pending" | "processing" | "completed" | "failed" | "expired";
|
|
616
|
+
type MailboxExportErrorCode = "source_unavailable" | "snapshot_changed" | "export_failed";
|
|
617
|
+
type MailboxExport = {
|
|
618
|
+
readonly object: "mailbox_export";
|
|
619
|
+
readonly id: string;
|
|
620
|
+
readonly mailbox_id: string;
|
|
621
|
+
readonly status: MailboxExportStatus;
|
|
622
|
+
readonly format: "zip";
|
|
623
|
+
readonly format_version: number;
|
|
624
|
+
readonly file_size: number | null;
|
|
625
|
+
readonly message_count: number | null;
|
|
626
|
+
readonly folder_count: number | null;
|
|
627
|
+
readonly error_code: MailboxExportErrorCode | null;
|
|
628
|
+
readonly download_url: string | null;
|
|
629
|
+
readonly download_url_expires_at: string | null;
|
|
630
|
+
readonly expires_at: string | null;
|
|
631
|
+
readonly created_at: string;
|
|
632
|
+
readonly started_at: string | null;
|
|
633
|
+
readonly completed_at: string | null;
|
|
634
|
+
};
|
|
581
635
|
type MailboxFolder = {
|
|
582
636
|
readonly object: "mailbox_folder";
|
|
583
637
|
readonly id: string;
|
|
@@ -741,11 +795,37 @@ type MailboxRules = {
|
|
|
741
795
|
readonly rules: readonly MailboxRule[];
|
|
742
796
|
readonly folders: readonly MailboxRuleFolder[];
|
|
743
797
|
};
|
|
744
|
-
type
|
|
798
|
+
type MailboxForwarding = {
|
|
799
|
+
readonly object: "mailbox_forwarding";
|
|
800
|
+
readonly id: string;
|
|
801
|
+
readonly mailbox_id: string;
|
|
802
|
+
readonly destination: string;
|
|
803
|
+
readonly status: "pending" | "active";
|
|
804
|
+
readonly verification_sent_at: string | null;
|
|
805
|
+
readonly verified_at: string | null;
|
|
806
|
+
readonly created_at: string;
|
|
807
|
+
readonly updated_at: string;
|
|
808
|
+
};
|
|
809
|
+
type MailboxForwardingList = {
|
|
810
|
+
readonly object: "mailbox_forwarding_list";
|
|
811
|
+
readonly mailbox_id: string;
|
|
812
|
+
readonly data: readonly MailboxForwarding[];
|
|
813
|
+
};
|
|
814
|
+
type CreateMailboxForwardingParams = {
|
|
815
|
+
readonly destination: string;
|
|
816
|
+
};
|
|
817
|
+
type CreateMailboxBaseParams = {
|
|
745
818
|
readonly domain_id: string;
|
|
746
819
|
readonly address: string;
|
|
747
820
|
readonly display_name?: string | undefined;
|
|
748
821
|
};
|
|
822
|
+
type CreateMailboxParams = CreateMailboxBaseParams & ({
|
|
823
|
+
readonly password: string;
|
|
824
|
+
readonly generate_password?: never;
|
|
825
|
+
} | {
|
|
826
|
+
readonly password?: never;
|
|
827
|
+
readonly generate_password: true;
|
|
828
|
+
});
|
|
749
829
|
type UpdateMailboxParams = {
|
|
750
830
|
readonly display_name?: string | null | undefined;
|
|
751
831
|
};
|
|
@@ -798,42 +878,16 @@ type UpdateMailboxRulesParams = {
|
|
|
798
878
|
readonly rules: readonly MailboxRule[];
|
|
799
879
|
};
|
|
800
880
|
|
|
801
|
-
declare class Mailboxes extends ApiResource {
|
|
802
|
-
create(params: CreateMailboxParams, options?: MethodOptions): Promise<Mailbox>;
|
|
803
|
-
list(params?: ListMailboxesParams, options?: MethodOptions): Promise<PaginatedResponse<Mailbox>>;
|
|
804
|
-
listAutoPaginating(params?: Omit<ListMailboxesParams, "cursor">): Page<Mailbox>;
|
|
805
|
-
get(id: string, options?: MethodOptions): Promise<Mailbox>;
|
|
806
|
-
update(id: string, params: UpdateMailboxParams, options?: MethodOptions): Promise<Mailbox>;
|
|
807
|
-
delete(id: string, options?: MethodOptions): Promise<void>;
|
|
808
|
-
listFolders(id: string, options?: MethodOptions): Promise<MailboxFolders>;
|
|
809
|
-
createFolder(id: string, params: CreateMailboxFolderParams, options?: MethodOptions): Promise<MailboxFolder>;
|
|
810
|
-
updateFolder(id: string, folderId: string, params: UpdateMailboxFolderParams, options?: MethodOptions): Promise<MailboxFolder>;
|
|
811
|
-
deleteFolder(id: string, folderId: string, options?: MethodOptions): Promise<void>;
|
|
812
|
-
listIdentities(id: string, options?: MethodOptions): Promise<MailboxIdentities>;
|
|
813
|
-
listInboxMessages(id: string, params?: ListInboxMessagesParams, options?: MethodOptions): Promise<InboxMessages>;
|
|
814
|
-
getInboxThread(id: string, threadId: string, options?: MethodOptions): Promise<InboxThread>;
|
|
815
|
-
updateInboxMessage(id: string, messageId: string, params: UpdateInboxMessageParams, options?: MethodOptions): Promise<InboxMessageAction>;
|
|
816
|
-
moveInboxMessage(id: string, messageId: string, params: MoveInboxMessageParams, options?: MethodOptions): Promise<InboxMessageAction>;
|
|
817
|
-
deleteInboxMessage(id: string, messageId: string, options?: MethodOptions): Promise<void>;
|
|
818
|
-
downloadInboxAttachment(id: string, params: DownloadInboxAttachmentParams, options?: MethodOptions): Promise<Uint8Array>;
|
|
819
|
-
resetPassword(id: string, params: ResetMailboxPasswordParams, options?: MethodOptions): Promise<Mailbox>;
|
|
820
|
-
getRules(id: string, options?: MethodOptions): Promise<MailboxRules>;
|
|
821
|
-
updateRules(id: string, params: UpdateMailboxRulesParams, options?: MethodOptions): Promise<MailboxRules>;
|
|
822
|
-
updateAutoReply(id: string, params: UpdateAutoReplyParams, options?: MethodOptions): Promise<Mailbox>;
|
|
823
|
-
updateSpamFilter(id: string, params: UpdateSpamFilterParams, options?: MethodOptions): Promise<Mailbox>;
|
|
824
|
-
createImport(id: string, params: CreateMailboxImportParams, options?: MethodOptions): Promise<MailboxImport>;
|
|
825
|
-
listImports(id: string, options?: MethodOptions): Promise<MailboxImports>;
|
|
826
|
-
getImport(id: string, importId: string, options?: MethodOptions): Promise<MailboxImport>;
|
|
827
|
-
cancelImport(id: string, importId: string, options?: MethodOptions): Promise<MailboxImport>;
|
|
828
|
-
undoImport(id: string, importId: string, options?: MethodOptions): Promise<MailboxImport>;
|
|
829
|
-
createImportUpload(id: string, params: CreateImportUploadParams, options?: MethodOptions): Promise<ImportUpload>;
|
|
830
|
-
}
|
|
831
|
-
|
|
832
881
|
type Message = {
|
|
833
882
|
readonly object: "message";
|
|
834
883
|
readonly id: string;
|
|
835
884
|
readonly mailbox_id: string;
|
|
836
885
|
readonly thread_id: string | null;
|
|
886
|
+
readonly source_rfc_message_id: string | null;
|
|
887
|
+
readonly delivered_rfc_message_id: string | null;
|
|
888
|
+
readonly client_reference: string | null;
|
|
889
|
+
readonly metadata: Readonly<Record<string, string | number | boolean | null>>;
|
|
890
|
+
readonly headers: readonly OutboundHeader[];
|
|
837
891
|
readonly subject: string | null;
|
|
838
892
|
readonly from_address: string | null;
|
|
839
893
|
readonly to_addresses: readonly {
|
|
@@ -854,6 +908,7 @@ type Message = {
|
|
|
854
908
|
readonly content_type: string;
|
|
855
909
|
}[] | null;
|
|
856
910
|
readonly source: MessageSource;
|
|
911
|
+
readonly mode: DataMode;
|
|
857
912
|
readonly status: MessageStatus;
|
|
858
913
|
readonly scheduled_at: string | null;
|
|
859
914
|
readonly created_at: string;
|
|
@@ -864,6 +919,11 @@ type Attachment = {
|
|
|
864
919
|
readonly content: string;
|
|
865
920
|
readonly content_type?: string | undefined;
|
|
866
921
|
};
|
|
922
|
+
type OutboundHeader = {
|
|
923
|
+
readonly name: string;
|
|
924
|
+
readonly value: string;
|
|
925
|
+
};
|
|
926
|
+
type MessageMetadata = Readonly<Record<string, string | number | boolean | null>>;
|
|
867
927
|
type SendMessageParams = {
|
|
868
928
|
readonly mailbox_id?: string | undefined;
|
|
869
929
|
readonly from?: string | undefined;
|
|
@@ -877,18 +937,84 @@ type SendMessageParams = {
|
|
|
877
937
|
readonly in_reply_to?: string | undefined;
|
|
878
938
|
readonly references?: readonly string[] | undefined;
|
|
879
939
|
readonly attachments?: readonly Attachment[] | undefined;
|
|
940
|
+
readonly client_reference?: string | undefined;
|
|
941
|
+
readonly metadata?: MessageMetadata | undefined;
|
|
942
|
+
readonly source_rfc_message_id?: string | undefined;
|
|
943
|
+
readonly headers?: readonly OutboundHeader[] | undefined;
|
|
880
944
|
readonly scheduled_at?: string | undefined;
|
|
945
|
+
readonly sandbox_outcome?: SandboxOutcome | undefined;
|
|
881
946
|
};
|
|
882
|
-
type ListMessagesParams = PaginationParams & {
|
|
947
|
+
type ListMessagesParams = PaginationParams & ({
|
|
883
948
|
readonly mailbox_id: string;
|
|
884
|
-
|
|
949
|
+
readonly client_reference?: string | undefined;
|
|
950
|
+
} | {
|
|
951
|
+
readonly mailbox_id?: string | undefined;
|
|
952
|
+
readonly client_reference: string;
|
|
953
|
+
});
|
|
885
954
|
type ReplyToMessageParams = {
|
|
886
955
|
readonly html?: string | undefined;
|
|
887
956
|
readonly text?: string | undefined;
|
|
888
957
|
readonly to: readonly EmailRecipientInput[];
|
|
889
958
|
readonly cc?: readonly EmailRecipientInput[] | undefined;
|
|
959
|
+
readonly client_reference?: string | undefined;
|
|
960
|
+
readonly metadata?: MessageMetadata | undefined;
|
|
961
|
+
readonly source_rfc_message_id?: string | undefined;
|
|
962
|
+
readonly headers?: readonly OutboundHeader[] | undefined;
|
|
890
963
|
readonly scheduled_at?: string | undefined;
|
|
964
|
+
readonly sandbox_outcome?: SandboxOutcome | undefined;
|
|
891
965
|
};
|
|
966
|
+
type InjectSandboxInboundParams = {
|
|
967
|
+
readonly from: EmailRecipientInput;
|
|
968
|
+
readonly to?: readonly EmailRecipientInput[] | undefined;
|
|
969
|
+
readonly cc?: readonly EmailRecipientInput[] | undefined;
|
|
970
|
+
readonly subject: string;
|
|
971
|
+
readonly text?: string | undefined;
|
|
972
|
+
readonly html?: string | undefined;
|
|
973
|
+
readonly message_id?: string | undefined;
|
|
974
|
+
readonly in_reply_to?: string | undefined;
|
|
975
|
+
readonly references?: readonly string[] | undefined;
|
|
976
|
+
readonly received_at?: string | undefined;
|
|
977
|
+
readonly headers?: readonly OutboundHeader[] | undefined;
|
|
978
|
+
};
|
|
979
|
+
|
|
980
|
+
declare class Mailboxes extends ApiResource {
|
|
981
|
+
injectSandboxInbound(id: string, params: InjectSandboxInboundParams, options?: MethodOptions): Promise<Message>;
|
|
982
|
+
create(params: CreateMailboxParams, options?: MethodOptions): Promise<Mailbox>;
|
|
983
|
+
list(params?: ListMailboxesParams, options?: MethodOptions): Promise<PaginatedResponse<Mailbox>>;
|
|
984
|
+
listAutoPaginating(params?: Omit<ListMailboxesParams, "cursor">): Page<Mailbox>;
|
|
985
|
+
get(id: string, options?: MethodOptions): Promise<Mailbox>;
|
|
986
|
+
update(id: string, params: UpdateMailboxParams, options?: MethodOptions): Promise<Mailbox>;
|
|
987
|
+
delete(id: string, options?: MethodOptions): Promise<void>;
|
|
988
|
+
suspend(id: string, options?: MethodOptions): Promise<Mailbox>;
|
|
989
|
+
resume(id: string, options?: MethodOptions): Promise<Mailbox>;
|
|
990
|
+
createExport(id: string, options?: MethodOptions): Promise<MailboxExport>;
|
|
991
|
+
getExport(id: string, exportId: string, options?: MethodOptions): Promise<MailboxExport>;
|
|
992
|
+
listFolders(id: string, options?: MethodOptions): Promise<MailboxFolders>;
|
|
993
|
+
createFolder(id: string, params: CreateMailboxFolderParams, options?: MethodOptions): Promise<MailboxFolder>;
|
|
994
|
+
updateFolder(id: string, folderId: string, params: UpdateMailboxFolderParams, options?: MethodOptions): Promise<MailboxFolder>;
|
|
995
|
+
deleteFolder(id: string, folderId: string, options?: MethodOptions): Promise<void>;
|
|
996
|
+
listIdentities(id: string, options?: MethodOptions): Promise<MailboxIdentities>;
|
|
997
|
+
listInboxMessages(id: string, params?: ListInboxMessagesParams, options?: MethodOptions): Promise<InboxMessages>;
|
|
998
|
+
getInboxThread(id: string, threadId: string, options?: MethodOptions): Promise<InboxThread>;
|
|
999
|
+
updateInboxMessage(id: string, messageId: string, params: UpdateInboxMessageParams, options?: MethodOptions): Promise<InboxMessageAction>;
|
|
1000
|
+
moveInboxMessage(id: string, messageId: string, params: MoveInboxMessageParams, options?: MethodOptions): Promise<InboxMessageAction>;
|
|
1001
|
+
deleteInboxMessage(id: string, messageId: string, options?: MethodOptions): Promise<void>;
|
|
1002
|
+
downloadInboxAttachment(id: string, params: DownloadInboxAttachmentParams, options?: MethodOptions): Promise<Uint8Array>;
|
|
1003
|
+
resetPassword(id: string, params: ResetMailboxPasswordParams, options?: MethodOptions): Promise<Mailbox>;
|
|
1004
|
+
getRules(id: string, options?: MethodOptions): Promise<MailboxRules>;
|
|
1005
|
+
updateRules(id: string, params: UpdateMailboxRulesParams, options?: MethodOptions): Promise<MailboxRules>;
|
|
1006
|
+
listForwarding(id: string, options?: MethodOptions): Promise<MailboxForwardingList>;
|
|
1007
|
+
createForwarding(id: string, params: CreateMailboxForwardingParams, options?: MethodOptions): Promise<MailboxForwarding>;
|
|
1008
|
+
deleteForwarding(id: string, forwardingId: string, options?: MethodOptions): Promise<void>;
|
|
1009
|
+
updateAutoReply(id: string, params: UpdateAutoReplyParams, options?: MethodOptions): Promise<Mailbox>;
|
|
1010
|
+
updateSpamFilter(id: string, params: UpdateSpamFilterParams, options?: MethodOptions): Promise<Mailbox>;
|
|
1011
|
+
createImport(id: string, params: CreateMailboxImportParams, options?: MethodOptions): Promise<MailboxImport>;
|
|
1012
|
+
listImports(id: string, options?: MethodOptions): Promise<MailboxImports>;
|
|
1013
|
+
getImport(id: string, importId: string, options?: MethodOptions): Promise<MailboxImport>;
|
|
1014
|
+
cancelImport(id: string, importId: string, options?: MethodOptions): Promise<MailboxImport>;
|
|
1015
|
+
undoImport(id: string, importId: string, options?: MethodOptions): Promise<MailboxImport>;
|
|
1016
|
+
createImportUpload(id: string, params: CreateImportUploadParams, options?: MethodOptions): Promise<ImportUpload>;
|
|
1017
|
+
}
|
|
892
1018
|
|
|
893
1019
|
declare class Messages extends ApiResource {
|
|
894
1020
|
send(params: SendMessageParams, options?: MethodOptions): Promise<Message>;
|
|
@@ -1231,6 +1357,80 @@ declare class Newsletters extends ApiResource {
|
|
|
1231
1357
|
resume(id: string, options?: MethodOptions): Promise<Newsletter>;
|
|
1232
1358
|
}
|
|
1233
1359
|
|
|
1360
|
+
type PartnerOrganizationStatus = "pending_owner" | "active" | "suspended" | "offboarding" | "disconnected";
|
|
1361
|
+
type PartnerDataClassification = "internal_test" | "customer";
|
|
1362
|
+
type PartnerOrganization = {
|
|
1363
|
+
readonly object: "partner_organization";
|
|
1364
|
+
readonly id: string;
|
|
1365
|
+
readonly organization_id: string;
|
|
1366
|
+
readonly name: string;
|
|
1367
|
+
readonly external_reference: string;
|
|
1368
|
+
readonly owner_email: string;
|
|
1369
|
+
readonly owner_user_id: string | null;
|
|
1370
|
+
readonly status: PartnerOrganizationStatus;
|
|
1371
|
+
readonly data_classification: PartnerDataClassification;
|
|
1372
|
+
readonly mailbox_limit: number;
|
|
1373
|
+
readonly delegated_permissions: readonly string[];
|
|
1374
|
+
readonly owner_accepted_at: string | null;
|
|
1375
|
+
readonly activated_at: string | null;
|
|
1376
|
+
readonly suspended_at: string | null;
|
|
1377
|
+
readonly disconnected_at: string | null;
|
|
1378
|
+
readonly created_at: string;
|
|
1379
|
+
readonly updated_at: string;
|
|
1380
|
+
};
|
|
1381
|
+
type CreatePartnerOrganizationParams = {
|
|
1382
|
+
readonly name: string;
|
|
1383
|
+
readonly external_reference: string;
|
|
1384
|
+
readonly owner_email: string;
|
|
1385
|
+
readonly mailbox_limit: number;
|
|
1386
|
+
readonly data_classification: PartnerDataClassification;
|
|
1387
|
+
};
|
|
1388
|
+
type UpdatePartnerOrganizationParams = {
|
|
1389
|
+
readonly name?: string | undefined;
|
|
1390
|
+
readonly mailbox_limit?: number | undefined;
|
|
1391
|
+
};
|
|
1392
|
+
type PartnerOrganizationList = {
|
|
1393
|
+
readonly data: readonly PartnerOrganization[];
|
|
1394
|
+
};
|
|
1395
|
+
type PartnerOwnershipInvitation = {
|
|
1396
|
+
readonly object: "partner_ownership_invitation";
|
|
1397
|
+
readonly owner_email: string;
|
|
1398
|
+
readonly email_sent: boolean;
|
|
1399
|
+
readonly expires_at: string;
|
|
1400
|
+
};
|
|
1401
|
+
type CreatedPartnerOrganization = PartnerOrganization & {
|
|
1402
|
+
readonly ownership_invitation: PartnerOwnershipInvitation | null;
|
|
1403
|
+
};
|
|
1404
|
+
type PartnerUsage = {
|
|
1405
|
+
readonly object: "partner_usage";
|
|
1406
|
+
readonly period_start: string;
|
|
1407
|
+
readonly period_end: string;
|
|
1408
|
+
readonly closed_through: string | null;
|
|
1409
|
+
readonly active_children: number;
|
|
1410
|
+
readonly active_mailboxes: number;
|
|
1411
|
+
readonly child_active_seconds: number;
|
|
1412
|
+
readonly mailbox_active_seconds: number;
|
|
1413
|
+
readonly child_subtotal: number;
|
|
1414
|
+
readonly mailbox_subtotal: number;
|
|
1415
|
+
readonly minimum_shortfall: number;
|
|
1416
|
+
readonly projected_total: number;
|
|
1417
|
+
readonly currency: string;
|
|
1418
|
+
};
|
|
1419
|
+
|
|
1420
|
+
declare class Partner extends ApiResource {
|
|
1421
|
+
listOrganizations(options?: MethodOptions): Promise<PartnerOrganizationList>;
|
|
1422
|
+
createOrganization(params: CreatePartnerOrganizationParams, options?: MethodOptions): Promise<CreatedPartnerOrganization>;
|
|
1423
|
+
getOrganization(id: string, options?: MethodOptions): Promise<PartnerOrganization>;
|
|
1424
|
+
updateOrganization(id: string, params: UpdatePartnerOrganizationParams, options?: MethodOptions): Promise<PartnerOrganization>;
|
|
1425
|
+
resendOwnershipInvitation(id: string, params?: {
|
|
1426
|
+
readonly owner_email?: string | undefined;
|
|
1427
|
+
}, options?: MethodOptions): Promise<PartnerOwnershipInvitation>;
|
|
1428
|
+
suspendOrganization(id: string, options?: MethodOptions): Promise<PartnerOrganization>;
|
|
1429
|
+
resumeOrganization(id: string, options?: MethodOptions): Promise<PartnerOrganization>;
|
|
1430
|
+
offboardOrganization(id: string, options?: MethodOptions): Promise<PartnerOrganization>;
|
|
1431
|
+
usage(options?: MethodOptions): Promise<PartnerUsage>;
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1234
1434
|
declare class Status extends ApiResource {
|
|
1235
1435
|
get(options?: MethodOptions): Promise<StatusResponse>;
|
|
1236
1436
|
}
|
|
@@ -1272,6 +1472,7 @@ type ReplyToThreadParams = {
|
|
|
1272
1472
|
readonly to?: readonly EmailRecipientInput[] | undefined;
|
|
1273
1473
|
readonly cc?: readonly EmailRecipientInput[] | undefined;
|
|
1274
1474
|
readonly scheduled_at?: string | undefined;
|
|
1475
|
+
readonly sandbox_outcome?: SandboxOutcome | undefined;
|
|
1275
1476
|
};
|
|
1276
1477
|
|
|
1277
1478
|
declare class Threads extends ApiResource {
|
|
@@ -1317,7 +1518,8 @@ type WebhookDelivery = {
|
|
|
1317
1518
|
readonly object: "webhook_delivery";
|
|
1318
1519
|
readonly id: string;
|
|
1319
1520
|
readonly event_id: string;
|
|
1320
|
-
readonly event_type:
|
|
1521
|
+
readonly event_type: WebhookDeliveryEventType;
|
|
1522
|
+
readonly mode: DataMode;
|
|
1321
1523
|
readonly status: WebhookDeliveryStatus;
|
|
1322
1524
|
readonly attempts: number;
|
|
1323
1525
|
readonly last_status_code: number | null;
|
|
@@ -1325,14 +1527,21 @@ type WebhookDelivery = {
|
|
|
1325
1527
|
readonly created_at: string;
|
|
1326
1528
|
readonly delivered_at: string | null;
|
|
1327
1529
|
};
|
|
1530
|
+
type WebhookDeliveryDetail = WebhookDelivery & {
|
|
1531
|
+
readonly payload: unknown;
|
|
1532
|
+
readonly next_attempt_at: string | null;
|
|
1533
|
+
readonly replayed_from_delivery_id: string | null;
|
|
1534
|
+
};
|
|
1328
1535
|
type ListDeliveriesParams = PaginationParams & {
|
|
1329
1536
|
readonly status?: string | undefined;
|
|
1330
1537
|
readonly event_type?: string | undefined;
|
|
1331
1538
|
};
|
|
1332
1539
|
type WebhookEvent<T = unknown> = {
|
|
1540
|
+
readonly version: "2026-07-12";
|
|
1333
1541
|
readonly event_id: string;
|
|
1334
1542
|
readonly event_type: WebhookEventType;
|
|
1335
1543
|
readonly created_at: string;
|
|
1544
|
+
readonly test: boolean;
|
|
1336
1545
|
readonly data: T;
|
|
1337
1546
|
};
|
|
1338
1547
|
|
|
@@ -1347,6 +1556,8 @@ declare class Webhooks extends ApiResource {
|
|
|
1347
1556
|
test(id: string, options?: MethodOptions): Promise<TestWebhookResponse>;
|
|
1348
1557
|
listDeliveries(id: string, params?: ListDeliveriesParams, options?: MethodOptions): Promise<PaginatedResponse<WebhookDelivery>>;
|
|
1349
1558
|
listDeliveriesAutoPaginating(id: string, params?: Omit<ListDeliveriesParams, "cursor">): Page<WebhookDelivery>;
|
|
1559
|
+
getDelivery(id: string, deliveryId: string, options?: MethodOptions): Promise<WebhookDeliveryDetail>;
|
|
1560
|
+
replayDelivery(id: string, deliveryId: string, options?: MethodOptions): Promise<WebhookDeliveryDetail>;
|
|
1350
1561
|
}
|
|
1351
1562
|
|
|
1352
1563
|
type RequestOptions = {
|
|
@@ -1368,6 +1579,7 @@ declare class ShipMailClient {
|
|
|
1368
1579
|
private readonly timeout;
|
|
1369
1580
|
private readonly fetchFn;
|
|
1370
1581
|
private readonly defaultHeaders;
|
|
1582
|
+
private readonly organizationId;
|
|
1371
1583
|
readonly audiences: Audiences;
|
|
1372
1584
|
readonly bookingPages: BookingPages;
|
|
1373
1585
|
readonly calendar: Calendar;
|
|
@@ -1375,6 +1587,7 @@ declare class ShipMailClient {
|
|
|
1375
1587
|
readonly mailboxes: Mailboxes;
|
|
1376
1588
|
readonly messages: Messages;
|
|
1377
1589
|
readonly newsletters: Newsletters;
|
|
1590
|
+
readonly partner: Partner;
|
|
1378
1591
|
readonly suppressions: Suppressions;
|
|
1379
1592
|
readonly threads: Threads;
|
|
1380
1593
|
readonly webhooks: Webhooks;
|
|
@@ -1463,4 +1676,4 @@ declare function verifyWebhook(body: string, headers: WebhookHeaders | Headers,
|
|
|
1463
1676
|
readonly toleranceInSeconds?: number | undefined;
|
|
1464
1677
|
}): Promise<WebhookEvent>;
|
|
1465
1678
|
|
|
1466
|
-
export { type AddSubscriberParams, type AddSubscribersBatchParams, type AddSubscribersBatchResult, type ApiErrorBody, type Audience, AuthenticationError, AuthorizationError, type BookingPage, type CalendarAvailability, type CalendarAvailabilityParams, type CalendarAvailabilitySlot, type CalendarEvent, type CalendarEventPrivacy, type CalendarEventStatus, type CalendarFreeBusyStatus, ConflictError, ConnectionError, type CreateAudienceParams, type CreateBookingPageParams, type CreateCalendarEventParams, type CreateDomainParams, type CreateMailboxFolderParams, type CreateMailboxParams, type CreateNewsletterFromChangelogParams, type CreateNewsletterParams, type CreateWebhookParams, DOMAIN_STATUSES, type DeleteCalendarEventParams, type Domain, type DomainRegistrationInfo, type DomainSearchResult, type DomainStatus, type DomainVerificationResult, type DownloadInboxAttachmentParams, type EmailRecipient, type EmailRecipientInput, type ErrorType, type GetCalendarEventParams, type GetThreadParams, type InboxAttachment, type InboxBodyPart, type InboxBodyValue, type InboxEmailHeader, type InboxFullMessage, type InboxKeyword, type InboxMessage, type InboxMessageAction, type InboxMessages, type InboxThread, InternalServerError, type ListAudiencesParams, type ListBookingPagesParams, type ListCalendarEventsParams, type ListDeliveriesParams, type ListDomainsParams, type ListInboxMessagesParams, type ListMailboxesParams, type ListMessagesParams, type ListNewsletterAssetsParams, type ListNewsletterDomainsParams, type ListNewslettersParams, type ListSubscribersParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MESSAGE_SOURCES, MESSAGE_STATUSES, type Mailbox, type MailboxFolder, type MailboxFolders, type MailboxIdentities, type MailboxIdentity, type MailboxRule, type MailboxRuleAction, type MailboxRuleCondition, type MailboxRuleFolder, type MailboxRuleMatchMode, type MailboxRuleMoveTarget, type MailboxRules, type MergeFields, type Message, type MessageSource, type MessageStatus, type MethodOptions, type MoveInboxMessageParams, type Newsletter, type NewsletterArchiveVisibility, type NewsletterAsset, type NewsletterAssetKind, type NewsletterAssetListResponse, type NewsletterAssetStorageUsage, type NewsletterBlock, type NewsletterButtonAlign, type NewsletterCalloutVariant, type NewsletterChangelogEntry, type NewsletterChangelogMedia, type NewsletterChangelogTone, type NewsletterColumnContent, type NewsletterColumnRatio, type NewsletterCountedUrl, type NewsletterDomain, type NewsletterDomainRecordStatus, type NewsletterDomainStatus, type NewsletterPreflight, type NewsletterPreflightItem, type NewsletterPreflightItemStatus, type NewsletterPreflightStatus, type NewsletterPreview, type NewsletterStatus, type NewsletterTestSend, type NewsletterTestSendStatus, type NewsletterUrlBreakdown, type NewsletterUrlSource, NotFoundError, Page, type PaginatedResponse, type PaginationParams, QuotaExceededError, RateLimitError, type Recurrence, type RecurrenceFrequency, type RecurrenceNDay, type RegisterDomainParams, type RegisterNewsletterAssetFromUrlParams, type RegistrationContact, type Reminder, type ReplyToMessageParams, type ReplyToThreadParams, type RequestOptions, type ResetMailboxPasswordParams, type RotateSecretResponse, type ScheduleNewsletterParams, type SearchDomainsParams, type SendMessageParams, type SendNewsletterTestParams, ShipMailClient, type ShipMailConfig, ShipMailError, type StatusResponse, type Subscriber, type SubscriberOutcome, type SubscriberResult, type SubscriberStatus, type Suppression, type TestWebhookResponse, type Thread, type UpdateAudienceParams, type UpdateAutoReplyParams, type UpdateBookingPageParams, type UpdateCalendarEventParams, type UpdateDomainParams, type UpdateInboxMessageParams, type UpdateMailboxFolderParams, type UpdateMailboxParams, type UpdateMailboxRulesParams, type UpdateNewsletterParams, type UpdateSpamFilterParams, type UpdateSubscriberParams, type UpdateWebhookParams, type UploadNewsletterAssetParams, ValidationError, WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, type Webhook, type WebhookDelivery, type WebhookDeliveryStatus, type WebhookEvent, type WebhookEventType, WebhookVerificationError, type WebhookWithSecret, type Weekday, ShipMailClient as default, verifyWebhook };
|
|
1679
|
+
export { type AddSubscriberParams, type AddSubscribersBatchParams, type AddSubscribersBatchResult, type ApiErrorBody, type Audience, AuthenticationError, AuthorizationError, type BookingPage, CONFERENCING_PROVIDER_IDS, type CalendarAvailability, type CalendarAvailabilityParams, type CalendarAvailabilitySlot, type CalendarEvent, type CalendarEventPrivacy, type CalendarEventStatus, type CalendarFreeBusyStatus, type ConferencingProviderId, ConflictError, ConnectionError, type CreateAudienceParams, type CreateBookingPageParams, type CreateCalendarEventParams, type CreateDomainParams, type CreateMailboxFolderParams, type CreateMailboxParams, type CreateNewsletterFromChangelogParams, type CreateNewsletterParams, type CreatePartnerOrganizationParams, type CreateWebhookParams, type CreatedPartnerOrganization, DOMAIN_STATUSES, type DataMode, type DeleteCalendarEventParams, type Domain, type DomainDnsRecord, type DomainDnsRecordKey, type DomainDnsRecordSet, type DomainDnsRecordStatus, type DomainRegistrationInfo, type DomainSearchResult, type DomainStatus, type DomainVerificationResult, type DownloadInboxAttachmentParams, type EmailRecipient, type EmailRecipientInput, type ErrorType, type GetCalendarEventParams, type GetThreadParams, type InboxAttachment, type InboxBodyPart, type InboxBodyValue, type InboxEmailHeader, type InboxFullMessage, type InboxKeyword, type InboxMessage, type InboxMessageAction, type InboxMessages, type InboxThread, type InjectSandboxInboundParams, InternalServerError, type ListAudiencesParams, type ListBookingPagesParams, type ListCalendarEventsParams, type ListDeliveriesParams, type ListDomainsParams, type ListInboxMessagesParams, type ListMailboxesParams, type ListMessagesParams, type ListNewsletterAssetsParams, type ListNewsletterDomainsParams, type ListNewslettersParams, type ListSubscribersParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MESSAGE_SOURCES, MESSAGE_STATUSES, type Mailbox, type MailboxExport, type MailboxExportErrorCode, type MailboxExportStatus, type MailboxFolder, type MailboxFolders, type MailboxIdentities, type MailboxIdentity, type MailboxRule, type MailboxRuleAction, type MailboxRuleCondition, type MailboxRuleFolder, type MailboxRuleMatchMode, type MailboxRuleMoveTarget, type MailboxRules, type MergeFields, type Message, type MessageMetadata, type MessageSource, type MessageStatus, type MethodOptions, type MoveInboxMessageParams, type Newsletter, type NewsletterArchiveVisibility, type NewsletterAsset, type NewsletterAssetKind, type NewsletterAssetListResponse, type NewsletterAssetStorageUsage, type NewsletterBlock, type NewsletterButtonAlign, type NewsletterCalloutVariant, type NewsletterChangelogEntry, type NewsletterChangelogMedia, type NewsletterChangelogTone, type NewsletterColumnContent, type NewsletterColumnRatio, type NewsletterCountedUrl, type NewsletterDomain, type NewsletterDomainRecordStatus, type NewsletterDomainStatus, type NewsletterPreflight, type NewsletterPreflightItem, type NewsletterPreflightItemStatus, type NewsletterPreflightStatus, type NewsletterPreview, type NewsletterStatus, type NewsletterTestSend, type NewsletterTestSendStatus, type NewsletterUrlBreakdown, type NewsletterUrlSource, NotFoundError, type OutboundHeader, Page, type PaginatedResponse, type PaginationParams, type PartnerDataClassification, type PartnerOrganization, type PartnerOrganizationList, type PartnerOrganizationStatus, type PartnerOwnershipInvitation, type PartnerUsage, QuotaExceededError, RateLimitError, type Recurrence, type RecurrenceFrequency, type RecurrenceNDay, type RegisterDomainParams, type RegisterNewsletterAssetFromUrlParams, type RegistrationContact, type Reminder, type ReplyToMessageParams, type ReplyToThreadParams, type RequestOptions, type ResetMailboxPasswordParams, type RotateSecretResponse, type SandboxOutcome, type ScheduleNewsletterParams, type SearchDomainsParams, type SendMessageParams, type SendNewsletterTestParams, ShipMailClient, type ShipMailConfig, ShipMailError, type StatusResponse, type Subscriber, type SubscriberOutcome, type SubscriberResult, type SubscriberStatus, type Suppression, type TestWebhookResponse, type Thread, type UpdateAudienceParams, type UpdateAutoReplyParams, type UpdateBookingPageParams, type UpdateCalendarEventParams, type UpdateDomainParams, type UpdateInboxMessageParams, type UpdateMailboxFolderParams, type UpdateMailboxParams, type UpdateMailboxRulesParams, type UpdateNewsletterParams, type UpdatePartnerOrganizationParams, type UpdateSpamFilterParams, type UpdateSubscriberParams, type UpdateWebhookParams, type UploadNewsletterAssetParams, ValidationError, WEBHOOK_DELIVERY_EVENT_TYPES, WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, type Webhook, type WebhookDelivery, type WebhookDeliveryDetail, type WebhookDeliveryEventType, type WebhookDeliveryStatus, type WebhookEvent, type WebhookEventType, WebhookVerificationError, type WebhookWithSecret, type Weekday, ShipMailClient as default, verifyWebhook };
|