@one-commerce/sdk-core 1.18.0-alpha.0 → 1.19.2-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.
Files changed (38) hide show
  1. package/lib/bundles/bundle.esm.js +80 -48
  2. package/lib/bundles/bundle.esm.js.map +1 -1
  3. package/lib/bundles/bundle.esm.min.js +1 -1
  4. package/lib/bundles/bundle.esm.min.js.map +1 -1
  5. package/lib/bundles/bundle.umd.js +80 -47
  6. package/lib/bundles/bundle.umd.js.map +1 -1
  7. package/lib/bundles/bundle.umd.min.js +1 -1
  8. package/lib/bundles/bundle.umd.min.js.map +1 -1
  9. package/lib/cjs/backoffice/context.js +104 -0
  10. package/lib/cjs/backoffice/context.js.map +1 -0
  11. package/lib/cjs/{backofficeServices.js → backoffice/services.js} +3 -52
  12. package/lib/cjs/backoffice/services.js.map +1 -0
  13. package/lib/cjs/index.js +34 -17
  14. package/lib/cjs/index.js.map +1 -1
  15. package/lib/cjs/{shopServices.js → shop/services.js} +2 -2
  16. package/lib/cjs/shop/services.js.map +1 -0
  17. package/lib/esm/backoffice/context.js +38 -0
  18. package/lib/esm/backoffice/context.js.map +1 -0
  19. package/lib/esm/{backofficeServices.js → backoffice/services.js} +2 -28
  20. package/lib/esm/backoffice/services.js.map +1 -0
  21. package/lib/esm/index.js +13 -3
  22. package/lib/esm/index.js.map +1 -1
  23. package/lib/esm/{shopServices.js → shop/services.js} +2 -2
  24. package/lib/esm/shop/services.js.map +1 -0
  25. package/lib/types/backoffice/context.d.ts +16 -0
  26. package/lib/types/backoffice/context.d.ts.map +1 -0
  27. package/lib/types/{backofficeServices.d.ts → backoffice/services.d.ts} +2 -11
  28. package/lib/types/backoffice/services.d.ts.map +1 -0
  29. package/lib/types/index.d.ts +11 -5
  30. package/lib/types/index.d.ts.map +1 -1
  31. package/lib/types/{shopServices.d.ts → shop/services.d.ts} +2 -2
  32. package/lib/types/{shopServices.d.ts.map → shop/services.d.ts.map} +1 -1
  33. package/package.json +3 -3
  34. package/lib/cjs/backofficeServices.js.map +0 -1
  35. package/lib/cjs/shopServices.js.map +0 -1
  36. package/lib/esm/backofficeServices.js.map +0 -1
  37. package/lib/esm/shopServices.js.map +0 -1
  38. package/lib/types/backofficeServices.d.ts.map +0 -1
@@ -296,6 +296,75 @@
296
296
  return BaseCallClass;
297
297
  }();
298
298
 
299
+ var ContextCallClass = /*#__PURE__*/function (_BaseCallClass) {
300
+ _inherits(ContextCallClass, _BaseCallClass);
301
+
302
+ var _super = _createSuper(ContextCallClass);
303
+
304
+ function ContextCallClass() {
305
+ var _this;
306
+
307
+ _classCallCheck(this, ContextCallClass);
308
+
309
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
310
+ args[_key] = arguments[_key];
311
+ }
312
+
313
+ _this = _super.call.apply(_super, [this].concat(args));
314
+
315
+ _defineProperty(_assertThisInitialized(_this), "serviceName", 'context');
316
+
317
+ return _this;
318
+ }
319
+
320
+ return _createClass(ContextCallClass);
321
+ }(BaseCallClass);
322
+
323
+ var AddToCartContext = /*#__PURE__*/function (_ContextCallClass) {
324
+ _inherits(AddToCartContext, _ContextCallClass);
325
+
326
+ var _super2 = _createSuper(AddToCartContext);
327
+
328
+ function AddToCartContext() {
329
+ var _this2;
330
+
331
+ _classCallCheck(this, AddToCartContext);
332
+
333
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
334
+ args[_key2] = arguments[_key2];
335
+ }
336
+
337
+ _this2 = _super2.call.apply(_super2, [this].concat(args));
338
+
339
+ _defineProperty(_assertThisInitialized(_this2), "productId", void 0);
340
+
341
+ _defineProperty(_assertThisInitialized(_this2), "cartId", void 0);
342
+
343
+ _defineProperty(_assertThisInitialized(_this2), "warehouses", void 0);
344
+
345
+ return _this2;
346
+ }
347
+
348
+ _createClass(AddToCartContext, [{
349
+ key: "closePlugin",
350
+ value: function closePlugin() {
351
+ return this.call('closePlugin');
352
+ }
353
+ }, {
354
+ key: "closePluginAndAddToCart",
355
+ value: function closePluginAndAddToCart() {
356
+ return this.call('closePluginAndAddToCart');
357
+ }
358
+ }, {
359
+ key: "closePluginAndRefreshCart",
360
+ value: function closePluginAndRefreshCart() {
361
+ return this.call('closePluginAndRefreshCart');
362
+ }
363
+ }]);
364
+
365
+ return AddToCartContext;
366
+ }(ContextCallClass);
367
+
299
368
  var BackofficeCatalog = /*#__PURE__*/function (_BaseCallClass) {
300
369
  _inherits(BackofficeCatalog, _BaseCallClass);
301
370
 
@@ -525,52 +594,6 @@
525
594
 
526
595
  return _createClass(BackofficePlugin);
527
596
  }(BaseCallClass);
