@stndrds/schema 1.0.0-alpha.329 → 1.0.0-alpha.331

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 (165) hide show
  1. package/dist/all-CWDgBPuS.d.ts +1186 -0
  2. package/dist/all-DilIWUev.d.mts +1186 -0
  3. package/dist/capabilities.d.mts +94 -94
  4. package/dist/capabilities.d.ts +94 -94
  5. package/dist/capabilities.js +2 -2
  6. package/dist/capabilities.mjs +2 -2
  7. package/dist/checkbox-CjnTd8DE.d.ts +11 -0
  8. package/dist/checkbox-preO352q.d.mts +11 -0
  9. package/dist/config-BQJJHopR.js +13 -0
  10. package/dist/config-_sOeudpS.mjs +13 -0
  11. package/dist/core-397tQy5q.js +2 -0
  12. package/dist/core-BLHhNykL.mjs +2 -0
  13. package/dist/date-BL3UHIXs.d.mts +24 -0
  14. package/dist/date-CxwHkbid.d.ts +24 -0
  15. package/dist/exceptions-DGCzCc9t.d.mts +1405 -0
  16. package/dist/exceptions-DGCzCc9t.d.ts +1405 -0
  17. package/dist/exceptions.d.mts +3 -2
  18. package/dist/exceptions.d.ts +3 -2
  19. package/dist/exceptions.js +3 -1
  20. package/dist/exceptions.mjs +3 -1
  21. package/dist/index-B7HmBsUS.d.ts +53 -0
  22. package/dist/{helpers-qMMFwD1I.d.ts → index-BoUwfrDH.d.mts} +172 -145
  23. package/dist/index-C8M7Amy9.d.mts +254 -0
  24. package/dist/{helpers-lqSDjgQ1.d.mts → index-DqwNrDSp.d.ts} +172 -145
  25. package/dist/index-Uwy7CTKo.d.ts +254 -0
  26. package/dist/index-XtmC-C7J.d.mts +53 -0
  27. package/dist/index.d.mts +9151 -9136
  28. package/dist/index.d.ts +9151 -9136
  29. package/dist/index.js +21 -27
  30. package/dist/index.mjs +21 -27
  31. package/dist/number-Ddi_YYfm.d.mts +11 -0
  32. package/dist/number-GmD5PM5s.d.ts +11 -0
  33. package/dist/object-DGu0m2Y1.js +4 -0
  34. package/dist/object-DSRy1coV.mjs +4 -0
  35. package/dist/phone-BawtTYVi.mjs +2 -0
  36. package/dist/phone-DVaELsa3.js +2 -0
  37. package/dist/text-A9AJ1wUO.js +2 -0
  38. package/dist/text-C8Lb-NFo.mjs +2 -0
  39. package/dist/text-CxwF5K4k.d.mts +11 -0
  40. package/dist/text-D6UypN8p.d.ts +11 -0
  41. package/dist/utils-fXIvFFl6.mjs +2 -0
  42. package/dist/utils-gY3d9Dwp.js +2 -0
  43. package/dist/utils.d.mts +3 -2
  44. package/dist/utils.d.ts +3 -2
  45. package/dist/utils.js +2 -1
  46. package/dist/utils.mjs +2 -1
  47. package/dist/validation/all.d.mts +6 -8
  48. package/dist/validation/all.d.ts +6 -8
  49. package/dist/validation/all.js +2 -1
  50. package/dist/validation/all.mjs +2 -1
  51. package/dist/validation/complex/currency.d.mts +8 -9
  52. package/dist/validation/complex/currency.d.ts +8 -9
  53. package/dist/validation/complex/currency.js +2 -1
  54. package/dist/validation/complex/currency.mjs +2 -1
  55. package/dist/validation/complex/location.d.mts +14 -15
  56. package/dist/validation/complex/location.d.ts +14 -15
  57. package/dist/validation/complex/location.js +2 -1
  58. package/dist/validation/complex/location.mjs +2 -1
  59. package/dist/validation/complex/phone.d.mts +8 -9
  60. package/dist/validation/complex/phone.d.ts +8 -9
  61. package/dist/validation/complex/phone.js +2 -1
  62. package/dist/validation/complex/phone.mjs +2 -1
  63. package/dist/validation/complex/relation.d.mts +8 -9
  64. package/dist/validation/complex/relation.d.ts +8 -9
  65. package/dist/validation/complex/relation.js +2 -1
  66. package/dist/validation/complex/relation.mjs +2 -1
  67. package/dist/validation/complex/richtext.d.mts +6 -7
  68. package/dist/validation/complex/richtext.d.ts +6 -7
  69. package/dist/validation/complex/richtext.js +2 -1
  70. package/dist/validation/complex/richtext.mjs +2 -1
  71. package/dist/validation/complex/select.d.mts +8 -9
  72. package/dist/validation/complex/select.d.ts +8 -9
  73. package/dist/validation/complex/select.js +2 -1
  74. package/dist/validation/complex/select.mjs +2 -1
  75. package/dist/validation/complex/user.d.mts +6 -7
  76. package/dist/validation/complex/user.d.ts +6 -7
  77. package/dist/validation/complex/user.js +2 -1
  78. package/dist/validation/complex/user.mjs +2 -1
  79. package/dist/validation/computed/formula.d.mts +6 -7
  80. package/dist/validation/computed/formula.d.ts +6 -7
  81. package/dist/validation/computed/formula.js +2 -1
  82. package/dist/validation/computed/formula.mjs +2 -1
  83. package/dist/validation/computed/rollup.d.mts +6 -7
  84. package/dist/validation/computed/rollup.d.ts +6 -7
  85. package/dist/validation/computed/rollup.js +2 -1
  86. package/dist/validation/computed/rollup.mjs +2 -1
  87. package/dist/validation/config/index.d.mts +3 -4
  88. package/dist/validation/config/index.d.ts +3 -4
  89. package/dist/validation/config/index.js +2 -1
  90. package/dist/validation/config/index.mjs +2 -1
  91. package/dist/validation/core/index.d.mts +2 -17
  92. package/dist/validation/core/index.d.ts +2 -17
  93. package/dist/validation/core/index.js +2 -1
  94. package/dist/validation/core/index.mjs +2 -1
  95. package/dist/validation/object/index.d.mts +2 -29
  96. package/dist/validation/object/index.d.ts +2 -29
  97. package/dist/validation/object/index.js +2 -1
  98. package/dist/validation/object/index.mjs +2 -1
  99. package/dist/validation/primitives/checkbox.d.mts +2 -10
  100. package/dist/validation/primitives/checkbox.d.ts +2 -10
  101. package/dist/validation/primitives/checkbox.js +2 -1
  102. package/dist/validation/primitives/checkbox.mjs +2 -1
  103. package/dist/validation/primitives/date.d.mts +2 -23
  104. package/dist/validation/primitives/date.d.ts +2 -23
  105. package/dist/validation/primitives/date.js +2 -1
  106. package/dist/validation/primitives/date.mjs +2 -1
  107. package/dist/validation/primitives/number.d.mts +2 -10
  108. package/dist/validation/primitives/number.d.ts +2 -10
  109. package/dist/validation/primitives/number.js +2 -1
  110. package/dist/validation/primitives/number.mjs +2 -1
  111. package/dist/validation/primitives/text.d.mts +2 -10
  112. package/dist/validation/primitives/text.d.ts +2 -10
  113. package/dist/validation/primitives/text.js +2 -1
  114. package/dist/validation/primitives/text.mjs +2 -1
  115. package/dist/view-config.schema-B4AkqLKQ.mjs +2 -0
  116. package/dist/view-config.schema-to6p1m8L.js +2 -0
  117. package/package.json +7 -6
  118. package/dist/all-BgP-bB0i.d.mts +0 -1178
  119. package/dist/all-Cq8ZMfM4.d.ts +0 -1178
  120. package/dist/attributes-Cv6IP8-a.d.mts +0 -1365
  121. package/dist/attributes-Cv6IP8-a.d.ts +0 -1365
  122. package/dist/chunk-23KPS33D.js +0 -2
  123. package/dist/chunk-2M4YXNYZ.js +0 -15
  124. package/dist/chunk-47KVYDKG.js +0 -2
  125. package/dist/chunk-4OTKOCGB.mjs +0 -2
  126. package/dist/chunk-4VCADZK4.mjs +0 -2
  127. package/dist/chunk-53RAH3XB.mjs +0 -2
  128. package/dist/chunk-DPD6ZWL2.js +0 -2
  129. package/dist/chunk-EZCWO4XV.mjs +0 -15
  130. package/dist/chunk-GKXTXH4Y.mjs +0 -2
  131. package/dist/chunk-GXSNLYRR.js +0 -2
  132. package/dist/chunk-IBM4ID4Y.js +0 -6
  133. package/dist/chunk-JFSQ24XR.js +0 -2
  134. package/dist/chunk-JOS2XMXY.js +0 -2
  135. package/dist/chunk-JSKLP4GI.js +0 -12
  136. package/dist/chunk-JVLH3DVZ.js +0 -2
  137. package/dist/chunk-KG2ADZG6.mjs +0 -2
  138. package/dist/chunk-KLR22JMC.js +0 -2
  139. package/dist/chunk-KSPJP74K.mjs +0 -2
  140. package/dist/chunk-KYPEBOPW.mjs +0 -2
  141. package/dist/chunk-LB4TNMZU.mjs +0 -2
  142. package/dist/chunk-LSCBR4VS.js +0 -2
  143. package/dist/chunk-LWSOKXPF.js +0 -2
  144. package/dist/chunk-O34B5KOW.mjs +0 -2
  145. package/dist/chunk-PFO7NWQW.mjs +0 -2
  146. package/dist/chunk-Q7TQCRSD.mjs +0 -2
  147. package/dist/chunk-RTHLB6T6.js +0 -2
  148. package/dist/chunk-SLYRQ72J.js +0 -2
  149. package/dist/chunk-UKFOBZX2.js +0 -2
  150. package/dist/chunk-UXISKZ5Y.js +0 -2
  151. package/dist/chunk-VKFLXFPP.mjs +0 -2
  152. package/dist/chunk-WMQRTFOP.mjs +0 -2
  153. package/dist/chunk-XAVRKIBE.mjs +0 -6
  154. package/dist/chunk-XHEBV2HE.js +0 -2
  155. package/dist/chunk-XMQV2WFY.mjs +0 -2
  156. package/dist/chunk-XRDP2Y4J.mjs +0 -2
  157. package/dist/chunk-XRWRECDA.mjs +0 -12
  158. package/dist/chunk-XUAP7KWK.js +0 -2
  159. package/dist/chunk-XXTKNIBK.js +0 -2
  160. package/dist/chunk-YIXNAWH6.mjs +0 -2
  161. package/dist/chunk-YJSVWV3Z.mjs +0 -2
  162. package/dist/index-Comy7znP.d.ts +0 -252
  163. package/dist/index-D4XlMkLV.d.mts +0 -252
  164. package/dist/types-C5Bqalr9.d.ts +0 -38
  165. package/dist/types-CILLmEj-.d.mts +0 -38
