@workwae/sdk 0.1.0-alpha.1 → 0.1.0-alpha.3

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 (64) hide show
  1. package/README.md +7 -7
  2. package/client.d.ts +1 -1
  3. package/contract/accounts/models.d.ts +85 -45
  4. package/contract/accounts/routes.d.ts +191 -29
  5. package/contract/ai/models.d.ts +0 -1
  6. package/contract/ai/routes.d.ts +9 -0
  7. package/contract/audit-log/models.d.ts +22 -5
  8. package/contract/audit-log/routes.d.ts +11 -1
  9. package/contract/calendar/models.d.ts +249 -74
  10. package/contract/calendar/routes.d.ts +574 -30
  11. package/contract/connect/models.d.ts +30 -16
  12. package/contract/connect/routes.d.ts +51 -7
  13. package/contract/connect-domain/models.d.ts +41 -0
  14. package/contract/connect-domain/routes.d.ts +197 -0
  15. package/contract/contacts/models.d.ts +0 -10
  16. package/contract/contacts/routes.d.ts +14 -0
  17. package/contract/custom-domain.d.ts +12 -0
  18. package/contract/email-validation/models.d.ts +119 -0
  19. package/contract/email-validation/routes.d.ts +106 -0
  20. package/contract/errors.d.ts +28 -20
  21. package/contract/events/models.d.ts +139 -79
  22. package/contract/events/routes.d.ts +54 -44
  23. package/contract/exports/routes.d.ts +10 -0
  24. package/contract/identities/models.d.ts +7 -9
  25. package/contract/identities/routes.d.ts +79 -10
  26. package/contract/limits.d.ts +27 -73
  27. package/contract/mail/models.d.ts +230 -50
  28. package/contract/mail/routes.d.ts +649 -59
  29. package/contract/mcp-keys/models.d.ts +125 -0
  30. package/contract/mcp-keys/routes.d.ts +151 -0
  31. package/contract/meetings/models.d.ts +39 -33
  32. package/contract/meetings/routes.d.ts +121 -23
  33. package/contract/oauth-apps/models.d.ts +6 -6
  34. package/contract/oauth-apps/routes.d.ts +34 -4
  35. package/contract/org-connections/models.d.ts +93 -39
  36. package/contract/org-connections/routes.d.ts +352 -43
  37. package/contract/plans/credit-packs.d.ts +30 -0
  38. package/contract/plans/models.d.ts +208 -0
  39. package/contract/primitives.d.ts +7 -62
  40. package/contract/public.d.ts +7 -0
  41. package/contract/reasons.d.ts +559 -21
  42. package/contract/router.d.ts +6447 -2719
  43. package/contract/scheduling/models.d.ts +405 -0
  44. package/contract/scheduling/routes.d.ts +756 -0
  45. package/contract/send/models.d.ts +140 -45
  46. package/contract/send/routes.d.ts +310 -31
  47. package/contract/settings/models.d.ts +73 -13
  48. package/contract/settings/routes.d.ts +56 -4
  49. package/contract/suppressions/models.d.ts +21 -28
  50. package/contract/suppressions/routes.d.ts +62 -14
  51. package/contract/templates/models.d.ts +0 -14
  52. package/contract/templates/routes.d.ts +30 -6
  53. package/contract/threads/models.d.ts +0 -5
  54. package/contract/threads/routes.d.ts +40 -0
  55. package/contract/tracking-domain/models.d.ts +41 -0
  56. package/contract/tracking-domain/routes.d.ts +193 -0
  57. package/contract/usage/models.d.ts +98 -126
  58. package/contract/usage/routes.d.ts +48 -20
  59. package/contract/webhooks/models.d.ts +45 -30
  60. package/contract/webhooks/routes.d.ts +52 -9
  61. package/contract/webhooks/signing.d.ts +0 -16
  62. package/index.js +1 -4334
  63. package/package.json +6 -7
  64. package/index.js.map +0 -59
@@ -1,9 +1,7 @@
1
1
  import * as z from "zod";
2
- /** A mailboxId (or addMailboxIds, removeMailboxIds) the account does not have. */
3
2
  export declare const UNKNOWN_MAILBOX: import("../errors.js").DeclaredErrors<{
4
3
  readonly unknown_mailbox: "A mailbox id names no live mailbox of the account; data.ids lists them.";
5
4
  }>;
