@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.
- package/lib/bundles/bundle.esm.js +71 -3
- package/lib/bundles/bundle.esm.js.map +1 -1
- package/lib/bundles/bundle.esm.min.js +1 -1
- package/lib/bundles/bundle.esm.min.js.map +1 -1
- package/lib/bundles/bundle.umd.js +71 -2
- package/lib/bundles/bundle.umd.js.map +1 -1
- package/lib/bundles/bundle.umd.min.js +1 -1
- package/lib/bundles/bundle.umd.min.js.map +1 -1
- package/lib/cjs/backoffice/context.js +84 -0
- package/lib/cjs/backoffice/context.js.map +1 -0
- package/lib/cjs/{backofficeServices.js → backoffice/services.js} +2 -2
- package/lib/cjs/backoffice/services.js.map +1 -0
- package/lib/cjs/index.js +34 -16
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/{shopServices.js → shop/services.js} +2 -2
- package/lib/cjs/shop/services.js.map +1 -0
- package/lib/esm/backoffice/context.js +31 -0
- package/lib/esm/backoffice/context.js.map +1 -0
- package/lib/esm/{backofficeServices.js → backoffice/services.js} +2 -2
- package/lib/esm/backoffice/services.js.map +1 -0
- package/lib/esm/index.js +14 -3
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/{shopServices.js → shop/services.js} +2 -2
- package/lib/esm/shop/services.js.map +1 -0
- package/lib/types/backoffice/context.d.ts +13 -0
- package/lib/types/backoffice/context.d.ts.map +1 -0
- package/lib/types/{backofficeServices.d.ts → backoffice/services.d.ts} +2 -2
- package/lib/types/backoffice/services.d.ts.map +1 -0
- package/lib/types/index.d.ts +11 -3
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/{shopServices.d.ts → shop/services.d.ts} +2 -2
- package/lib/types/{shopServices.d.ts.map → shop/services.d.ts.map} +1 -1
- package/package.json +3 -3
- package/lib/cjs/backofficeServices.js.map +0 -1
- package/lib/cjs/shopServices.js.map +0 -1
- package/lib/esm/backofficeServices.js.map +0 -1
- package/lib/esm/shopServices.js.map +0 -1
- 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
|
-
|
|
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) {
|
|
@@ -290,6 +301,53 @@ var BaseCallClass = /*#__PURE__*/function () {
|
|
|
290
301
|
return BaseCallClass;
|
|
291
302
|
}();
|
|
292
303
|
|
|
304
|
+
var AddToCartContext = /*#__PURE__*/function (_BaseCallClass) {
|
|
305
|
+
_inherits(AddToCartContext, _BaseCallClass);
|
|
306
|
+
|
|
307
|
+
var _super = _createSuper(AddToCartContext);
|
|
308
|
+
|
|
309
|
+
function AddToCartContext() {
|
|
310
|
+
var _this;
|
|
311
|
+
|
|
312
|
+
_classCallCheck(this, AddToCartContext);
|
|
313
|
+
|
|
314
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
315
|
+
args[_key] = arguments[_key];
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
319
|
+
|
|
320
|
+
_defineProperty(_assertThisInitialized(_this), "serviceName", main.Backoffice.Context.AvailableContext.ADD_TO_CART);
|
|
321
|
+
|
|
322
|
+
_defineProperty(_assertThisInitialized(_this), "productId", void 0);
|
|
323
|
+
|
|
324
|
+
_defineProperty(_assertThisInitialized(_this), "cartId", void 0);
|
|
325
|
+
|
|
326
|
+
_defineProperty(_assertThisInitialized(_this), "warehouses", void 0);
|
|
327
|
+
|
|
328
|
+
return _this;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
_createClass(AddToCartContext, [{
|
|
332
|
+
key: "closePlugin",
|
|
333
|
+
value: function closePlugin() {
|
|
334
|
+
return this.call('closePlugin');
|
|
335
|
+
}
|
|
336
|
+
}, {
|
|
337
|
+
key: "closePluginAndAddToCart",
|
|
338
|
+
value: function closePluginAndAddToCart() {
|
|
339
|
+
return this.call('closePluginAndAddToCart');
|
|
340
|
+
}
|
|
341
|
+
}, {
|
|
342
|
+
key: "closePluginAndRefreshCart",
|
|
343
|
+
value: function closePluginAndRefreshCart() {
|
|
344
|
+
return this.call('closePluginAndRefreshCart');
|
|
345
|
+
}
|
|
346
|
+
}]);
|
|
347
|
+
|
|
348
|
+
return AddToCartContext;
|
|
349
|
+
}(BaseCallClass);
|
|
350
|
+
|
|
293
351
|
var BackofficeCatalog = /*#__PURE__*/function (_BaseCallClass) {
|
|
294
352
|
_inherits(BackofficeCatalog, _BaseCallClass);
|
|
295
353
|
|
|
@@ -851,6 +909,8 @@ var Sdk = /*#__PURE__*/function (_Events) {
|
|
|
851
909
|
|
|
852
910
|
_defineProperty(_assertThisInitialized(_this), "instances", void 0);
|
|
853
911
|
|
|
912
|
+
_defineProperty(_assertThisInitialized(_this), "contextClass", void 0);
|
|
913
|
+
|
|
854
914
|
_this.initializeServiceGetters();
|
|
855
915
|
|
|
856
916
|
_this.origin = options.origin;
|
|
@@ -914,6 +974,11 @@ var Sdk = /*#__PURE__*/function (_Events) {
|
|
|
914
974
|
}
|
|
915
975
|
|
|
916
976
|
_createClass(Sdk, [{
|
|
977
|
+
key: "initializeContextClass",
|
|
978
|
+
value: function initializeContextClass() {
|
|
979
|
+
return new this.contextClass(this.callFunction.bind(this));
|
|
980
|
+
}
|
|
981
|
+
}, {
|
|
917
982
|
key: "initializeServiceGetters",
|
|
918
983
|
value: function initializeServiceGetters() {
|
|
919
984
|
var _this2 = this;
|
|
@@ -973,6 +1038,8 @@ var Sdk = /*#__PURE__*/function (_Events) {
|
|
|
973
1038
|
if (typeof options.autoheight !== 'undefined') {
|
|
974
1039
|
this.autoheight = options.autoheight;
|
|
975
1040
|
}
|
|
1041
|
+
|
|
1042
|
+
this.contextClass = options.context;
|
|
976
1043
|
}
|
|
977
1044
|
}
|
|
978
1045
|
}, {
|
|
@@ -1072,7 +1139,8 @@ var BackofficeSdk = /*#__PURE__*/function (_Sdk) {
|
|
|
1072
1139
|
layout: new BackofficeLayout(_this5.callFunction.bind(_assertThisInitialized(_this5))),
|
|
1073
1140
|
authorization: new BackofficeAuthorization(_this5.callFunction.bind(_assertThisInitialized(_this5))),
|
|
1074
1141
|
customer: new BackofficeCustomer(_this5.callFunction.bind(_assertThisInitialized(_this5))),
|
|
1075
|
-
plugin: new BackofficePlugin(_this5.callFunction.bind(_assertThisInitialized(_this5)))
|
|
1142
|
+
plugin: new BackofficePlugin(_this5.callFunction.bind(_assertThisInitialized(_this5))),
|
|
1143
|
+
context: _this5.initializeContextClass()
|
|
1076
1144
|
});
|
|
1077
1145
|
|
|
1078
1146
|
return _this5;
|
|
@@ -1115,5 +1183,5 @@ var ShopSdk = /*#__PURE__*/function (_Sdk2) {
|
|
|
1115
1183
|
return _createClass(ShopSdk);
|
|
1116
1184
|
}(Sdk);
|
|
1117
1185
|
|
|
1118
|
-
export { BackofficeSdk, SdkEvents, ShopSdk };
|
|
1186
|
+
export { AddToCartContext, BackofficeSdk, SdkEvents, ShopSdk };
|
|
1119
1187
|
//# sourceMappingURL=bundle.esm.js.map
|