@stndrds/schema 1.0.0-alpha.349 → 1.0.0-alpha.351
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.
- package/dist/{all-CnoQ40WJ.d.mts → all-CxrR3FfQ.d.mts} +8 -8
- package/dist/{all-DZp7BWOq.d.ts → all-DgCMEIjc.d.ts} +8 -8
- package/dist/attributes-BrWmES5w.d.mts +684 -0
- package/dist/attributes-DF899HOt.d.ts +684 -0
- package/dist/{checkbox-Cli_fh_9.d.ts → checkbox-Clb_FZ4C.d.mts} +2 -2
- package/dist/{checkbox-De7-FSiU.d.mts → checkbox-DdyYfy8E.d.ts} +2 -2
- package/dist/config-CYuFravl.js +13 -0
- package/dist/config-CiAtjzem.mjs +13 -0
- package/dist/{date-CxGxPeHR.d.mts → date-CXp1zJM4.d.mts} +2 -2
- package/dist/{date-CJGbHQZF.d.ts → date-DhwNqFU4.d.ts} +2 -2
- package/dist/empty-BgAwlO54.mjs +2 -0
- package/dist/empty-CRCKZcwK.js +2 -0
- package/dist/exceptions-DrrzAhuA.d.mts +590 -0
- package/dist/exceptions-DrrzAhuA.d.ts +590 -0
- package/dist/exceptions.d.mts +2 -2
- package/dist/exceptions.d.ts +2 -2
- package/dist/exceptions.js +1 -2
- package/dist/exceptions.mjs +1 -2
- package/dist/{index-DqfX-ct_.d.mts → index-BOibflWy.d.ts} +15 -2
- package/dist/{index-UancE_wI.d.ts → index-Bfvc4AZB.d.mts} +15 -2
- package/dist/{index-Dz6tbe0o.d.ts → index-DCw-X_sc.d.ts} +3 -6
- package/dist/{index-fWrEgqge.d.mts → index-DggAjGTr.d.mts} +1 -1
- package/dist/{index-DRfeDI4f.d.mts → index-Lp5dhlhc.d.mts} +3 -6
- package/dist/{index-C9whsQlG.d.ts → index-OvRk1isl.d.ts} +1 -1
- package/dist/index.d.mts +221 -115
- package/dist/index.d.ts +221 -115
- package/dist/index.js +9 -9
- package/dist/index.mjs +9 -9
- package/dist/{number-BtJHcFCQ.d.ts → number-C_ZN3qJO.d.mts} +2 -2
- package/dist/{number-DJ-nhMMq.d.mts → number-CoTBX03I.d.ts} +2 -2
- package/dist/object-AqI3n2CP.mjs +4 -0
- package/dist/object-BEwZx-Fu.js +4 -0
- package/dist/{text-RUwIi6jM.d.mts → text-D_rs4VYZ.d.mts} +2 -2
- package/dist/{text-qHaUKcUU.d.ts → text-Z8QjbxUx.d.ts} +2 -2
- package/dist/utils-Cl3b_6d8.d.mts +163 -0
- package/dist/utils-Cuz_wSKI.d.ts +163 -0
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/validation/all.d.mts +5 -5
- package/dist/validation/all.d.ts +5 -5
- package/dist/validation/all.js +1 -1
- package/dist/validation/all.mjs +1 -1
- package/dist/validation/complex/currency.d.mts +2 -2
- package/dist/validation/complex/currency.d.ts +2 -2
- package/dist/validation/complex/location.d.mts +2 -2
- package/dist/validation/complex/location.d.ts +2 -2
- package/dist/validation/complex/phone.d.mts +2 -2
- package/dist/validation/complex/phone.d.ts +2 -2
- package/dist/validation/complex/relation.d.mts +2 -2
- package/dist/validation/complex/relation.d.ts +2 -2
- package/dist/validation/complex/richtext.d.mts +2 -2
- package/dist/validation/complex/richtext.d.ts +2 -2
- package/dist/validation/complex/select.d.mts +2 -2
- package/dist/validation/complex/select.d.ts +2 -2
- package/dist/validation/complex/user.d.mts +2 -2
- package/dist/validation/complex/user.d.ts +2 -2
- package/dist/validation/computed/formula.d.mts +2 -2
- package/dist/validation/computed/formula.d.ts +2 -2
- package/dist/validation/computed/rollup.d.mts +2 -2
- package/dist/validation/computed/rollup.d.ts +2 -2
- package/dist/validation/config/index.d.mts +2 -2
- package/dist/validation/config/index.d.ts +2 -2
- package/dist/validation/config/index.js +1 -1
- package/dist/validation/config/index.mjs +1 -1
- package/dist/validation/core/index.d.mts +1 -1
- package/dist/validation/core/index.d.ts +1 -1
- package/dist/validation/object/index.d.mts +1 -1
- package/dist/validation/object/index.d.ts +1 -1
- package/dist/validation/object/index.js +1 -1
- package/dist/validation/object/index.mjs +1 -1
- package/dist/validation/primitives/checkbox.d.mts +1 -1
- package/dist/validation/primitives/checkbox.d.ts +1 -1
- package/dist/validation/primitives/date.d.mts +1 -1
- package/dist/validation/primitives/date.d.ts +1 -1
- package/dist/validation/primitives/number.d.mts +1 -1
- package/dist/validation/primitives/number.d.ts +1 -1
- package/dist/validation/primitives/text.d.mts +1 -1
- package/dist/validation/primitives/text.d.ts +1 -1
- package/dist/view-config.schema-CCrM5b-O.mjs +2 -0
- package/dist/view-config.schema-CgU86fLj.js +2 -0
- package/package.json +2 -2
- package/dist/config-BiQGgy7f.mjs +0 -13
- package/dist/config-WUWITOeW.js +0 -13
- package/dist/exceptions-B2EKDci0.d.mts +0 -1460
- package/dist/exceptions-B2EKDci0.d.ts +0 -1460
- package/dist/object-BA3vKFl0.js +0 -4
- package/dist/object-C92B0Oei.mjs +0 -4
- package/dist/view-config.schema-PCAznd98.mjs +0 -2
- package/dist/view-config.schema-VEoY_VAd.js +0 -2
|
@@ -1,1460 +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 EDIT_MATCH_NOT_FOUND: "EDIT_MATCH_NOT_FOUND";
|
|
985
|
-
readonly EDIT_MATCH_AMBIGUOUS: "EDIT_MATCH_AMBIGUOUS";
|
|
986
|
-
readonly EDIT_NO_CHANGE: "EDIT_NO_CHANGE";
|
|
987
|
-
readonly EDIT_TARGET_UNAVAILABLE: "EDIT_TARGET_UNAVAILABLE";
|
|
988
|
-
readonly EDIT_TARGET_UNSUPPORTED: "EDIT_TARGET_UNSUPPORTED";
|
|
989
|
-
readonly AGENT_EXECUTION_CANCELLED: "AGENT_EXECUTION_CANCELLED";
|
|
990
|
-
readonly AGENT_EXECUTION_TIMEOUT: "AGENT_EXECUTION_TIMEOUT";
|
|
991
|
-
readonly AGENT_EXTERNAL_OUTCOME_UNKNOWN: "AGENT_EXTERNAL_OUTCOME_UNKNOWN";
|
|
992
|
-
readonly AGENT_TOOL_CANCELLATION_POLICY: "AGENT_TOOL_CANCELLATION_POLICY";
|
|
993
|
-
readonly AGENT_CANCELLATION_WATCH_CAPACITY: "AGENT_CANCELLATION_WATCH_CAPACITY";
|
|
994
|
-
readonly AGENT_CANCELLATION_CLEANUP: "AGENT_CANCELLATION_CLEANUP";
|
|
995
|
-
readonly DEVICE_NOT_FOUND: "DEVICE_NOT_FOUND";
|
|
996
|
-
readonly DEVICE_OFFLINE: "DEVICE_OFFLINE";
|
|
997
|
-
readonly DEVICE_CAPABILITY_MISMATCH: "DEVICE_CAPABILITY_MISMATCH";
|
|
998
|
-
readonly DEVICE_CHANNEL_PROTOCOL: "DEVICE_CHANNEL_PROTOCOL";
|
|
999
|
-
readonly AI_UNKNOWN: "AI_UNKNOWN";
|
|
1000
|
-
readonly AI_USAGE_LIMIT_EXCEEDED: "AI_USAGE_LIMIT_EXCEEDED";
|
|
1001
|
-
readonly AI_INVALID_USAGE: "AI_INVALID_USAGE";
|
|
1002
|
-
readonly AI_INVALID_MODEL: "AI_INVALID_MODEL";
|
|
1003
|
-
readonly AI_INVALID_MODEL_INPUT: "AI_INVALID_MODEL_INPUT";
|
|
1004
|
-
readonly AI_REPOSITORY_ERROR: "AI_REPOSITORY_ERROR";
|
|
1005
|
-
readonly AI_GENERATION_FAILED: "AI_GENERATION_FAILED";
|
|
1006
|
-
readonly AI_DECISION_FAILED: "AI_DECISION_FAILED";
|
|
1007
|
-
readonly AI_IMAGE_USAGE_PENDING: "AI_IMAGE_USAGE_PENDING";
|
|
1008
|
-
readonly AI_IMAGE_GENERATION_INDETERMINATE: "AI_IMAGE_GENERATION_INDETERMINATE";
|
|
1009
|
-
readonly AI_IMAGE_RESERVATION_CLEANUP_INDETERMINATE: "AI_IMAGE_RESERVATION_CLEANUP_INDETERMINATE";
|
|
1010
|
-
readonly AI_IMAGE_PUBLICATION_FAILED: "AI_IMAGE_PUBLICATION_FAILED";
|
|
1011
|
-
readonly DOCUMENT_MIME_NOT_ACCEPTED: "DOCUMENT_MIME_NOT_ACCEPTED";
|
|
1012
|
-
readonly DOCUMENT_MULTIPLE_NOT_ALLOWED: "DOCUMENT_MULTIPLE_NOT_ALLOWED";
|
|
1013
|
-
readonly DOCUMENT_NOT_FOUND_FOR_OPERATION: "DOCUMENT_NOT_FOUND_FOR_OPERATION";
|
|
1014
|
-
readonly DOCUMENT_STORAGE_FAILED: "DOCUMENT_STORAGE_FAILED";
|
|
1015
|
-
readonly DOCUMENT_SIZE_EXCEEDED: "DOCUMENT_SIZE_EXCEEDED";
|
|
1016
|
-
readonly DOCUMENT_OCR_FAILED: "DOCUMENT_OCR_FAILED";
|
|
1017
|
-
readonly DOCUMENT_BLOB_EMPTY: "DOCUMENT_BLOB_EMPTY";
|
|
1018
|
-
readonly DOCUMENT_FILE_TOO_LARGE: "DOCUMENT_FILE_TOO_LARGE";
|
|
1019
|
-
readonly DOCUMENT_FILE_NOT_FOUND: "DOCUMENT_FILE_NOT_FOUND";
|
|
1020
|
-
readonly DOCUMENT_FILE_ALREADY_PACKED: "DOCUMENT_FILE_ALREADY_PACKED";
|
|
1021
|
-
readonly DOCUMENT_RECORD_NOT_FOUND: "DOCUMENT_RECORD_NOT_FOUND";
|
|
1022
|
-
readonly DOCUMENT_RECORD_OBJECT_MISMATCH: "DOCUMENT_RECORD_OBJECT_MISMATCH";
|
|
1023
|
-
readonly DOCUMENT_FOLDER_SERVICE_UNAVAILABLE: "DOCUMENT_FOLDER_SERVICE_UNAVAILABLE";
|
|
1024
|
-
readonly DOCUMENT_FOLDER_PATH_NOT_FOUND: "DOCUMENT_FOLDER_PATH_NOT_FOUND";
|
|
1025
|
-
readonly EMAIL_PROVIDER_API_FAILED: "EMAIL_PROVIDER_API_FAILED";
|
|
1026
|
-
readonly EMAIL_SEND_FAILED: "EMAIL_SEND_FAILED";
|
|
1027
|
-
readonly EMAIL_SENT_NOT_STORED: "EMAIL_SENT_NOT_STORED";
|
|
1028
|
-
readonly EMAIL_BATCH_ITEM_FAILED: "EMAIL_BATCH_ITEM_FAILED";
|
|
1029
|
-
readonly CALENDAR_PROVIDER_API_FAILED: "CALENDAR_PROVIDER_API_FAILED";
|
|
1030
|
-
readonly REFLEX_INVALID_TRANSITION: "REFLEX_INVALID_TRANSITION";
|
|
1031
|
-
readonly REFLEX_INVALID_TOKEN: "REFLEX_INVALID_TOKEN";
|
|
1032
|
-
readonly REFLEX_CAPABILITY_DENIED: "REFLEX_CAPABILITY_DENIED";
|
|
1033
|
-
readonly REFLEX_GATEWAY_UNAVAILABLE: "REFLEX_GATEWAY_UNAVAILABLE";
|
|
1034
|
-
readonly REFLEX_BUNDLE_FAILED: "REFLEX_BUNDLE_FAILED";
|
|
1035
|
-
readonly REFLEX_EGRESS_DENIED: "REFLEX_EGRESS_DENIED";
|
|
1036
|
-
readonly REFLEX_PROTOCOL_VIOLATION: "REFLEX_PROTOCOL_VIOLATION";
|
|
1037
|
-
readonly REFLEX_RUN_FAILED: "REFLEX_RUN_FAILED";
|
|
1038
|
-
readonly REFLEX_RUN_TIMEOUT: "REFLEX_RUN_TIMEOUT";
|
|
1039
|
-
readonly REFLEX_DEPENDENCY_DRIFT: "REFLEX_DEPENDENCY_DRIFT";
|
|
1040
|
-
readonly REFLEX_NOT_READY: "REFLEX_NOT_READY";
|
|
1041
|
-
readonly REFLEX_INVARIANT_VIOLATION: "REFLEX_INVARIANT_VIOLATION";
|
|
1042
|
-
/** The embeddings feature is enabled but no Gateway credential is configured. */
|
|
1043
|
-
readonly EMBEDDING_MODEL_UNAVAILABLE: "EMBEDDING_MODEL_UNAVAILABLE";
|
|
1044
|
-
/** The provider returned vectors whose length differs from the configured dimensions. */
|
|
1045
|
-
readonly EMBEDDING_DIMENSION_MISMATCH: "EMBEDDING_DIMENSION_MISMATCH";
|
|
1046
|
-
};
|
|
1047
|
-
type SchemaErrorCode = (typeof SchemaErrorCode)[keyof typeof SchemaErrorCode];
|
|
1048
|
-
/**
|
|
1049
|
-
* Base error class for all schema-related errors
|
|
1050
|
-
*/
|
|
1051
|
-
declare class SchemaError extends Error {
|
|
1052
|
-
readonly code: SchemaErrorCode;
|
|
1053
|
-
readonly details?: Record<string, unknown>;
|
|
1054
|
-
constructor(message: string, code?: SchemaErrorCode, details?: Record<string, unknown>);
|
|
1055
|
-
toJSON(): {
|
|
1056
|
-
name: string;
|
|
1057
|
-
code: SchemaErrorCode;
|
|
1058
|
-
message: string;
|
|
1059
|
-
details: Record<string, unknown> | undefined;
|
|
1060
|
-
};
|
|
1061
|
-
}
|
|
1062
|
-
/**
|
|
1063
|
-
* Base class for "not found" errors
|
|
1064
|
-
*/
|
|
1065
|
-
declare class NotFoundError extends SchemaError {
|
|
1066
|
-
/** Literal discriminator for `Effect.catchTag`; a widened `string` breaks narrowing. */
|
|
1067
|
-
readonly _tag = "NotFoundError";
|
|
1068
|
-
readonly resourceType: string;
|
|
1069
|
-
readonly resourceId: string;
|
|
1070
|
-
constructor(resourceType: string, resourceId: string, code?: SchemaErrorCode, message?: string);
|
|
1071
|
-
}
|
|
1072
|
-
/**
|
|
1073
|
-
* Object not found error
|
|
1074
|
-
*/
|
|
1075
|
-
declare class ObjectNotFoundError extends NotFoundError {
|
|
1076
|
-
constructor(objectId: string);
|
|
1077
|
-
}
|
|
1078
|
-
/**
|
|
1079
|
-
* Attribute not found error
|
|
1080
|
-
*/
|
|
1081
|
-
declare class AttributeNotFoundError extends NotFoundError {
|
|
1082
|
-
constructor(attributeId: string);
|
|
1083
|
-
}
|
|
1084
|
-
/**
|
|
1085
|
-
* Record not found error
|
|
1086
|
-
*/
|
|
1087
|
-
declare class RecordNotFoundError extends NotFoundError {
|
|
1088
|
-
constructor(recordId: string);
|
|
1089
|
-
}
|
|
1090
|
-
/**
|
|
1091
|
-
* Schema plan not found error — raised when a `planId` sent by an approver
|
|
1092
|
-
* (who never receives the plan payload itself, only its id) does not match
|
|
1093
|
-
* any stored plan.
|
|
1094
|
-
*/
|
|
1095
|
-
declare class SchemaPlanNotFoundError extends NotFoundError {
|
|
1096
|
-
constructor(planId: string);
|
|
1097
|
-
}
|
|
1098
|
-
/**
|
|
1099
|
-
* Validation error with field-level details
|
|
1100
|
-
*/
|
|
1101
|
-
interface ValidationErrorDetail {
|
|
1102
|
-
path: string[];
|
|
1103
|
-
message: string;
|
|
1104
|
-
code?: string;
|
|
1105
|
-
}
|
|
1106
|
-
/**
|
|
1107
|
-
* Validation error thrown when data fails schema validation
|
|
1108
|
-
*/
|
|
1109
|
-
declare class ValidationError extends SchemaError {
|
|
1110
|
-
/** Literal discriminator for `Effect.catchTag`; a widened `string` breaks narrowing. */
|
|
1111
|
-
readonly _tag = "ValidationError";
|
|
1112
|
-
readonly errors: ValidationErrorDetail[];
|
|
1113
|
-
constructor(message: string, errors: ValidationErrorDetail[]);
|
|
1114
|
-
/**
|
|
1115
|
-
* Create a validation error from Zod-style errors
|
|
1116
|
-
*/
|
|
1117
|
-
static fromZodErrors(errors: Array<{
|
|
1118
|
-
path: (string | number)[];
|
|
1119
|
-
message: string;
|
|
1120
|
-
}>): ValidationError;
|
|
1121
|
-
}
|
|
1122
|
-
/**
|
|
1123
|
-
* Error thrown when attempting to modify a protected (system) resource
|
|
1124
|
-
*/
|
|
1125
|
-
declare class ProtectedResourceError extends SchemaError {
|
|
1126
|
-
readonly resourceType: "object" | "attribute" | "view";
|
|
1127
|
-
readonly resourceName: string;
|
|
1128
|
-
readonly operation: "delete" | "modify";
|
|
1129
|
-
constructor(resourceType: "object" | "attribute" | "view", resourceName: string, operation: "delete" | "modify");
|
|
1130
|
-
}
|
|
1131
|
-
/**
|
|
1132
|
-
* Error thrown during native object synchronization
|
|
1133
|
-
*/
|
|
1134
|
-
declare class SyncError extends SchemaError {
|
|
1135
|
-
readonly objectName: string;
|
|
1136
|
-
readonly cause?: Error;
|
|
1137
|
-
constructor(objectName: string, message: string, cause?: Error);
|
|
1138
|
-
}
|
|
1139
|
-
/**
|
|
1140
|
-
* Thrown when code tries to mutate a system entity at runtime.
|
|
1141
|
-
* System entities are declared in code and immutable at runtime.
|
|
1142
|
-
* HTTP status: 403 Forbidden.
|
|
1143
|
-
*/
|
|
1144
|
-
declare class SystemEntityImmutableError extends SchemaError {
|
|
1145
|
-
readonly entityType: string;
|
|
1146
|
-
readonly entityName: string;
|
|
1147
|
-
constructor(entityType: string, entityName: string);
|
|
1148
|
-
}
|
|
1149
|
-
interface SyncConflictParams {
|
|
1150
|
-
objectName: string;
|
|
1151
|
-
attributeName?: string;
|
|
1152
|
-
reason: string;
|
|
1153
|
-
}
|
|
1154
|
-
/**
|
|
1155
|
-
* Thrown at boot when an auto-promote cannot proceed due to incompatible types
|
|
1156
|
-
* or constraints. The dev must resolve manually (relax constraints, migrate
|
|
1157
|
-
* values, or rename).
|
|
1158
|
-
*/
|
|
1159
|
-
declare class SyncConflictError extends SchemaError {
|
|
1160
|
-
readonly objectName: string;
|
|
1161
|
-
readonly attributeName?: string;
|
|
1162
|
-
readonly reason: string;
|
|
1163
|
-
constructor(params: SyncConflictParams);
|
|
1164
|
-
}
|
|
1165
|
-
/**
|
|
1166
|
-
* Thrown at boot when an object is being demoted but still has system attributes
|
|
1167
|
-
* declared in code. The dev forgot to remove those attributes too, or kept the
|
|
1168
|
-
* object inconsistently.
|
|
1169
|
-
*/
|
|
1170
|
-
declare class SyncCascadeError extends SchemaError {
|
|
1171
|
-
readonly objectName: string;
|
|
1172
|
-
readonly conflictingAttributes: string[];
|
|
1173
|
-
constructor(objectName: string, conflictingAttributes: string[]);
|
|
1174
|
-
}
|
|
1175
|
-
/**
|
|
1176
|
-
* Thrown at boot when an attribute is system:true but its object parent is
|
|
1177
|
-
* system:false. This invariant should never be violated — if seen, it's a bug
|
|
1178
|
-
* in the boot reconciliation logic or in a manual DB mutation.
|
|
1179
|
-
*/
|
|
1180
|
-
declare class OrphanSystemAttributeError extends SchemaError {
|
|
1181
|
-
readonly objectName: string;
|
|
1182
|
-
readonly attributeName: string;
|
|
1183
|
-
constructor(objectName: string, attributeName: string);
|
|
1184
|
-
}
|
|
1185
|
-
/**
|
|
1186
|
-
* Thrown when a destructive operation is detected without the explicit
|
|
1187
|
-
* STANDARDS_ALLOW_DESTRUCTIVE_SYNC=1 opt-in.
|
|
1188
|
-
* HTTP status: 500 (boot fail, should never surface to HTTP).
|
|
1189
|
-
*
|
|
1190
|
-
* Which operations the opt-in governs is decided in one place —
|
|
1191
|
-
* `requiresDestructiveSyncOptIn` in the runtime's sync classifier. Today that
|
|
1192
|
-
* is object removal only: attribute removal is unconditional at boot, because a
|
|
1193
|
-
* system attribute is code-controlled and its disappearance from the builder is
|
|
1194
|
-
* an unambiguous drop.
|
|
1195
|
-
*
|
|
1196
|
-
* NOTE — Wiring status: defined but not thrown by the current sync.ts, which
|
|
1197
|
-
* demotes instead. Reserved for the `standards diff` CLI gate, which will throw
|
|
1198
|
-
* it when CI detects an unauthorized destructive deployment.
|
|
1199
|
-
*/
|
|
1200
|
-
declare class DestructiveSyncNotAllowedError extends SchemaError {
|
|
1201
|
-
readonly operations: SchemaOperation[];
|
|
1202
|
-
constructor(operations: SchemaOperation[]);
|
|
1203
|
-
}
|
|
1204
|
-
/**
|
|
1205
|
-
* Thrown at boot when applying a migration in batches exceeds the maximum
|
|
1206
|
-
* allowed duration (default 5 min, configurable via STANDARDS_MIGRATION_MAX_DURATION_MS).
|
|
1207
|
-
* HTTP status: 500 (boot fail).
|
|
1208
|
-
*/
|
|
1209
|
-
declare class MigrationTimeoutError extends SchemaError {
|
|
1210
|
-
readonly objectName: string;
|
|
1211
|
-
readonly migrated: number;
|
|
1212
|
-
readonly total: number;
|
|
1213
|
-
readonly maxDurationMs: number;
|
|
1214
|
-
constructor(objectName: string, migrated: number, total: number, maxDurationMs: number);
|
|
1215
|
-
}
|
|
1216
|
-
/**
|
|
1217
|
-
* Thrown when the runtime admin API is called to change an attribute's type.
|
|
1218
|
-
* Type changes must be declared in code via `.migration(N, m => m.changeType(...))`.
|
|
1219
|
-
* HTTP status: 400 Bad Request.
|
|
1220
|
-
*/
|
|
1221
|
-
declare class ChangeTypeNotSupportedError extends SchemaError {
|
|
1222
|
-
readonly objectName: string;
|
|
1223
|
-
readonly attributeName: string;
|
|
1224
|
-
constructor(objectName: string, attributeName: string);
|
|
1225
|
-
}
|
|
1226
|
-
/**
|
|
1227
|
-
* Error thrown when attempting to create a duplicate resource.
|
|
1228
|
-
*
|
|
1229
|
-
* `resourceType` is free-form: pass `"object"`/`"attribute"` for schema
|
|
1230
|
-
* resources (a specific code is selected automatically), or any domain label
|
|
1231
|
-
* (`"tool"`, `"background job handler"`, …) for runtime registries, which fall
|
|
1232
|
-
* back to the generic `DUPLICATE` code. The default message is
|
|
1233
|
-
* `'<ResourceType> "<name>" already exists'`; pass a custom message when the
|
|
1234
|
-
* domain reads better with different wording (e.g. "already registered for
|
|
1235
|
-
* type X").
|
|
1236
|
-
*/
|
|
1237
|
-
declare class DuplicateError extends SchemaError {
|
|
1238
|
-
readonly resourceType: string;
|
|
1239
|
-
readonly resourceName: string;
|
|
1240
|
-
constructor(resourceType: string, resourceName: string, message?: string);
|
|
1241
|
-
}
|
|
1242
|
-
/**
|
|
1243
|
-
* A consumer tried to build, register, bundle or source an object under a name
|
|
1244
|
-
* the framework owns (`skill`, `memory`, `drives`, `artifact`, `meeting`).
|
|
1245
|
-
* Raised at declaration time so the collision fails in the consumer's own
|
|
1246
|
-
* tests, never at boot: the platform's `wealth-manager` bundle once shipped
|
|
1247
|
-
* `meeting` and hid the native calendar object from every tenant for three
|
|
1248
|
-
* days (#3450).
|
|
1249
|
-
*/
|
|
1250
|
-
declare const RESERVED_NAME_CONTEXTS: {
|
|
1251
|
-
readonly builder: "cannot be built by a consumer";
|
|
1252
|
-
readonly registry: "cannot be registered by a consumer";
|
|
1253
|
-
readonly bundle: "cannot be claimed by a bundle";
|
|
1254
|
-
readonly source: "cannot be declared by a schema source";
|
|
1255
|
-
};
|
|
1256
|
-
declare class ReservedObjectNameError extends SchemaError {
|
|
1257
|
-
readonly objectName: string;
|
|
1258
|
-
constructor(objectName: string, context: keyof typeof RESERVED_NAME_CONTEXTS);
|
|
1259
|
-
}
|
|
1260
|
-
/**
|
|
1261
|
-
* Check if an error is a SchemaError
|
|
1262
|
-
*/
|
|
1263
|
-
declare function isSchemaError(error: unknown): error is SchemaError;
|
|
1264
|
-
/**
|
|
1265
|
-
* Check if an error is a NotFoundError
|
|
1266
|
-
*/
|
|
1267
|
-
declare function isNotFoundError(error: unknown): error is NotFoundError;
|
|
1268
|
-
/**
|
|
1269
|
-
* Check if an error is a ValidationError
|
|
1270
|
-
*/
|
|
1271
|
-
declare function isValidationError(error: unknown): error is ValidationError;
|
|
1272
|
-
/**
|
|
1273
|
-
* Check if an error is a ProtectedResourceError
|
|
1274
|
-
*/
|
|
1275
|
-
declare function isProtectedResourceError(error: unknown): error is ProtectedResourceError;
|
|
1276
|
-
/**
|
|
1277
|
-
* Error thrown when a user lacks permission to perform an action.
|
|
1278
|
-
*
|
|
1279
|
-
* That, and nothing else (#2681) — its message is redacted, so it must not
|
|
1280
|
-
* carry a refusal a permission grant would not lift: use `WORKSPACE_INVARIANT`,
|
|
1281
|
-
* `STATE_GATE`, `ACTOR_CONTEXT_REQUIRED` or `SYSTEM_ENTITY_IMMUTABLE` instead.
|
|
1282
|
-
*/
|
|
1283
|
-
declare class ForbiddenError extends SchemaError {
|
|
1284
|
-
/** Literal discriminator for `Effect.catchTag`; a widened `string` breaks narrowing. */
|
|
1285
|
-
readonly _tag = "ForbiddenError";
|
|
1286
|
-
readonly objectName: string;
|
|
1287
|
-
readonly action: string;
|
|
1288
|
-
readonly userId?: string;
|
|
1289
|
-
constructor(objectName: string, action: string, userId?: string);
|
|
1290
|
-
}
|
|
1291
|
-
/**
|
|
1292
|
-
* Error thrown when trying to modify a protected role
|
|
1293
|
-
*/
|
|
1294
|
-
declare class ProtectedRoleError extends SchemaError {
|
|
1295
|
-
readonly roleName: string;
|
|
1296
|
-
readonly operation: "delete" | "modify";
|
|
1297
|
-
constructor(roleName: string, operation: "delete" | "modify");
|
|
1298
|
-
}
|
|
1299
|
-
/**
|
|
1300
|
-
* Role not found error
|
|
1301
|
-
*/
|
|
1302
|
-
declare class RoleNotFoundError extends NotFoundError {
|
|
1303
|
-
constructor(roleId: string);
|
|
1304
|
-
}
|
|
1305
|
-
/**
|
|
1306
|
-
* Thrown when a record has been modified by another request between read and write.
|
|
1307
|
-
* Clients should retry the operation with fresh data.
|
|
1308
|
-
* Maps to HTTP 409 Conflict.
|
|
1309
|
-
*/
|
|
1310
|
-
declare class ConcurrentModificationError extends SchemaError {
|
|
1311
|
-
constructor(recordId: string);
|
|
1312
|
-
}
|
|
1313
|
-
/**
|
|
1314
|
-
* Storage operation type for error context
|
|
1315
|
-
*/
|
|
1316
|
-
type StorageOperation = "upload" | "download" | "delete" | "signedUrl";
|
|
1317
|
-
/**
|
|
1318
|
-
* Error thrown when a storage operation fails
|
|
1319
|
-
*/
|
|
1320
|
-
declare class StorageError extends SchemaError {
|
|
1321
|
-
readonly operation: StorageOperation;
|
|
1322
|
-
readonly path?: string;
|
|
1323
|
-
readonly cause?: string;
|
|
1324
|
-
constructor(operation: StorageOperation, message: string, path?: string, cause?: string);
|
|
1325
|
-
}
|
|
1326
|
-
/**
|
|
1327
|
-
* Error thrown when access to a resource is denied (e.g., tenant path mismatch)
|
|
1328
|
-
*/
|
|
1329
|
-
declare class AccessDeniedError extends SchemaError {
|
|
1330
|
-
readonly resource: string;
|
|
1331
|
-
readonly reason?: string;
|
|
1332
|
-
constructor(resource: string, reason?: string);
|
|
1333
|
-
}
|
|
1334
|
-
/**
|
|
1335
|
-
* Repository operation type for error context
|
|
1336
|
-
*/
|
|
1337
|
-
type RepositoryOperation = "create" | "update" | "delete" | "query";
|
|
1338
|
-
/**
|
|
1339
|
-
* Error thrown when a repository operation fails
|
|
1340
|
-
*/
|
|
1341
|
-
declare class RepositoryError extends SchemaError {
|
|
1342
|
-
readonly operation: RepositoryOperation;
|
|
1343
|
-
readonly entity: string;
|
|
1344
|
-
readonly cause?: string;
|
|
1345
|
-
constructor(operation: RepositoryOperation, entity: string, message: string, cause?: string);
|
|
1346
|
-
}
|
|
1347
|
-
/**
|
|
1348
|
-
* Error thrown when a search read call fails at the transport level — e.g. the
|
|
1349
|
-
* Meili client received a non-JSON body (`JSON.parse` SyntaxError) or a network
|
|
1350
|
-
* failure. Translates an otherwise un-fingerprintable bare exception into a
|
|
1351
|
-
* typed error with a stable `code` and a user-safe message. The original
|
|
1352
|
-
* failure text is preserved in `cause`/`details`, never in the message.
|
|
1353
|
-
*/
|
|
1354
|
-
declare class SearchBackendError extends SchemaError {
|
|
1355
|
-
readonly scope: string;
|
|
1356
|
-
readonly cause?: string;
|
|
1357
|
-
constructor(scope: string, cause?: string);
|
|
1358
|
-
}
|
|
1359
|
-
/**
|
|
1360
|
-
* Error thrown when a feature or method is not yet implemented
|
|
1361
|
-
*/
|
|
1362
|
-
declare class NotImplementedError extends SchemaError {
|
|
1363
|
-
readonly feature: string;
|
|
1364
|
-
readonly milestone?: string;
|
|
1365
|
-
constructor(feature: string, milestone?: string);
|
|
1366
|
-
}
|
|
1367
|
-
/**
|
|
1368
|
-
* Memory entry not found error
|
|
1369
|
-
*/
|
|
1370
|
-
declare class MemoryNotFoundError extends NotFoundError {
|
|
1371
|
-
constructor(memoryId: string);
|
|
1372
|
-
}
|
|
1373
|
-
/**
|
|
1374
|
-
* Reference information for a record that is blocking deletion.
|
|
1375
|
-
*/
|
|
1376
|
-
interface RecordReference {
|
|
1377
|
-
/** Technical name of the object (e.g., "contacts") */
|
|
1378
|
-
objectName: string;
|
|
1379
|
-
/** Display label of the object (e.g., "Contacts") */
|
|
1380
|
-
objectLabel: string;
|
|
1381
|
-
/** Number of records referencing the target */
|
|
1382
|
-
count: number;
|
|
1383
|
-
}
|
|
1384
|
-
/**
|
|
1385
|
-
* Thrown when attempting to delete a record that is referenced by other records.
|
|
1386
|
-
*
|
|
1387
|
-
* This implements the "Restrict" behavior: deletion is blocked and the user
|
|
1388
|
-
* must first remove or update the referencing records.
|
|
1389
|
-
*/
|
|
1390
|
-
declare class RecordReferencedError extends SchemaError {
|
|
1391
|
-
readonly recordId: string;
|
|
1392
|
-
readonly references: RecordReference[];
|
|
1393
|
-
constructor(recordId: string, references: RecordReference[]);
|
|
1394
|
-
}
|
|
1395
|
-
/**
|
|
1396
|
-
* Usage context where an attribute is being used.
|
|
1397
|
-
*/
|
|
1398
|
-
type AttributeUsage = "labelExpression" | "embeddingExpression" | "view" | "filter";
|
|
1399
|
-
/**
|
|
1400
|
-
* Thrown when attempting to delete an attribute that is in use.
|
|
1401
|
-
*
|
|
1402
|
-
* Attributes cannot be deleted if they are referenced in:
|
|
1403
|
-
* - The object's labelExpression template
|
|
1404
|
-
* - A saved view's column configuration
|
|
1405
|
-
* - A saved filter condition
|
|
1406
|
-
*/
|
|
1407
|
-
declare class AttributeInUseError extends SchemaError {
|
|
1408
|
-
readonly attributeName: string;
|
|
1409
|
-
readonly usage: AttributeUsage;
|
|
1410
|
-
/** Where exactly, when the usage alone would not let the caller find it. */
|
|
1411
|
-
readonly location?: string;
|
|
1412
|
-
constructor(attributeName: string, usage: AttributeUsage, location?: string);
|
|
1413
|
-
}
|
|
1414
|
-
/**
|
|
1415
|
-
* Thrown when attempting to delete an object that is a relation target.
|
|
1416
|
-
*
|
|
1417
|
-
* Objects cannot be deleted if other objects have relation attributes
|
|
1418
|
-
* pointing to them as a target.
|
|
1419
|
-
*/
|
|
1420
|
-
declare class ObjectReferencedError extends SchemaError {
|
|
1421
|
-
readonly objectName: string;
|
|
1422
|
-
readonly referencingObjects: string[];
|
|
1423
|
-
constructor(objectName: string, referencingObjects: string[]);
|
|
1424
|
-
}
|
|
1425
|
-
/**
|
|
1426
|
-
* Supabase Realtime refused a publish because the channel was rate limited.
|
|
1427
|
-
*
|
|
1428
|
-
* Lives here rather than beside the publisher so the browser channel client and
|
|
1429
|
-
* the server publisher can share one error vocabulary without either package
|
|
1430
|
-
* depending on the other.
|
|
1431
|
-
*/
|
|
1432
|
-
declare class RealtimeRateLimitedError extends SchemaError {
|
|
1433
|
-
constructor();
|
|
1434
|
-
}
|
|
1435
|
-
/**
|
|
1436
|
-
* A Supabase Realtime publish did not reach the channel.
|
|
1437
|
-
*/
|
|
1438
|
-
declare class RealtimeDeliveryError extends SchemaError {
|
|
1439
|
-
constructor();
|
|
1440
|
-
}
|
|
1441
|
-
/**
|
|
1442
|
-
* A Supabase Realtime channel could not be subscribed to.
|
|
1443
|
-
*/
|
|
1444
|
-
declare class RealtimeSubscriptionError extends SchemaError {
|
|
1445
|
-
constructor();
|
|
1446
|
-
}
|
|
1447
|
-
/**
|
|
1448
|
-
* Check if an error is a RecordReferencedError
|
|
1449
|
-
*/
|
|
1450
|
-
declare function isRecordReferencedError(error: unknown): error is RecordReferencedError;
|
|
1451
|
-
/**
|
|
1452
|
-
* Check if an error is an AttributeInUseError
|
|
1453
|
-
*/
|
|
1454
|
-
declare function isAttributeInUseError(error: unknown): error is AttributeInUseError;
|
|
1455
|
-
/**
|
|
1456
|
-
* Check if an error is an ObjectReferencedError
|
|
1457
|
-
*/
|
|
1458
|
-
declare function isObjectReferencedError(error: unknown): error is ObjectReferencedError;
|
|
1459
|
-
//#endregion
|
|
1460
|
-
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 };
|