@veloceapps/sdk 11.0.0-1 → 11.0.0-11

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 (30) hide show
  1. package/cms/cms.actions.d.ts +0 -40
  2. package/cms/vendor-map.d.ts +10 -21
  3. package/core/modules/configuration/services/configuration-state.service.d.ts +0 -4
  4. package/core/modules/configuration/services/configuration.service.d.ts +5 -1
  5. package/core/modules/configuration/services/runtime-context.service.d.ts +1 -1
  6. package/core/modules/configuration/types/configuration-runtime.types.d.ts +2 -0
  7. package/core/types/flow-customization.types.d.ts +0 -12
  8. package/esm2020/cms/cms.actions.mjs +1 -36
  9. package/esm2020/cms/components/element-tools-panel/element-tools-panel.component.mjs +3 -3
  10. package/esm2020/cms/vendor-map.mjs +4 -9
  11. package/esm2020/core/modules/configuration/services/configuration-runtime.service.mjs +4 -2
  12. package/esm2020/core/modules/configuration/services/configuration-state.service.mjs +2 -3
  13. package/esm2020/core/modules/configuration/services/configuration.service.mjs +29 -10
  14. package/esm2020/core/modules/configuration/services/runtime-context.service.mjs +5 -3
  15. package/esm2020/core/modules/configuration/types/configuration-runtime.types.mjs +1 -1
  16. package/esm2020/core/types/flow-customization.types.mjs +1 -1
  17. package/esm2020/src/pages/product/product.component.mjs +9 -2
  18. package/fesm2015/veloceapps-sdk-cms.mjs +15 -52
  19. package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
  20. package/fesm2015/veloceapps-sdk-core.mjs +32 -14
  21. package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
  22. package/fesm2015/veloceapps-sdk.mjs +9 -2
  23. package/fesm2015/veloceapps-sdk.mjs.map +1 -1
  24. package/fesm2020/veloceapps-sdk-cms.mjs +7 -54
  25. package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
  26. package/fesm2020/veloceapps-sdk-core.mjs +34 -14
  27. package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
  28. package/fesm2020/veloceapps-sdk.mjs +8 -1
  29. package/fesm2020/veloceapps-sdk.mjs.map +1 -1
  30. package/package.json +1 -1
@@ -1422,7 +1422,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1422
1422
  }], ctorParameters: function () { return [{ type: i1.ConfigurationSettingsApiService }]; } });
1423
1423
 
