@one-commerce/sdk-core 1.17.1 → 1.18.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.
@@ -391,15 +391,15 @@
391
391
 
392
392
  return _createClass(BackofficeTenant);
393
393
  }(BaseCallClass);
394
- var BackofficeOrderpath = /*#__PURE__*/function (_BaseCallClass4) {
395
- _inherits(BackofficeOrderpath, _BaseCallClass4);
394
+ var BackofficeLayout = /*#__PURE__*/function (_BaseCallClass4) {
395
+ _inherits(BackofficeLayout, _BaseCallClass4);
396
396
 
397
- var _super4 = _createSuper(BackofficeOrderpath);
397
+ var _super4 = _createSuper(BackofficeLayout);
398
398
 
399
- function BackofficeOrderpath() {
399
+ function BackofficeLayout() {
400
400
  var _this4;
401
401
 
402
- _classCallCheck(this, BackofficeOrderpath);
402
+ _classCallCheck(this, BackofficeLayout);
403
403
 
404
404
  for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
405
405
  args[_key4] = arguments[_key4];
@@ -407,22 +407,24 @@
407
407
 
408
408
  _this4 = _super4.call.apply(_super4, [this].concat(args));
409
409
 
410
- _defineProperty(_assertThisInitialized(_this4), "serviceName", 'orderpath');
410
+ _defineProperty(_assertThisInitialized(_this4), "serviceName", 'layout');
411
+
412
+ _defineProperty(_assertThisInitialized(_this4), "isAsideOpened", void 0);
411
413
 
412
414
  return _this4;
413
415
  }
414
416
 
415
- return _createClass(BackofficeOrderpath);
417
+ return _createClass(BackofficeLayout);
416
418
  }(BaseCallClass);
417
- var BackofficeLayout = /*#__PURE__*/function (_BaseCallClass5) {
418
- _inherits(BackofficeLayout, _BaseCallClass5);
419
+ var BackofficeAuthorization = /*#__PURE__*/function (_BaseCallClass5) {
420
+ _inherits(BackofficeAuthorization, _BaseCallClass5);
419
421
 
420
- var _super5 = _createSuper(BackofficeLayout);
422
+ var _super5 = _createSuper(BackofficeAuthorization);
421
423
 
422
- function BackofficeLayout() {
424
+ function BackofficeAuthorization() {
423
425
  var _this5;
424
426
 
425
- _classCallCheck(this, BackofficeLayout);
427
+ _classCallCheck(this, BackofficeAuthorization);
426
428
 
427
429
  for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
428
430
  args[_key5] = arguments[_key5];
@@ -430,36 +432,11 @@
430
432
 
431
433
  _this5 = _super5.call.apply(_super5, [this].concat(args));
432
434
 
433
- _defineProperty(_assertThisInitialized(_this5), "serviceName", 'layout');
434
-
435
- _defineProperty(_assertThisInitialized(_this5), "isAsideOpened", void 0);
435
+ _defineProperty(_assertThisInitialized(_this5), "serviceName", 'authorization');
436
436
 
437
437
  return _this5;
438
438
  }
439
439
 
440
- return _createClass(BackofficeLayout);
441
- }(BaseCallClass);
442
- var BackofficeAuthorization = /*#__PURE__*/function (_BaseCallClass6) {
443
- _inherits(BackofficeAuthorization, _BaseCallClass6);
444
-
445
- var _super6 = _createSuper(BackofficeAuthorization);
446
-
447
- function BackofficeAuthorization() {
448
- var _this6;
449
-
450
- _classCallCheck(this, BackofficeAuthorization);
451
-
452
- for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
453
- args[_key6] = arguments[_key6];
454
- }
455
-
456
- _this6 = _super6.call.apply(_super6, [this].concat(args));
457
-
458
- _defineProperty(_assertThisInitialized(_this6), "serviceName", 'authorization');
459
-
460
- return _this6;
461
- }
462
-
463
440
  _createClass(BackofficeAuthorization, [{
464
441
  key: "getAuthToken",
465
442
  value: function getAuthToken() {
@@ -469,58 +446,58 @@
469
446
 
470
447
  return BackofficeAuthorization;
471
448
  }(BaseCallClass);
472
- var BackofficeCustomer = /*#__PURE__*/function (_BaseCallClass7) {
473
- _inherits(BackofficeCustomer, _BaseCallClass7);
449
+ var BackofficeCustomer = /*#__PURE__*/function (_BaseCallClass6) {
450
+ _inherits(BackofficeCustomer, _BaseCallClass6);
474
451
 
475
- var _super7 = _createSuper(BackofficeCustomer);
452
+ var _super6 = _createSuper(BackofficeCustomer);
476
453
 
477
454
  function BackofficeCustomer() {
478
- var _this7;
455
+ var _this6;
479
456
 
480
457
  _classCallCheck(this, BackofficeCustomer);
481
458
 
482
- for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
483
- args[_key7] = arguments[_key7];
459
+ for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
460
+ args[_key6] = arguments[_key6];
484
461
  }
485
462
 
486
- _this7 = _super7.call.apply(_super7, [this].concat(args));
463
+ _this6 = _super6.call.apply(_super6, [this].concat(args));
487
464
 
488
- _defineProperty(_assertThisInitialized(_this7), "serviceName", 'customer');
465
+ _defineProperty(_assertThisInitialized(_this6), "serviceName", 'customer');
489
466
 
490
- _defineProperty(_assertThisInitialized(_this7), "id", void 0);
467
+ _defineProperty(_assertThisInitialized(_this6), "id", void 0);
491
468
 
492
- _defineProperty(_assertThisInitialized(_this7), "name", void 0);
469
+ _defineProperty(_assertThisInitialized(_this6), "name", void 0);
493
470
 
494
- return _this7;
471
+ return _this6;
495
472
  }
496
473
 
497
474
  return _createClass(BackofficeCustomer);
498
475
  }(BaseCallClass);
499
- var BackofficePlugin = /*#__PURE__*/function (_BaseCallClass8) {
500
- _inherits(BackofficePlugin, _BaseCallClass8);
476
+ var BackofficePlugin = /*#__PURE__*/function (_BaseCallClass7) {
477
+ _inherits(BackofficePlugin, _BaseCallClass7);
501
478
 
502
- var _super8 = _createSuper(BackofficePlugin);
479
+ var _super7 = _createSuper(BackofficePlugin);
503
480
 
504
481
  function BackofficePlugin() {
505
- var _this8;
482
+ var _this7;
506
483
 
507
484
  _classCallCheck(this, BackofficePlugin);
508
485
 
509
- for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
510
- args[_key8] = arguments[_key8];
486
+ for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
487
+ args[_key7] = arguments[_key7];
511
488
  }
512
489
 
513
- _this8 = _super8.call.apply(_super8, [this].concat(args));
490
+ _this7 = _super7.call.apply(_super7, [this].concat(args));
514
491
 
515
- _defineProperty(_assertThisInitialized(_this8), "serviceName", 'plugin');
492
+ _defineProperty(_assertThisInitialized(_this7), "serviceName", 'plugin');
516
493
 
517
- _defineProperty(_assertThisInitialized(_this8), "id", void 0);
494
+ _defineProperty(_assertThisInitialized(_this7), "id", void 0);
518
495
 
519
- _defineProperty(_assertThisInitialized(_this8), "srcUrl", void 0);
496
+ _defineProperty(_assertThisInitialized(_this7), "srcUrl", void 0);
520
497
 
521
- _defineProperty(_assertThisInitialized(_this8), "name", void 0);
498
+ _defineProperty(_assertThisInitialized(_this7), "name", void 0);
522
499
 
523
- return _this8;
500
+ return _this7;
524
501
  }
525
502
 
526
503
  return _createClass(BackofficePlugin);
@@ -608,15 +585,15 @@
608
585
 
609
586
  return ShopCatalog;
610
587
  }(BaseCallClass);
611
- var ShopAccount = /*#__PURE__*/function (_BaseCallClass2) {
612
- _inherits(ShopAccount, _BaseCallClass2);
588
+ var ShopWishlist = /*#__PURE__*/function (_BaseCallClass2) {
589
+ _inherits(ShopWishlist, _BaseCallClass2);
613
590
 
614
- var _super2 = _createSuper(ShopAccount);
591
+ var _super2 = _createSuper(ShopWishlist);
615
592
 
616
- function ShopAccount() {
593
+ function ShopWishlist() {
617
594
  var _this2;
618
595
 
619
- _classCallCheck(this, ShopAccount);
596
+ _classCallCheck(this, ShopWishlist);
620
597
 
621
598
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
622
599
  args[_key2] = arguments[_key2];
@@ -624,17 +601,57 @@
624
601
 
625
602
  _this2 = _super2.call.apply(_super2, [this].concat(args));
626
603
 
627
- _defineProperty(_assertThisInitialized(_this2), "serviceName", 'account');
604
+ _defineProperty(_assertThisInitialized(_this2), "serviceName", 'wishlist');
628
605
 
629
- _defineProperty(_assertThisInitialized(_this2), "client", void 0);
606
+ return _this2;
607
+ }
630
608
 
631
- _defineProperty(_assertThisInitialized(_this2), "isAuthenticated", void 0);
609
+ _createClass(ShopWishlist, [{
610
+ key: "addProductsToWishlist",
611
+ value: function addProductsToWishlist(wishlistId, newProduct) {
612
+ return this.call('addProductsToWishlist', wishlistId, newProduct);
613
+ }
614
+ }, {
615
+ key: "getWishlists",
616
+ value: function getWishlists() {
617
+ return this.call('getWishlists');
618
+ }
619
+ }, {
620
+ key: "createWishlist",
621
+ value: function createWishlist(name) {
622
+ return this.call('createWishlist', name);
623
+ }
624
+ }]);
632
625
 
633
- _defineProperty(_assertThisInitialized(_this2), "user", void 0);
626
+ return ShopWishlist;
627
+ }(BaseCallClass);
628
+ var ShopAccount = /*#__PURE__*/function (_BaseCallClass3) {
629
+ _inherits(ShopAccount, _BaseCallClass3);
634
630
 
635
- _defineProperty(_assertThisInitialized(_this2), "manager", void 0);
631
+ var _super3 = _createSuper(ShopAccount);
636
632
 
637
- return _this2;
633
+ function ShopAccount() {
634
+ var _this3;
635
+
636
+ _classCallCheck(this, ShopAccount);
637
+
638
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
639
+ args[_key3] = arguments[_key3];
640
+ }
641
+
642
+ _this3 = _super3.call.apply(_super3, [this].concat(args));
643
+
644
+ _defineProperty(_assertThisInitialized(_this3), "serviceName", 'account');
645
+
646
+ _defineProperty(_assertThisInitialized(_this3), "client", void 0);
647
+
648
+ _defineProperty(_assertThisInitialized(_this3), "isAuthenticated", void 0);
649
+
650
+ _defineProperty(_assertThisInitialized(_this3), "user", void 0);
651
+
652
+ _defineProperty(_assertThisInitialized(_this3), "manager", void 0);
653
+
654
+ return _this3;
638
655
  }
639
656
 
640
657
  _createClass(ShopAccount, [{
@@ -650,31 +667,31 @@
650
667
 
651
668
  return ShopAccount;
652
669
  }(BaseCallClass);
653
- var ShopCart = /*#__PURE__*/function (_BaseCallClass3) {
654
- _inherits(ShopCart, _BaseCallClass3);
670
+ var ShopCart = /*#__PURE__*/function (_BaseCallClass4) {
671
+ _inherits(ShopCart, _BaseCallClass4);
655
672
 
656
- var _super3 = _createSuper(ShopCart);
673
+ var _super4 = _createSuper(ShopCart);
657
674
 
658
675
  function ShopCart() {
659
- var _this3;
676
+ var _this4;
660
677
 
661
678
  _classCallCheck(this, ShopCart);
662
679
 
663
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
664
- args[_key3] = arguments[_key3];
680
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
681
+ args[_key4] = arguments[_key4];
665
682
  }
666
683
 
667
- _this3 = _super3.call.apply(_super3, [this].concat(args));
684
+ _this4 = _super4.call.apply(_super4, [this].concat(args));
668
685
 
669
- _defineProperty(_assertThisInitialized(_this3), "serviceName", 'cart');
686
+ _defineProperty(_assertThisInitialized(_this4), "serviceName", 'cart');
670
687
 
671
- _defineProperty(_assertThisInitialized(_this3), "carts", void 0);
688
+ _defineProperty(_assertThisInitialized(_this4), "carts", void 0);
672
689
 
673
- _defineProperty(_assertThisInitialized(_this3), "currentCart", void 0);
690
+ _defineProperty(_assertThisInitialized(_this4), "currentCart", void 0);
674
691
 
675
- _defineProperty(_assertThisInitialized(_this3), "totalCartPrice", void 0);
692
+ _defineProperty(_assertThisInitialized(_this4), "totalCartPrice", void 0);
676
693
 
677
- return _this3;
694
+ return _this4;
678
695
  }
679
696
 
680
697
  _createClass(ShopCart, [{
@@ -686,25 +703,25 @@
686
703
 
687
704
  return ShopCart;
688
705
  }(BaseCallClass);
689
- var ShopAuthorization = /*#__PURE__*/function (_BaseCallClass4) {
690
- _inherits(ShopAuthorization, _BaseCallClass4);
706
+ var ShopAuthorization = /*#__PURE__*/function (_BaseCallClass5) {
707
+ _inherits(ShopAuthorization, _BaseCallClass5);
691
708
 
692
- var _super4 = _createSuper(ShopAuthorization);
709
+ var _super5 = _createSuper(ShopAuthorization);
693
710
 
694
711
  function ShopAuthorization() {
695
- var _this4;
712
+ var _this5;
696
713
 
697
714
  _classCallCheck(this, ShopAuthorization);
698
715
 
699
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
700
- args[_key4] = arguments[_key4];
716
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
717
+ args[_key5] = arguments[_key5];
701
718
  }
702
719
 
703
- _this4 = _super4.call.apply(_super4, [this].concat(args));
720
+ _this5 = _super5.call.apply(_super5, [this].concat(args));
704
721
 
705
- _defineProperty(_assertThisInitialized(_this4), "serviceName", 'authorization');
722
+ _defineProperty(_assertThisInitialized(_this5), "serviceName", 'authorization');
706
723
 
707
- return _this4;
724
+ return _this5;
708
725
  }
709
726
 
710
727
  _createClass(ShopAuthorization, [{
@@ -716,41 +733,41 @@
716
733
 
717
734
  return ShopAuthorization;
718
735
  }(BaseCallClass);
719
- var ShopUtils = /*#__PURE__*/function (_BaseCallClass5) {
720
- _inherits(ShopUtils, _BaseCallClass5);
736
+ var ShopUtils = /*#__PURE__*/function (_BaseCallClass6) {
737
+ _inherits(ShopUtils, _BaseCallClass6);
721
738
 
722
- var _super5 = _createSuper(ShopUtils);
739
+ var _super6 = _createSuper(ShopUtils);
723
740
 
724
741
  function ShopUtils(call) {
725
- var _this5;
742
+ var _this6;
726
743
 
727
744
  _classCallCheck(this, ShopUtils);
728
745
 
729
- _this5 = _super5.call(this, call);
746
+ _this6 = _super6.call(this, call);
730
747
 
731
- _defineProperty(_assertThisInitialized(_this5), "serviceName", 'utils');
748
+ _defineProperty(_assertThisInitialized(_this6), "serviceName", 'utils');
732
749
 
733
- _defineProperty(_assertThisInitialized(_this5), "currency", void 0);
750
+ _defineProperty(_assertThisInitialized(_this6), "currency", void 0);
734
751
 
735
- _defineProperty(_assertThisInitialized(_this5), "isAnonymousAndPurchaseDisabled", void 0);
752
+ _defineProperty(_assertThisInitialized(_this6), "isAnonymousAndPurchaseDisabled", void 0);
736
753
 
737
- _defineProperty(_assertThisInitialized(_this5), "isB2B", void 0);
754
+ _defineProperty(_assertThisInitialized(_this6), "isB2B", void 0);
738
755
 
739
- _defineProperty(_assertThisInitialized(_this5), "isB2BAndPlatformIsNotOpened", void 0);
756
+ _defineProperty(_assertThisInitialized(_this6), "isB2BAndPlatformIsNotOpened", void 0);
740
757
 
741
- _defineProperty(_assertThisInitialized(_this5), "isIndexPage", void 0);
758
+ _defineProperty(_assertThisInitialized(_this6), "isIndexPage", void 0);
742
759
 
743
- _defineProperty(_assertThisInitialized(_this5), "isPurchaseEnabledOrAuthenticated", void 0);
760
+ _defineProperty(_assertThisInitialized(_this6), "isPurchaseEnabledOrAuthenticated", void 0);
744
761
 
745
- _defineProperty(_assertThisInitialized(_this5), "routes", void 0);
762
+ _defineProperty(_assertThisInitialized(_this6), "routes", void 0);
746
763
 
747
- _this5.routes = {
748
- getCategoryPath: _this5.getCategoryPath,
749
- getManufacturerSearchUrl: _this5.getManufacturerSearchUrl,
750
- getProductUrl: _this5.getProductUrl,
751
- isExternalUrl: _this5.isExternalUrl
764
+ _this6.routes = {
765
+ getCategoryPath: _this6.getCategoryPath,
766
+ getManufacturerSearchUrl: _this6.getManufacturerSearchUrl,
767
+ getProductUrl: _this6.getProductUrl,
768
+ isExternalUrl: _this6.isExternalUrl
752
769
  };
753
- return _this5;
770
+ return _this6;
754
771
  }
755
772
 
756
773
  _createClass(ShopUtils, [{
@@ -777,43 +794,43 @@
777
794
 
778
795
  return ShopUtils;
779
796
  }(BaseCallClass);
780
- var ShopConfig = /*#__PURE__*/function (_BaseCallClass6) {
781
- _inherits(ShopConfig, _BaseCallClass6);
797
+ var ShopConfig = /*#__PURE__*/function (_BaseCallClass7) {
798
+ _inherits(ShopConfig, _BaseCallClass7);
782
799
 
783
- var _super6 = _createSuper(ShopConfig);
800
+ var _super7 = _createSuper(ShopConfig);
784
801
 
785
802
  function ShopConfig() {
786
- var _this6;
803
+ var _this7;
787
804
 
788
805
  _classCallCheck(this, ShopConfig);
789
806
 
790
- for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
791
- args[_key5] = arguments[_key5];
807
+ for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
808
+ args[_key6] = arguments[_key6];
792
809
  }
793
810
 
794
- _this6 = _super6.call.apply(_super6, [this].concat(args));
811
+ _this7 = _super7.call.apply(_super7, [this].concat(args));
795
812
 
796
- _defineProperty(_assertThisInitialized(_this6), "serviceName", 'config');
813
+ _defineProperty(_assertThisInitialized(_this7), "serviceName", 'config');
797
814
 
798
- _defineProperty(_assertThisInitialized(_this6), "accessMode", void 0);
815
+ _defineProperty(_assertThisInitialized(_this7), "accessMode", void 0);
799
816
 
800
- _defineProperty(_assertThisInitialized(_this6), "isB2CRegistrationEnabled", void 0);
817
+ _defineProperty(_assertThisInitialized(_this7), "isB2CRegistrationEnabled", void 0);
801
818
 
802
- _defineProperty(_assertThisInitialized(_this6), "isCatalogOpened", void 0);
819
+ _defineProperty(_assertThisInitialized(_this7), "isCatalogOpened", void 0);
803
820
 
804
- _defineProperty(_assertThisInitialized(_this6), "isGrossSelected", void 0);
821
+ _defineProperty(_assertThisInitialized(_this7), "isGrossSelected", void 0);
805
822
 
806
- _defineProperty(_assertThisInitialized(_this6), "isPlatformClosed", void 0);
823
+ _defineProperty(_assertThisInitialized(_this7), "isPlatformClosed", void 0);
807
824
 
808
- _defineProperty(_assertThisInitialized(_this6), "isPlatformOpened", void 0);
825
+ _defineProperty(_assertThisInitialized(_this7), "isPlatformOpened", void 0);
809
826
 
810
- _defineProperty(_assertThisInitialized(_this6), "isPurchaseEnabled", void 0);
827
+ _defineProperty(_assertThisInitialized(_this7), "isPurchaseEnabled", void 0);
811
828
 
812
- _defineProperty(_assertThisInitialized(_this6), "isRegistrationEnabled", void 0);
829
+ _defineProperty(_assertThisInitialized(_this7), "isRegistrationEnabled", void 0);
813
830
 
814
- _defineProperty(_assertThisInitialized(_this6), "currency", void 0);
831
+ _defineProperty(_assertThisInitialized(_this7), "currency", void 0);
815
832
 
816
- return _this6;
833
+ return _this7;
817
834
  }
818
835
 
819
836
  return _createClass(ShopConfig);
@@ -1000,11 +1017,15 @@
1000
1017
  method: fun,
1001
1018
  payload: payload
1002
1019
  });
1003
- return new Promise(function (resolve) {
1020
+ return new Promise(function (resolve, reject) {
1004
1021
  var onChannelMessage = function onChannelMessage(response) {
1005
1022
  if (response.callId === callId) {
1006
1023
  _this4.channel.unsubscribe(main.Message.METHOD_RESULT, onChannelMessage);
1007
1024
 
1025
+ if (response.isException) {
1026
+ return reject(response.result);
1027
+ }
1028
+
1008
1029
  return resolve(response.result);
1009
1030
  }
1010
1031
  };
@@ -1071,7 +1092,6 @@
1071
1092
  hash: '',
1072
1093
  query: {}
1073
1094
  },
1074
- orderpath: new BackofficeOrderpath(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1075
1095
  catalog: new BackofficeCatalog(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1076
1096
  user: new BackofficeUser(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1077
1097
  tenant: new BackofficeTenant(_this5.callFunction.bind(_assertThisInitialized(_this5))),
@@ -1112,7 +1132,8 @@
1112
1132
  catalog: new ShopCatalog(_this6.callFunction.bind(_assertThisInitialized(_this6))),
1113
1133
  account: new ShopAccount(_this6.callFunction.bind(_assertThisInitialized(_this6))),
1114
1134
  utils: new ShopUtils(_this6.callFunction.bind(_assertThisInitialized(_this6))),
1115
- config: new ShopConfig(_this6.callFunction.bind(_assertThisInitialized(_this6)))
1135
+ config: new ShopConfig(_this6.callFunction.bind(_assertThisInitialized(_this6))),
1136
+ wishlist: new ShopWishlist(_this6.callFunction.bind(_assertThisInitialized(_this6)))
1116
1137
  });
1117
1138
 
1118
1139
  return _this6;