@remit/api-zod-schemas 0.0.60 → 0.0.61

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/schemas.ts CHANGED
@@ -13,6 +13,8 @@ export const QuarantineFailureStageSchema = z.enum(["BodyParse"]);
13
13
 
14
14
  export const QuarantineFailureCodeSchema = z.enum(["UnknownCharset", "UnreadableBody"]);
15
15
 
16
+ export const SyncWarningStageSchema = z.enum(["Header", "Body"]);
17
+
16
18
  export const AccountConfigStateSchema = z.enum(["active", "deleting"]);
17
19
 
18
20
  export const AccountAuthTypeSchema = z.enum(["password", "oauthMicrosoft"]);
@@ -89,8 +91,6 @@ export const MessageMutationSchema = z.enum(["none", "move", "delete", "copy"]);
89
91
 
90
92
  export const PlacementActionSchema = z.enum(["MoveToInbox", "MoveToJunk"]);
91
93
 
92
- export const SemanticSearchChunkTypeSchema = z.enum(["sender", "recipient", "subject", "attachment", "body", "entities"]);
93
-
94
94
  export const OutboxMessageStatusSchema = z.enum(["draft", "queued", "sending", "sent", "unfiled", "failed", "blocked"]);
95
95
 
96
96
  export const OutboxAttachmentStateSchema = z.enum(["Pending", "Stored"]);
@@ -149,6 +149,8 @@ export const ConfigImportStateSchema = z.enum(["Pending", "Complete"]);
149
149
 
150
150
  export const ConfigImportRefKindSchema = z.enum(["FolderRole", "MailboxOverride", "FilterAction"]);
151
151
 
152
+ export const SyncWarningStateSchema = z.enum(["Retrying", "GaveUp"]);
153
+
152
154
  export const MessagePlacementMoveStateSchema = z.enum(["pending", "queued", "processing", "processed"]);
153
155
 
154
156
  export const FlagPushOperationSchema = z.enum(["add", "remove"]);
@@ -156,8 +158,8 @@ export const FlagPushOperationSchema = z.enum(["add", "remove"]);
156
158
  export const MessageFlagPushStateSchema = z.enum(["pending", "queued", "processing", "processed"]);
157
159
 
158
160
  export const CognitoAuthorizerSchema = z.object({
159
- type: z.unknown(),
160
- "in": z.unknown(),
161
+ type: z.literal("apiKey"),
162
+ "in": z.literal("header"),
161
163
  name: z.literal("Authorization")
162
164
  });
163
165
 
@@ -293,7 +295,7 @@ export const DeleteAccountConfigResponseSchema = z.object({
293
295
  });
294
296
 
