@veloceapps/api 9.0.0-7 → 9.0.0-9
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/esm2020/lib/services/configuration-api.service.mjs +26 -28
- package/fesm2015/veloceapps-api.mjs +25 -24
- package/fesm2015/veloceapps-api.mjs.map +1 -1
- package/fesm2020/veloceapps-api.mjs +25 -27
- package/fesm2020/veloceapps-api.mjs.map +1 -1
- package/lib/services/configuration-api.service.d.ts +1 -1
- package/package.json +1 -1
@@ -403,7 +403,7 @@ class ConfigurationApiService {
|
|
403
403
|
if (runtimeModel) {
|
404
404
|
return {
|
405
405
|
...configurePrice,
|
406
|
-
lineItem: this.
|
406
|
+
lineItem: this.updateDomains(configurePrice.lineItem, runtimeModel),
|
407
407
|
};
|
408
408
|
}
|
409
409
|
else {
|
@@ -423,7 +423,7 @@ class ConfigurationApiService {
|
|
423
423
|
if (runtimeModel) {
|
424
424
|
return {
|
425
425
|
...configurePrice,
|
426
|
-
lineItem: this.
|
426
|
+
lineItem: this.updateDomains(configurePrice.lineItem, runtimeModel),
|
427
427
|
};
|
428
428
|
}
|
429
429
|
else {
|
@@ -450,37 +450,35 @@ class ConfigurationApiService {
|
|
450
450
|
url: `${this.SERVICE_URL}/${modelId}/model-test`,
|
451
451
|
});
|
452
452
|
}
|
453
|
-
|
454
|
-
const
|
453
|
+
updateDomains(lineItem, runtimeModel) {
|
454
|
+
const component = runtimeModel.components.get(lineItem.type);
|
455
455
|
const portDomains = { ...lineItem.portDomains };
|
456
456
|
// loop through ports to look for 'None' type domain computations
|
457
|
-
for (const port of
|
458
|
-
const
|
459
|
-
|
460
|
-
|
461
|
-
// there's a 'None' type domain computation
|
462
|
-
if (portDomain.properties?.['domainComputation'] === ('None')) {
|
463
|
-
portDomain.domainTypes = domainTypes;
|
464
|
-
}
|
465
|
-
}
|
466
|
-
else {
|
467
|
-
// there's no port domain so consider that as 'None' type domain computation
|
468
|
-
portDomains[portName] = {
|
469
|
-
name: portName,
|
470
|
-
type: typeName,
|
471
|
-
minCard: Number(min),
|
472
|
-
maxCard: Number(max),
|
473
|
-
domainTypes: domainTypes,
|
474
|
-
properties: {
|
475
|
-
...properties,
|
476
|
-
domainComputation: 'None',
|
477
|
-
},
|
478
|
-
};
|
457
|
+
for (const port of component?.ports ?? []) {
|
458
|
+
const portDomain = portDomains[port.name];
|
459
|
+
if (portDomain?.properties?.['domainComputation'] === ('None')) {
|
460
|
+
portDomain.domainTypes = port.domainTypes;
|
479
461
|
}
|
480
462
|
}
|
463
|
+
const type = runtimeModel.types.find(({ name }) => {
|
464
|
+
return lineItem.type === name;
|
465
|
+
});
|
466
|
+
const attributeDomains = lineItem.attributeDomains;
|
467
|
+
if (type) {
|
468
|
+
const initialDomains = lineItem.attributeDomains;
|
469
|
+
type.attributes.forEach(attribute => {
|
470
|
+
if (Object.prototype.hasOwnProperty.call(initialDomains, attribute.name)) {
|
471
|
+
return;
|
472
|
+
}
|
473
|
+
if (attribute.attributeDomain) {
|
474
|
+
attributeDomains[attribute.name] = attribute.attributeDomain;
|
475
|
+
}
|
476
|
+
});
|
477
|
+
}
|
481
478
|
return {
|
482
479
|
...lineItem,
|
483
|
-
lineItems: lineItem.lineItems?.map(i => this.
|
480
|
+
lineItems: lineItem.lineItems?.map(i => this.updateDomains(i, runtimeModel)),
|
481
|
+
attributeDomains,
|
484
482
|
portDomains,
|
485
483
|
};
|
486
484
|
}
|