shipmail 0.5.1 → 0.5.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.cts CHANGED
@@ -36,7 +36,7 @@ type PaginatedResponse<T> = {
36
36
  };
37
37
  type DataMode = "live" | "test";
38
38
  type SandboxOutcome = "delivered" | "bounced" | "complained";
39
- type ErrorType = "validation_error" | "authentication_error" | "authorization_error" | "quota_exceeded" | "not_found" | "rate_limit_error" | "conflict" | "internal_error";
39
+ type ErrorType = "validation_error" | "authentication_error" | "authorization_error" | "quota_exceeded" | "not_found" | "rate_limit_error" | "conflict" | "reconciliation_required" | "internal_error";
40
40
  type ApiErrorBody = {
41
41
  readonly error: {
42
42
  readonly type: ErrorType;
@@ -48,6 +48,11 @@ type ApiErrorBody = {
48
48
  readonly code?: string | undefined;
49
49
  }[] | undefined;
50
50
  readonly retry_after?: number | undefined;
51
+ /**
52
+ * Present only on a `reconciliation_required` error: the tracking message
53
+ * the interrupted send attempt left behind.
54
+ */
55
+ readonly message_id?: string | undefined;
51
56
  };
52
57
  };
53
58
  type EmailRecipient = {
@@ -798,7 +803,10 @@ type Message = {
798
803
  readonly object: "message";
799
804
  readonly id: string;
800
805
  readonly mailbox_id: string;
806
+ /** @deprecated The mail server's thread ID. Still supported and unchanged; store `conversation_id`. */
801
807
  readonly thread_id: string | null;
808
+ /** Stable Shipmail conversation identifier. Store this instead of `thread_id`. */
809
+ readonly conversation_id: string | null;
802
810
  readonly source_rfc_message_id: string | null;
803
811
  readonly delivered_rfc_message_id: string | null;
804
812
  readonly client_reference: string | null;
@@ -969,7 +977,10 @@ type MessageAnalytics = {
969
977
  readonly object: "message_analytics";
970
978
  readonly id: string;
971
979
  readonly mailbox_id: string;
980
+ /** @deprecated The mail server's thread ID. Still supported and unchanged; store `conversation_id`. */
972
981
  readonly thread_id: string | null;
982
+ /** Stable Shipmail conversation identifier. Store this instead of `thread_id`. */
983
+ readonly conversation_id: string | null;
973
984
  readonly client_reference: string | null;
974
985
  readonly direction: "inbound" | "outbound";
975
986
  readonly contact_addresses: readonly string[];
@@ -1158,7 +1169,10 @@ type EmailAuthenticationResults = {
1158
1169
  type InboxMessage = {
1159
1170
  readonly object: "inbox_message";
1160
1171
  readonly id: string;
1172
+ /** @deprecated The mail server's thread ID. Still supported and unchanged; store `conversation_id`. */
1161
1173
  readonly thread_id: string;
1174
+ /** Stable Shipmail conversation identifier. Store this instead of `thread_id`. */
1175
+ readonly conversation_id: string | null;
1162
1176
  readonly mailbox_id: string;
1163
1177
  readonly address: string;
1164
1178
  readonly folder_ids: readonly string[];
@@ -1200,7 +1214,10 @@ type InboxThreadAttentionState = "needs_reply" | "waiting_on_them" | "done" | "f
1200
1214
  type InboxThreadSummary = {
1201
1215
  readonly object: "inbox_thread_summary";
1202
1216
  readonly id: string;
1217
+ /** @deprecated The mail server's thread ID. Still supported and unchanged; store `conversation_id`. */
1203
1218
  readonly thread_id: string;
1219
+ /** Stable Shipmail conversation identifier. Store this instead of `thread_id`. */
1220
+ readonly conversation_id: string;
1204
1221
  readonly attention_state: InboxThreadAttentionState;
1205
1222
  readonly version: number;
1206
1223
  readonly attention_since: string | null;
@@ -1236,7 +1253,10 @@ type InboxThreads = {
1236
1253
  type InboxThreadAttentionResult = {
1237
1254
  readonly object: "inbox_thread_attention";
1238
1255
  readonly id: string;
1256
+ /** @deprecated The mail server's thread ID. Still supported and unchanged; store `conversation_id`. */
1239
1257
  readonly thread_id: string;
1258
+ /** Stable Shipmail conversation identifier. Store this instead of `thread_id`. */
1259
+ readonly conversation_id: string;
1240
1260
  readonly attention_state: InboxThreadAttentionState;
1241
1261
  readonly version: number;
1242
1262
  readonly attention_since: string | null;
@@ -1247,7 +1267,10 @@ type InboxReplyDraft = {
1247
1267
  readonly object: "inbox_reply_draft";
1248
1268
  readonly id: string;
1249
1269
  readonly mailbox_id: string;
1270
+ /** @deprecated The mail server's thread ID. Still supported and unchanged; store `conversation_id`. */
1250
1271
  readonly thread_id: string;
1272
+ /** Stable Shipmail conversation identifier. Store this instead of `thread_id`. */
1273
+ readonly conversation_id: string;
1251
1274
  readonly based_on_message_id: string | null;
1252
1275
  readonly expected_version: number;
1253
1276
  readonly reply_mode: "reply" | "reply_all";
@@ -1272,7 +1295,10 @@ type InboxThread = {
1272
1295
  readonly object: "inbox_thread";
1273
1296
  readonly mailbox_id: string;
1274
1297
  readonly address: string;
1298
+ /** @deprecated The mail server's thread ID. Still supported and unchanged; store `conversation_id`. */
1275
1299
  readonly thread_id: string;
1300
+ /** Stable Shipmail conversation identifier. Store this instead of `thread_id`. */
1301
+ readonly conversation_id: string | null;
1276
1302
  readonly data: readonly InboxFullMessage[];
1277
1303
  };
1278
1304
  type InboxMessageAction = {
@@ -1560,7 +1586,7 @@ declare class Messages extends ApiResource {
1560
1586
  reply(id: string, params: ReplyToMessageParams, options?: MethodOptions): Promise<Message>;
1561
1587
  }
1562
1588
 
1563
- type NewsletterStatus = "draft" | "pending_approval" | "approved" | "scheduled" | "sending" | "paused" | "sent" | "cancelled" | "failed";
1589
+ type NewsletterStatus = "draft" | "imported" | "pending_approval" | "approved" | "scheduled" | "sending" | "paused" | "sent" | "cancelled" | "failed";
1564
1590
  type NewsletterArchiveVisibility = "private" | "public";
1565
1591
  type NewsletterStylingMode = "styled" | "plain";
1566
1592
  type NewsletterDomainStatus = "pending" | "verifying" | "verified" | "failed" | "disabled";
@@ -1574,6 +1600,7 @@ type NewsletterUrlSource = "href" | "image_src" | "video_href" | "text";
1574
1600
  type NewsletterChangelogTone = "concise" | "friendly" | "technical";
1575
1601
  type NewsletterCalloutVariant = "accent" | "info" | "warning" | "success";
1576
1602
  type NewsletterColumnRatio = "50-50" | "33-67" | "67-33";
1603
+ type NewsletterColumnImageFit = "natural" | "contain" | "cover";
1577
1604
  type NewsletterButtonAlign = "left" | "center" | "right";
1578
1605
  type NewsletterDomain = {
1579
1606
  readonly object: "newsletter_domain";
@@ -1852,11 +1879,13 @@ type SendNewsletterTestParams = {
1852
1879
  type ScheduleNewsletterParams = {
1853
1880
  readonly scheduled_at: string;
1854
1881
  };
1882
+ /** Include at least one heading, body, image, or complete CTA pair. */
1855
1883
  type NewsletterColumnContent = {
1856
1884
  readonly title?: string | null | undefined;
1857
- readonly body: string;
1885
+ readonly body?: string | undefined;
1858
1886
  readonly image_url?: string | null | undefined;
1859
1887
  readonly image_alt?: string | null | undefined;
1888
+ readonly image_fit?: NewsletterColumnImageFit | undefined;
1860
1889
  readonly cta_label?: string | null | undefined;
1861
1890
  readonly cta_url?: string | null | undefined;
1862
1891
  };
@@ -2075,7 +2104,11 @@ type ReplyScanCandidate = {
2075
2104
  readonly object: "reply_scan_candidate";
2076
2105
  readonly id: string;
2077
2106
  readonly mailbox_id: string;
2107
+ /** @deprecated The mail server's thread ID. Still supported and unchanged; store `conversation_id`. */
2078
2108
  readonly thread_id: string;
2109
+ /** Stable Shipmail conversation identifier. Store this instead of `thread_id`. */
2110
+ readonly conversation_id: string;
2111
+ /** Same value as `conversation_id`, kept for compatibility. */
2079
2112
  readonly tracked_thread_id: string;
2080
2113
  readonly latest_message_id: string | null;
2081
2114
  readonly latest_email_id: string | null;
@@ -2142,6 +2175,8 @@ declare class Suppressions extends ApiResource {
2142
2175
  type Thread = {
2143
2176
  readonly object: "thread";
2144
2177
  readonly id: string;
2178
+ /** Stable Shipmail conversation identifier. Store this instead of `id`. */
2179
+ readonly conversation_id: string;
2145
2180
  readonly mailbox_id: string;
2146
2181
  readonly subject: string | null;
2147
2182
  readonly message_count: number;
@@ -2351,6 +2386,17 @@ declare class ConflictError extends ShipmailError {
2351
2386
  declare class InternalServerError extends ShipmailError {
2352
2387
  constructor(message: string, requestId?: string);
2353
2388
  }
2389
+ /**
2390
+ * A send was interrupted and its outcome is not known.
2391
+ *
2392
+ * Never retried: the message this names may already have gone out, so a retry
2393
+ * can deliver it twice. `messageId` is the tracking message the attempt left
2394
+ * behind; read it, or quote it in support, before deciding what to send.
2395
+ */
2396
+ declare class ReconciliationRequiredError extends ShipmailError {
2397
+ readonly messageId: string | undefined;
2398
+ constructor(message: string, requestId?: string, messageId?: string);
2399
+ }
2354
2400
  declare class ConnectionError extends ShipmailError {
2355
2401
  constructor(message: string);
2356
2402
  }
@@ -2372,4 +2418,4 @@ declare function verifyWebhook(body: string, headers: WebhookHeaders | Headers,
2372
2418
  readonly toleranceInSeconds?: number | undefined;
2373
2419
  }): Promise<WebhookEvent>;
2374
2420
 
2375
- export { type AddSubscriberParams, type AddSubscribersBatchParams, type AddSubscribersBatchResult, type ApiErrorBody, type Audience, type AudienceFeed, AuthenticationError, AuthorizationError, type Automation, type AutomationAction, type AutomationCondition, type AutomationDefinition, type AutomationRun, type AutomationRunStatus, type AutomationRunSummary, type AutomationStatus, type AutomationTrigger, type BookingPage, CONFERENCING_PROVIDER_IDS, type CalendarAvailability, type CalendarAvailabilityParams, type CalendarAvailabilitySlot, type CalendarEvent, type CalendarEventPrivacy, type CalendarEventStatus, type CalendarFreeBusyStatus, type CalendarInvitationLanguage, type CapabilitiesResponse, type CapabilityResourceConstraints, type ConferencingProviderId, ConflictError, ConnectionError, type ConsumePartnerMailboxCredentialGrantParams, type CreateAudienceParams, type CreateAutomationParams, 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 EmailAuthVerdict, type EmailAuthenticationResults, 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 InboxThreadAttentionResult, type InboxThreadAttentionState, type InboxThreadSummary, type InboxThreads, type InjectSandboxInboundParams, InternalServerError, type ListAudiencesParams, type ListAutomationsResponse, type ListBookingPagesParams, type ListCalendarEventsParams, type ListDeliveriesParams, type ListDomainsParams, type ListInboxMessagesParams, type ListInboxThreadsParams, type ListMailboxesParams, type ListMembersParams, type ListMessageAnalyticsParams, type ListMessagesParams, type ListNewsletterAssetsParams, type ListNewsletterDomainsParams, type ListNewsletterSenderIdentitiesParams, type ListNewslettersParams, type ListReplyScanResultsParams, type ListScheduledMessagesParams, type ListSubscribersParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MESSAGE_SOURCES, MESSAGE_STATUSES, type Mailbox, type MailboxAppPassword, type MailboxAppPasswordList, type MailboxAppPasswordPurpose, type MailboxAppPasswordState, type MailboxDeliveryDestination, type MailboxDeliveryRouting, 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 Member, type MemberRole, type MergeFields, type Message, type MessageAnalytics, type MessageAnalyticsPage, type MessageMetadata, type MessageRuleDisposition, type MessageSource, type MessageStatus, type MethodOptions, type MoveInboxMessageParams, type Newsletter, type NewsletterArchiveVisibility, type NewsletterAsset, type NewsletterAssetContentType, type NewsletterAssetKind, type NewsletterAssetListResponse, type NewsletterAssetStorageUsage, type NewsletterAssetUpload, 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 NewsletterSenderIdentity, type NewsletterStatus, type NewsletterStylingMode, 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, type PrepareNewsletterAssetUploadParams, type PrepareStagedAttachmentUploadParams, 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 ScheduledMessage, type ScheduledMessageAttachment, type ScheduledMessageList, type ScheduledMessageRecipient, type ScheduledMessageUploadedAttachment, type SearchDomainsParams, type SendMessageParams, type SendNewsletterTestParams, ShipmailClient, type ShipmailConfig, ShipmailError, type StageAttachmentParams, type StagedAttachment, type StagedAttachmentUpload, type StatusResponse, type Subscriber, type SubscriberOutcome, type SubscriberResult, type SubscriberStatus, type Suppression, type TestWebhookResponse, type Thread, type UpdateAudienceFeedParams, type UpdateAudienceParams, type UpdateAutoReplyParams, type UpdateAutomationParams, type UpdateBookingPageParams, type UpdateCalendarEventParams, type UpdateDomainParams, type UpdateInboxMessageParams, type UpdateInboxThreadAttentionParams, type UpdateMailboxDeliveryRoutingParams, type UpdateMailboxFolderParams, type UpdateMailboxParams, type UpdateMailboxRulesParams, type UpdateNewsletterParams, type UpdatePartnerOrganizationParams, type UpdateScheduledMessageParams, 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 };
2421
+ export { type AddSubscriberParams, type AddSubscribersBatchParams, type AddSubscribersBatchResult, type ApiErrorBody, type Audience, type AudienceFeed, AuthenticationError, AuthorizationError, type Automation, type AutomationAction, type AutomationCondition, type AutomationDefinition, type AutomationRun, type AutomationRunStatus, type AutomationRunSummary, type AutomationStatus, type AutomationTrigger, type BookingPage, CONFERENCING_PROVIDER_IDS, type CalendarAvailability, type CalendarAvailabilityParams, type CalendarAvailabilitySlot, type CalendarEvent, type CalendarEventPrivacy, type CalendarEventStatus, type CalendarFreeBusyStatus, type CalendarInvitationLanguage, type CapabilitiesResponse, type CapabilityResourceConstraints, type ConferencingProviderId, ConflictError, ConnectionError, type ConsumePartnerMailboxCredentialGrantParams, type CreateAudienceParams, type CreateAutomationParams, 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 EmailAuthVerdict, type EmailAuthenticationResults, 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 InboxThreadAttentionResult, type InboxThreadAttentionState, type InboxThreadSummary, type InboxThreads, type InjectSandboxInboundParams, InternalServerError, type ListAudiencesParams, type ListAutomationsResponse, type ListBookingPagesParams, type ListCalendarEventsParams, type ListDeliveriesParams, type ListDomainsParams, type ListInboxMessagesParams, type ListInboxThreadsParams, type ListMailboxesParams, type ListMembersParams, type ListMessageAnalyticsParams, type ListMessagesParams, type ListNewsletterAssetsParams, type ListNewsletterDomainsParams, type ListNewsletterSenderIdentitiesParams, type ListNewslettersParams, type ListReplyScanResultsParams, type ListScheduledMessagesParams, type ListSubscribersParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MESSAGE_SOURCES, MESSAGE_STATUSES, type Mailbox, type MailboxAppPassword, type MailboxAppPasswordList, type MailboxAppPasswordPurpose, type MailboxAppPasswordState, type MailboxDeliveryDestination, type MailboxDeliveryRouting, 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 Member, type MemberRole, type MergeFields, type Message, type MessageAnalytics, type MessageAnalyticsPage, type MessageMetadata, type MessageRuleDisposition, type MessageSource, type MessageStatus, type MethodOptions, type MoveInboxMessageParams, type Newsletter, type NewsletterArchiveVisibility, type NewsletterAsset, type NewsletterAssetContentType, type NewsletterAssetKind, type NewsletterAssetListResponse, type NewsletterAssetStorageUsage, type NewsletterAssetUpload, type NewsletterBlock, type NewsletterButtonAlign, type NewsletterCalloutVariant, type NewsletterChangelogEntry, type NewsletterChangelogMedia, type NewsletterChangelogTone, type NewsletterColumnContent, type NewsletterColumnImageFit, type NewsletterColumnRatio, type NewsletterCountedUrl, type NewsletterDomain, type NewsletterDomainRecordStatus, type NewsletterDomainStatus, type NewsletterPreflight, type NewsletterPreflightItem, type NewsletterPreflightItemStatus, type NewsletterPreflightStatus, type NewsletterPreview, type NewsletterSenderIdentity, type NewsletterStatus, type NewsletterStylingMode, 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, type PrepareNewsletterAssetUploadParams, type PrepareStagedAttachmentUploadParams, QuotaExceededError, RateLimitError, ReconciliationRequiredError, 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 ScheduledMessage, type ScheduledMessageAttachment, type ScheduledMessageList, type ScheduledMessageRecipient, type ScheduledMessageUploadedAttachment, type SearchDomainsParams, type SendMessageParams, type SendNewsletterTestParams, ShipmailClient, type ShipmailConfig, ShipmailError, type StageAttachmentParams, type StagedAttachment, type StagedAttachmentUpload, type StatusResponse, type Subscriber, type SubscriberOutcome, type SubscriberResult, type SubscriberStatus, type Suppression, type TestWebhookResponse, type Thread, type UpdateAudienceFeedParams, type UpdateAudienceParams, type UpdateAutoReplyParams, type UpdateAutomationParams, type UpdateBookingPageParams, type UpdateCalendarEventParams, type UpdateDomainParams, type UpdateInboxMessageParams, type UpdateInboxThreadAttentionParams, type UpdateMailboxDeliveryRoutingParams, type UpdateMailboxFolderParams, type UpdateMailboxParams, type UpdateMailboxRulesParams, type UpdateNewsletterParams, type UpdatePartnerOrganizationParams, type UpdateScheduledMessageParams, 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.d.ts CHANGED
@@ -36,7 +36,7 @@ type PaginatedResponse<T> = {
36
36
  };
37
37
  type DataMode = "live" | "test";
38
38
  type SandboxOutcome = "delivered" | "bounced" | "complained";
39
- type ErrorType = "validation_error" | "authentication_error" | "authorization_error" | "quota_exceeded" | "not_found" | "rate_limit_error" | "conflict" | "internal_error";
39
+ type ErrorType = "validation_error" | "authentication_error" | "authorization_error" | "quota_exceeded" | "not_found" | "rate_limit_error" | "conflict" | "reconciliation_required" | "internal_error";
40
40
  type ApiErrorBody = {
41
41
  readonly error: {
42
42
  readonly type: ErrorType;
@@ -48,6 +48,11 @@ type ApiErrorBody = {
48
48
  readonly code?: string | undefined;
49
49
  }[] | undefined;
50
50
  readonly retry_after?: number | undefined;
51
+ /**
52
+ * Present only on a `reconciliation_required` error: the tracking message
53
+ * the interrupted send attempt left behind.
54
+ */
55
+ readonly message_id?: string | undefined;
51
56
  };
52
57
  };
53
58
  type EmailRecipient = {
@@ -798,7 +803,10 @@ type Message = {
798
803
  readonly object: "message";
799
804
  readonly id: string;
800
805
  readonly mailbox_id: string;
806
+ /** @deprecated The mail server's thread ID. Still supported and unchanged; store `conversation_id`. */
801
807
  readonly thread_id: string | null;
808
+ /** Stable Shipmail conversation identifier. Store this instead of `thread_id`. */
809
+ readonly conversation_id: string | null;
802
810
  readonly source_rfc_message_id: string | null;
803
811
  readonly delivered_rfc_message_id: string | null;
804
812
  readonly client_reference: string | null;
@@ -969,7 +977,10 @@ type MessageAnalytics = {
969
977
  readonly object: "message_analytics";
970
978
  readonly id: string;
971
979
  readonly mailbox_id: string;
980
+ /** @deprecated The mail server's thread ID. Still supported and unchanged; store `conversation_id`. */
972
981
  readonly thread_id: string | null;
982
+ /** Stable Shipmail conversation identifier. Store this instead of `thread_id`. */
983
+ readonly conversation_id: string | null;
973
984
  readonly client_reference: string | null;
974
985
  readonly direction: "inbound" | "outbound";
975
986
  readonly contact_addresses: readonly string[];
@@ -1158,7 +1169,10 @@ type EmailAuthenticationResults = {
1158
1169
  type InboxMessage = {
1159
1170
  readonly object: "inbox_message";
1160
1171
  readonly id: string;
1172
+ /** @deprecated The mail server's thread ID. Still supported and unchanged; store `conversation_id`. */
1161
1173
  readonly thread_id: string;
1174
+ /** Stable Shipmail conversation identifier. Store this instead of `thread_id`. */
1175
+ readonly conversation_id: string | null;
1162
1176
  readonly mailbox_id: string;
1163
1177
  readonly address: string;
1164
1178
  readonly folder_ids: readonly string[];
@@ -1200,7 +1214,10 @@ type InboxThreadAttentionState = "needs_reply" | "waiting_on_them" | "done" | "f
1200
1214
  type InboxThreadSummary = {
1201
1215
  readonly object: "inbox_thread_summary";
1202
1216
  readonly id: string;
1217
+ /** @deprecated The mail server's thread ID. Still supported and unchanged; store `conversation_id`. */
1203
1218
  readonly thread_id: string;
1219
+ /** Stable Shipmail conversation identifier. Store this instead of `thread_id`. */
1220
+ readonly conversation_id: string;
1204
1221
  readonly attention_state: InboxThreadAttentionState;
1205
1222
  readonly version: number;
1206
1223
  readonly attention_since: string | null;
@@ -1236,7 +1253,10 @@ type InboxThreads = {
1236
1253
  type InboxThreadAttentionResult = {
1237
1254
  readonly object: "inbox_thread_attention";
1238
1255
  readonly id: string;
1256
+ /** @deprecated The mail server's thread ID. Still supported and unchanged; store `conversation_id`. */
1239
1257
  readonly thread_id: string;
1258
+ /** Stable Shipmail conversation identifier. Store this instead of `thread_id`. */
1259
+ readonly conversation_id: string;
1240
1260
  readonly attention_state: InboxThreadAttentionState;
1241
1261
  readonly version: number;
1242
1262
  readonly attention_since: string | null;
@@ -1247,7 +1267,10 @@ type InboxReplyDraft = {
1247
1267
  readonly object: "inbox_reply_draft";
1248
1268
  readonly id: string;
1249
1269
  readonly mailbox_id: string;
1270
+ /** @deprecated The mail server's thread ID. Still supported and unchanged; store `conversation_id`. */
1250
1271
  readonly thread_id: string;
1272
+ /** Stable Shipmail conversation identifier. Store this instead of `thread_id`. */
1273
+ readonly conversation_id: string;
1251
1274
  readonly based_on_message_id: string | null;
1252
1275
  readonly expected_version: number;
1253
1276
  readonly reply_mode: "reply" | "reply_all";
@@ -1272,7 +1295,10 @@ type InboxThread = {
1272
1295
  readonly object: "inbox_thread";
1273
1296
  readonly mailbox_id: string;
1274
1297
  readonly address: string;
1298
+ /** @deprecated The mail server's thread ID. Still supported and unchanged; store `conversation_id`. */
1275
1299
  readonly thread_id: string;
1300
+ /** Stable Shipmail conversation identifier. Store this instead of `thread_id`. */
1301
+ readonly conversation_id: string | null;
1276
1302
  readonly data: readonly InboxFullMessage[];
1277
1303
  };
1278
1304
  type InboxMessageAction = {
@@ -1560,7 +1586,7 @@ declare class Messages extends ApiResource {
1560
1586
  reply(id: string, params: ReplyToMessageParams, options?: MethodOptions): Promise<Message>;
1561
1587
  }
1562
1588
 
1563
- type NewsletterStatus = "draft" | "pending_approval" | "approved" | "scheduled" | "sending" | "paused" | "sent" | "cancelled" | "failed";
1589
+ type NewsletterStatus = "draft" | "imported" | "pending_approval" | "approved" | "scheduled" | "sending" | "paused" | "sent" | "cancelled" | "failed";
1564
1590
  type NewsletterArchiveVisibility = "private" | "public";
1565
1591
  type NewsletterStylingMode = "styled" | "plain";
1566
1592
  type NewsletterDomainStatus = "pending" | "verifying" | "verified" | "failed" | "disabled";
@@ -1574,6 +1600,7 @@ type NewsletterUrlSource = "href" | "image_src" | "video_href" | "text";
1574
1600
  type NewsletterChangelogTone = "concise" | "friendly" | "technical";
1575
1601
  type NewsletterCalloutVariant = "accent" | "info" | "warning" | "success";
1576
1602
  type NewsletterColumnRatio = "50-50" | "33-67" | "67-33";
1603
+ type NewsletterColumnImageFit = "natural" | "contain" | "cover";
1577
1604
  type NewsletterButtonAlign = "left" | "center" | "right";
1578
1605
  type NewsletterDomain = {
1579
1606
  readonly object: "newsletter_domain";
@@ -1852,11 +1879,13 @@ type SendNewsletterTestParams = {
1852
1879
  type ScheduleNewsletterParams = {
1853
1880
  readonly scheduled_at: string;
1854
1881
  };
1882
+ /** Include at least one heading, body, image, or complete CTA pair. */
1855
1883
  type NewsletterColumnContent = {
1856
1884
  readonly title?: string | null | undefined;
1857
- readonly body: string;
1885
+ readonly body?: string | undefined;
1858
1886
  readonly image_url?: string | null | undefined;
1859
1887
  readonly image_alt?: string | null | undefined;
1888
+ readonly image_fit?: NewsletterColumnImageFit | undefined;
1860
1889
  readonly cta_label?: string | null | undefined;
1861
1890
  readonly cta_url?: string | null | undefined;
1862
1891
  };
@@ -2075,7 +2104,11 @@ type ReplyScanCandidate = {
2075
2104
  readonly object: "reply_scan_candidate";
2076
2105
  readonly id: string;
2077
2106
  readonly mailbox_id: string;
2107
+ /** @deprecated The mail server's thread ID. Still supported and unchanged; store `conversation_id`. */
2078
2108
  readonly thread_id: string;
2109
+ /** Stable Shipmail conversation identifier. Store this instead of `thread_id`. */
2110
+ readonly conversation_id: string;
2111
+ /** Same value as `conversation_id`, kept for compatibility. */
2079
2112
  readonly tracked_thread_id: string;
2080
2113
  readonly latest_message_id: string | null;
2081
2114
  readonly latest_email_id: string | null;
@@ -2142,6 +2175,8 @@ declare class Suppressions extends ApiResource {
2142
2175
  type Thread = {
2143
2176
  readonly object: "thread";
2144
2177
  readonly id: string;
2178
+ /** Stable Shipmail conversation identifier. Store this instead of `id`. */
2179
+ readonly conversation_id: string;
2145
2180
  readonly mailbox_id: string;
2146
2181
  readonly subject: string | null;
2147
2182
  readonly message_count: number;
@@ -2351,6 +2386,17 @@ declare class ConflictError extends ShipmailError {
2351
2386
  declare class InternalServerError extends ShipmailError {
2352
2387
  constructor(message: string, requestId?: string);
2353
2388
  }
2389
+ /**
2390
+ * A send was interrupted and its outcome is not known.
2391
+ *
2392
+ * Never retried: the message this names may already have gone out, so a retry
2393
+ * can deliver it twice. `messageId` is the tracking message the attempt left
2394
+ * behind; read it, or quote it in support, before deciding what to send.
2395
+ */
2396
+ declare class ReconciliationRequiredError extends ShipmailError {
2397
+ readonly messageId: string | undefined;
2398
+ constructor(message: string, requestId?: string, messageId?: string);
2399
+ }
2354
2400
  declare class ConnectionError extends ShipmailError {
2355
2401
  constructor(message: string);
2356
2402
  }
@@ -2372,4 +2418,4 @@ declare function verifyWebhook(body: string, headers: WebhookHeaders | Headers,
2372
2418
  readonly toleranceInSeconds?: number | undefined;
2373
2419
  }): Promise<WebhookEvent>;
2374
2420
 
2375
- export { type AddSubscriberParams, type AddSubscribersBatchParams, type AddSubscribersBatchResult, type ApiErrorBody, type Audience, type AudienceFeed, AuthenticationError, AuthorizationError, type Automation, type AutomationAction, type AutomationCondition, type AutomationDefinition, type AutomationRun, type AutomationRunStatus, type AutomationRunSummary, type AutomationStatus, type AutomationTrigger, type BookingPage, CONFERENCING_PROVIDER_IDS, type CalendarAvailability, type CalendarAvailabilityParams, type CalendarAvailabilitySlot, type CalendarEvent, type CalendarEventPrivacy, type CalendarEventStatus, type CalendarFreeBusyStatus, type CalendarInvitationLanguage, type CapabilitiesResponse, type CapabilityResourceConstraints, type ConferencingProviderId, ConflictError, ConnectionError, type ConsumePartnerMailboxCredentialGrantParams, type CreateAudienceParams, type CreateAutomationParams, 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 EmailAuthVerdict, type EmailAuthenticationResults, 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 InboxThreadAttentionResult, type InboxThreadAttentionState, type InboxThreadSummary, type InboxThreads, type InjectSandboxInboundParams, InternalServerError, type ListAudiencesParams, type ListAutomationsResponse, type ListBookingPagesParams, type ListCalendarEventsParams, type ListDeliveriesParams, type ListDomainsParams, type ListInboxMessagesParams, type ListInboxThreadsParams, type ListMailboxesParams, type ListMembersParams, type ListMessageAnalyticsParams, type ListMessagesParams, type ListNewsletterAssetsParams, type ListNewsletterDomainsParams, type ListNewsletterSenderIdentitiesParams, type ListNewslettersParams, type ListReplyScanResultsParams, type ListScheduledMessagesParams, type ListSubscribersParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MESSAGE_SOURCES, MESSAGE_STATUSES, type Mailbox, type MailboxAppPassword, type MailboxAppPasswordList, type MailboxAppPasswordPurpose, type MailboxAppPasswordState, type MailboxDeliveryDestination, type MailboxDeliveryRouting, 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 Member, type MemberRole, type MergeFields, type Message, type MessageAnalytics, type MessageAnalyticsPage, type MessageMetadata, type MessageRuleDisposition, type MessageSource, type MessageStatus, type MethodOptions, type MoveInboxMessageParams, type Newsletter, type NewsletterArchiveVisibility, type NewsletterAsset, type NewsletterAssetContentType, type NewsletterAssetKind, type NewsletterAssetListResponse, type NewsletterAssetStorageUsage, type NewsletterAssetUpload, 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 NewsletterSenderIdentity, type NewsletterStatus, type NewsletterStylingMode, 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, type PrepareNewsletterAssetUploadParams, type PrepareStagedAttachmentUploadParams, 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 ScheduledMessage, type ScheduledMessageAttachment, type ScheduledMessageList, type ScheduledMessageRecipient, type ScheduledMessageUploadedAttachment, type SearchDomainsParams, type SendMessageParams, type SendNewsletterTestParams, ShipmailClient, type ShipmailConfig, ShipmailError, type StageAttachmentParams, type StagedAttachment, type StagedAttachmentUpload, type StatusResponse, type Subscriber, type SubscriberOutcome, type SubscriberResult, type SubscriberStatus, type Suppression, type TestWebhookResponse, type Thread, type UpdateAudienceFeedParams, type UpdateAudienceParams, type UpdateAutoReplyParams, type UpdateAutomationParams, type UpdateBookingPageParams, type UpdateCalendarEventParams, type UpdateDomainParams, type UpdateInboxMessageParams, type UpdateInboxThreadAttentionParams, type UpdateMailboxDeliveryRoutingParams, type UpdateMailboxFolderParams, type UpdateMailboxParams, type UpdateMailboxRulesParams, type UpdateNewsletterParams, type UpdatePartnerOrganizationParams, type UpdateScheduledMessageParams, 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 };
2421
+ export { type AddSubscriberParams, type AddSubscribersBatchParams, type AddSubscribersBatchResult, type ApiErrorBody, type Audience, type AudienceFeed, AuthenticationError, AuthorizationError, type Automation, type AutomationAction, type AutomationCondition, type AutomationDefinition, type AutomationRun, type AutomationRunStatus, type AutomationRunSummary, type AutomationStatus, type AutomationTrigger, type BookingPage, CONFERENCING_PROVIDER_IDS, type CalendarAvailability, type CalendarAvailabilityParams, type CalendarAvailabilitySlot, type CalendarEvent, type CalendarEventPrivacy, type CalendarEventStatus, type CalendarFreeBusyStatus, type CalendarInvitationLanguage, type CapabilitiesResponse, type CapabilityResourceConstraints, type ConferencingProviderId, ConflictError, ConnectionError, type ConsumePartnerMailboxCredentialGrantParams, type CreateAudienceParams, type CreateAutomationParams, 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 EmailAuthVerdict, type EmailAuthenticationResults, 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 InboxThreadAttentionResult, type InboxThreadAttentionState, type InboxThreadSummary, type InboxThreads, type InjectSandboxInboundParams, InternalServerError, type ListAudiencesParams, type ListAutomationsResponse, type ListBookingPagesParams, type ListCalendarEventsParams, type ListDeliveriesParams, type ListDomainsParams, type ListInboxMessagesParams, type ListInboxThreadsParams, type ListMailboxesParams, type ListMembersParams, type ListMessageAnalyticsParams, type ListMessagesParams, type ListNewsletterAssetsParams, type ListNewsletterDomainsParams, type ListNewsletterSenderIdentitiesParams, type ListNewslettersParams, type ListReplyScanResultsParams, type ListScheduledMessagesParams, type ListSubscribersParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MESSAGE_SOURCES, MESSAGE_STATUSES, type Mailbox, type MailboxAppPassword, type MailboxAppPasswordList, type MailboxAppPasswordPurpose, type MailboxAppPasswordState, type MailboxDeliveryDestination, type MailboxDeliveryRouting, 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 Member, type MemberRole, type MergeFields, type Message, type MessageAnalytics, type MessageAnalyticsPage, type MessageMetadata, type MessageRuleDisposition, type MessageSource, type MessageStatus, type MethodOptions, type MoveInboxMessageParams, type Newsletter, type NewsletterArchiveVisibility, type NewsletterAsset, type NewsletterAssetContentType, type NewsletterAssetKind, type NewsletterAssetListResponse, type NewsletterAssetStorageUsage, type NewsletterAssetUpload, type NewsletterBlock, type NewsletterButtonAlign, type NewsletterCalloutVariant, type NewsletterChangelogEntry, type NewsletterChangelogMedia, type NewsletterChangelogTone, type NewsletterColumnContent, type NewsletterColumnImageFit, type NewsletterColumnRatio, type NewsletterCountedUrl, type NewsletterDomain, type NewsletterDomainRecordStatus, type NewsletterDomainStatus, type NewsletterPreflight, type NewsletterPreflightItem, type NewsletterPreflightItemStatus, type NewsletterPreflightStatus, type NewsletterPreview, type NewsletterSenderIdentity, type NewsletterStatus, type NewsletterStylingMode, 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, type PrepareNewsletterAssetUploadParams, type PrepareStagedAttachmentUploadParams, QuotaExceededError, RateLimitError, ReconciliationRequiredError, 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 ScheduledMessage, type ScheduledMessageAttachment, type ScheduledMessageList, type ScheduledMessageRecipient, type ScheduledMessageUploadedAttachment, type SearchDomainsParams, type SendMessageParams, type SendNewsletterTestParams, ShipmailClient, type ShipmailConfig, ShipmailError, type StageAttachmentParams, type StagedAttachment, type StagedAttachmentUpload, type StatusResponse, type Subscriber, type SubscriberOutcome, type SubscriberResult, type SubscriberStatus, type Suppression, type TestWebhookResponse, type Thread, type UpdateAudienceFeedParams, type UpdateAudienceParams, type UpdateAutoReplyParams, type UpdateAutomationParams, type UpdateBookingPageParams, type UpdateCalendarEventParams, type UpdateDomainParams, type UpdateInboxMessageParams, type UpdateInboxThreadAttentionParams, type UpdateMailboxDeliveryRoutingParams, type UpdateMailboxFolderParams, type UpdateMailboxParams, type UpdateMailboxRulesParams, type UpdateNewsletterParams, type UpdatePartnerOrganizationParams, type UpdateScheduledMessageParams, 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
@@ -157,6 +157,18 @@ var InternalServerError = class extends ShipmailError {
157
157
  this.name = "InternalServerError";
158
158
  }
159
159
  };
160
+ var ReconciliationRequiredError = class extends ShipmailError {
161
+ constructor(message, requestId, messageId) {
162
+ super(message, {
163
+ status: 409,
164
+ type: "reconciliation_required",
165
+ requestId,
166
+ retryable: false
167
+ });
168
+ this.name = "ReconciliationRequiredError";
169
+ this.messageId = messageId;
170
+ }
171
+ };
160
172
  var ConnectionError = class extends ShipmailError {
161
173
  constructor(message) {
162
174
  super(message, { retryable: true });
@@ -187,6 +199,8 @@ function mapErrorFromResponse(status, body, requestId) {
187
199
  return new RateLimitError(error.message, { requestId: rid, retryAfter: error.retry_after });
188
200
  case "conflict":
189
201
  return new ConflictError(error.message, rid);
202
+ case "reconciliation_required":
203
+ return new ReconciliationRequiredError(error.message, rid, error.message_id);
190
204
  case "internal_error":
191
205
  return new InternalServerError(error.message, rid);
192
206
  default:
@@ -1681,7 +1695,7 @@ var Webhooks = class extends ApiResource {
1681
1695
  };
1682
1696
 
1683
1697
  // src/version.ts
1684
- var VERSION = "0.5.1";
1698
+ var VERSION = "0.5.3";
1685
1699
 
1686
1700
  // src/client.ts
1687
1701
  var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
@@ -1937,6 +1951,6 @@ async function verifyWebhook(body, headers, secret, options) {
1937
1951
  return parsed;
1938
1952
  }
1939
1953
 
1940
- export { API_KEY_SCOPES, API_KEY_SCOPE_DESCRIPTIONS, AuthenticationError, AuthorizationError, CONFERENCING_PROVIDER_IDS, 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, apiKeyScopesGrant, ShipmailClient as default, isApiKeyScope, verifyWebhook };
1954
+ export { API_KEY_SCOPES, API_KEY_SCOPE_DESCRIPTIONS, AuthenticationError, AuthorizationError, CONFERENCING_PROVIDER_IDS, ConflictError, ConnectionError, DOMAIN_STATUSES, InternalServerError, MESSAGE_SOURCES, MESSAGE_STATUSES, NotFoundError, Page, QuotaExceededError, RateLimitError, ReconciliationRequiredError, ShipmailClient, ShipmailError, ValidationError, WEBHOOK_DELIVERY_EVENT_TYPES, WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, WebhookVerificationError, apiKeyScopesGrant, ShipmailClient as default, isApiKeyScope, verifyWebhook };
1941
1955
  //# sourceMappingURL=index.js.map
1942
1956
  //# sourceMappingURL=index.js.map