@workwae/sdk 0.1.0-alpha.1 → 0.1.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +7 -7
  2. package/client.d.ts +1 -1
  3. package/contract/accounts/models.d.ts +85 -45
  4. package/contract/accounts/routes.d.ts +191 -29
  5. package/contract/ai/models.d.ts +0 -1
  6. package/contract/ai/routes.d.ts +9 -0
  7. package/contract/audit-log/models.d.ts +22 -5
  8. package/contract/audit-log/routes.d.ts +11 -1
  9. package/contract/calendar/models.d.ts +249 -74
  10. package/contract/calendar/routes.d.ts +574 -30
  11. package/contract/connect/models.d.ts +30 -16
  12. package/contract/connect/routes.d.ts +51 -7
  13. package/contract/connect-domain/models.d.ts +41 -0
  14. package/contract/connect-domain/routes.d.ts +197 -0
  15. package/contract/contacts/models.d.ts +0 -10
  16. package/contract/contacts/routes.d.ts +14 -0
  17. package/contract/custom-domain.d.ts +12 -0
  18. package/contract/email-validation/models.d.ts +119 -0
  19. package/contract/email-validation/routes.d.ts +106 -0
  20. package/contract/errors.d.ts +28 -20
  21. package/contract/events/models.d.ts +139 -79
  22. package/contract/events/routes.d.ts +54 -44
  23. package/contract/exports/routes.d.ts +10 -0
  24. package/contract/identities/models.d.ts +7 -9
  25. package/contract/identities/routes.d.ts +79 -10
  26. package/contract/limits.d.ts +27 -73
  27. package/contract/mail/models.d.ts +230 -50
  28. package/contract/mail/routes.d.ts +649 -59
  29. package/contract/mcp-keys/models.d.ts +125 -0
  30. package/contract/mcp-keys/routes.d.ts +151 -0
  31. package/contract/meetings/models.d.ts +39 -33
  32. package/contract/meetings/routes.d.ts +121 -23
  33. package/contract/oauth-apps/models.d.ts +6 -6
  34. package/contract/oauth-apps/routes.d.ts +34 -4
  35. package/contract/org-connections/models.d.ts +93 -39
  36. package/contract/org-connections/routes.d.ts +352 -43
  37. package/contract/plans/credit-packs.d.ts +30 -0
  38. package/contract/plans/models.d.ts +208 -0
  39. package/contract/primitives.d.ts +7 -62
  40. package/contract/public.d.ts +7 -0
  41. package/contract/reasons.d.ts +559 -21
  42. package/contract/router.d.ts +6447 -2719
  43. package/contract/scheduling/models.d.ts +405 -0
  44. package/contract/scheduling/routes.d.ts +756 -0
  45. package/contract/send/models.d.ts +140 -45
  46. package/contract/send/routes.d.ts +310 -31
  47. package/contract/settings/models.d.ts +73 -13
  48. package/contract/settings/routes.d.ts +56 -4
  49. package/contract/suppressions/models.d.ts +21 -28
  50. package/contract/suppressions/routes.d.ts +62 -14
  51. package/contract/templates/models.d.ts +0 -14
  52. package/contract/templates/routes.d.ts +30 -6
  53. package/contract/threads/models.d.ts +0 -5
  54. package/contract/threads/routes.d.ts +40 -0
  55. package/contract/tracking-domain/models.d.ts +41 -0
  56. package/contract/tracking-domain/routes.d.ts +193 -0
  57. package/contract/usage/models.d.ts +98 -126
  58. package/contract/usage/routes.d.ts +48 -20
  59. package/contract/webhooks/models.d.ts +45 -30
  60. package/contract/webhooks/routes.d.ts +52 -9
  61. package/contract/webhooks/signing.d.ts +0 -16
  62. package/index.js +1 -4334
  63. package/package.json +6 -7
  64. package/index.js.map +0 -59
@@ -1,170 +1,124 @@
1
- /** The longest address the capped fields take: a 64-character local part, "@", and a
2
- * 255-character domain (RFC 5321 section 4.5.3.1). */
3
1
  export declare const MAX_EMAIL_LENGTH = 320;
4
- /** A name a tenant gives what it registers: an API key, an app, a connection, a plan. */
5
2
  export declare const MAX_NAME_LENGTH = 100;
6
- /** The caller's own reference stored with an account or template. */
7
3
  export declare const MAX_EXTERNAL_REF_LENGTH = 255;
8
- /** An account's display name. */
9
4
  export declare const MAX_DISPLAY_NAME_LENGTH = 255;
10
- /** The display name next to an address: a recipient's, an attendee's, an identity's. */
11
5
  export declare const MAX_ADDRESS_NAME_LENGTH = 256;
12
- /** A password or client secret. */
13
6
  export declare const MAX_SECRET_LENGTH = 1024;
14
- /** A free-text note or description an admin attaches. */
15
7
  export declare const MAX_NOTE_LENGTH = 500;
16
- /** A listing's text filter. */
17
8
  export declare const MAX_FILTER_QUERY_LENGTH = 200;
