@one-commerce/sdk-core 1.17.0 → 1.19.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.
Files changed (38) hide show
  1. package/lib/bundles/bundle.esm.js +23 -2
  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 +23 -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 +26 -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 +12 -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 +10 -2
  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
@@ -213,7 +213,18 @@ exports.Errors = exports.Message = void 0;
213
213
 
214
214
  var api = {};
215
215
 
216
- Object.defineProperty(api, "__esModule", { value: true });
216
+ (function (exports) {
217
+ Object.defineProperty(exports, "__esModule", { value: true });
218
+ exports.Backoffice = void 0;
219
+ (function (Backoffice) {
220
+ (function (Context) {
221
+ (function (AvailableContext) {
222
+ AvailableContext["ADD_TO_CART"] = "backofficeAddToCart";
223
+ })(Context.AvailableContext || (Context.AvailableContext = {}));
224
+ })(Backoffice.Context || (Backoffice.Context = {}));
225
+ })(exports.Backoffice || (exports.Backoffice = {}));
226
+
227
+ }(api));
217
228
 
218
229
  (function (exports) {
219
230
  var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -851,6 +862,8 @@ var Sdk = /*#__PURE__*/function (_Events) {
851
862
 
852
863
  _defineProperty(_assertThisInitialized(_this), "instances", void 0);
853
864
 
865
+ _defineProperty(_assertThisInitialized(_this), "contextClass", void 0);
866
+
854
867
  _this.initializeServiceGetters();
855
868
 
856
869
  _this.origin = options.origin;
@@ -914,6 +927,11 @@ var Sdk = /*#__PURE__*/function (_Events) {
914
927
  }
915
928
 
916
929
  _createClass(Sdk, [{
930
+ key: "initializeContextClass",
931
+ value: function initializeContextClass() {
932
+ return new this.contextClass(this.callFunction.bind(this));
933
+ }
934
+ }, {
917
935
  key: "initializeServiceGetters",
918
936
  value: function initializeServiceGetters() {
919
937
  var _this2 = this;
@@ -973,6 +991,8 @@ var Sdk = /*#__PURE__*/function (_Events) {
973
991
  if (typeof options.autoheight !== 'undefined') {
974
992
  this.autoheight = options.autoheight;
975
993
  }
994
+
995
+ this.contextClass = options.context;
976
996
  }
977
997
  }
978
998
  }, {
@@ -1072,7 +1092,8 @@ var BackofficeSdk = /*#__PURE__*/function (_Sdk) {
1072
1092
  layout: new BackofficeLayout(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1073
1093
  authorization: new BackofficeAuthorization(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1074
1094
  customer: new BackofficeCustomer(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1075
- plugin: new BackofficePlugin(_this5.callFunction.bind(_assertThisInitialized(_this5)))
1095
+ plugin: new BackofficePlugin(_this5.callFunction.bind(_assertThisInitialized(_this5))),
1096
+ context: _this5.initializeContextClass()
1076
1097
  });
1077
1098
 
1078
1099
  return _this5;