@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
@@ -15,6 +15,8 @@ export declare const contactFolders: {
15
15
  readonly missing_scope: "The API key lacks the scope the operation needs.";
16
16
  readonly role_forbidden: "The member's role does not allow the operation.";
17
17
  readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
18
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
19
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
18
20
  readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
19
21
  readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
20
22
  readonly overloaded: "The API is shedding load; retry after Retry-After.";
@@ -87,6 +89,8 @@ export declare const contacts: {
87
89
  readonly missing_scope: "The API key lacks the scope the operation needs.";
88
90
  readonly role_forbidden: "The member's role does not allow the operation.";
89
91
  readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
92
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
93
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
90
94
  readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
91
95
  readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
92
96
  readonly overloaded: "The API is shedding load; retry after Retry-After.";
@@ -159,6 +163,8 @@ export declare const contacts: {
159
163
  readonly missing_scope: "The API key lacks the scope the operation needs.";
160
164
  readonly role_forbidden: "The member's role does not allow the operation.";
161
165
  readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
166
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
167
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
162
168
  readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
163
169
  readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
164
170
  readonly overloaded: "The API is shedding load; retry after Retry-After.";
@@ -195,6 +201,8 @@ export declare const contacts: {
195
201
  readonly missing_scope: "The API key lacks the scope the operation needs.";
196
202
  readonly role_forbidden: "The member's role does not allow the operation.";
197
203
  readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
204
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
205
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
198
206
  readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
199
207
  readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
200
208
  readonly overloaded: "The API is shedding load; retry after Retry-After.";
@@ -334,6 +342,8 @@ export declare const contacts: {
334
342
  readonly missing_scope: "The API key lacks the scope the operation needs.";
335
343
  readonly role_forbidden: "The member's role does not allow the operation.";
336
344
  readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
345
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
346
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
337
347
  readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
338
348
  readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
339
349
  readonly overloaded: "The API is shedding load; retry after Retry-After.";
@@ -481,6 +491,8 @@ export declare const contacts: {
481
491
  readonly missing_scope: "The API key lacks the scope the operation needs.";
482
492
  readonly role_forbidden: "The member's role does not allow the operation.";
483
493
  readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
494
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
495
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
484
496
  readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
485
497
  readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
486
498
  readonly overloaded: "The API is shedding load; retry after Retry-After.";
@@ -565,6 +577,8 @@ export declare const contacts: {
565
577
  readonly missing_scope: "The API key lacks the scope the operation needs.";
566
578
  readonly role_forbidden: "The member's role does not allow the operation.";
567
579
  readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
580
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
581
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
568
582
  readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
569
583
  readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
570
584
  readonly overloaded: "The API is shedding load; retry after Retry-After.";
@@ -0,0 +1,12 @@
1
+ import * as z from "zod";
2
+ export declare const customDomainHostname: (example: string) => z.ZodString;
3
+ export declare const CUSTOM_DOMAIN_STATUSES: readonly [
4
+ "pending",
5
+ "active",
6
+ "failed"
7
+ ];
8
+ export declare const customDomainRecord: () => z.ZodObject<{
9
+ type: z.ZodString;
10
+ name: z.ZodString;
11
+ value: z.ZodString;
12
+ }, z.core.$strip>;
@@ -0,0 +1,119 @@
1
+ import * as z from "zod";
2
+ export declare const Reachability: z.ZodEnum<{
3
+ unknown: "unknown";
4
+ safe: "safe";
5
+ risky: "risky";
6
+ invalid: "invalid";
7
+ }>;
8
+ export type Reachability = z.infer<typeof Reachability>;
9
+ export declare const CreateEmailValidation: z.ZodObject<{
10
+ addresses: z.ZodArray<z.ZodEmail>;
11
+ suppressInvalid: z.ZodDefault<z.ZodBoolean>;
12
+ refresh: z.ZodDefault<z.ZodBoolean>;
13
+ }, z.core.$strip>;
14
+ export type CreateEmailValidation = z.infer<typeof CreateEmailValidation>;
15
+ export declare const EmailValidationResult: z.ZodObject<{
16
+ address: z.ZodString;
17
+ reachability: z.ZodEnum<{
18
+ unknown: "unknown";
19
+ safe: "safe";
20
+ risky: "risky";
21
+ invalid: "invalid";
22
+ }>;
23
+ validSyntax: z.ZodBoolean;
24
+ domainAcceptsMail: z.ZodNullable<z.ZodBoolean>;
25
+ deliverable: z.ZodNullable<z.ZodBoolean>;
26
+ disabled: z.ZodNullable<z.ZodBoolean>;
27
+ fullInbox: z.ZodNullable<z.ZodBoolean>;
28
+ catchAll: z.ZodNullable<z.ZodBoolean>;
29
+ disposable: z.ZodNullable<z.ZodBoolean>;
30
+ roleAccount: z.ZodNullable<z.ZodBoolean>;
31
+ suppressed: z.ZodBoolean;
32
+ cached: z.ZodBoolean;
33
+ checkedAt: z.ZodPreprocess<z.ZodDate, Date>;
34
+ }, z.core.$strip>;
35
+ export type EmailValidationResult = z.infer<typeof EmailValidationResult>;
36
+ export declare const EmailValidation: z.ZodObject<{
37
+ results: z.ZodArray<z.ZodObject<{
38
+ address: z.ZodString;
39
+ reachability: z.ZodEnum<{
40
+ unknown: "unknown";
41
+ safe: "safe";
42
+ risky: "risky";
43
+ invalid: "invalid";
44
+ }>;
45
+ validSyntax: z.ZodBoolean;
46
+ domainAcceptsMail: z.ZodNullable<z.ZodBoolean>;
47
+ deliverable: z.ZodNullable<z.ZodBoolean>;
48
+ disabled: z.ZodNullable<z.ZodBoolean>;
49
+ fullInbox: z.ZodNullable<z.ZodBoolean>;
50
+ catchAll: z.ZodNullable<z.ZodBoolean>;
51
+ disposable: z.ZodNullable<z.ZodBoolean>;
52
+ roleAccount: z.ZodNullable<z.ZodBoolean>;
53
+ suppressed: z.ZodBoolean;
54
+ cached: z.ZodBoolean;
55
+ checkedAt: z.ZodPreprocess<z.ZodDate, Date>;
56
+ }, z.core.$strip>>;
57
+ }, z.core.$strip>;
58
+ export type EmailValidation = z.infer<typeof EmailValidation>;
59
+ export declare const EmailValidationRecord: z.ZodObject<{
60
+ address: z.ZodString;
61
+ reachability: z.ZodEnum<{
62
+ unknown: "unknown";
63
+ safe: "safe";
64
+ risky: "risky";
65
+ invalid: "invalid";
66
+ }>;
67
+ validSyntax: z.ZodBoolean;
68
+ domainAcceptsMail: z.ZodNullable<z.ZodBoolean>;
69
+ deliverable: z.ZodNullable<z.ZodBoolean>;
70
+ disabled: z.ZodNullable<z.ZodBoolean>;
71
+ fullInbox: z.ZodNullable<z.ZodBoolean>;
72
+ catchAll: z.ZodNullable<z.ZodBoolean>;
73
+ disposable: z.ZodNullable<z.ZodBoolean>;
74
+ roleAccount: z.ZodNullable<z.ZodBoolean>;
75
+ suppressed: z.ZodBoolean;
76
+ cached: z.ZodBoolean;
77
+ checkedAt: z.ZodPreprocess<z.ZodDate, Date>;
78
+ id: z.ZodUUID;
79
+ createdAt: z.ZodPreprocess<z.ZodDate, Date>;
80
+ }, z.core.$strip>;
81
+ export type EmailValidationRecord = z.infer<typeof EmailValidationRecord>;
82
+ export declare const EmailValidationRecordPage: z.ZodObject<{
83
+ items: z.ZodArray<z.ZodObject<{
84
+ address: z.ZodString;
85
+ reachability: z.ZodEnum<{
86
+ unknown: "unknown";
87
+ safe: "safe";
88
+ risky: "risky";
89
+ invalid: "invalid";
90
+ }>;
91
+ validSyntax: z.ZodBoolean;
92
+ domainAcceptsMail: z.ZodNullable<z.ZodBoolean>;
93
+ deliverable: z.ZodNullable<z.ZodBoolean>;
94
+ disabled: z.ZodNullable<z.ZodBoolean>;
95
+ fullInbox: z.ZodNullable<z.ZodBoolean>;
96
+ catchAll: z.ZodNullable<z.ZodBoolean>;
97
+ disposable: z.ZodNullable<z.ZodBoolean>;
98
+ roleAccount: z.ZodNullable<z.ZodBoolean>;
99
+ suppressed: z.ZodBoolean;
100
+ cached: z.ZodBoolean;
101
+ checkedAt: z.ZodPreprocess<z.ZodDate, Date>;
102
+ id: z.ZodUUID;
103
+ createdAt: z.ZodPreprocess<z.ZodDate, Date>;
104
+ }, z.core.$strip>>;
105
+ nextCursor: z.ZodNullable<z.ZodString>;
106
+ }, z.core.$strip>;
107
+ export type EmailValidationRecordPage = z.infer<typeof EmailValidationRecordPage>;
108
+ export declare const ListEmailValidationsQuery: z.ZodObject<{
109
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
110
+ cursor: z.ZodOptional<z.ZodString>;
111
+ address: z.ZodOptional<z.ZodString>;
112
+ reachability: z.ZodOptional<z.ZodEnum<{
113
+ unknown: "unknown";
114
+ safe: "safe";
115
+ risky: "risky";
116
+ invalid: "invalid";
117
+ }>>;
118
+ }, z.core.$strip>;
119
+ export type ListEmailValidationsQuery = z.infer<typeof ListEmailValidationsQuery>;
@@ -0,0 +1,106 @@
1
+ export declare const emailValidations: {
2
+ create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
3
+ addresses: import("zod").ZodArray<import("zod").ZodEmail>;
4
+ suppressInvalid: import("zod").ZodDefault<import("zod").ZodBoolean>;
5
+ refresh: import("zod").ZodDefault<import("zod").ZodBoolean>;
6
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
7
+ results: import("zod").ZodArray<import("zod").ZodObject<{
8
+ address: import("zod").ZodString;
9
+ reachability: import("zod").ZodEnum<{
10
+ unknown: "unknown";
11
+ safe: "safe";
12
+ risky: "risky";
13
+ invalid: "invalid";
14
+ }>;
15
+ validSyntax: import("zod").ZodBoolean;
16
+ domainAcceptsMail: import("zod").ZodNullable<import("zod").ZodBoolean>;
17
+ deliverable: import("zod").ZodNullable<import("zod").ZodBoolean>;
18
+ disabled: import("zod").ZodNullable<import("zod").ZodBoolean>;
19
+ fullInbox: import("zod").ZodNullable<import("zod").ZodBoolean>;
20
+ catchAll: import("zod").ZodNullable<import("zod").ZodBoolean>;
21
+ disposable: import("zod").ZodNullable<import("zod").ZodBoolean>;
22
+ roleAccount: import("zod").ZodNullable<import("zod").ZodBoolean>;
23
+ suppressed: import("zod").ZodBoolean;
24
+ cached: import("zod").ZodBoolean;
25
+ checkedAt: import("zod").ZodPreprocess<import("zod").ZodDate, Date>;
26
+ }, import("zod/v4/core").$strip>>;
27
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
28
+ readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
29
+ readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
30
+ readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
31
+ readonly missing_scope: "The API key lacks the scope the operation needs.";
32
+ readonly role_forbidden: "The member's role does not allow the operation.";
33
+ readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
34
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
35
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
36
+ readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
37
+ readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
38
+ readonly overloaded: "The API is shedding load; retry after Retry-After.";
39
+ readonly payload_too_large: "The request body is larger than the API accepts.";
40
+ readonly internal_error: "An unexpected failure on our side.";
41
+ readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
42
+ readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
43
+ readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
44
+ }>>, import("../errors.js").DeclaredErrors<{
45
+ readonly email_validation_disabled: "Email validation is unavailable.";
46
+ readonly email_validation_unavailable: "The validation service fails or does not answer in time; no address is suppressed.";
47
+ readonly email_validation_suspended: "The validation service refuses Workwae's requests for now; try again later.";
48
+ readonly plan_limit_validations: "The addresses to check again exceed what the plan allows today (UTC); nothing was checked.";
49
+ readonly plan_required: "The workspace has no plan and is not its owner's Free workspace (the Free plan covers one workspace per owner): choose a plan under Billing.";
50
+ readonly validation_credits_exhausted: "The tenant has fewer email validation credits than the addresses to check again; data.balance and data.needed say how many; nothing was checked.";
51
+ }>>, Record<never, never>>;
52
+ list: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
53
+ limit: import("zod").ZodDefault<import("zod").ZodCoercedNumber<unknown>>;
54
+ cursor: import("zod").ZodOptional<import("zod").ZodString>;
55
+ address: import("zod").ZodOptional<import("zod").ZodString>;
56
+ reachability: import("zod").ZodOptional<import("zod").ZodEnum<{
57
+ unknown: "unknown";
58
+ safe: "safe";
59
+ risky: "risky";
60
+ invalid: "invalid";
61
+ }>>;
62
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
63
+ items: import("zod").ZodArray<import("zod").ZodObject<{
64
+ address: import("zod").ZodString;
65
+ reachability: import("zod").ZodEnum<{
66
+ unknown: "unknown";
67
+ safe: "safe";
68
+ risky: "risky";
69
+ invalid: "invalid";
70
+ }>;
71
+ validSyntax: import("zod").ZodBoolean;
72
+ domainAcceptsMail: import("zod").ZodNullable<import("zod").ZodBoolean>;
73
+ deliverable: import("zod").ZodNullable<import("zod").ZodBoolean>;
74
+ disabled: import("zod").ZodNullable<import("zod").ZodBoolean>;
75
+ fullInbox: import("zod").ZodNullable<import("zod").ZodBoolean>;
76
+ catchAll: import("zod").ZodNullable<import("zod").ZodBoolean>;
77
+ disposable: import("zod").ZodNullable<import("zod").ZodBoolean>;
78
+ roleAccount: import("zod").ZodNullable<import("zod").ZodBoolean>;
79
+ suppressed: import("zod").ZodBoolean;
80
+ cached: import("zod").ZodBoolean;
81
+ checkedAt: import("zod").ZodPreprocess<import("zod").ZodDate, Date>;
82
+ id: import("zod").ZodUUID;
83
+ createdAt: import("zod").ZodPreprocess<import("zod").ZodDate, Date>;
84
+ }, import("zod/v4/core").$strip>>;
85
+ nextCursor: import("zod").ZodNullable<import("zod").ZodString>;
86
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
87
+ readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
88
+ readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
89
+ readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
90
+ readonly missing_scope: "The API key lacks the scope the operation needs.";
91
+ readonly role_forbidden: "The member's role does not allow the operation.";
92
+ readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
93
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
94
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
95
+ readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
96
+ readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
97
+ readonly overloaded: "The API is shedding load; retry after Retry-After.";
98
+ readonly payload_too_large: "The request body is larger than the API accepts.";
99
+ readonly internal_error: "An unexpected failure on our side.";
100
+ readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
101
+ readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
102
+ readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
103
+ }>>, import("../errors.js").DeclaredErrors<{
104
+ readonly invalid_cursor: "The cursor is not one this list issued.";
105
+ }>>, Record<never, never>>;
106
+ };
@@ -1,5 +1,4 @@
1
1
  import { type ErrorReason, type ReasonDataSchema, type ReasonStatus, type ReasonTable } from "./reasons.js";
2
- /** A declared error: its reason's status and data schema, with the condition as its message. */
3
2
  export type DeclaredError<R extends ErrorReason> = {
4
3
  status: ReasonStatus<R>;
5
4
  message: string;
@@ -9,22 +8,14 @@ export type DeclaredError<R extends ErrorReason> = {
9
8
  export type DeclaredErrors<C> = {
10
9
  [R in keyof C & ErrorReason]: DeclaredError<R>;
11
10
  };
12
- /**
13
- * The oRPC error map for `conditions` (reason -> when it is answered, one sentence), each with its
14
- * reason's status and data schema from `table`. errors() below and the console's wrap it; they
15
- * are declared functions with named return types so declarations reference the table by name
16
- * instead of inlining it into every route.
17
- */
18
11
  export declare function errorMap(table: ReasonTable, conditions: Record<string, string | undefined>): Record<string, {
19
12
  status: number;
20
13
  message: string;
21
14
  data?: unknown;
22
15
  }>;
23
- /** The error map of a /v1 route; console routes use console/reasons.ts's, which knows theirs. */
24
16
  export declare function errors<const C extends {
25
17
  [R in ErrorReason]?: string;
26
18
  }>(conditions: C): DeclaredErrors<C>;
27
- /** What any route can answer with, whoever calls it and whatever it does. */
28
19
  export declare const GLOBAL_ERRORS: DeclaredErrors<{
29
20
  readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
30
21
  readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
@@ -32,6 +23,8 @@ export declare const GLOBAL_ERRORS: DeclaredErrors<{
32
23
  readonly missing_scope: "The API key lacks the scope the operation needs.";
33
24
  readonly role_forbidden: "The member's role does not allow the operation.";
34
25
  readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
26
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
27
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
35
28
  readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
36
29
  readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
37
30
  readonly overloaded: "The API is shedding load; retry after Retry-After.";
@@ -41,7 +34,6 @@ export declare const GLOBAL_ERRORS: DeclaredErrors<{
41
34
  readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
42
35
  readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
43
36
  }>;
44
- /** The builder every route starts from: oc with GLOBAL_ERRORS declared. */
45
37
  export declare const base: import("@orpc/contract").ContractBuilder<import("@orpc/contract").Schema<unknown, unknown>, import("@orpc/contract").Schema<unknown, unknown>, import("@orpc/contract").MergedErrorMap<Record<never, never>, DeclaredErrors<{
46
38
  readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
47
39
  readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
@@ -49,6 +41,8 @@ export declare const base: import("@orpc/contract").ContractBuilder<import("@orp
49
41
  readonly missing_scope: "The API key lacks the scope the operation needs.";
50
42
  readonly role_forbidden: "The member's role does not allow the operation.";
51
43
  readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
44
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
45
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
52
46
  readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
53
47
  readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
54
48
  readonly overloaded: "The API is shedding load; retry after Retry-After.";
@@ -59,46 +53,60 @@ export declare const base: import("@orpc/contract").ContractBuilder<import("@orp
59
53
  readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
60
54
  }>>, Record<never, never>>;
61
55
  export declare const SESSION_ONLY: DeclaredErrors<{
62
- readonly session_required: "The caller is not a board session (only board sessions may call this).";
56
+ readonly session_required: "The caller is not a console session (only console sessions may call this).";
63
57
  }>;
64
58
  export declare const OWNER_ONLY: DeclaredErrors<{
65
- readonly session_required: "The caller is not a board session (only board sessions may call this).";
59
+ readonly session_required: "The caller is not a console session (only console sessions may call this).";
66
60
  readonly owner_required: "The caller does not own the organization.";
67
61
  }>;
68
62
  export declare const PLATFORM_ONLY: DeclaredErrors<{
69
- readonly session_required: "The caller is not a board session (only board sessions may call this).";
63
+ readonly session_required: "The caller is not a console session (only console sessions may call this).";
70
64
  readonly platform_admin_required: "The caller is not a platform administrator.";
71
65
  readonly email_verification_required: "The platform administrator has not verified their email address yet.";
72
66
  }>;
73
- /** The account a path names: missing, deleted, or another account than an account token's. */
74
67
  export declare const ACCOUNT_NOT_FOUND: DeclaredErrors<{
75
68
  readonly account_not_found: "The account does not exist, or the caller is an account token for another account.";
76
69
  }>;
77
- /** The account states that keep a route from reaching the provider; `account` names the account
78
- * and may narrow when, e.g. "With source=provider, the account". */
70
+ export declare const MAIL_ACCOUNT: {
71
+ mail_disabled: {
72
+ status: 409;
73
+ message: string;
74
+ };
75
+ account_not_found: {
76
+ status: 404;
77
+ message: string;
78
+ };
79
+ plan_module_unavailable: {
80
+ status: 403;
81
+ message: string;
82
+ };
83
+ };
79
84
  export declare function accountState(account?: string): DeclaredErrors<{
80
85
  readonly account_paused: `${string} is paused.`;
81
86
  readonly account_disabled: `${string} is disabled.`;
82
87
  readonly account_reauth_required: `${string} must be reconnected: its stored grant or login no longer works.`;
83
88
  readonly account_misconfigured: `${string}'s stored grant cannot be used until an administrator fixes what it relies on (the tenant's OAuth app or organization connection is refused, missing or unreadable).`;
84
89
  }>;
85
- /** What any provider call answers when it fails. A route the provider can refuse adds
86
- * `provider_forbidden` with its own condition, and one reading an item `provider_not_found`. */
87
90
  export declare const PROVIDER_FAILURES: DeclaredErrors<{
88
91
  readonly provider_throttled: "The provider asked us to slow down (with Retry-After when it named a wait).";
89
92
  readonly provider_unavailable: "The provider could not be reached (with Retry-After when it named a wait).";
90
93
  }>;
91
- /** What asking for stored bodies through `field` refuses. */
92
94
  export declare function bodyStorage(field: string): DeclaredErrors<{
93
95
  readonly storage_unavailable: `${string} is cache or full and no object store is configured.`;
94
96
  readonly plan_limit_storage: `${string} is cache or full and the tenant's plan does not include body storage.`;
95
97
  }>;
96
- /** A route of a module the tenant's plan may lack, e.g. planModule("calendar"). */
97
98
  export declare function planModule(module: string): DeclaredErrors<{
98
99
  readonly plan_module_unavailable: `The tenant's plan does not include ${string}.`;
99
100
  }>;
101
+ export declare const PLAN_REQUIRED_CONDITION = "The workspace has no plan and is not its owner's Free workspace (the Free plan covers one workspace per owner): choose a plan under Billing.";
102
+ export declare const PLAN_REQUIRED: DeclaredErrors<{
103
+ readonly plan_required: "The workspace has no plan and is not its owner's Free workspace (the Free plan covers one workspace per owner): choose a plan under Billing.";
104
+ }>;
105
+ export declare function spendCapCondition(what: string): string;
100
106
  export declare const PLAN_LIMIT_ACCOUNTS: DeclaredErrors<{
101
107
  readonly plan_limit_accounts: "The tenant already has as many accounts as its plan allows.";
108
+ readonly plan_required: "The workspace has no plan and is not its owner's Free workspace (the Free plan covers one workspace per owner): choose a plan under Billing.";
109
+ readonly spend_cap_reached: string;
102
110
  }>;
103
111
  export declare const BILLING_PAST_DUE: DeclaredErrors<{
104
112
  readonly billing_past_due: "The tenant's payment is past due beyond the grace period (sends already queued or scheduled still go out).";