@lbdudc/linea-core 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.
Files changed (91) hide show
  1. package/README.md +358 -0
  2. package/dist/analysis/analyze.d.ts +105 -0
  3. package/dist/analysis/analyze.js +220 -0
  4. package/dist/analysis/analyze.js.map +1 -0
  5. package/dist/analysis/runtime.d.ts +97 -0
  6. package/dist/analysis/runtime.js +198 -0
  7. package/dist/analysis/runtime.js.map +1 -0
  8. package/dist/analysis/wheels/micropip-0.6.0-py3-none-any.whl +0 -0
  9. package/dist/analysis/wheels/packaging-23.2-py3-none-any.whl +0 -0
  10. package/dist/assets.d.ts +16 -0
  11. package/dist/assets.js +36 -0
  12. package/dist/assets.js.map +1 -0
  13. package/dist/constants.d.ts +77 -0
  14. package/dist/constants.js +76 -0
  15. package/dist/constants.js.map +1 -0
  16. package/dist/derivation/derive.d.ts +68 -0
  17. package/dist/derivation/derive.js +115 -0
  18. package/dist/derivation/derive.js.map +1 -0
  19. package/dist/derivation/engine.d.ts +48 -0
  20. package/dist/derivation/engine.js +98 -0
  21. package/dist/derivation/engine.js.map +1 -0
  22. package/dist/errors.d.ts +72 -0
  23. package/dist/errors.js +91 -0
  24. package/dist/errors.js.map +1 -0
  25. package/dist/feature-model/convert.d.ts +35 -0
  26. package/dist/feature-model/convert.js +47 -0
  27. package/dist/feature-model/convert.js.map +1 -0
  28. package/dist/feature-model/engine.d.ts +60 -0
  29. package/dist/feature-model/engine.js +139 -0
  30. package/dist/feature-model/engine.js.map +1 -0
  31. package/dist/feature-model/inspect.d.ts +67 -0
  32. package/dist/feature-model/inspect.js +113 -0
  33. package/dist/feature-model/inspect.js.map +1 -0
  34. package/dist/feature-model/io.d.ts +66 -0
  35. package/dist/feature-model/io.js +92 -0
  36. package/dist/feature-model/io.js.map +1 -0
  37. package/dist/feature-model/parse.d.ts +30 -0
  38. package/dist/feature-model/parse.js +36 -0
  39. package/dist/feature-model/parse.js.map +1 -0
  40. package/dist/feature-model/text.d.ts +54 -0
  41. package/dist/feature-model/text.js +126 -0
  42. package/dist/feature-model/text.js.map +1 -0
  43. package/dist/fs/archive.d.ts +23 -0
  44. package/dist/fs/archive.js +87 -0
  45. package/dist/fs/archive.js.map +1 -0
  46. package/dist/fs/diff.d.ts +40 -0
  47. package/dist/fs/diff.js +155 -0
  48. package/dist/fs/diff.js.map +1 -0
  49. package/dist/fs/format.d.ts +21 -0
  50. package/dist/fs/format.js +111 -0
  51. package/dist/fs/format.js.map +1 -0
  52. package/dist/fs/workspace.d.ts +77 -0
  53. package/dist/fs/workspace.js +103 -0
  54. package/dist/fs/workspace.js.map +1 -0
  55. package/dist/index.d.ts +50 -0
  56. package/dist/index.js +48 -0
  57. package/dist/index.js.map +1 -0
  58. package/dist/internal/guards.d.ts +15 -0
  59. package/dist/internal/guards.js +16 -0
  60. package/dist/internal/guards.js.map +1 -0
  61. package/dist/line/platform-files.d.ts +73 -0
  62. package/dist/line/platform-files.js +112 -0
  63. package/dist/line/platform-files.js.map +1 -0
  64. package/dist/line/scaffold.d.ts +88 -0
  65. package/dist/line/scaffold.js +145 -0
  66. package/dist/line/scaffold.js.map +1 -0
  67. package/dist/line/templates/core/extra.js +54 -0
  68. package/dist/line/templates/core/transformation.js +196 -0
  69. package/dist/line/templates/metamodels/dataModel/extra.js +328 -0
  70. package/dist/line/templates/metamodels/dataModel/transformation.js +211 -0
  71. package/dist/line/templates/metamodels/sensor/extra.js +36 -0
  72. package/dist/line/templates/metamodels/sensor/transformation.js +47 -0
  73. package/dist/line/templates/pipeline/.gitlab-ci.yml +51 -0
  74. package/dist/line/templates/pipeline/ci/test-client.sh +16 -0
  75. package/dist/line/templates/pipeline/ci/test-server.sh +16 -0
  76. package/dist/product/engine-spec.d.ts +25 -0
  77. package/dist/product/engine-spec.js +77 -0
  78. package/dist/product/engine-spec.js.map +1 -0
  79. package/dist/product/spec.d.ts +130 -0
  80. package/dist/product/spec.js +219 -0
  81. package/dist/product/spec.js.map +1 -0
  82. package/dist/product/version.d.ts +27 -0
  83. package/dist/product/version.js +49 -0
  84. package/dist/product/version.js.map +1 -0
  85. package/dist/products-index/products-index.d.ts +224 -0
  86. package/dist/products-index/products-index.js +395 -0
  87. package/dist/products-index/products-index.js.map +1 -0
  88. package/dist/selection/selection.d.ts +126 -0
  89. package/dist/selection/selection.js +152 -0
  90. package/dist/selection/selection.js.map +1 -0
  91. package/package.json +67 -0