18
- /** A URL the caller gives: a DAV server, a meeting's join link. */
19
9
  export declare const MAX_URL_LENGTH = 2048;
20
- /** An IANA time zone name. */
21
10
  export declare const MAX_TIME_ZONE_LENGTH = 64;
22
- /** An opaque pagination cursor. */
23
11
  export declare const MAX_CURSOR_LENGTH = 512;
24
- /** A listing's page size, where the listing names no other. */
25
12
  export declare const MAX_PAGE_SIZE = 200;
26
13
  export declare const DEFAULT_PAGE_SIZE = 50;
27
- /** An id a provider issues (a thread id, an attachment id), as a path segment takes it. */
28
14
  export declare const MAX_PROVIDER_ID_LENGTH = 1024;
29
- /** A host name (RFC 1035): a server's, or a domain's. */
30
15
  export declare const MAX_HOST_LENGTH = 253;
31
- /** The highest TCP port. */
32
16
  export declare const MAX_PORT = 65535;
33
- /** The `state` a redirect flow echoes back. */
34
17
  export declare const MAX_STATE_LENGTH = 1024;
35
- /** Shortest and longest life of a token or a hosted session the caller asks for. */
36
18
  export declare const MIN_TOKEN_TTL_SECONDS = 60;
37
19
  export declare const MAX_TOKEN_TTL_SECONDS = 86400;
38
- /** Redirect URIs a tenant's allowlist holds. */
20
+ export declare const MAX_MCP_KEYS_PER_ACCOUNT = 25;
39
21
  export declare const MAX_REDIRECT_URIS = 50;
40
- /** The longest undo window for sends. */
41
22
  export declare const MAX_UNDO_SEND_SECONDS = 60;
42
- /** The range a tenant's event retention may be set within. */
43
23
  export declare const MIN_EVENT_RETENTION_DAYS = 7;
44
24
  export declare const MAX_EVENT_RETENTION_DAYS = 30;
25
+ export declare const MAX_MCP_ALLOWED_DOMAINS = 100;
26
+ export declare const MAX_MCP_DAILY_SEND_LIMIT = 10000;
45
27
  export declare const MAX_ATTACHMENT_BYTES: number;
46
- /** RFC 5322's line limit; also the longest Message-ID a mail merge entry takes. */
47
28
  export declare const MAX_SUBJECT_LENGTH = 998;
48
29
  export declare const MAX_MESSAGE_ID_LENGTH = 998;
49
- /** Longest html or text body a message takes (characters): what a template may render, so a send
50
- * gets no more inline than it could through a template. */
51
30
  export declare const MAX_BODY_LENGTH: number;
52
- /** Recipients of each of to, cc and bcc. */
53
31
  export declare const MAX_RECIPIENTS = 500;
54
32
  export declare const MAX_REPLY_TO = 10;
55
33
  export declare const MAX_ATTACHMENTS = 50;
56
34
  export declare const MAX_FILENAME_LENGTH = 255;
57
35
  export declare const MAX_CONTENT_TYPE_LENGTH = 255;
58
36
  export declare const MAX_CONTENT_ID_LENGTH = 255;
59
- /** A send's own `reference`. */
60
37
  export declare const MAX_SEND_REFERENCE_LENGTH = 255;
61
- /** Mailboxes one message update adds or removes. */
38
+ export declare const MAX_SEND_WAIT_SECONDS = 30;
39
+ export declare const MAX_SEND_HEADERS = 50;
40
+ export declare const MAX_HEADER_VALUE_LENGTH = 4096;
41
+ export declare const MAX_CALENDAR_LENGTH: number;
62
42
  export declare const MAX_MAILBOX_CHANGES = 50;
63
- /** The longest search query search.messages takes. */
64
43
  export declare const MAX_SEARCH_QUERY_LENGTH = 500;
65
- /** Hits one search page holds: a provider search reads a page of the provider's per call. */
66
44
  export declare const MAX_SEARCH_PAGE_SIZE = 100;
67
45
  export declare const DEFAULT_SEARCH_PAGE_SIZE = 25;
68
- /** Threads one page holds: each summary aggregates every message of its thread. */
69
46
  export declare const MAX_THREAD_PAGE_SIZE = 100;
70
47
  export declare const DEFAULT_THREAD_PAGE_SIZE = 25;
48
+ export declare const MAX_MESSAGE_BODIES_PAGE_SIZE = 25;
49
+ export declare const MAX_REFERENCES = 100;
71
50
  export declare const MAX_SIGNATURE_HTML_LENGTH = 100000;
72
51
  export declare const MAX_SIGNATURE_TEXT_LENGTH = 20000;
73
- /** Longest template name (after trimming) and description the API accepts. */
74
52
  export declare const MAX_TEMPLATE_NAME_LENGTH = 255;
75
53
  export declare const MAX_TEMPLATE_DESCRIPTION_LENGTH = 1000;
76
- /** Longest subject, preview line and body (html, text) source a template stores. */
77
54
  export declare const MAX_TEMPLATE_SUBJECT_LENGTH = 2000;
