shipmail 0.2.2 → 0.2.3

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
@@ -53,9 +53,9 @@ type EmailRecipient = {
53
53
  readonly name?: string | null | undefined;
54
54
  };
55
55
  type EmailRecipientInput = EmailRecipient | string;
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"];
56
+ declare const WEBHOOK_EVENT_TYPES: readonly ["message.received", "message.sent", "message.delivered", "message.bounced", "message.complained", "thread.needs_reply", "mailbox.rule_matched", "domain.verified", "domain.verification_failed", "domain.degraded", "org.reputation_warning", "org.sending_throttled", "org.sending_suspended", "org.reputation_recovered"];
57
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"];
58
+ declare const WEBHOOK_DELIVERY_EVENT_TYPES: readonly ["webhook.test", "message.received", "message.sent", "message.delivered", "message.bounced", "message.complained", "thread.needs_reply", "mailbox.rule_matched", "domain.verified", "domain.verification_failed", "domain.degraded", "org.reputation_warning", "org.sending_throttled", "org.sending_suspended", "org.reputation_recovered"];
59
59
  type WebhookDeliveryEventType = (typeof WEBHOOK_DELIVERY_EVENT_TYPES)[number];
60
60
  type StatusResponse = {
61
61
  readonly status: string;
@@ -67,7 +67,7 @@ declare const DOMAIN_STATUSES: readonly ["pending", "verifying", "verified", "de
67
67
  type DomainStatus = (typeof DOMAIN_STATUSES)[number];
68
68
  declare const MESSAGE_STATUSES: readonly ["scheduled", "queued", "sent", "delivered", "bounced", "complained", "failed", "suppressed", "cancelled"];
69
69
  type MessageStatus = (typeof MESSAGE_STATUSES)[number];
70
- declare const MESSAGE_SOURCES: readonly ["api", "newsletter", "dashboard", "inbound", "smtp"];
70
+ declare const MESSAGE_SOURCES: readonly ["api", "newsletter", "dashboard", "inbound", "smtp", "agent"];
71
71
  type MessageSource = (typeof MESSAGE_SOURCES)[number];
72
72
  declare const WEBHOOK_DELIVERY_STATUSES: readonly ["pending", "delivered", "failed"];
73
73
  type WebhookDeliveryStatus = (typeof WEBHOOK_DELIVERY_STATUSES)[number];
@@ -592,6 +592,105 @@ type ImportUpload = {
592
592
  readonly expires_in_seconds: number;
593
593
  };
594
594
 
595
+ type Message = {
596
+ readonly object: "message";
597
+ readonly id: string;
598
+ readonly mailbox_id: string;
599
+ readonly thread_id: string | null;
600
+ readonly source_rfc_message_id: string | null;
601
+ readonly delivered_rfc_message_id: string | null;
602
+ readonly client_reference: string | null;
603
+ readonly metadata: Readonly<Record<string, string | number | boolean | null>>;
604
+ readonly headers: readonly OutboundHeader[];
605
+ readonly subject: string | null;
606
+ readonly from_address: string | null;
607
+ readonly to_addresses: readonly {
608
+ readonly address: string;
609
+ readonly name?: string | null;
610
+ }[] | null;
611
+ readonly cc_addresses: readonly {
612
+ readonly address: string;
613
+ readonly name?: string | null;
614
+ }[] | null;
615
+ readonly bcc_addresses: readonly {
616
+ readonly address: string;
617
+ readonly name?: string | null;
618
+ }[] | null;
619
+ readonly attachments: readonly {
620
+ readonly filename: string;
621
+ readonly size: number;
622
+ readonly content_type: string;
623
+ }[] | null;
624
+ readonly source: MessageSource;
625
+ readonly mode: DataMode;
626
+ readonly status: MessageStatus;
627
+ readonly scheduled_at: string | null;
628
+ readonly created_at: string;
629
+ readonly updated_at: string;
630
+ };
631
+ type Attachment = {
632
+ readonly filename: string;
633
+ readonly content: string;
634
+ readonly content_type?: string | undefined;
635
+ };
636
+ type OutboundHeader = {
637
+ readonly name: string;
638
+ readonly value: string;
639
+ };
640
+ type MessageMetadata = Readonly<Record<string, string | number | boolean | null>>;
641
+ type SendMessageParams = {
642
+ readonly mailbox_id?: string | undefined;
643
+ readonly from?: string | undefined;
644
+ readonly to: readonly EmailRecipientInput[];
645
+ readonly cc?: readonly EmailRecipientInput[] | undefined;
646
+ readonly bcc?: readonly EmailRecipientInput[] | undefined;
647
+ readonly reply_to?: EmailRecipientInput | undefined;
648
+ readonly subject: string;
649
+ readonly html?: string | undefined;
650
+ readonly text?: string | undefined;
651
+ readonly in_reply_to?: string | undefined;
652
+ readonly references?: readonly string[] | undefined;
653
+ readonly attachments?: readonly Attachment[] | undefined;
654
+ readonly client_reference?: string | undefined;
655
+ readonly metadata?: MessageMetadata | undefined;
656
+ readonly source_rfc_message_id?: string | undefined;
657
+ readonly headers?: readonly OutboundHeader[] | undefined;
658
+ readonly scheduled_at?: string | undefined;
659
+ readonly sandbox_outcome?: SandboxOutcome | undefined;
660
+ };
661
+ type ListMessagesParams = PaginationParams & ({
662
+ readonly mailbox_id: string;
663
+ readonly client_reference?: string | undefined;
664
+ } | {
665
+ readonly mailbox_id?: string | undefined;
666
+ readonly client_reference: string;
667
+ });
668
+ type ReplyToMessageParams = {
669
+ readonly html?: string | undefined;
670
+ readonly text?: string | undefined;
671
+ readonly to: readonly EmailRecipientInput[];
672
+ readonly cc?: readonly EmailRecipientInput[] | undefined;
673
+ readonly client_reference?: string | undefined;
674
+ readonly metadata?: MessageMetadata | undefined;
675
+ readonly source_rfc_message_id?: string | undefined;
676
+ readonly headers?: readonly OutboundHeader[] | undefined;
677
+ readonly scheduled_at?: string | undefined;
678
+ readonly sandbox_outcome?: SandboxOutcome | undefined;
679
+ };
680
+ type InjectSandboxInboundParams = {
681
+ readonly from: EmailRecipientInput;
682
+ readonly to?: readonly EmailRecipientInput[] | undefined;
683
+ readonly cc?: readonly EmailRecipientInput[] | undefined;
684
+ readonly subject: string;
685
+ readonly text?: string | undefined;
686
+ readonly html?: string | undefined;
687
+ readonly message_id?: string | undefined;
688
+ readonly in_reply_to?: string | undefined;
689
+ readonly references?: readonly string[] | undefined;
690
+ readonly received_at?: string | undefined;
691
+ readonly headers?: readonly OutboundHeader[] | undefined;
692
+ };
693
+
595
694
  type AutoReply = {
596
695
  readonly enabled: boolean;
597
696
  readonly subject: string | null;
@@ -745,13 +844,79 @@ type InboxMessages = {
745
844
  readonly address: string;
746
845
  readonly data: readonly InboxFullMessage[];
747
846
  readonly pagination: {
748
- readonly position: number;
749
847
  readonly limit: number;
750
848
  readonly total: number;
751
849
  readonly has_more: boolean;
752
- readonly next_position: number | null;
850
+ readonly next_cursor: string | null;
851
+ };
852
+ };
853
+ type InboxThreadReplyState = "needs_reply" | "waiting_on_contact" | "resolved" | "no_reply_expected";
854
+ type InboxThreadSummary = {
855
+ readonly object: "inbox_thread_summary";
856
+ readonly id: string;
857
+ readonly thread_id: string;
858
+ readonly reply_state: InboxThreadReplyState;
859
+ readonly reply_version: number;
860
+ readonly needs_reply_since: string | null;
861
+ readonly subject: string | null;
862
+ readonly latest_from_address: string | null;
863
+ readonly message_count: number;
864
+ readonly first_message_at: string;
865
+ readonly last_message_at: string;
866
+ readonly latest_message_id: string | null;
867
+ readonly latest_email_id: string | null;
868
+ readonly latest_inbound_message_id: string | null;
869
+ readonly latest_inbound_email_id: string | null;
870
+ readonly latest_inbound_at: string | null;
871
+ readonly latest_outbound_message_id: string | null;
872
+ readonly latest_outbound_email_id: string | null;
873
+ readonly latest_outbound_at: string | null;
874
+ };
875
+ type InboxThreads = {
876
+ readonly object: "inbox_threads";
877
+ readonly mailbox_id: string;
878
+ readonly data: readonly InboxThreadSummary[];
879
+ readonly summary: Readonly<Record<InboxThreadReplyState, number>>;
880
+ readonly pagination: {
881
+ readonly limit: number;
882
+ readonly has_more: boolean;
883
+ readonly next_cursor: string | null;
884
+ readonly snapshot_at: string;
753
885
  };
754
886
  };
887
+ type InboxThreadReplyStateResult = {
888
+ readonly object: "inbox_thread_reply_state";
889
+ readonly id: string;
890
+ readonly thread_id: string;
891
+ readonly reply_state: InboxThreadReplyState;
892
+ readonly reply_version: number;
893
+ readonly needs_reply_since: string | null;
894
+ };
895
+ type InboxReplyDraft = {
896
+ readonly object: "inbox_reply_draft";
897
+ readonly id: string;
898
+ readonly mailbox_id: string;
899
+ readonly thread_id: string;
900
+ readonly based_on_message_id: string | null;
901
+ readonly expected_reply_version: number;
902
+ readonly reply_mode: "reply" | "reply_all";
903
+ readonly status: "draft" | "sending" | "sent" | "invalidated" | "failed";
904
+ readonly to: readonly {
905
+ readonly address: string;
906
+ readonly name: string | null;
907
+ }[];
908
+ readonly cc: readonly {
909
+ readonly address: string;
910
+ readonly name: string | null;
911
+ }[];
912
+ readonly created_at: string;
913
+ };
914
+ type InboxReplyDraftSend = {
915
+ readonly object: "inbox_reply_draft_send";
916
+ readonly draft_id: string;
917
+ readonly status: InboxReplyDraft["status"];
918
+ readonly message: Message;
919
+ };
755
920
  type InboxThread = {
756
921
  readonly object: "inbox_thread";
757
922
  readonly mailbox_id: string;
@@ -874,11 +1039,32 @@ type ListInboxMessagesParams = {
874
1039
  readonly folder_id?: string | undefined;
875
1040
  readonly folder_role?: "inbox" | "starred" | "sent" | "drafts" | "archive" | "junk" | "trash" | undefined;
876
1041
  readonly search_text?: string | undefined;
877
- readonly position?: number | undefined;
1042
+ readonly cursor?: string | undefined;
1043
+ readonly after?: string | undefined;
1044
+ readonly before?: string | undefined;
878
1045
  readonly limit?: number | undefined;
879
1046
  readonly has_keyword?: InboxKeyword | undefined;
880
1047
  readonly not_keyword?: InboxKeyword | undefined;
881
1048
  };
1049
+ type ListInboxThreadsParams = {
1050
+ readonly reply_state?: InboxThreadReplyState | undefined;
1051
+ readonly sort_by?: "needs_reply_since" | "last_message_at" | undefined;
1052
+ readonly order?: "asc" | "desc" | undefined;
1053
+ readonly after?: string | undefined;
1054
+ readonly before?: string | undefined;
1055
+ readonly cursor?: string | undefined;
1056
+ readonly limit?: number | undefined;
1057
+ };
1058
+ type CreateInboxReplyDraftParams = {
1059
+ readonly text?: string | undefined;
1060
+ readonly html?: string | undefined;
1061
+ readonly reply_mode?: "reply" | "reply_all" | undefined;
1062
+ readonly expected_reply_version: number;
1063
+ };
1064
+ type UpdateInboxThreadReplyStateParams = {
1065
+ readonly reply_state: "needs_reply" | "resolved" | "no_reply_expected";
1066
+ readonly expected_reply_version: number;
1067
+ };
882
1068
  type DownloadInboxAttachmentParams = {
883
1069
  readonly blob_id: string;
884
1070
  readonly name?: string | undefined;
@@ -906,105 +1092,6 @@ type UpdateMailboxRulesParams = {
906
1092
  readonly rules: readonly MailboxRule[];
907
1093
  };
908
1094
 
909
- type Message = {
910
- readonly object: "message";
911
- readonly id: string;
912
- readonly mailbox_id: string;
913
- readonly thread_id: string | null;
914
- readonly source_rfc_message_id: string | null;
915
- readonly delivered_rfc_message_id: string | null;
916
- readonly client_reference: string | null;
917
- readonly metadata: Readonly<Record<string, string | number | boolean | null>>;
918
- readonly headers: readonly OutboundHeader[];
919
- readonly subject: string | null;
920
- readonly from_address: string | null;
921
- readonly to_addresses: readonly {
922
- readonly address: string;
923
- readonly name?: string | null;
924
- }[] | null;
925
- readonly cc_addresses: readonly {
926
- readonly address: string;
927
- readonly name?: string | null;
928
- }[] | null;
929
- readonly bcc_addresses: readonly {
930
- readonly address: string;
931
- readonly name?: string | null;
932
- }[] | null;
933
- readonly attachments: readonly {
934
- readonly filename: string;
935
- readonly size: number;
936
- readonly content_type: string;
937
- }[] | null;
938
- readonly source: MessageSource;
939
- readonly mode: DataMode;
940
- readonly status: MessageStatus;
941
- readonly scheduled_at: string | null;
942
- readonly created_at: string;
943
- readonly updated_at: string;
944
- };
945
- type Attachment = {
946
- readonly filename: string;
947
- readonly content: string;
948
- readonly content_type?: string | undefined;
949
- };
950
- type OutboundHeader = {
951
- readonly name: string;
952
- readonly value: string;
953
- };
954
- type MessageMetadata = Readonly<Record<string, string | number | boolean | null>>;
955
- type SendMessageParams = {
956
- readonly mailbox_id?: string | undefined;
957
- readonly from?: string | undefined;
958
- readonly to: readonly EmailRecipientInput[];
959
- readonly cc?: readonly EmailRecipientInput[] | undefined;
960
- readonly bcc?: readonly EmailRecipientInput[] | undefined;
961
- readonly reply_to?: EmailRecipientInput | undefined;
962
- readonly subject: string;
963
- readonly html?: string | undefined;
964
- readonly text?: string | undefined;
965
- readonly in_reply_to?: string | undefined;
966
- readonly references?: readonly string[] | undefined;
967
- readonly attachments?: readonly Attachment[] | undefined;
968
- readonly client_reference?: string | undefined;
969
- readonly metadata?: MessageMetadata | undefined;
970
- readonly source_rfc_message_id?: string | undefined;
971
- readonly headers?: readonly OutboundHeader[] | undefined;
972
- readonly scheduled_at?: string | undefined;
973
- readonly sandbox_outcome?: SandboxOutcome | undefined;
974
- };
975
- type ListMessagesParams = PaginationParams & ({
976
- readonly mailbox_id: string;
977
- readonly client_reference?: string | undefined;
978
- } | {
979
- readonly mailbox_id?: string | undefined;
980
- readonly client_reference: string;
981
- });
982
- type ReplyToMessageParams = {
983
- readonly html?: string | undefined;
984
- readonly text?: string | undefined;
985
- readonly to: readonly EmailRecipientInput[];
986
- readonly cc?: readonly EmailRecipientInput[] | undefined;
987
- readonly client_reference?: string | undefined;
988
- readonly metadata?: MessageMetadata | undefined;
989
- readonly source_rfc_message_id?: string | undefined;
990
- readonly headers?: readonly OutboundHeader[] | undefined;
991
- readonly scheduled_at?: string | undefined;
992
- readonly sandbox_outcome?: SandboxOutcome | undefined;
993
- };
994
- type InjectSandboxInboundParams = {
995
- readonly from: EmailRecipientInput;
996
- readonly to?: readonly EmailRecipientInput[] | undefined;
997
- readonly cc?: readonly EmailRecipientInput[] | undefined;
998
- readonly subject: string;
999
- readonly text?: string | undefined;
1000
- readonly html?: string | undefined;
1001
- readonly message_id?: string | undefined;
1002
- readonly in_reply_to?: string | undefined;
1003
- readonly references?: readonly string[] | undefined;
1004
- readonly received_at?: string | undefined;
1005
- readonly headers?: readonly OutboundHeader[] | undefined;
1006
- };
1007
-
1008
1095
  declare class Mailboxes extends ApiResource {
1009
1096
  injectSandboxInbound(id: string, params: InjectSandboxInboundParams, options?: MethodOptions): Promise<Message>;
1010
1097
  create(params: CreateMailboxParams, options?: MethodOptions): Promise<Mailbox>;
@@ -1023,7 +1110,12 @@ declare class Mailboxes extends ApiResource {
1023
1110
  deleteFolder(id: string, folderId: string, options?: MethodOptions): Promise<void>;
1024
1111
  listIdentities(id: string, options?: MethodOptions): Promise<MailboxIdentities>;
1025
1112
  listInboxMessages(id: string, params?: ListInboxMessagesParams, options?: MethodOptions): Promise<InboxMessages>;
1113
+ getInboxMessage(id: string, messageId: string, options?: MethodOptions): Promise<InboxFullMessage>;
1114
+ listInboxThreads(id: string, params?: ListInboxThreadsParams, options?: MethodOptions): Promise<InboxThreads>;
1026
1115
  getInboxThread(id: string, threadId: string, options?: MethodOptions): Promise<InboxThread>;
1116
+ updateInboxThreadReplyState(id: string, threadId: string, params: UpdateInboxThreadReplyStateParams, options?: MethodOptions): Promise<InboxThreadReplyStateResult>;
1117
+ createInboxReplyDraft(id: string, threadId: string, params: CreateInboxReplyDraftParams, options?: MethodOptions): Promise<InboxReplyDraft>;
1118
+ sendInboxReplyDraft(id: string, threadId: string, draftId: string, options?: MethodOptions): Promise<InboxReplyDraftSend>;
1027
1119
  replyToInboxMessage(id: string, messageId: string, params: ReplyToMessageParams, options?: MethodOptions): Promise<Message>;
1028
1120
  replyToInboxThread(id: string, threadId: string, params: ReplyToMessageParams, options?: MethodOptions): Promise<Message>;
1029
1121
  updateInboxMessage(id: string, messageId: string, params: UpdateInboxMessageParams, options?: MethodOptions): Promise<InboxMessageAction>;
@@ -1491,6 +1583,59 @@ declare class Partner extends ApiResource {
1491
1583
  usage(options?: MethodOptions): Promise<PartnerUsage>;
1492
1584
  }
1493
1585
 
1586
+ type ReplyScanStatus = "completed";
1587
+ type ReplyScan = {
1588
+ readonly object: "reply_scan";
1589
+ readonly id: string;
1590
+ readonly mailbox_ids: readonly string[];
1591
+ readonly after: string;
1592
+ readonly before: string;
1593
+ readonly snapshot_at: string;
1594
+ readonly status: ReplyScanStatus;
1595
+ readonly candidate_count: number;
1596
+ readonly completed_at: string;
1597
+ readonly created_at: string;
1598
+ };
1599
+ type ReplyScanCandidate = {
1600
+ readonly object: "reply_scan_candidate";
1601
+ readonly id: string;
1602
+ readonly mailbox_id: string;
1603
+ readonly thread_id: string;
1604
+ readonly tracked_thread_id: string;
1605
+ readonly latest_message_id: string | null;
1606
+ readonly latest_email_id: string | null;
1607
+ readonly latest_inbound_message_id: string | null;
1608
+ readonly latest_inbound_email_id: string | null;
1609
+ readonly reply_version: number;
1610
+ readonly needs_reply_since: string;
1611
+ readonly subject: string | null;
1612
+ };
1613
+ type ReplyScanResults = {
1614
+ readonly object: "reply_scan_results";
1615
+ readonly scan_id: string;
1616
+ readonly data: readonly ReplyScanCandidate[];
1617
+ readonly pagination: {
1618
+ readonly limit: number;
1619
+ readonly has_more: boolean;
1620
+ readonly next_cursor: string | null;
1621
+ };
1622
+ };
1623
+ type CreateReplyScanParams = {
1624
+ readonly mailbox_ids: readonly string[];
1625
+ readonly after: string;
1626
+ readonly before?: string | undefined;
1627
+ };
1628
+ type ListReplyScanResultsParams = {
1629
+ readonly cursor?: string | undefined;
1630
+ readonly limit?: number | undefined;
1631
+ };
1632
+
1633
+ declare class ReplyScans extends ApiResource {
1634
+ create(params: CreateReplyScanParams, options?: MethodOptions): Promise<ReplyScan>;
1635
+ get(id: string, options?: MethodOptions): Promise<ReplyScan>;
1636
+ listResults(id: string, params?: ListReplyScanResultsParams, options?: MethodOptions): Promise<ReplyScanResults>;
1637
+ }
1638
+
1494
1639
  declare class Status extends ApiResource {
1495
1640
  get(options?: MethodOptions): Promise<StatusResponse>;
1496
1641
  }
@@ -1600,7 +1745,7 @@ type ListDeliveriesParams = PaginationParams & {
1600
1745
  readonly event_type?: string | undefined;
1601
1746
  };
1602
1747
  type WebhookEvent<T = unknown> = {
1603
- readonly version: "2026-07-12";
1748
+ readonly version: "2026-07-20";
1604
1749
  readonly event_id: string;
1605
1750
  readonly event_type: WebhookEventType;
1606
1751
  readonly created_at: string;
@@ -1651,6 +1796,7 @@ declare class ShipMailClient {
1651
1796
  readonly messages: Messages;
1652
1797
  readonly newsletters: Newsletters;
1653
1798
  readonly partner: Partner;
1799
+ readonly replyScans: ReplyScans;
1654
1800
  readonly suppressions: Suppressions;
1655
1801
  readonly threads: Threads;
1656
1802
  readonly webhooks: Webhooks;
@@ -1739,4 +1885,4 @@ declare function verifyWebhook(body: string, headers: WebhookHeaders | Headers,
1739
1885
  readonly toleranceInSeconds?: number | undefined;
1740
1886
  }): Promise<WebhookEvent>;
1741
1887
 
1742
- 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 ConsumePartnerMailboxCredentialGrantParams, type CreateAudienceParams, type CreateBookingPageParams, type CreateCalendarEventParams, type CreateDomainParams, type CreateMailboxAppPasswordParams, type CreateMailboxFolderParams, type CreateMailboxParams, type CreateNewsletterFromChangelogParams, type CreateNewsletterParams, type CreatePartnerOrganizationParams, type CreateWebhookParams, type CreatedMailboxAppPassword, 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 MailboxAppPassword, type MailboxAppPasswordList, type MailboxAppPasswordPurpose, type MailboxAppPasswordState, 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 OneTimeSecretMethodOptions, type OutboundHeader, Page, type PaginatedResponse, type PaginationParams, type PartnerDataClassification, type PartnerMailboxCredential, type PartnerMailboxCredentialGrant, type PartnerMailboxCredentialGrantList, 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 };
1888
+ 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 ConsumePartnerMailboxCredentialGrantParams, type CreateAudienceParams, type CreateBookingPageParams, type CreateCalendarEventParams, type CreateDomainParams, type CreateInboxReplyDraftParams, type CreateMailboxAppPasswordParams, type CreateMailboxFolderParams, type CreateMailboxParams, type CreateNewsletterFromChangelogParams, type CreateNewsletterParams, type CreatePartnerOrganizationParams, type CreateReplyScanParams, type CreateWebhookParams, type CreatedMailboxAppPassword, 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 InboxReplyDraft, type InboxReplyDraftSend, type InboxThread, type InboxThreadReplyState, type InboxThreadReplyStateResult, type InboxThreadSummary, type InboxThreads, type InjectSandboxInboundParams, InternalServerError, type ListAudiencesParams, type ListBookingPagesParams, type ListCalendarEventsParams, type ListDeliveriesParams, type ListDomainsParams, type ListInboxMessagesParams, type ListInboxThreadsParams, type ListMailboxesParams, type ListMessagesParams, type ListNewsletterAssetsParams, type ListNewsletterDomainsParams, type ListNewslettersParams, type ListReplyScanResultsParams, type ListSubscribersParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MESSAGE_SOURCES, MESSAGE_STATUSES, type Mailbox, type MailboxAppPassword, type MailboxAppPasswordList, type MailboxAppPasswordPurpose, type MailboxAppPasswordState, 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 OneTimeSecretMethodOptions, type OutboundHeader, Page, type PaginatedResponse, type PaginationParams, type PartnerDataClassification, type PartnerMailboxCredential, type PartnerMailboxCredentialGrant, type PartnerMailboxCredentialGrantList, 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 ReplyScan, type ReplyScanCandidate, type ReplyScanResults, type ReplyScanStatus, 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 UpdateInboxThreadReplyStateParams, 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 };
package/dist/index.js CHANGED
@@ -620,7 +620,9 @@ var Mailboxes = class extends ApiResource {
620
620
  folder_id: params?.folder_id,
621
621
  folder_role: params?.folder_role,
622
622
  search_text: params?.search_text,
623
- position: params?.position,
623
+ cursor: params?.cursor,
624
+ after: params?.after,
625
+ before: params?.before,
624
626
  limit: params?.limit,
625
627
  has_keyword: params?.has_keyword,
626
628
  not_keyword: params?.not_keyword
@@ -628,6 +630,29 @@ var Mailboxes = class extends ApiResource {
628
630
  methodOptions: options
629
631
  });
630
632
  }
633
+ getInboxMessage(id, messageId, options) {
634
+ return this.client.request({
635
+ method: "GET",
636
+ path: `/mailboxes/${encodeURIComponent(id)}/inbox/messages/${encodeURIComponent(messageId)}`,
637
+ methodOptions: options
638
+ });
639
+ }
640
+ listInboxThreads(id, params, options) {
641
+ return this.client.request({
642
+ method: "GET",
643
+ path: `/mailboxes/${encodeURIComponent(id)}/inbox/threads`,
644
+ query: {
645
+ reply_state: params?.reply_state,
646
+ sort_by: params?.sort_by,
647
+ order: params?.order,
648
+ after: params?.after,
649
+ before: params?.before,
650
+ cursor: params?.cursor,
651
+ limit: params?.limit
652
+ },
653
+ methodOptions: options
654
+ });
655
+ }
631
656
  getInboxThread(id, threadId, options) {
632
657
  return this.client.request({
633
658
  method: "GET",
@@ -635,6 +660,29 @@ var Mailboxes = class extends ApiResource {
635
660
  methodOptions: options
636
661
  });
637
662
  }
663
+ updateInboxThreadReplyState(id, threadId, params, options) {
664
+ return this.client.request({
665
+ method: "PATCH",
666
+ path: `/mailboxes/${encodeURIComponent(id)}/inbox/threads/${encodeURIComponent(threadId)}`,
667
+ body: params,
668
+ methodOptions: options
669
+ });
670
+ }
671
+ createInboxReplyDraft(id, threadId, params, options) {
672
+ return this.client.request({
673
+ method: "POST",
674
+ path: `/mailboxes/${encodeURIComponent(id)}/inbox/threads/${encodeURIComponent(threadId)}/drafts`,
675
+ body: params,
676
+ methodOptions: options
677
+ });
678
+ }
679
+ sendInboxReplyDraft(id, threadId, draftId, options) {
680
+ return this.client.request({
681
+ method: "POST",
682
+ path: `/mailboxes/${encodeURIComponent(id)}/inbox/threads/${encodeURIComponent(threadId)}/drafts/${encodeURIComponent(draftId)}/send`,
683
+ methodOptions: options
684
+ });
685
+ }
638
686
  replyToInboxMessage(id, messageId, params, options) {
639
687
  return this.client.request({
640
688
  method: "POST",
@@ -1093,6 +1141,33 @@ var Partner = class extends ApiResource {
1093
1141
  }
1094
1142
  };
1095
1143
 
1144
+ // src/resources/reply-scans.ts
1145
+ var ReplyScans = class extends ApiResource {
1146
+ create(params, options) {
1147
+ return this.client.request({
1148
+ method: "POST",
1149
+ path: "/reply-scans",
1150
+ body: params,
1151
+ methodOptions: options
1152
+ });
1153
+ }
1154
+ get(id, options) {
1155
+ return this.client.request({
1156
+ method: "GET",
1157
+ path: `/reply-scans/${encodeURIComponent(id)}`,
1158
+ methodOptions: options
1159
+ });
1160
+ }
1161
+ listResults(id, params, options) {
1162
+ return this.client.request({
1163
+ method: "GET",
1164
+ path: `/reply-scans/${encodeURIComponent(id)}/results`,
1165
+ query: { cursor: params?.cursor, limit: params?.limit },
1166
+ methodOptions: options
1167
+ });
1168
+ }
1169
+ };
1170
+
1096
1171
  // src/resources/status.ts
1097
1172
  var Status = class extends ApiResource {
1098
1173
  get(options) {
@@ -1276,7 +1351,7 @@ var Webhooks = class extends ApiResource {
1276
1351
  };
1277
1352
 
1278
1353
  // src/version.ts
1279
- var VERSION = "0.2.2";
1354
+ var VERSION = "0.2.3";
1280
1355
 
1281
1356
  // src/client.ts
1282
1357
  var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
@@ -1337,6 +1412,7 @@ var ShipMailClient = class {
1337
1412
  this.messages = new Messages(this);
1338
1413
  this.newsletters = new Newsletters(this);
1339
1414
  this.partner = new Partner(this);
1415
+ this.replyScans = new ReplyScans(this);
1340
1416
  this.suppressions = new Suppressions(this);
1341
1417
  this.threads = new Threads(this);
1342
1418
  this.webhooks = new Webhooks(this);
@@ -1447,6 +1523,7 @@ var WEBHOOK_EVENT_TYPES = [
1447
1523
  "message.delivered",
1448
1524
  "message.bounced",
1449
1525
  "message.complained",
1526
+ "thread.needs_reply",
1450
1527
  "mailbox.rule_matched",
1451
1528
  "domain.verified",
1452
1529
  "domain.verification_failed",
@@ -1469,7 +1546,14 @@ var MESSAGE_STATUSES = [
1469
1546
  "suppressed",
1470
1547
  "cancelled"
1471
1548
  ];
1472
- var MESSAGE_SOURCES = ["api", "newsletter", "dashboard", "inbound", "smtp"];
1549
+ var MESSAGE_SOURCES = [
1550
+ "api",
1551
+ "newsletter",
1552
+ "dashboard",
1553
+ "inbound",
1554
+ "smtp",
1555
+ "agent"
1556
+ ];
1473
1557
  var WEBHOOK_DELIVERY_STATUSES = ["pending", "delivered", "failed"];
1474
1558
 
1475
1559
  // src/webhook-verification.ts