6
- /** What a change made at the provider answers when the provider refuses it. */
7
5
  export declare const PROVIDER_CHANGE: {
8
6
  provider_not_found: {
9
7
  status: 404;
@@ -45,13 +43,13 @@ export declare const mailboxes: {
45
43
  parentId: z.ZodNullable<z.ZodUUID>;
46
44
  role: z.ZodEnum<{
47
45
  custom: "custom";
46
+ all: "all";
48
47
  inbox: "inbox";
49
48
  sent: "sent";
50
49
  drafts: "drafts";
51
50
  trash: "trash";
52
51
  junk: "junk";
53
52
  archive: "archive";
54
- all: "all";
55
53
  important: "important";
56
54
  }>;
57
55
  kind: z.ZodEnum<{
@@ -68,6 +66,8 @@ export declare const mailboxes: {
68
66
  readonly missing_scope: "The API key lacks the scope the operation needs.";
69
67
  readonly role_forbidden: "The member's role does not allow the operation.";
70
68
  readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
69
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
70
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
71
71
  readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
72
72
  readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
73
73
  readonly overloaded: "The API is shedding load; retry after Retry-After.";
@@ -76,72 +76,518 @@ export declare const mailboxes: {
76
76
  readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
77
77
  readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
78
78
  readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
79
- }>>, import("../errors.js").DeclaredErrors<{
80
- readonly account_not_found: "The account does not exist, or the caller is an account token for another account.";
81
- }>>, Record<never, never>>;
79
+ }>>, {
80
+ mail_disabled: {
81
+ status: 409;
82
+ message: string;
83
+ };
84
+ account_not_found: {
85
+ status: 404;
86
+ message: string;
87
+ };
88
+ plan_module_unavailable: {
89
+ status: 403;
90
+ message: string;
91
+ };
92
+ }>, Record<never, never>>;
93
+ create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
94
+ accountId: z.ZodUUID;
95
+ name: z.ZodString;
96
+ parentId: z.ZodOptional<z.ZodUUID>;
97
+ }, z.core.$strip>, z.ZodObject<{
98
+ id: z.ZodUUID;
99
+ name: z.ZodString;
100
+ path: z.ZodString;
101
+ parentId: z.ZodNullable<z.ZodUUID>;
102
+ role: z.ZodEnum<{
103
+ custom: "custom";
104
+ all: "all";
105
+ inbox: "inbox";
106
+ sent: "sent";
107
+ drafts: "drafts";
108
+ trash: "trash";
109
+ junk: "junk";
110
+ archive: "archive";
111
+ important: "important";
112
+ }>;
113
+ kind: z.ZodEnum<{
114
+ label: "label";
115
+ folder: "folder";
116
+ }>;
117
+ totalCount: z.ZodNullable<z.ZodNumber>;
118
+ unreadCount: z.ZodNullable<z.ZodNumber>;
119
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
120
+ readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
121
+ readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
122
+ readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
123
+ readonly missing_scope: "The API key lacks the scope the operation needs.";
124
+ readonly role_forbidden: "The member's role does not allow the operation.";
125
+ readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
126
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
127
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
128
+ readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
129
+ readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
130
+ readonly overloaded: "The API is shedding load; retry after Retry-After.";
131
+ readonly payload_too_large: "The request body is larger than the API accepts.";
132
+ readonly internal_error: "An unexpected failure on our side.";
133
+ readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
134
+ readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
135
+ readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
136
+ }>>, {
137
+ provider_not_found: {
138
+ status: 404;
139
+ message: string;
140
+ };
141
+ provider_forbidden: {
142
+ status: 403;
143
+ message: string;
144
+ };
145
+ provider_conflict: {
146
+ status: 409;
147
+ message: string;
148
+ };
149
+ provider_unsupported: {
150
+ status: 400;
151
+ message: string;
152
+ };
153
+ provider_rejected: {
154
+ status: 400;
155
+ message: string;
156
+ };
157
+ provider_unavailable: {
158
+ status: 502;
159
+ message: string;
160
+ };
161
+ provider_throttled: {
162
+ status: 429;
163
+ message: string;
164
+ };
165
+ account_paused: {
166
+ status: 409;
167
+ message: string;
168
+ };
169
+ account_disabled: {
170
+ status: 409;
171
+ message: string;
172
+ };
173
+ account_reauth_required: {
174
+ status: 409;
175
+ message: string;
176
+ };
177
+ account_misconfigured: {
178
+ status: 409;
179
+ message: string;
180
+ };
181
+ group_unsupported: {
182
+ status: 400;
183
+ message: string;
184
+ };
185
+ unknown_mailbox: import("../errors.js").DeclaredError<"unknown_mailbox">;
186
+ mail_disabled: {
187
+ status: 409;
188
+ message: string;
189
+ };
190
+ account_not_found: {
191
+ status: 404;
192
+ message: string;
193
+ };
194
+ plan_module_unavailable: {
195
+ status: 403;
196
+ message: string;
197
+ };
198
+ }>, Record<never, never>>;
199
+ update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
200
+ accountId: z.ZodUUID;
201
+ mailboxId: z.ZodUUID;
202
+ name: z.ZodOptional<z.ZodString>;
203
+ parentId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
204
+ }, z.core.$strip>, z.ZodObject<{
205
+ id: z.ZodUUID;
206
+ name: z.ZodString;
207
+ path: z.ZodString;
208
+ parentId: z.ZodNullable<z.ZodUUID>;
209
+ role: z.ZodEnum<{
210
+ custom: "custom";
211
+ all: "all";
212
+ inbox: "inbox";
213
+ sent: "sent";
214
+ drafts: "drafts";
215
+ trash: "trash";
216
+ junk: "junk";
217
+ archive: "archive";
218
+ important: "important";
219
+ }>;
220
+ kind: z.ZodEnum<{
221
+ label: "label";
222
+ folder: "folder";
223
+ }>;
224
+ totalCount: z.ZodNullable<z.ZodNumber>;
225
+ unreadCount: z.ZodNullable<z.ZodNumber>;
226
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
227
+ readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
228
+ readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
229
+ readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
230
+ readonly missing_scope: "The API key lacks the scope the operation needs.";
231
+ readonly role_forbidden: "The member's role does not allow the operation.";
232
+ readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
233
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
234
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
235
+ readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
236
+ readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
237
+ readonly overloaded: "The API is shedding load; retry after Retry-After.";
238
+ readonly payload_too_large: "The request body is larger than the API accepts.";
239
+ readonly internal_error: "An unexpected failure on our side.";
240
+ readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
241
+ readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
242
+ readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
243
+ }>>, {
244
+ provider_not_found: {
245
+ status: 404;
246
+ message: string;
247
+ };
248
+ provider_forbidden: {
249
+ status: 403;
250
+ message: string;
251
+ };
252
+ provider_conflict: {
253
+ status: 409;
254
+ message: string;
255
+ };
256
+ provider_unsupported: {
257
+ status: 400;
258
+ message: string;
259
+ };
260
+ provider_rejected: {
261
+ status: 400;
262
+ message: string;
263
+ };
264
+ provider_unavailable: {
265
+ status: 502;
266
+ message: string;
267
+ };
268
+ provider_throttled: {
269
+ status: 429;
270
+ message: string;
271
+ };
272
+ account_paused: {
273
+ status: 409;
274
+ message: string;
275
+ };
276
+ account_disabled: {
277
+ status: 409;
278
+ message: string;
279
+ };
280
+ account_reauth_required: {
281
+ status: 409;
282
+ message: string;
283
+ };
284
+ account_misconfigured: {
285
+ status: 409;
286
+ message: string;
287
+ };
288
+ mailbox_protected: {
289
+ status: 409;
290
+ message: string;
291
+ };
292
+ mailbox_parent: {
293
+ status: 400;
294
+ message: string;
295
+ };
296
+ group_unsupported: {
297
+ status: 400;
298
+ message: string;
299
+ };
300
+ unknown_mailbox: import("../errors.js").DeclaredError<"unknown_mailbox">;
301
+ mail_disabled: {
302
+ status: 409;
303
+ message: string;
304
+ };
305
+ account_not_found: {
306
+ status: 404;
307
+ message: string;
308
+ };
309
+ plan_module_unavailable: {
310
+ status: 403;
311
+ message: string;
312
+ };
313
+ }>, Record<never, never>>;
314
+ delete: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
315
+ accountId: z.ZodUUID;
316
+ mailboxId: z.ZodUUID;
317
+ }, z.core.$strip>, z.ZodVoid, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
318
+ readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
319
+ readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
320
+ readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
321
+ readonly missing_scope: "The API key lacks the scope the operation needs.";
322
+ readonly role_forbidden: "The member's role does not allow the operation.";
323
+ readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
324
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
325
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
326
+ readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
327
+ readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
328
+ readonly overloaded: "The API is shedding load; retry after Retry-After.";
329
+ readonly payload_too_large: "The request body is larger than the API accepts.";
330
+ readonly internal_error: "An unexpected failure on our side.";
331
+ readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
332
+ readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
333
+ readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
334
+ }>>, {
335
+ provider_not_found: {
336
+ status: 404;
337
+ message: string;
338
+ };
339
+ provider_forbidden: {
340
+ status: 403;
341
+ message: string;
342
+ };
343
+ provider_conflict: {
344
+ status: 409;
345
+ message: string;
346
+ };
347
+ provider_unsupported: {
348
+ status: 400;
349
+ message: string;
350
+ };
351
+ provider_rejected: {
352
+ status: 400;
353
+ message: string;
354
+ };
355
+ provider_unavailable: {
356
+ status: 502;
357
+ message: string;
358
+ };
359
+ provider_throttled: {
360
+ status: 429;
361
+ message: string;
362
+ };
363
+ account_paused: {
364
+ status: 409;
365
+ message: string;
366
+ };
367
+ account_disabled: {
368
+ status: 409;
369
+ message: string;
370
+ };
371
+ account_reauth_required: {
372
+ status: 409;
373
+ message: string;
374
+ };
375
+ account_misconfigured: {
376
+ status: 409;
377
+ message: string;
378
+ };
379
+ unknown_mailbox: import("../errors.js").DeclaredError<"unknown_mailbox">;
380
+ mailbox_protected: {
381
+ status: 409;
382
+ message: string;
383
+ };
384
+ group_unsupported: {
385
+ status: 400;
386
+ message: string;
387
+ };
388
+ mail_disabled: {
389
+ status: 409;
390
+ message: string;
391
+ };
392
+ account_not_found: {
393
+ status: 404;
394
+ message: string;
395
+ };
396
+ plan_module_unavailable: {
397
+ status: 403;
398
+ message: string;
399
+ };
400
+ }>, Record<never, never>>;
82
401
  };
