@remit/api-zod-schemas 0.0.31 → 0.0.33

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
@@ -17,12 +17,16 @@ export const AccountConfigStateSchema = z.enum(["active", "deleting"]);
17
17
 
18
18
  export const AccountAuthTypeSchema = z.enum(["password", "oauthMicrosoft"]);
19
19
 
20
- export const ConnectionStateSchema = z.enum(["not_authenticated", "authenticated", "selected", "logout", "reauth_required"]);
20
+ export const ConnectionStateSchema = z.enum(["not_authenticated", "authenticated", "selected", "logout", "reauth_required", "credentials_missing"]);
21
21
 
22
22
  export const SyncPhaseSchema = z.enum(["idle", "discovering_mailboxes", "syncing_inbox", "syncing_others", "complete", "error"]);
23
23
 
24
24
  export const FolderAppointmentSourceSchema = z.enum(["Appointed", "Flagged", "Reserved", "Proposed", "Stale", "None"]);
25
25
 
26
+ export const ConfigImportModeSchema = z.enum(["validate", "apply"]);
27
+
28
+ export const ConfigImportOnExistingSchema = z.enum(["abort", "merge"]);
29
+
26
30
  export const SystemUpdateCheckStatusSchema = z.enum(["ok", "failed", "disabled"]);
27
31
 
28
32
  export const SystemUpdatePhaseSchema = z.enum(["checking", "pulling", "snapshotting", "stopping", "starting", "verifying", "committing", "rollingBack", "recovering"]);
@@ -105,6 +109,22 @@ export const ContentEncodingSchema = z.enum(["none", "gzip", "zstd"]);
105
109
 
106
110
  export const AccountSettingNameSchema = z.enum(["Theme", "Density", "DefaultComposerFormat", "PinnedFolders", "AccountSignaturePlainText", "AccountSignatureHtml", "AccountDisplayName", "AccountMuted", "AccountComposeLanguages", "MailboxDisplayName", "MailboxMuted", "FolderRoleAppointment", "FolderRoleAppointmentLabel", "MailboxRole"]);
107
111
 
112
+ export const ConfigImportStateSchema = z.enum(["Pending", "Complete"]);
113
+
114
+ export const ConfigImportRefKindSchema = z.enum(["FolderRole", "MailboxOverride", "FilterAction"]);
115
+
116
+ export const CalendarColorSchema = z.enum(["Cal1", "Cal2", "Cal3", "Cal4", "Cal5", "Cal6"]);
117
+
118
+ export const CalendarComponentSetSchema = z.enum(["VeventOnly"]);
119
+
120
+ export const CalendarSourceSchema = z.enum(["Default", "UserCreated", "MailDerived"]);
121
+
122
+ export const CalendarEventStatusSchema = z.enum(["Confirmed", "Tentative", "Cancelled"]);
123
+
124
+ export const CalendarTransparencySchema = z.enum(["Opaque", "Transparent"]);
125
+
126
+ export const ZoneCertaintySchema = z.enum(["Local", "Explicit", "Ambiguous"]);
127
+
108
128
  export const MessagePlacementMoveStateSchema = z.enum(["pending", "queued", "processing", "processed"]);
109
129
 
110
130
  export const FlagPushOperationSchema = z.enum(["add", "remove"]);
@@ -360,9 +380,15 @@ export const AccountResponseSchema = z.object({
360
380
  folderAppointments: z.array(FolderAppointmentSchema)
361
381
  });
362
382
 
383
+ export const PendingConfigImportSchema = z.object({
384
+ importId: z.string(),
385
+ folderPaths: z.array(z.string())
386
+ });
387
+
363
388
  export const ConfigDescriptionResponseSchema = z.object({
364
389
  accountConfig: AccountConfigResponseSchema,
365
- accounts: z.array(AccountResponseSchema)
390
+ accounts: z.array(AccountResponseSchema),
391
+ pendingImport: PendingConfigImportSchema.optional()
366
392
  });
367
393
 
