@veloceapps/sdk 2.0.3 → 2.0.4

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.
@@ -571,6 +571,7 @@
571
571
  this.states = {};
572
572
  this.uiDefinitionProperties = {};
573
573
  this.lineItem = new rxjs.BehaviorSubject(undefined);
574
+ this.charges = new rxjs.BehaviorSubject({});
574
575
  }
575
576
  ConfigurationService.prototype.init = function (modelId, uiDefinitionProperties) {
576
577
  var _this = this;
@@ -609,8 +610,7 @@
609
610
  .subscribe();
610
611
  };
611
612
  ConfigurationService.prototype.get = function () {
612
- var _a;
613
- return (_a = this.lineItem) === null || _a === void 0 ? void 0 : _a.asObservable().pipe(rxjs.shareReplay());
613
+ return this.lineItem.asObservable().pipe(rxjs.shareReplay());
614
614
  };
615
615
  ConfigurationService.prototype.getSnapshot = function () {
616
616
  return this.lineItem.value ? Object.assign({}, this.lineItem.value) : undefined;
@@ -621,6 +621,20 @@
621
621
  ConfigurationService.prototype.getRuntimeContext = function () {
622
622
  return this.runtimeContext;
623
623
  };
624
+ Object.defineProperty(ConfigurationService.prototype, "charges$", {
625
+ get: function () {
626
+ return this.charges.asObservable();
627
+ },
628
+ enumerable: false,
629
+ configurable: true
630
+ });
631
+ Object.defineProperty(ConfigurationService.prototype, "chargesSnapshot", {
632
+ get: function () {
633
+ return this.charges.value;
634
+ },
635
+ enumerable: false,
636
+ configurable: true
637
+ });
624
638
  ConfigurationService.prototype.configure = function () {
625
639
  var _this = this;
626
640
  var _a, _b;
@@ -635,17 +649,18 @@
635
649
  var request$;
636
650
  if (this.uiDefinitionProperties.pricingEnabled) {
637
651
  request$ = this.configurationApiService.configureAndPriceLineItem(configurationRequest, this.runtimeModel).pipe(rxjsOperators.map(function (_d) {
638
- var lineItem = _d.lineItem, context = _d.context;
652
+ var lineItem = _d.lineItem, context = _d.context, charges = _d.charges;
639
653
  if (context) {
640
654
  _this.contextService.update({ properties: context.properties });
641
655
  }
656
+ _this.charges.next(charges !== null && charges !== void 0 ? charges : {});
642
657
  return lineItem;
643
658
  }));
644
659
  }
645
660
  else {
646
661
  request$ = this.configurationApiService.configureLineItem(configurationRequest, runtimeModel);
647
662
  }
648
- return request$.pipe(rxjsOperators.tap(function (lineItem) { var _a; return lineItem && ((_a = _this.lineItem) === null || _a === void 0 ? void 0 : _a.next(lineItem)); }), rxjsOperators.catchError(function (error) { return rxjs.throwError(function () { var _a; return new Error(((_a = error.error) === null || _a === void 0 ? void 0 : _a.message) || error.message || JSON.stringify(error)); }); }));
663
+ return request$.pipe(rxjsOperators.tap(function (lineItem) { return lineItem && _this.lineItem.next(lineItem); }), rxjsOperators.catchError(function (error) { return rxjs.throwError(function () { var _a; return new Error(((_a = error.error) === null || _a === void 0 ? void 0 : _a.message) || error.message || JSON.stringify(error)); }); }));
649
664
  };
650
665
  ConfigurationService.prototype.createRequest = function (lineItem) {
651
666
  var _a, _b, _c;