83
402
  export declare const messages: {
84
403
  list: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
85
404
  accountId: z.ZodUUID;
86
- limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
87
- cursor: z.ZodOptional<z.ZodString>;
88
- mailboxId: z.ZodOptional<z.ZodUUID>;
89
- unread: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodEnum<{
90
- true: "true";
91
- false: "false";
92
- }>]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
93
405
  importance: z.ZodOptional<z.ZodEnum<{
94
406
  normal: "normal";
95
407
  high: "high";
96
408
  low: "low";
97
409
  }>>;
98
- }, z.core.$strip>, z.ZodObject<{
99
- items: z.ZodArray<z.ZodObject<{
100
- id: z.ZodUUID;
101
- threadId: z.ZodNullable<z.ZodString>;
102
- internetMessageId: z.ZodNullable<z.ZodString>;
103
- mailboxIds: z.ZodArray<z.ZodUUID>;
104
- subject: z.ZodNullable<z.ZodString>;
105
- from: z.ZodNullable<z.ZodObject<{
106
- name: z.ZodNullable<z.ZodString>;
107
- address: z.ZodString;
108
- }, z.core.$strip>>;
109
- to: z.ZodArray<z.ZodObject<{
110
- name: z.ZodNullable<z.ZodString>;
111
- address: z.ZodString;
410
+ outboxId: z.ZodOptional<z.ZodUUID>;
411
+ internetMessageId: z.ZodOptional<z.ZodString>;
412
+ after: z.ZodOptional<z.ZodPreprocess<z.ZodDate, string | Date>>;
413
+ before: z.ZodOptional<z.ZodPreprocess<z.ZodDate, string | Date>>;
414
+ include: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [
415
+ z.ZodString,
416
+ z.ZodArray<z.ZodEnum<{
417
+ headers: "headers";
418
+ body: "body";
419
+ }>>
420
+ ]>, z.ZodTransform<string[], string | ("headers" | "body")[]>>, z.ZodArray<z.ZodEnum<{
421
+ headers: "headers";
422
+ body: "body";
423
+ }>>>>;
424
+ limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
425
+ cursor: z.ZodOptional<z.ZodString>;
426
+ from: z.ZodOptional<z.ZodString>;
427
+ to: z.ZodOptional<z.ZodString>;
428
+ unread: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [
429
+ z.ZodBoolean,
430
+ z.ZodEnum<{
431
+ true: "true";
432
+ false: "false";
433
+ }>
434
+ ]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
435
+ flagged: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [
436
+ z.ZodBoolean,
437
+ z.ZodEnum<{
438
+ true: "true";
439
+ false: "false";
440
+ }>
441
+ ]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
442
+ hasAttachments: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [
443
+ z.ZodBoolean,
444
+ z.ZodEnum<{
445
+ true: "true";
446
+ false: "false";
447
+ }>
448
+ ]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
449
+ mailboxId: z.ZodOptional<z.ZodUUID>;
450
+ }, z.core.$strip>, z.ZodUnion<readonly [
451
+ z.ZodObject<{
452
+ items: z.ZodArray<z.ZodObject<{
453
+ id: z.ZodUUID;
454
+ threadId: z.ZodNullable<z.ZodString>;
455
+ internetMessageId: z.ZodNullable<z.ZodString>;
456
+ mailboxIds: z.ZodArray<z.ZodUUID>;
457
+ subject: z.ZodNullable<z.ZodString>;
458
+ from: z.ZodNullable<z.ZodObject<{
459
+ name: z.ZodNullable<z.ZodString>;
460
+ address: z.ZodString;
461
+ }, z.core.$strip>>;
462
+ to: z.ZodArray<z.ZodObject<{
463
+ name: z.ZodNullable<z.ZodString>;
464
+ address: z.ZodString;
465
+ }, z.core.$strip>>;
466
+ cc: z.ZodArray<z.ZodObject<{
467
+ name: z.ZodNullable<z.ZodString>;
468
+ address: z.ZodString;
469
+ }, z.core.$strip>>;
470
+ snippet: z.ZodNullable<z.ZodString>;
471
+ receivedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
472
+ sentAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
473
+ isRead: z.ZodBoolean;
474
+ isFlagged: z.ZodBoolean;
475
+ isDraft: z.ZodBoolean;
476
+ hasAttachments: z.ZodBoolean;
477
+ categories: z.ZodArray<z.ZodString>;
478
+ direction: z.ZodEnum<{
479
+ inbound: "inbound";
480
+ outbound: "outbound";
481
+ }>;
482
+ outboxId: z.ZodNullable<z.ZodUUID>;
483
+ reference: z.ZodNullable<z.ZodString>;
484
+ importance: z.ZodNullable<z.ZodEnum<{
485
+ normal: "normal";
486
+ high: "high";
487
+ low: "low";
488
+ }>>;
489
+ bcc: z.ZodArray<z.ZodObject<{
490
+ name: z.ZodNullable<z.ZodString>;
491
+ address: z.ZodString;
492
+ }, z.core.$strip>>;
493
+ replyTo: z.ZodArray<z.ZodObject<{
494
+ name: z.ZodNullable<z.ZodString>;
495
+ address: z.ZodString;
496
+ }, z.core.$strip>>;
497
+ body: z.ZodObject<{
498
+ text: z.ZodNullable<z.ZodString>;
499
+ html: z.ZodNullable<z.ZodString>;
500
+ }, z.core.$strip>;
501
+ attachments: z.ZodArray<z.ZodObject<{
502
+ id: z.ZodString;
503
+ filename: z.ZodNullable<z.ZodString>;
504
+ contentType: z.ZodString;
505
+ size: z.ZodNullable<z.ZodNumber>;
506
+ isInline: z.ZodBoolean;
507
+ contentId: z.ZodNullable<z.ZodString>;
508
+ }, z.core.$strip>>;
509
+ classification: z.ZodNullable<z.ZodObject<{
510
+ kind: z.ZodEnum<{
511
+ opt_out: "opt_out";
512
+ auto_reply: "auto_reply";
513
+ bounce: "bounce";
514
+ human_reply: "human_reply";
515
+ }>;
516
+ probabilities: z.ZodRecord<z.ZodString, z.ZodNumber>;
517
+ optOutProbability: z.ZodNumber;
518
+ autoReplyCategory: z.ZodNullable<z.ZodEnum<{
519
+ other: "other";
520
+ out_of_office: "out_of_office";
521
+ left_company: "left_company";
522
+ address_changed: "address_changed";
523
+ ticket_acknowledgment: "ticket_acknowledgment";
524
+ challenge_response: "challenge_response";
525
+ }>>;
526
+ returnDate: z.ZodNullable<z.ZodISODate>;
527
+ alternateContacts: z.ZodArray<z.ZodString>;
528
+ outboxId: z.ZodNullable<z.ZodUUID>;
529
+ model: z.ZodString;
530
+ classifiedAt: z.ZodPreprocess<z.ZodDate, Date>;
531
+ }, z.core.$strip>>;
532
+ inReplyTo: z.ZodNullable<z.ZodString>;
533
+ references: z.ZodArray<z.ZodString>;
534
+ headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
535
+ name: z.ZodString;
536
+ value: z.ZodString;
537
+ }, z.core.$strip>>>;
112
538
  }, z.core.$strip>>;
113
- cc: z.ZodArray<z.ZodObject<{
114
- name: z.ZodNullable<z.ZodString>;
115
- address: z.ZodString;
539
+ nextCursor: z.ZodNullable<z.ZodString>;
540
+ }, z.core.$strip>,
541
+ z.ZodObject<{
542
+ items: z.ZodArray<z.ZodObject<{
543
+ id: z.ZodUUID;
544
+ threadId: z.ZodNullable<z.ZodString>;
545
+ internetMessageId: z.ZodNullable<z.ZodString>;
546
+ mailboxIds: z.ZodArray<z.ZodUUID>;
547
+ subject: z.ZodNullable<z.ZodString>;
548
+ from: z.ZodNullable<z.ZodObject<{
549
+ name: z.ZodNullable<z.ZodString>;
550
+ address: z.ZodString;
551
+ }, z.core.$strip>>;
552
+ to: z.ZodArray<z.ZodObject<{
553
+ name: z.ZodNullable<z.ZodString>;
554
+ address: z.ZodString;
555
+ }, z.core.$strip>>;
556
+ cc: z.ZodArray<z.ZodObject<{
557
+ name: z.ZodNullable<z.ZodString>;
558
+ address: z.ZodString;
559
+ }, z.core.$strip>>;
560
+ snippet: z.ZodNullable<z.ZodString>;
561
+ receivedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
562
+ sentAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
563
+ isRead: z.ZodBoolean;
564
+ isFlagged: z.ZodBoolean;
565
+ isDraft: z.ZodBoolean;
566
+ hasAttachments: z.ZodBoolean;
567
+ categories: z.ZodArray<z.ZodString>;
568
+ direction: z.ZodEnum<{
569
+ inbound: "inbound";
570
+ outbound: "outbound";
571
+ }>;
572
+ outboxId: z.ZodNullable<z.ZodUUID>;
573
+ reference: z.ZodNullable<z.ZodString>;
574
+ importance: z.ZodNullable<z.ZodEnum<{
575
+ normal: "normal";
576
+ high: "high";
577
+ low: "low";
578
+ }>>;
116
579
  }, z.core.$strip>>;
117
- snippet: z.ZodNullable<z.ZodString>;
118
- receivedAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
119
- sentAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
120
- isRead: z.ZodBoolean;
121
- isFlagged: z.ZodBoolean;
122
- isDraft: z.ZodBoolean;
123
- hasAttachments: z.ZodBoolean;
124
- categories: z.ZodArray<z.ZodString>;
125
- direction: z.ZodEnum<{
126
- inbound: "inbound";
127
- outbound: "outbound";
128
- }>;
129
- outboxId: z.ZodNullable<z.ZodUUID>;
130
- reference: z.ZodNullable<z.ZodString>;
131
- importance: z.ZodNullable<z.ZodEnum<{
132
- normal: "normal";
133
- high: "high";
134
- low: "low";
135
- }>>;
136
- }, z.core.$strip>>;
137
- nextCursor: z.ZodNullable<z.ZodString>;
138
- }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
580
+ nextCursor: z.ZodNullable<z.ZodString>;
581
+ }, z.core.$strip>
582
+ ]>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
139
583
  readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
