@veloceapps/sdk 3.0.5 → 3.0.7

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 (47) hide show
  1. package/bundles/veloce-sdk-cms.umd.js +176 -38
  2. package/bundles/veloce-sdk-cms.umd.js.map +1 -1
  3. package/bundles/veloce-sdk-runtime.umd.js +11 -15
  4. package/bundles/veloce-sdk-runtime.umd.js.map +1 -1
  5. package/bundles/veloce-sdk.umd.js +205 -123
  6. package/bundles/veloce-sdk.umd.js.map +1 -1
  7. package/cms/modules/configuration/types/configuration.types.d.ts +2 -3
  8. package/cms/modules/flow-configuration/index.d.ts +2 -0
  9. package/cms/modules/flow-configuration/services/flow-configuration.service.d.ts +10 -1
  10. package/cms/modules/flow-configuration/services/flow-update.service.d.ts +13 -0
  11. package/cms/modules/flow-configuration/types/update.types.d.ts +12 -0
  12. package/cms/utils/line-item.utils.d.ts +1 -0
  13. package/esm2015/cms/modules/configuration/services/configuration-runtime.service.js +10 -11
  14. package/esm2015/cms/modules/configuration/services/configuration.service.js +4 -3
  15. package/esm2015/cms/modules/configuration/services/runtime-context.service.js +4 -5
  16. package/esm2015/cms/modules/configuration/types/configuration.types.js +1 -1
  17. package/esm2015/cms/modules/flow-configuration/flow-configuration.module.js +4 -3
  18. package/esm2015/cms/modules/flow-configuration/index.js +3 -1
  19. package/esm2015/cms/modules/flow-configuration/services/flow-configuration.service.js +31 -12
  20. package/esm2015/cms/modules/flow-configuration/services/flow-update.service.js +97 -0
  21. package/esm2015/cms/modules/flow-configuration/types/update.types.js +2 -0
  22. package/esm2015/cms/utils/line-item.utils.js +14 -4
  23. package/esm2015/runtime/components/ui-runtime-preview/runtime-preview.component.js +2 -10
  24. package/esm2015/runtime/execution/directives/vl-ramp.directive.js +1 -1
  25. package/esm2015/runtime/services/quote.service.js +10 -6
  26. package/esm2015/src/components/header/cart-overlay/cart-overlay.component.js +60 -0
  27. package/esm2015/src/components/header/cart-overlay/cart-overlay.module.js +21 -0
  28. package/esm2015/src/components/header/header.component.js +20 -11
  29. package/esm2015/src/components/header/header.module.js +6 -4
  30. package/esm2015/src/components/header/header.types.js +1 -1
  31. package/esm2015/src/flow.component.js +1 -1
  32. package/esm2015/src/pages/debug/debug.component.js +16 -11
  33. package/fesm2015/veloce-sdk-cms.js +157 -34
  34. package/fesm2015/veloce-sdk-cms.js.map +1 -1
  35. package/fesm2015/veloce-sdk-runtime.js +10 -14
  36. package/fesm2015/veloce-sdk-runtime.js.map +1 -1
  37. package/fesm2015/veloce-sdk.js +137 -63
  38. package/fesm2015/veloce-sdk.js.map +1 -1
  39. package/package.json +1 -1
  40. package/runtime/execution/directives/vl-ramp.directive.d.ts +1 -1
  41. package/runtime/services/quote.service.d.ts +4 -3
  42. package/src/components/header/cart-overlay/cart-overlay.component.d.ts +21 -0
  43. package/src/components/header/cart-overlay/cart-overlay.module.d.ts +11 -0
  44. package/src/components/header/header.component.d.ts +9 -5
  45. package/src/components/header/header.module.d.ts +3 -1
  46. package/src/components/header/header.types.d.ts +1 -0
  47. package/src/pages/debug/debug.component.d.ts +5 -2
