@workwae/sdk 0.0.0-stage → 0.1.0-alpha.2

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.
Files changed (65) hide show
  1. package/README.md +233 -2
  2. package/client.d.ts +36 -0
  3. package/contract/accounts/models.d.ts +766 -0
  4. package/contract/accounts/routes.d.ts +1480 -0
  5. package/contract/ai/models.d.ts +29 -0
  6. package/contract/ai/routes.d.ts +98 -0
  7. package/contract/audit-log/models.d.ts +121 -0
  8. package/contract/audit-log/routes.d.ts +81 -0
  9. package/contract/calendar/models.d.ts +1012 -0
  10. package/contract/calendar/routes.d.ts +1843 -0
  11. package/contract/connect/models.d.ts +284 -0
  12. package/contract/connect/routes.d.ts +570 -0
  13. package/contract/contacts/models.d.ts +259 -0
  14. package/contract/contacts/routes.d.ts +648 -0
  15. package/contract/email-validation/models.d.ts +119 -0
  16. package/contract/email-validation/routes.d.ts +106 -0
  17. package/contract/errors.d.ts +116 -0
  18. package/contract/events/models.d.ts +2424 -0
  19. package/contract/events/routes.d.ts +117 -0
  20. package/contract/exports/models.d.ts +67 -0
  21. package/contract/exports/routes.d.ts +206 -0
  22. package/contract/identities/models.d.ts +98 -0
  23. package/contract/identities/routes.d.ts +318 -0
  24. package/contract/limits.d.ts +118 -0
  25. package/contract/mail/models.d.ts +571 -0
  26. package/contract/mail/routes.d.ts +1189 -0
  27. package/contract/mcp-keys/models.d.ts +125 -0
  28. package/contract/mcp-keys/routes.d.ts +151 -0
  29. package/contract/meetings/models.d.ts +227 -0
  30. package/contract/meetings/routes.d.ts +405 -0
  31. package/contract/oauth-apps/models.d.ts +86 -0
  32. package/contract/oauth-apps/routes.d.ts +195 -0
  33. package/contract/org-connections/models.d.ts +427 -0
  34. package/contract/org-connections/routes.d.ts +1107 -0
  35. package/contract/plans/credit-packs.d.ts +30 -0
  36. package/contract/plans/models.d.ts +208 -0
  37. package/contract/primitives.d.ts +85 -0
  38. package/contract/public.d.ts +32 -0
  39. package/contract/reasons.d.ts +1222 -0
  40. package/contract/router.d.ts +12986 -0
  41. package/contract/scheduling/models.d.ts +405 -0
  42. package/contract/scheduling/routes.d.ts +756 -0
  43. package/contract/send/models.d.ts +787 -0
  44. package/contract/send/routes.d.ts +1488 -0
  45. package/contract/settings/models.d.ts +163 -0
  46. package/contract/settings/routes.d.ts +162 -0
  47. package/contract/suppressions/models.d.ts +224 -0
  48. package/contract/suppressions/routes.d.ts +365 -0
  49. package/contract/templates/models.d.ts +155 -0
  50. package/contract/templates/routes.d.ts +305 -0
  51. package/contract/threads/models.d.ts +112 -0
  52. package/contract/threads/routes.d.ts +376 -0
  53. package/contract/tracking-domain/models.d.ts +41 -0
  54. package/contract/tracking-domain/routes.d.ts +193 -0
  55. package/contract/usage/models.d.ts +185 -0
  56. package/contract/usage/routes.d.ts +109 -0
  57. package/contract/webhooks/models.d.ts +894 -0
  58. package/contract/webhooks/routes.d.ts +882 -0
  59. package/contract/webhooks/signing.d.ts +19 -0
  60. package/errors.d.ts +15 -0
  61. package/index.d.ts +6 -0
  62. package/index.js +1 -0
  63. package/package.json +44 -4
  64. package/pagination.d.ts +40 -0
  65. package/webhooks.d.ts +28 -0
