shipmail 0.1.32 → 0.1.33

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
@@ -18,6 +18,7 @@ type ShipMailConfig = {
18
18
  readonly timeout?: number | undefined;
19
19
  readonly fetch?: typeof fetch | undefined;
20
20
  readonly defaultHeaders?: Record<string, string> | undefined;
21
+ readonly organizationId?: string | undefined;
21
22
  };
22
23
  type PaginationParams = {
23
24
  readonly cursor?: string | undefined;
@@ -75,6 +76,7 @@ type MethodOptions = {
75
76
  readonly signal?: AbortSignal | undefined;
76
77
  readonly headers?: Record<string, string> | undefined;
77
78
  readonly idempotencyKey?: string | undefined;
79
+ readonly organizationId?: string | undefined;
78
80
  };
79
81
 
80
82
  type MergeFields = Record<string, string | number | boolean | null>;
@@ -165,6 +167,8 @@ declare class Audiences extends ApiResource {
165
167
  delete(id: string, options?: MethodOptions): Promise<void>;
166
168
  }
167
169
 
170
+ declare const CONFERENCING_PROVIDER_IDS: readonly ["zoom", "google_meet"];
171
+ type ConferencingProviderId = (typeof CONFERENCING_PROVIDER_IDS)[number];
168
172
  type BookingPage = {
169
173
  readonly object: "booking_page";
170
174
  readonly id: string;
@@ -181,6 +185,7 @@ type BookingPage = {
181
185
  readonly buffer_minutes: number;
182
186
  readonly minimum_notice_minutes: number;
183
187
  readonly max_advance_days: number;
188
+ readonly conferencing_provider: ConferencingProviderId | null;
184
189
  readonly active: boolean;
185
190
  readonly created_at: string;
186
191
  readonly updated_at: string;
@@ -199,6 +204,7 @@ type CreateBookingPageParams = {
199
204
  readonly buffer_minutes?: number | undefined;
200
205
  readonly minimum_notice_minutes?: number | undefined;
201
206
  readonly max_advance_days?: number | undefined;
207
+ readonly conferencing_provider?: ConferencingProviderId | null | undefined;
202
208
  readonly active?: boolean | undefined;
203
209
  };
204
210
  type UpdateBookingPageParams = {
@@ -214,6 +220,7 @@ type UpdateBookingPageParams = {
214
220
  readonly buffer_minutes?: number | undefined;
215
221
  readonly minimum_notice_minutes?: number | undefined;
216
222
  readonly max_advance_days?: number | undefined;
223
+ readonly conferencing_provider?: ConferencingProviderId | null | undefined;
217
224
  readonly active?: boolean | undefined;
218
225
  };
219
226
 
@@ -807,12 +814,18 @@ type MailboxForwardingList = {
807
814
  type CreateMailboxForwardingParams = {
808
815
  readonly destination: string;
809
816
  };
810
- type CreateMailboxParams = {
817
+ type CreateMailboxBaseParams = {
811
818
  readonly domain_id: string;
812
819
  readonly address: string;
813
- readonly password: string;
814
820
  readonly display_name?: string | undefined;
815
821
  };
822
+ type CreateMailboxParams = CreateMailboxBaseParams & ({
823
+ readonly password: string;
824
+ readonly generate_password?: never;
825
+ } | {
826
+ readonly password?: never;
827
+ readonly generate_password: true;
828
+ });
816
829
  type UpdateMailboxParams = {
817
830
  readonly display_name?: string | null | undefined;
818
831
  };
@@ -1344,6 +1357,80 @@ declare class Newsletters extends ApiResource {
1344
1357
  resume(id: string, options?: MethodOptions): Promise<Newsletter>;
1345
1358
  }
1346
1359
 
1360
+ type PartnerOrganizationStatus = "pending_owner" | "active" | "suspended" | "offboarding" | "disconnected";
1361
+ type PartnerDataClassification = "internal_test" | "customer";
1362
+ type PartnerOrganization = {
1363
+ readonly object: "partner_organization";
1364
+ readonly id: string;
1365
+ readonly organization_id: string;
1366
+ readonly name: string;
1367
+ readonly external_reference: string;
1368
+ readonly owner_email: string;
1369
+ readonly owner_user_id: string | null;
1370
+ readonly status: PartnerOrganizationStatus;
1371
+ readonly data_classification: PartnerDataClassification;
1372
+ readonly mailbox_limit: number;
1373
+ readonly delegated_permissions: readonly string[];
1374
+ readonly owner_accepted_at: string | null;
1375
+ readonly activated_at: string | null;
1376
+ readonly suspended_at: string | null;
1377
+ readonly disconnected_at: string | null;
1378
+ readonly created_at: string;
1379
+ readonly updated_at: string;
1380
+ };
1381
+ type CreatePartnerOrganizationParams = {
1382
+ readonly name: string;
1383
+ readonly external_reference: string;
1384
+ readonly owner_email: string;
1385
+ readonly mailbox_limit: number;
1386
+ readonly data_classification: PartnerDataClassification;
1387
+ };
1388
+ type UpdatePartnerOrganizationParams = {
1389
+ readonly name?: string | undefined;
1390
+ readonly mailbox_limit?: number | undefined;
1391
+ };
1392
+ type PartnerOrganizationList = {
1393
+ readonly data: readonly PartnerOrganization[];
1394
+ };
1395
+ type PartnerOwnershipInvitation = {
1396
+ readonly object: "partner_ownership_invitation";
1397
+ readonly owner_email: string;
1398
+ readonly email_sent: boolean;
1399
+ readonly expires_at: string;
1400
+ };
1401
+ type CreatedPartnerOrganization = PartnerOrganization & {
1402
+ readonly ownership_invitation: PartnerOwnershipInvitation | null;
1403
+ };
1404
+ type PartnerUsage = {
1405
+ readonly object: "partner_usage";
1406
+ readonly period_start: string;
1407
+ readonly period_end: string;
1408
+ readonly closed_through: string | null;
1409
+ readonly active_children: number;
1410
+ readonly active_mailboxes: number;
1411
+ readonly child_active_seconds: number;
1412
+ readonly mailbox_active_seconds: number;
1413
+ readonly child_subtotal: number;
1414
+ readonly mailbox_subtotal: number;
1415
+ readonly minimum_shortfall: number;
1416
+ readonly projected_total: number;
1417
+ readonly currency: string;
1418
+ };
1419
+
1420
+ declare class Partner extends ApiResource {
1421
+ listOrganizations(options?: MethodOptions): Promise<PartnerOrganizationList>;
1422
+ createOrganization(params: CreatePartnerOrganizationParams, options?: MethodOptions): Promise<CreatedPartnerOrganization>;
1423
+ getOrganization(id: string, options?: MethodOptions): Promise<PartnerOrganization>;
1424
+ updateOrganization(id: string, params: UpdatePartnerOrganizationParams, options?: MethodOptions): Promise<PartnerOrganization>;
1425
+ resendOwnershipInvitation(id: string, params?: {
1426
+ readonly owner_email?: string | undefined;
1427
+ }, options?: MethodOptions): Promise<PartnerOwnershipInvitation>;
1428
+ suspendOrganization(id: string, options?: MethodOptions): Promise<PartnerOrganization>;
1429
+ resumeOrganization(id: string, options?: MethodOptions): Promise<PartnerOrganization>;
1430
+ offboardOrganization(id: string, options?: MethodOptions): Promise<PartnerOrganization>;
1431
+ usage(options?: MethodOptions): Promise<PartnerUsage>;
1432
+ }
1433
+
1347
1434
  declare class Status extends ApiResource {
1348
1435
  get(options?: MethodOptions): Promise<StatusResponse>;
1349
1436
  }
@@ -1492,6 +1579,7 @@ declare class ShipMailClient {
1492
1579
  private readonly timeout;
1493
1580
  private readonly fetchFn;
1494
1581
  private readonly defaultHeaders;
1582
+ private readonly organizationId;
1495
1583
  readonly audiences: Audiences;
1496
1584
  readonly bookingPages: BookingPages;
1497
1585
  readonly calendar: Calendar;
@@ -1499,6 +1587,7 @@ declare class ShipMailClient {
1499
1587
  readonly mailboxes: Mailboxes;
1500
1588
  readonly messages: Messages;
1501
1589
  readonly newsletters: Newsletters;
1590
+ readonly partner: Partner;
1502
1591
  readonly suppressions: Suppressions;
1503
1592
  readonly threads: Threads;
1504
1593
  readonly webhooks: Webhooks;
@@ -1587,4 +1676,4 @@ declare function verifyWebhook(body: string, headers: WebhookHeaders | Headers,
1587
1676
  readonly toleranceInSeconds?: number | undefined;
1588
1677
  }): Promise<WebhookEvent>;
1589
1678
 
1590
- export { type AddSubscriberParams, type AddSubscribersBatchParams, type AddSubscribersBatchResult, type ApiErrorBody, type Audience, AuthenticationError, AuthorizationError, type BookingPage, type CalendarAvailability, type CalendarAvailabilityParams, type CalendarAvailabilitySlot, type CalendarEvent, type CalendarEventPrivacy, type CalendarEventStatus, type CalendarFreeBusyStatus, ConflictError, ConnectionError, type CreateAudienceParams, type CreateBookingPageParams, type CreateCalendarEventParams, type CreateDomainParams, type CreateMailboxFolderParams, type CreateMailboxParams, type CreateNewsletterFromChangelogParams, type CreateNewsletterParams, type CreateWebhookParams, DOMAIN_STATUSES, type DataMode, type DeleteCalendarEventParams, type Domain, type DomainDnsRecord, type DomainDnsRecordKey, type DomainDnsRecordSet, type DomainDnsRecordStatus, type DomainRegistrationInfo, type DomainSearchResult, type DomainStatus, type DomainVerificationResult, type DownloadInboxAttachmentParams, type EmailRecipient, type EmailRecipientInput, type ErrorType, type GetCalendarEventParams, type GetThreadParams, type InboxAttachment, type InboxBodyPart, type InboxBodyValue, type InboxEmailHeader, type InboxFullMessage, type InboxKeyword, type InboxMessage, type InboxMessageAction, type InboxMessages, type InboxThread, type InjectSandboxInboundParams, InternalServerError, type ListAudiencesParams, type ListBookingPagesParams, type ListCalendarEventsParams, type ListDeliveriesParams, type ListDomainsParams, type ListInboxMessagesParams, type ListMailboxesParams, type ListMessagesParams, type ListNewsletterAssetsParams, type ListNewsletterDomainsParams, type ListNewslettersParams, type ListSubscribersParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MESSAGE_SOURCES, MESSAGE_STATUSES, type Mailbox, type MailboxExport, type MailboxExportErrorCode, type MailboxExportStatus, type MailboxFolder, type MailboxFolders, type MailboxIdentities, type MailboxIdentity, type MailboxRule, type MailboxRuleAction, type MailboxRuleCondition, type MailboxRuleFolder, type MailboxRuleMatchMode, type MailboxRuleMoveTarget, type MailboxRules, type MergeFields, type Message, type MessageMetadata, type MessageSource, type MessageStatus, type MethodOptions, type MoveInboxMessageParams, type Newsletter, type NewsletterArchiveVisibility, type NewsletterAsset, type NewsletterAssetKind, type NewsletterAssetListResponse, type NewsletterAssetStorageUsage, type NewsletterBlock, type NewsletterButtonAlign, type NewsletterCalloutVariant, type NewsletterChangelogEntry, type NewsletterChangelogMedia, type NewsletterChangelogTone, type NewsletterColumnContent, type NewsletterColumnRatio, type NewsletterCountedUrl, type NewsletterDomain, type NewsletterDomainRecordStatus, type NewsletterDomainStatus, type NewsletterPreflight, type NewsletterPreflightItem, type NewsletterPreflightItemStatus, type NewsletterPreflightStatus, type NewsletterPreview, type NewsletterStatus, type NewsletterTestSend, type NewsletterTestSendStatus, type NewsletterUrlBreakdown, type NewsletterUrlSource, NotFoundError, type OutboundHeader, Page, type PaginatedResponse, type PaginationParams, QuotaExceededError, RateLimitError, type Recurrence, type RecurrenceFrequency, type RecurrenceNDay, type RegisterDomainParams, type RegisterNewsletterAssetFromUrlParams, type RegistrationContact, type Reminder, type ReplyToMessageParams, type ReplyToThreadParams, type RequestOptions, type ResetMailboxPasswordParams, type RotateSecretResponse, type SandboxOutcome, type ScheduleNewsletterParams, type SearchDomainsParams, type SendMessageParams, type SendNewsletterTestParams, ShipMailClient, type ShipMailConfig, ShipMailError, type StatusResponse, type Subscriber, type SubscriberOutcome, type SubscriberResult, type SubscriberStatus, type Suppression, type TestWebhookResponse, type Thread, type UpdateAudienceParams, type UpdateAutoReplyParams, type UpdateBookingPageParams, type UpdateCalendarEventParams, type UpdateDomainParams, type UpdateInboxMessageParams, type UpdateMailboxFolderParams, type UpdateMailboxParams, type UpdateMailboxRulesParams, type UpdateNewsletterParams, type UpdateSpamFilterParams, type UpdateSubscriberParams, type UpdateWebhookParams, type UploadNewsletterAssetParams, ValidationError, WEBHOOK_DELIVERY_EVENT_TYPES, WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, type Webhook, type WebhookDelivery, type WebhookDeliveryDetail, type WebhookDeliveryEventType, type WebhookDeliveryStatus, type WebhookEvent, type WebhookEventType, WebhookVerificationError, type WebhookWithSecret, type Weekday, ShipMailClient as default, verifyWebhook };
1679
+ 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 CreateAudienceParams, type CreateBookingPageParams, type CreateCalendarEventParams, type CreateDomainParams, type CreateMailboxFolderParams, type CreateMailboxParams, type CreateNewsletterFromChangelogParams, type CreateNewsletterParams, type CreatePartnerOrganizationParams, type CreateWebhookParams, type CreatedPartnerOrganization, DOMAIN_STATUSES, type DataMode, type DeleteCalendarEventParams, type Domain, type DomainDnsRecord, type DomainDnsRecordKey, type DomainDnsRecordSet, type DomainDnsRecordStatus, type DomainRegistrationInfo, type DomainSearchResult, type DomainStatus, type DomainVerificationResult, type DownloadInboxAttachmentParams, type EmailRecipient, type EmailRecipientInput, type ErrorType, type GetCalendarEventParams, type GetThreadParams, type InboxAttachment, type InboxBodyPart, type InboxBodyValue, type InboxEmailHeader, type InboxFullMessage, type InboxKeyword, type InboxMessage, type InboxMessageAction, type InboxMessages, type InboxThread, type InjectSandboxInboundParams, InternalServerError, type ListAudiencesParams, type ListBookingPagesParams, type ListCalendarEventsParams, type ListDeliveriesParams, type ListDomainsParams, type ListInboxMessagesParams, type ListMailboxesParams, type ListMessagesParams, type ListNewsletterAssetsParams, type ListNewsletterDomainsParams, type ListNewslettersParams, type ListSubscribersParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MESSAGE_SOURCES, MESSAGE_STATUSES, type Mailbox, type MailboxExport, type MailboxExportErrorCode, type MailboxExportStatus, type MailboxFolder, type MailboxFolders, type MailboxIdentities, type MailboxIdentity, type MailboxRule, type MailboxRuleAction, type MailboxRuleCondition, type MailboxRuleFolder, type MailboxRuleMatchMode, type MailboxRuleMoveTarget, type MailboxRules, type MergeFields, type Message, type MessageMetadata, type MessageSource, type MessageStatus, type MethodOptions, type MoveInboxMessageParams, type Newsletter, type NewsletterArchiveVisibility, type NewsletterAsset, type NewsletterAssetKind, type NewsletterAssetListResponse, type NewsletterAssetStorageUsage, type NewsletterBlock, type NewsletterButtonAlign, type NewsletterCalloutVariant, type NewsletterChangelogEntry, type NewsletterChangelogMedia, type NewsletterChangelogTone, type NewsletterColumnContent, type NewsletterColumnRatio, type NewsletterCountedUrl, type NewsletterDomain, type NewsletterDomainRecordStatus, type NewsletterDomainStatus, type NewsletterPreflight, type NewsletterPreflightItem, type NewsletterPreflightItemStatus, type NewsletterPreflightStatus, type NewsletterPreview, type NewsletterStatus, type NewsletterTestSend, type NewsletterTestSendStatus, type NewsletterUrlBreakdown, type NewsletterUrlSource, NotFoundError, type OutboundHeader, Page, type PaginatedResponse, type PaginationParams, type PartnerDataClassification, type PartnerOrganization, type PartnerOrganizationList, type PartnerOrganizationStatus, type PartnerOwnershipInvitation, type PartnerUsage, QuotaExceededError, RateLimitError, type Recurrence, type RecurrenceFrequency, type RecurrenceNDay, type RegisterDomainParams, type RegisterNewsletterAssetFromUrlParams, type RegistrationContact, type Reminder, type ReplyToMessageParams, type ReplyToThreadParams, type RequestOptions, type ResetMailboxPasswordParams, type RotateSecretResponse, type SandboxOutcome, type ScheduleNewsletterParams, type SearchDomainsParams, type SendMessageParams, type SendNewsletterTestParams, ShipMailClient, type ShipMailConfig, ShipMailError, type StatusResponse, type Subscriber, type SubscriberOutcome, type SubscriberResult, type SubscriberStatus, type Suppression, type TestWebhookResponse, type Thread, type UpdateAudienceParams, type UpdateAutoReplyParams, type UpdateBookingPageParams, type UpdateCalendarEventParams, type UpdateDomainParams, type UpdateInboxMessageParams, type UpdateMailboxFolderParams, type UpdateMailboxParams, type UpdateMailboxRulesParams, type UpdateNewsletterParams, type UpdatePartnerOrganizationParams, type UpdateSpamFilterParams, type UpdateSubscriberParams, type UpdateWebhookParams, type UploadNewsletterAssetParams, ValidationError, WEBHOOK_DELIVERY_EVENT_TYPES, WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, type Webhook, type WebhookDelivery, type WebhookDeliveryDetail, type WebhookDeliveryEventType, type WebhookDeliveryStatus, type WebhookEvent, type WebhookEventType, WebhookVerificationError, type WebhookWithSecret, type Weekday, ShipMailClient as default, verifyWebhook };
package/dist/index.d.ts CHANGED
@@ -18,6 +18,7 @@ type ShipMailConfig = {
18
18
  readonly timeout?: number | undefined;
19
19
  readonly fetch?: typeof fetch | undefined;
20
20
  readonly defaultHeaders?: Record<string, string> | undefined;
21
+ readonly organizationId?: string | undefined;
21
22
  };
22
23
  type PaginationParams = {
23
24
  readonly cursor?: string | undefined;
@@ -75,6 +76,7 @@ type MethodOptions = {
75
76
  readonly signal?: AbortSignal | undefined;
76
77
  readonly headers?: Record<string, string> | undefined;
77
78
  readonly idempotencyKey?: string | undefined;
79
+ readonly organizationId?: string | undefined;
78
80
  };
79
81
 
80
82
  type MergeFields = Record<string, string | number | boolean | null>;
@@ -165,6 +167,8 @@ declare class Audiences extends ApiResource {
165
167
  delete(id: string, options?: MethodOptions): Promise<void>;
166
168
  }
167
169
 
170
+ declare const CONFERENCING_PROVIDER_IDS: readonly ["zoom", "google_meet"];
171
+ type ConferencingProviderId = (typeof CONFERENCING_PROVIDER_IDS)[number];
168
172
  type BookingPage = {
169
173
  readonly object: "booking_page";
170
174
  readonly id: string;
@@ -181,6 +185,7 @@ type BookingPage = {
181
185
  readonly buffer_minutes: number;
182
186
  readonly minimum_notice_minutes: number;
183
187
  readonly max_advance_days: number;
188
+ readonly conferencing_provider: ConferencingProviderId | null;
184
189
  readonly active: boolean;
185
190
  readonly created_at: string;
186
191
  readonly updated_at: string;
@@ -199,6 +204,7 @@ type CreateBookingPageParams = {
199
204
  readonly buffer_minutes?: number | undefined;
200
205
  readonly minimum_notice_minutes?: number | undefined;
201
206
  readonly max_advance_days?: number | undefined;
207
+ readonly conferencing_provider?: ConferencingProviderId | null | undefined;
202
208
  readonly active?: boolean | undefined;
203
209
  };
204
210
  type UpdateBookingPageParams = {
@@ -214,6 +220,7 @@ type UpdateBookingPageParams = {
214
220
  readonly buffer_minutes?: number | undefined;
215
221
  readonly minimum_notice_minutes?: number | undefined;
216
222
  readonly max_advance_days?: number | undefined;
223
+ readonly conferencing_provider?: ConferencingProviderId | null | undefined;
217
224
  readonly active?: boolean | undefined;
218
225
  };
219
226
 
@@ -807,12 +814,18 @@ type MailboxForwardingList = {
807
814
  type CreateMailboxForwardingParams = {
808
815
  readonly destination: string;
809
816
  };
810
- type CreateMailboxParams = {
817
+ type CreateMailboxBaseParams = {
811
818
  readonly domain_id: string;
812
819
  readonly address: string;
813
- readonly password: string;
814
820
  readonly display_name?: string | undefined;
815
821
  };
822
+ type CreateMailboxParams = CreateMailboxBaseParams & ({
823
+ readonly password: string;
824
+ readonly generate_password?: never;
825
+ } | {
826
+ readonly password?: never;
827
+ readonly generate_password: true;
828
+ });
816
829
  type UpdateMailboxParams = {
817
830
  readonly display_name?: string | null | undefined;
818
831
  };
@@ -1344,6 +1357,80 @@ declare class Newsletters extends ApiResource {
1344
1357
  resume(id: string, options?: MethodOptions): Promise<Newsletter>;
1345
1358
  }
1346
1359
 
1360
+ type PartnerOrganizationStatus = "pending_owner" | "active" | "suspended" | "offboarding" | "disconnected";
1361
+ type PartnerDataClassification = "internal_test" | "customer";
1362
+ type PartnerOrganization = {
1363
+ readonly object: "partner_organization";
1364
+ readonly id: string;
1365
+ readonly organization_id: string;
1366
+ readonly name: string;
1367
+ readonly external_reference: string;
1368
+ readonly owner_email: string;
1369
+ readonly owner_user_id: string | null;
1370
+ readonly status: PartnerOrganizationStatus;
1371
+ readonly data_classification: PartnerDataClassification;
1372
+ readonly mailbox_limit: number;
1373
+ readonly delegated_permissions: readonly string[];
1374
+ readonly owner_accepted_at: string | null;
1375
+ readonly activated_at: string | null;
1376
+ readonly suspended_at: string | null;
1377
+ readonly disconnected_at: string | null;
1378
+ readonly created_at: string;
1379
+ readonly updated_at: string;
1380
+ };
1381
+ type CreatePartnerOrganizationParams = {
1382
+ readonly name: string;
1383
+ readonly external_reference: string;
1384
+ readonly owner_email: string;
1385
+ readonly mailbox_limit: number;
1386
+ readonly data_classification: PartnerDataClassification;
1387
+ };
1388
+ type UpdatePartnerOrganizationParams = {
1389
+ readonly name?: string | undefined;
1390
+ readonly mailbox_limit?: number | undefined;
1391
+ };
1392
+ type PartnerOrganizationList = {
1393
+ readonly data: readonly PartnerOrganization[];
1394
+ };
1395
+ type PartnerOwnershipInvitation = {
1396
+ readonly object: "partner_ownership_invitation";
1397
+ readonly owner_email: string;
1398
+ readonly email_sent: boolean;
1399
+ readonly expires_at: string;
1400
+ };
1401
+ type CreatedPartnerOrganization = PartnerOrganization & {
1402
+ readonly ownership_invitation: PartnerOwnershipInvitation | null;
1403
+ };
1404
+ type PartnerUsage = {
1405
+ readonly object: "partner_usage";
1406
+ readonly period_start: string;
1407
+ readonly period_end: string;
1408
+ readonly closed_through: string | null;
1409
+ readonly active_children: number;
1410
+ readonly active_mailboxes: number;
1411
+ readonly child_active_seconds: number;
1412
+ readonly mailbox_active_seconds: number;
1413
+ readonly child_subtotal: number;
1414
+ readonly mailbox_subtotal: number;
1415
+ readonly minimum_shortfall: number;
1416
+ readonly projected_total: number;
1417
+ readonly currency: string;
1418
+ };
1419
+
1420
+ declare class Partner extends ApiResource {
1421
+ listOrganizations(options?: MethodOptions): Promise<PartnerOrganizationList>;
1422
+ createOrganization(params: CreatePartnerOrganizationParams, options?: MethodOptions): Promise<CreatedPartnerOrganization>;
1423
+ getOrganization(id: string, options?: MethodOptions): Promise<PartnerOrganization>;
1424
+ updateOrganization(id: string, params: UpdatePartnerOrganizationParams, options?: MethodOptions): Promise<PartnerOrganization>;
1425
+ resendOwnershipInvitation(id: string, params?: {
1426
+ readonly owner_email?: string | undefined;
1427
+ }, options?: MethodOptions): Promise<PartnerOwnershipInvitation>;
1428
+ suspendOrganization(id: string, options?: MethodOptions): Promise<PartnerOrganization>;
1429
+ resumeOrganization(id: string, options?: MethodOptions): Promise<PartnerOrganization>;
1430
+ offboardOrganization(id: string, options?: MethodOptions): Promise<PartnerOrganization>;
1431
+ usage(options?: MethodOptions): Promise<PartnerUsage>;
1432
+ }
1433
+
1347
1434
  declare class Status extends ApiResource {
1348
1435
  get(options?: MethodOptions): Promise<StatusResponse>;
1349
1436
  }
@@ -1492,6 +1579,7 @@ declare class ShipMailClient {
1492
1579
  private readonly timeout;
1493
1580
  private readonly fetchFn;
1494
1581
  private readonly defaultHeaders;
1582
+ private readonly organizationId;
1495
1583
  readonly audiences: Audiences;
1496
1584
  readonly bookingPages: BookingPages;
1497
1585
  readonly calendar: Calendar;
@@ -1499,6 +1587,7 @@ declare class ShipMailClient {
1499
1587
  readonly mailboxes: Mailboxes;
1500
1588
  readonly messages: Messages;
1501
1589
  readonly newsletters: Newsletters;
1590
+ readonly partner: Partner;
1502
1591
  readonly suppressions: Suppressions;
1503
1592
  readonly threads: Threads;
1504
1593
  readonly webhooks: Webhooks;
@@ -1587,4 +1676,4 @@ declare function verifyWebhook(body: string, headers: WebhookHeaders | Headers,
1587
1676
  readonly toleranceInSeconds?: number | undefined;
1588
1677
  }): Promise<WebhookEvent>;
1589
1678
 
1590
- export { type AddSubscriberParams, type AddSubscribersBatchParams, type AddSubscribersBatchResult, type ApiErrorBody, type Audience, AuthenticationError, AuthorizationError, type BookingPage, type CalendarAvailability, type CalendarAvailabilityParams, type CalendarAvailabilitySlot, type CalendarEvent, type CalendarEventPrivacy, type CalendarEventStatus, type CalendarFreeBusyStatus, ConflictError, ConnectionError, type CreateAudienceParams, type CreateBookingPageParams, type CreateCalendarEventParams, type CreateDomainParams, type CreateMailboxFolderParams, type CreateMailboxParams, type CreateNewsletterFromChangelogParams, type CreateNewsletterParams, type CreateWebhookParams, DOMAIN_STATUSES, type DataMode, type DeleteCalendarEventParams, type Domain, type DomainDnsRecord, type DomainDnsRecordKey, type DomainDnsRecordSet, type DomainDnsRecordStatus, type DomainRegistrationInfo, type DomainSearchResult, type DomainStatus, type DomainVerificationResult, type DownloadInboxAttachmentParams, type EmailRecipient, type EmailRecipientInput, type ErrorType, type GetCalendarEventParams, type GetThreadParams, type InboxAttachment, type InboxBodyPart, type InboxBodyValue, type InboxEmailHeader, type InboxFullMessage, type InboxKeyword, type InboxMessage, type InboxMessageAction, type InboxMessages, type InboxThread, type InjectSandboxInboundParams, InternalServerError, type ListAudiencesParams, type ListBookingPagesParams, type ListCalendarEventsParams, type ListDeliveriesParams, type ListDomainsParams, type ListInboxMessagesParams, type ListMailboxesParams, type ListMessagesParams, type ListNewsletterAssetsParams, type ListNewsletterDomainsParams, type ListNewslettersParams, type ListSubscribersParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MESSAGE_SOURCES, MESSAGE_STATUSES, type Mailbox, type MailboxExport, type MailboxExportErrorCode, type MailboxExportStatus, type MailboxFolder, type MailboxFolders, type MailboxIdentities, type MailboxIdentity, type MailboxRule, type MailboxRuleAction, type MailboxRuleCondition, type MailboxRuleFolder, type MailboxRuleMatchMode, type MailboxRuleMoveTarget, type MailboxRules, type MergeFields, type Message, type MessageMetadata, type MessageSource, type MessageStatus, type MethodOptions, type MoveInboxMessageParams, type Newsletter, type NewsletterArchiveVisibility, type NewsletterAsset, type NewsletterAssetKind, type NewsletterAssetListResponse, type NewsletterAssetStorageUsage, type NewsletterBlock, type NewsletterButtonAlign, type NewsletterCalloutVariant, type NewsletterChangelogEntry, type NewsletterChangelogMedia, type NewsletterChangelogTone, type NewsletterColumnContent, type NewsletterColumnRatio, type NewsletterCountedUrl, type NewsletterDomain, type NewsletterDomainRecordStatus, type NewsletterDomainStatus, type NewsletterPreflight, type NewsletterPreflightItem, type NewsletterPreflightItemStatus, type NewsletterPreflightStatus, type NewsletterPreview, type NewsletterStatus, type NewsletterTestSend, type NewsletterTestSendStatus, type NewsletterUrlBreakdown, type NewsletterUrlSource, NotFoundError, type OutboundHeader, Page, type PaginatedResponse, type PaginationParams, QuotaExceededError, RateLimitError, type Recurrence, type RecurrenceFrequency, type RecurrenceNDay, type RegisterDomainParams, type RegisterNewsletterAssetFromUrlParams, type RegistrationContact, type Reminder, type ReplyToMessageParams, type ReplyToThreadParams, type RequestOptions, type ResetMailboxPasswordParams, type RotateSecretResponse, type SandboxOutcome, type ScheduleNewsletterParams, type SearchDomainsParams, type SendMessageParams, type SendNewsletterTestParams, ShipMailClient, type ShipMailConfig, ShipMailError, type StatusResponse, type Subscriber, type SubscriberOutcome, type SubscriberResult, type SubscriberStatus, type Suppression, type TestWebhookResponse, type Thread, type UpdateAudienceParams, type UpdateAutoReplyParams, type UpdateBookingPageParams, type UpdateCalendarEventParams, type UpdateDomainParams, type UpdateInboxMessageParams, type UpdateMailboxFolderParams, type UpdateMailboxParams, type UpdateMailboxRulesParams, type UpdateNewsletterParams, type UpdateSpamFilterParams, type UpdateSubscriberParams, type UpdateWebhookParams, type UploadNewsletterAssetParams, ValidationError, WEBHOOK_DELIVERY_EVENT_TYPES, WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, type Webhook, type WebhookDelivery, type WebhookDeliveryDetail, type WebhookDeliveryEventType, type WebhookDeliveryStatus, type WebhookEvent, type WebhookEventType, WebhookVerificationError, type WebhookWithSecret, type Weekday, ShipMailClient as default, verifyWebhook };
1679
+ 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 CreateAudienceParams, type CreateBookingPageParams, type CreateCalendarEventParams, type CreateDomainParams, type CreateMailboxFolderParams, type CreateMailboxParams, type CreateNewsletterFromChangelogParams, type CreateNewsletterParams, type CreatePartnerOrganizationParams, type CreateWebhookParams, type CreatedPartnerOrganization, DOMAIN_STATUSES, type DataMode, type DeleteCalendarEventParams, type Domain, type DomainDnsRecord, type DomainDnsRecordKey, type DomainDnsRecordSet, type DomainDnsRecordStatus, type DomainRegistrationInfo, type DomainSearchResult, type DomainStatus, type DomainVerificationResult, type DownloadInboxAttachmentParams, type EmailRecipient, type EmailRecipientInput, type ErrorType, type GetCalendarEventParams, type GetThreadParams, type InboxAttachment, type InboxBodyPart, type InboxBodyValue, type InboxEmailHeader, type InboxFullMessage, type InboxKeyword, type InboxMessage, type InboxMessageAction, type InboxMessages, type InboxThread, type InjectSandboxInboundParams, InternalServerError, type ListAudiencesParams, type ListBookingPagesParams, type ListCalendarEventsParams, type ListDeliveriesParams, type ListDomainsParams, type ListInboxMessagesParams, type ListMailboxesParams, type ListMessagesParams, type ListNewsletterAssetsParams, type ListNewsletterDomainsParams, type ListNewslettersParams, type ListSubscribersParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MESSAGE_SOURCES, MESSAGE_STATUSES, type Mailbox, type MailboxExport, type MailboxExportErrorCode, type MailboxExportStatus, type MailboxFolder, type MailboxFolders, type MailboxIdentities, type MailboxIdentity, type MailboxRule, type MailboxRuleAction, type MailboxRuleCondition, type MailboxRuleFolder, type MailboxRuleMatchMode, type MailboxRuleMoveTarget, type MailboxRules, type MergeFields, type Message, type MessageMetadata, type MessageSource, type MessageStatus, type MethodOptions, type MoveInboxMessageParams, type Newsletter, type NewsletterArchiveVisibility, type NewsletterAsset, type NewsletterAssetKind, type NewsletterAssetListResponse, type NewsletterAssetStorageUsage, type NewsletterBlock, type NewsletterButtonAlign, type NewsletterCalloutVariant, type NewsletterChangelogEntry, type NewsletterChangelogMedia, type NewsletterChangelogTone, type NewsletterColumnContent, type NewsletterColumnRatio, type NewsletterCountedUrl, type NewsletterDomain, type NewsletterDomainRecordStatus, type NewsletterDomainStatus, type NewsletterPreflight, type NewsletterPreflightItem, type NewsletterPreflightItemStatus, type NewsletterPreflightStatus, type NewsletterPreview, type NewsletterStatus, type NewsletterTestSend, type NewsletterTestSendStatus, type NewsletterUrlBreakdown, type NewsletterUrlSource, NotFoundError, type OutboundHeader, Page, type PaginatedResponse, type PaginationParams, type PartnerDataClassification, type PartnerOrganization, type PartnerOrganizationList, type PartnerOrganizationStatus, type PartnerOwnershipInvitation, type PartnerUsage, QuotaExceededError, RateLimitError, type Recurrence, type RecurrenceFrequency, type RecurrenceNDay, type RegisterDomainParams, type RegisterNewsletterAssetFromUrlParams, type RegistrationContact, type Reminder, type ReplyToMessageParams, type ReplyToThreadParams, type RequestOptions, type ResetMailboxPasswordParams, type RotateSecretResponse, type SandboxOutcome, type ScheduleNewsletterParams, type SearchDomainsParams, type SendMessageParams, type SendNewsletterTestParams, ShipMailClient, type ShipMailConfig, ShipMailError, type StatusResponse, type Subscriber, type SubscriberOutcome, type SubscriberResult, type SubscriberStatus, type Suppression, type TestWebhookResponse, type Thread, type UpdateAudienceParams, type UpdateAutoReplyParams, type UpdateBookingPageParams, type UpdateCalendarEventParams, type UpdateDomainParams, type UpdateInboxMessageParams, type UpdateMailboxFolderParams, type UpdateMailboxParams, type UpdateMailboxRulesParams, type UpdateNewsletterParams, type UpdatePartnerOrganizationParams, type UpdateSpamFilterParams, type UpdateSubscriberParams, type UpdateWebhookParams, type UploadNewsletterAssetParams, ValidationError, WEBHOOK_DELIVERY_EVENT_TYPES, WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, type Webhook, type WebhookDelivery, type WebhookDeliveryDetail, type WebhookDeliveryEventType, type WebhookDeliveryStatus, type WebhookEvent, type WebhookEventType, WebhookVerificationError, type WebhookWithSecret, type Weekday, ShipMailClient as default, verifyWebhook };
package/dist/index.js CHANGED
@@ -974,6 +974,72 @@ var Newsletters = class extends ApiResource {
974
974
  }
975
975
  };
976
976
 
977
+ // src/resources/partner.ts
978
+ var Partner = class extends ApiResource {
979
+ listOrganizations(options) {
980
+ return this.client.request({
981
+ method: "GET",
982
+ path: "/partner/organizations",
983
+ methodOptions: options
984
+ });
985
+ }
986
+ createOrganization(params, options) {
987
+ return this.client.request({
988
+ method: "POST",
989
+ path: "/partner/organizations",
990
+ body: params,
991
+ methodOptions: options
992
+ });
993
+ }
994
+ getOrganization(id, options) {
995
+ return this.client.request({
996
+ method: "GET",
997
+ path: `/partner/organizations/${encodeURIComponent(id)}`,
998
+ methodOptions: options
999
+ });
1000
+ }
1001
+ updateOrganization(id, params, options) {
1002
+ return this.client.request({
1003
+ method: "PATCH",
1004
+ path: `/partner/organizations/${encodeURIComponent(id)}`,
1005
+ body: params,
1006
+ methodOptions: options
1007
+ });
1008
+ }
1009
+ resendOwnershipInvitation(id, params = {}, options) {
1010
+ return this.client.request({
1011
+ method: "POST",
1012
+ path: `/partner/organizations/${encodeURIComponent(id)}/ownership-invitations`,
1013
+ body: params,
1014
+ methodOptions: options
1015
+ });
1016
+ }
1017
+ suspendOrganization(id, options) {
1018
+ return this.client.request({
1019
+ method: "POST",
1020
+ path: `/partner/organizations/${encodeURIComponent(id)}/suspend`,
1021
+ methodOptions: options
1022
+ });
1023
+ }
1024
+ resumeOrganization(id, options) {
1025
+ return this.client.request({
1026
+ method: "POST",
1027
+ path: `/partner/organizations/${encodeURIComponent(id)}/resume`,
1028
+ methodOptions: options
1029
+ });
1030
+ }
1031
+ offboardOrganization(id, options) {
1032
+ return this.client.request({
1033
+ method: "DELETE",
1034
+ path: `/partner/organizations/${encodeURIComponent(id)}`,
1035
+ methodOptions: options
1036
+ });
1037
+ }
1038
+ usage(options) {
1039
+ return this.client.request({ method: "GET", path: "/partner/usage", methodOptions: options });
1040
+ }
1041
+ };
1042
+
977
1043
  // src/resources/status.ts
978
1044
  var Status = class extends ApiResource {
979
1045
  get(options) {
@@ -1156,7 +1222,7 @@ var Webhooks = class extends ApiResource {
1156
1222
  };
1157
1223
 
1158
1224
  // src/version.ts
1159
- var VERSION = "0.1.32";
1225
+ var VERSION = "0.1.33";
1160
1226
 
1161
1227
  // src/client.ts
1162
1228
  var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
@@ -1199,6 +1265,7 @@ var ShipMailClient = class {
1199
1265
  this.timeout = DEFAULT_TIMEOUT;
1200
1266
  this.fetchFn = globalThis.fetch;
1201
1267
  this.defaultHeaders = {};
1268
+ this.organizationId = void 0;
1202
1269
  } else {
1203
1270
  this.apiKey = config.apiKey;
1204
1271
  this.baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;
@@ -1206,6 +1273,7 @@ var ShipMailClient = class {
1206
1273
  this.timeout = config.timeout ?? DEFAULT_TIMEOUT;
1207
1274
  this.fetchFn = config.fetch ?? globalThis.fetch;
1208
1275
  this.defaultHeaders = config.defaultHeaders ? { ...config.defaultHeaders } : {};
1276
+ this.organizationId = config.organizationId;
1209
1277
  }
1210
1278
  this.audiences = new Audiences(this);
1211
1279
  this.bookingPages = new BookingPages(this);
@@ -1214,6 +1282,7 @@ var ShipMailClient = class {
1214
1282
  this.mailboxes = new Mailboxes(this);
1215
1283
  this.messages = new Messages(this);
1216
1284
  this.newsletters = new Newsletters(this);
1285
+ this.partner = new Partner(this);
1217
1286
  this.suppressions = new Suppressions(this);
1218
1287
  this.threads = new Threads(this);
1219
1288
  this.webhooks = new Webhooks(this);
@@ -1254,6 +1323,10 @@ var ShipMailClient = class {
1254
1323
  if (methodOpts?.idempotencyKey) {
1255
1324
  headers["Idempotency-Key"] = methodOpts.idempotencyKey;
1256
1325
  }
1326
+ const targetOrganizationId = methodOpts?.organizationId ?? this.organizationId;
1327
+ if (targetOrganizationId) {
1328
+ headers["X-ShipMail-Organization-Id"] = targetOrganizationId;
1329
+ }
1257
1330
  let body = null;
1258
1331
  if (options.rawBody !== void 0) {
1259
1332
  headers["Content-Type"] = options.contentType ?? "application/octet-stream";
@@ -1310,6 +1383,9 @@ var ShipMailClient = class {
1310
1383
  }
1311
1384
  };
1312
1385
 
1386
+ // src/types/booking-page.ts
1387
+ var CONFERENCING_PROVIDER_IDS = ["zoom", "google_meet"];
1388
+
1313
1389
  // src/types/common.ts
1314
1390
  var WEBHOOK_EVENT_TYPES = [
1315
1391
  "message.received",
@@ -1390,6 +1466,6 @@ async function verifyWebhook(body, headers, secret, options) {
1390
1466
  return parsed;
1391
1467
  }
1392
1468
 
1393
- export { AuthenticationError, AuthorizationError, ConflictError, ConnectionError, DOMAIN_STATUSES, InternalServerError, MESSAGE_SOURCES, MESSAGE_STATUSES, NotFoundError, Page, QuotaExceededError, RateLimitError, ShipMailClient, ShipMailError, ValidationError, WEBHOOK_DELIVERY_EVENT_TYPES, WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, WebhookVerificationError, ShipMailClient as default, verifyWebhook };
1469
+ 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 };
1394
1470
  //# sourceMappingURL=index.js.map
1395
1471
  //# sourceMappingURL=index.js.map