@one-commerce/sdk-core 1.16.0 → 1.18.0-alpha.0

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.
@@ -519,6 +519,52 @@ var BackofficePlugin = /*#__PURE__*/function (_BaseCallClass8) {
519
519
 
520
520
  return _createClass(BackofficePlugin);
521
521
  }(BaseCallClass);
522
+ var BackofficeAddToCartContext = /*#__PURE__*/function (_BaseCallClass9) {
523
+ _inherits(BackofficeAddToCartContext, _BaseCallClass9);
524
+
525
+ var _super9 = _createSuper(BackofficeAddToCartContext);
526
+
527
+ function BackofficeAddToCartContext() {
528
+ var _this9;
529
+
530
+ _classCallCheck(this, BackofficeAddToCartContext);
531
+
532
+ for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
533
+ args[_key9] = arguments[_key9];
534
+ }
535
+
536
+ _this9 = _super9.call.apply(_super9, [this].concat(args));
537
+
538
+ _defineProperty(_assertThisInitialized(_this9), "serviceName", 'addToCartContext');
539
+
540
+ _defineProperty(_assertThisInitialized(_this9), "productId", void 0);
541
+
542
+ _defineProperty(_assertThisInitialized(_this9), "cartId", void 0);
543
+
544
+ _defineProperty(_assertThisInitialized(_this9), "warehouses", void 0);
545
+
546
+ return _this9;
547
+ }
548
+
549
+ _createClass(BackofficeAddToCartContext, [{
550
+ key: "closePlugin",
551
+ value: function closePlugin() {
552
+ this.call('closePlugin');
553
+ }
554
+ }, {
555
+ key: "closePluginAndAddToCart",
556
+ value: function closePluginAndAddToCart() {
557
+ this.call('closePluginAndAddToCart');
558
+ }
559
+ }, {
560
+ key: "closePluginAndRefreshCart",
561
+ value: function closePluginAndRefreshCart() {
562
+ this.call('closePluginAndRefreshCart');
563
+ }
564
+ }]);
565
+
566
+ return BackofficeAddToCartContext;
567
+ }(BaseCallClass);
522
568
 
