@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
@@ -290,6 +290,75 @@ var BaseCallClass = /*#__PURE__*/function () {
290
290
  return BaseCallClass;
291
291
  }();
292
292
 
293
+ var ContextCallClass = /*#__PURE__*/function (_BaseCallClass) {
294
+ _inherits(ContextCallClass, _BaseCallClass);
295
+
296
+ var _super = _createSuper(ContextCallClass);
297
+
298
+ function ContextCallClass() {
299
+ var _this;
300
+
301
+ _classCallCheck(this, ContextCallClass);
302
+
303
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
304
+ args[_key] = arguments[_key];
305
+ }
306
+
307
+ _this = _super.call.apply(_super, [this].concat(args));
308
+
309
+ _defineProperty(_assertThisInitialized(_this), "serviceName", 'context');
310
+
311
+ return _this;
312
+ }
313
+
314
+ return _createClass(ContextCallClass);
315
+ }(BaseCallClass);
316
+
317
+ var AddToCartContext = /*#__PURE__*/function (_ContextCallClass) {
318
+ _inherits(AddToCartContext, _ContextCallClass);
319
+
320
+ var _super2 = _createSuper(AddToCartContext);
321
+
322
+ function AddToCartContext() {
323
+ var _this2;
324
+
325
+ _classCallCheck(this, AddToCartContext);
326
+
327
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
328
+ args[_key2] = arguments[_key2];
329
+ }
330
+
331
+ _this2 = _super2.call.apply(_super2, [this].concat(args));
332
+
333
+ _defineProperty(_assertThisInitialized(_this2), "productId", void 0);
334
+
335
+ _defineProperty(_assertThisInitialized(_this2), "cartId", void 0);
336
+
337
+ _defineProperty(_assertThisInitialized(_this2), "warehouses", void 0);
338
+
339
+ return _this2;
340
+ }
341
+
342
+ _createClass(AddToCartContext, [{
343
+ key: "closePlugin",
344
+ value: function closePlugin() {
345
+ return this.call('closePlugin');
346
+ }
347
+ }, {
348
+ key: "closePluginAndAddToCart",
349
+ value: function closePluginAndAddToCart() {
350
+ return this.call('closePluginAndAddToCart');
351
+ }
352
+ }, {
353
+ key: "closePluginAndRefreshCart",
354
+ value: function closePluginAndRefreshCart() {
355
+ return this.call('closePluginAndRefreshCart');
356
+ }
357
+ }]);
358
+
359
+ return AddToCartContext;
360
+ }(ContextCallClass);
361
+
293
362
  var BackofficeCatalog = /*#__PURE__*/function (_BaseCallClass) {
294
363
  _inherits(BackofficeCatalog, _BaseCallClass);
295
364
 
@@ -519,52 +588,6 @@ var BackofficePlugin = /*#__PURE__*/function (_BaseCallClass8) {
519
588
 
520
589
  return _createClass(BackofficePlugin);
521
590
  }(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);
568
591
 
569
592
  var Events = /*#__PURE__*/function () {
570
593
  function Events() {
@@ -897,6 +920,8 @@ var Sdk = /*#__PURE__*/function (_Events) {
897
920
 
898
921
  _defineProperty(_assertThisInitialized(_this), "instances", void 0);
899
922
 
923
+ _defineProperty(_assertThisInitialized(_this), "contextClass", void 0);
924
+
900
925
  _this.initializeServiceGetters();
901
926
 
902
927
  _this.origin = options.origin;
@@ -960,6 +985,11 @@ var Sdk = /*#__PURE__*/function (_Events) {
960
985
  }
961
986
 
962
987
  _createClass(Sdk, [{
988
+ key: "initializeContextClass",
989
+ value: function initializeContextClass() {
990
+ return new this.contextClass(this.callFunction.bind(this));
991
+ }
992
+ }, {
963
993
  key: "initializeServiceGetters",
964
994
  value: function initializeServiceGetters() {
965
995
  var _this2 = this;
@@ -1019,6 +1049,8 @@ var Sdk = /*#__PURE__*/function (_Events) {
1019
1049
  if (typeof options.autoheight !== 'undefined') {
1020
1050
  this.autoheight = options.autoheight;
1021
1051
  }
1052
+
1053
+ this.contextClass = options.context;
1022
1054
  }
1023
1055
  }
1024
1056
  }, {
@@ -1119,7 +1151,7 @@ var BackofficeSdk = /*#__PURE__*/function (_Sdk) {
1119
1151
  authorization: new BackofficeAuthorization(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1120
1152
  customer: new BackofficeCustomer(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1121
1153
  plugin: new BackofficePlugin(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1122
- addToCartContext: new BackofficeAddToCartContext(_this5.callFunction.bind(_assertThisInitialized(_this5)))
1154
+ context: _this5.initializeContextClass()
1123
1155
  });
1124
1156
 
1125
1157
  return _this5;
@@ -1162,5 +1194,5 @@ var ShopSdk = /*#__PURE__*/function (_Sdk2) {
1162
1194
  return _createClass(ShopSdk);
1163
1195
  }(Sdk);
1164
1196
 
1165
- export { BackofficeSdk, SdkEvents, ShopSdk };
1197
+ export { AddToCartContext, BackofficeSdk, SdkEvents, ShopSdk };
1166
1198
  //# sourceMappingURL=bundle.esm.js.map