140
584
  readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
141
585
  readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
142
586
  readonly missing_scope: "The API key lacks the scope the operation needs.";
143
587
  readonly role_forbidden: "The member's role does not allow the operation.";
144
588
  readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
589
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
590
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
145
591
  readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
146
592
  readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
147
593
  readonly overloaded: "The API is shedding load; retry after Retry-After.";
@@ -151,19 +597,71 @@ export declare const messages: {
151
597
  readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
152
598
  readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
153
599
  }>>, {
600
+ invalid_range: {
601
+ status: 400;
602
+ message: string;
603
+ };
604
+ provider_not_found: {
605
+ status: 404;
606
+ message: string;
607
+ };
608
+ provider_forbidden: {
609
+ status: 403;
610
+ message: string;
611
+ };
612
+ provider_unavailable: {
613
+ status: 502;
614
+ message: string;
615
+ };
616
+ provider_throttled: {
617
+ status: 429;
618
+ message: string;
619
+ };
620
+ account_paused: {
621
+ status: 409;
622
+ message: string;
623
+ };
624
+ account_disabled: {
625
+ status: 409;
626
+ message: string;
627
+ };
628
+ account_reauth_required: {
629
+ status: 409;
630
+ message: string;
631
+ };
632
+ account_misconfigured: {
633
+ status: 409;
634
+ message: string;
635
+ };
154
636
  unknown_mailbox: import("../errors.js").DeclaredError<"unknown_mailbox">;
155
637
  invalid_cursor: {
156
638
  status: 400;
157
639
  message: string;
158
640
  };
641
+ mail_disabled: {
642
+ status: 409;
643
+ message: string;
644
+ };
159
645
  account_not_found: {
160
646
  status: 404;
161
647
  message: string;
162
648
  };
649
+ plan_module_unavailable: {
650
+ status: 403;
651
+ message: string;
652
+ };
163
653
  }>, Record<never, never>>;
