shipmail 0.3.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -0
- package/dist/api-key-scopes.cjs +86 -0
- package/dist/api-key-scopes.cjs.map +1 -0
- package/dist/api-key-scopes.d.cts +7 -0
- package/dist/api-key-scopes.d.ts +7 -0
- package/dist/api-key-scopes.js +81 -0
- package/dist/api-key-scopes.js.map +1 -0
- package/dist/index.cjs +152 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +137 -1
- package/dist/index.d.ts +137 -1
- package/dist/index.js +149 -2
- package/dist/index.js.map +1 -1
- package/package.json +18 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { API_KEY_SCOPES, API_KEY_SCOPE_DESCRIPTIONS, ApiKeyScope, apiKeyScopesGrant, isApiKeyScope } from './api-key-scopes.cjs';
|
|
2
|
+
|
|
1
3
|
declare class Page<T> implements AsyncIterable<T> {
|
|
2
4
|
private readonly client;
|
|
3
5
|
private readonly path;
|
|
@@ -382,6 +384,33 @@ declare class Calendar extends ApiResource {
|
|
|
382
384
|
availability(params: CalendarAvailabilityParams, options?: MethodOptions): Promise<CalendarAvailability>;
|
|
383
385
|
}
|
|
384
386
|
|
|
387
|
+
type CapabilityResourceConstraints = {
|
|
388
|
+
readonly mailbox_ids: readonly string[] | null;
|
|
389
|
+
readonly domain_ids: readonly string[] | null;
|
|
390
|
+
readonly audience_ids: readonly string[] | null;
|
|
391
|
+
readonly allowed_recipient_addresses: readonly string[] | null;
|
|
392
|
+
readonly allowed_recipient_domains: readonly string[] | null;
|
|
393
|
+
};
|
|
394
|
+
type TransactionalRecipientBudget = {
|
|
395
|
+
readonly unlimited: boolean;
|
|
396
|
+
readonly limit: number | null;
|
|
397
|
+
readonly used: number;
|
|
398
|
+
readonly remaining: number | null;
|
|
399
|
+
readonly window_hours: 24;
|
|
400
|
+
};
|
|
401
|
+
type CapabilitiesResponse = {
|
|
402
|
+
readonly capability_version: string;
|
|
403
|
+
readonly scopes: readonly string[];
|
|
404
|
+
readonly constraints: CapabilityResourceConstraints;
|
|
405
|
+
readonly allowed_mcp_tools: readonly string[];
|
|
406
|
+
readonly transactional_recipient_budget: TransactionalRecipientBudget;
|
|
407
|
+
readonly undo_hold_seconds: number;
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
declare class Capabilities extends ApiResource {
|
|
411
|
+
get(options?: MethodOptions): Promise<CapabilitiesResponse>;
|
|
412
|
+
}
|
|
413
|
+
|
|
385
414
|
type Domain = {
|
|
386
415
|
readonly object: "domain";
|
|
387
416
|
readonly id: string;
|
|
@@ -633,6 +662,37 @@ type Attachment = {
|
|
|
633
662
|
readonly content: string;
|
|
634
663
|
readonly content_type?: string | undefined;
|
|
635
664
|
};
|
|
665
|
+
type StagedAttachment = {
|
|
666
|
+
readonly object: "staged_attachment";
|
|
667
|
+
readonly id: string;
|
|
668
|
+
readonly mailbox_id: string;
|
|
669
|
+
readonly filename: string;
|
|
670
|
+
readonly content_type: string;
|
|
671
|
+
readonly size: number;
|
|
672
|
+
readonly sha256: string;
|
|
673
|
+
readonly expires_at: string;
|
|
674
|
+
};
|
|
675
|
+
type StageAttachmentParams = {
|
|
676
|
+
readonly filename: string;
|
|
677
|
+
readonly data: ArrayBuffer | Uint8Array;
|
|
678
|
+
readonly content_type?: string | undefined;
|
|
679
|
+
};
|
|
680
|
+
type PrepareStagedAttachmentUploadParams = {
|
|
681
|
+
readonly filename: string;
|
|
682
|
+
readonly content_type: string;
|
|
683
|
+
readonly size: number;
|
|
684
|
+
readonly sha256: string;
|
|
685
|
+
};
|
|
686
|
+
type StagedAttachmentUpload = {
|
|
687
|
+
readonly object: "staged_attachment_upload";
|
|
688
|
+
readonly mailbox_id: string;
|
|
689
|
+
readonly filename: string;
|
|
690
|
+
readonly content_type: string;
|
|
691
|
+
readonly size: number;
|
|
692
|
+
readonly sha256: string;
|
|
693
|
+
readonly upload_url: string;
|
|
694
|
+
readonly expires_at: string;
|
|
695
|
+
};
|
|
636
696
|
type OutboundHeader = {
|
|
637
697
|
readonly name: string;
|
|
638
698
|
readonly value: string;
|
|
@@ -651,6 +711,7 @@ type SendMessageParams = {
|
|
|
651
711
|
readonly in_reply_to?: string | undefined;
|
|
652
712
|
readonly references?: readonly string[] | undefined;
|
|
653
713
|
readonly attachments?: readonly Attachment[] | undefined;
|
|
714
|
+
readonly staged_attachment_ids?: readonly string[] | undefined;
|
|
654
715
|
readonly client_reference?: string | undefined;
|
|
655
716
|
readonly metadata?: MessageMetadata | undefined;
|
|
656
717
|
readonly source_rfc_message_id?: string | undefined;
|
|
@@ -658,6 +719,70 @@ type SendMessageParams = {
|
|
|
658
719
|
readonly scheduled_at?: string | undefined;
|
|
659
720
|
readonly sandbox_outcome?: SandboxOutcome | undefined;
|
|
660
721
|
};
|
|
722
|
+
type ScheduledMessageRecipient = {
|
|
723
|
+
readonly address: string;
|
|
724
|
+
readonly name?: string | null;
|
|
725
|
+
};
|
|
726
|
+
type ScheduledMessageAttachment = {
|
|
727
|
+
readonly filename: string;
|
|
728
|
+
readonly size: number;
|
|
729
|
+
readonly content_type: string;
|
|
730
|
+
};
|
|
731
|
+
type ScheduledMessageUploadedAttachment = {
|
|
732
|
+
readonly blob_id: string;
|
|
733
|
+
readonly filename: string;
|
|
734
|
+
readonly content_type: string;
|
|
735
|
+
readonly size: number;
|
|
736
|
+
};
|
|
737
|
+
type ScheduledMessage = {
|
|
738
|
+
readonly object: "scheduled_message";
|
|
739
|
+
readonly id: string;
|
|
740
|
+
readonly scheduled_message_id: string;
|
|
741
|
+
readonly kind: "scheduled" | "undo";
|
|
742
|
+
readonly mailbox_id: string;
|
|
743
|
+
readonly mailbox_address: string;
|
|
744
|
+
readonly from_address: string;
|
|
745
|
+
readonly identity_id: string;
|
|
746
|
+
readonly mode: DataMode;
|
|
747
|
+
readonly subject: string;
|
|
748
|
+
readonly to: readonly ScheduledMessageRecipient[];
|
|
749
|
+
readonly cc: readonly ScheduledMessageRecipient[];
|
|
750
|
+
readonly bcc: readonly ScheduledMessageRecipient[];
|
|
751
|
+
readonly attachments: readonly ScheduledMessageAttachment[];
|
|
752
|
+
readonly scheduled_at: string;
|
|
753
|
+
readonly created_at: string;
|
|
754
|
+
readonly updated_at: string;
|
|
755
|
+
readonly last_error: string | null;
|
|
756
|
+
readonly draft_email_id?: string | undefined;
|
|
757
|
+
readonly from_name?: string | undefined;
|
|
758
|
+
readonly text?: string | undefined;
|
|
759
|
+
readonly html?: string | undefined;
|
|
760
|
+
readonly in_reply_to?: string | null | undefined;
|
|
761
|
+
readonly references?: readonly string[] | undefined;
|
|
762
|
+
readonly uploaded_attachments?: readonly ScheduledMessageUploadedAttachment[] | undefined;
|
|
763
|
+
};
|
|
764
|
+
type ScheduledMessageList = {
|
|
765
|
+
readonly object: "scheduled_message_list";
|
|
766
|
+
readonly data: readonly ScheduledMessage[];
|
|
767
|
+
readonly total: number;
|
|
768
|
+
};
|
|
769
|
+
type ListScheduledMessagesParams = {
|
|
770
|
+
readonly include_held?: boolean | undefined;
|
|
771
|
+
readonly search?: string | undefined;
|
|
772
|
+
readonly limit?: number | undefined;
|
|
773
|
+
};
|
|
774
|
+
type UpdateScheduledMessageParams = {
|
|
775
|
+
readonly to: readonly EmailRecipientInput[];
|
|
776
|
+
readonly cc?: readonly EmailRecipientInput[] | undefined;
|
|
777
|
+
readonly bcc?: readonly EmailRecipientInput[] | undefined;
|
|
778
|
+
readonly subject: string;
|
|
779
|
+
readonly html?: string | undefined;
|
|
780
|
+
readonly text?: string | undefined;
|
|
781
|
+
readonly in_reply_to?: string | undefined;
|
|
782
|
+
readonly references?: readonly string[] | undefined;
|
|
783
|
+
readonly staged_attachment_ids?: readonly string[] | undefined;
|
|
784
|
+
readonly scheduled_at: string;
|
|
785
|
+
};
|
|
661
786
|
type ListMessagesParams = PaginationParams & ({
|
|
662
787
|
readonly mailbox_id: string;
|
|
663
788
|
readonly client_reference?: string | undefined;
|
|
@@ -1033,6 +1158,8 @@ type UpdateSpamFilterParams = {
|
|
|
1033
1158
|
};
|
|
1034
1159
|
|
|
1035
1160
|
declare class Mailboxes extends ApiResource {
|
|
1161
|
+
prepareStagedAttachmentUpload(id: string, params: PrepareStagedAttachmentUploadParams, options?: OneTimeSecretMethodOptions): Promise<StagedAttachmentUpload>;
|
|
1162
|
+
stageAttachment(id: string, params: StageAttachmentParams, options?: MethodOptions): Promise<StagedAttachment>;
|
|
1036
1163
|
injectSandboxInbound(id: string, params: InjectSandboxInboundParams, options?: MethodOptions): Promise<Message>;
|
|
1037
1164
|
create(params: CreateMailboxParams, options?: MethodOptions): Promise<Mailbox>;
|
|
1038
1165
|
list(params?: ListMailboxesParams, options?: MethodOptions): Promise<PaginatedResponse<Mailbox>>;
|
|
@@ -1574,6 +1701,13 @@ declare class ReplyScans extends ApiResource {
|
|
|
1574
1701
|
listResults(id: string, params?: ListReplyScanResultsParams, options?: MethodOptions): Promise<ReplyScanResults>;
|
|
1575
1702
|
}
|
|
1576
1703
|
|
|
1704
|
+
declare class ScheduledMessages extends ApiResource {
|
|
1705
|
+
list(params?: ListScheduledMessagesParams, options?: MethodOptions): Promise<ScheduledMessageList>;
|
|
1706
|
+
get(id: string, options?: MethodOptions): Promise<ScheduledMessage>;
|
|
1707
|
+
update(id: string, params: UpdateScheduledMessageParams, options?: MethodOptions): Promise<ScheduledMessage>;
|
|
1708
|
+
cancel(id: string, options?: MethodOptions): Promise<void>;
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1577
1711
|
declare class Status extends ApiResource {
|
|
1578
1712
|
get(options?: MethodOptions): Promise<StatusResponse>;
|
|
1579
1713
|
}
|
|
@@ -1728,6 +1862,7 @@ declare class ShipMailClient {
|
|
|
1728
1862
|
private readonly organizationId;
|
|
1729
1863
|
readonly audiences: Audiences;
|
|
1730
1864
|
readonly bookingPages: BookingPages;
|
|
1865
|
+
readonly capabilities: Capabilities;
|
|
1731
1866
|
readonly calendar: Calendar;
|
|
1732
1867
|
readonly domains: Domains;
|
|
1733
1868
|
readonly mailboxes: Mailboxes;
|
|
@@ -1735,6 +1870,7 @@ declare class ShipMailClient {
|
|
|
1735
1870
|
readonly newsletters: Newsletters;
|
|
1736
1871
|
readonly partner: Partner;
|
|
1737
1872
|
readonly replyScans: ReplyScans;
|
|
1873
|
+
readonly scheduledMessages: ScheduledMessages;
|
|
1738
1874
|
readonly suppressions: Suppressions;
|
|
1739
1875
|
readonly threads: Threads;
|
|
1740
1876
|
readonly webhooks: Webhooks;
|
|
@@ -1823,4 +1959,4 @@ declare function verifyWebhook(body: string, headers: WebhookHeaders | Headers,
|
|
|
1823
1959
|
readonly toleranceInSeconds?: number | undefined;
|
|
1824
1960
|
}): Promise<WebhookEvent>;
|
|
1825
1961
|
|
|
1826
|
-
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 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 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 };
|
|
1962
|
+
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 CapabilitiesResponse, type CapabilityResourceConstraints, 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 ListScheduledMessagesParams, 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 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, 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 TransactionalRecipientBudget, type UpdateAudienceParams, type UpdateAutoReplyParams, type UpdateBookingPageParams, type UpdateCalendarEventParams, type UpdateDomainParams, type UpdateInboxMessageParams, type UpdateInboxThreadReplyStateParams, type UpdateMailboxFolderParams, type UpdateMailboxParams, type UpdateNewsletterParams, type UpdatePartnerOrganizationParams, type UpdateScheduledMessageParams, 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.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { API_KEY_SCOPES, API_KEY_SCOPE_DESCRIPTIONS, ApiKeyScope, apiKeyScopesGrant, isApiKeyScope } from './api-key-scopes.js';
|
|
2
|
+
|
|
1
3
|
declare class Page<T> implements AsyncIterable<T> {
|
|
2
4
|
private readonly client;
|
|
3
5
|
private readonly path;
|
|
@@ -382,6 +384,33 @@ declare class Calendar extends ApiResource {
|
|
|
382
384
|
availability(params: CalendarAvailabilityParams, options?: MethodOptions): Promise<CalendarAvailability>;
|
|
383
385
|
}
|
|
384
386
|
|
|
387
|
+
type CapabilityResourceConstraints = {
|
|
388
|
+
readonly mailbox_ids: readonly string[] | null;
|
|
389
|
+
readonly domain_ids: readonly string[] | null;
|
|
390
|
+
readonly audience_ids: readonly string[] | null;
|
|
391
|
+
readonly allowed_recipient_addresses: readonly string[] | null;
|
|
392
|
+
readonly allowed_recipient_domains: readonly string[] | null;
|
|
393
|
+
};
|
|
394
|
+
type TransactionalRecipientBudget = {
|
|
395
|
+
readonly unlimited: boolean;
|
|
396
|
+
readonly limit: number | null;
|
|
397
|
+
readonly used: number;
|
|
398
|
+
readonly remaining: number | null;
|
|
399
|
+
readonly window_hours: 24;
|
|
400
|
+
};
|
|
401
|
+
type CapabilitiesResponse = {
|
|
402
|
+
readonly capability_version: string;
|
|
403
|
+
readonly scopes: readonly string[];
|
|
404
|
+
readonly constraints: CapabilityResourceConstraints;
|
|
405
|
+
readonly allowed_mcp_tools: readonly string[];
|
|
406
|
+
readonly transactional_recipient_budget: TransactionalRecipientBudget;
|
|
407
|
+
readonly undo_hold_seconds: number;
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
declare class Capabilities extends ApiResource {
|
|
411
|
+
get(options?: MethodOptions): Promise<CapabilitiesResponse>;
|
|
412
|
+
}
|
|
413
|
+
|
|
385
414
|
type Domain = {
|
|
386
415
|
readonly object: "domain";
|
|
387
416
|
readonly id: string;
|
|
@@ -633,6 +662,37 @@ type Attachment = {
|
|
|
633
662
|
readonly content: string;
|
|
634
663
|
readonly content_type?: string | undefined;
|
|
635
664
|
};
|
|
665
|
+
type StagedAttachment = {
|
|
666
|
+
readonly object: "staged_attachment";
|
|
667
|
+
readonly id: string;
|
|
668
|
+
readonly mailbox_id: string;
|
|
669
|
+
readonly filename: string;
|
|
670
|
+
readonly content_type: string;
|
|
671
|
+
readonly size: number;
|
|
672
|
+
readonly sha256: string;
|
|
673
|
+
readonly expires_at: string;
|
|
674
|
+
};
|
|
675
|
+
type StageAttachmentParams = {
|
|
676
|
+
readonly filename: string;
|
|
677
|
+
readonly data: ArrayBuffer | Uint8Array;
|
|
678
|
+
readonly content_type?: string | undefined;
|
|
679
|
+
};
|
|
680
|
+
type PrepareStagedAttachmentUploadParams = {
|
|
681
|
+
readonly filename: string;
|
|
682
|
+
readonly content_type: string;
|
|
683
|
+
readonly size: number;
|
|
684
|
+
readonly sha256: string;
|
|
685
|
+
};
|
|
686
|
+
type StagedAttachmentUpload = {
|
|
687
|
+
readonly object: "staged_attachment_upload";
|
|
688
|
+
readonly mailbox_id: string;
|
|
689
|
+
readonly filename: string;
|
|
690
|
+
readonly content_type: string;
|
|
691
|
+
readonly size: number;
|
|
692
|
+
readonly sha256: string;
|
|
693
|
+
readonly upload_url: string;
|
|
694
|
+
readonly expires_at: string;
|
|
695
|
+
};
|
|
636
696
|
type OutboundHeader = {
|
|
637
697
|
readonly name: string;
|
|
638
698
|
readonly value: string;
|
|
@@ -651,6 +711,7 @@ type SendMessageParams = {
|
|
|
651
711
|
readonly in_reply_to?: string | undefined;
|
|
652
712
|
readonly references?: readonly string[] | undefined;
|
|
653
713
|
readonly attachments?: readonly Attachment[] | undefined;
|
|
714
|
+
readonly staged_attachment_ids?: readonly string[] | undefined;
|
|
654
715
|
readonly client_reference?: string | undefined;
|
|
655
716
|
readonly metadata?: MessageMetadata | undefined;
|
|
656
717
|
readonly source_rfc_message_id?: string | undefined;
|
|
@@ -658,6 +719,70 @@ type SendMessageParams = {
|
|
|
658
719
|
readonly scheduled_at?: string | undefined;
|
|
659
720
|
readonly sandbox_outcome?: SandboxOutcome | undefined;
|
|
660
721
|
};
|
|
722
|
+
type ScheduledMessageRecipient = {
|
|
723
|
+
readonly address: string;
|
|
724
|
+
readonly name?: string | null;
|
|
725
|
+
};
|
|
726
|
+
type ScheduledMessageAttachment = {
|
|
727
|
+
readonly filename: string;
|
|
728
|
+
readonly size: number;
|
|
729
|
+
readonly content_type: string;
|
|
730
|
+
};
|
|
731
|
+
type ScheduledMessageUploadedAttachment = {
|
|
732
|
+
readonly blob_id: string;
|
|
733
|
+
readonly filename: string;
|
|
734
|
+
readonly content_type: string;
|
|
735
|
+
readonly size: number;
|
|
736
|
+
};
|
|
737
|
+
type ScheduledMessage = {
|
|
738
|
+
readonly object: "scheduled_message";
|
|
739
|
+
readonly id: string;
|
|
740
|
+
readonly scheduled_message_id: string;
|
|
741
|
+
readonly kind: "scheduled" | "undo";
|
|
742
|
+
readonly mailbox_id: string;
|
|
743
|
+
readonly mailbox_address: string;
|
|
744
|
+
readonly from_address: string;
|
|
745
|
+
readonly identity_id: string;
|
|
746
|
+
readonly mode: DataMode;
|
|
747
|
+
readonly subject: string;
|
|
748
|
+
readonly to: readonly ScheduledMessageRecipient[];
|
|
749
|
+
readonly cc: readonly ScheduledMessageRecipient[];
|
|
750
|
+
readonly bcc: readonly ScheduledMessageRecipient[];
|
|
751
|
+
readonly attachments: readonly ScheduledMessageAttachment[];
|
|
752
|
+
readonly scheduled_at: string;
|
|
753
|
+
readonly created_at: string;
|
|
754
|
+
readonly updated_at: string;
|
|
755
|
+
readonly last_error: string | null;
|
|
756
|
+
readonly draft_email_id?: string | undefined;
|
|
757
|
+
readonly from_name?: string | undefined;
|
|
758
|
+
readonly text?: string | undefined;
|
|
759
|
+
readonly html?: string | undefined;
|
|
760
|
+
readonly in_reply_to?: string | null | undefined;
|
|
761
|
+
readonly references?: readonly string[] | undefined;
|
|
762
|
+
readonly uploaded_attachments?: readonly ScheduledMessageUploadedAttachment[] | undefined;
|
|
763
|
+
};
|
|
764
|
+
type ScheduledMessageList = {
|
|
765
|
+
readonly object: "scheduled_message_list";
|
|
766
|
+
readonly data: readonly ScheduledMessage[];
|
|
767
|
+
readonly total: number;
|
|
768
|
+
};
|
|
769
|
+
type ListScheduledMessagesParams = {
|
|
770
|
+
readonly include_held?: boolean | undefined;
|
|
771
|
+
readonly search?: string | undefined;
|
|
772
|
+
readonly limit?: number | undefined;
|
|
773
|
+
};
|
|
774
|
+
type UpdateScheduledMessageParams = {
|
|
775
|
+
readonly to: readonly EmailRecipientInput[];
|
|
776
|
+
readonly cc?: readonly EmailRecipientInput[] | undefined;
|
|
777
|
+
readonly bcc?: readonly EmailRecipientInput[] | undefined;
|
|
778
|
+
readonly subject: string;
|
|
779
|
+
readonly html?: string | undefined;
|
|
780
|
+
readonly text?: string | undefined;
|
|
781
|
+
readonly in_reply_to?: string | undefined;
|
|
782
|
+
readonly references?: readonly string[] | undefined;
|
|
783
|
+
readonly staged_attachment_ids?: readonly string[] | undefined;
|
|
784
|
+
readonly scheduled_at: string;
|
|
785
|
+
};
|
|
661
786
|
type ListMessagesParams = PaginationParams & ({
|
|
662
787
|
readonly mailbox_id: string;
|
|
663
788
|
readonly client_reference?: string | undefined;
|
|
@@ -1033,6 +1158,8 @@ type UpdateSpamFilterParams = {
|
|
|
1033
1158
|
};
|
|
1034
1159
|
|
|
1035
1160
|
declare class Mailboxes extends ApiResource {
|
|
1161
|
+
prepareStagedAttachmentUpload(id: string, params: PrepareStagedAttachmentUploadParams, options?: OneTimeSecretMethodOptions): Promise<StagedAttachmentUpload>;
|
|
1162
|
+
stageAttachment(id: string, params: StageAttachmentParams, options?: MethodOptions): Promise<StagedAttachment>;
|
|
1036
1163
|
injectSandboxInbound(id: string, params: InjectSandboxInboundParams, options?: MethodOptions): Promise<Message>;
|
|
1037
1164
|
create(params: CreateMailboxParams, options?: MethodOptions): Promise<Mailbox>;
|
|
1038
1165
|
list(params?: ListMailboxesParams, options?: MethodOptions): Promise<PaginatedResponse<Mailbox>>;
|
|
@@ -1574,6 +1701,13 @@ declare class ReplyScans extends ApiResource {
|
|
|
1574
1701
|
listResults(id: string, params?: ListReplyScanResultsParams, options?: MethodOptions): Promise<ReplyScanResults>;
|
|
1575
1702
|
}
|
|
1576
1703
|
|
|
1704
|
+
declare class ScheduledMessages extends ApiResource {
|
|
1705
|
+
list(params?: ListScheduledMessagesParams, options?: MethodOptions): Promise<ScheduledMessageList>;
|
|
1706
|
+
get(id: string, options?: MethodOptions): Promise<ScheduledMessage>;
|
|
1707
|
+
update(id: string, params: UpdateScheduledMessageParams, options?: MethodOptions): Promise<ScheduledMessage>;
|
|
1708
|
+
cancel(id: string, options?: MethodOptions): Promise<void>;
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1577
1711
|
declare class Status extends ApiResource {
|
|
1578
1712
|
get(options?: MethodOptions): Promise<StatusResponse>;
|
|
1579
1713
|
}
|
|
@@ -1728,6 +1862,7 @@ declare class ShipMailClient {
|
|
|
1728
1862
|
private readonly organizationId;
|
|
1729
1863
|
readonly audiences: Audiences;
|
|
1730
1864
|
readonly bookingPages: BookingPages;
|
|
1865
|
+
readonly capabilities: Capabilities;
|
|
1731
1866
|
readonly calendar: Calendar;
|
|
1732
1867
|
readonly domains: Domains;
|
|
1733
1868
|
readonly mailboxes: Mailboxes;
|
|
@@ -1735,6 +1870,7 @@ declare class ShipMailClient {
|
|
|
1735
1870
|
readonly newsletters: Newsletters;
|
|
1736
1871
|
readonly partner: Partner;
|
|
1737
1872
|
readonly replyScans: ReplyScans;
|
|
1873
|
+
readonly scheduledMessages: ScheduledMessages;
|
|
1738
1874
|
readonly suppressions: Suppressions;
|
|
1739
1875
|
readonly threads: Threads;
|
|
1740
1876
|
readonly webhooks: Webhooks;
|
|
@@ -1823,4 +1959,4 @@ declare function verifyWebhook(body: string, headers: WebhookHeaders | Headers,
|
|
|
1823
1959
|
readonly toleranceInSeconds?: number | undefined;
|
|
1824
1960
|
}): Promise<WebhookEvent>;
|
|
1825
1961
|
|
|
1826
|
-
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 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 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 };
|
|
1962
|
+
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 CapabilitiesResponse, type CapabilityResourceConstraints, 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 ListScheduledMessagesParams, 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 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, 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 TransactionalRecipientBudget, type UpdateAudienceParams, type UpdateAutoReplyParams, type UpdateBookingPageParams, type UpdateCalendarEventParams, type UpdateDomainParams, type UpdateInboxMessageParams, type UpdateInboxThreadReplyStateParams, type UpdateMailboxFolderParams, type UpdateMailboxParams, type UpdateNewsletterParams, type UpdatePartnerOrganizationParams, type UpdateScheduledMessageParams, 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
|
@@ -1,3 +1,81 @@
|
|
|
1
|
+
// src/api-key-scopes.ts
|
|
2
|
+
var API_KEY_SCOPES = [
|
|
3
|
+
"*",
|
|
4
|
+
"audiences:read",
|
|
5
|
+
"audiences:write",
|
|
6
|
+
"booking_pages:read",
|
|
7
|
+
"booking_pages:write",
|
|
8
|
+
"calendar:read",
|
|
9
|
+
"calendar:write",
|
|
10
|
+
"domains:read",
|
|
11
|
+
"domains:write",
|
|
12
|
+
"mailboxes:read",
|
|
13
|
+
"mailboxes:export",
|
|
14
|
+
"mailboxes:write",
|
|
15
|
+
"mailbox_credentials:read",
|
|
16
|
+
"mailbox_credentials:write",
|
|
17
|
+
"mailbox_forwarding:read",
|
|
18
|
+
"mailbox_forwarding:write",
|
|
19
|
+
"messages:read",
|
|
20
|
+
"messages:write",
|
|
21
|
+
"drafts:write",
|
|
22
|
+
"messages:send",
|
|
23
|
+
"newsletters:read",
|
|
24
|
+
"newsletters:write",
|
|
25
|
+
"threads:read",
|
|
26
|
+
"webhooks:read",
|
|
27
|
+
"webhooks:write",
|
|
28
|
+
"suppressions:read",
|
|
29
|
+
"suppressions:write",
|
|
30
|
+
"partner:organizations:read",
|
|
31
|
+
"partner:organizations:write",
|
|
32
|
+
"partner:organizations:access",
|
|
33
|
+
"partner:mailbox_credentials:issue",
|
|
34
|
+
"partner:usage:read"
|
|
35
|
+
];
|
|
36
|
+
var API_KEY_SCOPE_DESCRIPTIONS = {
|
|
37
|
+
"*": "All non-partner API endpoints in this organization.",
|
|
38
|
+
"audiences:read": "List and retrieve newsletter audiences and their subscribers.",
|
|
39
|
+
"audiences:write": "Create audiences and add, update, or remove their subscribers.",
|
|
40
|
+
"booking_pages:read": "List and retrieve booking pages.",
|
|
41
|
+
"booking_pages:write": "Create, update, and delete booking pages.",
|
|
42
|
+
"calendar:read": "List and retrieve calendar events and open availability.",
|
|
43
|
+
"calendar:write": "Create, update, and delete calendar events.",
|
|
44
|
+
"domains:read": "List, retrieve, and verify domains.",
|
|
45
|
+
"domains:write": "Create, update, and delete domains.",
|
|
46
|
+
"mailboxes:read": "List and retrieve mailboxes.",
|
|
47
|
+
"mailboxes:export": "Create and download mailbox content exports.",
|
|
48
|
+
"mailboxes:write": "Create, update, suspend, resume, and delete mailboxes.",
|
|
49
|
+
"mailbox_credentials:read": "List revocable app passwords for allowed mailboxes.",
|
|
50
|
+
"mailbox_credentials:write": "Create and revoke app passwords for allowed mailboxes.",
|
|
51
|
+
"mailbox_forwarding:read": "List forwarding destinations for allowed mailboxes.",
|
|
52
|
+
"mailbox_forwarding:write": "Create and remove forwarding destinations for allowed mailboxes.",
|
|
53
|
+
"messages:read": "List and retrieve messages.",
|
|
54
|
+
"messages:write": "Update, move, delete, and inject sandbox messages.",
|
|
55
|
+
"drafts:write": "Create agent-safe reply drafts with server-derived recipients.",
|
|
56
|
+
"messages:send": "Send messages, replies, and approved reply drafts.",
|
|
57
|
+
"newsletters:read": "List and retrieve newsletter drafts and campaigns.",
|
|
58
|
+
"newsletters:write": "Create, update, test, schedule, cancel, and resume newsletters.",
|
|
59
|
+
"threads:read": "List threads and retrieve thread messages.",
|
|
60
|
+
"webhooks:read": "List webhooks, retrieve webhooks, and list deliveries.",
|
|
61
|
+
"webhooks:write": "Create, update, delete, test, and rotate webhooks.",
|
|
62
|
+
"suppressions:read": "List suppressed recipient addresses.",
|
|
63
|
+
"suppressions:write": "Remove addresses from the suppression list.",
|
|
64
|
+
"partner:organizations:read": "List and retrieve this partner's child organizations.",
|
|
65
|
+
"partner:organizations:write": "Create and manage this partner's child organizations.",
|
|
66
|
+
"partner:organizations:access": "Act on an active child using the delegated organization header.",
|
|
67
|
+
"partner:mailbox_credentials:issue": "List and consume operator-approved grants for embedded-webmail credentials.",
|
|
68
|
+
"partner:usage:read": "Read consolidated child and mailbox usage for this partner."
|
|
69
|
+
};
|
|
70
|
+
function isApiKeyScope(value) {
|
|
71
|
+
return API_KEY_SCOPES.some((scope) => scope === value);
|
|
72
|
+
}
|
|
73
|
+
function apiKeyScopesGrant(grantedScopes, requiredScope) {
|
|
74
|
+
if (requiredScope === "public") return true;
|
|
75
|
+
if (requiredScope.startsWith("partner:")) return grantedScopes.includes(requiredScope);
|
|
76
|
+
return grantedScopes.includes("*") || grantedScopes.includes(requiredScope);
|
|
77
|
+
}
|
|
78
|
+
|
|
1
79
|
// src/errors.ts
|
|
2
80
|
var ShipMailError = class extends Error {
|
|
3
81
|
constructor(message, options) {
|
|
@@ -409,6 +487,17 @@ var Calendar = class extends ApiResource {
|
|
|
409
487
|
}
|
|
410
488
|
};
|
|
411
489
|
|
|
490
|
+
// src/resources/capabilities.ts
|
|
491
|
+
var Capabilities = class extends ApiResource {
|
|
492
|
+
get(options) {
|
|
493
|
+
return this.client.request({
|
|
494
|
+
method: "GET",
|
|
495
|
+
path: "/capabilities",
|
|
496
|
+
methodOptions: options
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
|
|
412
501
|
// src/resources/domains.ts
|
|
413
502
|
var Domains = class extends ApiResource {
|
|
414
503
|
create(params, options) {
|
|
@@ -491,6 +580,24 @@ var Domains = class extends ApiResource {
|
|
|
491
580
|
|
|
492
581
|
// src/resources/mailboxes.ts
|
|
493
582
|
var Mailboxes = class extends ApiResource {
|
|
583
|
+
prepareStagedAttachmentUpload(id, params, options) {
|
|
584
|
+
return this.client.request({
|
|
585
|
+
method: "POST",
|
|
586
|
+
path: `/mailboxes/${encodeURIComponent(id)}/staged-attachment-upload-tokens`,
|
|
587
|
+
body: params,
|
|
588
|
+
methodOptions: options
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
stageAttachment(id, params, options) {
|
|
592
|
+
return this.client.request({
|
|
593
|
+
method: "POST",
|
|
594
|
+
path: `/mailboxes/${encodeURIComponent(id)}/staged-attachments`,
|
|
595
|
+
query: { filename: params.filename },
|
|
596
|
+
rawBody: params.data,
|
|
597
|
+
contentType: params.content_type,
|
|
598
|
+
methodOptions: options
|
|
599
|
+
});
|
|
600
|
+
}
|
|
494
601
|
injectSandboxInbound(id, params, options) {
|
|
495
602
|
return this.client.request({
|
|
496
603
|
method: "POST",
|
|
@@ -1153,6 +1260,44 @@ var ReplyScans = class extends ApiResource {
|
|
|
1153
1260
|
}
|
|
1154
1261
|
};
|
|
1155
1262
|
|
|
1263
|
+
// src/resources/scheduled-messages.ts
|
|
1264
|
+
var ScheduledMessages = class extends ApiResource {
|
|
1265
|
+
list(params, options) {
|
|
1266
|
+
return this.client.request({
|
|
1267
|
+
method: "GET",
|
|
1268
|
+
path: "/scheduled-messages",
|
|
1269
|
+
query: {
|
|
1270
|
+
include_held: params?.include_held,
|
|
1271
|
+
search: params?.search,
|
|
1272
|
+
limit: params?.limit
|
|
1273
|
+
},
|
|
1274
|
+
methodOptions: options
|
|
1275
|
+
});
|
|
1276
|
+
}
|
|
1277
|
+
get(id, options) {
|
|
1278
|
+
return this.client.request({
|
|
1279
|
+
method: "GET",
|
|
1280
|
+
path: `/scheduled-messages/${encodeURIComponent(id)}`,
|
|
1281
|
+
methodOptions: options
|
|
1282
|
+
});
|
|
1283
|
+
}
|
|
1284
|
+
update(id, params, options) {
|
|
1285
|
+
return this.client.request({
|
|
1286
|
+
method: "PATCH",
|
|
1287
|
+
path: `/scheduled-messages/${encodeURIComponent(id)}`,
|
|
1288
|
+
body: params,
|
|
1289
|
+
methodOptions: options
|
|
1290
|
+
});
|
|
1291
|
+
}
|
|
1292
|
+
cancel(id, options) {
|
|
1293
|
+
return this.client.request({
|
|
1294
|
+
method: "DELETE",
|
|
1295
|
+
path: `/scheduled-messages/${encodeURIComponent(id)}`,
|
|
1296
|
+
methodOptions: options
|
|
1297
|
+
});
|
|
1298
|
+
}
|
|
1299
|
+
};
|
|
1300
|
+
|
|
1156
1301
|
// src/resources/status.ts
|
|
1157
1302
|
var Status = class extends ApiResource {
|
|
1158
1303
|
get(options) {
|
|
@@ -1336,7 +1481,7 @@ var Webhooks = class extends ApiResource {
|
|
|
1336
1481
|
};
|
|
1337
1482
|
|
|
1338
1483
|
// src/version.ts
|
|
1339
|
-
var VERSION = "0.
|
|
1484
|
+
var VERSION = "0.4.2";
|
|
1340
1485
|
|
|
1341
1486
|
// src/client.ts
|
|
1342
1487
|
var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
|
|
@@ -1391,6 +1536,7 @@ var ShipMailClient = class {
|
|
|
1391
1536
|
}
|
|
1392
1537
|
this.audiences = new Audiences(this);
|
|
1393
1538
|
this.bookingPages = new BookingPages(this);
|
|
1539
|
+
this.capabilities = new Capabilities(this);
|
|
1394
1540
|
this.calendar = new Calendar(this);
|
|
1395
1541
|
this.domains = new Domains(this);
|
|
1396
1542
|
this.mailboxes = new Mailboxes(this);
|
|
@@ -1398,6 +1544,7 @@ var ShipMailClient = class {
|
|
|
1398
1544
|
this.newsletters = new Newsletters(this);
|
|
1399
1545
|
this.partner = new Partner(this);
|
|
1400
1546
|
this.replyScans = new ReplyScans(this);
|
|
1547
|
+
this.scheduledMessages = new ScheduledMessages(this);
|
|
1401
1548
|
this.suppressions = new Suppressions(this);
|
|
1402
1549
|
this.threads = new Threads(this);
|
|
1403
1550
|
this.webhooks = new Webhooks(this);
|
|
@@ -1588,6 +1735,6 @@ async function verifyWebhook(body, headers, secret, options) {
|
|
|
1588
1735
|
return parsed;
|
|
1589
1736
|
}
|
|
1590
1737
|
|
|
1591
|
-
export { 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, ShipMailClient as default, verifyWebhook };
|
|
1738
|
+
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 };
|
|
1592
1739
|
//# sourceMappingURL=index.js.map
|
|
1593
1740
|
//# sourceMappingURL=index.js.map
|