shipmail 0.6.3 → 0.6.5

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
@@ -67,9 +67,9 @@ type EmailRecipient = {
67
67
  readonly name?: string | null | undefined;
68
68
  };
69
69
  type EmailRecipientInput = EmailRecipient | string;
70
- declare const WEBHOOK_EVENT_TYPES: readonly ["message.received", "message.sent", "message.delivered", "message.bounced", "message.complained", "mailbox.rule_matched", "mailbox.export.completed", "mailbox.export.failed", "domain.verified", "domain.verification_failed", "domain.degraded", "org.reputation_warning", "org.sending_throttled", "org.sending_suspended", "org.reputation_recovered", "reply.overdue", "conversation.needs_action", "calendar.event_starting", "booking.created", "subscriber.added", "newsletter.sent"];
70
+ declare const WEBHOOK_EVENT_TYPES: readonly ["message.received", "message.sent", "message.delayed", "message.delivered", "message.bounced", "message.complained", "mailbox.rule_matched", "mailbox.export.completed", "mailbox.export.failed", "domain.verified", "domain.verification_failed", "domain.degraded", "org.reputation_warning", "org.sending_throttled", "org.sending_suspended", "org.reputation_recovered", "reply.overdue", "conversation.needs_action", "calendar.event_starting", "booking.created", "subscriber.added", "newsletter.sent"];
71
71
  type WebhookEventType = (typeof WEBHOOK_EVENT_TYPES)[number];
72
- declare const WEBHOOK_DELIVERY_EVENT_TYPES: readonly ["webhook.test", "message.received", "message.sent", "message.delivered", "message.bounced", "message.complained", "mailbox.rule_matched", "mailbox.export.completed", "mailbox.export.failed", "domain.verified", "domain.verification_failed", "domain.degraded", "org.reputation_warning", "org.sending_throttled", "org.sending_suspended", "org.reputation_recovered", "reply.overdue", "conversation.needs_action", "calendar.event_starting", "booking.created", "subscriber.added", "newsletter.sent"];
72
+ declare const WEBHOOK_DELIVERY_EVENT_TYPES: readonly ["webhook.test", "message.received", "message.sent", "message.delayed", "message.delivered", "message.bounced", "message.complained", "mailbox.rule_matched", "mailbox.export.completed", "mailbox.export.failed", "domain.verified", "domain.verification_failed", "domain.degraded", "org.reputation_warning", "org.sending_throttled", "org.sending_suspended", "org.reputation_recovered", "reply.overdue", "conversation.needs_action", "calendar.event_starting", "booking.created", "subscriber.added", "newsletter.sent"];
73
73
  type WebhookDeliveryEventType = (typeof WEBHOOK_DELIVERY_EVENT_TYPES)[number];
