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

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 (56) hide show
  1. package/README.md +233 -2
  2. package/client.d.ts +36 -0
  3. package/contract/accounts/models.d.ts +726 -0
  4. package/contract/accounts/routes.d.ts +1318 -0
  5. package/contract/ai/models.d.ts +30 -0
  6. package/contract/ai/routes.d.ts +89 -0
  7. package/contract/audit-log/models.d.ts +107 -0
  8. package/contract/audit-log/routes.d.ts +72 -0
  9. package/contract/calendar/models.d.ts +837 -0
  10. package/contract/calendar/routes.d.ts +1299 -0
  11. package/contract/connect/models.d.ts +272 -0
  12. package/contract/connect/routes.d.ts +531 -0
  13. package/contract/contacts/models.d.ts +269 -0
  14. package/contract/contacts/routes.d.ts +634 -0
  15. package/contract/errors.d.ts +108 -0
  16. package/contract/events/models.d.ts +2364 -0
  17. package/contract/events/routes.d.ts +107 -0
  18. package/contract/exports/models.d.ts +67 -0
  19. package/contract/exports/routes.d.ts +196 -0
  20. package/contract/identities/models.d.ts +100 -0
  21. package/contract/identities/routes.d.ts +249 -0
  22. package/contract/limits.d.ts +170 -0
  23. package/contract/mail/models.d.ts +528 -0
  24. package/contract/mail/routes.d.ts +749 -0
  25. package/contract/meetings/models.d.ts +232 -0
  26. package/contract/meetings/routes.d.ts +386 -0
  27. package/contract/oauth-apps/models.d.ts +92 -0
  28. package/contract/oauth-apps/routes.d.ts +187 -0
  29. package/contract/org-connections/models.d.ts +383 -0
  30. package/contract/org-connections/routes.d.ts +830 -0
  31. package/contract/primitives.d.ts +140 -0
  32. package/contract/public.d.ts +26 -0
  33. package/contract/reasons.d.ts +711 -0
  34. package/contract/router.d.ts +9773 -0
  35. package/contract/send/models.d.ts +750 -0
  36. package/contract/send/routes.d.ts +1239 -0
  37. package/contract/settings/models.d.ts +103 -0
  38. package/contract/settings/routes.d.ts +110 -0
  39. package/contract/suppressions/models.d.ts +231 -0
  40. package/contract/suppressions/routes.d.ts +317 -0
  41. package/contract/templates/models.d.ts +169 -0
  42. package/contract/templates/routes.d.ts +281 -0
  43. package/contract/threads/models.d.ts +117 -0
  44. package/contract/threads/routes.d.ts +336 -0
  45. package/contract/usage/models.d.ts +213 -0
  46. package/contract/usage/routes.d.ts +81 -0
  47. package/contract/webhooks/models.d.ts +879 -0
  48. package/contract/webhooks/routes.d.ts +839 -0
  49. package/contract/webhooks/signing.d.ts +35 -0
  50. package/errors.d.ts +15 -0
  51. package/index.d.ts +6 -0
  52. package/index.js +4334 -0
  53. package/index.js.map +59 -0
  54. package/package.json +45 -4
  55. package/pagination.d.ts +40 -0
  56. package/webhooks.d.ts +28 -0
