@oxy.so/contracts 4.0.0 → 4.1.0

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,2064 @@
1
+ /**
2
+ * Wire contract for the Inbox read API (`/email/*` on oxy-api).
3
+ *
4
+ * These schemas describe what a client RECEIVES — the JSON-serialised DTOs of
5
+ * `packages/api/src/services/email.service.ts` — so every timestamp is an ISO
6
+ * string and every nullable column is `null`, never absent. oxy-api asserts at
7
+ * the type level that its DTOs serialise to exactly these shapes, and a
8
+ * database-backed test parses real responses with them; a client parses with
9
+ * the same schemas. One declaration, two sides, no drift.
10
+ *
11
+ * Why this exists: the Inbox client used to declare its own copy, with
12
+ * `contentId: z.string().optional()`. oxy-api sends `null` for an attachment
13
+ * without a Content-ID, the client's parse failed, and the list silently
14
+ * dropped the whole message — a verification-code mail that appeared for a
15
+ * second (the realtime placeholder) and then vanished (the refetch).
16
+ *
17
+ * Unknown keys are stripped, not rejected, so the server may ADD a field
18
+ * without breaking an older client. Removing or re-typing one is breaking.
19
+ *
20
+ * Platform-agnostic — zod only, no react/react-native/expo.
21
+ */
22
+ import { z } from 'zod';
23
+ /** Structured data cards the AI extractor can emit. */
24
+ export declare const MESSAGE_CARD_TYPES: readonly ["trip", "purchase", "event", "bill", "package"];
25
+ export type MessageCardType = (typeof MESSAGE_CARD_TYPES)[number];
26
+ /** What a mail-rule condition looks at. */
27
+ export declare const EMAIL_FILTER_CONDITION_FIELDS: readonly ["from", "to", "subject", "has-attachment", "size"];
28
+ export type EmailFilterConditionField = (typeof EMAIL_FILTER_CONDITION_FIELDS)[number];
29
+ /** How a mail-rule condition compares. */
30
+ export declare const EMAIL_FILTER_CONDITION_OPERATORS: readonly ["contains", "equals", "not-contains", "starts-with", "ends-with", "greater-than", "less-than"];
31
+ export type EmailFilterConditionOperator = (typeof EMAIL_FILTER_CONDITION_OPERATORS)[number];
32
+ /** What a mail rule does. */
33
+ export declare const EMAIL_FILTER_ACTION_TYPES: readonly ["move", "label", "star", "mark-read", "archive", "delete", "forward"];
34
+ export type EmailFilterActionType = (typeof EMAIL_FILTER_ACTION_TYPES)[number];
35
+ /** Lifecycle of a durable outbound delivery. */
36
+ export declare const EMAIL_OUTBOX_STATUSES: readonly ["pending", "processing", "sent", "failed", "cancelled"];
37
+ export type EmailOutboxStatus = (typeof EMAIL_OUTBOX_STATUSES)[number];
38
+ /** One addressee. A header without a display name carries `name: ''`. */
39
+ export declare const emailMessageAddressSchema: z.ZodObject<{
40
+ name: z.ZodString;
41
+ address: z.ZodString;
42
+ }, "strip", z.ZodTypeAny, {
43
+ name: string;
44
+ address: string;
45
+ }, {
46
+ name: string;
47
+ address: string;
48
+ }>;
49
+ export type EmailMessageAddressWire = z.infer<typeof emailMessageAddressSchema>;
50
+ /**
51
+ * One attached file. `contentId` is `null` — present, not absent — when the
52
+ * part had no Content-ID, which is most attachments.
53
+ */
54
+ export declare const emailAttachmentSchema: z.ZodObject<{
55
+ fileId: z.ZodString;
56
+ name: z.ZodString;
57
+ contentType: z.ZodString;
58
+ size: z.ZodNumber;
59
+ contentId: z.ZodNullable<z.ZodString>;
60
+ isInline: z.ZodBoolean;
61
+ }, "strip", z.ZodTypeAny, {
62
+ name: string;
63
+ contentType: string;
64
+ size: number;
65
+ fileId: string;
66
+ contentId: string | null;
67
+ isInline: boolean;
68
+ }, {
69
+ name: string;
70
+ contentType: string;
71
+ size: number;
72
+ fileId: string;
73
+ contentId: string | null;
74
+ isInline: boolean;
75
+ }>;
76
+ export type EmailAttachmentWire = z.infer<typeof emailAttachmentSchema>;
77
+ export declare const emailMessageFlagsSchema: z.ZodObject<{
78
+ seen: z.ZodBoolean;
79
+ starred: z.ZodBoolean;
80
+ answered: z.ZodBoolean;
81
+ forwarded: z.ZodBoolean;
82
+ draft: z.ZodBoolean;
83
+ pinned: z.ZodBoolean;
84
+ }, "strip", z.ZodTypeAny, {
85
+ draft: boolean;
86
+ seen: boolean;
87
+ answered: boolean;
88
+ starred: boolean;
89
+ forwarded: boolean;
90
+ pinned: boolean;
91
+ }, {
92
+ draft: boolean;
93
+ seen: boolean;
94
+ answered: boolean;
95
+ starred: boolean;
96
+ forwarded: boolean;
97
+ pinned: boolean;
98
+ }>;
99
+ export type EmailMessageFlagsWire = z.infer<typeof emailMessageFlagsSchema>;
100
+ /** The AI-extracted card. Every field but `type` may be unknown. */
101
+ export declare const emailMessageCardSchema: z.ZodObject<{
102
+ type: z.ZodEnum<["trip", "purchase", "event", "bill", "package"]>;
103
+ data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
104
+ confidence: z.ZodNullable<z.ZodNumber>;
105
+ extractedAt: z.ZodNullable<z.ZodString>;
106
+ }, "strip", z.ZodTypeAny, {
107
+ type: "event" | "purchase" | "trip" | "bill" | "package";
108
+ data: Record<string, unknown> | null;
109
+ confidence: number | null;
110
+ extractedAt: string | null;
111
+ }, {
112
+ type: "event" | "purchase" | "trip" | "bill" | "package";
113
+ data: Record<string, unknown> | null;
114
+ confidence: number | null;
115
+ extractedAt: string | null;
116
+ }>;
117
+ export type EmailMessageCardWire = z.infer<typeof emailMessageCardSchema>;
118
+ /** One extracted key/value rendered as a chip. */
119
+ export declare const emailMessageHighlightSchema: z.ZodObject<{
120
+ type: z.ZodString;
121
+ value: z.ZodString;
122
+ label: z.ZodString;
123
+ }, "strip", z.ZodTypeAny, {
124
+ value: string;
125
+ type: string;
126
+ label: string;
127
+ }, {
128
+ value: string;
129
+ type: string;
130
+ label: string;
131
+ }>;
132
+ export type EmailMessageHighlightWire = z.infer<typeof emailMessageHighlightSchema>;
133
+ /**
134
+ * A stored message as every `/email` read returns it.
135
+ *
136
+ * `_id` and `id` are the same row id (see the "Wire shapes" note in oxy-api's
137
+ * email service). `messageId` is the RFC 5322 `Message-ID` header — NOT the row
138
+ * id — and it is what `inReplyTo` / `references` of a reply must name.
139
+ */
140
+ export declare const emailMessageSchema: z.ZodObject<{
141
+ _id: z.ZodString;
142
+ id: z.ZodString;
143
+ userId: z.ZodString;
144
+ mailboxId: z.ZodString;
145
+ messageId: z.ZodString;
146
+ threadId: z.ZodString;
147
+ from: z.ZodObject<{
148
+ name: z.ZodString;
149
+ address: z.ZodString;
150
+ }, "strip", z.ZodTypeAny, {
151
+ name: string;
152
+ address: string;
153
+ }, {
154
+ name: string;
155
+ address: string;
156
+ }>;
157
+ to: z.ZodArray<z.ZodObject<{
158
+ name: z.ZodString;
159
+ address: z.ZodString;
160
+ }, "strip", z.ZodTypeAny, {
161
+ name: string;
162
+ address: string;
163
+ }, {
164
+ name: string;
165
+ address: string;
166
+ }>, "many">;
167
+ cc: z.ZodArray<z.ZodObject<{
168
+ name: z.ZodString;
169
+ address: z.ZodString;
170
+ }, "strip", z.ZodTypeAny, {
171
+ name: string;
172
+ address: string;
173
+ }, {
174
+ name: string;
175
+ address: string;
176
+ }>, "many">;
177
+ bcc: z.ZodArray<z.ZodObject<{
178
+ name: z.ZodString;
179
+ address: z.ZodString;
180
+ }, "strip", z.ZodTypeAny, {
181
+ name: string;
182
+ address: string;
183
+ }, {
184
+ name: string;
185
+ address: string;
186
+ }>, "many">;
187
+ replyTo: z.ZodOptional<z.ZodObject<{
188
+ name: z.ZodString;
189
+ address: z.ZodString;
190
+ }, "strip", z.ZodTypeAny, {
191
+ name: string;
192
+ address: string;
193
+ }, {
194
+ name: string;
195
+ address: string;
196
+ }>>;
197
+ subject: z.ZodString;
198
+ attachments: z.ZodArray<z.ZodObject<{
199
+ fileId: z.ZodString;
200
+ name: z.ZodString;
201
+ contentType: z.ZodString;
202
+ size: z.ZodNumber;
203
+ contentId: z.ZodNullable<z.ZodString>;
204
+ isInline: z.ZodBoolean;
205
+ }, "strip", z.ZodTypeAny, {
206
+ name: string;
207
+ contentType: string;
208
+ size: number;
209
+ fileId: string;
210
+ contentId: string | null;
211
+ isInline: boolean;
212
+ }, {
213
+ name: string;
214
+ contentType: string;
215
+ size: number;
216
+ fileId: string;
217
+ contentId: string | null;
218
+ isInline: boolean;
219
+ }>, "many">;
220
+ flags: z.ZodObject<{
221
+ seen: z.ZodBoolean;
222
+ starred: z.ZodBoolean;
223
+ answered: z.ZodBoolean;
224
+ forwarded: z.ZodBoolean;
225
+ draft: z.ZodBoolean;
226
+ pinned: z.ZodBoolean;
227
+ }, "strip", z.ZodTypeAny, {
228
+ draft: boolean;
229
+ seen: boolean;
230
+ answered: boolean;
231
+ starred: boolean;
232
+ forwarded: boolean;
233
+ pinned: boolean;
234
+ }, {
235
+ draft: boolean;
236
+ seen: boolean;
237
+ answered: boolean;
238
+ starred: boolean;
239
+ forwarded: boolean;
240
+ pinned: boolean;
241
+ }>;
242
+ labels: z.ZodArray<z.ZodString, "many">;
243
+ card: z.ZodOptional<z.ZodObject<{
244
+ type: z.ZodEnum<["trip", "purchase", "event", "bill", "package"]>;
245
+ data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
246
+ confidence: z.ZodNullable<z.ZodNumber>;
247
+ extractedAt: z.ZodNullable<z.ZodString>;
248
+ }, "strip", z.ZodTypeAny, {
249
+ type: "event" | "purchase" | "trip" | "bill" | "package";
250
+ data: Record<string, unknown> | null;
251
+ confidence: number | null;
252
+ extractedAt: string | null;
253
+ }, {
254
+ type: "event" | "purchase" | "trip" | "bill" | "package";
255
+ data: Record<string, unknown> | null;
256
+ confidence: number | null;
257
+ extractedAt: string | null;
258
+ }>>;
259
+ highlights: z.ZodArray<z.ZodObject<{
260
+ type: z.ZodString;
261
+ value: z.ZodString;
262
+ label: z.ZodString;
263
+ }, "strip", z.ZodTypeAny, {
264
+ value: string;
265
+ type: string;
266
+ label: string;
267
+ }, {
268
+ value: string;
269
+ type: string;
270
+ label: string;
271
+ }>, "many">;
272
+ encrypted: z.ZodBoolean;
273
+ spamScore: z.ZodNullable<z.ZodNumber>;
274
+ spamAction: z.ZodNullable<z.ZodString>;
275
+ size: z.ZodNumber;
276
+ inReplyTo: z.ZodNullable<z.ZodString>;
277
+ references: z.ZodArray<z.ZodString, "many">;
278
+ aliasTag: z.ZodNullable<z.ZodString>;
279
+ snoozedUntil: z.ZodNullable<z.ZodString>;
280
+ snoozedFromMailbox: z.ZodNullable<z.ZodString>;
281
+ scheduledAt: z.ZodNullable<z.ZodString>;
282
+ readReceiptRequested: z.ZodBoolean;
283
+ readReceiptSent: z.ZodBoolean;
284
+ date: z.ZodString;
285
+ receivedAt: z.ZodString;
286
+ createdAt: z.ZodString;
287
+ updatedAt: z.ZodString;
288
+ draftRevision: z.ZodNumber;
289
+ /** Present only on the reads that return bodies (single message, thread). */
290
+ text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
291
+ html: z.ZodOptional<z.ZodNullable<z.ZodString>>;
292
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
293
+ senderAvatarPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
294
+ /** Present only on list reads that walked the thread. */
295
+ threadCount: z.ZodOptional<z.ZodNumber>;
296
+ threadParticipants: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
297
+ }, "strip", z.ZodTypeAny, {
298
+ date: string;
299
+ id: string;
300
+ createdAt: string;
301
+ updatedAt: string;
302
+ subject: string;
303
+ userId: string;
304
+ _id: string;
305
+ mailboxId: string;
306
+ messageId: string;
307
+ from: {
308
+ name: string;
309
+ address: string;
310
+ };
311
+ receivedAt: string;
312
+ size: number;
313
+ labels: string[];
314
+ to: {
315
+ name: string;
316
+ address: string;
317
+ }[];
318
+ threadId: string;
319
+ cc: {
320
+ name: string;
321
+ address: string;
322
+ }[];
323
+ bcc: {
324
+ name: string;
325
+ address: string;
326
+ }[];
327
+ attachments: {
328
+ name: string;
329
+ contentType: string;
330
+ size: number;
331
+ fileId: string;
332
+ contentId: string | null;
333
+ isInline: boolean;
334
+ }[];
335
+ flags: {
336
+ draft: boolean;
337
+ seen: boolean;
338
+ answered: boolean;
339
+ starred: boolean;
340
+ forwarded: boolean;
341
+ pinned: boolean;
342
+ };
343
+ highlights: {
344
+ value: string;
345
+ type: string;
346
+ label: string;
347
+ }[];
348
+ encrypted: boolean;
349
+ spamScore: number | null;
350
+ spamAction: string | null;
351
+ inReplyTo: string | null;
352
+ references: string[];
353
+ aliasTag: string | null;
354
+ snoozedUntil: string | null;
355
+ snoozedFromMailbox: string | null;
356
+ scheduledAt: string | null;
357
+ readReceiptRequested: boolean;
358
+ readReceiptSent: boolean;
359
+ draftRevision: number;
360
+ card?: {
361
+ type: "event" | "purchase" | "trip" | "bill" | "package";
362
+ data: Record<string, unknown> | null;
363
+ confidence: number | null;
364
+ extractedAt: string | null;
365
+ } | undefined;
366
+ headers?: Record<string, string> | undefined;
367
+ text?: string | null | undefined;
368
+ replyTo?: {
369
+ name: string;
370
+ address: string;
371
+ } | undefined;
372
+ html?: string | null | undefined;
373
+ senderAvatarPath?: string | null | undefined;
374
+ threadCount?: number | undefined;
375
+ threadParticipants?: string[] | undefined;
376
+ }, {
377
+ date: string;
378
+ id: string;
379
+ createdAt: string;
380
+ updatedAt: string;
381
+ subject: string;
382
+ userId: string;
383
+ _id: string;
384
+ mailboxId: string;
385
+ messageId: string;
386
+ from: {
387
+ name: string;
388
+ address: string;
389
+ };
390
+ receivedAt: string;
391
+ size: number;
392
+ labels: string[];
393
+ to: {
394
+ name: string;
395
+ address: string;
396
+ }[];
397
+ threadId: string;
398
+ cc: {
399
+ name: string;
400
+ address: string;
401
+ }[];
402
+ bcc: {
403
+ name: string;
404
+ address: string;
405
+ }[];
406
+ attachments: {
407
+ name: string;
408
+ contentType: string;
409
+ size: number;
410
+ fileId: string;
411
+ contentId: string | null;
412
+ isInline: boolean;
413
+ }[];
414
+ flags: {
415
+ draft: boolean;
416
+ seen: boolean;
417
+ answered: boolean;
418
+ starred: boolean;
419
+ forwarded: boolean;
420
+ pinned: boolean;
421
+ };
422
+ highlights: {
423
+ value: string;
424
+ type: string;
425
+ label: string;
426
+ }[];
427
+ encrypted: boolean;
428
+ spamScore: number | null;
429
+ spamAction: string | null;
430
+ inReplyTo: string | null;
431
+ references: string[];
432
+ aliasTag: string | null;
433
+ snoozedUntil: string | null;
434
+ snoozedFromMailbox: string | null;
435
+ scheduledAt: string | null;
436
+ readReceiptRequested: boolean;
437
+ readReceiptSent: boolean;
438
+ draftRevision: number;
439
+ card?: {
440
+ type: "event" | "purchase" | "trip" | "bill" | "package";
441
+ data: Record<string, unknown> | null;
442
+ confidence: number | null;
443
+ extractedAt: string | null;
444
+ } | undefined;
445
+ headers?: Record<string, string> | undefined;
446
+ text?: string | null | undefined;
447
+ replyTo?: {
448
+ name: string;
449
+ address: string;
450
+ } | undefined;
451
+ html?: string | null | undefined;
452
+ senderAvatarPath?: string | null | undefined;
453
+ threadCount?: number | undefined;
454
+ threadParticipants?: string[] | undefined;
455
+ }>;
456
+ export type EmailMessageWire = z.infer<typeof emailMessageSchema>;
457
+ export declare const emailMailboxSchema: z.ZodObject<{
458
+ _id: z.ZodString;
459
+ id: z.ZodString;
460
+ userId: z.ZodString;
461
+ name: z.ZodString;
462
+ path: z.ZodString;
463
+ specialUse: z.ZodNullable<z.ZodString>;
464
+ retentionDays: z.ZodNullable<z.ZodNumber>;
465
+ totalMessages: z.ZodNumber;
466
+ unseenMessages: z.ZodNumber;
467
+ size: z.ZodNumber;
468
+ createdAt: z.ZodString;
469
+ updatedAt: z.ZodString;
470
+ }, "strip", z.ZodTypeAny, {
471
+ path: string;
472
+ name: string;
473
+ id: string;
474
+ createdAt: string;
475
+ updatedAt: string;
476
+ userId: string;
477
+ _id: string;
478
+ totalMessages: number;
479
+ unseenMessages: number;
480
+ size: number;
481
+ retentionDays: number | null;
482
+ specialUse: string | null;
483
+ }, {
484
+ path: string;
485
+ name: string;
486
+ id: string;
487
+ createdAt: string;
488
+ updatedAt: string;
489
+ userId: string;
490
+ _id: string;
491
+ totalMessages: number;
492
+ unseenMessages: number;
493
+ size: number;
494
+ retentionDays: number | null;
495
+ specialUse: string | null;
496
+ }>;
497
+ export type EmailMailboxWire = z.infer<typeof emailMailboxSchema>;
498
+ /** A label the user made. */
499
+ export declare const emailUserLabelSchema: z.ZodObject<{
500
+ _id: z.ZodString;
501
+ id: z.ZodString;
502
+ userId: z.ZodString;
503
+ name: z.ZodString;
504
+ color: z.ZodString;
505
+ order: z.ZodNumber;
506
+ system: z.ZodLiteral<false>;
507
+ createdAt: z.ZodString;
508
+ updatedAt: z.ZodString;
509
+ }, "strip", z.ZodTypeAny, {
510
+ system: false;
511
+ name: string;
512
+ color: string;
513
+ id: string;
514
+ createdAt: string;
515
+ updatedAt: string;
516
+ userId: string;
517
+ _id: string;
518
+ order: number;
519
+ }, {
520
+ system: false;
521
+ name: string;
522
+ color: string;
523
+ id: string;
524
+ createdAt: string;
525
+ updatedAt: string;
526
+ userId: string;
527
+ _id: string;
528
+ order: number;
529
+ }>;
530
+ export type EmailUserLabelWire = z.infer<typeof emailUserLabelSchema>;
531
+ /** One of the product's built-in labels; `_id` is `system:<name>`. */
532
+ export declare const emailSystemLabelSchema: z.ZodObject<{
533
+ _id: z.ZodString;
534
+ name: z.ZodString;
535
+ color: z.ZodString;
536
+ order: z.ZodNumber;
537
+ system: z.ZodLiteral<true>;
538
+ }, "strip", z.ZodTypeAny, {
539
+ system: true;
540
+ name: string;
541
+ color: string;
542
+ _id: string;
543
+ order: number;
544
+ }, {
545
+ system: true;
546
+ name: string;
547
+ color: string;
548
+ _id: string;
549
+ order: number;
550
+ }>;
551
+ export type EmailSystemLabelWire = z.infer<typeof emailSystemLabelSchema>;
552
+ export declare const emailLabelSchema: z.ZodDiscriminatedUnion<"system", [z.ZodObject<{
553
+ _id: z.ZodString;
554
+ id: z.ZodString;
555
+ userId: z.ZodString;
556
+ name: z.ZodString;
557
+ color: z.ZodString;
558
+ order: z.ZodNumber;
559
+ system: z.ZodLiteral<false>;
560
+ createdAt: z.ZodString;
561
+ updatedAt: z.ZodString;
562
+ }, "strip", z.ZodTypeAny, {
563
+ system: false;
564
+ name: string;
565
+ color: string;
566
+ id: string;
567
+ createdAt: string;
568
+ updatedAt: string;
569
+ userId: string;
570
+ _id: string;
571
+ order: number;
572
+ }, {
573
+ system: false;
574
+ name: string;
575
+ color: string;
576
+ id: string;
577
+ createdAt: string;
578
+ updatedAt: string;
579
+ userId: string;
580
+ _id: string;
581
+ order: number;
582
+ }>, z.ZodObject<{
583
+ _id: z.ZodString;
584
+ name: z.ZodString;
585
+ color: z.ZodString;
586
+ order: z.ZodNumber;
587
+ system: z.ZodLiteral<true>;
588
+ }, "strip", z.ZodTypeAny, {
589
+ system: true;
590
+ name: string;
591
+ color: string;
592
+ _id: string;
593
+ order: number;
594
+ }, {
595
+ system: true;
596
+ name: string;
597
+ color: string;
598
+ _id: string;
599
+ order: number;
600
+ }>]>;
601
+ export type EmailLabelWire = z.infer<typeof emailLabelSchema>;
602
+ export declare const emailFilterConditionSchema: z.ZodObject<{
603
+ field: z.ZodEnum<["from", "to", "subject", "has-attachment", "size"]>;
604
+ operator: z.ZodEnum<["contains", "equals", "not-contains", "starts-with", "ends-with", "greater-than", "less-than"]>;
605
+ value: z.ZodString;
606
+ }, "strip", z.ZodTypeAny, {
607
+ value: string;
608
+ field: "subject" | "from" | "size" | "to" | "has-attachment";
609
+ operator: "contains" | "equals" | "not-contains" | "starts-with" | "ends-with" | "greater-than" | "less-than";
610
+ }, {
611
+ value: string;
612
+ field: "subject" | "from" | "size" | "to" | "has-attachment";
613
+ operator: "contains" | "equals" | "not-contains" | "starts-with" | "ends-with" | "greater-than" | "less-than";
614
+ }>;
615
+ export type EmailFilterConditionWire = z.infer<typeof emailFilterConditionSchema>;
616
+ /** `value` is absent for the actions that take none. */
617
+ export declare const emailFilterActionSchema: z.ZodObject<{
618
+ type: z.ZodEnum<["move", "label", "star", "mark-read", "archive", "delete", "forward"]>;
619
+ value: z.ZodOptional<z.ZodString>;
620
+ }, "strip", z.ZodTypeAny, {
621
+ type: "label" | "archive" | "move" | "star" | "mark-read" | "delete" | "forward";
622
+ value?: string | undefined;
623
+ }, {
624
+ type: "label" | "archive" | "move" | "star" | "mark-read" | "delete" | "forward";
625
+ value?: string | undefined;
626
+ }>;
627
+ export type EmailFilterActionWire = z.infer<typeof emailFilterActionSchema>;
628
+ export declare const emailFilterSchema: z.ZodObject<{
629
+ _id: z.ZodString;
630
+ id: z.ZodString;
631
+ userId: z.ZodString;
632
+ name: z.ZodString;
633
+ enabled: z.ZodBoolean;
634
+ matchAll: z.ZodBoolean;
635
+ order: z.ZodNumber;
636
+ conditions: z.ZodArray<z.ZodObject<{
637
+ field: z.ZodEnum<["from", "to", "subject", "has-attachment", "size"]>;
638
+ operator: z.ZodEnum<["contains", "equals", "not-contains", "starts-with", "ends-with", "greater-than", "less-than"]>;
639
+ value: z.ZodString;
640
+ }, "strip", z.ZodTypeAny, {
641
+ value: string;
642
+ field: "subject" | "from" | "size" | "to" | "has-attachment";
643
+ operator: "contains" | "equals" | "not-contains" | "starts-with" | "ends-with" | "greater-than" | "less-than";
644
+ }, {
645
+ value: string;
646
+ field: "subject" | "from" | "size" | "to" | "has-attachment";
647
+ operator: "contains" | "equals" | "not-contains" | "starts-with" | "ends-with" | "greater-than" | "less-than";
648
+ }>, "many">;
649
+ actions: z.ZodArray<z.ZodObject<{
650
+ type: z.ZodEnum<["move", "label", "star", "mark-read", "archive", "delete", "forward"]>;
651
+ value: z.ZodOptional<z.ZodString>;
652
+ }, "strip", z.ZodTypeAny, {
653
+ type: "label" | "archive" | "move" | "star" | "mark-read" | "delete" | "forward";
654
+ value?: string | undefined;
655
+ }, {
656
+ type: "label" | "archive" | "move" | "star" | "mark-read" | "delete" | "forward";
657
+ value?: string | undefined;
658
+ }>, "many">;
659
+ createdAt: z.ZodString;
660
+ updatedAt: z.ZodString;
661
+ }, "strip", z.ZodTypeAny, {
662
+ name: string;
663
+ id: string;
664
+ createdAt: string;
665
+ updatedAt: string;
666
+ enabled: boolean;
667
+ userId: string;
668
+ _id: string;
669
+ order: number;
670
+ matchAll: boolean;
671
+ conditions: {
672
+ value: string;
673
+ field: "subject" | "from" | "size" | "to" | "has-attachment";
674
+ operator: "contains" | "equals" | "not-contains" | "starts-with" | "ends-with" | "greater-than" | "less-than";
675
+ }[];
676
+ actions: {
677
+ type: "label" | "archive" | "move" | "star" | "mark-read" | "delete" | "forward";
678
+ value?: string | undefined;
679
+ }[];
680
+ }, {
681
+ name: string;
682
+ id: string;
683
+ createdAt: string;
684
+ updatedAt: string;
685
+ enabled: boolean;
686
+ userId: string;
687
+ _id: string;
688
+ order: number;
689
+ matchAll: boolean;
690
+ conditions: {
691
+ value: string;
692
+ field: "subject" | "from" | "size" | "to" | "has-attachment";
693
+ operator: "contains" | "equals" | "not-contains" | "starts-with" | "ends-with" | "greater-than" | "less-than";
694
+ }[];
695
+ actions: {
696
+ type: "label" | "archive" | "move" | "star" | "mark-read" | "delete" | "forward";
697
+ value?: string | undefined;
698
+ }[];
699
+ }>;
700
+ export type EmailFilterWire = z.infer<typeof emailFilterSchema>;
701
+ export declare const emailBundleSchema: z.ZodObject<{
702
+ _id: z.ZodString;
703
+ id: z.ZodString;
704
+ userId: z.ZodString;
705
+ name: z.ZodString;
706
+ icon: z.ZodString;
707
+ color: z.ZodString;
708
+ matchLabels: z.ZodArray<z.ZodString, "many">;
709
+ enabled: z.ZodBoolean;
710
+ collapsed: z.ZodBoolean;
711
+ order: z.ZodNumber;
712
+ createdAt: z.ZodString;
713
+ updatedAt: z.ZodString;
714
+ }, "strip", z.ZodTypeAny, {
715
+ name: string;
716
+ color: string;
717
+ id: string;
718
+ createdAt: string;
719
+ updatedAt: string;
720
+ enabled: boolean;
721
+ userId: string;
722
+ _id: string;
723
+ icon: string;
724
+ order: number;
725
+ matchLabels: string[];
726
+ collapsed: boolean;
727
+ }, {
728
+ name: string;
729
+ color: string;
730
+ id: string;
731
+ createdAt: string;
732
+ updatedAt: string;
733
+ enabled: boolean;
734
+ userId: string;
735
+ _id: string;
736
+ icon: string;
737
+ order: number;
738
+ matchLabels: string[];
739
+ collapsed: boolean;
740
+ }>;
741
+ export type EmailBundleWire = z.infer<typeof emailBundleSchema>;
742
+ /** `GET /email/messages?bundled=true` — the inbox split into primary and bundles. */
743
+ export declare const emailBundledInboxSchema: z.ZodObject<{
744
+ primary: z.ZodArray<z.ZodObject<{
745
+ _id: z.ZodString;
746
+ id: z.ZodString;
747
+ userId: z.ZodString;
748
+ mailboxId: z.ZodString;
749
+ messageId: z.ZodString;
750
+ threadId: z.ZodString;
751
+ from: z.ZodObject<{
752
+ name: z.ZodString;
753
+ address: z.ZodString;
754
+ }, "strip", z.ZodTypeAny, {
755
+ name: string;
756
+ address: string;
757
+ }, {
758
+ name: string;
759
+ address: string;
760
+ }>;
761
+ to: z.ZodArray<z.ZodObject<{
762
+ name: z.ZodString;
763
+ address: z.ZodString;
764
+ }, "strip", z.ZodTypeAny, {
765
+ name: string;
766
+ address: string;
767
+ }, {
768
+ name: string;
769
+ address: string;
770
+ }>, "many">;
771
+ cc: z.ZodArray<z.ZodObject<{
772
+ name: z.ZodString;
773
+ address: z.ZodString;
774
+ }, "strip", z.ZodTypeAny, {
775
+ name: string;
776
+ address: string;
777
+ }, {
778
+ name: string;
779
+ address: string;
780
+ }>, "many">;
781
+ bcc: z.ZodArray<z.ZodObject<{
782
+ name: z.ZodString;
783
+ address: z.ZodString;
784
+ }, "strip", z.ZodTypeAny, {
785
+ name: string;
786
+ address: string;
787
+ }, {
788
+ name: string;
789
+ address: string;
790
+ }>, "many">;
791
+ replyTo: z.ZodOptional<z.ZodObject<{
792
+ name: z.ZodString;
793
+ address: z.ZodString;
794
+ }, "strip", z.ZodTypeAny, {
795
+ name: string;
796
+ address: string;
797
+ }, {
798
+ name: string;
799
+ address: string;
800
+ }>>;
801
+ subject: z.ZodString;
802
+ attachments: z.ZodArray<z.ZodObject<{
803
+ fileId: z.ZodString;
804
+ name: z.ZodString;
805
+ contentType: z.ZodString;
806
+ size: z.ZodNumber;
807
+ contentId: z.ZodNullable<z.ZodString>;
808
+ isInline: z.ZodBoolean;
809
+ }, "strip", z.ZodTypeAny, {
810
+ name: string;
811
+ contentType: string;
812
+ size: number;
813
+ fileId: string;
814
+ contentId: string | null;
815
+ isInline: boolean;
816
+ }, {
817
+ name: string;
818
+ contentType: string;
819
+ size: number;
820
+ fileId: string;
821
+ contentId: string | null;
822
+ isInline: boolean;
823
+ }>, "many">;
824
+ flags: z.ZodObject<{
825
+ seen: z.ZodBoolean;
826
+ starred: z.ZodBoolean;
827
+ answered: z.ZodBoolean;
828
+ forwarded: z.ZodBoolean;
829
+ draft: z.ZodBoolean;
830
+ pinned: z.ZodBoolean;
831
+ }, "strip", z.ZodTypeAny, {
832
+ draft: boolean;
833
+ seen: boolean;
834
+ answered: boolean;
835
+ starred: boolean;
836
+ forwarded: boolean;
837
+ pinned: boolean;
838
+ }, {
839
+ draft: boolean;
840
+ seen: boolean;
841
+ answered: boolean;
842
+ starred: boolean;
843
+ forwarded: boolean;
844
+ pinned: boolean;
845
+ }>;
846
+ labels: z.ZodArray<z.ZodString, "many">;
847
+ card: z.ZodOptional<z.ZodObject<{
848
+ type: z.ZodEnum<["trip", "purchase", "event", "bill", "package"]>;
849
+ data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
850
+ confidence: z.ZodNullable<z.ZodNumber>;
851
+ extractedAt: z.ZodNullable<z.ZodString>;
852
+ }, "strip", z.ZodTypeAny, {
853
+ type: "event" | "purchase" | "trip" | "bill" | "package";
854
+ data: Record<string, unknown> | null;
855
+ confidence: number | null;
856
+ extractedAt: string | null;
857
+ }, {
858
+ type: "event" | "purchase" | "trip" | "bill" | "package";
859
+ data: Record<string, unknown> | null;
860
+ confidence: number | null;
861
+ extractedAt: string | null;
862
+ }>>;
863
+ highlights: z.ZodArray<z.ZodObject<{
864
+ type: z.ZodString;
865
+ value: z.ZodString;
866
+ label: z.ZodString;
867
+ }, "strip", z.ZodTypeAny, {
868
+ value: string;
869
+ type: string;
870
+ label: string;
871
+ }, {
872
+ value: string;
873
+ type: string;
874
+ label: string;
875
+ }>, "many">;
876
+ encrypted: z.ZodBoolean;
877
+ spamScore: z.ZodNullable<z.ZodNumber>;
878
+ spamAction: z.ZodNullable<z.ZodString>;
879
+ size: z.ZodNumber;
880
+ inReplyTo: z.ZodNullable<z.ZodString>;
881
+ references: z.ZodArray<z.ZodString, "many">;
882
+ aliasTag: z.ZodNullable<z.ZodString>;
883
+ snoozedUntil: z.ZodNullable<z.ZodString>;
884
+ snoozedFromMailbox: z.ZodNullable<z.ZodString>;
885
+ scheduledAt: z.ZodNullable<z.ZodString>;
886
+ readReceiptRequested: z.ZodBoolean;
887
+ readReceiptSent: z.ZodBoolean;
888
+ date: z.ZodString;
889
+ receivedAt: z.ZodString;
890
+ createdAt: z.ZodString;
891
+ updatedAt: z.ZodString;
892
+ draftRevision: z.ZodNumber;
893
+ /** Present only on the reads that return bodies (single message, thread). */
894
+ text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
895
+ html: z.ZodOptional<z.ZodNullable<z.ZodString>>;
896
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
897
+ senderAvatarPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
898
+ /** Present only on list reads that walked the thread. */
899
+ threadCount: z.ZodOptional<z.ZodNumber>;
900
+ threadParticipants: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
901
+ }, "strip", z.ZodTypeAny, {
902
+ date: string;
903
+ id: string;
904
+ createdAt: string;
905
+ updatedAt: string;
906
+ subject: string;
907
+ userId: string;
908
+ _id: string;
909
+ mailboxId: string;
910
+ messageId: string;
911
+ from: {
912
+ name: string;
913
+ address: string;
914
+ };
915
+ receivedAt: string;
916
+ size: number;
917
+ labels: string[];
918
+ to: {
919
+ name: string;
920
+ address: string;
921
+ }[];
922
+ threadId: string;
923
+ cc: {
924
+ name: string;
925
+ address: string;
926
+ }[];
927
+ bcc: {
928
+ name: string;
929
+ address: string;
930
+ }[];
931
+ attachments: {
932
+ name: string;
933
+ contentType: string;
934
+ size: number;
935
+ fileId: string;
936
+ contentId: string | null;
937
+ isInline: boolean;
938
+ }[];
939
+ flags: {
940
+ draft: boolean;
941
+ seen: boolean;
942
+ answered: boolean;
943
+ starred: boolean;
944
+ forwarded: boolean;
945
+ pinned: boolean;
946
+ };
947
+ highlights: {
948
+ value: string;
949
+ type: string;
950
+ label: string;
951
+ }[];
952
+ encrypted: boolean;
953
+ spamScore: number | null;
954
+ spamAction: string | null;
955
+ inReplyTo: string | null;
956
+ references: string[];
957
+ aliasTag: string | null;
958
+ snoozedUntil: string | null;
959
+ snoozedFromMailbox: string | null;
960
+ scheduledAt: string | null;
961
+ readReceiptRequested: boolean;
962
+ readReceiptSent: boolean;
963
+ draftRevision: number;
964
+ card?: {
965
+ type: "event" | "purchase" | "trip" | "bill" | "package";
966
+ data: Record<string, unknown> | null;
967
+ confidence: number | null;
968
+ extractedAt: string | null;
969
+ } | undefined;
970
+ headers?: Record<string, string> | undefined;
971
+ text?: string | null | undefined;
972
+ replyTo?: {
973
+ name: string;
974
+ address: string;
975
+ } | undefined;
976
+ html?: string | null | undefined;
977
+ senderAvatarPath?: string | null | undefined;
978
+ threadCount?: number | undefined;
979
+ threadParticipants?: string[] | undefined;
980
+ }, {
981
+ date: string;
982
+ id: string;
983
+ createdAt: string;
984
+ updatedAt: string;
985
+ subject: string;
986
+ userId: string;
987
+ _id: string;
988
+ mailboxId: string;
989
+ messageId: string;
990
+ from: {
991
+ name: string;
992
+ address: string;
993
+ };
994
+ receivedAt: string;
995
+ size: number;
996
+ labels: string[];
997
+ to: {
998
+ name: string;
999
+ address: string;
1000
+ }[];
1001
+ threadId: string;
1002
+ cc: {
1003
+ name: string;
1004
+ address: string;
1005
+ }[];
1006
+ bcc: {
1007
+ name: string;
1008
+ address: string;
1009
+ }[];
1010
+ attachments: {
1011
+ name: string;
1012
+ contentType: string;
1013
+ size: number;
1014
+ fileId: string;
1015
+ contentId: string | null;
1016
+ isInline: boolean;
1017
+ }[];
1018
+ flags: {
1019
+ draft: boolean;
1020
+ seen: boolean;
1021
+ answered: boolean;
1022
+ starred: boolean;
1023
+ forwarded: boolean;
1024
+ pinned: boolean;
1025
+ };
1026
+ highlights: {
1027
+ value: string;
1028
+ type: string;
1029
+ label: string;
1030
+ }[];
1031
+ encrypted: boolean;
1032
+ spamScore: number | null;
1033
+ spamAction: string | null;
1034
+ inReplyTo: string | null;
1035
+ references: string[];
1036
+ aliasTag: string | null;
1037
+ snoozedUntil: string | null;
1038
+ snoozedFromMailbox: string | null;
1039
+ scheduledAt: string | null;
1040
+ readReceiptRequested: boolean;
1041
+ readReceiptSent: boolean;
1042
+ draftRevision: number;
1043
+ card?: {
1044
+ type: "event" | "purchase" | "trip" | "bill" | "package";
1045
+ data: Record<string, unknown> | null;
1046
+ confidence: number | null;
1047
+ extractedAt: string | null;
1048
+ } | undefined;
1049
+ headers?: Record<string, string> | undefined;
1050
+ text?: string | null | undefined;
1051
+ replyTo?: {
1052
+ name: string;
1053
+ address: string;
1054
+ } | undefined;
1055
+ html?: string | null | undefined;
1056
+ senderAvatarPath?: string | null | undefined;
1057
+ threadCount?: number | undefined;
1058
+ threadParticipants?: string[] | undefined;
1059
+ }>, "many">;
1060
+ bundles: z.ZodArray<z.ZodObject<{
1061
+ bundle: z.ZodObject<{
1062
+ _id: z.ZodString;
1063
+ id: z.ZodString;
1064
+ userId: z.ZodString;
1065
+ name: z.ZodString;
1066
+ icon: z.ZodString;
1067
+ color: z.ZodString;
1068
+ matchLabels: z.ZodArray<z.ZodString, "many">;
1069
+ enabled: z.ZodBoolean;
1070
+ collapsed: z.ZodBoolean;
1071
+ order: z.ZodNumber;
1072
+ createdAt: z.ZodString;
1073
+ updatedAt: z.ZodString;
1074
+ }, "strip", z.ZodTypeAny, {
1075
+ name: string;
1076
+ color: string;
1077
+ id: string;
1078
+ createdAt: string;
1079
+ updatedAt: string;
1080
+ enabled: boolean;
1081
+ userId: string;
1082
+ _id: string;
1083
+ icon: string;
1084
+ order: number;
1085
+ matchLabels: string[];
1086
+ collapsed: boolean;
1087
+ }, {
1088
+ name: string;
1089
+ color: string;
1090
+ id: string;
1091
+ createdAt: string;
1092
+ updatedAt: string;
1093
+ enabled: boolean;
1094
+ userId: string;
1095
+ _id: string;
1096
+ icon: string;
1097
+ order: number;
1098
+ matchLabels: string[];
1099
+ collapsed: boolean;
1100
+ }>;
1101
+ messages: z.ZodArray<z.ZodObject<{
1102
+ _id: z.ZodString;
1103
+ id: z.ZodString;
1104
+ userId: z.ZodString;
1105
+ mailboxId: z.ZodString;
1106
+ messageId: z.ZodString;
1107
+ threadId: z.ZodString;
1108
+ from: z.ZodObject<{
1109
+ name: z.ZodString;
1110
+ address: z.ZodString;
1111
+ }, "strip", z.ZodTypeAny, {
1112
+ name: string;
1113
+ address: string;
1114
+ }, {
1115
+ name: string;
1116
+ address: string;
1117
+ }>;
1118
+ to: z.ZodArray<z.ZodObject<{
1119
+ name: z.ZodString;
1120
+ address: z.ZodString;
1121
+ }, "strip", z.ZodTypeAny, {
1122
+ name: string;
1123
+ address: string;
1124
+ }, {
1125
+ name: string;
1126
+ address: string;
1127
+ }>, "many">;
1128
+ cc: z.ZodArray<z.ZodObject<{
1129
+ name: z.ZodString;
1130
+ address: z.ZodString;
1131
+ }, "strip", z.ZodTypeAny, {
1132
+ name: string;
1133
+ address: string;
1134
+ }, {
1135
+ name: string;
1136
+ address: string;
1137
+ }>, "many">;
1138
+ bcc: z.ZodArray<z.ZodObject<{
1139
+ name: z.ZodString;
1140
+ address: z.ZodString;
1141
+ }, "strip", z.ZodTypeAny, {
1142
+ name: string;
1143
+ address: string;
1144
+ }, {
1145
+ name: string;
1146
+ address: string;
1147
+ }>, "many">;
1148
+ replyTo: z.ZodOptional<z.ZodObject<{
1149
+ name: z.ZodString;
1150
+ address: z.ZodString;
1151
+ }, "strip", z.ZodTypeAny, {
1152
+ name: string;
1153
+ address: string;
1154
+ }, {
1155
+ name: string;
1156
+ address: string;
1157
+ }>>;
1158
+ subject: z.ZodString;
1159
+ attachments: z.ZodArray<z.ZodObject<{
1160
+ fileId: z.ZodString;
1161
+ name: z.ZodString;
1162
+ contentType: z.ZodString;
1163
+ size: z.ZodNumber;
1164
+ contentId: z.ZodNullable<z.ZodString>;
1165
+ isInline: z.ZodBoolean;
1166
+ }, "strip", z.ZodTypeAny, {
1167
+ name: string;
1168
+ contentType: string;
1169
+ size: number;
1170
+ fileId: string;
1171
+ contentId: string | null;
1172
+ isInline: boolean;
1173
+ }, {
1174
+ name: string;
1175
+ contentType: string;
1176
+ size: number;
1177
+ fileId: string;
1178
+ contentId: string | null;
1179
+ isInline: boolean;
1180
+ }>, "many">;
1181
+ flags: z.ZodObject<{
1182
+ seen: z.ZodBoolean;
1183
+ starred: z.ZodBoolean;
1184
+ answered: z.ZodBoolean;
1185
+ forwarded: z.ZodBoolean;
1186
+ draft: z.ZodBoolean;
1187
+ pinned: z.ZodBoolean;
1188
+ }, "strip", z.ZodTypeAny, {
1189
+ draft: boolean;
1190
+ seen: boolean;
1191
+ answered: boolean;
1192
+ starred: boolean;
1193
+ forwarded: boolean;
1194
+ pinned: boolean;
1195
+ }, {
1196
+ draft: boolean;
1197
+ seen: boolean;
1198
+ answered: boolean;
1199
+ starred: boolean;
1200
+ forwarded: boolean;
1201
+ pinned: boolean;
1202
+ }>;
1203
+ labels: z.ZodArray<z.ZodString, "many">;
1204
+ card: z.ZodOptional<z.ZodObject<{
1205
+ type: z.ZodEnum<["trip", "purchase", "event", "bill", "package"]>;
1206
+ data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1207
+ confidence: z.ZodNullable<z.ZodNumber>;
1208
+ extractedAt: z.ZodNullable<z.ZodString>;
1209
+ }, "strip", z.ZodTypeAny, {
1210
+ type: "event" | "purchase" | "trip" | "bill" | "package";
1211
+ data: Record<string, unknown> | null;
1212
+ confidence: number | null;
1213
+ extractedAt: string | null;
1214
+ }, {
1215
+ type: "event" | "purchase" | "trip" | "bill" | "package";
1216
+ data: Record<string, unknown> | null;
1217
+ confidence: number | null;
1218
+ extractedAt: string | null;
1219
+ }>>;
1220
+ highlights: z.ZodArray<z.ZodObject<{
1221
+ type: z.ZodString;
1222
+ value: z.ZodString;
1223
+ label: z.ZodString;
1224
+ }, "strip", z.ZodTypeAny, {
1225
+ value: string;
1226
+ type: string;
1227
+ label: string;
1228
+ }, {
1229
+ value: string;
1230
+ type: string;
1231
+ label: string;
1232
+ }>, "many">;
1233
+ encrypted: z.ZodBoolean;
1234
+ spamScore: z.ZodNullable<z.ZodNumber>;
1235
+ spamAction: z.ZodNullable<z.ZodString>;
1236
+ size: z.ZodNumber;
1237
+ inReplyTo: z.ZodNullable<z.ZodString>;
1238
+ references: z.ZodArray<z.ZodString, "many">;
1239
+ aliasTag: z.ZodNullable<z.ZodString>;
1240
+ snoozedUntil: z.ZodNullable<z.ZodString>;
1241
+ snoozedFromMailbox: z.ZodNullable<z.ZodString>;
1242
+ scheduledAt: z.ZodNullable<z.ZodString>;
1243
+ readReceiptRequested: z.ZodBoolean;
1244
+ readReceiptSent: z.ZodBoolean;
1245
+ date: z.ZodString;
1246
+ receivedAt: z.ZodString;
1247
+ createdAt: z.ZodString;
1248
+ updatedAt: z.ZodString;
1249
+ draftRevision: z.ZodNumber;
1250
+ /** Present only on the reads that return bodies (single message, thread). */
1251
+ text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1252
+ html: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1253
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1254
+ senderAvatarPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1255
+ /** Present only on list reads that walked the thread. */
1256
+ threadCount: z.ZodOptional<z.ZodNumber>;
1257
+ threadParticipants: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1258
+ }, "strip", z.ZodTypeAny, {
1259
+ date: string;
1260
+ id: string;
1261
+ createdAt: string;
1262
+ updatedAt: string;
1263
+ subject: string;
1264
+ userId: string;
1265
+ _id: string;
1266
+ mailboxId: string;
1267
+ messageId: string;
1268
+ from: {
1269
+ name: string;
1270
+ address: string;
1271
+ };
1272
+ receivedAt: string;
1273
+ size: number;
1274
+ labels: string[];
1275
+ to: {
1276
+ name: string;
1277
+ address: string;
1278
+ }[];
1279
+ threadId: string;
1280
+ cc: {
1281
+ name: string;
1282
+ address: string;
1283
+ }[];
1284
+ bcc: {
1285
+ name: string;
1286
+ address: string;
1287
+ }[];
1288
+ attachments: {
1289
+ name: string;
1290
+ contentType: string;
1291
+ size: number;
1292
+ fileId: string;
1293
+ contentId: string | null;
1294
+ isInline: boolean;
1295
+ }[];
1296
+ flags: {
1297
+ draft: boolean;
1298
+ seen: boolean;
1299
+ answered: boolean;
1300
+ starred: boolean;
1301
+ forwarded: boolean;
1302
+ pinned: boolean;
1303
+ };
1304
+ highlights: {
1305
+ value: string;
1306
+ type: string;
1307
+ label: string;
1308
+ }[];
1309
+ encrypted: boolean;
1310
+ spamScore: number | null;
1311
+ spamAction: string | null;
1312
+ inReplyTo: string | null;
1313
+ references: string[];
1314
+ aliasTag: string | null;
1315
+ snoozedUntil: string | null;
1316
+ snoozedFromMailbox: string | null;
1317
+ scheduledAt: string | null;
1318
+ readReceiptRequested: boolean;
1319
+ readReceiptSent: boolean;
1320
+ draftRevision: number;
1321
+ card?: {
1322
+ type: "event" | "purchase" | "trip" | "bill" | "package";
1323
+ data: Record<string, unknown> | null;
1324
+ confidence: number | null;
1325
+ extractedAt: string | null;
1326
+ } | undefined;
1327
+ headers?: Record<string, string> | undefined;
1328
+ text?: string | null | undefined;
1329
+ replyTo?: {
1330
+ name: string;
1331
+ address: string;
1332
+ } | undefined;
1333
+ html?: string | null | undefined;
1334
+ senderAvatarPath?: string | null | undefined;
1335
+ threadCount?: number | undefined;
1336
+ threadParticipants?: string[] | undefined;
1337
+ }, {
1338
+ date: string;
1339
+ id: string;
1340
+ createdAt: string;
1341
+ updatedAt: string;
1342
+ subject: string;
1343
+ userId: string;
1344
+ _id: string;
1345
+ mailboxId: string;
1346
+ messageId: string;
1347
+ from: {
1348
+ name: string;
1349
+ address: string;
1350
+ };
1351
+ receivedAt: string;
1352
+ size: number;
1353
+ labels: string[];
1354
+ to: {
1355
+ name: string;
1356
+ address: string;
1357
+ }[];
1358
+ threadId: string;
1359
+ cc: {
1360
+ name: string;
1361
+ address: string;
1362
+ }[];
1363
+ bcc: {
1364
+ name: string;
1365
+ address: string;
1366
+ }[];
1367
+ attachments: {
1368
+ name: string;
1369
+ contentType: string;
1370
+ size: number;
1371
+ fileId: string;
1372
+ contentId: string | null;
1373
+ isInline: boolean;
1374
+ }[];
1375
+ flags: {
1376
+ draft: boolean;
1377
+ seen: boolean;
1378
+ answered: boolean;
1379
+ starred: boolean;
1380
+ forwarded: boolean;
1381
+ pinned: boolean;
1382
+ };
1383
+ highlights: {
1384
+ value: string;
1385
+ type: string;
1386
+ label: string;
1387
+ }[];
1388
+ encrypted: boolean;
1389
+ spamScore: number | null;
1390
+ spamAction: string | null;
1391
+ inReplyTo: string | null;
1392
+ references: string[];
1393
+ aliasTag: string | null;
1394
+ snoozedUntil: string | null;
1395
+ snoozedFromMailbox: string | null;
1396
+ scheduledAt: string | null;
1397
+ readReceiptRequested: boolean;
1398
+ readReceiptSent: boolean;
1399
+ draftRevision: number;
1400
+ card?: {
1401
+ type: "event" | "purchase" | "trip" | "bill" | "package";
1402
+ data: Record<string, unknown> | null;
1403
+ confidence: number | null;
1404
+ extractedAt: string | null;
1405
+ } | undefined;
1406
+ headers?: Record<string, string> | undefined;
1407
+ text?: string | null | undefined;
1408
+ replyTo?: {
1409
+ name: string;
1410
+ address: string;
1411
+ } | undefined;
1412
+ html?: string | null | undefined;
1413
+ senderAvatarPath?: string | null | undefined;
1414
+ threadCount?: number | undefined;
1415
+ threadParticipants?: string[] | undefined;
1416
+ }>, "many">;
1417
+ unreadCount: z.ZodNumber;
1418
+ }, "strip", z.ZodTypeAny, {
1419
+ messages: {
1420
+ date: string;
1421
+ id: string;
1422
+ createdAt: string;
1423
+ updatedAt: string;
1424
+ subject: string;
1425
+ userId: string;
1426
+ _id: string;
1427
+ mailboxId: string;
1428
+ messageId: string;
1429
+ from: {
1430
+ name: string;
1431
+ address: string;
1432
+ };
1433
+ receivedAt: string;
1434
+ size: number;
1435
+ labels: string[];
1436
+ to: {
1437
+ name: string;
1438
+ address: string;
1439
+ }[];
1440
+ threadId: string;
1441
+ cc: {
1442
+ name: string;
1443
+ address: string;
1444
+ }[];
1445
+ bcc: {
1446
+ name: string;
1447
+ address: string;
1448
+ }[];
1449
+ attachments: {
1450
+ name: string;
1451
+ contentType: string;
1452
+ size: number;
1453
+ fileId: string;
1454
+ contentId: string | null;
1455
+ isInline: boolean;
1456
+ }[];
1457
+ flags: {
1458
+ draft: boolean;
1459
+ seen: boolean;
1460
+ answered: boolean;
1461
+ starred: boolean;
1462
+ forwarded: boolean;
1463
+ pinned: boolean;
1464
+ };
1465
+ highlights: {
1466
+ value: string;
1467
+ type: string;
1468
+ label: string;
1469
+ }[];
1470
+ encrypted: boolean;
1471
+ spamScore: number | null;
1472
+ spamAction: string | null;
1473
+ inReplyTo: string | null;
1474
+ references: string[];
1475
+ aliasTag: string | null;
1476
+ snoozedUntil: string | null;
1477
+ snoozedFromMailbox: string | null;
1478
+ scheduledAt: string | null;
1479
+ readReceiptRequested: boolean;
1480
+ readReceiptSent: boolean;
1481
+ draftRevision: number;
1482
+ card?: {
1483
+ type: "event" | "purchase" | "trip" | "bill" | "package";
1484
+ data: Record<string, unknown> | null;
1485
+ confidence: number | null;
1486
+ extractedAt: string | null;
1487
+ } | undefined;
1488
+ headers?: Record<string, string> | undefined;
1489
+ text?: string | null | undefined;
1490
+ replyTo?: {
1491
+ name: string;
1492
+ address: string;
1493
+ } | undefined;
1494
+ html?: string | null | undefined;
1495
+ senderAvatarPath?: string | null | undefined;
1496
+ threadCount?: number | undefined;
1497
+ threadParticipants?: string[] | undefined;
1498
+ }[];
1499
+ bundle: {
1500
+ name: string;
1501
+ color: string;
1502
+ id: string;
1503
+ createdAt: string;
1504
+ updatedAt: string;
1505
+ enabled: boolean;
1506
+ userId: string;
1507
+ _id: string;
1508
+ icon: string;
1509
+ order: number;
1510
+ matchLabels: string[];
1511
+ collapsed: boolean;
1512
+ };
1513
+ unreadCount: number;
1514
+ }, {
1515
+ messages: {
1516
+ date: string;
1517
+ id: string;
1518
+ createdAt: string;
1519
+ updatedAt: string;
1520
+ subject: string;
1521
+ userId: string;
1522
+ _id: string;
1523
+ mailboxId: string;
1524
+ messageId: string;
1525
+ from: {
1526
+ name: string;
1527
+ address: string;
1528
+ };
1529
+ receivedAt: string;
1530
+ size: number;
1531
+ labels: string[];
1532
+ to: {
1533
+ name: string;
1534
+ address: string;
1535
+ }[];
1536
+ threadId: string;
1537
+ cc: {
1538
+ name: string;
1539
+ address: string;
1540
+ }[];
1541
+ bcc: {
1542
+ name: string;
1543
+ address: string;
1544
+ }[];
1545
+ attachments: {
1546
+ name: string;
1547
+ contentType: string;
1548
+ size: number;
1549
+ fileId: string;
1550
+ contentId: string | null;
1551
+ isInline: boolean;
1552
+ }[];
1553
+ flags: {
1554
+ draft: boolean;
1555
+ seen: boolean;
1556
+ answered: boolean;
1557
+ starred: boolean;
1558
+ forwarded: boolean;
1559
+ pinned: boolean;
1560
+ };
1561
+ highlights: {
1562
+ value: string;
1563
+ type: string;
1564
+ label: string;
1565
+ }[];
1566
+ encrypted: boolean;
1567
+ spamScore: number | null;
1568
+ spamAction: string | null;
1569
+ inReplyTo: string | null;
1570
+ references: string[];
1571
+ aliasTag: string | null;
1572
+ snoozedUntil: string | null;
1573
+ snoozedFromMailbox: string | null;
1574
+ scheduledAt: string | null;
1575
+ readReceiptRequested: boolean;
1576
+ readReceiptSent: boolean;
1577
+ draftRevision: number;
1578
+ card?: {
1579
+ type: "event" | "purchase" | "trip" | "bill" | "package";
1580
+ data: Record<string, unknown> | null;
1581
+ confidence: number | null;
1582
+ extractedAt: string | null;
1583
+ } | undefined;
1584
+ headers?: Record<string, string> | undefined;
1585
+ text?: string | null | undefined;
1586
+ replyTo?: {
1587
+ name: string;
1588
+ address: string;
1589
+ } | undefined;
1590
+ html?: string | null | undefined;
1591
+ senderAvatarPath?: string | null | undefined;
1592
+ threadCount?: number | undefined;
1593
+ threadParticipants?: string[] | undefined;
1594
+ }[];
1595
+ bundle: {
1596
+ name: string;
1597
+ color: string;
1598
+ id: string;
1599
+ createdAt: string;
1600
+ updatedAt: string;
1601
+ enabled: boolean;
1602
+ userId: string;
1603
+ _id: string;
1604
+ icon: string;
1605
+ order: number;
1606
+ matchLabels: string[];
1607
+ collapsed: boolean;
1608
+ };
1609
+ unreadCount: number;
1610
+ }>, "many">;
1611
+ total: z.ZodNumber;
1612
+ }, "strip", z.ZodTypeAny, {
1613
+ total: number;
1614
+ primary: {
1615
+ date: string;
1616
+ id: string;
1617
+ createdAt: string;
1618
+ updatedAt: string;
1619
+ subject: string;
1620
+ userId: string;
1621
+ _id: string;
1622
+ mailboxId: string;
1623
+ messageId: string;
1624
+ from: {
1625
+ name: string;
1626
+ address: string;
1627
+ };
1628
+ receivedAt: string;
1629
+ size: number;
1630
+ labels: string[];
1631
+ to: {
1632
+ name: string;
1633
+ address: string;
1634
+ }[];
1635
+ threadId: string;
1636
+ cc: {
1637
+ name: string;
1638
+ address: string;
1639
+ }[];
1640
+ bcc: {
1641
+ name: string;
1642
+ address: string;
1643
+ }[];
1644
+ attachments: {
1645
+ name: string;
1646
+ contentType: string;
1647
+ size: number;
1648
+ fileId: string;
1649
+ contentId: string | null;
1650
+ isInline: boolean;
1651
+ }[];
1652
+ flags: {
1653
+ draft: boolean;
1654
+ seen: boolean;
1655
+ answered: boolean;
1656
+ starred: boolean;
1657
+ forwarded: boolean;
1658
+ pinned: boolean;
1659
+ };
1660
+ highlights: {
1661
+ value: string;
1662
+ type: string;
1663
+ label: string;
1664
+ }[];
1665
+ encrypted: boolean;
1666
+ spamScore: number | null;
1667
+ spamAction: string | null;
1668
+ inReplyTo: string | null;
1669
+ references: string[];
1670
+ aliasTag: string | null;
1671
+ snoozedUntil: string | null;
1672
+ snoozedFromMailbox: string | null;
1673
+ scheduledAt: string | null;
1674
+ readReceiptRequested: boolean;
1675
+ readReceiptSent: boolean;
1676
+ draftRevision: number;
1677
+ card?: {
1678
+ type: "event" | "purchase" | "trip" | "bill" | "package";
1679
+ data: Record<string, unknown> | null;
1680
+ confidence: number | null;
1681
+ extractedAt: string | null;
1682
+ } | undefined;
1683
+ headers?: Record<string, string> | undefined;
1684
+ text?: string | null | undefined;
1685
+ replyTo?: {
1686
+ name: string;
1687
+ address: string;
1688
+ } | undefined;
1689
+ html?: string | null | undefined;
1690
+ senderAvatarPath?: string | null | undefined;
1691
+ threadCount?: number | undefined;
1692
+ threadParticipants?: string[] | undefined;
1693
+ }[];
1694
+ bundles: {
1695
+ messages: {
1696
+ date: string;
1697
+ id: string;
1698
+ createdAt: string;
1699
+ updatedAt: string;
1700
+ subject: string;
1701
+ userId: string;
1702
+ _id: string;
1703
+ mailboxId: string;
1704
+ messageId: string;
1705
+ from: {
1706
+ name: string;
1707
+ address: string;
1708
+ };
1709
+ receivedAt: string;
1710
+ size: number;
1711
+ labels: string[];
1712
+ to: {
1713
+ name: string;
1714
+ address: string;
1715
+ }[];
1716
+ threadId: string;
1717
+ cc: {
1718
+ name: string;
1719
+ address: string;
1720
+ }[];
1721
+ bcc: {
1722
+ name: string;
1723
+ address: string;
1724
+ }[];
1725
+ attachments: {
1726
+ name: string;
1727
+ contentType: string;
1728
+ size: number;
1729
+ fileId: string;
1730
+ contentId: string | null;
1731
+ isInline: boolean;
1732
+ }[];
1733
+ flags: {
1734
+ draft: boolean;
1735
+ seen: boolean;
1736
+ answered: boolean;
1737
+ starred: boolean;
1738
+ forwarded: boolean;
1739
+ pinned: boolean;
1740
+ };
1741
+ highlights: {
1742
+ value: string;
1743
+ type: string;
1744
+ label: string;
1745
+ }[];
1746
+ encrypted: boolean;
1747
+ spamScore: number | null;
1748
+ spamAction: string | null;
1749
+ inReplyTo: string | null;
1750
+ references: string[];
1751
+ aliasTag: string | null;
1752
+ snoozedUntil: string | null;
1753
+ snoozedFromMailbox: string | null;
1754
+ scheduledAt: string | null;
1755
+ readReceiptRequested: boolean;
1756
+ readReceiptSent: boolean;
1757
+ draftRevision: number;
1758
+ card?: {
1759
+ type: "event" | "purchase" | "trip" | "bill" | "package";
1760
+ data: Record<string, unknown> | null;
1761
+ confidence: number | null;
1762
+ extractedAt: string | null;
1763
+ } | undefined;
1764
+ headers?: Record<string, string> | undefined;
1765
+ text?: string | null | undefined;
1766
+ replyTo?: {
1767
+ name: string;
1768
+ address: string;
1769
+ } | undefined;
1770
+ html?: string | null | undefined;
1771
+ senderAvatarPath?: string | null | undefined;
1772
+ threadCount?: number | undefined;
1773
+ threadParticipants?: string[] | undefined;
1774
+ }[];
1775
+ bundle: {
1776
+ name: string;
1777
+ color: string;
1778
+ id: string;
1779
+ createdAt: string;
1780
+ updatedAt: string;
1781
+ enabled: boolean;
1782
+ userId: string;
1783
+ _id: string;
1784
+ icon: string;
1785
+ order: number;
1786
+ matchLabels: string[];
1787
+ collapsed: boolean;
1788
+ };
1789
+ unreadCount: number;
1790
+ }[];
1791
+ }, {
1792
+ total: number;
1793
+ primary: {
1794
+ date: string;
1795
+ id: string;
1796
+ createdAt: string;
1797
+ updatedAt: string;
1798
+ subject: string;
1799
+ userId: string;
1800
+ _id: string;
1801
+ mailboxId: string;
1802
+ messageId: string;
1803
+ from: {
1804
+ name: string;
1805
+ address: string;
1806
+ };
1807
+ receivedAt: string;
1808
+ size: number;
1809
+ labels: string[];
1810
+ to: {
1811
+ name: string;
1812
+ address: string;
1813
+ }[];
1814
+ threadId: string;
1815
+ cc: {
1816
+ name: string;
1817
+ address: string;
1818
+ }[];
1819
+ bcc: {
1820
+ name: string;
1821
+ address: string;
1822
+ }[];
1823
+ attachments: {
1824
+ name: string;
1825
+ contentType: string;
1826
+ size: number;
1827
+ fileId: string;
1828
+ contentId: string | null;
1829
+ isInline: boolean;
1830
+ }[];
1831
+ flags: {
1832
+ draft: boolean;
1833
+ seen: boolean;
1834
+ answered: boolean;
1835
+ starred: boolean;
1836
+ forwarded: boolean;
1837
+ pinned: boolean;
1838
+ };
1839
+ highlights: {
1840
+ value: string;
1841
+ type: string;
1842
+ label: string;
1843
+ }[];
1844
+ encrypted: boolean;
1845
+ spamScore: number | null;
1846
+ spamAction: string | null;
1847
+ inReplyTo: string | null;
1848
+ references: string[];
1849
+ aliasTag: string | null;
1850
+ snoozedUntil: string | null;
1851
+ snoozedFromMailbox: string | null;
1852
+ scheduledAt: string | null;
1853
+ readReceiptRequested: boolean;
1854
+ readReceiptSent: boolean;
1855
+ draftRevision: number;
1856
+ card?: {
1857
+ type: "event" | "purchase" | "trip" | "bill" | "package";
1858
+ data: Record<string, unknown> | null;
1859
+ confidence: number | null;
1860
+ extractedAt: string | null;
1861
+ } | undefined;
1862
+ headers?: Record<string, string> | undefined;
1863
+ text?: string | null | undefined;
1864
+ replyTo?: {
1865
+ name: string;
1866
+ address: string;
1867
+ } | undefined;
1868
+ html?: string | null | undefined;
1869
+ senderAvatarPath?: string | null | undefined;
1870
+ threadCount?: number | undefined;
1871
+ threadParticipants?: string[] | undefined;
1872
+ }[];
1873
+ bundles: {
1874
+ messages: {
1875
+ date: string;
1876
+ id: string;
1877
+ createdAt: string;
1878
+ updatedAt: string;
1879
+ subject: string;
1880
+ userId: string;
1881
+ _id: string;
1882
+ mailboxId: string;
1883
+ messageId: string;
1884
+ from: {
1885
+ name: string;
1886
+ address: string;
1887
+ };
1888
+ receivedAt: string;
1889
+ size: number;
1890
+ labels: string[];
1891
+ to: {
1892
+ name: string;
1893
+ address: string;
1894
+ }[];
1895
+ threadId: string;
1896
+ cc: {
1897
+ name: string;
1898
+ address: string;
1899
+ }[];
1900
+ bcc: {
1901
+ name: string;
1902
+ address: string;
1903
+ }[];
1904
+ attachments: {
1905
+ name: string;
1906
+ contentType: string;
1907
+ size: number;
1908
+ fileId: string;
1909
+ contentId: string | null;
1910
+ isInline: boolean;
1911
+ }[];
1912
+ flags: {
1913
+ draft: boolean;
1914
+ seen: boolean;
1915
+ answered: boolean;
1916
+ starred: boolean;
1917
+ forwarded: boolean;
1918
+ pinned: boolean;
1919
+ };
1920
+ highlights: {
1921
+ value: string;
1922
+ type: string;
1923
+ label: string;
1924
+ }[];
1925
+ encrypted: boolean;
1926
+ spamScore: number | null;
1927
+ spamAction: string | null;
1928
+ inReplyTo: string | null;
1929
+ references: string[];
1930
+ aliasTag: string | null;
1931
+ snoozedUntil: string | null;
1932
+ snoozedFromMailbox: string | null;
1933
+ scheduledAt: string | null;
1934
+ readReceiptRequested: boolean;
1935
+ readReceiptSent: boolean;
1936
+ draftRevision: number;
1937
+ card?: {
1938
+ type: "event" | "purchase" | "trip" | "bill" | "package";
1939
+ data: Record<string, unknown> | null;
1940
+ confidence: number | null;
1941
+ extractedAt: string | null;
1942
+ } | undefined;
1943
+ headers?: Record<string, string> | undefined;
1944
+ text?: string | null | undefined;
1945
+ replyTo?: {
1946
+ name: string;
1947
+ address: string;
1948
+ } | undefined;
1949
+ html?: string | null | undefined;
1950
+ senderAvatarPath?: string | null | undefined;
1951
+ threadCount?: number | undefined;
1952
+ threadParticipants?: string[] | undefined;
1953
+ }[];
1954
+ bundle: {
1955
+ name: string;
1956
+ color: string;
1957
+ id: string;
1958
+ createdAt: string;
1959
+ updatedAt: string;
1960
+ enabled: boolean;
1961
+ userId: string;
1962
+ _id: string;
1963
+ icon: string;
1964
+ order: number;
1965
+ matchLabels: string[];
1966
+ collapsed: boolean;
1967
+ };
1968
+ unreadCount: number;
1969
+ }[];
1970
+ }>;
1971
+ export type EmailBundledInboxWire = z.infer<typeof emailBundledInboxSchema>;
1972
+ /** An address-book entry. `company` and `notes` are `null` when unset. */
1973
+ export declare const emailContactSchema: z.ZodObject<{
1974
+ _id: z.ZodString;
1975
+ id: z.ZodString;
1976
+ userId: z.ZodString;
1977
+ name: z.ZodString;
1978
+ email: z.ZodString;
1979
+ company: z.ZodNullable<z.ZodString>;
1980
+ notes: z.ZodNullable<z.ZodString>;
1981
+ starred: z.ZodBoolean;
1982
+ autoCollected: z.ZodBoolean;
1983
+ lastContactedAt: z.ZodNullable<z.ZodString>;
1984
+ createdAt: z.ZodString;
1985
+ updatedAt: z.ZodString;
1986
+ }, "strip", z.ZodTypeAny, {
1987
+ email: string;
1988
+ name: string;
1989
+ id: string;
1990
+ createdAt: string;
1991
+ updatedAt: string;
1992
+ userId: string;
1993
+ _id: string;
1994
+ starred: boolean;
1995
+ company: string | null;
1996
+ notes: string | null;
1997
+ autoCollected: boolean;
1998
+ lastContactedAt: string | null;
1999
+ }, {
2000
+ email: string;
2001
+ name: string;
2002
+ id: string;
2003
+ createdAt: string;
2004
+ updatedAt: string;
2005
+ userId: string;
2006
+ _id: string;
2007
+ starred: boolean;
2008
+ company: string | null;
2009
+ notes: string | null;
2010
+ autoCollected: boolean;
2011
+ lastContactedAt: string | null;
2012
+ }>;
2013
+ export type EmailContactWire = z.infer<typeof emailContactSchema>;
2014
+ /**
2015
+ * One durable outbound delivery. `terminal` means no further attempt will
2016
+ * happen on its own — present that differently from "still trying".
2017
+ */
2018
+ export declare const emailOutboxSchema: z.ZodObject<{
2019
+ id: z.ZodString;
2020
+ messageId: z.ZodString;
2021
+ status: z.ZodEnum<["pending", "processing", "sent", "failed", "cancelled"]>;
2022
+ attempts: z.ZodNumber;
2023
+ maxAttempts: z.ZodNumber;
2024
+ terminal: z.ZodBoolean;
2025
+ nextAttemptAt: z.ZodString;
2026
+ lastError: z.ZodNullable<z.ZodString>;
2027
+ sentAt: z.ZodNullable<z.ZodString>;
2028
+ createdAt: z.ZodString;
2029
+ updatedAt: z.ZodString;
2030
+ }, "strip", z.ZodTypeAny, {
2031
+ status: "failed" | "pending" | "cancelled" | "sent" | "processing";
2032
+ id: string;
2033
+ createdAt: string;
2034
+ updatedAt: string;
2035
+ messageId: string;
2036
+ attempts: number;
2037
+ maxAttempts: number;
2038
+ terminal: boolean;
2039
+ nextAttemptAt: string;
2040
+ lastError: string | null;
2041
+ sentAt: string | null;
2042
+ }, {
2043
+ status: "failed" | "pending" | "cancelled" | "sent" | "processing";
2044
+ id: string;
2045
+ createdAt: string;
2046
+ updatedAt: string;
2047
+ messageId: string;
2048
+ attempts: number;
2049
+ maxAttempts: number;
2050
+ terminal: boolean;
2051
+ nextAttemptAt: string;
2052
+ lastError: string | null;
2053
+ sentAt: string | null;
2054
+ }>;
2055
+ export type EmailOutboxWire = z.infer<typeof emailOutboxSchema>;
2056
+ /**
2057
+ * One RFC 5322 `msg-id`: `<left@right>`, no whitespace, no nested brackets.
2058
+ *
2059
+ * `In-Reply-To` and `References` carry these and nothing else. A reply that
2060
+ * names a database row id instead (`01a0…` or `<01a0…>`) breaks threading for
2061
+ * every recipient — it happened, which is why it is refused at the edge.
2062
+ */
2063
+ export declare const RFC_MESSAGE_ID_PATTERN: RegExp;
2064
+ export declare const rfcMessageIdSchema: z.ZodString;