@veloceapps/sdk 3.0.6 → 3.0.8
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/bundles/veloce-sdk-cms.umd.js +19 -20
- package/bundles/veloce-sdk-cms.umd.js.map +1 -1
- package/bundles/veloce-sdk-runtime.umd.js +8 -15
- package/bundles/veloce-sdk-runtime.umd.js.map +1 -1
- package/bundles/veloce-sdk.umd.js +9 -7
- package/bundles/veloce-sdk.umd.js.map +1 -1
- package/cms/modules/configuration/types/configuration.types.d.ts +2 -3
- package/esm2015/cms/modules/configuration/services/configuration-runtime.service.js +10 -11
- package/esm2015/cms/modules/configuration/services/configuration.service.js +4 -3
- package/esm2015/cms/modules/configuration/services/runtime-context.service.js +4 -5
- package/esm2015/cms/modules/configuration/types/configuration.types.js +1 -1
- package/esm2015/runtime/components/ui-runtime-preview/runtime-preview.component.js +2 -10
- package/esm2015/runtime/services/quote.service.js +7 -6
- package/esm2015/src/components/header/header.component.js +9 -6
- package/esm2015/src/flow.component.js +1 -1
- package/esm2015/src/pages/debug/debug.component.js +1 -1
- package/fesm2015/veloce-sdk-cms.js +15 -16
- package/fesm2015/veloce-sdk-cms.js.map +1 -1
- package/fesm2015/veloce-sdk-runtime.js +7 -14
- package/fesm2015/veloce-sdk-runtime.js.map +1 -1
- package/fesm2015/veloce-sdk.js +10 -7
- package/fesm2015/veloce-sdk.js.map +1 -1
- package/package.json +1 -1
- package/runtime/services/quote.service.d.ts +3 -3
- package/src/components/header/header.component.d.ts +5 -4
|
@@ -1037,10 +1037,10 @@
|
|
|
1037
1037
|
RuntimeContextService.prototype.getRuntimeContext = function (productId, offeringId) {
|
|
1038
1038
|
var _this = this;
|
|
1039
1039
|
return this.configurationApiService.getRuntimeDataByProductId(productId, offeringId).pipe(rxjsOperators.map(function (runtimeData) {
|
|
1040
|
-
var _a, _b, _c
|
|
1040
|
+
var _a, _b, _c;
|
|
1041
1041
|
var uiDefinition = _this.getUIDefinition(runtimeData);
|
|
1042
1042
|
var runtimeModel = core.RuntimeModel.create(runtimeData.types, runtimeData.products);
|
|
1043
|
-
var
|
|
1043
|
+
var _d = (_a = Array.from(runtimeModel.components.values()).find(function (c) { return c.productId === productId; })) !== null && _a !== void 0 ? _a : {}, productName = _d.productName, properties = _d.properties;
|
|
1044
1044
|
return {
|
|
1045
1045
|
modelId: runtimeData.modelId,
|
|
1046
1046
|
uiDefinition: uiDefinition,
|
|
@@ -1049,10 +1049,9 @@
|
|
|
1049
1049
|
productId: productId,
|
|
1050
1050
|
productType: (properties === null || properties === void 0 ? void 0 : properties.displayName) || productName,
|
|
1051
1051
|
offeringId: offeringId,
|
|
1052
|
-
priceListId: (_b = uiDefinition === null || uiDefinition === void 0 ? void 0 : uiDefinition.properties) === null || _b === void 0 ? void 0 : _b.priceList,
|
|
1053
1052
|
properties: {
|
|
1054
|
-
PricingEnabled: (
|
|
1055
|
-
PriceListId: (
|
|
1053
|
+
PricingEnabled: ((_b = uiDefinition === null || uiDefinition === void 0 ? void 0 : uiDefinition.properties) === null || _b === void 0 ? void 0 : _b.pricingEnabled) ? 'true' : 'false',
|
|
1054
|
+
PriceListId: (_c = uiDefinition === null || uiDefinition === void 0 ? void 0 : uiDefinition.properties) === null || _c === void 0 ? void 0 : _c.priceList,
|
|
1056
1055
|
},
|
|
1057
1056
|
};
|
|
1058
1057
|
}));
|
|
@@ -1108,8 +1107,8 @@
|
|
|
1108
1107
|
return rxjs.combineLatest([
|
|
1109
1108
|
this.apiService.getRuntimeDataByModelId(modelId),
|
|
1110
1109
|
this.contextService.create('TestId', core.ConfigurationContextMode.TEST),
|
|
1111
|
-
]).pipe(rxjsOperators.first(), rxjsOperators.tap(function (
|
|
1112
|
-
var
|
|
1110
|
+
]).pipe(rxjsOperators.first(), rxjsOperators.tap(function (_e) {
|
|
1111
|
+
var _f = __read(_e, 2), runtimeData = _f[0], context = _f[1];
|
|
1113
1112
|
var _a;
|
|
1114
1113
|
_this._runtimeContext = {
|
|
1115
1114
|
modelId: modelId,
|
|
@@ -1117,8 +1116,7 @@
|
|
|
1117
1116
|
runtimeMode: i2.RuntimeMode.TEST,
|
|
1118
1117
|
};
|
|
1119
1118
|
_this.contextService.update({
|
|
1120
|
-
|
|
1121
|
-
properties: Object.assign(Object.assign(Object.assign(Object.assign({}, (_a = _this.runtimeContext) === null || _a === void 0 ? void 0 : _a.properties), configurationContext.properties), { ModelId: modelId, RuntimeMode: core.ConfigurationContextMode.TEST, PricingEnabled: String(_this.uiDefinitionProperties.pricingEnabled), StartDate: new Date().toISOString().substring(0, 10), PriceListId: _this.uiDefinitionProperties.priceList }), uiDefinitionExternals),
|
|
1119
|
+
properties: Object.assign(Object.assign(Object.assign(Object.assign({}, (_a = _this.runtimeContext) === null || _a === void 0 ? void 0 : _a.properties), context.properties), { ModelId: modelId, RuntimeMode: core.ConfigurationContextMode.TEST, PricingEnabled: _this.uiDefinitionProperties.pricingEnabled ? 'true' : 'false', StartDate: new Date().toISOString().substring(0, 10), PriceListId: _this.uiDefinitionProperties.priceList }), uiDefinitionExternals),
|
|
1122
1120
|
});
|
|
1123
1121
|
_this._isInitialized = true;
|
|
1124
1122
|
}));
|
|
@@ -1126,20 +1124,20 @@
|
|
|
1126
1124
|
ConfigurationRuntimeService.prototype.init = function (props) {
|
|
1127
1125
|
var _this = this;
|
|
1128
1126
|
this._assets = props.assets;
|
|
1129
|
-
var
|
|
1130
|
-
if (!
|
|
1127
|
+
var context = this.contextService.resolve();
|
|
1128
|
+
if (!context) {
|
|
1131
1129
|
return rxjs.of();
|
|
1132
1130
|
}
|
|
1133
1131
|
return this.runtimeContextService.getRuntimeContext(props.productId, props.offeringId).pipe(rxjsOperators.tap(function (runtimeContext) {
|
|
1134
|
-
var _a, _b, _c;
|
|
1132
|
+
var _a, _b, _c, _d;
|
|
1135
1133
|
_this.uiDefinitionProperties = (_b = (_a = runtimeContext.uiDefinition) === null || _a === void 0 ? void 0 : _a.properties) !== null && _b !== void 0 ? _b : {};
|
|
1136
|
-
var
|
|
1134
|
+
var PriceListId = ((_c = context.properties) !== null && _c !== void 0 ? _c : {}).PriceListId;
|
|
1135
|
+
var mergeContext = Object.assign(Object.assign({}, runtimeContext), { properties: Object.assign(Object.assign(Object.assign({}, runtimeContext.properties), context.properties), { PricingEnabled: PriceListId ? 'true' : 'false' }) });
|
|
1137
1136
|
_this.id15to18('AccountId', mergeContext.properties);
|
|
1138
1137
|
_this._runtimeContext = mergeContext;
|
|
1139
|
-
if (
|
|
1138
|
+
if (context.properties && ((_d = _this._runtimeContext.properties) === null || _d === void 0 ? void 0 : _d.StartDate)) {
|
|
1140
1139
|
_this.contextService.update({
|
|
1141
|
-
|
|
1142
|
-
properties: Object.assign(Object.assign(Object.assign({}, runtimeContext.properties), configurationContext.properties), { PricingEnabled: String(_this.uiDefinitionProperties.pricingEnabled), PriceListId: _this.uiDefinitionProperties.priceList }),
|
|
1140
|
+
properties: Object.assign(Object.assign({}, _this._runtimeContext.properties), context.properties),
|
|
1143
1141
|
});
|
|
1144
1142
|
}
|
|
1145
1143
|
_this._isInitialized = true;
|
|
@@ -1258,7 +1256,7 @@
|
|
|
1258
1256
|
});
|
|
1259
1257
|
ConfigurationService.prototype.configure = function () {
|
|
1260
1258
|
var _this = this;
|
|
1261
|
-
var _a, _b, _c, _d;
|
|
1259
|
+
var _a, _b, _c, _d, _e;
|
|
1262
1260
|
var runtimeContext = this.getRuntimeContext();
|
|
1263
1261
|
var runtimeModel = this.getRuntimeModel();
|
|
1264
1262
|
if (!runtimeContext || !runtimeModel) {
|
|
@@ -1269,11 +1267,12 @@
|
|
|
1269
1267
|
var configurationRequest = this.createRequest(lineItem);
|
|
1270
1268
|
configurationRequest.lineItems = this.states.currentState || [];
|
|
1271
1269
|
configurationRequest.asset = this.states.asset;
|
|
1272
|
-
var
|
|
1270
|
+
var mainPricingEnabled = (_e = runtimeContext.properties) === null || _e === void 0 ? void 0 : _e.PricingEnabled;
|
|
1271
|
+
var pricingEnabled = mainPricingEnabled ? mainPricingEnabled === 'true' : uiDefinitionProperties.pricingEnabled;
|
|
1273
1272
|
return this.configurationApiService
|
|
1274
1273
|
.configureLineItem({ configurationRequest: configurationRequest, runtimeModel: runtimeModel, pricingEnabled: pricingEnabled })
|
|
1275
|
-
.pipe(rxjsOperators.map(function (
|
|
1276
|
-
var lineItem =
|
|
1274
|
+
.pipe(rxjsOperators.map(function (_f) {
|
|
1275
|
+
var lineItem = _f.lineItem, context = _f.context, charges = _f.charges, deletedLineItems = _f.deletedLineItems;
|
|
1277
1276
|
if (context) {
|
|
1278
1277
|
_this.contextService.update({ properties: context.properties });
|
|
1279
1278
|
}
|