@veloceapps/sdk 11.0.0-0 → 11.0.0-10

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 (42) hide show
  1. package/cms/cms.actions.d.ts +0 -52
  2. package/cms/vendor-map.d.ts +11 -25
  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 -52
  9. package/esm2020/cms/components/element-tools-panel/element-tools-panel.component.mjs +3 -3
  10. package/esm2020/cms/vendor-map.mjs +5 -11
  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/services/flow-info.service.mjs +1 -3
  17. package/esm2020/core/types/flow-customization.types.mjs +1 -1
  18. package/esm2020/src/flow.component.mjs +4 -5
  19. package/esm2020/src/flow.module.mjs +5 -10
  20. package/esm2020/src/pages/product/product.component.mjs +9 -2
  21. package/esm2020/src/services/flow-dialog.service.mjs +1 -30
  22. package/fesm2015/veloceapps-sdk-cms.mjs +16 -72
  23. package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
  24. package/fesm2015/veloceapps-sdk-core.mjs +32 -16
  25. package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
  26. package/fesm2015/veloceapps-sdk.mjs +66 -250
  27. package/fesm2015/veloceapps-sdk.mjs.map +1 -1
  28. package/fesm2020/veloceapps-sdk-cms.mjs +8 -74
  29. package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
  30. package/fesm2020/veloceapps-sdk-core.mjs +34 -16
  31. package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
  32. package/fesm2020/veloceapps-sdk.mjs +65 -249
  33. package/fesm2020/veloceapps-sdk.mjs.map +1 -1
  34. package/package.json +1 -1
  35. package/src/flow.module.d.ts +2 -3
  36. package/src/services/flow-dialog.service.d.ts +0 -4
  37. package/esm2020/src/components/doc-gen/doc-gen.component.mjs +0 -129
  38. package/esm2020/src/components/doc-gen/doc-gen.module.mjs +0 -19
  39. package/esm2020/src/services/doc-gen.service.mjs +0 -34
  40. package/src/components/doc-gen/doc-gen.component.d.ts +0 -26
  41. package/src/components/doc-gen/doc-gen.module.d.ts +0 -9
  42. package/src/services/doc-gen.service.d.ts +0 -13
@@ -260,8 +260,6 @@ class FlowInfoService {
260
260
  return UITemplateType.SHOPPING_CART;
261
261
  case 'catalog':
262
262
  return UITemplateType.CATALOG;
263
- case 'docGen':
264
- return UITemplateType.DOCGEN;
265
263
  case 'guidedSelling':
266
264
  return UITemplateType.GUIDED_SELLING;
267
265
  case 'flowHeader':
@@ -1323,7 +1321,7 @@ function extractMetadata(uiDefinition) {
1323
1321
  }
1324
1322
 
1325
1323
  class ConfigurationService {
1326
- constructor(quoteDraftService, runtimeService, contextService, configurationApiService, messageService, dialogService, runtimeSettings) {
1324
+ constructor(quoteDraftService, runtimeService, contextService, configurationApiService, messageService, dialogService, runtimeSettings, flowInfoService) {
1327
1325
  this.quoteDraftService = quoteDraftService;
1328
1326
  this.runtimeService = runtimeService;
1329
1327
  this.contextService = contextService;
@@ -1331,6 +1329,7 @@ class ConfigurationService {
1331
1329
  this.messageService = messageService;
1332
1330
  this.dialogService = dialogService;
1333
1331
  this.runtimeSettings = runtimeSettings;
1332
+ this.flowInfoService = flowInfoService;
1334
1333
  this.mode = ConfigurationMode.SEARCH;
1335
1334
  this.configurationState = new BehaviorSubject(null);
1336
1335
  this.previousConfigurationState = new BehaviorSubject(null);
@@ -1438,8 +1437,12 @@ class ConfigurationService {
1438
1437
  const customPriceApi = this.runtimeSettings.getConfigurationSettings()['CUSTOM_PRICE_API'];
1439
1438
  this.isLoadingSubj$.next(true);
1440
1439
  const configure$ = pricingEnabled && customPriceApi
1441
- ? this.configurationApiService.customConfigurePrice({ url: customPriceApi, configurationRequest, runtimeModel })
1442
- : this.configurationApiService.configureLineItem({
1440
+ ? this.configurationApiService.customConfigurePrice({
1441
+ url: customPriceApi,
1442
+ configurationRequest: this.extendConfigurationRequest(configurationRequest),
1443
+ runtimeModel,
1444
+ })
1445
+ : this.extendedConfigureLineItem$({
1443
1446
  configurationRequest,
1444
1447
  runtimeModel,
1445
1448
  pricingEnabled,
@@ -1473,11 +1476,9 @@ class ConfigurationService {
1473
1476
  }), finalize$1(() => this.reset()));
1474
1477
  }
1475
1478
  configureGuidedSelling$(data) {
1476
- return this.configurationApiService
1477
- .configureLineItem({
1479
+ return this.extendedConfigureLineItem$({
1478
1480
  configurationRequest: getGuidedSellingConfigurationRequest(data, this.contextService.resolve()),
1479
- })
1480
- .pipe(catchError$1(error => {
1481
+ }).pipe(catchError$1(error => {
1481
1482
  if (error instanceof HttpErrorResponse) {
1482
1483
  this.messageService.add({ severity: ToastType.error, summary: error.error.message || error.error });
1483
1484
  }
@@ -1553,12 +1554,26 @@ class ConfigurationService {
1553
1554
  }
1554
1555
  });
1555
1556
  }
1557
+ extendedConfigureLineItem$({ configurationRequest, runtimeModel, pricingEnabled, }) {
1558
+ return this.configurationApiService.configureLineItem({
1559
+ configurationRequest: this.extendConfigurationRequest(configurationRequest),
1560
+ runtimeModel,
1561
+ pricingEnabled,
1562
+ });
1563
+ }
1564
+ extendConfigurationRequest(configurationRequest) {
1565
+ const procedureName = this.flowInfoService.flow?.properties.procedureName;
1566
+ return {
1567
+ ...configurationRequest,
1568
+ ...(procedureName ? { procedureName } : {}),
1569
+ };
1570
+ }
1556
1571
  }
1557
- 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 });
1572
+ 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 });
1558
1573
  ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationService });
1559
1574
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationService, decorators: [{
1560
1575
  type: Injectable
1561
- }], ctorParameters: function () { return [{ type: QuoteDraftService }, { type: ConfigurationRuntimeService }, { type: ContextService }, { type: i1.ConfigurationApiService }, { type: i5.MessageService }, { type: i6$1.DialogService }, { type: RuntimeSettingsService }]; } });
1576
+ }], ctorParameters: function () { return [{ type: QuoteDraftService }, { type: ConfigurationRuntimeService }, { type: ContextService }, { type: i1.ConfigurationApiService }, { type: i5.MessageService }, { type: i6$1.DialogService }, { type: RuntimeSettingsService }, { type: FlowInfoService }]; } });
1562
1577
 