74
74
  type StatusResponse = {
75
75
  readonly status: string;
@@ -1229,12 +1229,16 @@ type InboxFullMessage = Omit<InboxMessage, "object"> & {
1229
1229
  readonly text_body: readonly InboxBodyPart[];
1230
1230
  readonly html_body: readonly InboxBodyPart[];
1231
1231
  readonly attachments: readonly InboxAttachment[];
1232
+ /** What the sender newly wrote, without quoted history or signature. `null` when nothing is left. */
1233
+ readonly reply_text: string | null;
1232
1234
  };
1233
1235
  type InboxMessages = {
1234
1236
  readonly object: "inbox_messages";
1235
1237
  readonly mailbox_id: string;
1236
1238
  readonly address: string;
1237
1239
  readonly data: readonly InboxFullMessage[];
1240
+ /** Messages in Junk that match the other filters, when a folder filter leaves Junk out. Null otherwise. */
1241
+ readonly junk_total: number | null;
1238
1242
  readonly pagination: {
1239
1243
  readonly limit: number;
1240
1244
  readonly total: number;
@@ -1355,10 +1359,13 @@ type InboxMessageAction = {
1355
1359
  readonly address: string;
1356
1360
  readonly message_id: string;
1357
1361
  readonly ok: true;
1362
+ /** Folders and keywords read back after the change. Null when the message could not be read. */
1363
+ readonly folder_ids: readonly string[] | null;
1364
+ readonly keywords: Readonly<Record<string, boolean>> | null;
1358
1365
  };
1359
1366
  type MailboxRuleMatchMode = "all" | "any";
1360
1367
  type MailboxRuleCondition = {
1361
- readonly type: "from_is" | "from_contains" | "recipient_is" | "plus_tag_is" | "subject_contains";
1368
+ readonly type: "from_is" | "from_contains" | "recipient_is" | "recipient_contains" | "plus_tag_is" | "subject_contains";
1362
1369
  readonly value: string;
1363
1370
  } | {
1364
1371
  readonly type: "has_attachment" | "list_unsubscribe_exists";
@@ -1463,6 +1470,13 @@ type ListInboxMessagesParams = {
1463
1470
  readonly folder_id?: string | undefined;
1464
1471
  readonly folder_role?: "inbox" | "starred" | "sent" | "drafts" | "archive" | "junk" | "trash" | undefined;
1465
1472
  readonly search_text?: string | undefined;
1473
+ /** Matches the From name or address. */
1474
+ readonly from?: string | undefined;
1475
+ /** Matches the To recipients by name or address. Cc and Bcc are not searched. */
1476
+ readonly to?: string | undefined;
1477
+ readonly subject?: string | undefined;
1478
+ /** `true` for messages with an attachment, `false` for messages without one. */
1479
+ readonly has_attachment?: boolean | undefined;
1466
1480
  readonly cursor?: string | undefined;
1467
1481
  readonly after?: string | undefined;
1468
1482
  readonly before?: string | undefined;
@@ -1724,6 +1738,7 @@ type Newsletter = {
1724
1738
  readonly feed_entry_url: string | null;
1725
1739
  readonly styling_mode: NewsletterStylingMode;
1726
1740
  readonly track_engagement: boolean;
1741
+ readonly add_utm_tags: boolean;
1727
1742
  readonly opened_count: number | null;
1728
1743
  readonly clicked_count: number | null;
1729
1744
  readonly preflight_status: NewsletterPreflightStatus;
@@ -1815,6 +1830,7 @@ type CreateNewsletterParams = {
1815
1830
  readonly feed_entry_url?: string | null | undefined;
1816
1831
  readonly styling_mode?: NewsletterStylingMode | undefined;
1817
1832
  readonly track_engagement?: boolean | undefined;
1833
+ readonly add_utm_tags?: boolean | undefined;
1818
1834
  };
1819
1835
  type UpdateNewsletterParams = Partial<CreateNewsletterParams>;
1820
1836
  type NewsletterChangelogMedia = {
@@ -2223,6 +2239,11 @@ type Webhook = {
2223
2239
  readonly description: string | null;
2224
2240
  readonly mailbox_ids: readonly string[] | null;
2225
2241
  readonly domain_ids: readonly string[] | null;
2242
+ readonly has_authorization: boolean;
2243
+ readonly has_standard_webhooks_secret: boolean;
2244
+ readonly include_reply_text: boolean;
2245
+ readonly authenticated_senders_only: boolean;
2246
+ readonly allowed_senders: readonly string[] | null;
2226
2247
  readonly created_at: string;
2227
2248
  readonly updated_at: string;
2228
2249
  };
@@ -2235,6 +2256,16 @@ type CreateWebhookParams = {
2235
2256
  readonly description?: string | undefined;
2236
2257
  readonly mailbox_ids?: readonly string[] | null | undefined;
2237
2258
  readonly domain_ids?: readonly string[] | null | undefined;
2259
+ /** Sent verbatim as the `Authorization` header of every delivery. Write-only. */
2260
+ readonly authorization?: string | null | undefined;
2261
+ /** A `whsec_` secret from the receiving service. Deliveries then carry Standard Webhooks signatures. Write-only. */
2262
+ readonly standard_webhooks_secret?: string | null | undefined;
2263
+ /** Add `reply_text` to `message.received` deliveries. The API key also needs `messages:read`. */
2264
+ readonly include_reply_text?: boolean | undefined;
2265
+ /** Skip `message.received` deliveries whose sender did not pass DMARC. */
2266
+ readonly authenticated_senders_only?: boolean | undefined;
2267
+ /** Deliver `message.received` only from these addresses or exact domains. At most 100. */
2268
+ readonly allowed_senders?: readonly string[] | null | undefined;
2238
2269
  };
2239
2270
  type UpdateWebhookParams = {
2240
2271
  readonly url?: string | undefined;
@@ -2243,6 +2274,16 @@ type UpdateWebhookParams = {
2243
2274
  readonly active?: boolean | undefined;
2244
2275
  readonly mailbox_ids?: readonly string[] | null | undefined;
2245
2276
  readonly domain_ids?: readonly string[] | null | undefined;
2277
+ /** A string replaces the delivery `Authorization` header, `null` removes it. */
2278
+ readonly authorization?: string | null | undefined;
2279
+ /** A string replaces the Standard Webhooks signing secret, `null` removes it. */
2280
+ readonly standard_webhooks_secret?: string | null | undefined;
2281
+ /** Add `reply_text` to `message.received` deliveries. The API key also needs `messages:read`. */
2282
+ readonly include_reply_text?: boolean | undefined;
2283
+ /** Skip `message.received` deliveries whose sender did not pass DMARC. */
2284
+ readonly authenticated_senders_only?: boolean | undefined;
2285
+ /** Replaces the sender list. `null` or `[]` delivers every sender again. */
2286
+ readonly allowed_senders?: readonly string[] | null | undefined;
2246
2287
  };
2247
2288
  type ListWebhooksParams = PaginationParams;
2248
2289
  type RotateSecretResponse = {
package/dist/index.d.ts CHANGED
@@ -67,9 +67,9 @@ type EmailRecipient = {
67
67
  readonly name?: string | null | undefined;
68
68
  };
69
69
  type EmailRecipientInput = EmailRecipient | string;
70
- declare const WEBHOOK_EVENT_TYPES: readonly ["message.received", "message.sent", "message.delivered", "message.bounced", "message.complained", "mailbox.rule_matched", "mailbox.export.completed", "mailbox.export.failed", "domain.verified", "domain.verification_failed", "domain.degraded", "org.reputation_warning", "org.sending_throttled", "org.sending_suspended", "org.reputation_recovered", "reply.overdue", "conversation.needs_action", "calendar.event_starting", "booking.created", "subscriber.added", "newsletter.sent"];
70
+ declare const WEBHOOK_EVENT_TYPES: readonly ["message.received", "message.sent", "message.delayed", "message.delivered", "message.bounced", "message.complained", "mailbox.rule_matched", "mailbox.export.completed", "mailbox.export.failed", "domain.verified", "domain.verification_failed", "domain.degraded", "org.reputation_warning", "org.sending_throttled", "org.sending_suspended", "org.reputation_recovered", "reply.overdue", "conversation.needs_action", "calendar.event_starting", "booking.created", "subscriber.added", "newsletter.sent"];
71
71
  type WebhookEventType = (typeof WEBHOOK_EVENT_TYPES)[number];
72
- declare const WEBHOOK_DELIVERY_EVENT_TYPES: readonly ["webhook.test", "message.received", "message.sent", "message.delivered", "message.bounced", "message.complained", "mailbox.rule_matched", "mailbox.export.completed", "mailbox.export.failed", "domain.verified", "domain.verification_failed", "domain.degraded", "org.reputation_warning", "org.sending_throttled", "org.sending_suspended", "org.reputation_recovered", "reply.overdue", "conversation.needs_action", "calendar.event_starting", "booking.created", "subscriber.added", "newsletter.sent"];
72
+ declare const WEBHOOK_DELIVERY_EVENT_TYPES: readonly ["webhook.test", "message.received", "message.sent", "message.delayed", "message.delivered", "message.bounced", "message.complained", "mailbox.rule_matched", "mailbox.export.completed", "mailbox.export.failed", "domain.verified", "domain.verification_failed", "domain.degraded", "org.reputation_warning", "org.sending_throttled", "org.sending_suspended", "org.reputation_recovered", "reply.overdue", "conversation.needs_action", "calendar.event_starting", "booking.created", "subscriber.added", "newsletter.sent"];
73
73
  type WebhookDeliveryEventType = (typeof WEBHOOK_DELIVERY_EVENT_TYPES)[number];
74
74
  type StatusResponse = {
75
75
  readonly status: string;
@@ -1229,12 +1229,16 @@ type InboxFullMessage = Omit<InboxMessage, "object"> & {
1229
1229
  readonly text_body: readonly InboxBodyPart[];
1230
1230
  readonly html_body: readonly InboxBodyPart[];
1231
1231
  readonly attachments: readonly InboxAttachment[];
1232
+ /** What the sender newly wrote, without quoted history or signature. `null` when nothing is left. */
1233
+ readonly reply_text: string | null;
1232
1234
  };
1233
1235
  type InboxMessages = {
1234
1236
  readonly object: "inbox_messages";
1235
1237
  readonly mailbox_id: string;
1236
1238
  readonly address: string;
1237
1239
  readonly data: readonly InboxFullMessage[];
1240
+ /** Messages in Junk that match the other filters, when a folder filter leaves Junk out. Null otherwise. */
1241
+ readonly junk_total: number | null;
1238
1242
  readonly pagination: {
1239
1243
  readonly limit: number;
1240
1244
  readonly total: number;
@@ -1355,10 +1359,13 @@ type InboxMessageAction = {
1355
1359
  readonly address: string;
1356
1360
  readonly message_id: string;
1357
1361
  readonly ok: true;
1362
+ /** Folders and keywords read back after the change. Null when the message could not be read. */
1363
+ readonly folder_ids: readonly string[] | null;
1364
+ readonly keywords: Readonly<Record<string, boolean>> | null;
1358
1365
  };
1359
1366
  type MailboxRuleMatchMode = "all" | "any";
1360
1367
  type MailboxRuleCondition = {
1361
- readonly type: "from_is" | "from_contains" | "recipient_is" | "plus_tag_is" | "subject_contains";
1368
+ readonly type: "from_is" | "from_contains" | "recipient_is" | "recipient_contains" | "plus_tag_is" | "subject_contains";
1362
1369
  readonly value: string;
1363
1370
  } | {
1364
1371
  readonly type: "has_attachment" | "list_unsubscribe_exists";
@@ -1463,6 +1470,13 @@ type ListInboxMessagesParams = {
1463
1470
  readonly folder_id?: string | undefined;
1464
1471
  readonly folder_role?: "inbox" | "starred" | "sent" | "drafts" | "archive" | "junk" | "trash" | undefined;
1465
1472
  readonly search_text?: string | undefined;
1473
+ /** Matches the From name or address. */
1474
+ readonly from?: string | undefined;
1475
+ /** Matches the To recipients by name or address. Cc and Bcc are not searched. */
1476
+ readonly to?: string | undefined;
1477
+ readonly subject?: string | undefined;
1478
+ /** `true` for messages with an attachment, `false` for messages without one. */
1479
+ readonly has_attachment?: boolean | undefined;
1466
1480
  readonly cursor?: string | undefined;
1467
1481
  readonly after?: string | undefined;
1468
1482
  readonly before?: string | undefined;
@@ -1724,6 +1738,7 @@ type Newsletter = {
1724
1738
  readonly feed_entry_url: string | null;
1725
1739
  readonly styling_mode: NewsletterStylingMode;
1726
1740
  readonly track_engagement: boolean;
1741
+ readonly add_utm_tags: boolean;
1727
1742
  readonly opened_count: number | null;
1728
1743
  readonly clicked_count: number | null;
1729
1744
  readonly preflight_status: NewsletterPreflightStatus;
@@ -1815,6 +1830,7 @@ type CreateNewsletterParams = {
1815
1830
  readonly feed_entry_url?: string | null | undefined;
1816
1831
  readonly styling_mode?: NewsletterStylingMode | undefined;
1817
1832
  readonly track_engagement?: boolean | undefined;
1833
+ readonly add_utm_tags?: boolean | undefined;
1818
1834
  };
1819
1835
  type UpdateNewsletterParams = Partial<CreateNewsletterParams>;
1820
1836
  type NewsletterChangelogMedia = {
@@ -2223,6 +2239,11 @@ type Webhook = {
2223
2239
  readonly description: string | null;
2224
2240
  readonly mailbox_ids: readonly string[] | null;
2225
2241
  readonly domain_ids: readonly string[] | null;
2242
+ readonly has_authorization: boolean;
2243
+ readonly has_standard_webhooks_secret: boolean;
2244
+ readonly include_reply_text: boolean;
2245
+ readonly authenticated_senders_only: boolean;
2246
+ readonly allowed_senders: readonly string[] | null;
2226
2247
  readonly created_at: string;
2227
2248
  readonly updated_at: string;
2228
2249
  };
@@ -2235,6 +2256,16 @@ type CreateWebhookParams = {
2235
2256
  readonly description?: string | undefined;
2236
2257
  readonly mailbox_ids?: readonly string[] | null | undefined;
2237
2258
  readonly domain_ids?: readonly string[] | null | undefined;
2259
+ /** Sent verbatim as the `Authorization` header of every delivery. Write-only. */
2260
+ readonly authorization?: string | null | undefined;
2261
+ /** A `whsec_` secret from the receiving service. Deliveries then carry Standard Webhooks signatures. Write-only. */
2262
+ readonly standard_webhooks_secret?: string | null | undefined;
2263
+ /** Add `reply_text` to `message.received` deliveries. The API key also needs `messages:read`. */
2264
+ readonly include_reply_text?: boolean | undefined;
2265
+ /** Skip `message.received` deliveries whose sender did not pass DMARC. */
2266
+ readonly authenticated_senders_only?: boolean | undefined;
2267
+ /** Deliver `message.received` only from these addresses or exact domains. At most 100. */
2268
+ readonly allowed_senders?: readonly string[] | null | undefined;
2238
2269
  };
2239
2270
  type UpdateWebhookParams = {
2240
2271
  readonly url?: string | undefined;
@@ -2243,6 +2274,16 @@ type UpdateWebhookParams = {
2243
2274
  readonly active?: boolean | undefined;
2244
2275
  readonly mailbox_ids?: readonly string[] | null | undefined;
2245
2276
  readonly domain_ids?: readonly string[] | null | undefined;
2277
+ /** A string replaces the delivery `Authorization` header, `null` removes it. */
2278
+ readonly authorization?: string | null | undefined;
2279
+ /** A string replaces the Standard Webhooks signing secret, `null` removes it. */
2280
+ readonly standard_webhooks_secret?: string | null | undefined;
2281
+ /** Add `reply_text` to `message.received` deliveries. The API key also needs `messages:read`. */
2282
+ readonly include_reply_text?: boolean | undefined;
2283
+ /** Skip `message.received` deliveries whose sender did not pass DMARC. */
2284
+ readonly authenticated_senders_only?: boolean | undefined;
2285
+ /** Replaces the sender list. `null` or `[]` delivers every sender again. */
2286
+ readonly allowed_senders?: readonly string[] | null | undefined;
2246
2287
  };
2247
2288
  type ListWebhooksParams = PaginationParams;
2248
2289
  type RotateSecretResponse = {
package/dist/index.js CHANGED
@@ -849,6 +849,10 @@ var Mailboxes = class extends ApiResource {
849
849
  folder_id: params?.folder_id,
850
850
  folder_role: params?.folder_role,
851
851
  search_text: params?.search_text,
852
+ from: params?.from,
853
+ to: params?.to,
854
+ subject: params?.subject,
855
+ has_attachment: params?.has_attachment,
852
856
  cursor: params?.cursor,
853
857
  after: params?.after,
854
858
  before: params?.before,
@@ -1661,7 +1665,7 @@ var Webhooks = class extends ApiResource {
1661
1665
  };
1662
1666
 
1663
1667
  // src/version.ts
1664
- var VERSION = "0.6.3";
1668
+ var VERSION = "0.6.5";
1665
1669
 
1666
1670
  // src/client.ts
1667
1671
  var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
@@ -1854,6 +1858,7 @@ var CONFERENCING_PROVIDER_IDS = ["zoom", "google_meet"];
1854
1858
  var WEBHOOK_EVENT_TYPES = [
1855
1859
  "message.received",
1856
1860
  "message.sent",
1861
+ "message.delayed",
1857
1862
  "message.delivered",
1858
1863
  "message.bounced",
1859
1864
  "message.complained",