@one-commerce/sdk-core 1.22.1-UNITYONE-11259.0 → 1.23.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 (45) hide show
  1. package/lib/bundles/bundle.esm.js +152 -25
  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 +152 -24
  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 +57 -33
  10. package/lib/cjs/backoffice/context.js.map +1 -1
  11. package/lib/cjs/events.js +0 -14
  12. package/lib/cjs/events.js.map +1 -1
  13. package/lib/cjs/index.js +19 -10
  14. package/lib/cjs/index.js.map +1 -1
  15. package/lib/cjs/shop/services.js +68 -1
  16. package/lib/cjs/shop/services.js.map +1 -1
  17. package/lib/cjs/utils.js +1 -43
  18. package/lib/cjs/utils.js.map +1 -1
  19. package/lib/esm/backoffice/context.js +11 -1
  20. package/lib/esm/backoffice/context.js.map +1 -1
  21. package/lib/esm/events.js +0 -13
  22. package/lib/esm/events.js.map +1 -1
  23. package/lib/esm/index.js +13 -10
  24. package/lib/esm/index.js.map +1 -1
  25. package/lib/esm/shop/services.js +30 -0
  26. package/lib/esm/shop/services.js.map +1 -1
  27. package/lib/esm/utils.js +0 -8
  28. package/lib/esm/utils.js.map +1 -1
  29. package/lib/types/backoffice/context.d.ts +6 -2
  30. package/lib/types/backoffice/context.d.ts.map +1 -1
  31. package/lib/types/events.d.ts +0 -1
  32. package/lib/types/events.d.ts.map +1 -1
  33. package/lib/types/index.d.ts +18 -16
  34. package/lib/types/index.d.ts.map +1 -1
  35. package/lib/types/shop/services.d.ts +12 -0
  36. package/lib/types/shop/services.d.ts.map +1 -1
  37. package/lib/types/utils.d.ts +0 -3
  38. package/lib/types/utils.d.ts.map +1 -1
  39. package/package.json +3 -3
  40. package/lib/cjs/shop/context.js +0 -88
  41. package/lib/cjs/shop/context.js.map +0 -1
  42. package/lib/esm/shop/context.js +0 -36
  43. package/lib/esm/shop/context.js.map +0 -1
  44. package/lib/types/shop/context.d.ts +0 -16
  45. package/lib/types/shop/context.d.ts.map +0 -1
@@ -294,6 +294,85 @@ var BaseCallClass = /*#__PURE__*/function () {
294
294
  return BaseCallClass;
295
295
  }();
296
296
 