295
297
  export const VipSuggestionEntrySchema = z.object({
296
- addressId: z.string(),
298
+ addressId: z.string().min(25).max(25),
297
299
  displayName: z.string().optional(),
298
300
  normalizedEmail: z.string(),
299
301
  inboundCount: z.number(),
@@ -313,8 +315,8 @@ export const CreateExportResponseSchema = z.object({
313
315
  });
314
316
 
315
317
  export const AccountExportRequestSchema = z.object({
316
- accountExportRequestId: z.string(),
317
- accountConfigId: z.string(),
318
+ accountExportRequestId: z.string().min(25).max(25),
319
+ accountConfigId: z.string().min(25).max(25),
318
320
  userId: z.string(),
319
321
  state: AccountExportStateSchema,
320
322
  createdAt: z.number(),
@@ -326,8 +328,8 @@ export const AccountExportRequestSchema = z.object({
326
328
  });
327
329
 
328
330
  export const AccountExportRequestResponseSchema = z.object({
329
- accountExportRequestId: z.string(),
330
- accountConfigId: z.string(),
331
+ accountExportRequestId: z.string().min(25).max(25),
332
+ accountConfigId: z.string().min(25).max(25),
331
333
  userId: z.string(),
332
334
  state: AccountExportStateSchema,
333
335
  createdAt: z.number(),
@@ -340,68 +342,94 @@ export const AccountExportRequestResponseSchema = z.object({
340
342
 
341
343
  export const QuarantineMimeNodeSchema = z.object({
342
344
  depth: z.number(),
343
- contentType: z.string()
345
+ contentType: z.string().max(140)
344
346
  });
345
347
 
346
348
  export const QuarantineResponseSchema = z.object({
347
- quarantineId: z.string(),
348
- accountConfigId: z.string(),
349
- accountId: z.string(),
350
- mailboxId: z.string(),
349
+ quarantineId: z.string().min(25).max(25),
350
+ accountConfigId: z.string().min(25).max(25),
351
+ accountId: z.string().min(25).max(25),
352
+ mailboxId: z.string().min(25).max(25),
351
353
  uidValidity: z.number(),
352
354
  uid: z.number(),
353
355
  mailboxRole: CanonicalMailboxRoleSchema.optional(),
354
- mailboxPath: z.string(),
356
+ mailboxPath: z.string().max(512),
355
357
  quarantinedAt: z.number(),
356
358
  attempts: z.number(),
357
359
  failureStage: QuarantineFailureStageSchema,
358
360
  failureCode: QuarantineFailureCodeSchema,
359
- failureMessage: z.string(),
360
- failurePartPath: z.string().optional(),
361
- workerVersion: z.string(),
362
- contentType: z.string().optional(),
363
- transferEncoding: z.string().optional(),
364
- charset: z.string().optional(),
361
+ failureMessage: z.string().max(512),
362
+ failurePartPath: z.string().max(140).optional(),
363
+ workerVersion: z.string().max(64),
364
+ contentType: z.string().max(140).optional(),
365
+ transferEncoding: z.string().max(64).optional(),
366
+ charset: z.string().max(64).optional(),
365
367
  sizeBytes: z.number().optional(),
366
368
  structure: z.array(QuarantineMimeNodeSchema),
367
- messageIdHash: z.string().optional(),
369
+ messageIdHash: z.string().max(140).optional(),
368
370
  createdAt: z.number(),
369
371
  updatedAt: z.number()
370
372
  });
371
373
 
374
+ export const SyncWarningResponseSchema = z.object({
375
+ syncWarningId: z.string().min(25).max(25),
376
+ accountConfigId: z.string().min(25).max(25),
377
+ accountId: z.string().min(25).max(25),
378
+ mailboxId: z.string().min(25).max(25),
379
+ uidValidity: z.number(),
380
+ uid: z.number(),
381
+ stage: SyncWarningStageSchema,
382
+ attempts: z.number(),
383
+ createdAt: z.number()
384
+ });
385
+
372
386
  export const QuarantineListResponseSchema = z.object({
373
- entries: z.array(QuarantineResponseSchema)
387
+ entries: z.array(QuarantineResponseSchema),
388
+ warnings: z.array(SyncWarningResponseSchema),
389
+ warningsTotal: z.number()
374
390
  });
375
391
 
376
392
  export const QuarantineSchema = z.object({
377
- quarantineId: z.string(),
378
- accountConfigId: z.string(),
379
- accountId: z.string(),
380
- mailboxId: z.string(),
393
+ quarantineId: z.string().min(25).max(25),
394
+ accountConfigId: z.string().min(25).max(25),
395
+ accountId: z.string().min(25).max(25),
396
+ mailboxId: z.string().min(25).max(25),
381
397
  uidValidity: z.number(),
382
398
  uid: z.number(),
383
399
  mailboxRole: CanonicalMailboxRoleSchema.optional(),
384
- mailboxPath: z.string(),
400
+ mailboxPath: z.string().max(512),
385
401
  quarantinedAt: z.number(),
386
402
  attempts: z.number(),
387
403
  failureStage: QuarantineFailureStageSchema,
388
404
  failureCode: QuarantineFailureCodeSchema,
389
- failureMessage: z.string(),
390
- failurePartPath: z.string().optional(),
391
- workerVersion: z.string(),
392
- contentType: z.string().optional(),
393
- transferEncoding: z.string().optional(),
394
- charset: z.string().optional(),
405
+ failureMessage: z.string().max(512),
406
+ failurePartPath: z.string().max(140).optional(),
407
+ workerVersion: z.string().max(64),
408
+ contentType: z.string().max(140).optional(),
409
+ transferEncoding: z.string().max(64).optional(),
410
+ charset: z.string().max(64).optional(),
395
411
  sizeBytes: z.number().optional(),
396
412
  structure: z.array(QuarantineMimeNodeSchema),
397
- messageIdHash: z.string().optional(),
413
+ messageIdHash: z.string().max(140).optional(),
398
414
  createdAt: z.number(),
399
415
  updatedAt: z.number()
400
416
  });
401
417
 
418
+ export const SyncWarningSchema = z.object({
419
+ syncWarningId: z.string().min(25).max(25),
420
+ accountConfigId: z.string().min(25).max(25),
421
+ accountId: z.string().min(25).max(25),
422
+ mailboxId: z.string().min(25).max(25),
423
+ uidValidity: z.number(),
424
+ uid: z.number(),
425
+ stage: SyncWarningStageSchema,
426
+ attempts: z.number(),
427
+ createdAt: z.number()
428
+ });
429
+
402
430
  export const AccountConfigResponseSchema = z.object({
403
- accountConfigId: z.string(),
404
- userId: z.string(),
431
+ accountConfigId: z.string().min(25).max(25),
432
+ userId: z.string().min(25).max(25),
405
433
  name: z.string().optional(),
406
434
  state: AccountConfigStateSchema,
407
435
  deletedAt: z.number().optional(),
@@ -421,26 +449,26 @@ export const MutedFlagSchema = z.object({
421
449
  export const FolderAppointmentSchema = z.object({
422
450
  role: CanonicalMailboxRoleSchema,
423
451
  source: FolderAppointmentSourceSchema,
424
- mailboxId: z.string().optional(),
425
- staleAppointmentMailboxId: z.string().optional(),
426
- staleAppointmentPath: z.string().optional()
452
+ mailboxId: z.string().min(25).max(25).optional(),
453
+ staleAppointmentMailboxId: z.string().min(25).max(25).optional(),
454
+ staleAppointmentPath: z.string().max(512).optional()
427
455
  });
428
456
 
429
457
  export const AccountResponseSchema = z.object({
430
- accountId: z.string(),
431
- accountConfigId: z.string(),
432
- username: z.string(),
458
+ accountId: z.string().min(25).max(25),
459
+ accountConfigId: z.string().min(25).max(25),
460
+ username: z.string().min(1),
433
461
  email: z.string(),
434
462
  authType: AccountAuthTypeSchema,
435
463
  syncedServices: z.array(AccountServiceSchema),
436
464
  grantedScopes: z.array(z.string()),
437
- imapHost: z.string(),
438
- imapPort: z.number(),
465
+ imapHost: z.string().min(1),
466
+ imapPort: z.number().min(1).max(65535),
439
467
  imapTls: z.boolean(),
440
468
  imapStartTls: z.boolean(),
441
469
  smtpEnabled: z.boolean(),
442
470
  smtpHost: z.string(),
443
- smtpPort: z.number(),
471
+ smtpPort: z.number().min(1).max(65535),
444
472
  smtpTls: z.boolean(),
445
473
  smtpStartTls: z.boolean(),
446
474
  smtpUsername: z.string(),
@@ -450,8 +478,8 @@ export const AccountResponseSchema = z.object({
450
478
  lastSyncAt: z.number().optional(),
451
479
  lastError: z.string().optional(),
452
480
  syncPhase: SyncPhaseSchema.optional(),
453
- mailboxCountTotal: z.number().optional(),
454
- mailboxCountSynced: z.number().optional(),
481
+ mailboxCountTotal: z.number().min(0).optional(),
482
+ mailboxCountSynced: z.number().min(0).optional(),
455
483
  createdAt: z.number(),
456
484
  updatedAt: z.number(),
457
485
  displayName: z.string().optional(),
@@ -463,20 +491,20 @@ export const AccountResponseSchema = z.object({
463
491
  });
464
492
 
465
493
  export const PendingConfigImportSchema = z.object({
466
- importId: z.string(),
494
+ importId: z.string().min(25).max(25),
467
495
  folderPaths: z.array(z.string())
468
496
  });
469
497
 
470
498
  export const ConfigDescriptionResponseSchema = z.object({
471
499
  accountConfig: AccountConfigResponseSchema,
472
500
  accounts: z.array(AccountResponseSchema),
473
- pendingImport: PendingConfigImportSchema.optional(),
474
- semanticSearchEnabled: z.boolean()
501
+ buildCommit: z.string(),
502
+ pendingImport: PendingConfigImportSchema.optional()
475
503
  });
476
504
 
477
505
  export const AccountConfigSchema = z.object({
478
- accountConfigId: z.string(),
479
- userId: z.string(),
506
+ accountConfigId: z.string().min(25).max(25),
507
+ userId: z.string().min(25).max(25),
480
508
  name: z.string().optional(),
481
509
  state: AccountConfigStateSchema,
482
510
  deletedAt: z.number().optional(),
@@ -486,9 +514,9 @@ export const AccountConfigSchema = z.object({
486
514
  });
487
515
 
488
516
  export const AccountSchema = z.object({
489
- accountId: z.string(),
490
- accountConfigId: z.string(),
491
- username: z.string(),
517
+ accountId: z.string().min(25).max(25),
518
+ accountConfigId: z.string().min(25).max(25),
519
+ username: z.string().min(1),
492
520
  email: z.string(),
493
521
  authType: AccountAuthTypeSchema,
494
522
  syncedServices: z.array(AccountServiceSchema),
@@ -496,13 +524,13 @@ export const AccountSchema = z.object({
496
524
  passwordHash: z.string().optional(),
497
525
  oauthRefreshTokenHash: z.string().optional(),
498
526
  oauthTokenUpdatedAt: z.number().optional(),
499
- imapHost: z.string(),
500
- imapPort: z.number(),
527
+ imapHost: z.string().min(1),
528
+ imapPort: z.number().min(1).max(65535),
501
529
  imapTls: z.boolean(),
502
530
  imapStartTls: z.boolean(),
503
531
  smtpEnabled: z.boolean(),
504
532
  smtpHost: z.string(),
505
- smtpPort: z.number(),
533
+ smtpPort: z.number().min(1).max(65535),
506
534
  smtpTls: z.boolean(),
507
535
  smtpStartTls: z.boolean(),
508
536
  smtpUsername: z.string(),
@@ -513,8 +541,8 @@ export const AccountSchema = z.object({
513
541
  lastSyncAt: z.number().optional(),
514
542
  lastError: z.string().optional(),
515
543
  syncPhase: SyncPhaseSchema.optional(),
516
- mailboxCountTotal: z.number().optional(),
517
- mailboxCountSynced: z.number().optional(),
544
+ mailboxCountTotal: z.number().min(0).optional(),
545
+ mailboxCountSynced: z.number().min(0).optional(),
518
546
  createdAt: z.number(),
519
547
  updatedAt: z.number(),
520
548
  deletedAt: z.number().optional()
@@ -546,14 +574,14 @@ export const ConfigImportItemReportSchema = z.object({
546
574
  });
547
575
 
548
576
  export const ConfigImportReportSchema = z.object({
549
- importId: z.string().optional(),
577
+ importId: z.string().min(25).max(25).optional(),
550
578
  valid: z.boolean(),
551
579
  schemaVersion: z.number(),
552
580
  applied: z.boolean(),
553
581
  items: z.array(ConfigImportItemReportSchema),
554
582
  errors: z.array(ApiErrorSchema),
555
583
  warnings: z.array(ApiErrorSchema),
556
- accountsNeedingCredentials: z.array(z.string())
584
+ accountsNeedingCredentials: z.array(z.string().min(25).max(25))
557
585
  });
558
586
 
559
587
  export const ConfigImportConflictSchema = z.object({
@@ -580,7 +608,7 @@ export const SystemUpdateRunSchema = z.object({
580
608
  fromVersion: z.string(),
581
609
  targetVersion: z.string(),
582
610
  phase: SystemUpdatePhaseSchema,
583
- outcome: z.union([SystemUpdateOutcomeSchema, z.unknown()]),
611
+ outcome: z.union([SystemUpdateOutcomeSchema, z.null()]),
584
612
  startedAt: z.string(),
585
613
  updatedAt: z.string(),
586
614
  message: z.string(),
@@ -591,7 +619,7 @@ export const SystemUpdateResponseSchema = z.object({
591
619
  currentVersion: z.string(),
592
620
  currentSchemaVersion: z.number().optional(),
593
621
  check: SystemUpdateCheckSchema,
594
- run: z.union([SystemUpdateRunSchema, z.unknown()])
622
+ run: z.union([SystemUpdateRunSchema, z.null()])
595
623
  });
596
624
 
597
625
  export const ApplyUpdateInputSchema = z.object({
@@ -599,26 +627,26 @@ export const ApplyUpdateInputSchema = z.object({
599
627
  });
600
628
 
601
629
  export const MailboxSchema = z.object({
602
- mailboxId: z.string(),
603
- accountId: z.string(),
630
+ mailboxId: z.string().min(25).max(25),
631
+ accountId: z.string().min(25).max(25),
604
632
  namespaceType: NamespaceTypeSchema,
605
633
  namespacePrefix: z.string(),
606
- hierarchyDelimiter: z.string(),
607
- fullPath: z.string(),
608
- uidValidity: z.number(),
609
- uidNext: z.number(),
610
- highestModseq: z.string(),
611
- messageCount: z.number(),
612
- unseenCount: z.number(),
613
- deletedCount: z.number(),
614
- totalSize: z.number(),
634
+ hierarchyDelimiter: z.string().min(1).max(1),
635
+ fullPath: z.string().min(1).max(512),
636
+ uidValidity: z.number().min(1),
637
+ uidNext: z.number().min(1),
638
+ highestModseq: z.string().max(32),
639
+ messageCount: z.number().min(0),
640
+ unseenCount: z.number().min(0),
641
+ deletedCount: z.number().min(0),
642
+ totalSize: z.number().min(0),
615
643
  lastSyncUid: z.number(),
616
644
  highWaterMarkUid: z.number(),
617
645
  lastMessageSyncAt: z.number(),
618
646
  initialSyncCompletedAt: z.number().optional(),
619
647
  parentMailboxId: z.string(),
620
648
  syncStatus: MailboxSyncStatusSchema,
621
- pendingPath: z.string().optional(),
649
+ pendingPath: z.string().max(512).optional(),
622
650
  syncFailureReason: z.string(),
623
651
  cursorState: MailboxCursorStateSchema,
624
652
  specialUse: z.array(MailboxSpecialUseSchema).optional(),
@@ -627,62 +655,66 @@ export const MailboxSchema = z.object({
627
655
  });
628
656
 
629
657
  export const MailboxResponseSchema = z.object({
630
- mailboxId: z.string(),
631
- accountId: z.string(),
658
+ mailboxId: z.string().min(25).max(25),
659
+ accountId: z.string().min(25).max(25),
632
660
  namespaceType: NamespaceTypeSchema,
633
661
  namespacePrefix: z.string(),
634
- hierarchyDelimiter: z.string(),
635
- fullPath: z.string(),
636
- messageCount: z.number(),
637
- unseenCount: z.number(),
638
- deletedCount: z.number(),
662
+ hierarchyDelimiter: z.string().min(1).max(1),
663
+ fullPath: z.string().min(1).max(512),
664
+ messageCount: z.number().min(0),
665
+ unseenCount: z.number().min(0),
666
+ deletedCount: z.number().min(0),
639
667
  lastSyncUid: z.number(),
640
668
  highWaterMarkUid: z.number(),
641
669
  lastMessageSyncAt: z.number(),
642
670
  syncStatus: MailboxSyncStatusSchema,
643
- pendingPath: z.string().optional(),
671
+ pendingPath: z.string().max(512).optional(),
644
672
  syncFailureReason: z.string(),
645
673
  specialUse: z.array(MailboxSpecialUseSchema).optional(),
646
674
  createdAt: z.number(),
647
675
  updatedAt: z.number(),
648
676
  muted: MutedFlagSchema.optional(),
649
- displayNameOverride: z.string().optional()
677
+ displayNameOverride: z.string().max(256).optional()
678
+ });
679
+
680
+ export const MailboxListResponseSchema = z.object({
681
+ continuationToken: z.string().max(800).optional(),
682
+ items: z.array(MailboxResponseSchema)
650
683
  });
651
684
 
652
685
  export const CreateMailboxInputSchema = z.object({
653
686
  namespaceType: NamespaceTypeSchema,
654
- fullPath: z.string()
687
+ fullPath: z.string().min(1).max(512)
655
688
  });
656
689
 
657
690
  export const RenameMailboxInputSchema = z.object({
658
- fullPath: z.string().optional(),
659
- muted: z.union([MutedFlagSchema, z.unknown()]).optional(),
660
- displayNameOverride: z.union([z.string(), z.unknown()]).optional()
691
+ fullPath: z.string().max(512).optional(),
692
+ muted: z.union([MutedFlagSchema, z.null()]).optional(),
693
+ displayNameOverride: z.union([z.string(), z.null()]).optional()
661
694
  });
662
695
 
663
696
  export const AppointFolderRoleInputSchema = z.object({
664
- mailboxId: z.union([z.string(), z.unknown()])
697
+ mailboxId: z.union([z.string(), z.null()])
665
698
  });
666
699
 
667
700
  export const FilterClauseSchema = z.object({
668
701
  field: FilterClauseFieldSchema,
669
- value: z.string()
702
+ value: z.string().max(256)
670
703
  });
671
704
 
672
705
  export const FilterSchema = z.object({
673
- filterId: z.string(),
674
- accountConfigId: z.string(),
675
- name: z.string(),
706
+ filterId: z.string().min(25).max(25),
707
+ accountConfigId: z.string().min(25).max(25),
708
+ name: z.string().max(256),
676
709
  scope: FilterScopeSchema,
677
710
  expiresAt: z.string().optional(),
678
711
  ttl: z.number().optional(),
679
712
  state: FilterStateSchema,
680
713
  disabledReason: FilterDisabledReasonSchema,
681
- hasAnchor: z.boolean(),
682
714
  ruleChangedAt: z.number(),
683
715
  actionChangedAt: z.number(),
684
716
  matchOperator: FilterMatchOperatorSchema,
685
- literalClauses: z.array(FilterClauseSchema),
717
+ literalClauses: z.array(FilterClauseSchema).min(1),
686
718
  actionLabelId: z.string(),
687
719
  actionMailboxId: z.string(),
688
720
  createdAt: z.number(),
@@ -690,18 +722,17 @@ export const FilterSchema = z.object({
690
722
  });
691
723
 
692
724
  export const FilterResponseSchema = z.object({
693
- filterId: z.string(),
694
- accountConfigId: z.string(),
695
- name: z.string(),
725
+ filterId: z.string().min(25).max(25),
726
+ accountConfigId: z.string().min(25).max(25),
727
+ name: z.string().max(256),
696
728
  scope: FilterScopeSchema,
697
729
  expiresAt: z.string().optional(),
698
730
  state: FilterStateSchema,
699
731
  disabledReason: FilterDisabledReasonSchema,
700
- hasAnchor: z.boolean(),
701
732
  ruleChangedAt: z.number(),
702
733
  actionChangedAt: z.number(),
703
734
  matchOperator: FilterMatchOperatorSchema,
704
- literalClauses: z.array(FilterClauseSchema),
735
+ literalClauses: z.array(FilterClauseSchema).min(1),
705
736
  actionLabelId: z.string(),
706
737
  actionMailboxId: z.string(),
707
738
  createdAt: z.number(),
@@ -709,29 +740,27 @@ export const FilterResponseSchema = z.object({
709
740
  });
710
741
 
711
742
  export const CreateFilterInputSchema = z.object({
712
- name: z.string(),
743
+ name: z.string().max(256),
713
744
  scope: FilterScopeSchema,
714
745
  expiresAt: z.string().optional(),
715
746
  matchOperator: FilterMatchOperatorSchema,
716
- literalClauses: z.array(FilterClauseSchema),
747
+ literalClauses: z.array(FilterClauseSchema).min(1),
717
748
  actionLabelId: z.string(),
718
- actionMailboxId: z.string(),
719
- anchorMessageId: z.string().optional()
749
+ actionMailboxId: z.string()
720
750
  });
721
751
 
722
752
  export const CreateFilterResponseSchema = z.object({
723
- filterId: z.string(),
724
- accountConfigId: z.string(),
725
- name: z.string(),
753
+ filterId: z.string().min(25).max(25),
754
+ accountConfigId: z.string().min(25).max(25),
755
+ name: z.string().max(256),
726
756
  scope: FilterScopeSchema,
727
757
  expiresAt: z.string().optional(),
728
758
  state: FilterStateSchema,
729
759
  disabledReason: FilterDisabledReasonSchema,
730
- hasAnchor: z.boolean(),
731
760
  ruleChangedAt: z.number(),
732
761
  actionChangedAt: z.number(),
733
762
  matchOperator: FilterMatchOperatorSchema,
734
- literalClauses: z.array(FilterClauseSchema),
763
+ literalClauses: z.array(FilterClauseSchema).min(1),
735
764
  actionLabelId: z.string(),
736
765
  actionMailboxId: z.string(),
737
766
  createdAt: z.number(),
@@ -740,30 +769,30 @@ export const CreateFilterResponseSchema = z.object({
740
769
  });
741
770
 
742
771
  export const UpdateFilterInputSchema = z.object({
743
- name: z.string(),
772
+ name: z.string().max(256),
744
773
  scope: FilterScopeSchema,
745
774
  expiresAt: z.string().optional(),
746
775
  state: FilterStateSchema,
747
776
  matchOperator: FilterMatchOperatorSchema,
748
- literalClauses: z.array(FilterClauseSchema),
777
+ literalClauses: z.array(FilterClauseSchema).min(1),
749
778
  actionLabelId: z.string(),
750
779
  actionMailboxId: z.string()
751
780
  });
752
781
 
753
782
  export const LabelSchema = z.object({
754
- labelId: z.string(),
755
- accountConfigId: z.string(),
756
- name: z.string(),
757
- normalizedName: z.string(),
783
+ labelId: z.string().min(25).max(25),
784
+ accountConfigId: z.string().min(25).max(25),
785
+ name: z.string().max(140),
786
+ normalizedName: z.string().max(140),
758
787
  color: LabelColorSchema,
759
788
  createdAt: z.number(),
760
789
  updatedAt: z.number()
761
790
  });
762
791
 
763
792
  export const LabelResponseSchema = z.object({
764
- labelId: z.string(),
765
- accountConfigId: z.string(),
766
- name: z.string(),
793
+ labelId: z.string().min(25).max(25),
794
+ accountConfigId: z.string().min(25).max(25),
795
+ name: z.string().max(140),
767
796
  color: LabelColorSchema,
768
797
  createdAt: z.number(),
769
798
  updatedAt: z.number(),
@@ -771,21 +800,19 @@ export const LabelResponseSchema = z.object({
771
800
  });
772
801
 
773
802
  export const CreateLabelInputSchema = z.object({
774
- name: z.string(),
803
+ name: z.string().max(140),
775
804
  color: LabelColorSchema
776
805
  });
777
806
 
778
807
  export const UpdateLabelInputSchema = z.object({
779
- name: z.string(),
808
+ name: z.string().max(140),
780
809
  color: LabelColorSchema
781
810
  });
782
811
 
783
812
  export const OrganizeInputSchema = z.object({
784
- filterId: z.string().optional(),
785
- anchorMessageId: z.string().optional(),
813
+ filterId: z.string().min(25).max(25).optional(),
786
814
  matchOperator: FilterMatchOperatorSchema,
787
815
  literalClauses: z.array(FilterClauseSchema),
788
- similarityThreshold: z.number().optional(),
789
816
  actionLabelId: z.string(),
790
817
  actionMailboxId: z.string()
791
818
  });
@@ -798,21 +825,17 @@ export const CreateOrganizeJobResponseSchema = z.object({
798
825
 
799
826
  export const OrganizePreviewResponseSchema = z.object({
800
827
  matchedCount: z.number(),
801
- messageIds: z.array(z.string()),
802
- semanticUnavailable: z.boolean().optional(),
803
- semanticIndexEmpty: z.boolean().optional()
828
+ messageIds: z.array(z.string())
804
829
  });
805
830
 
806
831
  export const OrganizeJobRequestSchema = z.object({
807
- organizeJobId: z.string(),
808
- accountConfigId: z.string(),
832
+ organizeJobId: z.string().min(25).max(25),
833
+ accountConfigId: z.string().min(25).max(25),
809
834
  userId: z.string(),
810
835
  state: OrganizeJobStateSchema,
811
836
  filterId: z.string(),
812
- anchorMessageId: z.string(),
813
837
  matchOperator: FilterMatchOperatorSchema,
814
838
  literalClauses: z.array(FilterClauseSchema),
815
- similarityThreshold: z.number(),
816
839
  actionLabelId: z.string(),
817
840
  actionMailboxId: z.string(),
818
841
  matchedCount: z.number(),
@@ -825,15 +848,13 @@ export const OrganizeJobRequestSchema = z.object({
825
848
  });
826
849
 
827
850
  export const OrganizeJobResponseSchema = z.object({
828
- organizeJobId: z.string(),
829
- accountConfigId: z.string(),
851
+ organizeJobId: z.string().min(25).max(25),
852
+ accountConfigId: z.string().min(25).max(25),
830
853
  userId: z.string(),
831
854
  state: OrganizeJobStateSchema,
832
855
  filterId: z.string(),
833
- anchorMessageId: z.string(),
834
856
  matchOperator: FilterMatchOperatorSchema,
835
857
  literalClauses: z.array(FilterClauseSchema),
836
- similarityThreshold: z.number(),
837
858
  actionLabelId: z.string(),
838
859
  actionMailboxId: z.string(),
839
860
  matchedCount: z.number(),
@@ -845,20 +866,20 @@ export const OrganizeJobResponseSchema = z.object({
845
866
  });
846
867
 
847
868
  export const CalendarResponseSchema = z.object({
848
- calendarId: z.string(),
849
- accountConfigId: z.string(),
850
- urlSegment: z.string(),
851
- displayName: z.string(),
869
+ calendarId: z.string().min(25).max(25),
870
+ accountConfigId: z.string().min(25).max(25),
871
+ urlSegment: z.string().max(64),
872
+ displayName: z.string().max(140),
852
873
  color: CalendarColorSchema,
853
874
  componentSet: CalendarComponentSetSchema,
854
875
  source: CalendarSourceSchema,
855
- timezone: z.string(),
876
+ timezone: z.string().max(64),
856
877
  syncSequence: z.number(),
857
- subscriptionUrl: z.string(),
878
+ subscriptionUrl: z.string().max(2048),
858
879
  subscriptionEnabled: z.boolean(),
859
880
  subscriptionCheckedAt: z.number(),
860
881
  subscriptionFetchedAt: z.number(),
861
- subscriptionError: z.string(),
882
+ subscriptionError: z.string().max(512),
862
883
  createdAt: z.number(),
863
884
  updatedAt: z.number()
864
885
  });
@@ -868,36 +889,36 @@ export const CalendarListResponseSchema = z.object({
868
889
  });
869
890
 
870
891
  export const CalendarCollectionSchema = z.object({
871
- calendarId: z.string(),
872
- accountConfigId: z.string(),
873
- urlSegment: z.string(),
874
- displayName: z.string(),
892
+ calendarId: z.string().min(25).max(25),
893
+ accountConfigId: z.string().min(25).max(25),
894
+ urlSegment: z.string().max(64),
895
+ displayName: z.string().max(140),
875
896
  color: CalendarColorSchema,
876
897
  componentSet: CalendarComponentSetSchema,
877
898
  source: CalendarSourceSchema,
878
- timezone: z.string(),
899
+ timezone: z.string().max(64),
879
900
  syncSequence: z.number(),
880
- subscriptionUrl: z.string(),
901
+ subscriptionUrl: z.string().max(2048),
881
902
  subscriptionEnabled: z.boolean(),
882
903
  subscriptionCheckedAt: z.number(),
883
904
  subscriptionFetchedAt: z.number(),
884
- subscriptionError: z.string(),
905
+ subscriptionError: z.string().max(512),
885
906
  createdAt: z.number(),
886
907
  updatedAt: z.number()
887
908
  });
888
909
 
889
910
  export const CreateCalendarInputSchema = z.object({
890
- displayName: z.string(),
891
- urlSegment: z.string(),
911
+ displayName: z.string().max(140),
912
+ urlSegment: z.string().max(64),
892
913
  color: CalendarColorSchema.optional(),
893
- timezone: z.string().optional(),
894
- subscriptionUrl: z.string().optional()
914
+ timezone: z.string().max(64).optional(),
915
+ subscriptionUrl: z.string().max(2048).optional()
895
916
  });
896
917
 
897
918
  export const UpdateCalendarInputSchema = z.object({
898
- displayName: z.string(),
919
+ displayName: z.string().max(140),
899
920
  color: CalendarColorSchema,
900
- timezone: z.string(),
921
+ timezone: z.string().max(64),
901
922
  subscriptionEnabled: z.boolean()
902
923
  });
903
924
 
@@ -906,14 +927,14 @@ export const CalendarNoContentSchema = z.object({
906
927
  });
907
928
 
908
929
  export const CalendarFeedStateResponseSchema = z.object({
909
- calendarId: z.string(),
930
+ calendarId: z.string().min(25).max(25),
910
931
  createdAt: z.number(),
911
932
  rotatedAt: z.number()
912
933
  });
913
934
 
914
935
  export const CalendarFeedResponseSchema = z.object({
915
- calendarId: z.string(),
916
- feedToken: z.string(),
936
+ calendarId: z.string().min(25).max(25),
937
+ feedToken: z.string().max(512),
917
938
  createdAt: z.number(),
918
939
  rotatedAt: z.number()
919
940
  });
@@ -938,18 +959,18 @@ export const CalendarFeedNotFoundSchema = z.object({
938
959
  });
939
960
 
940
961
  export const CalendarEventInstanceSchema = z.object({
941
- calendarId: z.string(),
942
- calendarObjectId: z.string(),
943
- recurrenceId: z.string(),
944
- icalUid: z.string(),
945
- summary: z.string(),
946
- start: z.string(),
947
- end: z.string(),
962
+ calendarId: z.string().min(25).max(25),
963
+ calendarObjectId: z.string().min(25).max(25),
964
+ recurrenceId: z.string().max(64),
965
+ icalUid: z.string().max(512),
966
+ summary: z.string().max(512),
967
+ start: z.string().max(64),
968
+ end: z.string().max(64),
948
969
  allDay: z.boolean(),
949
970
  status: CalendarEventStatusSchema,
950
971
  transparency: CalendarTransparencySchema,
951
972
  zoneCertainty: ZoneCertaintySchema,
952
- etag: z.string(),
973
+ etag: z.string().max(64),
953
974
  hasRecurrence: z.boolean()
954
975
  });
955
976
 
@@ -958,79 +979,79 @@ export const CalendarEventListResponseSchema = z.object({
958
979
  });
959
980
 
960
981
  export const CreateCalendarEventInputSchema = z.object({
961
- calendarId: z.string(),
962
- summary: z.string(),
963
- description: z.string().optional(),
964
- location: z.string().optional(),
965
- start: z.string(),
966
- end: z.string(),
982
+ calendarId: z.string().min(25).max(25),
983
+ summary: z.string().max(512),
984
+ description: z.string().max(2048).optional(),
985
+ location: z.string().max(512).optional(),
986
+ start: z.string().max(64),
987
+ end: z.string().max(64),
967
988
  allDay: z.boolean().optional(),
968
- timeZone: z.string().optional(),
989
+ timeZone: z.string().max(64).optional(),
969
990
  status: CalendarEventStatusSchema.optional(),
970
991
  transparency: CalendarTransparencySchema.optional(),
971
- recurrenceRule: z.string().optional()
992
+ recurrenceRule: z.string().max(512).optional()
972
993
  });
973
994
 
974
995
  export const CalendarObjectSchema = z.object({
975
- calendarObjectId: z.string(),
976
- calendarId: z.string(),
977
- resourceName: z.string(),
978
- icalUid: z.string(),
996
+ calendarObjectId: z.string().min(25).max(25),
997
+ calendarId: z.string().min(25).max(25),
998
+ resourceName: z.string().max(256),
999
+ icalUid: z.string().max(512),
979
1000
  icalData: z.string(),
980
- etag: z.string(),
1001
+ etag: z.string().max(64),
981
1002
  sequence: z.number(),
982
1003
  syncSequence: z.number(),
983
- summary: z.string(),
984
- dtStart: z.string(),
985
- dtEnd: z.string(),
1004
+ summary: z.string().max(512),
1005
+ dtStart: z.string().max(64),
1006
+ dtEnd: z.string().max(64),
986
1007
  allDay: z.boolean(),
987
1008
  zoneCertainty: ZoneCertaintySchema,
988
1009
  status: CalendarEventStatusSchema,
989
1010
  transparency: CalendarTransparencySchema,
990
1011
  hasRecurrence: z.boolean(),
991
- expandedThrough: z.string(),
1012
+ expandedThrough: z.string().max(64),
992
1013
  createdAt: z.number(),
993
1014
  updatedAt: z.number()
994
1015
  });
995
1016
 
996
1017
  export const CalendarEventResponseSchema = z.object({
997
- calendarObjectId: z.string(),
998
- calendarId: z.string(),
999
- resourceName: z.string(),
1000
- icalUid: z.string(),
1018
+ calendarObjectId: z.string().min(25).max(25),
1019
+ calendarId: z.string().min(25).max(25),
1020
+ resourceName: z.string().max(256),
1021
+ icalUid: z.string().max(512),
1001
1022
  icalData: z.string(),
1002
- etag: z.string(),
1023
+ etag: z.string().max(64),
1003
1024
  sequence: z.number(),
1004
1025
  syncSequence: z.number(),
1005
- summary: z.string(),
1006
- dtStart: z.string(),
1007
- dtEnd: z.string(),
1026
+ summary: z.string().max(512),
1027
+ dtStart: z.string().max(64),
1028
+ dtEnd: z.string().max(64),
1008
1029
  allDay: z.boolean(),
1009
1030
  zoneCertainty: ZoneCertaintySchema,
1010
1031
  status: CalendarEventStatusSchema,
1011
1032
  transparency: CalendarTransparencySchema,
1012
1033
  hasRecurrence: z.boolean(),
1013
- expandedThrough: z.string(),
1034
+ expandedThrough: z.string().max(64),
1014
1035
  createdAt: z.number(),
1015
1036
  updatedAt: z.number()
1016
1037
  });
1017
1038
 
1018
1039
  export const UpdateCalendarEventInputSchema = z.object({
1019
- summary: z.string().optional(),
1020
- description: z.string().optional(),
1021
- location: z.string().optional(),
1022
- start: z.string().optional(),
1023
- end: z.string().optional(),
1040
+ summary: z.string().max(512).optional(),
1041
+ description: z.string().max(2048).optional(),
1042
+ location: z.string().max(512).optional(),
1043
+ start: z.string().max(64).optional(),
1044
+ end: z.string().max(64).optional(),
1024
1045
  allDay: z.boolean().optional(),
1025
- timeZone: z.string().optional(),
1046
+ timeZone: z.string().max(64).optional(),
1026
1047
  status: CalendarEventStatusSchema.optional(),
1027
1048
  transparency: CalendarTransparencySchema.optional(),
1028
- recurrenceRule: z.string().optional()
1049
+ recurrenceRule: z.string().max(512).optional()
1029
1050
  });
1030
1051
 
1031
1052
  export const CalendarFreeBusySpanSchema = z.object({
1032
- start: z.string(),
1033
- end: z.string()
1053
+ start: z.string().max(64),
1054
+ end: z.string().max(64)
1034
1055
  });
1035
1056
 
1036
1057
  export const CalendarFreeBusyResponseSchema = z.object({
@@ -1047,7 +1068,7 @@ export const SyncTriggerResponseSchema = z.object({
1047
1068
  });
1048
1069
 
1049
1070
  export const MailboxSyncProgressSchema = z.object({
1050
- mailboxId: z.string(),
1071
+ mailboxId: z.string().min(25).max(25),
1051
1072
  fullPath: z.string(),
1052
1073
  phase: z.string(),
1053
1074
  messagesTotal: z.number(),
@@ -1057,7 +1078,7 @@ export const MailboxSyncProgressSchema = z.object({
1057
1078
  });
1058
1079
 
1059
1080
  export const AccountSyncStatusResponseSchema = z.object({
1060
- accountId: z.string(),
1081
+ accountId: z.string().min(25).max(25),
1061
1082
  syncPhase: SyncPhaseSchema.optional(),
1062
1083
  mailboxCountTotal: z.number().optional(),
1063
1084
  mailboxCountSynced: z.number().optional(),
@@ -1066,19 +1087,19 @@ export const AccountSyncStatusResponseSchema = z.object({
1066
1087
  });
1067
1088
 
1068
1089
  export const CreateAccountInputSchema = z.object({
1069
- email: z.string(),
1090
+ email: z.string().min(1),
1070
1091
  displayName: z.string().optional(),
1071
1092
  username: z.string().optional(),
1072
1093
  authType: AccountAuthTypeSchema.optional(),
1073
1094
  syncedServices: z.array(AccountServiceSchema).optional(),
1074
1095
  password: z.string().optional(),
1075
- imapHost: z.string(),
1076
- imapPort: z.number(),
1096
+ imapHost: z.string().min(1),
1097
+ imapPort: z.number().min(1).max(65535),
1077
1098
  imapTls: z.boolean(),
1078
1099
  imapStartTls: z.boolean(),
1079
1100
  smtpEnabled: z.boolean().optional(),
1080
1101
  smtpHost: z.string().optional(),
1081
- smtpPort: z.number().optional(),
1102
+ smtpPort: z.number().min(1).max(65535).optional(),
1082
1103
  smtpTls: z.boolean().optional(),
1083
1104
  smtpStartTls: z.boolean().optional(),
1084
1105
  smtpUsername: z.string().optional(),
@@ -1086,15 +1107,15 @@ export const CreateAccountInputSchema = z.object({
1086
1107
  });
1087
1108
 
1088
1109
  export const TestConnectionInputSchema = z.object({
1089
- accountId: z.string().optional(),
1090
- username: z.string(),
1110
+ accountId: z.string().min(25).max(25).optional(),
1111
+ username: z.string().min(1),
1091
1112
  password: z.string().optional(),
1092
- imapHost: z.string(),
1093
- imapPort: z.number(),
1113
+ imapHost: z.string().min(1),
1114
+ imapPort: z.number().min(1).max(65535),
1094
1115
  imapTls: z.boolean(),
1095
1116
  imapStartTls: z.boolean(),
1096
1117
  smtpHost: z.string().optional(),
1097
- smtpPort: z.number().optional(),
1118
+ smtpPort: z.number().min(1).max(65535).optional(),
1098
1119
  smtpTls: z.boolean().optional(),
1099
1120
  smtpStartTls: z.boolean().optional(),
1100
1121
  smtpUsername: z.string().optional(),
@@ -1112,12 +1133,12 @@ export const UpdateAccountInputSchema = z.object({
1112
1133
  displayName: z.string().optional(),
1113
1134
  password: z.string().optional(),
1114
1135
  imapHost: z.string().optional(),
1115
- imapPort: z.number().optional(),
1136
+ imapPort: z.number().min(1).max(65535).optional(),
1116
1137
  imapTls: z.boolean().optional(),
1117
1138
  imapStartTls: z.boolean().optional(),
1118
1139
  smtpEnabled: z.boolean().optional(),
1119
1140
  smtpHost: z.string().optional(),
1120
- smtpPort: z.number().optional(),
1141
+ smtpPort: z.number().min(1).max(65535).optional(),
1121
1142
  smtpTls: z.boolean().optional(),
1122
1143
  smtpStartTls: z.boolean().optional(),
1123
1144
  smtpUsername: z.string().optional(),
@@ -1127,29 +1148,29 @@ export const UpdateAccountInputSchema = z.object({
1127
1148
  signaturePlainText: z.string().optional(),
1128
1149
  signatureHtml: z.string().optional(),
1129
1150
  composeLanguages: z.array(z.string()).optional(),
1130
- muted: z.union([MutedFlagSchema, z.unknown()]).optional()
1151
+ muted: z.union([MutedFlagSchema, z.null()]).optional()
1131
1152
  });
1132
1153
 
1133
1154
  export const DeleteAccountResponseSchema = z.object({
1134
- accountId: z.string(),
1155
+ accountId: z.string().min(25).max(25),
1135
1156
  deletedAt: z.number(),
1136
1157
  message: z.string()
1137
1158
  });
1138
1159
 
1139
1160
  export const ThreadMessageSchema = z.object({
1140
- threadMessageId: z.string(),
1141
- threadId: z.string(),
1142
- messageId: z.string(),
1143
- accountConfigId: z.string(),
1144
- mailboxId: z.string(),
1145
- uid: z.number(),
1161
+ threadMessageId: z.string().min(25).max(25),
1162
+ threadId: z.string().min(25).max(25),
1163
+ messageId: z.string().min(25).max(25),
1164
+ accountConfigId: z.string().min(25).max(25),
1165
+ mailboxId: z.string().min(25).max(25),
1166
+ uid: z.number().min(1),
1146
1167
  messageIdHeader: z.string().optional(),
1147
1168
  inReplyTo: z.string().optional(),
1148
- referenceOrder: z.number(),
1169
+ referenceOrder: z.number().min(0),
1149
1170
  fromEmail: z.string().optional(),
1150
1171
  fromName: z.string().optional(),
1151
1172
  subject: z.string().optional(),
1152
- listId: z.string().optional(),
1173
+ listId: z.string().max(256).optional(),
1153
1174
  internalDate: z.number(),
1154
1175
  sentDate: z.number(),
1155
1176
  isRead: z.boolean(),
@@ -1157,7 +1178,7 @@ export const ThreadMessageSchema = z.object({
1157
1178
  star: StarColorSchema,
1158
1179
  hasStars: z.boolean(),
1159
1180
  isDeleted: z.boolean(),
1160
- snippet: z.string().optional(),
1181
+ snippet: z.string().max(256).optional(),
1161
1182
  category: MessageCategorySchema,
1162
1183
  createdAt: z.number(),
1163
1184
  updatedAt: z.number()
@@ -1178,14 +1199,14 @@ export const MessageAuthenticitySchema = z.object({
1178
1199
  export const AutoMovedInfoSchema = z.object({
1179
1200
  action: PlacementActionSchema.optional(),
1180
1201
  fromPlacement: z.string().optional(),
1181
- fromMailboxId: z.string().optional(),
1182
- destinationMailboxId: z.string().optional(),
1183
- filterId: z.string().optional()
1202
+ fromMailboxId: z.string().min(25).max(25).optional(),
1203
+ destinationMailboxId: z.string().min(25).max(25).optional(),
1204
+ filterId: z.string().min(25).max(25).optional()
1184
1205
  });
1185
1206
 
1186
1207
  export const LabelSummaryResponseSchema = z.object({
1187
- labelId: z.string(),
1188
- name: z.string(),
1208
+ labelId: z.string().min(25).max(25),
1209
+ name: z.string().max(140),
1189
1210
  color: LabelColorSchema
1190
1211
  });
1191
1212
 
@@ -1194,11 +1215,11 @@ export const MessageSpamReportSchema = z.object({
1194
1215
  });
1195
1216
 
1196
1217
  export const ThreadMessageResponseSchema = z.object({
1197
- threadMessageId: z.string(),
1198
- threadId: z.string(),
1199
- messageId: z.string(),
1200
- accountConfigId: z.string(),
1201
- mailboxId: z.string(),
1218
+ threadMessageId: z.string().min(25).max(25),
1219
+ threadId: z.string().min(25).max(25),
1220
+ messageId: z.string().min(25).max(25),
1221
+ accountConfigId: z.string().min(25).max(25),
1222
+ mailboxId: z.string().min(25).max(25),
1202
1223
  fromEmail: z.string().optional(),
1203
1224
  fromName: z.string().optional(),
1204
1225
  subject: z.string().optional(),
@@ -1208,7 +1229,7 @@ export const ThreadMessageResponseSchema = z.object({
1208
1229
  star: StarColorSchema,
1209
1230
  hasStars: z.boolean(),
1210
1231
  isDeleted: z.boolean(),
1211
- snippet: z.string().optional(),
1232
+ snippet: z.string().max(256).optional(),
1212
1233
  createdAt: z.number(),
1213
1234
  updatedAt: z.number(),
1214
1235
  category: MessageCategorySchema,
@@ -1218,33 +1239,26 @@ export const ThreadMessageResponseSchema = z.object({
1218
1239
  status: MessageStatusSchema,
1219
1240
  syncStatus: MessageSyncStatusSchema,
1220
1241
  abandonedMutation: MessageMutationSchema,
1221
- accountId: z.string().optional(),
1242
+ accountId: z.string().min(25).max(25).optional(),
1222
1243
  autoMoved: AutoMovedInfoSchema.optional(),
1223
1244
  labels: z.array(LabelSummaryResponseSchema).optional(),
1224
1245
  spamReport: MessageSpamReportSchema.optional()
1225
1246
  });
1226
1247
 
1248
+ export const ThreadMessageListResponseSchema = z.object({
1249
+ continuationToken: z.string().max(800).optional(),
1250
+ items: z.array(ThreadMessageResponseSchema)
1251
+ });
1252
+
1227
1253
  export const ThreadSearchResponseSchema = z.object({
1228
1254
  items: z.array(ThreadMessageResponseSchema).optional(),
1229
- continuationToken: z.string().optional(),
1255
+ continuationToken: z.string().max(800).optional(),
1230
1256
  count: z.number().optional()
1231
1257
  });
1232
1258
 
1233
- export const SemanticSearchResultSchema = z.object({
1234
- messageId: z.string(),
1235
- threadId: z.string(),
1236
- score: z.number(),
1237
- matchedChunkType: SemanticSearchChunkTypeSchema,
1238
- mailboxIds: z.array(z.string()),
1239
- fromName: z.string().optional(),
1240
- subject: z.string().optional(),
1241
- sentDate: z.number().optional(),
1242
- category: MessageCategorySchema.optional()
1243
- });
1244
-
1245
1259
  export const CreateOutboxMessageInputSchema = z.object({
1246
- accountId: z.string(),
1247
- toAddresses: z.array(z.string()),
1260
+ accountId: z.string().min(25).max(25),
1261
+ toAddresses: z.array(z.string()).min(1),
1248
1262
  ccAddresses: z.array(z.string()).optional(),
1249
1263
  bccAddresses: z.array(z.string()).optional(),
1250
1264
  subject: z.string().optional(),
@@ -1256,9 +1270,9 @@ export const CreateOutboxMessageInputSchema = z.object({
1256
1270
  });
1257
1271
 
1258
1272
  export const OutboxMessageSchema = z.object({
1259
- outboxMessageId: z.string(),
1260
- accountId: z.string(),
1261
- accountConfigId: z.string(),
1273
+ outboxMessageId: z.string().min(25).max(25),
1274
+ accountId: z.string().min(25).max(25),
1275
+ accountConfigId: z.string().min(25).max(25),
1262
1276
  fromAddress: z.string(),
1263
1277
  fromName: z.string().optional(),
1264
1278
  toAddresses: z.array(z.string()),
@@ -1282,19 +1296,19 @@ export const OutboxMessageSchema = z.object({
1282
1296
  });
1283
1297
 
1284
1298
  export const OutboxAttachmentResponseSchema = z.object({
1285
- outboxAttachmentId: z.string(),
1286
- outboxMessageId: z.string(),
1287
- filename: z.string(),
1288
- contentType: z.string(),
1289
- sizeBytes: z.number(),
1299
+ outboxAttachmentId: z.string().min(25).max(25),
1300
+ outboxMessageId: z.string().min(25).max(25),
1301
+ filename: z.string().max(256),
1302
+ contentType: z.string().max(256),
1303
+ sizeBytes: z.number().min(0),
1290
1304
  state: OutboxAttachmentStateSchema,
1291
- contentId: z.string(),
1305
+ contentId: z.string().max(256),
1292
1306
  contentUrl: z.string().url()
1293
1307
  });
1294
1308
 
1295
1309
  export const OutboxMessageResponseSchema = z.object({
1296
- outboxMessageId: z.string(),
1297
- accountId: z.string(),
1310
+ outboxMessageId: z.string().min(25).max(25),
1311
+ accountId: z.string().min(25).max(25),
1298
1312
  fromAddress: z.string(),
1299
1313
  fromName: z.string().optional(),
1300
1314
  toAddresses: z.array(z.string()),
@@ -1314,22 +1328,27 @@ export const OutboxMessageResponseSchema = z.object({
1314
1328
  });
1315
1329
 
1316
1330
  export const OutboxAttachmentSchema = z.object({
1317
- outboxAttachmentId: z.string(),
1318
- outboxMessageId: z.string(),
1319
- accountId: z.string(),
1320
- accountConfigId: z.string(),
1321
- filename: z.string(),
1322
- contentType: z.string(),
1323
- sizeBytes: z.number(),
1331
+ outboxAttachmentId: z.string().min(25).max(25),
1332
+ outboxMessageId: z.string().min(25).max(25),
1333
+ accountId: z.string().min(25).max(25),
1334
+ accountConfigId: z.string().min(25).max(25),
1335
+ filename: z.string().max(256),
1336
+ contentType: z.string().max(256),
1337
+ sizeBytes: z.number().min(0),
1324
1338
  state: OutboxAttachmentStateSchema,
1325
- storageKey: z.string(),
1326
- reservationExpiresAt: z.number(),
1339
+ storageKey: z.string().max(2048),
1340
+ reservationExpiresAt: z.number().min(0),
1327
1341
  createdAt: z.number(),
1328
1342
  updatedAt: z.number()
1329
1343
  });
1330
1344
 
1345
+ export const OutboxMessageListResponseSchema = z.object({
1346
+ continuationToken: z.string().max(800).optional(),
1347
+ items: z.array(OutboxMessageResponseSchema)
1348
+ });
1349
+
1331
1350
  export const UpdateOutboxMessageInputSchema = z.object({
1332
- attachmentIds: z.array(z.string()).optional(),
1351
+ attachmentIds: z.array(z.string().min(25).max(25)).optional(),
1333
1352
  toAddresses: z.array(z.string()).optional(),
1334
1353
  ccAddresses: z.array(z.string()).optional(),
1335
1354
  bccAddresses: z.array(z.string()).optional(),
@@ -1341,37 +1360,37 @@ export const UpdateOutboxMessageInputSchema = z.object({
1341
1360
  });
1342
1361
 
1343
1362
  export const MintOutboxAttachmentInputSchema = z.object({
1344
- filename: z.string(),
1345
- contentType: z.string(),
1346
- sizeBytes: z.number()
1363
+ filename: z.string().max(256),
1364
+ contentType: z.string().max(256),
1365
+ sizeBytes: z.number().min(1)
1347
1366
  });
1348
1367
 
1349
1368
  export const MintOutboxAttachmentResponseSchema = z.object({
1350
- outboxAttachmentId: z.string(),
1351
- outboxMessageId: z.string(),
1352
- filename: z.string(),
1353
- contentType: z.string(),
1354
- sizeBytes: z.number(),
1355
- contentId: z.string(),
1356
- uploadUrl: z.string(),
1369
+ outboxAttachmentId: z.string().min(25).max(25),
1370
+ outboxMessageId: z.string().min(25).max(25),
1371
+ filename: z.string().max(256),
1372
+ contentType: z.string().max(256),
1373
+ sizeBytes: z.number().min(1),
1374
+ contentId: z.string().max(256),
1375
+ uploadUrl: z.string().max(2048),
1357
1376
  uploadExpiresAt: z.number()
1358
1377
  });
1359
1378
 
1360
1379
  export const OutboxAttachmentRejectionSchema = z.object({
1361
1380
  code: z.string(),
1362
1381
  reason: OutboxAttachmentRejectionReasonSchema,
1363
- message: z.string(),
1364
- limitBytes: z.number(),
1365
- usedBytes: z.number()
1382
+ message: z.string().max(512),
1383
+ limitBytes: z.number().min(0),
1384
+ usedBytes: z.number().min(0)
1366
1385
  });
1367
1386
 
1368
1387
  export const OutboxAttachmentRejectedSchema = z.object({
1369
1388
  statusCode: z.union([z.literal(400), z.literal(413)]),
1370
1389
  code: z.string(),
1371
1390
  reason: OutboxAttachmentRejectionReasonSchema,
1372
- message: z.string(),
1373
- limitBytes: z.number(),
1374
- usedBytes: z.number()
1391
+ message: z.string().max(512),
1392
+ limitBytes: z.number().min(0),
1393
+ usedBytes: z.number().min(0)
1375
1394
  });
1376
1395
 
1377
1396
  export const TrustedFlagSchema = z.object({
@@ -1460,11 +1479,11 @@ export const AddressFlagsSchema = z.object({
1460
1479
  });
1461
1480
 
1462
1481
  export const AddressSchema = z.object({
1463
- addressId: z.string(),
1464
- accountConfigId: z.string(),
1482
+ addressId: z.string().min(25).max(25),
1483
+ accountConfigId: z.string().min(25).max(25),
1465
1484
  displayName: z.string().optional(),
1466
- localPart: z.string(),
1467
- domain: z.string(),
1485
+ localPart: z.string().min(1),
1486
+ domain: z.string().min(1),
1468
1487
  normalizedEmail: z.string(),
1469
1488
  normalizedCompound: z.string(),
1470
1489
  flags: AddressFlagsSchema,
@@ -1479,11 +1498,11 @@ export const AddressSchema = z.object({
1479
1498
  });
1480
1499
 
1481
1500
  export const AddressResponseSchema = z.object({
1482
- addressId: z.string(),
1483
- accountConfigId: z.string(),
1501
+ addressId: z.string().min(25).max(25),
1502
+ accountConfigId: z.string().min(25).max(25),
1484
1503
  displayName: z.string().optional(),
1485
- localPart: z.string(),
1486
- domain: z.string(),
1504
+ localPart: z.string().min(1),
1505
+ domain: z.string().min(1),
1487
1506
  normalizedEmail: z.string(),
1488
1507
  flags: AddressFlagsSchema,
1489
1508
  inboundCount: z.number(),
@@ -1496,16 +1515,16 @@ export const AddressResponseSchema = z.object({
1496
1515
  });
1497
1516
 
1498
1517
  export const UpdateAddressFlagsInputSchema = z.object({
1499
- trusted: z.union([TrustedFlagSchema, z.unknown()]).optional(),
1500
- blocked: z.union([BlockedFlagSchema, z.unknown()]).optional(),
1501
- neverSpam: z.union([NeverSpamFlagSchema, z.unknown()]).optional(),
1502
- muted: z.union([MutedFlagSchema, z.unknown()]).optional(),
1503
- vip: z.union([VipFlagSchema, z.unknown()]).optional(),
1504
- wellknown: z.union([WellknownFlagSchema, z.unknown()]).optional(),
1505
- junkOnly: z.union([JunkOnlyFlagSchema, z.unknown()]).optional(),
1506
- category: z.union([CategoryFlagSchema, z.unknown()]).optional(),
1507
- autoArchive: z.union([AutoArchiveFlagSchema, z.unknown()]).optional(),
1508
- unsubscribed: z.union([UnsubscribedFlagSchema, z.unknown()]).optional()
1518
+ trusted: z.union([TrustedFlagSchema, z.null()]).optional(),
1519
+ blocked: z.union([BlockedFlagSchema, z.null()]).optional(),
1520
+ neverSpam: z.union([NeverSpamFlagSchema, z.null()]).optional(),
1521
+ muted: z.union([MutedFlagSchema, z.null()]).optional(),
1522
+ vip: z.union([VipFlagSchema, z.null()]).optional(),
1523
+ wellknown: z.union([WellknownFlagSchema, z.null()]).optional(),
1524
+ junkOnly: z.union([JunkOnlyFlagSchema, z.null()]).optional(),
1525
+ category: z.union([CategoryFlagSchema, z.null()]).optional(),
1526
+ autoArchive: z.union([AutoArchiveFlagSchema, z.null()]).optional(),
1527
+ unsubscribed: z.union([UnsubscribedFlagSchema, z.null()]).optional()
1509
1528
  });
1510
1529
 
1511
1530
  export const UpdateAddressInputSchema = z.object({
@@ -1514,23 +1533,23 @@ export const UpdateAddressInputSchema = z.object({
1514
1533
  });
1515
1534
 
1516
1535
  export const MessageSummaryResponseSchema = z.object({
1517
- messageId: z.string(),
1518
- mailboxId: z.string(),
1519
- uid: z.number(),
1520
- rfc822Size: z.number(),
1536
+ messageId: z.string().min(25).max(25),
1537
+ mailboxId: z.string().min(25).max(25),
1538
+ uid: z.number().min(1),
1539
+ rfc822Size: z.number().min(0),
1521
1540
  internalDate: z.number(),
1522
- messageIdHeader: z.string().optional(),
1523
1541
  status: MessageStatusSchema,
1524
1542
  syncStatus: MessageSyncStatusSchema,
1525
1543
  abandonedMutation: MessageMutationSchema,
1526
1544
  authenticity: MessageAuthenticitySchema.optional(),
1545
+ messageIdHeader: z.string().optional(),
1527
1546
  autoMoved: AutoMovedInfoSchema.optional(),
1528
1547
  labels: z.array(LabelSummaryResponseSchema).optional(),
1529
1548
  spamReport: MessageSpamReportSchema.optional()
1530
1549
  });
1531
1550
 
1532
1551
  export const EnvelopeAddressResponseSchema = z.object({
1533
- addressId: z.string(),
1552
+ addressId: z.string().min(25).max(25),
1534
1553
  displayName: z.string().optional(),
1535
1554
  normalizedEmail: z.string(),
1536
1555
  addressRole: AddressRoleSchema,
@@ -1539,7 +1558,7 @@ export const EnvelopeAddressResponseSchema = z.object({
1539
1558
  });
1540
1559
 
1541
1560
  export const EnvelopeResponseSchema = z.object({
1542
- messageId: z.string(),
1561
+ messageId: z.string().min(25).max(25),
1543
1562
  date: z.number(),
1544
1563
  subject: z.string().optional(),
1545
1564
  messageIdValue: z.string().optional(),
@@ -1553,11 +1572,12 @@ export const EnvelopeResponseSchema = z.object({
1553
1572
  });
1554
1573
 
1555
1574
  export const BodyPartResponseSchema = z.object({
1556
- bodyPartId: z.string(),
1575
+ bodyPartId: z.string().min(25).max(25),
1576
+ partPath: z.string().min(1),
1557
1577
  mediaType: MediaTypeSchema,
1558
- mediaSubtype: z.string(),
1578
+ mediaSubtype: z.string().min(1),
1559
1579
  contentId: z.string().optional(),
1560
- sizeOctets: z.number(),
1580
+ sizeOctets: z.number().min(0),
1561
1581
  disposition: ContentDispositionSchema.optional(),
1562
1582
  dispositionFilename: z.string().optional(),
1563
1583
  isMultipart: z.boolean(),
@@ -1567,7 +1587,7 @@ export const BodyPartResponseSchema = z.object({
1567
1587
  export const MessageReferenceResponseSchema = z.object({
1568
1588
  messageIdValue: z.string(),
1569
1589
  referenceType: ReferenceTypeSchema,
1570
- referenceOrder: z.number()
1590
+ referenceOrder: z.number().min(0)
1571
1591
  });
1572
1592
 
1573
1593
  export const DescribeMessageResponseSchema = z.object({
@@ -1600,27 +1620,26 @@ export const MessagePlacementVerdictSchema = z.object({
1600
1620
  });
1601
1621
 
1602
1622
  export const MessageFilterMoveSchema = z.object({
1603
- filterId: z.string(),
1604
- sourceMailboxId: z.string(),
1605
- destinationMailboxId: z.string(),
1623
+ filterId: z.string().min(25).max(25),
1624
+ sourceMailboxId: z.string().min(25).max(25),
1625
+ destinationMailboxId: z.string().min(25).max(25),
1606
1626
  decidedAt: z.number()
1607
1627
  });
1608
1628
 
1609
- export const MessageSchema = z.object({
1610
- messageId: z.string(),
1611
- mailboxId: z.string(),
1612
- uid: z.number(),
1613
- sequenceNumber: z.number(),
1614
- rfc822Size: z.number(),
1629
+ export const MessageRecordSchema = z.object({
1630
+ messageId: z.string().min(25).max(25),
1631
+ mailboxId: z.string().min(25).max(25),
1632
+ uid: z.number().min(1),
1633
+ sequenceNumber: z.number().min(1),
1634
+ rfc822Size: z.number().min(0),
1615
1635
  internalDate: z.number(),
1616
- messageIdHeader: z.string().optional(),
1617
- envelopeId: z.string(),
1618
- rootBodyPartId: z.string(),
1636
+ envelopeId: z.string().min(25).max(25),
1637
+ rootBodyPartId: z.string().min(25).max(25),
1619
1638
  bodyStorageKey: z.string().optional(),
1620
1639
  status: MessageStatusSchema,
1621
1640
  syncStatus: MessageSyncStatusSchema,
1622
1641
  abandonedMutation: MessageMutationSchema,
1623
- originalMailboxId: z.string().optional(),
1642
+ originalMailboxId: z.string().min(25).max(25).optional(),
1624
1643
  originalUid: z.number().optional(),
1625
1644
  category: MessageCategorySchema,
1626
1645
  classificationState: MessageClassificationStateSchema,
@@ -1638,17 +1657,49 @@ export const MessageSchema = z.object({
1638
1657
  updatedAt: z.number()
1639
1658
  });
1640
1659
 
1660
+ export const MessageSchema = z.object({
1661
+ messageId: z.string().min(25).max(25),
1662
+ mailboxId: z.string().min(25).max(25),
1663
+ uid: z.number().min(1),
1664
+ sequenceNumber: z.number().min(1),
1665
+ rfc822Size: z.number().min(0),
1666
+ internalDate: z.number(),
1667
+ envelopeId: z.string().min(25).max(25),
1668
+ rootBodyPartId: z.string().min(25).max(25),
1669
+ bodyStorageKey: z.string().optional(),
1670
+ status: MessageStatusSchema,
1671
+ syncStatus: MessageSyncStatusSchema,
1672
+ abandonedMutation: MessageMutationSchema,
1673
+ originalMailboxId: z.string().min(25).max(25).optional(),
1674
+ originalUid: z.number().optional(),
1675
+ category: MessageCategorySchema,
1676
+ classificationState: MessageClassificationStateSchema,
1677
+ authenticity: MessageAuthenticitySchema.optional(),
1678
+ authenticityVerdict: AuthenticityVerdictSchema,
1679
+ authResult: MessageAuthResultSchema.optional(),
1680
+ providerSpam: MessageProviderSpamSchema.optional(),
1681
+ hasListUnsubscribe: z.boolean(),
1682
+ movedByRemit: z.boolean(),
1683
+ placementVerdict: MessagePlacementVerdictSchema.optional(),
1684
+ filterMove: MessageFilterMoveSchema.optional(),
1685
+ placementDecidedAt: z.number().optional(),
1686
+ spamReport: MessageSpamReportSchema.optional(),
1687
+ createdAt: z.number(),
1688
+ updatedAt: z.number(),
1689
+ messageIdHeader: z.string().optional()
1690
+ });
1691
+
1641
1692
  export const BodyPartSchema = z.object({
1642
- bodyPartId: z.string(),
1643
- messageId: z.string(),
1644
- parentBodyPartId: z.string().optional(),
1645
- partPath: z.string(),
1693
+ bodyPartId: z.string().min(25).max(25),
1694
+ messageId: z.string().min(25).max(25),
1695
+ parentBodyPartId: z.string().min(25).max(25).optional(),
1696
+ partPath: z.string().min(1),
1646
1697
  mediaType: MediaTypeSchema,
1647
- mediaSubtype: z.string(),
1698
+ mediaSubtype: z.string().min(1),
1648
1699
  contentId: z.string().optional(),
1649
1700
  contentDescription: z.string().optional(),
1650
1701
  transferEncoding: TransferEncodingSchema,
1651
- sizeOctets: z.number(),
1702
+ sizeOctets: z.number().min(0),
1652
1703
  lineCount: z.number().optional(),
1653
1704
  md5Hash: z.string().optional(),
1654
1705
  disposition: ContentDispositionSchema.optional(),
@@ -1662,12 +1713,12 @@ export const BodyPartSchema = z.object({
1662
1713
  });
1663
1714
 
1664
1715
  export const MessageReferenceSchema = z.object({
1665
- messageReferenceId: z.string(),
1666
- messageId: z.string(),
1667
- envelopeId: z.string(),
1716
+ messageReferenceId: z.string().min(25).max(25),
1717
+ messageId: z.string().min(25).max(25),
1718
+ envelopeId: z.string().min(25).max(25),
1668
1719
  messageIdValue: z.string(),
1669
1720
  referenceType: ReferenceTypeSchema,
1670
- referenceOrder: z.number(),
1721
+ referenceOrder: z.number().min(0),
1671
1722
  createdAt: z.number(),
1672
1723
  updatedAt: z.number()
1673
1724
  });
@@ -1683,7 +1734,7 @@ export const UpdateFlagsInputSchema = z.object({
1683
1734
  });
1684
1735
 
1685
1736
  export const BulkUpdateFlagsInputSchema = z.object({
1686
- messageIds: z.array(z.string()),
1737
+ messageIds: z.array(z.string().min(25).max(25)).min(1).max(100),
1687
1738
  isRead: z.boolean().optional(),
1688
1739
  isStarred: z.boolean().optional(),
1689
1740
  starColor: StarColorSchema.optional()
@@ -1695,32 +1746,32 @@ export const MessageBulkOperationResultSchema = z.object({
1695
1746
  });
1696
1747
 
1697
1748
  export const DeleteMessagesInputSchema = z.object({
1698
- messageIds: z.array(z.string()),
1749
+ messageIds: z.array(z.string().min(25).max(25)).min(1).max(100),
1699
1750
  permanent: z.boolean().optional()
1700
1751
  });
1701
1752
 
1702
1753
  export const BulkMessageInputSchema = z.object({
1703
- messageIds: z.array(z.string())
1754
+ messageIds: z.array(z.string().min(25).max(25)).min(1).max(100)
1704
1755
  });
1705
1756
 
1706
1757
  export const MoveMessagesInputSchema = z.object({
1707
- messageIds: z.array(z.string()),
1708
- destinationMailboxId: z.string()
1758
+ messageIds: z.array(z.string().min(25).max(25)).min(1).max(100),
1759
+ destinationMailboxId: z.string().min(25).max(25)
1709
1760
  });
1710
1761
 
1711
1762
  export const CopyMessagesInputSchema = z.object({
1712
- messageIds: z.array(z.string()),
1713
- destinationMailboxId: z.string()
1763
+ messageIds: z.array(z.string().min(25).max(25)).min(1).max(100),
1764
+ destinationMailboxId: z.string().min(25).max(25)
1714
1765
  });
1715
1766
 
1716
1767
  export const UpdateMessageLabelsInputSchema = z.object({
1717
- messageIds: z.array(z.string()),
1718
- labelId: z.string(),
1768
+ messageIds: z.array(z.string().min(25).max(25)).min(1).max(100),
1769
+ labelId: z.string().min(25).max(25),
1719
1770
  action: LabelActionSchema
1720
1771
  });
1721
1772
 
1722
1773
  export const SpamReportFailureSchema = z.object({
1723
- messageId: z.string(),
1774
+ messageId: z.string().min(25).max(25),
1724
1775
  reason: z.string()
1725
1776
  });
1726
1777
 
@@ -1731,22 +1782,22 @@ export const SpamReportBulkResultSchema = z.object({
1731
1782
  });
1732
1783
 
1733
1784
  export const CalendarSuggestionSchema = z.object({
1734
- suggestionId: z.string(),
1735
- accountConfigId: z.string(),
1736
- messageId: z.string(),
1737
- bodyPartId: z.string(),
1738
- icalUid: z.string(),
1785
+ suggestionId: z.string().min(25).max(25),
1786
+ accountConfigId: z.string().min(25).max(25),
1787
+ messageId: z.string().min(25).max(25),
1788
+ bodyPartId: z.string().min(25).max(25),
1789
+ icalUid: z.string().max(512),
1739
1790
  sequence: z.number(),
1740
1791
  method: CalendarInviteMethodSchema,
1741
1792
  source: CalendarSuggestionSourceSchema,
1742
1793
  state: CalendarSuggestionStateSchema,
1743
- summary: z.string(),
1744
- dtStart: z.string(),
1745
- dtEnd: z.string(),
1746
- endsAtUtc: z.string(),
1794
+ summary: z.string().max(512),
1795
+ dtStart: z.string().max(64),
1796
+ dtEnd: z.string().max(64),
1797
+ endsAtUtc: z.string().max(64),
1747
1798
  allDay: z.boolean(),
1748
- location: z.string(),
1749
- organizer: z.string(),
1799
+ location: z.string().max(512),
1800
+ organizer: z.string().max(256),
1750
1801
  zoneCertainty: ZoneCertaintySchema,
1751
1802
  icalData: z.string(),
1752
1803
  acceptedCalendarObjectId: z.string(),
@@ -1756,22 +1807,22 @@ export const CalendarSuggestionSchema = z.object({
1756
1807
  });
1757
1808
 
1758
1809
  export const CalendarSuggestionResponseSchema = z.object({
1759
- suggestionId: z.string(),
1760
- accountConfigId: z.string(),
1761
- messageId: z.string(),
1762
- bodyPartId: z.string(),
1763
- icalUid: z.string(),
1810
+ suggestionId: z.string().min(25).max(25),
1811
+ accountConfigId: z.string().min(25).max(25),
1812
+ messageId: z.string().min(25).max(25),
1813
+ bodyPartId: z.string().min(25).max(25),
1814
+ icalUid: z.string().max(512),
1764
1815
  sequence: z.number(),
1765
1816
  method: CalendarInviteMethodSchema,
1766
1817
  source: CalendarSuggestionSourceSchema,
1767
1818
  state: CalendarSuggestionStateSchema,
1768
- summary: z.string(),
1769
- dtStart: z.string(),
1770
- dtEnd: z.string(),
1771
- endsAtUtc: z.string(),
1819
+ summary: z.string().max(512),
1820
+ dtStart: z.string().max(64),
1821
+ dtEnd: z.string().max(64),
1822
+ endsAtUtc: z.string().max(64),
1772
1823
  allDay: z.boolean(),
1773
- location: z.string(),
1774
- organizer: z.string(),
1824
+ location: z.string().max(512),
1825
+ organizer: z.string().max(256),
1775
1826
  zoneCertainty: ZoneCertaintySchema,
1776
1827
  acceptedCalendarObjectId: z.string(),
1777
1828
  supersededByMessageId: z.string(),
@@ -1782,7 +1833,7 @@ export const CalendarSuggestionResponseSchema = z.object({
1782
1833
  });
1783
1834
 
1784
1835
  export const AcceptCalendarSuggestionInputSchema = z.object({
1785
- calendarId: z.string(),
1836
+ calendarId: z.string().min(25).max(25),
1786
1837
  answer: CalendarInviteAnswerSchema.optional(),
1787
1838
  event: UpdateCalendarEventInputSchema.optional()
1788
1839
  });
@@ -1792,28 +1843,28 @@ export const DismissCalendarSuggestionInputSchema = z.object({
1792
1843
  });
1793
1844
 
1794
1845
  export const EnvelopeAddressSchema = z.object({
1795
- envelopeAddressId: z.string(),
1796
- messageId: z.string(),
1797
- addressId: z.string(),
1846
+ envelopeAddressId: z.string().min(25).max(25),
1847
+ messageId: z.string().min(25).max(25),
1848
+ addressId: z.string().min(25).max(25),
1798
1849
  displayName: z.string().optional(),
1799
1850
  normalizedEmail: z.string(),
1800
1851
  addressRole: AddressRoleSchema,
1801
- addressOrder: z.number(),
1852
+ addressOrder: z.number().min(0),
1802
1853
  createdAt: z.number(),
1803
1854
  updatedAt: z.number()
1804
1855
  });
1805
1856
 
1806
1857
  export const ConfigImportUnresolvedRefSchema = z.object({
1807
1858
  kind: ConfigImportRefKindSchema,
1808
- accountId: z.string(),
1809
- folderPath: z.string(),
1810
- target: z.string(),
1859
+ accountId: z.string().min(25).max(25),
1860
+ folderPath: z.string().max(512),
1861
+ target: z.string().max(256),
1811
1862
  mailboxId: z.string()
1812
1863
  });
1813
1864
 
1814
1865
  export const ConfigImportSchema = z.object({
1815
- importId: z.string(),
1816
- accountConfigId: z.string(),
1866
+ importId: z.string().min(25).max(25),
1867
+ accountConfigId: z.string().min(25).max(25),
1817
1868
  schemaVersion: z.number(),
1818
1869
  state: ConfigImportStateSchema,
1819
1870
  document: z.record(z.string(), z.unknown()),
@@ -1858,8 +1909,8 @@ export const MutedFlagSettingSchema = z.object({
1858
1909
  });
1859
1910
 
1860
1911
  export const AccountSettingSchema = z.object({
1861
- accountSettingId: z.string(),
1862
- accountConfigId: z.string(),
1912
+ accountSettingId: z.string().min(25).max(25),
1913
+ accountConfigId: z.string().min(25).max(25),
1863
1914
  name: z.string(),
1864
1915
  value: z.union([BooleanSettingSchema, StringSettingSchema, NumberSettingSchema, StringListSettingSchema, MapSettingSchema, MutedFlagSettingSchema]),
1865
1916
  createdAt: z.number(),
@@ -1867,37 +1918,37 @@ export const AccountSettingSchema = z.object({
1867
1918
  });
1868
1919
 
1869
1920
  export const MailboxAttributeEntrySchema = z.object({
1870
- mailboxAttributeId: z.string(),
1871
- mailboxId: z.string(),
1921
+ mailboxAttributeId: z.string().min(25).max(25),
1922
+ mailboxId: z.string().min(25).max(25),
1872
1923
  attributeName: MailboxAttributeSchema
1873
1924
  });
1874
1925
 
1875
1926
  export const MailboxSpecialUseEntrySchema = z.object({
1876
- mailboxSpecialUseId: z.string(),
1877
- mailboxId: z.string(),
1927
+ mailboxSpecialUseId: z.string().min(25).max(25),
1928
+ mailboxId: z.string().min(25).max(25),
1878
1929
  specialUse: MailboxSpecialUseSchema
1879
1930
  });
1880
1931
 
1881
1932
  export const MailboxFlagSchema = z.object({
1882
- mailboxFlagId: z.string(),
1883
- mailboxId: z.string(),
1933
+ mailboxFlagId: z.string().min(25).max(25),
1934
+ mailboxId: z.string().min(25).max(25),
1884
1935
  flagName: z.union([MessageSystemFlagSchema, MessageKeywordFlagSchema, z.string()]),
1885
1936
  isPermanent: z.boolean()
1886
1937
  });
1887
1938
 
1888
1939
  export const MailboxLockSchema = z.object({
1889
- mailboxId: z.string(),
1940
+ mailboxId: z.string().min(25).max(25),
1890
1941
  eventName: z.string(),
1891
- accountId: z.string(),
1892
- lockId: z.string(),
1942
+ accountId: z.string().min(25).max(25),
1943
+ lockId: z.string().min(25).max(25),
1893
1944
  acquiredAt: z.number(),
1894
1945
  lockedBy: z.string(),
1895
1946
  ttl: z.number()
1896
1947
  });
1897
1948
 
1898
1949
  export const MessageFlagSchema = z.object({
1899
- messageFlagId: z.string(),
1900
- messageId: z.string(),
1950
+ messageFlagId: z.string().min(25).max(25),
1951
+ messageId: z.string().min(25).max(25),
1901
1952
  flagName: z.union([MessageSystemFlagSchema, MessageKeywordFlagSchema, z.string()]),
1902
1953
  setAt: z.number(),
1903
1954
  createdAt: z.number(),
@@ -1905,22 +1956,22 @@ export const MessageFlagSchema = z.object({
1905
1956
  });
1906
1957
 
1907
1958
  export const MessagePlacementMoveSchema = z.object({
1908
- messageId: z.string(),
1909
- accountId: z.string(),
1910
- accountConfigId: z.string(),
1911
- sourceMailboxId: z.string(),
1912
- destinationMailboxId: z.string(),
1959
+ messageId: z.string().min(25).max(25),
1960
+ accountId: z.string().min(25).max(25),
1961
+ accountConfigId: z.string().min(25).max(25),
1962
+ sourceMailboxId: z.string().min(25).max(25),
1963
+ destinationMailboxId: z.string().min(25).max(25),
1913
1964
  state: MessagePlacementMoveStateSchema,
1914
1965
  createdAt: z.number(),
1915
1966
  updatedAt: z.number()
1916
1967
  });
1917
1968
 
1918
1969
  export const MessageFlagPushSchema = z.object({
1919
- messageId: z.string(),
1970
+ messageId: z.string().min(25).max(25),
1920
1971
  flagName: z.string(),
1921
- accountId: z.string(),
1922
- accountConfigId: z.string(),
1923
- mailboxId: z.string(),
1972
+ accountId: z.string().min(25).max(25),
1973
+ accountConfigId: z.string().min(25).max(25),
1974
+ mailboxId: z.string().min(25).max(25),
1924
1975
  operation: FlagPushOperationSchema,
1925
1976
  state: MessageFlagPushStateSchema,
1926
1977
  createdAt: z.number(),
@@ -1928,8 +1979,8 @@ export const MessageFlagPushSchema = z.object({
1928
1979
  });
1929
1980
 
1930
1981
  export const EnvelopeSchema = z.object({
1931
- envelopeId: z.string(),
1932
- messageId: z.string(),
1982
+ envelopeId: z.string().min(25).max(25),
1983
+ messageId: z.string().min(25).max(25),
1933
1984
  dateValue: z.number(),
1934
1985
  dateRaw: z.string(),
1935
1986
  subject: z.string().optional(),
@@ -1939,9 +1990,9 @@ export const EnvelopeSchema = z.object({
1939
1990
  });
1940
1991
 
1941
1992
  export const SenderSignerStandingSchema = z.object({
1942
- accountConfigId: z.string(),
1943
- senderKey: z.string(),
1944
- signerDomain: z.string(),
1993
+ accountConfigId: z.string().min(25).max(25),
1994
+ senderKey: z.string().max(256),
1995
+ signerDomain: z.string().max(256),
1945
1996
  messageCount: z.number(),
1946
1997
  firstSeenAt: z.number(),
1947
1998
  lastSeenAt: z.number(),
@@ -1951,23 +2002,29 @@ export const SenderSignerStandingSchema = z.object({
1951
2002
  });
1952
2003
 
1953
2004
  export const BodyPartParameterSchema = z.object({
1954
- bodyPartParameterId: z.string(),
1955
- messageId: z.string(),
1956
- bodyPartId: z.string(),
1957
- parameterName: z.string(),
2005
+ bodyPartParameterId: z.string().min(25).max(25),
2006
+ messageId: z.string().min(25).max(25),
2007
+ bodyPartId: z.string().min(25).max(25),
2008
+ parameterName: z.string().min(1),
1958
2009
  parameterValue: z.string(),
1959
2010
  createdAt: z.number(),
1960
2011
  updatedAt: z.number()
1961
2012
  });
1962
2013
 
2014
+ export const BodyStructureRefetchSchema = z.object({
2015
+ messageId: z.string().min(25).max(25),
2016
+ createdAt: z.number(),
2017
+ updatedAt: z.number()
2018
+ });
2019
+
1963
2020
  export const RawMessageStorageSchema = z.object({
1964
- rawStorageId: z.string(),
1965
- messageId: z.string(),
2021
+ rawStorageId: z.string().min(25).max(25),
2022
+ messageId: z.string().min(25).max(25),
1966
2023
  storageType: StorageTypeSchema,
1967
2024
  storageLocation: z.string(),
1968
2025
  storageKey: z.string(),
1969
- sizeBytes: z.number(),
1970
- checksumSha256: z.string(),
2026
+ sizeBytes: z.number().min(0),
2027
+ checksumSha256: z.string().min(64).max(64),
1971
2028
  contentEncoding: ContentEncodingSchema,
1972
2029
  storedAt: z.number(),
1973
2030
  expiresAt: z.number().optional(),
@@ -1976,14 +2033,14 @@ export const RawMessageStorageSchema = z.object({
1976
2033
  });
1977
2034
 
1978
2035
  export const BodyPartStorageSchema = z.object({
1979
- bodyPartStorageId: z.string(),
1980
- messageId: z.string(),
1981
- bodyPartId: z.string(),
2036
+ bodyPartStorageId: z.string().min(25).max(25),
2037
+ messageId: z.string().min(25).max(25),
2038
+ bodyPartId: z.string().min(25).max(25),
1982
2039
  storageType: StorageTypeSchema,
1983
2040
  storageLocation: z.string(),
1984
2041
  storageKey: z.string(),
1985
- decodedSizeBytes: z.number(),
1986
- checksumSha256: z.string(),
2042
+ decodedSizeBytes: z.number().min(0),
2043
+ checksumSha256: z.string().min(64).max(64),
1987
2044
  contentEncoding: ContentEncodingSchema,
1988
2045
  isDeduped: z.boolean(),
1989
2046
  dedupHash: z.string().optional(),
@@ -1992,24 +2049,14 @@ export const BodyPartStorageSchema = z.object({
1992
2049
  updatedAt: z.number()
1993
2050
  });
1994
2051
 
1995
- export const BodyPartContentSchema = z.object({
1996
- bodyPartContentId: z.string(),
1997
- messageId: z.string(),
1998
- bodyPartId: z.string(),
1999
- content: z.string(),
2000
- contentLength: z.number(),
2001
- createdAt: z.number(),
2002
- updatedAt: z.number()
2003
- });
2004
-
2005
2052
  export const CalendarEventIndexSchema = z.object({
2006
- calendarId: z.string(),
2007
- calendarObjectId: z.string(),
2008
- recurrenceId: z.string(),
2009
- startAt: z.string(),
2010
- endAt: z.string(),
2053
+ calendarId: z.string().min(25).max(25),
2054
+ calendarObjectId: z.string().min(25).max(25),
2055
+ recurrenceId: z.string().max(64),
2056
+ startAt: z.string().max(64),
2057
+ endAt: z.string().max(64),
2011
2058
  allDay: z.boolean(),
2012
- summary: z.string(),
2059
+ summary: z.string().max(512),
2013
2060
  status: CalendarEventStatusSchema,
2014
2061
  transparency: CalendarTransparencySchema,
2015
2062
  createdAt: z.number(),
@@ -2017,39 +2064,28 @@ export const CalendarEventIndexSchema = z.object({
2017
2064
  });
2018
2065
 
2019
2066
  export const CalendarFeedTokenSchema = z.object({
2020
- feedTokenId: z.string(),
2021
- accountConfigId: z.string(),
2022
- calendarId: z.string(),
2023
- tokenHash: z.string(),
2067
+ feedTokenId: z.string().min(25).max(25),
2068
+ accountConfigId: z.string().min(25).max(25),
2069
+ calendarId: z.string().min(25).max(25),
2070
+ tokenHash: z.string().max(64),
2024
2071
  createdAt: z.number(),
2025
2072
  rotatedAt: z.number(),
2026
2073
  updatedAt: z.number()
2027
2074
  });
2028
2075
 
2029
2076
  export const MessageLabelSchema = z.object({
2030
- messageLabelId: z.string(),
2031
- messageId: z.string(),
2032
- labelId: z.string(),
2033
- accountConfigId: z.string(),
2034
- appliedByFilterId: z.string().optional(),
2035
- createdAt: z.number(),
2036
- updatedAt: z.number()
2037
- });
2038
-
2039
- export const FilterAnchorSchema = z.object({
2040
- accountConfigId: z.string(),
2041
- filterId: z.string(),
2042
- anchorEmbedding: z.array(z.number()),
2043
- anchorEmbeddingId: z.string(),
2044
- anchorSourceText: z.string(),
2045
- anchorMessageId: z.string(),
2077
+ messageLabelId: z.string().min(25).max(25),
2078
+ messageId: z.string().min(25).max(25),
2079
+ labelId: z.string().min(25).max(25),
2080
+ accountConfigId: z.string().min(25).max(25),
2081
+ appliedByFilterId: z.string().min(25).max(25).optional(),
2046
2082
  createdAt: z.number(),
2047
2083
  updatedAt: z.number()
2048
2084
  });
2049
2085
 
2050
2086
  export const MicrosoftOAuthStartRequestSchema = z.object({
2051
2087
  email: z.string().optional(),
2052
- services: z.array(AccountServiceSchema).optional()
2088
+ services: z.array(AccountServiceSchema).min(1).optional()
2053
2089
  });
2054
2090
 
2055
2091
  export const MicrosoftOAuthStartResponseSchema = z.object({