@one-commerce/sdk-core 1.17.1 → 1.19.1-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 +71 -3
  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 +71 -2
  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 +84 -0
  10. package/lib/cjs/backoffice/context.js.map +1 -0
  11. package/lib/cjs/{backofficeServices.js → backoffice/services.js} +2 -2
  12. package/lib/cjs/backoffice/services.js.map +1 -0
  13. package/lib/cjs/index.js +34 -16
  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 +31 -0
  18. package/lib/esm/backoffice/context.js.map +1 -0
  19. package/lib/esm/{backofficeServices.js → backoffice/services.js} +2 -2
  20. package/lib/esm/backoffice/services.js.map +1 -0
  21. package/lib/esm/index.js +14 -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 +13 -0
  26. package/lib/types/backoffice/context.d.ts.map +1 -0
  27. package/lib/types/{backofficeServices.d.ts → backoffice/services.d.ts} +2 -2
  28. package/lib/types/backoffice/services.d.ts.map +1 -0
  29. package/lib/types/index.d.ts +11 -3
  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
@@ -219,7 +219,18 @@
219
219
 
220
220
  var api = {};
221
221
 
222
- Object.defineProperty(api, "__esModule", { value: true });
222
+ (function (exports) {
223
+ Object.defineProperty(exports, "__esModule", { value: true });
224
+ exports.Backoffice = void 0;
225
+ (function (Backoffice) {
226
+ (function (Context) {
227
+ (function (AvailableContext) {
228
+ AvailableContext["ADD_TO_CART"] = "backofficeAddToCart";
229
+ })(Context.AvailableContext || (Context.AvailableContext = {}));
230
+ })(Backoffice.Context || (Backoffice.Context = {}));
231
+ })(exports.Backoffice || (exports.Backoffice = {}));
232
+
233
+ }(api));
223
234
 
224
235
  (function (exports) {
225
236
  var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -296,6 +307,53 @@
296
307
  return BaseCallClass;
297
308
  }();
298
309
 
310
+ var AddToCartContext = /*#__PURE__*/function (_BaseCallClass) {
311
+ _inherits(AddToCartContext, _BaseCallClass);
312
+
313
+ var _super = _createSuper(AddToCartContext);
314
+
315
+ function AddToCartContext() {
316
+ var _this;
317
+
318
+ _classCallCheck(this, AddToCartContext);
319
+
320
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
321
+ args[_key] = arguments[_key];
322
+ }
323
+
324
+ _this = _super.call.apply(_super, [this].concat(args));
325
+
326
+ _defineProperty(_assertThisInitialized(_this), "serviceName", main.Backoffice.Context.AvailableContext.ADD_TO_CART);
327
+
328
+ _defineProperty(_assertThisInitialized(_this), "productId", void 0);
329
+
330
+ _defineProperty(_assertThisInitialized(_this), "cartId", void 0);
331
+
332
+ _defineProperty(_assertThisInitialized(_this), "warehouses", void 0);
333
+
334
+ return _this;
335
+ }
336
+
337
+ _createClass(AddToCartContext, [{
338
+ key: "closePlugin",
339
+ value: function closePlugin() {
340
+ return this.call('closePlugin');
341
+ }
342
+ }, {
343
+ key: "closePluginAndAddToCart",
344
+ value: function closePluginAndAddToCart() {
345
+ return this.call('closePluginAndAddToCart');
346
+ }
347
+ }, {
348
+ key: "closePluginAndRefreshCart",
349
+ value: function closePluginAndRefreshCart() {
350
+ return this.call('closePluginAndRefreshCart');
351
+ }
352
+ }]);
353
+
354
+ return AddToCartContext;
355
+ }(BaseCallClass);
356
+
299
357
  var BackofficeCatalog = /*#__PURE__*/function (_BaseCallClass) {
300
358
  _inherits(BackofficeCatalog, _BaseCallClass);
301
359
 
@@ -857,6 +915,8 @@
857
915
 
858
916
  _defineProperty(_assertThisInitialized(_this), "instances", void 0);
859
917
 
918
+ _defineProperty(_assertThisInitialized(_this), "contextClass", void 0);
919
+
860
920
  _this.initializeServiceGetters();
861
921
 
862
922
  _this.origin = options.origin;
@@ -920,6 +980,11 @@
920
980
  }
921
981
 
922
982
  _createClass(Sdk, [{
983
+ key: "initializeContextClass",
984
+ value: function initializeContextClass() {
985
+ return new this.contextClass(this.callFunction.bind(this));
986
+ }
987
+ }, {
923
988
  key: "initializeServiceGetters",
924
989
  value: function initializeServiceGetters() {
925
990
  var _this2 = this;
@@ -979,6 +1044,8 @@
979
1044
  if (typeof options.autoheight !== 'undefined') {
980
1045
  this.autoheight = options.autoheight;
981
1046
  }
1047
+
1048
+ this.contextClass = options.context;
982
1049
  }
983
1050
  }
984
1051
  }, {
@@ -1078,7 +1145,8 @@
1078
1145
  layout: new BackofficeLayout(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1079
1146
  authorization: new BackofficeAuthorization(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1080
1147
  customer: new BackofficeCustomer(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1081
- plugin: new BackofficePlugin(_this5.callFunction.bind(_assertThisInitialized(_this5)))
1148
+ plugin: new BackofficePlugin(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1149
+ context: _this5.initializeContextClass()
1082
1150
  });
1083
1151
 
1084
1152
  return _this5;
@@ -1121,6 +1189,7 @@
1121
1189
  return _createClass(ShopSdk);
1122
1190
  }(Sdk);
1123
1191
 
1192
+ exports.AddToCartContext = AddToCartContext;
1124
1193
  exports.BackofficeSdk = BackofficeSdk;
1125
1194
  exports.ShopSdk = ShopSdk;
1126
1195