@judo/model-parser 0.1.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/LICENSE +277 -0
- package/README.md +109 -0
- package/dist/containment-builder.d.ts +17 -0
- package/dist/containment-builder.d.ts.map +1 -0
- package/dist/emf-defaults.d.ts +651 -0
- package/dist/emf-defaults.d.ts.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +531 -0
- package/dist/index.js.map +1 -0
- package/dist/parser.d.ts +56 -0
- package/dist/parser.d.ts.map +1 -0
- package/dist/reference-resolver.d.ts +28 -0
- package/dist/reference-resolver.d.ts.map +1 -0
- package/dist/type-discriminator.d.ts +14 -0
- package/dist/type-discriminator.d.ts.map +1 -0
- package/package.json +50 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
import { XMLParser } from "fast-xml-parser";
|
|
2
|
+
import { Axis, CheckboxSelection, ConfirmationType, CrossAxisAlignment, DurationUnit, Fit, MainAxisAlignment, MainAxisSize, MemberType, OperationTypeEnum, PageContainerType, Placement, RelationKind, Sort, Stretch, TableRepresentation } from "@judo/model-api";
|
|
3
|
+
const VISUAL_ELEMENT_DEFAULTS = {
|
|
4
|
+
col: 4,
|
|
5
|
+
row: 1,
|
|
6
|
+
fit: Fit.NONE,
|
|
7
|
+
stretch: Stretch.NONE,
|
|
8
|
+
disabled: !1,
|
|
9
|
+
isInCard: !1,
|
|
10
|
+
isReadOnly: !1
|
|
11
|
+
}, FLEX_DEFAULTS = {
|
|
12
|
+
...VISUAL_ELEMENT_DEFAULTS,
|
|
13
|
+
direction: Axis.HORIZONTAL,
|
|
14
|
+
mainAxisAlignment: MainAxisAlignment.CENTER,
|
|
15
|
+
crossAxisAlignment: CrossAxisAlignment.START,
|
|
16
|
+
mainAxisSize: MainAxisSize.MIN
|
|
17
|
+
}, PAGE_CONTAINER_DEFAULTS = {
|
|
18
|
+
...FLEX_DEFAULTS,
|
|
19
|
+
type: PageContainerType.TABLE,
|
|
20
|
+
generateVisualPropertiesHook: !1
|
|
21
|
+
}, SIZE_DEFAULTS = {
|
|
22
|
+
width: -1,
|
|
23
|
+
height: -1
|
|
24
|
+
}, SIZE_CONSTRAINT_DEFAULTS = {
|
|
25
|
+
minWidth: -1,
|
|
26
|
+
minHeight: -1,
|
|
27
|
+
maxWidth: -1,
|
|
28
|
+
maxHeight: -1
|
|
29
|
+
}, FRAME_DEFAULTS = {
|
|
30
|
+
elevation: 4,
|
|
31
|
+
radius: 10
|
|
32
|
+
}, TAB_CONTROLLER_DEFAULTS = {
|
|
33
|
+
...VISUAL_ELEMENT_DEFAULTS,
|
|
34
|
+
controllerRow: 1
|
|
35
|
+
}, TABLE_DEFAULTS = {
|
|
36
|
+
...VISUAL_ELEMENT_DEFAULTS,
|
|
37
|
+
crudOperationsDisplayed: 2,
|
|
38
|
+
isSmallTable: !1,
|
|
39
|
+
rowsPerPage: 10,
|
|
40
|
+
isEager: !1,
|
|
41
|
+
allowSelectMultiple: !1,
|
|
42
|
+
transferOperationsDisplayed: 0,
|
|
43
|
+
showTotalCount: !1,
|
|
44
|
+
checkboxSelection: CheckboxSelection.ENABLED,
|
|
45
|
+
representationComponent: TableRepresentation.TABLE
|
|
46
|
+
}, COLUMN_DEFAULTS = {
|
|
47
|
+
...VISUAL_ELEMENT_DEFAULTS,
|
|
48
|
+
sort: Sort.NONE,
|
|
49
|
+
sortPrecedence: 0,
|
|
50
|
+
formatValue: !0
|
|
51
|
+
}, FILTER_DEFAULTS = {
|
|
52
|
+
...VISUAL_ELEMENT_DEFAULTS,
|
|
53
|
+
alwaysShown: !1,
|
|
54
|
+
range: !1,
|
|
55
|
+
multiValue: !1
|
|
56
|
+
}, LINK_DEFAULTS = {
|
|
57
|
+
...VISUAL_ELEMENT_DEFAULTS,
|
|
58
|
+
isEager: !1
|
|
59
|
+
}, INPUT_DEFAULTS = {
|
|
60
|
+
...VISUAL_ELEMENT_DEFAULTS,
|
|
61
|
+
required: !1
|
|
62
|
+
}, TEXT_INPUT_DEFAULTS = {
|
|
63
|
+
...INPUT_DEFAULTS,
|
|
64
|
+
isTypeAheadField: !1
|
|
65
|
+
}, TEXT_AREA_DEFAULTS = {
|
|
66
|
+
...INPUT_DEFAULTS,
|
|
67
|
+
lines: 1
|
|
68
|
+
}, NUMERIC_INPUT_DEFAULTS = {
|
|
69
|
+
...INPUT_DEFAULTS,
|
|
70
|
+
formatValue: !0
|
|
71
|
+
}, DATE_TIME_INPUT_DEFAULTS = {
|
|
72
|
+
...INPUT_DEFAULTS,
|
|
73
|
+
baseUnit: DurationUnit.SECOND
|
|
74
|
+
}, TIME_INPUT_DEFAULTS = {
|
|
75
|
+
...INPUT_DEFAULTS,
|
|
76
|
+
baseUnit: DurationUnit.SECOND
|
|
77
|
+
}, CHECKBOX_DEFAULTS = {
|
|
78
|
+
...INPUT_DEFAULTS,
|
|
79
|
+
checked: !1,
|
|
80
|
+
valueLabelPlacement: Placement.DEFAULT
|
|
81
|
+
}, SWITCH_DEFAULTS = {
|
|
82
|
+
...INPUT_DEFAULTS,
|
|
83
|
+
valueLabelPlacement: Placement.DEFAULT
|
|
84
|
+
}, OPTION_DEFAULTS = { selected: !1 }, BUTTON_GROUP_DEFAULTS = {
|
|
85
|
+
...VISUAL_ELEMENT_DEFAULTS,
|
|
86
|
+
featuredActions: 0
|
|
87
|
+
}, PAGE_DEFINITION_DEFAULTS = {
|
|
88
|
+
dashboard: !1,
|
|
89
|
+
generateActionsHook: !1
|
|
90
|
+
}, APPLICATION_DEFAULTS = {
|
|
91
|
+
defaultLanguage: "en-US",
|
|
92
|
+
version: "$MODEL_VERSION_PLACEHOLDER$",
|
|
93
|
+
supportGuestAccess: !1
|
|
94
|
+
}, ACTION_DEFAULTS = { isMenuAction: !1 }, ACTION_DEFINITION_DEFAULTS = { isTransient: !1 }, CONFIRMATION_DEFAULTS = { confirmationType: ConfirmationType.NONE }, CLASS_TYPE_DEFAULTS = {
|
|
95
|
+
isMapped: !0,
|
|
96
|
+
isPrincipal: !1,
|
|
97
|
+
isActor: !1,
|
|
98
|
+
isOptional: !1,
|
|
99
|
+
isForCreateOrUpdateType: !1,
|
|
100
|
+
packageNameTokens: []
|
|
101
|
+
}, RELATION_TYPE_DEFAULTS = {
|
|
102
|
+
relationKind: RelationKind.ASSOCIATION,
|
|
103
|
+
memberType: MemberType.STORED,
|
|
104
|
+
isAccess: !1,
|
|
105
|
+
isReadOnly: !1,
|
|
106
|
+
isCollection: !0,
|
|
107
|
+
isOptional: !0,
|
|
108
|
+
isOrderable: !1
|
|
109
|
+
}, ATTRIBUTE_TYPE_DEFAULTS = {
|
|
110
|
+
memberType: MemberType.STORED,
|
|
111
|
+
isReadOnly: !0,
|
|
112
|
+
isProfilePicture: !1
|
|
113
|
+
}, OPERATION_TYPE_DEFAULTS = {
|
|
114
|
+
operationType: OperationTypeEnum.MAPPED,
|
|
115
|
+
isStateful: !0
|
|
116
|
+
}, REFERENCE_TYPE_DEFAULTS = {
|
|
117
|
+
isCollection: !0,
|
|
118
|
+
isOptional: !0,
|
|
119
|
+
isOrderable: !1
|
|
120
|
+
}, BINARY_TYPE_DEFAULTS = { maxFileSize: 0 }, TYPE_DEFAULTS_MAP = {
|
|
121
|
+
Flex: FLEX_DEFAULTS,
|
|
122
|
+
PageContainer: PAGE_CONTAINER_DEFAULTS,
|
|
123
|
+
TabController: TAB_CONTROLLER_DEFAULTS,
|
|
124
|
+
Table: TABLE_DEFAULTS,
|
|
125
|
+
Column: COLUMN_DEFAULTS,
|
|
126
|
+
Filter: FILTER_DEFAULTS,
|
|
127
|
+
Link: LINK_DEFAULTS,
|
|
128
|
+
TextInput: TEXT_INPUT_DEFAULTS,
|
|
129
|
+
TextArea: TEXT_AREA_DEFAULTS,
|
|
130
|
+
NumericInput: NUMERIC_INPUT_DEFAULTS,
|
|
131
|
+
DateInput: INPUT_DEFAULTS,
|
|
132
|
+
DateTimeInput: DATE_TIME_INPUT_DEFAULTS,
|
|
133
|
+
TimeInput: TIME_INPUT_DEFAULTS,
|
|
134
|
+
Checkbox: CHECKBOX_DEFAULTS,
|
|
135
|
+
Switch: SWITCH_DEFAULTS,
|
|
136
|
+
EnumerationCombo: INPUT_DEFAULTS,
|
|
137
|
+
EnumerationRadio: INPUT_DEFAULTS,
|
|
138
|
+
EnumerationToggleButtonbar: INPUT_DEFAULTS,
|
|
139
|
+
TrinaryLogicCombo: INPUT_DEFAULTS,
|
|
140
|
+
BinaryTypeInput: INPUT_DEFAULTS,
|
|
141
|
+
PasswordInput: INPUT_DEFAULTS,
|
|
142
|
+
Spacer: VISUAL_ELEMENT_DEFAULTS,
|
|
143
|
+
Divider: VISUAL_ELEMENT_DEFAULTS,
|
|
144
|
+
Text: VISUAL_ELEMENT_DEFAULTS,
|
|
145
|
+
Label: VISUAL_ELEMENT_DEFAULTS,
|
|
146
|
+
Formatted: VISUAL_ELEMENT_DEFAULTS,
|
|
147
|
+
IconImage: VISUAL_ELEMENT_DEFAULTS,
|
|
148
|
+
Button: VISUAL_ELEMENT_DEFAULTS,
|
|
149
|
+
ButtonGroup: BUTTON_GROUP_DEFAULTS,
|
|
150
|
+
Application: APPLICATION_DEFAULTS,
|
|
151
|
+
Option: OPTION_DEFAULTS,
|
|
152
|
+
ClassType: CLASS_TYPE_DEFAULTS,
|
|
153
|
+
RelationType: RELATION_TYPE_DEFAULTS,
|
|
154
|
+
AttributeType: ATTRIBUTE_TYPE_DEFAULTS,
|
|
155
|
+
OperationType: OPERATION_TYPE_DEFAULTS,
|
|
156
|
+
OperationParameterType: REFERENCE_TYPE_DEFAULTS,
|
|
157
|
+
"data:ClassType": CLASS_TYPE_DEFAULTS,
|
|
158
|
+
"data:RelationType": RELATION_TYPE_DEFAULTS,
|
|
159
|
+
"data:AttributeType": ATTRIBUTE_TYPE_DEFAULTS,
|
|
160
|
+
"data:OperationType": OPERATION_TYPE_DEFAULTS,
|
|
161
|
+
"data:OperationParameterType": REFERENCE_TYPE_DEFAULTS,
|
|
162
|
+
"data:BinaryType": BINARY_TYPE_DEFAULTS
|
|
163
|
+
}, PROPERTY_DEFAULTS_MAP = {
|
|
164
|
+
size: SIZE_DEFAULTS,
|
|
165
|
+
sizeConstraint: SIZE_CONSTRAINT_DEFAULTS,
|
|
166
|
+
sizeconstraint: SIZE_CONSTRAINT_DEFAULTS,
|
|
167
|
+
frame: FRAME_DEFAULTS,
|
|
168
|
+
confirmation: CONFIRMATION_DEFAULTS
|
|
169
|
+
};
|
|
170
|
+
function applyTypeDefaults(b, Y) {
|
|
171
|
+
let X = TYPE_DEFAULTS_MAP[Y];
|
|
172
|
+
if (!X) return b;
|
|
173
|
+
for (let [Y, Z] of Object.entries(X)) b[Y] === void 0 && (b[Y] = Z);
|
|
174
|
+
return b;
|
|
175
|
+
}
|
|
176
|
+
function applyPropertyDefaults(b, Y) {
|
|
177
|
+
let X = PROPERTY_DEFAULTS_MAP[Y.toLowerCase()];
|
|
178
|
+
if (!X) return b;
|
|
179
|
+
for (let [Y, Z] of Object.entries(X)) b[Y] === void 0 && (b[Y] = Z);
|
|
180
|
+
return b;
|
|
181
|
+
}
|
|
182
|
+
function applyActionDefinitionDefaults(b) {
|
|
183
|
+
for (let [Y, X] of Object.entries(ACTION_DEFINITION_DEFAULTS)) b[Y] === void 0 && (b[Y] = X);
|
|
184
|
+
return b;
|
|
185
|
+
}
|
|
186
|
+
function applyPageDefinitionDefaults(b) {
|
|
187
|
+
for (let [Y, X] of Object.entries(PAGE_DEFINITION_DEFAULTS)) b[Y] === void 0 && (b[Y] = X);
|
|
188
|
+
return b;
|
|
189
|
+
}
|
|
190
|
+
function applyActionDefaults(b) {
|
|
191
|
+
for (let [Y, X] of Object.entries(ACTION_DEFAULTS)) b[Y] === void 0 && (b[Y] = X);
|
|
192
|
+
return b;
|
|
193
|
+
}
|
|
194
|
+
var ReferenceResolver = class {
|
|
195
|
+
index = /* @__PURE__ */ new Map();
|
|
196
|
+
indexElement(b) {
|
|
197
|
+
let Y = b["xmi:id"];
|
|
198
|
+
Y && this.index.set(Y, b);
|
|
199
|
+
}
|
|
200
|
+
resolve(b) {
|
|
201
|
+
return this.index.get(b);
|
|
202
|
+
}
|
|
203
|
+
getIndex() {
|
|
204
|
+
return this.index;
|
|
205
|
+
}
|
|
206
|
+
clear() {
|
|
207
|
+
this.index.clear();
|
|
208
|
+
}
|
|
209
|
+
indexTree(b) {
|
|
210
|
+
if (!b || typeof b != "object") return;
|
|
211
|
+
if (Array.isArray(b)) {
|
|
212
|
+
for (let Y of b) this.indexTree(Y);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
let Y = b;
|
|
216
|
+
this.indexElement(Y);
|
|
217
|
+
for (let [b, X] of Object.entries(Y)) b !== "eContainer" && X && typeof X == "object" && this.indexTree(X);
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
const TYPE_MAP = {
|
|
221
|
+
"ui:Flex": "Flex",
|
|
222
|
+
"ui:PageContainer": "PageContainer",
|
|
223
|
+
"ui:TabController": "TabController",
|
|
224
|
+
"ui:Tab": "Tab",
|
|
225
|
+
"ui:Table": "Table",
|
|
226
|
+
"ui:Column": "Column",
|
|
227
|
+
"ui:Filter": "Filter",
|
|
228
|
+
"ui:Link": "Link",
|
|
229
|
+
"ui:Text": "Text",
|
|
230
|
+
"ui:Label": "Label",
|
|
231
|
+
"ui:Formatted": "Formatted",
|
|
232
|
+
"ui:IconImage": "IconImage",
|
|
233
|
+
"ui:Divider": "Divider",
|
|
234
|
+
"ui:Spacer": "Spacer",
|
|
235
|
+
"ui:TextInput": "TextInput",
|
|
236
|
+
"ui:TextArea": "TextArea",
|
|
237
|
+
"ui:NumericInput": "NumericInput",
|
|
238
|
+
"ui:DateInput": "DateInput",
|
|
239
|
+
"ui:DateTimeInput": "DateTimeInput",
|
|
240
|
+
"ui:TimeInput": "TimeInput",
|
|
241
|
+
"ui:Checkbox": "Checkbox",
|
|
242
|
+
"ui:Switch": "Switch",
|
|
243
|
+
"ui:EnumerationCombo": "EnumerationCombo",
|
|
244
|
+
"ui:EnumerationRadio": "EnumerationRadio",
|
|
245
|
+
"ui:EnumerationToggleButtonbar": "EnumerationToggleButtonbar",
|
|
246
|
+
"ui:TrinaryLogicCombo": "TrinaryLogicCombo",
|
|
247
|
+
"ui:BinaryTypeInput": "BinaryTypeInput",
|
|
248
|
+
"ui:PasswordInput": "PasswordInput",
|
|
249
|
+
"ui:Button": "Button",
|
|
250
|
+
"ui:ButtonGroup": "ButtonGroup",
|
|
251
|
+
"ui:BackActionDefinition": "BackActionDefinition",
|
|
252
|
+
"ui:OpenPageActionDefinition": "OpenPageActionDefinition",
|
|
253
|
+
"ui:RowOpenPageActionDefinition": "RowOpenPageActionDefinition",
|
|
254
|
+
"ui:OpenFormActionDefinition": "OpenFormActionDefinition",
|
|
255
|
+
"ui:OpenCreateFormActionDefinition": "OpenCreateFormActionDefinition",
|
|
256
|
+
"ui:OpenOperationInputFormActionDefinition": "OpenOperationInputFormActionDefinition",
|
|
257
|
+
"ui:OpenSelectorActionDefinition": "OpenSelectorActionDefinition",
|
|
258
|
+
"ui:OpenAddSelectorActionDefinition": "OpenAddSelectorActionDefinition",
|
|
259
|
+
"ui:OpenSetSelectorActionDefinition": "OpenSetSelectorActionDefinition",
|
|
260
|
+
"ui:OpenOperationInputSelectorActionDefinition": "OpenOperationInputSelectorActionDefinition",
|
|
261
|
+
"ui:SelectorRangeActionDefinition": "SelectorRangeActionDefinition",
|
|
262
|
+
"ui:RefreshActionDefinition": "RefreshActionDefinition",
|
|
263
|
+
"ui:CreateActionDefinition": "CreateActionDefinition",
|
|
264
|
+
"ui:UpdateActionDefinition": "UpdateActionDefinition",
|
|
265
|
+
"ui:DeleteActionDefinition": "DeleteActionDefinition",
|
|
266
|
+
"ui:BulkDeleteActionDefinition": "BulkDeleteActionDefinition",
|
|
267
|
+
"ui:RowDeleteActionDefinition": "RowDeleteActionDefinition",
|
|
268
|
+
"ui:GetTemplateActionDefinition": "GetTemplateActionDefinition",
|
|
269
|
+
"ui:SetActionDefinition": "SetActionDefinition",
|
|
270
|
+
"ui:UnsetActionDefinition": "UnsetActionDefinition",
|
|
271
|
+
"ui:AddActionDefinition": "AddActionDefinition",
|
|
272
|
+
"ui:RemoveActionDefinition": "RemoveActionDefinition",
|
|
273
|
+
"ui:BulkRemoveActionDefinition": "BulkRemoveActionDefinition",
|
|
274
|
+
"ui:ClearActionDefinition": "ClearActionDefinition",
|
|
275
|
+
"ui:RefreshRelationActionDefinition": "RefreshRelationActionDefinition",
|
|
276
|
+
"ui:FilterRelationActionDefinition": "FilterRelationActionDefinition",
|
|
277
|
+
"ui:FilterActionDefinition": "FilterActionDefinition",
|
|
278
|
+
"ui:ExportActionDefinition": "ExportActionDefinition",
|
|
279
|
+
"ui:InlineCreateRowActionDefinition": "InlineCreateRowActionDefinition",
|
|
280
|
+
"ui:CallOperationActionDefinition": "CallOperationActionDefinition",
|
|
281
|
+
"ui:BulkCallOperationActionDefinition": "BulkCallOperationActionDefinition",
|
|
282
|
+
"ui:InputFormCallOperationActionDefinition": "InputFormCallOperationActionDefinition",
|
|
283
|
+
"ui:InputSelectorCallOperationActionDefinition": "InputSelectorCallOperationActionDefinition",
|
|
284
|
+
"ui:ParameterlessCallOperationActionDefinition": "ParameterlessCallOperationActionDefinition",
|
|
285
|
+
"ui:AutocompleteRangeActionDefinition": "AutocompleteRangeActionDefinition",
|
|
286
|
+
"ui:AutocompleteSetActionDefinition": "AutocompleteSetActionDefinition",
|
|
287
|
+
"ui:AutocompleteAddActionDefinition": "AutocompleteAddActionDefinition",
|
|
288
|
+
"ui:PreFetchActionDefinition": "PreFetchActionDefinition",
|
|
289
|
+
"ui:CancelActionDefinition": "CancelActionDefinition",
|
|
290
|
+
"ui:CustomActionDefinition": "CustomActionDefinition",
|
|
291
|
+
"data:ClassType": "ClassType",
|
|
292
|
+
"data:RelationType": "RelationType",
|
|
293
|
+
"data:AttributeType": "AttributeType",
|
|
294
|
+
"data:OperationType": "OperationType",
|
|
295
|
+
"data:OperationParameterType": "OperationParameterType",
|
|
296
|
+
"data:ApplicationType": "ApplicationType",
|
|
297
|
+
"data:StringType": "StringType",
|
|
298
|
+
"data:NumericType": "NumericType",
|
|
299
|
+
"data:BooleanType": "BooleanType",
|
|
300
|
+
"data:DateType": "DateType",
|
|
301
|
+
"data:TimeType": "TimeType",
|
|
302
|
+
"data:TimestampType": "TimestampType",
|
|
303
|
+
"data:EnumerationType": "EnumerationType",
|
|
304
|
+
"data:BinaryType": "BinaryType",
|
|
305
|
+
"data:PasswordType": "PasswordType"
|
|
306
|
+
};
|
|
307
|
+
function discriminateType(b) {
|
|
308
|
+
let Y = b["xsi:type"];
|
|
309
|
+
if (Y && TYPE_MAP[Y]) return TYPE_MAP[Y];
|
|
310
|
+
if (Y) {
|
|
311
|
+
let b = Y.split(":");
|
|
312
|
+
return b.length > 1 ? b[1] : Y;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
function inferTypeFromTag(b) {
|
|
316
|
+
return {
|
|
317
|
+
navigationController: "NavigationController",
|
|
318
|
+
items: "NavigationItem",
|
|
319
|
+
pages: "PageDefinition",
|
|
320
|
+
pageContainers: "PageContainer",
|
|
321
|
+
dataElements: "DataElement",
|
|
322
|
+
dataTypes: "DataType",
|
|
323
|
+
children: "VisualElement",
|
|
324
|
+
columns: "Column",
|
|
325
|
+
filters: "Filter",
|
|
326
|
+
buttons: "Button",
|
|
327
|
+
actions: "Action",
|
|
328
|
+
tabs: "Tab",
|
|
329
|
+
attributes: "AttributeType",
|
|
330
|
+
relations: "RelationType",
|
|
331
|
+
operations: "OperationType",
|
|
332
|
+
claims: "Claim",
|
|
333
|
+
members: "EnumerationMember",
|
|
334
|
+
options: "Option",
|
|
335
|
+
parts: "Column"
|
|
336
|
+
}[b];
|
|
337
|
+
}
|
|
338
|
+
var ARRAY_TAGS = new Set([
|
|
339
|
+
"pages",
|
|
340
|
+
"pageContainers",
|
|
341
|
+
"dataElements",
|
|
342
|
+
"dataTypes",
|
|
343
|
+
"mimeTypes",
|
|
344
|
+
"availableAnnotations",
|
|
345
|
+
"items",
|
|
346
|
+
"actions",
|
|
347
|
+
"children",
|
|
348
|
+
"actionButtonGroups",
|
|
349
|
+
"tabs",
|
|
350
|
+
"columns",
|
|
351
|
+
"filters",
|
|
352
|
+
"buttons",
|
|
353
|
+
"attributes",
|
|
354
|
+
"relations",
|
|
355
|
+
"operations",
|
|
356
|
+
"members",
|
|
357
|
+
"parts",
|
|
358
|
+
"faults",
|
|
359
|
+
"annotations",
|
|
360
|
+
"behaviours",
|
|
361
|
+
"claims",
|
|
362
|
+
"packageNameTokens",
|
|
363
|
+
"ui:Application"
|
|
364
|
+
]), cachedParser = new XMLParser({
|
|
365
|
+
ignoreAttributes: !1,
|
|
366
|
+
attributeNamePrefix: "",
|
|
367
|
+
attributesGroupName: !1,
|
|
368
|
+
isArray: (b) => ARRAY_TAGS.has(b),
|
|
369
|
+
parseAttributeValue: !1,
|
|
370
|
+
trimValues: !0
|
|
371
|
+
});
|
|
372
|
+
function getParser() {
|
|
373
|
+
return cachedParser;
|
|
374
|
+
}
|
|
375
|
+
var BOOLEAN_PROPERTIES = new Set(/* @__PURE__ */ "isEager.isSmallTable.allowSelectMultiple.showTotalCount.isInlineEditable.required.countCharacters.formatValue.isTypeAheadField.isMultiLine.checked.switched.selected.openInDialog.dashboard.generateActionsHook.isSelector.isRelationSelector.supportGuestAccess.isBulk.autoOpenAfterCreate.isMenuAction.autoCloseOnSave.isContainedRelationAction.isTransient.isInlineCreatable.isProfilePicture.isRequired.isReadOnly.isFilterable.isOptional.isCollection.isOrderable.isMapped.isPrincipal.isActor.isForCreateOrUpdateType.isStateful.alwaysShown.range.multiValue.customImplementation.onBlur.isInCard.isAccess".split(".")), NUMERIC_PROPERTIES = new Set([
|
|
376
|
+
"maxLength",
|
|
377
|
+
"precision",
|
|
378
|
+
"scale",
|
|
379
|
+
"maxFileSize",
|
|
380
|
+
"rowsPerPage",
|
|
381
|
+
"selectorRowsPerPage",
|
|
382
|
+
"actionColumnWidth",
|
|
383
|
+
"width",
|
|
384
|
+
"minWidth",
|
|
385
|
+
"maxWidth",
|
|
386
|
+
"height",
|
|
387
|
+
"minHeight",
|
|
388
|
+
"maxHeight",
|
|
389
|
+
"sortPrecedence",
|
|
390
|
+
"ordinal",
|
|
391
|
+
"featuredActions"
|
|
392
|
+
]);
|
|
393
|
+
function coerceNumericProperties(b) {
|
|
394
|
+
for (let Y of NUMERIC_PROPERTIES) {
|
|
395
|
+
let X = b[Y];
|
|
396
|
+
if (typeof X == "string") {
|
|
397
|
+
let Z = Number(X);
|
|
398
|
+
Number.isNaN(Z) || (b[Y] = Z);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
function coerceBooleanProperties(b) {
|
|
403
|
+
for (let Y of BOOLEAN_PROPERTIES) {
|
|
404
|
+
let X = b[Y];
|
|
405
|
+
typeof X == "string" && (b[Y] = X === "true");
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
var PROPERTY_DEFAULT_KEYS = new Set([
|
|
409
|
+
"size",
|
|
410
|
+
"sizeConstraint",
|
|
411
|
+
"sizeconstraint",
|
|
412
|
+
"frame",
|
|
413
|
+
"confirmation"
|
|
414
|
+
]), ACTION_DEFINITION_KEYS = new Set([
|
|
415
|
+
"actionDefinition",
|
|
416
|
+
"templateAction",
|
|
417
|
+
"onInit",
|
|
418
|
+
"autocompleteRangeActionDefinition",
|
|
419
|
+
"autocompleteAddActionDefinition",
|
|
420
|
+
"autocompleteSetActionDefinition",
|
|
421
|
+
"refreshActionDefinition",
|
|
422
|
+
"preFetchActionDefinition"
|
|
423
|
+
]);
|
|
424
|
+
function transformElement(b, Y) {
|
|
425
|
+
if (!b || typeof b != "object") return b;
|
|
426
|
+
let X = b["xsi:type"], Z;
|
|
427
|
+
if (X) Z = discriminateType(b), b["@type"] = Z, b["xsi:type"] = void 0;
|
|
428
|
+
else if (Y) {
|
|
429
|
+
let X = inferTypeFromTag(Y);
|
|
430
|
+
X && (Z = X, b["@type"] = X);
|
|
431
|
+
}
|
|
432
|
+
for (let [Y, X] of Object.entries(b)) if (Y !== "eContainer") if (Array.isArray(X)) for (let Z = 0; Z < X.length; Z++) {
|
|
433
|
+
let Q = X[Z];
|
|
434
|
+
Q && typeof Q == "object" && (Q.eContainer = b, transformElement(Q, Y));
|
|
435
|
+
}
|
|
436
|
+
else X && typeof X == "object" && (X.eContainer = b, transformElement(X, Y), PROPERTY_DEFAULT_KEYS.has(Y) && applyPropertyDefaults(X, Y), ACTION_DEFINITION_KEYS.has(Y) && applyActionDefinitionDefaults(X));
|
|
437
|
+
return coerceNumericProperties(b), coerceBooleanProperties(b), Z && applyTypeDefaults(b, Z), Y === "pages" && applyPageDefinitionDefaults(b), Y === "actions" && applyActionDefaults(b), Y === "ui:Application" && applyTypeDefaults(b, "Application"), b;
|
|
438
|
+
}
|
|
439
|
+
function extractApplications(b) {
|
|
440
|
+
let Y = b["xmi:XMI"];
|
|
441
|
+
if (Y) {
|
|
442
|
+
let b = Y["ui:Application"];
|
|
443
|
+
if (!b) throw new ModelParseError("Invalid XMI: missing ui:Application element", "/xmi:XMI");
|
|
444
|
+
return (Array.isArray(b) ? b : [b]).map((b) => transformElement(b, "ui:Application"));
|
|
445
|
+
}
|
|
446
|
+
let X = b["ui:Application"];
|
|
447
|
+
if (X) return [transformElement(Array.isArray(X) ? X[0] : X, "ui:Application")];
|
|
448
|
+
throw new ModelParseError("Invalid XMI: missing xmi:XMI or ui:Application root element", "/");
|
|
449
|
+
}
|
|
450
|
+
function parseModel(b) {
|
|
451
|
+
return extractApplications(getParser().parse(b));
|
|
452
|
+
}
|
|
453
|
+
function parseModelWithOptions(b, Y = {}) {
|
|
454
|
+
let X = extractApplications(getParser().parse(b)), Z = new ReferenceResolver();
|
|
455
|
+
for (let b of X) Z.indexTree(b);
|
|
456
|
+
let Q = [];
|
|
457
|
+
if (Y.validateReferences) {
|
|
458
|
+
let b = validateReferences(X, Z);
|
|
459
|
+
Q.push(...b);
|
|
460
|
+
}
|
|
461
|
+
return {
|
|
462
|
+
applications: X,
|
|
463
|
+
elementIndex: Z.getIndex(),
|
|
464
|
+
errors: Q
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
function validateReferences(b, Y) {
|
|
468
|
+
let X = [], Z = [
|
|
469
|
+
"target",
|
|
470
|
+
"targetPageDefinition",
|
|
471
|
+
"targetType",
|
|
472
|
+
"dataElement",
|
|
473
|
+
"attributeType",
|
|
474
|
+
"relationType",
|
|
475
|
+
"operationType",
|
|
476
|
+
"owner",
|
|
477
|
+
"dataType",
|
|
478
|
+
"enumeration"
|
|
479
|
+
];
|
|
480
|
+
function Q(b, Y) {
|
|
481
|
+
if (!b || typeof b != "object") return;
|
|
482
|
+
if (Array.isArray(b)) {
|
|
483
|
+
b.forEach((b, X) => {
|
|
484
|
+
Q(b, `${Y}[${X}]`);
|
|
485
|
+
});
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
let X = b;
|
|
489
|
+
for (let b of Z) {
|
|
490
|
+
let Y = X[b];
|
|
491
|
+
typeof Y == "string" && Y.includes("/");
|
|
492
|
+
}
|
|
493
|
+
for (let [b, Z] of Object.entries(X)) b !== "eContainer" && Z && typeof Z == "object" && Q(Z, `${Y}/${b}`);
|
|
494
|
+
}
|
|
495
|
+
for (let Y = 0; Y < b.length; Y++) Q(b[Y], `/ui:Application[${Y}]`);
|
|
496
|
+
return X;
|
|
497
|
+
}
|
|
498
|
+
var ModelParseError = class extends Error {
|
|
499
|
+
constructor(b, Y, X) {
|
|
500
|
+
super(`Parse error at ${Y}: ${b}`), this.path = Y, this.cause = X, this.name = "ModelParseError";
|
|
501
|
+
}
|
|
502
|
+
}, ModelReferenceError = class extends Error {
|
|
503
|
+
constructor(b, Y) {
|
|
504
|
+
super(`Unresolved reference: ${b} -> ${Y}`), this.sourceId = b, this.targetRef = Y, this.name = "ModelReferenceError";
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
function buildContainmentTree(b) {
|
|
508
|
+
let Y = b.children;
|
|
509
|
+
return !Y || !Array.isArray(Y) ? [] : Y.map((b) => processVisualElement(b));
|
|
510
|
+
}
|
|
511
|
+
function processVisualElement(b) {
|
|
512
|
+
let Y = { ...b };
|
|
513
|
+
return b.children && Array.isArray(b.children) && (Y.children = b.children.map((b) => processVisualElement(b))), b.tabs && Array.isArray(b.tabs) && (Y.tabs = b.tabs.map((b) => b.element ? {
|
|
514
|
+
...b,
|
|
515
|
+
element: processVisualElement(b.element)
|
|
516
|
+
} : b)), b.columns && Array.isArray(b.columns) && (Y.columns = b.columns), b.filters && Array.isArray(b.filters) && (Y.filters = b.filters), b.tableActionButtonGroup && typeof b.tableActionButtonGroup == "object" && (Y.tableActionButtonGroup = processVisualElement(b.tableActionButtonGroup)), b.rowActionButtonGroup && typeof b.rowActionButtonGroup == "object" && (Y.rowActionButtonGroup = processVisualElement(b.rowActionButtonGroup)), b.buttons && Array.isArray(b.buttons) && (Y.buttons = b.buttons), b.parts && Array.isArray(b.parts) && (Y.parts = b.parts.map((b) => processVisualElement(b))), Y;
|
|
517
|
+
}
|
|
518
|
+
function attachParentReferences(b, Y) {
|
|
519
|
+
let X = b;
|
|
520
|
+
Y && (X.__parent = Y);
|
|
521
|
+
let Z = X.children;
|
|
522
|
+
if (Z && Array.isArray(Z)) for (let Y of Z) attachParentReferences(Y, b);
|
|
523
|
+
let Q = X.tabs;
|
|
524
|
+
if (Q && Array.isArray(Q)) for (let Y of Q) Y.element && attachParentReferences(Y.element, b);
|
|
525
|
+
let $ = X.parts;
|
|
526
|
+
if ($ && Array.isArray($)) for (let Y of $) attachParentReferences(Y, b);
|
|
527
|
+
}
|
|
528
|
+
function getParent(b) {
|
|
529
|
+
return b.__parent;
|
|
530
|
+
}
|
|
531
|
+
export { ACTION_DEFAULTS, ACTION_DEFINITION_DEFAULTS, APPLICATION_DEFAULTS, ATTRIBUTE_TYPE_DEFAULTS, BINARY_TYPE_DEFAULTS, BUTTON_GROUP_DEFAULTS, CHECKBOX_DEFAULTS, CLASS_TYPE_DEFAULTS, COLUMN_DEFAULTS, CONFIRMATION_DEFAULTS, DATE_TIME_INPUT_DEFAULTS, FILTER_DEFAULTS, FLEX_DEFAULTS, FRAME_DEFAULTS, INPUT_DEFAULTS, LINK_DEFAULTS, ModelParseError, ModelReferenceError, NUMERIC_INPUT_DEFAULTS, OPERATION_TYPE_DEFAULTS, OPTION_DEFAULTS, PAGE_CONTAINER_DEFAULTS, PAGE_DEFINITION_DEFAULTS, PROPERTY_DEFAULTS_MAP, REFERENCE_TYPE_DEFAULTS, RELATION_TYPE_DEFAULTS, ReferenceResolver, SIZE_CONSTRAINT_DEFAULTS, SIZE_DEFAULTS, SWITCH_DEFAULTS, TABLE_DEFAULTS, TAB_CONTROLLER_DEFAULTS, TEXT_AREA_DEFAULTS, TEXT_INPUT_DEFAULTS, TIME_INPUT_DEFAULTS, TYPE_DEFAULTS_MAP, TYPE_MAP, VISUAL_ELEMENT_DEFAULTS, applyActionDefaults, applyActionDefinitionDefaults, applyPageDefinitionDefaults, applyPropertyDefaults, applyTypeDefaults, attachParentReferences, buildContainmentTree, discriminateType, getParent, inferTypeFromTag, parseModel, parseModelWithOptions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["TYPE_DEFAULTS_MAP: Record<string, Record<string, unknown>>","PROPERTY_DEFAULTS_MAP: Record<string, Record<string, unknown>>","TYPE_MAP: Record<string, string>","tagMap: Record<string, string>","elementType: string | undefined","errors: ParseError[]","path: string","cause?: Error","sourceId: string","targetRef: string","result: Record<string, unknown>"],"sources":["../src/emf-defaults.ts","../src/reference-resolver.ts","../src/type-discriminator.ts","../src/parser.ts","../src/containment-builder.ts"],"sourcesContent":["/**\n * EMF Default Values Module\n *\n * EMF models do not serialize attributes when their values equal the default.\n * This module defines all default values from the ui.ecore meta-model to ensure\n * the runtime has explicit values for all properties.\n *\n * Source: meta-model/ui.ecore (defaultValueLiteral attributes)\n *\n * @module emf-defaults\n */\n\nimport {\n\tAxis,\n\tCheckboxSelection,\n\tConfirmationType,\n\tCrossAxisAlignment,\n\tDurationUnit,\n\tFit,\n\tMainAxisAlignment,\n\tMainAxisSize,\n\tMemberType,\n\tOperationTypeEnum,\n\tPageContainerType,\n\tPlacement,\n\tRelationKind,\n\tSort,\n\tStretch,\n\tTableRepresentation,\n} from \"@judo/model-api\";\n\n// ============================================\n// TYPE-SPECIFIC DEFAULT VALUE MAPS\n// ============================================\n\n/**\n * Default values for VisualElement properties.\n * Maps to: ui:VisualElement\n */\nexport const VISUAL_ELEMENT_DEFAULTS = {\n\t/** Default column span - 4 columns */\n\tcol: 4,\n\t/** Default row span - 1 row */\n\trow: 1,\n\t/** Default fit behavior */\n\tfit: Fit.NONE,\n\t/** Default stretch behavior */\n\tstretch: Stretch.NONE,\n\t/** Not disabled by default */\n\tdisabled: false,\n\t/** Not in card by default */\n\tisInCard: false,\n\t/** Not read-only by default */\n\tisReadOnly: false,\n} as const;\n\n/**\n * Default values for Flex container.\n * Maps to: ui:Flex\n *\n * Note: Flex inherits from Container which inherits from VisualElement.\n * direction, mainAxisAlignment, and mainAxisSize use EMF first enum literal defaults.\n */\nexport const FLEX_DEFAULTS = {\n\t...VISUAL_ELEMENT_DEFAULTS,\n\t/** EMF default is first enum literal: HORIZONTAL */\n\tdirection: Axis.HORIZONTAL,\n\t/** EMF default is first enum literal: CENTER */\n\tmainAxisAlignment: MainAxisAlignment.CENTER,\n\t/** Explicit default: START (from meta-model) */\n\tcrossAxisAlignment: CrossAxisAlignment.START,\n\t/** EMF default is first enum literal: MIN */\n\tmainAxisSize: MainAxisSize.MIN,\n} as const;\n\n/**\n * Default values for PageContainer.\n * Maps to: ui:PageContainer\n */\nexport const PAGE_CONTAINER_DEFAULTS = {\n\t...FLEX_DEFAULTS,\n\t/** EMF default is first enum literal: TABLE */\n\ttype: PageContainerType.TABLE,\n\t/** Not generating visual properties hook by default */\n\tgenerateVisualPropertiesHook: false,\n} as const;\n\n/**\n * Default values for Size.\n * Maps to: ui:Size\n */\nexport const SIZE_DEFAULTS = {\n\t/** -1 means unset/auto */\n\twidth: -1,\n\t/** -1 means unset/auto */\n\theight: -1,\n} as const;\n\n/**\n * Default values for SizeConstraint.\n * Maps to: ui:SizeConstraint\n */\nexport const SIZE_CONSTRAINT_DEFAULTS = {\n\t/** -1 means no minimum */\n\tminWidth: -1,\n\t/** -1 means no minimum */\n\tminHeight: -1,\n\t/** -1 means no maximum */\n\tmaxWidth: -1,\n\t/** -1 means no maximum */\n\tmaxHeight: -1,\n} as const;\n\n/**\n * Default values for Frame.\n * Maps to: ui:Frame\n */\nexport const FRAME_DEFAULTS = {\n\t/** Default elevation */\n\televation: 4,\n\t/** Default border radius */\n\tradius: 10.0,\n} as const;\n\n/**\n * Default values for TabController.\n * Maps to: ui:TabController\n */\nexport const TAB_CONTROLLER_DEFAULTS = {\n\t...VISUAL_ELEMENT_DEFAULTS,\n\t/** Default controller row */\n\tcontrollerRow: 1,\n} as const;\n\n/**\n * Default values for Table.\n * Maps to: ui:Table\n */\nexport const TABLE_DEFAULTS = {\n\t...VISUAL_ELEMENT_DEFAULTS,\n\t/** Default CRUD operations displayed count */\n\tcrudOperationsDisplayed: 2,\n\t/** Not a small table by default */\n\tisSmallTable: false,\n\t/** Default rows per page */\n\trowsPerPage: 10,\n\t/** Not eager loading by default */\n\tisEager: false,\n\t/** Single selection by default */\n\tallowSelectMultiple: false,\n\t/** Default transfer operations displayed count */\n\ttransferOperationsDisplayed: 0,\n\t/** Don't show total count by default */\n\tshowTotalCount: false,\n\t/** Checkbox selection enabled by default */\n\tcheckboxSelection: CheckboxSelection.ENABLED,\n\t/** Default representation is TABLE */\n\trepresentationComponent: TableRepresentation.TABLE,\n} as const;\n\n/**\n * Default values for Column.\n * Maps to: ui:Column\n */\nexport const COLUMN_DEFAULTS = {\n\t...VISUAL_ELEMENT_DEFAULTS,\n\t/** No sorting by default */\n\tsort: Sort.NONE,\n\t/** Default sort precedence */\n\tsortPrecedence: 0,\n\t/** Format numeric values by default */\n\tformatValue: true,\n} as const;\n\n/**\n * Default values for Filter.\n * Maps to: ui:Filter\n */\nexport const FILTER_DEFAULTS = {\n\t...VISUAL_ELEMENT_DEFAULTS,\n\t/** Not always shown by default */\n\talwaysShown: false,\n\t/** Not a range filter by default */\n\trange: false,\n\t/** Not multi-value by default */\n\tmultiValue: false,\n} as const;\n\n/**\n * Default values for Link.\n * Maps to: ui:Link\n */\nexport const LINK_DEFAULTS = {\n\t...VISUAL_ELEMENT_DEFAULTS,\n\t/** Not eager loading by default */\n\tisEager: false,\n} as const;\n\n/**\n * Default values for Input (abstract base).\n * Maps to: ui:Input\n */\nexport const INPUT_DEFAULTS = {\n\t...VISUAL_ELEMENT_DEFAULTS,\n\t/** Not required by default */\n\trequired: false,\n} as const;\n\n/**\n * Default values for TextInput.\n * Maps to: ui:TextInput\n */\nexport const TEXT_INPUT_DEFAULTS = {\n\t...INPUT_DEFAULTS,\n\t/** Not a type-ahead field by default */\n\tisTypeAheadField: false,\n} as const;\n\n/**\n * Default values for TextArea.\n * Maps to: ui:TextArea\n */\nexport const TEXT_AREA_DEFAULTS = {\n\t...INPUT_DEFAULTS,\n\t/** Single line by default */\n\tlines: 1,\n} as const;\n\n/**\n * Default values for NumericInput.\n * Maps to: ui:NumericInput\n */\nexport const NUMERIC_INPUT_DEFAULTS = {\n\t...INPUT_DEFAULTS,\n\t/** Format values by default */\n\tformatValue: true,\n} as const;\n\n/**\n * Default values for DateTimeInput.\n * Maps to: ui:DateTimeInput\n */\nexport const DATE_TIME_INPUT_DEFAULTS = {\n\t...INPUT_DEFAULTS,\n\t/** Base unit is SECOND */\n\tbaseUnit: DurationUnit.SECOND,\n} as const;\n\n/**\n * Default values for TimeInput.\n * Maps to: ui:TimeInput\n */\nexport const TIME_INPUT_DEFAULTS = {\n\t...INPUT_DEFAULTS,\n\t/** Base unit is SECOND */\n\tbaseUnit: DurationUnit.SECOND,\n} as const;\n\n/**\n * Default values for Checkbox.\n * Maps to: ui:Checkbox\n */\nexport const CHECKBOX_DEFAULTS = {\n\t...INPUT_DEFAULTS,\n\t/** Not checked by default */\n\tchecked: false,\n\t/** Default label placement */\n\tvalueLabelPlacement: Placement.DEFAULT,\n} as const;\n\n/**\n * Default values for Switch.\n * Maps to: ui:Switch\n */\nexport const SWITCH_DEFAULTS = {\n\t...INPUT_DEFAULTS,\n\t/** Default label placement */\n\tvalueLabelPlacement: Placement.DEFAULT,\n} as const;\n\n/**\n * Default values for Option.\n * Maps to: ui:Option\n */\nexport const OPTION_DEFAULTS = {\n\t/** Not selected by default */\n\tselected: false,\n} as const;\n\n/**\n * Default values for ButtonGroup.\n * Maps to: ui:ButtonGroup\n */\nexport const BUTTON_GROUP_DEFAULTS = {\n\t...VISUAL_ELEMENT_DEFAULTS,\n\t/** No featured actions by default */\n\tfeaturedActions: 0,\n} as const;\n\n/**\n * Default values for PageDefinition.\n * Maps to: ui:PageDefinition\n */\nexport const PAGE_DEFINITION_DEFAULTS = {\n\t/** Not a dashboard by default */\n\tdashboard: false,\n\t/** Don't generate actions hook by default */\n\tgenerateActionsHook: false,\n} as const;\n\n/**\n * Default values for Application.\n * Maps to: ui:Application\n */\nexport const APPLICATION_DEFAULTS = {\n\t/** Default language */\n\tdefaultLanguage: \"en-US\",\n\t/** Version placeholder */\n\tversion: \"$MODEL_VERSION_PLACEHOLDER$\",\n\t/** No guest access by default */\n\tsupportGuestAccess: false,\n} as const;\n\n/**\n * Default values for Action.\n * Maps to: ui:Action\n */\nexport const ACTION_DEFAULTS = {\n\t/** Not a menu action by default */\n\tisMenuAction: false,\n} as const;\n\n/**\n * Default values for ActionDefinition.\n * Maps to: ui:ActionDefinition\n */\nexport const ACTION_DEFINITION_DEFAULTS = {\n\t/** Not transient by default */\n\tisTransient: false,\n} as const;\n\n/**\n * Default values for Confirmation.\n * Maps to: ui:Confirmation\n */\nexport const CONFIRMATION_DEFAULTS = {\n\t/** No confirmation by default */\n\tconfirmationType: ConfirmationType.NONE,\n} as const;\n\n// ============================================\n// DATA PACKAGE DEFAULTS\n// ============================================\n\n/**\n * Default values for ClassType.\n * Maps to: data:ClassType\n */\nexport const CLASS_TYPE_DEFAULTS = {\n\t/** Mapped by default */\n\tisMapped: true,\n\t/** Not a principal by default */\n\tisPrincipal: false,\n\t/** Not an actor by default */\n\tisActor: false,\n\t/** Not optional by default */\n\tisOptional: false,\n\t/** Not for create/update by default */\n\tisForCreateOrUpdateType: false,\n\t/** Empty package tokens by default */\n\tpackageNameTokens: [] as string[],\n};\n\n/**\n * Default values for RelationType.\n * Maps to: data:RelationType\n */\nexport const RELATION_TYPE_DEFAULTS = {\n\t/** Default relation kind */\n\trelationKind: RelationKind.ASSOCIATION,\n\t/** Default member type */\n\tmemberType: MemberType.STORED,\n\t/** Not an access relation by default */\n\tisAccess: false,\n\t/** Not read-only by default */\n\tisReadOnly: false,\n\t/** Is a collection by default */\n\tisCollection: true,\n\t/** Is optional by default */\n\tisOptional: true,\n\t/** Not orderable by default */\n\tisOrderable: false,\n} as const;\n\n/**\n * Default values for AttributeType.\n * Maps to: data:AttributeType\n */\nexport const ATTRIBUTE_TYPE_DEFAULTS = {\n\t/** Default member type */\n\tmemberType: MemberType.STORED,\n\t/** Read-only by default */\n\tisReadOnly: true,\n\t/** Not a profile picture by default */\n\tisProfilePicture: false,\n} as const;\n\n/**\n * Default values for OperationType.\n * Maps to: data:OperationType\n */\nexport const OPERATION_TYPE_DEFAULTS = {\n\t/** Default operation type */\n\toperationType: OperationTypeEnum.MAPPED,\n\t/** Stateful by default */\n\tisStateful: true,\n} as const;\n\n/**\n * Default values for ReferenceType (abstract).\n * Maps to: data:ReferenceType\n */\nexport const REFERENCE_TYPE_DEFAULTS = {\n\t/** Is a collection by default */\n\tisCollection: true,\n\t/** Is optional by default */\n\tisOptional: true,\n\t/** Not orderable by default */\n\tisOrderable: false,\n} as const;\n\n/**\n * Default values for BinaryType.\n * Maps to: data:BinaryType\n */\nexport const BINARY_TYPE_DEFAULTS = {\n\t/** No size limit by default */\n\tmaxFileSize: 0,\n} as const;\n\n// ============================================\n// TYPE TO DEFAULTS MAPPING\n// ============================================\n\n/**\n * Map of @type discriminators to their default value objects.\n * Used by the parser to apply defaults based on element type.\n */\nexport const TYPE_DEFAULTS_MAP: Record<string, Record<string, unknown>> = {\n\t// Visual Elements\n\tFlex: FLEX_DEFAULTS,\n\tPageContainer: PAGE_CONTAINER_DEFAULTS,\n\tTabController: TAB_CONTROLLER_DEFAULTS,\n\tTable: TABLE_DEFAULTS,\n\tColumn: COLUMN_DEFAULTS,\n\tFilter: FILTER_DEFAULTS,\n\tLink: LINK_DEFAULTS,\n\t// Inputs\n\tTextInput: TEXT_INPUT_DEFAULTS,\n\tTextArea: TEXT_AREA_DEFAULTS,\n\tNumericInput: NUMERIC_INPUT_DEFAULTS,\n\tDateInput: INPUT_DEFAULTS,\n\tDateTimeInput: DATE_TIME_INPUT_DEFAULTS,\n\tTimeInput: TIME_INPUT_DEFAULTS,\n\tCheckbox: CHECKBOX_DEFAULTS,\n\tSwitch: SWITCH_DEFAULTS,\n\tEnumerationCombo: INPUT_DEFAULTS,\n\tEnumerationRadio: INPUT_DEFAULTS,\n\tEnumerationToggleButtonbar: INPUT_DEFAULTS,\n\tTrinaryLogicCombo: INPUT_DEFAULTS,\n\tBinaryTypeInput: INPUT_DEFAULTS,\n\tPasswordInput: INPUT_DEFAULTS,\n\t// Other Visual\n\tSpacer: VISUAL_ELEMENT_DEFAULTS,\n\tDivider: VISUAL_ELEMENT_DEFAULTS,\n\tText: VISUAL_ELEMENT_DEFAULTS,\n\tLabel: VISUAL_ELEMENT_DEFAULTS,\n\tFormatted: VISUAL_ELEMENT_DEFAULTS,\n\tIconImage: VISUAL_ELEMENT_DEFAULTS,\n\tButton: VISUAL_ELEMENT_DEFAULTS,\n\tButtonGroup: BUTTON_GROUP_DEFAULTS,\n\t// Structural\n\tApplication: APPLICATION_DEFAULTS,\n\tOption: OPTION_DEFAULTS,\n\t// Data Types\n\tClassType: CLASS_TYPE_DEFAULTS,\n\tRelationType: RELATION_TYPE_DEFAULTS,\n\tAttributeType: ATTRIBUTE_TYPE_DEFAULTS,\n\tOperationType: OPERATION_TYPE_DEFAULTS,\n\tOperationParameterType: REFERENCE_TYPE_DEFAULTS,\n\t\"data:ClassType\": CLASS_TYPE_DEFAULTS,\n\t\"data:RelationType\": RELATION_TYPE_DEFAULTS,\n\t\"data:AttributeType\": ATTRIBUTE_TYPE_DEFAULTS,\n\t\"data:OperationType\": OPERATION_TYPE_DEFAULTS,\n\t\"data:OperationParameterType\": REFERENCE_TYPE_DEFAULTS,\n\t\"data:BinaryType\": BINARY_TYPE_DEFAULTS,\n};\n\n/**\n * Defaults for contained objects (not typed elements).\n * These are applied based on the property name.\n */\nexport const PROPERTY_DEFAULTS_MAP: Record<string, Record<string, unknown>> = {\n\tsize: SIZE_DEFAULTS,\n\tsizeConstraint: SIZE_CONSTRAINT_DEFAULTS,\n\tsizeconstraint: SIZE_CONSTRAINT_DEFAULTS, // Handle both casings\n\tframe: FRAME_DEFAULTS,\n\tconfirmation: CONFIRMATION_DEFAULTS,\n};\n\n// ============================================\n// DEFAULT APPLICATION FUNCTIONS\n// ============================================\n\n/**\n * Apply EMF defaults to an element based on its @type.\n * Only sets values for properties that are undefined.\n *\n * @param element - The element to apply defaults to\n * @param type - The @type discriminator\n * @returns The element with defaults applied (mutated in place for performance)\n */\nexport function applyTypeDefaults(element: Record<string, unknown>, type: string): Record<string, unknown> {\n\tconst defaults = TYPE_DEFAULTS_MAP[type];\n\tif (!defaults) {\n\t\treturn element;\n\t}\n\n\t// Mutate in place - safe since elements are freshly parsed objects\n\tfor (const [key, defaultValue] of Object.entries(defaults)) {\n\t\tif (element[key] === undefined) {\n\t\t\telement[key] = defaultValue;\n\t\t}\n\t}\n\treturn element;\n}\n\n/**\n * Apply EMF defaults to a contained object based on property name.\n *\n * @param element - The contained object to apply defaults to\n * @param propertyName - The name of the containing property\n * @returns The element with defaults applied (mutated in place for performance)\n */\nexport function applyPropertyDefaults(element: Record<string, unknown>, propertyName: string): Record<string, unknown> {\n\tconst defaults = PROPERTY_DEFAULTS_MAP[propertyName.toLowerCase()];\n\tif (!defaults) {\n\t\treturn element;\n\t}\n\n\t// Mutate in place - safe since elements are freshly parsed objects\n\tfor (const [key, defaultValue] of Object.entries(defaults)) {\n\t\tif (element[key] === undefined) {\n\t\t\telement[key] = defaultValue;\n\t\t}\n\t}\n\treturn element;\n}\n\n/**\n * Apply defaults to action definitions.\n * All action definitions share the same base defaults.\n */\nexport function applyActionDefinitionDefaults(element: Record<string, unknown>): Record<string, unknown> {\n\t// Mutate in place - safe since elements are freshly parsed objects\n\tfor (const [key, defaultValue] of Object.entries(ACTION_DEFINITION_DEFAULTS)) {\n\t\tif (element[key] === undefined) {\n\t\t\telement[key] = defaultValue;\n\t\t}\n\t}\n\treturn element;\n}\n\n/**\n * Apply defaults to page definitions.\n */\nexport function applyPageDefinitionDefaults(element: Record<string, unknown>): Record<string, unknown> {\n\t// Mutate in place - safe since elements are freshly parsed objects\n\tfor (const [key, defaultValue] of Object.entries(PAGE_DEFINITION_DEFAULTS)) {\n\t\tif (element[key] === undefined) {\n\t\t\telement[key] = defaultValue;\n\t\t}\n\t}\n\treturn element;\n}\n\n/**\n * Apply defaults to action elements.\n */\nexport function applyActionDefaults(element: Record<string, unknown>): Record<string, unknown> {\n\t// Mutate in place - safe since elements are freshly parsed objects\n\tfor (const [key, defaultValue] of Object.entries(ACTION_DEFAULTS)) {\n\t\tif (element[key] === undefined) {\n\t\t\telement[key] = defaultValue;\n\t\t}\n\t}\n\treturn element;\n}\n","/**\n * Reference resolver for XMI cross-references.\n * Indexes elements by xmi:id during first pass and resolves references in second pass.\n */\nexport class ReferenceResolver {\n\tprivate index = new Map<string, unknown>();\n\n\t/**\n\t * Index an element by its xmi:id.\n\t */\n\tindexElement(element: Record<string, unknown>): void {\n\t\tconst id = element[\"xmi:id\"] as string | undefined;\n\t\tif (id) {\n\t\t\tthis.index.set(id, element);\n\t\t}\n\t}\n\n\t/**\n\t * Resolve a reference string to the indexed element.\n\t */\n\tresolve<T = unknown>(ref: string): T | undefined {\n\t\treturn this.index.get(ref) as T | undefined;\n\t}\n\n\t/**\n\t * Get all indexed elements.\n\t */\n\tgetIndex(): Map<string, unknown> {\n\t\treturn this.index;\n\t}\n\n\t/**\n\t * Clear the index.\n\t */\n\tclear(): void {\n\t\tthis.index.clear();\n\t}\n\n\t/**\n\t * Index all elements in a tree recursively.\n\t */\n\tindexTree(element: unknown): void {\n\t\tif (!element || typeof element !== \"object\") {\n\t\t\treturn;\n\t\t}\n\n\t\tif (Array.isArray(element)) {\n\t\t\tfor (const item of element) {\n\t\t\t\tthis.indexTree(item);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst obj = element as Record<string, unknown>;\n\t\tthis.indexElement(obj);\n\n\t\t// Recursively index children (skip eContainer to avoid infinite recursion)\n\t\tfor (const [key, value] of Object.entries(obj)) {\n\t\t\tif (key === \"eContainer\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (value && typeof value === \"object\") {\n\t\t\t\tthis.indexTree(value);\n\t\t\t}\n\t\t}\n\t}\n}\n","/**\n * XMI type map: maps xsi:type values to simplified type names.\n */\nexport const TYPE_MAP: Record<string, string> = {\n\t// Visual Elements\n\t\"ui:Flex\": \"Flex\",\n\t\"ui:PageContainer\": \"PageContainer\",\n\t\"ui:TabController\": \"TabController\",\n\t\"ui:Tab\": \"Tab\",\n\t\"ui:Table\": \"Table\",\n\t\"ui:Column\": \"Column\",\n\t\"ui:Filter\": \"Filter\",\n\t\"ui:Link\": \"Link\",\n\t\"ui:Text\": \"Text\",\n\t\"ui:Label\": \"Label\",\n\t\"ui:Formatted\": \"Formatted\",\n\t\"ui:IconImage\": \"IconImage\",\n\t\"ui:Divider\": \"Divider\",\n\t\"ui:Spacer\": \"Spacer\",\n\n\t// Inputs (17 types)\n\t\"ui:TextInput\": \"TextInput\",\n\t\"ui:TextArea\": \"TextArea\",\n\t\"ui:NumericInput\": \"NumericInput\",\n\t\"ui:DateInput\": \"DateInput\",\n\t\"ui:DateTimeInput\": \"DateTimeInput\",\n\t\"ui:TimeInput\": \"TimeInput\",\n\t\"ui:Checkbox\": \"Checkbox\",\n\t\"ui:Switch\": \"Switch\",\n\t\"ui:EnumerationCombo\": \"EnumerationCombo\",\n\t\"ui:EnumerationRadio\": \"EnumerationRadio\",\n\t\"ui:EnumerationToggleButtonbar\": \"EnumerationToggleButtonbar\",\n\t\"ui:TrinaryLogicCombo\": \"TrinaryLogicCombo\",\n\t\"ui:BinaryTypeInput\": \"BinaryTypeInput\",\n\t\"ui:PasswordInput\": \"PasswordInput\",\n\n\t// Button/Action UI\n\t\"ui:Button\": \"Button\",\n\t\"ui:ButtonGroup\": \"ButtonGroup\",\n\n\t// Action Definitions (35 types)\n\t\"ui:BackActionDefinition\": \"BackActionDefinition\",\n\t\"ui:OpenPageActionDefinition\": \"OpenPageActionDefinition\",\n\t\"ui:RowOpenPageActionDefinition\": \"RowOpenPageActionDefinition\",\n\t\"ui:OpenFormActionDefinition\": \"OpenFormActionDefinition\",\n\t\"ui:OpenCreateFormActionDefinition\": \"OpenCreateFormActionDefinition\",\n\t\"ui:OpenOperationInputFormActionDefinition\": \"OpenOperationInputFormActionDefinition\",\n\t\"ui:OpenSelectorActionDefinition\": \"OpenSelectorActionDefinition\",\n\t\"ui:OpenAddSelectorActionDefinition\": \"OpenAddSelectorActionDefinition\",\n\t\"ui:OpenSetSelectorActionDefinition\": \"OpenSetSelectorActionDefinition\",\n\t\"ui:OpenOperationInputSelectorActionDefinition\": \"OpenOperationInputSelectorActionDefinition\",\n\t\"ui:SelectorRangeActionDefinition\": \"SelectorRangeActionDefinition\",\n\t\"ui:RefreshActionDefinition\": \"RefreshActionDefinition\",\n\t\"ui:CreateActionDefinition\": \"CreateActionDefinition\",\n\t\"ui:UpdateActionDefinition\": \"UpdateActionDefinition\",\n\t\"ui:DeleteActionDefinition\": \"DeleteActionDefinition\",\n\t\"ui:BulkDeleteActionDefinition\": \"BulkDeleteActionDefinition\",\n\t\"ui:RowDeleteActionDefinition\": \"RowDeleteActionDefinition\",\n\t\"ui:GetTemplateActionDefinition\": \"GetTemplateActionDefinition\",\n\t\"ui:SetActionDefinition\": \"SetActionDefinition\",\n\t\"ui:UnsetActionDefinition\": \"UnsetActionDefinition\",\n\t\"ui:AddActionDefinition\": \"AddActionDefinition\",\n\t\"ui:RemoveActionDefinition\": \"RemoveActionDefinition\",\n\t\"ui:BulkRemoveActionDefinition\": \"BulkRemoveActionDefinition\",\n\t\"ui:ClearActionDefinition\": \"ClearActionDefinition\",\n\t\"ui:RefreshRelationActionDefinition\": \"RefreshRelationActionDefinition\",\n\t\"ui:FilterRelationActionDefinition\": \"FilterRelationActionDefinition\",\n\t\"ui:FilterActionDefinition\": \"FilterActionDefinition\",\n\t\"ui:ExportActionDefinition\": \"ExportActionDefinition\",\n\t\"ui:InlineCreateRowActionDefinition\": \"InlineCreateRowActionDefinition\",\n\t\"ui:CallOperationActionDefinition\": \"CallOperationActionDefinition\",\n\t\"ui:BulkCallOperationActionDefinition\": \"BulkCallOperationActionDefinition\",\n\t\"ui:InputFormCallOperationActionDefinition\": \"InputFormCallOperationActionDefinition\",\n\t\"ui:InputSelectorCallOperationActionDefinition\": \"InputSelectorCallOperationActionDefinition\",\n\t\"ui:ParameterlessCallOperationActionDefinition\": \"ParameterlessCallOperationActionDefinition\",\n\t\"ui:AutocompleteRangeActionDefinition\": \"AutocompleteRangeActionDefinition\",\n\t\"ui:AutocompleteSetActionDefinition\": \"AutocompleteSetActionDefinition\",\n\t\"ui:AutocompleteAddActionDefinition\": \"AutocompleteAddActionDefinition\",\n\t\"ui:PreFetchActionDefinition\": \"PreFetchActionDefinition\",\n\t\"ui:CancelActionDefinition\": \"CancelActionDefinition\",\n\t\"ui:CustomActionDefinition\": \"CustomActionDefinition\",\n\n\t// Data Types\n\t\"data:ClassType\": \"ClassType\",\n\t\"data:RelationType\": \"RelationType\",\n\t\"data:AttributeType\": \"AttributeType\",\n\t\"data:OperationType\": \"OperationType\",\n\t\"data:OperationParameterType\": \"OperationParameterType\",\n\t\"data:ApplicationType\": \"ApplicationType\",\n\t\"data:StringType\": \"StringType\",\n\t\"data:NumericType\": \"NumericType\",\n\t\"data:BooleanType\": \"BooleanType\",\n\t\"data:DateType\": \"DateType\",\n\t\"data:TimeType\": \"TimeType\",\n\t\"data:TimestampType\": \"TimestampType\",\n\t\"data:EnumerationType\": \"EnumerationType\",\n\t\"data:BinaryType\": \"BinaryType\",\n\t\"data:PasswordType\": \"PasswordType\",\n};\n\n/**\n * Discriminate type from XMI element.\n * Uses xsi:type attribute or infers from element structure.\n */\nexport function discriminateType(element: Record<string, unknown>): string | undefined {\n\tconst xsiType = element[\"xsi:type\"] as string | undefined;\n\tif (xsiType && TYPE_MAP[xsiType]) {\n\t\treturn TYPE_MAP[xsiType];\n\t}\n\t// If xsi:type not in map, return it with prefix stripped\n\tif (xsiType) {\n\t\tconst parts = xsiType.split(\":\");\n\t\treturn parts.length > 1 ? parts[1] : xsiType;\n\t}\n\treturn undefined;\n}\n\n/**\n * Infer type from element tag name when xsi:type is not present.\n */\nexport function inferTypeFromTag(tagName: string): string | undefined {\n\t// Map common tag names to types\n\tconst tagMap: Record<string, string> = {\n\t\tnavigationController: \"NavigationController\",\n\t\titems: \"NavigationItem\",\n\t\tpages: \"PageDefinition\",\n\t\tpageContainers: \"PageContainer\",\n\t\tdataElements: \"DataElement\",\n\t\tdataTypes: \"DataType\",\n\t\tchildren: \"VisualElement\",\n\t\tcolumns: \"Column\",\n\t\tfilters: \"Filter\",\n\t\tbuttons: \"Button\",\n\t\tactions: \"Action\",\n\t\ttabs: \"Tab\",\n\t\tattributes: \"AttributeType\",\n\t\trelations: \"RelationType\",\n\t\toperations: \"OperationType\",\n\t\tclaims: \"Claim\",\n\t\tmembers: \"EnumerationMember\",\n\t\toptions: \"Option\",\n\t\tparts: \"Column\",\n\t};\n\treturn tagMap[tagName];\n}\n","import type { Application } from \"@judo/model-api\";\nimport { XMLParser } from \"fast-xml-parser\";\nimport {\n\tapplyActionDefaults,\n\tapplyActionDefinitionDefaults,\n\tapplyPageDefinitionDefaults,\n\tapplyPropertyDefaults,\n\tapplyTypeDefaults,\n} from \"./emf-defaults\";\nimport { ReferenceResolver } from \"./reference-resolver\";\nimport { discriminateType, inferTypeFromTag } from \"./type-discriminator\";\n\n/**\n * Parse options for advanced use cases.\n */\nexport interface ParseOptions {\n\t/** Validate references after parsing */\n\tvalidateReferences?: boolean;\n\t/** Include raw XML attributes for debugging */\n\tpreserveRawAttributes?: boolean;\n}\n\n/**\n * Parse error information.\n */\nexport interface ParseError {\n\ttype: \"MISSING_REFERENCE\" | \"INVALID_TYPE\" | \"MISSING_REQUIRED\";\n\tmessage: string;\n\telementId?: string;\n\treferencedId?: string;\n\tpath: string;\n}\n\n/**\n * Extended parse result with metadata.\n */\nexport interface ParseResult {\n\tapplications: Application[];\n\t/** All elements indexed by xmi:id for reference resolution */\n\telementIndex: Map<string, unknown>;\n\t/** Validation errors if validateReferences=true */\n\terrors: ParseError[];\n}\n\n/**\n * Collection tag names that should always be parsed as arrays.\n * These correspond to properties with upperBound=\"-1\" in ui.ecore meta-model.\n */\nconst ARRAY_TAGS = new Set([\n\t// Application level\n\t\"pages\",\n\t\"pageContainers\",\n\t\"dataElements\",\n\t\"dataTypes\",\n\t\"mimeTypes\",\n\t\"availableAnnotations\",\n\t// Navigation\n\t\"items\",\n\t\"actions\",\n\t// Visual elements\n\t\"children\",\n\t\"actionButtonGroups\",\n\t\"tabs\",\n\t// Table\n\t\"columns\",\n\t\"filters\",\n\t// Buttons\n\t\"buttons\",\n\t// Data model\n\t\"attributes\",\n\t\"relations\",\n\t\"operations\",\n\t\"members\",\n\t\"parts\",\n\t\"faults\",\n\t\"annotations\",\n\t// Enums\n\t\"behaviours\",\n\t\"claims\",\n\t// ClassType package tokens (can be single or multiple)\n\t\"packageNameTokens\",\n\t// Special\n\t\"ui:Application\",\n]);\n\n/**\n * Cached XML parser instance.\n * Configuration is static, so we can reuse the same instance for all parse calls.\n * This avoids the overhead of creating a new XMLParser instance per model.\n */\nconst cachedParser = new XMLParser({\n\tignoreAttributes: false,\n\tattributeNamePrefix: \"\",\n\tattributesGroupName: false,\n\tisArray: (tagName: string) => ARRAY_TAGS.has(tagName),\n\tparseAttributeValue: false, // Keep values as strings for reference resolution\n\ttrimValues: true,\n});\n\n/**\n * Get the cached XML parser instance.\n */\nfunction getParser(): XMLParser {\n\treturn cachedParser;\n}\n\n/**\n * Property names that should be coerced to booleans.\n * These correspond to model properties typed as 'boolean' in model-api\n * and 'Boolean' or 'EBoolean' types in ui.ecore meta-model.\n */\nconst BOOLEAN_PROPERTIES = new Set([\n\t// Table properties\n\t\"isEager\",\n\t\"isSmallTable\",\n\t\"allowSelectMultiple\",\n\t\"showTotalCount\",\n\t\"isInlineEditable\",\n\t// Input properties\n\t\"required\",\n\t\"countCharacters\",\n\t\"formatValue\",\n\t\"isTypeAheadField\",\n\t\"isMultiLine\",\n\t// Link properties (same as Table)\n\t// \"isEager\" - already included\n\t// Checkbox/Switch\n\t\"checked\",\n\t\"switched\",\n\t// Selection\n\t\"selected\",\n\t// Page/Application properties\n\t\"openInDialog\",\n\t\"dashboard\",\n\t\"generateActionsHook\",\n\t\"isSelector\",\n\t\"isRelationSelector\",\n\t\"supportGuestAccess\",\n\t// Action properties\n\t\"isBulk\",\n\t\"autoOpenAfterCreate\",\n\t\"isMenuAction\",\n\t\"autoCloseOnSave\",\n\t\"isContainedRelationAction\",\n\t\"isTransient\",\n\t// Data properties\n\t\"isInlineCreatable\",\n\t\"isProfilePicture\",\n\t\"isRequired\",\n\t\"isReadOnly\",\n\t\"isFilterable\",\n\t\"isOptional\",\n\t\"isCollection\",\n\t\"isOrderable\",\n\t\"isMapped\",\n\t\"isPrincipal\",\n\t\"isActor\",\n\t\"isForCreateOrUpdateType\",\n\t\"isStateful\",\n\t// Filter properties\n\t\"alwaysShown\",\n\t\"range\",\n\t\"multiValue\",\n\t// Visual properties\n\t\"customImplementation\",\n\t\"onBlur\",\n\t\"isInCard\",\n\t// Relation properties\n\t\"isAccess\",\n]);\n\n/**\n * Property names that should be coerced to numbers.\n * These correspond to model properties typed as 'number' in model-api.\n */\nconst NUMERIC_PROPERTIES = new Set([\n\t// DataType properties\n\t\"maxLength\",\n\t\"precision\",\n\t\"scale\",\n\t\"maxFileSize\",\n\t// Table properties\n\t\"rowsPerPage\",\n\t\"selectorRowsPerPage\",\n\t\"actionColumnWidth\",\n\t// Size/Layout properties\n\t\"width\",\n\t\"minWidth\",\n\t\"maxWidth\",\n\t\"height\",\n\t\"minHeight\",\n\t\"maxHeight\",\n\t// Sort precedence\n\t\"sortPrecedence\",\n\t// Enumeration ordinal\n\t\"ordinal\",\n\t// ButtonGroup featured actions count\n\t\"featuredActions\",\n]);\n\n/**\n * Coerce numeric string properties to actual numbers.\n * XML attributes are always parsed as strings, but model-api types expect numbers.\n * Optimized to only check properties that exist in the element.\n */\nfunction coerceNumericProperties(element: Record<string, unknown>): void {\n\t// Only check numeric properties that exist in this element\n\tfor (const key of NUMERIC_PROPERTIES) {\n\t\tconst value = element[key];\n\t\tif (typeof value === \"string\") {\n\t\t\tconst num = Number(value);\n\t\t\tif (!Number.isNaN(num)) {\n\t\t\t\telement[key] = num;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Coerce boolean string properties to actual booleans.\n * XML attributes are always parsed as strings (\"true\"/\"false\"), but model-api types expect booleans.\n * Optimized to only check properties that exist in the element.\n */\nfunction coerceBooleanProperties(element: Record<string, unknown>): void {\n\t// Only check boolean properties that exist in this element\n\tfor (const key of BOOLEAN_PROPERTIES) {\n\t\tconst value = element[key];\n\t\tif (typeof value === \"string\") {\n\t\t\t// Convert \"true\" to true, everything else (including \"false\") to false\n\t\t\telement[key] = value === \"true\";\n\t\t}\n\t}\n}\n\n/**\n * Known property names that contain objects requiring property-based defaults.\n */\nconst PROPERTY_DEFAULT_KEYS = new Set([\"size\", \"sizeConstraint\", \"sizeconstraint\", \"frame\", \"confirmation\"]);\n\n/**\n * Known property names that contain action definitions.\n */\nconst ACTION_DEFINITION_KEYS = new Set([\n\t\"actionDefinition\",\n\t\"templateAction\",\n\t\"onInit\",\n\t\"autocompleteRangeActionDefinition\",\n\t\"autocompleteAddActionDefinition\",\n\t\"autocompleteSetActionDefinition\",\n\t\"refreshActionDefinition\",\n\t\"preFetchActionDefinition\",\n]);\n\n/**\n * Transform a raw parsed element, adding @type discriminator and applying EMF defaults.\n * EMF models do not serialize attributes that equal their default values, so we must\n * explicitly apply defaults during parsing to ensure runtime has complete data.\n *\n * Note: This function mutates the element in place for performance.\n * The parsed XML objects are transient and safe to modify.\n */\nfunction transformElement(element: Record<string, unknown>, tagName?: string): Record<string, unknown> {\n\tif (!element || typeof element !== \"object\") {\n\t\treturn element;\n\t}\n\n\t// Add @type discriminator\n\tconst xsiType = element[\"xsi:type\"] as string | undefined;\n\tlet elementType: string | undefined;\n\tif (xsiType) {\n\t\telementType = discriminateType(element);\n\t\telement[\"@type\"] = elementType;\n\t\t// Clear xsi:type since we have @type now (set to undefined instead of delete for performance)\n\t\telement[\"xsi:type\"] = undefined;\n\t} else if (tagName) {\n\t\tconst inferred = inferTypeFromTag(tagName);\n\t\tif (inferred) {\n\t\t\telementType = inferred;\n\t\t\telement[\"@type\"] = inferred;\n\t\t}\n\t}\n\n\t// Transform nested elements in place and set eContainer for EMF containment\n\tfor (const [key, value] of Object.entries(element)) {\n\t\t// Skip eContainer to prevent infinite recursion (it's a back-reference, not a containment)\n\t\tif (key === \"eContainer\") {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\t\tconst item = value[i];\n\t\t\t\tif (item && typeof item === \"object\") {\n\t\t\t\t\t// Set eContainer back-reference for EMF-style containment navigation\n\t\t\t\t\t(item as Record<string, unknown>).eContainer = element;\n\t\t\t\t\ttransformElement(item as Record<string, unknown>, key);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (value && typeof value === \"object\") {\n\t\t\t// Set eContainer back-reference for EMF-style containment navigation\n\t\t\t(value as Record<string, unknown>).eContainer = element;\n\t\t\ttransformElement(value as Record<string, unknown>, key);\n\n\t\t\t// Apply property-based defaults for specific object types\n\t\t\tif (PROPERTY_DEFAULT_KEYS.has(key)) {\n\t\t\t\tapplyPropertyDefaults(value as Record<string, unknown>, key);\n\t\t\t}\n\n\t\t\t// Apply action definition defaults\n\t\t\tif (ACTION_DEFINITION_KEYS.has(key)) {\n\t\t\t\tapplyActionDefinitionDefaults(value as Record<string, unknown>);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Coerce numeric properties from strings to numbers\n\tcoerceNumericProperties(element);\n\n\t// Coerce boolean properties from strings to booleans\n\tcoerceBooleanProperties(element);\n\n\t// Apply EMF type-based defaults\n\tif (elementType) {\n\t\tapplyTypeDefaults(element, elementType);\n\t}\n\n\t// Apply special handling for pages (PageDefinition) and actions (Action)\n\tif (tagName === \"pages\") {\n\t\tapplyPageDefinitionDefaults(element);\n\t}\n\tif (tagName === \"actions\") {\n\t\tapplyActionDefaults(element);\n\t}\n\n\t// Apply Application defaults for ui:Application elements\n\tif (tagName === \"ui:Application\") {\n\t\tapplyTypeDefaults(element, \"Application\");\n\t}\n\n\treturn element;\n}\n\n/**\n * Extract Application elements from parsed XMI.\n * Supports two formats:\n * 1. Multi-actor: xmi:XMI root with multiple ui:Application children\n * 2. Single-actor: ui:Application as root element directly\n */\nfunction extractApplications(parsed: Record<string, unknown>): Record<string, unknown>[] {\n\t// Check for xmi:XMI wrapper (multi-actor format)\n\tconst xmi = parsed[\"xmi:XMI\"] as Record<string, unknown> | undefined;\n\n\tif (xmi) {\n\t\tconst apps = xmi[\"ui:Application\"] as Record<string, unknown>[] | Record<string, unknown> | undefined;\n\n\t\tif (!apps) {\n\t\t\tthrow new ModelParseError(\"Invalid XMI: missing ui:Application element\", \"/xmi:XMI\");\n\t\t}\n\n\t\t// Ensure array\n\t\tconst appArray = Array.isArray(apps) ? apps : [apps];\n\t\treturn appArray.map((app) => transformElement(app, \"ui:Application\"));\n\t}\n\n\t// Check for direct ui:Application root (single-actor format)\n\tconst directApp = parsed[\"ui:Application\"] as Record<string, unknown> | undefined;\n\n\tif (directApp) {\n\t\t// Handle case where parser returns array (should unwrap)\n\t\tconst appObject = Array.isArray(directApp) ? directApp[0] : directApp;\n\t\treturn [transformElement(appObject, \"ui:Application\")];\n\t}\n\n\tthrow new ModelParseError(\"Invalid XMI: missing xmi:XMI or ui:Application root element\", \"/\");\n}\n\n/**\n * Parse an XMI/XML model string into Application objects.\n * Returns array for multi-actor model support.\n */\nexport function parseModel(xml: string): Application[] {\n\tconst parser = getParser();\n\tconst parsed = parser.parse(xml) as Record<string, unknown>;\n\n\tconst apps = extractApplications(parsed);\n\n\treturn apps as unknown as Application[];\n}\n\n/**\n * Parse with options for advanced use cases.\n */\nexport function parseModelWithOptions(xml: string, options: ParseOptions = {}): ParseResult {\n\tconst parser = getParser();\n\tconst parsed = parser.parse(xml) as Record<string, unknown>;\n\n\tconst apps = extractApplications(parsed);\n\n\t// Build element index\n\tconst resolver = new ReferenceResolver();\n\tfor (const app of apps) {\n\t\tresolver.indexTree(app);\n\t}\n\n\tconst errors: ParseError[] = [];\n\n\t// Validate references if requested\n\tif (options.validateReferences) {\n\t\tconst validationErrors = validateReferences(apps, resolver);\n\t\terrors.push(...validationErrors);\n\t}\n\n\treturn {\n\t\tapplications: apps as unknown as Application[],\n\t\telementIndex: resolver.getIndex(),\n\t\terrors,\n\t};\n}\n\n/**\n * Validate that all references resolve to indexed elements.\n */\nfunction validateReferences(apps: Record<string, unknown>[], _resolver: ReferenceResolver): ParseError[] {\n\tconst errors: ParseError[] = [];\n\tconst referenceProps = [\n\t\t\"target\",\n\t\t\"targetPageDefinition\",\n\t\t\"targetType\",\n\t\t\"dataElement\",\n\t\t\"attributeType\",\n\t\t\"relationType\",\n\t\t\"operationType\",\n\t\t\"owner\",\n\t\t\"dataType\",\n\t\t\"enumeration\",\n\t];\n\n\tfunction validate(element: unknown, path: string): void {\n\t\tif (!element || typeof element !== \"object\") {\n\t\t\treturn;\n\t\t}\n\n\t\tif (Array.isArray(element)) {\n\t\t\telement.forEach((item, index) => {\n\t\t\t\tvalidate(item, `${path}[${index}]`);\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tconst obj = element as Record<string, unknown>;\n\t\tconst _elementId = obj[\"xmi:id\"] as string | undefined;\n\n\t\tfor (const prop of referenceProps) {\n\t\t\tconst ref = obj[prop];\n\t\t\tif (typeof ref === \"string\" && ref.includes(\"/\")) {\n\t\t\t\t// This looks like a reference path, not a direct ID\n\t\t\t\t// XMI references are typically in format: \"Name/(esm/_id)/Type\"\n\t\t\t\t// We can't validate external references here\n\t\t\t}\n\t\t}\n\n\t\t// Recursively validate children (skip eContainer to avoid infinite recursion)\n\t\tfor (const [key, value] of Object.entries(obj)) {\n\t\t\tif (key === \"eContainer\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (value && typeof value === \"object\") {\n\t\t\t\tvalidate(value, `${path}/${key}`);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (let i = 0; i < apps.length; i++) {\n\t\tvalidate(apps[i], `/ui:Application[${i}]`);\n\t}\n\n\treturn errors;\n}\n\n/**\n * Error thrown when model parsing fails.\n */\nexport class ModelParseError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly path: string,\n\t\tpublic readonly cause?: Error\n\t) {\n\t\tsuper(`Parse error at ${path}: ${message}`);\n\t\tthis.name = \"ModelParseError\";\n\t}\n}\n\n/**\n * Error thrown when a reference cannot be resolved.\n */\nexport class ModelReferenceError extends Error {\n\tconstructor(\n\t\tpublic readonly sourceId: string,\n\t\tpublic readonly targetRef: string\n\t) {\n\t\tsuper(`Unresolved reference: ${sourceId} -> ${targetRef}`);\n\t\tthis.name = \"ModelReferenceError\";\n\t}\n}\n","/**\n * Build visual element containment trees from parsed structures.\n */\n\nimport type { VisualElement } from \"@judo/model-api\";\n\n/**\n * Recursively build containment tree for visual elements.\n * Preserves parent-child relationships.\n */\nexport function buildContainmentTree(container: Record<string, unknown>): VisualElement[] {\n\tconst children = container.children as Record<string, unknown>[] | undefined;\n\n\tif (!children || !Array.isArray(children)) {\n\t\treturn [];\n\t}\n\n\treturn children.map((child) => processVisualElement(child));\n}\n\n/**\n * Process a visual element and its nested children.\n */\nfunction processVisualElement(element: Record<string, unknown>): VisualElement {\n\tconst result: Record<string, unknown> = { ...element };\n\n\t// Process nested children recursively\n\tif (element.children && Array.isArray(element.children)) {\n\t\tresult.children = (element.children as Record<string, unknown>[]).map((child) => processVisualElement(child));\n\t}\n\n\t// Process tabs in TabController\n\tif (element.tabs && Array.isArray(element.tabs)) {\n\t\tresult.tabs = (element.tabs as Record<string, unknown>[]).map((tab) => {\n\t\t\tif (tab.element) {\n\t\t\t\treturn {\n\t\t\t\t\t...tab,\n\t\t\t\t\telement: processVisualElement(tab.element as Record<string, unknown>),\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn tab;\n\t\t});\n\t}\n\n\t// Process columns in Table\n\tif (element.columns && Array.isArray(element.columns)) {\n\t\tresult.columns = element.columns;\n\t}\n\n\t// Process filters in Table\n\tif (element.filters && Array.isArray(element.filters)) {\n\t\tresult.filters = element.filters;\n\t}\n\n\t// Process tableActionButtonGroup in Table\n\tif (element.tableActionButtonGroup && typeof element.tableActionButtonGroup === \"object\") {\n\t\tresult.tableActionButtonGroup = processVisualElement(element.tableActionButtonGroup as Record<string, unknown>);\n\t}\n\n\t// Process rowActionButtonGroup in Table\n\tif (element.rowActionButtonGroup && typeof element.rowActionButtonGroup === \"object\") {\n\t\tresult.rowActionButtonGroup = processVisualElement(element.rowActionButtonGroup as Record<string, unknown>);\n\t}\n\n\t// Process buttons in ButtonGroup\n\tif (element.buttons && Array.isArray(element.buttons)) {\n\t\tresult.buttons = element.buttons;\n\t}\n\n\t// Process parts in Link\n\tif (element.parts && Array.isArray(element.parts)) {\n\t\tresult.parts = (element.parts as Record<string, unknown>[]).map((part) => processVisualElement(part));\n\t}\n\n\treturn result as unknown as VisualElement;\n}\n\n/**\n * Attach parent references to enable upward navigation.\n * This mutates the tree by adding __parent references.\n */\nexport function attachParentReferences(root: VisualElement, parent?: VisualElement): void {\n\tconst elem = root as unknown as Record<string, unknown>;\n\n\tif (parent) {\n\t\telem.__parent = parent;\n\t}\n\n\t// Process children\n\tconst children = elem.children as VisualElement[] | undefined;\n\tif (children && Array.isArray(children)) {\n\t\tfor (const child of children) {\n\t\t\tattachParentReferences(child, root);\n\t\t}\n\t}\n\n\t// Process tabs\n\tconst tabs = elem.tabs as Array<{ element?: VisualElement }> | undefined;\n\tif (tabs && Array.isArray(tabs)) {\n\t\tfor (const tab of tabs) {\n\t\t\tif (tab.element) {\n\t\t\t\tattachParentReferences(tab.element, root);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Process parts\n\tconst parts = elem.parts as VisualElement[] | undefined;\n\tif (parts && Array.isArray(parts)) {\n\t\tfor (const part of parts) {\n\t\t\tattachParentReferences(part, root);\n\t\t}\n\t}\n}\n\n/**\n * Get the parent of a visual element.\n * Returns undefined if no parent is attached.\n */\nexport function getParent(element: VisualElement): VisualElement | undefined {\n\treturn (element as unknown as Record<string, unknown>).__parent as VisualElement | undefined;\n}\n"],"mappings":";;AAuCA,MAAa,0BAA0B;CAEtC,KAAK;CAEL,KAAK;CAEL,KAAK,IAAI;CAET,SAAS,QAAQ;CAEjB,UAAU;CAEV,UAAU;CAEV,YAAY;CACZ,EASY,gBAAgB;CAC5B,GAAG;CAEH,WAAW,KAAK;CAEhB,mBAAmB,kBAAkB;CAErC,oBAAoB,mBAAmB;CAEvC,cAAc,aAAa;CAC3B,EAMY,0BAA0B;CACtC,GAAG;CAEH,MAAM,kBAAkB;CAExB,8BAA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