78
55
  export declare const MAX_TEMPLATE_PREVIEW_TEXT_LENGTH = 2000;
79
56
  export declare const MAX_TEMPLATE_BODY_LENGTH = 1000000;
80
- /** Most entries one mail merge call takes; split larger lists over several calls. */
81
57
  export declare const MAX_MAIL_MERGE_ENTRIES = 100;
82
- /** Most attachment bytes a mail merge queues in total (the attachments times the entries): every
83
- * copy is sealed with its own attachments. */
84
58
  export declare const MAX_MAIL_MERGE_ATTACHMENT_BYTES: number;
85
- /** Largest params object (serialized as JSON) one render takes: 400 reason params_too_large. */
86
59
  export declare const MAX_RENDER_PARAMS_BYTES: number;
87
- /** Block iterations (each, with, if/unless bodies, ...) one render may run before it fails with
88
- * template_render_failed. */
89
60
  export declare const MAX_RENDER_ITERATIONS = 10000;
90
- /** Longest Markdown (after rendering, values escaped) converted to HTML; beyond it the render, or
91
- * a send of the content as it is, fails with template_render_failed. Converting takes about 2 ms
92
- * per 1,000 characters at worst, so this keeps one conversion under about 200 ms. */
93
61
  export declare const MAX_MARKDOWN_LENGTH = 100000;
94
- /** How many addresses one call adding entries to a suppression list takes. */
95
62
  export declare const MAX_SUPPRESSION_BATCH = 1000;
96
63
  export declare const MAX_SUPPRESSION_LIST_DESCRIPTION_LENGTH = 500;
97
- /** The reason given with an address the API suppresses. */
98
64
  export declare const MAX_SUPPRESSION_REASON_LENGTH = 200;
99
- /** Attendees one event write may name; also the most an iMIP message from a CalDAV account goes
100
- * to, so email never reaches more people than the API would have let a caller invite. */
101
65
  export declare const MAX_EVENT_ATTENDEES = 500;
102
66
  export declare const MAX_EVENT_SUBJECT_LENGTH = 255;
103
67
  export declare const MAX_EVENT_LOCATION_LENGTH = 255;
104
68
  export declare const MAX_EVENT_BODY_LENGTH = 1000000;
105
- /** Longest note sent with a cancellation or an answer. */
106
69
  export declare const MAX_EVENT_COMMENT_LENGTH = 2000;
107
- /** RFC 5545 recurrence lines one event takes, and the longest. */
108
70
  export declare const MAX_RECURRENCE_LINES = 20;
109
71
  export declare const MAX_RECURRENCE_LINE_LENGTH = 1000;
110
- /** Four weeks. */
111
72
  export declare const MAX_REMINDER_MINUTES = 40320;
112
- /** Attendees one availability question takes. */
113
73
  export declare const MAX_AVAILABILITY_ATTENDEES = 20;
114
- /** The longest range an availability question spans. */
115
74
  export declare const MAX_AVAILABILITY_DAYS = 62;
116
- /** Shortest and longest suggested slot, and step between suggestions. */
117
75
  export declare const MIN_SLOT_MINUTES = 5;
118
76
  export declare const MAX_SLOT_MINUTES = 1440;
119
- /** Most free slots one availability question suggests. */
120
77
  export declare const MAX_SUGGESTIONS = 100;
121
- /** The longest range one event listing spans. */
78
+ export declare const MAX_AVAILABILITY_ACCOUNTS = 20;
122
79
  export declare const MAX_EVENT_RANGE_DAYS = 400;
123
- /** A page of events. */
124
80
  export declare const MAX_CALENDAR_EVENT_PAGE_SIZE = 500;
125
81
  export declare const DEFAULT_CALENDAR_EVENT_PAGE_SIZE = 100;
126
- /** Email addresses, and phone numbers, one contact takes. */
82
+ export declare const MAX_SCHEDULING_DAY_WINDOWS = 8;
83
+ export declare const MAX_SCHEDULING_WINDOW_DAYS = 365;
84
+ export declare const MAX_SCHEDULING_BUFFER_MINUTES = 1440;
85
+ export declare const MAX_SCHEDULING_NOTICE_MINUTES = 86400;
86
+ export declare const MAX_SCHEDULING_PER_DAY = 1000;
87
+ export declare const MAX_SCHEDULING_TITLE_LENGTH = 255;
88
+ export declare const MAX_SCHEDULING_DESCRIPTION_LENGTH = 10000;
89
+ export declare const MAX_BOOKING_NOTES_LENGTH = 2000;
90
+ export declare const MAX_SCHEDULING_SLOTS = 1000;
91
+ export declare const DEFAULT_SCHEDULING_SLOTS = 200;
127
92
  export declare const MAX_CONTACT_ENTRIES = 20;
128
- /** Longest name, organization, job title or department; phone number; notes. */
129
93
  export declare const MAX_CONTACT_FIELD_LENGTH = 256;
130
94
  export declare const MAX_CONTACT_PHONE_LENGTH = 64;
131
95
  export declare const MAX_CONTACT_NOTES_LENGTH = 10000;