523
569
  var Events = /*#__PURE__*/function () {
524
570
  function Events() {
@@ -680,41 +726,71 @@ var ShopCart = /*#__PURE__*/function (_BaseCallClass3) {
680
726
 
681
727
  return ShopCart;
682
728
  }(BaseCallClass);
683
- var ShopUtils = /*#__PURE__*/function (_BaseCallClass4) {
684
- _inherits(ShopUtils, _BaseCallClass4);
729
+ var ShopAuthorization = /*#__PURE__*/function (_BaseCallClass4) {
730
+ _inherits(ShopAuthorization, _BaseCallClass4);
685
731
 
686
- var _super4 = _createSuper(ShopUtils);
732
+ var _super4 = _createSuper(ShopAuthorization);
687
733
 
688
- function ShopUtils(call) {
734
+ function ShopAuthorization() {
689
735
  var _this4;
690
736
 
737
+ _classCallCheck(this, ShopAuthorization);
738
+
739
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
740
+ args[_key4] = arguments[_key4];
741
+ }
742
+
743
+ _this4 = _super4.call.apply(_super4, [this].concat(args));
744
+
745
+ _defineProperty(_assertThisInitialized(_this4), "serviceName", 'authorization');
746
+
747
+ return _this4;
748
+ }
749
+
750
+ _createClass(ShopAuthorization, [{
751
+ key: "getAuthToken",
752
+ value: function getAuthToken() {
753
+ return this.call('getAuthToken');
754
+ }
755
+ }]);
756
+
757
+ return ShopAuthorization;
758
+ }(BaseCallClass);
759
+ var ShopUtils = /*#__PURE__*/function (_BaseCallClass5) {
760
+ _inherits(ShopUtils, _BaseCallClass5);
761
+
762
+ var _super5 = _createSuper(ShopUtils);
763
+
764
+ function ShopUtils(call) {
765
+ var _this5;
766
+
691
767
  _classCallCheck(this, ShopUtils);
692
768
 
693
- _this4 = _super4.call(this, call);
769
+ _this5 = _super5.call(this, call);
694
770
 
695
- _defineProperty(_assertThisInitialized(_this4), "serviceName", 'utils');
771
+ _defineProperty(_assertThisInitialized(_this5), "serviceName", 'utils');
696
772
 
697
- _defineProperty(_assertThisInitialized(_this4), "currency", void 0);
773
+ _defineProperty(_assertThisInitialized(_this5), "currency", void 0);
698
774
 
699
- _defineProperty(_assertThisInitialized(_this4), "isAnonymousAndPurchaseDisabled", void 0);
775
+ _defineProperty(_assertThisInitialized(_this5), "isAnonymousAndPurchaseDisabled", void 0);
700
776
 
701
- _defineProperty(_assertThisInitialized(_this4), "isB2B", void 0);
777
+ _defineProperty(_assertThisInitialized(_this5), "isB2B", void 0);
702
778
 
703
- _defineProperty(_assertThisInitialized(_this4), "isB2BAndPlatformIsNotOpened", void 0);
779
+ _defineProperty(_assertThisInitialized(_this5), "isB2BAndPlatformIsNotOpened", void 0);
704
780
 
705
- _defineProperty(_assertThisInitialized(_this4), "isIndexPage", void 0);
781
+ _defineProperty(_assertThisInitialized(_this5), "isIndexPage", void 0);
706
782
 
707
- _defineProperty(_assertThisInitialized(_this4), "isPurchaseEnabledOrAuthenticated", void 0);
783
+ _defineProperty(_assertThisInitialized(_this5), "isPurchaseEnabledOrAuthenticated", void 0);
708
784
 
709
- _defineProperty(_assertThisInitialized(_this4), "routes", void 0);
785
+ _defineProperty(_assertThisInitialized(_this5), "routes", void 0);
710
786
 
711
- _this4.routes = {
712
- getCategoryPath: _this4.getCategoryPath,
713
- getManufacturerSearchUrl: _this4.getManufacturerSearchUrl,
714
- getProductUrl: _this4.getProductUrl,
715
- isExternalUrl: _this4.isExternalUrl
787
+ _this5.routes = {
788
+ getCategoryPath: _this5.getCategoryPath,
789
+ getManufacturerSearchUrl: _this5.getManufacturerSearchUrl,
790
+ getProductUrl: _this5.getProductUrl,
791
+ isExternalUrl: _this5.isExternalUrl
716
792
  };
717
- return _this4;
793
+ return _this5;
718
794
  }
719
795
 
720
796
  _createClass(ShopUtils, [{
@@ -741,43 +817,43 @@ var ShopUtils = /*#__PURE__*/function (_BaseCallClass4) {
741
817
 
742
818
  return ShopUtils;
743
819
  }(BaseCallClass);
744
- var ShopConfig = /*#__PURE__*/function (_BaseCallClass5) {
745
- _inherits(ShopConfig, _BaseCallClass5);
820
+ var ShopConfig = /*#__PURE__*/function (_BaseCallClass6) {
821
+ _inherits(ShopConfig, _BaseCallClass6);
746
822
 
747
- var _super5 = _createSuper(ShopConfig);
823
+ var _super6 = _createSuper(ShopConfig);
748
824
 
749
825
  function ShopConfig() {
750
- var _this5;
826
+ var _this6;
751
827
 
752
828
  _classCallCheck(this, ShopConfig);
753
829
 
754
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
755
- args[_key4] = arguments[_key4];
830
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
831
+ args[_key5] = arguments[_key5];
756
832
  }
757
833
 
758
- _this5 = _super5.call.apply(_super5, [this].concat(args));
834
+ _this6 = _super6.call.apply(_super6, [this].concat(args));
759
835
 
760
- _defineProperty(_assertThisInitialized(_this5), "serviceName", 'config');
836
+ _defineProperty(_assertThisInitialized(_this6), "serviceName", 'config');
761
837
 
762
- _defineProperty(_assertThisInitialized(_this5), "accessMode", void 0);
838
+ _defineProperty(_assertThisInitialized(_this6), "accessMode", void 0);
763
839
 
764
- _defineProperty(_assertThisInitialized(_this5), "isB2CRegistrationEnabled", void 0);
840
+ _defineProperty(_assertThisInitialized(_this6), "isB2CRegistrationEnabled", void 0);
765
841
 
766
- _defineProperty(_assertThisInitialized(_this5), "isCatalogOpened", void 0);
842
+ _defineProperty(_assertThisInitialized(_this6), "isCatalogOpened", void 0);
767
843
 
768
- _defineProperty(_assertThisInitialized(_this5), "isGrossSelected", void 0);
844
+ _defineProperty(_assertThisInitialized(_this6), "isGrossSelected", void 0);
769
845
 
770
- _defineProperty(_assertThisInitialized(_this5), "isPlatformClosed", void 0);
846
+ _defineProperty(_assertThisInitialized(_this6), "isPlatformClosed", void 0);
771
847
 
772
- _defineProperty(_assertThisInitialized(_this5), "isPlatformOpened", void 0);
848
+ _defineProperty(_assertThisInitialized(_this6), "isPlatformOpened", void 0);
773
849
 
774
- _defineProperty(_assertThisInitialized(_this5), "isPurchaseEnabled", void 0);
850
+ _defineProperty(_assertThisInitialized(_this6), "isPurchaseEnabled", void 0);
775
851
 
776
- _defineProperty(_assertThisInitialized(_this5), "isRegistrationEnabled", void 0);
852
+ _defineProperty(_assertThisInitialized(_this6), "isRegistrationEnabled", void 0);
777
853
 
778
- _defineProperty(_assertThisInitialized(_this5), "currency", void 0);
854
+ _defineProperty(_assertThisInitialized(_this6), "currency", void 0);
779
855
 
780
- return _this5;
856
+ return _this6;
781
857
  }
782
858
 
783
859
  return _createClass(ShopConfig);
@@ -1042,7 +1118,8 @@ var BackofficeSdk = /*#__PURE__*/function (_Sdk) {
1042
1118
  layout: new BackofficeLayout(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1043
1119
  authorization: new BackofficeAuthorization(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1044
1120
  customer: new BackofficeCustomer(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1045
- plugin: new BackofficePlugin(_this5.callFunction.bind(_assertThisInitialized(_this5)))
1121
+ plugin: new BackofficePlugin(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1122
+ addToCartContext: new BackofficeAddToCartContext(_this5.callFunction.bind(_assertThisInitialized(_this5)))
1046
1123
  });
1047
1124
 
1048
1125
  return _this5;
@@ -1071,6 +1148,7 @@ var ShopSdk = /*#__PURE__*/function (_Sdk2) {
1071
1148
  hash: '',
1072
1149
  query: {}
1073
1150
  },
1151
+ authorization: new ShopAuthorization(_this6.callFunction.bind(_assertThisInitialized(_this6))),
1074
1152
  cart: new ShopCart(_this6.callFunction.bind(_assertThisInitialized(_this6))),
1075
1153
  catalog: new ShopCatalog(_this6.callFunction.bind(_assertThisInitialized(_this6))),
1076
1154
  account: new ShopAccount(_this6.callFunction.bind(_assertThisInitialized(_this6))),