@stndrds/schema 1.0.0-alpha.348 → 1.0.0-alpha.350

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