132
- /** A page of contacts. */
133
96
  export declare const MAX_CONTACT_PAGE_SIZE = 500;
134
97
  export declare const DEFAULT_CONTACT_PAGE_SIZE = 100;
135
- /** Most values one list filter takes. */
136
98
  export declare const MAX_WEBHOOK_FILTER_VALUES = 100;
137
- /** A subjectContains filter value. */
138
99
  export declare const MAX_SUBJECT_FILTER_LENGTH = 200;
139
- /** Most events one range replay queues; ask for a narrower range beyond it. */
140
100
  export declare const MAX_REPLAY_EVENTS = 1000;
141
- /** A page of an endpoint's delivery log. */
142
101
  export declare const MAX_WEBHOOK_ATTEMPT_PAGE_SIZE = 500;
143
102
  export declare const DEFAULT_WEBHOOK_ATTEMPT_PAGE_SIZE = 50;
144
- /** Signatures in a webhook-signature header that a verifier checks; any after them are ignored. */
145
103
  export declare const MAX_SIGNATURE_CANDIDATES = 8;
146
- /** How long a rotated-out signing secret still signs deliveries when the rotation names no grace. */
147
104
  export declare const DEFAULT_WEBHOOK_SECRET_GRACE_SECONDS: number;
148
- /** The longest grace a signing secret rotation may give the old secret. */
149
105
  export declare const MAX_WEBHOOK_SECRET_GRACE_SECONDS: number;
150
106
  export declare const MAX_DRAFT_INSTRUCTIONS_LENGTH = 2000;
151
- /** The longest current draft a draft request carries. */
152
107
  export declare const MAX_DRAFT_CONTEXT_LENGTH = 20000;
153
- /** Longest client or account id a meeting service issues. */
108
+ export declare const MAX_EMAIL_VALIDATIONS = 10;
154
109
  export declare const MAX_MEETING_APP_ID_LENGTH = 200;
155
110
  export declare const MAX_REFRESH_TOKEN_LENGTH = 4096;
156
- /** Longest certificate or key file (PEM, or Google's JSON key). */
157
111
  export declare const MAX_KEY_FILE_LENGTH = 20000;
158
- /** Longest directory search. */
159
112
  export declare const MAX_DIRECTORY_QUERY_LENGTH = 100;
160
- /** Directory entries one page lists at most, and when no limit is given. */
161
113
  export declare const MAX_DIRECTORY_PAGE_SIZE = 200;
162
114
  export declare const DEFAULT_DIRECTORY_PAGE_SIZE = 100;
163
- /** Mailboxes one addAccounts request takes. */
164
115
  export declare const MAX_ADD_MAILBOXES = 100;
165
- /** An Entra application id or directory (tenant) id. */
166
116
  export declare const MAX_ENTRA_ID_LENGTH = 100;
167
- /** A Stripe price id. */
168
117
  export declare const MAX_STRIPE_ID_LENGTH = 255;
169
- /** UTC days one usage read spans at most, both ends included. */
118
+ export declare const MAX_VALIDATION_CREDITS = 1000000000;
119
+ export declare const MAX_CREDIT_PACKS_PER_PURCHASE = 100;
120
+ export declare const MAX_CREDIT_PACK_CREDITS = 10000000;
121
+ export declare const MAX_CREDIT_PACKS_PER_PLAN = 5;
122
+ export declare const MAX_TRIAL_DAYS = 730;
170
123
  export declare const MAX_USAGE_RANGE_DAYS = 366;
124
+ export declare const MAX_LIMIT_HIT_DAYS = 90;
@@ -1,17 +1,16 @@
1
1
  import * as z from "zod";
2
2
  export declare const MailboxRole: z.ZodEnum<{
3
3
  custom: "custom";
4
+ all: "all";
4
5
  inbox: "inbox";
5
6
  sent: "sent";
6
7
  drafts: "drafts";
7
8
  trash: "trash";
8
9
  junk: "junk";
9
10
  archive: "archive";
10
- all: "all";
11
11
  important: "important";
12
12
  }>;
13
13
  export type MailboxRole = z.infer<typeof MailboxRole>;