164
654
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
165
655
  accountId: z.ZodUUID;
166
656
  messageId: z.ZodUUID;
657
+ include: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [
658
+ z.ZodString,
659
+ z.ZodArray<z.ZodEnum<{
660
+ headers: "headers";
661
+ }>>
662
+ ]>, z.ZodTransform<string[], string | "headers"[]>>, z.ZodArray<z.ZodEnum<{
663
+ headers: "headers";
664
+ }>>>>;
167
665
  }, z.core.$strip>, z.ZodObject<{
168
666
  id: z.ZodUUID;
169
667
  threadId: z.ZodNullable<z.ZodString>;
@@ -244,6 +742,12 @@ export declare const messages: {
244
742
  model: z.ZodString;
245
743
  classifiedAt: z.ZodPreprocess<z.ZodDate, Date>;
246
744
  }, z.core.$strip>>;
745
+ inReplyTo: z.ZodNullable<z.ZodString>;
746
+ references: z.ZodArray<z.ZodString>;
747
+ headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
748
+ name: z.ZodString;
749
+ value: z.ZodString;
750
+ }, z.core.$strip>>>;
247
751
  }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
248
752
  readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
249
753
  readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
@@ -251,6 +755,8 @@ export declare const messages: {
251
755
  readonly missing_scope: "The API key lacks the scope the operation needs.";
252
756
  readonly role_forbidden: "The member's role does not allow the operation.";
253
757
  readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
758
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
759
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
254
760
  readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
255
761
  readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
256
762
  readonly overloaded: "The API is shedding load; retry after Retry-After.";
@@ -296,10 +802,18 @@ export declare const messages: {
296
802
  status: 404;
297
803
  message: string;
298
804
  };
805
+ mail_disabled: {
806
+ status: 409;
807
+ message: string;
808
+ };
299
809
  account_not_found: {
300
810
  status: 404;
301
811
  message: string;
302
812
  };
813
+ plan_module_unavailable: {
814
+ status: 403;
815
+ message: string;
816
+ };
303
817
  }>, Record<never, never>>;