368
394
  export const AccountConfigSchema = z.object({
@@ -421,6 +447,37 @@ export const ConfigExportResponseSchema = z.object({
421
447
  document: z.record(z.string(), z.unknown())
422
448
  });
423
449
 
450
+ export const ImportConfigInputSchema = z.object({
451
+ mode: ConfigImportModeSchema.optional(),
452
+ onExisting: ConfigImportOnExistingSchema.optional(),
453
+ document: z.record(z.string(), z.unknown())
454
+ });
455
+
456
+ export const ConfigImportItemReportSchema = z.object({
457
+ section: z.string(),
458
+ key: z.string(),
459
+ verdict: z.string(),
460
+ reason: z.string().optional()
461
+ });
462
+
463
+ export const ConfigImportReportSchema = z.object({
464
+ importId: z.string().optional(),
465
+ valid: z.boolean(),
466
+ schemaVersion: z.number(),
467
+ applied: z.boolean(),
468
+ items: z.array(ConfigImportItemReportSchema),
469
+ errors: z.array(ApiErrorSchema),
470
+ warnings: z.array(ApiErrorSchema),
471
+ accountsNeedingCredentials: z.array(z.string())
472
+ });
473
+
474
+ export const ConfigImportConflictSchema = z.object({
475
+ statusCode: z.literal(409),
476
+ code: z.string(),
477
+ message: z.string(),
478
+ details: z.record(z.string(), z.string()).optional()
479
+ });
480
+
424
481
  export const SystemUpdateCheckSchema = z.object({
425
482
  status: SystemUpdateCheckStatusSchema,
426
483
  lastCheckedAt: z.string().optional(),
@@ -1347,6 +1404,25 @@ export const EnvelopeAddressSchema = z.object({
1347
1404
  updatedAt: z.number()
1348
1405
  });
1349
1406
 
1407
+ export const ConfigImportUnresolvedRefSchema = z.object({
1408
+ kind: ConfigImportRefKindSchema,
1409
+ accountId: z.string(),
1410
+ folderPath: z.string(),
1411
+ target: z.string()
1412
+ });
1413
+
1414
+ export const ConfigImportSchema = z.object({
1415
+ importId: z.string(),
1416
+ accountConfigId: z.string(),
1417
+ schemaVersion: z.number(),
1418
+ state: ConfigImportStateSchema,
1419
+ document: z.record(z.string(), z.unknown()),
1420
+ unresolvedRefs: z.array(ConfigImportUnresolvedRefSchema),
1421
+ createdAt: z.number(),
1422
+ completedAt: z.number(),
1423
+ updatedAt: z.number()
1424
+ });
1425
+
1350
1426
  export const AccountSettingValueSchema = z.object({
1351
1427
  kind: z.string()
1352
1428
  });
@@ -1526,6 +1602,53 @@ export const BodyPartContentSchema = z.object({
1526
1602
  updatedAt: z.number()
1527
1603
  });
1528
1604
 
1605
+ export const CalendarCollectionSchema = z.object({
1606
+ calendarId: z.string(),
1607
+ accountConfigId: z.string(),
1608
+ urlSegment: z.string(),
1609
+ displayName: z.string(),
1610
+ color: CalendarColorSchema,
1611
+ componentSet: CalendarComponentSetSchema,
1612
+ source: CalendarSourceSchema,
1613
+ timezone: z.string(),
1614
+ syncSequence: z.number(),
1615
+ createdAt: z.number(),
1616
+ updatedAt: z.number()
1617
+ });
1618
+
1619
+ export const CalendarObjectSchema = z.object({
1620
+ calendarObjectId: z.string(),
1621
+ calendarId: z.string(),
1622
+ resourceName: z.string(),
1623
+ icalUid: z.string(),
1624
+ icalData: z.string(),
1625
+ etag: z.string(),
1626
+ sequence: z.number(),
1627
+ syncSequence: z.number(),
1628
+ summary: z.string(),
1629
+ dtStart: z.string(),
1630
+ dtEnd: z.string(),
1631
+ allDay: z.boolean(),
1632
+ zoneCertainty: ZoneCertaintySchema,
1633
+ status: CalendarEventStatusSchema,
1634
+ transparency: CalendarTransparencySchema,
1635
+ hasRecurrence: z.boolean(),
1636
+ expandedThrough: z.string(),
1637
+ createdAt: z.number(),
1638
+ updatedAt: z.number()
1639
+ });
1640
+
1641
+ export const CalendarEventIndexSchema = z.object({
1642
+ calendarId: z.string(),
1643
+ calendarObjectId: z.string(),
1644
+ recurrenceId: z.string(),
1645
+ startAt: z.string(),
1646
+ endAt: z.string(),
1647
+ allDay: z.boolean(),
1648
+ createdAt: z.number(),
1649
+ updatedAt: z.number()
1650
+ });
1651
+
1529
1652
  export const MessageLabelSchema = z.object({
1530
1653
  messageLabelId: z.string(),
1531
1654
  messageId: z.string(),