@repa/mail 0.0.0-stage → 0.1.0-alpha.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.
@@ -0,0 +1,929 @@
1
+ import { z } from 'zod';
2
+
3
+ // src/contracts/mailbox.ts
4
+ var bytes = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
5
+ var accountStorage = z.object({
6
+ usedBytes: bytes,
7
+ limitBytes: bytes.min(1),
8
+ workspaceLimitBytes: bytes.min(1),
9
+ workspaceUsedBytes: bytes,
10
+ warningPercent: z.union([z.literal(0), z.literal(80), z.literal(95)]),
11
+ workspaceWarningPercent: z.union([z.literal(0), z.literal(80), z.literal(95)])
12
+ }).strict();
13
+ var accountStorageMaximumBytes = JSON.stringify({
14
+ usedBytes: Number.MAX_SAFE_INTEGER,
15
+ limitBytes: Number.MAX_SAFE_INTEGER,
16
+ workspaceLimitBytes: Number.MAX_SAFE_INTEGER,
17
+ workspaceUsedBytes: Number.MAX_SAFE_INTEGER,
18
+ warningPercent: 95,
19
+ workspaceWarningPercent: 95
20
+ }).length;
21
+ var serviceAccountStorage = accountStorage.omit({ workspaceLimitBytes: true, workspaceUsedBytes: true, workspaceWarningPercent: true }).extend({ tenantLimitBytes: bytes.min(1), tenantUsedBytes: bytes, tenantWarningPercent: z.union([z.literal(0), z.literal(80), z.literal(95)]) }).strict().transform(({ tenantLimitBytes, tenantUsedBytes, tenantWarningPercent, ...account4 }) => ({
22
+ ...account4,
23
+ workspaceLimitBytes: tenantLimitBytes,
24
+ workspaceUsedBytes: tenantUsedBytes,
25
+ workspaceWarningPercent: tenantWarningPercent
26
+ }));
27
+ var kinds = /* @__PURE__ */ new Set(["text", "br", "p", "strong", "em", "u", "s", "ul", "ol", "li", "blockquote", "a"]);
28
+ function safeComposeLink(value) {
29
+ if (value.length > 2048 || /\s/.test(value) || Array.from(value).some((char) => char.charCodeAt(0) < 32 || char.charCodeAt(0) === 127)) return false;
30
+ try {
31
+ return ["https:", "http:", "mailto:"].includes(new URL(value).protocol);
32
+ } catch {
33
+ return false;
34
+ }
35
+ }
36
+ function validComposeFormat(input) {
37
+ if (!Array.isArray(input) || input.length > 1e4) return false;
38
+ const pending = input.map((node) => ({ node, depth: 0 }));
39
+ let count5 = 0, bytes2 = 0;
40
+ while (pending.length) {
41
+ const { node, depth } = pending.pop();
42
+ if (!node || typeof node !== "object" || Array.isArray(node) || depth > 16 || ++count5 > 1e4) return false;
43
+ if (Object.keys(node).some((key) => !["kind", "text", "href", "children"].includes(key)) || !kinds.has(node.kind)) return false;
44
+ if (node.kind === "text") {
45
+ if (typeof node.text !== "string" || node.children !== void 0 || node.href !== void 0) return false;
46
+ bytes2 += new TextEncoder().encode(node.text).length;
47
+ } else if (node.kind === "br") {
48
+ if (node.text !== void 0 || node.href !== void 0 || node.children !== void 0) return false;
49
+ } else {
50
+ if (!Array.isArray(node.children) || node.text !== void 0) return false;
51
+ if (node.kind === "a" ? typeof node.href !== "string" || !safeComposeLink(node.href) : node.href !== void 0) return false;
52
+ bytes2 += node.href?.length ?? 0;
53
+ if (node.children.length + pending.length + count5 > 1e4) return false;
54
+ for (const child of node.children) pending.push({ node: child, depth: depth + 1 });
55
+ }
56
+ if (bytes2 > 1024 * 1024) return false;
57
+ }
58
+ return true;
59
+ }
60
+ var composeFormat = z.custom(validComposeFormat, "Invalid message formatting");
61
+
62
+ // src/contracts/size.ts
63
+ var MAXIMUM_SEND_BYTES = 25 * 1024 * 1024;
64
+ var MAXIMUM_SEND_BASE64_BYTES = Math.ceil(MAXIMUM_SEND_BYTES / 3) * 4;
65
+ var MAXIMUM_SEND_BODY_BYTES = MAXIMUM_SEND_BASE64_BYTES + 16 * 1024;
66
+ var uuid = z.string().uuid();
67
+ var draftContent = z.object({
68
+ senderId: uuid,
69
+ to: z.string().max(16384),
70
+ cc: z.string().max(16384),
71
+ bcc: z.string().max(16384),
72
+ subject: z.string().max(998),
73
+ text: z.string().max(1024 * 1024),
74
+ format: composeFormat.optional(),
75
+ inReplyTo: z.string().max(998).optional(),
76
+ references: z.array(z.string().min(3).max(998)).max(32).optional(),
77
+ attachments: z.array(
78
+ z.object({
79
+ name: z.string().min(1).max(200),
80
+ type: z.string().max(256),
81
+ bytes: z.string().max(MAXIMUM_SEND_BODY_BYTES)
82
+ }).strict()
83
+ ).max(20)
84
+ }).strict();
85
+ var savedDraft = z.object({
86
+ id: uuid,
87
+ accountId: uuid,
88
+ revision: z.number().int().min(1).max(Number.MAX_SAFE_INTEGER),
89
+ state: z.enum(["editing", "scheduled", "prepared", "accepted", "discarded"]),
90
+ subject: z.string().max(3992),
91
+ updatedAt: z.string(),
92
+ content: draftContent.optional(),
93
+ sendAt: z.string().datetime({ offset: true }).optional(),
94
+ scheduleError: z.enum(["authority_lost", "sending_refused"]).optional()
95
+ }).strict();
96
+ var draftList = z.object({ drafts: z.array(savedDraft).max(100) }).strict();
97
+ var draftLocation = z.object({ accountId: uuid, id: uuid }).strict();
98
+ var mutation = draftLocation.extend({
99
+ operationId: uuid,
100
+ revision: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)
101
+ });
102
+ var preparedInput = mutation.extend({ submission: z.object({ authorAddressId: uuid, envelopeRecipients: z.array(z.string().min(3).max(320)).min(1).max(50), raw: z.string().min(1).max(MAXIMUM_SEND_BODY_BYTES) }).strict() }).strict();
103
+ var draftInputs = {
104
+ schedule: preparedInput.extend({ sendAt: z.string().datetime({ offset: true }).optional() }).strict(),
105
+ unschedule: mutation.strict(),
106
+ list: z.object({ accountId: uuid }).strict(),
107
+ get: draftLocation,
108
+ save: mutation.extend({ content: draftContent }).strict(),
109
+ discard: mutation.strict(),
110
+ prepare: mutation.extend({
111
+ submission: z.object({
112
+ authorAddressId: uuid,
113
+ envelopeRecipients: z.array(z.string().min(3).max(320)).min(1).max(50),
114
+ raw: z.string().min(1).max(MAXIMUM_SEND_BODY_BYTES)
115
+ }).strict()
116
+ }).strict(),
117
+ send: draftLocation
118
+ };
119
+
120
+ // src/contracts/mailbox.ts
121
+ var uuid2 = z.string().uuid();
122
+ var uint = z.number().int().min(1).max(4294967295);
123
+ var mailbox = z.object({
124
+ id: uuid2,
125
+ domainId: uuid2,
126
+ kind: z.enum(["personal", "shared"]),
127
+ displayName: z.string().max(255),
128
+ address: z.string().max(318)
129
+ }).strict();
130
+ var mailboxPage = z.object({ mailboxes: z.array(mailbox).max(100), next: uuid2.nullable() }).strict();
131
+ var folder = z.object({ id: uuid2, name: z.string().max(1024), uidValidity: uint, specialUse: z.enum(["\\Drafts", "\\Sent", "\\Junk", "\\Trash", "\\Archive"]).optional() }).strict();
132
+ var renamedFolder = z.object({ folders: z.array(folder).max(1024), rulesNotice: z.boolean() }).strict();
133
+ var sender = z.object({ id: uuid2, address: z.string().max(318) }).strict();
134
+ var inbox = z.object({
135
+ folders: z.array(folder).max(1e4),
136
+ senders: z.array(sender).max(100),
137
+ rights: z.number().int().min(0).max(511),
138
+ canDraft: z.boolean()
139
+ }).strict();
140
+ var entry = z.object({
141
+ uid: uint,
142
+ id: uuid2,
143
+ flags: z.number().int().min(0).max(31),
144
+ date: z.string(),
145
+ octets: z.number().int().min(0).max(32 * 1024 * 1024),
146
+ preview: z.string().max(16384),
147
+ hasAttachment: z.boolean(),
148
+ subject: z.string().max(16384),
149
+ from: z.string().max(16384),
150
+ to: z.string().max(16384)
151
+ }).strict();
152
+ var entries = z.object({
153
+ entries: z.array(entry).max(20),
154
+ next: z.number().int().min(0).max(4294967295),
155
+ hasMore: z.boolean(),
156
+ count: z.number().int().nonnegative()
157
+ }).strict();
158
+ var header = z.string().max(16384);
159
+ var attachment = z.object({
160
+ contentId: z.string().max(998).optional(),
161
+ part: z.string().max(256),
162
+ name: z.string().max(1024),
163
+ type: z.string().max(1024),
164
+ octets: z.number().int().nonnegative()
165
+ }).strict();
166
+ var message = z.object({
167
+ entry,
168
+ headers: z.object({
169
+ subject: header,
170
+ from: header,
171
+ to: header,
172
+ cc: header,
173
+ replyTo: header,
174
+ messageId: header,
175
+ unsubscribe: z.string().max(4096).optional()
176
+ }).strict(),
177
+ text: z.string().max(1024 * 1024),
178
+ html: z.string().max(1024 * 1024),
179
+ attachments: z.array(attachment).max(1e3),
180
+ warnings: z.array(z.enum(["incomplete_scan", "hosted_domain_unaligned", "link_text_mismatch", "lookalike_brand", "lookalike_tenant", "homograph_domain", "credential_form", "dangerous_attachment", "encrypted_archive"])).max(16),
181
+ incomplete: z.boolean()
182
+ }).strict();
183
+ var changed = z.object({ operationId: uuid2 }).strict();
184
+ var download = z.object({
185
+ name: z.string().max(1024),
186
+ data: z.string().max(45 * 1024 * 1024)
187
+ }).strict();
188
+ var receipt = z.object({
189
+ idempotencyKey: uuid2,
190
+ operationId: uuid2,
191
+ accountId: uuid2,
192
+ messageId: uuid2,
193
+ entryId: uuid2,
194
+ folderId: uuid2,
195
+ uid: uint,
196
+ acceptedAt: z.string(),
197
+ state: z.literal("queued")
198
+ }).strict();
199
+ var draftSchemas = {
200
+ list: draftList,
201
+ get: savedDraft,
202
+ save: savedDraft,
203
+ discard: savedDraft,
204
+ prepare: savedDraft,
205
+ schedule: savedDraft,
206
+ unschedule: savedDraft,
207
+ send: receipt
208
+ };
209
+ var MailError = class extends Error {
210
+ constructor(code) {
211
+ super(code);
212
+ this.code = code;
213
+ this.name = "MailError";
214
+ }
215
+ };
216
+ var readContent = z.enum(["full", "new"]);
217
+ var newTextOutcome = z.enum(["cut", "whole", "unreadable"]);
218
+ var newTextConfidence = z.enum(["proven", "structural", "none"]);
219
+ var newTextSignatureReason = z.enum(["", "rfc3676_delimiter", "html_signature", "sender_learned"]);
220
+ var newTextRemovedKind = z.enum(["quote", "forward_header", "signature"]);
221
+ var newTextRemoved = z.object({
222
+ kind: newTextRemovedKind,
223
+ messageId: z.uuid().nullable(),
224
+ headerId: z.string().min(1).max(998).nullable(),
225
+ bytes: z.number().int().nonnegative()
226
+ }).strict();
227
+ var newTextReason = z.string().regex(/^[a-z0-9_]*$/).max(32);
228
+ var newTextInfo = z.object({
229
+ outcome: newTextOutcome,
230
+ confidence: newTextConfidence,
231
+ reason: newTextReason,
232
+ extractorVersion: z.number().int().min(1).max(65535),
233
+ fullTextBytes: z.number().int().nonnegative(),
234
+ signatureReason: newTextSignatureReason,
235
+ removed: z.array(newTextRemoved).max(8)
236
+ }).strict();
237
+ var unreadNewText = z.object({
238
+ outcome: z.literal(""),
239
+ confidence: z.literal(""),
240
+ reason: z.literal(""),
241
+ extractorVersion: z.literal(0),
242
+ fullTextBytes: z.literal(0),
243
+ signatureReason: z.literal(""),
244
+ removed: z.array(newTextRemoved).max(0)
245
+ }).strict();
246
+ var newTextMessage = z.object({
247
+ entry,
248
+ headers: message.shape.headers,
249
+ text: message.shape.text,
250
+ signature: z.string().max(1024),
251
+ attachments: message.shape.attachments,
252
+ warnings: message.shape.warnings,
253
+ incomplete: z.boolean(),
254
+ newText: newTextInfo
255
+ }).strict();
256
+
257
+ // src/contracts/conversations.ts
258
+ var uuid3 = z.string().uuid();
259
+ var uint2 = z.number().int().min(1).max(4294967295);
260
+ var count = z.number().int().nonnegative();
261
+ var header2 = z.string().max(16384);
262
+ var messageId = z.string().min(3).max(998);
263
+ var conversationCursor = z.string().max(64);
264
+ var participant = z.object({ address: z.string().max(320), name: z.string().max(1024) }).strict();
265
+ var conversationRow = z.object({
266
+ id: uuid3,
267
+ latest: entry,
268
+ messages: count,
269
+ unread: count,
270
+ starred: z.boolean(),
271
+ hasAttachment: z.boolean(),
272
+ participants: z.array(participant).max(8)
273
+ }).strict();
274
+ var conversationPage = z.object({
275
+ conversations: z.array(conversationRow).max(20),
276
+ next: conversationCursor,
277
+ hasMore: z.boolean(),
278
+ unindexed: count
279
+ }).strict();
280
+ var conversationLocation = z.object({
281
+ folderId: uuid3,
282
+ uidValidity: uint2,
283
+ uid: uint2,
284
+ flags: z.number().int().min(0).max(31)
285
+ }).strict();
286
+ var chatText = z.object({
287
+ text: z.string().max(16384),
288
+ quoted: z.boolean(),
289
+ signature: z.string().max(1024),
290
+ truncated: z.boolean(),
291
+ newText: z.union([newTextInfo, unreadNewText])
292
+ }).strict();
293
+ var conversationMessage = z.object({
294
+ id: uuid3,
295
+ headerId: z.string().max(998),
296
+ parent: uuid3.nullable(),
297
+ date: z.string(),
298
+ subject: header2,
299
+ from: header2,
300
+ to: header2,
301
+ cc: header2,
302
+ locations: z.array(conversationLocation).max(1e4),
303
+ reply: z.object({
304
+ inReplyTo: z.string().max(998),
305
+ references: z.array(messageId).max(32)
306
+ }).strict(),
307
+ chat: chatText,
308
+ hasHTML: z.boolean(),
309
+ attachments: z.array(attachment).max(1e3),
310
+ warnings: message.shape.warnings,
311
+ incomplete: z.boolean()
312
+ }).strict();
313
+ var conversation = z.object({
314
+ id: uuid3,
315
+ messages: z.array(conversationMessage).max(50),
316
+ count,
317
+ earlier: conversationCursor
318
+ }).strict();
319
+ var MAXIMUM_RULE_SCRIPT_BYTES = 64 * 1024;
320
+ var MAXIMUM_RULE_ITEMS = 100 + 2;
321
+ var MAXIMUM_RULE_CONDITIONS = 16;
322
+ var MAXIMUM_RULE_PROBLEMS = 32;
323
+ var uuid4 = z.string().uuid();
324
+ var encoder = new TextEncoder();
325
+ var script = z.string().max(MAXIMUM_RULE_SCRIPT_BYTES).refine((value) => encoder.encode(value).length <= MAXIMUM_RULE_SCRIPT_BYTES);
326
+ var text = (maximumBytes) => z.string().max(maximumBytes * 6);
327
+ var folderName = text(255);
328
+ var index = z.number().int().min(0).max(MAXIMUM_RULE_ITEMS);
329
+ var revision = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
330
+ var ruleCondition = z.object({
331
+ field: z.enum(["from", "to", "cc", "subject", "listId", "body", "attachmentName", "tag"]),
332
+ operator: z.enum(["is", "contains", "matches"]),
333
+ negate: z.boolean(),
334
+ value: text(256)
335
+ }).strict();
336
+ var ruleActions = z.object({
337
+ fileInto: folderName.nullable(),
338
+ markRead: z.boolean(),
339
+ flag: z.boolean(),
340
+ stop: z.boolean()
341
+ }).strict();
342
+ var rule = z.object({
343
+ name: text(120),
344
+ enabled: z.boolean(),
345
+ match: z.enum(["all", "any"]),
346
+ conditions: z.array(ruleCondition).max(MAXIMUM_RULE_CONDITIONS),
347
+ actions: ruleActions
348
+ }).strict();
349
+ var day = z.string().regex(/^\d{4}-\d{2}-\d{2}$/).nullable();
350
+ var ruleVacation = z.object({
351
+ start: day,
352
+ end: day,
353
+ zone: z.string().regex(/^[+-]\d{4}$/),
354
+ subject: text(120).nullable(),
355
+ body: text(16 * 1024),
356
+ days: z.number().int().min(1).max(30)
357
+ }).strict();
358
+ var ruleForward = z.object({ address: z.string().min(1).max(320), keepCopy: z.boolean() }).strict();
359
+ var label = text(120).nullable();
360
+ var folders = z.array(folderName).max(1024);
361
+ var none = folders.max(0);
362
+ var ruleItem = z.discriminatedUnion("kind", [
363
+ z.object({
364
+ kind: z.literal("rule"),
365
+ enabled: z.boolean(),
366
+ label,
367
+ rule,
368
+ text: z.null(),
369
+ vacation: z.null(),
370
+ forward: z.null(),
371
+ folders,
372
+ missingFolders: folders
373
+ }).strict(),
374
+ z.object({
375
+ kind: z.literal("script"),
376
+ enabled: z.boolean(),
377
+ label,
378
+ rule: z.null(),
379
+ text: text(MAXIMUM_RULE_SCRIPT_BYTES),
380
+ vacation: z.null(),
381
+ forward: z.null(),
382
+ folders,
383
+ missingFolders: folders
384
+ }).strict(),
385
+ z.object({
386
+ kind: z.literal("vacation"),
387
+ enabled: z.boolean(),
388
+ label: z.null(),
389
+ rule: z.null(),
390
+ text: z.null(),
391
+ vacation: ruleVacation,
392
+ forward: z.null(),
393
+ folders: none,
394
+ missingFolders: none
395
+ }).strict(),
396
+ z.object({
397
+ kind: z.literal("forward"),
398
+ enabled: z.boolean(),
399
+ label: z.null(),
400
+ rule: z.null(),
401
+ text: z.null(),
402
+ vacation: z.null(),
403
+ forward: ruleForward,
404
+ folders: none,
405
+ missingFolders: none
406
+ }).strict()
407
+ ]);
408
+ var ruleItemInput = z.discriminatedUnion("kind", [
409
+ z.object({ kind: z.literal("rule"), enabled: z.boolean(), rule }).strict(),
410
+ z.object({ kind: z.literal("script"), enabled: z.boolean(), label: label.optional(), text: script }).strict(),
411
+ z.object({ kind: z.literal("vacation"), enabled: z.boolean(), vacation: ruleVacation }).strict(),
412
+ z.object({ kind: z.literal("forward"), enabled: z.boolean(), forward: ruleForward }).strict()
413
+ ]);
414
+ var items = z.array(ruleItem).max(MAXIMUM_RULE_ITEMS);
415
+ var rulesNotice = z.object({
416
+ kind: z.string().max(64),
417
+ folder: folderName,
418
+ renamedTo: folderName,
419
+ notedAt: z.string().max(64)
420
+ }).strict();
421
+ var mailboxRules = z.object({
422
+ accountId: uuid4,
423
+ kind: z.enum(["personal", "shared"]),
424
+ revision,
425
+ script: text(MAXIMUM_RULE_SCRIPT_BYTES),
426
+ items,
427
+ notices: z.array(rulesNotice).max(32)
428
+ }).strict();
429
+ var place = z.number().int().min(0).nullable();
430
+ var rulesProblem = z.object({
431
+ code: z.string().max(64),
432
+ item: place,
433
+ condition: place,
434
+ line: place,
435
+ column: place,
436
+ message: z.string().max(4096),
437
+ detail: text(MAXIMUM_RULE_SCRIPT_BYTES).nullable()
438
+ }).strict();
439
+ var rulesChecked = z.object({ ok: z.boolean(), problems: z.array(rulesProblem).max(MAXIMUM_RULE_PROBLEMS) }).strict();
440
+ var rulesSaved = z.discriminatedUnion("status", [
441
+ z.object({
442
+ status: z.literal("saved"),
443
+ revision: revision.min(1),
444
+ script: text(MAXIMUM_RULE_SCRIPT_BYTES),
445
+ items,
446
+ normalized: z.boolean()
447
+ }).strict(),
448
+ z.object({ status: z.literal("rejected"), problems: z.array(rulesProblem).min(1).max(MAXIMUM_RULE_PROBLEMS) }).strict()
449
+ ]);
450
+ var account = z.object({ accountId: uuid4 }).strict();
451
+ var write = account.extend({ expectedRevision: revision });
452
+ var rulesInputs = {
453
+ get: account,
454
+ check: account.extend({ script }).strict(),
455
+ /** Exactly one of items (re-rendered in the canonical layout) or script (stored as written). */
456
+ save: z.union([
457
+ write.extend({ items: z.array(ruleItemInput).max(MAXIMUM_RULE_ITEMS) }).strict(),
458
+ write.extend({ script }).strict()
459
+ ]),
460
+ /** One edit of the ordered items: move needs `to`, toggle `enabled`, put `rule` (replace at index or append). */
461
+ items: z.discriminatedUnion("operation", [
462
+ write.extend({ operation: z.literal("move"), index, to: index }).strict(),
463
+ write.extend({ operation: z.literal("toggle"), index, enabled: z.boolean() }).strict(),
464
+ write.extend({ operation: z.literal("delete"), index }).strict(),
465
+ write.extend({ operation: z.literal("put"), index, rule }).strict()
466
+ ])
467
+ };
468
+ var uuid5 = z.uuid();
469
+ var uint3 = z.number().int().min(1).max(4294967295);
470
+ var account2 = z.object({ accountId: uuid5 }).strict();
471
+ var location = account2.extend({ folderId: uuid5, uidValidity: uint3 }).strict();
472
+ var messageLocation = location.extend({ uid: uint3 }).strict();
473
+ var mutation2 = messageLocation.extend({ operationId: uuid5 });
474
+ var MiB = 1024 * 1024;
475
+ var RULES_REQUEST_BYTES = 128 * 1024;
476
+ var RULES_RESPONSE_BYTES = 14 * MiB;
477
+ function operation(path, internal, input, output, options = {}) {
478
+ return {
479
+ path,
480
+ internal,
481
+ input,
482
+ output,
483
+ envelope: z.object({ data: output }).strict(),
484
+ requestBytes: options.requestBytes ?? (options.upload ? MAXIMUM_SEND_BODY_BYTES : 16 * 1024),
485
+ responseBytes: options.responseBytes ?? MiB,
486
+ upload: options.upload ?? false,
487
+ key: options.key,
488
+ revision: options.revision ?? false
489
+ };
490
+ }
491
+ var headlessOperations = {
492
+ mailboxes: operation("mailboxes/discover", "mailboxes", z.object({ after: uuid5.optional(), limit: z.number().int().min(1).max(100) }).strict(), mailboxPage),
493
+ open: operation("mailboxes/open", "open", account2, inbox, { responseBytes: 14 * MiB }),
494
+ list: operation("messages/list", "list", location.extend({ before: z.number().int().min(0).max(4294967295), limit: z.number().int().min(1).max(20) }).strict(), entries, { responseBytes: 14 * MiB }),
495
+ /** `content: 'new'` answers what the sender wrote without the quoted chain (EMAIL-D240); default `full`. */
496
+ read: operation(
497
+ "messages/read",
498
+ "read",
499
+ messageLocation.extend({ content: readContent.optional() }).strict(),
500
+ z.union([message, newTextMessage]),
501
+ { responseBytes: 14 * MiB }
502
+ ),
503
+ conversations: operation("conversations/list", "conversations", location.extend({
504
+ cursor: conversationCursor,
505
+ limit: z.number().int().min(1).max(20)
506
+ }).strict(), conversationPage, { responseBytes: 2 * MiB }),
507
+ conversation: operation("conversations/read", "conversation", z.union([
508
+ location.extend({ conversationId: uuid5, cursor: conversationCursor, limit: z.number().int().min(1).max(50) }).strict(),
509
+ location.extend({ uid: uint3, cursor: conversationCursor, limit: z.number().int().min(1).max(50) }).strict()
510
+ ]), conversation, { responseBytes: 8 * MiB }),
511
+ download: operation("messages/download", "read", messageLocation.extend({ part: z.string().regex(/^(?:source|body|[1-9]\d*(?:\.[1-9]\d*)*)$/).max(256) }).strict(), download, { responseBytes: 46 * MiB }),
512
+ change: operation("messages/change", "change", z.discriminatedUnion("action", [
513
+ mutation2.extend({ action: z.enum(["seen", "starred"]), enabled: z.boolean() }).strict(),
514
+ mutation2.extend({ action: z.literal("move"), destinationId: uuid5, destinationValidity: uint3 }).strict()
515
+ ]), changed, { key: "operationId" }),
516
+ createFolder: operation("folders", "create-folder", account2.extend({ operationId: uuid5, name: z.string().min(1).max(256) }).strict(), folder, { key: "operationId" }),
517
+ renameFolder: operation("folders/rename", "rename-folder", account2.extend({ operationId: uuid5, name: z.string().min(1).max(255), newName: z.string().min(1).max(255) }).strict(), renamedFolder, { key: "operationId" }),
518
+ deleteFolder: operation("folders/delete", "delete-folder", account2.extend({ operationId: uuid5, name: z.string().min(1).max(255) }).strict(), folder, { key: "operationId" }),
519
+ storage: operation("storage", "storage", account2, accountStorage),
520
+ submit: operation("submissions/raw", "submit-raw", z.object({
521
+ operationId: uuid5,
522
+ authorAddressId: uuid5,
523
+ sentAccountId: uuid5,
524
+ envelopeRecipients: z.array(z.string().min(3).max(320)).min(1).max(50),
525
+ raw: z.string().min(1).max(MAXIMUM_SEND_BODY_BYTES)
526
+ }).strict(), receipt, { key: "operationId", upload: true }),
527
+ draftList: operation("drafts/list", "draft-list", draftInputs.list, draftSchemas.list),
528
+ draftGet: operation("drafts/get", "draft-get", draftInputs.get, draftSchemas.get, { responseBytes: 46 * MiB }),
529
+ draftSave: operation("drafts/save", "draft-save", draftInputs.save, draftSchemas.save, { key: "operationId", upload: true }),
530
+ draftDiscard: operation("drafts/discard", "draft-discard", draftInputs.discard, draftSchemas.discard, { key: "operationId" }),
531
+ draftPrepare: operation("drafts/prepare", "draft-prepare", draftInputs.prepare, draftSchemas.prepare, { key: "operationId", upload: true }),
532
+ draftSchedule: operation("drafts/schedule", "draft-schedule", draftInputs.schedule, draftSchemas.schedule, { key: "operationId", upload: true }),
533
+ draftUnschedule: operation("drafts/unschedule", "draft-unschedule", draftInputs.unschedule, draftSchemas.unschedule, { key: "operationId", responseBytes: 46 * MiB }),
534
+ draftSend: operation("drafts/send", "draft-send", draftInputs.send, draftSchemas.send, { key: "id", upload: true }),
535
+ // A legal worst case (every string byte escaped, 100 rules, a 64 KiB script and its problems) exceeds 1 MiB.
536
+ rulesGet: operation("rules/get", "rules-get", rulesInputs.get, mailboxRules, { responseBytes: RULES_RESPONSE_BYTES }),
537
+ rulesCheck: operation(
538
+ "rules/check",
539
+ "rules-check",
540
+ rulesInputs.check,
541
+ rulesChecked,
542
+ { requestBytes: RULES_REQUEST_BYTES, responseBytes: RULES_RESPONSE_BYTES }
543
+ ),
544
+ rulesSave: operation(
545
+ "rules/save",
546
+ "rules-save",
547
+ rulesInputs.save,
548
+ rulesSaved,
549
+ { requestBytes: RULES_REQUEST_BYTES, responseBytes: RULES_RESPONSE_BYTES, revision: true }
550
+ ),
551
+ rulesItems: operation(
552
+ "rules/items",
553
+ "rules-items",
554
+ rulesInputs.items,
555
+ rulesSaved,
556
+ { requestBytes: RULES_REQUEST_BYTES, responseBytes: RULES_RESPONSE_BYTES, revision: true }
557
+ )
558
+ };
559
+ var uuid6 = z.string().uuid();
560
+ var uint4 = z.number().int().min(1).max(4294967295);
561
+ var count2 = z.number().int().nonnegative();
562
+ var time = z.string();
563
+ var text2 = (maximum) => z.string().min(1).max(maximum).nullable();
564
+ var enhancedStatus = z.string().regex(/^[245]\.[0-9]{1,3}\.[0-9]{1,3}$/);
565
+ var MAXIMUM_DELIVERY_BATCH = 50;
566
+ var deliveryStates = [
567
+ "sending",
568
+ "held",
569
+ "sent",
570
+ "unconfirmed",
571
+ "delivered",
572
+ "delayed",
573
+ "bounced",
574
+ "failed",
575
+ "complained"
576
+ ];
577
+ var deliveryState = z.enum(deliveryStates);
578
+ var deliveryReason = z.enum([
579
+ "content_review",
580
+ "sending_paused",
581
+ "gave_up",
582
+ "expired",
583
+ "held_expired",
584
+ "rejected",
585
+ "rendering_failure",
586
+ "blocked",
587
+ "sender_not_permitted",
588
+ "suppressed"
589
+ ]);
590
+ var heldReason = z.enum([
591
+ "scanner_reject",
592
+ "scanner_spam",
593
+ "scanner_phishing",
594
+ "scanner_malware",
595
+ "scanner_url_blocklisted",
596
+ "scanner_incomplete",
597
+ "link_text_mismatch",
598
+ "lookalike_brand",
599
+ "lookalike_tenant",
600
+ "homograph_domain",
601
+ "credential_form",
602
+ "dangerous_attachment",
603
+ "encrypted_archive"
604
+ ]);
605
+ var deliveryMeaning = z.enum([
606
+ "address_unknown",
607
+ "domain_unknown",
608
+ "mailbox_full",
609
+ "mailbox_disabled",
610
+ "too_large",
611
+ "timed_out",
612
+ "network",
613
+ "authentication",
614
+ "refused_by_policy",
615
+ "other"
616
+ ]);
617
+ var deliveryEventName = z.enum([
618
+ "accepted",
619
+ "held",
620
+ "released",
621
+ "handed_off",
622
+ "unconfirmed",
623
+ "delivered",
624
+ "delayed",
625
+ "bounced",
626
+ "failed",
627
+ "complained"
628
+ ]);
629
+ var deliverySummary = z.object({
630
+ state: deliveryState,
631
+ recipients: z.number().int().min(1).max(100),
632
+ counts: z.object({
633
+ sending: count2,
634
+ held: count2,
635
+ sent: count2,
636
+ unconfirmed: count2,
637
+ delivered: count2,
638
+ delayed: count2,
639
+ bounced: count2,
640
+ failed: count2,
641
+ complained: count2
642
+ }).strict()
643
+ }).strict();
644
+ var recipientDelivery = z.object({
645
+ address: z.string().max(320),
646
+ blind: z.boolean(),
647
+ state: deliveryState,
648
+ reason: deliveryReason.nullable(),
649
+ status: enhancedStatus.nullable(),
650
+ meaning: deliveryMeaning.nullable(),
651
+ /** The server's answer: printable, one line, at most 1000 bytes. */
652
+ diagnostic: text2(1e3),
653
+ updatedAt: time,
654
+ deliveredAt: time.nullable(),
655
+ nextAttemptAt: time.nullable()
656
+ }).strict();
657
+ var deliveryEvent = z.object({
658
+ at: time,
659
+ event: deliveryEventName,
660
+ recipient: z.number().int().min(0).max(99).nullable(),
661
+ status: enhancedStatus.nullable(),
662
+ diagnostic: text2(1e3)
663
+ }).strict();
664
+ var sentDeliveryStatus = z.object({
665
+ submittedAt: time,
666
+ summary: deliverySummary,
667
+ heldReasons: z.array(heldReason).max(16),
668
+ recipients: z.array(recipientDelivery).min(1).max(100),
669
+ timeline: z.array(deliveryEvent).max(50),
670
+ timelineComplete: z.boolean()
671
+ }).strict();
672
+ var sentDeliveryLocation = z.object({ accountId: uuid6, folderId: uuid6, uidValidity: uint4, uid: uint4 }).strict();
673
+ var sentDelivery = z.object({ status: sentDeliveryStatus.nullable() }).strict();
674
+ var sentDeliveriesLocation = z.object({
675
+ accountId: uuid6,
676
+ folderId: uuid6,
677
+ uidValidity: uint4,
678
+ uids: z.array(uint4).min(1).max(MAXIMUM_DELIVERY_BATCH)
679
+ }).strict();
680
+ var sentDeliveries = z.object({
681
+ messages: z.array(z.object({ uid: uint4, summary: deliverySummary.nullable() }).strict()).max(MAXIMUM_DELIVERY_BATCH)
682
+ }).strict();
683
+ var uuid7 = z.string().uuid();
684
+ var MAXIMUM_SIGNATURES = 100;
685
+ var MAXIMUM_SIGNATURE_BYTES = 2048;
686
+ var MAXIMUM_SIGNATURE_LINES = 12;
687
+ var signaturePlacement = z.enum(["above", "below"]);
688
+ var signature = z.object({
689
+ addressId: uuid7,
690
+ address: z.string().max(320),
691
+ text: z.string().max(MAXIMUM_SIGNATURE_BYTES),
692
+ format: composeFormat.refine((value) => new TextEncoder().encode(JSON.stringify(value)).length <= 16384).optional(),
693
+ placement: signaturePlacement,
694
+ revision: z.number().int().nonnegative(),
695
+ updatedAt: z.string().nullable()
696
+ }).strict();
697
+ var signaturePage = z.object({ signatures: z.array(signature).max(MAXIMUM_SIGNATURES), complete: z.boolean() }).strict();
698
+ var signatureSave = z.object({
699
+ operationId: uuid7,
700
+ addressId: uuid7,
701
+ text: z.string().max(MAXIMUM_SIGNATURE_BYTES),
702
+ format: composeFormat.refine((value) => new TextEncoder().encode(JSON.stringify(value)).length <= 16384).optional(),
703
+ placement: signaturePlacement,
704
+ expectedRevision: z.number().int().nonnegative()
705
+ }).strict();
706
+ var signatureSaved = z.object({ signature }).strict();
707
+ var uuid8 = z.string().uuid();
708
+ var uint5 = z.number().int().min(1).max(4294967295);
709
+ var address = z.string().min(1).max(320);
710
+ var MAXIMUM_HEADER_SAMPLE = 400;
711
+ var headerSampleInput = z.object({
712
+ accountId: uuid8,
713
+ folderId: uuid8.optional(),
714
+ uidValidity: uint5.optional(),
715
+ limit: z.number().int().min(1).max(MAXIMUM_HEADER_SAMPLE)
716
+ }).strict().refine((input) => input.folderId === void 0 === (input.uidValidity === void 0), {
717
+ message: "folderId and uidValidity go together"
718
+ });
719
+ var headerSampleMessage = z.object({
720
+ from: z.object({ address, name: z.string().max(200).nullable() }).strict().nullable(),
721
+ to: z.array(address).max(10),
722
+ cc: z.array(address).max(10),
723
+ subject: z.string().max(400).nullable(),
724
+ listId: z.string().max(400).nullable(),
725
+ bulk: z.object({
726
+ listUnsubscribe: z.boolean(),
727
+ precedence: z.string().max(32).nullable(),
728
+ autoSubmitted: z.string().max(64).nullable()
729
+ }).strict(),
730
+ folder: z.string().min(1).max(255),
731
+ date: z.string().max(40).nullable()
732
+ }).strict();
733
+ var headerSample = z.object({ messages: z.array(headerSampleMessage).max(MAXIMUM_HEADER_SAMPLE), hasMore: z.boolean() }).strict();
734
+ var uuid9 = z.uuid();
735
+ var time2 = z.iso.datetime({ offset: true });
736
+ var count3 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
737
+ var folderName2 = z.string().min(1).max(1024);
738
+ var MAXIMUM_IMPORT_FOLDERS = 1024;
739
+ var MAXIMUM_IMPORT_FAILURES_SHOWN = 100;
740
+ var MAXIMUM_IMPORTS_KEPT = 20;
741
+ var MAXIMUM_IMPORT_UPLOAD_BYTES = 256 * 1024 * 1024;
742
+ var MAXIMUM_IMPORT_UPLOAD_DAY_BYTES = 1024 * 1024 * 1024;
743
+ var IMPORT_UPLOAD_PART_BYTES = 8 * 1024 * 1024;
744
+ var MAXIMUM_IMPORT_MESSAGE_BYTES = 32 * 1024 * 1024;
745
+ var importKind = z.enum(["imap", "upload"]);
746
+ var importSecurity = z.enum(["tls", "starttls"]);
747
+ var importFileFormat = z.enum(["mbox", "eml", "zip"]);
748
+ var importSpecialUse = z.enum(["inbox", "sent", "drafts", "junk", "trash", "archive"]);
749
+ var importStates = [
750
+ "checking",
751
+ "ready",
752
+ "uploading",
753
+ "queued",
754
+ "running",
755
+ "waiting",
756
+ "completed",
757
+ "cancelled",
758
+ "failed"
759
+ ];
760
+ var importState = z.enum(importStates);
761
+ var finishedImportStates = ["completed", "cancelled", "failed"];
762
+ var importWaitReason = z.enum(["source_dropped", "source_busy", "scanner_unavailable"]);
763
+ var importFailureReason = z.enum([
764
+ "authentication",
765
+ "source_unreachable",
766
+ "tls",
767
+ "address_not_allowed",
768
+ "source_refused",
769
+ "mailbox_full",
770
+ "access",
771
+ "expired",
772
+ "unreadable_file",
773
+ "upload_lost",
774
+ "folder_missing"
775
+ ]);
776
+ var importMessageFailure = z.enum(["too_large", "empty", "unreadable", "fetch_refused", "malware"]);
777
+ var host = z.string().min(1).max(253).regex(/^(?=.{1,253}$)([A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z]{2,63}$/);
778
+ var importSourceInput = z.object({
779
+ host,
780
+ port: z.number().int().min(1).max(65535),
781
+ security: importSecurity,
782
+ username: z.string().min(1).max(320),
783
+ password: z.string().min(1).max(1024)
784
+ }).strict();
785
+ var importBegin = z.object({ operationId: uuid9, accountId: uuid9, source: importSourceInput }).strict();
786
+ var importRef = z.object({ accountId: uuid9, importId: uuid9 }).strict();
787
+ var importList = z.object({ accountId: uuid9 }).strict();
788
+ var importFolderChoice = z.object({
789
+ ordinal: z.number().int().min(0).max(MAXIMUM_IMPORT_FOLDERS - 1),
790
+ include: z.boolean(),
791
+ targetName: folderName2
792
+ }).strict();
793
+ var importConfirm = importRef.extend({
794
+ folders: z.array(importFolderChoice).min(1).max(MAXIMUM_IMPORT_FOLDERS)
795
+ }).strict();
796
+ var importUploadBegin = z.object({
797
+ operationId: uuid9,
798
+ accountId: uuid9,
799
+ folderId: uuid9,
800
+ fileName: z.string().min(1).max(255),
801
+ format: importFileFormat,
802
+ bytes: z.number().int().min(1).max(MAXIMUM_IMPORT_UPLOAD_BYTES)
803
+ }).strict();
804
+ var importUploadPart = importRef.extend({
805
+ part: z.number().int().min(0).max(31),
806
+ data: z.string().min(4).max(4 * (IMPORT_UPLOAD_PART_BYTES / 3 + 1))
807
+ }).strict();
808
+ var importProgress = z.object({
809
+ copied: count3,
810
+ skipped: count3,
811
+ failed: count3,
812
+ copiedBytes: count3,
813
+ plannedMessages: count3.nullable(),
814
+ plannedBytes: count3.nullable()
815
+ }).strict();
816
+ var importSource = z.object({
817
+ host,
818
+ port: z.number().int().min(1).max(65535),
819
+ security: importSecurity,
820
+ username: z.string().min(1).max(320)
821
+ }).strict();
822
+ var importFile = z.object({
823
+ name: z.string().min(1).max(255),
824
+ format: importFileFormat,
825
+ bytes: count3,
826
+ receivedBytes: count3
827
+ }).strict();
828
+ var importSummary = z.object({
829
+ id: uuid9,
830
+ accountId: uuid9,
831
+ kind: importKind,
832
+ state: importState,
833
+ source: importSource.nullable(),
834
+ file: importFile.nullable(),
835
+ /** The destination folder of an upload. */
836
+ folderId: uuid9.nullable(),
837
+ createdAt: time2,
838
+ startedAt: time2.nullable(),
839
+ finishedAt: time2.nullable(),
840
+ progress: importProgress,
841
+ wait: z.object({ reason: importWaitReason, until: time2 }).strict().nullable(),
842
+ failure: importFailureReason.nullable()
843
+ }).strict();
844
+ var importPlanFolder = z.object({
845
+ ordinal: z.number().int().min(0).max(MAXIMUM_IMPORT_FOLDERS - 1),
846
+ sourceName: folderName2,
847
+ specialUse: importSpecialUse.nullable(),
848
+ targetName: folderName2,
849
+ include: z.boolean(),
850
+ messages: count3,
851
+ bytes: count3.nullable(),
852
+ copied: count3,
853
+ skipped: count3,
854
+ failed: count3,
855
+ done: z.boolean()
856
+ }).strict();
857
+ var importDetail = importSummary.extend({
858
+ folders: z.array(importPlanFolder).max(MAXIMUM_IMPORT_FOLDERS),
859
+ failures: z.array(z.object({
860
+ folder: folderName2,
861
+ itemKind: z.enum(["uid", "message", "file", "folder"]),
862
+ item: z.string().min(1).max(255),
863
+ reason: importMessageFailure
864
+ }).strict()).max(MAXIMUM_IMPORT_FAILURES_SHOWN),
865
+ failureCount: count3,
866
+ /** Room this mailbox has for imported mail; a margin stays free for arriving mail. */
867
+ freeBytes: count3
868
+ }).strict();
869
+ var importAnswer = z.object({ import: importDetail }).strict();
870
+ var importListAnswer = z.object({
871
+ imports: z.array(importSummary).max(MAXIMUM_IMPORTS_KEPT),
872
+ /** False when importing from another server is not set up in this deployment. */
873
+ imapAvailable: z.boolean(),
874
+ uploadDayUsedBytes: count3
875
+ }).strict();
876
+ var importErrorCode = z.enum([
877
+ "IMPORT_ACTIVE",
878
+ "IMPORT_LIMIT",
879
+ "IMPORT_UNAVAILABLE",
880
+ "UPLOAD_TOO_LARGE",
881
+ "UPLOAD_DAY_LIMIT"
882
+ ]);
883
+ var uuid10 = z.uuid();
884
+ var time3 = z.iso.datetime({ offset: true });
885
+ var count4 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
886
+ var MAXIMUM_EXPORT_FOLDERS = 1024;
887
+ var EXPORT_MANIFEST_NAME = "manifest.json";
888
+ var exportStart = z.object({
889
+ accountId: uuid10,
890
+ /** null exports every folder the person may read. */
891
+ folderIds: z.array(uuid10).min(1).max(MAXIMUM_EXPORT_FOLDERS).nullable()
892
+ }).strict();
893
+ var exportFlag = z.enum(["seen", "answered", "flagged", "draft", "deleted"]);
894
+ var exportManifestMessage = z.object({
895
+ /** Byte offset of the message's `From ` separator line in the folder's mbox file. */
896
+ offset: count4,
897
+ octets: z.number().int().min(1).max(33554432),
898
+ sha256: z.string().regex(/^[0-9a-f]{64}$/),
899
+ internalDate: time3,
900
+ flags: z.array(exportFlag).max(5),
901
+ keywords: z.array(z.string().min(1).max(64)).max(32)
902
+ }).strict();
903
+ var exportManifestFolder = z.object({
904
+ name: z.string().min(1).max(1024),
905
+ file: z.string().min(1).max(2048),
906
+ specialUse: z.enum(["inbox", "sent", "drafts", "junk", "trash", "archive"]).nullable(),
907
+ messages: z.array(exportManifestMessage)
908
+ }).strict();
909
+ var exportManifest = z.object({
910
+ version: z.literal(1),
911
+ mailbox: z.object({ accountId: uuid10, address: z.string().min(1).max(320).nullable() }).strict(),
912
+ exportedAt: time3,
913
+ folders: z.array(exportManifestFolder).max(MAXIMUM_EXPORT_FOLDERS)
914
+ }).strict();
915
+ var uint6 = z.number().int().min(1).max(4294967295);
916
+ var location2 = z.object({ accountId: z.uuid(), folderId: z.uuid(), uidValidity: uint6, operationId: z.uuid() });
917
+ var cleanupInput = z.union([
918
+ location2.extend({ empty: z.literal(true), beforeUid: uint6.optional() }).strict(),
919
+ location2.extend({ empty: z.literal(false), uids: z.array(uint6).min(1).max(1e3) }).strict()
920
+ ]);
921
+ var cleanupResult = z.object({ operationId: z.uuid(), removed: z.number().int().min(0).max(1e3), beforeUid: z.number().int().min(0).max(4294967295), more: z.boolean() }).strict().refine((value) => !value.more || value.removed === 1e3 && value.beforeUid > 0);
922
+ var account3 = z.object({ accountId: z.uuid() }).strict();
923
+ var inboxWaitInput = account3.extend({ after: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER), timeoutMs: z.number().int().min(1).max(25e3) }).strict();
924
+ var inboxPosition = z.object({ position: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER) }).strict();
925
+ var inboxCountsInput = account3.extend({ folderIds: z.array(z.uuid()).min(1).max(200).refine((ids) => new Set(ids).size === ids.length) }).strict();
926
+ var inboxFolderCount = z.object({ folderId: z.uuid(), unseen: z.number().int().nonnegative(), total: z.number().int().nonnegative(), uidNext: z.number().int().min(1).max(4294967295), uidValidity: z.number().int().min(1).max(4294967295) }).strict();
927
+ var inboxCounts = inboxPosition.extend({ folders: z.array(inboxFolderCount).max(200) }).strict();
928
+
929
+ export { EXPORT_MANIFEST_NAME, IMPORT_UPLOAD_PART_BYTES, MAXIMUM_DELIVERY_BATCH, MAXIMUM_EXPORT_FOLDERS, MAXIMUM_HEADER_SAMPLE, MAXIMUM_IMPORTS_KEPT, MAXIMUM_IMPORT_FAILURES_SHOWN, MAXIMUM_IMPORT_FOLDERS, MAXIMUM_IMPORT_MESSAGE_BYTES, MAXIMUM_IMPORT_UPLOAD_BYTES, MAXIMUM_IMPORT_UPLOAD_DAY_BYTES, MAXIMUM_RULE_CONDITIONS, MAXIMUM_RULE_ITEMS, MAXIMUM_RULE_PROBLEMS, MAXIMUM_RULE_SCRIPT_BYTES, MAXIMUM_SEND_BASE64_BYTES, MAXIMUM_SEND_BODY_BYTES, MAXIMUM_SEND_BYTES, MAXIMUM_SIGNATURES, MAXIMUM_SIGNATURE_BYTES, MAXIMUM_SIGNATURE_LINES, MailError, RULES_REQUEST_BYTES, RULES_RESPONSE_BYTES, accountStorage, accountStorageMaximumBytes, attachment, changed, chatText, cleanupInput, cleanupResult, composeFormat, conversation, conversationCursor, conversationLocation, conversationMessage, conversationPage, conversationRow, deliveryEvent, deliveryEventName, deliveryMeaning, deliveryReason, deliveryState, deliveryStates, deliverySummary, download, draftContent, draftInputs, draftList, draftLocation, draftSchemas, entries, entry, exportFlag, exportManifest, exportManifestFolder, exportManifestMessage, exportStart, finishedImportStates, folder, headerSample, headerSampleInput, headerSampleMessage, headlessOperations, heldReason, importAnswer, importBegin, importConfirm, importDetail, importErrorCode, importFailureReason, importFile, importFileFormat, importFolderChoice, importKind, importList, importListAnswer, importMessageFailure, importPlanFolder, importProgress, importRef, importSecurity, importSource, importSourceInput, importSpecialUse, importState, importStates, importSummary, importUploadBegin, importUploadPart, importWaitReason, inbox, inboxCounts, inboxCountsInput, inboxFolderCount, inboxPosition, inboxWaitInput, mailbox, mailboxPage, mailboxRules, message, newTextConfidence, newTextInfo, newTextMessage, newTextOutcome, newTextReason, newTextRemoved, newTextRemovedKind, newTextSignatureReason, participant, readContent, receipt, recipientDelivery, renamedFolder, rule, ruleActions, ruleCondition, ruleForward, ruleItem, ruleItemInput, ruleVacation, rulesChecked, rulesInputs, rulesNotice, rulesProblem, rulesSaved, safeComposeLink, savedDraft, sender, sentDeliveries, sentDeliveriesLocation, sentDelivery, sentDeliveryLocation, sentDeliveryStatus, serviceAccountStorage, signature, signaturePage, signaturePlacement, signatureSave, signatureSaved, unreadNewText, validComposeFormat };