@enervance/insight-cim-model 0.0.382-next1 → 0.0.382-next2
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.
|
@@ -37,75 +37,110 @@ const resolveIfExists = (object, objectPropertyName, instance, instancePropertyN
|
|
|
37
37
|
switch (instancePropertyKind) {
|
|
38
38
|
case InstancePropertyKind.PLAIN:
|
|
39
39
|
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
if (objectPropertyValue === null || objectPropertyValue === undefined) {
|
|
41
|
+
instance[_instancePropertyName] = objectPropertyValue;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
const referenceIdentifier = (0, base_model_utils_1.$identifier)(objectPropertyValue);
|
|
45
|
+
instance[_instancePropertyName] = args.classStore.find_by_id(referenceIdentifier.id);
|
|
46
|
+
if (!instance[_instancePropertyName]) {
|
|
47
|
+
instance[_instancePropertyName] = (0, exports.lookupObjectFromModelContainers)(referenceIdentifier, args);
|
|
48
|
+
}
|
|
44
49
|
}
|
|
45
50
|
}
|
|
46
51
|
break;
|
|
47
52
|
case InstancePropertyKind.MAP:
|
|
48
53
|
{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
objectPropertyValueAsArray = [objectPropertyValueAsArray];
|
|
54
|
+
if (objectPropertyValue === null || objectPropertyValue === undefined) {
|
|
55
|
+
instance[_instancePropertyName] = objectPropertyValue;
|
|
52
56
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
for (const objectPropertyValueEntry of objectPropertyValueAsArray) {
|
|
58
|
-
const referenceIdentifier = (0, base_model_utils_1.$identifier)(objectPropertyValueEntry);
|
|
59
|
-
let referenceInstance = args.classStore.find_by_id(referenceIdentifier.id);
|
|
60
|
-
if (!referenceInstance) {
|
|
61
|
-
referenceInstance = (0, exports.lookupObjectFromModelContainers)(referenceIdentifier, args);
|
|
57
|
+
else {
|
|
58
|
+
let objectPropertyValueAsArray = objectPropertyValue;
|
|
59
|
+
if (!Array.isArray(objectPropertyValueAsArray)) {
|
|
60
|
+
objectPropertyValueAsArray = [objectPropertyValueAsArray];
|
|
62
61
|
}
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
// key is the uuid of the reference; value is the reference as an instance
|
|
63
|
+
const instancePropertyMap = (_a = instance[_instancePropertyName]) !== null && _a !== void 0 ? _a : new Map();
|
|
64
|
+
if (!instance[_instancePropertyName])
|
|
65
|
+
instance[_instancePropertyName] = instancePropertyMap;
|
|
66
|
+
for (const objectPropertyValueEntry of objectPropertyValueAsArray) {
|
|
67
|
+
if (objectPropertyValueEntry === null || objectPropertyValueEntry === undefined) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
const referenceIdentifier = (0, base_model_utils_1.$identifier)(objectPropertyValueEntry);
|
|
72
|
+
let referenceInstance = args.classStore.find_by_id(referenceIdentifier.id);
|
|
73
|
+
if (!referenceInstance) {
|
|
74
|
+
referenceInstance = (0, exports.lookupObjectFromModelContainers)(referenceIdentifier, args);
|
|
75
|
+
}
|
|
76
|
+
if (referenceInstance) {
|
|
77
|
+
instancePropertyMap.set(referenceIdentifier.id, referenceInstance);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
65
80
|
}
|
|
66
81
|
}
|
|
67
82
|
}
|
|
68
83
|
break;
|
|
69
84
|
case InstancePropertyKind.ARRAY:
|
|
70
85
|
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
objectPropertyValueAsArray = [objectPropertyValueAsArray];
|
|
86
|
+
if (objectPropertyValue === null || objectPropertyValue === undefined) {
|
|
87
|
+
instance[_instancePropertyName] = objectPropertyValue;
|
|
74
88
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
for (const objectPropertyValueEntry of objectPropertyValueAsArray) {
|
|
80
|
-
const referenceIdentifier = (0, base_model_utils_1.$identifier)(objectPropertyValueEntry);
|
|
81
|
-
let referenceInstance = args.classStore.find_by_id(referenceIdentifier.id);
|
|
82
|
-
if (!referenceInstance) {
|
|
83
|
-
referenceInstance = (0, exports.lookupObjectFromModelContainers)(referenceIdentifier, args);
|
|
89
|
+
else {
|
|
90
|
+
let objectPropertyValueAsArray = objectPropertyValue;
|
|
91
|
+
if (!Array.isArray(objectPropertyValueAsArray)) {
|
|
92
|
+
objectPropertyValueAsArray = [objectPropertyValueAsArray];
|
|
84
93
|
}
|
|
85
|
-
|
|
86
|
-
|
|
94
|
+
// key is the uuid of the reference; value is the reference as an instance
|
|
95
|
+
const instancePropertyArray = (_b = instance[_instancePropertyName]) !== null && _b !== void 0 ? _b : new Array();
|
|
96
|
+
if (!instance[_instancePropertyName])
|
|
97
|
+
instance[_instancePropertyName] = instancePropertyArray;
|
|
98
|
+
for (const objectPropertyValueEntry of objectPropertyValueAsArray) {
|
|
99
|
+
if (objectPropertyValueEntry === null || objectPropertyValueEntry === undefined) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
const referenceIdentifier = (0, base_model_utils_1.$identifier)(objectPropertyValueEntry);
|
|
104
|
+
let referenceInstance = args.classStore.find_by_id(referenceIdentifier.id);
|
|
105
|
+
if (!referenceInstance) {
|
|
106
|
+
referenceInstance = (0, exports.lookupObjectFromModelContainers)(referenceIdentifier, args);
|
|
107
|
+
}
|
|
108
|
+
if (referenceInstance) {
|
|
109
|
+
instancePropertyArray.push(referenceInstance);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
87
112
|
}
|
|
88
113
|
}
|
|
89
114
|
}
|
|
90
115
|
break;
|
|
91
116
|
case InstancePropertyKind.SET:
|
|
92
117
|
{
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
objectPropertyValueAsArray = [objectPropertyValueAsArray];
|
|
118
|
+
if (objectPropertyValue === null || objectPropertyValue === undefined) {
|
|
119
|
+
instance[_instancePropertyName] = objectPropertyValue;
|
|
96
120
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
for (const objectPropertyValueEntry of objectPropertyValueAsArray) {
|
|
102
|
-
const referenceIdentifier = (0, base_model_utils_1.$identifier)(objectPropertyValueEntry);
|
|
103
|
-
let referenceInstance = args.classStore.find_by_id(referenceIdentifier.id);
|
|
104
|
-
if (!referenceInstance) {
|
|
105
|
-
referenceInstance = (0, exports.lookupObjectFromModelContainers)(referenceIdentifier, args);
|
|
121
|
+
else {
|
|
122
|
+
let objectPropertyValueAsArray = objectPropertyValue;
|
|
123
|
+
if (!Array.isArray(objectPropertyValueAsArray)) {
|
|
124
|
+
objectPropertyValueAsArray = [objectPropertyValueAsArray];
|
|
106
125
|
}
|
|
107
|
-
|
|
108
|
-
|
|
126
|
+
// key is the uuid of the reference; value is the reference as an instance
|
|
127
|
+
const instancePropertyArray = (_c = instance[_instancePropertyName]) !== null && _c !== void 0 ? _c : new Set();
|
|
128
|
+
if (!instance[_instancePropertyName])
|
|
129
|
+
instance[_instancePropertyName] = instancePropertyArray;
|
|
130
|
+
for (const objectPropertyValueEntry of objectPropertyValueAsArray) {
|
|
131
|
+
if (objectPropertyValueEntry === null || objectPropertyValueEntry === undefined) {
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
const referenceIdentifier = (0, base_model_utils_1.$identifier)(objectPropertyValueEntry);
|
|
136
|
+
let referenceInstance = args.classStore.find_by_id(referenceIdentifier.id);
|
|
137
|
+
if (!referenceInstance) {
|
|
138
|
+
referenceInstance = (0, exports.lookupObjectFromModelContainers)(referenceIdentifier, args);
|
|
139
|
+
}
|
|
140
|
+
if (referenceInstance) {
|
|
141
|
+
instancePropertyArray.add(referenceInstance);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
109
144
|
}
|
|
110
145
|
}
|
|
111
146
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-instantiate-utilities.js","sourceRoot":"","sources":["../../../../../../src/adapter/store-adapter/utilities/to-classes/class-instantiate/class-instantiate-utilities.ts"],"names":[],"mappings":";;;AAAA,kEAAsE;
|
|
1
|
+
{"version":3,"file":"class-instantiate-utilities.js","sourceRoot":"","sources":["../../../../../../src/adapter/store-adapter/utilities/to-classes/class-instantiate/class-instantiate-utilities.ts"],"names":[],"mappings":";;;AAAA,kEAAsE;AAK/D,MAAM,+BAA+B,GAAG,CAC7C,UAAsB,EACtB,IAEC,EACc,EAAE;IACjB,KAAK,MAAM,gBAAgB,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACtD,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;QACxD,IAAI,MAAM;YAAE,OAAO,MAAW,CAAC;IACjC,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAZW,QAAA,+BAA+B,mCAY1C;AAGK,MAAM,WAAW,GAAG,CACzB,MAAS,EACT,kBAAqB,EACrB,QAAW,EACX,oBAAuB,EACvB,WAA0C,EAC1C,EAAE;IACF,IAAI,kBAAkB,IAAI,MAAM,EAAE,CAAC;QACjC,aAAa;QACb,MAAM,mBAAmB,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAE/G,MAAM,qBAAqB,GAAG,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,GAAI,kBAAkB,CAAC;QACzE,aAAa;QACb,QAAQ,CAAC,qBAAqB,CAAC,GAAG,mBAAmB,CAAC;IACxD,CAAC;AACH,CAAC,CAAC;AAfW,QAAA,WAAW,eAetB;AAGF,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,iEAAK,CAAA;IACL,iEAAK,CAAA;IACL,6DAAG,CAAA;IACH,6DAAG,CAAA;AACL,CAAC,EALW,oBAAoB,oCAApB,oBAAoB,QAK/B;A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