14
- /** folder: a message is in exactly one (Microsoft). label: a message can carry several (Gmail). */
15
14
  export declare const MailboxKind: z.ZodEnum<{
16
15
  label: "label";
17
16
  folder: "folder";
@@ -24,13 +23,13 @@ export declare const Mailbox: z.ZodObject<{
24
23
  parentId: z.ZodNullable<z.ZodUUID>;
25
24
  role: z.ZodEnum<{
26
25
  custom: "custom";
26
+ all: "all";
27
27
  inbox: "inbox";
28
28
  sent: "sent";
29
29
  drafts: "drafts";
30
30
  trash: "trash";
31
31
  junk: "junk";
32
32
  archive: "archive";
33
- all: "all";
34
33
  important: "important";
35
34
  }>;
36
35
  kind: z.ZodEnum<{
@@ -49,13 +48,13 @@ export declare const MailboxList: z.ZodObject<{
49
48
  parentId: z.ZodNullable<z.ZodUUID>;
50
49
  role: z.ZodEnum<{
51
50
  custom: "custom";
51
+ all: "all";
52
52
  inbox: "inbox";
53
53
  sent: "sent";
54
54
  drafts: "drafts";
55
55
  trash: "trash";
56
56
  junk: "junk";
57
57
  archive: "archive";
58
- all: "all";
59
58
  important: "important";
60
59
  }>;
61
60
  kind: z.ZodEnum<{
@@ -67,7 +66,27 @@ export declare const MailboxList: z.ZodObject<{
67
66
  }, z.core.$strip>>;
68
67
  }, z.core.$strip>;
69
68
  export type MailboxList = z.infer<typeof MailboxList>;
70
- /** The Mailbox fields mailbox.updated names in `changes` (the counts move without an event). */
69
+ export declare const MailboxIdInput: z.ZodObject<{
70
+ accountId: z.ZodUUID;
71
+ mailboxId: z.ZodUUID;
72
+ }, z.core.$strip>;
73
+ export type MailboxIdInput = z.infer<typeof MailboxIdInput>;
74
+ export declare const CreateMailbox: z.ZodObject<{
75
+ name: z.ZodString;
76
+ parentId: z.ZodOptional<z.ZodUUID>;
77
+ }, z.core.$strip>;
78
+ export type CreateMailbox = z.infer<typeof CreateMailbox>;
79
+ export declare const CreateMailboxInput: z.ZodObject<{
80
+ accountId: z.ZodUUID;
81
+ name: z.ZodString;
82
+ parentId: z.ZodOptional<z.ZodUUID>;
83
+ }, z.core.$strip>;
84
+ export type CreateMailboxInput = z.infer<typeof CreateMailboxInput>;
85
+ export declare const UpdateMailbox: z.ZodObject<{
86
+ name: z.ZodOptional<z.ZodString>;
87
+ parentId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
88
+ }, z.core.$strip>;
89
+ export type UpdateMailbox = z.infer<typeof UpdateMailbox>;
71
90
  export declare const MailboxChangedField: z.ZodEnum<{
72
91
  path: "path";
73
92
  name: "name";
@@ -76,20 +95,11 @@ export declare const MailboxChangedField: z.ZodEnum<{
76
95
  parentId: "parentId";
77
96
  }>;
78
97
  export type MailboxChangedField = z.infer<typeof MailboxChangedField>;
79
- /**
80
- * outbound: the message is in a mailbox with role `sent`, or its From is the account's own address
81
- * or one of its identities (so drafts are outbound too). inbound: everything else.
82
- */
83
98
  export declare const MessageDirection: z.ZodEnum<{
84
99
  inbound: "inbound";
85
100
  outbound: "outbound";
86
101
  }>;
87
102
  export type MessageDirection = z.infer<typeof MessageDirection>;
88
- /**
89
- * The priority mail clients mark with "!" (high) or a down arrow (low). Sent as
90
- * X-Priority, X-MSMail-Priority, Importance and Priority headers; read from Graph's `importance`
91
- * and from those headers on Gmail and IMAP.
92
- */
93
103
  export declare const MessagePriority: z.ZodEnum<{
94
104
  normal: "normal";
95
105
  high: "high";
@@ -135,8 +145,6 @@ export declare const MessageSummary: z.ZodObject<{
135
145
  }>>;
136
146
  }, z.core.$strip>;
137
147
  export type MessageSummary = z.infer<typeof MessageSummary>;
138
- /** The Message fields message.updated names in `changes`. `reference` changes only with
139
- * outboxId and is not named on its own. */
140
148
  export declare const MessageChangedField: z.ZodEnum<{
141
149
  from: "from";
142
150
  to: "to";
@@ -211,7 +219,6 @@ export declare const Attachment: z.ZodObject<{
211
219
  contentId: z.ZodNullable<z.ZodString>;
212
220
  }, z.core.$strip>;
213
221
  export type Attachment = z.infer<typeof Attachment>;
214
- /** What AI made of a reply to one of your sends (see the tenant setting aiReplyClassification). */
215
222
  export declare const ReplyKind: z.ZodEnum<{
216
223
  opt_out: "opt_out";
217
224
  auto_reply: "auto_reply";
@@ -219,11 +226,6 @@ export declare const ReplyKind: z.ZodEnum<{
219
226
  human_reply: "human_reply";
220
227
  }>;
221
228
  export type ReplyKind = z.infer<typeof ReplyKind>;
222
- /** What kind of automatic answer an auto_reply is. out_of_office: away for a while;
223
- * left_company: the person no longer works there, or the mailbox is unmonitored; address_changed:
224
- * gives a new address to use; ticket_acknowledgment: an automated receipt or ticket number;
225
- * challenge_response: asks the sender to verify before the mail is delivered; other: any other
226
- * automatic answer. */
227
229
  export declare const AutoReplyCategory: z.ZodEnum<{
228
230
  other: "other";
229
231
  out_of_office: "out_of_office";
@@ -257,13 +259,16 @@ export declare const MessageClassification: z.ZodObject<{
257
259
  classifiedAt: z.ZodPreprocess<z.ZodDate, Date>;
258
260
  }, z.core.$strip>;
259
261
  export type MessageClassification = z.infer<typeof MessageClassification>;
260
- /** Served from stored content when the account stores bodies (bodyStorage cache or full),
261
- * otherwise fetched from the provider on request; null parts are absent from the message. */
262
262
  export declare const MessageBody: z.ZodObject<{
263
263
  text: z.ZodNullable<z.ZodString>;
264
264
  html: z.ZodNullable<z.ZodString>;
265
265
  }, z.core.$strip>;
266
266
  export type MessageBody = z.infer<typeof MessageBody>;
267
+ export declare const MessageHeader: z.ZodObject<{
268
+ name: z.ZodString;
269
+ value: z.ZodString;
270
+ }, z.core.$strip>;
271
+ export type MessageHeader = z.infer<typeof MessageHeader>;
267
272
  export declare const Message: z.ZodObject<{
268
273
  id: z.ZodUUID;
269
274
  threadId: z.ZodNullable<z.ZodString>;
@@ -344,23 +349,116 @@ export declare const Message: z.ZodObject<{
344
349
  model: z.ZodString;
345
350
  classifiedAt: z.ZodPreprocess<z.ZodDate, Date>;
346
351
  }, z.core.$strip>>;
352
+ inReplyTo: z.ZodNullable<z.ZodString>;
353
+ references: z.ZodArray<z.ZodString>;
354
+ headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
355
+ name: z.ZodString;
356
+ value: z.ZodString;
357
+ }, z.core.$strip>>>;
347
358
  }, z.core.$strip>;
348
359
  export type Message = z.infer<typeof Message>;
349
- /** Where a search looks: the index, the provider, or the index first (see messages.search). */
360
+ export declare const MessagePage: z.ZodObject<{
361
+ items: z.ZodArray<z.ZodObject<{
362
+ id: z.ZodUUID;
363
+ threadId: z.ZodNullable<z.ZodString>;
364
+ internetMessageId: z.ZodNullable<z.ZodString>;
365
+ mailboxIds: z.ZodArray<z.ZodUUID>;
366
+ subject: z.ZodNullable<z.ZodString>;
367
+ from: z.ZodNullable<z.ZodObject<{
368
+ name: z.ZodNullable<z.ZodString>;
369
+ address: z.ZodString;
370
+ }, z.core.$strip>>;
371
+ to: z.ZodArray<z.ZodObject<{
372
+ name: z.ZodNullable<z.ZodString>;
373
+ address: z.ZodString;
374
+ }, z.core.$strip>>;
375
+ cc: z.ZodArray<z.ZodObject<{
376
+ name: z.ZodNullable<z.ZodString>;
377
+ address: z.ZodString;
378
+ }, z.core.$strip>>;
379
+ snippet: z.ZodNullable<z.ZodString>;
380
+ receivedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
381
+ sentAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
382
+ isRead: z.ZodBoolean;
383
+ isFlagged: z.ZodBoolean;
384
+ isDraft: z.ZodBoolean;
385
+ hasAttachments: z.ZodBoolean;
386
+ categories: z.ZodArray<z.ZodString>;
387
+ direction: z.ZodEnum<{
388
+ inbound: "inbound";
389
+ outbound: "outbound";
390
+ }>;
391
+ outboxId: z.ZodNullable<z.ZodUUID>;
392
+ reference: z.ZodNullable<z.ZodString>;
393
+ importance: z.ZodNullable<z.ZodEnum<{
394
+ normal: "normal";
395
+ high: "high";
396
+ low: "low";
397
+ }>>;
398
+ bcc: z.ZodArray<z.ZodObject<{
399
+ name: z.ZodNullable<z.ZodString>;
400
+ address: z.ZodString;
401
+ }, z.core.$strip>>;
402
+ replyTo: z.ZodArray<z.ZodObject<{
403
+ name: z.ZodNullable<z.ZodString>;
404
+ address: z.ZodString;
405
+ }, z.core.$strip>>;
406
+ body: z.ZodObject<{
407
+ text: z.ZodNullable<z.ZodString>;
408
+ html: z.ZodNullable<z.ZodString>;
409
+ }, z.core.$strip>;
410
+ attachments: z.ZodArray<z.ZodObject<{
411
+ id: z.ZodString;
412
+ filename: z.ZodNullable<z.ZodString>;
413
+ contentType: z.ZodString;
414
+ size: z.ZodNullable<z.ZodNumber>;
415
+ isInline: z.ZodBoolean;
416
+ contentId: z.ZodNullable<z.ZodString>;
417
+ }, z.core.$strip>>;
418
+ classification: z.ZodNullable<z.ZodObject<{
419
+ kind: z.ZodEnum<{
420
+ opt_out: "opt_out";
421
+ auto_reply: "auto_reply";
422
+ bounce: "bounce";
423
+ human_reply: "human_reply";
424
+ }>;
425
+ probabilities: z.ZodRecord<z.ZodString, z.ZodNumber>;
426
+ optOutProbability: z.ZodNumber;
427
+ autoReplyCategory: z.ZodNullable<z.ZodEnum<{
428
+ other: "other";
429
+ out_of_office: "out_of_office";
430
+ left_company: "left_company";
431
+ address_changed: "address_changed";
432
+ ticket_acknowledgment: "ticket_acknowledgment";
433
+ challenge_response: "challenge_response";
434
+ }>>;
435
+ returnDate: z.ZodNullable<z.ZodISODate>;
436
+ alternateContacts: z.ZodArray<z.ZodString>;
437
+ outboxId: z.ZodNullable<z.ZodUUID>;
438
+ model: z.ZodString;
439
+ classifiedAt: z.ZodPreprocess<z.ZodDate, Date>;
440
+ }, z.core.$strip>>;
441
+ inReplyTo: z.ZodNullable<z.ZodString>;
442
+ references: z.ZodArray<z.ZodString>;
443
+ headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
444
+ name: z.ZodString;
445
+ value: z.ZodString;
446
+ }, z.core.$strip>>>;
447
+ }, z.core.$strip>>;
448
+ nextCursor: z.ZodNullable<z.ZodString>;
449
+ }, z.core.$strip>;
450
+ export type MessagePage = z.infer<typeof MessagePage>;
350
451
  export declare const SearchSource: z.ZodEnum<{
351
452
  provider: "provider";
352
- auto: "auto";
353
453
  index: "index";
454
+ auto: "auto";
354
455
  }>;
355
456
  export type SearchSource = z.infer<typeof SearchSource>;
356
- /** Which source answered a search. */
357
457
  export declare const SearchResultSource: z.ZodEnum<{
358
458
  provider: "provider";
359
459
  index: "index";
360
460
  }>;
361
461
  export type SearchResultSource = z.infer<typeof SearchResultSource>;
362
- /** A search result. `id` is null for a provider result the index does not hold (a message older
363
- * than the sync window); such a result cannot be opened through the API. */
364
462
  export declare const SearchHit: z.ZodObject<{
365
463
  threadId: z.ZodNullable<z.ZodString>;
366
464
  internetMessageId: z.ZodNullable<z.ZodString>;
@@ -400,7 +498,6 @@ export declare const SearchHit: z.ZodObject<{
400
498
  id: z.ZodNullable<z.ZodUUID>;
401
499
  }, z.core.$strip>;
402
500
  export type SearchHit = z.infer<typeof SearchHit>;
403
- /** A search page, with the source that answered; later pages (through nextCursor) stay with it. */
404
501
  export declare const SearchPage: z.ZodObject<{
405
502
  source: z.ZodEnum<{
406
503
  provider: "provider";
@@ -447,7 +544,6 @@ export declare const SearchPage: z.ZodObject<{
447
544
  nextCursor: z.ZodNullable<z.ZodString>;
448
545
  }, z.core.$strip>;
449
546
  export type SearchPage = z.infer<typeof SearchPage>;
450
- /** Stored message content, for the whole tenant or one account. */
451
547
  export declare const BodyStorageUsage: z.ZodObject<{
452
548
  available: z.ZodBoolean;
453
549
  storedMessages: z.ZodNumber;
@@ -468,33 +564,112 @@ export declare const AttachmentIdInput: z.ZodObject<{
468
564
  attachmentId: z.ZodString;
469
565
  }, z.core.$strip>;
470
566
  export type AttachmentIdInput = z.infer<typeof AttachmentIdInput>;
567
+ export declare const MessageDetailInclude: z.ZodEnum<{
568
+ headers: "headers";
569
+ }>;
570
+ export type MessageDetailInclude = z.infer<typeof MessageDetailInclude>;
571
+ export declare const MessageListInclude: z.ZodEnum<{
572
+ headers: "headers";
573
+ body: "body";
574
+ }>;
575
+ export type MessageListInclude = z.infer<typeof MessageListInclude>;
576
+ export declare const GetMessageInput: z.ZodObject<{
577
+ accountId: z.ZodUUID;
578
+ messageId: z.ZodUUID;
579
+ include: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [
580
+ z.ZodString,
581
+ z.ZodArray<z.ZodEnum<{
582
+ headers: "headers";
583
+ }>>
584
+ ]>, z.ZodTransform<string[], string | "headers"[]>>, z.ZodArray<z.ZodEnum<{
585
+ headers: "headers";
586
+ }>>>>;
587
+ }, z.core.$strip>;
588
+ export type GetMessageInput = z.infer<typeof GetMessageInput>;
471
589
  export declare const ListMessagesQuery: z.ZodObject<{
472
- limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
473
- cursor: z.ZodOptional<z.ZodString>;
474
- mailboxId: z.ZodOptional<z.ZodUUID>;
475
- unread: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodEnum<{
476
- true: "true";
477
- false: "false";
478
- }>]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
479
590
  importance: z.ZodOptional<z.ZodEnum<{
480
591
  normal: "normal";
481
592
  high: "high";
482
593
  low: "low";
483
594
  }>>;
595
+ outboxId: z.ZodOptional<z.ZodUUID>;
596
+ internetMessageId: z.ZodOptional<z.ZodString>;
597
+ after: z.ZodOptional<z.ZodPreprocess<z.ZodDate, string | Date>>;
598
+ before: z.ZodOptional<z.ZodPreprocess<z.ZodDate, string | Date>>;
599
+ include: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [
600
+ z.ZodString,
601
+ z.ZodArray<z.ZodEnum<{
602
+ headers: "headers";
603
+ body: "body";
604
+ }>>
605
+ ]>, z.ZodTransform<string[], string | ("headers" | "body")[]>>, z.ZodArray<z.ZodEnum<{
606
+ headers: "headers";
607
+ body: "body";
608
+ }>>>>;
609
+ limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
610
+ cursor: z.ZodOptional<z.ZodString>;
611
+ from: z.ZodOptional<z.ZodString>;
612
+ to: z.ZodOptional<z.ZodString>;
613
+ unread: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [
614
+ z.ZodBoolean,
615
+ z.ZodEnum<{
616
+ true: "true";
617
+ false: "false";
618
+ }>
619
+ ]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
620
+ flagged: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [
621
+ z.ZodBoolean,
622
+ z.ZodEnum<{
623
+ true: "true";
624
+ false: "false";
625
+ }>
626
+ ]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
627
+ hasAttachments: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [
628
+ z.ZodBoolean,
629
+ z.ZodEnum<{
630
+ true: "true";
631
+ false: "false";
632
+ }>
633
+ ]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
634
+ mailboxId: z.ZodOptional<z.ZodUUID>;
484
635
  }, z.core.$strip>;
485
636
  export type ListMessagesQuery = z.infer<typeof ListMessagesQuery>;
637
+ export declare function withListIncludeRules<T extends z.ZodObject>(schema: T): T;
486
638
  export declare const SearchMessagesQuery: z.ZodObject<{
487
- q: z.ZodString;
488
- mailboxId: z.ZodOptional<z.ZodUUID>;
489
639
  after: z.ZodOptional<z.ZodPreprocess<z.ZodDate, string | Date>>;
490
640
  before: z.ZodOptional<z.ZodPreprocess<z.ZodDate, string | Date>>;
491
641
  source: z.ZodDefault<z.ZodEnum<{
492
642
  provider: "provider";
493
- auto: "auto";
494
643
  index: "index";
644
+ auto: "auto";
495
645
  }>>;
496
646
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
497
647
  cursor: z.ZodOptional<z.ZodString>;
648
+ from: z.ZodOptional<z.ZodString>;
649
+ to: z.ZodOptional<z.ZodString>;
650
+ unread: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [
651
+ z.ZodBoolean,
652
+ z.ZodEnum<{
653
+ true: "true";
654
+ false: "false";
655
+ }>
656
+ ]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
657
+ flagged: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [
658
+ z.ZodBoolean,
659
+ z.ZodEnum<{
660
+ true: "true";
661
+ false: "false";
662
+ }>
663
+ ]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
664
+ hasAttachments: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [
665
+ z.ZodBoolean,
666
+ z.ZodEnum<{
667
+ true: "true";
668
+ false: "false";
669
+ }>
670
+ ]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
671
+ q: z.ZodString;
672
+ mailboxId: z.ZodOptional<z.ZodUUID>;
498
673
  }, z.core.$strip>;
499
674
  export type SearchMessagesQuery = z.infer<typeof SearchMessagesQuery>;
500
675
  export declare const UpdateMessage: z.ZodObject<{
@@ -506,23 +681,28 @@ export declare const UpdateMessage: z.ZodObject<{
506
681
  }, z.core.$strip>;
507
682
  export type UpdateMessage = z.infer<typeof UpdateMessage>;
508
683
  export declare const DeleteMessageQuery: z.ZodObject<{
509
- permanent: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodEnum<{
510
- true: "true";
511
- false: "false";
512
- }>]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
684
+ permanent: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [
685
+ z.ZodBoolean,
686
+ z.ZodEnum<{
687
+ true: "true";
688
+ false: "false";
689
+ }>
690
+ ]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
513
691
  }, z.core.$strip>;
514
692
  export type DeleteMessageQuery = z.infer<typeof DeleteMessageQuery>;
515
- /** The path's message and the query's options, as a DELETE takes them. */
516
693
  export declare const DeleteMessageInput: z.ZodObject<{
517
694
  params: z.ZodObject<{
518
695
  accountId: z.ZodUUID;
519
696
  messageId: z.ZodUUID;
520
697
  }, z.core.$strip>;
521
698
  query: z.ZodObject<{
522
- permanent: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodEnum<{
523
- true: "true";
524
- false: "false";
525
- }>]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
699
+ permanent: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [
700
+ z.ZodBoolean,
701
+ z.ZodEnum<{
702
+ true: "true";
703
+ false: "false";
704
+ }>
705
+ ]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
526
706
  }, z.core.$strip>;
527
707
  }, z.core.$strip>;
528
708
  export type DeleteMessageInput = z.infer<typeof DeleteMessageInput>;