@@ -1373,20 +1373,24 @@
1373
1373
  }], ctorParameters: function () { return [{ type: ConfigurationService }, { type: ContextService }, { type: i3__namespace$1.MessageService }]; } });
1374
1374
 
1375
1375
  var QuoteService = /** @class */ (function () {
1376
- function QuoteService(contextService, quoteApiService, priceApiService) {
1377
- this.contextService = contextService;
1376
+ function QuoteService(context, quoteApiService, priceApiService) {
1377
+ this.context = context;
1378
1378
  this.quoteApiService = quoteApiService;
1379
1379
  this.priceApiService = priceApiService;
1380
1380
  this.quote = new rxjs.BehaviorSubject(null);
1381
+ this.priceLists = [];
1381
1382
  }
1383
+ QuoteService.prototype.reset = function () {
1384
+ this.quote.next(null);
1385
+ };
1382
1386
  QuoteService.prototype.init = function (quoteId, params) {
1383
1387
  var _this = this;
1384
- return rxjs.zip(this.quoteApiService.getQuoteDraft(quoteId, params), this.priceApiService.getPriceLists(), this.contextService.resolve$().pipe(rxjsOperators.filter(Boolean), rxjsOperators.map(function (context) { return context; }))).pipe(rxjsOperators.tap(function (_a) {
1385
- var _b = __read(_a, 3), quote = _b[0], priceLists = _b[1], configurationContext = _b[2];
1388
+ return rxjs.zip(this.quoteApiService.getQuoteDraft(quoteId, params), this.priceApiService.getPriceLists(), this.context.resolve$().pipe(rxjsOperators.filter(Boolean), rxjsOperators.map(function (context) { return context; }))).pipe(rxjsOperators.tap(function (_a) {
1389
+ var _b = __read(_a, 3), quote = _b[0], priceLists = _b[1], context = _b[2];
1386
1390
  _this.quote.next(quote);
1387
1391
  _this.priceLists = priceLists;
1388
- _this.quotePriceList = priceLists.find(function (p) { return p.id === configurationContext.priceListId; });
1389
- _this.contextService.update(Object.assign(Object.assign(Object.assign({}, configurationContext), quote.context), { properties: Object.assign(Object.assign({}, configurationContext.properties), quote.context.properties) }));
1392
+ _this.quotePriceList = priceLists.find(function (p) { return p.id === context.properties.PriceListId; });
1393
+ _this.context.update(Object.assign(Object.assign(Object.assign({}, context), quote.context), { properties: Object.assign(Object.assign({}, context.properties), quote.context.properties) }));
1390
1394
  }), rxjsOperators.map(function () { return undefined; }), rxjsOperators.take(1));
1391
1395
  };
1392
1396
  QuoteService.prototype.setCurrentLineItemState = function (lineItems) {
@@ -4319,16 +4323,8 @@
4319
4323
  this.configurationApiService.getRuntimeDataByModelId(this.modelId),
4320
4324
  this.contextService.create('TestId', i7.ConfigurationContextMode.TEST),
4321
4325
  ]).subscribe(function (_c) {
4322
- var _d = __read(_c, 2), runtimeData = _d[0], ctx = _d[1];
4326
+ var _d = __read(_c, 1), runtimeData = _d[0];
4323
4327
  var _a;
4324
- if (uiDefinition.pricingEnabled) {
4325
- // TODO: uncomment when Shopping Cart is added
4326
- // this.shoppingCartService.resetCart();
4327
- if (uiDefinition.priceList) {
4328
- ctx.priceListId = uiDefinition.priceList;
4329
- }
4330
- _this.contextService.update(ctx);
4331
- }
4332
4328
  var runtimeModel = i7.RuntimeModel.create(runtimeData.types, runtimeData.products);
4333
4329
  var rootType = Array.from(runtimeModel.components.values()).find(function (c) { return uiDefinition.rootType &&
4334
4330
  runtimeModel.isEquals(c.typeName, uiDefinition.rootType) &&