304
818
  raw: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
305
819
  accountId: z.ZodUUID;
@@ -311,6 +825,8 @@ export declare const messages: {
311
825
  readonly missing_scope: "The API key lacks the scope the operation needs.";
312
826
  readonly role_forbidden: "The member's role does not allow the operation.";
313
827
  readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
828
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
829
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
314
830
  readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
315
831
  readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
316
832
  readonly overloaded: "The API is shedding load; retry after Retry-After.";
@@ -356,10 +872,18 @@ export declare const messages: {
356
872
  status: 404;
357
873
  message: string;
358
874
  };
875
+ mail_disabled: {
876
+ status: 409;
877
+ message: string;
878
+ };
359
879
  account_not_found: {
360
880
  status: 404;
361
881
  message: string;
362
882
  };
883
+ plan_module_unavailable: {
884
+ status: 403;
885
+ message: string;
886
+ };
363
887
  }>, Record<never, never>>;
364
888
  attachment: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
365
889
  accountId: z.ZodUUID;
@@ -372,6 +896,8 @@ export declare const messages: {
372
896
  readonly missing_scope: "The API key lacks the scope the operation needs.";
373
897
  readonly role_forbidden: "The member's role does not allow the operation.";
374
898
  readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
899
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
900
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
375
901
  readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
376
902
  readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
377
903
  readonly overloaded: "The API is shedding load; retry after Retry-After.";
@@ -417,10 +943,18 @@ export declare const messages: {
417
943
  status: 404;
418
944
  message: string;
419
945
  };
946
+ mail_disabled: {
947
+ status: 409;
948
+ message: string;
949
+ };
420
950
  account_not_found: {
421
951
  status: 404;
422
952
  message: string;
423
953
  };
954
+ plan_module_unavailable: {
955
+ status: 403;
956
+ message: string;
957
+ };
424
958
  }>, Record<never, never>>;