1563
1578
  class FlowUpdateService {
1564
1579
  update(rootLineItems, updates, charges) {
@@ -1955,8 +1970,10 @@ class RuntimeContextService {
1955
1970
  constructor(configurationApiService) {
1956
1971
  this.configurationApiService = configurationApiService;
1957
1972
  }
1958
- getRuntimeContext(productId, offeringId) {
1959
- return this.configurationApiService.getRuntimeDataByProductId(productId, offeringId).pipe(map(runtimeData => {
1973
+ getRuntimeContext(productId, offeringId, defaultUIDefinitionId, requiredUIDefinitionId) {
1974
+ return this.configurationApiService
1975
+ .getRuntimeDataByProductId(productId, offeringId, defaultUIDefinitionId, requiredUIDefinitionId)
1976
+ .pipe(map(runtimeData => {
1960
1977
  const uiDefinitionContainer = this.getUIDefinitionContainer(runtimeData);
1961
1978
  const runtimeModel = RuntimeModel.create(runtimeData.types, runtimeData.products);
1962
1979
  const { productName, properties } = Array.from(runtimeModel.components.values()).find(c => c.productId === productId) ?? {};
@@ -2031,7 +2048,9 @@ class ConfigurationRuntimeService {
2031
2048
  init(props) {
2032
2049
  this.initializationProps = props;
2033
2050
  const context = this.contextService.resolve();
2034
- return this.runtimeContextService.getRuntimeContext(props.productId, props.offeringId).pipe(tap(runtimeContext => {
2051
+ return this.runtimeContextService
2052
+ .getRuntimeContext(props.productId, props.offeringId, props.defaultUIDefinitionId, props.requiredUIDefinitionId)
2053
+ .pipe(tap(runtimeContext => {
2035
2054
  this.uiDefinitionProperties = runtimeContext.uiDefinitionContainer?.source.properties ?? {};
2036
2055
  const { PriceListId } = context.properties ?? {};
2037
2056
  const mergeContext = {
@@ -2205,8 +2224,7 @@ class ConfigurationStateService {
2205
2224
  }
2206
2225
  }), takeUntil(this.canceledConfiguration$));
2207
2226
  }
2208
- saveConfiguration(first, second) {
2209
- const flow = typeof first === 'boolean' ? first : second;
2227
+ saveConfiguration(flow) {
2210
2228
  if (this.isStatefulConfiguration) {
2211
2229
  return this.flowStateApiService
2212
2230
  .saveConfiguration(this.flowStateService.stateId ?? '', this.stateId ?? '')