@@ -1,1365 +0,0 @@
1
- import { IconName, CountryIso3, CurrencyCode, ColorId } from '@stndrds/constants';
2
-
3
- type ComputedFormulaAstNode = ComputedFormulaLiteralNode | ComputedFormulaPathNode | ComputedFormulaCallNode | ComputedFormulaBinaryNode;
4
- interface ComputedFormulaLiteralNode {
5
- kind: "literal";
6
- value: string | number | boolean | null;
7
- }
8
- interface ComputedFormulaPathNode {
9
- kind: "path";
10
- parts: string[];
11
- }
12
- interface ComputedFormulaCallNode {
13
- kind: "call";
14
- functionName: string;
15
- args: ComputedFormulaAstNode[];
16
- }
17
- interface ComputedFormulaBinaryNode {
18
- kind: "binary";
19
- operator: ComputedFormulaBinaryOperator;
20
- left: ComputedFormulaAstNode;
21
- right: ComputedFormulaAstNode;
22
- }
23
- type ComputedFormulaBinaryOperator = ">" | "<" | ">=" | "<=" | "==" | "!=" | "+" | "-" | "*" | "/";
24
- declare class ComputedFormulaParseError extends Error {
25
- constructor(message: string);
26
- }
27
- declare function parseComputedFormula(expression: string): ComputedFormulaAstNode;
28
-
29
- type ComputedReturnType = "text" | "number" | "boolean" | "date" | "select" | "multiselect";
30
- type ComputedFieldKind = "formula" | "rollup";
31
- type ComputedValueType = {
32
- kind: "scalar";
33
- type: Exclude<ComputedReturnType, "multiselect">;
34
- } | {
35
- kind: "collection";
36
- itemType: "text" | "number" | "boolean" | "date" | "select";
37
- };
38
- interface ComputedOptionsSource {
39
- objectName: string;
40
- attributeName: string;
41
- attributeId?: string;
42
- }
43
- type ComputedDependency = {
44
- kind: "local";
45
- attributeName: string;
46
- } | {
47
- kind: "relation";
48
- relationName: string;
49
- targetAttributeName?: string;
50
- cardinality?: "one" | "many";
51
- } | {
52
- kind: "computed";
53
- attributeName: string;
54
- } | {
55
- kind: "options";
56
- source: ComputedOptionsSource;
57
- };
58
- interface ComputedPlan {
59
- kind: ComputedFieldKind;
60
- attributeName: string;
61
- expression: string;
62
- returnType: ComputedReturnType;
63
- valueType: ComputedValueType;
64
- dependencies: ComputedDependency[];
65
- optionsSource?: ComputedOptionsSource;
66
- targetAttributeType?: AttributeType;
67
- dependenciesHash: string;
68
- ast?: ComputedFormulaAstNode;
69
- }
70
-
71
- type BuiltInTransform = "toString" | "toNumber" | "toDate" | "toBoolean" | "toISOString";
72
- type SchemaOperation = {
73
- type: "add_attribute";
74
- attribute: Attribute;
75
- } | {
76
- type: "remove_attribute";
77
- name: string;
78
- backup_config?: Attribute;
79
- } | {
80
- type: "rename_attribute";
81
- from: string;
82
- to: string;
83
- } | {
84
- type: "change_type";
85
- name: string;
86
- from: AttributeType;
87
- to: AttributeType;
88
- transform?: BuiltInTransform;
89
- } | {
90
- type: "update_config";
91
- name: string;
92
- from: Partial<Record<string, unknown>>;
93
- to: Partial<Record<string, unknown>>;
94
- } | {
95
- type: "remove_object";
96
- backup: Record<string, unknown>;
97
- } | {
98
- type: "rename_object";
99
- from: string;
100
- to: string;
101
- };
102
- interface MigrationDefinition {
103
- version: number;
104
- operations: SchemaOperation[];
105
- }
106
-
107
- /**
108
- * Error codes for schema exceptions
109
- */
110
- declare const SchemaErrorCode: {
111
- readonly DRAFT_REVISION_CONFLICT: "DRAFT_REVISION_CONFLICT";
112
- readonly UNKNOWN: "SCHEMA_UNKNOWN_ERROR";
113
- readonly OBJECT_NOT_FOUND: "SCHEMA_OBJECT_NOT_FOUND";
114
- readonly ATTRIBUTE_NOT_FOUND: "SCHEMA_ATTRIBUTE_NOT_FOUND";
115
- readonly RECORD_NOT_FOUND: "SCHEMA_RECORD_NOT_FOUND";
116
- readonly SOURCE_NOT_FOUND: "SCHEMA_SOURCE_NOT_FOUND";
117
- readonly ROLE_NOT_FOUND: "SCHEMA_ROLE_NOT_FOUND";
118
- readonly MEMORY_NOT_FOUND: "SCHEMA_MEMORY_NOT_FOUND";
119
- readonly SCHEMA_PLAN_NOT_FOUND: "SCHEMA_PLAN_NOT_FOUND";
120
- readonly VALIDATION_FAILED: "SCHEMA_VALIDATION_FAILED";
121
- readonly INVALID_ATTRIBUTE_NAME: "SCHEMA_INVALID_ATTRIBUTE_NAME";
122
- readonly INVALID_OBJECT_NAME: "SCHEMA_INVALID_OBJECT_NAME";
123
- /** A consumer declared, registered, bundled or sourced an object under a framework-native name (#3450). */
124
- readonly RESERVED_OBJECT_NAME: "SCHEMA_RESERVED_OBJECT_NAME";
125
- readonly PROTECTED_OBJECT: "SCHEMA_PROTECTED_OBJECT";
126
- readonly PROTECTED_ATTRIBUTE: "SCHEMA_PROTECTED_ATTRIBUTE";
127
- readonly PROTECTED_VIEW: "SCHEMA_PROTECTED_VIEW";
128
- readonly PROTECTED_ROLE: "SCHEMA_PROTECTED_ROLE";
129
- readonly FORBIDDEN: "SCHEMA_FORBIDDEN";
130
- readonly ACCESS_DENIED: "SCHEMA_ACCESS_DENIED";
131
- /**
132
- * A workspace RULE refuses the write — the last owner cannot be removed.
133
- *
134
- * Not `INVARIANT_VIOLATION`, despite the name: that one is an internal
135
- * "should never happen" assertion, a bug signal nobody outside the codebase
136
- * can act on. This is the opposite — a rule the caller can act on, reached
137
- * by a request that was entirely well-formed, whose message tells them how.
138
- */
139
- readonly WORKSPACE_INVARIANT: "SCHEMA_WORKSPACE_INVARIANT";
140
- /** The resource's own state refuses the operation — a disarmed reflex run. */
141
- readonly STATE_GATE: "SCHEMA_STATE_GATE";
142
- /** The operation needs an actor and the request carried none. */
143
- readonly ACTOR_CONTEXT_REQUIRED: "SCHEMA_ACTOR_CONTEXT_REQUIRED";
144
- readonly CONNECTOR_AUTH_FAILED: "SCHEMA_CONNECTOR_AUTH_FAILED";
145
- readonly CONNECTOR_INVALID_STATE: "SCHEMA_CONNECTOR_INVALID_STATE";
146
- /**
147
- * The provider issued tokens and the flow failed AFTER that — resolving the
148
- * connected address. Distinct from CONNECTOR_AUTH_FAILED because the user is
149
- * left holding a real grant: consent happened, and it may still be live on the
150
- * provider side even though no connection row exists here.
151
- */
152
- readonly CONNECTOR_GRANT_ORPHANED: "SCHEMA_CONNECTOR_GRANT_ORPHANED";
153
- readonly SYNC_FAILED: "SCHEMA_SYNC_FAILED";
154
- readonly SYNC_CONFLICT: "SCHEMA_SYNC_CONFLICT";
155
- readonly SYNC_CASCADE: "SCHEMA_SYNC_CASCADE";
156
- readonly ORPHAN_SYSTEM_ATTRIBUTE: "SCHEMA_ORPHAN_SYSTEM_ATTRIBUTE";
157
- readonly SYSTEM_ENTITY_IMMUTABLE: "SCHEMA_SYSTEM_ENTITY_IMMUTABLE";
158
- readonly DESTRUCTIVE_NOT_ALLOWED: "SCHEMA_DESTRUCTIVE_NOT_ALLOWED";
159
- readonly MIGRATION_TIMEOUT: "SCHEMA_MIGRATION_TIMEOUT";
160
- readonly CHANGE_TYPE_NOT_SUPPORTED: "SCHEMA_CHANGE_TYPE_NOT_SUPPORTED";
161
- readonly DUPLICATE: "SCHEMA_DUPLICATE";
162
- readonly DUPLICATE_OBJECT: "SCHEMA_DUPLICATE_OBJECT";
163
- readonly DUPLICATE_ATTRIBUTE: "SCHEMA_DUPLICATE_ATTRIBUTE";
164
- readonly CONFLICT: "SCHEMA_CONFLICT";
165
- readonly STORAGE_UPLOAD_FAILED: "SCHEMA_STORAGE_UPLOAD_FAILED";
166
- readonly STORAGE_DOWNLOAD_FAILED: "SCHEMA_STORAGE_DOWNLOAD_FAILED";
167
- readonly STORAGE_DELETE_FAILED: "SCHEMA_STORAGE_DELETE_FAILED";
168
- readonly STORAGE_URL_FAILED: "SCHEMA_STORAGE_URL_FAILED";
169
- readonly REPOSITORY_CREATE_FAILED: "SCHEMA_REPOSITORY_CREATE_FAILED";
170
- readonly REPOSITORY_UPDATE_FAILED: "SCHEMA_REPOSITORY_UPDATE_FAILED";
171
- readonly REPOSITORY_DELETE_FAILED: "SCHEMA_REPOSITORY_DELETE_FAILED";
172
- readonly REPOSITORY_QUERY_FAILED: "SCHEMA_REPOSITORY_QUERY_FAILED";
173
- readonly NOT_IMPLEMENTED: "SCHEMA_NOT_IMPLEMENTED";
174
- readonly TIMEOUT: "SCHEMA_TIMEOUT";
175
- readonly RECORD_REFERENCED: "SCHEMA_RECORD_REFERENCED";
176
- readonly ATTRIBUTE_IN_USE: "SCHEMA_ATTRIBUTE_IN_USE";
177
- readonly OBJECT_REFERENCED: "SCHEMA_OBJECT_REFERENCED";
178
- readonly CONFIGURATION_REQUIRED: "CONFIGURATION_REQUIRED";
179
- readonly SEARCH_ADAPTER_REQUIRED: "SEARCH_ADAPTER_REQUIRED";
180
- readonly CRON_REGISTRATION_FAILED: "CRON_REGISTRATION_FAILED";
181
- readonly SEARCH_BACKEND_FAILED: "SEARCH_BACKEND_FAILED";
182
- readonly INVARIANT_VIOLATION: "INVARIANT_VIOLATION";
183
- readonly TENANT_CONTEXT_MISSING: "TENANT_CONTEXT_MISSING";
184
- readonly FEATURE_FLAGS_CONTEXT: "FEATURE_FLAGS_CONTEXT";
185
- readonly REALTIME_RATE_LIMITED: "REALTIME_RATE_LIMITED";
186
- readonly REALTIME_DELIVERY_FAILED: "REALTIME_DELIVERY_FAILED";
187
- readonly REALTIME_SUBSCRIPTION_FAILED: "REALTIME_SUBSCRIPTION_FAILED";
188
- readonly AGENT_UNKNOWN: "AGENT_UNKNOWN";
189
- readonly AGENT_DEPTH_EXCEEDED: "AGENT_DEPTH_EXCEEDED";
190
- readonly AGENT_COST_LIMIT_EXCEEDED: "AGENT_COST_LIMIT_EXCEEDED";
191
- readonly AGENT_TREE_COST_LIMIT_EXCEEDED: "AGENT_TREE_COST_LIMIT_EXCEEDED";
192
- readonly CREDITS_EXHAUSTED: "CREDITS_EXHAUSTED";
193
- readonly QUOTA_EXCEEDED: "QUOTA_EXCEEDED";
194
- readonly AGENT_SESSION_NOT_FOUND: "AGENT_SESSION_NOT_FOUND";
195
- readonly AGENT_DEFINITION_NOT_FOUND: "AGENT_DEFINITION_NOT_FOUND";
196
- readonly AGENT_RUN_CONFIG: "AGENT_RUN_CONFIG";
197
- readonly AGENT_STREAMING: "AGENT_STREAMING";
198
- readonly AGENT_MISSING_ACTOR: "AGENT_MISSING_ACTOR";
199
- readonly AGENT_INVALID_STATE: "AGENT_INVALID_STATE";
200
- readonly AGENT_COMPACTION_IMPOSSIBLE: "AGENT_COMPACTION_IMPOSSIBLE";
201
- readonly AGENT_COMPACTION_TIMEOUT: "AGENT_COMPACTION_TIMEOUT";
202
- readonly AGENT_LEASE_HELD: "AGENT_LEASE_HELD";
203
- readonly AGENT_WORK_MODE_REQUIRED: "AGENT_WORK_MODE_REQUIRED";
204
- readonly AGENT_MESSAGE_NOT_FOUND: "AGENT_MESSAGE_NOT_FOUND";
205
- readonly AGENT_MESSAGE_NOT_EDITABLE: "AGENT_MESSAGE_NOT_EDITABLE";
206
- readonly DEVICE_NOT_FOUND: "DEVICE_NOT_FOUND";
207
- readonly DEVICE_OFFLINE: "DEVICE_OFFLINE";
208
- readonly AI_UNKNOWN: "AI_UNKNOWN";
209
- readonly AI_USAGE_LIMIT_EXCEEDED: "AI_USAGE_LIMIT_EXCEEDED";
210
- readonly AI_INVALID_USAGE: "AI_INVALID_USAGE";
211
- readonly AI_INVALID_MODEL: "AI_INVALID_MODEL";
212
- readonly AI_INVALID_MODEL_INPUT: "AI_INVALID_MODEL_INPUT";
213
- readonly AI_REPOSITORY_ERROR: "AI_REPOSITORY_ERROR";
214
- readonly AI_GENERATION_FAILED: "AI_GENERATION_FAILED";
215
- readonly AI_IMAGE_USAGE_PENDING: "AI_IMAGE_USAGE_PENDING";
216
- readonly AI_IMAGE_GENERATION_INDETERMINATE: "AI_IMAGE_GENERATION_INDETERMINATE";
217
- readonly AI_IMAGE_PUBLICATION_FAILED: "AI_IMAGE_PUBLICATION_FAILED";
218
- readonly DOCUMENT_MIME_NOT_ACCEPTED: "DOCUMENT_MIME_NOT_ACCEPTED";
219
- readonly DOCUMENT_MULTIPLE_NOT_ALLOWED: "DOCUMENT_MULTIPLE_NOT_ALLOWED";
220
- readonly DOCUMENT_NOT_FOUND_FOR_OPERATION: "DOCUMENT_NOT_FOUND_FOR_OPERATION";
221
- readonly DOCUMENT_STORAGE_FAILED: "DOCUMENT_STORAGE_FAILED";
222
- readonly DOCUMENT_SIZE_EXCEEDED: "DOCUMENT_SIZE_EXCEEDED";
223
- readonly DOCUMENT_OCR_FAILED: "DOCUMENT_OCR_FAILED";
224
- readonly DOCUMENT_BLOB_EMPTY: "DOCUMENT_BLOB_EMPTY";
225
- readonly DOCUMENT_FILE_TOO_LARGE: "DOCUMENT_FILE_TOO_LARGE";
226
- readonly DOCUMENT_FILE_NOT_FOUND: "DOCUMENT_FILE_NOT_FOUND";
227
- readonly DOCUMENT_FILE_ALREADY_PACKED: "DOCUMENT_FILE_ALREADY_PACKED";
228
- readonly DOCUMENT_RECORD_NOT_FOUND: "DOCUMENT_RECORD_NOT_FOUND";
229
- readonly DOCUMENT_RECORD_OBJECT_MISMATCH: "DOCUMENT_RECORD_OBJECT_MISMATCH";
230
- readonly DOCUMENT_FOLDER_SERVICE_UNAVAILABLE: "DOCUMENT_FOLDER_SERVICE_UNAVAILABLE";
231
- readonly DOCUMENT_FOLDER_PATH_NOT_FOUND: "DOCUMENT_FOLDER_PATH_NOT_FOUND";
232
- readonly EMAIL_PROVIDER_API_FAILED: "EMAIL_PROVIDER_API_FAILED";
233
- readonly EMAIL_SEND_FAILED: "EMAIL_SEND_FAILED";
234
- readonly EMAIL_SENT_NOT_STORED: "EMAIL_SENT_NOT_STORED";
235
- readonly EMAIL_BATCH_ITEM_FAILED: "EMAIL_BATCH_ITEM_FAILED";
236
- readonly CALENDAR_PROVIDER_API_FAILED: "CALENDAR_PROVIDER_API_FAILED";
237
- readonly REFLEX_INVALID_TRANSITION: "REFLEX_INVALID_TRANSITION";
238
- readonly REFLEX_INVALID_TOKEN: "REFLEX_INVALID_TOKEN";
239
- readonly REFLEX_CAPABILITY_DENIED: "REFLEX_CAPABILITY_DENIED";
240
- readonly REFLEX_GATEWAY_UNAVAILABLE: "REFLEX_GATEWAY_UNAVAILABLE";
241
- readonly REFLEX_BUNDLE_FAILED: "REFLEX_BUNDLE_FAILED";
242
- readonly REFLEX_EGRESS_DENIED: "REFLEX_EGRESS_DENIED";
243
- readonly REFLEX_PROTOCOL_VIOLATION: "REFLEX_PROTOCOL_VIOLATION";
244
- readonly REFLEX_RUN_FAILED: "REFLEX_RUN_FAILED";
245
- readonly REFLEX_RUN_TIMEOUT: "REFLEX_RUN_TIMEOUT";
246
- readonly REFLEX_DEPENDENCY_DRIFT: "REFLEX_DEPENDENCY_DRIFT";
247
- readonly REFLEX_NOT_READY: "REFLEX_NOT_READY";
248
- readonly REFLEX_INVARIANT_VIOLATION: "REFLEX_INVARIANT_VIOLATION";
249
- /** The embeddings feature is enabled but no Gateway credential is configured. */
250
- readonly EMBEDDING_MODEL_UNAVAILABLE: "EMBEDDING_MODEL_UNAVAILABLE";
251
- /** The provider returned vectors whose length differs from the configured dimensions. */
252
- readonly EMBEDDING_DIMENSION_MISMATCH: "EMBEDDING_DIMENSION_MISMATCH";
253
- };
254
- type SchemaErrorCode = (typeof SchemaErrorCode)[keyof typeof SchemaErrorCode];
255
- /**
256
- * Base error class for all schema-related errors
257
- */
258
- declare class SchemaError extends Error {
259
- readonly code: SchemaErrorCode;
260
- readonly details?: Record<string, unknown>;
261
- constructor(message: string, code?: SchemaErrorCode, details?: Record<string, unknown>);
262
- toJSON(): {
263
- name: string;
264
- code: SchemaErrorCode;
265
- message: string;
266
- details: Record<string, unknown> | undefined;
267
- };
268
- }
269
- /**
270
- * Base class for "not found" errors
271
- */
272
- declare class NotFoundError extends SchemaError {
273
- /** Literal discriminator for `Effect.catchTag`; a widened `string` breaks narrowing. */
274
- readonly _tag = "NotFoundError";
275
- readonly resourceType: string;
276
- readonly resourceId: string;
277
- constructor(resourceType: string, resourceId: string, code?: SchemaErrorCode, message?: string);
278
- }
279
- /**
280
- * Object not found error
281
- */
282
- declare class ObjectNotFoundError extends NotFoundError {
283
- constructor(objectId: string);
284
- }
285
- /**
286
- * Attribute not found error
287
- */
288
- declare class AttributeNotFoundError extends NotFoundError {
289
- constructor(attributeId: string);
290
- }
291
- /**
292
- * Record not found error
293
- */
294
- declare class RecordNotFoundError extends NotFoundError {
295
- constructor(recordId: string);
296
- }
297
- /**
298
- * Schema plan not found error — raised when a `planId` sent by an approver
299
- * (who never receives the plan payload itself, only its id) does not match
300
- * any stored plan.
301
- */
302
- declare class SchemaPlanNotFoundError extends NotFoundError {
303
- constructor(planId: string);
304
- }
305
- /**
306
- * Validation error with field-level details
307
- */
308
- interface ValidationErrorDetail {
309
- path: string[];
310
- message: string;
311
- code?: string;
312
- }
313
- /**
314
- * Validation error thrown when data fails schema validation
315
- */
316
- declare class ValidationError extends SchemaError {
317
- /** Literal discriminator for `Effect.catchTag`; a widened `string` breaks narrowing. */
318
- readonly _tag = "ValidationError";
319
- readonly errors: ValidationErrorDetail[];
320
- constructor(message: string, errors: ValidationErrorDetail[]);
321
- /**
322
- * Create a validation error from Zod-style errors
323
- */
324
- static fromZodErrors(errors: Array<{
325
- path: (string | number)[];
326
- message: string;
327
- }>): ValidationError;
328
- }
329
- /**
330
- * Error thrown when attempting to modify a protected (system) resource
331
- */
332
- declare class ProtectedResourceError extends SchemaError {
333
- readonly resourceType: "object" | "attribute" | "view";
334
- readonly resourceName: string;
335
- readonly operation: "delete" | "modify";
336
- constructor(resourceType: "object" | "attribute" | "view", resourceName: string, operation: "delete" | "modify");
337
- }
338
- /**
339
- * Error thrown during native object synchronization
340
- */
341
- declare class SyncError extends SchemaError {
342
- readonly objectName: string;
343
- readonly cause?: Error;
344
- constructor(objectName: string, message: string, cause?: Error);
345
- }
346
- /**
347
- * Thrown when code tries to mutate a system entity at runtime.
348
- * System entities are declared in code and immutable at runtime.
349
- * HTTP status: 403 Forbidden.
350
- */
351
- declare class SystemEntityImmutableError extends SchemaError {
352
- readonly entityType: string;
353
- readonly entityName: string;
354
- constructor(entityType: string, entityName: string);
355
- }
356
- interface SyncConflictParams {
357
- objectName: string;
358
- attributeName?: string;
359
- reason: string;
360
- }
361
- /**
362
- * Thrown at boot when an auto-promote cannot proceed due to incompatible types
363
- * or constraints. The dev must resolve manually (relax constraints, migrate
364
- * values, or rename).
365
- */
366
- declare class SyncConflictError extends SchemaError {
367
- readonly objectName: string;
368
- readonly attributeName?: string;
369
- readonly reason: string;
370
- constructor(params: SyncConflictParams);
371
- }
372
- /**
373
- * Thrown at boot when an object is being demoted but still has system attributes
374
- * declared in code. The dev forgot to remove those attributes too, or kept the
375
- * object inconsistently.
376
- */
377
- declare class SyncCascadeError extends SchemaError {
378
- readonly objectName: string;
379
- readonly conflictingAttributes: string[];
380
- constructor(objectName: string, conflictingAttributes: string[]);
381
- }
382
- /**
383
- * Thrown at boot when an attribute is system:true but its object parent is
384
- * system:false. This invariant should never be violated — if seen, it's a bug
385
- * in the boot reconciliation logic or in a manual DB mutation.
386
- */
387
- declare class OrphanSystemAttributeError extends SchemaError {
388
- readonly objectName: string;
389
- readonly attributeName: string;
390
- constructor(objectName: string, attributeName: string);
391
- }
392
- /**
393
- * Thrown when a destructive operation is detected without the explicit
394
- * STANDARDS_ALLOW_DESTRUCTIVE_SYNC=1 opt-in.
395
- * HTTP status: 500 (boot fail, should never surface to HTTP).
396
- *
397
- * Which operations the opt-in governs is decided in one place —
398
- * `requiresDestructiveSyncOptIn` in the runtime's sync classifier. Today that
399
- * is object removal only: attribute removal is unconditional at boot, because a
400
- * system attribute is code-controlled and its disappearance from the builder is
401
- * an unambiguous drop.
402
- *
403
- * NOTE — Wiring status: defined but not thrown by the current sync.ts, which
404
- * demotes instead. Reserved for the `standards diff` CLI gate, which will throw
405
- * it when CI detects an unauthorized destructive deployment.
406
- */
407
- declare class DestructiveSyncNotAllowedError extends SchemaError {
408
- readonly operations: SchemaOperation[];
409
- constructor(operations: SchemaOperation[]);
410
- }
411
- /**
412
- * Thrown at boot when applying a migration in batches exceeds the maximum
413
- * allowed duration (default 5 min, configurable via STANDARDS_MIGRATION_MAX_DURATION_MS).
414
- * HTTP status: 500 (boot fail).
415
- */
416
- declare class MigrationTimeoutError extends SchemaError {
417
- readonly objectName: string;
418
- readonly migrated: number;
419
- readonly total: number;
420
- readonly maxDurationMs: number;
421
- constructor(objectName: string, migrated: number, total: number, maxDurationMs: number);
422
- }
423
- /**
424
- * Thrown when the runtime admin API is called to change an attribute's type.
425
- * Type changes must be declared in code via `.migration(N, m => m.changeType(...))`.
426
- * HTTP status: 400 Bad Request.
427
- */
428
- declare class ChangeTypeNotSupportedError extends SchemaError {
429
- readonly objectName: string;
430
- readonly attributeName: string;
431
- constructor(objectName: string, attributeName: string);
432
- }
433
- /**
434
- * Error thrown when attempting to create a duplicate resource.
435
- *
436
- * `resourceType` is free-form: pass `"object"`/`"attribute"` for schema
437
- * resources (a specific code is selected automatically), or any domain label
438
- * (`"tool"`, `"background job handler"`, …) for runtime registries, which fall
439
- * back to the generic `DUPLICATE` code. The default message is
440
- * `'<ResourceType> "<name>" already exists'`; pass a custom message when the
441
- * domain reads better with different wording (e.g. "already registered for
442
- * type X").
443
- */
444
- declare class DuplicateError extends SchemaError {
445
- readonly resourceType: string;
446
- readonly resourceName: string;
447
- constructor(resourceType: string, resourceName: string, message?: string);
448
- }
449
- /**
450
- * A consumer tried to build, register, bundle or source an object under a name
451
- * the framework owns (`skill`, `memory`, `drives`, `artifact`, `meeting`).
452
- * Raised at declaration time so the collision fails in the consumer's own
453
- * tests, never at boot: the platform's `wealth-manager` bundle once shipped
454
- * `meeting` and hid the native calendar object from every tenant for three
455
- * days (#3450).
456
- */
457
- declare const RESERVED_NAME_CONTEXTS: {
458
- readonly builder: "cannot be built by a consumer";
459
- readonly registry: "cannot be registered by a consumer";
460
- readonly bundle: "cannot be claimed by a bundle";
461
- readonly source: "cannot be declared by a schema source";
462
- };
463
- declare class ReservedObjectNameError extends SchemaError {
464
- readonly objectName: string;
465
- constructor(objectName: string, context: keyof typeof RESERVED_NAME_CONTEXTS);
466
- }
467
- /**
468
- * Check if an error is a SchemaError
469
- */
470
- declare function isSchemaError(error: unknown): error is SchemaError;
471
- /**
472
- * Check if an error is a NotFoundError
473
- */
474
- declare function isNotFoundError(error: unknown): error is NotFoundError;
475
- /**
476
- * Check if an error is a ValidationError
477
- */
478
- declare function isValidationError(error: unknown): error is ValidationError;
479
- /**
480
- * Check if an error is a ProtectedResourceError
481
- */
482
- declare function isProtectedResourceError(error: unknown): error is ProtectedResourceError;
483
- /**
484
- * Error thrown when a user lacks permission to perform an action.
485
- *
486
- * That, and nothing else (#2681) — its message is redacted, so it must not
487
- * carry a refusal a permission grant would not lift: use `WORKSPACE_INVARIANT`,
488
- * `STATE_GATE`, `ACTOR_CONTEXT_REQUIRED` or `SYSTEM_ENTITY_IMMUTABLE` instead.
489
- */
490
- declare class ForbiddenError extends SchemaError {
491
- /** Literal discriminator for `Effect.catchTag`; a widened `string` breaks narrowing. */
492
- readonly _tag = "ForbiddenError";
493
- readonly objectName: string;
494
- readonly action: string;
495
- readonly userId?: string;
496
- constructor(objectName: string, action: string, userId?: string);
497
- }
498
- /**
499
- * Error thrown when trying to modify a protected role
500
- */
501
- declare class ProtectedRoleError extends SchemaError {
502
- readonly roleName: string;
503
- readonly operation: "delete" | "modify";
504
- constructor(roleName: string, operation: "delete" | "modify");
505
- }
506
- /**
507
- * Role not found error
508
- */
509
- declare class RoleNotFoundError extends NotFoundError {
510
- constructor(roleId: string);
511
- }
512
- /**
513
- * Thrown when a record has been modified by another request between read and write.
514
- * Clients should retry the operation with fresh data.
515
- * Maps to HTTP 409 Conflict.
516
- */
517
- declare class ConcurrentModificationError extends SchemaError {
518
- constructor(recordId: string);
519
- }
520
- /**
521
- * Storage operation type for error context
522
- */
523
- type StorageOperation = "upload" | "download" | "delete" | "signedUrl";
524
- /**
525
- * Error thrown when a storage operation fails
526
- */
527
- declare class StorageError extends SchemaError {
528
- readonly operation: StorageOperation;
529
- readonly path?: string;
530
- readonly cause?: string;
531
- constructor(operation: StorageOperation, message: string, path?: string, cause?: string);
532
- }
533
- /**
534
- * Error thrown when access to a resource is denied (e.g., tenant path mismatch)
535
- */
536
- declare class AccessDeniedError extends SchemaError {
537
- readonly resource: string;
538
- readonly reason?: string;
539
- constructor(resource: string, reason?: string);
540
- }
541
- /**
542
- * Repository operation type for error context
543
- */
544
- type RepositoryOperation = "create" | "update" | "delete" | "query";
545
- /**
546
- * Error thrown when a repository operation fails
547
- */
548
- declare class RepositoryError extends SchemaError {
549
- readonly operation: RepositoryOperation;
550
- readonly entity: string;
551
- readonly cause?: string;
552
- constructor(operation: RepositoryOperation, entity: string, message: string, cause?: string);
553
- }
554
- /**
555
- * Error thrown when a search read call fails at the transport level — e.g. the
556
- * Meili client received a non-JSON body (`JSON.parse` SyntaxError) or a network
557
- * failure. Translates an otherwise un-fingerprintable bare exception into a
558
- * typed error with a stable `code` and a user-safe message. The original
559
- * failure text is preserved in `cause`/`details`, never in the message.
560
- */
561
- declare class SearchBackendError extends SchemaError {
562
- readonly scope: string;
563
- readonly cause?: string;
564
- constructor(scope: string, cause?: string);
565
- }
566
- /**
567
- * Error thrown when a feature or method is not yet implemented
568
- */
569
- declare class NotImplementedError extends SchemaError {
570
- readonly feature: string;
571
- readonly milestone?: string;
572
- constructor(feature: string, milestone?: string);
573
- }
574
- /**
575
- * Memory entry not found error
576
- */
577
- declare class MemoryNotFoundError extends NotFoundError {
578
- constructor(memoryId: string);
579
- }
580
- /**
581
- * Reference information for a record that is blocking deletion.
582
- */
583
- interface RecordReference {
584
- /** Technical name of the object (e.g., "contacts") */
585
- objectName: string;
586
- /** Display label of the object (e.g., "Contacts") */
587
- objectLabel: string;
588
- /** Number of records referencing the target */
589
- count: number;
590
- }
591
- /**
592
- * Thrown when attempting to delete a record that is referenced by other records.
593
- *
594
- * This implements the "Restrict" behavior: deletion is blocked and the user
595
- * must first remove or update the referencing records.
596
- */
597
- declare class RecordReferencedError extends SchemaError {
598
- readonly recordId: string;
599
- readonly references: RecordReference[];
600
- constructor(recordId: string, references: RecordReference[]);
601
- }
602
- /**
603
- * Usage context where an attribute is being used.
604
- */
605
- type AttributeUsage = "labelExpression" | "embeddingExpression" | "view" | "filter";
606
- /**
607
- * Thrown when attempting to delete an attribute that is in use.
608
- *
609
- * Attributes cannot be deleted if they are referenced in:
610
- * - The object's labelExpression template
611
- * - A saved view's column configuration
612
- * - A saved filter condition
613
- */
614
- declare class AttributeInUseError extends SchemaError {
615
- readonly attributeName: string;
616
- readonly usage: AttributeUsage;
617
- constructor(attributeName: string, usage: AttributeUsage);
618
- }
619
- /**
620
- * Thrown when attempting to delete an object that is a relation target.
621
- *
622
- * Objects cannot be deleted if other objects have relation attributes
623
- * pointing to them as a target.
624
- */
625
- declare class ObjectReferencedError extends SchemaError {
626
- readonly objectName: string;
627
- readonly referencingObjects: string[];
628
- constructor(objectName: string, referencingObjects: string[]);
629
- }
630
- /**
631
- * Check if an error is a RecordReferencedError
632
- */
633
- declare function isRecordReferencedError(error: unknown): error is RecordReferencedError;
634
- /**
635
- * Check if an error is an AttributeInUseError
636
- */
637
- declare function isAttributeInUseError(error: unknown): error is AttributeInUseError;
638
- /**
639
- * Check if an error is an ObjectReferencedError
640
- */
641
- declare function isObjectReferencedError(error: unknown): error is ObjectReferencedError;
642
-
643
- /**
644
- * The one stable JSON traversal: object keys sorted, array order preserved,
645
- * `undefined` object entries omitted, no whitespace.
646
- *
647
- * There used to be two. The runtime's copy was written because `sameValue()`
648
- * used `JSON.stringify`, which is key-order sensitive: Postgres jsonb
649
- * round-trips a config with a different key order than the blueprint that
650
- * produced it, so system-agent sync saw perpetual false drift and
651
- * unregistered/re-registered every cron on each boot. Merging the two back was
652
- * blocked for a year on one question — does a canonical hash omit an
653
- * `undefined` object entry, or refuse it? — answered in #2750: it omits it,
654
- * exactly as `JSON.stringify` and jsonb storage both do.
655
- *
656
- * What remains is not one strictness but three, because three callers ask three
657
- * different questions of the same walk:
658
- *
659
- * | | `canonicalStringify` | `serializeCanonicalJson` | `serializeStableJson` |
660
- * |---|---|---|---|
661
- * | asks | "what is this value, publicly?" | "what is this value's identity?" | "are these two the same?" |
662
- * | `undefined` entry | omit | omit | omit |
663
- * | top-level / array `undefined`, `NaN` | `null` | refuse | `null` |
664
- * | `function` / `symbol` / `bigint` | refuse | refuse | coerce to its string |
665
- * | `Date`, `Map`, class instance | refuse (#3406) | refuse | own entries |
666
- * | enumerable accessor | read it | refuse | skip it |
667
- * | error raised | `ValidationError` | `NonJsonValueError` | `NonJsonValueError` |
668
- *
669
- * A content hash must refuse what it cannot represent, or two different values
670
- * hash alike. A drift comparison must tolerate: it runs at boot against data
671
- * that already exists, and refusing there turns a cosmetic false-drift into a
672
- * server that will not start. The public traversal is the older contract, kept
673
- * byte-for-byte for the JSON it always accepted, because `@stndrds/client` and
674
- * `@stndrds/reflex` hash with it — and, since #3406, refusing a `Date`, `Map`
675
- * or `Set` instead of emitting `{}`: it is a content identity, and flattening
676
- * made two different instants hash alike. `toJSON` is deliberately not
677
- * honoured (Karl, 2026-09-07: « 1 — Refuser »); the caller pre-projects.
678
- *
679
- * On genuinely JSON-compatible input all three emit the same bytes, so every
680
- * stored hash still matches — with one measured exception against
681
- * `JSON.stringify`-based predecessors: an object with integer-like keys.
682
- * Rebuilding it to sort assigns those keys in ascending numeric order, where
683
- * this traversal orders them lexicographically (`{"2":…,"10":…}` vs
684
- * `{"10":…,"2":…}`). No caller passes such a key.
685
- */
686
-
687
- declare class NonJsonValueError extends SchemaError {
688
- constructor();
689
- }
690
- /**
691
- * Serializes a value into deterministic JSON: object keys are sorted
692
- * recursively, array order is preserved, `undefined` object entries are
693
- * omitted, and no whitespace is emitted.
694
- *
695
- * The canonicalization hashed across the runtime boot seed, the server, the CLI
696
- * and `@stndrds/reflex` — the output must stay byte-identical for equivalent
697
- * inputs regardless of key insertion order or jsonb storage round-trips.
698
- *
699
- * @throws {ValidationError} On circular references, unsupported value types
700
- * (functions, symbols, bigint), and on a `Date`, `Map`, `Set` or any other
701
- * non-plain object — it is a content identity, and those carry no own
702
- * enumerable entry, so emitting them as `{}` made two different values hash
703
- * alike (#3406). Project such a value yourself (`date.toISOString()`,
704
- * `[...map]`) before hashing it.
705
- */
706
- declare function canonicalStringify(value: unknown): string;
707
- /**
708
- * Key-sorted JSON for comparing values that round-trip through jsonb. Coerces
709
- * what JSON cannot express rather than refusing — the caller is asking "are
710
- * these the same?", not "is this valid?".
711
- */
712
- declare function serializeStableJson(value: unknown): string;
713
- /**
714
- * Key-sorted JSON for content identity. Throws {@link NonJsonValueError} on
715
- * anything JSON cannot represent, so two different values never hash alike.
716
- */
717
- declare function serializeCanonicalJson(value: unknown): string;
718
- /**
719
- * Order-insensitive deep equality over {@link serializeStableJson}.
720
- *
721
- * Not `deepEqual` from `../utils`: that one compares in place without
722
- * allocating, and answers differently for `NaN`, for an explicitly-`undefined`
723
- * entry, and for a cycle. Reach for this when the bytes are the point.
724
- */
725
- declare function sameStableValue(left: unknown, right: unknown): boolean;
726
-
727
- /**
728
- * Brand symbol for nominal typing.
729
- * This ensures type-safety by making IDs non-interchangeable.
730
- */
731
- declare const __brand: unique symbol;
732
- /**
733
- * Creates a branded type from a base type.
734
- * Branded types are structurally identical but nominally different.
735
- */
736
- type Brand<T, B> = T & {
737
- readonly [__brand]: B;
738
- };
739
- /**
740
- * UUID string type for all identifiers
741
- */
742
- type Uuid = string;
743
- /**
744
- * Tenant identifier for multi-tenant isolation.
745
- * Branded type to prevent accidental mixing with other string IDs.
746
- *
747
- * @example
748
- * ```typescript
749
- * const tenantId: TenantId = asTenantId('tenant-123');
750
- * const userId: UserId = asUserId('user-456');
751
- *
752
- * // Type error: cannot assign UserId to TenantId
753
- * const wrong: TenantId = userId;
754
- * ```
755
- */
756
- type TenantId = Brand<string, "TenantId">;
757
- /**
758
- * User identifier for audit trails and permissions.
759
- * Branded type to prevent accidental mixing with other string IDs.
760
- */
761
- type UserId = Brand<string, "UserId">;
762
- /**
763
- * Convert a string to a TenantId.
764
- * Use this when receiving tenant IDs from external sources (JWT, headers).
765
- *
766
- * @param id - The string to convert
767
- * @returns A branded TenantId
768
- *
769
- * @example
770
- * ```typescript
771
- * const tenantId = asTenantId(request.headers['x-tenant-id']);
772
- * ```
773
- */
774
- declare function asTenantId(id: string): TenantId;
775
- /**
776
- * Convert a string to a UserId.
777
- * Use this when receiving user IDs from external sources (JWT, auth).
778
- *
779
- * @param id - The string to convert
780
- * @returns A branded UserId
781
- *
782
- * @example
783
- * ```typescript
784
- * const userId = asUserId(jwtPayload.sub);
785
- * ```
786
- */
787
- declare function asUserId(id: string): UserId;
788
- /**
789
- * Generate a unique UUID v4
790
- * Uses crypto.randomUUID() when available (Node.js 19+, modern browsers)
791
- * Falls back to a manual implementation for older environments
792
- *
793
- * @returns A UUID v4 string
794
- *
795
- * @example
796
- * ```typescript
797
- * const id = generateId();
798
- * // "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
799
- * ```
800
- */
801
- declare function generateId(): Uuid;
802
- /**
803
- * Create a Map indexed by a key extracted from each item.
804
- * This eliminates the repeated pattern: new Map(items.map(item => [keyFn(item), item]))
805
- *
806
- * Time complexity: O(n)
807
- * Space complexity: O(n)
808
- *
809
- * @param items - Array of items to index
810
- * @param keyFn - Function to extract the key from each item
811
- * @returns Map indexed by the extracted key
812
- *
813
- * @example
814
- * ```typescript
815
- * const attributes = [{ name: "title", type: "text" }, { name: "status", type: "select" }];
816
- *
817
- * // Before:
818
- * const attrMap = new Map(attributes.map(a => [a.name, a]));
819
- *
820
- * // After:
821
- * const attrMap = indexBy(attributes, a => a.name);
822
- * ```
823
- */
824
- declare function indexBy<T, K extends PropertyKey>(items: T[], keyFn: (item: T) => K): Map<K, T>;
825
- /**
826
- * Deep equality comparison for plain objects and arrays.
827
- * Handles nested structures, arrays, primitives, null, and undefined.
828
- *
829
- * Time complexity: O(n) where n is total number of properties
830
- *
831
- * @param a - First value to compare
832
- * @param b - Second value to compare
833
- * @returns true if values are deeply equal
834
- *
835
- * @example
836
- * ```typescript
837
- * deepEqual({ a: 1, b: { c: 2 } }, { a: 1, b: { c: 2 } }); // true
838
- * deepEqual({ a: 1, b: 2 }, { b: 2, a: 1 }); // true (order-independent)
839
- * deepEqual([1, 2, 3], [1, 2, 3]); // true
840
- * deepEqual([1, 2], [2, 1]); // false (arrays preserve order)
841
- * ```
842
- */
843
- declare function deepEqual(a: unknown, b: unknown): boolean;
844
-
845
- /**
846
- * Allowed attribute types in .qualifyWith()
847
- *
848
- * IMPORTANT: Complex types (formula, rollup, relation, file, user, document, richtext)
849
- * are NOT supported to avoid duplicating backend behavior.
850
- */
851
- type PropertyType = "text" | "number" | "checkbox" | "date" | "phone" | "currency" | "status" | "select" | "multiselect" | "location";
852
- /**
853
- * Union of attribute types allowed as qualified relation properties.
854
- *
855
- * These are the same Attribute types used for object attributes,
856
- * restricted to simple types that don't require complex backend duplication.
857
- */
858
- type PropertyAttribute = TextAttribute | NumberAttribute | CheckboxAttribute | DateAttribute | PhoneAttribute | CurrencyAttribute | StatusAttribute | SelectAttribute | MultiselectAttribute | LocationAttribute;
859
- /**
860
- * Schema defining properties for a qualified relation.
861
- *
862
- * Uses the same Attribute types as object attributes, enabling DRY builders:
863
- *
864
- * @example
865
- * ```typescript
866
- * relation({ name: "companies", label: "Companies" })
867
- * .to("companies").many()
868
- * .qualifyWith(
869
- * select({ name: "role", label: "Role" }).options([...]).required(),
870
- * number({ name: "shares", label: "Shares" }).min(0),
871
- * )
872
- * ```
873
- */
874
- interface PropertySchema {
875
- definitions: PropertyAttribute[];
876
- }
877
- /**
878
- * Normalizes an attribute's `properties` field to a flat list of
879
- * {@link PropertyAttribute}. Handles both the production {@link PropertySchema}
880
- * shape (`{ definitions: [...] }`) and the raw-array shape used in test
881
- * fixtures (`PropertyAttribute[]`).
882
- */
883
- declare function resolvePropertyDefinitions(attr: unknown): PropertyAttribute[];
884
- /**
885
- * Property attribute types that have an `options` array.
886
- */
887
- type OptionPropertyAttribute = SelectAttribute | StatusAttribute | MultiselectAttribute;
888
- /**
889
- * Type guard to check if a property attribute has options.
890
- *
891
- * @param attr - The property attribute to check
892
- * @returns true if the attribute is a select, status, or multiselect type with options
893
- *
894
- * @example
895
- * ```typescript
896
- * for (const def of definitions) {
897
- * if (hasOptions(def)) {
898
- * // TypeScript knows def.options exists and is Option[]
899
- * for (const option of def.options) {
900
- * console.log(option.value);
901
- * }
902
- * }
903
- * }
904
- * ```
905
- */
906
- declare function hasOptions(attr: PropertyAttribute): attr is OptionPropertyAttribute;
907
-
908
- declare const ATTRIBUTE_TYPES: readonly ["text", "richtext", "number", "checkbox", "date", "phone", "currency", "status", "location", "select", "multiselect", "user", "relation", "formula", "rollup", "document"];
909
- type AttributeType = (typeof ATTRIBUTE_TYPES)[number];
910
- /**
911
- * Status group categorization
912
- */
913
- type StatusGroup = "idle" | "in_progress" | "finished";
914
- /**
915
- * Unified option type for select-like fields
916
- */
917
- interface Option {
918
- value: string;
919
- label: string;
920
- color?: ColorId;
921
- description?: string;
922
- group?: StatusGroup;
923
- /** Value of the inverse option for bilateral relations (e.g. "parent" → "child") */
924
- inverse?: string;
925
- archived?: boolean;
926
- }
927
- /**
928
- * Attribute grouping for UI organization
929
- */
930
- interface AttributeGroup {
931
- id: string;
932
- label: string;
933
- description?: string;
934
- attributeIds: string[];
935
- collapsible?: boolean;
936
- collapsed?: boolean;
937
- order?: number;
938
- }
939
- interface BaseAttribute<DefaultValueType = unknown> {
940
- id?: Uuid;
941
- objectId?: Uuid;
942
- name: string;
943
- label: string;
944
- type: AttributeType;
945
- required?: boolean;
946
- placeholder?: string;
947
- description?: string;
948
- defaultValue?: DefaultValueType;
949
- icon?: IconName;
950
- order?: number;
951
- hidden?: boolean;
952
- archived?: boolean;
953
- deprecated?: boolean;
954
- system?: boolean;
955
- unique?: boolean;
956
- metadata?: Record<string, unknown>;
957
- }
958
- interface TextAttribute extends BaseAttribute<string> {
959
- type: "text";
960
- multiline?: boolean;
961
- minLength?: number;
962
- maxLength?: number;
963
- pattern?: string;
964
- format?: "email" | "url" | "slug";
965
- }
966
- type NumberUnit = "integer" | "decimal" | "percentage";
967
- interface NumberAttribute extends BaseAttribute<number> {
968
- type: "number";
969
- min?: number;
970
- max?: number;
971
- unit?: NumberUnit;
972
- decimals?: number;
973
- renderAs?: "number" | "rating";
974
- }
975
- interface CheckboxAttribute extends BaseAttribute<boolean> {
976
- type: "checkbox";
977
- }
978
- type DateFormat = "short" | "long" | "full" | "relative";
979
- type DateValue = string | "today";
980
- type TimeFormat = "12h" | "24h";
981
- /** Stored value of a date attribute configured with `.endDate()`. */
982
- interface DateRangeValue {
983
- start: string;
984
- end: string | null;
985
- }
986
- interface DateAttribute extends BaseAttribute<string | DateRangeValue> {
987
- type: "date";
988
- dateFormat?: DateFormat;
989
- minDate?: DateValue;
990
- maxDate?: DateValue;
991
- /** Values carry a time component; stored as full ISO UTC datetimes. */
992
- includeTime?: boolean;
993
- /** Values are ranges stored as { start, end } objects. */
994
- endDate?: boolean;
995
- /** Display format for the time component. Defaults to "24h". */
996
- timeFormat?: TimeFormat;
997
- }
998
- interface Phone {
999
- countryCode: CountryIso3;
1000
- phoneNumber: string;
1001
- }
1002
- interface PhoneAttribute extends BaseAttribute<Phone> {
1003
- type: "phone";
1004
- defaultCountryCode?: CountryIso3;
1005
- }
1006
- interface Currency {
1007
- code: CurrencyCode;
1008
- value: number;
1009
- }
1010
- interface CurrencyAttribute extends BaseAttribute<Currency> {
1011
- type: "currency";
1012
- defaultCurrency?: CurrencyCode;
1013
- allowedCurrencies?: CurrencyCode[];
1014
- /** Allow negative currency values (e.g. refunds, credits). Defaults to false. */
1015
- allowNegative?: boolean;
1016
- }
1017
- /**
1018
- * StatusAttribute - For workflow states with semantic grouping (idle/in_progress/finished)
1019
- * Use this for: Task status, Order status, Project phases, Process states
1020
- * Use SelectAttribute for: Categories, Types, simple choices without workflow
1021
- */
1022
- interface StatusAttribute extends BaseAttribute<string> {
1023
- type: "status";
1024
- options: Option[];
1025
- }
1026
- interface Location {
1027
- address?: string;
1028
- address2?: string;
1029
- city?: string;
1030
- state?: string;
1031
- postalCode?: string;
1032
- country?: CountryIso3;
1033
- latitude?: number;
1034
- longitude?: number;
1035
- }
1036
- type LocationGranularity = "full" | "address" | "city" | "state" | "country" | "coordinates";
1037
- interface LocationAttribute extends BaseAttribute<Location> {
1038
- type: "location";
1039
- granularity?: LocationGranularity;
1040
- defaultCountry?: CountryIso3;
1041
- allowedCountries?: CountryIso3[];
1042
- }
1043
- /**
1044
- * SelectAttribute - For simple single-choice selection
1045
- * Use this for: Categories, Document types, Departments, Priorities
1046
- * Options can be grouped (e.g., countries by continent) but no workflow logic
1047
- */
1048
- interface SelectAttribute extends BaseAttribute<string> {
1049
- type: "select";
1050
- options: Option[];
1051
- renderAs?: "badges";
1052
- }
1053
- interface MultiselectAttribute extends BaseAttribute<string[]> {
1054
- type: "multiselect";
1055
- options: Option[];
1056
- renderAs?: "badges";
1057
- }
1058
- type UserReferenceType = "user" | "agent";
1059
- interface UserAttribute extends BaseAttribute<string | string[]> {
1060
- type: "user";
1061
- types?: UserReferenceType[];
1062
- multiple?: boolean;
1063
- }
1064
- /**
1065
- * Wildcard marker for universal relations (can link to any object)
1066
- * Use with `.toAny()` builder method
1067
- */
1068
- declare const RELATION_TARGET_ANY: "*";
1069
- /**
1070
- * Configuration for bilateral synchronization (bidirectional relations)
1071
- */
1072
- interface BilateralConfig {
1073
- /** Target object containing the inverse attribute */
1074
- object: string;
1075
- /** Name of the inverse attribute */
1076
- attribute: string;
1077
- /** Optional cardinality override (inferred by default) */
1078
- cardinality?: "one" | "many";
1079
- /** Label for the inverse attribute when it is generated from this declaration. */
1080
- label?: string;
1081
- /** When true, this side owns the storage direction for qualified properties.
1082
- * Set to false on the inverse side (enriched at read time). */
1083
- storageOwner?: boolean;
1084
- }
1085
- /**
1086
- * Target object for a relation - defines which objects can be linked
1087
- */
1088
- interface RelationTarget {
1089
- /** Object name (e.g., "companies", "contacts") or "*" for any object */
1090
- object: string;
1091
- /**
1092
- * Display template for the label using mustache-like syntax
1093
- * @example "{name}" or "{firstName} {lastName} — {email}"
1094
- */
1095
- displayTemplate?: string;
1096
- /**
1097
- * Optional filter to restrict available records
1098
- * @example { status: "active" }
1099
- */
1100
- filter?: Record<string, unknown>;
1101
- }
1102
- /**
1103
- * Base properties shared by both single and multi relation attributes
1104
- *
1105
- * Note: Deletion behavior is always "restrict" - if a record is referenced
1106
- * by other records, it cannot be deleted until those references are removed.
1107
- * This is enforced by RecordService.deleteRecord() which throws
1108
- * RecordReferencedError when attempting to delete a referenced record.
1109
- */
1110
- interface RelationAttributeBase extends Omit<BaseAttribute<unknown>, "defaultValue"> {
1111
- type: "relation";
1112
- /** Target objects that can be linked */
1113
- targets: RelationTarget[];
1114
- /** Optional properties schema for qualified relations */
1115
- properties?: PropertySchema;
1116
- /** Configuration for bilateral synchronization (opt-in) */
1117
- bilateral?: BilateralConfig;
1118
- }
1119
- /**
1120
- * Single relation attribute (one-to-one or many-to-one)
1121
- * Stores a single record ID or null
1122
- */
1123
- interface SingleRelationAttribute extends RelationAttributeBase {
1124
- cardinality: "one";
1125
- defaultValue?: string | null;
1126
- }
1127
- /**
1128
- * Multi relation attribute (one-to-many or many-to-many)
1129
- * Stores an array of record IDs
1130
- */
1131
- interface MultiRelationAttribute extends RelationAttributeBase {
1132
- cardinality: "many";
1133
- defaultValue?: string[];
1134
- /** Maximum number of relations allowed */
1135
- maxItems?: number;
1136
- }
1137
- /**
1138
- * RelationAttribute links to other objects/records
1139
- * Discriminated union by cardinality for type-safe value handling
1140
- *
1141
- * @example Single relation (many-to-one)
1142
- * ```typescript
1143
- * relation({ name: "company", label: "Company" })
1144
- * .to("companies")
1145
- * .required()
1146
- * // → Value: "rec-uuid-123" | null
1147
- * ```
1148
- *
1149
- * @example Multi relation (many-to-many)
1150
- * ```typescript
1151
- * relation({ name: "contacts", label: "Contacts" })
1152
- * .to("contacts", { displayTemplate: "{firstName} {lastName}" })
1153
- * .many()
1154
- * .maxItems(5)
1155
- * // → Value: ["rec-1", "rec-2", ...]
1156
- * ```
1157
- *
1158
- * @example Polymorphic relation (multiple target objects)
1159
- * ```typescript
1160
- * relation({ name: "linked", label: "Linked Items" })
1161
- * .to("companies")
1162
- * .to("contacts")
1163
- * .to("deals")
1164
- * .many()
1165
- * // → Can link to records from any of these objects
1166
- * ```
1167
- */
1168
- type RelationAttribute = SingleRelationAttribute | MultiRelationAttribute;
1169
- /**
1170
- * Check if a relation attribute is universal (can link to any object)
1171
- * Universal relations have `targets: [{ object: "*" }]`
1172
- */
1173
- /**
1174
- * The object names a relation attribute can point at, universal marker
1175
- * stripped. Any other attribute type — and a relation row whose config lost
1176
- * its `targets` — yields no names.
1177
- */
1178
- declare function relationTargetsOf(attribute: Attribute): string[];
1179
- declare function isUniversalRelation(attr: RelationAttribute): boolean;
1180
- /**
1181
- * Check if a relation attribute has bilateral synchronization enabled
1182
- */
1183
- declare function isBilateralRelation(attr: RelationAttribute): attr is RelationAttribute & {
1184
- bilateral: BilateralConfig;
1185
- };
1186
- /**
1187
- * Infer the cardinality of the inverse relation
1188
- * - one → many (contact.company ↔ company.contacts)
1189
- * - many → many (contact.tags ↔ tag.contacts)
1190
- */
1191
- declare function inferInverseCardinality(cardinality: "one" | "many"): "one" | "many";
1192
- /**
1193
- * RichtextAttribute - Rich text content using semantic markdown
1194
- *
1195
- * Stores content as semantic markdown string (with directives like :::callout).
1196
- * Parsed at runtime to Tiptap JSON for editing.
1197
- * Use this for: Notes, articles, descriptions, long-form content.
1198
- *
1199
- * @example
1200
- * ```typescript
1201
- * richtext({ name: "content", label: "Content" }).required()
1202
- * ```
1203
- */
1204
- interface RichtextAttribute extends BaseAttribute<string> {
1205
- type: "richtext";
1206
- }
1207
- type RichTextAttribute = RichtextAttribute;
1208
- /**
1209
- * Return type for formula expressions
1210
- */
1211
- type FormulaReturnType = ComputedReturnType;
1212
- /**
1213
- * FormulaAttribute - Computed value based on other attributes
1214
- *
1215
- * Formulas are calculated at read-time and are always read-only.
1216
- * Users cannot directly edit formula values.
1217
- *
1218
- * @example Simple calculation
1219
- * ```typescript
1220
- * formula({ name: "total", label: "Total" })
1221
- * .expression("price * quantity")
1222
- * .returns("number")
1223
- * .decimals(2)
1224
- * ```
1225
- *
1226
- * @example With functions
1227
- * ```typescript
1228
- * formula({ name: "fullName", label: "Full Name" })
1229
- * .expression("CONCAT(firstName, ' ', lastName)")
1230
- * .returns("text")
1231
- * ```
1232
- */
1233
- interface FormulaAttribute extends Omit<BaseAttribute<never>, "defaultValue" | "required"> {
1234
- type: "formula";
1235
- /** Expression to evaluate (e.g., "price * quantity") */
1236
- expression: string;
1237
- /** Expected return type for formatting */
1238
- returnType: FormulaReturnType;
1239
- /** Decimal places for number results */
1240
- decimals?: number;
1241
- /** Source attribute for select-like computed options */
1242
- optionsSource?: ComputedOptionsSource;
1243
- /** Whether to allow relation references in the expression (e.g., "company.name") */
1244
- allowRelations?: boolean;
1245
- /** Formula is always not required (read-only) */
1246
- required: false;
1247
- }
1248
- /**
1249
- * Aggregation functions for rollup attributes
1250
- *
1251
- * Categories:
1252
- * - Numeric (sum, avg): Only for number and currency types
1253
- * - Date (earliest, latest): Only for date type
1254
- * - Count (count, countValues, countUniqueValues, countEmpty): Universal
1255
- * - Percent (percentEmpty, percentNotEmpty): Universal
1256
- * - Lookup (original): Returns all values as array, rendered as target type
1257
- */
1258
- type RollupFunction = "sum" | "avg" | "earliest" | "latest" | "count" | "countValues" | "countUniqueValues" | "countEmpty" | "percentEmpty" | "percentNotEmpty" | "original";
1259
- /**
1260
- * RollupAttribute - Aggregates values from related records
1261
- *
1262
- * Rollups are calculated and stored (denormalized) for performance.
1263
- * They are automatically recalculated when related records change.
1264
- * Users cannot directly edit rollup values.
1265
- *
1266
- * @example Sum of related amounts
1267
- * ```typescript
1268
- * rollup({ name: "totalOrders", label: "Total Orders" })
1269
- * .from("orders") // relation attribute name
1270
- * .aggregate("amount") // target attribute to sum
1271
- * .using("sum")
1272
- * .decimals(2)
1273
- * ```
1274
- *
1275
- * @example Count of related records
1276
- * ```typescript
1277
- * rollup({ name: "orderCount", label: "Number of Orders" })
1278
- * .from("orders")
1279
- * .using("count")
1280
- * ```
1281
- */
1282
- interface RollupAttribute extends Omit<BaseAttribute<never>, "defaultValue" | "required"> {
1283
- type: "rollup";
1284
- /** Name of the relation attribute on this object */
1285
- relationAttribute: string;
1286
- /**
1287
- * Dot notation path for multi-level traversal (Phase 4+)
1288
- * @example "orders.items" - traverse through orders to items
1289
- */
1290
- relationPath?: string;
1291
- /** Attribute name on the target object to aggregate */
1292
- targetAttribute: string;
1293
- /** Aggregation function to apply */
1294
- function: RollupFunction;
1295
- /** Decimal places for numeric results */
1296
- decimals?: number;
1297
- /** Rollup is always not required (read-only) */
1298
- required: false;
1299
- /**
1300
- * Cached type of the target attribute for display purposes
1301
- * Used when function="original" to render values as the target type
1302
- */
1303
- targetAttributeType?: AttributeType;
1304
- /**
1305
- * Cached currency code of a currency target, from its `defaultCurrency`
1306
- * (#2644). The stored rollup value stays a bare number; this is the
1307
- * schema-derived channel that lets a single-code sum/avg render with its
1308
- * symbol. Absent → the value renders bare, exactly as before.
1309
- *
1310
- * Named for what it holds — an ISO 4217 CODE — rather than the siblings'
1311
- * `targetAttribute*` prefix: `targetAttributeCurrency` would read as a
1312
- * `Currency` value, which this deliberately is not.
1313
- */
1314
- targetCurrencyCode?: CurrencyCode;
1315
- /**
1316
- * Cached options from target attribute (for select/status/multiselect display)
1317
- * Required when function="original" and target is a select-like type
1318
- */
1319
- targetAttributeOptions?: Option[];
1320
- /** Source attribute for select-like computed options */
1321
- optionsSource?: ComputedOptionsSource;
1322
- }
1323
- /**
1324
- * DocumentAttribute - References structured documents.
1325
- *
1326
- * A DocumentAttribute references packs of anonymous files with typed edge
1327
- * properties.
1328
- *
1329
- * Every document attribute is multi by construction — the underlying storage
1330
- * (documents + files) supports 1 Doc → N files uniformly.
1331
- *
1332
- * @example
1333
- * ```typescript
1334
- * document({ name: "contracts", label: "Contrats" })
1335
- * .accepts(["application/pdf"])
1336
- * ```
1337
- */
1338
- interface DocumentAttribute extends BaseAttribute<string[]> {
1339
- type: "document";
1340
- /**
1341
- * Schema for typed properties on the record→document edge.
1342
- * Symmetric with `RelationAttribute.properties`; populated by `.qualifyWith(...)`.
1343
- * Stored on `record_reference_edges.properties`, not on the document itself.
1344
- */
1345
- properties?: PropertySchema;
1346
- /** MIME prefixes/globs (e.g. "image/*", "application/pdf") applied to every file of the pack. */
1347
- accepts?: string[];
1348
- /** Hard ceiling in bytes applied to every file of the pack. */
1349
- maxFileSize?: number;
1350
- }
1351
- /**
1352
- * Union of every attribute definition supported by Standards objects.
1353
- *
1354
- * Use this type when code needs to inspect or render attributes generically
1355
- * across primitive, relation, computed, user, and document fields.
1356
- */
1357
- type Attribute = TextAttribute | RichtextAttribute | NumberAttribute | CheckboxAttribute | DateAttribute | PhoneAttribute | CurrencyAttribute | StatusAttribute | LocationAttribute | SelectAttribute | MultiselectAttribute | UserAttribute | RelationAttribute | FormulaAttribute | RollupAttribute | DocumentAttribute;
1358
- /**
1359
- * Check if an attribute supports sorting based on its type.
1360
- */
1361
- declare function isAttributeSortable(attr: {
1362
- type: AttributeType;
1363
- }): boolean;
1364
-
1365
- export { type BuiltInTransform as $, type Attribute as A, type BilateralConfig as B, type CheckboxAttribute as C, type DateAttribute as D, type FormulaReturnType as E, type FormulaAttribute as F, type RollupFunction as G, type UserReferenceType as H, SchemaErrorCode as I, SchemaError as J, ATTRIBUTE_TYPES as K, type LocationAttribute as L, type MultiselectAttribute as M, type NumberAttribute as N, type Option as O, type PhoneAttribute as P, AccessDeniedError as Q, type RichtextAttribute as R, type SelectAttribute as S, type TextAttribute as T, type UserAttribute as U, ValidationError as V, type AttributeGroup as W, AttributeInUseError as X, AttributeNotFoundError as Y, type AttributeUsage as Z, type BaseAttribute as _, type CurrencyAttribute as a, isSchemaError as a$, ChangeTypeNotSupportedError as a0, type ComputedFieldKind as a1, type ComputedFormulaBinaryNode as a2, type ComputedFormulaBinaryOperator as a3, type ComputedFormulaCallNode as a4, type ComputedFormulaLiteralNode as a5, ComputedFormulaParseError as a6, type ComputedFormulaPathNode as a7, ConcurrentModificationError as a8, type DateFormat as a9, type SchemaOperation as aA, SchemaPlanNotFoundError as aB, SearchBackendError as aC, type StatusGroup as aD, StorageError as aE, type StorageOperation as aF, SyncCascadeError as aG, SyncConflictError as aH, SyncError as aI, SystemEntityImmutableError as aJ, type UserId as aK, type ValidationErrorDetail as aL, asTenantId as aM, asUserId as aN, canonicalStringify as aO, deepEqual as aP, generateId as aQ, hasOptions as aR, indexBy as aS, inferInverseCardinality as aT, isAttributeInUseError as aU, isAttributeSortable as aV, isBilateralRelation as aW, isNotFoundError as aX, isObjectReferencedError as aY, isProtectedResourceError as aZ, isRecordReferencedError as a_, type DateValue as aa, DestructiveSyncNotAllowedError as ab, DuplicateError as ac, ForbiddenError as ad, MemoryNotFoundError as ae, MigrationTimeoutError as af, NonJsonValueError as ag, NotFoundError as ah, NotImplementedError as ai, type NumberUnit as aj, ObjectNotFoundError as ak, ObjectReferencedError as al, type OptionPropertyAttribute as am, OrphanSystemAttributeError as an, type PropertyType as ao, ProtectedResourceError as ap, ProtectedRoleError as aq, RELATION_TARGET_ANY as ar, RecordNotFoundError as as, type RecordReference as at, RecordReferencedError as au, RepositoryError as av, type RepositoryOperation as aw, ReservedObjectNameError as ax, type RichTextAttribute as ay, RoleNotFoundError as az, type StatusAttribute as b, isUniversalRelation as b0, isValidationError as b1, parseComputedFormula as b2, relationTargetsOf as b3, resolvePropertyDefinitions as b4, sameStableValue as b5, serializeCanonicalJson as b6, serializeStableJson as b7, type MultiRelationAttribute as c, type RelationAttribute as d, type SingleRelationAttribute as e, type RollupAttribute as f, type Uuid as g, type MigrationDefinition as h, type ComputedValueType as i, type ComputedReturnType as j, type AttributeType as k, type ComputedOptionsSource as l, type ComputedDependency as m, type ComputedPlan as n, type ComputedFormulaAstNode as o, type TenantId as p, type LocationGranularity as q, type Location as r, type DateRangeValue as s, type DocumentAttribute as t, type Phone as u, type Currency as v, type PropertySchema as w, type PropertyAttribute as x, type RelationTarget as y, type TimeFormat as z };