shipmail 0.1.19 → 0.1.21

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
@@ -95,7 +95,7 @@ type CreateDomainParams = {
95
95
  readonly name: string;
96
96
  };
97
97
  type UpdateDomainParams = {
98
- readonly catch_all_mailbox_id?: string | null | undefined;
98
+ readonly catch_all_mailbox_id: string | null;
99
99
  };
100
100
  type ListDomainsParams = PaginationParams;
101
101
  type DomainVerificationResult = {
@@ -181,10 +181,165 @@ type Mailbox = {
181
181
  readonly address: string;
182
182
  readonly display_name: string | null;
183
183
  readonly suspended_at: string | null;
184
+ readonly spam_filter_threshold: number;
184
185
  readonly auto_reply: AutoReply;
185
186
  readonly created_at: string;
186
187
  readonly updated_at: string;
187
188
  };
189
+ type MailboxFolder = {
190
+ readonly object: "mailbox_folder";
191
+ readonly id: string;
192
+ readonly name: string;
193
+ readonly role: string | null;
194
+ readonly kind: "custom" | "system";
195
+ readonly total_emails: number;
196
+ readonly unread_emails: number;
197
+ readonly unread_threads: number;
198
+ readonly sort_order: number;
199
+ };
200
+ type MailboxFolders = {
201
+ readonly object: "mailbox_folders";
202
+ readonly mailbox_id: string;
203
+ readonly address: string;
204
+ readonly data: readonly MailboxFolder[];
205
+ };
206
+ type MailboxIdentity = {
207
+ readonly object: "mailbox_identity";
208
+ readonly id: string;
209
+ readonly name: string;
210
+ readonly email: string;
211
+ };
212
+ type MailboxIdentities = {
213
+ readonly object: "mailbox_identities";
214
+ readonly mailbox_id: string;
215
+ readonly address: string;
216
+ readonly data: readonly MailboxIdentity[];
217
+ };
218
+ type InboxEmailHeader = {
219
+ readonly name: string | null;
220
+ readonly email: string | null;
221
+ };
222
+ type InboxKeyword = "$flagged" | "$seen" | "$draft" | "$answered" | "$forwarded";
223
+ type InboxAttachment = {
224
+ readonly part_id: string;
225
+ readonly blob_id: string;
226
+ readonly name: string | null;
227
+ readonly content_type: string;
228
+ readonly size: number;
229
+ readonly download_path: string;
230
+ };
231
+ type InboxBodyPart = {
232
+ readonly part_id: string;
233
+ readonly type: string;
234
+ };
235
+ type InboxBodyValue = {
236
+ readonly value: string;
237
+ readonly is_encoding_problem: boolean;
238
+ };
239
+ type InboxMessage = {
240
+ readonly object: "inbox_message";
241
+ readonly id: string;
242
+ readonly thread_id: string;
243
+ readonly mailbox_id: string;
244
+ readonly address: string;
245
+ readonly folder_ids: readonly string[];
246
+ readonly keywords: Readonly<Record<string, boolean>>;
247
+ readonly from: readonly InboxEmailHeader[] | null;
248
+ readonly to: readonly InboxEmailHeader[] | null;
249
+ readonly subject: string | null;
250
+ readonly received_at: string;
251
+ readonly preview: string;
252
+ readonly has_attachment: boolean;
253
+ readonly size: number;
254
+ };
255
+ type InboxFullMessage = Omit<InboxMessage, "object"> & {
256
+ readonly object: "inbox_message_full";
257
+ readonly cc: readonly InboxEmailHeader[] | null;
258
+ readonly reply_to: readonly InboxEmailHeader[] | null;
259
+ readonly message_id: readonly string[] | null;
260
+ readonly in_reply_to: readonly string[] | null;
261
+ readonly references: readonly string[] | null;
262
+ readonly body_values: Readonly<Record<string, InboxBodyValue>>;
263
+ readonly text_body: readonly InboxBodyPart[];
264
+ readonly html_body: readonly InboxBodyPart[];
265
+ readonly attachments: readonly InboxAttachment[];
266
+ };
267
+ type InboxMessages = {
268
+ readonly object: "inbox_messages";
269
+ readonly mailbox_id: string;
270
+ readonly address: string;
271
+ readonly data: readonly InboxMessage[];
272
+ readonly pagination: {
273
+ readonly position: number;
274
+ readonly limit: number;
275
+ readonly total: number;
276
+ readonly has_more: boolean;
277
+ readonly next_position: number | null;
278
+ };
279
+ };
280
+ type InboxThread = {
281
+ readonly object: "inbox_thread";
282
+ readonly mailbox_id: string;
283
+ readonly address: string;
284
+ readonly thread_id: string;
285
+ readonly data: readonly InboxFullMessage[];
286
+ };
287
+ type InboxMessageAction = {
288
+ readonly object: "inbox_message_action";
289
+ readonly mailbox_id: string;
290
+ readonly address: string;
291
+ readonly message_id: string;
292
+ readonly ok: true;
293
+ };
294
+ type MailboxRuleMatchMode = "all" | "any";
295
+ type MailboxRuleCondition = {
296
+ readonly type: "from_is" | "from_contains" | "recipient_is" | "plus_tag_is" | "subject_contains";
297
+ readonly value: string;
298
+ } | {
299
+ readonly type: "has_attachment" | "list_unsubscribe_exists";
300
+ } | {
301
+ readonly type: "group";
302
+ readonly match_mode: MailboxRuleMatchMode;
303
+ readonly conditions: readonly MailboxRuleCondition[];
304
+ };
305
+ type MailboxRuleMoveTarget = {
306
+ readonly kind: "system";
307
+ readonly role: "inbox" | "archive" | "junk" | "trash";
308
+ } | {
309
+ readonly kind: "custom";
310
+ readonly folder_id: string;
311
+ };
312
+ type MailboxRuleAction = {
313
+ readonly type: "move";
314
+ readonly target: MailboxRuleMoveTarget;
315
+ } | {
316
+ readonly type: "mark_read";
317
+ } | {
318
+ readonly type: "star";
319
+ };
320
+ type MailboxRule = {
321
+ readonly id: string;
322
+ readonly name: string;
323
+ readonly enabled: boolean;
324
+ readonly position: number;
325
+ readonly match_mode: MailboxRuleMatchMode;
326
+ readonly stop: boolean;
327
+ readonly conditions: readonly MailboxRuleCondition[];
328
+ readonly actions: readonly MailboxRuleAction[];
329
+ };
330
+ type MailboxRuleFolder = {
331
+ readonly id: string;
332
+ readonly name: string;
333
+ readonly role: string | null;
334
+ readonly kind: "custom" | "system";
335
+ };
336
+ type MailboxRules = {
337
+ readonly object: "mailbox_rules";
338
+ readonly mailbox_id: string;
339
+ readonly address: string;
340
+ readonly rules: readonly MailboxRule[];
341
+ readonly folders: readonly MailboxRuleFolder[];
342
+ };
188
343
  type CreateMailboxParams = {
189
344
  readonly domain_id: string;
190
345
  readonly address: string;
@@ -193,9 +348,40 @@ type CreateMailboxParams = {
193
348
  type UpdateMailboxParams = {
194
349
  readonly display_name?: string | null | undefined;
195
350
  };
351
+ type CreateMailboxFolderParams = {
352
+ readonly name: string;
353
+ };
354
+ type UpdateMailboxFolderParams = {
355
+ readonly name: string;
356
+ };
357
+ type ResetMailboxPasswordParams = {
358
+ readonly password: string;
359
+ };
196
360
  type ListMailboxesParams = PaginationParams & {
197
361
  readonly domain_id?: string | undefined;
198
362
  };
363
+ type ListInboxMessagesParams = {
364
+ readonly folder_id?: string | undefined;
365
+ readonly folder_role?: "inbox" | "starred" | "sent" | "drafts" | "archive" | "junk" | "trash" | undefined;
366
+ readonly search_text?: string | undefined;
367
+ readonly position?: number | undefined;
368
+ readonly limit?: number | undefined;
369
+ readonly has_keyword?: InboxKeyword | undefined;
370
+ readonly not_keyword?: InboxKeyword | undefined;
371
+ };
372
+ type DownloadInboxAttachmentParams = {
373
+ readonly blob_id: string;
374
+ readonly name?: string | undefined;
375
+ };
376
+ type UpdateInboxMessageParams = {
377
+ readonly read?: boolean | undefined;
378
+ readonly starred?: boolean | undefined;
379
+ };
380
+ type MoveInboxMessageParams = {
381
+ readonly from_folder_id?: string | undefined;
382
+ readonly target_role?: "inbox" | "archive" | "junk" | "trash" | undefined;
383
+ readonly target_folder_id?: string | undefined;
384
+ };
199
385
  type UpdateAutoReplyParams = {
200
386
  readonly enabled: boolean;
201
387
  readonly subject?: string | null | undefined;
@@ -203,6 +389,12 @@ type UpdateAutoReplyParams = {
203
389
  readonly from_date?: string | null | undefined;
204
390
  readonly to_date?: string | null | undefined;
205
391
  };
392
+ type UpdateSpamFilterParams = {
393
+ readonly threshold: number;
394
+ };
395
+ type UpdateMailboxRulesParams = {
396
+ readonly rules: readonly MailboxRule[];
397
+ };
206
398
 
207
399
  declare class Mailboxes extends ApiResource {
208
400
  create(params: CreateMailboxParams, options?: MethodOptions): Promise<Mailbox>;
@@ -211,7 +403,22 @@ declare class Mailboxes extends ApiResource {
211
403
  get(id: string, options?: MethodOptions): Promise<Mailbox>;
212
404
  update(id: string, params: UpdateMailboxParams, options?: MethodOptions): Promise<Mailbox>;
213
405
  delete(id: string, options?: MethodOptions): Promise<void>;
406
+ listFolders(id: string, options?: MethodOptions): Promise<MailboxFolders>;
407
+ createFolder(id: string, params: CreateMailboxFolderParams, options?: MethodOptions): Promise<MailboxFolder>;
408
+ updateFolder(id: string, folderId: string, params: UpdateMailboxFolderParams, options?: MethodOptions): Promise<MailboxFolder>;
409
+ deleteFolder(id: string, folderId: string, options?: MethodOptions): Promise<void>;
410
+ listIdentities(id: string, options?: MethodOptions): Promise<MailboxIdentities>;
411
+ listInboxMessages(id: string, params?: ListInboxMessagesParams, options?: MethodOptions): Promise<InboxMessages>;
412
+ getInboxThread(id: string, threadId: string, options?: MethodOptions): Promise<InboxThread>;
413
+ updateInboxMessage(id: string, messageId: string, params: UpdateInboxMessageParams, options?: MethodOptions): Promise<InboxMessageAction>;
414
+ moveInboxMessage(id: string, messageId: string, params: MoveInboxMessageParams, options?: MethodOptions): Promise<InboxMessageAction>;
415
+ deleteInboxMessage(id: string, messageId: string, options?: MethodOptions): Promise<void>;
416
+ downloadInboxAttachment(id: string, params: DownloadInboxAttachmentParams, options?: MethodOptions): Promise<Uint8Array>;
417
+ resetPassword(id: string, params: ResetMailboxPasswordParams, options?: MethodOptions): Promise<Mailbox>;
418
+ getRules(id: string, options?: MethodOptions): Promise<MailboxRules>;
419
+ updateRules(id: string, params: UpdateMailboxRulesParams, options?: MethodOptions): Promise<MailboxRules>;
214
420
  updateAutoReply(id: string, params: UpdateAutoReplyParams, options?: MethodOptions): Promise<Mailbox>;
421
+ updateSpamFilter(id: string, params: UpdateSpamFilterParams, options?: MethodOptions): Promise<Mailbox>;
215
422
  }
216
423
 
217
424
  type Message = {
@@ -301,6 +508,16 @@ declare class Suppressions extends ApiResource {
301
508
  remove(email: string, options?: MethodOptions): Promise<void>;
302
509
  }
303
510
 
511
+ type Thread = {
512
+ readonly object: "thread";
513
+ readonly id: string;
514
+ readonly mailbox_id: string;
515
+ readonly subject: string | null;
516
+ readonly message_count: number;
517
+ readonly latest_message: Message;
518
+ readonly created_at: string;
519
+ readonly updated_at: string;
520
+ };
304
521
  type ListThreadsParams = PaginationParams & {
305
522
  readonly mailbox_id: string;
306
523
  };
@@ -313,8 +530,8 @@ type ReplyToThreadParams = {
313
530
  };
314
531
 
315
532
  declare class Threads extends ApiResource {
316
- list(params: ListThreadsParams, options?: MethodOptions): Promise<PaginatedResponse<Message>>;
317
- listAutoPaginating(params: Omit<ListThreadsParams, "cursor">): Page<Message>;
533
+ list(params: ListThreadsParams, options?: MethodOptions): Promise<PaginatedResponse<Thread>>;
534
+ listAutoPaginating(params: Omit<ListThreadsParams, "cursor">): Page<Thread>;
318
535
  get(id: string, params?: GetThreadParams, options?: MethodOptions): Promise<PaginatedResponse<Message>>;
319
536
  reply(id: string, params: ReplyToThreadParams, options?: MethodOptions): Promise<Message>;
320
537
  }
@@ -419,6 +636,8 @@ declare class ShipMailClient {
419
636
  */
420
637
  constructor(config: string | ShipMailConfig);
421
638
  request<T>(options: RequestOptions): Promise<T>;
639
+ requestBytes(options: RequestOptions): Promise<Uint8Array>;
640
+ private requestWithParser;
422
641
  private buildUrl;
423
642
  }
424
643
 
@@ -493,4 +712,4 @@ declare function verifyWebhook(body: string, headers: WebhookHeaders | Headers,
493
712
  readonly toleranceInSeconds?: number | undefined;
494
713
  }): Promise<WebhookEvent>;
495
714
 
496
- export { type ApiErrorBody, AuthenticationError, AuthorizationError, ConflictError, ConnectionError, type CreateDomainParams, type CreateMailboxParams, type CreateWebhookParams, DOMAIN_STATUSES, type Domain, type DomainRegistrationInfo, type DomainSearchResult, type DomainStatus, type DomainVerificationResult, type EmailRecipient, type EmailRecipientInput, type ErrorType, type GetThreadParams, InternalServerError, type ListDeliveriesParams, type ListDomainsParams, type ListMailboxesParams, type ListMessagesParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MESSAGE_SOURCES, MESSAGE_STATUSES, type Mailbox, type Message, type MessageSource, type MessageStatus, type MethodOptions, NotFoundError, Page, type PaginatedResponse, type PaginationParams, QuotaExceededError, RateLimitError, type RegisterDomainParams, type RegistrationContact, type ReplyToMessageParams, type ReplyToThreadParams, type RequestOptions, type RotateSecretResponse, type SearchDomainsParams, type SendMessageParams, ShipMailClient, type ShipMailConfig, ShipMailError, type StatusResponse, type Suppression, type TestWebhookResponse, type UpdateAutoReplyParams, type UpdateDomainParams, type UpdateMailboxParams, type UpdateWebhookParams, ValidationError, WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, type Webhook, type WebhookDelivery, type WebhookDeliveryStatus, type WebhookEvent, type WebhookEventType, WebhookVerificationError, type WebhookWithSecret, ShipMailClient as default, verifyWebhook };
715
+ export { type ApiErrorBody, AuthenticationError, AuthorizationError, ConflictError, ConnectionError, type CreateDomainParams, type CreateMailboxFolderParams, type CreateMailboxParams, type CreateWebhookParams, DOMAIN_STATUSES, type Domain, type DomainRegistrationInfo, type DomainSearchResult, type DomainStatus, type DomainVerificationResult, type DownloadInboxAttachmentParams, type EmailRecipient, type EmailRecipientInput, type ErrorType, type GetThreadParams, type InboxAttachment, type InboxBodyPart, type InboxBodyValue, type InboxEmailHeader, type InboxFullMessage, type InboxKeyword, type InboxMessage, type InboxMessageAction, type InboxMessages, type InboxThread, InternalServerError, type ListDeliveriesParams, type ListDomainsParams, type ListInboxMessagesParams, type ListMailboxesParams, type ListMessagesParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MESSAGE_SOURCES, MESSAGE_STATUSES, type Mailbox, type MailboxFolder, type MailboxFolders, type MailboxIdentities, type MailboxIdentity, type MailboxRule, type MailboxRuleAction, type MailboxRuleCondition, type MailboxRuleFolder, type MailboxRuleMatchMode, type MailboxRuleMoveTarget, type MailboxRules, type Message, type MessageSource, type MessageStatus, type MethodOptions, type MoveInboxMessageParams, NotFoundError, Page, type PaginatedResponse, type PaginationParams, QuotaExceededError, RateLimitError, type RegisterDomainParams, type RegistrationContact, type ReplyToMessageParams, type ReplyToThreadParams, type RequestOptions, type ResetMailboxPasswordParams, type RotateSecretResponse, type SearchDomainsParams, type SendMessageParams, ShipMailClient, type ShipMailConfig, ShipMailError, type StatusResponse, type Suppression, type TestWebhookResponse, type Thread, type UpdateAutoReplyParams, type UpdateDomainParams, type UpdateInboxMessageParams, type UpdateMailboxFolderParams, type UpdateMailboxParams, type UpdateMailboxRulesParams, type UpdateSpamFilterParams, type UpdateWebhookParams, ValidationError, WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, type Webhook, type WebhookDelivery, type WebhookDeliveryStatus, type WebhookEvent, type WebhookEventType, WebhookVerificationError, type WebhookWithSecret, ShipMailClient as default, verifyWebhook };
package/dist/index.d.ts CHANGED
@@ -95,7 +95,7 @@ type CreateDomainParams = {
95
95
  readonly name: string;
96
96
  };
97
97
  type UpdateDomainParams = {
98
- readonly catch_all_mailbox_id?: string | null | undefined;
98
+ readonly catch_all_mailbox_id: string | null;
99
99
  };
100
100
  type ListDomainsParams = PaginationParams;
101
101
  type DomainVerificationResult = {
@@ -181,10 +181,165 @@ type Mailbox = {
181
181
  readonly address: string;
182
182
  readonly display_name: string | null;
183
183
  readonly suspended_at: string | null;
184
+ readonly spam_filter_threshold: number;
184
185
  readonly auto_reply: AutoReply;
185
186
  readonly created_at: string;
186
187
  readonly updated_at: string;
187
188
  };
189
+ type MailboxFolder = {
190
+ readonly object: "mailbox_folder";
191
+ readonly id: string;
192
+ readonly name: string;
193
+ readonly role: string | null;
194
+ readonly kind: "custom" | "system";
195
+ readonly total_emails: number;
196
+ readonly unread_emails: number;
197
+ readonly unread_threads: number;
198
+ readonly sort_order: number;
199
+ };
200
+ type MailboxFolders = {
201
+ readonly object: "mailbox_folders";
202
+ readonly mailbox_id: string;
203
+ readonly address: string;
204
+ readonly data: readonly MailboxFolder[];
205
+ };
206
+ type MailboxIdentity = {
207
+ readonly object: "mailbox_identity";
208
+ readonly id: string;
209
+ readonly name: string;
210
+ readonly email: string;
211
+ };
212
+ type MailboxIdentities = {
213
+ readonly object: "mailbox_identities";
214
+ readonly mailbox_id: string;
215
+ readonly address: string;
216
+ readonly data: readonly MailboxIdentity[];
217
+ };
218
+ type InboxEmailHeader = {
219
+ readonly name: string | null;
220
+ readonly email: string | null;
221
+ };
222
+ type InboxKeyword = "$flagged" | "$seen" | "$draft" | "$answered" | "$forwarded";
223
+ type InboxAttachment = {
224
+ readonly part_id: string;
225
+ readonly blob_id: string;
226
+ readonly name: string | null;
227
+ readonly content_type: string;
228
+ readonly size: number;
229
+ readonly download_path: string;
230
+ };
231
+ type InboxBodyPart = {
232
+ readonly part_id: string;
233
+ readonly type: string;
234
+ };
235
+ type InboxBodyValue = {
236
+ readonly value: string;
237
+ readonly is_encoding_problem: boolean;
238
+ };
239
+ type InboxMessage = {
240
+ readonly object: "inbox_message";
241
+ readonly id: string;
242
+ readonly thread_id: string;
243
+ readonly mailbox_id: string;
244
+ readonly address: string;
245
+ readonly folder_ids: readonly string[];
246
+ readonly keywords: Readonly<Record<string, boolean>>;
247
+ readonly from: readonly InboxEmailHeader[] | null;
248
+ readonly to: readonly InboxEmailHeader[] | null;
249
+ readonly subject: string | null;
250
+ readonly received_at: string;
251
+ readonly preview: string;
252
+ readonly has_attachment: boolean;
253
+ readonly size: number;
254
+ };
255
+ type InboxFullMessage = Omit<InboxMessage, "object"> & {
256
+ readonly object: "inbox_message_full";
257
+ readonly cc: readonly InboxEmailHeader[] | null;
258
+ readonly reply_to: readonly InboxEmailHeader[] | null;
259
+ readonly message_id: readonly string[] | null;
260
+ readonly in_reply_to: readonly string[] | null;
261
+ readonly references: readonly string[] | null;
262
+ readonly body_values: Readonly<Record<string, InboxBodyValue>>;
263
+ readonly text_body: readonly InboxBodyPart[];
264
+ readonly html_body: readonly InboxBodyPart[];
265
+ readonly attachments: readonly InboxAttachment[];
266
+ };
267
+ type InboxMessages = {
268
+ readonly object: "inbox_messages";
269
+ readonly mailbox_id: string;
270
+ readonly address: string;
271
+ readonly data: readonly InboxMessage[];
272
+ readonly pagination: {
273
+ readonly position: number;
274
+ readonly limit: number;
275
+ readonly total: number;
276
+ readonly has_more: boolean;
277
+ readonly next_position: number | null;
278
+ };
279
+ };
280
+ type InboxThread = {
281
+ readonly object: "inbox_thread";
282
+ readonly mailbox_id: string;
283
+ readonly address: string;
284
+ readonly thread_id: string;
285
+ readonly data: readonly InboxFullMessage[];
286
+ };
287
+ type InboxMessageAction = {
288
+ readonly object: "inbox_message_action";
289
+ readonly mailbox_id: string;
290
+ readonly address: string;
291
+ readonly message_id: string;
292
+ readonly ok: true;
293
+ };
294
+ type MailboxRuleMatchMode = "all" | "any";
295
+ type MailboxRuleCondition = {
296
+ readonly type: "from_is" | "from_contains" | "recipient_is" | "plus_tag_is" | "subject_contains";
297
+ readonly value: string;
298
+ } | {
299
+ readonly type: "has_attachment" | "list_unsubscribe_exists";
300
+ } | {
301
+ readonly type: "group";
302
+ readonly match_mode: MailboxRuleMatchMode;
303
+ readonly conditions: readonly MailboxRuleCondition[];
304
+ };
305
+ type MailboxRuleMoveTarget = {
306
+ readonly kind: "system";
307
+ readonly role: "inbox" | "archive" | "junk" | "trash";
308
+ } | {
309
+ readonly kind: "custom";
310
+ readonly folder_id: string;
311
+ };
312
+ type MailboxRuleAction = {
313
+ readonly type: "move";
314
+ readonly target: MailboxRuleMoveTarget;
315
+ } | {
316
+ readonly type: "mark_read";
317
+ } | {
318
+ readonly type: "star";
319
+ };
320
+ type MailboxRule = {
321
+ readonly id: string;
322
+ readonly name: string;
323
+ readonly enabled: boolean;
324
+ readonly position: number;
325
+ readonly match_mode: MailboxRuleMatchMode;
326
+ readonly stop: boolean;
327
+ readonly conditions: readonly MailboxRuleCondition[];
328
+ readonly actions: readonly MailboxRuleAction[];
329
+ };
330
+ type MailboxRuleFolder = {
331
+ readonly id: string;
332
+ readonly name: string;
333
+ readonly role: string | null;
334
+ readonly kind: "custom" | "system";
335
+ };
336
+ type MailboxRules = {
337
+ readonly object: "mailbox_rules";
338
+ readonly mailbox_id: string;
339
+ readonly address: string;
340
+ readonly rules: readonly MailboxRule[];
341
+ readonly folders: readonly MailboxRuleFolder[];
342
+ };
188
343
  type CreateMailboxParams = {
189
344
  readonly domain_id: string;
190
345
  readonly address: string;
@@ -193,9 +348,40 @@ type CreateMailboxParams = {
193
348
  type UpdateMailboxParams = {
194
349
  readonly display_name?: string | null | undefined;
195
350
  };
351
+ type CreateMailboxFolderParams = {
352
+ readonly name: string;
353
+ };
354
+ type UpdateMailboxFolderParams = {
355
+ readonly name: string;
356
+ };
357
+ type ResetMailboxPasswordParams = {
358
+ readonly password: string;
359
+ };
196
360
  type ListMailboxesParams = PaginationParams & {
197
361
  readonly domain_id?: string | undefined;
198
362
  };
363
+ type ListInboxMessagesParams = {
364
+ readonly folder_id?: string | undefined;
365
+ readonly folder_role?: "inbox" | "starred" | "sent" | "drafts" | "archive" | "junk" | "trash" | undefined;
366
+ readonly search_text?: string | undefined;
367
+ readonly position?: number | undefined;
368
+ readonly limit?: number | undefined;
369
+ readonly has_keyword?: InboxKeyword | undefined;
370
+ readonly not_keyword?: InboxKeyword | undefined;
371
+ };
372
+ type DownloadInboxAttachmentParams = {
373
+ readonly blob_id: string;
374
+ readonly name?: string | undefined;
375
+ };
376
+ type UpdateInboxMessageParams = {
377
+ readonly read?: boolean | undefined;
378
+ readonly starred?: boolean | undefined;
379
+ };
380
+ type MoveInboxMessageParams = {
381
+ readonly from_folder_id?: string | undefined;
382
+ readonly target_role?: "inbox" | "archive" | "junk" | "trash" | undefined;
383
+ readonly target_folder_id?: string | undefined;
384
+ };
199
385
  type UpdateAutoReplyParams = {
200
386
  readonly enabled: boolean;
201
387
  readonly subject?: string | null | undefined;
@@ -203,6 +389,12 @@ type UpdateAutoReplyParams = {
203
389
  readonly from_date?: string | null | undefined;
204
390
  readonly to_date?: string | null | undefined;
205
391
  };
392
+ type UpdateSpamFilterParams = {
393
+ readonly threshold: number;
394
+ };
395
+ type UpdateMailboxRulesParams = {
396
+ readonly rules: readonly MailboxRule[];
397
+ };
206
398
 
207
399
  declare class Mailboxes extends ApiResource {
208
400
  create(params: CreateMailboxParams, options?: MethodOptions): Promise<Mailbox>;
@@ -211,7 +403,22 @@ declare class Mailboxes extends ApiResource {
211
403
  get(id: string, options?: MethodOptions): Promise<Mailbox>;
212
404
  update(id: string, params: UpdateMailboxParams, options?: MethodOptions): Promise<Mailbox>;
213
405
  delete(id: string, options?: MethodOptions): Promise<void>;
406
+ listFolders(id: string, options?: MethodOptions): Promise<MailboxFolders>;
407
+ createFolder(id: string, params: CreateMailboxFolderParams, options?: MethodOptions): Promise<MailboxFolder>;
408
+ updateFolder(id: string, folderId: string, params: UpdateMailboxFolderParams, options?: MethodOptions): Promise<MailboxFolder>;
409
+ deleteFolder(id: string, folderId: string, options?: MethodOptions): Promise<void>;
410
+ listIdentities(id: string, options?: MethodOptions): Promise<MailboxIdentities>;
411
+ listInboxMessages(id: string, params?: ListInboxMessagesParams, options?: MethodOptions): Promise<InboxMessages>;
412
+ getInboxThread(id: string, threadId: string, options?: MethodOptions): Promise<InboxThread>;
413
+ updateInboxMessage(id: string, messageId: string, params: UpdateInboxMessageParams, options?: MethodOptions): Promise<InboxMessageAction>;
414
+ moveInboxMessage(id: string, messageId: string, params: MoveInboxMessageParams, options?: MethodOptions): Promise<InboxMessageAction>;
415
+ deleteInboxMessage(id: string, messageId: string, options?: MethodOptions): Promise<void>;
416
+ downloadInboxAttachment(id: string, params: DownloadInboxAttachmentParams, options?: MethodOptions): Promise<Uint8Array>;
417
+ resetPassword(id: string, params: ResetMailboxPasswordParams, options?: MethodOptions): Promise<Mailbox>;
418
+ getRules(id: string, options?: MethodOptions): Promise<MailboxRules>;
419
+ updateRules(id: string, params: UpdateMailboxRulesParams, options?: MethodOptions): Promise<MailboxRules>;
214
420
  updateAutoReply(id: string, params: UpdateAutoReplyParams, options?: MethodOptions): Promise<Mailbox>;
421
+ updateSpamFilter(id: string, params: UpdateSpamFilterParams, options?: MethodOptions): Promise<Mailbox>;
215
422
  }
216
423
 
217
424
  type Message = {
@@ -301,6 +508,16 @@ declare class Suppressions extends ApiResource {
301
508
  remove(email: string, options?: MethodOptions): Promise<void>;
302
509
  }
303
510
 
511
+ type Thread = {
512
+ readonly object: "thread";
513
+ readonly id: string;
514
+ readonly mailbox_id: string;
515
+ readonly subject: string | null;
516
+ readonly message_count: number;
517
+ readonly latest_message: Message;
518
+ readonly created_at: string;
519
+ readonly updated_at: string;
520
+ };
304
521
  type ListThreadsParams = PaginationParams & {
305
522
  readonly mailbox_id: string;
306
523
  };
@@ -313,8 +530,8 @@ type ReplyToThreadParams = {
313
530
  };
314
531
 
315
532
  declare class Threads extends ApiResource {
316
- list(params: ListThreadsParams, options?: MethodOptions): Promise<PaginatedResponse<Message>>;
317
- listAutoPaginating(params: Omit<ListThreadsParams, "cursor">): Page<Message>;
533
+ list(params: ListThreadsParams, options?: MethodOptions): Promise<PaginatedResponse<Thread>>;
534
+ listAutoPaginating(params: Omit<ListThreadsParams, "cursor">): Page<Thread>;
318
535
  get(id: string, params?: GetThreadParams, options?: MethodOptions): Promise<PaginatedResponse<Message>>;
319
536
  reply(id: string, params: ReplyToThreadParams, options?: MethodOptions): Promise<Message>;
320
537
  }
@@ -419,6 +636,8 @@ declare class ShipMailClient {
419
636
  */
420
637
  constructor(config: string | ShipMailConfig);
421
638
  request<T>(options: RequestOptions): Promise<T>;
639
+ requestBytes(options: RequestOptions): Promise<Uint8Array>;
640
+ private requestWithParser;
422
641
  private buildUrl;
423
642
  }
424
643
 
@@ -493,4 +712,4 @@ declare function verifyWebhook(body: string, headers: WebhookHeaders | Headers,
493
712
  readonly toleranceInSeconds?: number | undefined;
494
713
  }): Promise<WebhookEvent>;
495
714
 
496
- export { type ApiErrorBody, AuthenticationError, AuthorizationError, ConflictError, ConnectionError, type CreateDomainParams, type CreateMailboxParams, type CreateWebhookParams, DOMAIN_STATUSES, type Domain, type DomainRegistrationInfo, type DomainSearchResult, type DomainStatus, type DomainVerificationResult, type EmailRecipient, type EmailRecipientInput, type ErrorType, type GetThreadParams, InternalServerError, type ListDeliveriesParams, type ListDomainsParams, type ListMailboxesParams, type ListMessagesParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MESSAGE_SOURCES, MESSAGE_STATUSES, type Mailbox, type Message, type MessageSource, type MessageStatus, type MethodOptions, NotFoundError, Page, type PaginatedResponse, type PaginationParams, QuotaExceededError, RateLimitError, type RegisterDomainParams, type RegistrationContact, type ReplyToMessageParams, type ReplyToThreadParams, type RequestOptions, type RotateSecretResponse, type SearchDomainsParams, type SendMessageParams, ShipMailClient, type ShipMailConfig, ShipMailError, type StatusResponse, type Suppression, type TestWebhookResponse, type UpdateAutoReplyParams, type UpdateDomainParams, type UpdateMailboxParams, type UpdateWebhookParams, ValidationError, WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, type Webhook, type WebhookDelivery, type WebhookDeliveryStatus, type WebhookEvent, type WebhookEventType, WebhookVerificationError, type WebhookWithSecret, ShipMailClient as default, verifyWebhook };
715
+ export { type ApiErrorBody, AuthenticationError, AuthorizationError, ConflictError, ConnectionError, type CreateDomainParams, type CreateMailboxFolderParams, type CreateMailboxParams, type CreateWebhookParams, DOMAIN_STATUSES, type Domain, type DomainRegistrationInfo, type DomainSearchResult, type DomainStatus, type DomainVerificationResult, type DownloadInboxAttachmentParams, type EmailRecipient, type EmailRecipientInput, type ErrorType, type GetThreadParams, type InboxAttachment, type InboxBodyPart, type InboxBodyValue, type InboxEmailHeader, type InboxFullMessage, type InboxKeyword, type InboxMessage, type InboxMessageAction, type InboxMessages, type InboxThread, InternalServerError, type ListDeliveriesParams, type ListDomainsParams, type ListInboxMessagesParams, type ListMailboxesParams, type ListMessagesParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MESSAGE_SOURCES, MESSAGE_STATUSES, type Mailbox, type MailboxFolder, type MailboxFolders, type MailboxIdentities, type MailboxIdentity, type MailboxRule, type MailboxRuleAction, type MailboxRuleCondition, type MailboxRuleFolder, type MailboxRuleMatchMode, type MailboxRuleMoveTarget, type MailboxRules, type Message, type MessageSource, type MessageStatus, type MethodOptions, type MoveInboxMessageParams, NotFoundError, Page, type PaginatedResponse, type PaginationParams, QuotaExceededError, RateLimitError, type RegisterDomainParams, type RegistrationContact, type ReplyToMessageParams, type ReplyToThreadParams, type RequestOptions, type ResetMailboxPasswordParams, type RotateSecretResponse, type SearchDomainsParams, type SendMessageParams, ShipMailClient, type ShipMailConfig, ShipMailError, type StatusResponse, type Suppression, type TestWebhookResponse, type Thread, type UpdateAutoReplyParams, type UpdateDomainParams, type UpdateInboxMessageParams, type UpdateMailboxFolderParams, type UpdateMailboxParams, type UpdateMailboxRulesParams, type UpdateSpamFilterParams, type UpdateWebhookParams, ValidationError, WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, type Webhook, type WebhookDelivery, type WebhookDeliveryStatus, type WebhookEvent, type WebhookEventType, WebhookVerificationError, type WebhookWithSecret, ShipMailClient as default, verifyWebhook };