shipmail 0.1.31 → 0.1.32

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/dist/index.d.ts CHANGED
@@ -31,6 +31,8 @@ type PaginatedResponse<T> = {
31
31
  readonly limit: number;
32
32
  };
33
33
  };
34
+ type DataMode = "live" | "test";
35
+ type SandboxOutcome = "delivered" | "bounced" | "complained";
34
36
  type ErrorType = "validation_error" | "authentication_error" | "authorization_error" | "quota_exceeded" | "not_found" | "rate_limit_error" | "conflict" | "internal_error";
35
37
  type ApiErrorBody = {
36
38
  readonly error: {
@@ -50,8 +52,10 @@ type EmailRecipient = {
50
52
  readonly name?: string | null | undefined;
51
53
  };
52
54
  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"];
55
+ 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
56
  type WebhookEventType = (typeof WEBHOOK_EVENT_TYPES)[number];
57
+ 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"];
58
+ type WebhookDeliveryEventType = (typeof WEBHOOK_DELIVERY_EVENT_TYPES)[number];
55
59
  type StatusResponse = {
56
60
  readonly status: string;
57
61
  readonly version: string;
@@ -414,6 +418,26 @@ type DomainVerificationResult = {
414
418
  readonly dmarc_record_value: string | null;
415
419
  readonly dmarc_managed_externally: boolean;
416
420
  };
421
+ type DomainDnsRecordKey = "mx" | "spf" | "mail_from_mx" | "mail_from_spf" | "dkim" | "dmarc";
422
+ type DomainDnsRecordStatus = "verified" | "not_found" | "mismatch" | "pending";
423
+ type DomainDnsRecord = {
424
+ readonly key: DomainDnsRecordKey;
425
+ readonly type: "MX" | "TXT";
426
+ readonly host: string;
427
+ readonly value: string | null;
428
+ readonly priority: number | null;
429
+ readonly ttl: number;
430
+ readonly status: DomainDnsRecordStatus;
431
+ readonly found_values: readonly string[];
432
+ };
433
+ type DomainDnsRecordSet = {
434
+ readonly object: "dns_record_set";
435
+ readonly domain_id: string;
436
+ readonly domain_name: string;
437
+ readonly all_verified: boolean;
438
+ readonly checked_at: string;
439
+ readonly records: readonly DomainDnsRecord[];
440
+ };
417
441
  type DomainSearchResult = {
418
442
  readonly domain_name: string;
419
443
  readonly available: boolean;
@@ -456,6 +480,7 @@ declare class Domains extends ApiResource {
456
480
  list(params?: ListDomainsParams, options?: MethodOptions): Promise<PaginatedResponse<Domain>>;
457
481
  listAutoPaginating(params?: Omit<ListDomainsParams, "cursor">): Page<Domain>;
458
482
  get(id: string, options?: MethodOptions): Promise<Domain>;
483
+ getDnsRecords(id: string, options?: MethodOptions): Promise<DomainDnsRecordSet>;
459
484
  update(id: string, params: UpdateDomainParams, options?: MethodOptions): Promise<Domain>;
460
485
  delete(id: string, options?: MethodOptions): Promise<void>;
461
486
  verify(id: string, options?: MethodOptions): Promise<DomainVerificationResult>;
@@ -566,6 +591,7 @@ type AutoReply = {
566
591
  readonly from_date: string | null;
567
592
  readonly to_date: string | null;
568
593
  };
594
+ type MailboxSuspensionReason = "billing" | "manual" | "security";
569
595
  type Mailbox = {
570
596
  readonly object: "mailbox";
571
597
  readonly id: string;
@@ -573,11 +599,32 @@ type Mailbox = {
573
599
  readonly address: string;
574
600
  readonly display_name: string | null;
575
601
  readonly suspended_at: string | null;
602
+ readonly suspension_reasons: readonly MailboxSuspensionReason[];
576
603
  readonly spam_filter_threshold: number;
577
604
  readonly auto_reply: AutoReply;
578
605
  readonly created_at: string;
579
606
  readonly updated_at: string;
580
607
  };
608
+ type MailboxExportStatus = "pending" | "processing" | "completed" | "failed" | "expired";
609
+ type MailboxExportErrorCode = "source_unavailable" | "snapshot_changed" | "export_failed";
610
+ type MailboxExport = {
611
+ readonly object: "mailbox_export";
612
+ readonly id: string;
613
+ readonly mailbox_id: string;
614
+ readonly status: MailboxExportStatus;
615
+ readonly format: "zip";
616
+ readonly format_version: number;
617
+ readonly file_size: number | null;
618
+ readonly message_count: number | null;
619
+ readonly folder_count: number | null;
620
+ readonly error_code: MailboxExportErrorCode | null;
621
+ readonly download_url: string | null;
622
+ readonly download_url_expires_at: string | null;
623
+ readonly expires_at: string | null;
624
+ readonly created_at: string;
625
+ readonly started_at: string | null;
626
+ readonly completed_at: string | null;
627
+ };
581
628
  type MailboxFolder = {
582
629
  readonly object: "mailbox_folder";
583
630
  readonly id: string;
@@ -741,9 +788,29 @@ type MailboxRules = {
741
788
  readonly rules: readonly MailboxRule[];
742
789
  readonly folders: readonly MailboxRuleFolder[];
743
790
  };
791
+ type MailboxForwarding = {
792
+ readonly object: "mailbox_forwarding";
793
+ readonly id: string;
794
+ readonly mailbox_id: string;
795
+ readonly destination: string;
796
+ readonly status: "pending" | "active";
797
+ readonly verification_sent_at: string | null;
798
+ readonly verified_at: string | null;
799
+ readonly created_at: string;
800
+ readonly updated_at: string;
801
+ };
802
+ type MailboxForwardingList = {
803
+ readonly object: "mailbox_forwarding_list";
804
+ readonly mailbox_id: string;
805
+ readonly data: readonly MailboxForwarding[];
806
+ };
807
+ type CreateMailboxForwardingParams = {
808
+ readonly destination: string;
809
+ };
744
810
  type CreateMailboxParams = {
745
811
  readonly domain_id: string;
746
812
  readonly address: string;
813
+ readonly password: string;
747
814
  readonly display_name?: string | undefined;
748
815
  };
749
816
  type UpdateMailboxParams = {
@@ -798,42 +865,16 @@ type UpdateMailboxRulesParams = {
798
865
  readonly rules: readonly MailboxRule[];
799
866
  };
800
867
 
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
868
  type Message = {
833
869
  readonly object: "message";
834
870
  readonly id: string;
835
871
  readonly mailbox_id: string;
836
872
  readonly thread_id: string | null;
873
+ readonly source_rfc_message_id: string | null;
874
+ readonly delivered_rfc_message_id: string | null;
875
+ readonly client_reference: string | null;
876
+ readonly metadata: Readonly<Record<string, string | number | boolean | null>>;
877
+ readonly headers: readonly OutboundHeader[];
837
878
  readonly subject: string | null;
838
879
  readonly from_address: string | null;
839
880
  readonly to_addresses: readonly {
@@ -854,6 +895,7 @@ type Message = {
854
895
  readonly content_type: string;
855
896
  }[] | null;
856
897
  readonly source: MessageSource;
898
+ readonly mode: DataMode;
857
899
  readonly status: MessageStatus;
858
900
  readonly scheduled_at: string | null;
859
901
  readonly created_at: string;
@@ -864,6 +906,11 @@ type Attachment = {
864
906
  readonly content: string;
865
907
  readonly content_type?: string | undefined;
866
908
  };
909
+ type OutboundHeader = {
910
+ readonly name: string;
911
+ readonly value: string;
912
+ };
913
+ type MessageMetadata = Readonly<Record<string, string | number | boolean | null>>;
867
914
  type SendMessageParams = {
868
915
  readonly mailbox_id?: string | undefined;
869
916
  readonly from?: string | undefined;
@@ -877,19 +924,85 @@ type SendMessageParams = {
877
924
  readonly in_reply_to?: string | undefined;
878
925
  readonly references?: readonly string[] | undefined;
879
926
  readonly attachments?: readonly Attachment[] | undefined;
927
+ readonly client_reference?: string | undefined;
928
+ readonly metadata?: MessageMetadata | undefined;
929
+ readonly source_rfc_message_id?: string | undefined;
930
+ readonly headers?: readonly OutboundHeader[] | undefined;
880
931
  readonly scheduled_at?: string | undefined;
932
+ readonly sandbox_outcome?: SandboxOutcome | undefined;
881
933
  };
882
- type ListMessagesParams = PaginationParams & {
934
+ type ListMessagesParams = PaginationParams & ({
883
935
  readonly mailbox_id: string;
884
- };
936
+ readonly client_reference?: string | undefined;
937
+ } | {
938
+ readonly mailbox_id?: string | undefined;
939
+ readonly client_reference: string;
940
+ });
885
941
  type ReplyToMessageParams = {
886
942
  readonly html?: string | undefined;
887
943
  readonly text?: string | undefined;
888
944
  readonly to: readonly EmailRecipientInput[];
889
945
  readonly cc?: readonly EmailRecipientInput[] | undefined;
946
+ readonly client_reference?: string | undefined;
947
+ readonly metadata?: MessageMetadata | undefined;
948
+ readonly source_rfc_message_id?: string | undefined;
949
+ readonly headers?: readonly OutboundHeader[] | undefined;
890
950
  readonly scheduled_at?: string | undefined;
951
+ readonly sandbox_outcome?: SandboxOutcome | undefined;
952
+ };
953
+ type InjectSandboxInboundParams = {
954
+ readonly from: EmailRecipientInput;
955
+ readonly to?: readonly EmailRecipientInput[] | undefined;
956
+ readonly cc?: readonly EmailRecipientInput[] | undefined;
957
+ readonly subject: string;
958
+ readonly text?: string | undefined;
959
+ readonly html?: string | undefined;
960
+ readonly message_id?: string | undefined;
961
+ readonly in_reply_to?: string | undefined;
962
+ readonly references?: readonly string[] | undefined;
963
+ readonly received_at?: string | undefined;
964
+ readonly headers?: readonly OutboundHeader[] | undefined;
891
965
  };
892
966
 
967
+ declare class Mailboxes extends ApiResource {
968
+ injectSandboxInbound(id: string, params: InjectSandboxInboundParams, options?: MethodOptions): Promise<Message>;
969
+ create(params: CreateMailboxParams, options?: MethodOptions): Promise<Mailbox>;
970
+ list(params?: ListMailboxesParams, options?: MethodOptions): Promise<PaginatedResponse<Mailbox>>;
971
+ listAutoPaginating(params?: Omit<ListMailboxesParams, "cursor">): Page<Mailbox>;
972
+ get(id: string, options?: MethodOptions): Promise<Mailbox>;
973
+ update(id: string, params: UpdateMailboxParams, options?: MethodOptions): Promise<Mailbox>;
974
+ delete(id: string, options?: MethodOptions): Promise<void>;
975
+ suspend(id: string, options?: MethodOptions): Promise<Mailbox>;
976
+ resume(id: string, options?: MethodOptions): Promise<Mailbox>;
977
+ createExport(id: string, options?: MethodOptions): Promise<MailboxExport>;
978
+ getExport(id: string, exportId: string, options?: MethodOptions): Promise<MailboxExport>;
979
+ listFolders(id: string, options?: MethodOptions): Promise<MailboxFolders>;
980
+ createFolder(id: string, params: CreateMailboxFolderParams, options?: MethodOptions): Promise<MailboxFolder>;
981
+ updateFolder(id: string, folderId: string, params: UpdateMailboxFolderParams, options?: MethodOptions): Promise<MailboxFolder>;
982
+ deleteFolder(id: string, folderId: string, options?: MethodOptions): Promise<void>;
983
+ listIdentities(id: string, options?: MethodOptions): Promise<MailboxIdentities>;
984
+ listInboxMessages(id: string, params?: ListInboxMessagesParams, options?: MethodOptions): Promise<InboxMessages>;
985
+ getInboxThread(id: string, threadId: string, options?: MethodOptions): Promise<InboxThread>;
986
+ updateInboxMessage(id: string, messageId: string, params: UpdateInboxMessageParams, options?: MethodOptions): Promise<InboxMessageAction>;
987
+ moveInboxMessage(id: string, messageId: string, params: MoveInboxMessageParams, options?: MethodOptions): Promise<InboxMessageAction>;
988
+ deleteInboxMessage(id: string, messageId: string, options?: MethodOptions): Promise<void>;
989
+ downloadInboxAttachment(id: string, params: DownloadInboxAttachmentParams, options?: MethodOptions): Promise<Uint8Array>;
990
+ resetPassword(id: string, params: ResetMailboxPasswordParams, options?: MethodOptions): Promise<Mailbox>;
991
+ getRules(id: string, options?: MethodOptions): Promise<MailboxRules>;
992
+ updateRules(id: string, params: UpdateMailboxRulesParams, options?: MethodOptions): Promise<MailboxRules>;
993
+ listForwarding(id: string, options?: MethodOptions): Promise<MailboxForwardingList>;
994
+ createForwarding(id: string, params: CreateMailboxForwardingParams, options?: MethodOptions): Promise<MailboxForwarding>;
995
+ deleteForwarding(id: string, forwardingId: string, options?: MethodOptions): Promise<void>;
996
+ updateAutoReply(id: string, params: UpdateAutoReplyParams, options?: MethodOptions): Promise<Mailbox>;
997
+ updateSpamFilter(id: string, params: UpdateSpamFilterParams, options?: MethodOptions): Promise<Mailbox>;
998
+ createImport(id: string, params: CreateMailboxImportParams, options?: MethodOptions): Promise<MailboxImport>;
999
+ listImports(id: string, options?: MethodOptions): Promise<MailboxImports>;
1000
+ getImport(id: string, importId: string, options?: MethodOptions): Promise<MailboxImport>;
1001
+ cancelImport(id: string, importId: string, options?: MethodOptions): Promise<MailboxImport>;
1002
+ undoImport(id: string, importId: string, options?: MethodOptions): Promise<MailboxImport>;
1003
+ createImportUpload(id: string, params: CreateImportUploadParams, options?: MethodOptions): Promise<ImportUpload>;
1004
+ }
1005
+
893
1006
  declare class Messages extends ApiResource {
894
1007
  send(params: SendMessageParams, options?: MethodOptions): Promise<Message>;
895
1008
  list(params: ListMessagesParams, options?: MethodOptions): Promise<PaginatedResponse<Message>>;
@@ -1272,6 +1385,7 @@ type ReplyToThreadParams = {
1272
1385
  readonly to?: readonly EmailRecipientInput[] | undefined;
1273
1386
  readonly cc?: readonly EmailRecipientInput[] | undefined;
1274
1387
  readonly scheduled_at?: string | undefined;
1388
+ readonly sandbox_outcome?: SandboxOutcome | undefined;
1275
1389
  };
1276
1390
 
1277
1391
  declare class Threads extends ApiResource {
@@ -1317,7 +1431,8 @@ type WebhookDelivery = {
1317
1431
  readonly object: "webhook_delivery";
1318
1432
  readonly id: string;
1319
1433
  readonly event_id: string;
1320
- readonly event_type: string;
1434
+ readonly event_type: WebhookDeliveryEventType;
1435
+ readonly mode: DataMode;
1321
1436
  readonly status: WebhookDeliveryStatus;
1322
1437
  readonly attempts: number;
1323
1438
  readonly last_status_code: number | null;
@@ -1325,14 +1440,21 @@ type WebhookDelivery = {
1325
1440
  readonly created_at: string;
1326
1441
  readonly delivered_at: string | null;
1327
1442
  };
1443
+ type WebhookDeliveryDetail = WebhookDelivery & {
1444
+ readonly payload: unknown;
1445
+ readonly next_attempt_at: string | null;
1446
+ readonly replayed_from_delivery_id: string | null;
1447
+ };
1328
1448
  type ListDeliveriesParams = PaginationParams & {
1329
1449
  readonly status?: string | undefined;
1330
1450
  readonly event_type?: string | undefined;
1331
1451
  };
1332
1452
  type WebhookEvent<T = unknown> = {
1453
+ readonly version: "2026-07-12";
1333
1454
  readonly event_id: string;
1334
1455
  readonly event_type: WebhookEventType;
1335
1456
  readonly created_at: string;
1457
+ readonly test: boolean;
1336
1458
  readonly data: T;
1337
1459
  };
1338
1460
 
@@ -1347,6 +1469,8 @@ declare class Webhooks extends ApiResource {
1347
1469
  test(id: string, options?: MethodOptions): Promise<TestWebhookResponse>;
1348
1470
  listDeliveries(id: string, params?: ListDeliveriesParams, options?: MethodOptions): Promise<PaginatedResponse<WebhookDelivery>>;
1349
1471
  listDeliveriesAutoPaginating(id: string, params?: Omit<ListDeliveriesParams, "cursor">): Page<WebhookDelivery>;
1472
+ getDelivery(id: string, deliveryId: string, options?: MethodOptions): Promise<WebhookDeliveryDetail>;
1473
+ replayDelivery(id: string, deliveryId: string, options?: MethodOptions): Promise<WebhookDeliveryDetail>;
1350
1474
  }
1351
1475
 
1352
1476
  type RequestOptions = {
@@ -1463,4 +1587,4 @@ declare function verifyWebhook(body: string, headers: WebhookHeaders | Headers,
1463
1587
  readonly toleranceInSeconds?: number | undefined;
1464
1588
  }): Promise<WebhookEvent>;
1465
1589
 
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 };
1590
+ 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 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, 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 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 };
package/dist/index.js CHANGED
@@ -442,6 +442,13 @@ var Domains = class extends ApiResource {
442
442
  methodOptions: options
443
443
  });
444
444
  }
445
+ getDnsRecords(id, options) {
446
+ return this.client.request({
447
+ method: "GET",
448
+ path: `/domains/${encodeURIComponent(id)}/dns-records`,
449
+ methodOptions: options
450
+ });
451
+ }
445
452
  update(id, params, options) {
446
453
  return this.client.request({
447
454
  method: "PATCH",
@@ -484,6 +491,14 @@ var Domains = class extends ApiResource {
484
491
 
485
492
  // src/resources/mailboxes.ts
486
493
  var Mailboxes = class extends ApiResource {
494
+ injectSandboxInbound(id, params, options) {
495
+ return this.client.request({
496
+ method: "POST",
497
+ path: `/mailboxes/${encodeURIComponent(id)}/sandbox/inbound`,
498
+ body: params,
499
+ methodOptions: options
500
+ });
501
+ }
487
502
  create(params, options) {
488
503
  return this.client.request({
489
504
  method: "POST",
@@ -532,6 +547,34 @@ var Mailboxes = class extends ApiResource {
532
547
  methodOptions: options
533
548
  });
534
549
  }
550
+ suspend(id, options) {
551
+ return this.client.request({
552
+ method: "POST",
553
+ path: `/mailboxes/${encodeURIComponent(id)}/suspend`,
554
+ methodOptions: options
555
+ });
556
+ }
557
+ resume(id, options) {
558
+ return this.client.request({
559
+ method: "POST",
560
+ path: `/mailboxes/${encodeURIComponent(id)}/resume`,
561
+ methodOptions: options
562
+ });
563
+ }
564
+ createExport(id, options) {
565
+ return this.client.request({
566
+ method: "POST",
567
+ path: `/mailboxes/${encodeURIComponent(id)}/exports`,
568
+ methodOptions: options
569
+ });
570
+ }
571
+ getExport(id, exportId, options) {
572
+ return this.client.request({
573
+ method: "GET",
574
+ path: `/mailboxes/${encodeURIComponent(id)}/exports/${encodeURIComponent(exportId)}`,
575
+ methodOptions: options
576
+ });
577
+ }
535
578
  listFolders(id, options) {
536
579
  return this.client.request({
537
580
  method: "GET",
@@ -649,6 +692,28 @@ var Mailboxes = class extends ApiResource {
649
692
  methodOptions: options
650
693
  });
651
694
  }
695
+ listForwarding(id, options) {
696
+ return this.client.request({
697
+ method: "GET",
698
+ path: `/mailboxes/${encodeURIComponent(id)}/forwarding`,
699
+ methodOptions: options
700
+ });
701
+ }
702
+ createForwarding(id, params, options) {
703
+ return this.client.request({
704
+ method: "POST",
705
+ path: `/mailboxes/${encodeURIComponent(id)}/forwarding`,
706
+ body: params,
707
+ methodOptions: options
708
+ });
709
+ }
710
+ deleteForwarding(id, forwardingId, options) {
711
+ return this.client.request({
712
+ method: "DELETE",
713
+ path: `/mailboxes/${encodeURIComponent(id)}/forwarding/${encodeURIComponent(forwardingId)}`,
714
+ methodOptions: options
715
+ });
716
+ }
652
717
  updateAutoReply(id, params, options) {
653
718
  return this.client.request({
654
719
  method: "PATCH",
@@ -727,6 +792,7 @@ var Messages = class extends ApiResource {
727
792
  path: "/messages",
728
793
  query: {
729
794
  mailbox_id: params.mailbox_id,
795
+ client_reference: params.client_reference,
730
796
  cursor: params.cursor,
731
797
  limit: params.limit
732
798
  },
@@ -736,6 +802,7 @@ var Messages = class extends ApiResource {
736
802
  listAutoPaginating(params) {
737
803
  return new Page(this.client, "/messages", {
738
804
  mailbox_id: params.mailbox_id,
805
+ client_reference: params.client_reference,
739
806
  limit: params.limit
740
807
  });
741
808
  }
@@ -1072,10 +1139,24 @@ var Webhooks = class extends ApiResource {
1072
1139
  }
1073
1140
  );
1074
1141
  }
1142
+ getDelivery(id, deliveryId, options) {
1143
+ return this.client.request({
1144
+ method: "GET",
1145
+ path: `/webhooks/${encodeURIComponent(id)}/deliveries/${encodeURIComponent(deliveryId)}`,
1146
+ methodOptions: options
1147
+ });
1148
+ }
1149
+ replayDelivery(id, deliveryId, options) {
1150
+ return this.client.request({
1151
+ method: "POST",
1152
+ path: `/webhooks/${encodeURIComponent(id)}/deliveries/${encodeURIComponent(deliveryId)}/replay`,
1153
+ methodOptions: options
1154
+ });
1155
+ }
1075
1156
  };
1076
1157
 
1077
1158
  // src/version.ts
1078
- var VERSION = "0.1.31";
1159
+ var VERSION = "0.1.32";
1079
1160
 
1080
1161
  // src/client.ts
1081
1162
  var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
@@ -1236,6 +1317,7 @@ var WEBHOOK_EVENT_TYPES = [
1236
1317
  "message.delivered",
1237
1318
  "message.bounced",
1238
1319
  "message.complained",
1320
+ "mailbox.rule_matched",
1239
1321
  "domain.verified",
1240
1322
  "domain.verification_failed",
1241
1323
  "domain.degraded",
@@ -1244,6 +1326,7 @@ var WEBHOOK_EVENT_TYPES = [
1244
1326
  "org.sending_suspended",
1245
1327
  "org.reputation_recovered"
1246
1328
  ];
1329
+ var WEBHOOK_DELIVERY_EVENT_TYPES = ["webhook.test", ...WEBHOOK_EVENT_TYPES];
1247
1330
  var DOMAIN_STATUSES = ["pending", "verifying", "verified", "degraded", "failed"];
1248
1331
  var MESSAGE_STATUSES = [
1249
1332
  "scheduled",
@@ -1307,6 +1390,6 @@ async function verifyWebhook(body, headers, secret, options) {
1307
1390
  return parsed;
1308
1391
  }
1309
1392
 
1310
- export { AuthenticationError, AuthorizationError, ConflictError, ConnectionError, DOMAIN_STATUSES, InternalServerError, MESSAGE_SOURCES, MESSAGE_STATUSES, NotFoundError, Page, QuotaExceededError, RateLimitError, ShipMailClient, ShipMailError, ValidationError, WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, WebhookVerificationError, ShipMailClient as default, verifyWebhook };
1393
+ export { AuthenticationError, AuthorizationError, ConflictError, ConnectionError, DOMAIN_STATUSES, InternalServerError, MESSAGE_SOURCES, MESSAGE_STATUSES, NotFoundError, Page, QuotaExceededError, RateLimitError, ShipMailClient, ShipMailError, ValidationError, WEBHOOK_DELIVERY_EVENT_TYPES, WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, WebhookVerificationError, ShipMailClient as default, verifyWebhook };
1311
1394
  //# sourceMappingURL=index.js.map
1312
1395
  //# sourceMappingURL=index.js.map