@@ -0,0 +1,328 @@
1
+ function getFilterName(entity, propertyName) {
2
+ if (!entity) {
3
+ return propertyName;
4
+ } else if (entity.displayString == "") {
5
+ return "";
6
+ } else {
7
+ var regExFilter = /^\$[_a-zA-Z0-9-]+$/;
8
+ if (regExFilter.test(entity.displayString)) {
9
+ var propertyInDisplaString = getProperty(
10
+ entity,
11
+ entity.displayString.replace(/\$/g, "")
12
+ );
13
+ if (!propertyInDisplaString || propertyInDisplaString.multiple) {
14
+ return "";
15
+ } else {
16
+ return propertyName + "_" + propertyInDisplaString.name;
17
+ }
18
+ } else {
19
+ return "";
20
+ }
21
+ }
22
+ }
23
+
24
+ function getDisplayString(entity, suffix) {
25
+ if (!suffix) {
26
+ suffix = normalize(entity.name);
27
+ }
28
+
29
+ if (entity.displayString == "") {
30
+ return (
31
+ "'" +
32
+ entity.name +
33
+ "'" +
34
+ " + ' ' + " +
35
+ suffix +
36
+ "." +
37
+ getIdProperty(entity).name
38
+ );
39
+ }
40
+
41
+ return (
42
+ "'" +
43
+ entity.displayString.replace(/\$\w+/g, function myFunction(x) {
44
+ return "' + " + x.replace(/\$/g, suffix + ".") + " + '";
45
+ }) +
46
+ "'"
47
+ );
48
+ }
49
+
50
+ function getDisplayStringName(entity) {
51
+ if (entity.displayString == null) {
52
+ return null;
53
+ }
54
+ return entity.displayString.replace("$", "");
55
+ }
56
+
57
+ function getDisplayStringJava(entity, entityVariableName) {
58
+ if (entity.displayString == "") {
59
+ return (
60
+ '"' +
61
+ entity.name +
62
+ ' " + ' +
63
+ entityVariableName +
64
+ ".get" +
65
+ normalize(getIdProperty(entity).name, true) +
66
+ "()"
67
+ );
68
+ }
69
+
70
+ return (
71
+ '"' +
72
+ entity.displayString.replace(/\$\w+/g, function myFunction(x) {
73
+ return (
74
+ '" + ' +
75
+ entityVariableName +
76
+ ".get" +
77
+ normalize(x.split("$")[1], true) +
78
+ "()" +
79
+ " + " +
80
+ '"'
81
+ );
82
+ }) +
83
+ '"'
84
+ );
85
+ }
86
+
87
+ function getEntity(data, entityName) {
88
+ return data.dataModel.entities.find(function(en) {
89
+ return en.name == entityName;
90
+ });
91
+ }
92
+
93
+ function getForm(data, className) {
94
+ return data.forms.find(function(en) {
95
+ return en.entity == className;
96
+ });
97
+ }
98
+
99
+ function getProperty(entity, propertyName) {
100
+ return entity.properties.find(function(p) {
101
+ return p.name == propertyName;
102
+ });
103
+ }
104
+
105
+ function getEnum(data, enumName) {
106
+ return data.dataModel.enums.find(function(en) {
107
+ return en.name == enumName;
108
+ });
109
+ }
110
+
111
+ function getIdProperty(entity) {
112
+ if (!entity) return null;
113
+ return entity.properties.find(function(p) {
114
+ return p.pk;
115
+ });
116
+ }
117
+
118
+ function getProperties(entity, data) {
119
+ const properties = entity.properties;
120
+ const superclass = entity.superclass ? getEntity(data, entity.superclass) : null;
121
+ if (superclass) {
122
+ return properties.concat(getProperties(superclass, data));
123
+ } else {
124
+ return properties;
125
+ }
126
+ }
127
+
128
+ function getEntityProperty(entity, propertyName) {
129
+ if (!entity) return null;
130
+
131
+ let foundProp = null;
132
+ entity.properties.every((property) => {
133
+ if (property.name === propertyName) {
134
+ foundProp = property;
135
+ return false;
136
+ }
137
+ return true;
138
+ });
139
+
140
+ if (!foundProp && entity.superclass) {
141
+ const superClasses = getEntitySuperClasses(entity);
142
+ superClasses.every((superclass) => {
143
+ superclass.properties.every((property) => {
144
+ if (property.name === propertyName) {
145
+ foundProp = property;
146
+ return false;
147
+ }
148
+ return true;
149
+ });
150
+ return foundProp == null;
151
+ });
152
+ }
153
+ return foundProp;
154
+ }
155
+
156
+ function getRelationships(data, entity, propertiesFilter) {
157
+ var r = [];
158
+
159
+ var properties = entity.properties;
160
+
161
+ if (propertiesFilter) {
162
+ if (typeof propertiesFilter == "function") {
163
+ properties = properties.filter(propertiesFilter);
164
+ } else {
165
+ properties = properties.filter(function(p) {
166
+ return propertiesFilter.indexOf(p.name) != -1;
167
+ });
168
+ }
169
+ }
170
+
171
+ properties.forEach(function(property) {
172
+ var propertyEntity = getEntity(data, property.class);
173
+
174
+ if (propertyEntity != null) {
175
+ r.push({
176
+ property: property,
177
+ class: propertyEntity,
178
+ inverseProperty: propertyEntity.properties.find(function(p) {
179
+ return p.name == property.bidirectional;
180
+ })
181
+ });
182
+ }
183
+ });
184
+
185
+ return r;
186
+ }
187
+
188
+ var inputTypes = [
189
+ "Boolean",
190
+ "BigDecimal",
191
+ "Integer",
192
+ "Long",
193
+ "Float",
194
+ "Double",
195
+ "String",
196
+ "Text",
197
+ "Date",
198
+ "DateTime"
199
+ ];
200
+
201
+ function isInput(data, property) {
202
+ return inputTypes.indexOf(property.class) != -1
203
+ || property.class.indexOf('autoinc') != -1
204
+ || getEntity(data, property.class)
205
+ || getEnum(data, property.class);
206
+ }
207
+
208
+ function getEntityPropertyNamesOfTypes(entity, types) {
209
+ const propertyNames = [];
210
+ let entities = [];
211
+ if (!entity.abstract) {
212
+ entities.push(entity);
213
+ if (entity.superclass) {
214
+ const superClasses = getEntitySuperClasses(entity);
215
+ entities = entities.concat(superClasses);
216
+ }
217
+ }
218
+ entities.forEach((_entity) => {
219
+ _entity.properties.forEach((property) => {
220
+ types.forEach((type) => {
221
+ if (property.class == type || property.class == type + " (autoinc)") {
222
+ propertyNames.push(property.name);
223
+ }
224
+ });
225
+ });
226
+ });
227
+ return propertyNames;
228
+ }
229
+
230
+ function checkEntityContainsPropertiesOfTypes(entity, types) {
231
+ return getEntityPropertyNamesOfTypes(entity, types).length !== 0;
232
+ }
233
+
234
+ function getEntitySuperClasses(entity, superclasses = []) {
235
+ let entitySuperClasses = superclasses;
236
+ if (!entity.superclass) {
237
+ return superclasses;
238
+ } else {
239
+ let _superclass = data.dataModel.entities.find(e => e.name === entity.superclass);
240
+ if (!_superclass) {
241
+ return superclasses;
242
+ } else {
243
+ entitySuperClasses = entitySuperClasses.concat(_superclass);
244
+ return getEntitySuperClasses(_superclass, entitySuperClasses);
245
+ }
246
+ }
247
+ }
248
+
249
+ function checkAnyEntityContainsPropertiesOfTypes(data, types) {
250
+ var propertyTypeFound = false;
251
+ data.dataModel.entities.forEach(function(entity) {
252
+ var found = checkEntityContainsPropertiesOfTypes(entity, types);
253
+ propertyTypeFound = propertyTypeFound || found;
254
+ });
255
+ return propertyTypeFound;
256
+ }
257
+
258
+ function checkEntityContainsPatternOfType(entity, patternType) {
259
+ var patternFound = false;
260
+ entity.properties.forEach(function(property) {
261
+ if (property.patternType === patternType) {
262
+ patternFound = true;
263
+ }
264
+ });
265
+ return patternFound;
266
+ }
267
+
268
+ function checkEntityContainsPatternOfTypes(entity, patternTypes) {
269
+ var patternsFound = false;
270
+ patternTypes.forEach(function(patternType) {
271
+ var patternFound = checkEntityContainsPatternOfType(entity, patternType);
272
+ patternsFound = patternsFound || patternFound;
273
+ });
274
+ return patternsFound;
275
+ }
276
+
277
+ function checkAnyEntityContainsPatternOfType(data, patternType) {
278
+ var patternFound = false;
279
+ data.dataModel.entities.forEach(function(entity) {
280
+ patternFound =
281
+ patternFound || checkEntityContainsPatternOfType(entity, patternType);
282
+ });
283
+ return patternFound;
284
+ }
285
+
286
+ function checkAnyEntityContainsPatternOfTypes(data, patternTypes) {
287
+ var patternsFound = false;
288
+ patternTypes.forEach(function(patternType) {
289
+ var patternFound = checkAnyEntityContainsPatternOfType(data, patternType);
290
+ patternsFound = patternsFound || patternFound;
291
+ });
292
+ return patternsFound;
293
+ }
294
+
295
+ function entityIsSuperclass(entity) {
296
+ return data.dataModel.entities.find(e => e.superclass === entity.name) != null;
297
+ }
298
+
299
+ function getTableDataTitleTranslate(entityName, propertyName) {
300
+ return (
301
+ "'entity." +
302
+ normalize(entityName) +
303
+ ".prop." +
304
+ normalize(propertyName) +
305
+ "' | translate"
306
+ );
307
+ }
308
+
309
+ function getOtherRelationshipsNotMultipleAndOwning(data, context) {
310
+ var rels = [];
311
+
312
+ data.dataModel.entities.forEach(function(entity) {
313
+ entity.properties.forEach(function(property) {
314
+ if (property.class == context.name && property.owner) {
315
+ if (property.bidirectional && !property.multiple) {
316
+ var thisProperty = context.properties.find(function(p) {
317
+ return p.name == property.bidirectional;
318
+ });
319
+ if (!thisProperty.multiple) {
320
+ rels.push({ entity: entity, property: property });
321
+ }
322
+ }
323
+ }
324
+ });
325
+ });
326
+
327
+ return rels;
328
+ }
@@ -0,0 +1,211 @@
1
+ registerMetamodelProcessor(function processDataModel(ret, input) {
2
+ if (input.data && input.data.dataModel) {
3
+ ret.data.dataModel = input.data.dataModel;
4
+ } else if (input.dataModel) {
5
+ ret.data.dataModel = dataModel(input.dataModel);
6
+ } else {
7
+ ret.data.dataModel = { entities: [], enums: [] };
8
+ }
9
+
10
+ if (ret.features.indexOf("GUI_Forms") !== -1) {
11
+ ret.data.forms = forms(ret.data.dataModel.entities, ret.features);
12
+ } else {
13
+ ret.data.forms = [];
14
+ }
15
+
16
+ if (ret.features.indexOf("GUI_Lists") !== -1) {
17
+ ret.data.lists = lists(ret.data.dataModel.entities, ret.features, ret.data.forms);
18
+ } else {
19
+ ret.data.lists = [];
20
+ }
21
+ });
22
+
23
+ function enums(input) {
24
+ return input.map((e) => ({
25
+ name: normalize(e.name, true),
26
+ values: e.values,
27
+ }));
28
+ }
29
+
30
+ function entities(input) {
31
+ return input.map((e) => ({
32
+ name: normalize(e.name, true),
33
+ properties: properties(e),
34
+ displayString: "$" + _getDisplayString(e, input),
35
+ superclass: e.superclass && e.superclass.name,
36
+ abstract: e.abstract,
37
+ traceable: e.traceable,
38
+ }));
39
+ }
40
+
41
+ function properties(entity) {
42
+ const ret = [];
43
+ entity.properties.forEach((p) => {
44
+ if (p.name === "id") {
45
+ ret.push({ name: "id", class: "Long (autoinc)", pk: true, required: true, unique: true });
46
+ } else {
47
+ ret.push({
48
+ name: p.name,
49
+ class: normalize(p.class, true),
50
+ required: p.required,
51
+ unique: p.unique,
52
+ patternType: p.patternType,
53
+ pattern: p.pattern,
54
+ min: p.min,
55
+ max: p.max,
56
+ });
57
+ }
58
+ });
59
+ return ret;
60
+ }
61
+
62
+ function relationships(ret, input) {
63
+ const rels = input.cells.filter((o) => o.type === "custom.Association");
64
+
65
+ rels.forEach((r) => {
66
+ const source = findEntityByName(normalize(findEntityById(r.source.id, input.cells).name, true), ret);
67
+ const target = findEntityByName(normalize(findEntityById(r.target.id, input.cells).name, true), ret);
68
+
69
+ source.properties.push({
70
+ name: r.sourceOpts.label || normalize(target.name),
71
+ class: target.name,
72
+ owner: _getRelationshipOwner(r, r.source.id),
73
+ bidirectional: r.targetOpts.label || normalize(source.name),
74
+ multiple: multiple(r.sourceOpts.multiplicity),
75
+ required: required(r.sourceOpts.multiplicity),
76
+ });
77
+
78
+ target.properties.push({
79
+ name: r.targetOpts.label || normalize(source.name),
80
+ class: source.name,
81
+ owner: _getRelationshipOwner(r, r.target.id),
82
+ bidirectional: r.sourceOpts.label || normalize(target.name),
83
+ multiple: multiple(r.targetOpts.multiplicity),
84
+ required: required(r.targetOpts.multiplicity),
85
+ });
86
+ });
87
+
88
+ return ret;
89
+ }
90
+
91
+ function dataModel(input) {
92
+ const ret = {};
93
+ ret.enums = enums(input.cells.filter((o) => o.type === "custom.Enum"));
94
+ ret.entities = entities(input.cells.filter((o) => o.type === "custom.Class"));
95
+ relationships(ret.entities, input);
96
+ return ret;
97
+ }
98
+
99
+ function forms(entities, features) {
100
+ return entities.map((e) => {
101
+ const props = _getProperties(e, entities);
102
+ return {
103
+ id: e.name + " Form",
104
+ properties: _sortProperties(props, e),
105
+ entity: e.name,
106
+ abstract: e.abstract,
107
+ creatable: features.indexOf("GUI_F_Creatable") !== -1,
108
+ editable: features.indexOf("GUI_F_Editable") !== -1,
109
+ removable: features.indexOf("GUI_F_Removable") !== -1,
110
+ confirmation: features.indexOf("GUI_F_R_ConfirmationAlert") !== -1,
111
+ };
112
+ });
113
+ }
114
+
115
+ function lists(entities, features, forms) {
116
+ const formNeeded = features.indexOf("GUI_L_FormLink") !== -1;
117
+ return entities
118
+ .filter((e) => !e.abstract)
119
+ .map((e) => {
120
+ const entityForm = _getForm(e.name, forms);
121
+ const props = _getProperties(e, entities, forms);
122
+ return {
123
+ id: e.name + " List",
124
+ abstract: e.abstract,
125
+ properties: _sortProperties(props, e),
126
+ entity: e.name,
127
+ form: entityForm && entityForm.id,
128
+ removeLink: formNeeded && entityForm && entityForm.removable,
129
+ sorting: features.indexOf("GUI_L_Sortable") !== -1,
130
+ searching: features.indexOf("GUI_L_F_BasicSearch") !== -1,
131
+ filtering: features.indexOf("GUI_L_F_RowFilter") !== -1,
132
+ };
133
+ });
134
+ }
135
+
136
+ function _getForm(entityName, forms) {
137
+ return forms.find((f) => f.entity === entityName);
138
+ }
139
+
140
+ function _getProperties(e, entities, forms) {
141
+ if (forms === undefined) forms = [];
142
+ const props = forms.length ? _getPropertiesLists(e, forms) : _getPropertiesForms(e);
143
+ const superclass = e.superclass ? entities.find((entity) => entity.name === e.superclass) : null;
144
+ return superclass ? props.concat(_getProperties(superclass, entities, forms)) : props;
145
+ }
146
+
147
+ function _getPropertiesLists(e, forms) {
148
+ return e.properties
149
+ .filter((p) => p.owner === undefined || p.owner)
150
+ .map((p) => ({
151
+ property: p.name,
152
+ form: _getForm(e.name, forms) && _getForm(e.name, forms).id,
153
+ owner: e.name,
154
+ }));
155
+ }
156
+
157
+ function _getPropertiesForms(e) {
158
+ return e.properties
159
+ .filter((p) => p.owner === undefined || p.owner)
160
+ .map((p) => ({
161
+ property: p.name,
162
+ viewing: true,
163
+ editing: p.name !== "id",
164
+ owner: e.name,
165
+ }));
166
+ }
167
+
168
+ function _sortProperties(props, entity) {
169
+ const displayString = entity.displayString.replace("$", "");
170
+ const idProp = props.find((p) => p.property === "id");
171
+ const displayProp = props.find((p) => p.property === displayString);
172
+ props = props.filter((p) => p !== idProp && p !== displayProp);
173
+ return displayProp !== idProp ? [idProp, displayProp].concat(props) : [idProp].concat(props);
174
+ }
175
+
176
+ function _getDisplayString(entity, entities) {
177
+ const displayString = entity.properties.find((e) => e.displayString);
178
+ if (!displayString && entity.superclass) {
179
+ return _getDisplayString(entities.find((e) => e.name === entity.superclass.name), entities);
180
+ } else if (displayString) {
181
+ return displayString.name;
182
+ } else {
183
+ return "id";
184
+ }
185
+ }
186
+
187
+ function _getRelationshipOwner(rel, entityId) {
188
+ const isSource = rel.source.id === entityId;
189
+ const relType =
190
+ (multiple(rel.targetOpts.multiplicity) ? "Many" : "One") +
191
+ "To" +
192
+ (multiple(rel.sourceOpts.multiplicity) ? "Many" : "One");
193
+ if (relType === "OneToMany") return !isSource;
194
+ else return isSource;
195
+ }
196
+
197
+ function findEntityById(id, col) {
198
+ return col.find((o) => o.id === id);
199
+ }
200
+
201
+ function findEntityByName(name, col) {
202
+ return col.find((o) => o.name === name);
203
+ }
204
+
205
+ function multiple(multiplicity) {
206
+ return ["1", "0..1"].find((a) => a === multiplicity) == null;
207
+ }
208
+
209
+ function required() {
210
+ return false;
211
+ }
@@ -0,0 +1,36 @@
1
+ // Sensor metamodel helper functions
2
+ // These are appended to core/extra.js and made available to codegen templates.
3
+
4
+ function getSensors(data) {
5
+ return (data.dataWarehouse && data.dataWarehouse.sensors) || [];
6
+ }
7
+
8
+ function getSensor(data, sensorId) {
9
+ return getSensors(data).find(function (s) {
10
+ return s.id === sensorId;
11
+ });
12
+ }
13
+
14
+ function getSensorMeasurements(sensor) {
15
+ return (sensor && sensor.measureData) || [];
16
+ }
17
+
18
+ function getSensorDimensions(sensor) {
19
+ return (sensor && sensor.dimensions) || [];
20
+ }
21
+
22
+ function getSensorSpatialDimensions(sensor) {
23
+ return getSensorDimensions(sensor).filter(function (d) {
24
+ return d.type === 'SPATIAL';
25
+ });
26
+ }
27
+
28
+ function getSensorCategoricalDimensions(sensor) {
29
+ return getSensorDimensions(sensor).filter(function (d) {
30
+ return d.type === 'CATEGORICAL';
31
+ });
32
+ }
33
+
34
+ function getSensorGroups(data) {
35
+ return (data.dataWarehouse && data.dataWarehouse.sensorGroups) || [];
36
+ }
@@ -0,0 +1,47 @@
1
+ // Fallback path: runs when #buildEngineSpec in ProductService did NOT trigger the engine's
2
+ // fast-path shortcut (i.e. parsed.data.basicData was absent). For fully-valid sensor products
3
+ // the fast-path fires instead and this processor receives input.sensor === undefined.
4
+ registerMetamodelProcessor(function processSensor(ret, input) {
5
+ const sensor = input.sensor;
6
+ if (!sensor || !sensor.parsed) return;
7
+
8
+ const parsed = sensor.parsed;
9
+
10
+ // The sensor DSL produces its own feature set (SensorViewer, SV_*, etc.).
11
+ // Override the FM-selected features so the correct platform capabilities are activated.
12
+ if (Array.isArray(parsed.features) && parsed.features.length) {
13
+ ret.features = parsed.features;
14
+ }
15
+
16
+ const data = parsed.data;
17
+ if (!data) return;
18
+
19
+ // Use the parser's basicData which already has the correct packageInfo key names
20
+ // (artifactId / groupId) and the SET DEPLOYMENT extra values.
21
+ // Merge database credentials from the product document (user-configured, not in DSL).
22
+ if (data.basicData) {
23
+ ret.data.basicData = Object.assign({}, data.basicData, {
24
+ database: (input.basicData && input.basicData.database) || {}
25
+ });
26
+ }
27
+
28
+ // The sensor DSL parser already outputs a ready-to-use dataModel
29
+ // (entities/enums) — pass it through directly, overriding any UML-sourced value.
30
+ if (data.dataModel) {
31
+ ret.data.dataModel = data.dataModel;
32
+ }
33
+
34
+ // Sensor-specific data warehouse (sensors, sensorGroups, maps, layers, styles)
35
+ if (data.dataWarehouse) {
36
+ ret.data.dataWarehouse = data.dataWarehouse;
37
+ }
38
+
39
+ if (data.mapViewer) {
40
+ ret.data.mapViewer = data.mapViewer;
41
+ }
42
+
43
+ // forms/lists come from the parser (empty for most sensor products, but respect parsed output).
44
+ // menus and statics are set by the core transformation AFTER processors run.
45
+ ret.data.forms = data.forms || [];
46
+ ret.data.lists = data.lists || [];
47
+ });
@@ -0,0 +1,51 @@
1
+ #
2
+ # A pipeline is composed of independent jobs that run scripts, grouped into stages.
3
+ # Stages run in sequential order, but jobs within stages run in parallel.
4
+ #
5
+ # For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
6
+
7
+ stages:
8
+ - test
9
+
10
+ # Test commands live in ci/test-server.sh and ci/test-client.sh.
11
+ # Domain engineers edit those scripts to wire in real tests; this YAML should
12
+ # not need changes.
13
+
14
+ test_server:
15
+ stage: test
16
+ image: gradle:8-jdk21
17
+ variables:
18
+ GRADLE_USER_HOME: "$CI_PROJECT_DIR/.gradle"
19
+ script:
20
+ - sh ./ci/test-server.sh
21
+ cache:
22
+ key: gradle-$CI_COMMIT_REF_SLUG
23
+ paths:
24
+ - .gradle/caches
25
+ - .gradle/wrapper
26
+ artifacts:
27
+ when: always
28
+ reports:
29
+ junit: server/build/test-results/test/**/TEST-*.xml
30
+ expire_in: 1 week
31
+ rules:
32
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
33
+ - if: '$CI_COMMIT_BRANCH'
34
+
35
+ test_client:
36
+ stage: test
37
+ image: node:20
38
+ script:
39
+ - sh ./ci/test-client.sh
40
+ cache:
41
+ key: node-$CI_COMMIT_REF_SLUG
42
+ paths:
43
+ - client/node_modules
44
+ artifacts:
45
+ when: always
46
+ reports:
47
+ junit: client/test-results/**/junit*.xml
48
+ expire_in: 1 week
49
+ rules:
50
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
51
+ - if: '$CI_COMMIT_BRANCH'
@@ -0,0 +1,16 @@
1
+ #!/bin/sh
2
+ #
3
+ # Client test command for this product.
4
+ #
5
+ # Default is a no-op (exit 0) so generated products with no tests yield a
6
+ # green pipeline. Replace the echo+exit below with the real test command,
7
+ # e.g.:
8
+ #
9
+ # cd client && npm ci && npm test
10
+ # cd client && yarn install --frozen-lockfile && yarn test
11
+ #
12
+ # Any non-zero exit will fail the test_client job in .gitlab-ci.yml.
13
+
14
+ echo "[test-client] No client tests defined for this product."
15
+ echo "[test-client] Edit ci/test-client.sh to wire in real tests."
16
+ exit 0
@@ -0,0 +1,16 @@
1
+ #!/bin/sh
2
+ #
3
+ # Server test command for this product.
4
+ #
5
+ # Default is a no-op (exit 0) so generated products with no tests yield a
6
+ # green pipeline. Replace the echo+exit below with the real test command,
7
+ # e.g.:
8
+ #
9
+ # cd server && ./gradlew test
10
+ # cd server && mvn test
11
+ #
12
+ # Any non-zero exit will fail the test_server job in .gitlab-ci.yml.
13
+
14
+ echo "[test-server] No server tests defined for this product."
15
+ echo "[test-server] Edit ci/test-server.sh to wire in real tests."
16
+ exit 0