shipmail 0.1.30 → 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;
@@ -60,9 +64,9 @@ type StatusResponse = {
60
64
  };
61
65
  declare const DOMAIN_STATUSES: readonly ["pending", "verifying", "verified", "degraded", "failed"];
62
66
  type DomainStatus = (typeof DOMAIN_STATUSES)[number];
63
- declare const MESSAGE_STATUSES: readonly ["scheduled", "queued", "sent", "delivered", "bounced", "complained", "failed", "cancelled"];
67
+ declare const MESSAGE_STATUSES: readonly ["scheduled", "queued", "sent", "delivered", "bounced", "complained", "failed", "suppressed", "cancelled"];
64
68
  type MessageStatus = (typeof MESSAGE_STATUSES)[number];
65
- declare const MESSAGE_SOURCES: readonly ["api", "dashboard", "inbound", "smtp"];
69
+ declare const MESSAGE_SOURCES: readonly ["api", "newsletter", "dashboard", "inbound", "smtp"];
66
70
  type MessageSource = (typeof MESSAGE_SOURCES)[number];
67
71
  declare const WEBHOOK_DELIVERY_STATUSES: readonly ["pending", "delivered", "failed"];
68
72
  type WebhookDeliveryStatus = (typeof WEBHOOK_DELIVERY_STATUSES)[number];
@@ -74,7 +78,7 @@ type MethodOptions = {
74
78
  };
75
79
 
76
80
  type MergeFields = Record<string, string | number | boolean | null>;
77
- type SubscriberStatus = "subscribed" | "unsubscribed" | "bounced" | "complained" | "suppressed" | "transactional_only";
81
+ type SubscriberStatus = "subscribed" | "pending" | "unsubscribed" | "bounced" | "complained" | "suppressed" | "transactional_only";
78
82
  type SubscriberOutcome = "created" | "updated" | "skipped_not_mailable" | "skipped_invalid" | "skipped_cap" | "skipped_quota";