425
959
  update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
426
960
  accountId: z.ZodUUID;
@@ -474,6 +1008,8 @@ export declare const messages: {
474
1008
  readonly missing_scope: "The API key lacks the scope the operation needs.";
475
1009
  readonly role_forbidden: "The member's role does not allow the operation.";
476
1010
  readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
1011
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
1012
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
477
1013
  readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
478
1014
  readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
479
1015
  readonly overloaded: "The API is shedding load; retry after Retry-After.";
@@ -536,10 +1072,18 @@ export declare const messages: {
536
1072
  status: 400;
537
1073
  message: string;
538
1074
  };
1075
+ mail_disabled: {
1076
+ status: 409;
1077
+ message: string;
1078
+ };
539
1079
  account_not_found: {
540
1080
  status: 404;
541
1081
  message: string;
542
1082
  };
1083
+ plan_module_unavailable: {
1084
+ status: 403;
1085
+ message: string;
1086
+ };
543
1087
  }>, Record<never, never>>;
544
1088
  delete: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
545
1089
  params: z.ZodObject<{
@@ -547,10 +1091,13 @@ export declare const messages: {
547
1091
  messageId: z.ZodUUID;
548
1092
  }, z.core.$strip>;
549
1093
  query: z.ZodObject<{
550
- permanent: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodEnum<{
551
- true: "true";
552
- false: "false";
553
- }>]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
1094
+ permanent: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [
1095
+ z.ZodBoolean,
1096
+ z.ZodEnum<{
1097
+ true: "true";
1098
+ false: "false";
1099
+ }>
1100
+ ]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
554
1101
  }, z.core.$strip>;
