@remit/api-zod-schemas 0.0.59 → 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.js CHANGED
@@ -7,6 +7,7 @@ export const AccountExportStateSchema = z.enum(["Pending", "Processing", "Ready"
7
7
  export const CanonicalMailboxRoleSchema = z.enum(["Inbox", "Drafts", "Sent", "Archive", "Junk", "Trash", "All", "Flagged"]);
8
8
  export const QuarantineFailureStageSchema = z.enum(["BodyParse"]);
9
9
  export const QuarantineFailureCodeSchema = z.enum(["UnknownCharset", "UnreadableBody"]);
10
+ export const SyncWarningStageSchema = z.enum(["Header", "Body"]);
10
11
  export const AccountConfigStateSchema = z.enum(["active", "deleting"]);
11
12
  export const AccountAuthTypeSchema = z.enum(["password", "oauthMicrosoft"]);
12
13
  export const AccountServiceSchema = z.enum(["Mail", "Calendar"]);
@@ -45,7 +46,6 @@ export const MessageStatusSchema = z.enum(["active", "deleting", "deleted", "mov
45
46
  export const MessageSyncStatusSchema = z.enum(["synced", "pending", "failed", "abandoned"]);
46
47
  export const MessageMutationSchema = z.enum(["none", "move", "delete", "copy"]);
47
48
  export const PlacementActionSchema = z.enum(["MoveToInbox", "MoveToJunk"]);
48
- export const SemanticSearchChunkTypeSchema = z.enum(["sender", "recipient", "subject", "attachment", "body", "entities"]);
49
49
  export const OutboxMessageStatusSchema = z.enum(["draft", "queued", "sending", "sent", "unfiled", "failed", "blocked"]);
50
50
  export const OutboxAttachmentStateSchema = z.enum(["Pending", "Stored"]);
51
51
  export const OutboxAttachmentRejectionReasonSchema = z.enum(["EmptyFile", "UnusableFilename", "FileTooLarge", "MessageTooLarge", "TooManyAttachments", "ReservationExpired", "UploadMissing", "SizeMismatch"]);
@@ -75,12 +75,13 @@ export const SenderOverrideSchema = z.enum(["none", "blocked", "neverSpam"]);
75
75
  export const AccountSettingNameSchema = z.enum(["Theme", "Density", "DefaultComposerFormat", "PinnedFolders", "AccountSignaturePlainText", "AccountSignatureHtml", "AccountDisplayName", "AccountMuted", "AccountComposeLanguages", "MailboxDisplayName", "MailboxMuted", "FolderRoleAppointment", "FolderRoleAppointmentLabel", "MailboxRole"]);
76
76
  export const ConfigImportStateSchema = z.enum(["Pending", "Complete"]);
77
77
  export const ConfigImportRefKindSchema = z.enum(["FolderRole", "MailboxOverride", "FilterAction"]);
78
+ export const SyncWarningStateSchema = z.enum(["Retrying", "GaveUp"]);
78
79
  export const MessagePlacementMoveStateSchema = z.enum(["pending", "queued", "processing", "processed"]);
79
80
  export const FlagPushOperationSchema = z.enum(["add", "remove"]);
80
81
  export const MessageFlagPushStateSchema = z.enum(["pending", "queued", "processing", "processed"]);
81
82
  export const CognitoAuthorizerSchema = z.object({
82
- type: z.unknown(),
83
- "in": z.unknown(),
83
+ type: z.literal("apiKey"),
84
+ "in": z.literal("header"),
84
85
  name: z.literal("Authorization")
85
86
  });
86
87
  export const ApiErrorSchema = z.object({
@@ -157,8 +158,8 @@ export const PreconditionFailedErrorSchema = z.object({
157
158
  message: z.string(),
158
159
  details: z.record(z.string(), z.string()).optional()
159
160
  });
160
- export const DeleteMessagesConflictSchema = z.object({
161
- statusCode: z.literal(409),
161
+ export const MessageNotFoundErrorSchema = z.object({
162
+ statusCode: z.literal(404),
162
163
  code: z.string(),
163
164
  message: z.string(),
164
165
  details: z.record(z.string(), z.string()).optional()
@@ -169,6 +170,12 @@ export const MessagePlacementConflictSchema = z.object({
169
170
  message: z.string(),
170
171
  details: z.record(z.string(), z.string()).optional()
171
172
  });
173
+ export const DeleteMessagesConflictSchema = z.object({
174
+ statusCode: z.literal(409),
175
+ code: z.string(),
176
+ message: z.string(),
177
+ details: z.record(z.string(), z.string()).optional()
178
+ });
172
179
  export const AmazonApiGatewayIntegrationSchema = z.object({
173
180
  type: z.literal("aws_proxy"),
174
181
  httpMethod: z.literal("POST"),
@@ -189,7 +196,7 @@ export const DeleteAccountConfigResponseSchema = z.object({
189
196
  message: z.string()
190
197
  });
191
198
  export const VipSuggestionEntrySchema = z.object({
192
- addressId: z.string(),
199
+ addressId: z.string().min(25).max(25),
193
200
  displayName: z.string().optional(),
194
201
  normalizedEmail: z.string(),
195
202
  inboundCount: z.number(),
@@ -206,8 +213,8 @@ export const CreateExportResponseSchema = z.object({
206
213
  exportId: z.string()
207
214
  });
208
215
  export const AccountExportRequestSchema = z.object({
209
- accountExportRequestId: z.string(),
210
- accountConfigId: z.string(),
216
+ accountExportRequestId: z.string().min(25).max(25),
217
+ accountConfigId: z.string().min(25).max(25),
211
218
  userId: z.string(),
212
219
  state: AccountExportStateSchema,
213
220
  createdAt: z.number(),
@@ -218,8 +225,8 @@ export const AccountExportRequestSchema = z.object({
218
225
  errorMessage: z.string().optional()
219
226
  });
220
227
  export const AccountExportRequestResponseSchema = z.object({
221
- accountExportRequestId: z.string(),
222
- accountConfigId: z.string(),
228
+ accountExportRequestId: z.string().min(25).max(25),
229
+ accountConfigId: z.string().min(25).max(25),
223
230
  userId: z.string(),
224
231
  state: AccountExportStateSchema,
225
232
  createdAt: z.number(),
@@ -231,64 +238,88 @@ export const AccountExportRequestResponseSchema = z.object({
231
238
  });
232
239
  export const QuarantineMimeNodeSchema = z.object({
233
240
  depth: z.number(),
234
- contentType: z.string()
241
+ contentType: z.string().max(140)
235
242
  });
236
243
  export const QuarantineResponseSchema = z.object({
237
- quarantineId: z.string(),
238
- accountConfigId: z.string(),
239
- accountId: z.string(),
240
- mailboxId: z.string(),
244
+ quarantineId: z.string().min(25).max(25),
245
+ accountConfigId: z.string().min(25).max(25),
246
+ accountId: z.string().min(25).max(25),
247
+ mailboxId: z.string().min(25).max(25),
241
248
  uidValidity: z.number(),
242
249
  uid: z.number(),
243
250
  mailboxRole: CanonicalMailboxRoleSchema.optional(),
244
- mailboxPath: z.string(),
251
+ mailboxPath: z.string().max(512),
245
252
  quarantinedAt: z.number(),
246
253
  attempts: z.number(),
247
254
  failureStage: QuarantineFailureStageSchema,
248
255
  failureCode: QuarantineFailureCodeSchema,
249
- failureMessage: z.string(),
250
- failurePartPath: z.string().optional(),
251
- workerVersion: z.string(),
252
- contentType: z.string().optional(),
253
- transferEncoding: z.string().optional(),
254
- charset: z.string().optional(),
256
+ failureMessage: z.string().max(512),
257
+ failurePartPath: z.string().max(140).optional(),
258
+ workerVersion: z.string().max(64),
259
+ contentType: z.string().max(140).optional(),
260
+ transferEncoding: z.string().max(64).optional(),
261
+ charset: z.string().max(64).optional(),
255
262
  sizeBytes: z.number().optional(),
256
263
  structure: z.array(QuarantineMimeNodeSchema),
257
- messageIdHash: z.string().optional(),
264
+ messageIdHash: z.string().max(140).optional(),
258
265
  createdAt: z.number(),
259
266
  updatedAt: z.number()
260
267
  });
268
+ export const SyncWarningResponseSchema = z.object({
269
+ syncWarningId: z.string().min(25).max(25),
270
+ accountConfigId: z.string().min(25).max(25),
271
+ accountId: z.string().min(25).max(25),
272
+ mailboxId: z.string().min(25).max(25),
273
+ uidValidity: z.number(),
274
+ uid: z.number(),
275
+ stage: SyncWarningStageSchema,
276
+ attempts: z.number(),
277
+ createdAt: z.number()
278
+ });
261
279
  export const QuarantineListResponseSchema = z.object({
262
- entries: z.array(QuarantineResponseSchema)
280
+ entries: z.array(QuarantineResponseSchema),
281
+ warnings: z.array(SyncWarningResponseSchema),
282
+ warningsTotal: z.number()
263
283
  });
264
284
  export const QuarantineSchema = z.object({
265
- quarantineId: z.string(),
266
- accountConfigId: z.string(),
267
- accountId: z.string(),
268
- mailboxId: z.string(),
285
+ quarantineId: z.string().min(25).max(25),
286
+ accountConfigId: z.string().min(25).max(25),
287
+ accountId: z.string().min(25).max(25),
288
+ mailboxId: z.string().min(25).max(25),
269
289
  uidValidity: z.number(),
270
290
  uid: z.number(),
271
291
  mailboxRole: CanonicalMailboxRoleSchema.optional(),
272
- mailboxPath: z.string(),
292
+ mailboxPath: z.string().max(512),
273
293
  quarantinedAt: z.number(),
274
294
  attempts: z.number(),
275
295
  failureStage: QuarantineFailureStageSchema,
276
296
  failureCode: QuarantineFailureCodeSchema,
277
- failureMessage: z.string(),
278
- failurePartPath: z.string().optional(),
279
- workerVersion: z.string(),
280
- contentType: z.string().optional(),
281
- transferEncoding: z.string().optional(),
282
- charset: z.string().optional(),
297
+ failureMessage: z.string().max(512),
298
+ failurePartPath: z.string().max(140).optional(),
299
+ workerVersion: z.string().max(64),
300
+ contentType: z.string().max(140).optional(),
301
+ transferEncoding: z.string().max(64).optional(),
302
+ charset: z.string().max(64).optional(),
283
303
  sizeBytes: z.number().optional(),
284
304
  structure: z.array(QuarantineMimeNodeSchema),
285
- messageIdHash: z.string().optional(),
305
+ messageIdHash: z.string().max(140).optional(),
286
306
  createdAt: z.number(),
287
307
  updatedAt: z.number()
288
308
  });
309
+ export const SyncWarningSchema = z.object({
310
+ syncWarningId: z.string().min(25).max(25),
311
+ accountConfigId: z.string().min(25).max(25),
312
+ accountId: z.string().min(25).max(25),
313
+ mailboxId: z.string().min(25).max(25),
314
+ uidValidity: z.number(),
315
+ uid: z.number(),
316
+ stage: SyncWarningStageSchema,
317
+ attempts: z.number(),
318
+ createdAt: z.number()
319
+ });
289
320
  export const AccountConfigResponseSchema = z.object({
290
- accountConfigId: z.string(),
291
- userId: z.string(),
321
+ accountConfigId: z.string().min(25).max(25),
322
+ userId: z.string().min(25).max(25),
292
323
  name: z.string().optional(),
293
324
  state: AccountConfigStateSchema,
294
325
  deletedAt: z.number().optional(),
@@ -306,25 +337,25 @@ export const MutedFlagSchema = z.object({
306
337
  export const FolderAppointmentSchema = z.object({
307
338
  role: CanonicalMailboxRoleSchema,
308
339
  source: FolderAppointmentSourceSchema,
309
- mailboxId: z.string().optional(),
310
- staleAppointmentMailboxId: z.string().optional(),
311
- staleAppointmentPath: z.string().optional()
340
+ mailboxId: z.string().min(25).max(25).optional(),
341
+ staleAppointmentMailboxId: z.string().min(25).max(25).optional(),
342
+ staleAppointmentPath: z.string().max(512).optional()
312
343
  });
313
344
  export const AccountResponseSchema = z.object({
314
- accountId: z.string(),
315
- accountConfigId: z.string(),
316
- username: z.string(),
345
+ accountId: z.string().min(25).max(25),
346
+ accountConfigId: z.string().min(25).max(25),
347
+ username: z.string().min(1),
317
348
  email: z.string(),
318
349
  authType: AccountAuthTypeSchema,
319
350
  syncedServices: z.array(AccountServiceSchema),
320
351
  grantedScopes: z.array(z.string()),
321
- imapHost: z.string(),
322
- imapPort: z.number(),
352
+ imapHost: z.string().min(1),
353
+ imapPort: z.number().min(1).max(65535),
323
354
  imapTls: z.boolean(),
324
355
  imapStartTls: z.boolean(),
325
356
  smtpEnabled: z.boolean(),
326
357
  smtpHost: z.string(),
327
- smtpPort: z.number(),
358
+ smtpPort: z.number().min(1).max(65535),
328
359
  smtpTls: z.boolean(),
329
360
  smtpStartTls: z.boolean(),
330
361
  smtpUsername: z.string(),
@@ -334,8 +365,8 @@ export const AccountResponseSchema = z.object({
334
365
  lastSyncAt: z.number().optional(),
335
366
  lastError: z.string().optional(),
336
367
  syncPhase: SyncPhaseSchema.optional(),
337
- mailboxCountTotal: z.number().optional(),
338
- mailboxCountSynced: z.number().optional(),
368
+ mailboxCountTotal: z.number().min(0).optional(),
369
+ mailboxCountSynced: z.number().min(0).optional(),
339
370
  createdAt: z.number(),
340
371
  updatedAt: z.number(),
341
372
  displayName: z.string().optional(),
@@ -346,18 +377,18 @@ export const AccountResponseSchema = z.object({
346
377
  folderAppointments: z.array(FolderAppointmentSchema)
347
378
  });
348
379
  export const PendingConfigImportSchema = z.object({
349
- importId: z.string(),
380
+ importId: z.string().min(25).max(25),
350
381
  folderPaths: z.array(z.string())
351
382
  });
352
383
  export const ConfigDescriptionResponseSchema = z.object({
353
384
  accountConfig: AccountConfigResponseSchema,
354
385
  accounts: z.array(AccountResponseSchema),
355
- pendingImport: PendingConfigImportSchema.optional(),
356
- semanticSearchEnabled: z.boolean()
386
+ buildCommit: z.string(),
387
+ pendingImport: PendingConfigImportSchema.optional()
357
388
  });
358
389
  export const AccountConfigSchema = z.object({
359
- accountConfigId: z.string(),
360
- userId: z.string(),
390
+ accountConfigId: z.string().min(25).max(25),
391
+ userId: z.string().min(25).max(25),
361
392
  name: z.string().optional(),
362
393
  state: AccountConfigStateSchema,
363
394
  deletedAt: z.number().optional(),
@@ -366,9 +397,9 @@ export const AccountConfigSchema = z.object({
366
397
  updatedAt: z.number()
367
398
  });
368
399
  export const AccountSchema = z.object({
369
- accountId: z.string(),
370
- accountConfigId: z.string(),
371
- username: z.string(),
400
+ accountId: z.string().min(25).max(25),
401
+ accountConfigId: z.string().min(25).max(25),
402
+ username: z.string().min(1),
372
403
  email: z.string(),
373
404
  authType: AccountAuthTypeSchema,
374
405
  syncedServices: z.array(AccountServiceSchema),
@@ -376,13 +407,13 @@ export const AccountSchema = z.object({
376
407
  passwordHash: z.string().optional(),
377
408
  oauthRefreshTokenHash: z.string().optional(),
378
409
  oauthTokenUpdatedAt: z.number().optional(),
379
- imapHost: z.string(),
380
- imapPort: z.number(),
410
+ imapHost: z.string().min(1),
411
+ imapPort: z.number().min(1).max(65535),
381
412
  imapTls: z.boolean(),
382
413
  imapStartTls: z.boolean(),
383
414
  smtpEnabled: z.boolean(),
384
415
  smtpHost: z.string(),
385
- smtpPort: z.number(),
416
+ smtpPort: z.number().min(1).max(65535),
386
417
  smtpTls: z.boolean(),
387
418
  smtpStartTls: z.boolean(),
388
419
  smtpUsername: z.string(),
@@ -393,8 +424,8 @@ export const AccountSchema = z.object({
393
424
  lastSyncAt: z.number().optional(),
394
425
  lastError: z.string().optional(),
395
426
  syncPhase: SyncPhaseSchema.optional(),
396
- mailboxCountTotal: z.number().optional(),
397
- mailboxCountSynced: z.number().optional(),
427
+ mailboxCountTotal: z.number().min(0).optional(),
428
+ mailboxCountSynced: z.number().min(0).optional(),
398
429
  createdAt: z.number(),
399
430
  updatedAt: z.number(),
400
431
  deletedAt: z.number().optional()
@@ -421,14 +452,14 @@ export const ConfigImportItemReportSchema = z.object({
421
452
  reason: z.string().optional()
422
453
  });
423
454
  export const ConfigImportReportSchema = z.object({
424
- importId: z.string().optional(),
455
+ importId: z.string().min(25).max(25).optional(),
425
456
  valid: z.boolean(),
426
457
  schemaVersion: z.number(),
427
458
  applied: z.boolean(),
428
459
  items: z.array(ConfigImportItemReportSchema),
429
460
  errors: z.array(ApiErrorSchema),
430
461
  warnings: z.array(ApiErrorSchema),
431
- accountsNeedingCredentials: z.array(z.string())
462
+ accountsNeedingCredentials: z.array(z.string().min(25).max(25))
432
463
  });
433
464
  export const ConfigImportConflictSchema = z.object({
434
465
  statusCode: z.literal(409),
@@ -452,7 +483,7 @@ export const SystemUpdateRunSchema = z.object({
452
483
  fromVersion: z.string(),
453
484
  targetVersion: z.string(),
454
485
  phase: SystemUpdatePhaseSchema,
455
- outcome: z.union([SystemUpdateOutcomeSchema, z.unknown()]),
486
+ outcome: z.union([SystemUpdateOutcomeSchema, z.null()]),
456
487
  startedAt: z.string(),
457
488
  updatedAt: z.string(),
458
489
  message: z.string(),
@@ -462,32 +493,32 @@ export const SystemUpdateResponseSchema = z.object({
462
493
  currentVersion: z.string(),
463
494
  currentSchemaVersion: z.number().optional(),
464
495
  check: SystemUpdateCheckSchema,
465
- run: z.union([SystemUpdateRunSchema, z.unknown()])
496
+ run: z.union([SystemUpdateRunSchema, z.null()])
466
497
  });
467
498
  export const ApplyUpdateInputSchema = z.object({
468
499
  targetVersion: z.string()
469
500
  });
470
501
  export const MailboxSchema = z.object({
471
- mailboxId: z.string(),
472
- accountId: z.string(),
502
+ mailboxId: z.string().min(25).max(25),
503
+ accountId: z.string().min(25).max(25),
473
504
  namespaceType: NamespaceTypeSchema,
474
505
  namespacePrefix: z.string(),
475
- hierarchyDelimiter: z.string(),
476
- fullPath: z.string(),
477
- uidValidity: z.number(),
478
- uidNext: z.number(),
479
- highestModseq: z.string(),
480
- messageCount: z.number(),
481
- unseenCount: z.number(),
482
- deletedCount: z.number(),
483
- totalSize: z.number(),
506
+ hierarchyDelimiter: z.string().min(1).max(1),
507
+ fullPath: z.string().min(1).max(512),
508
+ uidValidity: z.number().min(1),
509
+ uidNext: z.number().min(1),
510
+ highestModseq: z.string().max(32),
511
+ messageCount: z.number().min(0),
512
+ unseenCount: z.number().min(0),
513
+ deletedCount: z.number().min(0),
514
+ totalSize: z.number().min(0),
484
515
  lastSyncUid: z.number(),
485
516
  highWaterMarkUid: z.number(),
486
517
  lastMessageSyncAt: z.number(),
487
518
  initialSyncCompletedAt: z.number().optional(),
488
519
  parentMailboxId: z.string(),
489
520
  syncStatus: MailboxSyncStatusSchema,
490
- pendingPath: z.string().optional(),
521
+ pendingPath: z.string().max(512).optional(),
491
522
  syncFailureReason: z.string(),
492
523
  cursorState: MailboxCursorStateSchema,
493
524
  specialUse: z.array(MailboxSpecialUseSchema).optional(),
@@ -495,103 +526,103 @@ export const MailboxSchema = z.object({
495
526
  updatedAt: z.number()
496
527
  });
497
528
  export const MailboxResponseSchema = z.object({
498
- mailboxId: z.string(),
499
- accountId: z.string(),
529
+ mailboxId: z.string().min(25).max(25),
530
+ accountId: z.string().min(25).max(25),
500
531
  namespaceType: NamespaceTypeSchema,
501
532
  namespacePrefix: z.string(),
502
- hierarchyDelimiter: z.string(),
503
- fullPath: z.string(),
504
- messageCount: z.number(),
505
- unseenCount: z.number(),
506
- deletedCount: z.number(),
533
+ hierarchyDelimiter: z.string().min(1).max(1),
534
+ fullPath: z.string().min(1).max(512),
535
+ messageCount: z.number().min(0),
536
+ unseenCount: z.number().min(0),
537
+ deletedCount: z.number().min(0),
507
538
  lastSyncUid: z.number(),
508
539
  highWaterMarkUid: z.number(),
509
540
  lastMessageSyncAt: z.number(),
510
541
  syncStatus: MailboxSyncStatusSchema,
511
- pendingPath: z.string().optional(),
542
+ pendingPath: z.string().max(512).optional(),
512
543
  syncFailureReason: z.string(),
513
544
  specialUse: z.array(MailboxSpecialUseSchema).optional(),
514
545
  createdAt: z.number(),
515
546
  updatedAt: z.number(),
516
547
  muted: MutedFlagSchema.optional(),
517
- displayNameOverride: z.string().optional()
548
+ displayNameOverride: z.string().max(256).optional()
549
+ });
550
+ export const MailboxListResponseSchema = z.object({
551
+ continuationToken: z.string().max(800).optional(),
552
+ items: z.array(MailboxResponseSchema)
518
553
  });
519
554
  export const CreateMailboxInputSchema = z.object({
520
555
  namespaceType: NamespaceTypeSchema,
521
- fullPath: z.string()
556
+ fullPath: z.string().min(1).max(512)
522
557
  });
523
558
  export const RenameMailboxInputSchema = z.object({
524
- fullPath: z.string().optional(),
525
- muted: z.union([MutedFlagSchema, z.unknown()]).optional(),
526
- displayNameOverride: z.union([z.string(), z.unknown()]).optional()
559
+ fullPath: z.string().max(512).optional(),
560
+ muted: z.union([MutedFlagSchema, z.null()]).optional(),
561
+ displayNameOverride: z.union([z.string(), z.null()]).optional()
527
562
  });
528
563
  export const AppointFolderRoleInputSchema = z.object({
529
- mailboxId: z.union([z.string(), z.unknown()])
564
+ mailboxId: z.union([z.string(), z.null()])
530
565
  });
531
566
  export const FilterClauseSchema = z.object({
532
567
  field: FilterClauseFieldSchema,
533
- value: z.string()
568
+ value: z.string().max(256)
534
569
  });
535
570
  export const FilterSchema = z.object({
536
- filterId: z.string(),
537
- accountConfigId: z.string(),
538
- name: z.string(),
571
+ filterId: z.string().min(25).max(25),
572
+ accountConfigId: z.string().min(25).max(25),
573
+ name: z.string().max(256),
539
574
  scope: FilterScopeSchema,
540
575
  expiresAt: z.string().optional(),
541
576
  ttl: z.number().optional(),
542
577
  state: FilterStateSchema,
543
578
  disabledReason: FilterDisabledReasonSchema,
544
- hasAnchor: z.boolean(),
545
579
  ruleChangedAt: z.number(),
546
580
  actionChangedAt: z.number(),
547
581
  matchOperator: FilterMatchOperatorSchema,
548
- literalClauses: z.array(FilterClauseSchema),
582
+ literalClauses: z.array(FilterClauseSchema).min(1),
549
583
  actionLabelId: z.string(),
550
584
  actionMailboxId: z.string(),
551
585
  createdAt: z.number(),
552
586
  updatedAt: z.number()
553
587
  });
554
588
  export const FilterResponseSchema = z.object({
555
- filterId: z.string(),
556
- accountConfigId: z.string(),
557
- name: z.string(),
589
+ filterId: z.string().min(25).max(25),
590
+ accountConfigId: z.string().min(25).max(25),
591
+ name: z.string().max(256),
558
592
  scope: FilterScopeSchema,
559
593
  expiresAt: z.string().optional(),
560
594
  state: FilterStateSchema,
561
595
  disabledReason: FilterDisabledReasonSchema,
562
- hasAnchor: z.boolean(),
563
596
  ruleChangedAt: z.number(),
564
597
  actionChangedAt: z.number(),
565
598
  matchOperator: FilterMatchOperatorSchema,
566
- literalClauses: z.array(FilterClauseSchema),
599
+ literalClauses: z.array(FilterClauseSchema).min(1),
567
600
  actionLabelId: z.string(),
568
601
  actionMailboxId: z.string(),
569
602
  createdAt: z.number(),
570
603
  updatedAt: z.number()
571
604
  });
572
605
  export const CreateFilterInputSchema = z.object({
573
- name: z.string(),
606
+ name: z.string().max(256),
574
607
  scope: FilterScopeSchema,
575
608
  expiresAt: z.string().optional(),
576
609
  matchOperator: FilterMatchOperatorSchema,
577
- literalClauses: z.array(FilterClauseSchema),
610
+ literalClauses: z.array(FilterClauseSchema).min(1),
578
611
  actionLabelId: z.string(),
579
- actionMailboxId: z.string(),
580
- anchorMessageId: z.string().optional()
612
+ actionMailboxId: z.string()
581
613
  });
582
614
  export const CreateFilterResponseSchema = z.object({
583
- filterId: z.string(),
584
- accountConfigId: z.string(),
585
- name: z.string(),
615
+ filterId: z.string().min(25).max(25),
616
+ accountConfigId: z.string().min(25).max(25),
617
+ name: z.string().max(256),
586
618
  scope: FilterScopeSchema,
587
619
  expiresAt: z.string().optional(),
588
620
  state: FilterStateSchema,
589
621
  disabledReason: FilterDisabledReasonSchema,
590
- hasAnchor: z.boolean(),
591
622
  ruleChangedAt: z.number(),
592
623
  actionChangedAt: z.number(),
593
624
  matchOperator: FilterMatchOperatorSchema,
594
- literalClauses: z.array(FilterClauseSchema),
625
+ literalClauses: z.array(FilterClauseSchema).min(1),
595
626
  actionLabelId: z.string(),
596
627
  actionMailboxId: z.string(),
597
628
  createdAt: z.number(),
@@ -599,47 +630,45 @@ export const CreateFilterResponseSchema = z.object({
599
630
  organizeJobId: z.string()
600
631
  });
601
632
  export const UpdateFilterInputSchema = z.object({
602
- name: z.string(),
633
+ name: z.string().max(256),
603
634
  scope: FilterScopeSchema,
604
635
  expiresAt: z.string().optional(),
605
636
  state: FilterStateSchema,
606
637
  matchOperator: FilterMatchOperatorSchema,
607
- literalClauses: z.array(FilterClauseSchema),
638
+ literalClauses: z.array(FilterClauseSchema).min(1),
608
639
  actionLabelId: z.string(),
609
640
  actionMailboxId: z.string()
610
641
  });
611
642
  export const LabelSchema = z.object({
612
- labelId: z.string(),
613
- accountConfigId: z.string(),
614
- name: z.string(),
615
- normalizedName: z.string(),
643
+ labelId: z.string().min(25).max(25),
644
+ accountConfigId: z.string().min(25).max(25),
645
+ name: z.string().max(140),
646
+ normalizedName: z.string().max(140),
616
647
  color: LabelColorSchema,
617
648
  createdAt: z.number(),
618
649
  updatedAt: z.number()
619
650
  });
620
651
  export const LabelResponseSchema = z.object({
621
- labelId: z.string(),
622
- accountConfigId: z.string(),
623
- name: z.string(),
652
+ labelId: z.string().min(25).max(25),
653
+ accountConfigId: z.string().min(25).max(25),
654
+ name: z.string().max(140),
624
655
  color: LabelColorSchema,
625
656
  createdAt: z.number(),
626
657
  updatedAt: z.number(),
627
658
  filterCount: z.number()
628
659
  });
629
660
  export const CreateLabelInputSchema = z.object({
630
- name: z.string(),
661
+ name: z.string().max(140),
631
662
  color: LabelColorSchema
632
663
  });
633
664
  export const UpdateLabelInputSchema = z.object({
634
- name: z.string(),
665
+ name: z.string().max(140),
635
666
  color: LabelColorSchema
636
667
  });
637
668
  export const OrganizeInputSchema = z.object({
638
- filterId: z.string().optional(),
639
- anchorMessageId: z.string().optional(),
669
+ filterId: z.string().min(25).max(25).optional(),
640
670
  matchOperator: FilterMatchOperatorSchema,
641
671
  literalClauses: z.array(FilterClauseSchema),
642
- similarityThreshold: z.number().optional(),
643
672
  actionLabelId: z.string(),
644
673
  actionMailboxId: z.string()
645
674
  });
@@ -650,20 +679,16 @@ export const CreateOrganizeJobResponseSchema = z.object({
650
679
  });
651
680
  export const OrganizePreviewResponseSchema = z.object({
652
681
  matchedCount: z.number(),
653
- messageIds: z.array(z.string()),
654
- semanticUnavailable: z.boolean().optional(),
655
- semanticIndexEmpty: z.boolean().optional()
682
+ messageIds: z.array(z.string())
656
683
  });
657
684
  export const OrganizeJobRequestSchema = z.object({
658
- organizeJobId: z.string(),
659
- accountConfigId: z.string(),
685
+ organizeJobId: z.string().min(25).max(25),
686
+ accountConfigId: z.string().min(25).max(25),
660
687
  userId: z.string(),
661
688
  state: OrganizeJobStateSchema,
662
689
  filterId: z.string(),
663
- anchorMessageId: z.string(),
664
690
  matchOperator: FilterMatchOperatorSchema,
665
691
  literalClauses: z.array(FilterClauseSchema),
666
- similarityThreshold: z.number(),
667
692
  actionLabelId: z.string(),
668
693
  actionMailboxId: z.string(),
669
694
  matchedCount: z.number(),
@@ -675,15 +700,13 @@ export const OrganizeJobRequestSchema = z.object({
675
700
  updatedAt: z.number()
676
701
  });
677
702
  export const OrganizeJobResponseSchema = z.object({
678
- organizeJobId: z.string(),
679
- accountConfigId: z.string(),
703
+ organizeJobId: z.string().min(25).max(25),
704
+ accountConfigId: z.string().min(25).max(25),
680
705
  userId: z.string(),
681
706
  state: OrganizeJobStateSchema,
682
707
  filterId: z.string(),
683
- anchorMessageId: z.string(),
684
708
  matchOperator: FilterMatchOperatorSchema,
685
709
  literalClauses: z.array(FilterClauseSchema),
686
- similarityThreshold: z.number(),
687
710
  actionLabelId: z.string(),
688
711
  actionMailboxId: z.string(),
689
712
  matchedCount: z.number(),
@@ -694,20 +717,20 @@ export const OrganizeJobResponseSchema = z.object({
694
717
  updatedAt: z.number()
695
718
  });
696
719
  export const CalendarResponseSchema = z.object({
697
- calendarId: z.string(),
698
- accountConfigId: z.string(),
699
- urlSegment: z.string(),
700
- displayName: z.string(),
720
+ calendarId: z.string().min(25).max(25),
721
+ accountConfigId: z.string().min(25).max(25),
722
+ urlSegment: z.string().max(64),
723
+ displayName: z.string().max(140),
701
724
  color: CalendarColorSchema,
702
725
  componentSet: CalendarComponentSetSchema,
703
726
  source: CalendarSourceSchema,
704
- timezone: z.string(),
727
+ timezone: z.string().max(64),
705
728
  syncSequence: z.number(),
706
- subscriptionUrl: z.string(),
729
+ subscriptionUrl: z.string().max(2048),
707
730
  subscriptionEnabled: z.boolean(),
708
731
  subscriptionCheckedAt: z.number(),
709
732
  subscriptionFetchedAt: z.number(),
710
- subscriptionError: z.string(),
733
+ subscriptionError: z.string().max(512),
711
734
  createdAt: z.number(),
712
735
  updatedAt: z.number()
713
736
  });
@@ -715,47 +738,47 @@ export const CalendarListResponseSchema = z.object({
715
738
  items: z.array(CalendarResponseSchema)
716
739
  });
717
740
  export const CalendarCollectionSchema = z.object({
718
- calendarId: z.string(),
719
- accountConfigId: z.string(),
720
- urlSegment: z.string(),
721
- displayName: z.string(),
741
+ calendarId: z.string().min(25).max(25),
742
+ accountConfigId: z.string().min(25).max(25),
743
+ urlSegment: z.string().max(64),
744
+ displayName: z.string().max(140),
722
745
  color: CalendarColorSchema,
723
746
  componentSet: CalendarComponentSetSchema,
724
747
  source: CalendarSourceSchema,
725
- timezone: z.string(),
748
+ timezone: z.string().max(64),
726
749
  syncSequence: z.number(),
727
- subscriptionUrl: z.string(),
750
+ subscriptionUrl: z.string().max(2048),
728
751
  subscriptionEnabled: z.boolean(),
729
752
  subscriptionCheckedAt: z.number(),
730
753
  subscriptionFetchedAt: z.number(),
731
- subscriptionError: z.string(),
754
+ subscriptionError: z.string().max(512),
732
755
  createdAt: z.number(),
733
756
  updatedAt: z.number()
734
757
  });
735
758
  export const CreateCalendarInputSchema = z.object({
736
- displayName: z.string(),
737
- urlSegment: z.string(),
759
+ displayName: z.string().max(140),
760
+ urlSegment: z.string().max(64),
738
761
  color: CalendarColorSchema.optional(),
739
- timezone: z.string().optional(),
740
- subscriptionUrl: z.string().optional()
762
+ timezone: z.string().max(64).optional(),
763
+ subscriptionUrl: z.string().max(2048).optional()
741
764
  });
742
765
  export const UpdateCalendarInputSchema = z.object({
743
- displayName: z.string(),
766
+ displayName: z.string().max(140),
744
767
  color: CalendarColorSchema,
745
- timezone: z.string(),
768
+ timezone: z.string().max(64),
746
769
  subscriptionEnabled: z.boolean()
747
770
  });
748
771
  export const CalendarNoContentSchema = z.object({
749
772
  statusCode: z.literal(204)
750
773
  });
751
774
  export const CalendarFeedStateResponseSchema = z.object({
752
- calendarId: z.string(),
775
+ calendarId: z.string().min(25).max(25),
753
776
  createdAt: z.number(),
754
777
  rotatedAt: z.number()
755
778
  });
756
779
  export const CalendarFeedResponseSchema = z.object({
757
- calendarId: z.string(),
758
- feedToken: z.string(),
780
+ calendarId: z.string().min(25).max(25),
781
+ feedToken: z.string().max(512),
759
782
  createdAt: z.number(),
760
783
  rotatedAt: z.number()
761
784
  });
@@ -776,93 +799,93 @@ export const CalendarFeedNotFoundSchema = z.object({
776
799
  message: z.string()
777
800
  });
778
801
  export const CalendarEventInstanceSchema = z.object({
779
- calendarId: z.string(),
780
- calendarObjectId: z.string(),
781
- recurrenceId: z.string(),
782
- icalUid: z.string(),
783
- summary: z.string(),
784
- start: z.string(),
785
- end: z.string(),
802
+ calendarId: z.string().min(25).max(25),
803
+ calendarObjectId: z.string().min(25).max(25),
804
+ recurrenceId: z.string().max(64),
805
+ icalUid: z.string().max(512),
806
+ summary: z.string().max(512),
807
+ start: z.string().max(64),
808
+ end: z.string().max(64),
786
809
  allDay: z.boolean(),
787
810
  status: CalendarEventStatusSchema,
788
811
  transparency: CalendarTransparencySchema,
789
812
  zoneCertainty: ZoneCertaintySchema,
790
- etag: z.string(),
813
+ etag: z.string().max(64),
791
814
  hasRecurrence: z.boolean()
792
815
  });
793
816
  export const CalendarEventListResponseSchema = z.object({
794
817
  items: z.array(CalendarEventInstanceSchema)
795
818
  });
796
819
  export const CreateCalendarEventInputSchema = z.object({
797
- calendarId: z.string(),
798
- summary: z.string(),
799
- description: z.string().optional(),
800
- location: z.string().optional(),
801
- start: z.string(),
802
- end: z.string(),
820
+ calendarId: z.string().min(25).max(25),
821
+ summary: z.string().max(512),
822
+ description: z.string().max(2048).optional(),
823
+ location: z.string().max(512).optional(),
824
+ start: z.string().max(64),
825
+ end: z.string().max(64),
803
826
  allDay: z.boolean().optional(),
804
- timeZone: z.string().optional(),
827
+ timeZone: z.string().max(64).optional(),
805
828
  status: CalendarEventStatusSchema.optional(),
806
829
  transparency: CalendarTransparencySchema.optional(),
807
- recurrenceRule: z.string().optional()
830
+ recurrenceRule: z.string().max(512).optional()
808
831
  });
809
832
  export const CalendarObjectSchema = z.object({
810
- calendarObjectId: z.string(),
811
- calendarId: z.string(),
812
- resourceName: z.string(),
813
- icalUid: z.string(),
833
+ calendarObjectId: z.string().min(25).max(25),
834
+ calendarId: z.string().min(25).max(25),
835
+ resourceName: z.string().max(256),
836
+ icalUid: z.string().max(512),
814
837
  icalData: z.string(),
815
- etag: z.string(),
838
+ etag: z.string().max(64),
816
839
  sequence: z.number(),
817
840
  syncSequence: z.number(),
818
- summary: z.string(),
819
- dtStart: z.string(),
820
- dtEnd: z.string(),
841
+ summary: z.string().max(512),
842
+ dtStart: z.string().max(64),
843
+ dtEnd: z.string().max(64),
821
844
  allDay: z.boolean(),
822
845
  zoneCertainty: ZoneCertaintySchema,
823
846
  status: CalendarEventStatusSchema,
824
847
  transparency: CalendarTransparencySchema,
825
848
  hasRecurrence: z.boolean(),
826
- expandedThrough: z.string(),
849
+ expandedThrough: z.string().max(64),
827
850
  createdAt: z.number(),
828
851
  updatedAt: z.number()
829
852
  });
830
853
  export const CalendarEventResponseSchema = z.object({
831
- calendarObjectId: z.string(),
832
- calendarId: z.string(),
833
- resourceName: z.string(),
834
- icalUid: z.string(),
854
+ calendarObjectId: z.string().min(25).max(25),
855
+ calendarId: z.string().min(25).max(25),
856
+ resourceName: z.string().max(256),
857
+ icalUid: z.string().max(512),
835
858
  icalData: z.string(),
836
- etag: z.string(),
859
+ etag: z.string().max(64),
837
860
  sequence: z.number(),
838
861
  syncSequence: z.number(),
839
- summary: z.string(),
840
- dtStart: z.string(),
841
- dtEnd: z.string(),
862
+ summary: z.string().max(512),
863
+ dtStart: z.string().max(64),
864
+ dtEnd: z.string().max(64),
842
865
  allDay: z.boolean(),
843
866
  zoneCertainty: ZoneCertaintySchema,
844
867
  status: CalendarEventStatusSchema,
845
868
  transparency: CalendarTransparencySchema,
846
869
  hasRecurrence: z.boolean(),
847
- expandedThrough: z.string(),
870
+ expandedThrough: z.string().max(64),
848
871
  createdAt: z.number(),
849
872
  updatedAt: z.number()
850
873
  });
851
874
  export const UpdateCalendarEventInputSchema = z.object({
852
- summary: z.string().optional(),
853
- description: z.string().optional(),
854
- location: z.string().optional(),
855
- start: z.string().optional(),
856
- end: z.string().optional(),
875
+ summary: z.string().max(512).optional(),
876
+ description: z.string().max(2048).optional(),
877
+ location: z.string().max(512).optional(),
878
+ start: z.string().max(64).optional(),
879
+ end: z.string().max(64).optional(),
857
880
  allDay: z.boolean().optional(),
858
- timeZone: z.string().optional(),
881
+ timeZone: z.string().max(64).optional(),
859
882
  status: CalendarEventStatusSchema.optional(),
860
883
  transparency: CalendarTransparencySchema.optional(),
861
- recurrenceRule: z.string().optional()
884
+ recurrenceRule: z.string().max(512).optional()
862
885
  });
863
886
  export const CalendarFreeBusySpanSchema = z.object({
864
- start: z.string(),
865
- end: z.string()
887
+ start: z.string().max(64),
888
+ end: z.string().max(64)
866
889
  });
867
890
  export const CalendarFreeBusyResponseSchema = z.object({
868
891
  items: z.array(CalendarFreeBusySpanSchema)
@@ -875,7 +898,7 @@ export const SyncTriggerResponseSchema = z.object({
875
898
  message: z.string()
876
899
  });
877
900
  export const MailboxSyncProgressSchema = z.object({
878
- mailboxId: z.string(),
901
+ mailboxId: z.string().min(25).max(25),
879
902
  fullPath: z.string(),
880
903
  phase: z.string(),
881
904
  messagesTotal: z.number(),
@@ -884,7 +907,7 @@ export const MailboxSyncProgressSchema = z.object({
884
907
  lastSyncedAt: z.number().optional()
885
908
  });
886
909
  export const AccountSyncStatusResponseSchema = z.object({
887
- accountId: z.string(),
910
+ accountId: z.string().min(25).max(25),
888
911
  syncPhase: SyncPhaseSchema.optional(),
889
912
  mailboxCountTotal: z.number().optional(),
890
913
  mailboxCountSynced: z.number().optional(),
@@ -892,34 +915,34 @@ export const AccountSyncStatusResponseSchema = z.object({
892
915
  mailboxes: z.array(MailboxSyncProgressSchema)
893
916
  });
894
917
  export const CreateAccountInputSchema = z.object({
895
- email: z.string(),
918
+ email: z.string().min(1),
896
919
  displayName: z.string().optional(),
897
920
  username: z.string().optional(),
898
921
  authType: AccountAuthTypeSchema.optional(),
899
922
  syncedServices: z.array(AccountServiceSchema).optional(),
900
923
  password: z.string().optional(),
901
- imapHost: z.string(),
902
- imapPort: z.number(),
924
+ imapHost: z.string().min(1),
925
+ imapPort: z.number().min(1).max(65535),
903
926
  imapTls: z.boolean(),
904
927
  imapStartTls: z.boolean(),
905
928
  smtpEnabled: z.boolean().optional(),
906
929
  smtpHost: z.string().optional(),
907
- smtpPort: z.number().optional(),
930
+ smtpPort: z.number().min(1).max(65535).optional(),
908
931
  smtpTls: z.boolean().optional(),
909
932
  smtpStartTls: z.boolean().optional(),
910
933
  smtpUsername: z.string().optional(),
911
934
  smtpPassword: z.string().optional()
912
935
  });
913
936
  export const TestConnectionInputSchema = z.object({
914
- accountId: z.string().optional(),
915
- username: z.string(),
937
+ accountId: z.string().min(25).max(25).optional(),
938
+ username: z.string().min(1),
916
939
  password: z.string().optional(),
917
- imapHost: z.string(),
918
- imapPort: z.number(),
940
+ imapHost: z.string().min(1),
941
+ imapPort: z.number().min(1).max(65535),
919
942
  imapTls: z.boolean(),
920
943
  imapStartTls: z.boolean(),
921
944
  smtpHost: z.string().optional(),
922
- smtpPort: z.number().optional(),
945
+ smtpPort: z.number().min(1).max(65535).optional(),
923
946
  smtpTls: z.boolean().optional(),
924
947
  smtpStartTls: z.boolean().optional(),
925
948
  smtpUsername: z.string().optional(),
@@ -935,12 +958,12 @@ export const UpdateAccountInputSchema = z.object({
935
958
  displayName: z.string().optional(),
936
959
  password: z.string().optional(),
937
960
  imapHost: z.string().optional(),
938
- imapPort: z.number().optional(),
961
+ imapPort: z.number().min(1).max(65535).optional(),
939
962
  imapTls: z.boolean().optional(),
940
963
  imapStartTls: z.boolean().optional(),
941
964
  smtpEnabled: z.boolean().optional(),
942
965
  smtpHost: z.string().optional(),
943
- smtpPort: z.number().optional(),
966
+ smtpPort: z.number().min(1).max(65535).optional(),
944
967
  smtpTls: z.boolean().optional(),
945
968
  smtpStartTls: z.boolean().optional(),
946
969
  smtpUsername: z.string().optional(),
@@ -950,27 +973,27 @@ export const UpdateAccountInputSchema = z.object({
950
973
  signaturePlainText: z.string().optional(),
951
974
  signatureHtml: z.string().optional(),
952
975
  composeLanguages: z.array(z.string()).optional(),
953
- muted: z.union([MutedFlagSchema, z.unknown()]).optional()
976
+ muted: z.union([MutedFlagSchema, z.null()]).optional()
954
977
  });
955
978
  export const DeleteAccountResponseSchema = z.object({
956
- accountId: z.string(),
979
+ accountId: z.string().min(25).max(25),
957
980
  deletedAt: z.number(),
958
981
  message: z.string()
959
982
  });
960
983
  export const ThreadMessageSchema = z.object({
961
- threadMessageId: z.string(),
962
- threadId: z.string(),
963
- messageId: z.string(),
964
- accountConfigId: z.string(),
965
- mailboxId: z.string(),
966
- uid: z.number(),
984
+ threadMessageId: z.string().min(25).max(25),
985
+ threadId: z.string().min(25).max(25),
986
+ messageId: z.string().min(25).max(25),
987
+ accountConfigId: z.string().min(25).max(25),
988
+ mailboxId: z.string().min(25).max(25),
989
+ uid: z.number().min(1),
967
990
  messageIdHeader: z.string().optional(),
968
991
  inReplyTo: z.string().optional(),
969
- referenceOrder: z.number(),
992
+ referenceOrder: z.number().min(0),
970
993
  fromEmail: z.string().optional(),
971
994
  fromName: z.string().optional(),
972
995
  subject: z.string().optional(),
973
- listId: z.string().optional(),
996
+ listId: z.string().max(256).optional(),
974
997
  internalDate: z.number(),
975
998
  sentDate: z.number(),
976
999
  isRead: z.boolean(),
@@ -978,7 +1001,7 @@ export const ThreadMessageSchema = z.object({
978
1001
  star: StarColorSchema,
979
1002
  hasStars: z.boolean(),
980
1003
  isDeleted: z.boolean(),
981
- snippet: z.string().optional(),
1004
+ snippet: z.string().max(256).optional(),
982
1005
  category: MessageCategorySchema,
983
1006
  createdAt: z.number(),
984
1007
  updatedAt: z.number()
@@ -997,24 +1020,24 @@ export const MessageAuthenticitySchema = z.object({
997
1020
  export const AutoMovedInfoSchema = z.object({
998
1021
  action: PlacementActionSchema.optional(),
999
1022
  fromPlacement: z.string().optional(),
1000
- fromMailboxId: z.string().optional(),
1001
- destinationMailboxId: z.string().optional(),
1002
- filterId: z.string().optional()
1023
+ fromMailboxId: z.string().min(25).max(25).optional(),
1024
+ destinationMailboxId: z.string().min(25).max(25).optional(),
1025
+ filterId: z.string().min(25).max(25).optional()
1003
1026
  });
1004
1027
  export const LabelSummaryResponseSchema = z.object({
1005
- labelId: z.string(),
1006
- name: z.string(),
1028
+ labelId: z.string().min(25).max(25),
1029
+ name: z.string().max(140),
1007
1030
  color: LabelColorSchema
1008
1031
  });
1009
1032
  export const MessageSpamReportSchema = z.object({
1010
1033
  reportedAt: z.number()
1011
1034
  });
1012
1035
  export const ThreadMessageResponseSchema = z.object({
1013
- threadMessageId: z.string(),
1014
- threadId: z.string(),
1015
- messageId: z.string(),
1016
- accountConfigId: z.string(),
1017
- mailboxId: z.string(),
1036
+ threadMessageId: z.string().min(25).max(25),
1037
+ threadId: z.string().min(25).max(25),
1038
+ messageId: z.string().min(25).max(25),
1039
+ accountConfigId: z.string().min(25).max(25),
1040
+ mailboxId: z.string().min(25).max(25),
1018
1041
  fromEmail: z.string().optional(),
1019
1042
  fromName: z.string().optional(),
1020
1043
  subject: z.string().optional(),
@@ -1024,7 +1047,7 @@ export const ThreadMessageResponseSchema = z.object({
1024
1047
  star: StarColorSchema,
1025
1048
  hasStars: z.boolean(),
1026
1049
  isDeleted: z.boolean(),
1027
- snippet: z.string().optional(),
1050
+ snippet: z.string().max(256).optional(),
1028
1051
  createdAt: z.number(),
1029
1052
  updatedAt: z.number(),
1030
1053
  category: MessageCategorySchema,
@@ -1034,30 +1057,23 @@ export const ThreadMessageResponseSchema = z.object({
1034
1057
  status: MessageStatusSchema,
1035
1058
  syncStatus: MessageSyncStatusSchema,
1036
1059
  abandonedMutation: MessageMutationSchema,
1037
- accountId: z.string().optional(),
1060
+ accountId: z.string().min(25).max(25).optional(),
1038
1061
  autoMoved: AutoMovedInfoSchema.optional(),
1039
1062
  labels: z.array(LabelSummaryResponseSchema).optional(),
1040
1063
  spamReport: MessageSpamReportSchema.optional()
1041
1064
  });
1065
+ export const ThreadMessageListResponseSchema = z.object({
1066
+ continuationToken: z.string().max(800).optional(),
1067
+ items: z.array(ThreadMessageResponseSchema)
1068
+ });
1042
1069
  export const ThreadSearchResponseSchema = z.object({
1043
1070
  items: z.array(ThreadMessageResponseSchema).optional(),
1044
- continuationToken: z.string().optional(),
1071
+ continuationToken: z.string().max(800).optional(),
1045
1072
  count: z.number().optional()
1046
1073
  });
1047
- export const SemanticSearchResultSchema = z.object({
1048
- messageId: z.string(),
1049
- threadId: z.string(),
1050
- score: z.number(),
1051
- matchedChunkType: SemanticSearchChunkTypeSchema,
1052
- mailboxIds: z.array(z.string()),
1053
- fromName: z.string().optional(),
1054
- subject: z.string().optional(),
1055
- sentDate: z.number().optional(),
1056
- category: MessageCategorySchema.optional()
1057
- });
1058
1074
  export const CreateOutboxMessageInputSchema = z.object({
1059
- accountId: z.string(),
1060
- toAddresses: z.array(z.string()),
1075
+ accountId: z.string().min(25).max(25),
1076
+ toAddresses: z.array(z.string()).min(1),
1061
1077
  ccAddresses: z.array(z.string()).optional(),
1062
1078
  bccAddresses: z.array(z.string()).optional(),
1063
1079
  subject: z.string().optional(),
@@ -1068,9 +1084,9 @@ export const CreateOutboxMessageInputSchema = z.object({
1068
1084
  sendImmediately: z.boolean().optional()
1069
1085
  });
1070
1086
  export const OutboxMessageSchema = z.object({
1071
- outboxMessageId: z.string(),
1072
- accountId: z.string(),
1073
- accountConfigId: z.string(),
1087
+ outboxMessageId: z.string().min(25).max(25),
1088
+ accountId: z.string().min(25).max(25),
1089
+ accountConfigId: z.string().min(25).max(25),
1074
1090
  fromAddress: z.string(),
1075
1091
  fromName: z.string().optional(),
1076
1092
  toAddresses: z.array(z.string()),
@@ -1093,18 +1109,18 @@ export const OutboxMessageSchema = z.object({
1093
1109
  updatedAt: z.number()
1094
1110
  });
1095
1111
  export const OutboxAttachmentResponseSchema = z.object({
1096
- outboxAttachmentId: z.string(),
1097
- outboxMessageId: z.string(),
1098
- filename: z.string(),
1099
- contentType: z.string(),
1100
- sizeBytes: z.number(),
1112
+ outboxAttachmentId: z.string().min(25).max(25),
1113
+ outboxMessageId: z.string().min(25).max(25),
1114
+ filename: z.string().max(256),
1115
+ contentType: z.string().max(256),
1116
+ sizeBytes: z.number().min(0),
1101
1117
  state: OutboxAttachmentStateSchema,
1102
- contentId: z.string(),
1118
+ contentId: z.string().max(256),
1103
1119
  contentUrl: z.string().url()
1104
1120
  });
1105
1121
  export const OutboxMessageResponseSchema = z.object({
1106
- outboxMessageId: z.string(),
1107
- accountId: z.string(),
1122
+ outboxMessageId: z.string().min(25).max(25),
1123
+ accountId: z.string().min(25).max(25),
1108
1124
  fromAddress: z.string(),
1109
1125
  fromName: z.string().optional(),
1110
1126
  toAddresses: z.array(z.string()),
@@ -1123,21 +1139,25 @@ export const OutboxMessageResponseSchema = z.object({
1123
1139
  attachments: z.array(OutboxAttachmentResponseSchema)
1124
1140
  });
1125
1141
  export const OutboxAttachmentSchema = z.object({
1126
- outboxAttachmentId: z.string(),
1127
- outboxMessageId: z.string(),
1128
- accountId: z.string(),
1129
- accountConfigId: z.string(),
1130
- filename: z.string(),
1131
- contentType: z.string(),
1132
- sizeBytes: z.number(),
1142
+ outboxAttachmentId: z.string().min(25).max(25),
1143
+ outboxMessageId: z.string().min(25).max(25),
1144
+ accountId: z.string().min(25).max(25),
1145
+ accountConfigId: z.string().min(25).max(25),
1146
+ filename: z.string().max(256),
1147
+ contentType: z.string().max(256),
1148
+ sizeBytes: z.number().min(0),
1133
1149
  state: OutboxAttachmentStateSchema,
1134
- storageKey: z.string(),
1135
- reservationExpiresAt: z.number(),
1150
+ storageKey: z.string().max(2048),
1151
+ reservationExpiresAt: z.number().min(0),
1136
1152
  createdAt: z.number(),
1137
1153
  updatedAt: z.number()
1138
1154
  });
1155
+ export const OutboxMessageListResponseSchema = z.object({
1156
+ continuationToken: z.string().max(800).optional(),
1157
+ items: z.array(OutboxMessageResponseSchema)
1158
+ });
1139
1159
  export const UpdateOutboxMessageInputSchema = z.object({
1140
- attachmentIds: z.array(z.string()).optional(),
1160
+ attachmentIds: z.array(z.string().min(25).max(25)).optional(),
1141
1161
  toAddresses: z.array(z.string()).optional(),
1142
1162
  ccAddresses: z.array(z.string()).optional(),
1143
1163
  bccAddresses: z.array(z.string()).optional(),
@@ -1148,34 +1168,34 @@ export const UpdateOutboxMessageInputSchema = z.object({
1148
1168
  references: z.array(z.string()).optional()
1149
1169
  });
1150
1170
  export const MintOutboxAttachmentInputSchema = z.object({
1151
- filename: z.string(),
1152
- contentType: z.string(),
1153
- sizeBytes: z.number()
1171
+ filename: z.string().max(256),
1172
+ contentType: z.string().max(256),
1173
+ sizeBytes: z.number().min(1)
1154
1174
  });
1155
1175
  export const MintOutboxAttachmentResponseSchema = z.object({
1156
- outboxAttachmentId: z.string(),
1157
- outboxMessageId: z.string(),
1158
- filename: z.string(),
1159
- contentType: z.string(),
1160
- sizeBytes: z.number(),
1161
- contentId: z.string(),
1162
- uploadUrl: z.string(),
1176
+ outboxAttachmentId: z.string().min(25).max(25),
1177
+ outboxMessageId: z.string().min(25).max(25),
1178
+ filename: z.string().max(256),
1179
+ contentType: z.string().max(256),
1180
+ sizeBytes: z.number().min(1),
1181
+ contentId: z.string().max(256),
1182
+ uploadUrl: z.string().max(2048),
1163
1183
  uploadExpiresAt: z.number()
1164
1184
  });
1165
1185
  export const OutboxAttachmentRejectionSchema = z.object({
1166
1186
  code: z.string(),
1167
1187
  reason: OutboxAttachmentRejectionReasonSchema,
1168
- message: z.string(),
1169
- limitBytes: z.number(),
1170
- usedBytes: z.number()
1188
+ message: z.string().max(512),
1189
+ limitBytes: z.number().min(0),
1190
+ usedBytes: z.number().min(0)
1171
1191
  });
1172
1192
  export const OutboxAttachmentRejectedSchema = z.object({
1173
1193
  statusCode: z.union([z.literal(400), z.literal(413)]),
1174
1194
  code: z.string(),
1175
1195
  reason: OutboxAttachmentRejectionReasonSchema,
1176
- message: z.string(),
1177
- limitBytes: z.number(),
1178
- usedBytes: z.number()
1196
+ message: z.string().max(512),
1197
+ limitBytes: z.number().min(0),
1198
+ usedBytes: z.number().min(0)
1179
1199
  });
1180
1200
  export const TrustedFlagSchema = z.object({
1181
1201
  setAt: z.number(),
@@ -1253,11 +1273,11 @@ export const AddressFlagsSchema = z.object({
1253
1273
  unsubscribed: UnsubscribedFlagSchema.optional()
1254
1274
  });
1255
1275
  export const AddressSchema = z.object({
1256
- addressId: z.string(),
1257
- accountConfigId: z.string(),
1276
+ addressId: z.string().min(25).max(25),
1277
+ accountConfigId: z.string().min(25).max(25),
1258
1278
  displayName: z.string().optional(),
1259
- localPart: z.string(),
1260
- domain: z.string(),
1279
+ localPart: z.string().min(1),
1280
+ domain: z.string().min(1),
1261
1281
  normalizedEmail: z.string(),
1262
1282
  normalizedCompound: z.string(),
1263
1283
  flags: AddressFlagsSchema,
@@ -1271,11 +1291,11 @@ export const AddressSchema = z.object({
1271
1291
  updatedAt: z.number()
1272
1292
  });
1273
1293
  export const AddressResponseSchema = z.object({
1274
- addressId: z.string(),
1275
- accountConfigId: z.string(),
1294
+ addressId: z.string().min(25).max(25),
1295
+ accountConfigId: z.string().min(25).max(25),
1276
1296
  displayName: z.string().optional(),
1277
- localPart: z.string(),
1278
- domain: z.string(),
1297
+ localPart: z.string().min(1),
1298
+ domain: z.string().min(1),
1279
1299
  normalizedEmail: z.string(),
1280
1300
  flags: AddressFlagsSchema,
1281
1301
  inboundCount: z.number(),
@@ -1287,38 +1307,38 @@ export const AddressResponseSchema = z.object({
1287
1307
  updatedAt: z.number()
1288
1308
  });
1289
1309
  export const UpdateAddressFlagsInputSchema = z.object({
1290
- trusted: z.union([TrustedFlagSchema, z.unknown()]).optional(),
1291
- blocked: z.union([BlockedFlagSchema, z.unknown()]).optional(),
1292
- neverSpam: z.union([NeverSpamFlagSchema, z.unknown()]).optional(),
1293
- muted: z.union([MutedFlagSchema, z.unknown()]).optional(),
1294
- vip: z.union([VipFlagSchema, z.unknown()]).optional(),
1295
- wellknown: z.union([WellknownFlagSchema, z.unknown()]).optional(),
1296
- junkOnly: z.union([JunkOnlyFlagSchema, z.unknown()]).optional(),
1297
- category: z.union([CategoryFlagSchema, z.unknown()]).optional(),
1298
- autoArchive: z.union([AutoArchiveFlagSchema, z.unknown()]).optional(),
1299
- unsubscribed: z.union([UnsubscribedFlagSchema, z.unknown()]).optional()
1310
+ trusted: z.union([TrustedFlagSchema, z.null()]).optional(),
1311
+ blocked: z.union([BlockedFlagSchema, z.null()]).optional(),
1312
+ neverSpam: z.union([NeverSpamFlagSchema, z.null()]).optional(),
1313
+ muted: z.union([MutedFlagSchema, z.null()]).optional(),
1314
+ vip: z.union([VipFlagSchema, z.null()]).optional(),
1315
+ wellknown: z.union([WellknownFlagSchema, z.null()]).optional(),
1316
+ junkOnly: z.union([JunkOnlyFlagSchema, z.null()]).optional(),
1317
+ category: z.union([CategoryFlagSchema, z.null()]).optional(),
1318
+ autoArchive: z.union([AutoArchiveFlagSchema, z.null()]).optional(),
1319
+ unsubscribed: z.union([UnsubscribedFlagSchema, z.null()]).optional()
1300
1320
  });
1301
1321
  export const UpdateAddressInputSchema = z.object({
1302
1322
  flags: UpdateAddressFlagsInputSchema.optional(),
1303
1323
  clearFlags: z.array(AddressFlagKeySchema).optional()
1304
1324
  });
1305
1325
  export const MessageSummaryResponseSchema = z.object({
1306
- messageId: z.string(),
1307
- mailboxId: z.string(),
1308
- uid: z.number(),
1309
- rfc822Size: z.number(),
1326
+ messageId: z.string().min(25).max(25),
1327
+ mailboxId: z.string().min(25).max(25),
1328
+ uid: z.number().min(1),
1329
+ rfc822Size: z.number().min(0),
1310
1330
  internalDate: z.number(),
1311
- messageIdHeader: z.string().optional(),
1312
1331
  status: MessageStatusSchema,
1313
1332
  syncStatus: MessageSyncStatusSchema,
1314
1333
  abandonedMutation: MessageMutationSchema,
1315
1334
  authenticity: MessageAuthenticitySchema.optional(),
1335
+ messageIdHeader: z.string().optional(),
1316
1336
  autoMoved: AutoMovedInfoSchema.optional(),
1317
1337
  labels: z.array(LabelSummaryResponseSchema).optional(),
1318
1338
  spamReport: MessageSpamReportSchema.optional()
1319
1339
  });
1320
1340
  export const EnvelopeAddressResponseSchema = z.object({
1321
- addressId: z.string(),
1341
+ addressId: z.string().min(25).max(25),
1322
1342
  displayName: z.string().optional(),
1323
1343
  normalizedEmail: z.string(),
1324
1344
  addressRole: AddressRoleSchema,
@@ -1326,7 +1346,7 @@ export const EnvelopeAddressResponseSchema = z.object({
1326
1346
  flags: AddressFlagsSchema.optional()
1327
1347
  });
1328
1348
  export const EnvelopeResponseSchema = z.object({
1329
- messageId: z.string(),
1349
+ messageId: z.string().min(25).max(25),
1330
1350
  date: z.number(),
1331
1351
  subject: z.string().optional(),
1332
1352
  messageIdValue: z.string().optional(),
@@ -1339,11 +1359,12 @@ export const EnvelopeResponseSchema = z.object({
1339
1359
  senderTrust: SenderTrustSchema
1340
1360
  });
1341
1361
  export const BodyPartResponseSchema = z.object({
1342
- bodyPartId: z.string(),
1362
+ bodyPartId: z.string().min(25).max(25),
1363
+ partPath: z.string().min(1),
1343
1364
  mediaType: MediaTypeSchema,
1344
- mediaSubtype: z.string(),
1365
+ mediaSubtype: z.string().min(1),
1345
1366
  contentId: z.string().optional(),
1346
- sizeOctets: z.number(),
1367
+ sizeOctets: z.number().min(0),
1347
1368
  disposition: ContentDispositionSchema.optional(),
1348
1369
  dispositionFilename: z.string().optional(),
1349
1370
  isMultipart: z.boolean(),
@@ -1352,7 +1373,7 @@ export const BodyPartResponseSchema = z.object({
1352
1373
  export const MessageReferenceResponseSchema = z.object({
1353
1374
  messageIdValue: z.string(),
1354
1375
  referenceType: ReferenceTypeSchema,
1355
- referenceOrder: z.number()
1376
+ referenceOrder: z.number().min(0)
1356
1377
  });
1357
1378
  export const DescribeMessageResponseSchema = z.object({
1358
1379
  message: MessageSummaryResponseSchema,
@@ -1380,26 +1401,25 @@ export const MessagePlacementVerdictSchema = z.object({
1380
1401
  decidedAt: z.number()
1381
1402
  });
1382
1403
  export const MessageFilterMoveSchema = z.object({
1383
- filterId: z.string(),
1384
- sourceMailboxId: z.string(),
1385
- destinationMailboxId: z.string(),
1404
+ filterId: z.string().min(25).max(25),
1405
+ sourceMailboxId: z.string().min(25).max(25),
1406
+ destinationMailboxId: z.string().min(25).max(25),
1386
1407
  decidedAt: z.number()
1387
1408
  });
1388
- export const MessageSchema = z.object({
1389
- messageId: z.string(),
1390
- mailboxId: z.string(),
1391
- uid: z.number(),
1392
- sequenceNumber: z.number(),
1393
- rfc822Size: z.number(),
1409
+ export const MessageRecordSchema = z.object({
1410
+ messageId: z.string().min(25).max(25),
1411
+ mailboxId: z.string().min(25).max(25),
1412
+ uid: z.number().min(1),
1413
+ sequenceNumber: z.number().min(1),
1414
+ rfc822Size: z.number().min(0),
1394
1415
  internalDate: z.number(),
1395
- messageIdHeader: z.string().optional(),
1396
- envelopeId: z.string(),
1397
- rootBodyPartId: z.string(),
1416
+ envelopeId: z.string().min(25).max(25),
1417
+ rootBodyPartId: z.string().min(25).max(25),
1398
1418
  bodyStorageKey: z.string().optional(),
1399
1419
  status: MessageStatusSchema,
1400
1420
  syncStatus: MessageSyncStatusSchema,
1401
1421
  abandonedMutation: MessageMutationSchema,
1402
- originalMailboxId: z.string().optional(),
1422
+ originalMailboxId: z.string().min(25).max(25).optional(),
1403
1423
  originalUid: z.number().optional(),
1404
1424
  category: MessageCategorySchema,
1405
1425
  classificationState: MessageClassificationStateSchema,
@@ -1416,17 +1436,48 @@ export const MessageSchema = z.object({
1416
1436
  createdAt: z.number(),
1417
1437
  updatedAt: z.number()
1418
1438
  });
1439
+ export const MessageSchema = z.object({
1440
+ messageId: z.string().min(25).max(25),
1441
+ mailboxId: z.string().min(25).max(25),
1442
+ uid: z.number().min(1),
1443
+ sequenceNumber: z.number().min(1),
1444
+ rfc822Size: z.number().min(0),
1445
+ internalDate: z.number(),
1446
+ envelopeId: z.string().min(25).max(25),
1447
+ rootBodyPartId: z.string().min(25).max(25),
1448
+ bodyStorageKey: z.string().optional(),
1449
+ status: MessageStatusSchema,
1450
+ syncStatus: MessageSyncStatusSchema,
1451
+ abandonedMutation: MessageMutationSchema,
1452
+ originalMailboxId: z.string().min(25).max(25).optional(),
1453
+ originalUid: z.number().optional(),
1454
+ category: MessageCategorySchema,
1455
+ classificationState: MessageClassificationStateSchema,
1456
+ authenticity: MessageAuthenticitySchema.optional(),
1457
+ authenticityVerdict: AuthenticityVerdictSchema,
1458
+ authResult: MessageAuthResultSchema.optional(),
1459
+ providerSpam: MessageProviderSpamSchema.optional(),
1460
+ hasListUnsubscribe: z.boolean(),
1461
+ movedByRemit: z.boolean(),
1462
+ placementVerdict: MessagePlacementVerdictSchema.optional(),
1463
+ filterMove: MessageFilterMoveSchema.optional(),
1464
+ placementDecidedAt: z.number().optional(),
1465
+ spamReport: MessageSpamReportSchema.optional(),
1466
+ createdAt: z.number(),
1467
+ updatedAt: z.number(),
1468
+ messageIdHeader: z.string().optional()
1469
+ });
1419
1470
  export const BodyPartSchema = z.object({
1420
- bodyPartId: z.string(),
1421
- messageId: z.string(),
1422
- parentBodyPartId: z.string().optional(),
1423
- partPath: z.string(),
1471
+ bodyPartId: z.string().min(25).max(25),
1472
+ messageId: z.string().min(25).max(25),
1473
+ parentBodyPartId: z.string().min(25).max(25).optional(),
1474
+ partPath: z.string().min(1),
1424
1475
  mediaType: MediaTypeSchema,
1425
- mediaSubtype: z.string(),
1476
+ mediaSubtype: z.string().min(1),
1426
1477
  contentId: z.string().optional(),
1427
1478
  contentDescription: z.string().optional(),
1428
1479
  transferEncoding: TransferEncodingSchema,
1429
- sizeOctets: z.number(),
1480
+ sizeOctets: z.number().min(0),
1430
1481
  lineCount: z.number().optional(),
1431
1482
  md5Hash: z.string().optional(),
1432
1483
  disposition: ContentDispositionSchema.optional(),
@@ -1439,12 +1490,12 @@ export const BodyPartSchema = z.object({
1439
1490
  updatedAt: z.number()
1440
1491
  });
1441
1492
  export const MessageReferenceSchema = z.object({
1442
- messageReferenceId: z.string(),
1443
- messageId: z.string(),
1444
- envelopeId: z.string(),
1493
+ messageReferenceId: z.string().min(25).max(25),
1494
+ messageId: z.string().min(25).max(25),
1495
+ envelopeId: z.string().min(25).max(25),
1445
1496
  messageIdValue: z.string(),
1446
1497
  referenceType: ReferenceTypeSchema,
1447
- referenceOrder: z.number(),
1498
+ referenceOrder: z.number().min(0),
1448
1499
  createdAt: z.number(),
1449
1500
  updatedAt: z.number()
1450
1501
  });
@@ -1457,7 +1508,7 @@ export const UpdateFlagsInputSchema = z.object({
1457
1508
  starColor: StarColorSchema.optional()
1458
1509
  });
1459
1510
  export const BulkUpdateFlagsInputSchema = z.object({
1460
- messageIds: z.array(z.string()),
1511
+ messageIds: z.array(z.string().min(25).max(25)).min(1).max(100),
1461
1512
  isRead: z.boolean().optional(),
1462
1513
  isStarred: z.boolean().optional(),
1463
1514
  starColor: StarColorSchema.optional()
@@ -1467,27 +1518,27 @@ export const MessageBulkOperationResultSchema = z.object({
1467
1518
  failureCount: z.number()
1468
1519
  });
1469
1520
  export const DeleteMessagesInputSchema = z.object({
1470
- messageIds: z.array(z.string()),
1521
+ messageIds: z.array(z.string().min(25).max(25)).min(1).max(100),
1471
1522
  permanent: z.boolean().optional()
1472
1523
  });
1473
1524
  export const BulkMessageInputSchema = z.object({
1474
- messageIds: z.array(z.string())
1525
+ messageIds: z.array(z.string().min(25).max(25)).min(1).max(100)
1475
1526
  });
1476
1527
  export const MoveMessagesInputSchema = z.object({
1477
- messageIds: z.array(z.string()),
1478
- destinationMailboxId: z.string()
1528
+ messageIds: z.array(z.string().min(25).max(25)).min(1).max(100),
1529
+ destinationMailboxId: z.string().min(25).max(25)
1479
1530
  });
1480
1531
  export const CopyMessagesInputSchema = z.object({
1481
- messageIds: z.array(z.string()),
1482
- destinationMailboxId: z.string()
1532
+ messageIds: z.array(z.string().min(25).max(25)).min(1).max(100),
1533
+ destinationMailboxId: z.string().min(25).max(25)
1483
1534
  });
1484
1535
  export const UpdateMessageLabelsInputSchema = z.object({
1485
- messageIds: z.array(z.string()),
1486
- labelId: z.string(),
1536
+ messageIds: z.array(z.string().min(25).max(25)).min(1).max(100),
1537
+ labelId: z.string().min(25).max(25),
1487
1538
  action: LabelActionSchema
1488
1539
  });
1489
1540
  export const SpamReportFailureSchema = z.object({
1490
- messageId: z.string(),
1541
+ messageId: z.string().min(25).max(25),
1491
1542
  reason: z.string()
1492
1543
  });
1493
1544
  export const SpamReportBulkResultSchema = z.object({
@@ -1496,22 +1547,22 @@ export const SpamReportBulkResultSchema = z.object({
1496
1547
  failures: z.array(SpamReportFailureSchema).optional()
1497
1548
  });
1498
1549
  export const CalendarSuggestionSchema = z.object({
1499
- suggestionId: z.string(),
1500
- accountConfigId: z.string(),
1501
- messageId: z.string(),
1502
- bodyPartId: z.string(),
1503
- icalUid: z.string(),
1550
+ suggestionId: z.string().min(25).max(25),
1551
+ accountConfigId: z.string().min(25).max(25),
1552
+ messageId: z.string().min(25).max(25),
1553
+ bodyPartId: z.string().min(25).max(25),
1554
+ icalUid: z.string().max(512),
1504
1555
  sequence: z.number(),
1505
1556
  method: CalendarInviteMethodSchema,
1506
1557
  source: CalendarSuggestionSourceSchema,
1507
1558
  state: CalendarSuggestionStateSchema,
1508
- summary: z.string(),
1509
- dtStart: z.string(),
1510
- dtEnd: z.string(),
1511
- endsAtUtc: z.string(),
1559
+ summary: z.string().max(512),
1560
+ dtStart: z.string().max(64),
1561
+ dtEnd: z.string().max(64),
1562
+ endsAtUtc: z.string().max(64),
1512
1563
  allDay: z.boolean(),
1513
- location: z.string(),
1514
- organizer: z.string(),
1564
+ location: z.string().max(512),
1565
+ organizer: z.string().max(256),
1515
1566
  zoneCertainty: ZoneCertaintySchema,
1516
1567
  icalData: z.string(),
1517
1568
  acceptedCalendarObjectId: z.string(),
@@ -1520,22 +1571,22 @@ export const CalendarSuggestionSchema = z.object({
1520
1571
  updatedAt: z.number()
1521
1572
  });
1522
1573
  export const CalendarSuggestionResponseSchema = z.object({
1523
- suggestionId: z.string(),
1524
- accountConfigId: z.string(),
1525
- messageId: z.string(),
1526
- bodyPartId: z.string(),
1527
- icalUid: z.string(),
1574
+ suggestionId: z.string().min(25).max(25),
1575
+ accountConfigId: z.string().min(25).max(25),
1576
+ messageId: z.string().min(25).max(25),
1577
+ bodyPartId: z.string().min(25).max(25),
1578
+ icalUid: z.string().max(512),
1528
1579
  sequence: z.number(),
1529
1580
  method: CalendarInviteMethodSchema,
1530
1581
  source: CalendarSuggestionSourceSchema,
1531
1582
  state: CalendarSuggestionStateSchema,
1532
- summary: z.string(),
1533
- dtStart: z.string(),
1534
- dtEnd: z.string(),
1535
- endsAtUtc: z.string(),
1583
+ summary: z.string().max(512),
1584
+ dtStart: z.string().max(64),
1585
+ dtEnd: z.string().max(64),
1586
+ endsAtUtc: z.string().max(64),
1536
1587
  allDay: z.boolean(),
1537
- location: z.string(),
1538
- organizer: z.string(),
1588
+ location: z.string().max(512),
1589
+ organizer: z.string().max(256),
1539
1590
  zoneCertainty: ZoneCertaintySchema,
1540
1591
  acceptedCalendarObjectId: z.string(),
1541
1592
  supersededByMessageId: z.string(),
@@ -1545,7 +1596,7 @@ export const CalendarSuggestionResponseSchema = z.object({
1545
1596
  answerOvertakenBy: CalendarAnswerOvertakenSchema
1546
1597
  });
1547
1598
  export const AcceptCalendarSuggestionInputSchema = z.object({
1548
- calendarId: z.string(),
1599
+ calendarId: z.string().min(25).max(25),
1549
1600
  answer: CalendarInviteAnswerSchema.optional(),
1550
1601
  event: UpdateCalendarEventInputSchema.optional()
1551
1602
  });
@@ -1553,26 +1604,26 @@ export const DismissCalendarSuggestionInputSchema = z.object({
1553
1604
  muteSender: z.boolean()
1554
1605
  });
1555
1606
  export const EnvelopeAddressSchema = z.object({
1556
- envelopeAddressId: z.string(),
1557
- messageId: z.string(),
1558
- addressId: z.string(),
1607
+ envelopeAddressId: z.string().min(25).max(25),
1608
+ messageId: z.string().min(25).max(25),
1609
+ addressId: z.string().min(25).max(25),
1559
1610
  displayName: z.string().optional(),
1560
1611
  normalizedEmail: z.string(),
1561
1612
  addressRole: AddressRoleSchema,
1562
- addressOrder: z.number(),
1613
+ addressOrder: z.number().min(0),
1563
1614
  createdAt: z.number(),
1564
1615
  updatedAt: z.number()
1565
1616
  });
1566
1617
  export const ConfigImportUnresolvedRefSchema = z.object({
1567
1618
  kind: ConfigImportRefKindSchema,
1568
- accountId: z.string(),
1569
- folderPath: z.string(),
1570
- target: z.string(),
1619
+ accountId: z.string().min(25).max(25),
1620
+ folderPath: z.string().max(512),
1621
+ target: z.string().max(256),
1571
1622
  mailboxId: z.string()
1572
1623
  });
1573
1624
  export const ConfigImportSchema = z.object({
1574
- importId: z.string(),
1575
- accountConfigId: z.string(),
1625
+ importId: z.string().min(25).max(25),
1626
+ accountConfigId: z.string().min(25).max(25),
1576
1627
  schemaVersion: z.number(),
1577
1628
  state: ConfigImportStateSchema,
1578
1629
  document: z.record(z.string(), z.unknown()),
@@ -1609,70 +1660,70 @@ export const MutedFlagSettingSchema = z.object({
1609
1660
  value: MutedFlagSchema
1610
1661
  });
1611
1662
  export const AccountSettingSchema = z.object({
1612
- accountSettingId: z.string(),
1613
- accountConfigId: z.string(),
1663
+ accountSettingId: z.string().min(25).max(25),
1664
+ accountConfigId: z.string().min(25).max(25),
1614
1665
  name: z.string(),
1615
1666
  value: z.union([BooleanSettingSchema, StringSettingSchema, NumberSettingSchema, StringListSettingSchema, MapSettingSchema, MutedFlagSettingSchema]),
1616
1667
  createdAt: z.number(),
1617
1668
  updatedAt: z.number()
1618
1669
  });
1619
1670
  export const MailboxAttributeEntrySchema = z.object({
1620
- mailboxAttributeId: z.string(),
1621
- mailboxId: z.string(),
1671
+ mailboxAttributeId: z.string().min(25).max(25),
1672
+ mailboxId: z.string().min(25).max(25),
1622
1673
  attributeName: MailboxAttributeSchema
1623
1674
  });
1624
1675
  export const MailboxSpecialUseEntrySchema = z.object({
1625
- mailboxSpecialUseId: z.string(),
1626
- mailboxId: z.string(),
1676
+ mailboxSpecialUseId: z.string().min(25).max(25),
1677
+ mailboxId: z.string().min(25).max(25),
1627
1678
  specialUse: MailboxSpecialUseSchema
1628
1679
  });
1629
1680
  export const MailboxFlagSchema = z.object({
1630
- mailboxFlagId: z.string(),
1631
- mailboxId: z.string(),
1681
+ mailboxFlagId: z.string().min(25).max(25),
1682
+ mailboxId: z.string().min(25).max(25),
1632
1683
  flagName: z.union([MessageSystemFlagSchema, MessageKeywordFlagSchema, z.string()]),
1633
1684
  isPermanent: z.boolean()
1634
1685
  });
1635
1686
  export const MailboxLockSchema = z.object({
1636
- mailboxId: z.string(),
1687
+ mailboxId: z.string().min(25).max(25),
1637
1688
  eventName: z.string(),
1638
- accountId: z.string(),
1639
- lockId: z.string(),
1689
+ accountId: z.string().min(25).max(25),
1690
+ lockId: z.string().min(25).max(25),
1640
1691
  acquiredAt: z.number(),
1641
1692
  lockedBy: z.string(),
1642
1693
  ttl: z.number()
1643
1694
  });
1644
1695
  export const MessageFlagSchema = z.object({
1645
- messageFlagId: z.string(),
1646
- messageId: z.string(),
1696
+ messageFlagId: z.string().min(25).max(25),
1697
+ messageId: z.string().min(25).max(25),
1647
1698
  flagName: z.union([MessageSystemFlagSchema, MessageKeywordFlagSchema, z.string()]),
1648
1699
  setAt: z.number(),
1649
1700
  createdAt: z.number(),
1650
1701
  updatedAt: z.number()
1651
1702
  });
1652
1703
  export const MessagePlacementMoveSchema = z.object({
1653
- messageId: z.string(),
1654
- accountId: z.string(),
1655
- accountConfigId: z.string(),
1656
- sourceMailboxId: z.string(),
1657
- destinationMailboxId: z.string(),
1704
+ messageId: z.string().min(25).max(25),
1705
+ accountId: z.string().min(25).max(25),
1706
+ accountConfigId: z.string().min(25).max(25),
1707
+ sourceMailboxId: z.string().min(25).max(25),
1708
+ destinationMailboxId: z.string().min(25).max(25),
1658
1709
  state: MessagePlacementMoveStateSchema,
1659
1710
  createdAt: z.number(),
1660
1711
  updatedAt: z.number()
1661
1712
  });
1662
1713
  export const MessageFlagPushSchema = z.object({
1663
- messageId: z.string(),
1714
+ messageId: z.string().min(25).max(25),
1664
1715
  flagName: z.string(),
1665
- accountId: z.string(),
1666
- accountConfigId: z.string(),
1667
- mailboxId: z.string(),
1716
+ accountId: z.string().min(25).max(25),
1717
+ accountConfigId: z.string().min(25).max(25),
1718
+ mailboxId: z.string().min(25).max(25),
1668
1719
  operation: FlagPushOperationSchema,
1669
1720
  state: MessageFlagPushStateSchema,
1670
1721
  createdAt: z.number(),
1671
1722
  updatedAt: z.number()
1672
1723
  });
1673
1724
  export const EnvelopeSchema = z.object({
1674
- envelopeId: z.string(),
1675
- messageId: z.string(),
1725
+ envelopeId: z.string().min(25).max(25),
1726
+ messageId: z.string().min(25).max(25),
1676
1727
  dateValue: z.number(),
1677
1728
  dateRaw: z.string(),
1678
1729
  subject: z.string().optional(),
@@ -1681,9 +1732,9 @@ export const EnvelopeSchema = z.object({
1681
1732
  updatedAt: z.number()
1682
1733
  });
1683
1734
  export const SenderSignerStandingSchema = z.object({
1684
- accountConfigId: z.string(),
1685
- senderKey: z.string(),
1686
- signerDomain: z.string(),
1735
+ accountConfigId: z.string().min(25).max(25),
1736
+ senderKey: z.string().max(256),
1737
+ signerDomain: z.string().max(256),
1687
1738
  messageCount: z.number(),
1688
1739
  firstSeenAt: z.number(),
1689
1740
  lastSeenAt: z.number(),
@@ -1692,22 +1743,27 @@ export const SenderSignerStandingSchema = z.object({
1692
1743
  updatedAt: z.number()
1693
1744
  });
1694
1745
  export const BodyPartParameterSchema = z.object({
1695
- bodyPartParameterId: z.string(),
1696
- messageId: z.string(),
1697
- bodyPartId: z.string(),
1698
- parameterName: z.string(),
1746
+ bodyPartParameterId: z.string().min(25).max(25),
1747
+ messageId: z.string().min(25).max(25),
1748
+ bodyPartId: z.string().min(25).max(25),
1749
+ parameterName: z.string().min(1),
1699
1750
  parameterValue: z.string(),
1700
1751
  createdAt: z.number(),
1701
1752
  updatedAt: z.number()
1702
1753
  });
1754
+ export const BodyStructureRefetchSchema = z.object({
1755
+ messageId: z.string().min(25).max(25),
1756
+ createdAt: z.number(),
1757
+ updatedAt: z.number()
1758
+ });
1703
1759
  export const RawMessageStorageSchema = z.object({
1704
- rawStorageId: z.string(),
1705
- messageId: z.string(),
1760
+ rawStorageId: z.string().min(25).max(25),
1761
+ messageId: z.string().min(25).max(25),
1706
1762
  storageType: StorageTypeSchema,
1707
1763
  storageLocation: z.string(),
1708
1764
  storageKey: z.string(),
1709
- sizeBytes: z.number(),
1710
- checksumSha256: z.string(),
1765
+ sizeBytes: z.number().min(0),
1766
+ checksumSha256: z.string().min(64).max(64),
1711
1767
  contentEncoding: ContentEncodingSchema,
1712
1768
  storedAt: z.number(),
1713
1769
  expiresAt: z.number().optional(),
@@ -1715,14 +1771,14 @@ export const RawMessageStorageSchema = z.object({
1715
1771
  updatedAt: z.number()
1716
1772
  });
1717
1773
  export const BodyPartStorageSchema = z.object({
1718
- bodyPartStorageId: z.string(),
1719
- messageId: z.string(),
1720
- bodyPartId: z.string(),
1774
+ bodyPartStorageId: z.string().min(25).max(25),
1775
+ messageId: z.string().min(25).max(25),
1776
+ bodyPartId: z.string().min(25).max(25),
1721
1777
  storageType: StorageTypeSchema,
1722
1778
  storageLocation: z.string(),
1723
1779
  storageKey: z.string(),
1724
- decodedSizeBytes: z.number(),
1725
- checksumSha256: z.string(),
1780
+ decodedSizeBytes: z.number().min(0),
1781
+ checksumSha256: z.string().min(64).max(64),
1726
1782
  contentEncoding: ContentEncodingSchema,
1727
1783
  isDeduped: z.boolean(),
1728
1784
  dedupHash: z.string().optional(),
@@ -1730,59 +1786,40 @@ export const BodyPartStorageSchema = z.object({
1730
1786
  createdAt: z.number(),
1731
1787
  updatedAt: z.number()
1732
1788
  });
1733
- export const BodyPartContentSchema = z.object({
1734
- bodyPartContentId: z.string(),
1735
- messageId: z.string(),
1736
- bodyPartId: z.string(),
1737
- content: z.string(),
1738
- contentLength: z.number(),
1739
- createdAt: z.number(),
1740
- updatedAt: z.number()
1741
- });
1742
1789
  export const CalendarEventIndexSchema = z.object({
1743
- calendarId: z.string(),
1744
- calendarObjectId: z.string(),
1745
- recurrenceId: z.string(),
1746
- startAt: z.string(),
1747
- endAt: z.string(),
1790
+ calendarId: z.string().min(25).max(25),
1791
+ calendarObjectId: z.string().min(25).max(25),
1792
+ recurrenceId: z.string().max(64),
1793
+ startAt: z.string().max(64),
1794
+ endAt: z.string().max(64),
1748
1795
  allDay: z.boolean(),
1749
- summary: z.string(),
1796
+ summary: z.string().max(512),
1750
1797
  status: CalendarEventStatusSchema,
1751
1798
  transparency: CalendarTransparencySchema,
1752
1799
  createdAt: z.number(),
1753
1800
  updatedAt: z.number()
1754
1801
  });
1755
1802
  export const CalendarFeedTokenSchema = z.object({
1756
- feedTokenId: z.string(),
1757
- accountConfigId: z.string(),
1758
- calendarId: z.string(),
1759
- tokenHash: z.string(),
1803
+ feedTokenId: z.string().min(25).max(25),
1804
+ accountConfigId: z.string().min(25).max(25),
1805
+ calendarId: z.string().min(25).max(25),
1806
+ tokenHash: z.string().max(64),
1760
1807
  createdAt: z.number(),
1761
1808
  rotatedAt: z.number(),
1762
1809
  updatedAt: z.number()
1763
1810
  });
1764
1811
  export const MessageLabelSchema = z.object({
1765
- messageLabelId: z.string(),
1766
- messageId: z.string(),
1767
- labelId: z.string(),
1768
- accountConfigId: z.string(),
1769
- appliedByFilterId: z.string().optional(),
1770
- createdAt: z.number(),
1771
- updatedAt: z.number()
1772
- });
1773
- export const FilterAnchorSchema = z.object({
1774
- accountConfigId: z.string(),
1775
- filterId: z.string(),
1776
- anchorEmbedding: z.array(z.number()),
1777
- anchorEmbeddingId: z.string(),
1778
- anchorSourceText: z.string(),
1779
- anchorMessageId: z.string(),
1812
+ messageLabelId: z.string().min(25).max(25),
1813
+ messageId: z.string().min(25).max(25),
1814
+ labelId: z.string().min(25).max(25),
1815
+ accountConfigId: z.string().min(25).max(25),
1816
+ appliedByFilterId: z.string().min(25).max(25).optional(),
1780
1817
  createdAt: z.number(),
1781
1818
  updatedAt: z.number()
1782
1819
  });
1783
1820
  export const MicrosoftOAuthStartRequestSchema = z.object({
1784
1821
  email: z.string().optional(),
1785
- services: z.array(AccountServiceSchema).optional()
1822
+ services: z.array(AccountServiceSchema).min(1).optional()
1786
1823
  });
1787
1824
  export const MicrosoftOAuthStartResponseSchema = z.object({
1788
1825
  authorizationUrl: z.string()