297
+ var ContextCallClass = /*#__PURE__*/function (_BaseCallClass) {
298
+ _inherits(ContextCallClass, _BaseCallClass);
299
+
300
+ var _super = _createSuper(ContextCallClass);
301
+
302
+ function ContextCallClass() {
303
+ var _this;
304
+
305
+ _classCallCheck(this, ContextCallClass);
306
+
307
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
308
+ args[_key] = arguments[_key];
309
+ }
310
+
311
+ _this = _super.call.apply(_super, [this].concat(args));
312
+
313
+ _defineProperty(_assertThisInitialized(_this), "serviceName", 'context');
314
+
315
+ return _this;
316
+ }
317
+
318
+ return _createClass(ContextCallClass);
319
+ }(BaseCallClass);
320
+
321
+ var AddToCartContext = /*#__PURE__*/function (_ContextCallClass) {
322
+ _inherits(AddToCartContext, _ContextCallClass);
323
+
324
+ var _super2 = _createSuper(AddToCartContext);
325
+
326
+ function AddToCartContext() {
327
+ var _this2;
328
+
329
+ _classCallCheck(this, AddToCartContext);
330
+
331
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
332
+ args[_key2] = arguments[_key2];
333
+ }
334
+
335
+ _this2 = _super2.call.apply(_super2, [this].concat(args));
336
+
337
+ _defineProperty(_assertThisInitialized(_this2), "productId", void 0);
338
+
339
+ _defineProperty(_assertThisInitialized(_this2), "cartId", void 0);
340
+
341
+ _defineProperty(_assertThisInitialized(_this2), "offerId", void 0);
342
+
343
+ _defineProperty(_assertThisInitialized(_this2), "warehouses", void 0);
344
+
345
+ _defineProperty(_assertThisInitialized(_this2), "warehouseId", void 0);
346
+
347
+ _defineProperty(_assertThisInitialized(_this2), "meta", void 0);
348
+
349
+ _defineProperty(_assertThisInitialized(_this2), "pluginProductLines", void 0);
350
+
351
+ _defineProperty(_assertThisInitialized(_this2), "productLines", void 0);
352
+
353
+ return _this2;
354
+ }
355
+
356
+ _createClass(AddToCartContext, [{
357
+ key: "closePlugin",
358
+ value: function closePlugin() {
359
+ return this.call('closePlugin');
360
+ }
361
+ }, {
362
+ key: "closePluginAndAddToCart",
363
+ value: function closePluginAndAddToCart() {
364
+ return this.call('closePluginAndAddToCart');
365
+ }
366
+ }, {
367
+ key: "closePluginAndRefreshCart",
368
+ value: function closePluginAndRefreshCart() {
369
+ return this.call('closePluginAndRefreshCart');
370
+ }
371
+ }]);
372
+
373
+ return AddToCartContext;
374
+ }(ContextCallClass);
375
+
297
376
  var BackofficeCatalog = /*#__PURE__*/function (_BaseCallClass) {
298
377
  _inherits(BackofficeCatalog, _BaseCallClass);
299
378
 
@@ -556,20 +635,6 @@ var Events = /*#__PURE__*/function () {
556
635
 
557
636
  this._callbacks[key].push(callback);
558
637
  }
559
- }, {
560
- key: "off",
561
- value: function off(key, callback) {
562
- // if the key exists
563
- if (this._callbacks[key] !== undefined) {
564
- // iterate through the callbacks for the event key
565
- for (var i = 0; i < this._callbacks[key].length; i++) {
566
- // if the callback matches, remove it
567
- if (this._callbacks[key][i] === callback) {
568
- this._callbacks[key].splice(i, 1);
569
- }
570
- }
571
- }
572
- }
573
638
  }, {
574
639
  key: "emit",
575
640
  value: function emit(key) {
@@ -818,6 +883,11 @@ var ShopUtils = /*#__PURE__*/function (_BaseCallClass6) {
818
883
  }
819
884
 
820
885
  _createClass(ShopUtils, [{
886
+ key: "notify",
887
+ value: function notify(options) {
888
+ return this.call('notify', options);
889
+ }
890
+ }, {
821
891
  key: "getCategoryPath",
822
892
  value: function getCategoryPath(id) {
823
893
  return this.call('getCategoryPath', id);
@@ -882,6 +952,62 @@ var ShopConfig = /*#__PURE__*/function (_BaseCallClass7) {
882
952
 
883
953
  return _createClass(ShopConfig);
884
954
  }(BaseCallClass);
955
+ var ShopTenant = /*#__PURE__*/function (_BaseCallClass8) {
956
+ _inherits(ShopTenant, _BaseCallClass8);
957
+
958
+ var _super8 = _createSuper(ShopTenant);
959
+
960
+ function ShopTenant() {
961
+ var _this8;
962
+
963
+ _classCallCheck(this, ShopTenant);
964
+
965
+ for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
966
+ args[_key7] = arguments[_key7];
967
+ }
968
+
969
+ _this8 = _super8.call.apply(_super8, [this].concat(args));
970
+
971
+ _defineProperty(_assertThisInitialized(_this8), "serviceName", 'tenant');
972
+
973
+ _defineProperty(_assertThisInitialized(_this8), "tenantKey", void 0);
974
+
975
+ _defineProperty(_assertThisInitialized(_this8), "language", void 0);
976
+
977
+ return _this8;
978
+ }
979
+
980
+ return _createClass(ShopTenant);
981
+ }(BaseCallClass);
982
+ var ShopPlugin = /*#__PURE__*/function (_BaseCallClass9) {
983
+ _inherits(ShopPlugin, _BaseCallClass9);
984
+
985
+ var _super9 = _createSuper(ShopPlugin);
986
+
987
+ function ShopPlugin() {
988
+ var _this9;
989
+
990
+ _classCallCheck(this, ShopPlugin);
991
+
992
+ for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
993
+ args[_key8] = arguments[_key8];
994
+ }
995
+
996
+ _this9 = _super9.call.apply(_super9, [this].concat(args));
997
+
998
+ _defineProperty(_assertThisInitialized(_this9), "serviceName", 'plugin');
999
+
1000
+ _defineProperty(_assertThisInitialized(_this9), "id", void 0);
1001
+
1002
+ _defineProperty(_assertThisInitialized(_this9), "srcUrl", void 0);
1003
+
1004
+ _defineProperty(_assertThisInitialized(_this9), "name", void 0);
1005
+
1006
+ return _this9;
1007
+ }
1008
+
1009
+ return _createClass(ShopPlugin);
1010
+ }(BaseCallClass);
885
1011
 
886
1012
  var SdkInternalEvents;
887
1013
 
@@ -985,6 +1111,15 @@ var Sdk = /*#__PURE__*/function (_Events) {
985
1111
  }
986
1112
 
987
1113
  _createClass(Sdk, [{
1114
+ key: "initializeContextClass",
1115
+ value: function initializeContextClass() {
1116
+ if (this.contextClass) {
1117
+ return new this.contextClass(this.callFunction.bind(this));
1118
+ }
1119
+
1120
+ return {};
1121
+ }
1122
+ }, {
988
1123
  key: "initializeServiceGetters",
989
1124
  value: function initializeServiceGetters() {
990
1125
  var _this2 = this;
@@ -999,15 +1134,6 @@ var Sdk = /*#__PURE__*/function (_Events) {
999
1134
  });
1000
1135
  }
1001
1136
  }
1002
- }, {
1003
- key: "initializeContextClass",
1004
- value: function initializeContextClass() {
1005
- if (this.contextClass) {
1006
- return new this.contextClass(this.callFunction.bind(this));
1007
- }
1008
-
1009
- return {};
1010
- }
1011
1137
  }, {
1012
1138
  key: "sendFrameHeight",
1013
1139
  value: function sendFrameHeight() {
@@ -1194,8 +1320,9 @@ var ShopSdk = /*#__PURE__*/function (_Sdk2) {
1194
1320
  account: new ShopAccount(_this6.callFunction.bind(_assertThisInitialized(_this6))),
1195
1321
  utils: new ShopUtils(_this6.callFunction.bind(_assertThisInitialized(_this6))),
1196
1322
  config: new ShopConfig(_this6.callFunction.bind(_assertThisInitialized(_this6))),
1323
+ tenant: new ShopTenant(_this6.callFunction.bind(_assertThisInitialized(_this6))),
1197
1324
  wishlist: new ShopWishlist(_this6.callFunction.bind(_assertThisInitialized(_this6))),
1198
- context: _this6.initializeContextClass()
1325
+ plugin: new ShopPlugin(_this6.callFunction.bind(_assertThisInitialized(_this6)))
1199
1326
  });
1200
1327
 
1201
1328
  return _this6;
@@ -1204,5 +1331,5 @@ var ShopSdk = /*#__PURE__*/function (_Sdk2) {
1204
1331
  return _createClass(ShopSdk);
1205
1332
  }(Sdk);
1206
1333
 
1207
- export { BackofficeSdk, SdkEvents, ShopSdk };
1334
+ export { AddToCartContext, BackofficeSdk, SdkEvents, ShopSdk };
1208
1335
  //# sourceMappingURL=bundle.esm.js.map