1424
1424
  class ConfigurationService {
1425
- constructor(quoteDraftService, runtimeService, contextService, configurationApiService, messageService, dialogService, runtimeSettings) {
1425
+ constructor(quoteDraftService, runtimeService, contextService, configurationApiService, messageService, dialogService, runtimeSettings, flowInfoService) {
1426
1426
  this.quoteDraftService = quoteDraftService;
1427
1427
  this.runtimeService = runtimeService;
1428
1428
  this.contextService = contextService;
@@ -1430,6 +1430,7 @@ class ConfigurationService {
1430
1430
  this.messageService = messageService;
1431
1431
  this.dialogService = dialogService;
1432
1432
  this.runtimeSettings = runtimeSettings;
1433
+ this.flowInfoService = flowInfoService;
1433
1434
  this.mode = ConfigurationMode.SEARCH;
1434
1435
  this.configurationState = new BehaviorSubject(null);
1435
1436
  this.previousConfigurationState = new BehaviorSubject(null);
@@ -1542,8 +1543,12 @@ class ConfigurationService {
1542
1543
  const customPriceApi = this.runtimeSettings.getConfigurationSettings()['CUSTOM_PRICE_API'];
1543
1544
  this.isLoadingSubj$.next(true);
1544
1545
  const configure$ = pricingEnabled && customPriceApi
1545
- ? this.configurationApiService.customConfigurePrice({ url: customPriceApi, configurationRequest, runtimeModel })
1546
- : this.configurationApiService.configureLineItem({
1546
+ ? this.configurationApiService.customConfigurePrice({
1547
+ url: customPriceApi,
1548
+ configurationRequest: this.extendConfigurationRequest(configurationRequest),
1549
+ runtimeModel,
1550
+ })
1551
+ : this.extendedConfigureLineItem$({
1547
1552
  configurationRequest,
1548
1553
  runtimeModel,
1549
1554
  pricingEnabled,
@@ -1578,11 +1583,9 @@ class ConfigurationService {
1578
1583
  }), finalize$1(() => this.reset()));
1579
1584
  }
1580
1585
  configureGuidedSelling$(data) {
1581
- return this.configurationApiService
1582
- .configureLineItem({
1586
+ return this.extendedConfigureLineItem$({
1583
1587
  configurationRequest: getGuidedSellingConfigurationRequest(data, this.contextService.resolve()),
1584
- })
1585
- .pipe(catchError$1(error => {
1588
+ }).pipe(catchError$1(error => {
1586
1589
  if (error instanceof HttpErrorResponse) {
1587
1590
  this.messageService.add({ severity: ToastType.error, summary: error.error.message || error.error });
1588
1591
  }
@@ -1659,12 +1662,24 @@ class ConfigurationService {
1659
1662
  }
1660
1663
  });
1661
1664
  }
1665
+ extendedConfigureLineItem$({ configurationRequest, runtimeModel, pricingEnabled, }) {
1666
+ return this.configurationApiService.configureLineItem({
1667
+ configurationRequest: this.extendConfigurationRequest(configurationRequest),
1668
+ runtimeModel,
1669
+ pricingEnabled,
1670
+ });
1671
+ }
1672
+ extendConfigurationRequest(configurationRequest) {
1673
+ var _a;
1674
+ const procedureName = (_a = this.flowInfoService.flow) === null || _a === void 0 ? void 0 : _a.properties.procedureName;
1675
+ return Object.assign(Object.assign({}, configurationRequest), (procedureName ? { procedureName } : {}));
1676
+ }
1662
1677
  }
1663
- ConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationService, deps: [{ token: QuoteDraftService }, { token: ConfigurationRuntimeService }, { token: ContextService }, { token: i1.ConfigurationApiService }, { token: i5.MessageService }, { token: i6$1.DialogService }, { token: RuntimeSettingsService }], target: i0.ɵɵFactoryTarget.Injectable });
1678
+ ConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationService, deps: [{ token: QuoteDraftService }, { token: ConfigurationRuntimeService }, { token: ContextService }, { token: i1.ConfigurationApiService }, { token: i5.MessageService }, { token: i6$1.DialogService }, { token: RuntimeSettingsService }, { token: FlowInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
1664
1679
  ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationService });
1665
1680
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationService, decorators: [{
1666
1681
  type: Injectable
1667
- }], ctorParameters: function () { return [{ type: QuoteDraftService }, { type: ConfigurationRuntimeService }, { type: ContextService }, { type: i1.ConfigurationApiService }, { type: i5.MessageService }, { type: i6$1.DialogService }, { type: RuntimeSettingsService }]; } });
1682
+ }], ctorParameters: function () { return [{ type: QuoteDraftService }, { type: ConfigurationRuntimeService }, { type: ContextService }, { type: i1.ConfigurationApiService }, { type: i5.MessageService }, { type: i6$1.DialogService }, { type: RuntimeSettingsService }, { type: FlowInfoService }]; } });
1668
1683
 
1669
1684
  class FlowConfigurationService {
1670
1685
  constructor(proceduresApiService, contextService, quoteDraftService, updateService, configurationService, flowInfoService) {
@@ -1936,8 +1951,10 @@ class RuntimeContextService {
1936
1951
  constructor(configurationApiService) {
1937
1952
  this.configurationApiService = configurationApiService;
1938
1953
  }
1939
- getRuntimeContext(productId, offeringId) {
1940
- return this.configurationApiService.getRuntimeDataByProductId(productId, offeringId).pipe(map(runtimeData => {
1954
+ getRuntimeContext(productId, offeringId, defaultUIDefinitionId, requiredUIDefinitionId) {
1955
+ return this.configurationApiService
1956
+ .getRuntimeDataByProductId(productId, offeringId, defaultUIDefinitionId, requiredUIDefinitionId)
1957
+ .pipe(map(runtimeData => {
1941
1958
  var _a;
1942
1959
  const uiDefinitionContainer = this.getUIDefinitionContainer(runtimeData);
1943
1960
  const runtimeModel = RuntimeModel.create(runtimeData.types, runtimeData.products);
@@ -2008,7 +2025,9 @@ class ConfigurationRuntimeService {
2008
2025
  init(props) {
2009
2026
  this.initializationProps = props;
2010
2027
  const context = this.contextService.resolve();
2011
- return this.runtimeContextService.getRuntimeContext(props.productId, props.offeringId).pipe(tap(runtimeContext => {
2028
+ return this.runtimeContextService
2029
+ .getRuntimeContext(props.productId, props.offeringId, props.defaultUIDefinitionId, props.requiredUIDefinitionId)
2030
+ .pipe(tap(runtimeContext => {
2012
2031
  var _a, _b, _c, _d;
2013
2032
  this.uiDefinitionProperties = (_b = (_a = runtimeContext.uiDefinitionContainer) === null || _a === void 0 ? void 0 : _a.source.properties) !== null && _b !== void 0 ? _b : {};
2014
2033
  const { PriceListId } = (_c = context.properties) !== null && _c !== void 0 ? _c : {};
@@ -2177,9 +2196,8 @@ class ConfigurationStateService {
2177
2196
  }
2178
2197
  }), takeUntil(this.canceledConfiguration$));
2179
2198
  }
2180
- saveConfiguration(first, second) {
2199
+ saveConfiguration(flow) {
2181
2200
  var _a, _b, _c, _d;
2182
- const flow = typeof first === 'boolean' ? first : second;
2183
2201
  if (this.isStatefulConfiguration) {
2184
2202
  return this.flowStateApiService
2185
2203
  .saveConfiguration((_a = this.flowStateService.stateId) !== null && _a !== void 0 ? _a : '', (_b = this.stateId) !== null && _b !== void 0 ? _b : '')