@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,1222 @@
1
+ import * as z from "zod";
2
+ export type ErrorStatus = 400 | 401 | 402 | 403 | 404 | 409 | 410 | 413 | 422 | 429 | 500 | 502 | 503 | 507;
3
+ export interface ReasonDefinition {
4
+ readonly status: ErrorStatus;
5
+ readonly data?: z.ZodType;
6
+ }
7
+ export type ReasonTable = Record<string, ReasonDefinition>;
8
+ export declare const InputIssue: z.ZodObject<{
9
+ path: z.ZodArray<z.ZodUnion<readonly [
10
+ z.ZodString,
11
+ z.ZodNumber
12
+ ]>>;
13
+ message: z.ZodString;
14
+ }, z.core.$strip>;
15
+ export type InputIssue = z.infer<typeof InputIssue>;
16
+ export declare const InvalidInputData: z.ZodObject<{
17
+ issues: z.ZodArray<z.ZodObject<{
18
+ path: z.ZodArray<z.ZodUnion<readonly [
19
+ z.ZodString,
20
+ z.ZodNumber
21
+ ]>>;
22
+ message: z.ZodString;
23
+ }, z.core.$strip>>;
24
+ }, z.core.$strip>;
25
+ export type InvalidInputData = z.infer<typeof InvalidInputData>;
26
+ export declare const UnknownIdsData: z.ZodObject<{
27
+ ids: z.ZodArray<z.ZodUUID>;
28
+ }, z.core.$strip>;
29
+ export type UnknownIdsData = z.infer<typeof UnknownIdsData>;
30
+ export declare const SuppressedData: z.ZodObject<{
31
+ addresses: z.ZodArray<z.ZodString>;
32
+ }, z.core.$strip>;
33
+ export type SuppressedData = z.infer<typeof SuppressedData>;
34
+ export declare const SyncKindsData: z.ZodObject<{
35
+ kinds: z.ZodArray<z.ZodEnum<{
36
+ mail: "mail";
37
+ calendar: "calendar";
38
+ contacts: "contacts";
39
+ }>>;
40
+ }, z.core.$strip>;
41
+ export type SyncKindsData = z.infer<typeof SyncKindsData>;
42
+ export declare const PlanFeatureData: z.ZodObject<{
43
+ feature: z.ZodEnum<{
44
+ sso: "sso";
45
+ scim: "scim";
46
+ }>;
47
+ }, z.core.$strip>;
48
+ export type PlanFeatureData = z.infer<typeof PlanFeatureData>;
49
+ export declare const TemplateFieldData: z.ZodObject<{
50
+ field: z.ZodEnum<{
51
+ text: "text";
52
+ subject: "subject";
53
+ html: "html";
54
+ previewText: "previewText";
55
+ }>;
56
+ }, z.core.$strip>;
57
+ export type TemplateFieldData = z.infer<typeof TemplateFieldData>;
58
+ export declare const SsoRequiredData: z.ZodObject<{
59
+ providerId: z.ZodString;
60
+ organization: z.ZodString;
61
+ }, z.core.$strip>;
62
+ export type SsoRequiredData = z.infer<typeof SsoRequiredData>;
63
+ export declare const PLAN_LIMIT_KINDS: readonly [
64
+ "mail_accounts",
65
+ "calendar_contacts_accounts",
66
+ "meeting_accounts",
67
+ "accounts",
68
+ "sends_per_day",
69
+ "sends_per_month",
70
+ "webhook_endpoints",
71
+ "validations_per_day",
72
+ "storage_bytes",
73
+ "body_storage",
74
+ "ai_classifications",
75
+ "ai_drafts",
76
+ "validation_credits",
77
+ "spend_cap",
78
+ "plan"
79
+ ];
80
+ export declare const PlanLimitKind: z.ZodEnum<{
81
+ accounts: "accounts";
82
+ mail_accounts: "mail_accounts";
83
+ calendar_contacts_accounts: "calendar_contacts_accounts";
84
+ meeting_accounts: "meeting_accounts";
85
+ sends_per_day: "sends_per_day";
86
+ sends_per_month: "sends_per_month";
87
+ webhook_endpoints: "webhook_endpoints";
88
+ validations_per_day: "validations_per_day";
89
+ storage_bytes: "storage_bytes";
90
+ body_storage: "body_storage";
91
+ ai_classifications: "ai_classifications";
92
+ ai_drafts: "ai_drafts";
93
+ validation_credits: "validation_credits";
94
+ spend_cap: "spend_cap";
95
+ plan: "plan";
96
+ }>;
97
+ export type PlanLimitKind = z.infer<typeof PlanLimitKind>;
98
+ export declare const PlanLimitData: z.ZodObject<{
99
+ limit: z.ZodEnum<{
100
+ accounts: "accounts";
101
+ mail_accounts: "mail_accounts";
102
+ calendar_contacts_accounts: "calendar_contacts_accounts";
103
+ meeting_accounts: "meeting_accounts";
104
+ sends_per_day: "sends_per_day";
105
+ sends_per_month: "sends_per_month";
106
+ webhook_endpoints: "webhook_endpoints";
107
+ validations_per_day: "validations_per_day";
108
+ storage_bytes: "storage_bytes";
109
+ body_storage: "body_storage";
110
+ ai_classifications: "ai_classifications";
111
+ ai_drafts: "ai_drafts";
112
+ validation_credits: "validation_credits";
113
+ spend_cap: "spend_cap";
114
+ plan: "plan";
115
+ }>;
116
+ value: z.ZodNullable<z.ZodNumber>;
117
+ usage: z.ZodNullable<z.ZodNumber>;
118
+ upgradeUrl: z.ZodString;
119
+ }, z.core.$strip>;
120
+ export type PlanLimitData = z.infer<typeof PlanLimitData>;
121
+ export declare const ValidationCreditsData: z.ZodObject<{
122
+ limit: z.ZodEnum<{
123
+ accounts: "accounts";
124
+ mail_accounts: "mail_accounts";
125
+ calendar_contacts_accounts: "calendar_contacts_accounts";
126
+ meeting_accounts: "meeting_accounts";
127
+ sends_per_day: "sends_per_day";
128
+ sends_per_month: "sends_per_month";
129
+ webhook_endpoints: "webhook_endpoints";
130
+ validations_per_day: "validations_per_day";
131
+ storage_bytes: "storage_bytes";
132
+ body_storage: "body_storage";
133
+ ai_classifications: "ai_classifications";
134
+ ai_drafts: "ai_drafts";
135
+ validation_credits: "validation_credits";
136
+ spend_cap: "spend_cap";
137
+ plan: "plan";
138
+ }>;
139
+ value: z.ZodNullable<z.ZodNumber>;
140
+ usage: z.ZodNullable<z.ZodNumber>;
141
+ upgradeUrl: z.ZodString;
142
+ balance: z.ZodNumber;
143
+ needed: z.ZodNumber;
144
+ }, z.core.$strip>;
145
+ export type ValidationCreditsData = z.infer<typeof ValidationCreditsData>;
146
+ export declare const LIMIT_DATA_REASONS: readonly [
147
+ "plan_limit_accounts",
148
+ "plan_limit_sends",
149
+ "plan_limit_validations",
150
+ "plan_limit_ai",
151
+ "plan_limit_webhooks",
152
+ "plan_limit_storage",
153
+ "plan_required",
154
+ "validation_credits_exhausted",
155
+ "spend_cap_reached"
156
+ ];
157
+ export type LimitDataReason = (typeof LIMIT_DATA_REASONS)[number];
158
+ export declare const LIMIT_HIT_REASONS: readonly [
159
+ "plan_limit_accounts",
160
+ "plan_limit_sends",
161
+ "plan_limit_validations",
162
+ "plan_limit_ai",
163
+ "plan_limit_webhooks",
164
+ "plan_limit_storage",
165
+ "plan_required",
166
+ "validation_credits_exhausted",
167
+ "spend_cap_reached",
168
+ "plan_feature_unavailable"
169
+ ];
170
+ export declare const LimitHitReason: z.ZodEnum<{
171
+ plan_limit_accounts: "plan_limit_accounts";
172
+ plan_required: "plan_required";
173
+ spend_cap_reached: "spend_cap_reached";
174
+ plan_limit_sends: "plan_limit_sends";
175
+ plan_limit_validations: "plan_limit_validations";
176
+ plan_limit_ai: "plan_limit_ai";
177
+ plan_limit_webhooks: "plan_limit_webhooks";
178
+ plan_limit_storage: "plan_limit_storage";
179
+ validation_credits_exhausted: "validation_credits_exhausted";
180
+ plan_feature_unavailable: "plan_feature_unavailable";
181
+ }>;
182
+ export type LimitHitReason = z.infer<typeof LimitHitReason>;
183
+ export declare const REASONS: {
184
+ readonly invalid_input: {
185
+ readonly status: 400;
186
+ readonly data: z.ZodObject<{
187
+ issues: z.ZodArray<z.ZodObject<{
188
+ path: z.ZodArray<z.ZodUnion<readonly [
189
+ z.ZodString,
190
+ z.ZodNumber
191
+ ]>>;
192
+ message: z.ZodString;
193
+ }, z.core.$strip>>;
194
+ }, z.core.$strip>;
195
+ };
196
+ readonly invalid_cursor: {
197
+ readonly status: 400;
198
+ };
199
+ readonly invalid_range: {
200
+ readonly status: 400;
201
+ };
202
+ readonly payload_too_large: {
203
+ readonly status: 413;
204
+ };
205
+ readonly invalid_payload: {
206
+ readonly status: 400;
207
+ };
208
+ readonly invalid_signature: {
209
+ readonly status: 400;
210
+ };
211
+ readonly route_not_found: {
212
+ readonly status: 404;
213
+ };
214
+ readonly internal_error: {
215
+ readonly status: 500;
216
+ };
217
+ readonly invalid_idempotency_key: {
218
+ readonly status: 400;
219
+ };
220
+ readonly idempotency_key_reused: {
221
+ readonly status: 422;
222
+ };
223
+ readonly idempotency_key_in_progress: {
224
+ readonly status: 409;
225
+ };
226
+ readonly rate_limited: {
227
+ readonly status: 429;
228
+ };
229
+ readonly too_many_requests: {
230
+ readonly status: 429;
231
+ };
232
+ readonly overloaded: {
233
+ readonly status: 503;
234
+ };
235
+ readonly unauthenticated: {
236
+ readonly status: 401;
237
+ };
238
+ readonly api_key_expired: {
239
+ readonly status: 401;
240
+ };
241
+ readonly missing_scope: {
242
+ readonly status: 403;
243
+ };
244
+ readonly role_forbidden: {
245
+ readonly status: 403;
246
+ };
247
+ readonly account_token_forbidden: {
248
+ readonly status: 403;
249
+ };
250
+ readonly account_scope_forbidden: {
251
+ readonly status: 403;
252
+ };
253
+ readonly api_key_required: {
254
+ readonly status: 403;
255
+ };
256
+ readonly mcp_only_key: {
257
+ readonly status: 403;
258
+ };
259
+ readonly session_required: {
260
+ readonly status: 403;
261
+ };
262
+ readonly owner_required: {
263
+ readonly status: 403;
264
+ };
265
+ readonly platform_admin_required: {
266
+ readonly status: 403;
267
+ };
268
+ readonly email_verification_required: {
269
+ readonly status: 403;
270
+ };
271
+ readonly console_only: {
272
+ readonly status: 403;
273
+ };
274
+ readonly sso_required: {
275
+ readonly status: 403;
276
+ readonly data: z.ZodObject<{
277
+ providerId: z.ZodString;
278
+ organization: z.ZodString;
279
+ }, z.core.$strip>;
280
+ };
281
+ readonly two_factor_required: {
282
+ readonly status: 403;
283
+ };
284
+ readonly session_not_fresh: {
285
+ readonly status: 403;
286
+ };
287
+ readonly cross_site_request: {
288
+ readonly status: 403;
289
+ };
290
+ readonly plan_limit_accounts: {
291
+ readonly status: 403;
292
+ readonly data: z.ZodObject<{
293
+ limit: z.ZodEnum<{
294
+ accounts: "accounts";
295
+ mail_accounts: "mail_accounts";
296
+ calendar_contacts_accounts: "calendar_contacts_accounts";
297
+ meeting_accounts: "meeting_accounts";
298
+ sends_per_day: "sends_per_day";
299
+ sends_per_month: "sends_per_month";
300
+ webhook_endpoints: "webhook_endpoints";
301
+ validations_per_day: "validations_per_day";
302
+ storage_bytes: "storage_bytes";
303
+ body_storage: "body_storage";
304
+ ai_classifications: "ai_classifications";
305
+ ai_drafts: "ai_drafts";
306
+ validation_credits: "validation_credits";
307
+ spend_cap: "spend_cap";
308
+ plan: "plan";
309
+ }>;
310
+ value: z.ZodNullable<z.ZodNumber>;
311
+ usage: z.ZodNullable<z.ZodNumber>;
312
+ upgradeUrl: z.ZodString;
313
+ }, z.core.$strip>;
314
+ };
315
+ readonly plan_limit_sends: {
316
+ readonly status: 403;
317
+ readonly data: z.ZodObject<{
318
+ limit: z.ZodEnum<{
319
+ accounts: "accounts";
320
+ mail_accounts: "mail_accounts";
321
+ calendar_contacts_accounts: "calendar_contacts_accounts";
322
+ meeting_accounts: "meeting_accounts";
323
+ sends_per_day: "sends_per_day";
324
+ sends_per_month: "sends_per_month";
325
+ webhook_endpoints: "webhook_endpoints";
326
+ validations_per_day: "validations_per_day";
327
+ storage_bytes: "storage_bytes";
328
+ body_storage: "body_storage";
329
+ ai_classifications: "ai_classifications";
330
+ ai_drafts: "ai_drafts";
331
+ validation_credits: "validation_credits";
332
+ spend_cap: "spend_cap";
333
+ plan: "plan";
334
+ }>;
335
+ value: z.ZodNullable<z.ZodNumber>;
336
+ usage: z.ZodNullable<z.ZodNumber>;
337
+ upgradeUrl: z.ZodString;
338
+ }, z.core.$strip>;
339
+ };
340
+ readonly plan_limit_validations: {
341
+ readonly status: 403;
342
+ readonly data: z.ZodObject<{
343
+ limit: z.ZodEnum<{
344
+ accounts: "accounts";
345
+ mail_accounts: "mail_accounts";
346
+ calendar_contacts_accounts: "calendar_contacts_accounts";
347
+ meeting_accounts: "meeting_accounts";
348
+ sends_per_day: "sends_per_day";
349
+ sends_per_month: "sends_per_month";
350
+ webhook_endpoints: "webhook_endpoints";
351
+ validations_per_day: "validations_per_day";
352
+ storage_bytes: "storage_bytes";
353
+ body_storage: "body_storage";
354
+ ai_classifications: "ai_classifications";
355
+ ai_drafts: "ai_drafts";
356
+ validation_credits: "validation_credits";
357
+ spend_cap: "spend_cap";
358
+ plan: "plan";
359
+ }>;
360
+ value: z.ZodNullable<z.ZodNumber>;
361
+ usage: z.ZodNullable<z.ZodNumber>;
362
+ upgradeUrl: z.ZodString;
363
+ }, z.core.$strip>;
364
+ };
365
+ readonly plan_limit_ai: {
366
+ readonly status: 403;
367
+ readonly data: z.ZodObject<{
368
+ limit: z.ZodEnum<{
369
+ accounts: "accounts";
370
+ mail_accounts: "mail_accounts";
371
+ calendar_contacts_accounts: "calendar_contacts_accounts";
372
+ meeting_accounts: "meeting_accounts";
373
+ sends_per_day: "sends_per_day";
374
+ sends_per_month: "sends_per_month";
375
+ webhook_endpoints: "webhook_endpoints";
376
+ validations_per_day: "validations_per_day";
377
+ storage_bytes: "storage_bytes";
378
+ body_storage: "body_storage";
379
+ ai_classifications: "ai_classifications";
380
+ ai_drafts: "ai_drafts";
381
+ validation_credits: "validation_credits";
382
+ spend_cap: "spend_cap";
383
+ plan: "plan";
384
+ }>;
385
+ value: z.ZodNullable<z.ZodNumber>;
386
+ usage: z.ZodNullable<z.ZodNumber>;
387
+ upgradeUrl: z.ZodString;
388
+ }, z.core.$strip>;
389
+ };
390
+ readonly plan_limit_webhooks: {
391
+ readonly status: 403;
392
+ readonly data: z.ZodObject<{
393
+ limit: z.ZodEnum<{
394
+ accounts: "accounts";
395
+ mail_accounts: "mail_accounts";
396
+ calendar_contacts_accounts: "calendar_contacts_accounts";
397
+ meeting_accounts: "meeting_accounts";
398
+ sends_per_day: "sends_per_day";
399
+ sends_per_month: "sends_per_month";
400
+ webhook_endpoints: "webhook_endpoints";
401
+ validations_per_day: "validations_per_day";
402
+ storage_bytes: "storage_bytes";
403
+ body_storage: "body_storage";
404
+ ai_classifications: "ai_classifications";
405
+ ai_drafts: "ai_drafts";
406
+ validation_credits: "validation_credits";
407
+ spend_cap: "spend_cap";
408
+ plan: "plan";
409
+ }>;
410
+ value: z.ZodNullable<z.ZodNumber>;
411
+ usage: z.ZodNullable<z.ZodNumber>;
412
+ upgradeUrl: z.ZodString;
413
+ }, z.core.$strip>;
414
+ };
415
+ readonly plan_limit_storage: {
416
+ readonly status: 403;
417
+ readonly data: z.ZodObject<{
418
+ limit: z.ZodEnum<{
419
+ accounts: "accounts";
420
+ mail_accounts: "mail_accounts";
421
+ calendar_contacts_accounts: "calendar_contacts_accounts";
422
+ meeting_accounts: "meeting_accounts";
423
+ sends_per_day: "sends_per_day";
424
+ sends_per_month: "sends_per_month";
425
+ webhook_endpoints: "webhook_endpoints";
426
+ validations_per_day: "validations_per_day";
427
+ storage_bytes: "storage_bytes";
428
+ body_storage: "body_storage";
429
+ ai_classifications: "ai_classifications";
430
+ ai_drafts: "ai_drafts";
431
+ validation_credits: "validation_credits";
432
+ spend_cap: "spend_cap";
433
+ plan: "plan";
434
+ }>;
435
+ value: z.ZodNullable<z.ZodNumber>;
436
+ usage: z.ZodNullable<z.ZodNumber>;
437
+ upgradeUrl: z.ZodString;
438
+ }, z.core.$strip>;
439
+ };
440
+ readonly plan_required: {
441
+ readonly status: 402;
442
+ readonly data: z.ZodObject<{
443
+ limit: z.ZodEnum<{
444
+ accounts: "accounts";
445
+ mail_accounts: "mail_accounts";
446
+ calendar_contacts_accounts: "calendar_contacts_accounts";
447
+ meeting_accounts: "meeting_accounts";
448
+ sends_per_day: "sends_per_day";
449
+ sends_per_month: "sends_per_month";
450
+ webhook_endpoints: "webhook_endpoints";
451
+ validations_per_day: "validations_per_day";
452
+ storage_bytes: "storage_bytes";
453
+ body_storage: "body_storage";
454
+ ai_classifications: "ai_classifications";
455
+ ai_drafts: "ai_drafts";
456
+ validation_credits: "validation_credits";
457
+ spend_cap: "spend_cap";
458
+ plan: "plan";
459
+ }>;
460
+ value: z.ZodNullable<z.ZodNumber>;
461
+ usage: z.ZodNullable<z.ZodNumber>;
462
+ upgradeUrl: z.ZodString;
463
+ }, z.core.$strip>;
464
+ };
465
+ readonly spend_cap_reached: {
466
+ readonly status: 402;
467
+ readonly data: z.ZodObject<{
468
+ limit: z.ZodEnum<{
469
+ accounts: "accounts";
470
+ mail_accounts: "mail_accounts";
471
+ calendar_contacts_accounts: "calendar_contacts_accounts";
472
+ meeting_accounts: "meeting_accounts";
473
+ sends_per_day: "sends_per_day";
474
+ sends_per_month: "sends_per_month";
475
+ webhook_endpoints: "webhook_endpoints";
476
+ validations_per_day: "validations_per_day";
477
+ storage_bytes: "storage_bytes";
478
+ body_storage: "body_storage";
479
+ ai_classifications: "ai_classifications";
480
+ ai_drafts: "ai_drafts";
481
+ validation_credits: "validation_credits";
482
+ spend_cap: "spend_cap";
483
+ plan: "plan";
484
+ }>;
485
+ value: z.ZodNullable<z.ZodNumber>;
486
+ usage: z.ZodNullable<z.ZodNumber>;
487
+ upgradeUrl: z.ZodString;
488
+ }, z.core.$strip>;
489
+ };
490
+ readonly plan_module_unavailable: {
491
+ readonly status: 403;
492
+ };
493
+ readonly plan_feature_unavailable: {
494
+ readonly status: 403;
495
+ readonly data: z.ZodObject<{
496
+ feature: z.ZodEnum<{
497
+ sso: "sso";
498
+ scim: "scim";
499
+ }>;
500
+ }, z.core.$strip>;
501
+ };
502
+ readonly storage_unavailable: {
503
+ readonly status: 400;
504
+ };
505
+ readonly connect_grants_nothing: {
506
+ readonly status: 400;
507
+ };
508
+ readonly tenant_not_found: {
509
+ readonly status: 404;
510
+ };
511
+ readonly billing_past_due: {
512
+ readonly status: 402;
513
+ };
514
+ readonly billing_disabled: {
515
+ readonly status: 404;
516
+ };
517
+ readonly billing_unavailable: {
518
+ readonly status: 502;
519
+ };
520
+ readonly billing_tax_failed: {
521
+ readonly status: 502;
522
+ };
523
+ readonly billing_subscription_exists: {
524
+ readonly status: 409;
525
+ };
526
+ readonly billing_customer_missing: {
527
+ readonly status: 409;
528
+ };
529
+ readonly plan_not_billable: {
530
+ readonly status: 409;
531
+ };
532
+ readonly plan_not_offered: {
533
+ readonly status: 409;
534
+ };
535
+ readonly billing_subscription_missing: {
536
+ readonly status: 409;
537
+ };
538
+ readonly billing_not_active: {
539
+ readonly status: 409;
540
+ };
541
+ readonly billing_cancel_pending: {
542
+ readonly status: 409;
543
+ };
544
+ readonly plan_unchanged: {
545
+ readonly status: 409;
546
+ };
547
+ readonly plan_currency_mismatch: {
548
+ readonly status: 409;
549
+ };
550
+ readonly plan_interval_unavailable: {
551
+ readonly status: 409;
552
+ };
553
+ readonly plan_interval_change: {
554
+ readonly status: 409;
555
+ };
556
+ readonly billing_payment_failed: {
557
+ readonly status: 402;
558
+ };
559
+ readonly plan_change_quote_changed: {
560
+ readonly status: 409;
561
+ };
562
+ readonly billing_checkout_in_progress: {
563
+ readonly status: 409;
564
+ };
565
+ readonly validation_credits_exhausted: {
566
+ readonly status: 402;
567
+ readonly data: z.ZodObject<{
568
+ limit: z.ZodEnum<{
569
+ accounts: "accounts";
570
+ mail_accounts: "mail_accounts";
571
+ calendar_contacts_accounts: "calendar_contacts_accounts";
572
+ meeting_accounts: "meeting_accounts";
573
+ sends_per_day: "sends_per_day";
574
+ sends_per_month: "sends_per_month";
575
+ webhook_endpoints: "webhook_endpoints";
576
+ validations_per_day: "validations_per_day";
577
+ storage_bytes: "storage_bytes";
578
+ body_storage: "body_storage";
579
+ ai_classifications: "ai_classifications";
580
+ ai_drafts: "ai_drafts";
581
+ validation_credits: "validation_credits";
582
+ spend_cap: "spend_cap";
583
+ plan: "plan";
584
+ }>;
585
+ value: z.ZodNullable<z.ZodNumber>;
586
+ usage: z.ZodNullable<z.ZodNumber>;
587
+ upgradeUrl: z.ZodString;
588
+ balance: z.ZodNumber;
589
+ needed: z.ZodNumber;
590
+ }, z.core.$strip>;
591
+ };
592
+ readonly account_not_found: {
593
+ readonly status: 404;
594
+ };
595
+ readonly unknown_account: {
596
+ readonly status: 422;
597
+ readonly data: z.ZodObject<{
598
+ ids: z.ZodArray<z.ZodUUID>;
599
+ }, z.core.$strip>;
600
+ };
601
+ readonly account_paused: {
602
+ readonly status: 409;
603
+ };
604
+ readonly account_disabled: {
605
+ readonly status: 409;
606
+ };
607
+ readonly account_reauth_required: {
608
+ readonly status: 409;
609
+ };
610
+ readonly account_misconfigured: {
611
+ readonly status: 409;
612
+ };
613
+ readonly mail_disabled: {
614
+ readonly status: 409;
615
+ };
616
+ readonly calendar_disabled: {
617
+ readonly status: 409;
618
+ };
619
+ readonly contacts_disabled: {
620
+ readonly status: 409;
621
+ };
622
+ readonly sync_kinds_disabled: {
623
+ readonly status: 409;
624
+ readonly data: z.ZodObject<{
625
+ kinds: z.ZodArray<z.ZodEnum<{
626
+ mail: "mail";
627
+ calendar: "calendar";
628
+ contacts: "contacts";
629
+ }>>;
630
+ }, z.core.$strip>;
631
+ };
632
+ readonly mcp_key_not_found: {
633
+ readonly status: 404;
634
+ };
635
+ readonly mcp_key_limit: {
636
+ readonly status: 409;
637
+ };
638
+ readonly provider_not_found: {
639
+ readonly status: 404;
640
+ };
641
+ readonly provider_throttled: {
642
+ readonly status: 429;
643
+ };
644
+ readonly provider_unavailable: {
645
+ readonly status: 502;
646
+ };
647
+ readonly provider_forbidden: {
648
+ readonly status: 403;
649
+ };
650
+ readonly provider_conflict: {
651
+ readonly status: 409;
652
+ };
653
+ readonly provider_unsupported: {
654
+ readonly status: 400;
655
+ };
656
+ readonly provider_rejected: {
657
+ readonly status: 400;
658
+ };
659
+ readonly outcome_unknown: {
660
+ readonly status: 502;
661
+ };
662
+ readonly message_not_found: {
663
+ readonly status: 404;
664
+ };
665
+ readonly unknown_mailbox: {
666
+ readonly status: 422;
667
+ readonly data: z.ZodObject<{
668
+ ids: z.ZodArray<z.ZodUUID>;
669
+ }, z.core.$strip>;
670
+ };
671
+ readonly mailbox_not_label: {
672
+ readonly status: 400;
673
+ };
674
+ readonly mailbox_protected: {
675
+ readonly status: 409;
676
+ };
677
+ readonly mailbox_parent: {
678
+ readonly status: 400;
679
+ };
680
+ readonly thread_not_found: {
681
+ readonly status: 404;
682
+ };
683
+ readonly identity_not_found: {
684
+ readonly status: 404;
685
+ };
686
+ readonly identities_managed_by_provider: {
687
+ readonly status: 400;
688
+ };
689
+ readonly identity_exists: {
690
+ readonly status: 409;
691
+ };
692
+ readonly identity_not_custom: {
693
+ readonly status: 400;
694
+ };
695
+ readonly draft_not_found: {
696
+ readonly status: 404;
697
+ };
698
+ readonly draft_lost: {
699
+ readonly status: 502;
700
+ };
701
+ readonly send_not_found: {
702
+ readonly status: 404;
703
+ };
704
+ readonly mail_merge_not_found: {
705
+ readonly status: 404;
706
+ };
707
+ readonly attachments_too_large: {
708
+ readonly status: 400;
709
+ };
710
+ readonly not_a_draft: {
711
+ readonly status: 400;
712
+ };
713
+ readonly unknown_reply_target: {
714
+ readonly status: 422;
715
+ };
716
+ readonly from_not_allowed: {
717
+ readonly status: 400;
718
+ };
719
+ readonly tracking_unsupported: {
720
+ readonly status: 400;
721
+ };
722
+ readonly honeypot_needs_click_tracking: {
723
+ readonly status: 400;
724
+ };
725
+ readonly list_send_recipients: {
726
+ readonly status: 400;
727
+ };
728
+ readonly suppressed: {
729
+ readonly status: 400;
730
+ readonly data: z.ZodObject<{
731
+ addresses: z.ZodArray<z.ZodString>;
732
+ }, z.core.$strip>;
733
+ };
734
+ readonly no_recipients: {
735
+ readonly status: 400;
736
+ };
737
+ readonly list_unsubscribe_unavailable: {
738
+ readonly status: 400;
739
+ };
740
+ readonly send_not_reschedulable: {
741
+ readonly status: 409;
742
+ };
743
+ readonly send_not_cancellable: {
744
+ readonly status: 409;
745
+ };
746
+ readonly suppression_list_not_found: {
747
+ readonly status: 404;
748
+ };
749
+ readonly suppression_entry_not_found: {
750
+ readonly status: 404;
751
+ };
752
+ readonly suppression_review_not_found: {
753
+ readonly status: 404;
754
+ };
755
+ readonly suppression_list_exists: {
756
+ readonly status: 409;
757
+ };
758
+ readonly suppression_list_not_empty: {
759
+ readonly status: 409;
760
+ };
761
+ readonly tracking_domain_unavailable: {
762
+ readonly status: 400;
763
+ };
764
+ readonly tracking_domain_not_found: {
765
+ readonly status: 404;
766
+ };
767
+ readonly tracking_domain_not_allowed: {
768
+ readonly status: 400;
769
+ };
770
+ readonly tracking_domain_taken: {
771
+ readonly status: 409;
772
+ };
773
+ readonly tracking_domain_edge_unavailable: {
774
+ readonly status: 502;
775
+ };
776
+ readonly template_not_found: {
777
+ readonly status: 404;
778
+ };
779
+ readonly unknown_template: {
780
+ readonly status: 422;
781
+ };
782
+ readonly template_and_inline_fields: {
783
+ readonly status: 400;
784
+ };
785
+ readonly invalid_template: {
786
+ readonly status: 400;
787
+ readonly data: z.ZodObject<{
788
+ field: z.ZodEnum<{
789
+ text: "text";
790
+ subject: "subject";
791
+ html: "html";
792
+ previewText: "previewText";
793
+ }>;
794
+ }, z.core.$strip>;
795
+ };
796
+ readonly template_account_mismatch: {
797
+ readonly status: 400;
798
+ };
799
+ readonly template_render_failed: {
800
+ readonly status: 400;
801
+ readonly data: z.ZodObject<{
802
+ field: z.ZodEnum<{
803
+ text: "text";
804
+ subject: "subject";
805
+ html: "html";
806
+ previewText: "previewText";
807
+ }>;
808
+ }, z.core.$strip>;
809
+ };
810
+ readonly params_too_large: {
811
+ readonly status: 400;
812
+ };
813
+ readonly template_name_taken: {
814
+ readonly status: 409;
815
+ };
816
+ readonly calendar_not_found: {
817
+ readonly status: 404;
818
+ };
819
+ readonly calendar_event_not_found: {
820
+ readonly status: 404;
821
+ };
822
+ readonly contact_not_found: {
823
+ readonly status: 404;
824
+ };
825
+ readonly photo_not_found: {
826
+ readonly status: 404;
827
+ };
828
+ readonly unknown_calendar: {
829
+ readonly status: 422;
830
+ };
831
+ readonly unknown_contact_folder: {
832
+ readonly status: 422;
833
+ };
834
+ readonly calendar_read_only: {
835
+ readonly status: 403;
836
+ };
837
+ readonly calendar_primary: {
838
+ readonly status: 409;
839
+ };
840
+ readonly organizer_cannot_respond: {
841
+ readonly status: 409;
842
+ };
843
+ readonly invalid_time_zone: {
844
+ readonly status: 400;
845
+ };
846
+ readonly invalid_working_hours: {
847
+ readonly status: 400;
848
+ };
849
+ readonly scheduling_link_not_found: {
850
+ readonly status: 404;
851
+ };
852
+ readonly booking_not_found: {
853
+ readonly status: 404;
854
+ };
855
+ readonly slot_unavailable: {
856
+ readonly status: 409;
857
+ };
858
+ readonly slot_taken: {
859
+ readonly status: 409;
860
+ };
861
+ readonly booking_cancelled: {
862
+ readonly status: 409;
863
+ };
864
+ readonly mixed_event_times: {
865
+ readonly status: 400;
866
+ };
867
+ readonly invalid_recurrence: {
868
+ readonly status: 400;
869
+ };
870
+ readonly recurrence_on_instance: {
871
+ readonly status: 400;
872
+ };
873
+ readonly contact_unidentifiable: {
874
+ readonly status: 400;
875
+ };
876
+ readonly multiple_meeting_options: {
877
+ readonly status: 400;
878
+ };
879
+ readonly meeting_service_not_connected: {
880
+ readonly status: 409;
881
+ };
882
+ readonly meeting_service_reauth_required: {
883
+ readonly status: 409;
884
+ };
885
+ readonly meeting_host_missing: {
886
+ readonly status: 409;
887
+ };
888
+ readonly meeting_recurrence_unsupported: {
889
+ readonly status: 400;
890
+ };
891
+ readonly meeting_service_rejected: {
892
+ readonly status: 400;
893
+ };
894
+ readonly meeting_deleted: {
895
+ readonly status: 409;
896
+ };
897
+ readonly meeting_service_unavailable: {
898
+ readonly status: 502;
899
+ };
900
+ readonly meeting_app_not_found: {
901
+ readonly status: 404;
902
+ };
903
+ readonly unknown_meeting_app: {
904
+ readonly status: 422;
905
+ };
906
+ readonly meeting_connection_not_found: {
907
+ readonly status: 404;
908
+ };
909
+ readonly meeting_connect_session_not_found: {
910
+ readonly status: 404;
911
+ };
912
+ readonly meeting_app_exists: {
913
+ readonly status: 409;
914
+ };
915
+ readonly meeting_app_in_use: {
916
+ readonly status: 409;
917
+ };
918
+ readonly meeting_app_mismatch: {
919
+ readonly status: 400;
920
+ };
921
+ readonly meeting_app_secret_unreadable: {
922
+ readonly status: 400;
923
+ };
924
+ readonly not_testable: {
925
+ readonly status: 400;
926
+ };
927
+ readonly autodiscovery_failed: {
928
+ readonly status: 422;
929
+ };
930
+ readonly password_required: {
931
+ readonly status: 400;
932
+ };
933
+ readonly oauth_servers_fixed: {
934
+ readonly status: 400;
935
+ };
936
+ readonly dav_discovery_failed: {
937
+ readonly status: 400;
938
+ };
939
+ readonly dav_unsupported: {
940
+ readonly status: 400;
941
+ };
942
+ readonly login_failed: {
943
+ readonly status: 400;
944
+ };
945
+ readonly server_not_allowed: {
946
+ readonly status: 400;
947
+ };
948
+ readonly plaintext_not_allowed: {
949
+ readonly status: 400;
950
+ };
951
+ readonly not_dav_server: {
952
+ readonly status: 400;
953
+ };
954
+ readonly not_imap_account: {
955
+ readonly status: 400;
956
+ };
957
+ readonly password_not_stored: {
958
+ readonly status: 400;
959
+ };
960
+ readonly password_unsupported: {
961
+ readonly status: 400;
962
+ };
963
+ readonly connect_session_not_found: {
964
+ readonly status: 404;
965
+ };
966
+ readonly session_used: {
967
+ readonly status: 409;
968
+ };
969
+ readonly session_expired: {
970
+ readonly status: 400;
971
+ };
972
+ readonly provider_not_allowed: {
973
+ readonly status: 400;
974
+ };
975
+ readonly redirect_uri_not_allowed: {
976
+ readonly status: 400;
977
+ };
978
+ readonly access_denied: {
979
+ readonly status: 400;
980
+ };
981
+ readonly access_token_rejected: {
982
+ readonly status: 400;
983
+ };
984
+ readonly account_exists: {
985
+ readonly status: 409;
986
+ };
987
+ readonly account_mismatch: {
988
+ readonly status: 409;
989
+ };
990
+ readonly consent_failed: {
991
+ readonly status: 400;
992
+ };
993
+ readonly consent_revoked: {
994
+ readonly status: 400;
995
+ };
996
+ readonly consent_unverified: {
997
+ readonly status: 400;
998
+ };
999
+ readonly credential_conflict: {
1000
+ readonly status: 400;
1001
+ };
1002
+ readonly credential_missing: {
1003
+ readonly status: 400;
1004
+ };
1005
+ readonly identity_failed: {
1006
+ readonly status: 400;
1007
+ };
1008
+ readonly identity_unavailable: {
1009
+ readonly status: 400;
1010
+ };
1011
+ readonly invalid_client: {
1012
+ readonly status: 400;
1013
+ };
1014
+ readonly interaction_required: {
1015
+ readonly status: 400;
1016
+ };
1017
+ readonly invalid_grant: {
1018
+ readonly status: 400;
1019
+ };
1020
+ readonly missing_refresh_token: {
1021
+ readonly status: 400;
1022
+ };
1023
+ readonly unknown_oauth_app: {
1024
+ readonly status: 422;
1025
+ };
1026
+ readonly oauth_app_not_found: {
1027
+ readonly status: 404;
1028
+ };
1029
+ readonly oauth_app_mismatch: {
1030
+ readonly status: 400;
1031
+ };
1032
+ readonly oauth_app_in_use: {
1033
+ readonly status: 409;
1034
+ };
1035
+ readonly oauth_app_secret_unreadable: {
1036
+ readonly status: 400;
1037
+ };
1038
+ readonly google_imap_requires_own_app: {
1039
+ readonly status: 400;
1040
+ };
1041
+ readonly org_connection_account: {
1042
+ readonly status: 400;
1043
+ };
1044
+ readonly shared_mailbox_account: {
1045
+ readonly status: 400;
1046
+ };
1047
+ readonly gmail_push_unsupported: {
1048
+ readonly status: 400;
1049
+ };
1050
+ readonly push_unavailable: {
1051
+ readonly status: 400;
1052
+ };
1053
+ readonly cloud_required: {
1054
+ readonly status: 400;
1055
+ };
1056
+ readonly provider_error: {
1057
+ readonly status: 400;
1058
+ };
1059
+ readonly provider_not_configured: {
1060
+ readonly status: 400;
1061
+ };
1062
+ readonly unsupported_provider: {
1063
+ readonly status: 400;
1064
+ };
1065
+ readonly scope_denied: {
1066
+ readonly status: 400;
1067
+ };
1068
+ readonly token_exchange_failed: {
1069
+ readonly status: 400;
1070
+ };
1071
+ readonly org_connection_not_found: {
1072
+ readonly status: 404;
1073
+ };
1074
+ readonly org_connection_secret_unreadable: {
1075
+ readonly status: 400;
1076
+ };
1077
+ readonly consent_required: {
1078
+ readonly status: 409;
1079
+ };
1080
+ readonly delegate_missing: {
1081
+ readonly status: 400;
1082
+ };
1083
+ readonly directory_unavailable: {
1084
+ readonly status: 409;
1085
+ };
1086
+ readonly directory_already_connected: {
1087
+ readonly status: 409;
1088
+ };
1089
+ readonly directory_mismatch: {
1090
+ readonly status: 400;
1091
+ };
1092
+ readonly directory_id_not_allowed: {
1093
+ readonly status: 400;
1094
+ };
1095
+ readonly credential_mismatch: {
1096
+ readonly status: 400;
1097
+ };
1098
+ readonly connection_in_use: {
1099
+ readonly status: 409;
1100
+ };
1101
+ readonly invalid_certificate: {
1102
+ readonly status: 400;
1103
+ };
1104
+ readonly invalid_service_account_key: {
1105
+ readonly status: 400;
1106
+ };
1107
+ readonly not_microsoft: {
1108
+ readonly status: 400;
1109
+ };
1110
+ readonly user_required: {
1111
+ readonly status: 400;
1112
+ };
1113
+ readonly shared_mailbox_unsupported: {
1114
+ readonly status: 400;
1115
+ };
1116
+ readonly scope_missing: {
1117
+ readonly status: 400;
1118
+ };
1119
+ readonly shared_mailbox_inaccessible: {
1120
+ readonly status: 422;
1121
+ };
1122
+ readonly group_unsupported: {
1123
+ readonly status: 400;
1124
+ };
1125
+ readonly group_relay_inaccessible: {
1126
+ readonly status: 422;
1127
+ };
1128
+ readonly group_alias_unverified: {
1129
+ readonly status: 409;
1130
+ };
1131
+ readonly group_alias_missing: {
1132
+ readonly status: 409;
1133
+ };
1134
+ readonly webhook_endpoint_not_found: {
1135
+ readonly status: 404;
1136
+ };
1137
+ readonly endpoint_disabled: {
1138
+ readonly status: 409;
1139
+ };
1140
+ readonly event_not_found: {
1141
+ readonly status: 404;
1142
+ };
1143
+ readonly replay_range_too_large: {
1144
+ readonly status: 400;
1145
+ };
1146
+ readonly mailbox_outside_accounts: {
1147
+ readonly status: 400;
1148
+ };
1149
+ readonly https_required: {
1150
+ readonly status: 400;
1151
+ };
1152
+ readonly export_not_found: {
1153
+ readonly status: 404;
1154
+ };
1155
+ readonly export_not_ready: {
1156
+ readonly status: 409;
1157
+ };
1158
+ readonly export_failed: {
1159
+ readonly status: 409;
1160
+ };
1161
+ readonly export_running: {
1162
+ readonly status: 409;
1163
+ };
1164
+ readonly export_in_progress: {
1165
+ readonly status: 409;
1166
+ };
1167
+ readonly export_expired: {
1168
+ readonly status: 410;
1169
+ };
1170
+ readonly export_corrupt: {
1171
+ readonly status: 500;
1172
+ };
1173
+ readonly confirmation_mismatch: {
1174
+ readonly status: 400;
1175
+ };
1176
+ readonly erase_scheduled: {
1177
+ readonly status: 409;
1178
+ };
1179
+ readonly erase_started: {
1180
+ readonly status: 409;
1181
+ };
1182
+ readonly erase_not_found: {
1183
+ readonly status: 404;
1184
+ };
1185
+ readonly ai_disabled: {
1186
+ readonly status: 400;
1187
+ };
1188
+ readonly ai_unavailable: {
1189
+ readonly status: 502;
1190
+ };
1191
+ readonly ai_suspended: {
1192
+ readonly status: 502;
1193
+ };
1194
+ readonly ai_refused: {
1195
+ readonly status: 400;
1196
+ };
1197
+ readonly unknown_message: {
1198
+ readonly status: 422;
1199
+ };
1200
+ readonly email_validation_disabled: {
1201
+ readonly status: 400;
1202
+ };
1203
+ readonly email_validation_unavailable: {
1204
+ readonly status: 502;
1205
+ };
1206
+ readonly email_validation_suspended: {
1207
+ readonly status: 502;
1208
+ };
1209
+ };
1210
+ export type Reasons = typeof REASONS;
1211
+ export type ErrorReason = keyof Reasons;
1212
+ export type ReasonStatus<R extends ErrorReason> = Reasons[R]["status"];
1213
+ export type ReasonDataSchema<R extends ErrorReason> = Reasons[R] extends {
1214
+ data: infer S extends z.ZodType;
1215
+ } ? S : undefined;
1216
+ export type ReasonData<R extends ErrorReason> = ReasonDataSchema<R> extends z.ZodType ? z.output<ReasonDataSchema<R>> : undefined;
1217
+ export declare function reasonGuards<T extends ReasonTable>(table: T): {
1218
+ isReason: (code: unknown) => code is keyof T & string;
1219
+ reasonOf(error: unknown): (keyof T & string) | null;
1220
+ };
1221
+ export declare const isErrorReason: (code: unknown) => code is ErrorReason;
1222
+ export declare const reasonOf: (error: unknown) => ErrorReason | null;