@@ -0,0 +1,1480 @@
1
+ import * as z from "zod";
2
+ export declare const MAIL_SETTINGS_CHECK: import("../errors.js").DeclaredErrors<{
3
+ readonly login_failed: "A server (IMAP, SMTP, CalDAV or CardDAV) refuses the login.";
4
+ readonly server_not_allowed: "A server resolves to a private or loopback address.";
5
+ readonly plaintext_not_allowed: "A server is named with security none (a plaintext login).";
6
+ }>;
7
+ export declare const AUTODISCOVERY_FAILED: import("../errors.js").DeclaredErrors<{
8
+ readonly autodiscovery_failed: "imap was left out and autodiscovery found no IMAP server for the address.";
9
+ }>;
10
+ export declare const DAV_SETTINGS_CHECK: import("../errors.js").DeclaredErrors<{
11
+ readonly dav_discovery_failed: "Neither a CalDAV nor a CardDAV server was found or answered.";
12
+ readonly not_dav_server: "A named CalDAV or CardDAV URL is no DAV server (it answers 404, 403, or not as one).";
13
+ }>;
14
+ export declare const OAUTH_CLIENT: import("../errors.js").DeclaredErrors<{
15
+ readonly unknown_oauth_app: "oauthAppId names no OAuth app of the tenant.";
16
+ readonly oauth_app_mismatch: "The OAuth app is for the other provider.";
17
+ readonly oauth_app_secret_unreadable: "The OAuth app's client secret cannot be decrypted; replace it.";
18
+ readonly provider_not_configured: "No OAuth app is given and the platform has none for the provider (and cloud).";
19
+ }>;
20
+ export declare const accounts: {
21
+ list: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
22
+ externalRef: z.ZodOptional<z.ZodString>;
23
+ q: z.ZodOptional<z.ZodString>;
24
+ status: z.ZodOptional<z.ZodEnum<{
25
+ active: "active";
26
+ paused: "paused";
27
+ reauth_required: "reauth_required";
28
+ disabled: "disabled";
29
+ }>>;
30
+ orgConnectionId: z.ZodOptional<z.ZodUUID>;
31
+ delegateAccountId: z.ZodOptional<z.ZodUUID>;
32
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
33
+ cursor: z.ZodOptional<z.ZodString>;
34
+ }, z.core.$strip>, z.ZodObject<{
35
+ items: z.ZodArray<z.ZodObject<{
36
+ id: z.ZodUUID;
37
+ externalRef: z.ZodNullable<z.ZodString>;
38
+ provider: z.ZodEnum<{
39
+ gmail: "gmail";
40
+ graph: "graph";
41
+ imap: "imap";
42
+ }>;
43
+ email: z.ZodString;
44
+ displayName: z.ZodNullable<z.ZodString>;
45
+ oauthAppId: z.ZodNullable<z.ZodUUID>;
46
+ cloud: z.ZodNullable<z.ZodEnum<{
47
+ global: "global";
48
+ "gcc-high": "gcc-high";
49
+ dod: "dod";
50
+ china: "china";
51
+ }>>;
52
+ status: z.ZodEnum<{
53
+ active: "active";
54
+ paused: "paused";
55
+ reauth_required: "reauth_required";
56
+ disabled: "disabled";
57
+ }>;
58
+ statusReason: z.ZodNullable<z.ZodString>;
59
+ settings: z.ZodObject<{
60
+ bodyStorage: z.ZodEnum<{
61
+ none: "none";
62
+ cache: "cache";
63
+ full: "full";
64
+ }>;
65
+ syncWindowDays: z.ZodNullable<z.ZodNumber>;
66
+ mailEnabled: z.ZodBoolean;
67
+ calendarEnabled: z.ZodBoolean;
68
+ contactsEnabled: z.ZodBoolean;
69
+ undoSendSeconds: z.ZodNumber;
70
+ trackOpens: z.ZodBoolean;
71
+ trackClicks: z.ZodBoolean;
72
+ trackingHoneypot: z.ZodBoolean;
73
+ suppressionCheck: z.ZodEnum<{
74
+ lists: "lists";
75
+ always: "always";
76
+ }>;
77
+ sendsPerMinute: z.ZodNullable<z.ZodNumber>;
78
+ }, z.core.$strip>;
79
+ settingsOverride: z.ZodObject<{
80
+ bodyStorage: z.ZodOptional<z.ZodEnum<{
81
+ none: "none";
82
+ cache: "cache";
83
+ full: "full";
84
+ }>>;
85
+ syncWindowDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
86
+ mailEnabled: z.ZodOptional<z.ZodBoolean>;
87
+ calendarEnabled: z.ZodOptional<z.ZodBoolean>;
88
+ contactsEnabled: z.ZodOptional<z.ZodBoolean>;
89
+ undoSendSeconds: z.ZodOptional<z.ZodNumber>;
90
+ trackOpens: z.ZodOptional<z.ZodBoolean>;
91
+ trackClicks: z.ZodOptional<z.ZodBoolean>;
92
+ trackingHoneypot: z.ZodOptional<z.ZodBoolean>;
93
+ suppressionCheck: z.ZodOptional<z.ZodEnum<{
94
+ lists: "lists";
95
+ always: "always";
96
+ }>>;
97
+ sendsPerMinute: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
98
+ }, z.core.$strip>;
99
+ runtime: z.ZodNullable<z.ZodObject<{
100
+ state: z.ZodEnum<{
101
+ error: "error";
102
+ pending: "pending";
103
+ connecting: "connecting";
104
+ connected: "connected";
105
+ stopped: "stopped";
106
+ }>;
107
+ detail: z.ZodNullable<z.ZodString>;
108
+ ownerInstanceId: z.ZodNullable<z.ZodUUID>;
109
+ updatedAt: z.ZodPreprocess<z.ZodDate, Date>;
110
+ }, z.core.$strip>>;
111
+ imap: z.ZodNullable<z.ZodObject<{
112
+ imap: z.ZodObject<{
113
+ host: z.ZodString;
114
+ port: z.ZodNumber;
115
+ security: z.ZodEnum<{
116
+ none: "none";
117
+ tls: "tls";
118
+ starttls: "starttls";
119
+ }>;
120
+ user: z.ZodString;
121
+ }, z.core.$strip>;
122
+ smtp: z.ZodNullable<z.ZodObject<{
123
+ host: z.ZodString;
124
+ port: z.ZodNumber;
125
+ security: z.ZodEnum<{
126
+ none: "none";
127
+ tls: "tls";
128
+ starttls: "starttls";
129
+ }>;
130
+ user: z.ZodString;
131
+ }, z.core.$strip>>;
132
+ auth: z.ZodEnum<{
133
+ google: "google";
134
+ microsoft: "microsoft";
135
+ password: "password";
136
+ }>;
137
+ appendSent: z.ZodBoolean;
138
+ dav: z.ZodNullable<z.ZodObject<{
139
+ calendarUrl: z.ZodNullable<z.ZodString>;
140
+ contactsUrl: z.ZodNullable<z.ZodString>;
141
+ user: z.ZodString;
142
+ auth: z.ZodEnum<{
143
+ imap_password: "imap_password";
144
+ dav_password: "dav_password";
145
+ }>;
146
+ }, z.core.$strip>>;
147
+ }, z.core.$strip>>;
148
+ auth: z.ZodObject<{
149
+ method: z.ZodEnum<{
150
+ password: "password";
151
+ oauth: "oauth";
152
+ google_delegation: "google_delegation";
153
+ microsoft_app: "microsoft_app";
154
+ shared_mailbox: "shared_mailbox";
155
+ google_group: "google_group";
156
+ }>;
157
+ orgConnectionId: z.ZodNullable<z.ZodUUID>;
158
+ delegateAccountId: z.ZodNullable<z.ZodUUID>;
159
+ relayEmail: z.ZodNullable<z.ZodEmail>;
160
+ }, z.core.$strip>;
161
+ initializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
162
+ calendarInitializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
163
+ contactsInitializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
164
+ createdAt: z.ZodPreprocess<z.ZodDate, Date>;
165
+ updatedAt: z.ZodPreprocess<z.ZodDate, Date>;
166
+ }, z.core.$strip>>;
167
+ nextCursor: z.ZodNullable<z.ZodString>;
168
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
169
+ readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
170
+ readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
171
+ readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
172
+ readonly missing_scope: "The API key lacks the scope the operation needs.";
173
+ readonly role_forbidden: "The member's role does not allow the operation.";
174
+ readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
175
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
176
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
177
+ readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
178
+ readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
179
+ readonly overloaded: "The API is shedding load; retry after Retry-After.";
180
+ readonly payload_too_large: "The request body is larger than the API accepts.";
181
+ readonly internal_error: "An unexpected failure on our side.";
182
+ readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
183
+ readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
184
+ readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
185
+ }>>, import("../errors.js").DeclaredErrors<{
186
+ readonly invalid_cursor: "The cursor is not one this list issued.";
187
+ }>>, Record<never, never>>;
188
+ get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
189
+ accountId: z.ZodUUID;
190
+ }, z.core.$strip>, z.ZodObject<{
191
+ id: z.ZodUUID;
192
+ externalRef: z.ZodNullable<z.ZodString>;
193
+ provider: z.ZodEnum<{
194
+ gmail: "gmail";
195
+ graph: "graph";
196
+ imap: "imap";
197
+ }>;
198
+ email: z.ZodString;
199
+ displayName: z.ZodNullable<z.ZodString>;
200
+ oauthAppId: z.ZodNullable<z.ZodUUID>;
201
+ cloud: z.ZodNullable<z.ZodEnum<{
202
+ global: "global";
203
+ "gcc-high": "gcc-high";
204
+ dod: "dod";
205
+ china: "china";
206
+ }>>;
207
+ status: z.ZodEnum<{
208
+ active: "active";
209
+ paused: "paused";
210
+ reauth_required: "reauth_required";
211
+ disabled: "disabled";
212
+ }>;
213
+ statusReason: z.ZodNullable<z.ZodString>;
214
+ settings: z.ZodObject<{
215
+ bodyStorage: z.ZodEnum<{
216
+ none: "none";
217
+ cache: "cache";
218
+ full: "full";
219
+ }>;
220
+ syncWindowDays: z.ZodNullable<z.ZodNumber>;
221
+ mailEnabled: z.ZodBoolean;
222
+ calendarEnabled: z.ZodBoolean;
223
+ contactsEnabled: z.ZodBoolean;
224
+ undoSendSeconds: z.ZodNumber;
225
+ trackOpens: z.ZodBoolean;
226
+ trackClicks: z.ZodBoolean;
227
+ trackingHoneypot: z.ZodBoolean;
228
+ suppressionCheck: z.ZodEnum<{
229
+ lists: "lists";
230
+ always: "always";
231
+ }>;
232
+ sendsPerMinute: z.ZodNullable<z.ZodNumber>;
233
+ }, z.core.$strip>;
234
+ settingsOverride: z.ZodObject<{
235
+ bodyStorage: z.ZodOptional<z.ZodEnum<{
236
+ none: "none";
237
+ cache: "cache";
238
+ full: "full";
239
+ }>>;
240
+ syncWindowDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
241
+ mailEnabled: z.ZodOptional<z.ZodBoolean>;
242
+ calendarEnabled: z.ZodOptional<z.ZodBoolean>;
243
+ contactsEnabled: z.ZodOptional<z.ZodBoolean>;
244
+ undoSendSeconds: z.ZodOptional<z.ZodNumber>;
245
+ trackOpens: z.ZodOptional<z.ZodBoolean>;
246
+ trackClicks: z.ZodOptional<z.ZodBoolean>;
247
+ trackingHoneypot: z.ZodOptional<z.ZodBoolean>;
248
+ suppressionCheck: z.ZodOptional<z.ZodEnum<{
249
+ lists: "lists";
250
+ always: "always";
251
+ }>>;
252
+ sendsPerMinute: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
253
+ }, z.core.$strip>;
254
+ runtime: z.ZodNullable<z.ZodObject<{
255
+ state: z.ZodEnum<{
256
+ error: "error";
257
+ pending: "pending";
258
+ connecting: "connecting";
259
+ connected: "connected";
260
+ stopped: "stopped";
261
+ }>;
262
+ detail: z.ZodNullable<z.ZodString>;
263
+ ownerInstanceId: z.ZodNullable<z.ZodUUID>;
264
+ updatedAt: z.ZodPreprocess<z.ZodDate, Date>;
265
+ }, z.core.$strip>>;
266
+ imap: z.ZodNullable<z.ZodObject<{
267
+ imap: z.ZodObject<{
268
+ host: z.ZodString;
269
+ port: z.ZodNumber;
270
+ security: z.ZodEnum<{
271
+ none: "none";
272
+ tls: "tls";
273
+ starttls: "starttls";
274
+ }>;
275
+ user: z.ZodString;
276
+ }, z.core.$strip>;
277
+ smtp: z.ZodNullable<z.ZodObject<{
278
+ host: z.ZodString;
279
+ port: z.ZodNumber;
280
+ security: z.ZodEnum<{
281
+ none: "none";
282
+ tls: "tls";
283
+ starttls: "starttls";
284
+ }>;
285
+ user: z.ZodString;
286
+ }, z.core.$strip>>;
287
+ auth: z.ZodEnum<{
288
+ google: "google";
289
+ microsoft: "microsoft";
290
+ password: "password";
291
+ }>;
292
+ appendSent: z.ZodBoolean;
293
+ dav: z.ZodNullable<z.ZodObject<{
294
+ calendarUrl: z.ZodNullable<z.ZodString>;
295
+ contactsUrl: z.ZodNullable<z.ZodString>;
296
+ user: z.ZodString;
297
+ auth: z.ZodEnum<{
298
+ imap_password: "imap_password";
299
+ dav_password: "dav_password";
300
+ }>;
301
+ }, z.core.$strip>>;
302
+ }, z.core.$strip>>;
303
+ auth: z.ZodObject<{
304
+ method: z.ZodEnum<{
305
+ password: "password";
306
+ oauth: "oauth";
307
+ google_delegation: "google_delegation";
308
+ microsoft_app: "microsoft_app";
309
+ shared_mailbox: "shared_mailbox";
310
+ google_group: "google_group";
311
+ }>;
312
+ orgConnectionId: z.ZodNullable<z.ZodUUID>;
313
+ delegateAccountId: z.ZodNullable<z.ZodUUID>;
314
+ relayEmail: z.ZodNullable<z.ZodEmail>;
315
+ }, z.core.$strip>;
316
+ initializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
317
+ calendarInitializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
318
+ contactsInitializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
319
+ createdAt: z.ZodPreprocess<z.ZodDate, Date>;
320
+ updatedAt: z.ZodPreprocess<z.ZodDate, Date>;
321
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
322
+ readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
323
+ readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
324
+ readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
325
+ readonly missing_scope: "The API key lacks the scope the operation needs.";
326
+ readonly role_forbidden: "The member's role does not allow the operation.";
327
+ readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
328
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
329
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
330
+ readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
331
+ readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
332
+ readonly overloaded: "The API is shedding load; retry after Retry-After.";
333
+ readonly payload_too_large: "The request body is larger than the API accepts.";
334
+ readonly internal_error: "An unexpected failure on our side.";
335
+ readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
336
+ readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
337
+ readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
338
+ }>>, import("../errors.js").DeclaredErrors<{
339
+ readonly account_not_found: "The account does not exist, or the caller is an account token for another account.";
340
+ }>>, Record<never, never>>;
341
+ create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
342
+ provider: z.ZodEnum<{
343
+ google: "google";
344
+ microsoft: "microsoft";
345
+ }>;
346
+ microsoftCloud: z.ZodDefault<z.ZodEnum<{
347
+ global: "global";
348
+ "gcc-high": "gcc-high";
349
+ dod: "dod";
350
+ china: "china";
351
+ }>>;
352
+ refreshToken: z.ZodString;
353
+ oauthAppId: z.ZodOptional<z.ZodUUID>;
354
+ externalRef: z.ZodOptional<z.ZodString>;
355
+ settings: z.ZodOptional<z.ZodObject<{
356
+ bodyStorage: z.ZodOptional<z.ZodEnum<{
357
+ none: "none";
358
+ cache: "cache";
359
+ full: "full";
360
+ }>>;
361
+ syncWindowDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
362
+ mailEnabled: z.ZodOptional<z.ZodBoolean>;
363
+ calendarEnabled: z.ZodOptional<z.ZodBoolean>;
364
+ contactsEnabled: z.ZodOptional<z.ZodBoolean>;
365
+ undoSendSeconds: z.ZodOptional<z.ZodNumber>;
366
+ trackOpens: z.ZodOptional<z.ZodBoolean>;
367
+ trackClicks: z.ZodOptional<z.ZodBoolean>;
368
+ trackingHoneypot: z.ZodOptional<z.ZodBoolean>;
369
+ suppressionCheck: z.ZodOptional<z.ZodEnum<{
370
+ lists: "lists";
371
+ always: "always";
372
+ }>>;
373
+ sendsPerMinute: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
374
+ }, z.core.$strip>>;
375
+ sharedMailboxesEnabled: z.ZodOptional<z.ZodBoolean>;
376
+ }, z.core.$strip>, z.ZodObject<{
377
+ id: z.ZodUUID;
378
+ externalRef: z.ZodNullable<z.ZodString>;
379
+ provider: z.ZodEnum<{
380
+ gmail: "gmail";
381
+ graph: "graph";
382
+ imap: "imap";
383
+ }>;
384
+ email: z.ZodString;
385
+ displayName: z.ZodNullable<z.ZodString>;
386
+ oauthAppId: z.ZodNullable<z.ZodUUID>;
387
+ cloud: z.ZodNullable<z.ZodEnum<{
388
+ global: "global";
389
+ "gcc-high": "gcc-high";
390
+ dod: "dod";
391
+ china: "china";
392
+ }>>;
393
+ status: z.ZodEnum<{
394
+ active: "active";
395
+ paused: "paused";
396
+ reauth_required: "reauth_required";
397
+ disabled: "disabled";
398
+ }>;
399
+ statusReason: z.ZodNullable<z.ZodString>;
400
+ settings: z.ZodObject<{
401
+ bodyStorage: z.ZodEnum<{
402
+ none: "none";
403
+ cache: "cache";
404
+ full: "full";
405
+ }>;
406
+ syncWindowDays: z.ZodNullable<z.ZodNumber>;
407
+ mailEnabled: z.ZodBoolean;
408
+ calendarEnabled: z.ZodBoolean;
409
+ contactsEnabled: z.ZodBoolean;
410
+ undoSendSeconds: z.ZodNumber;
411
+ trackOpens: z.ZodBoolean;
412
+ trackClicks: z.ZodBoolean;
413
+ trackingHoneypot: z.ZodBoolean;
414
+ suppressionCheck: z.ZodEnum<{
415
+ lists: "lists";
416
+ always: "always";
417
+ }>;
418
+ sendsPerMinute: z.ZodNullable<z.ZodNumber>;
419
+ }, z.core.$strip>;
420
+ settingsOverride: z.ZodObject<{
421
+ bodyStorage: z.ZodOptional<z.ZodEnum<{
422
+ none: "none";
423
+ cache: "cache";
424
+ full: "full";
425
+ }>>;
426
+ syncWindowDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
427
+ mailEnabled: z.ZodOptional<z.ZodBoolean>;
428
+ calendarEnabled: z.ZodOptional<z.ZodBoolean>;
429
+ contactsEnabled: z.ZodOptional<z.ZodBoolean>;
430
+ undoSendSeconds: z.ZodOptional<z.ZodNumber>;
431
+ trackOpens: z.ZodOptional<z.ZodBoolean>;
432
+ trackClicks: z.ZodOptional<z.ZodBoolean>;
433
+ trackingHoneypot: z.ZodOptional<z.ZodBoolean>;
434
+ suppressionCheck: z.ZodOptional<z.ZodEnum<{
435
+ lists: "lists";
436
+ always: "always";
437
+ }>>;
438
+ sendsPerMinute: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
439
+ }, z.core.$strip>;
440
+ runtime: z.ZodNullable<z.ZodObject<{
441
+ state: z.ZodEnum<{
442
+ error: "error";
443
+ pending: "pending";
444
+ connecting: "connecting";
445
+ connected: "connected";
446
+ stopped: "stopped";
447
+ }>;
448
+ detail: z.ZodNullable<z.ZodString>;
449
+ ownerInstanceId: z.ZodNullable<z.ZodUUID>;
450
+ updatedAt: z.ZodPreprocess<z.ZodDate, Date>;
451
+ }, z.core.$strip>>;
452
+ imap: z.ZodNullable<z.ZodObject<{
453
+ imap: z.ZodObject<{
454
+ host: z.ZodString;
455
+ port: z.ZodNumber;
456
+ security: z.ZodEnum<{
457
+ none: "none";
458
+ tls: "tls";
459
+ starttls: "starttls";
460
+ }>;
461
+ user: z.ZodString;
462
+ }, z.core.$strip>;
463
+ smtp: z.ZodNullable<z.ZodObject<{
464
+ host: z.ZodString;
465
+ port: z.ZodNumber;
466
+ security: z.ZodEnum<{
467
+ none: "none";
468
+ tls: "tls";
469
+ starttls: "starttls";
470
+ }>;
471
+ user: z.ZodString;
472
+ }, z.core.$strip>>;
473
+ auth: z.ZodEnum<{
474
+ google: "google";
475
+ microsoft: "microsoft";
476
+ password: "password";
477
+ }>;
478
+ appendSent: z.ZodBoolean;
479
+ dav: z.ZodNullable<z.ZodObject<{
480
+ calendarUrl: z.ZodNullable<z.ZodString>;
481
+ contactsUrl: z.ZodNullable<z.ZodString>;
482
+ user: z.ZodString;
483
+ auth: z.ZodEnum<{
484
+ imap_password: "imap_password";
485
+ dav_password: "dav_password";
486
+ }>;
487
+ }, z.core.$strip>>;
488
+ }, z.core.$strip>>;
489
+ auth: z.ZodObject<{
490
+ method: z.ZodEnum<{
491
+ password: "password";
492
+ oauth: "oauth";
493
+ google_delegation: "google_delegation";
494
+ microsoft_app: "microsoft_app";
495
+ shared_mailbox: "shared_mailbox";
496
+ google_group: "google_group";
497
+ }>;
498
+ orgConnectionId: z.ZodNullable<z.ZodUUID>;
499
+ delegateAccountId: z.ZodNullable<z.ZodUUID>;
500
+ relayEmail: z.ZodNullable<z.ZodEmail>;
501
+ }, z.core.$strip>;
502
+ initializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
503
+ calendarInitializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
504
+ contactsInitializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
505
+ createdAt: z.ZodPreprocess<z.ZodDate, Date>;
506
+ updatedAt: z.ZodPreprocess<z.ZodDate, Date>;
507
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
508
+ readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
509
+ readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
510
+ readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
511
+ readonly missing_scope: "The API key lacks the scope the operation needs.";
512
+ readonly role_forbidden: "The member's role does not allow the operation.";
513
+ readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
514
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
515
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
516
+ readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
517
+ readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
518
+ readonly overloaded: "The API is shedding load; retry after Retry-After.";
519
+ readonly payload_too_large: "The request body is larger than the API accepts.";
520
+ readonly internal_error: "An unexpected failure on our side.";
521
+ readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
522
+ readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
523
+ readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
524
+ }>>, {
525
+ access_token_rejected: {
526
+ status: 400;
527
+ message: string;
528
+ };
529
+ provider_unavailable: {
530
+ status: 502;
531
+ message: string;
532
+ };
533
+ token_exchange_failed: {
534
+ status: 400;
535
+ message: string;
536
+ };
537
+ invalid_client: {
538
+ status: 400;
539
+ message: string;
540
+ };
541
+ interaction_required: {
542
+ status: 400;
543
+ message: string;
544
+ };
545
+ invalid_grant: {
546
+ status: 400;
547
+ message: string;
548
+ };
549
+ scope_denied: {
550
+ status: 400;
551
+ message: string;
552
+ };
553
+ identity_failed: {
554
+ status: 400;
555
+ message: string;
556
+ };
557
+ identity_unavailable: {
558
+ status: 400;
559
+ message: string;
560
+ };
561
+ provider_not_configured: {
562
+ status: 400;
563
+ message: string;
564
+ };
565
+ unknown_oauth_app: {
566
+ status: 422;
567
+ message: string;
568
+ };
569
+ oauth_app_mismatch: {
570
+ status: 400;
571
+ message: string;
572
+ };
573
+ oauth_app_secret_unreadable: {
574
+ status: 400;
575
+ message: string;
576
+ };
577
+ billing_past_due: {
578
+ status: 402;
579
+ message: string;
580
+ };
581
+ plan_limit_accounts: import("../errors.js").DeclaredError<"plan_limit_accounts">;
582
+ plan_required: import("../errors.js").DeclaredError<"plan_required">;
583
+ spend_cap_reached: import("../errors.js").DeclaredError<"spend_cap_reached">;
584
+ plan_module_unavailable: {
585
+ status: 403;
586
+ message: string;
587
+ };
588
+ plan_limit_storage: import("../errors.js").DeclaredError<"plan_limit_storage">;
589
+ storage_unavailable: {
590
+ status: 400;
591
+ message: string;
592
+ };
593
+ }>, Record<never, never>>;
594
+ update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
595
+ accountId: z.ZodUUID;
596
+ externalRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
597
+ status: z.ZodOptional<z.ZodEnum<{
598
+ active: "active";
599
+ paused: "paused";
600
+ }>>;
601
+ settings: z.ZodOptional<z.ZodObject<{
602
+ bodyStorage: z.ZodOptional<z.ZodEnum<{
603
+ none: "none";
604
+ cache: "cache";
605
+ full: "full";
606
+ }>>;
607
+ syncWindowDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
608
+ mailEnabled: z.ZodOptional<z.ZodBoolean>;
609
+ calendarEnabled: z.ZodOptional<z.ZodBoolean>;
610
+ contactsEnabled: z.ZodOptional<z.ZodBoolean>;
611
+ undoSendSeconds: z.ZodOptional<z.ZodNumber>;
612
+ trackOpens: z.ZodOptional<z.ZodBoolean>;
613
+ trackClicks: z.ZodOptional<z.ZodBoolean>;
614
+ trackingHoneypot: z.ZodOptional<z.ZodBoolean>;
615
+ suppressionCheck: z.ZodOptional<z.ZodEnum<{
616
+ lists: "lists";
617
+ always: "always";
618
+ }>>;
619
+ sendsPerMinute: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
620
+ }, z.core.$strip>>;
621
+ }, z.core.$strip>, z.ZodObject<{
622
+ id: z.ZodUUID;
623
+ externalRef: z.ZodNullable<z.ZodString>;
624
+ provider: z.ZodEnum<{
625
+ gmail: "gmail";
626
+ graph: "graph";
627
+ imap: "imap";
628
+ }>;
629
+ email: z.ZodString;
630
+ displayName: z.ZodNullable<z.ZodString>;
631
+ oauthAppId: z.ZodNullable<z.ZodUUID>;
632
+ cloud: z.ZodNullable<z.ZodEnum<{
633
+ global: "global";
634
+ "gcc-high": "gcc-high";
635
+ dod: "dod";
636
+ china: "china";
637
+ }>>;
638
+ status: z.ZodEnum<{
639
+ active: "active";
640
+ paused: "paused";
641
+ reauth_required: "reauth_required";
642
+ disabled: "disabled";
643
+ }>;
644
+ statusReason: z.ZodNullable<z.ZodString>;
645
+ settings: z.ZodObject<{
646
+ bodyStorage: z.ZodEnum<{
647
+ none: "none";
648
+ cache: "cache";
649
+ full: "full";
650
+ }>;
651
+ syncWindowDays: z.ZodNullable<z.ZodNumber>;
652
+ mailEnabled: z.ZodBoolean;
653
+ calendarEnabled: z.ZodBoolean;
654
+ contactsEnabled: z.ZodBoolean;
655
+ undoSendSeconds: z.ZodNumber;
656
+ trackOpens: z.ZodBoolean;
657
+ trackClicks: z.ZodBoolean;
658
+ trackingHoneypot: z.ZodBoolean;
659
+ suppressionCheck: z.ZodEnum<{
660
+ lists: "lists";
661
+ always: "always";
662
+ }>;
663
+ sendsPerMinute: z.ZodNullable<z.ZodNumber>;
664
+ }, z.core.$strip>;
665
+ settingsOverride: z.ZodObject<{
666
+ bodyStorage: z.ZodOptional<z.ZodEnum<{
667
+ none: "none";
668
+ cache: "cache";
669
+ full: "full";
670
+ }>>;
671
+ syncWindowDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
672
+ mailEnabled: z.ZodOptional<z.ZodBoolean>;
673
+ calendarEnabled: z.ZodOptional<z.ZodBoolean>;
674
+ contactsEnabled: z.ZodOptional<z.ZodBoolean>;
675
+ undoSendSeconds: z.ZodOptional<z.ZodNumber>;
676
+ trackOpens: z.ZodOptional<z.ZodBoolean>;
677
+ trackClicks: z.ZodOptional<z.ZodBoolean>;
678
+ trackingHoneypot: z.ZodOptional<z.ZodBoolean>;
679
+ suppressionCheck: z.ZodOptional<z.ZodEnum<{
680
+ lists: "lists";
681
+ always: "always";
682
+ }>>;
683
+ sendsPerMinute: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
684
+ }, z.core.$strip>;
685
+ runtime: z.ZodNullable<z.ZodObject<{
686
+ state: z.ZodEnum<{
687
+ error: "error";
688
+ pending: "pending";
689
+ connecting: "connecting";
690
+ connected: "connected";
691
+ stopped: "stopped";
692
+ }>;
693
+ detail: z.ZodNullable<z.ZodString>;
694
+ ownerInstanceId: z.ZodNullable<z.ZodUUID>;
695
+ updatedAt: z.ZodPreprocess<z.ZodDate, Date>;
696
+ }, z.core.$strip>>;
697
+ imap: z.ZodNullable<z.ZodObject<{
698
+ imap: z.ZodObject<{
699
+ host: z.ZodString;
700
+ port: z.ZodNumber;
701
+ security: z.ZodEnum<{
702
+ none: "none";
703
+ tls: "tls";
704
+ starttls: "starttls";
705
+ }>;
706
+ user: z.ZodString;
707
+ }, z.core.$strip>;
708
+ smtp: z.ZodNullable<z.ZodObject<{
709
+ host: z.ZodString;
710
+ port: z.ZodNumber;
711
+ security: z.ZodEnum<{
712
+ none: "none";
713
+ tls: "tls";
714
+ starttls: "starttls";
715
+ }>;
716
+ user: z.ZodString;
717
+ }, z.core.$strip>>;
718
+ auth: z.ZodEnum<{
719
+ google: "google";
720
+ microsoft: "microsoft";
721
+ password: "password";
722
+ }>;
723
+ appendSent: z.ZodBoolean;
724
+ dav: z.ZodNullable<z.ZodObject<{
725
+ calendarUrl: z.ZodNullable<z.ZodString>;
726
+ contactsUrl: z.ZodNullable<z.ZodString>;
727
+ user: z.ZodString;
728
+ auth: z.ZodEnum<{
729
+ imap_password: "imap_password";
730
+ dav_password: "dav_password";
731
+ }>;
732
+ }, z.core.$strip>>;
733
+ }, z.core.$strip>>;
734
+ auth: z.ZodObject<{
735
+ method: z.ZodEnum<{
736
+ password: "password";
737
+ oauth: "oauth";
738
+ google_delegation: "google_delegation";
739
+ microsoft_app: "microsoft_app";
740
+ shared_mailbox: "shared_mailbox";
741
+ google_group: "google_group";
742
+ }>;
743
+ orgConnectionId: z.ZodNullable<z.ZodUUID>;
744
+ delegateAccountId: z.ZodNullable<z.ZodUUID>;
745
+ relayEmail: z.ZodNullable<z.ZodEmail>;
746
+ }, z.core.$strip>;
747
+ initializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
748
+ calendarInitializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
749
+ contactsInitializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
750
+ createdAt: z.ZodPreprocess<z.ZodDate, Date>;
751
+ updatedAt: z.ZodPreprocess<z.ZodDate, Date>;
752
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
753
+ readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
754
+ readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
755
+ readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
756
+ readonly missing_scope: "The API key lacks the scope the operation needs.";
757
+ readonly role_forbidden: "The member's role does not allow the operation.";
758
+ readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
759
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
760
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
761
+ readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
762
+ readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
763
+ readonly overloaded: "The API is shedding load; retry after Retry-After.";
764
+ readonly payload_too_large: "The request body is larger than the API accepts.";
765
+ readonly internal_error: "An unexpected failure on our side.";
766
+ readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
767
+ readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
768
+ readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
769
+ }>>, {
770
+ account_disabled: {
771
+ status: 409;
772
+ message: string;
773
+ };
774
+ account_reauth_required: {
775
+ status: 409;
776
+ message: string;
777
+ };
778
+ plan_limit_storage: import("../errors.js").DeclaredError<"plan_limit_storage">;
779
+ storage_unavailable: {
780
+ status: 400;
781
+ message: string;
782
+ };
783
+ plan_limit_accounts: import("../errors.js").DeclaredError<"plan_limit_accounts">;
784
+ plan_required: import("../errors.js").DeclaredError<"plan_required">;
785
+ spend_cap_reached: import("../errors.js").DeclaredError<"spend_cap_reached">;
786
+ account_not_found: {
787
+ status: 404;
788
+ message: string;
789
+ };
790
+ }>, Record<never, never>>;
791
+ delete: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
792
+ params: z.ZodObject<{
793
+ accountId: z.ZodUUID;
794
+ }, z.core.$strip>;
795
+ query: z.ZodObject<{
796
+ purge: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [
797
+ z.ZodBoolean,
798
+ z.ZodEnum<{
799
+ true: "true";
800
+ false: "false";
801
+ }>
802
+ ]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
803
+ }, z.core.$strip>;
804
+ }, z.core.$strip>, z.ZodVoid, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
805
+ readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
806
+ readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
807
+ readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
808
+ readonly missing_scope: "The API key lacks the scope the operation needs.";
809
+ readonly role_forbidden: "The member's role does not allow the operation.";
810
+ readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
811
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
812
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
813
+ readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
814
+ readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
815
+ readonly overloaded: "The API is shedding load; retry after Retry-After.";
816
+ readonly payload_too_large: "The request body is larger than the API accepts.";
817
+ readonly internal_error: "An unexpected failure on our side.";
818
+ readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
819
+ readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
820
+ readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
821
+ }>>, import("../errors.js").DeclaredErrors<{
822
+ readonly account_not_found: "The account does not exist, or (without purge) is already deleted.";
823
+ }>>, Record<never, never>>;
824
+ sync: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
825
+ accountId: z.ZodUUID;
826
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
827
+ mail: "mail";
828
+ calendar: "calendar";
829
+ contacts: "contacts";
830
+ }>>>;
831
+ }, z.core.$strip>, z.ZodObject<{
832
+ kinds: z.ZodArray<z.ZodEnum<{
833
+ mail: "mail";
834
+ calendar: "calendar";
835
+ contacts: "contacts";
836
+ }>>;
837
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
838
+ readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
839
+ readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
840
+ readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
841
+ readonly missing_scope: "The API key lacks the scope the operation needs.";
842
+ readonly role_forbidden: "The member's role does not allow the operation.";
843
+ readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
844
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
845
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
846
+ readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
847
+ readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
848
+ readonly overloaded: "The API is shedding load; retry after Retry-After.";
849
+ readonly payload_too_large: "The request body is larger than the API accepts.";
850
+ readonly internal_error: "An unexpected failure on our side.";
851
+ readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
852
+ readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
853
+ readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
854
+ }>>, {
855
+ account_disabled: {
856
+ status: 409;
857
+ message: string;
858
+ };
859
+ account_reauth_required: {
860
+ status: 409;
861
+ message: string;
862
+ };
863
+ sync_kinds_disabled: import("../errors.js").DeclaredError<"sync_kinds_disabled">;
864
+ account_not_found: {
865
+ status: 404;
866
+ message: string;
867
+ };
868
+ }>, Record<never, never>>;
869
+ mintToken: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
870
+ accountId: z.ZodUUID;
871
+ ttlSeconds: z.ZodDefault<z.ZodNumber>;
872
+ }, z.core.$strip>, z.ZodObject<{
873
+ token: z.ZodString;
874
+ expiresAt: z.ZodPreprocess<z.ZodDate, Date>;
875
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
876
+ readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
877
+ readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
878
+ readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
879
+ readonly missing_scope: "The API key lacks the scope the operation needs.";
880
+ readonly role_forbidden: "The member's role does not allow the operation.";
881
+ readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
882
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
883
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
884
+ readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
885
+ readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
886
+ readonly overloaded: "The API is shedding load; retry after Retry-After.";
887
+ readonly payload_too_large: "The request body is larger than the API accepts.";
888
+ readonly internal_error: "An unexpected failure on our side.";
889
+ readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
890
+ readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
891
+ readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
892
+ }>>, import("../errors.js").DeclaredErrors<{
893
+ readonly account_not_found: "The account does not exist, or the caller is an account token for another account.";
894
+ }>>, Record<never, never>>;
895
+ };
896
+ export declare const imapAccounts: {
897
+ create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
898
+ email: z.ZodEmail;
899
+ displayName: z.ZodOptional<z.ZodString>;
900
+ password: z.ZodString;
901
+ smtpPassword: z.ZodOptional<z.ZodString>;
902
+ imap: z.ZodOptional<z.ZodObject<{
903
+ host: z.ZodString;
904
+ port: z.ZodNumber;
905
+ security: z.ZodEnum<{
906
+ none: "none";
907
+ tls: "tls";
908
+ starttls: "starttls";
909
+ }>;
910
+ user: z.ZodOptional<z.ZodString>;
911
+ }, z.core.$strip>>;
912
+ smtp: z.ZodOptional<z.ZodNullable<z.ZodObject<{
913
+ host: z.ZodString;
914
+ port: z.ZodNumber;
915
+ security: z.ZodEnum<{
916
+ none: "none";
917
+ tls: "tls";
918
+ starttls: "starttls";
919
+ }>;
920
+ user: z.ZodOptional<z.ZodString>;
921
+ }, z.core.$strip>>>;
922
+ appendSent: z.ZodOptional<z.ZodBoolean>;
923
+ dav: z.ZodOptional<z.ZodObject<{
924
+ calendarUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
925
+ contactsUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
926
+ user: z.ZodOptional<z.ZodString>;
927
+ password: z.ZodOptional<z.ZodNullable<z.ZodString>>;
928
+ }, z.core.$strip>>;
929
+ externalRef: z.ZodOptional<z.ZodString>;
930
+ settings: z.ZodOptional<z.ZodObject<{
931
+ bodyStorage: z.ZodOptional<z.ZodEnum<{
932
+ none: "none";
933
+ cache: "cache";
934
+ full: "full";
935
+ }>>;
936
+ syncWindowDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
937
+ mailEnabled: z.ZodOptional<z.ZodBoolean>;
938
+ calendarEnabled: z.ZodOptional<z.ZodBoolean>;
939
+ contactsEnabled: z.ZodOptional<z.ZodBoolean>;
940
+ undoSendSeconds: z.ZodOptional<z.ZodNumber>;
941
+ trackOpens: z.ZodOptional<z.ZodBoolean>;
942
+ trackClicks: z.ZodOptional<z.ZodBoolean>;
943
+ trackingHoneypot: z.ZodOptional<z.ZodBoolean>;
944
+ suppressionCheck: z.ZodOptional<z.ZodEnum<{
945
+ lists: "lists";
946
+ always: "always";
947
+ }>>;
948
+ sendsPerMinute: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
949
+ }, z.core.$strip>>;
950
+ }, z.core.$strip>, z.ZodObject<{
951
+ id: z.ZodUUID;
952
+ externalRef: z.ZodNullable<z.ZodString>;
953
+ provider: z.ZodEnum<{
954
+ gmail: "gmail";
955
+ graph: "graph";
956
+ imap: "imap";
957
+ }>;
958
+ email: z.ZodString;
959
+ displayName: z.ZodNullable<z.ZodString>;
960
+ oauthAppId: z.ZodNullable<z.ZodUUID>;
961
+ cloud: z.ZodNullable<z.ZodEnum<{
962
+ global: "global";
963
+ "gcc-high": "gcc-high";
964
+ dod: "dod";
965
+ china: "china";
966
+ }>>;
967
+ status: z.ZodEnum<{
968
+ active: "active";
969
+ paused: "paused";
970
+ reauth_required: "reauth_required";
971
+ disabled: "disabled";
972
+ }>;
973
+ statusReason: z.ZodNullable<z.ZodString>;
974
+ settings: z.ZodObject<{
975
+ bodyStorage: z.ZodEnum<{
976
+ none: "none";
977
+ cache: "cache";
978
+ full: "full";
979
+ }>;
980
+ syncWindowDays: z.ZodNullable<z.ZodNumber>;
981
+ mailEnabled: z.ZodBoolean;
982
+ calendarEnabled: z.ZodBoolean;
983
+ contactsEnabled: z.ZodBoolean;
984
+ undoSendSeconds: z.ZodNumber;
985
+ trackOpens: z.ZodBoolean;
986
+ trackClicks: z.ZodBoolean;
987
+ trackingHoneypot: z.ZodBoolean;
988
+ suppressionCheck: z.ZodEnum<{
989
+ lists: "lists";
990
+ always: "always";
991
+ }>;
992
+ sendsPerMinute: z.ZodNullable<z.ZodNumber>;
993
+ }, z.core.$strip>;
994
+ settingsOverride: z.ZodObject<{
995
+ bodyStorage: z.ZodOptional<z.ZodEnum<{
996
+ none: "none";
997
+ cache: "cache";
998
+ full: "full";
999
+ }>>;
1000
+ syncWindowDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1001
+ mailEnabled: z.ZodOptional<z.ZodBoolean>;
1002
+ calendarEnabled: z.ZodOptional<z.ZodBoolean>;
1003
+ contactsEnabled: z.ZodOptional<z.ZodBoolean>;
1004
+ undoSendSeconds: z.ZodOptional<z.ZodNumber>;
1005
+ trackOpens: z.ZodOptional<z.ZodBoolean>;
1006
+ trackClicks: z.ZodOptional<z.ZodBoolean>;
1007
+ trackingHoneypot: z.ZodOptional<z.ZodBoolean>;
1008
+ suppressionCheck: z.ZodOptional<z.ZodEnum<{
1009
+ lists: "lists";
1010
+ always: "always";
1011
+ }>>;
1012
+ sendsPerMinute: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1013
+ }, z.core.$strip>;
1014
+ runtime: z.ZodNullable<z.ZodObject<{
1015
+ state: z.ZodEnum<{
1016
+ error: "error";
1017
+ pending: "pending";
1018
+ connecting: "connecting";
1019
+ connected: "connected";
1020
+ stopped: "stopped";
1021
+ }>;
1022
+ detail: z.ZodNullable<z.ZodString>;
1023
+ ownerInstanceId: z.ZodNullable<z.ZodUUID>;
1024
+ updatedAt: z.ZodPreprocess<z.ZodDate, Date>;
1025
+ }, z.core.$strip>>;
1026
+ imap: z.ZodNullable<z.ZodObject<{
1027
+ imap: z.ZodObject<{
1028
+ host: z.ZodString;
1029
+ port: z.ZodNumber;
1030
+ security: z.ZodEnum<{
1031
+ none: "none";
1032
+ tls: "tls";
1033
+ starttls: "starttls";
1034
+ }>;
1035
+ user: z.ZodString;
1036
+ }, z.core.$strip>;
1037
+ smtp: z.ZodNullable<z.ZodObject<{
1038
+ host: z.ZodString;
1039
+ port: z.ZodNumber;
1040
+ security: z.ZodEnum<{
1041
+ none: "none";
1042
+ tls: "tls";
1043
+ starttls: "starttls";
1044
+ }>;
1045
+ user: z.ZodString;
1046
+ }, z.core.$strip>>;
1047
+ auth: z.ZodEnum<{
1048
+ google: "google";
1049
+ microsoft: "microsoft";
1050
+ password: "password";
1051
+ }>;
1052
+ appendSent: z.ZodBoolean;
1053
+ dav: z.ZodNullable<z.ZodObject<{
1054
+ calendarUrl: z.ZodNullable<z.ZodString>;
1055
+ contactsUrl: z.ZodNullable<z.ZodString>;
1056
+ user: z.ZodString;
1057
+ auth: z.ZodEnum<{
1058
+ imap_password: "imap_password";
1059
+ dav_password: "dav_password";
1060
+ }>;
1061
+ }, z.core.$strip>>;
1062
+ }, z.core.$strip>>;
1063
+ auth: z.ZodObject<{
1064
+ method: z.ZodEnum<{
1065
+ password: "password";
1066
+ oauth: "oauth";
1067
+ google_delegation: "google_delegation";
1068
+ microsoft_app: "microsoft_app";
1069
+ shared_mailbox: "shared_mailbox";
1070
+ google_group: "google_group";
1071
+ }>;
1072
+ orgConnectionId: z.ZodNullable<z.ZodUUID>;
1073
+ delegateAccountId: z.ZodNullable<z.ZodUUID>;
1074
+ relayEmail: z.ZodNullable<z.ZodEmail>;
1075
+ }, z.core.$strip>;
1076
+ initializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
1077
+ calendarInitializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
1078
+ contactsInitializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
1079
+ createdAt: z.ZodPreprocess<z.ZodDate, Date>;
1080
+ updatedAt: z.ZodPreprocess<z.ZodDate, Date>;
1081
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
1082
+ readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
1083
+ readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
1084
+ readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
1085
+ readonly missing_scope: "The API key lacks the scope the operation needs.";
1086
+ readonly role_forbidden: "The member's role does not allow the operation.";
1087
+ readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
1088
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
1089
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
1090
+ readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
1091
+ readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
1092
+ readonly overloaded: "The API is shedding load; retry after Retry-After.";
1093
+ readonly payload_too_large: "The request body is larger than the API accepts.";
1094
+ readonly internal_error: "An unexpected failure on our side.";
1095
+ readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
1096
+ readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
1097
+ readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
1098
+ }>>, {
1099
+ plan_module_unavailable: {
1100
+ status: 403;
1101
+ message: string;
1102
+ };
1103
+ billing_past_due: {
1104
+ status: 402;
1105
+ message: string;
1106
+ };
1107
+ plan_limit_accounts: import("../errors.js").DeclaredError<"plan_limit_accounts">;
1108
+ plan_required: import("../errors.js").DeclaredError<"plan_required">;
1109
+ spend_cap_reached: import("../errors.js").DeclaredError<"spend_cap_reached">;
1110
+ plan_limit_storage: import("../errors.js").DeclaredError<"plan_limit_storage">;
1111
+ storage_unavailable: {
1112
+ status: 400;
1113
+ message: string;
1114
+ };
1115
+ provider_unavailable: {
1116
+ status: 502;
1117
+ message: string;
1118
+ };
1119
+ provider_throttled: {
1120
+ status: 429;
1121
+ message: string;
1122
+ };
1123
+ dav_discovery_failed: {
1124
+ status: 400;
1125
+ message: string;
1126
+ };
1127
+ not_dav_server: {
1128
+ status: 400;
1129
+ message: string;
1130
+ };
1131
+ autodiscovery_failed: {
1132
+ status: 422;
1133
+ message: string;
1134
+ };
1135
+ login_failed: {
1136
+ status: 400;
1137
+ message: string;
1138
+ };
1139
+ server_not_allowed: {
1140
+ status: 400;
1141
+ message: string;
1142
+ };
1143
+ plaintext_not_allowed: {
1144
+ status: 400;
1145
+ message: string;
1146
+ };
1147
+ }>, Record<never, never>>;
1148
+ };
1149
+ export declare const imapSettings: {
1150
+ update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
1151
+ accountId: z.ZodUUID;
1152
+ password: z.ZodOptional<z.ZodString>;
1153
+ smtpPassword: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1154
+ imap: z.ZodOptional<z.ZodObject<{
1155
+ host: z.ZodString;
1156
+ port: z.ZodNumber;
1157
+ security: z.ZodEnum<{
1158
+ none: "none";
1159
+ tls: "tls";
1160
+ starttls: "starttls";
1161
+ }>;
1162
+ user: z.ZodOptional<z.ZodString>;
1163
+ }, z.core.$strip>>;
1164
+ smtp: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1165
+ host: z.ZodString;
1166
+ port: z.ZodNumber;
1167
+ security: z.ZodEnum<{
1168
+ none: "none";
1169
+ tls: "tls";
1170
+ starttls: "starttls";
1171
+ }>;
1172
+ user: z.ZodOptional<z.ZodString>;
1173
+ }, z.core.$strip>>>;
1174
+ appendSent: z.ZodOptional<z.ZodBoolean>;
1175
+ dav: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1176
+ calendarUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
1177
+ contactsUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
1178
+ user: z.ZodOptional<z.ZodString>;
1179
+ password: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1180
+ }, z.core.$strip>>>;
1181
+ }, z.core.$strip>, z.ZodObject<{
1182
+ id: z.ZodUUID;
1183
+ externalRef: z.ZodNullable<z.ZodString>;
1184
+ provider: z.ZodEnum<{
1185
+ gmail: "gmail";
1186
+ graph: "graph";
1187
+ imap: "imap";
1188
+ }>;
1189
+ email: z.ZodString;
1190
+ displayName: z.ZodNullable<z.ZodString>;
1191
+ oauthAppId: z.ZodNullable<z.ZodUUID>;
1192
+ cloud: z.ZodNullable<z.ZodEnum<{
1193
+ global: "global";
1194
+ "gcc-high": "gcc-high";
1195
+ dod: "dod";
1196
+ china: "china";
1197
+ }>>;
1198
+ status: z.ZodEnum<{
1199
+ active: "active";
1200
+ paused: "paused";
1201
+ reauth_required: "reauth_required";
1202
+ disabled: "disabled";
1203
+ }>;
1204
+ statusReason: z.ZodNullable<z.ZodString>;
1205
+ settings: z.ZodObject<{
1206
+ bodyStorage: z.ZodEnum<{
1207
+ none: "none";
1208
+ cache: "cache";
1209
+ full: "full";
1210
+ }>;
1211
+ syncWindowDays: z.ZodNullable<z.ZodNumber>;
1212
+ mailEnabled: z.ZodBoolean;
1213
+ calendarEnabled: z.ZodBoolean;
1214
+ contactsEnabled: z.ZodBoolean;
1215
+ undoSendSeconds: z.ZodNumber;
1216
+ trackOpens: z.ZodBoolean;
1217
+ trackClicks: z.ZodBoolean;
1218
+ trackingHoneypot: z.ZodBoolean;
1219
+ suppressionCheck: z.ZodEnum<{
1220
+ lists: "lists";
1221
+ always: "always";
1222
+ }>;
1223
+ sendsPerMinute: z.ZodNullable<z.ZodNumber>;
1224
+ }, z.core.$strip>;
1225
+ settingsOverride: z.ZodObject<{
1226
+ bodyStorage: z.ZodOptional<z.ZodEnum<{
1227
+ none: "none";
1228
+ cache: "cache";
1229
+ full: "full";
1230
+ }>>;
1231
+ syncWindowDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1232
+ mailEnabled: z.ZodOptional<z.ZodBoolean>;
1233
+ calendarEnabled: z.ZodOptional<z.ZodBoolean>;
1234
+ contactsEnabled: z.ZodOptional<z.ZodBoolean>;
1235
+ undoSendSeconds: z.ZodOptional<z.ZodNumber>;
1236
+ trackOpens: z.ZodOptional<z.ZodBoolean>;
1237
+ trackClicks: z.ZodOptional<z.ZodBoolean>;
1238
+ trackingHoneypot: z.ZodOptional<z.ZodBoolean>;
1239
+ suppressionCheck: z.ZodOptional<z.ZodEnum<{
1240
+ lists: "lists";
1241
+ always: "always";
1242
+ }>>;
1243
+ sendsPerMinute: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1244
+ }, z.core.$strip>;
1245
+ runtime: z.ZodNullable<z.ZodObject<{
1246
+ state: z.ZodEnum<{
1247
+ error: "error";
1248
+ pending: "pending";
1249
+ connecting: "connecting";
1250
+ connected: "connected";
1251
+ stopped: "stopped";
1252
+ }>;
1253
+ detail: z.ZodNullable<z.ZodString>;
1254
+ ownerInstanceId: z.ZodNullable<z.ZodUUID>;
1255
+ updatedAt: z.ZodPreprocess<z.ZodDate, Date>;
1256
+ }, z.core.$strip>>;
1257
+ imap: z.ZodNullable<z.ZodObject<{
1258
+ imap: z.ZodObject<{
1259
+ host: z.ZodString;
1260
+ port: z.ZodNumber;
1261
+ security: z.ZodEnum<{
1262
+ none: "none";
1263
+ tls: "tls";
1264
+ starttls: "starttls";
1265
+ }>;
1266
+ user: z.ZodString;
1267
+ }, z.core.$strip>;
1268
+ smtp: z.ZodNullable<z.ZodObject<{
1269
+ host: z.ZodString;
1270
+ port: z.ZodNumber;
1271
+ security: z.ZodEnum<{
1272
+ none: "none";
1273
+ tls: "tls";
1274
+ starttls: "starttls";
1275
+ }>;
1276
+ user: z.ZodString;
1277
+ }, z.core.$strip>>;
1278
+ auth: z.ZodEnum<{
1279
+ google: "google";
1280
+ microsoft: "microsoft";
1281
+ password: "password";
1282
+ }>;
1283
+ appendSent: z.ZodBoolean;
1284
+ dav: z.ZodNullable<z.ZodObject<{
1285
+ calendarUrl: z.ZodNullable<z.ZodString>;
1286
+ contactsUrl: z.ZodNullable<z.ZodString>;
1287
+ user: z.ZodString;
1288
+ auth: z.ZodEnum<{
1289
+ imap_password: "imap_password";
1290
+ dav_password: "dav_password";
1291
+ }>;
1292
+ }, z.core.$strip>>;
1293
+ }, z.core.$strip>>;
1294
+ auth: z.ZodObject<{
1295
+ method: z.ZodEnum<{
1296
+ password: "password";
1297
+ oauth: "oauth";
1298
+ google_delegation: "google_delegation";
1299
+ microsoft_app: "microsoft_app";
1300
+ shared_mailbox: "shared_mailbox";
1301
+ google_group: "google_group";
1302
+ }>;
1303
+ orgConnectionId: z.ZodNullable<z.ZodUUID>;
1304
+ delegateAccountId: z.ZodNullable<z.ZodUUID>;
1305
+ relayEmail: z.ZodNullable<z.ZodEmail>;
1306
+ }, z.core.$strip>;
1307
+ initializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
1308
+ calendarInitializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
1309
+ contactsInitializedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
1310
+ createdAt: z.ZodPreprocess<z.ZodDate, Date>;
1311
+ updatedAt: z.ZodPreprocess<z.ZodDate, Date>;
1312
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
1313
+ readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
1314
+ readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
1315
+ readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
1316
+ readonly missing_scope: "The API key lacks the scope the operation needs.";
1317
+ readonly role_forbidden: "The member's role does not allow the operation.";
1318
+ readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
1319
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
1320
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
1321
+ readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
1322
+ readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
1323
+ readonly overloaded: "The API is shedding load; retry after Retry-After.";
1324
+ readonly payload_too_large: "The request body is larger than the API accepts.";
1325
+ readonly internal_error: "An unexpected failure on our side.";
1326
+ readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
1327
+ readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
1328
+ readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
1329
+ }>>, {
1330
+ provider_not_configured: {
1331
+ status: 400;
1332
+ message: string;
1333
+ };
1334
+ token_exchange_failed: {
1335
+ status: 400;
1336
+ message: string;
1337
+ };
1338
+ invalid_client: {
1339
+ status: 400;
1340
+ message: string;
1341
+ };
1342
+ credential_conflict: {
1343
+ status: 400;
1344
+ message: string;
1345
+ };
1346
+ credential_missing: {
1347
+ status: 400;
1348
+ message: string;
1349
+ };
1350
+ oauth_app_secret_unreadable: {
1351
+ status: 400;
1352
+ message: string;
1353
+ };
1354
+ account_reauth_required: {
1355
+ status: 409;
1356
+ message: string;
1357
+ };
1358
+ password_required: {
1359
+ status: 400;
1360
+ message: string;
1361
+ };
1362
+ oauth_servers_fixed: {
1363
+ status: 400;
1364
+ message: string;
1365
+ };
1366
+ dav_unsupported: {
1367
+ status: 400;
1368
+ message: string;
1369
+ };
1370
+ not_imap_account: {
1371
+ status: 400;
1372
+ message: string;
1373
+ };
1374
+ password_not_stored: {
1375
+ status: 400;
1376
+ message: string;
1377
+ };
1378
+ password_unsupported: {
1379
+ status: 400;
1380
+ message: string;
1381
+ };
1382
+ provider_unavailable: {
1383
+ status: 502;
1384
+ message: string;
1385
+ };
1386
+ provider_throttled: {
1387
+ status: 429;
1388
+ message: string;
1389
+ };
1390
+ dav_discovery_failed: {
1391
+ status: 400;
1392
+ message: string;
1393
+ };
1394
+ not_dav_server: {
1395
+ status: 400;
1396
+ message: string;
1397
+ };
1398
+ login_failed: {
1399
+ status: 400;
1400
+ message: string;
1401
+ };
1402
+ server_not_allowed: {
1403
+ status: 400;
1404
+ message: string;
1405
+ };
1406
+ plaintext_not_allowed: {
1407
+ status: 400;
1408
+ message: string;
1409
+ };
1410
+ account_not_found: {
1411
+ status: 404;
1412
+ message: string;
1413
+ };
1414
+ }>, Record<never, never>>;
1415
+ };
1416
+ export declare const autoconfig: {
1417
+ lookup: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
1418
+ email: z.ZodEmail;
1419
+ }, z.core.$strip>, z.ZodObject<{
1420
+ source: z.ZodEnum<{
1421
+ provider: "provider";
1422
+ srv: "srv";
1423
+ autoconfig: "autoconfig";
1424
+ ispdb: "ispdb";
1425
+ mx: "mx";
1426
+ }>;
1427
+ imap: z.ZodObject<{
1428
+ host: z.ZodString;
1429
+ port: z.ZodNumber;
1430
+ security: z.ZodEnum<{
1431
+ none: "none";
1432
+ tls: "tls";
1433
+ starttls: "starttls";
1434
+ }>;
1435
+ user: z.ZodString;
1436
+ }, z.core.$strip>;
1437
+ smtp: z.ZodNullable<z.ZodObject<{
1438
+ host: z.ZodString;
1439
+ port: z.ZodNumber;
1440
+ security: z.ZodEnum<{
1441
+ none: "none";
1442
+ tls: "tls";
1443
+ starttls: "starttls";
1444
+ }>;
1445
+ user: z.ZodString;
1446
+ }, z.core.$strip>>;
1447
+ oauth: z.ZodNullable<z.ZodEnum<{
1448
+ google: "google";
1449
+ microsoft: "microsoft";
1450
+ }>>;
1451
+ dav: z.ZodNullable<z.ZodObject<{
1452
+ source: z.ZodEnum<{
1453
+ provider: "provider";
1454
+ "well-known": "well-known";
1455
+ srv: "srv";
1456
+ }>;
1457
+ calendarUrl: z.ZodNullable<z.ZodString>;
1458
+ contactsUrl: z.ZodNullable<z.ZodString>;
1459
+ }, z.core.$strip>>;
1460
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
1461
+ readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
1462
+ readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
1463
+ readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
1464
+ readonly missing_scope: "The API key lacks the scope the operation needs.";
1465
+ readonly role_forbidden: "The member's role does not allow the operation.";
1466
+ readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
1467
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
1468
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
1469
+ readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
1470
+ readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
1471
+ readonly overloaded: "The API is shedding load; retry after Retry-After.";
1472
+ readonly payload_too_large: "The request body is larger than the API accepts.";
1473
+ readonly internal_error: "An unexpected failure on our side.";
1474
+ readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
1475
+ readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
1476
+ readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
1477
+ }>>, import("../errors.js").DeclaredErrors<{
1478
+ readonly autodiscovery_failed: "No IMAP settings were found for the address; ask the user for the servers then.";
1479
+ }>>, Record<never, never>>;
1480
+ };