@@ -0,0 +1,711 @@
1
+ import * as z from "zod";
2
+ /** The HTTP statuses API errors answer with. */
3
+ export type ErrorStatus = 400 | 401 | 402 | 403 | 404 | 409 | 410 | 413 | 422 | 429 | 500 | 502 | 503 | 507;
4
+ export interface ReasonDefinition {
5
+ readonly status: ErrorStatus;
6
+ /** The schema of the error's `data`, for a reason that carries structured extras. */
7
+ readonly data?: z.ZodType;
8
+ }
9
+ export type ReasonTable = Record<string, ReasonDefinition>;
10
+ /** One input problem: where in the input (`path`, empty for the input as a whole) and what. */
11
+ export declare const InputIssue: z.ZodObject<{
12
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
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 [z.ZodString, z.ZodNumber]>>;
19
+ message: z.ZodString;
20
+ }, z.core.$strip>>;
21
+ }, z.core.$strip>;
22
+ export type InvalidInputData = z.infer<typeof InvalidInputData>;
23
+ /** The ids a request named that the tenant does not have. */
24
+ export declare const UnknownIdsData: z.ZodObject<{
25
+ ids: z.ZodArray<z.ZodUUID>;
26
+ }, z.core.$strip>;
27
+ export type UnknownIdsData = z.infer<typeof UnknownIdsData>;
28
+ /** The template content field that did not compile or render. */
29
+ export declare const TemplateFieldData: z.ZodObject<{
30
+ field: z.ZodEnum<{
31
+ text: "text";
32
+ subject: "subject";
33
+ html: "html";
34
+ previewText: "previewText";
35
+ }>;
36
+ }, z.core.$strip>;
37
+ export type TemplateFieldData = z.infer<typeof TemplateFieldData>;
38
+ export declare const REASONS: {
39
+ readonly invalid_input: {
40
+ readonly status: 400;
41
+ readonly data: z.ZodObject<{
42
+ issues: z.ZodArray<z.ZodObject<{
43
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
44
+ message: z.ZodString;
45
+ }, z.core.$strip>>;
46
+ }, z.core.$strip>;
47
+ };
48
+ readonly invalid_cursor: {
49
+ readonly status: 400;
50
+ };
51
+ readonly invalid_range: {
52
+ readonly status: 400;
53
+ };
54
+ readonly payload_too_large: {
55
+ readonly status: 413;
56
+ };
57
+ readonly invalid_payload: {
58
+ readonly status: 400;
59
+ };
60
+ readonly invalid_signature: {
61
+ readonly status: 400;
62
+ };
63
+ readonly route_not_found: {
64
+ readonly status: 404;
65
+ };
66
+ readonly internal_error: {
67
+ readonly status: 500;
68
+ };
69
+ readonly invalid_idempotency_key: {
70
+ readonly status: 400;
71
+ };
72
+ readonly idempotency_key_reused: {
73
+ readonly status: 422;
74
+ };
75
+ readonly idempotency_key_in_progress: {
76
+ readonly status: 409;
77
+ };
78
+ readonly rate_limited: {
79
+ readonly status: 429;
80
+ };
81
+ readonly too_many_requests: {
82
+ readonly status: 429;
83
+ };
84
+ readonly overloaded: {
85
+ readonly status: 503;
86
+ };
87
+ readonly unauthenticated: {
88
+ readonly status: 401;
89
+ };
90
+ readonly api_key_expired: {
91
+ readonly status: 401;
92
+ };
93
+ readonly missing_scope: {
94
+ readonly status: 403;
95
+ };
96
+ readonly role_forbidden: {
97
+ readonly status: 403;
98
+ };
99
+ readonly account_token_forbidden: {
100
+ readonly status: 403;
101
+ };
102
+ readonly session_required: {
103
+ readonly status: 403;
104
+ };
105
+ readonly owner_required: {
106
+ readonly status: 403;
107
+ };
108
+ readonly platform_admin_required: {
109
+ readonly status: 403;
110
+ };
111
+ readonly email_verification_required: {
112
+ readonly status: 403;
113
+ };
114
+ readonly console_only: {
115
+ readonly status: 403;
116
+ };
117
+ readonly plan_limit_accounts: {
118
+ readonly status: 403;
119
+ };
120
+ readonly plan_limit_sends: {
121
+ readonly status: 403;
122
+ };
123
+ readonly plan_limit_webhooks: {
124
+ readonly status: 403;
125
+ };
126
+ readonly plan_limit_storage: {
127
+ readonly status: 403;
128
+ };
129
+ readonly plan_module_unavailable: {
130
+ readonly status: 403;
131
+ };
132
+ readonly storage_unavailable: {
133
+ readonly status: 400;
134
+ };
135
+ readonly tenant_not_found: {
136
+ readonly status: 404;
137
+ };
138
+ readonly billing_past_due: {
139
+ readonly status: 402;
140
+ };
141
+ readonly billing_disabled: {
142
+ readonly status: 404;
143
+ };
144
+ readonly billing_unavailable: {
145
+ readonly status: 502;
146
+ };
147
+ readonly billing_subscription_exists: {
148
+ readonly status: 409;
149
+ };
150
+ readonly billing_customer_missing: {
151
+ readonly status: 409;
152
+ };
153
+ readonly plan_not_billable: {
154
+ readonly status: 409;
155
+ };
156
+ readonly account_not_found: {
157
+ readonly status: 404;
158
+ };
159
+ readonly unknown_account: {
160
+ readonly status: 422;
161
+ readonly data: z.ZodObject<{
162
+ ids: z.ZodArray<z.ZodUUID>;
163
+ }, z.core.$strip>;
164
+ };
165
+ readonly account_paused: {
166
+ readonly status: 409;
167
+ };
168
+ readonly account_disabled: {
169
+ readonly status: 409;
170
+ };
171
+ readonly account_reauth_required: {
172
+ readonly status: 409;
173
+ };
174
+ readonly account_misconfigured: {
175
+ readonly status: 409;
176
+ };
177
+ readonly calendar_disabled: {
178
+ readonly status: 409;
179
+ };
180
+ readonly contacts_disabled: {
181
+ readonly status: 409;
182
+ };
183
+ readonly provider_not_found: {
184
+ readonly status: 404;
185
+ };
186
+ readonly provider_throttled: {
187
+ readonly status: 429;
188
+ };
189
+ readonly provider_unavailable: {
190
+ readonly status: 502;
191
+ };
192
+ readonly provider_forbidden: {
193
+ readonly status: 403;
194
+ };
195
+ readonly provider_conflict: {
196
+ readonly status: 409;
197
+ };
198
+ readonly provider_unsupported: {
199
+ readonly status: 400;
200
+ };
201
+ readonly provider_rejected: {
202
+ readonly status: 400;
203
+ };
204
+ readonly outcome_unknown: {
205
+ readonly status: 502;
206
+ };
207
+ readonly message_not_found: {
208
+ readonly status: 404;
209
+ };
210
+ readonly unknown_mailbox: {
211
+ readonly status: 422;
212
+ readonly data: z.ZodObject<{
213
+ ids: z.ZodArray<z.ZodUUID>;
214
+ }, z.core.$strip>;
215
+ };
216
+ readonly mailbox_not_label: {
217
+ readonly status: 400;
218
+ };
219
+ readonly thread_not_found: {
220
+ readonly status: 404;
221
+ };
222
+ readonly identity_not_found: {
223
+ readonly status: 404;
224
+ };
225
+ readonly identities_managed_by_provider: {
226
+ readonly status: 400;
227
+ };
228
+ readonly identity_exists: {
229
+ readonly status: 409;
230
+ };
231
+ readonly identity_not_custom: {
232
+ readonly status: 400;
233
+ };
234
+ readonly draft_not_found: {
235
+ readonly status: 404;
236
+ };
237
+ readonly draft_lost: {
238
+ readonly status: 502;
239
+ };
240
+ readonly send_not_found: {
241
+ readonly status: 404;
242
+ };
243
+ readonly attachments_too_large: {
244
+ readonly status: 400;
245
+ };
246
+ readonly not_a_draft: {
247
+ readonly status: 400;
248
+ };
249
+ readonly unknown_reply_target: {
250
+ readonly status: 422;
251
+ };
252
+ readonly from_not_allowed: {
253
+ readonly status: 400;
254
+ };
255
+ readonly tracking_unsupported: {
256
+ readonly status: 400;
257
+ };
258
+ readonly honeypot_needs_click_tracking: {
259
+ readonly status: 400;
260
+ };
261
+ readonly list_send_recipients: {
262
+ readonly status: 400;
263
+ };
264
+ readonly suppressed: {
265
+ readonly status: 400;
266
+ };
267
+ readonly no_recipients: {
268
+ readonly status: 400;
269
+ };
270
+ readonly list_unsubscribe_unavailable: {
271
+ readonly status: 400;
272
+ };
273
+ readonly send_not_reschedulable: {
274
+ readonly status: 409;
275
+ };
276
+ readonly send_not_cancellable: {
277
+ readonly status: 409;
278
+ };
279
+ readonly suppression_list_not_found: {
280
+ readonly status: 404;
281
+ };
282
+ readonly suppression_entry_not_found: {
283
+ readonly status: 404;
284
+ };
285
+ readonly suppression_review_not_found: {
286
+ readonly status: 404;
287
+ };
288
+ readonly suppression_list_exists: {
289
+ readonly status: 409;
290
+ };
291
+ readonly suppression_list_not_empty: {
292
+ readonly status: 409;
293
+ };
294
+ readonly template_not_found: {
295
+ readonly status: 404;
296
+ };
297
+ readonly unknown_template: {
298
+ readonly status: 422;
299
+ };
300
+ readonly template_and_inline_fields: {
301
+ readonly status: 400;
302
+ };
303
+ readonly invalid_template: {
304
+ readonly status: 400;
305
+ readonly data: z.ZodObject<{
306
+ field: z.ZodEnum<{
307
+ text: "text";
308
+ subject: "subject";
309
+ html: "html";
310
+ previewText: "previewText";
311
+ }>;
312
+ }, z.core.$strip>;
313
+ };
314
+ readonly template_account_mismatch: {
315
+ readonly status: 400;
316
+ };
317
+ readonly template_render_failed: {
318
+ readonly status: 400;
319
+ readonly data: z.ZodObject<{
320
+ field: z.ZodEnum<{
321
+ text: "text";
322
+ subject: "subject";
323
+ html: "html";
324
+ previewText: "previewText";
325
+ }>;
326
+ }, z.core.$strip>;
327
+ };
328
+ readonly params_too_large: {
329
+ readonly status: 400;
330
+ };
331
+ readonly template_name_taken: {
332
+ readonly status: 409;
333
+ };
334
+ readonly calendar_not_found: {
335
+ readonly status: 404;
336
+ };
337
+ readonly calendar_event_not_found: {
338
+ readonly status: 404;
339
+ };
340
+ readonly contact_not_found: {
341
+ readonly status: 404;
342
+ };
343
+ readonly photo_not_found: {
344
+ readonly status: 404;
345
+ };
346
+ readonly unknown_calendar: {
347
+ readonly status: 422;
348
+ };
349
+ readonly unknown_contact_folder: {
350
+ readonly status: 422;
351
+ };
352
+ readonly calendar_read_only: {
353
+ readonly status: 403;
354
+ };
355
+ readonly organizer_cannot_respond: {
356
+ readonly status: 409;
357
+ };
358
+ readonly invalid_time_zone: {
359
+ readonly status: 400;
360
+ };
361
+ readonly invalid_working_hours: {
362
+ readonly status: 400;
363
+ };
364
+ readonly mixed_event_times: {
365
+ readonly status: 400;
366
+ };
367
+ readonly invalid_recurrence: {
368
+ readonly status: 400;
369
+ };
370
+ readonly recurrence_on_instance: {
371
+ readonly status: 400;
372
+ };
373
+ readonly contact_unidentifiable: {
374
+ readonly status: 400;
375
+ };
376
+ readonly multiple_meeting_options: {
377
+ readonly status: 400;
378
+ };
379
+ readonly meeting_service_not_connected: {
380
+ readonly status: 409;
381
+ };
382
+ readonly meeting_service_reauth_required: {
383
+ readonly status: 409;
384
+ };
385
+ readonly meeting_host_missing: {
386
+ readonly status: 409;
387
+ };
388
+ readonly meeting_recurrence_unsupported: {
389
+ readonly status: 400;
390
+ };
391
+ readonly meeting_service_rejected: {
392
+ readonly status: 400;
393
+ };
394
+ readonly meeting_deleted: {
395
+ readonly status: 409;
396
+ };
397
+ readonly meeting_service_unavailable: {
398
+ readonly status: 502;
399
+ };
400
+ readonly meeting_app_not_found: {
401
+ readonly status: 404;
402
+ };
403
+ readonly unknown_meeting_app: {
404
+ readonly status: 422;
405
+ };
406
+ readonly meeting_connection_not_found: {
407
+ readonly status: 404;
408
+ };
409
+ readonly meeting_connect_session_not_found: {
410
+ readonly status: 404;
411
+ };
412
+ readonly meeting_app_exists: {
413
+ readonly status: 409;
414
+ };
415
+ readonly meeting_app_in_use: {
416
+ readonly status: 409;
417
+ };
418
+ readonly meeting_app_mismatch: {
419
+ readonly status: 400;
420
+ };
421
+ readonly meeting_app_secret_unreadable: {
422
+ readonly status: 400;
423
+ };
424
+ readonly not_testable: {
425
+ readonly status: 400;
426
+ };
427
+ readonly autodiscovery_failed: {
428
+ readonly status: 422;
429
+ };
430
+ readonly password_required: {
431
+ readonly status: 400;
432
+ };
433
+ readonly oauth_servers_fixed: {
434
+ readonly status: 400;
435
+ };
436
+ readonly dav_discovery_failed: {
437
+ readonly status: 400;
438
+ };
439
+ readonly dav_unsupported: {
440
+ readonly status: 400;
441
+ };
442
+ readonly login_failed: {
443
+ readonly status: 400;
444
+ };
445
+ readonly server_not_allowed: {
446
+ readonly status: 400;
447
+ };
448
+ readonly plaintext_not_allowed: {
449
+ readonly status: 400;
450
+ };
451
+ readonly not_dav_server: {
452
+ readonly status: 400;
453
+ };
454
+ readonly not_imap_account: {
455
+ readonly status: 400;
456
+ };
457
+ readonly password_not_stored: {
458
+ readonly status: 400;
459
+ };
460
+ readonly password_unsupported: {
461
+ readonly status: 400;
462
+ };
463
+ readonly connect_session_not_found: {
464
+ readonly status: 404;
465
+ };
466
+ readonly session_used: {
467
+ readonly status: 409;
468
+ };
469
+ readonly session_expired: {
470
+ readonly status: 400;
471
+ };
472
+ readonly provider_not_allowed: {
473
+ readonly status: 400;
474
+ };
475
+ readonly redirect_uri_not_allowed: {
476
+ readonly status: 400;
477
+ };
478
+ readonly access_denied: {
479
+ readonly status: 400;
480
+ };
481
+ readonly access_token_rejected: {
482
+ readonly status: 400;
483
+ };
484
+ readonly account_exists: {
485
+ readonly status: 409;
486
+ };
487
+ readonly account_mismatch: {
488
+ readonly status: 409;
489
+ };
490
+ readonly consent_failed: {
491
+ readonly status: 400;
492
+ };
493
+ readonly consent_revoked: {
494
+ readonly status: 400;
495
+ };
496
+ readonly consent_unverified: {
497
+ readonly status: 400;
498
+ };
499
+ readonly credential_conflict: {
500
+ readonly status: 400;
501
+ };
502
+ readonly credential_missing: {
503
+ readonly status: 400;
504
+ };
505
+ readonly identity_failed: {
506
+ readonly status: 400;
507
+ };
508
+ readonly identity_unavailable: {
509
+ readonly status: 400;
510
+ };
511
+ readonly invalid_client: {
512
+ readonly status: 400;
513
+ };
514
+ readonly invalid_grant: {
515
+ readonly status: 400;
516
+ };
517
+ readonly missing_refresh_token: {
518
+ readonly status: 400;
519
+ };
520
+ readonly unknown_oauth_app: {
521
+ readonly status: 422;
522
+ };
523
+ readonly oauth_app_not_found: {
524
+ readonly status: 404;
525
+ };
526
+ readonly oauth_app_mismatch: {
527
+ readonly status: 400;
528
+ };
529
+ readonly oauth_app_in_use: {
530
+ readonly status: 409;
531
+ };
532
+ readonly oauth_app_secret_unreadable: {
533
+ readonly status: 400;
534
+ };
535
+ readonly google_imap_requires_own_app: {
536
+ readonly status: 400;
537
+ };
538
+ readonly org_connection_account: {
539
+ readonly status: 400;
540
+ };
541
+ readonly shared_mailbox_account: {
542
+ readonly status: 400;
543
+ };
544
+ readonly gmail_push_unsupported: {
545
+ readonly status: 400;
546
+ };
547
+ readonly push_unavailable: {
548
+ readonly status: 400;
549
+ };
550
+ readonly cloud_required: {
551
+ readonly status: 400;
552
+ };
553
+ readonly provider_error: {
554
+ readonly status: 400;
555
+ };
556
+ readonly provider_not_configured: {
557
+ readonly status: 400;
558
+ };
559
+ readonly unsupported_provider: {
560
+ readonly status: 400;
561
+ };
562
+ readonly scope_denied: {
563
+ readonly status: 400;
564
+ };
565
+ readonly token_exchange_failed: {
566
+ readonly status: 400;
567
+ };
568
+ readonly org_connection_not_found: {
569
+ readonly status: 404;
570
+ };
571
+ readonly org_connection_secret_unreadable: {
572
+ readonly status: 400;
573
+ };
574
+ readonly consent_required: {
575
+ readonly status: 409;
576
+ };
577
+ readonly delegate_missing: {
578
+ readonly status: 400;
579
+ };
580
+ readonly directory_unavailable: {
581
+ readonly status: 409;
582
+ };
583
+ readonly directory_already_connected: {
584
+ readonly status: 409;
585
+ };
586
+ readonly directory_mismatch: {
587
+ readonly status: 400;
588
+ };
589
+ readonly directory_id_not_allowed: {
590
+ readonly status: 400;
591
+ };
592
+ readonly credential_mismatch: {
593
+ readonly status: 400;
594
+ };
595
+ readonly connection_in_use: {
596
+ readonly status: 409;
597
+ };
598
+ readonly invalid_certificate: {
599
+ readonly status: 400;
600
+ };
601
+ readonly invalid_service_account_key: {
602
+ readonly status: 400;
603
+ };
604
+ readonly not_microsoft: {
605
+ readonly status: 400;
606
+ };
607
+ readonly user_required: {
608
+ readonly status: 400;
609
+ };
610
+ readonly shared_mailbox_unsupported: {
611
+ readonly status: 400;
612
+ };
613
+ readonly scope_missing: {
614
+ readonly status: 400;
615
+ };
616
+ readonly shared_mailbox_inaccessible: {
617
+ readonly status: 422;
618
+ };
619
+ readonly webhook_endpoint_not_found: {
620
+ readonly status: 404;
621
+ };
622
+ readonly endpoint_disabled: {
623
+ readonly status: 409;
624
+ };
625
+ readonly event_not_found: {
626
+ readonly status: 404;
627
+ };
628
+ readonly replay_range_too_large: {
629
+ readonly status: 400;
630
+ };
631
+ readonly mailbox_outside_accounts: {
632
+ readonly status: 400;
633
+ };
634
+ readonly https_required: {
635
+ readonly status: 400;
636
+ };
637
+ readonly export_not_found: {
638
+ readonly status: 404;
639
+ };
640
+ readonly export_not_ready: {
641
+ readonly status: 409;
642
+ };
643
+ readonly export_failed: {
644
+ readonly status: 409;
645
+ };
646
+ readonly export_running: {
647
+ readonly status: 409;
648
+ };
649
+ readonly export_in_progress: {
650
+ readonly status: 409;
651
+ };
652
+ readonly export_expired: {
653
+ readonly status: 410;
654
+ };
655
+ readonly export_corrupt: {
656
+ readonly status: 500;
657
+ };
658
+ readonly confirmation_mismatch: {
659
+ readonly status: 400;
660
+ };
661
+ readonly erase_scheduled: {
662
+ readonly status: 409;
663
+ };
664
+ readonly erase_started: {
665
+ readonly status: 409;
666
+ };
667
+ readonly erase_not_found: {
668
+ readonly status: 404;
669
+ };
670
+ readonly ai_disabled: {
671
+ readonly status: 400;
672
+ };
673
+ readonly ai_unavailable: {
674
+ readonly status: 502;
675
+ };
676
+ readonly ai_suspended: {
677
+ readonly status: 502;
678
+ };
679
+ readonly ai_refused: {
680
+ readonly status: 400;
681
+ };
682
+ readonly unknown_message: {
683
+ readonly status: 422;
684
+ };
685
+ };
686
+ export type Reasons = typeof REASONS;
687
+ /** A reason the /v1 API answers with. The workspace's ErrorReason (index.ts) adds the console's. */
688
+ export type ErrorReason = keyof Reasons;
689
+ /** The HTTP status `R` answers with. */
690
+ export type ReasonStatus<R extends ErrorReason> = Reasons[R]["status"];
691
+ /** The schema of `R`'s data, or undefined for a reason without data. */
692
+ export type ReasonDataSchema<R extends ErrorReason> = Reasons[R] extends {
693
+ data: infer S extends z.ZodType;
694
+ } ? S : undefined;
695
+ /** The data an error with reason `R` carries (undefined for a reason without data). */
696
+ export type ReasonData<R extends ErrorReason> = ReasonDataSchema<R> extends z.ZodType ? z.output<ReasonDataSchema<R>> : undefined;
697
+ /** The reason checks over a table: the /v1 one below, the console's merged one in console/. */
698
+ export declare function reasonGuards<T extends ReasonTable>(table: T): {
699
+ isReason: (code: unknown) => code is keyof T & string;
700
+ /**
701
+ * The reason of an API error: the `code` of an oRPC error (or any `{ code }` error body) when
702
+ * it is in the table, else null. The one way every app reads a refusal's reason.
703
+ */
704
+ reasonOf(error: unknown): (keyof T & string) | null;
705
+ };
706
+ export declare const isErrorReason: (code: unknown) => code is ErrorReason;
707
+ /**
708
+ * The reason of an API error: the `code` of an oRPC error (or any `{ code }` error body) when it
709
+ * is one of REASONS, else null. The one way every app reads a refusal's reason.
710
+ */
711
+ export declare const reasonOf: (error: unknown) => ErrorReason | null;