79
83
  type Audience = {
80
84
  readonly object: "audience";
@@ -241,6 +245,17 @@ type Recurrence = {
241
245
  type Reminder = {
242
246
  readonly minutes_before: number;
243
247
  };
248
+ type CalendarAttendeeInput = {
249
+ readonly email: string;
250
+ readonly name?: string | undefined;
251
+ };
252
+ type CalendarPerson = {
253
+ readonly email: string;
254
+ readonly name: string | null;
255
+ };
256
+ type CalendarAttendee = CalendarPerson & {
257
+ readonly status: "needs-action" | "accepted" | "declined" | "tentative";
258
+ };
244
259
  type CalendarEvent = {
245
260
  readonly object: "calendar_event";
246
261
  readonly id: string;
@@ -263,6 +278,8 @@ type CalendarEvent = {
263
278
  readonly recurrence: Recurrence | null;
264
279
  readonly recurrence_id: string | null;
265
280
  readonly reminders: readonly Reminder[];
281
+ readonly organizer: CalendarPerson | null;
282
+ readonly attendees: readonly CalendarAttendee[];
266
283
  readonly created_at: string | null;
267
284
  readonly updated_at: string | null;
268
285
  };
@@ -296,6 +313,7 @@ type CreateCalendarEventParams = {
296
313
  readonly privacy?: CalendarEventPrivacy | undefined;
297
314
  readonly recurrence?: Recurrence | undefined;
298
315
  readonly reminders?: readonly Reminder[] | undefined;
316
+ readonly attendees?: readonly CalendarAttendeeInput[] | undefined;
299
317
  };
300
318
  type UpdateCalendarEventParams = {
301
319
  readonly mailbox: string;
@@ -313,6 +331,7 @@ type UpdateCalendarEventParams = {
313
331
  readonly privacy?: CalendarEventPrivacy | undefined;
314
332
  readonly recurrence?: Recurrence | null | undefined;
315
333
  readonly reminders?: readonly Reminder[] | null | undefined;
334
+ readonly attendees?: readonly CalendarAttendeeInput[] | undefined;
316
335
  };
317
336
  type CalendarAvailabilitySlot = {
318
337
  readonly start: string;
@@ -360,7 +379,7 @@ type Domain = {
360
379
  readonly id: string;
361
380
  readonly name: string;
362
381
  readonly status: DomainStatus;
363
- readonly managed_by: "external" | "namecom";
382
+ readonly managed_by: "external" | "shipmail";
364
383
  readonly dns_provider: string | null;
365
384
  readonly mx_verified: boolean;
366
385
  readonly spf_verified: boolean;
@@ -399,6 +418,26 @@ type DomainVerificationResult = {
399
418
  readonly dmarc_record_value: string | null;
400
419
  readonly dmarc_managed_externally: boolean;
401
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
+ };
402
441
  type DomainSearchResult = {
403
442
  readonly domain_name: string;
404
443
  readonly available: boolean;
@@ -441,6 +480,7 @@ declare class Domains extends ApiResource {
441
480
  list(params?: ListDomainsParams, options?: MethodOptions): Promise<PaginatedResponse<Domain>>;
442
481
  listAutoPaginating(params?: Omit<ListDomainsParams, "cursor">): Page<Domain>;
443
482
  get(id: string, options?: MethodOptions): Promise<Domain>;
483
+ getDnsRecords(id: string, options?: MethodOptions): Promise<DomainDnsRecordSet>;
444
484
  update(id: string, params: UpdateDomainParams, options?: MethodOptions): Promise<Domain>;
445
485
  delete(id: string, options?: MethodOptions): Promise<void>;
446
486
  verify(id: string, options?: MethodOptions): Promise<DomainVerificationResult>;
@@ -551,6 +591,7 @@ type AutoReply = {
551
591
  readonly from_date: string | null;
552
592
  readonly to_date: string | null;
553
593
  };
594
+ type MailboxSuspensionReason = "billing" | "manual" | "security";
554
595
  type Mailbox = {
555
596
  readonly object: "mailbox";
556
597
  readonly id: string;
@@ -558,11 +599,32 @@ type Mailbox = {
558
599
  readonly address: string;
559
600
  readonly display_name: string | null;
560
601
  readonly suspended_at: string | null;
602
+ readonly suspension_reasons: readonly MailboxSuspensionReason[];
561
603
  readonly spam_filter_threshold: number;
562
604
  readonly auto_reply: AutoReply;
563
605
  readonly created_at: string;
564
606
  readonly updated_at: string;
565
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
+ };
566
628
  type MailboxFolder = {
567
629
  readonly object: "mailbox_folder";
568
630
  readonly id: string;
@@ -700,6 +762,7 @@ type MailboxRuleAction = {
700
762
  readonly type: "ai_draft_reply";
701
763
  readonly instructions: string;
702
764
  readonly reply_mode: "reply" | "reply_all";
765
+ readonly agent_policy: "observe_only" | "draft_for_review";
703
766
  };
704
767
  type MailboxRule = {
705
768
  readonly id: string;
@@ -725,9 +788,29 @@ type MailboxRules = {
725
788
  readonly rules: readonly MailboxRule[];
726
789
  readonly folders: readonly MailboxRuleFolder[];
727
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
+ };
728
810
  type CreateMailboxParams = {
729
811
  readonly domain_id: string;
730
812
  readonly address: string;
813
+ readonly password: string;
731
814
  readonly display_name?: string | undefined;
732
815
  };
733
816
  type UpdateMailboxParams = {
@@ -782,42 +865,16 @@ type UpdateMailboxRulesParams = {
782
865
  readonly rules: readonly MailboxRule[];
783
866
  };
784
867
 
785
- declare class Mailboxes extends ApiResource {
786
- create(params: CreateMailboxParams, options?: MethodOptions): Promise<Mailbox>;
787
- list(params?: ListMailboxesParams, options?: MethodOptions): Promise<PaginatedResponse<Mailbox>>;
788
- listAutoPaginating(params?: Omit<ListMailboxesParams, "cursor">): Page<Mailbox>;
789
- get(id: string, options?: MethodOptions): Promise<Mailbox>;
790
- update(id: string, params: UpdateMailboxParams, options?: MethodOptions): Promise<Mailbox>;
791
- delete(id: string, options?: MethodOptions): Promise<void>;
792
- listFolders(id: string, options?: MethodOptions): Promise<MailboxFolders>;
793
- createFolder(id: string, params: CreateMailboxFolderParams, options?: MethodOptions): Promise<MailboxFolder>;
794
- updateFolder(id: string, folderId: string, params: UpdateMailboxFolderParams, options?: MethodOptions): Promise<MailboxFolder>;
795
- deleteFolder(id: string, folderId: string, options?: MethodOptions): Promise<void>;
796
- listIdentities(id: string, options?: MethodOptions): Promise<MailboxIdentities>;
797
- listInboxMessages(id: string, params?: ListInboxMessagesParams, options?: MethodOptions): Promise<InboxMessages>;
798
- getInboxThread(id: string, threadId: string, options?: MethodOptions): Promise<InboxThread>;
799
- updateInboxMessage(id: string, messageId: string, params: UpdateInboxMessageParams, options?: MethodOptions): Promise<InboxMessageAction>;
800
- moveInboxMessage(id: string, messageId: string, params: MoveInboxMessageParams, options?: MethodOptions): Promise<InboxMessageAction>;
801
- deleteInboxMessage(id: string, messageId: string, options?: MethodOptions): Promise<void>;
802
- downloadInboxAttachment(id: string, params: DownloadInboxAttachmentParams, options?: MethodOptions): Promise<Uint8Array>;
803
- resetPassword(id: string, params: ResetMailboxPasswordParams, options?: MethodOptions): Promise<Mailbox>;
804
- getRules(id: string, options?: MethodOptions): Promise<MailboxRules>;
805
- updateRules(id: string, params: UpdateMailboxRulesParams, options?: MethodOptions): Promise<MailboxRules>;
806
- updateAutoReply(id: string, params: UpdateAutoReplyParams, options?: MethodOptions): Promise<Mailbox>;
807
- updateSpamFilter(id: string, params: UpdateSpamFilterParams, options?: MethodOptions): Promise<Mailbox>;
808
- createImport(id: string, params: CreateMailboxImportParams, options?: MethodOptions): Promise<MailboxImport>;
809
- listImports(id: string, options?: MethodOptions): Promise<MailboxImports>;
810
- getImport(id: string, importId: string, options?: MethodOptions): Promise<MailboxImport>;
811
- cancelImport(id: string, importId: string, options?: MethodOptions): Promise<MailboxImport>;
812
- undoImport(id: string, importId: string, options?: MethodOptions): Promise<MailboxImport>;
813
- createImportUpload(id: string, params: CreateImportUploadParams, options?: MethodOptions): Promise<ImportUpload>;
814
- }
815
-
816
868
  type Message = {
817
869
  readonly object: "message";
818
870
  readonly id: string;
819
871
  readonly mailbox_id: string;
820
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[];
821
878
  readonly subject: string | null;
822
879
  readonly from_address: string | null;
823
880
  readonly to_addresses: readonly {
@@ -838,6 +895,7 @@ type Message = {
838
895
  readonly content_type: string;
839
896
  }[] | null;
840
897
  readonly source: MessageSource;
898
+ readonly mode: DataMode;
841
899
  readonly status: MessageStatus;
842
900
  readonly scheduled_at: string | null;
843
901
  readonly created_at: string;
@@ -848,6 +906,11 @@ type Attachment = {
848
906
  readonly content: string;
849
907
  readonly content_type?: string | undefined;
850
908
  };
909
+ type OutboundHeader = {
910
+ readonly name: string;
911
+ readonly value: string;
912
+ };
913
+ type MessageMetadata = Readonly<Record<string, string | number | boolean | null>>;
851
914
  type SendMessageParams = {
852
915
  readonly mailbox_id?: string | undefined;
853
916
  readonly from?: string | undefined;
@@ -861,19 +924,85 @@ type SendMessageParams = {
861
924
  readonly in_reply_to?: string | undefined;
862
925
  readonly references?: readonly string[] | undefined;
863
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;
864
931
  readonly scheduled_at?: string | undefined;
932
+ readonly sandbox_outcome?: SandboxOutcome | undefined;
865
933
  };
866
- type ListMessagesParams = PaginationParams & {
934
+ type ListMessagesParams = PaginationParams & ({
867
935
  readonly mailbox_id: string;
868
- };
936
+ readonly client_reference?: string | undefined;
937
+ } | {
938
+ readonly mailbox_id?: string | undefined;
939
+ readonly client_reference: string;
940
+ });
869
941
  type ReplyToMessageParams = {
870
942
  readonly html?: string | undefined;
871
943
  readonly text?: string | undefined;
872
944
  readonly to: readonly EmailRecipientInput[];
873
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;
874
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;
875
965
  };
876
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
+
877
1006
  declare class Messages extends ApiResource {
878
1007
  send(params: SendMessageParams, options?: MethodOptions): Promise<Message>;
879
1008
  list(params: ListMessagesParams, options?: MethodOptions): Promise<PaginatedResponse<Message>>;
@@ -1256,6 +1385,7 @@ type ReplyToThreadParams = {
1256
1385
  readonly to?: readonly EmailRecipientInput[] | undefined;
1257
1386
  readonly cc?: readonly EmailRecipientInput[] | undefined;
1258
1387
  readonly scheduled_at?: string | undefined;
1388
+ readonly sandbox_outcome?: SandboxOutcome | undefined;
1259
1389
  };
1260
1390
 
1261
1391
  declare class Threads extends ApiResource {
@@ -1301,7 +1431,8 @@ type WebhookDelivery = {
1301
1431
  readonly object: "webhook_delivery";
1302
1432
  readonly id: string;
1303
1433
  readonly event_id: string;
1304
- readonly event_type: string;
1434
+ readonly event_type: WebhookDeliveryEventType;
1435
+ readonly mode: DataMode;
1305
1436
  readonly status: WebhookDeliveryStatus;
1306
1437
  readonly attempts: number;
1307
1438
  readonly last_status_code: number | null;
@@ -1309,14 +1440,21 @@ type WebhookDelivery = {
1309
1440
  readonly created_at: string;
1310
1441
  readonly delivered_at: string | null;
1311
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
+ };
1312
1448
  type ListDeliveriesParams = PaginationParams & {
1313
1449
  readonly status?: string | undefined;
1314
1450
  readonly event_type?: string | undefined;
1315
1451
  };
1316
1452
  type WebhookEvent<T = unknown> = {
1453
+ readonly version: "2026-07-12";
1317
1454
  readonly event_id: string;
1318
1455
  readonly event_type: WebhookEventType;
1319
1456
  readonly created_at: string;
1457
+ readonly test: boolean;
1320
1458
  readonly data: T;
1321
1459
  };
1322
1460
 
@@ -1331,6 +1469,8 @@ declare class Webhooks extends ApiResource {
1331
1469
  test(id: string, options?: MethodOptions): Promise<TestWebhookResponse>;
1332
1470
  listDeliveries(id: string, params?: ListDeliveriesParams, options?: MethodOptions): Promise<PaginatedResponse<WebhookDelivery>>;
1333
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>;
1334
1474
  }
1335
1475
 
1336
1476
  type RequestOptions = {
@@ -1447,4 +1587,4 @@ declare function verifyWebhook(body: string, headers: WebhookHeaders | Headers,
1447
1587
  readonly toleranceInSeconds?: number | undefined;
1448
1588
  }): Promise<WebhookEvent>;
1449
1589
 
1450
- 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.30";
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",
@@ -1253,9 +1336,10 @@ var MESSAGE_STATUSES = [
1253
1336
  "bounced",
1254
1337
  "complained",
1255
1338
  "failed",
1339
+ "suppressed",
1256
1340
  "cancelled"
1257
1341
  ];
1258
- var MESSAGE_SOURCES = ["api", "dashboard", "inbound", "smtp"];
1342
+ var MESSAGE_SOURCES = ["api", "newsletter", "dashboard", "inbound", "smtp"];
1259
1343
  var WEBHOOK_DELIVERY_STATUSES = ["pending", "delivered", "failed"];
1260
1344
 
1261
1345
  // src/webhook-verification.ts
@@ -1306,6 +1390,6 @@ async function verifyWebhook(body, headers, secret, options) {
1306
1390
  return parsed;
1307
1391
  }
1308
1392
 
1309
- 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 };
1310
1394
  //# sourceMappingURL=index.js.map
1311
1395
  //# sourceMappingURL=index.js.map