@revisium/schema-toolkit-ui 0.1.2 → 0.2.0
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/README.md +61 -12
- package/dist/index.cjs +3157 -5129
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +652 -1131
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +651 -1130
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3138 -5081
- package/dist/index.mjs.map +1 -1
- package/package.json +30 -15
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,607 @@
|
|
|
1
|
+
import * as _revisium_schema_toolkit0 from "@revisium/schema-toolkit";
|
|
2
|
+
import { JsonObjectSchema, JsonObjectSchema as JsonObjectSchema$1, JsonPatch, JsonPatch as JsonPatch$1, JsonSchemaTypeName, RefSchemas, SchemaModel, SchemaNode, SchemaPatch, SchemaValidationError, TableModel, TreeFormulaValidationError } from "@revisium/schema-toolkit";
|
|
1
3
|
import { BoxProps, IconButtonProps, Tooltip as Tooltip$1 } from "@chakra-ui/react";
|
|
2
4
|
import * as React$1 from "react";
|
|
3
|
-
import React, {
|
|
4
|
-
import { ASTNode } from "@revisium/formula";
|
|
5
|
+
import React, { FC, FocusEventHandler, FormEventHandler, KeyboardEventHandler, RefCallback } from "react";
|
|
5
6
|
|
|
7
|
+
//#region src/schema-editor/model/state/TreeState.d.ts
|
|
8
|
+
declare class TreeState {
|
|
9
|
+
private readonly _expandedNodes;
|
|
10
|
+
private readonly _focusedNodes;
|
|
11
|
+
private readonly _menuOpenNodes;
|
|
12
|
+
private readonly _settingsOpenNodes;
|
|
13
|
+
private readonly _dropNodes;
|
|
14
|
+
private readonly _disabledDropNodes;
|
|
15
|
+
private readonly _draggedOverNodes;
|
|
16
|
+
private readonly _focusRequestCounts;
|
|
17
|
+
private _activeNodeId;
|
|
18
|
+
constructor();
|
|
19
|
+
get activeNodeId(): string | null;
|
|
20
|
+
setActiveNodeId(nodeId: string | null): void;
|
|
21
|
+
isActive(nodeId: string): boolean;
|
|
22
|
+
getFocusRequestCount(nodeId: string): number;
|
|
23
|
+
requestFocus(nodeId: string): void;
|
|
24
|
+
isExpanded(nodeId: string): boolean;
|
|
25
|
+
setExpanded(nodeId: string, value: boolean): void;
|
|
26
|
+
toggleExpanded(nodeId: string): void;
|
|
27
|
+
isFocused(nodeId: string): boolean;
|
|
28
|
+
setFocused(nodeId: string, value: boolean): void;
|
|
29
|
+
isMenuOpen(nodeId: string): boolean;
|
|
30
|
+
setMenuOpen(nodeId: string, value: boolean): void;
|
|
31
|
+
isSettingsOpen(nodeId: string): boolean;
|
|
32
|
+
setSettingsOpen(nodeId: string, value: boolean): void;
|
|
33
|
+
isDrop(nodeId: string): boolean;
|
|
34
|
+
setDrop(nodeId: string, value: boolean): void;
|
|
35
|
+
isDisabledDrop(nodeId: string): boolean;
|
|
36
|
+
setDisabledDrop(nodeId: string, value: boolean): void;
|
|
37
|
+
isDraggedOver(nodeId: string): boolean;
|
|
38
|
+
setDraggedOver(nodeId: string, value: boolean): void;
|
|
39
|
+
clearNode(nodeId: string): void;
|
|
40
|
+
collapseAll(nodeIds: string[], keepRootExpanded: boolean): void;
|
|
41
|
+
expandAll(nodeIds: string[]): void;
|
|
42
|
+
reset(): void;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/schema-editor/model/accessor/NodeState.d.ts
|
|
46
|
+
declare class NodeState {
|
|
47
|
+
private readonly _nodeId;
|
|
48
|
+
private readonly _treeState;
|
|
49
|
+
constructor(_nodeId: string, _treeState: TreeState);
|
|
50
|
+
get isExpanded(): boolean;
|
|
51
|
+
toggleExpanded(): void;
|
|
52
|
+
get isFocused(): boolean;
|
|
53
|
+
setFocused(value: boolean): void;
|
|
54
|
+
get isMenuOpen(): boolean;
|
|
55
|
+
setMenuOpen(value: boolean): void;
|
|
56
|
+
get isSettingsOpen(): boolean;
|
|
57
|
+
setSettingsOpen(value: boolean): void;
|
|
58
|
+
get isDrop(): boolean;
|
|
59
|
+
setDrop(value: boolean): void;
|
|
60
|
+
get isDisabledDrop(): boolean;
|
|
61
|
+
setDisabledDrop(value: boolean): void;
|
|
62
|
+
get isDraggedOver(): boolean;
|
|
63
|
+
setDraggedOver(value: boolean): void;
|
|
64
|
+
get isActive(): boolean;
|
|
65
|
+
activate(): void;
|
|
66
|
+
get focusRequestCount(): number;
|
|
67
|
+
requestFocus(): void;
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/schema-editor/model/accessor/NodeLabel.d.ts
|
|
71
|
+
declare class NodeLabel {
|
|
72
|
+
private readonly _node;
|
|
73
|
+
private readonly _getTableId;
|
|
74
|
+
private readonly _isRoot;
|
|
75
|
+
constructor(_node: SchemaNode, _getTableId: () => string, _isRoot: boolean);
|
|
76
|
+
get name(): string;
|
|
77
|
+
get nodeType(): string;
|
|
78
|
+
get typeLabel(): string;
|
|
79
|
+
get description(): string | undefined;
|
|
80
|
+
get isDeprecated(): boolean;
|
|
81
|
+
get foreignKeyTable(): string | undefined;
|
|
82
|
+
get isForeignKey(): boolean;
|
|
83
|
+
private getRefLabel;
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/schema-editor/model/accessor/NodeFormula.d.ts
|
|
87
|
+
declare class NodeFormula {
|
|
88
|
+
private readonly _node;
|
|
89
|
+
private readonly _schemaModel;
|
|
90
|
+
private _inputValue;
|
|
91
|
+
private _inputError;
|
|
92
|
+
constructor(_node: SchemaNode, _schemaModel: SchemaModel);
|
|
93
|
+
get hasFormula(): boolean;
|
|
94
|
+
get plainSchema(): JsonObjectSchema$1;
|
|
95
|
+
get rawExpression(): string;
|
|
96
|
+
get formula(): string;
|
|
97
|
+
get inputValue(): string | null;
|
|
98
|
+
get inputError(): string | null;
|
|
99
|
+
get schemaError(): string | undefined;
|
|
100
|
+
get hasError(): boolean;
|
|
101
|
+
get errorMessage(): string | undefined;
|
|
102
|
+
setInputValue(value: string): void;
|
|
103
|
+
clearInput(): void;
|
|
104
|
+
private hasFormulaErrorForNode;
|
|
105
|
+
applyFormula(): boolean;
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/schema-editor/model/accessor/NodeValidation.d.ts
|
|
109
|
+
declare class NodeValidation {
|
|
110
|
+
private readonly _node;
|
|
111
|
+
private readonly _schemaModel;
|
|
112
|
+
private readonly _formula;
|
|
113
|
+
private readonly _getTableIdError;
|
|
114
|
+
private readonly _isRoot;
|
|
115
|
+
constructor(_node: SchemaNode, _schemaModel: SchemaModel, _formula: NodeFormula, _getTableIdError: () => string | null, _isRoot: boolean);
|
|
116
|
+
get schemaError(): string | undefined;
|
|
117
|
+
get tableIdError(): string | null;
|
|
118
|
+
get formulaError(): string | undefined;
|
|
119
|
+
get hasError(): boolean;
|
|
120
|
+
get errorMessage(): string | undefined;
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/schema-editor/model/accessor/NodeActions.d.ts
|
|
124
|
+
interface NodeActionsCallbacks {
|
|
125
|
+
renameTable: (name: string) => void;
|
|
126
|
+
onNodeRemoved: (nodeId: string) => void;
|
|
127
|
+
onNodeAdded: (nodeId: string) => void;
|
|
128
|
+
onNodeReplaced: (oldNodeId: string, newNodeId: string) => void;
|
|
129
|
+
selectForeignKey: () => Promise<string | null>;
|
|
130
|
+
}
|
|
131
|
+
declare class NodeActions {
|
|
132
|
+
private readonly _node;
|
|
133
|
+
private readonly _schemaModel;
|
|
134
|
+
private readonly _callbacks;
|
|
135
|
+
private readonly _isRoot;
|
|
136
|
+
private readonly _isReadonly;
|
|
137
|
+
constructor(_node: SchemaNode, _schemaModel: SchemaModel, _callbacks: NodeActionsCallbacks, _isRoot: boolean, _isReadonly: boolean);
|
|
138
|
+
get canRemove(): boolean;
|
|
139
|
+
get canAddProperty(): boolean;
|
|
140
|
+
rename(newName: string): void;
|
|
141
|
+
changeType(typeId: string): void;
|
|
142
|
+
private changeToForeignKey;
|
|
143
|
+
private changeToMarkdown;
|
|
144
|
+
remove(): void;
|
|
145
|
+
addProperty(name?: string): SchemaNode | null;
|
|
146
|
+
insertFieldAt(index: number, name: string): SchemaNode | null;
|
|
147
|
+
setDescription(description: string | undefined): void;
|
|
148
|
+
setDeprecated(deprecated: boolean): void;
|
|
149
|
+
setDefaultValue(value: unknown): void;
|
|
150
|
+
setForeignKey(tableId: string | undefined): void;
|
|
151
|
+
changeItemsType(typeId: string): void;
|
|
152
|
+
private changeItemsToForeignKey;
|
|
153
|
+
private changeItemsToMarkdown;
|
|
154
|
+
selectForeignKey(): Promise<void>;
|
|
155
|
+
private typeIdToRefUri;
|
|
156
|
+
}
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/schema-editor/model/accessor/NodeAccessor.d.ts
|
|
159
|
+
interface NodeAccessorDependencies {
|
|
160
|
+
state: NodeState;
|
|
161
|
+
label: NodeLabel;
|
|
162
|
+
formula: NodeFormula;
|
|
163
|
+
validation: NodeValidation;
|
|
164
|
+
actions: NodeActions;
|
|
165
|
+
}
|
|
166
|
+
declare class NodeAccessor {
|
|
167
|
+
private readonly _node;
|
|
168
|
+
private readonly _isRoot;
|
|
169
|
+
private readonly _isReadonly;
|
|
170
|
+
readonly state: NodeState;
|
|
171
|
+
readonly label: NodeLabel;
|
|
172
|
+
readonly formula: NodeFormula;
|
|
173
|
+
readonly validation: NodeValidation;
|
|
174
|
+
readonly actions: NodeActions;
|
|
175
|
+
constructor(_node: SchemaNode, deps: NodeAccessorDependencies, _isRoot?: boolean, _isReadonly?: boolean);
|
|
176
|
+
get nodeId(): string;
|
|
177
|
+
get isRoot(): boolean;
|
|
178
|
+
get isReadonly(): boolean;
|
|
179
|
+
get isObject(): boolean;
|
|
180
|
+
get isArray(): boolean;
|
|
181
|
+
get isPrimitive(): boolean;
|
|
182
|
+
get isRef(): boolean;
|
|
183
|
+
get ref(): string | undefined;
|
|
184
|
+
get isForeignKey(): boolean;
|
|
185
|
+
get defaultValue(): unknown;
|
|
186
|
+
get defaultValueAsString(): string;
|
|
187
|
+
get hoverTargetClass(): string;
|
|
188
|
+
get shouldApplyFieldStyles(): boolean;
|
|
189
|
+
get showMenu(): boolean;
|
|
190
|
+
handleFieldBlur(): void;
|
|
191
|
+
}
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/schema-editor/model/accessor/NodeAccessorFactory.d.ts
|
|
194
|
+
interface NodeAccessorContext {
|
|
195
|
+
schemaModel: SchemaModel;
|
|
196
|
+
treeState: TreeState;
|
|
197
|
+
getTableId: () => string;
|
|
198
|
+
getTableIdError: () => string | null;
|
|
199
|
+
callbacks: NodeActionsCallbacks;
|
|
200
|
+
}
|
|
201
|
+
declare class NodeAccessorFactory {
|
|
202
|
+
create(node: SchemaNode, context: NodeAccessorContext, isRoot?: boolean, isReadonly?: boolean): NodeAccessor;
|
|
203
|
+
}
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region src/schema-editor/model/core/AccessorCache.d.ts
|
|
206
|
+
declare class AccessorCache {
|
|
207
|
+
private readonly _getSchemaModel;
|
|
208
|
+
private readonly _getContext;
|
|
209
|
+
private readonly _accessorFactory;
|
|
210
|
+
private readonly _cache;
|
|
211
|
+
constructor(_getSchemaModel: () => SchemaModel, _getContext: () => NodeAccessorContext, _accessorFactory: NodeAccessorFactory);
|
|
212
|
+
get(nodeId: string, isRoot?: boolean, isReadonly?: boolean): NodeAccessor;
|
|
213
|
+
getChildren(parentNodeId: string, parentIsReadonly?: boolean): NodeAccessor[];
|
|
214
|
+
delete(nodeId: string): void;
|
|
215
|
+
clear(): void;
|
|
216
|
+
entries(): IterableIterator<[string, NodeAccessor]>;
|
|
217
|
+
}
|
|
218
|
+
//#endregion
|
|
219
|
+
//#region src/schema-editor/model/core/ValidationTracker.d.ts
|
|
220
|
+
declare class ValidationTracker {
|
|
221
|
+
private readonly _tableModel;
|
|
222
|
+
private readonly _accessorCache;
|
|
223
|
+
private readonly _getTableIdError;
|
|
224
|
+
constructor(_tableModel: TableModel, _accessorCache: AccessorCache, _getTableIdError: () => string | null);
|
|
225
|
+
get validationErrors(): readonly SchemaValidationError[];
|
|
226
|
+
get formulaErrors(): TreeFormulaValidationError[];
|
|
227
|
+
get tableIdError(): string | null;
|
|
228
|
+
get hasErrors(): boolean;
|
|
229
|
+
get errorsCount(): number;
|
|
230
|
+
collectFormulaInputErrors(): TreeFormulaValidationError[];
|
|
231
|
+
}
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region src/schema-editor/model/core/ViewState.d.ts
|
|
234
|
+
type ViewMode = 'Tree' | 'Json' | 'RefBy';
|
|
235
|
+
declare class ViewState {
|
|
236
|
+
private _viewMode;
|
|
237
|
+
private _loading;
|
|
238
|
+
constructor();
|
|
239
|
+
get viewMode(): ViewMode;
|
|
240
|
+
setViewMode(mode: ViewMode): void;
|
|
241
|
+
get loading(): boolean;
|
|
242
|
+
setLoading(value: boolean): void;
|
|
243
|
+
}
|
|
244
|
+
//#endregion
|
|
245
|
+
//#region src/schema-editor/model/core/CollapseManager.d.ts
|
|
246
|
+
declare class CollapseManager {
|
|
247
|
+
private readonly _treeState;
|
|
248
|
+
private readonly _getSchemaModel;
|
|
249
|
+
constructor(_treeState: TreeState, _getSchemaModel: () => SchemaModel);
|
|
250
|
+
collapseAll(): void;
|
|
251
|
+
expandAll(): void;
|
|
252
|
+
collapseIfComplex(threshold: number): void;
|
|
253
|
+
collapseRefNodes(): void;
|
|
254
|
+
private collectRefNodeIds;
|
|
255
|
+
private collectAllNodeIds;
|
|
256
|
+
}
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/schema-editor/model/utils/TreeNavigator.d.ts
|
|
259
|
+
declare class TreeNavigator {
|
|
260
|
+
private readonly _getSchemaModel;
|
|
261
|
+
private readonly _treeState;
|
|
262
|
+
constructor(_getSchemaModel: () => SchemaModel, _treeState: TreeState);
|
|
263
|
+
visibleNodeIds(): string[];
|
|
264
|
+
findParentId(nodeId: string): string | null;
|
|
265
|
+
isRootId(nodeId: string): boolean;
|
|
266
|
+
getNode(nodeId: string): SchemaNode;
|
|
267
|
+
nodeHasChildren(node: SchemaNode): boolean;
|
|
268
|
+
getFirstChildId(node: SchemaNode): string | null;
|
|
269
|
+
private collectVisibleNodes;
|
|
270
|
+
private findParentInTree;
|
|
271
|
+
private findParentInObject;
|
|
272
|
+
private findParentInArray;
|
|
273
|
+
}
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region src/schema-editor/model/core/KeyboardNavigation.d.ts
|
|
276
|
+
type KeyboardMode = 'TREE_NAV' | 'EDIT_NAME';
|
|
277
|
+
interface KeyboardEvent {
|
|
278
|
+
key: string;
|
|
279
|
+
shiftKey: boolean;
|
|
280
|
+
preventDefault: () => void;
|
|
281
|
+
}
|
|
282
|
+
declare class KeyboardNavigation {
|
|
283
|
+
private readonly _treeState;
|
|
284
|
+
private readonly _navigator;
|
|
285
|
+
private readonly _accessors;
|
|
286
|
+
private _mode;
|
|
287
|
+
private _skipNextEscape;
|
|
288
|
+
private _containerRef;
|
|
289
|
+
private readonly _disposers;
|
|
290
|
+
constructor(_treeState: TreeState, _navigator: TreeNavigator, _accessors: AccessorCache);
|
|
291
|
+
get mode(): KeyboardMode;
|
|
292
|
+
get visibleNodeIds(): string[];
|
|
293
|
+
handleKeyDown(event: KeyboardEvent): void;
|
|
294
|
+
setContainerRef(el: HTMLElement | null): void;
|
|
295
|
+
returnFocus(): void;
|
|
296
|
+
deactivate(): void;
|
|
297
|
+
private readonly handleNativeMouseDown;
|
|
298
|
+
handleEditEnter(): void;
|
|
299
|
+
handleNodeAdded(nodeId: string): void;
|
|
300
|
+
handleNodeReplaced(oldId: string, newId: string): void;
|
|
301
|
+
private deferReturnFocus;
|
|
302
|
+
dispose(): void;
|
|
303
|
+
private moveToNext;
|
|
304
|
+
private moveToPrev;
|
|
305
|
+
private expandOrMoveToChild;
|
|
306
|
+
private collapseOrMoveToParent;
|
|
307
|
+
private toggleExpand;
|
|
308
|
+
private insertField;
|
|
309
|
+
private enterEditMode;
|
|
310
|
+
private deactivateOrRemoveEmpty;
|
|
311
|
+
private removeNode;
|
|
312
|
+
private scrollToNode;
|
|
313
|
+
}
|
|
314
|
+
//#endregion
|
|
315
|
+
//#region src/schema-editor/model/core/SchemaEditorCore.d.ts
|
|
316
|
+
type ForeignKeySelectionCallback = () => Promise<string | null>;
|
|
317
|
+
interface SchemaEditorCoreOptions {
|
|
318
|
+
tableId?: string;
|
|
319
|
+
refSchemas?: RefSchemas;
|
|
320
|
+
collapseComplexSchemas?: boolean;
|
|
321
|
+
collapseComplexity?: number;
|
|
322
|
+
onCancel?: () => void;
|
|
323
|
+
onSelectForeignKey?: ForeignKeySelectionCallback;
|
|
324
|
+
}
|
|
325
|
+
declare class SchemaEditorCore {
|
|
326
|
+
private readonly _tableModel;
|
|
327
|
+
private readonly _treeState;
|
|
328
|
+
private readonly _onCancel;
|
|
329
|
+
private readonly _onSelectForeignKey;
|
|
330
|
+
readonly accessors: AccessorCache;
|
|
331
|
+
readonly validation: ValidationTracker;
|
|
332
|
+
readonly view: ViewState;
|
|
333
|
+
readonly collapse: CollapseManager;
|
|
334
|
+
readonly keyboard: KeyboardNavigation;
|
|
335
|
+
constructor(jsonSchema: JsonObjectSchema$1, options?: SchemaEditorCoreOptions, accessorFactory?: NodeAccessorFactory);
|
|
336
|
+
get tableModel(): TableModel;
|
|
337
|
+
get schemaModel(): SchemaModel;
|
|
338
|
+
get treeState(): TreeState;
|
|
339
|
+
get tableId(): string;
|
|
340
|
+
get initialTableId(): string;
|
|
341
|
+
get isTableIdChanged(): boolean;
|
|
342
|
+
get tableIdError(): string | null;
|
|
343
|
+
setTableId(value: string): void;
|
|
344
|
+
get rootAccessor(): NodeAccessor;
|
|
345
|
+
get isDirty(): boolean;
|
|
346
|
+
get isValid(): boolean;
|
|
347
|
+
get patchesCount(): number;
|
|
348
|
+
get totalChangesCount(): number;
|
|
349
|
+
markAsSaved(): void;
|
|
350
|
+
changeRootType(typeId: string): void;
|
|
351
|
+
selectForeignKey(): Promise<string | null>;
|
|
352
|
+
cancel(): void;
|
|
353
|
+
getPatches(): SchemaPatch[];
|
|
354
|
+
getJsonPatches(): JsonPatch$1[];
|
|
355
|
+
getPlainSchema(): JsonObjectSchema$1;
|
|
356
|
+
moveNode(fromNodeId: string, toParentId: string): void;
|
|
357
|
+
revert(): void;
|
|
358
|
+
dispose(): void;
|
|
359
|
+
private handleNodeRemoved;
|
|
360
|
+
private handleNodeAdded;
|
|
361
|
+
private handleNodeReplaced;
|
|
362
|
+
private collapseIfRefNode;
|
|
363
|
+
}
|
|
364
|
+
//#endregion
|
|
365
|
+
//#region src/schema-editor/model/vm/SchemaTreeVM.d.ts
|
|
366
|
+
declare class SchemaTreeVM {
|
|
367
|
+
private readonly _core;
|
|
368
|
+
constructor(_core: SchemaEditorCore);
|
|
369
|
+
get rootAccessor(): NodeAccessor;
|
|
370
|
+
get schemaModel(): SchemaModel;
|
|
371
|
+
getChildAccessors(nodeId: string, parentIsReadonly?: boolean): NodeAccessor[];
|
|
372
|
+
changeRootType(typeId: string): void;
|
|
373
|
+
changeNodeType(accessor: NodeAccessor, typeId: string): void;
|
|
374
|
+
moveNode(fromNodeId: string, toParentId: string): void;
|
|
375
|
+
selectForeignKey(): Promise<string | null>;
|
|
376
|
+
get keyboard(): KeyboardNavigation;
|
|
377
|
+
}
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region src/schema-editor/model/dialog/CreateTableDialogVM.d.ts
|
|
380
|
+
type CreateTableViewMode = 'Example' | 'Schema';
|
|
381
|
+
declare class CreateTableDialogVM {
|
|
382
|
+
private readonly _tableModel;
|
|
383
|
+
private readonly _onApprove;
|
|
384
|
+
private readonly _onClose;
|
|
385
|
+
private _viewMode;
|
|
386
|
+
private _loading;
|
|
387
|
+
constructor(_tableModel: TableModel, _onApprove: () => Promise<void>, _onClose: () => void);
|
|
388
|
+
get tableId(): string;
|
|
389
|
+
get viewMode(): CreateTableViewMode;
|
|
390
|
+
setViewMode(mode: CreateTableViewMode): void;
|
|
391
|
+
get loading(): boolean;
|
|
392
|
+
get plainSchema(): JsonObjectSchema$1;
|
|
393
|
+
get exampleData(): unknown;
|
|
394
|
+
approve(): Promise<void>;
|
|
395
|
+
close(): void;
|
|
396
|
+
}
|
|
397
|
+
//#endregion
|
|
398
|
+
//#region src/schema-editor/model/dialog/ReviewErrorsDialogVM.d.ts
|
|
399
|
+
declare class ReviewErrorsDialogVM {
|
|
400
|
+
private readonly _tableModel;
|
|
401
|
+
private readonly _getTableIdError;
|
|
402
|
+
private readonly _getFormulaInputErrors;
|
|
403
|
+
private readonly _onRevert?;
|
|
404
|
+
private readonly _onClose?;
|
|
405
|
+
constructor(_tableModel: TableModel, _getTableIdError: () => string | null, _getFormulaInputErrors: () => TreeFormulaValidationError[], _onRevert?: (() => void) | undefined, _onClose?: (() => void) | undefined);
|
|
406
|
+
get canRevert(): boolean;
|
|
407
|
+
revert(): void;
|
|
408
|
+
get tableId(): string;
|
|
409
|
+
get tableIdError(): string | null;
|
|
410
|
+
get validationErrors(): readonly SchemaValidationError[];
|
|
411
|
+
get formulaErrors(): TreeFormulaValidationError[];
|
|
412
|
+
get hasErrors(): boolean;
|
|
413
|
+
get errorsCount(): number;
|
|
414
|
+
}
|
|
415
|
+
//#endregion
|
|
416
|
+
//#region src/schema-editor/model/vm/CreatingEditorVM.d.ts
|
|
417
|
+
type CreateDialogViewMode = 'Example' | 'Schema';
|
|
418
|
+
interface CreatingEditorVMOptions extends SchemaEditorCoreOptions {
|
|
419
|
+
onApprove?: () => Promise<boolean>;
|
|
420
|
+
}
|
|
421
|
+
declare class CreatingEditorVM {
|
|
422
|
+
private readonly _core;
|
|
423
|
+
private readonly _onApprove;
|
|
424
|
+
readonly tree: SchemaTreeVM;
|
|
425
|
+
private _isErrorsDialogOpen;
|
|
426
|
+
private _isCreateDialogOpen;
|
|
427
|
+
private _createDialogViewMode;
|
|
428
|
+
constructor(coreOrSchema: SchemaEditorCore | JsonObjectSchema$1, options?: CreatingEditorVMOptions);
|
|
429
|
+
get mode(): 'creating';
|
|
430
|
+
get tableId(): string;
|
|
431
|
+
get initialTableId(): string;
|
|
432
|
+
get isTableIdChanged(): boolean;
|
|
433
|
+
get tableIdError(): string | null;
|
|
434
|
+
setTableId(value: string): void;
|
|
435
|
+
get isDirty(): boolean;
|
|
436
|
+
get isValid(): boolean;
|
|
437
|
+
markAsSaved(): void;
|
|
438
|
+
get loading(): boolean;
|
|
439
|
+
get viewMode(): ViewMode;
|
|
440
|
+
setViewMode(mode: ViewMode): void;
|
|
441
|
+
cancel(): void;
|
|
442
|
+
collapseAll(): void;
|
|
443
|
+
expandAll(): void;
|
|
444
|
+
get showReviewErrorsButton(): boolean;
|
|
445
|
+
get errorsCount(): number;
|
|
446
|
+
get isErrorsDialogOpen(): boolean;
|
|
447
|
+
openErrorsDialog(): void;
|
|
448
|
+
closeErrorsDialog(): void;
|
|
449
|
+
get errorsDialogVM(): ReviewErrorsDialogVM;
|
|
450
|
+
get showCreateTableButton(): boolean;
|
|
451
|
+
get isCreateDialogOpen(): boolean;
|
|
452
|
+
openCreateDialog(): void;
|
|
453
|
+
closeCreateDialog(): void;
|
|
454
|
+
get createDialogViewMode(): CreateDialogViewMode;
|
|
455
|
+
setCreateDialogViewMode(mode: CreateDialogViewMode): void;
|
|
456
|
+
get createDialogVM(): CreateTableDialogVM;
|
|
457
|
+
approve(): Promise<void>;
|
|
458
|
+
getPlainSchema(): JsonObjectSchema$1;
|
|
459
|
+
dispose(): void;
|
|
460
|
+
}
|
|
461
|
+
//#endregion
|
|
462
|
+
//#region src/schema-editor/model/dialog/ReviewChangesDialogVM.d.ts
|
|
463
|
+
type ReviewChangesViewMode = 'Changes' | 'Patches';
|
|
464
|
+
interface TableIdChangeInfo {
|
|
465
|
+
initialTableId: string;
|
|
466
|
+
currentTableId: string;
|
|
467
|
+
}
|
|
468
|
+
declare class ReviewChangesDialogVM {
|
|
469
|
+
private readonly _tableModel;
|
|
470
|
+
private readonly _onApprove;
|
|
471
|
+
private readonly _onRevert;
|
|
472
|
+
private readonly _onClose;
|
|
473
|
+
private _viewMode;
|
|
474
|
+
private _loading;
|
|
475
|
+
constructor(_tableModel: TableModel, _onApprove: () => Promise<void>, _onRevert: () => void, _onClose: () => void);
|
|
476
|
+
get tableId(): string;
|
|
477
|
+
get initialTableId(): string;
|
|
478
|
+
get isTableIdChanged(): boolean;
|
|
479
|
+
get tableIdChange(): TableIdChangeInfo | null;
|
|
480
|
+
get patches(): SchemaPatch[];
|
|
481
|
+
get jsonPatches(): JsonPatch$1[];
|
|
482
|
+
get patchesCount(): number;
|
|
483
|
+
get totalChangesCount(): number;
|
|
484
|
+
get hasChanges(): boolean;
|
|
485
|
+
get viewMode(): ReviewChangesViewMode;
|
|
486
|
+
setViewMode(mode: ReviewChangesViewMode): void;
|
|
487
|
+
get loading(): boolean;
|
|
488
|
+
approve(): Promise<void>;
|
|
489
|
+
revert(): void;
|
|
490
|
+
close(): void;
|
|
491
|
+
}
|
|
492
|
+
//#endregion
|
|
493
|
+
//#region src/schema-editor/model/vm/UpdatingEditorVM.d.ts
|
|
494
|
+
type UpdateDialogViewMode = 'Changes' | 'Patches';
|
|
495
|
+
interface UpdatingEditorVMOptions extends SchemaEditorCoreOptions {
|
|
496
|
+
onApprove?: () => Promise<boolean>;
|
|
497
|
+
}
|
|
498
|
+
declare class UpdatingEditorVM {
|
|
499
|
+
private readonly _core;
|
|
500
|
+
private readonly _onApprove;
|
|
501
|
+
readonly tree: SchemaTreeVM;
|
|
502
|
+
private _isErrorsDialogOpen;
|
|
503
|
+
private _isChangesDialogOpen;
|
|
504
|
+
private _updateDialogViewMode;
|
|
505
|
+
constructor(coreOrSchema: SchemaEditorCore | JsonObjectSchema$1, options?: UpdatingEditorVMOptions);
|
|
506
|
+
get mode(): 'updating';
|
|
507
|
+
get tableId(): string;
|
|
508
|
+
get initialTableId(): string;
|
|
509
|
+
get isTableIdChanged(): boolean;
|
|
510
|
+
get tableIdError(): string | null;
|
|
511
|
+
setTableId(value: string): void;
|
|
512
|
+
get isDirty(): boolean;
|
|
513
|
+
get isValid(): boolean;
|
|
514
|
+
markAsSaved(): void;
|
|
515
|
+
get loading(): boolean;
|
|
516
|
+
get viewMode(): ViewMode;
|
|
517
|
+
setViewMode(mode: ViewMode): void;
|
|
518
|
+
cancel(): void;
|
|
519
|
+
collapseAll(): void;
|
|
520
|
+
expandAll(): void;
|
|
521
|
+
get showReviewErrorsButton(): boolean;
|
|
522
|
+
get errorsCount(): number;
|
|
523
|
+
get isErrorsDialogOpen(): boolean;
|
|
524
|
+
openErrorsDialog(): void;
|
|
525
|
+
closeErrorsDialog(): void;
|
|
526
|
+
get errorsDialogVM(): ReviewErrorsDialogVM;
|
|
527
|
+
get showApplyChangesButton(): boolean;
|
|
528
|
+
get totalChangesCount(): number;
|
|
529
|
+
get isChangesDialogOpen(): boolean;
|
|
530
|
+
openChangesDialog(): void;
|
|
531
|
+
closeChangesDialog(): void;
|
|
532
|
+
get updateDialogViewMode(): UpdateDialogViewMode;
|
|
533
|
+
setUpdateDialogViewMode(mode: UpdateDialogViewMode): void;
|
|
534
|
+
get changesDialogVM(): ReviewChangesDialogVM;
|
|
535
|
+
revert(): void;
|
|
536
|
+
approve(): Promise<void>;
|
|
537
|
+
getPlainSchema(): JsonObjectSchema$1;
|
|
538
|
+
getPatches(): _revisium_schema_toolkit0.SchemaPatch[];
|
|
539
|
+
getJsonPatches(): _revisium_schema_toolkit0.JsonPatch[];
|
|
540
|
+
dispose(): void;
|
|
541
|
+
}
|
|
542
|
+
//#endregion
|
|
543
|
+
//#region src/schema-editor/ui/CreatingSchemaEditor/CreatingSchemaEditor.d.ts
|
|
544
|
+
interface CreatingSchemaEditorProps {
|
|
545
|
+
vm: CreatingEditorVM;
|
|
546
|
+
}
|
|
547
|
+
declare const CreatingSchemaEditor: FC<CreatingSchemaEditorProps>;
|
|
548
|
+
//#endregion
|
|
549
|
+
//#region src/schema-editor/ui/UpdatingSchemaEditor/UpdatingSchemaEditor.d.ts
|
|
550
|
+
interface UpdatingSchemaEditorProps {
|
|
551
|
+
vm: UpdatingEditorVM;
|
|
552
|
+
}
|
|
553
|
+
declare const UpdatingSchemaEditor: FC<UpdatingSchemaEditorProps>;
|
|
554
|
+
//#endregion
|
|
555
|
+
//#region src/schema-editor/config/schema-type-ids.d.ts
|
|
556
|
+
declare const getLabelByRef: (ref: string) => string;
|
|
557
|
+
declare enum SchemaTypeIds {
|
|
558
|
+
String = "String",
|
|
559
|
+
Number = "Number",
|
|
560
|
+
Boolean = "Boolean",
|
|
561
|
+
Object = "Object",
|
|
562
|
+
Array = "Array",
|
|
563
|
+
ForeignKeyString = "ForeignKeyString",
|
|
564
|
+
File = "File",
|
|
565
|
+
RowId = "RowId",
|
|
566
|
+
RowVersionId = "RowVersionId",
|
|
567
|
+
RowCreatedId = "RowCreatedId",
|
|
568
|
+
RowCreatedAt = "RowCreatedAt",
|
|
569
|
+
RowPublishedAt = "RowPublishedAt",
|
|
570
|
+
RowUpdatedAt = "RowUpdatedAt",
|
|
571
|
+
RowHash = "RowHash",
|
|
572
|
+
RowSchemaHash = "RowSchemaHash",
|
|
573
|
+
Markdown = "Markdown"
|
|
574
|
+
}
|
|
575
|
+
type BaseOption = {
|
|
576
|
+
id: string;
|
|
577
|
+
label: string;
|
|
578
|
+
type?: 'item' | 'submenu';
|
|
579
|
+
};
|
|
580
|
+
type MenuOptionItem = (BaseOption & {
|
|
581
|
+
type?: 'item';
|
|
582
|
+
addDividerAfter?: boolean;
|
|
583
|
+
}) | (BaseOption & {
|
|
584
|
+
type: 'submenu';
|
|
585
|
+
items: MenuOptionItem[];
|
|
586
|
+
});
|
|
587
|
+
type MenuGroup = {
|
|
588
|
+
id: string;
|
|
589
|
+
options: MenuOptionItem[];
|
|
590
|
+
addDividerAfter?: boolean;
|
|
591
|
+
};
|
|
592
|
+
declare const typeMenuGroups: MenuGroup[];
|
|
593
|
+
//#endregion
|
|
594
|
+
//#region src/schema-editor/types/index.d.ts
|
|
595
|
+
type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
596
|
+
[key: string]: JsonValue;
|
|
597
|
+
};
|
|
598
|
+
type NodeType = 'object' | 'array' | 'string' | 'number' | 'boolean' | 'ref' | 'foreignKey';
|
|
599
|
+
declare enum ViewerSwitcherMode {
|
|
600
|
+
Tree = "Tree",
|
|
601
|
+
Json = "Json",
|
|
602
|
+
RefBy = "RefBy"
|
|
603
|
+
}
|
|
604
|
+
//#endregion
|
|
6
605
|
//#region src/components/Tooltip/Tooltip.d.ts
|
|
7
606
|
interface TooltipProps extends Tooltip$1.RootProps {
|
|
8
607
|
showArrow?: boolean;
|
|
@@ -14,24 +613,42 @@ interface TooltipProps extends Tooltip$1.RootProps {
|
|
|
14
613
|
}
|
|
15
614
|
declare const Tooltip: React$1.ForwardRefExoticComponent<TooltipProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
16
615
|
//#endregion
|
|
17
|
-
//#region src/
|
|
18
|
-
interface
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
autoFocus?: boolean;
|
|
616
|
+
//#region src/hooks/useContentEditable.d.ts
|
|
617
|
+
interface UseContentEditableOptions {
|
|
618
|
+
value: string;
|
|
619
|
+
onChange?: (value: string) => void;
|
|
22
620
|
onBlur?: () => void;
|
|
23
621
|
onFocus?: () => void;
|
|
24
|
-
onChange?: (value: string) => void;
|
|
25
622
|
onEscape?: () => void;
|
|
26
623
|
onEnter?: () => void;
|
|
27
|
-
focusIfDependencyList?: DependencyList;
|
|
28
624
|
restrict?: RegExp;
|
|
625
|
+
autoFocus?: boolean;
|
|
626
|
+
focusTrigger?: number;
|
|
627
|
+
}
|
|
628
|
+
type UseContentEditableReturn = {
|
|
629
|
+
ref: RefCallback<HTMLElement>;
|
|
630
|
+
contentEditable: true;
|
|
631
|
+
spellCheck: false;
|
|
632
|
+
dangerouslySetInnerHTML: {
|
|
633
|
+
__html: string;
|
|
634
|
+
};
|
|
635
|
+
onInput: FormEventHandler<HTMLElement>;
|
|
636
|
+
onBlur: FormEventHandler<HTMLElement>;
|
|
637
|
+
onFocus: FocusEventHandler<HTMLElement>;
|
|
638
|
+
onKeyDown: KeyboardEventHandler<HTMLElement>;
|
|
639
|
+
};
|
|
640
|
+
declare function useContentEditable(options: UseContentEditableOptions): UseContentEditableReturn;
|
|
641
|
+
//#endregion
|
|
642
|
+
//#region src/components/ContentEditable/ContentEditable.d.ts
|
|
643
|
+
interface ContentEditableProps extends Pick<UseContentEditableOptions, 'onChange' | 'onBlur' | 'onFocus' | 'onEscape' | 'onEnter' | 'restrict' | 'autoFocus' | 'focusTrigger'> {
|
|
644
|
+
initValue: string;
|
|
645
|
+
placeholder?: string;
|
|
29
646
|
prefix?: string;
|
|
30
647
|
postfix?: string;
|
|
31
648
|
dataTestId?: string;
|
|
32
649
|
textDecoration?: BoxProps['textDecoration'];
|
|
33
650
|
}
|
|
34
|
-
declare const ContentEditable: React.FC<
|
|
651
|
+
declare const ContentEditable: React.FC<ContentEditableProps>;
|
|
35
652
|
//#endregion
|
|
36
653
|
//#region src/components/GrayButton/GrayButton.d.ts
|
|
37
654
|
interface GrayButtonProps {
|
|
@@ -99,59 +716,6 @@ interface JsonCardProps {
|
|
|
99
716
|
}
|
|
100
717
|
declare const JsonCard: React.FC<JsonCardProps>;
|
|
101
718
|
//#endregion
|
|
102
|
-
//#region src/schema-editor/types.d.ts
|
|
103
|
-
type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
104
|
-
[key: string]: JsonValue;
|
|
105
|
-
};
|
|
106
|
-
declare enum JsonSchemaTypeName {
|
|
107
|
-
String = "string",
|
|
108
|
-
Number = "number",
|
|
109
|
-
Boolean = "boolean",
|
|
110
|
-
Object = "object",
|
|
111
|
-
Array = "array"
|
|
112
|
-
}
|
|
113
|
-
type JsonPatch = {
|
|
114
|
-
op: 'add';
|
|
115
|
-
path: string;
|
|
116
|
-
value: JsonValue;
|
|
117
|
-
} | {
|
|
118
|
-
op: 'remove';
|
|
119
|
-
path: string;
|
|
120
|
-
} | {
|
|
121
|
-
op: 'replace';
|
|
122
|
-
path: string;
|
|
123
|
-
value: JsonValue;
|
|
124
|
-
} | {
|
|
125
|
-
op: 'move';
|
|
126
|
-
from: string;
|
|
127
|
-
path: string;
|
|
128
|
-
} | {
|
|
129
|
-
op: 'copy';
|
|
130
|
-
from: string;
|
|
131
|
-
path: string;
|
|
132
|
-
} | {
|
|
133
|
-
op: 'test';
|
|
134
|
-
path: string;
|
|
135
|
-
value: JsonValue;
|
|
136
|
-
};
|
|
137
|
-
declare enum ViewerSwitcherMode {
|
|
138
|
-
Tree = "Tree",
|
|
139
|
-
Json = "Json",
|
|
140
|
-
RefBy = "RefBy"
|
|
141
|
-
}
|
|
142
|
-
declare enum SystemSchemaIds {
|
|
143
|
-
RowId = "urn:jsonschema:io:revisium:row-id-schema:1.0.0",
|
|
144
|
-
RowCreatedId = "urn:jsonschema:io:revisium:row-created-id-schema:1.0.0",
|
|
145
|
-
RowVersionId = "urn:jsonschema:io:revisium:row-version-id-schema:1.0.0",
|
|
146
|
-
RowCreatedAt = "urn:jsonschema:io:revisium:row-created-at-schema:1.0.0",
|
|
147
|
-
RowPublishedAt = "urn:jsonschema:io:revisium:row-published-at-schema:1.0.0",
|
|
148
|
-
RowUpdatedAt = "urn:jsonschema:io:revisium:row-updated-at-schema:1.0.0",
|
|
149
|
-
RowHash = "urn:jsonschema:io:revisium:row-hash-schema:1.0.0",
|
|
150
|
-
RowSchemaHash = "urn:jsonschema:io:revisium:row-schema-hash-schema:1.0.0",
|
|
151
|
-
File = "urn:jsonschema:io:revisium:file-schema:1.0.0"
|
|
152
|
-
}
|
|
153
|
-
declare const getLabelByRef: (ref: string) => string;
|
|
154
|
-
//#endregion
|
|
155
719
|
//#region src/components/ViewerSwitcher/ViewerSwitcher.d.ts
|
|
156
720
|
interface ViewerSwitcherProps {
|
|
157
721
|
mode: ViewerSwitcherMode;
|
|
@@ -160,1051 +724,8 @@ interface ViewerSwitcherProps {
|
|
|
160
724
|
}
|
|
161
725
|
declare const ViewerSwitcher: React.FC<ViewerSwitcherProps>;
|
|
162
726
|
//#endregion
|
|
163
|
-
//#region src/schema-editor/model/node/NodeType.d.ts
|
|
164
|
-
declare enum NodeType {
|
|
165
|
-
Object = "object",
|
|
166
|
-
Array = "array",
|
|
167
|
-
String = "string",
|
|
168
|
-
Number = "number",
|
|
169
|
-
Boolean = "boolean",
|
|
170
|
-
Ref = "ref"
|
|
171
|
-
}
|
|
172
|
-
//#endregion
|
|
173
|
-
//#region src/schema-editor/model/node/NodeMetadata.d.ts
|
|
174
|
-
interface NodeMetadata {
|
|
175
|
-
title?: string;
|
|
176
|
-
description?: string;
|
|
177
|
-
deprecated?: boolean;
|
|
178
|
-
}
|
|
179
|
-
declare const EMPTY_METADATA: NodeMetadata;
|
|
180
|
-
//#endregion
|
|
181
|
-
//#region src/schema-editor/model/formula/core/FormulaDependency.d.ts
|
|
182
|
-
interface FormulaDependency {
|
|
183
|
-
targetNodeId(): string;
|
|
184
|
-
}
|
|
185
|
-
declare class ResolvedDependency implements FormulaDependency {
|
|
186
|
-
private readonly nodeId;
|
|
187
|
-
constructor(nodeId: string);
|
|
188
|
-
targetNodeId(): string;
|
|
189
|
-
}
|
|
190
|
-
//#endregion
|
|
191
|
-
//#region src/schema-editor/model/formula/core/Formula.d.ts
|
|
192
|
-
interface Formula {
|
|
193
|
-
version(): number;
|
|
194
|
-
ast(): ASTNode;
|
|
195
|
-
dependencies(): readonly FormulaDependency[];
|
|
196
|
-
getNodeIdForAstPath(astPath: string): string | null;
|
|
197
|
-
astPaths(): readonly string[];
|
|
198
|
-
}
|
|
199
|
-
//#endregion
|
|
200
|
-
//#region src/schema-editor/model/formula/core/FormulaError.d.ts
|
|
201
|
-
declare class FormulaError extends Error {
|
|
202
|
-
private readonly nodeId;
|
|
203
|
-
private readonly details?;
|
|
204
|
-
constructor(message: string, nodeId: string, details?: string | undefined);
|
|
205
|
-
formulaNodeId(): string;
|
|
206
|
-
errorDetails(): string | undefined;
|
|
207
|
-
}
|
|
208
|
-
//#endregion
|
|
209
|
-
//#region src/schema-editor/model/path/types.d.ts
|
|
210
|
-
interface PathSegment {
|
|
211
|
-
isProperty(): boolean;
|
|
212
|
-
isItems(): boolean;
|
|
213
|
-
propertyName(): string;
|
|
214
|
-
equals(other: PathSegment): boolean;
|
|
215
|
-
}
|
|
216
|
-
interface Path {
|
|
217
|
-
segments(): readonly PathSegment[];
|
|
218
|
-
asJsonPointer(): string;
|
|
219
|
-
asSimple(): string;
|
|
220
|
-
parent(): Path;
|
|
221
|
-
child(name: string): Path;
|
|
222
|
-
childItems(): Path;
|
|
223
|
-
equals(other: Path): boolean;
|
|
224
|
-
isEmpty(): boolean;
|
|
225
|
-
length(): number;
|
|
226
|
-
isChildOf(parent: Path): boolean;
|
|
227
|
-
}
|
|
228
|
-
//#endregion
|
|
229
|
-
//#region src/schema-editor/model/path/Path.d.ts
|
|
230
|
-
declare const EMPTY_PATH: Path;
|
|
231
|
-
//#endregion
|
|
232
|
-
//#region src/schema-editor/model/path/PathParser.d.ts
|
|
233
|
-
declare function jsonPointerToPath(pointer: string): Path;
|
|
234
|
-
declare function jsonPointerToSimplePath(pointer: string): string;
|
|
235
|
-
//#endregion
|
|
236
|
-
//#region src/schema-editor/model/tree/NodeTree.d.ts
|
|
237
|
-
interface NodeTree {
|
|
238
|
-
root(): SchemaNode;
|
|
239
|
-
nodeAt(path: Path): SchemaNode;
|
|
240
|
-
nodeById(id: string): SchemaNode;
|
|
241
|
-
pathOf(id: string): Path;
|
|
242
|
-
setNodeAt(path: Path, node: SchemaNode): void;
|
|
243
|
-
removeNodeAt(path: Path): void;
|
|
244
|
-
renameNode(id: string, newName: string): void;
|
|
245
|
-
}
|
|
246
|
-
//#endregion
|
|
247
|
-
//#region src/schema-editor/model/formula/parsing/ParsedFormula.d.ts
|
|
248
|
-
declare class ParsedFormula implements Formula {
|
|
249
|
-
private readonly astNode;
|
|
250
|
-
private readonly deps;
|
|
251
|
-
private readonly astPathToNodeId;
|
|
252
|
-
constructor(tree: NodeTree, formulaNodeId: string, expression: string);
|
|
253
|
-
version(): number;
|
|
254
|
-
ast(): ASTNode;
|
|
255
|
-
dependencies(): readonly FormulaDependency[];
|
|
256
|
-
getNodeIdForAstPath(astPath: string): string | null;
|
|
257
|
-
astPaths(): readonly string[];
|
|
258
|
-
private resolveDependencyPath;
|
|
259
|
-
private getFormulaBasePath;
|
|
260
|
-
}
|
|
261
|
-
//#endregion
|
|
262
|
-
//#region src/schema-editor/model/schema/JsonSchema.d.ts
|
|
263
|
-
interface JsonSchemaSharedFields {
|
|
264
|
-
deprecated?: boolean;
|
|
265
|
-
description?: string;
|
|
266
|
-
title?: string;
|
|
267
|
-
}
|
|
268
|
-
interface XFormula {
|
|
269
|
-
version: 1;
|
|
270
|
-
expression: string;
|
|
271
|
-
}
|
|
272
|
-
interface JsonStringSchema extends JsonSchemaSharedFields {
|
|
273
|
-
type: 'string';
|
|
274
|
-
default: string;
|
|
275
|
-
foreignKey?: string;
|
|
276
|
-
readOnly?: boolean;
|
|
277
|
-
pattern?: string;
|
|
278
|
-
format?: 'date-time' | 'date' | 'time' | 'email' | 'regex';
|
|
279
|
-
contentMediaType?: 'text/plain' | 'text/markdown' | 'text/html' | 'application/json' | 'application/schema+json' | 'application/yaml';
|
|
280
|
-
enum?: string[];
|
|
281
|
-
'x-formula'?: XFormula;
|
|
282
|
-
}
|
|
283
|
-
interface JsonNumberSchema extends JsonSchemaSharedFields {
|
|
284
|
-
type: 'number';
|
|
285
|
-
default: number;
|
|
286
|
-
readOnly?: boolean;
|
|
287
|
-
'x-formula'?: XFormula;
|
|
288
|
-
}
|
|
289
|
-
interface JsonBooleanSchema extends JsonSchemaSharedFields {
|
|
290
|
-
type: 'boolean';
|
|
291
|
-
default: boolean;
|
|
292
|
-
readOnly?: boolean;
|
|
293
|
-
'x-formula'?: XFormula;
|
|
294
|
-
}
|
|
295
|
-
type JsonSchemaPrimitives = JsonStringSchema | JsonNumberSchema | JsonBooleanSchema;
|
|
296
|
-
interface JsonObjectSchema extends JsonSchemaSharedFields {
|
|
297
|
-
type: 'object';
|
|
298
|
-
additionalProperties: false;
|
|
299
|
-
required: string[];
|
|
300
|
-
properties: Record<string, JsonSchemaType>;
|
|
301
|
-
}
|
|
302
|
-
interface JsonArraySchema extends JsonSchemaSharedFields {
|
|
303
|
-
type: 'array';
|
|
304
|
-
items: JsonSchemaType;
|
|
305
|
-
default?: unknown[];
|
|
306
|
-
}
|
|
307
|
-
interface JsonRefSchema {
|
|
308
|
-
$ref: string;
|
|
309
|
-
title?: string;
|
|
310
|
-
description?: string;
|
|
311
|
-
deprecated?: boolean;
|
|
312
|
-
}
|
|
313
|
-
type JsonSchemaType = JsonObjectSchema | JsonArraySchema | JsonSchemaPrimitives | JsonRefSchema;
|
|
314
|
-
//#endregion
|
|
315
|
-
//#region src/schema-editor/model/formula/serialization/FormulaSerializer.d.ts
|
|
316
|
-
declare class FormulaSerializer {
|
|
317
|
-
private readonly tree;
|
|
318
|
-
private readonly formulaNodeId;
|
|
319
|
-
private readonly formula;
|
|
320
|
-
private readonly relativePathBuilder;
|
|
321
|
-
constructor(tree: NodeTree, formulaNodeId: string, formula: Formula);
|
|
322
|
-
static toXFormula(tree: NodeTree, formulaNodeId: string, formula: Formula): XFormula;
|
|
323
|
-
serialize(): string;
|
|
324
|
-
private buildPathReplacements;
|
|
325
|
-
private needsReplacement;
|
|
326
|
-
private normalizeArrayNotation;
|
|
327
|
-
}
|
|
328
|
-
//#endregion
|
|
329
|
-
//#region src/schema-editor/model/formula/store/FormulaDependencyIndex.d.ts
|
|
330
|
-
interface FormulaDependent {
|
|
331
|
-
formulaNodeId: string;
|
|
332
|
-
fieldName: string;
|
|
333
|
-
expression: string;
|
|
334
|
-
}
|
|
335
|
-
//#endregion
|
|
336
|
-
//#region src/schema-editor/model/node/SchemaNode.d.ts
|
|
337
|
-
interface SchemaNode {
|
|
338
|
-
id(): string;
|
|
339
|
-
name(): string;
|
|
340
|
-
nodeType(): NodeType;
|
|
341
|
-
metadata(): NodeMetadata;
|
|
342
|
-
property(name: string): SchemaNode;
|
|
343
|
-
items(): SchemaNode;
|
|
344
|
-
properties(): readonly SchemaNode[];
|
|
345
|
-
isObject(): boolean;
|
|
346
|
-
isArray(): boolean;
|
|
347
|
-
isPrimitive(): boolean;
|
|
348
|
-
isRef(): boolean;
|
|
349
|
-
isNull(): boolean;
|
|
350
|
-
ref(): string;
|
|
351
|
-
formula(): Formula | undefined;
|
|
352
|
-
hasFormula(): boolean;
|
|
353
|
-
defaultValue(): unknown;
|
|
354
|
-
foreignKey(): string | undefined;
|
|
355
|
-
contentMediaType?(): string | undefined;
|
|
356
|
-
setName(name: string): void;
|
|
357
|
-
setMetadata(meta: NodeMetadata): void;
|
|
358
|
-
setFormula(formula: Formula | undefined): void;
|
|
359
|
-
setDefaultValue(value: unknown): void;
|
|
360
|
-
addProperty(node: SchemaNode): void;
|
|
361
|
-
removeProperty(name: string): void;
|
|
362
|
-
removePropertyById(id: string): void;
|
|
363
|
-
replaceProperty(name: string, node: SchemaNode): void;
|
|
364
|
-
setItems(node: SchemaNode): void;
|
|
365
|
-
clone(): SchemaNode;
|
|
366
|
-
}
|
|
367
|
-
//#endregion
|
|
368
|
-
//#region src/schema-editor/model/node/NullNode.d.ts
|
|
369
|
-
declare const NULL_NODE: SchemaNode;
|
|
370
|
-
//#endregion
|
|
371
|
-
//#region src/schema-editor/model/node/ObjectNode.d.ts
|
|
372
|
-
declare class ObjectNode implements SchemaNode {
|
|
373
|
-
private readonly _id;
|
|
374
|
-
private _name;
|
|
375
|
-
private _children;
|
|
376
|
-
private _metadata;
|
|
377
|
-
constructor(_id: string, name: string, children?: SchemaNode[], metadata?: NodeMetadata);
|
|
378
|
-
id(): string;
|
|
379
|
-
name(): string;
|
|
380
|
-
nodeType(): NodeType;
|
|
381
|
-
metadata(): NodeMetadata;
|
|
382
|
-
property(name: string): SchemaNode;
|
|
383
|
-
items(): SchemaNode;
|
|
384
|
-
properties(): readonly SchemaNode[];
|
|
385
|
-
isObject(): boolean;
|
|
386
|
-
isArray(): boolean;
|
|
387
|
-
isPrimitive(): boolean;
|
|
388
|
-
isRef(): boolean;
|
|
389
|
-
isNull(): boolean;
|
|
390
|
-
ref(): string;
|
|
391
|
-
formula(): undefined;
|
|
392
|
-
hasFormula(): boolean;
|
|
393
|
-
defaultValue(): undefined;
|
|
394
|
-
foreignKey(): undefined;
|
|
395
|
-
setName(name: string): void;
|
|
396
|
-
setMetadata(meta: NodeMetadata): void;
|
|
397
|
-
addProperty(node: SchemaNode): void;
|
|
398
|
-
removeProperty(name: string): void;
|
|
399
|
-
removePropertyById(id: string): void;
|
|
400
|
-
replaceProperty(name: string, node: SchemaNode): void;
|
|
401
|
-
setItems(): void;
|
|
402
|
-
setFormula(): void;
|
|
403
|
-
setDefaultValue(): void;
|
|
404
|
-
setChildren(children: SchemaNode[]): void;
|
|
405
|
-
clone(): ObjectNode;
|
|
406
|
-
}
|
|
407
|
-
//#endregion
|
|
408
|
-
//#region src/schema-editor/model/node/ArrayNode.d.ts
|
|
409
|
-
declare class ArrayNode implements SchemaNode {
|
|
410
|
-
private readonly _id;
|
|
411
|
-
private _name;
|
|
412
|
-
private _items;
|
|
413
|
-
private _metadata;
|
|
414
|
-
constructor(_id: string, name: string, items: SchemaNode, metadata?: NodeMetadata);
|
|
415
|
-
id(): string;
|
|
416
|
-
name(): string;
|
|
417
|
-
nodeType(): NodeType;
|
|
418
|
-
metadata(): NodeMetadata;
|
|
419
|
-
property(): SchemaNode;
|
|
420
|
-
items(): SchemaNode;
|
|
421
|
-
properties(): readonly SchemaNode[];
|
|
422
|
-
isObject(): boolean;
|
|
423
|
-
isArray(): boolean;
|
|
424
|
-
isPrimitive(): boolean;
|
|
425
|
-
isRef(): boolean;
|
|
426
|
-
isNull(): boolean;
|
|
427
|
-
ref(): string;
|
|
428
|
-
formula(): undefined;
|
|
429
|
-
hasFormula(): boolean;
|
|
430
|
-
defaultValue(): undefined;
|
|
431
|
-
foreignKey(): undefined;
|
|
432
|
-
setName(name: string): void;
|
|
433
|
-
setMetadata(meta: NodeMetadata): void;
|
|
434
|
-
addProperty(): void;
|
|
435
|
-
removeProperty(): void;
|
|
436
|
-
removePropertyById(): void;
|
|
437
|
-
replaceProperty(): void;
|
|
438
|
-
setItems(node: SchemaNode): void;
|
|
439
|
-
setFormula(): void;
|
|
440
|
-
setDefaultValue(): void;
|
|
441
|
-
clone(): ArrayNode;
|
|
442
|
-
}
|
|
443
|
-
//#endregion
|
|
444
|
-
//#region src/schema-editor/model/node/StringNode.d.ts
|
|
445
|
-
type StringFormat = 'date-time' | 'date' | 'time' | 'email' | 'regex';
|
|
446
|
-
type ContentMediaType = 'text/plain' | 'text/markdown' | 'text/html' | 'application/json' | 'application/schema+json' | 'application/yaml';
|
|
447
|
-
interface StringNodeOptions {
|
|
448
|
-
defaultValue?: string;
|
|
449
|
-
foreignKey?: string;
|
|
450
|
-
format?: StringFormat;
|
|
451
|
-
contentMediaType?: ContentMediaType;
|
|
452
|
-
enumValues?: string[];
|
|
453
|
-
formula?: Formula;
|
|
454
|
-
}
|
|
455
|
-
declare class StringNode implements SchemaNode {
|
|
456
|
-
private readonly _id;
|
|
457
|
-
private _name;
|
|
458
|
-
private _metadata;
|
|
459
|
-
private _defaultValue;
|
|
460
|
-
private _foreignKey;
|
|
461
|
-
private _format;
|
|
462
|
-
private _contentMediaType;
|
|
463
|
-
private _enumValues;
|
|
464
|
-
private _formula;
|
|
465
|
-
constructor(_id: string, name: string, options?: StringNodeOptions, metadata?: NodeMetadata);
|
|
466
|
-
id(): string;
|
|
467
|
-
name(): string;
|
|
468
|
-
nodeType(): NodeType;
|
|
469
|
-
metadata(): NodeMetadata;
|
|
470
|
-
defaultValue(): string | undefined;
|
|
471
|
-
foreignKey(): string | undefined;
|
|
472
|
-
format(): StringFormat | undefined;
|
|
473
|
-
contentMediaType(): ContentMediaType | undefined;
|
|
474
|
-
enumValues(): string[] | undefined;
|
|
475
|
-
formula(): Formula | undefined;
|
|
476
|
-
hasFormula(): boolean;
|
|
477
|
-
property(): SchemaNode;
|
|
478
|
-
items(): SchemaNode;
|
|
479
|
-
properties(): readonly SchemaNode[];
|
|
480
|
-
isObject(): boolean;
|
|
481
|
-
isArray(): boolean;
|
|
482
|
-
isPrimitive(): boolean;
|
|
483
|
-
isRef(): boolean;
|
|
484
|
-
isNull(): boolean;
|
|
485
|
-
ref(): string;
|
|
486
|
-
setName(name: string): void;
|
|
487
|
-
setMetadata(meta: NodeMetadata): void;
|
|
488
|
-
setDefaultValue(value: string | undefined): void;
|
|
489
|
-
setForeignKey(value: string | undefined): void;
|
|
490
|
-
setFormat(value: StringFormat | undefined): void;
|
|
491
|
-
setContentMediaType(value: ContentMediaType | undefined): void;
|
|
492
|
-
setEnumValues(values: string[] | undefined): void;
|
|
493
|
-
setFormula(formula: Formula | undefined): void;
|
|
494
|
-
addProperty(): void;
|
|
495
|
-
removeProperty(): void;
|
|
496
|
-
removePropertyById(): void;
|
|
497
|
-
replaceProperty(): void;
|
|
498
|
-
setItems(): void;
|
|
499
|
-
clone(): StringNode;
|
|
500
|
-
}
|
|
501
|
-
//#endregion
|
|
502
|
-
//#region src/schema-editor/model/node/NumberNode.d.ts
|
|
503
|
-
interface NumberNodeOptions {
|
|
504
|
-
defaultValue?: number;
|
|
505
|
-
formula?: Formula;
|
|
506
|
-
}
|
|
507
|
-
declare class NumberNode implements SchemaNode {
|
|
508
|
-
private readonly _id;
|
|
509
|
-
private _name;
|
|
510
|
-
private _metadata;
|
|
511
|
-
private _defaultValue;
|
|
512
|
-
private _formula;
|
|
513
|
-
constructor(_id: string, name: string, options?: NumberNodeOptions, metadata?: NodeMetadata);
|
|
514
|
-
id(): string;
|
|
515
|
-
name(): string;
|
|
516
|
-
nodeType(): NodeType;
|
|
517
|
-
metadata(): NodeMetadata;
|
|
518
|
-
defaultValue(): number | undefined;
|
|
519
|
-
formula(): Formula | undefined;
|
|
520
|
-
hasFormula(): boolean;
|
|
521
|
-
property(): SchemaNode;
|
|
522
|
-
items(): SchemaNode;
|
|
523
|
-
properties(): readonly SchemaNode[];
|
|
524
|
-
isObject(): boolean;
|
|
525
|
-
isArray(): boolean;
|
|
526
|
-
isPrimitive(): boolean;
|
|
527
|
-
isRef(): boolean;
|
|
528
|
-
isNull(): boolean;
|
|
529
|
-
ref(): string;
|
|
530
|
-
foreignKey(): undefined;
|
|
531
|
-
setName(name: string): void;
|
|
532
|
-
setMetadata(meta: NodeMetadata): void;
|
|
533
|
-
setDefaultValue(value: number | undefined): void;
|
|
534
|
-
setFormula(formula: Formula | undefined): void;
|
|
535
|
-
addProperty(): void;
|
|
536
|
-
removeProperty(): void;
|
|
537
|
-
removePropertyById(): void;
|
|
538
|
-
replaceProperty(): void;
|
|
539
|
-
setItems(): void;
|
|
540
|
-
clone(): NumberNode;
|
|
541
|
-
}
|
|
542
|
-
//#endregion
|
|
543
|
-
//#region src/schema-editor/model/node/BooleanNode.d.ts
|
|
544
|
-
interface BooleanNodeOptions {
|
|
545
|
-
defaultValue?: boolean;
|
|
546
|
-
formula?: Formula;
|
|
547
|
-
}
|
|
548
|
-
declare class BooleanNode implements SchemaNode {
|
|
549
|
-
private readonly _id;
|
|
550
|
-
private _name;
|
|
551
|
-
private _metadata;
|
|
552
|
-
private _defaultValue;
|
|
553
|
-
private _formula;
|
|
554
|
-
constructor(_id: string, name: string, options?: BooleanNodeOptions, metadata?: NodeMetadata);
|
|
555
|
-
id(): string;
|
|
556
|
-
name(): string;
|
|
557
|
-
nodeType(): NodeType;
|
|
558
|
-
metadata(): NodeMetadata;
|
|
559
|
-
defaultValue(): boolean | undefined;
|
|
560
|
-
formula(): Formula | undefined;
|
|
561
|
-
hasFormula(): boolean;
|
|
562
|
-
property(): SchemaNode;
|
|
563
|
-
items(): SchemaNode;
|
|
564
|
-
properties(): readonly SchemaNode[];
|
|
565
|
-
isObject(): boolean;
|
|
566
|
-
isArray(): boolean;
|
|
567
|
-
isPrimitive(): boolean;
|
|
568
|
-
isRef(): boolean;
|
|
569
|
-
isNull(): boolean;
|
|
570
|
-
ref(): string;
|
|
571
|
-
foreignKey(): undefined;
|
|
572
|
-
setName(name: string): void;
|
|
573
|
-
setMetadata(meta: NodeMetadata): void;
|
|
574
|
-
setDefaultValue(value: boolean | undefined): void;
|
|
575
|
-
setFormula(formula: Formula | undefined): void;
|
|
576
|
-
addProperty(): void;
|
|
577
|
-
removeProperty(): void;
|
|
578
|
-
removePropertyById(): void;
|
|
579
|
-
replaceProperty(): void;
|
|
580
|
-
setItems(): void;
|
|
581
|
-
clone(): BooleanNode;
|
|
582
|
-
}
|
|
583
|
-
//#endregion
|
|
584
|
-
//#region src/schema-editor/model/node/RefNode.d.ts
|
|
585
|
-
declare class RefNode implements SchemaNode {
|
|
586
|
-
private readonly _id;
|
|
587
|
-
private _name;
|
|
588
|
-
private _ref;
|
|
589
|
-
private _metadata;
|
|
590
|
-
constructor(_id: string, name: string, ref: string, metadata?: NodeMetadata);
|
|
591
|
-
id(): string;
|
|
592
|
-
name(): string;
|
|
593
|
-
nodeType(): NodeType;
|
|
594
|
-
metadata(): NodeMetadata;
|
|
595
|
-
ref(): string;
|
|
596
|
-
formula(): undefined;
|
|
597
|
-
hasFormula(): boolean;
|
|
598
|
-
defaultValue(): undefined;
|
|
599
|
-
foreignKey(): undefined;
|
|
600
|
-
property(): SchemaNode;
|
|
601
|
-
items(): SchemaNode;
|
|
602
|
-
properties(): readonly SchemaNode[];
|
|
603
|
-
isObject(): boolean;
|
|
604
|
-
isArray(): boolean;
|
|
605
|
-
isPrimitive(): boolean;
|
|
606
|
-
isRef(): boolean;
|
|
607
|
-
isNull(): boolean;
|
|
608
|
-
setName(name: string): void;
|
|
609
|
-
setMetadata(meta: NodeMetadata): void;
|
|
610
|
-
setRef(ref: string): void;
|
|
611
|
-
addProperty(): void;
|
|
612
|
-
removeProperty(): void;
|
|
613
|
-
removePropertyById(): void;
|
|
614
|
-
replaceProperty(): void;
|
|
615
|
-
setItems(): void;
|
|
616
|
-
setFormula(): void;
|
|
617
|
-
setDefaultValue(): void;
|
|
618
|
-
clone(): RefNode;
|
|
619
|
-
}
|
|
620
|
-
//#endregion
|
|
621
|
-
//#region src/schema-editor/model/node/NodeFactory.d.ts
|
|
622
|
-
interface StringNodeFactoryOptions {
|
|
623
|
-
foreignKey?: string;
|
|
624
|
-
contentMediaType?: ContentMediaType;
|
|
625
|
-
}
|
|
626
|
-
interface RefNodeOptions {
|
|
627
|
-
$ref: string;
|
|
628
|
-
}
|
|
629
|
-
declare class NodeFactory {
|
|
630
|
-
static string(name: string, options?: StringNodeFactoryOptions): StringNode;
|
|
631
|
-
static number(name: string): NumberNode;
|
|
632
|
-
static boolean(name: string): BooleanNode;
|
|
633
|
-
static object(name: string, children?: SchemaNode[]): ObjectNode;
|
|
634
|
-
static array(name: string, items: SchemaNode): ArrayNode;
|
|
635
|
-
static ref(name: string, options: RefNodeOptions): RefNode;
|
|
636
|
-
}
|
|
637
|
-
//#endregion
|
|
638
|
-
//#region src/schema-editor/model/tree/SchemaTree.d.ts
|
|
639
|
-
declare class SchemaTree implements NodeTree {
|
|
640
|
-
private readonly nodeIndex;
|
|
641
|
-
private readonly mutator;
|
|
642
|
-
private readonly formulaIndex;
|
|
643
|
-
private _rootNode;
|
|
644
|
-
constructor(rootNode: SchemaNode);
|
|
645
|
-
root(): SchemaNode;
|
|
646
|
-
countNodes(): number;
|
|
647
|
-
nodeIds(): IterableIterator<string>;
|
|
648
|
-
nodeById(id: string): SchemaNode;
|
|
649
|
-
pathOf(id: string): Path;
|
|
650
|
-
nodeAt(path: Path): SchemaNode;
|
|
651
|
-
replaceRoot(newRoot: SchemaNode): void;
|
|
652
|
-
setNodeAt(path: Path, node: SchemaNode): void;
|
|
653
|
-
removeNodeAt(path: Path): void;
|
|
654
|
-
renameNode(id: string, newName: string): void;
|
|
655
|
-
addChildTo(parentId: string, node: SchemaNode): void;
|
|
656
|
-
canMoveNode(fromNodeId: string, toNodeId: string): boolean;
|
|
657
|
-
private isMovingOutOfArray;
|
|
658
|
-
private hasPathPrefixMismatch;
|
|
659
|
-
hasValidDropTarget(nodeId: string): boolean;
|
|
660
|
-
private findValidDropTarget;
|
|
661
|
-
moveNode(nodeId: string, targetParentId: string): void;
|
|
662
|
-
registerFormula(formulaNodeId: string, formula: Formula): void;
|
|
663
|
-
unregisterFormula(formulaNodeId: string): void;
|
|
664
|
-
getFormulaDependents(nodeId: string): FormulaDependent[];
|
|
665
|
-
getDirectFormulaDependents(nodeId: string): FormulaDependent[];
|
|
666
|
-
hasFormulaDependents(nodeId: string): boolean;
|
|
667
|
-
getFormulaByNodeId(nodeId: string): Formula | null;
|
|
668
|
-
clearFormulaIndex(): void;
|
|
669
|
-
forEachFormula(callback: (nodeId: string) => void): void;
|
|
670
|
-
private rebuildIndex;
|
|
671
|
-
clone(): SchemaTree;
|
|
672
|
-
private cloneFormulas;
|
|
673
|
-
private collectFormulaDependents;
|
|
674
|
-
private collectDirectDependents;
|
|
675
|
-
private createFormulaDependent;
|
|
676
|
-
private collectChildDependents;
|
|
677
|
-
}
|
|
678
|
-
//#endregion
|
|
679
|
-
//#region src/schema-editor/model/parsing/descriptors/TypeCapabilities.d.ts
|
|
680
|
-
interface TypeCapabilities {
|
|
681
|
-
readonly hasChildren: boolean;
|
|
682
|
-
readonly hasItems: boolean;
|
|
683
|
-
readonly hasFormula: boolean;
|
|
684
|
-
readonly isPrimitive: boolean;
|
|
685
|
-
readonly isContainer: boolean;
|
|
686
|
-
}
|
|
687
|
-
//#endregion
|
|
688
|
-
//#region src/schema-editor/model/parsing/descriptors/TypeDescriptor.d.ts
|
|
689
|
-
interface ParseContext {
|
|
690
|
-
generateId: () => string;
|
|
691
|
-
parseNode: (schema: JsonSchemaType, name: string) => SchemaNode;
|
|
692
|
-
addPendingFormula: (nodeId: string, expression: string) => void;
|
|
693
|
-
}
|
|
694
|
-
interface SerializeContext {
|
|
695
|
-
serialize: (node: SchemaNode) => JsonSchemaType;
|
|
696
|
-
serializeFormula: (nodeId: string, formula: Formula) => XFormula;
|
|
697
|
-
}
|
|
698
|
-
interface TypeDescriptor<TSchema extends JsonSchemaType = JsonSchemaType, TNode extends SchemaNode = SchemaNode> {
|
|
699
|
-
readonly type: string;
|
|
700
|
-
readonly capabilities: TypeCapabilities;
|
|
701
|
-
canParse(schema: JsonSchemaType): schema is TSchema;
|
|
702
|
-
parse(schema: TSchema, name: string, metadata: NodeMetadata, context: ParseContext): TNode;
|
|
703
|
-
serialize(node: TNode, context: SerializeContext): TSchema;
|
|
704
|
-
getDefaultValue(schema: TSchema): unknown;
|
|
705
|
-
parseDefaultValueString(valueStr: string): unknown;
|
|
706
|
-
}
|
|
707
|
-
//#endregion
|
|
708
|
-
//#region src/schema-editor/model/parsing/descriptors/TypeRegistry.d.ts
|
|
709
|
-
declare class TypeRegistry {
|
|
710
|
-
private readonly descriptors;
|
|
711
|
-
private readonly parseOrder;
|
|
712
|
-
register(descriptor: TypeDescriptor): void;
|
|
713
|
-
getDescriptor(type: string): TypeDescriptor | undefined;
|
|
714
|
-
findDescriptorForSchema(schema: JsonSchemaType): TypeDescriptor | undefined;
|
|
715
|
-
getAllDescriptors(): readonly TypeDescriptor[];
|
|
716
|
-
getTypes(): readonly string[];
|
|
717
|
-
}
|
|
718
|
-
//#endregion
|
|
719
|
-
//#region src/schema-editor/model/schema/SchemaParser.d.ts
|
|
720
|
-
declare function resetIdCounter(): void;
|
|
721
|
-
interface PendingFormula {
|
|
722
|
-
nodeId: string;
|
|
723
|
-
expression: string;
|
|
724
|
-
}
|
|
725
|
-
declare class SchemaParser {
|
|
726
|
-
private pendingFormulas;
|
|
727
|
-
private readonly registry;
|
|
728
|
-
constructor(registry?: TypeRegistry);
|
|
729
|
-
parse(schema: JsonSchemaType): SchemaNode;
|
|
730
|
-
parseWithRootName(schema: JsonSchemaType, name: string): SchemaNode;
|
|
731
|
-
getPendingFormulas(): PendingFormula[];
|
|
732
|
-
private parseNode;
|
|
733
|
-
private extractMetadata;
|
|
734
|
-
}
|
|
735
|
-
//#endregion
|
|
736
|
-
//#region src/schema-editor/model/schema/SchemaSerializer.d.ts
|
|
737
|
-
interface SerializeOptions {
|
|
738
|
-
excludeNodeIds?: Set<string>;
|
|
739
|
-
}
|
|
740
|
-
declare class SchemaSerializer {
|
|
741
|
-
private readonly registry;
|
|
742
|
-
private tree;
|
|
743
|
-
private excludeNodeIds;
|
|
744
|
-
constructor(registry?: TypeRegistry);
|
|
745
|
-
serializeWithTree(node: SchemaNode, tree: NodeTree, options?: SerializeOptions): JsonSchemaType;
|
|
746
|
-
serialize(node: SchemaNode): JsonSchemaType;
|
|
747
|
-
private serializeObjectWithExclusions;
|
|
748
|
-
private addMetadata;
|
|
749
|
-
}
|
|
750
|
-
//#endregion
|
|
751
|
-
//#region src/schema-editor/model/diff/SchemaPatch.d.ts
|
|
752
|
-
interface JsonPatch$2 {
|
|
753
|
-
op: 'add' | 'remove' | 'replace' | 'move';
|
|
754
|
-
path: string;
|
|
755
|
-
from?: string;
|
|
756
|
-
value?: JsonSchemaType;
|
|
757
|
-
}
|
|
758
|
-
type MetadataChangeType = 'formula' | 'description' | 'deprecated' | 'foreignKey' | 'enum' | 'format' | 'default' | 'contentMediaType';
|
|
759
|
-
type DefaultValueType = string | number | boolean | undefined;
|
|
760
|
-
interface SchemaPatch {
|
|
761
|
-
patch: JsonPatch$2;
|
|
762
|
-
fieldName: string;
|
|
763
|
-
metadataChanges: MetadataChangeType[];
|
|
764
|
-
typeChange?: {
|
|
765
|
-
fromType: string;
|
|
766
|
-
toType: string;
|
|
767
|
-
};
|
|
768
|
-
formulaChange?: {
|
|
769
|
-
fromFormula: string | undefined;
|
|
770
|
-
toFormula: string | undefined;
|
|
771
|
-
};
|
|
772
|
-
defaultChange?: {
|
|
773
|
-
fromDefault: DefaultValueType;
|
|
774
|
-
toDefault: DefaultValueType;
|
|
775
|
-
};
|
|
776
|
-
descriptionChange?: {
|
|
777
|
-
fromDescription: string | undefined;
|
|
778
|
-
toDescription: string | undefined;
|
|
779
|
-
};
|
|
780
|
-
deprecatedChange?: {
|
|
781
|
-
fromDeprecated: boolean | undefined;
|
|
782
|
-
toDeprecated: boolean | undefined;
|
|
783
|
-
};
|
|
784
|
-
foreignKeyChange?: {
|
|
785
|
-
fromForeignKey: string | undefined;
|
|
786
|
-
toForeignKey: string | undefined;
|
|
787
|
-
};
|
|
788
|
-
contentMediaTypeChange?: {
|
|
789
|
-
fromContentMediaType: string | undefined;
|
|
790
|
-
toContentMediaType: string | undefined;
|
|
791
|
-
};
|
|
792
|
-
isRename?: boolean;
|
|
793
|
-
movesIntoArray?: boolean;
|
|
794
|
-
}
|
|
795
|
-
//#endregion
|
|
796
|
-
//#region src/schema-editor/model/diff/SchemaDiff.d.ts
|
|
797
|
-
declare class SchemaDiff {
|
|
798
|
-
private readonly tree;
|
|
799
|
-
private readonly serializer;
|
|
800
|
-
private readonly comparator;
|
|
801
|
-
private readonly baseIndex;
|
|
802
|
-
private baseTree;
|
|
803
|
-
constructor(tree: SchemaTree);
|
|
804
|
-
markAsSaved(): void;
|
|
805
|
-
getBaseSchema(): JsonObjectSchema;
|
|
806
|
-
trackReplacement(oldNodeId: string, newNodeId: string): void;
|
|
807
|
-
getPatches(): SchemaPatch[];
|
|
808
|
-
isDirty(): boolean;
|
|
809
|
-
getCurrentSchema(): JsonObjectSchema;
|
|
810
|
-
private createPatchBuilder;
|
|
811
|
-
}
|
|
812
|
-
//#endregion
|
|
813
|
-
//#region src/schema-editor/model/validation/FieldNameValidator.d.ts
|
|
814
|
-
declare const FIELD_NAME_ERROR_MESSAGE = "Must start with a letter or underscore, cannot start with __, and can only include letters, numbers, hyphens, and underscores (max 64 chars)";
|
|
815
|
-
declare function isValidFieldName(name: string): boolean;
|
|
816
|
-
//#endregion
|
|
817
|
-
//#region src/schema-editor/model/validation/SchemaValidator.d.ts
|
|
818
|
-
type ValidationErrorType = 'empty-name' | 'duplicate-name' | 'invalid-name';
|
|
819
|
-
interface ValidationError {
|
|
820
|
-
nodeId: string;
|
|
821
|
-
type: ValidationErrorType;
|
|
822
|
-
message: string;
|
|
823
|
-
}
|
|
824
|
-
//#endregion
|
|
825
|
-
//#region src/schema-editor/model/validation/FormulaValidator.d.ts
|
|
826
|
-
interface FormulaValidationError {
|
|
827
|
-
nodeId: string;
|
|
828
|
-
message: string;
|
|
829
|
-
fieldPath?: string;
|
|
830
|
-
}
|
|
831
|
-
//#endregion
|
|
832
|
-
//#region src/schema-editor/model/validation/DefaultValueParser.d.ts
|
|
833
|
-
type ParsedDefaultValue = string | number | boolean | undefined;
|
|
834
|
-
declare function parseDefaultValue(valueStr: string, nodeType: NodeType): ParsedDefaultValue;
|
|
835
|
-
//#endregion
|
|
836
|
-
//#region src/schema-editor/model/utils/DataTransformations.d.ts
|
|
837
|
-
type DataLossSeverity = 'none' | 'possible' | 'certain';
|
|
838
|
-
interface TransformationStep {
|
|
839
|
-
name: string;
|
|
840
|
-
dataLossSeverity: DataLossSeverity;
|
|
841
|
-
}
|
|
842
|
-
interface TransformationInfo {
|
|
843
|
-
fromType: string;
|
|
844
|
-
toType: string;
|
|
845
|
-
example: {
|
|
846
|
-
before: unknown;
|
|
847
|
-
after: unknown;
|
|
848
|
-
};
|
|
849
|
-
dataLossSeverity: DataLossSeverity;
|
|
850
|
-
steps: TransformationStep[];
|
|
851
|
-
}
|
|
852
|
-
declare function getTransformationInfoFromTypeChange(fromType: string, toType: string): TransformationInfo | null;
|
|
853
|
-
//#endregion
|
|
854
|
-
//#region src/schema-editor/model/utils/DefaultValues.d.ts
|
|
855
|
-
interface DefaultValueExample {
|
|
856
|
-
value: unknown;
|
|
857
|
-
type: string;
|
|
858
|
-
foreignKeyTableId?: string;
|
|
859
|
-
}
|
|
860
|
-
declare function getDefaultValueFromSchema(schema: JsonSchemaType): unknown;
|
|
861
|
-
interface AddPatch {
|
|
862
|
-
op: 'add';
|
|
863
|
-
path: string;
|
|
864
|
-
value: JsonSchemaType;
|
|
865
|
-
}
|
|
866
|
-
declare function getDefaultValueExample(patch: AddPatch): DefaultValueExample | null;
|
|
867
|
-
//#endregion
|
|
868
|
-
//#region src/schema-editor/model/utils/ValidationTypes.d.ts
|
|
869
|
-
type ValidationErrorType$1 = 'empty-name' | 'duplicate-name' | 'invalid-name';
|
|
870
|
-
interface SchemaValidationError {
|
|
871
|
-
nodeId: string;
|
|
872
|
-
type: ValidationErrorType$1;
|
|
873
|
-
message: string;
|
|
874
|
-
}
|
|
875
|
-
interface FormulaError$1 {
|
|
876
|
-
message: string;
|
|
877
|
-
fieldPath?: string;
|
|
878
|
-
}
|
|
879
|
-
//#endregion
|
|
880
|
-
//#region src/schema-editor/model/engine/SchemaEngine.d.ts
|
|
881
|
-
interface ReplaceResult {
|
|
882
|
-
replacedNodeId: string;
|
|
883
|
-
newNodeId: string;
|
|
884
|
-
}
|
|
885
|
-
interface FormulaUpdateResult {
|
|
886
|
-
success: boolean;
|
|
887
|
-
error?: string;
|
|
888
|
-
}
|
|
889
|
-
declare class SchemaEngine {
|
|
890
|
-
private readonly _tree;
|
|
891
|
-
private readonly _diff;
|
|
892
|
-
private readonly _schemaValidator;
|
|
893
|
-
private readonly _formulaValidator;
|
|
894
|
-
private _formulaParseErrors;
|
|
895
|
-
constructor(jsonSchema: JsonObjectSchema);
|
|
896
|
-
private applyPendingFormulas;
|
|
897
|
-
private extractErrorMessage;
|
|
898
|
-
get tree(): SchemaTree;
|
|
899
|
-
get diff(): SchemaDiff;
|
|
900
|
-
root(): SchemaNode;
|
|
901
|
-
nodeById(nodeId: string): SchemaNode;
|
|
902
|
-
countNodes(): number;
|
|
903
|
-
getFormulaDependents(nodeId: string): FormulaDependent[];
|
|
904
|
-
get isDirty(): boolean;
|
|
905
|
-
get isValid(): boolean;
|
|
906
|
-
get validationErrors(): readonly ValidationError[];
|
|
907
|
-
validateFormulas(): FormulaValidationError[];
|
|
908
|
-
markAsSaved(): void;
|
|
909
|
-
revert(): void;
|
|
910
|
-
getPatches(): SchemaPatch[];
|
|
911
|
-
getPlainSchema(): JsonObjectSchema;
|
|
912
|
-
canMoveNode(fromNodeId: string, toNodeId: string): boolean;
|
|
913
|
-
hasValidDropTarget(nodeId: string): boolean;
|
|
914
|
-
moveNode(nodeId: string, targetObjectId: string): void;
|
|
915
|
-
renameNode(nodeId: string, newName: string): void;
|
|
916
|
-
updateNodeMetadata(nodeId: string, metadata: {
|
|
917
|
-
description?: string;
|
|
918
|
-
deprecated?: boolean;
|
|
919
|
-
}): void;
|
|
920
|
-
updateDefaultValue(nodeId: string, value: string | number | boolean | undefined): void;
|
|
921
|
-
addChild(parentId: string, name: string): SchemaNode;
|
|
922
|
-
removeNode(nodeId: string): boolean;
|
|
923
|
-
replaceNode(nodeId: string, newNode: SchemaNode): ReplaceResult | null;
|
|
924
|
-
wrapInArray(nodeId: string): ReplaceResult | null;
|
|
925
|
-
replaceRootWith(newNode: SchemaNode): ReplaceResult | null;
|
|
926
|
-
wrapRootInArray(): ReplaceResult | null;
|
|
927
|
-
updateForeignKey(nodeId: string, tableId: string): boolean;
|
|
928
|
-
updateFormula(nodeId: string, expression: string | undefined): FormulaUpdateResult;
|
|
929
|
-
createStringNode(name: string): SchemaNode;
|
|
930
|
-
createNumberNode(name: string): SchemaNode;
|
|
931
|
-
}
|
|
932
|
-
//#endregion
|
|
933
|
-
//#region src/schema-editor/vm/BaseNodeVM.d.ts
|
|
934
|
-
declare abstract class BaseNodeVM {
|
|
935
|
-
protected readonly _node: SchemaNode;
|
|
936
|
-
protected readonly _editor: SchemaEditorVM;
|
|
937
|
-
protected readonly _isRoot: boolean;
|
|
938
|
-
protected readonly _isReadonly: boolean;
|
|
939
|
-
isFocusedState: boolean;
|
|
940
|
-
isMenuOpenState: boolean;
|
|
941
|
-
isSettingsOpenState: boolean;
|
|
942
|
-
constructor(_node: SchemaNode, _editor: SchemaEditorVM, _isRoot?: boolean, _isReadonly?: boolean);
|
|
943
|
-
get isReadonly(): boolean;
|
|
944
|
-
get node(): SchemaNode;
|
|
945
|
-
get nodeId(): string;
|
|
946
|
-
get isRoot(): boolean;
|
|
947
|
-
get name(): string;
|
|
948
|
-
get path(): string;
|
|
949
|
-
get type(): string;
|
|
950
|
-
get label(): string;
|
|
951
|
-
get isFocused(): boolean;
|
|
952
|
-
get isMenuOpen(): boolean;
|
|
953
|
-
get isSettingsOpen(): boolean;
|
|
954
|
-
get shouldApplyFieldStyles(): boolean;
|
|
955
|
-
setFocused(value: boolean): void;
|
|
956
|
-
setMenuOpen(value: boolean): void;
|
|
957
|
-
setSettingsOpen(value: boolean): void;
|
|
958
|
-
get isCollapsible(): boolean;
|
|
959
|
-
get isObject(): boolean;
|
|
960
|
-
get isArray(): boolean;
|
|
961
|
-
get isPrimitive(): boolean;
|
|
962
|
-
get isString(): boolean;
|
|
963
|
-
get isNumber(): boolean;
|
|
964
|
-
get isBoolean(): boolean;
|
|
965
|
-
get showTypeSelector(): boolean;
|
|
966
|
-
get showMenu(): boolean;
|
|
967
|
-
get hasDescription(): boolean;
|
|
968
|
-
get isDeprecated(): boolean;
|
|
969
|
-
get description(): string;
|
|
970
|
-
get hasFormula(): boolean;
|
|
971
|
-
get formula(): string;
|
|
972
|
-
get formulaDependents(): FormulaDependent[];
|
|
973
|
-
get canDelete(): boolean;
|
|
974
|
-
get deleteBlockedReason(): string | null;
|
|
975
|
-
get defaultValue(): unknown;
|
|
976
|
-
get defaultValueAsString(): string;
|
|
977
|
-
get validationError(): string | null;
|
|
978
|
-
get hasError(): boolean;
|
|
979
|
-
get errorMessage(): string | null;
|
|
980
|
-
get canDrag(): boolean;
|
|
981
|
-
get isValidDropTarget(): boolean;
|
|
982
|
-
rename(newName: string): void;
|
|
983
|
-
setDescription(value: string): void;
|
|
984
|
-
setDeprecated(value: boolean): void;
|
|
985
|
-
setFormula(_expression: string): void;
|
|
986
|
-
setDefault(_value: string): void;
|
|
987
|
-
handleFieldBlur(): void;
|
|
988
|
-
canAcceptDrop(fromNodeId: string): boolean;
|
|
989
|
-
remove(): void;
|
|
990
|
-
abstract removeSelf(): void;
|
|
991
|
-
abstract changeType(typeId: string): void;
|
|
992
|
-
}
|
|
993
|
-
//#endregion
|
|
994
|
-
//#region src/schema-editor/vm/ObjectNodeVM.d.ts
|
|
995
|
-
declare class ObjectNodeVM extends BaseNodeVM {
|
|
996
|
-
private readonly _parent;
|
|
997
|
-
isCollapsedState: boolean;
|
|
998
|
-
propertyList: NodeVM[];
|
|
999
|
-
constructor(node: SchemaNode, editor: SchemaEditorVM, _parent: ObjectNodeVM | null, isRoot?: boolean, isReadonly?: boolean);
|
|
1000
|
-
private initChildren;
|
|
1001
|
-
get isCollapsible(): boolean;
|
|
1002
|
-
get isCollapsed(): boolean;
|
|
1003
|
-
toggleCollapsed(): void;
|
|
1004
|
-
get children(): readonly NodeVM[];
|
|
1005
|
-
get showAddButton(): boolean;
|
|
1006
|
-
get isValidDropTarget(): boolean;
|
|
1007
|
-
addProperty(name: string): void;
|
|
1008
|
-
removeProperty(childVM: NodeVM): void;
|
|
1009
|
-
replaceProperty(childVM: NodeVM, typeId: string): void;
|
|
1010
|
-
private replacePropertyVM;
|
|
1011
|
-
moveNodeHere(fromNodeId: string): void;
|
|
1012
|
-
removeSelf(): void;
|
|
1013
|
-
changeType(typeId: string): void;
|
|
1014
|
-
removePropertyVMByNodeId(nodeId: string): boolean;
|
|
1015
|
-
}
|
|
1016
|
-
//#endregion
|
|
1017
|
-
//#region src/schema-editor/vm/ArrayNodeVM.d.ts
|
|
1018
|
-
declare class ArrayNodeVM extends BaseNodeVM {
|
|
1019
|
-
private readonly _parent;
|
|
1020
|
-
isCollapsedState: boolean;
|
|
1021
|
-
itemsVMRef: NodeVM | null;
|
|
1022
|
-
constructor(node: SchemaNode, editor: SchemaEditorVM, _parent: ObjectNodeVM | null, isRoot?: boolean, isReadonly?: boolean);
|
|
1023
|
-
private initItemsVM;
|
|
1024
|
-
get isCollapsible(): boolean;
|
|
1025
|
-
get isCollapsed(): boolean;
|
|
1026
|
-
toggleCollapsed(): void;
|
|
1027
|
-
get itemsVM(): NodeVM | null;
|
|
1028
|
-
changeItemsType(typeId: string): void;
|
|
1029
|
-
removeSelf(): void;
|
|
1030
|
-
changeType(typeId: string): void;
|
|
1031
|
-
}
|
|
1032
|
-
//#endregion
|
|
1033
|
-
//#region src/schema-editor/vm/PrimitiveNodeVM.d.ts
|
|
1034
|
-
type PrimitiveValue = string | number | boolean | undefined;
|
|
1035
|
-
declare class PrimitiveNodeVM extends BaseNodeVM {
|
|
1036
|
-
private readonly _parent;
|
|
1037
|
-
formulaInputValue: string | null;
|
|
1038
|
-
formulaErrorValue: string | null;
|
|
1039
|
-
constructor(node: SchemaNode, editor: SchemaEditorVM, _parent: ObjectNodeVM | null, isRoot?: boolean, isReadonly?: boolean);
|
|
1040
|
-
get hasFormula(): boolean;
|
|
1041
|
-
get formula(): string;
|
|
1042
|
-
get defaultValue(): PrimitiveValue;
|
|
1043
|
-
get defaultValueAsString(): string;
|
|
1044
|
-
get formulaError(): string | null;
|
|
1045
|
-
get hasError(): boolean;
|
|
1046
|
-
get errorMessage(): string | null;
|
|
1047
|
-
get formulaDependents(): FormulaDependent[];
|
|
1048
|
-
get canDelete(): boolean;
|
|
1049
|
-
get deleteBlockedReason(): string | null;
|
|
1050
|
-
setFormula(expression: string): void;
|
|
1051
|
-
setDefault(valueStr: string): void;
|
|
1052
|
-
removeSelf(): void;
|
|
1053
|
-
changeType(typeId: string): void;
|
|
1054
|
-
}
|
|
1055
|
-
//#endregion
|
|
1056
|
-
//#region src/schema-editor/vm/RefNodeVM.d.ts
|
|
1057
|
-
declare class RefNodeVM extends BaseNodeVM {
|
|
1058
|
-
private readonly _parent;
|
|
1059
|
-
isCollapsedState: boolean;
|
|
1060
|
-
childrenList: NodeVM[];
|
|
1061
|
-
private readonly _isResolvable;
|
|
1062
|
-
constructor(node: SchemaNode, editor: SchemaEditorVM, _parent: ObjectNodeVM | null, isRoot?: boolean, isReadonly?: boolean);
|
|
1063
|
-
private initResolvedChildren;
|
|
1064
|
-
get ref(): string;
|
|
1065
|
-
get isCollapsible(): boolean;
|
|
1066
|
-
get isCollapsed(): boolean;
|
|
1067
|
-
toggleCollapsed(): void;
|
|
1068
|
-
get children(): readonly NodeVM[];
|
|
1069
|
-
removeSelf(): void;
|
|
1070
|
-
changeType(typeId: string): void;
|
|
1071
|
-
}
|
|
1072
|
-
//#endregion
|
|
1073
|
-
//#region src/schema-editor/vm/ForeignKeyNodeVM.d.ts
|
|
1074
|
-
declare class ForeignKeyNodeVM extends BaseNodeVM {
|
|
1075
|
-
private readonly _parent;
|
|
1076
|
-
constructor(node: SchemaNode, editor: SchemaEditorVM, _parent: ObjectNodeVM | null, isRoot?: boolean, isReadonly?: boolean);
|
|
1077
|
-
get label(): string;
|
|
1078
|
-
get foreignKeyValue(): string;
|
|
1079
|
-
setForeignKey(tableId: string | null): void;
|
|
1080
|
-
selectForeignKey(): Promise<void>;
|
|
1081
|
-
removeSelf(): void;
|
|
1082
|
-
changeType(typeId: string): void;
|
|
1083
|
-
}
|
|
1084
|
-
//#endregion
|
|
1085
|
-
//#region src/schema-editor/vm/createNodeVM.d.ts
|
|
1086
|
-
type NodeVM = ObjectNodeVM | ArrayNodeVM | PrimitiveNodeVM | RefNodeVM | ForeignKeyNodeVM;
|
|
1087
|
-
//#endregion
|
|
1088
|
-
//#region src/schema-editor/vm/SchemaEditorVM.d.ts
|
|
1089
|
-
type SchemaEditorMode = 'creating' | 'updating';
|
|
1090
|
-
type ForeignKeySelectionCallback = () => Promise<string | null>;
|
|
1091
|
-
interface SchemaEditorOptions {
|
|
1092
|
-
tableId?: string;
|
|
1093
|
-
mode?: SchemaEditorMode;
|
|
1094
|
-
collapseComplexSchemas?: boolean;
|
|
1095
|
-
collapseComplexity?: number;
|
|
1096
|
-
onApprove?: () => Promise<boolean>;
|
|
1097
|
-
onCancel?: () => void;
|
|
1098
|
-
onSelectForeignKey?: ForeignKeySelectionCallback;
|
|
1099
|
-
}
|
|
1100
|
-
declare class SchemaEditorVM {
|
|
1101
|
-
private readonly _engine;
|
|
1102
|
-
private _rootNodeVM;
|
|
1103
|
-
private _tableId;
|
|
1104
|
-
private _initialTableId;
|
|
1105
|
-
private readonly _shouldCollapseAll;
|
|
1106
|
-
private readonly _mode;
|
|
1107
|
-
private readonly _onApprove;
|
|
1108
|
-
private readonly _onCancel;
|
|
1109
|
-
private readonly _onSelectForeignKey;
|
|
1110
|
-
private _loading;
|
|
1111
|
-
private _viewMode;
|
|
1112
|
-
private _isChangesDialogOpen;
|
|
1113
|
-
private _createDialogViewMode;
|
|
1114
|
-
constructor(jsonSchema: JsonObjectSchema, options?: SchemaEditorOptions);
|
|
1115
|
-
get mode(): SchemaEditorMode;
|
|
1116
|
-
get engine(): SchemaEngine;
|
|
1117
|
-
get shouldCollapseAll(): boolean;
|
|
1118
|
-
get tableId(): string;
|
|
1119
|
-
get initialTableId(): string;
|
|
1120
|
-
get isTableIdChanged(): boolean;
|
|
1121
|
-
get tableIdError(): string | null;
|
|
1122
|
-
setTableId(value: string): void;
|
|
1123
|
-
get loading(): boolean;
|
|
1124
|
-
setLoading(value: boolean): void;
|
|
1125
|
-
get viewMode(): ViewerSwitcherMode;
|
|
1126
|
-
setViewMode(mode: ViewerSwitcherMode): void;
|
|
1127
|
-
get isChangesDialogOpen(): boolean;
|
|
1128
|
-
openChangesDialog(): void;
|
|
1129
|
-
closeChangesDialog(): void;
|
|
1130
|
-
get createDialogViewMode(): 'Example' | 'Schema';
|
|
1131
|
-
setCreateDialogViewMode(mode: 'Example' | 'Schema'): void;
|
|
1132
|
-
get rootNodeVM(): NodeVM;
|
|
1133
|
-
get isDirty(): boolean;
|
|
1134
|
-
get isValid(): boolean;
|
|
1135
|
-
get isApproveDisabled(): boolean;
|
|
1136
|
-
get patchesCount(): number;
|
|
1137
|
-
get totalChangesCount(): number;
|
|
1138
|
-
get validationErrors(): readonly ValidationError[];
|
|
1139
|
-
get formulaErrors(): FormulaValidationError[];
|
|
1140
|
-
private collectFormulaInputErrors;
|
|
1141
|
-
get hasErrors(): boolean;
|
|
1142
|
-
markAsSaved(): void;
|
|
1143
|
-
revert(): void;
|
|
1144
|
-
changeRootType(typeId: string): void;
|
|
1145
|
-
selectForeignKey(): Promise<string | null>;
|
|
1146
|
-
approve(): Promise<void>;
|
|
1147
|
-
cancel(): void;
|
|
1148
|
-
getPatches(): SchemaPatch[];
|
|
1149
|
-
getJsonPatches(): JsonPatch$2[];
|
|
1150
|
-
getPlainSchema(): JsonObjectSchema;
|
|
1151
|
-
getExampleData(): unknown;
|
|
1152
|
-
createNodeByTypeId(typeId: string, name: string): SchemaNode | null;
|
|
1153
|
-
dispose(): void;
|
|
1154
|
-
}
|
|
1155
|
-
//#endregion
|
|
1156
|
-
//#region src/schema-editor/config/schema-type-ids.d.ts
|
|
1157
|
-
declare enum SchemaTypeIds {
|
|
1158
|
-
String = "String",
|
|
1159
|
-
Number = "Number",
|
|
1160
|
-
Boolean = "Boolean",
|
|
1161
|
-
Object = "Object",
|
|
1162
|
-
Array = "Array",
|
|
1163
|
-
ForeignKeyString = "ForeignKeyString",
|
|
1164
|
-
File = "File",
|
|
1165
|
-
RowId = "RowId",
|
|
1166
|
-
RowVersionId = "RowVersionId",
|
|
1167
|
-
RowCreatedId = "RowCreatedId",
|
|
1168
|
-
RowCreatedAt = "RowCreatedAt",
|
|
1169
|
-
RowPublishedAt = "RowPublishedAt",
|
|
1170
|
-
RowUpdatedAt = "RowUpdatedAt",
|
|
1171
|
-
RowHash = "RowHash",
|
|
1172
|
-
RowSchemaHash = "RowSchemaHash",
|
|
1173
|
-
Markdown = "Markdown"
|
|
1174
|
-
}
|
|
1175
|
-
declare function createNodeByTypeId(typeId: SchemaTypeIds | string, name: string): SchemaNode | null;
|
|
1176
|
-
type BaseOption = {
|
|
1177
|
-
id: string;
|
|
1178
|
-
label: string;
|
|
1179
|
-
type?: 'item' | 'submenu';
|
|
1180
|
-
};
|
|
1181
|
-
type MenuOptionItem = (BaseOption & {
|
|
1182
|
-
type?: 'item';
|
|
1183
|
-
addDividerAfter?: boolean;
|
|
1184
|
-
}) | (BaseOption & {
|
|
1185
|
-
type: 'submenu';
|
|
1186
|
-
items: MenuOptionItem[];
|
|
1187
|
-
});
|
|
1188
|
-
type MenuGroup = {
|
|
1189
|
-
id: string;
|
|
1190
|
-
options: MenuOptionItem[];
|
|
1191
|
-
addDividerAfter?: boolean;
|
|
1192
|
-
};
|
|
1193
|
-
declare const typeMenuGroups: MenuGroup[];
|
|
1194
|
-
//#endregion
|
|
1195
|
-
//#region src/schema-editor/ui/SchemaEditor/SchemaEditor.d.ts
|
|
1196
|
-
interface SchemaEditorProps {
|
|
1197
|
-
model: SchemaEditorVM;
|
|
1198
|
-
}
|
|
1199
|
-
declare const SchemaEditor: FC<SchemaEditorProps>;
|
|
1200
|
-
//#endregion
|
|
1201
|
-
//#region src/schema-editor/ui/hooks/useFixZagNestedMenuDismiss.d.ts
|
|
1202
|
-
declare function useFixZagNestedMenuDismiss(contentRef: RefObject<HTMLDivElement | null>): (e: {
|
|
1203
|
-
preventDefault: () => void;
|
|
1204
|
-
}) => void;
|
|
1205
|
-
//#endregion
|
|
1206
727
|
//#region src/value-model/core/Path.d.ts
|
|
1207
|
-
type PathSegment
|
|
728
|
+
type PathSegment = {
|
|
1208
729
|
type: 'property';
|
|
1209
730
|
name: string;
|
|
1210
731
|
} | {
|
|
@@ -1213,25 +734,25 @@ type PathSegment$1 = {
|
|
|
1213
734
|
} | {
|
|
1214
735
|
type: 'items';
|
|
1215
736
|
};
|
|
1216
|
-
declare class Path
|
|
737
|
+
declare class Path {
|
|
1217
738
|
private readonly _segments;
|
|
1218
739
|
private constructor();
|
|
1219
|
-
static empty(): Path
|
|
740
|
+
static empty(): Path;
|
|
1220
741
|
private static readonly INDEX_REGEX;
|
|
1221
742
|
private static readonly PROP_REGEX;
|
|
1222
|
-
static fromString(path: string): Path
|
|
1223
|
-
static fromSegments(segments: readonly PathSegment
|
|
1224
|
-
segments(): readonly PathSegment
|
|
743
|
+
static fromString(path: string): Path;
|
|
744
|
+
static fromSegments(segments: readonly PathSegment[]): Path;
|
|
745
|
+
segments(): readonly PathSegment[];
|
|
1225
746
|
isEmpty(): boolean;
|
|
1226
747
|
length(): number;
|
|
1227
|
-
first(): PathSegment
|
|
1228
|
-
last(): PathSegment
|
|
1229
|
-
parent(): Path
|
|
1230
|
-
child(name: string): Path
|
|
1231
|
-
childIndex(index: number): Path
|
|
1232
|
-
childItems(): Path
|
|
1233
|
-
isChildOf(parent: Path
|
|
1234
|
-
equals(other: Path
|
|
748
|
+
first(): PathSegment | undefined;
|
|
749
|
+
last(): PathSegment | undefined;
|
|
750
|
+
parent(): Path;
|
|
751
|
+
child(name: string): Path;
|
|
752
|
+
childIndex(index: number): Path;
|
|
753
|
+
childItems(): Path;
|
|
754
|
+
isChildOf(parent: Path): boolean;
|
|
755
|
+
equals(other: Path): boolean;
|
|
1235
756
|
asSimple(): string;
|
|
1236
757
|
asJsonPointer(): string;
|
|
1237
758
|
private segmentEquals;
|
|
@@ -1289,7 +810,7 @@ interface FormulaWarning {
|
|
|
1289
810
|
type ChangeType = 'setValue' | 'addProperty' | 'removeProperty' | 'arrayPush' | 'arrayInsert' | 'arrayRemove' | 'arrayMove' | 'arrayReplace' | 'arrayClear';
|
|
1290
811
|
interface Change {
|
|
1291
812
|
readonly type: ChangeType;
|
|
1292
|
-
readonly path: Path
|
|
813
|
+
readonly path: Path;
|
|
1293
814
|
readonly value?: unknown;
|
|
1294
815
|
readonly oldValue?: unknown;
|
|
1295
816
|
readonly fromIndex?: number;
|
|
@@ -1297,7 +818,7 @@ interface Change {
|
|
|
1297
818
|
readonly index?: number;
|
|
1298
819
|
}
|
|
1299
820
|
type JsonPatchOp = 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test';
|
|
1300
|
-
interface JsonPatch$
|
|
821
|
+
interface JsonPatch$2 {
|
|
1301
822
|
readonly op: JsonPatchOp;
|
|
1302
823
|
readonly path: string;
|
|
1303
824
|
readonly value?: unknown;
|
|
@@ -1312,7 +833,7 @@ declare class NodeFactoryRegistry {
|
|
|
1312
833
|
get(schemaType: string): NodeFactoryFn | undefined;
|
|
1313
834
|
has(schemaType: string): boolean;
|
|
1314
835
|
}
|
|
1315
|
-
declare class NodeFactory
|
|
836
|
+
declare class NodeFactory {
|
|
1316
837
|
private readonly registry;
|
|
1317
838
|
constructor(registry: NodeFactoryRegistry);
|
|
1318
839
|
create(name: string, schema: SchemaDefinition, value: unknown, id?: string): ValueNode;
|
|
@@ -1371,7 +892,7 @@ interface ArrayValueNode$1 extends ValueNode, DirtyTrackable {
|
|
|
1371
892
|
move(fromIndex: number, toIndex: number): void;
|
|
1372
893
|
replaceAt(index: number, node: ValueNode): void;
|
|
1373
894
|
clear(): void;
|
|
1374
|
-
setNodeFactory(factory: NodeFactory
|
|
895
|
+
setNodeFactory(factory: NodeFactory): void;
|
|
1375
896
|
pushValue(value?: unknown): void;
|
|
1376
897
|
insertValueAt(index: number, value?: unknown): void;
|
|
1377
898
|
}
|
|
@@ -1497,7 +1018,7 @@ declare class ArrayValueNode extends BaseValueNode implements ArrayValueNode$1 {
|
|
|
1497
1018
|
move(fromIndex: number, toIndex: number): void;
|
|
1498
1019
|
replaceAt(index: number, node: ValueNode): void;
|
|
1499
1020
|
clear(): void;
|
|
1500
|
-
setNodeFactory(factory: NodeFactory
|
|
1021
|
+
setNodeFactory(factory: NodeFactory): void;
|
|
1501
1022
|
pushValue(value?: unknown): void;
|
|
1502
1023
|
insertValueAt(index: number, value?: unknown): void;
|
|
1503
1024
|
private createItemNode;
|
|
@@ -1561,9 +1082,9 @@ declare class ValueTree {
|
|
|
1561
1082
|
get root(): ValueNode;
|
|
1562
1083
|
nodeById(id: string): ValueNode | undefined;
|
|
1563
1084
|
get(path: string): ValueNode | undefined;
|
|
1564
|
-
getByPath(path: Path
|
|
1085
|
+
getByPath(path: Path): ValueNode | undefined;
|
|
1565
1086
|
private resolveSegment;
|
|
1566
|
-
pathOf(nodeOrId: ValueNode | string): Path
|
|
1087
|
+
pathOf(nodeOrId: ValueNode | string): Path;
|
|
1567
1088
|
get allErrors(): readonly Diagnostic[];
|
|
1568
1089
|
get allWarnings(): readonly Diagnostic[];
|
|
1569
1090
|
get allDiagnostics(): readonly Diagnostic[];
|
|
@@ -1576,7 +1097,7 @@ declare class ValueTree {
|
|
|
1576
1097
|
get changes(): readonly Change[];
|
|
1577
1098
|
get hasChanges(): boolean;
|
|
1578
1099
|
clearChanges(): void;
|
|
1579
|
-
getPatches(): readonly JsonPatch$
|
|
1100
|
+
getPatches(): readonly JsonPatch$2[];
|
|
1580
1101
|
trackChange(change: Change): void;
|
|
1581
1102
|
rebuildIndex(): void;
|
|
1582
1103
|
invalidatePathsUnder(node: ValueNode): void;
|
|
@@ -1590,11 +1111,11 @@ declare class ValueTree {
|
|
|
1590
1111
|
//#endregion
|
|
1591
1112
|
//#region src/value-model/factory.d.ts
|
|
1592
1113
|
interface CreateValueModelOptions {
|
|
1593
|
-
nodeFactory?: NodeFactory
|
|
1114
|
+
nodeFactory?: NodeFactory;
|
|
1594
1115
|
formulaEngine?: boolean | FormulaEngineOptions;
|
|
1595
1116
|
}
|
|
1596
1117
|
declare function createValueModel(schema: SchemaDefinition, initialValue: unknown, options?: CreateValueModelOptions): ValueTree;
|
|
1597
1118
|
declare function createEmptyValueModel(schema: SchemaDefinition, options?: CreateValueModelOptions): ValueTree;
|
|
1598
1119
|
//#endregion
|
|
1599
|
-
export {
|
|
1120
|
+
export { ArrayValueNode, ArrayValueNode as ArrayValueNodeType, BackButton, BooleanValueNode, Change, ChangeType, CloseButton, ContentEditable, type ContentEditableProps, CopyButton, CreateButton, CreateValueModelOptions, CreatingEditorVM, type CreatingEditorVMOptions, CreatingSchemaEditor, type CreatingSchemaEditorProps, Diagnostic, DiagnosticSeverity, type ForeignKeySelectionCallback, FormulaDefinition, FormulaEngine, FormulaEngineOptions, FormulaWarning, GrayButton, JsonCard, type JsonObjectSchema, type JsonPatch, JsonSchemaTypeName, type JsonValue, type MenuGroup, type MenuOptionItem, type NodeType, NumberValueNode, ObjectValueNode, ObjectValueNode as ObjectValueNodeType, PrimitiveValueNode, SchemaDefinition, SchemaEditorCore, type SchemaEditorCoreOptions, SchemaTypeIds, SettingsButton, StringValueNode, Tooltip, type TooltipProps, UpdatingEditorVM, type UpdatingEditorVMOptions, UpdatingSchemaEditor, type UpdatingSchemaEditorProps, type UseContentEditableOptions, type UseContentEditableReturn, ValueNode, ValueTree, ValueType, type ViewMode, ViewerSwitcher, ViewerSwitcherMode, createEmptyValueModel, createValueModel, getLabelByRef, typeMenuGroups, useContentEditable };
|
|
1600
1121
|
//# sourceMappingURL=index.d.mts.map
|