528
- var BackofficeAddToCartContext = /*#__PURE__*/function (_BaseCallClass9) {
529
- _inherits(BackofficeAddToCartContext, _BaseCallClass9);
530
-
531
- var _super9 = _createSuper(BackofficeAddToCartContext);
532
-
533
- function BackofficeAddToCartContext() {
534
- var _this9;
535
-
536
- _classCallCheck(this, BackofficeAddToCartContext);
537
-
538
- for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
539
- args[_key9] = arguments[_key9];
540
- }
541
-
542
- _this9 = _super9.call.apply(_super9, [this].concat(args));
543
-
544
- _defineProperty(_assertThisInitialized(_this9), "serviceName", 'addToCartContext');
545
-
546
- _defineProperty(_assertThisInitialized(_this9), "productId", void 0);
547
-
548
- _defineProperty(_assertThisInitialized(_this9), "cartId", void 0);
549
-
550
- _defineProperty(_assertThisInitialized(_this9), "warehouses", void 0);
551
-
552
- return _this9;
553
- }
554
-
555
- _createClass(BackofficeAddToCartContext, [{
556
- key: "closePlugin",
557
- value: function closePlugin() {
558
- this.call('closePlugin');
559
- }
560
- }, {
561
- key: "closePluginAndAddToCart",
562
- value: function closePluginAndAddToCart() {
563
- this.call('closePluginAndAddToCart');
564
- }
565
- }, {
566
- key: "closePluginAndRefreshCart",
567
- value: function closePluginAndRefreshCart() {
568
- this.call('closePluginAndRefreshCart');
569
- }
570
- }]);
571
-
572
- return BackofficeAddToCartContext;
573
- }(BaseCallClass);
574
597
 
575
598
  var Events = /*#__PURE__*/function () {
576
599
  function Events() {
@@ -903,6 +926,8 @@
903
926
 
904
927
  _defineProperty(_assertThisInitialized(_this), "instances", void 0);
905
928
 
929
+ _defineProperty(_assertThisInitialized(_this), "contextClass", void 0);
930
+
906
931
  _this.initializeServiceGetters();
907
932
 
908
933
  _this.origin = options.origin;
@@ -966,6 +991,11 @@
966
991
  }
967
992
 
968
993
  _createClass(Sdk, [{
994
+ key: "initializeContextClass",
995
+ value: function initializeContextClass() {
996
+ return new this.contextClass(this.callFunction.bind(this));
997
+ }
998
+ }, {
969
999
  key: "initializeServiceGetters",
970
1000
  value: function initializeServiceGetters() {
971
1001
  var _this2 = this;
@@ -1025,6 +1055,8 @@
1025
1055
  if (typeof options.autoheight !== 'undefined') {
1026
1056
  this.autoheight = options.autoheight;
1027
1057
  }
1058
+
1059
+ this.contextClass = options.context;
1028
1060
  }
1029
1061
  }
1030
1062
  }, {
@@ -1125,7 +1157,7 @@
1125
1157
  authorization: new BackofficeAuthorization(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1126
1158
  customer: new BackofficeCustomer(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1127
1159
  plugin: new BackofficePlugin(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1128
- addToCartContext: new BackofficeAddToCartContext(_this5.callFunction.bind(_assertThisInitialized(_this5)))
1160
+ context: _this5.initializeContextClass()
1129
1161
  });
1130
1162
 
1131
1163
  return _this5;
@@ -1168,6 +1200,7 @@
1168
1200
  return _createClass(ShopSdk);
1169
1201
  }(Sdk);
1170
1202
 
1203
+ exports.AddToCartContext = AddToCartContext;
1171
1204
  exports.BackofficeSdk = BackofficeSdk;
1172
1205
  exports.ShopSdk = ShopSdk;
1173
1206