@remit/api-http-client 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/types.gen.ts ADDED
@@ -0,0 +1,3245 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ export type ClientOptions = {
4
+ baseUrl: 'https://api.remit.example.com' | (string & {});
5
+ };
6
+
7
+ /**
8
+ * API error response
9
+ */
10
+ export type ApiError = {
11
+ /**
12
+ * Error code
13
+ */
14
+ code: string;
15
+ /**
16
+ * Human-readable error message
17
+ */
18
+ message: string;
19
+ /**
20
+ * Additional error details
21
+ */
22
+ details?: {
23
+ [key: string]: string;
24
+ };
25
+ };
26
+
27
+ export type MicrosoftOAuthStartRequest = {
28
+ /**
29
+ * Optional email hint for the Microsoft login page
30
+ */
31
+ email?: string;
32
+ };
33
+
34
+ export type MicrosoftOAuthStartResponse = {
35
+ /**
36
+ * The Microsoft authorization URL to redirect the user to
37
+ */
38
+ authorizationUrl: string;
39
+ };
40
+
41
+ /**
42
+ * Authentication mechanism used by an email account
43
+ */
44
+ export type RemitImapAccountAuthType = 'password' | 'oauthMicrosoft';
45
+
46
+ /**
47
+ * Account configuration response
48
+ */
49
+ export type RemitImapAccountConfigResponse = {
50
+ /**
51
+ * Primary identifier
52
+ */
53
+ accountConfigId: Uuid;
54
+ /**
55
+ * Reference to owning user (typically stored externally)
56
+ */
57
+ userId: Uuid;
58
+ /**
59
+ * Display name for this configuration
60
+ */
61
+ readonly name?: string;
62
+ /**
63
+ * Lifecycle state of this account configuration
64
+ */
65
+ state: RemitImapAccountConfigState;
66
+ /**
67
+ * Timestamp when deletion was requested (tombstone)
68
+ */
69
+ readonly deletedAt?: number;
70
+ /**
71
+ * Timestamp when cascading cleanup started (idempotency fence)
72
+ */
73
+ readonly cascadeStartedAt?: number;
74
+ readonly createdAt: number;
75
+ readonly updatedAt: number;
76
+ };
77
+
78
+ /**
79
+ * Lifecycle state of an account configuration
80
+ */
81
+ export type RemitImapAccountConfigState = 'active' | 'deleting';
82
+
83
+ /**
84
+ * Response body for GET /me/export/{exportId}
85
+ */
86
+ export type RemitImapAccountExportRequestResponse = {
87
+ /**
88
+ * Primary identifier
89
+ */
90
+ accountExportRequestId: Uuid;
91
+ /**
92
+ * Owning account config
93
+ */
94
+ accountConfigId: Uuid;
95
+ /**
96
+ * Cognito user id of the requesting user
97
+ */
98
+ readonly userId: string;
99
+ /**
100
+ * Current lifecycle state of the export
101
+ */
102
+ state: RemitImapAccountExportState;
103
+ /**
104
+ * Epoch millis when the request was created
105
+ */
106
+ readonly createdAt: number;
107
+ /**
108
+ * Epoch millis when the request was last updated
109
+ */
110
+ readonly updatedAt: number;
111
+ /**
112
+ * Epoch millis after which the stored archive is reclaimed by its lifecycle policy
113
+ */
114
+ readonly expiresAt?: number;
115
+ /**
116
+ * S3 object key of the ZIP archive; present only when state is Ready. The download URL is signed on demand at read time and never stored.
117
+ */
118
+ readonly objectKey?: string;
119
+ /**
120
+ * Short-lived presigned S3 URL to download the ZIP archive, signed on demand at read time; present only when state is Ready
121
+ */
122
+ readonly downloadUrl?: string;
123
+ /**
124
+ * Human-readable error message; present only when state is Failed
125
+ */
126
+ readonly errorMessage?: string;
127
+ };
128
+
129
+ /**
130
+ * Lifecycle state of an account export request
131
+ */
132
+ export type RemitImapAccountExportState = 'Pending' | 'Processing' | 'Ready' | 'Failed';
133
+
134
+ /**
135
+ * Account response (excluding sensitive fields). Display name, mute flag, and signatures are sourced from per-account AccountSetting rows (RFC 032), not the Account entity, but are surfaced here so the response shape is unchanged.
136
+ */
137
+ export type RemitImapAccountResponse = {
138
+ /**
139
+ * Primary identifier
140
+ */
141
+ accountId: Uuid;
142
+ /**
143
+ * Reference to parent account configuration
144
+ */
145
+ accountConfigId: Uuid;
146
+ /**
147
+ * Login username
148
+ */
149
+ readonly username: string;
150
+ /**
151
+ * Primary email address
152
+ */
153
+ readonly email: string;
154
+ /**
155
+ * Authentication mechanism used by this account
156
+ */
157
+ authType: RemitImapAccountAuthType;
158
+ /**
159
+ * IMAP server hostname or IP address
160
+ */
161
+ readonly imapHost: string;
162
+ /**
163
+ * IMAP server port (typically 993 for TLS, 143 for STARTTLS)
164
+ */
165
+ readonly imapPort: number;
166
+ /**
167
+ * Whether to use TLS/SSL encryption (true for port 993)
168
+ */
169
+ readonly imapTls: boolean;
170
+ /**
171
+ * Whether to use STARTTLS upgrade (typically for port 143)
172
+ */
173
+ readonly imapStartTls: boolean;
174
+ /**
175
+ * Whether this account is configured to send mail over SMTP. The explicit marker for sending capability — never inferred from config-field presence.
176
+ */
177
+ readonly smtpEnabled: boolean;
178
+ /**
179
+ * SMTP server hostname or IP address for sending mail
180
+ */
181
+ readonly smtpHost: string;
182
+ /**
183
+ * SMTP server port (typically 587 for STARTTLS, 465 for TLS)
184
+ */
185
+ readonly smtpPort: number;
186
+ /**
187
+ * Whether to use TLS/SSL encryption for SMTP
188
+ */
189
+ readonly smtpTls: boolean;
190
+ /**
191
+ * Whether to use STARTTLS upgrade for SMTP
192
+ */
193
+ readonly smtpStartTls: boolean;
194
+ /**
195
+ * SMTP login username (may differ from IMAP username); empty when sending uses the IMAP username
196
+ */
197
+ readonly smtpUsername: string;
198
+ /**
199
+ * Whether the account is active and can login
200
+ */
201
+ readonly isActive: boolean;
202
+ /**
203
+ * Current connection state
204
+ */
205
+ connectionState: RemitImapConnectionState;
206
+ /**
207
+ * Timestamp of last successful connection
208
+ */
209
+ readonly lastConnectedAt?: number;
210
+ /**
211
+ * Timestamp of last synchronization attempt
212
+ */
213
+ readonly lastSyncAt?: number;
214
+ /**
215
+ * Error message from last failed connection attempt
216
+ */
217
+ readonly lastError?: string;
218
+ /**
219
+ * Current phase of the initial account sync lifecycle
220
+ */
221
+ syncPhase?: RemitImapSyncPhase;
222
+ /**
223
+ * Total number of mailboxes discovered during sync
224
+ */
225
+ readonly mailboxCountTotal?: number;
226
+ /**
227
+ * Number of mailboxes whose initial message sync has completed
228
+ */
229
+ readonly mailboxCountSynced?: number;
230
+ readonly createdAt: number;
231
+ readonly updatedAt: number;
232
+ /**
233
+ * User-chosen display name for this account. Optional; when absent the UI derives a label from the email address. Sourced from a per-account AccountSetting row (RFC 032).
234
+ */
235
+ displayName?: string;
236
+ /**
237
+ * Account-level mute flag. When set, all mailboxes of this account are hidden from unified/brief views (sync is unaffected). Sourced from a per-account AccountSetting row (RFC 032).
238
+ */
239
+ muted?: RemitImapMutedFlag;
240
+ /**
241
+ * Plain text email signature for this account
242
+ */
243
+ signaturePlainText?: string;
244
+ /**
245
+ * HTML email signature for this account
246
+ */
247
+ signatureHtml?: string;
248
+ /**
249
+ * Per-account appointment of each canonical role (Inbox, Drafts, Sent, Archive, Junk, Trash, All, Flagged) to at most one mailbox (RFC 032 exclusive-folder-appointment, issue #976). Always carries one entry per CanonicalMailboxRole member; an entry's `mailboxId` is a persisted user choice when set, or a server-proposed detection result when the user hasn't appointed that role yet. Write with PUT /accounts/{accountId}/folder-roles/{role}.
250
+ */
251
+ folderAppointments: Array<RemitImapFolderAppointment>;
252
+ };
253
+
254
+ /**
255
+ * Aggregate sync-status response for an account
256
+ */
257
+ export type RemitImapAccountSyncStatusResponse = {
258
+ /**
259
+ * Account identifier
260
+ */
261
+ accountId: Uuid;
262
+ /**
263
+ * Current sync phase for the account
264
+ */
265
+ syncPhase?: RemitImapSyncPhase;
266
+ /**
267
+ * Total number of mailboxes discovered
268
+ */
269
+ mailboxCountTotal?: number;
270
+ /**
271
+ * Number of mailboxes whose initial message sync has completed
272
+ */
273
+ mailboxCountSynced?: number;
274
+ /**
275
+ * Per-mailbox sync progress
276
+ */
277
+ mailboxes: Array<RemitImapMailboxSyncProgress>;
278
+ };
279
+
280
+ /**
281
+ * Common metadata for sender-level flags
282
+ */
283
+ export type RemitImapAddressFlagBase = {
284
+ /**
285
+ * Timestamp when the flag was set
286
+ */
287
+ setAt: number;
288
+ /**
289
+ * Device/session/user identifier that set the flag (audit trail)
290
+ */
291
+ setBy?: string;
292
+ /**
293
+ * Optional auto-revoke timestamp
294
+ */
295
+ expiresAt?: number;
296
+ /**
297
+ * Free-text user note
298
+ */
299
+ reason?: string;
300
+ };
301
+
302
+ /**
303
+ * Common metadata for sender-level flags
304
+ */
305
+ export type RemitImapAddressFlagBaseUpdate = {
306
+ /**
307
+ * Timestamp when the flag was set
308
+ */
309
+ setAt?: number;
310
+ /**
311
+ * Device/session/user identifier that set the flag (audit trail)
312
+ */
313
+ setBy?: string;
314
+ /**
315
+ * Optional auto-revoke timestamp
316
+ */
317
+ expiresAt?: number;
318
+ /**
319
+ * Free-text user note
320
+ */
321
+ reason?: string;
322
+ };
323
+
324
+ /**
325
+ * Sender-level flags map. Absent keys mean absent flags (sparse).
326
+ */
327
+ export type RemitImapAddressFlags = {
328
+ trusted?: RemitImapTrustedFlag;
329
+ blocked?: RemitImapBlockedFlag;
330
+ muted?: RemitImapMutedFlag;
331
+ vip?: RemitImapVipFlag;
332
+ wellknown?: RemitImapWellknownFlag;
333
+ category?: RemitImapCategoryFlag;
334
+ autoArchive?: RemitImapAutoArchiveFlag;
335
+ unsubscribed?: RemitImapUnsubscribedFlag;
336
+ };
337
+
338
+ /**
339
+ * Address response for address book entries
340
+ */
341
+ export type RemitImapAddressResponse = {
342
+ /**
343
+ * Primary identifier
344
+ */
345
+ addressId: Uuid;
346
+ /**
347
+ * Reference to parent account configuration
348
+ */
349
+ accountConfigId: Uuid;
350
+ /**
351
+ * Personal name phrase (display-name in RFC 2822)
352
+ */
353
+ readonly displayName?: string;
354
+ /**
355
+ * Local-part before @ (addr-mailbox)
356
+ */
357
+ readonly localPart: string;
358
+ /**
359
+ * Domain after @ (addr-host)
360
+ */
361
+ readonly domain: string;
362
+ /**
363
+ * Lowercase full email address for matching/deduplication
364
+ */
365
+ readonly normalizedEmail: string;
366
+ /**
367
+ * Sender-level flags (trust/block/mute/etc). Always present; an empty map means no flags are set. Individual flag keys remain sparse — a key's presence means that flag is set.
368
+ */
369
+ flags: RemitImapAddressFlags;
370
+ /**
371
+ * Number of inbound messages received from this address. Defaults to zero.
372
+ */
373
+ readonly inboundCount: number;
374
+ /**
375
+ * Number of outbound messages sent to this address. Defaults to zero.
376
+ */
377
+ readonly outboundCount: number;
378
+ /**
379
+ * Number of user replies to messages from this address. Defaults to zero.
380
+ */
381
+ readonly replyCount: number;
382
+ /**
383
+ * Timestamp (ms epoch) of the last inbound message from this address. Zero means never.
384
+ */
385
+ readonly lastInboundAt: number;
386
+ /**
387
+ * Timestamp (ms epoch) of the last user reply to a message from this address. Zero means never.
388
+ */
389
+ readonly lastReplyAt: number;
390
+ readonly createdAt: number;
391
+ readonly updatedAt: number;
392
+ };
393
+
394
+ /**
395
+ * Address roles in message headers per RFC 2822 Sections 3.6.2 and 3.6.3
396
+ */
397
+ export type RemitImapAddressRole = 'from' | 'sender' | 'reply_to' | 'to' | 'cc' | 'bcc';
398
+
399
+ /**
400
+ * Input for PUT /accounts/{accountId}/folder-roles/{role}. Appoints the mailbox to the role, replacing whichever mailbox previously held it (exclusive by construction — the map has one slot per role). Pass `mailboxId: null` to clear the role back to unfilled.
401
+ */
402
+ export type RemitImapAppointFolderRoleInput = {
403
+ /**
404
+ * Mailbox to appoint to the role, or `null` to clear the appointment. Typed as an inline nullable string rather than `UUID | null`: a named scalar union renders as allOf + nullable with no sibling type, which openapi-backend's AJV rejects for a `null` value — the same gotcha documented on RenameMailboxInput.displayNameOverride. An inline string keeps `null` valid at the wire; the handler validates the value as a UUID.
405
+ */
406
+ mailboxId: string | null;
407
+ };
408
+
409
+ /**
410
+ * Auto-archive: skip inbox, file directly
411
+ */
412
+ export type RemitImapAutoArchiveFlag = RemitImapAddressFlagBase & {
413
+ value: boolean;
414
+ };
415
+
416
+ /**
417
+ * Auto-archive: skip inbox, file directly
418
+ */
419
+ export type RemitImapAutoArchiveFlagUpdate = RemitImapAddressFlagBaseUpdate & {
420
+ value?: boolean;
421
+ };
422
+
423
+ /**
424
+ * Present only when Remit auto-moved this message on body-sync (a confident, non-dry-run move). Absent means the message was not auto-moved by Remit — clients treat absence as no indicator.
425
+ */
426
+ export type RemitImapAutoMovedInfo = {
427
+ /**
428
+ * Direction Remit moved the message: MoveToInbox | MoveToJunk. The implied destination lets the client tell whether the move is still in effect.
429
+ */
430
+ action: RemitImapPlacementAction;
431
+ /**
432
+ * Folder role the message was moved from: inbox | junk | other. Used to render "moved from Junk" and to resolve the undo target client-side via MailboxRole.
433
+ */
434
+ fromPlacement: string;
435
+ };
436
+
437
+ /**
438
+ * Sender is blocked: never load images, even on explicit click
439
+ */
440
+ export type RemitImapBlockedFlag = RemitImapAddressFlagBase & {
441
+ value: boolean;
442
+ };
443
+
444
+ /**
445
+ * Sender is blocked: never load images, even on explicit click
446
+ */
447
+ export type RemitImapBlockedFlagUpdate = RemitImapAddressFlagBaseUpdate & {
448
+ value?: boolean;
449
+ };
450
+
451
+ /**
452
+ * Body part information
453
+ */
454
+ export type RemitImapBodyPartResponse = {
455
+ /**
456
+ * Primary identifier
457
+ */
458
+ bodyPartId: Uuid;
459
+ /**
460
+ * MIME type (TEXT, IMAGE, APPLICATION, etc.)
461
+ */
462
+ mediaType: RemitImapMediaType;
463
+ /**
464
+ * MIME subtype (PLAIN, HTML, PNG, PDF, etc.)
465
+ */
466
+ readonly mediaSubtype: string;
467
+ /**
468
+ * Content-ID header value
469
+ */
470
+ readonly contentId?: string;
471
+ /**
472
+ * Encoded size in octets
473
+ */
474
+ readonly sizeOctets: number;
475
+ /**
476
+ * Content disposition (inline or attachment)
477
+ */
478
+ disposition?: RemitImapContentDisposition;
479
+ /**
480
+ * Filename from Content-Disposition
481
+ */
482
+ readonly dispositionFilename?: string;
483
+ /**
484
+ * True if this is a multipart container
485
+ */
486
+ readonly isMultipart: boolean;
487
+ /**
488
+ * CloudFront-fronted URL for fetching this body part. Cookie-authenticated via Cognito id_token. Path: /content/accounts/{accountConfigId}/{accountId}/messages/{messageId}/parts/{partPath}. Required: handlers must throw rather than emit a placeholder when CONTENT_DELIVERY_DOMAIN is unset.
489
+ */
490
+ contentUrl: string;
491
+ };
492
+
493
+ /**
494
+ * Input for bulk flag update operations
495
+ */
496
+ export type RemitImapBulkUpdateFlagsInput = {
497
+ /**
498
+ * List of message IDs to update
499
+ */
500
+ messageIds: Array<Uuid>;
501
+ /**
502
+ * Set messages as read (maps to \Seen flag)
503
+ */
504
+ isRead?: boolean;
505
+ /**
506
+ * Set messages as starred (maps to \Flagged flag)
507
+ */
508
+ isStarred?: boolean;
509
+ /**
510
+ * Star color for visual categorization
511
+ */
512
+ starColor?: RemitImapStarColor;
513
+ };
514
+
515
+ /**
516
+ * The fixed anchor set of canonical mailbox roles a user appoints to a folder (RFC 032 exclusive-folder-appointment, issue #976). Mirrors the IMAP SPECIAL-USE roles (RFC 6154). Each role resolves to at most one mailbox per account — see FolderAppointment.
517
+ */
518
+ export type RemitImapCanonicalMailboxRole = 'Inbox' | 'Drafts' | 'Sent' | 'Archive' | 'Junk' | 'Trash' | 'All' | 'Flagged';
519
+
520
+ /**
521
+ * Category override for auto-classification
522
+ */
523
+ export type RemitImapCategoryFlag = RemitImapAddressFlagBase & {
524
+ value: RemitImapMessageCategory;
525
+ };
526
+
527
+ /**
528
+ * Category override for auto-classification
529
+ */
530
+ export type RemitImapCategoryFlagUpdate = RemitImapAddressFlagBaseUpdate & {
531
+ value?: RemitImapMessageCategory;
532
+ };
533
+
534
+ /**
535
+ * Full configuration description including accounts
536
+ */
537
+ export type RemitImapConfigDescriptionResponse = {
538
+ /**
539
+ * The account configuration
540
+ */
541
+ accountConfig: RemitImapAccountConfigResponse;
542
+ /**
543
+ * Associated email accounts
544
+ */
545
+ accounts: Array<RemitImapAccountResponse>;
546
+ };
547
+
548
+ /**
549
+ * IMAP connection states per RFC 9051 Section 3
550
+ */
551
+ export type RemitImapConnectionState = 'not_authenticated' | 'authenticated' | 'selected' | 'logout' | 'reauth_required';
552
+
553
+ /**
554
+ * Content disposition types per RFC 2183
555
+ */
556
+ export type RemitImapContentDisposition = 'inline' | 'attachment';
557
+
558
+ /**
559
+ * Input for copying messages to another mailbox
560
+ */
561
+ export type RemitImapCopyMessagesInput = {
562
+ /**
563
+ * List of message IDs to copy
564
+ */
565
+ messageIds: Array<Uuid>;
566
+ /**
567
+ * Destination mailbox ID
568
+ */
569
+ destinationMailboxId: Uuid;
570
+ };
571
+
572
+ /**
573
+ * Input for creating a new email account
574
+ */
575
+ export type RemitImapCreateAccountInput = {
576
+ /**
577
+ * Primary email address for this account
578
+ */
579
+ email: string;
580
+ /**
581
+ * Display name (optional)
582
+ */
583
+ displayName?: string;
584
+ /**
585
+ * IMAP login username (defaults to email if not provided)
586
+ */
587
+ username?: string;
588
+ /**
589
+ * Authentication mechanism for this account. Defaults to `password`. Pass `oauthMicrosoft` only via the OAuth connect flow (POST /accounts/oauth/microsoft/start).
590
+ */
591
+ authType?: RemitImapAccountAuthType;
592
+ /**
593
+ * Account password (will be encrypted). Required for password accounts; omit for OAuth accounts.
594
+ */
595
+ password?: string;
596
+ /**
597
+ * IMAP server hostname
598
+ */
599
+ imapHost: string;
600
+ /**
601
+ * IMAP server port
602
+ */
603
+ imapPort: number;
604
+ /**
605
+ * Use TLS encryption
606
+ */
607
+ imapTls: boolean;
608
+ /**
609
+ * Use STARTTLS upgrade
610
+ */
611
+ imapStartTls: boolean;
612
+ /**
613
+ * Whether to enable SMTP sending for this account. When omitted, the server enables sending if an SMTP host is supplied.
614
+ */
615
+ smtpEnabled?: boolean;
616
+ /**
617
+ * SMTP server hostname (optional)
618
+ */
619
+ smtpHost?: string;
620
+ /**
621
+ * SMTP server port
622
+ */
623
+ smtpPort?: number;
624
+ /**
625
+ * Use TLS encryption for SMTP
626
+ */
627
+ smtpTls?: boolean;
628
+ /**
629
+ * Use STARTTLS upgrade for SMTP
630
+ */
631
+ smtpStartTls?: boolean;
632
+ /**
633
+ * SMTP username if different from IMAP
634
+ */
635
+ smtpUsername?: string;
636
+ /**
637
+ * SMTP password if different from IMAP
638
+ */
639
+ smtpPassword?: string;
640
+ };
641
+
642
+ /**
643
+ * Response body for POST /me/export
644
+ */
645
+ export type RemitImapCreateExportResponse = {
646
+ /**
647
+ * ID of the newly created export request
648
+ */
649
+ exportId: string;
650
+ };
651
+
652
+ /**
653
+ * Input for creating a filter (RFC 034). `ttl` is omitted — it is derived
654
+ * server-side from `expiresAt` when `scope` is `Temporary` (RFC 034 Decision
655
+ * 1.3), never client-supplied. `state`, `hasAnchor`, `ruleChangedAt`, and
656
+ * `filterId` are all server-derived and excluded by their Read-only visibility.
657
+ *
658
+ * When `anchorMessageId` is set, the server builds and persists the filter's
659
+ * semantic anchor from that message's indexed vectors (RFC 034 Decision 2) and
660
+ * sets `hasAnchor`. Absent for a purely-literal filter.
661
+ */
662
+ export type RemitImapCreateFilterInput = {
663
+ /**
664
+ * Plain-language name or editable label for this filter
665
+ */
666
+ name: String256;
667
+ /**
668
+ * Standing (permanent) or Temporary (expires). Governs whether expiresAt/ttl are present (RFC 034 Decision 1).
669
+ */
670
+ scope: RemitImapFilterScope;
671
+ /**
672
+ * ISO 8601 date-time with zone offset, present only when scope is Temporary (RFC 034 Decision 1.1) — a business date, not an epoch instant. Every evaluation compares `now` against this value directly; it is the source of truth for whether a Temporary filter is still active, independent of `state` or row existence.
673
+ */
674
+ expiresAt?: string;
675
+ /**
676
+ * How literalClauses combine. Meaningless when literalClauses is empty.
677
+ */
678
+ matchOperator: RemitImapFilterMatchOperator;
679
+ /**
680
+ * Literal from/subject/has-words predicate clauses (RFC 031). Empty when the filter relies solely on its semantic anchor (see hasAnchor).
681
+ */
682
+ literalClauses: Array<RemitImapFilterClause>;
683
+ /**
684
+ * Label applied when this filter matches — additive action, any number of filters can independently apply their own label (RFC 034 Decision 3.1). The named sentinel `"None"` means no label action; never an empty/optional field.
685
+ */
686
+ actionLabelId: string;
687
+ /**
688
+ * Mailbox matched messages are moved into — exclusive action, since a message lives in exactly one mailbox (RFC 034 Decision 3.1). On conflict between filters, the one with the latest ruleChangedAt wins. `"None"` means no move action.
689
+ */
690
+ actionMailboxId: string;
691
+ /**
692
+ * Anchor message for a semantic filter — provenance for the persisted anchor the server builds at save time (RFC 034 Decision 2.1). Absent for a purely-literal filter.
693
+ */
694
+ anchorMessageId?: Uuid;
695
+ };
696
+
697
+ /**
698
+ * Input for creating a new mailbox
699
+ */
700
+ export type RemitImapCreateMailboxInput = {
701
+ /**
702
+ * Namespace type: personal, other_users, or shared
703
+ */
704
+ namespaceType: RemitImapNamespaceType;
705
+ /**
706
+ * Complete mailbox path including hierarchy
707
+ */
708
+ fullPath: String512;
709
+ };
710
+
711
+ /**
712
+ * Response body for POST /accounts/{accountId}/organize
713
+ */
714
+ export type RemitImapCreateOrganizeJobResponse = {
715
+ /**
716
+ * ID of the newly created organize job
717
+ */
718
+ organizeJobId: string;
719
+ /**
720
+ * Initial state of the job (Pending)
721
+ */
722
+ state: RemitImapOrganizeJobState;
723
+ };
724
+
725
+ /**
726
+ * Input for creating an outbox message
727
+ */
728
+ export type RemitImapCreateOutboxMessageInput = {
729
+ /**
730
+ * Account to send from
731
+ */
732
+ accountId: Uuid;
733
+ /**
734
+ * Recipient addresses (To)
735
+ */
736
+ toAddresses: Array<string>;
737
+ /**
738
+ * CC recipient addresses
739
+ */
740
+ ccAddresses?: Array<string>;
741
+ /**
742
+ * BCC recipient addresses
743
+ */
744
+ bccAddresses?: Array<string>;
745
+ /**
746
+ * Subject line
747
+ */
748
+ subject?: string;
749
+ /**
750
+ * Plain text body
751
+ */
752
+ textBody?: string;
753
+ /**
754
+ * HTML body
755
+ */
756
+ htmlBody?: string;
757
+ /**
758
+ * For replies: parent message's Message-ID
759
+ */
760
+ inReplyTo?: string;
761
+ /**
762
+ * For replies: full References chain from parent
763
+ */
764
+ references?: Array<string>;
765
+ /**
766
+ * Whether to send immediately or save as draft
767
+ */
768
+ sendImmediately?: boolean;
769
+ };
770
+
771
+ /**
772
+ * Response for DELETE /me (account erasure request)
773
+ */
774
+ export type RemitImapDeleteAccountConfigResponse = {
775
+ /**
776
+ * Human-readable confirmation message
777
+ */
778
+ message: string;
779
+ };
780
+
781
+ /**
782
+ * Delete account response (tombstone)
783
+ */
784
+ export type RemitImapDeleteAccountResponse = {
785
+ /**
786
+ * Account ID that was marked for deletion
787
+ */
788
+ accountId: Uuid;
789
+ /**
790
+ * Timestamp when deletion was requested
791
+ */
792
+ deletedAt: number;
793
+ /**
794
+ * Message indicating async cleanup will follow
795
+ */
796
+ message: string;
797
+ };
798
+
799
+ /**
800
+ * Input for DELETE /me — requires the caller to confirm their email address
801
+ */
802
+ export type RemitImapDeleteMeInput = {
803
+ /**
804
+ * Must match the caller's Cognito email claim (case-insensitive)
805
+ */
806
+ confirmEmail: string;
807
+ };
808
+
809
+ /**
810
+ * Input for deleting messages
811
+ */
812
+ export type RemitImapDeleteMessagesInput = {
813
+ /**
814
+ * List of message IDs to delete
815
+ */
816
+ messageIds: Array<Uuid>;
817
+ /**
818
+ * Permanently delete instead of moving to Trash. Default: false
819
+ */
820
+ permanent?: boolean;
821
+ };
822
+
823
+ /**
824
+ * Complete message description including all related data. Body content is delivered via the per-part `BodyPartResponse.contentUrl` (CloudFront, JWT-authorized at the edge); the legacy `bodyText`/`bodyHtml` fields were removed once content delivery cut over end-to-end (#224).
825
+ */
826
+ export type RemitImapDescribeMessageResponse = {
827
+ /**
828
+ * Core message metadata
829
+ */
830
+ message: RemitImapMessageSummaryResponse;
831
+ /**
832
+ * Envelope data
833
+ */
834
+ envelope: RemitImapEnvelopeResponse;
835
+ /**
836
+ * Message flags
837
+ */
838
+ flags: Array<string>;
839
+ /**
840
+ * Body structure. Each part exposes `contentUrl` for fetching its bytes.
841
+ */
842
+ bodyParts: Array<RemitImapBodyPartResponse>;
843
+ /**
844
+ * Message references (In-Reply-To and References headers)
845
+ */
846
+ references: Array<RemitImapMessageReferenceResponse>;
847
+ };
848
+
849
+ /**
850
+ * Response from emptying trash
851
+ */
852
+ export type RemitImapEmptyTrashResponse = {
853
+ /**
854
+ * Number of messages permanently deleted
855
+ */
856
+ deletedCount: number;
857
+ };
858
+
859
+ /**
860
+ * Envelope address information. Includes the resolved Address `addressId` and per-sender `flags` so the UI can render trust state without a second fetch.
861
+ */
862
+ export type RemitImapEnvelopeAddressResponse = {
863
+ /**
864
+ * Resolved Address identifier (stable per accountConfig + normalized email)
865
+ */
866
+ addressId: Uuid;
867
+ /**
868
+ * Display name as it appeared in this specific message's envelope
869
+ */
870
+ displayName?: string;
871
+ /**
872
+ * Lowercase full email address
873
+ */
874
+ normalizedEmail: string;
875
+ /**
876
+ * Role of this address in the envelope
877
+ */
878
+ addressRole: RemitImapAddressRole;
879
+ /**
880
+ * Order for multiple addresses in same role (0-indexed)
881
+ */
882
+ addressOrder: number;
883
+ /**
884
+ * Sender-level flags resolved from the linked Address
885
+ */
886
+ flags?: RemitImapAddressFlags;
887
+ };
888
+
889
+ /**
890
+ * Message envelope (header metadata)
891
+ */
892
+ export type RemitImapEnvelopeResponse = {
893
+ /**
894
+ * Reference to parent message
895
+ */
896
+ messageId: Uuid;
897
+ /**
898
+ * Message date
899
+ */
900
+ date: number;
901
+ /**
902
+ * Message subject
903
+ */
904
+ subject?: string;
905
+ /**
906
+ * RFC 2822 Message-ID header value
907
+ */
908
+ messageIdValue?: string;
909
+ /**
910
+ * From addresses
911
+ */
912
+ from: Array<RemitImapEnvelopeAddressResponse>;
913
+ /**
914
+ * To addresses
915
+ */
916
+ to: Array<RemitImapEnvelopeAddressResponse>;
917
+ /**
918
+ * CC addresses
919
+ */
920
+ cc: Array<RemitImapEnvelopeAddressResponse>;
921
+ /**
922
+ * BCC addresses
923
+ */
924
+ bcc: Array<RemitImapEnvelopeAddressResponse>;
925
+ /**
926
+ * Reply-To addresses
927
+ */
928
+ replyTo: Array<RemitImapEnvelopeAddressResponse>;
929
+ /**
930
+ * Header-derived category for the message. Absent for messages synced before classification rolled out.
931
+ */
932
+ category?: RemitImapMessageCategory;
933
+ /**
934
+ * Trust level for the From address, derived from AddressFlags at read time.
935
+ */
936
+ senderTrust: RemitImapSenderTrust;
937
+ };
938
+
939
+ /**
940
+ * A single literal predicate clause (from / subject / has-words), combined with its siblings via Filter.matchOperator (RFC 031).
941
+ */
942
+ export type RemitImapFilterClause = {
943
+ /**
944
+ * Message attribute this clause matches against
945
+ */
946
+ field: RemitImapFilterClauseField;
947
+ /**
948
+ * Literal text to match
949
+ */
950
+ value: String256;
951
+ };
952
+
953
+ /**
954
+ * Message attribute a FilterClause matches against — RFC 031's Tier 0 literal predicates (from / subject / has-words).
955
+ */
956
+ export type RemitImapFilterClauseField = 'From' | 'Subject' | 'HasWords';
957
+
958
+ /**
959
+ * How a Filter's literalClauses combine (RFC 031 "literal predicates, AND/OR"). Ignored when literalClauses is empty.
960
+ */
961
+ export type RemitImapFilterMatchOperator = 'And' | 'Or';
962
+
963
+ /**
964
+ * Filter item returned by list/get/create/update operations. `ttl` is internal bookkeeping (RFC 034 Decision 1.3) and not surfaced.
965
+ */
966
+ export type RemitImapFilterResponse = {
967
+ /**
968
+ * Primary identifier. Stable id — the human name is a separate mutable overlay, never the key.
969
+ */
970
+ filterId: Uuid;
971
+ /**
972
+ * Owning account configuration
973
+ */
974
+ accountConfigId: Uuid;
975
+ /**
976
+ * Plain-language name or editable label for this filter
977
+ */
978
+ name: String256;
979
+ /**
980
+ * Standing (permanent) or Temporary (expires). Governs whether expiresAt/ttl are present (RFC 034 Decision 1).
981
+ */
982
+ scope: RemitImapFilterScope;
983
+ /**
984
+ * ISO 8601 date-time with zone offset, present only when scope is Temporary (RFC 034 Decision 1.1) — a business date, not an epoch instant. Every evaluation compares `now` against this value directly; it is the source of truth for whether a Temporary filter is still active, independent of `state` or row existence.
985
+ */
986
+ expiresAt?: string;
987
+ /**
988
+ * Cache of whether this filter is still active, backing byAccountAndState (RFC 034 Decision 1.2). Starts Active; lazily patched to Expired the first time something reads a Temporary filter past its expiresAt — whichever of index-time evaluation, retroactive replay, or a settings-page list touches it next. Never the correctness source; expiresAt is.
989
+ */
990
+ state: RemitImapFilterState;
991
+ /**
992
+ * Whether a sibling FilterAnchor row exists for this filter (RFC 034 Decision 2.3). Lets the index-time worker skip the FilterAnchor `get` entirely for purely-literal filters instead of probing for a row that may not exist.
993
+ */
994
+ readonly hasAnchor: boolean;
995
+ /**
996
+ * Epoch seconds, written only when the predicate (literalClauses, hasAnchor) or the action (actionLabelId, actionMailboxId) changes — never on a cosmetic rename. Backs most-recently-changed-filter-wins precedence for the exclusive move action (RFC 034 Decision 3.2). Distinct from ElectroDB's own updatedAt, which bumps on any write.
997
+ */
998
+ readonly ruleChangedAt: number;
999
+ /**
1000
+ * How literalClauses combine. Meaningless when literalClauses is empty.
1001
+ */
1002
+ matchOperator: RemitImapFilterMatchOperator;
1003
+ /**
1004
+ * Literal from/subject/has-words predicate clauses (RFC 031). Empty when the filter relies solely on its semantic anchor (see hasAnchor).
1005
+ */
1006
+ literalClauses: Array<RemitImapFilterClause>;
1007
+ /**
1008
+ * Label applied when this filter matches — additive action, any number of filters can independently apply their own label (RFC 034 Decision 3.1). The named sentinel `"None"` means no label action; never an empty/optional field.
1009
+ */
1010
+ actionLabelId: string;
1011
+ /**
1012
+ * Mailbox matched messages are moved into — exclusive action, since a message lives in exactly one mailbox (RFC 034 Decision 3.1). On conflict between filters, the one with the latest ruleChangedAt wins. `"None"` means no move action.
1013
+ */
1014
+ actionMailboxId: string;
1015
+ readonly createdAt: number;
1016
+ readonly updatedAt: number;
1017
+ };
1018
+
1019
+ /**
1020
+ * Whether a Filter is permanent or expires (RFC 034 Decision 1). A Filter row exists only for these two standing scopes — the one-time "just these" / "all like these" batch actions never create one.
1021
+ */
1022
+ export type RemitImapFilterScope = 'Standing' | 'Temporary';
1023
+
1024
+ /**
1025
+ * Cache of whether a Filter is still active to evaluate, backing the byAccountAndState index (RFC 034 Decision 1.2). Not the source of truth for expiry — Filter.expiresAt is, compared directly at every evaluation. Starts Active; lazily patched to Expired the first time something reads a Temporary filter past its expiresAt. No Disabled value: this RFC has no flow that pauses a filter without deleting it.
1026
+ */
1027
+ export type RemitImapFilterState = 'Active' | 'Expired';
1028
+
1029
+ /**
1030
+ * Per-account appointment of a canonical role to at most one mailbox (RFC 032 exclusive-folder-appointment, issue #976). A role with no `mailboxId` is unfilled — either genuinely unappointed, or the account has no matching folder yet. Persisted as per-(account, role) AccountSetting rows (RFC 032 settings tiers), surfaced on AccountResponse.folderAppointments — never on the Mailbox entity, so two folders can never both claim the same role.
1031
+ */
1032
+ export type RemitImapFolderAppointment = {
1033
+ /**
1034
+ * Which canonical role this entry fills.
1035
+ */
1036
+ role: RemitImapCanonicalMailboxRole;
1037
+ /**
1038
+ * The mailbox appointed to the role. Absent when the role is unfilled — either nothing was detected yet, or the account genuinely has no such folder. When absent on a GET, this is a server-proposed best guess (SPECIAL-USE flag, then the reserved INBOX name, then a weak name hint) rather than a user's persisted choice; it becomes persisted only once the user calls appointFolderRole.
1039
+ */
1040
+ mailboxId?: Uuid;
1041
+ };
1042
+
1043
+ /**
1044
+ * Mailbox item returned by list/get operations. The mute flag and the display-name override are sourced from per-mailbox AccountSetting rows (RFC 032), not the Mailbox entity, but are surfaced here so the response shape is unchanged. The canonical role a folder fills is not per-mailbox state — see AccountResponse.folderAppointments (RFC 032 exclusive-folder-appointment).
1045
+ */
1046
+ export type RemitImapMailboxResponse = {
1047
+ /**
1048
+ * Primary identifier
1049
+ */
1050
+ mailboxId: Uuid;
1051
+ /**
1052
+ * Reference to the owning account
1053
+ */
1054
+ accountId: Uuid;
1055
+ /**
1056
+ * Namespace type: personal, other_users, or shared
1057
+ */
1058
+ namespaceType: RemitImapNamespaceType;
1059
+ /**
1060
+ * Namespace prefix (e.g., '', '~', '#shared/')
1061
+ */
1062
+ readonly namespacePrefix: string;
1063
+ /**
1064
+ * Character used to separate hierarchy levels (typically '/' or '.')
1065
+ */
1066
+ readonly hierarchyDelimiter: string;
1067
+ /**
1068
+ * Complete mailbox path including hierarchy
1069
+ */
1070
+ fullPath: String512;
1071
+ /**
1072
+ * Total message count in mailbox
1073
+ */
1074
+ readonly messageCount: number;
1075
+ /**
1076
+ * Count of unseen messages
1077
+ */
1078
+ readonly unseenCount: number;
1079
+ /**
1080
+ * Count of messages marked for deletion
1081
+ */
1082
+ readonly deletedCount: number;
1083
+ /**
1084
+ * The lowest UID that has been successfully synced (tracks downward progress)
1085
+ */
1086
+ readonly lastSyncUid: number;
1087
+ /**
1088
+ * The highest UID ever seen/synced (used to detect new messages)
1089
+ */
1090
+ readonly highWaterMarkUid: number;
1091
+ /**
1092
+ * Timestamp of the last successful message sync
1093
+ */
1094
+ readonly lastMessageSyncAt: number;
1095
+ /**
1096
+ * Denormalized list of IMAP SPECIAL-USE designations (RFC 6154). Populated from the same `\Sent`, `\Drafts`, etc. attributes the server reports during LIST. Stored on the row to avoid an N+1 join when listing mailboxes.
1097
+ */
1098
+ readonly specialUse?: Array<RemitImapMailboxSpecialUse>;
1099
+ readonly createdAt: number;
1100
+ readonly updatedAt: number;
1101
+ /**
1102
+ * Mailbox-level mute flag. When set, this mailbox is hidden from unified/brief views (sync is unaffected). Sourced from a per-mailbox AccountSetting row (RFC 032).
1103
+ */
1104
+ muted?: RemitImapMutedFlag;
1105
+ /**
1106
+ * User-chosen sidebar label for this mailbox. Optional; when absent the UI uses the canonical/derived folder label. Sourced from a per-mailbox AccountSetting row (RFC 032).
1107
+ */
1108
+ displayNameOverride?: String256;
1109
+ };
1110
+
1111
+ /**
1112
+ * Mailbox special-use designations, named after RFC 6154 / RFC 9051 Section 7.3.1.
1113
+ * Values are the BARE forms (no leading backslash): Remit stores and serves
1114
+ * `"Junk"`, not the RFC's `"\Junk"`. The runtime is bare across the generated
1115
+ * enums and ElectroDB entities, and a backslash-prefixed value can't survive the
1116
+ * current enum emitter anyway, so the wire contract uses the bare form.
1117
+ */
1118
+ export type RemitImapMailboxSpecialUse = 'All' | 'Archive' | 'Drafts' | 'Flagged' | 'Junk' | 'Sent' | 'Trash' | 'Important';
1119
+
1120
+ /**
1121
+ * Per-mailbox progress entry in the sync-status response
1122
+ */
1123
+ export type RemitImapMailboxSyncProgress = {
1124
+ /**
1125
+ * Mailbox identifier
1126
+ */
1127
+ mailboxId: Uuid;
1128
+ /**
1129
+ * Full IMAP path (e.g. INBOX, Sent)
1130
+ */
1131
+ fullPath: string;
1132
+ /**
1133
+ * Sync phase for this mailbox: pending (never synced), syncing (in-progress), or complete
1134
+ */
1135
+ phase: string;
1136
+ /**
1137
+ * Total messages in mailbox (refreshed each batch)
1138
+ */
1139
+ messagesTotal: number;
1140
+ /**
1141
+ * Approximate number of messages synced. Computed as highWaterMarkUid − lastSyncUid (UID-range approximation; UIDs are sparse so this may undercount). Clamped to messagesTotal.
1142
+ */
1143
+ messagesSynced: number;
1144
+ /**
1145
+ * Timestamp of the last successful message sync for this mailbox
1146
+ */
1147
+ lastSyncedAt?: number;
1148
+ };
1149
+
1150
+ /**
1151
+ * Top-level MIME media types per RFC 2046
1152
+ */
1153
+ export type RemitImapMediaType = 'TEXT' | 'IMAGE' | 'AUDIO' | 'VIDEO' | 'APPLICATION' | 'MULTIPART' | 'MESSAGE';
1154
+
1155
+ /**
1156
+ * Structured sender-authenticity signal, derived from headers at classification time. Absent for messages classified before this field was introduced — clients should treat absence as no-signal.
1157
+ */
1158
+ export type RemitImapMessageAuthenticity = {
1159
+ /**
1160
+ * Domain of the From header address
1161
+ */
1162
+ fromDomain: string;
1163
+ /**
1164
+ * DKIM signing domain (d=) that was compared, when a signature is present
1165
+ */
1166
+ dkimDomain?: string;
1167
+ /**
1168
+ * True when DKIM signing domain(s) are present and none aligns with the From domain
1169
+ */
1170
+ dkimMismatch: boolean;
1171
+ };
1172
+
1173
+ /**
1174
+ * Bulk operation result for message operations
1175
+ */
1176
+ export type RemitImapMessageBulkOperationResult = {
1177
+ /**
1178
+ * Number of items successfully processed
1179
+ */
1180
+ successCount: number;
1181
+ /**
1182
+ * Number of items that failed
1183
+ */
1184
+ failureCount: number;
1185
+ /**
1186
+ * IDs of failed items
1187
+ */
1188
+ failedIds?: Array<Uuid>;
1189
+ };
1190
+
1191
+ /**
1192
+ * Header-derived message category. Set by classifyByHeaders during body-sync. Defaults to `uncategorized` until the message is body-classified.
1193
+ */
1194
+ export type RemitImapMessageCategory = 'uncategorized' | 'personal' | 'newsletter' | 'marketing' | 'automated' | 'transactional' | 'social';
1195
+
1196
+ /**
1197
+ * Message reference response for In-Reply-To and References headers
1198
+ */
1199
+ export type RemitImapMessageReferenceResponse = {
1200
+ /**
1201
+ * The msg-id value (without angle brackets)
1202
+ */
1203
+ readonly messageIdValue: string;
1204
+ /**
1205
+ * Type of reference: in_reply_to or references
1206
+ */
1207
+ referenceType: RemitImapReferenceType;
1208
+ /**
1209
+ * Order within References header (0-indexed). Always 0 for In-Reply-To.
1210
+ */
1211
+ readonly referenceOrder: number;
1212
+ };
1213
+
1214
+ /**
1215
+ * Core message metadata for API responses
1216
+ */
1217
+ export type RemitImapMessageSummaryResponse = {
1218
+ /**
1219
+ * Primary identifier (internal UUID)
1220
+ */
1221
+ messageId: Uuid;
1222
+ /**
1223
+ * Reference to parent mailbox
1224
+ */
1225
+ mailboxId: Uuid;
1226
+ /**
1227
+ * IMAP UID - unique within mailbox, strictly ascending, never reused under same UIDVALIDITY
1228
+ */
1229
+ readonly uid: number;
1230
+ /**
1231
+ * Message size in octets in RFC 5322 format
1232
+ */
1233
+ readonly rfc822Size: number;
1234
+ /**
1235
+ * Server receipt timestamp (INTERNALDATE)
1236
+ */
1237
+ readonly internalDate: number;
1238
+ /**
1239
+ * Message-ID header value for quick reference
1240
+ */
1241
+ readonly messageIdHeader?: string;
1242
+ /**
1243
+ * Structured sender-authenticity signal derived from DKIM headers at classification time. Absent for messages classified before this field was introduced — absence means no signal.
1244
+ */
1245
+ authenticity?: RemitImapMessageAuthenticity;
1246
+ /**
1247
+ * Present only when Remit auto-moved this message on body-sync. Absent means the message was not auto-moved by Remit.
1248
+ */
1249
+ autoMoved?: RemitImapAutoMovedInfo;
1250
+ };
1251
+
1252
+ /**
1253
+ * Input for moving messages
1254
+ */
1255
+ export type RemitImapMoveMessagesInput = {
1256
+ /**
1257
+ * List of message IDs to operate on
1258
+ */
1259
+ messageIds: Array<Uuid>;
1260
+ /**
1261
+ * Destination mailbox ID
1262
+ */
1263
+ destinationMailboxId: Uuid;
1264
+ };
1265
+
1266
+ /**
1267
+ * Sender is muted: do not notify on new mail
1268
+ */
1269
+ export type RemitImapMutedFlag = RemitImapAddressFlagBase & {
1270
+ value: boolean;
1271
+ };
1272
+
1273
+ /**
1274
+ * Sender is muted: do not notify on new mail
1275
+ */
1276
+ export type RemitImapMutedFlagUpdate = RemitImapAddressFlagBaseUpdate & {
1277
+ value?: boolean;
1278
+ };
1279
+
1280
+ /**
1281
+ * IMAP namespace types per RFC 9051 Section 6.3.10
1282
+ */
1283
+ export type RemitImapNamespaceType = 'personal' | 'other_users' | 'shared';
1284
+
1285
+ /**
1286
+ * The predicate + action for a one-time "all like these" back-apply (RFC 034
1287
+ * recap, #1278). A distinct model, deliberately NOT a Filter: it carries no
1288
+ * `scope`, `expiresAt`, or `name`, so it structurally cannot create a standing
1289
+ * rule. The anchor is derived transiently from `anchorMessageId`'s existing chunk
1290
+ * vectors at match time and never persisted as a FilterAnchor row.
1291
+ */
1292
+ export type RemitImapOrganizeInput = {
1293
+ /**
1294
+ * Anchor message for the semantic half — "all like this one". Absent for a purely-literal back-apply. The anchor vector is pooled transiently from this message's indexed chunk vectors and never written to a FilterAnchor row.
1295
+ */
1296
+ anchorMessageId?: Uuid;
1297
+ /**
1298
+ * How literalClauses combine. Meaningless when literalClauses is empty.
1299
+ */
1300
+ matchOperator: RemitImapFilterMatchOperator;
1301
+ /**
1302
+ * Literal from/subject/has-words clauses (RFC 031), reusing the Filter predicate shape. Empty when the back-apply relies solely on the semantic anchor.
1303
+ */
1304
+ literalClauses: Array<RemitImapFilterClause>;
1305
+ /**
1306
+ * Cosine cut-off for the semantic match. Absent uses the server default (the same threshold the index-time filter pipeline applies).
1307
+ */
1308
+ similarityThreshold?: number;
1309
+ /**
1310
+ * Label applied to every matching message — additive action (RFC 034 Decision 3.1). The `"None"` sentinel means no label action.
1311
+ */
1312
+ actionLabelId: string;
1313
+ /**
1314
+ * Mailbox every matching message is moved into — exclusive action (RFC 034 Decision 3.1). The `"None"` sentinel means no move action.
1315
+ */
1316
+ actionMailboxId: string;
1317
+ };
1318
+
1319
+ /**
1320
+ * Job item returned by GET /accounts/{accountId}/organize/{organizeJobId}. `ttl` is internal bookkeeping and not surfaced.
1321
+ */
1322
+ export type RemitImapOrganizeJobResponse = {
1323
+ /**
1324
+ * Primary identifier
1325
+ */
1326
+ organizeJobId: Uuid;
1327
+ /**
1328
+ * Owning account config
1329
+ */
1330
+ accountConfigId: Uuid;
1331
+ /**
1332
+ * Cognito user id of the requesting user
1333
+ */
1334
+ readonly userId: string;
1335
+ /**
1336
+ * Current lifecycle state of the job
1337
+ */
1338
+ state: RemitImapOrganizeJobState;
1339
+ /**
1340
+ * Snapshot of the anchor message id, or the `"None"` sentinel for a purely-literal back-apply. A sentinel, not an optional field, so the persisted entity has no optional attributes (RFC 032).
1341
+ */
1342
+ readonly anchorMessageId: string;
1343
+ /**
1344
+ * Snapshot of how literalClauses combine
1345
+ */
1346
+ matchOperator: RemitImapFilterMatchOperator;
1347
+ /**
1348
+ * Snapshot of the literal predicate clauses
1349
+ */
1350
+ readonly literalClauses: Array<RemitImapFilterClause>;
1351
+ /**
1352
+ * Snapshot of the semantic cut-off applied for this run
1353
+ */
1354
+ readonly similarityThreshold: number;
1355
+ /**
1356
+ * Snapshot of the additive label action, or `"None"`
1357
+ */
1358
+ readonly actionLabelId: string;
1359
+ /**
1360
+ * Snapshot of the exclusive move action, or `"None"`
1361
+ */
1362
+ readonly actionMailboxId: string;
1363
+ /**
1364
+ * Number of messages matched by the predicate, set when the pass completes
1365
+ */
1366
+ readonly matchedCount: number;
1367
+ /**
1368
+ * Number of matches the action was successfully applied to
1369
+ */
1370
+ readonly appliedCount: number;
1371
+ /**
1372
+ * Number of matches whose action apply failed
1373
+ */
1374
+ readonly failedCount: number;
1375
+ /**
1376
+ * Human-readable error message; empty unless state is Failed
1377
+ */
1378
+ readonly errorMessage: string;
1379
+ /**
1380
+ * Epoch millis when the job was created
1381
+ */
1382
+ readonly createdAt: number;
1383
+ /**
1384
+ * Epoch millis when the job was last updated
1385
+ */
1386
+ readonly updatedAt: number;
1387
+ };
1388
+
1389
+ /**
1390
+ * Lifecycle state of a smart-organize back-apply job (RFC 034, #1278). Mirrors the account-export job's lifecycle: a Pending row the worker picks up, drives to Running, then to a terminal Complete or Failed.
1391
+ */
1392
+ export type RemitImapOrganizeJobState = 'Pending' | 'Running' | 'Complete' | 'Failed';
1393
+
1394
+ /**
1395
+ * Response body for POST /accounts/{accountId}/organize/preview — the messages the same matcher would apply the action to, without applying it. Bounded server-side.
1396
+ */
1397
+ export type RemitImapOrganizePreviewResponse = {
1398
+ /**
1399
+ * Number of messages the predicate matched within the bounded pass
1400
+ */
1401
+ matchedCount: number;
1402
+ /**
1403
+ * Ids of the matching messages, bounded to the same cap the apply pass uses
1404
+ */
1405
+ messageIds: Array<string>;
1406
+ };
1407
+
1408
+ /**
1409
+ * Outbox message response
1410
+ */
1411
+ export type RemitImapOutboxMessageResponse = {
1412
+ /**
1413
+ * Primary identifier
1414
+ */
1415
+ outboxMessageId: Uuid;
1416
+ /**
1417
+ * Reference to sending account
1418
+ */
1419
+ accountId: Uuid;
1420
+ /**
1421
+ * Sender address for MAIL FROM (bounce address)
1422
+ */
1423
+ readonly fromAddress: string;
1424
+ /**
1425
+ * Display name for From header
1426
+ */
1427
+ readonly fromName?: string;
1428
+ /**
1429
+ * Recipient addresses (To)
1430
+ */
1431
+ readonly toAddresses: Array<string>;
1432
+ /**
1433
+ * CC recipient addresses. Empty when none.
1434
+ */
1435
+ readonly ccAddresses: Array<string>;
1436
+ /**
1437
+ * BCC recipient addresses. Empty when none.
1438
+ */
1439
+ readonly bccAddresses: Array<string>;
1440
+ /**
1441
+ * Subject line
1442
+ */
1443
+ readonly subject?: string;
1444
+ /**
1445
+ * In-Reply-To header value (parent message-id, without brackets)
1446
+ */
1447
+ readonly inReplyTo?: string;
1448
+ /**
1449
+ * References header values (array of message-ids, without brackets). Empty when none.
1450
+ */
1451
+ readonly references: Array<string>;
1452
+ /**
1453
+ * Plain text body
1454
+ */
1455
+ readonly textBody?: string;
1456
+ /**
1457
+ * HTML body
1458
+ */
1459
+ readonly htmlBody?: string;
1460
+ /**
1461
+ * Current send status
1462
+ */
1463
+ status: RemitImapOutboxMessageStatus;
1464
+ /**
1465
+ * Last error message if status is failed
1466
+ */
1467
+ readonly lastError?: string;
1468
+ /**
1469
+ * Timestamp when message was successfully sent
1470
+ */
1471
+ readonly sentAt?: number;
1472
+ readonly createdAt: number;
1473
+ readonly updatedAt: number;
1474
+ };
1475
+
1476
+ /**
1477
+ * Status of an outbox message in the send queue
1478
+ */
1479
+ export type RemitImapOutboxMessageStatus = 'draft' | 'queued' | 'sending' | 'sent' | 'failed' | 'blocked';
1480
+
1481
+ /**
1482
+ * Actionable placement verdict — the direction Remit decided to move a message. `leave` is not represented: a left-in-place verdict means the placement sub-model is absent.
1483
+ */
1484
+ export type RemitImapPlacementAction = 'MoveToInbox' | 'MoveToJunk';
1485
+
1486
+ /**
1487
+ * Raw RFC822/MIME source of a message (headers and body), decoded as a string for inspection.
1488
+ */
1489
+ export type RemitImapRawMessageResponse = {
1490
+ /**
1491
+ * The complete RFC822/MIME source of the message, headers included.
1492
+ */
1493
+ raw: string;
1494
+ };
1495
+
1496
+ /**
1497
+ * Message reference types per RFC 2822 Section 3.6.4
1498
+ */
1499
+ export type RemitImapReferenceType = 'in_reply_to' | 'references';
1500
+
1501
+ /**
1502
+ * Input for updating a mailbox. Rename (IMAP sync) is triggered only when `fullPath` is provided. The `muted` flag and the `displayNameOverride` override can be updated independently without triggering IMAP machinery; pass `null` to clear either. The canonical role a folder fills is appointed separately — see FolderRoleOperations.appointFolderRole (RFC 032 exclusive-folder-appointment).
1503
+ */
1504
+ export type RemitImapRenameMailboxInput = {
1505
+ /**
1506
+ * New full path (triggers IMAP rename when present)
1507
+ */
1508
+ fullPath?: String512;
1509
+ /**
1510
+ * Mute flag. Pass a MutedFlag object to mute; pass `null` to clear the mute.
1511
+ */
1512
+ muted?: RemitImapMutedFlagUpdate | null;
1513
+ /**
1514
+ * Sidebar display-name override. Pass a string to set; pass `null` to clear (UI falls back to the canonical/derived label). Typed as an inline nullable string with `@maxLength(256)` rather than `String256 | null`: a named scalar union renders as allOf + nullable with no sibling type, which openapi-backend's AJV rejects for a `null` value (the `$ref` re-imposes the string type), 400ing the clear path. An inline string attaches `type:string`, AJV compiles, and `null` stays valid at the wire while the 256-length cap is preserved.
1515
+ */
1516
+ displayNameOverride?: string | null;
1517
+ };
1518
+
1519
+ /**
1520
+ * Allowed chunk types that may be the best match for a semantic-search hit
1521
+ */
1522
+ export type RemitImapSemanticSearchChunkType = 'sender' | 'recipient' | 'subject' | 'attachment' | 'body' | 'entities';
1523
+
1524
+ /**
1525
+ * A single semantic-search hit. Display fields (fromName, subject, sentDate) are denormalized at index time and present for messages indexed after this feature was deployed. Older entries may omit them; clients should render a fallback when absent.
1526
+ */
1527
+ export type RemitImapSemanticSearchResult = {
1528
+ /**
1529
+ * Matched message id
1530
+ */
1531
+ messageId: Uuid;
1532
+ /**
1533
+ * Thread id the matched message belongs to
1534
+ */
1535
+ threadId: Uuid;
1536
+ /**
1537
+ * Cosine similarity (or backend-equivalent) of the best matching chunk for this message; higher is more relevant
1538
+ */
1539
+ score: number;
1540
+ /**
1541
+ * Chunk type that produced the best match for this message
1542
+ */
1543
+ matchedChunkType: RemitImapSemanticSearchChunkType;
1544
+ /**
1545
+ * All mailbox ids the matched message currently lives in
1546
+ */
1547
+ mailboxIds: Array<Uuid>;
1548
+ /**
1549
+ * Display name of the sender (From header). Present for messages indexed after display-field enrichment was deployed.
1550
+ */
1551
+ fromName?: string;
1552
+ /**
1553
+ * Message subject. Present for messages indexed after display-field enrichment was deployed.
1554
+ */
1555
+ subject?: string;
1556
+ /**
1557
+ * Sent date as Unix epoch seconds. Present for messages indexed after display-field enrichment was deployed.
1558
+ */
1559
+ sentDate?: number;
1560
+ /**
1561
+ * Header-derived category of the matched message. Present for messages indexed after category enrichment was deployed; older entries omit it.
1562
+ */
1563
+ category?: RemitImapMessageCategory;
1564
+ };
1565
+
1566
+ /**
1567
+ * Trust level for the From address, derived at read time from AddressFlags + counters.
1568
+ */
1569
+ export type RemitImapSenderTrust = 'unknown' | 'wellknown' | 'vip';
1570
+
1571
+ /**
1572
+ * Sort order for list operations
1573
+ */
1574
+ export type RemitImapSortOrder = 'asc' | 'desc';
1575
+
1576
+ /**
1577
+ * Gmail-style star colors for message/thread marking
1578
+ */
1579
+ export type RemitImapStarColor = 'none' | 'yellow' | 'orange' | 'red' | 'purple' | 'blue' | 'teal' | 'green' | 'yellow_bang' | 'red_bang' | 'purple_question' | 'blue_info' | 'orange_guillemet' | 'green_check' | 'yellow_check' | 'blue_star';
1580
+
1581
+ /**
1582
+ * Phase of the initial account sync lifecycle
1583
+ */
1584
+ export type RemitImapSyncPhase = 'idle' | 'discovering_mailboxes' | 'syncing_inbox' | 'syncing_others' | 'complete' | 'error';
1585
+
1586
+ /**
1587
+ * Sync trigger response
1588
+ */
1589
+ export type RemitImapSyncTriggerResponse = {
1590
+ /**
1591
+ * Whether sync was triggered successfully
1592
+ */
1593
+ triggered: boolean;
1594
+ /**
1595
+ * Message about sync status
1596
+ */
1597
+ message: string;
1598
+ };
1599
+
1600
+ /**
1601
+ * Input for testing connection without saving
1602
+ */
1603
+ export type RemitImapTestConnectionInput = {
1604
+ /**
1605
+ * Account ID (optional, used to retrieve stored password if password is empty)
1606
+ */
1607
+ accountId?: Uuid;
1608
+ /**
1609
+ * IMAP login username
1610
+ */
1611
+ username: string;
1612
+ /**
1613
+ * Account password (optional if accountId provided - uses stored password)
1614
+ */
1615
+ password?: string;
1616
+ /**
1617
+ * IMAP server hostname
1618
+ */
1619
+ imapHost: string;
1620
+ /**
1621
+ * IMAP server port
1622
+ */
1623
+ imapPort: number;
1624
+ /**
1625
+ * Use TLS encryption
1626
+ */
1627
+ imapTls: boolean;
1628
+ /**
1629
+ * Use STARTTLS upgrade
1630
+ */
1631
+ imapStartTls: boolean;
1632
+ /**
1633
+ * SMTP server hostname (optional)
1634
+ */
1635
+ smtpHost?: string;
1636
+ /**
1637
+ * SMTP server port
1638
+ */
1639
+ smtpPort?: number;
1640
+ /**
1641
+ * Use TLS encryption for SMTP
1642
+ */
1643
+ smtpTls?: boolean;
1644
+ /**
1645
+ * Use STARTTLS upgrade for SMTP
1646
+ */
1647
+ smtpStartTls?: boolean;
1648
+ /**
1649
+ * SMTP username (defaults to IMAP username)
1650
+ */
1651
+ smtpUsername?: string;
1652
+ /**
1653
+ * SMTP password (defaults to IMAP password)
1654
+ */
1655
+ smtpPassword?: string;
1656
+ };
1657
+
1658
+ /**
1659
+ * Connection test result
1660
+ */
1661
+ export type RemitImapTestConnectionResponse = {
1662
+ /**
1663
+ * Whether IMAP connection succeeded
1664
+ */
1665
+ imapSuccess: boolean;
1666
+ /**
1667
+ * IMAP error message if failed
1668
+ */
1669
+ imapError?: string;
1670
+ /**
1671
+ * Whether SMTP connection succeeded (null if not tested)
1672
+ */
1673
+ smtpSuccess?: boolean;
1674
+ /**
1675
+ * SMTP error message if failed
1676
+ */
1677
+ smtpError?: string;
1678
+ };
1679
+
1680
+ /**
1681
+ * Thread message item returned by list/search operations. `category` and `senderTrust` are attached at read time via batch-fetch so the inbox row can render badges without a per-row round trip.
1682
+ */
1683
+ export type RemitImapThreadMessageResponse = {
1684
+ /**
1685
+ * Primary identifier
1686
+ */
1687
+ threadMessageId: Uuid;
1688
+ /**
1689
+ * Reference to parent thread
1690
+ */
1691
+ threadId: Uuid;
1692
+ /**
1693
+ * Reference to Message entity
1694
+ */
1695
+ messageId: Uuid;
1696
+ /**
1697
+ * Reference to parent account configuration
1698
+ */
1699
+ accountConfigId: Uuid;
1700
+ /**
1701
+ * Mailbox containing this message
1702
+ */
1703
+ mailboxId: Uuid;
1704
+ /**
1705
+ * Sender email address (denormalized for display)
1706
+ */
1707
+ readonly fromEmail?: string;
1708
+ /**
1709
+ * Sender display name (denormalized for display)
1710
+ */
1711
+ readonly fromName?: string;
1712
+ /**
1713
+ * Message subject
1714
+ */
1715
+ readonly subject?: string;
1716
+ /**
1717
+ * Envelope date from message headers (when message was sent)
1718
+ */
1719
+ readonly sentDate: number;
1720
+ /**
1721
+ * Message has \Seen flag
1722
+ */
1723
+ readonly isRead: boolean;
1724
+ /**
1725
+ * Message has attachments
1726
+ */
1727
+ readonly hasAttachment: boolean;
1728
+ /**
1729
+ * Message-level star color. Defaults to `None` (no star) — the absent state is a named sentinel value, never an empty field. `hasStars` carries the boolean the byStarred index filters on.
1730
+ */
1731
+ star: RemitImapStarColor;
1732
+ /**
1733
+ * True if message is starred (for index filtering)
1734
+ */
1735
+ readonly hasStars: boolean;
1736
+ /**
1737
+ * True if message is in Trash or deleted (for UI filtering)
1738
+ */
1739
+ readonly isDeleted: boolean;
1740
+ /**
1741
+ * Preview text (~256 chars)
1742
+ */
1743
+ snippet?: String256;
1744
+ readonly createdAt: number;
1745
+ readonly updatedAt: number;
1746
+ /**
1747
+ * Header-derived category for the message (from the underlying Message). Absent for messages synced before classification rolled out — clients should treat this as `personal`.
1748
+ */
1749
+ category?: RemitImapMessageCategory;
1750
+ /**
1751
+ * Trust level for the From address, derived from AddressFlags at read time. Defaults to `unknown` when no Address row resolves.
1752
+ */
1753
+ senderTrust: RemitImapSenderTrust;
1754
+ /**
1755
+ * Structured sender-authenticity signal derived from DKIM headers at classification time (from the underlying Message). Absent for messages classified before this field was introduced — absence means no signal.
1756
+ */
1757
+ authenticity?: RemitImapMessageAuthenticity;
1758
+ /**
1759
+ * Account identifier attached at read time via a mailboxId→accountId map. Present on rows returned by `GET /threads`; absent on rows from per-mailbox endpoints (clients can resolve from the mailbox cache).
1760
+ */
1761
+ accountId?: Uuid;
1762
+ /**
1763
+ * Present only when Remit auto-moved this message on body-sync. Absent means the message was not auto-moved by Remit.
1764
+ */
1765
+ autoMoved?: RemitImapAutoMovedInfo;
1766
+ };
1767
+
1768
+ /**
1769
+ * Aggregate response for `searchThreads`. Carries the matching rows (`items`), a
1770
+ * pagination `continuationToken`, and an optional `count` of matches within the
1771
+ * server-capped window. `items` is omitted when `results=false` (count-only);
1772
+ * `count` is present only when `count=true`. Thread-specific so the shared
1773
+ * `ResultList<T>` (7 endpoints) stays untouched.
1774
+ */
1775
+ export type RemitImapThreadSearchResponse = {
1776
+ /**
1777
+ * Matching thread rows for this page. Omitted when `results=false` (count-only mode).
1778
+ */
1779
+ items?: Array<RemitImapThreadMessageResponse>;
1780
+ /**
1781
+ * Pass to the next call to fetch the next page; absent when the window is exhausted.
1782
+ */
1783
+ continuationToken?: String800;
1784
+ /**
1785
+ * Number of matches within the server-capped window. Present only when `count=true`.
1786
+ */
1787
+ count?: number;
1788
+ };
1789
+
1790
+ /**
1791
+ * Sender is trusted: auto-load images, allow author backgrounds
1792
+ */
1793
+ export type RemitImapTrustedFlag = RemitImapAddressFlagBase & {
1794
+ value: boolean;
1795
+ };
1796
+
1797
+ /**
1798
+ * Sender is trusted: auto-load images, allow author backgrounds
1799
+ */
1800
+ export type RemitImapTrustedFlagUpdate = RemitImapAddressFlagBaseUpdate & {
1801
+ value?: boolean;
1802
+ };
1803
+
1804
+ /**
1805
+ * User has unsubscribed; auto-mark-read until sender stops
1806
+ */
1807
+ export type RemitImapUnsubscribedFlag = RemitImapAddressFlagBase & {
1808
+ value: boolean;
1809
+ };
1810
+
1811
+ /**
1812
+ * User has unsubscribed; auto-mark-read until sender stops
1813
+ */
1814
+ export type RemitImapUnsubscribedFlagUpdate = RemitImapAddressFlagBaseUpdate & {
1815
+ value?: boolean;
1816
+ };
1817
+
1818
+ /**
1819
+ * Input for updating an existing account
1820
+ */
1821
+ export type RemitImapUpdateAccountInput = {
1822
+ /**
1823
+ * Display name
1824
+ */
1825
+ displayName?: string;
1826
+ /**
1827
+ * Account password (only if changing)
1828
+ */
1829
+ password?: string;
1830
+ /**
1831
+ * IMAP server hostname
1832
+ */
1833
+ imapHost?: string;
1834
+ /**
1835
+ * IMAP server port
1836
+ */
1837
+ imapPort?: number;
1838
+ /**
1839
+ * Use TLS encryption
1840
+ */
1841
+ imapTls?: boolean;
1842
+ /**
1843
+ * Use STARTTLS upgrade
1844
+ */
1845
+ imapStartTls?: boolean;
1846
+ /**
1847
+ * Whether SMTP sending is enabled for this account. When omitted, the server enables sending if an SMTP host is supplied here or already stored.
1848
+ */
1849
+ smtpEnabled?: boolean;
1850
+ /**
1851
+ * SMTP server hostname
1852
+ */
1853
+ smtpHost?: string;
1854
+ /**
1855
+ * SMTP server port
1856
+ */
1857
+ smtpPort?: number;
1858
+ /**
1859
+ * Use TLS encryption for SMTP
1860
+ */
1861
+ smtpTls?: boolean;
1862
+ /**
1863
+ * Use STARTTLS upgrade for SMTP
1864
+ */
1865
+ smtpStartTls?: boolean;
1866
+ /**
1867
+ * SMTP username
1868
+ */
1869
+ smtpUsername?: string;
1870
+ /**
1871
+ * SMTP password (only if changing)
1872
+ */
1873
+ smtpPassword?: string;
1874
+ /**
1875
+ * Enable/disable account
1876
+ */
1877
+ isActive?: boolean;
1878
+ /**
1879
+ * Plain text email signature
1880
+ */
1881
+ signaturePlainText?: string;
1882
+ /**
1883
+ * HTML email signature
1884
+ */
1885
+ signatureHtml?: string;
1886
+ /**
1887
+ * Account-level mute flag. Pass a MutedFlag object to mute; pass `null` to clear the mute.
1888
+ */
1889
+ muted?: RemitImapMutedFlagUpdate | null;
1890
+ };
1891
+
1892
+ /**
1893
+ * Patch payload for a single AddressFlags entry. Pass `null` for a flag key to remove that flag while leaving the others untouched.
1894
+ */
1895
+ export type RemitImapUpdateAddressFlagsInput = {
1896
+ trusted?: RemitImapTrustedFlagUpdate | null;
1897
+ blocked?: RemitImapBlockedFlagUpdate | null;
1898
+ muted?: RemitImapMutedFlagUpdate | null;
1899
+ vip?: RemitImapVipFlagUpdate | null;
1900
+ wellknown?: RemitImapWellknownFlagUpdate | null;
1901
+ category?: RemitImapCategoryFlagUpdate | null;
1902
+ autoArchive?: RemitImapAutoArchiveFlagUpdate | null;
1903
+ unsubscribed?: RemitImapUnsubscribedFlagUpdate | null;
1904
+ };
1905
+
1906
+ /**
1907
+ * Input for updating an Address (currently flag updates only)
1908
+ */
1909
+ export type RemitImapUpdateAddressInput = {
1910
+ /**
1911
+ * Per-flag merge update; omitted flags are untouched, `null` removes the flag
1912
+ */
1913
+ flags?: RemitImapUpdateAddressFlagsInput;
1914
+ };
1915
+
1916
+ /**
1917
+ * Input for updating a filter (RFC 034). Only the mutable name/predicate/action fields are updatable — `scope`, `expiresAt`, and `ttl` are fixed at creation, and `state`/`hasAnchor`/`ruleChangedAt`/`filterId` are server-derived. A patch touching a predicate or action field bumps `ruleChangedAt`; a name-only rename never does (RFC 034 Decision 3.2).
1918
+ */
1919
+ export type RemitImapUpdateFilterInput = {
1920
+ /**
1921
+ * Plain-language name or editable label for this filter
1922
+ */
1923
+ name?: String256;
1924
+ /**
1925
+ * How literalClauses combine. Meaningless when literalClauses is empty.
1926
+ */
1927
+ matchOperator?: RemitImapFilterMatchOperator;
1928
+ /**
1929
+ * Literal from/subject/has-words predicate clauses (RFC 031). Empty when the filter relies solely on its semantic anchor (see hasAnchor).
1930
+ */
1931
+ literalClauses?: Array<RemitImapFilterClause>;
1932
+ /**
1933
+ * Label applied when this filter matches — additive action, any number of filters can independently apply their own label (RFC 034 Decision 3.1). The named sentinel `"None"` means no label action; never an empty/optional field.
1934
+ */
1935
+ actionLabelId?: string;
1936
+ /**
1937
+ * Mailbox matched messages are moved into — exclusive action, since a message lives in exactly one mailbox (RFC 034 Decision 3.1). On conflict between filters, the one with the latest ruleChangedAt wins. `"None"` means no move action.
1938
+ */
1939
+ actionMailboxId?: string;
1940
+ };
1941
+
1942
+ /**
1943
+ * Input for updating message flags (translated to IMAP flags server-side)
1944
+ */
1945
+ export type RemitImapUpdateFlagsInput = {
1946
+ /**
1947
+ * Set message as read (maps to \Seen flag)
1948
+ */
1949
+ isRead?: boolean;
1950
+ /**
1951
+ * Set message as starred (maps to \Flagged flag)
1952
+ */
1953
+ isStarred?: boolean;
1954
+ /**
1955
+ * Star color for visual categorization
1956
+ */
1957
+ starColor?: RemitImapStarColor;
1958
+ };
1959
+
1960
+ /**
1961
+ * Input for updating a draft outbox message
1962
+ */
1963
+ export type RemitImapUpdateOutboxMessageInput = {
1964
+ /**
1965
+ * Recipient addresses (To)
1966
+ */
1967
+ toAddresses?: Array<string>;
1968
+ /**
1969
+ * CC recipient addresses
1970
+ */
1971
+ ccAddresses?: Array<string>;
1972
+ /**
1973
+ * BCC recipient addresses
1974
+ */
1975
+ bccAddresses?: Array<string>;
1976
+ /**
1977
+ * Subject line
1978
+ */
1979
+ subject?: string;
1980
+ /**
1981
+ * Plain text body
1982
+ */
1983
+ textBody?: string;
1984
+ /**
1985
+ * HTML body
1986
+ */
1987
+ htmlBody?: string;
1988
+ /**
1989
+ * For replies: parent message's Message-ID
1990
+ */
1991
+ inReplyTo?: string;
1992
+ /**
1993
+ * For replies: full References chain from parent
1994
+ */
1995
+ references?: Array<string>;
1996
+ };
1997
+
1998
+ /**
1999
+ * Sender is VIP: priority surface and push escalation
2000
+ */
2001
+ export type RemitImapVipFlag = RemitImapAddressFlagBase & {
2002
+ value: boolean;
2003
+ };
2004
+
2005
+ /**
2006
+ * Sender is VIP: priority surface and push escalation
2007
+ */
2008
+ export type RemitImapVipFlagUpdate = RemitImapAddressFlagBaseUpdate & {
2009
+ value?: boolean;
2010
+ };
2011
+
2012
+ /**
2013
+ * A reciprocal-engagement candidate for VIP promotion. The user opts in via `PATCH /addresses/{addressId}` with `flags.vip = { value: true, ... }`.
2014
+ */
2015
+ export type RemitImapVipSuggestionEntry = {
2016
+ /**
2017
+ * Resolved Address identifier
2018
+ */
2019
+ addressId: Uuid;
2020
+ /**
2021
+ * Personal name phrase, when known
2022
+ */
2023
+ displayName?: string;
2024
+ /**
2025
+ * Lowercase full email address
2026
+ */
2027
+ normalizedEmail: string;
2028
+ /**
2029
+ * Number of inbound messages received from this address
2030
+ */
2031
+ inboundCount: number;
2032
+ /**
2033
+ * Number of outbound messages sent to this address
2034
+ */
2035
+ outboundCount: number;
2036
+ /**
2037
+ * Number of user replies to messages from this address
2038
+ */
2039
+ replyCount: number;
2040
+ /**
2041
+ * Timestamp (ms epoch) of the last user reply to a message from this address
2042
+ */
2043
+ lastReplyAt?: number;
2044
+ /**
2045
+ * Timestamp (ms epoch) of the last inbound message from this address
2046
+ */
2047
+ lastInboundAt?: number;
2048
+ };
2049
+
2050
+ /**
2051
+ * Response for `GET /me/vip-suggestions` — wellknown senders the user has not yet promoted to VIP, ranked by reciprocal engagement.
2052
+ */
2053
+ export type RemitImapVipSuggestionsResponse = {
2054
+ /**
2055
+ * Up to 10 ranked suggestions; empty when there are no eligible senders yet.
2056
+ */
2057
+ suggestions: Array<RemitImapVipSuggestionEntry>;
2058
+ };
2059
+
2060
+ /**
2061
+ * Sender is wellknown: engagement counters crossed the promotion threshold
2062
+ */
2063
+ export type RemitImapWellknownFlag = RemitImapAddressFlagBase & {
2064
+ value: boolean;
2065
+ };
2066
+
2067
+ /**
2068
+ * Sender is wellknown: engagement counters crossed the promotion threshold
2069
+ */
2070
+ export type RemitImapWellknownFlagUpdate = RemitImapAddressFlagBaseUpdate & {
2071
+ value?: boolean;
2072
+ };
2073
+
2074
+ export type String256 = string;
2075
+
2076
+ export type String512 = string;
2077
+
2078
+ export type String800 = string;
2079
+
2080
+ export type Uuid = string;
2081
+
2082
+ /**
2083
+ * Account response (excluding sensitive fields). Display name, mute flag, and signatures are sourced from per-account AccountSetting rows (RFC 032), not the Account entity, but are surfaced here so the response shape is unchanged.
2084
+ */
2085
+ export type RemitImapAccountResponseWritable = {
2086
+ /**
2087
+ * User-chosen display name for this account. Optional; when absent the UI derives a label from the email address. Sourced from a per-account AccountSetting row (RFC 032).
2088
+ */
2089
+ displayName?: string;
2090
+ /**
2091
+ * Account-level mute flag. When set, all mailboxes of this account are hidden from unified/brief views (sync is unaffected). Sourced from a per-account AccountSetting row (RFC 032).
2092
+ */
2093
+ muted?: RemitImapMutedFlag;
2094
+ /**
2095
+ * Plain text email signature for this account
2096
+ */
2097
+ signaturePlainText?: string;
2098
+ /**
2099
+ * HTML email signature for this account
2100
+ */
2101
+ signatureHtml?: string;
2102
+ /**
2103
+ * Per-account appointment of each canonical role (Inbox, Drafts, Sent, Archive, Junk, Trash, All, Flagged) to at most one mailbox (RFC 032 exclusive-folder-appointment, issue #976). Always carries one entry per CanonicalMailboxRole member; an entry's `mailboxId` is a persisted user choice when set, or a server-proposed detection result when the user hasn't appointed that role yet. Write with PUT /accounts/{accountId}/folder-roles/{role}.
2104
+ */
2105
+ folderAppointments: Array<RemitImapFolderAppointment>;
2106
+ };
2107
+
2108
+ /**
2109
+ * Address response for address book entries
2110
+ */
2111
+ export type RemitImapAddressResponseWritable = {
2112
+ [key: string]: unknown;
2113
+ };
2114
+
2115
+ /**
2116
+ * Body part information
2117
+ */
2118
+ export type RemitImapBodyPartResponseWritable = {
2119
+ /**
2120
+ * CloudFront-fronted URL for fetching this body part. Cookie-authenticated via Cognito id_token. Path: /content/accounts/{accountConfigId}/{accountId}/messages/{messageId}/parts/{partPath}. Required: handlers must throw rather than emit a placeholder when CONTENT_DELIVERY_DOMAIN is unset.
2121
+ */
2122
+ contentUrl: string;
2123
+ };
2124
+
2125
+ /**
2126
+ * Full configuration description including accounts
2127
+ */
2128
+ export type RemitImapConfigDescriptionResponseWritable = {
2129
+ /**
2130
+ * The account configuration
2131
+ */
2132
+ accountConfig: unknown;
2133
+ /**
2134
+ * Associated email accounts
2135
+ */
2136
+ accounts: Array<RemitImapAccountResponseWritable>;
2137
+ };
2138
+
2139
+ /**
2140
+ * Complete message description including all related data. Body content is delivered via the per-part `BodyPartResponse.contentUrl` (CloudFront, JWT-authorized at the edge); the legacy `bodyText`/`bodyHtml` fields were removed once content delivery cut over end-to-end (#224).
2141
+ */
2142
+ export type RemitImapDescribeMessageResponseWritable = {
2143
+ /**
2144
+ * Core message metadata
2145
+ */
2146
+ message: RemitImapMessageSummaryResponseWritable;
2147
+ /**
2148
+ * Envelope data
2149
+ */
2150
+ envelope: RemitImapEnvelopeResponse;
2151
+ /**
2152
+ * Message flags
2153
+ */
2154
+ flags: Array<string>;
2155
+ /**
2156
+ * Body structure. Each part exposes `contentUrl` for fetching its bytes.
2157
+ */
2158
+ bodyParts: Array<RemitImapBodyPartResponseWritable>;
2159
+ /**
2160
+ * Message references (In-Reply-To and References headers)
2161
+ */
2162
+ references: Array<unknown>;
2163
+ };
2164
+
2165
+ /**
2166
+ * Filter item returned by list/get/create/update operations. `ttl` is internal bookkeeping (RFC 034 Decision 1.3) and not surfaced.
2167
+ */
2168
+ export type RemitImapFilterResponseWritable = {
2169
+ /**
2170
+ * Plain-language name or editable label for this filter
2171
+ */
2172
+ name: String256;
2173
+ /**
2174
+ * Standing (permanent) or Temporary (expires). Governs whether expiresAt/ttl are present (RFC 034 Decision 1).
2175
+ */
2176
+ scope: RemitImapFilterScope;
2177
+ /**
2178
+ * ISO 8601 date-time with zone offset, present only when scope is Temporary (RFC 034 Decision 1.1) — a business date, not an epoch instant. Every evaluation compares `now` against this value directly; it is the source of truth for whether a Temporary filter is still active, independent of `state` or row existence.
2179
+ */
2180
+ expiresAt?: string;
2181
+ /**
2182
+ * How literalClauses combine. Meaningless when literalClauses is empty.
2183
+ */
2184
+ matchOperator: RemitImapFilterMatchOperator;
2185
+ /**
2186
+ * Literal from/subject/has-words predicate clauses (RFC 031). Empty when the filter relies solely on its semantic anchor (see hasAnchor).
2187
+ */
2188
+ literalClauses: Array<RemitImapFilterClause>;
2189
+ /**
2190
+ * Label applied when this filter matches — additive action, any number of filters can independently apply their own label (RFC 034 Decision 3.1). The named sentinel `"None"` means no label action; never an empty/optional field.
2191
+ */
2192
+ actionLabelId: string;
2193
+ /**
2194
+ * Mailbox matched messages are moved into — exclusive action, since a message lives in exactly one mailbox (RFC 034 Decision 3.1). On conflict between filters, the one with the latest ruleChangedAt wins. `"None"` means no move action.
2195
+ */
2196
+ actionMailboxId: string;
2197
+ };
2198
+
2199
+ /**
2200
+ * Mailbox item returned by list/get operations. The mute flag and the display-name override are sourced from per-mailbox AccountSetting rows (RFC 032), not the Mailbox entity, but are surfaced here so the response shape is unchanged. The canonical role a folder fills is not per-mailbox state — see AccountResponse.folderAppointments (RFC 032 exclusive-folder-appointment).
2201
+ */
2202
+ export type RemitImapMailboxResponseWritable = {
2203
+ /**
2204
+ * Namespace type: personal, other_users, or shared
2205
+ */
2206
+ namespaceType: RemitImapNamespaceType;
2207
+ /**
2208
+ * Complete mailbox path including hierarchy
2209
+ */
2210
+ fullPath: String512;
2211
+ /**
2212
+ * Mailbox-level mute flag. When set, this mailbox is hidden from unified/brief views (sync is unaffected). Sourced from a per-mailbox AccountSetting row (RFC 032).
2213
+ */
2214
+ muted?: RemitImapMutedFlag;
2215
+ /**
2216
+ * User-chosen sidebar label for this mailbox. Optional; when absent the UI uses the canonical/derived folder label. Sourced from a per-mailbox AccountSetting row (RFC 032).
2217
+ */
2218
+ displayNameOverride?: String256;
2219
+ };
2220
+
2221
+ /**
2222
+ * Core message metadata for API responses
2223
+ */
2224
+ export type RemitImapMessageSummaryResponseWritable = {
2225
+ /**
2226
+ * Present only when Remit auto-moved this message on body-sync. Absent means the message was not auto-moved by Remit.
2227
+ */
2228
+ autoMoved?: RemitImapAutoMovedInfo;
2229
+ };
2230
+
2231
+ /**
2232
+ * Job item returned by GET /accounts/{accountId}/organize/{organizeJobId}. `ttl` is internal bookkeeping and not surfaced.
2233
+ */
2234
+ export type RemitImapOrganizeJobResponseWritable = {
2235
+ [key: string]: unknown;
2236
+ };
2237
+
2238
+ /**
2239
+ * Thread message item returned by list/search operations. `category` and `senderTrust` are attached at read time via batch-fetch so the inbox row can render badges without a per-row round trip.
2240
+ */
2241
+ export type RemitImapThreadMessageResponseWritable = {
2242
+ /**
2243
+ * Header-derived category for the message (from the underlying Message). Absent for messages synced before classification rolled out — clients should treat this as `personal`.
2244
+ */
2245
+ category?: RemitImapMessageCategory;
2246
+ /**
2247
+ * Trust level for the From address, derived from AddressFlags at read time. Defaults to `unknown` when no Address row resolves.
2248
+ */
2249
+ senderTrust: RemitImapSenderTrust;
2250
+ /**
2251
+ * Structured sender-authenticity signal derived from DKIM headers at classification time (from the underlying Message). Absent for messages classified before this field was introduced — absence means no signal.
2252
+ */
2253
+ authenticity?: RemitImapMessageAuthenticity;
2254
+ /**
2255
+ * Account identifier attached at read time via a mailboxId→accountId map. Present on rows returned by `GET /threads`; absent on rows from per-mailbox endpoints (clients can resolve from the mailbox cache).
2256
+ */
2257
+ accountId?: Uuid;
2258
+ /**
2259
+ * Present only when Remit auto-moved this message on body-sync. Absent means the message was not auto-moved by Remit.
2260
+ */
2261
+ autoMoved?: RemitImapAutoMovedInfo;
2262
+ };
2263
+
2264
+ /**
2265
+ * Aggregate response for `searchThreads`. Carries the matching rows (`items`), a
2266
+ * pagination `continuationToken`, and an optional `count` of matches within the
2267
+ * server-capped window. `items` is omitted when `results=false` (count-only);
2268
+ * `count` is present only when `count=true`. Thread-specific so the shared
2269
+ * `ResultList<T>` (7 endpoints) stays untouched.
2270
+ */
2271
+ export type RemitImapThreadSearchResponseWritable = {
2272
+ /**
2273
+ * Matching thread rows for this page. Omitted when `results=false` (count-only mode).
2274
+ */
2275
+ items?: Array<RemitImapThreadMessageResponseWritable>;
2276
+ /**
2277
+ * Pass to the next call to fetch the next page; absent when the window is exhausted.
2278
+ */
2279
+ continuationToken?: String800;
2280
+ /**
2281
+ * Number of matches within the server-capped window. Present only when `count=true`.
2282
+ */
2283
+ count?: number;
2284
+ };
2285
+
2286
+ export type AccountOperationsCreateAccountData = {
2287
+ body: RemitImapCreateAccountInput;
2288
+ path?: never;
2289
+ query?: never;
2290
+ url: '/accounts';
2291
+ };
2292
+
2293
+ export type AccountOperationsCreateAccountResponses = {
2294
+ /**
2295
+ * The request has succeeded.
2296
+ */
2297
+ 200: RemitImapAccountResponse;
2298
+ };
2299
+
2300
+ export type AccountOperationsCreateAccountResponse = AccountOperationsCreateAccountResponses[keyof AccountOperationsCreateAccountResponses];
2301
+
2302
+ export type MicrosoftOAuthOperationsMicrosoftOAuthCallbackData = {
2303
+ body?: never;
2304
+ path?: never;
2305
+ query?: {
2306
+ code?: string;
2307
+ state?: string;
2308
+ error?: string;
2309
+ };
2310
+ url: '/accounts/oauth/microsoft/callback';
2311
+ };
2312
+
2313
+ export type MicrosoftOAuthOperationsMicrosoftOAuthStartData = {
2314
+ body: MicrosoftOAuthStartRequest;
2315
+ path?: never;
2316
+ query?: never;
2317
+ url: '/accounts/oauth/microsoft/start';
2318
+ };
2319
+
2320
+ export type MicrosoftOAuthOperationsMicrosoftOAuthStartResponses = {
2321
+ /**
2322
+ * The request has succeeded.
2323
+ */
2324
+ 200: MicrosoftOAuthStartResponse;
2325
+ };
2326
+
2327
+ export type MicrosoftOAuthOperationsMicrosoftOAuthStartResponse = MicrosoftOAuthOperationsMicrosoftOAuthStartResponses[keyof MicrosoftOAuthOperationsMicrosoftOAuthStartResponses];
2328
+
2329
+ export type AccountOperationsTestConnectionData = {
2330
+ body: RemitImapTestConnectionInput;
2331
+ path?: never;
2332
+ query?: never;
2333
+ url: '/accounts/test-connection';
2334
+ };
2335
+
2336
+ export type AccountOperationsTestConnectionResponses = {
2337
+ /**
2338
+ * The request has succeeded.
2339
+ */
2340
+ 200: RemitImapTestConnectionResponse;
2341
+ };
2342
+
2343
+ export type AccountOperationsTestConnectionResponse = AccountOperationsTestConnectionResponses[keyof AccountOperationsTestConnectionResponses];
2344
+
2345
+ export type AccountDetailOperationsDeleteAccountData = {
2346
+ body?: never;
2347
+ path: {
2348
+ accountId: Uuid;
2349
+ };
2350
+ query?: never;
2351
+ url: '/accounts/{accountId}';
2352
+ };
2353
+
2354
+ export type AccountDetailOperationsDeleteAccountResponses = {
2355
+ /**
2356
+ * The request has succeeded.
2357
+ */
2358
+ 200: RemitImapDeleteAccountResponse;
2359
+ };
2360
+
2361
+ export type AccountDetailOperationsDeleteAccountResponse = AccountDetailOperationsDeleteAccountResponses[keyof AccountDetailOperationsDeleteAccountResponses];
2362
+
2363
+ export type AccountDetailOperationsUpdateAccountData = {
2364
+ body: RemitImapUpdateAccountInput;
2365
+ path: {
2366
+ accountId: Uuid;
2367
+ };
2368
+ query?: never;
2369
+ url: '/accounts/{accountId}';
2370
+ };
2371
+
2372
+ export type AccountDetailOperationsUpdateAccountResponses = {
2373
+ /**
2374
+ * The request has succeeded.
2375
+ */
2376
+ 200: RemitImapAccountResponse;
2377
+ };
2378
+
2379
+ export type AccountDetailOperationsUpdateAccountResponse = AccountDetailOperationsUpdateAccountResponses[keyof AccountDetailOperationsUpdateAccountResponses];
2380
+
2381
+ export type FilterOperationsListFiltersData = {
2382
+ body?: never;
2383
+ path: {
2384
+ accountId: Uuid;
2385
+ };
2386
+ query?: {
2387
+ continuationToken?: string;
2388
+ };
2389
+ url: '/accounts/{accountId}/filters';
2390
+ };
2391
+
2392
+ export type FilterOperationsListFiltersResponses = {
2393
+ /**
2394
+ * The request has succeeded.
2395
+ */
2396
+ 200: {
2397
+ continuationToken?: String800;
2398
+ items: Array<RemitImapFilterResponse>;
2399
+ };
2400
+ };
2401
+
2402
+ export type FilterOperationsListFiltersResponse = FilterOperationsListFiltersResponses[keyof FilterOperationsListFiltersResponses];
2403
+
2404
+ export type FilterOperationsCreateFilterData = {
2405
+ body: RemitImapCreateFilterInput;
2406
+ path: {
2407
+ accountId: Uuid;
2408
+ };
2409
+ query?: never;
2410
+ url: '/accounts/{accountId}/filters';
2411
+ };
2412
+
2413
+ export type FilterOperationsCreateFilterResponses = {
2414
+ /**
2415
+ * The request has succeeded.
2416
+ */
2417
+ 200: RemitImapFilterResponse;
2418
+ };
2419
+
2420
+ export type FilterOperationsCreateFilterResponse = FilterOperationsCreateFilterResponses[keyof FilterOperationsCreateFilterResponses];
2421
+
2422
+ export type FilterDetailOperationsDeleteFilterData = {
2423
+ body?: never;
2424
+ path: {
2425
+ accountId: Uuid;
2426
+ filterId: Uuid;
2427
+ };
2428
+ query?: never;
2429
+ url: '/accounts/{accountId}/filters/{filterId}';
2430
+ };
2431
+
2432
+ export type FilterDetailOperationsDeleteFilterResponses = {
2433
+ /**
2434
+ * There is no content to send for this request, but the headers may be useful.
2435
+ */
2436
+ 204: void;
2437
+ };
2438
+
2439
+ export type FilterDetailOperationsDeleteFilterResponse = FilterDetailOperationsDeleteFilterResponses[keyof FilterDetailOperationsDeleteFilterResponses];
2440
+
2441
+ export type FilterDetailOperationsGetFilterData = {
2442
+ body?: never;
2443
+ path: {
2444
+ accountId: Uuid;
2445
+ filterId: Uuid;
2446
+ };
2447
+ query?: never;
2448
+ url: '/accounts/{accountId}/filters/{filterId}';
2449
+ };
2450
+
2451
+ export type FilterDetailOperationsGetFilterResponses = {
2452
+ /**
2453
+ * The request has succeeded.
2454
+ */
2455
+ 200: RemitImapFilterResponse;
2456
+ };
2457
+
2458
+ export type FilterDetailOperationsGetFilterResponse = FilterDetailOperationsGetFilterResponses[keyof FilterDetailOperationsGetFilterResponses];
2459
+
2460
+ export type FilterDetailOperationsUpdateFilterData = {
2461
+ body: RemitImapUpdateFilterInput;
2462
+ path: {
2463
+ accountId: Uuid;
2464
+ filterId: Uuid;
2465
+ };
2466
+ query?: never;
2467
+ url: '/accounts/{accountId}/filters/{filterId}';
2468
+ };
2469
+
2470
+ export type FilterDetailOperationsUpdateFilterResponses = {
2471
+ /**
2472
+ * The request has succeeded.
2473
+ */
2474
+ 200: RemitImapFilterResponse;
2475
+ };
2476
+
2477
+ export type FilterDetailOperationsUpdateFilterResponse = FilterDetailOperationsUpdateFilterResponses[keyof FilterDetailOperationsUpdateFilterResponses];
2478
+
2479
+ export type FolderRoleOperationsAppointFolderRoleData = {
2480
+ body: RemitImapAppointFolderRoleInput;
2481
+ path: {
2482
+ accountId: Uuid;
2483
+ role: RemitImapCanonicalMailboxRole;
2484
+ };
2485
+ query?: never;
2486
+ url: '/accounts/{accountId}/folder-roles/{role}';
2487
+ };
2488
+
2489
+ export type FolderRoleOperationsAppointFolderRoleResponses = {
2490
+ /**
2491
+ * The request has succeeded.
2492
+ */
2493
+ 200: RemitImapAccountResponse;
2494
+ };
2495
+
2496
+ export type FolderRoleOperationsAppointFolderRoleResponse = FolderRoleOperationsAppointFolderRoleResponses[keyof FolderRoleOperationsAppointFolderRoleResponses];
2497
+
2498
+ export type MailboxOperationsListMailboxesData = {
2499
+ body?: never;
2500
+ path: {
2501
+ accountId: Uuid;
2502
+ };
2503
+ query?: {
2504
+ continuationToken?: string;
2505
+ };
2506
+ url: '/accounts/{accountId}/mailboxes';
2507
+ };
2508
+
2509
+ export type MailboxOperationsListMailboxesResponses = {
2510
+ /**
2511
+ * The request has succeeded.
2512
+ */
2513
+ 200: {
2514
+ continuationToken?: String800;
2515
+ items: Array<RemitImapMailboxResponse>;
2516
+ };
2517
+ };
2518
+
2519
+ export type MailboxOperationsListMailboxesResponse = MailboxOperationsListMailboxesResponses[keyof MailboxOperationsListMailboxesResponses];
2520
+
2521
+ export type MailboxOperationsCreateMailboxData = {
2522
+ body: RemitImapCreateMailboxInput;
2523
+ path: {
2524
+ accountId: Uuid;
2525
+ };
2526
+ query?: never;
2527
+ url: '/accounts/{accountId}/mailboxes';
2528
+ };
2529
+
2530
+ export type MailboxOperationsCreateMailboxResponses = {
2531
+ /**
2532
+ * The request has succeeded.
2533
+ */
2534
+ 200: RemitImapMailboxResponse;
2535
+ };
2536
+
2537
+ export type MailboxOperationsCreateMailboxResponse = MailboxOperationsCreateMailboxResponses[keyof MailboxOperationsCreateMailboxResponses];
2538
+
2539
+ export type MailboxDetailOperationsDeleteMailboxData = {
2540
+ body?: never;
2541
+ path: {
2542
+ accountId: Uuid;
2543
+ mailboxId: Uuid;
2544
+ };
2545
+ query?: never;
2546
+ url: '/accounts/{accountId}/mailboxes/{mailboxId}';
2547
+ };
2548
+
2549
+ export type MailboxDetailOperationsDeleteMailboxResponses = {
2550
+ /**
2551
+ * There is no content to send for this request, but the headers may be useful.
2552
+ */
2553
+ 204: void;
2554
+ };
2555
+
2556
+ export type MailboxDetailOperationsDeleteMailboxResponse = MailboxDetailOperationsDeleteMailboxResponses[keyof MailboxDetailOperationsDeleteMailboxResponses];
2557
+
2558
+ export type MailboxDetailOperationsGetMailboxData = {
2559
+ body?: never;
2560
+ path: {
2561
+ accountId: Uuid;
2562
+ mailboxId: Uuid;
2563
+ };
2564
+ query?: never;
2565
+ url: '/accounts/{accountId}/mailboxes/{mailboxId}';
2566
+ };
2567
+
2568
+ export type MailboxDetailOperationsGetMailboxResponses = {
2569
+ /**
2570
+ * The request has succeeded.
2571
+ */
2572
+ 200: RemitImapMailboxResponse;
2573
+ };
2574
+
2575
+ export type MailboxDetailOperationsGetMailboxResponse = MailboxDetailOperationsGetMailboxResponses[keyof MailboxDetailOperationsGetMailboxResponses];
2576
+
2577
+ export type MailboxDetailOperationsRenameMailboxData = {
2578
+ body: RemitImapRenameMailboxInput;
2579
+ path: {
2580
+ accountId: Uuid;
2581
+ mailboxId: Uuid;
2582
+ };
2583
+ query?: never;
2584
+ url: '/accounts/{accountId}/mailboxes/{mailboxId}';
2585
+ };
2586
+
2587
+ export type MailboxDetailOperationsRenameMailboxResponses = {
2588
+ /**
2589
+ * The request has succeeded.
2590
+ */
2591
+ 200: RemitImapMailboxResponse;
2592
+ };
2593
+
2594
+ export type MailboxDetailOperationsRenameMailboxResponse = MailboxDetailOperationsRenameMailboxResponses[keyof MailboxDetailOperationsRenameMailboxResponses];
2595
+
2596
+ export type OrganizeOperationsCreateOrganizeJobData = {
2597
+ body: RemitImapOrganizeInput;
2598
+ path: {
2599
+ accountId: Uuid;
2600
+ };
2601
+ query?: never;
2602
+ url: '/accounts/{accountId}/organize';
2603
+ };
2604
+
2605
+ export type OrganizeOperationsCreateOrganizeJobResponses = {
2606
+ /**
2607
+ * Response body for POST /accounts/{accountId}/organize
2608
+ */
2609
+ 202: RemitImapCreateOrganizeJobResponse;
2610
+ };
2611
+
2612
+ export type OrganizeOperationsCreateOrganizeJobResponse = OrganizeOperationsCreateOrganizeJobResponses[keyof OrganizeOperationsCreateOrganizeJobResponses];
2613
+
2614
+ export type OrganizeOperationsPreviewOrganizeData = {
2615
+ body: RemitImapOrganizeInput;
2616
+ path: {
2617
+ accountId: Uuid;
2618
+ };
2619
+ query?: never;
2620
+ url: '/accounts/{accountId}/organize/preview';
2621
+ };
2622
+
2623
+ export type OrganizeOperationsPreviewOrganizeResponses = {
2624
+ /**
2625
+ * The request has succeeded.
2626
+ */
2627
+ 200: RemitImapOrganizePreviewResponse;
2628
+ };
2629
+
2630
+ export type OrganizeOperationsPreviewOrganizeResponse = OrganizeOperationsPreviewOrganizeResponses[keyof OrganizeOperationsPreviewOrganizeResponses];
2631
+
2632
+ export type OrganizeJobDetailOperationsGetOrganizeJobData = {
2633
+ body?: never;
2634
+ path: {
2635
+ accountId: Uuid;
2636
+ organizeJobId: Uuid;
2637
+ };
2638
+ query?: never;
2639
+ url: '/accounts/{accountId}/organize/{organizeJobId}';
2640
+ };
2641
+
2642
+ export type OrganizeJobDetailOperationsGetOrganizeJobResponses = {
2643
+ /**
2644
+ * The request has succeeded.
2645
+ */
2646
+ 200: RemitImapOrganizeJobResponse;
2647
+ };
2648
+
2649
+ export type OrganizeJobDetailOperationsGetOrganizeJobResponse = OrganizeJobDetailOperationsGetOrganizeJobResponses[keyof OrganizeJobDetailOperationsGetOrganizeJobResponses];
2650
+
2651
+ export type SyncOperationsTriggerSyncData = {
2652
+ body?: never;
2653
+ path: {
2654
+ accountId: Uuid;
2655
+ };
2656
+ query?: never;
2657
+ url: '/accounts/{accountId}/sync';
2658
+ };
2659
+
2660
+ export type SyncOperationsTriggerSyncResponses = {
2661
+ /**
2662
+ * The request has succeeded.
2663
+ */
2664
+ 200: RemitImapSyncTriggerResponse;
2665
+ };
2666
+
2667
+ export type SyncOperationsTriggerSyncResponse = SyncOperationsTriggerSyncResponses[keyof SyncOperationsTriggerSyncResponses];
2668
+
2669
+ export type SyncOperationsGetSyncStatusData = {
2670
+ body?: never;
2671
+ path: {
2672
+ accountId: Uuid;
2673
+ };
2674
+ query?: never;
2675
+ url: '/accounts/{accountId}/sync/status';
2676
+ };
2677
+
2678
+ export type SyncOperationsGetSyncStatusResponses = {
2679
+ /**
2680
+ * The request has succeeded.
2681
+ */
2682
+ 200: RemitImapAccountSyncStatusResponse;
2683
+ };
2684
+
2685
+ export type SyncOperationsGetSyncStatusResponse = SyncOperationsGetSyncStatusResponses[keyof SyncOperationsGetSyncStatusResponses];
2686
+
2687
+ export type TrashOperationsEmptyTrashData = {
2688
+ body?: never;
2689
+ path: {
2690
+ accountId: Uuid;
2691
+ };
2692
+ query?: never;
2693
+ url: '/accounts/{accountId}/trash/empty';
2694
+ };
2695
+
2696
+ export type TrashOperationsEmptyTrashResponses = {
2697
+ /**
2698
+ * The request has succeeded.
2699
+ */
2700
+ 200: RemitImapEmptyTrashResponse;
2701
+ };
2702
+
2703
+ export type TrashOperationsEmptyTrashResponse = TrashOperationsEmptyTrashResponses[keyof TrashOperationsEmptyTrashResponses];
2704
+
2705
+ export type AddressOperationsSearchAddressesData = {
2706
+ body?: never;
2707
+ path?: never;
2708
+ query: {
2709
+ q: string;
2710
+ limit?: number;
2711
+ };
2712
+ url: '/addresses/search';
2713
+ };
2714
+
2715
+ export type AddressOperationsSearchAddressesResponses = {
2716
+ /**
2717
+ * The request has succeeded.
2718
+ */
2719
+ 200: {
2720
+ continuationToken?: String800;
2721
+ items: Array<RemitImapAddressResponse>;
2722
+ };
2723
+ };
2724
+
2725
+ export type AddressOperationsSearchAddressesResponse = AddressOperationsSearchAddressesResponses[keyof AddressOperationsSearchAddressesResponses];
2726
+
2727
+ export type AddressDetailOperationsUpdateAddressData = {
2728
+ body: RemitImapUpdateAddressInput;
2729
+ path: {
2730
+ addressId: Uuid;
2731
+ };
2732
+ query?: never;
2733
+ url: '/addresses/{addressId}';
2734
+ };
2735
+
2736
+ export type AddressDetailOperationsUpdateAddressResponses = {
2737
+ /**
2738
+ * The request has succeeded.
2739
+ */
2740
+ 200: RemitImapAddressResponse;
2741
+ };
2742
+
2743
+ export type AddressDetailOperationsUpdateAddressResponse = AddressDetailOperationsUpdateAddressResponses[keyof AddressDetailOperationsUpdateAddressResponses];
2744
+
2745
+ export type ConfigOperationsGetConfigData = {
2746
+ body?: never;
2747
+ path?: never;
2748
+ query?: never;
2749
+ url: '/config';
2750
+ };
2751
+
2752
+ export type ConfigOperationsGetConfigResponses = {
2753
+ /**
2754
+ * The request has succeeded.
2755
+ */
2756
+ 200: RemitImapConfigDescriptionResponse;
2757
+ };
2758
+
2759
+ export type ConfigOperationsGetConfigResponse = ConfigOperationsGetConfigResponses[keyof ConfigOperationsGetConfigResponses];
2760
+
2761
+ export type ThreadOperationsListThreadsData = {
2762
+ body?: never;
2763
+ path: {
2764
+ mailboxId: Uuid;
2765
+ };
2766
+ query?: {
2767
+ continuationToken?: string;
2768
+ order?: RemitImapSortOrder;
2769
+ };
2770
+ url: '/mailboxes/{mailboxId}/threads';
2771
+ };
2772
+
2773
+ export type ThreadOperationsListThreadsResponses = {
2774
+ /**
2775
+ * The request has succeeded.
2776
+ */
2777
+ 200: {
2778
+ continuationToken?: String800;
2779
+ items: Array<RemitImapThreadMessageResponse>;
2780
+ };
2781
+ };
2782
+
2783
+ export type ThreadOperationsListThreadsResponse = ThreadOperationsListThreadsResponses[keyof ThreadOperationsListThreadsResponses];
2784
+
2785
+ export type ThreadOperationsSearchThreadsData = {
2786
+ body?: never;
2787
+ path: {
2788
+ mailboxId: Uuid;
2789
+ };
2790
+ query?: {
2791
+ continuationToken?: string;
2792
+ order?: RemitImapSortOrder;
2793
+ query?: string;
2794
+ subject?: string;
2795
+ from?: string;
2796
+ unread?: boolean;
2797
+ starred?: boolean;
2798
+ attachments?: boolean;
2799
+ /**
2800
+ * Filter to messages whose From address has one of these trust levels. Off-row criterion, resolved by in-handler enrichment over the capped window.
2801
+ */
2802
+ senderTrust?: Array<RemitImapSenderTrust>;
2803
+ /**
2804
+ * Filter to messages with one of these header-derived categories. Off-row criterion, resolved by in-handler enrichment over the capped window.
2805
+ */
2806
+ category?: Array<RemitImapMessageCategory>;
2807
+ /**
2808
+ * Filter on the DKIM-alignment signal (true = DKIM mismatch). Off-row criterion; rows without an authenticity signal never match.
2809
+ */
2810
+ dkimMismatch?: boolean;
2811
+ /**
2812
+ * Include a count of matches within the server-capped window.
2813
+ */
2814
+ count?: boolean;
2815
+ /**
2816
+ * Return matching rows. Default true; set false for a count-only response.
2817
+ */
2818
+ results?: boolean;
2819
+ /**
2820
+ * Caller-set recency window, capped server-side at 500. Bounds the read.
2821
+ */
2822
+ limit?: number;
2823
+ };
2824
+ url: '/mailboxes/{mailboxId}/threads/search';
2825
+ };
2826
+
2827
+ export type ThreadOperationsSearchThreadsResponses = {
2828
+ /**
2829
+ * The request has succeeded.
2830
+ */
2831
+ 200: RemitImapThreadSearchResponse;
2832
+ };
2833
+
2834
+ export type ThreadOperationsSearchThreadsResponse = ThreadOperationsSearchThreadsResponses[keyof ThreadOperationsSearchThreadsResponses];
2835
+
2836
+ export type MeOperationsDeleteMeData = {
2837
+ body: RemitImapDeleteMeInput;
2838
+ path?: never;
2839
+ query?: never;
2840
+ url: '/me';
2841
+ };
2842
+
2843
+ export type MeOperationsDeleteMeErrors = {
2844
+ /**
2845
+ * Validation error response
2846
+ */
2847
+ 400: ApiError;
2848
+ };
2849
+
2850
+ export type MeOperationsDeleteMeError = MeOperationsDeleteMeErrors[keyof MeOperationsDeleteMeErrors];
2851
+
2852
+ export type MeOperationsDeleteMeResponses = {
2853
+ /**
2854
+ * Response for DELETE /me (account erasure request)
2855
+ */
2856
+ 202: RemitImapDeleteAccountConfigResponse;
2857
+ };
2858
+
2859
+ export type MeOperationsDeleteMeResponse = MeOperationsDeleteMeResponses[keyof MeOperationsDeleteMeResponses];
2860
+
2861
+ export type MeOperationsCreateExportData = {
2862
+ body?: never;
2863
+ path?: never;
2864
+ query?: never;
2865
+ url: '/me/export';
2866
+ };
2867
+
2868
+ export type MeOperationsCreateExportResponses = {
2869
+ /**
2870
+ * Response body for POST /me/export
2871
+ */
2872
+ 202: RemitImapCreateExportResponse;
2873
+ };
2874
+
2875
+ export type MeOperationsCreateExportResponse = MeOperationsCreateExportResponses[keyof MeOperationsCreateExportResponses];
2876
+
2877
+ export type MeOperationsGetExportData = {
2878
+ body?: never;
2879
+ path: {
2880
+ exportId: string;
2881
+ };
2882
+ query?: never;
2883
+ url: '/me/export/{exportId}';
2884
+ };
2885
+
2886
+ export type MeOperationsGetExportResponses = {
2887
+ /**
2888
+ * The request has succeeded.
2889
+ */
2890
+ 200: RemitImapAccountExportRequestResponse;
2891
+ };
2892
+
2893
+ export type MeOperationsGetExportResponse = MeOperationsGetExportResponses[keyof MeOperationsGetExportResponses];
2894
+
2895
+ export type MeOperationsListVipSuggestionsData = {
2896
+ body?: never;
2897
+ path?: never;
2898
+ query?: never;
2899
+ url: '/me/vip-suggestions';
2900
+ };
2901
+
2902
+ export type MeOperationsListVipSuggestionsResponses = {
2903
+ /**
2904
+ * The request has succeeded.
2905
+ */
2906
+ 200: RemitImapVipSuggestionsResponse;
2907
+ };
2908
+
2909
+ export type MeOperationsListVipSuggestionsResponse = MeOperationsListVipSuggestionsResponses[keyof MeOperationsListVipSuggestionsResponses];
2910
+
2911
+ export type MessageBulkOperationsCopyMessagesData = {
2912
+ body: RemitImapCopyMessagesInput;
2913
+ path?: never;
2914
+ query?: never;
2915
+ url: '/messages/copy';
2916
+ };
2917
+
2918
+ export type MessageBulkOperationsCopyMessagesResponses = {
2919
+ /**
2920
+ * The request has succeeded.
2921
+ */
2922
+ 200: RemitImapMessageBulkOperationResult;
2923
+ };
2924
+
2925
+ export type MessageBulkOperationsCopyMessagesResponse = MessageBulkOperationsCopyMessagesResponses[keyof MessageBulkOperationsCopyMessagesResponses];
2926
+
2927
+ export type MessageBulkOperationsDeleteMessagesData = {
2928
+ body: RemitImapDeleteMessagesInput;
2929
+ path?: never;
2930
+ query?: never;
2931
+ url: '/messages/delete';
2932
+ };
2933
+
2934
+ export type MessageBulkOperationsDeleteMessagesResponses = {
2935
+ /**
2936
+ * The request has succeeded.
2937
+ */
2938
+ 200: RemitImapMessageBulkOperationResult;
2939
+ };
2940
+
2941
+ export type MessageBulkOperationsDeleteMessagesResponse = MessageBulkOperationsDeleteMessagesResponses[keyof MessageBulkOperationsDeleteMessagesResponses];
2942
+
2943
+ export type MessageBulkOperationsUpdateFlagsData = {
2944
+ body: RemitImapBulkUpdateFlagsInput;
2945
+ path?: never;
2946
+ query?: never;
2947
+ url: '/messages/flags';
2948
+ };
2949
+
2950
+ export type MessageBulkOperationsUpdateFlagsResponses = {
2951
+ /**
2952
+ * The request has succeeded.
2953
+ */
2954
+ 200: RemitImapMessageBulkOperationResult;
2955
+ };
2956
+
2957
+ export type MessageBulkOperationsUpdateFlagsResponse = MessageBulkOperationsUpdateFlagsResponses[keyof MessageBulkOperationsUpdateFlagsResponses];
2958
+
2959
+ export type MessageBulkOperationsMoveMessagesData = {
2960
+ body: RemitImapMoveMessagesInput;
2961
+ path?: never;
2962
+ query?: never;
2963
+ url: '/messages/move';
2964
+ };
2965
+
2966
+ export type MessageBulkOperationsMoveMessagesResponses = {
2967
+ /**
2968
+ * The request has succeeded.
2969
+ */
2970
+ 200: RemitImapMessageBulkOperationResult;
2971
+ };
2972
+
2973
+ export type MessageBulkOperationsMoveMessagesResponse = MessageBulkOperationsMoveMessagesResponses[keyof MessageBulkOperationsMoveMessagesResponses];
2974
+
2975
+ export type MessageOperationsDescribeMessageData = {
2976
+ body?: never;
2977
+ path: {
2978
+ messageId: Uuid;
2979
+ };
2980
+ query?: never;
2981
+ url: '/messages/{messageId}';
2982
+ };
2983
+
2984
+ export type MessageOperationsDescribeMessageResponses = {
2985
+ /**
2986
+ * The request has succeeded.
2987
+ */
2988
+ 200: RemitImapDescribeMessageResponse;
2989
+ };
2990
+
2991
+ export type MessageOperationsDescribeMessageResponse = MessageOperationsDescribeMessageResponses[keyof MessageOperationsDescribeMessageResponses];
2992
+
2993
+ export type MessageOperationsUpdateMessageFlagsData = {
2994
+ body: RemitImapUpdateFlagsInput;
2995
+ path: {
2996
+ messageId: Uuid;
2997
+ };
2998
+ query?: never;
2999
+ url: '/messages/{messageId}/flags';
3000
+ };
3001
+
3002
+ export type MessageOperationsUpdateMessageFlagsResponses = {
3003
+ /**
3004
+ * The request has succeeded.
3005
+ */
3006
+ 200: {
3007
+ messageId: Uuid;
3008
+ isRead: boolean;
3009
+ isStarred: boolean;
3010
+ };
3011
+ };
3012
+
3013
+ export type MessageOperationsUpdateMessageFlagsResponse = MessageOperationsUpdateMessageFlagsResponses[keyof MessageOperationsUpdateMessageFlagsResponses];
3014
+
3015
+ export type MessageOperationsGetRawMessageData = {
3016
+ body?: never;
3017
+ path: {
3018
+ messageId: Uuid;
3019
+ };
3020
+ query?: never;
3021
+ url: '/messages/{messageId}/raw';
3022
+ };
3023
+
3024
+ export type MessageOperationsGetRawMessageResponses = {
3025
+ /**
3026
+ * The request has succeeded.
3027
+ */
3028
+ 200: RemitImapRawMessageResponse;
3029
+ };
3030
+
3031
+ export type MessageOperationsGetRawMessageResponse = MessageOperationsGetRawMessageResponses[keyof MessageOperationsGetRawMessageResponses];
3032
+
3033
+ export type OutboxOperationsListOutboxMessagesData = {
3034
+ body?: never;
3035
+ path?: never;
3036
+ query?: {
3037
+ continuationToken?: string;
3038
+ };
3039
+ url: '/outbox';
3040
+ };
3041
+
3042
+ export type OutboxOperationsListOutboxMessagesResponses = {
3043
+ /**
3044
+ * The request has succeeded.
3045
+ */
3046
+ 200: {
3047
+ continuationToken?: String800;
3048
+ items: Array<RemitImapOutboxMessageResponse>;
3049
+ };
3050
+ };
3051
+
3052
+ export type OutboxOperationsListOutboxMessagesResponse = OutboxOperationsListOutboxMessagesResponses[keyof OutboxOperationsListOutboxMessagesResponses];
3053
+
3054
+ export type OutboxOperationsCreateOutboxMessageData = {
3055
+ body: RemitImapCreateOutboxMessageInput;
3056
+ path?: never;
3057
+ query?: never;
3058
+ url: '/outbox';
3059
+ };
3060
+
3061
+ export type OutboxOperationsCreateOutboxMessageResponses = {
3062
+ /**
3063
+ * The request has succeeded.
3064
+ */
3065
+ 200: RemitImapOutboxMessageResponse;
3066
+ };
3067
+
3068
+ export type OutboxOperationsCreateOutboxMessageResponse = OutboxOperationsCreateOutboxMessageResponses[keyof OutboxOperationsCreateOutboxMessageResponses];
3069
+
3070
+ export type OutboxDetailOperationsDeleteOutboxMessageData = {
3071
+ body?: never;
3072
+ path: {
3073
+ outboxMessageId: Uuid;
3074
+ };
3075
+ query?: never;
3076
+ url: '/outbox/{outboxMessageId}';
3077
+ };
3078
+
3079
+ export type OutboxDetailOperationsDeleteOutboxMessageResponses = {
3080
+ /**
3081
+ * There is no content to send for this request, but the headers may be useful.
3082
+ */
3083
+ 204: void;
3084
+ };
3085
+
3086
+ export type OutboxDetailOperationsDeleteOutboxMessageResponse = OutboxDetailOperationsDeleteOutboxMessageResponses[keyof OutboxDetailOperationsDeleteOutboxMessageResponses];
3087
+
3088
+ export type OutboxDetailOperationsGetOutboxMessageData = {
3089
+ body?: never;
3090
+ path: {
3091
+ outboxMessageId: Uuid;
3092
+ };
3093
+ query?: never;
3094
+ url: '/outbox/{outboxMessageId}';
3095
+ };
3096
+
3097
+ export type OutboxDetailOperationsGetOutboxMessageResponses = {
3098
+ /**
3099
+ * The request has succeeded.
3100
+ */
3101
+ 200: RemitImapOutboxMessageResponse;
3102
+ };
3103
+
3104
+ export type OutboxDetailOperationsGetOutboxMessageResponse = OutboxDetailOperationsGetOutboxMessageResponses[keyof OutboxDetailOperationsGetOutboxMessageResponses];
3105
+
3106
+ export type OutboxDetailOperationsUpdateOutboxMessageData = {
3107
+ body: RemitImapUpdateOutboxMessageInput;
3108
+ path: {
3109
+ outboxMessageId: Uuid;
3110
+ };
3111
+ query?: never;
3112
+ url: '/outbox/{outboxMessageId}';
3113
+ };
3114
+
3115
+ export type OutboxDetailOperationsUpdateOutboxMessageResponses = {
3116
+ /**
3117
+ * The request has succeeded.
3118
+ */
3119
+ 200: RemitImapOutboxMessageResponse;
3120
+ };
3121
+
3122
+ export type OutboxDetailOperationsUpdateOutboxMessageResponse = OutboxDetailOperationsUpdateOutboxMessageResponses[keyof OutboxDetailOperationsUpdateOutboxMessageResponses];
3123
+
3124
+ export type OutboxDetailOperationsSendOutboxMessageData = {
3125
+ body?: never;
3126
+ path: {
3127
+ outboxMessageId: Uuid;
3128
+ };
3129
+ query?: never;
3130
+ url: '/outbox/{outboxMessageId}/send';
3131
+ };
3132
+
3133
+ export type OutboxDetailOperationsSendOutboxMessageResponses = {
3134
+ /**
3135
+ * The request has succeeded.
3136
+ */
3137
+ 200: RemitImapOutboxMessageResponse;
3138
+ };
3139
+
3140
+ export type OutboxDetailOperationsSendOutboxMessageResponse = OutboxDetailOperationsSendOutboxMessageResponses[keyof OutboxDetailOperationsSendOutboxMessageResponses];
3141
+
3142
+ export type SemanticSearchOperationsSemanticSearchData = {
3143
+ body?: never;
3144
+ path?: never;
3145
+ query: {
3146
+ /**
3147
+ * Free-form natural-language query
3148
+ */
3149
+ query: string;
3150
+ /**
3151
+ * Restrict results to a single mailbox
3152
+ */
3153
+ mailboxId?: Uuid;
3154
+ /**
3155
+ * Lower bound on sentDate (epoch seconds, inclusive)
3156
+ */
3157
+ sentDateFrom?: number;
3158
+ /**
3159
+ * Upper bound on sentDate (epoch seconds, inclusive)
3160
+ */
3161
+ sentDateTo?: number;
3162
+ /**
3163
+ * Restrict to messages with or without attachments
3164
+ */
3165
+ hasAttachment?: boolean;
3166
+ /**
3167
+ * Restrict to starred or unstarred messages
3168
+ */
3169
+ hasStars?: boolean;
3170
+ /**
3171
+ * Restrict to read or unread messages
3172
+ */
3173
+ isRead?: boolean;
3174
+ /**
3175
+ * Restrict results to a single header-derived category
3176
+ */
3177
+ category?: RemitImapMessageCategory;
3178
+ /**
3179
+ * Maximum number of results to return
3180
+ */
3181
+ limit?: number;
3182
+ };
3183
+ url: '/search/semantic';
3184
+ };
3185
+
3186
+ export type SemanticSearchOperationsSemanticSearchResponses = {
3187
+ /**
3188
+ * The request has succeeded.
3189
+ */
3190
+ 200: {
3191
+ items: Array<RemitImapSemanticSearchResult>;
3192
+ };
3193
+ };
3194
+
3195
+ export type SemanticSearchOperationsSemanticSearchResponse = SemanticSearchOperationsSemanticSearchResponses[keyof SemanticSearchOperationsSemanticSearchResponses];
3196
+
3197
+ export type UnifiedThreadOperationsListAllThreadsData = {
3198
+ body?: never;
3199
+ path?: never;
3200
+ query?: {
3201
+ continuationToken?: string;
3202
+ order?: RemitImapSortOrder;
3203
+ limit?: number;
3204
+ };
3205
+ url: '/threads';
3206
+ };
3207
+
3208
+ export type UnifiedThreadOperationsListAllThreadsResponses = {
3209
+ /**
3210
+ * The request has succeeded.
3211
+ */
3212
+ 200: {
3213
+ continuationToken?: String800;
3214
+ items: Array<RemitImapThreadMessageResponse>;
3215
+ };
3216
+ };
3217
+
3218
+ export type UnifiedThreadOperationsListAllThreadsResponse = UnifiedThreadOperationsListAllThreadsResponses[keyof UnifiedThreadOperationsListAllThreadsResponses];
3219
+
3220
+ export type ThreadDetailOperationsListThreadMessagesData = {
3221
+ body?: never;
3222
+ path: {
3223
+ threadId: Uuid;
3224
+ };
3225
+ query?: {
3226
+ order?: RemitImapSortOrder;
3227
+ /**
3228
+ * Filter messages to only those in this mailbox (useful for deduplication)
3229
+ */
3230
+ mailboxId?: Uuid;
3231
+ };
3232
+ url: '/threads/{threadId}/messages';
3233
+ };
3234
+
3235
+ export type ThreadDetailOperationsListThreadMessagesResponses = {
3236
+ /**
3237
+ * The request has succeeded.
3238
+ */
3239
+ 200: {
3240
+ continuationToken?: String800;
3241
+ items: Array<RemitImapThreadMessageResponse>;
3242
+ };
3243
+ };
3244
+
3245
+ export type ThreadDetailOperationsListThreadMessagesResponse = ThreadDetailOperationsListThreadMessagesResponses[keyof ThreadDetailOperationsListThreadMessagesResponses];