555
1102
  }, z.core.$strip>, z.ZodVoid, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
556
1103
  readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
@@ -559,6 +1106,8 @@ export declare const messages: {
559
1106
  readonly missing_scope: "The API key lacks the scope the operation needs.";
560
1107
  readonly role_forbidden: "The member's role does not allow the operation.";
561
1108
  readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
1109
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
1110
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
562
1111
  readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
563
1112
  readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
564
1113
  readonly overloaded: "The API is shedding load; retry after Retry-After.";
@@ -616,26 +1165,57 @@ export declare const messages: {
616
1165
  status: 404;
617
1166
  message: string;
618
1167
  };
1168
+ mail_disabled: {
1169
+ status: 409;
1170
+ message: string;
1171
+ };
619
1172
  account_not_found: {
620
1173
  status: 404;
621
1174
  message: string;
622
1175
  };
1176
+ plan_module_unavailable: {
1177
+ status: 403;
1178
+ message: string;
1179
+ };
623
1180
  }>, Record<never, never>>;
624
1181
  };
625
1182
  export declare const search: {
626
1183
  messages: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
627
1184
  accountId: z.ZodUUID;
628
- q: z.ZodString;
629
- mailboxId: z.ZodOptional<z.ZodUUID>;
630
1185
  after: z.ZodOptional<z.ZodPreprocess<z.ZodDate, string | Date>>;
631
1186
  before: z.ZodOptional<z.ZodPreprocess<z.ZodDate, string | Date>>;
632
1187
  source: z.ZodDefault<z.ZodEnum<{
633
1188
  provider: "provider";
634
- auto: "auto";
635
1189
  index: "index";
1190
+ auto: "auto";
636
1191
  }>>;
637
1192
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
638
1193
  cursor: z.ZodOptional<z.ZodString>;
1194
+ from: z.ZodOptional<z.ZodString>;
1195
+ to: z.ZodOptional<z.ZodString>;
1196
+ unread: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [
1197
+ z.ZodBoolean,
1198
+ z.ZodEnum<{
1199
+ true: "true";
1200
+ false: "false";
1201
+ }>
1202
+ ]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
1203
+ flagged: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [
1204
+ z.ZodBoolean,
1205
+ z.ZodEnum<{
1206
+ true: "true";
1207
+ false: "false";
1208
+ }>
1209
+ ]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
1210
+ hasAttachments: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [
1211
+ z.ZodBoolean,
1212
+ z.ZodEnum<{
1213
+ true: "true";
1214
+ false: "false";
1215
+ }>
1216
+ ]>, z.ZodTransform<boolean, boolean | "true" | "false">>>;
1217
+ q: z.ZodString;
1218
+ mailboxId: z.ZodOptional<z.ZodUUID>;
639
1219
  }, z.core.$strip>, z.ZodObject<{
640
1220
  source: z.ZodEnum<{
641
1221
  provider: "provider";
@@ -687,6 +1267,8 @@ export declare const search: {
687
1267
  readonly missing_scope: "The API key lacks the scope the operation needs.";
688
1268
  readonly role_forbidden: "The member's role does not allow the operation.";
689
1269
  readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
1270
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
1271
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
690
1272
  readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
691
1273
  readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
692
1274
  readonly overloaded: "The API is shedding load; retry after Retry-After.";
@@ -741,9 +1323,17 @@ export declare const search: {
741
1323
  status: 400;
742
1324
  message: string;
743
1325
  };
1326
+ mail_disabled: {
1327
+ status: 409;
1328
+ message: string;
1329
+ };
744
1330
  account_not_found: {
745
1331
  status: 404;
746
1332
  message: string;
747
1333
  };
1334
+ plan_module_unavailable: {
1335
+ status: 403;
1336
+ message: string;
1337
+ };
748
1338
  }>, Record<never, never>>;
749
1339
  };