@one-commerce/sdk-core 2.3.4 → 2.3.6

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 (52) hide show
  1. package/package.json +3 -3
  2. package/lib/bundles/bundle.esm.js +0 -1577
  3. package/lib/bundles/bundle.esm.js.map +0 -1
  4. package/lib/bundles/bundle.esm.min.js +0 -2
  5. package/lib/bundles/bundle.esm.min.js.map +0 -1
  6. package/lib/bundles/bundle.umd.js +0 -1593
  7. package/lib/bundles/bundle.umd.js.map +0 -1
  8. package/lib/bundles/bundle.umd.min.js +0 -2
  9. package/lib/bundles/bundle.umd.min.js.map +0 -1
  10. package/lib/cjs/backoffice/context.js +0 -196
  11. package/lib/cjs/backoffice/context.js.map +0 -1
  12. package/lib/cjs/backoffice/services.js +0 -298
  13. package/lib/cjs/backoffice/services.js.map +0 -1
  14. package/lib/cjs/events.js +0 -75
  15. package/lib/cjs/events.js.map +0 -1
  16. package/lib/cjs/index.js +0 -418
  17. package/lib/cjs/index.js.map +0 -1
  18. package/lib/cjs/shop/context.js +0 -144
  19. package/lib/cjs/shop/context.js.map +0 -1
  20. package/lib/cjs/shop/services.js +0 -435
  21. package/lib/cjs/shop/services.js.map +0 -1
  22. package/lib/cjs/utils.js +0 -111
  23. package/lib/cjs/utils.js.map +0 -1
  24. package/lib/esm/backoffice/context.js +0 -100
  25. package/lib/esm/backoffice/context.js.map +0 -1
  26. package/lib/esm/backoffice/services.js +0 -114
  27. package/lib/esm/backoffice/services.js.map +0 -1
  28. package/lib/esm/events.js +0 -47
  29. package/lib/esm/events.js.map +0 -1
  30. package/lib/esm/index.js +0 -244
  31. package/lib/esm/index.js.map +0 -1
  32. package/lib/esm/shop/context.js +0 -70
  33. package/lib/esm/shop/context.js.map +0 -1
  34. package/lib/esm/shop/services.js +0 -218
  35. package/lib/esm/shop/services.js.map +0 -1
  36. package/lib/esm/utils.js +0 -47
  37. package/lib/esm/utils.js.map +0 -1
  38. package/lib/types/backoffice/context.d.ts +0 -66
  39. package/lib/types/backoffice/context.d.ts.map +0 -1
  40. package/lib/types/backoffice/services.d.ts +0 -49
  41. package/lib/types/backoffice/services.d.ts.map +0 -1
  42. package/lib/types/events.d.ts +0 -9
  43. package/lib/types/events.d.ts.map +0 -1
  44. package/lib/types/iframe-channel.d.ts +0 -19
  45. package/lib/types/index.d.ts +0 -107
  46. package/lib/types/index.d.ts.map +0 -1
  47. package/lib/types/shop/context.d.ts +0 -30
  48. package/lib/types/shop/context.d.ts.map +0 -1
  49. package/lib/types/shop/services.d.ts +0 -161
  50. package/lib/types/shop/services.d.ts.map +0 -1
  51. package/lib/types/utils.d.ts +0 -12
  52. package/lib/types/utils.d.ts.map +0 -1
@@ -1,435 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.ShopWishlist = exports.ShopUtils = exports.ShopTenant = exports.ShopPlugin = exports.ShopConfig = exports.ShopCatalog = exports.ShopCart = exports.ShopAuthorization = exports.ShopAccount = void 0;
9
-
10
- var _utils = require("../utils");
11
-
12
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
13
-
14
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
15
-
16
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
17
-
18
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
19
-
20
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
21
-
22
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
23
-
24
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
25
-
26
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
27
-
28
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
29
-
30
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
31
-
32
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
33
-
34
- var ShopCatalog = /*#__PURE__*/function (_BaseCallClass) {
35
- _inherits(ShopCatalog, _BaseCallClass);
36
-
37
- var _super = _createSuper(ShopCatalog);
38
-
39
- function ShopCatalog() {
40
- var _this;
41
-
42
- _classCallCheck(this, ShopCatalog);
43
-
44
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
45
- args[_key] = arguments[_key];
46
- }
47
-
48
- _this = _super.call.apply(_super, [this].concat(args));
49
-
50
- _defineProperty(_assertThisInitialized(_this), "serviceName", 'catalog');
51
-
52
- _defineProperty(_assertThisInitialized(_this), "categories", void 0);
53
-
54
- _defineProperty(_assertThisInitialized(_this), "selectedCategoryId", void 0);
55
-
56
- return _this;
57
- }
58
-
59
- _createClass(ShopCatalog, [{
60
- key: "fetchProduct",
61
- value: function fetchProduct(productId) {
62
- return this.call('fetchProduct', productId);
63
- }
64
- }, {
65
- key: "fetchProducts",
66
- value: function fetchProducts(page) {
67
- return this.call('fetchProducts', page);
68
- }
69
- }, {
70
- key: "fetchStocksForProductsAndWarehouses",
71
- value: function fetchStocksForProductsAndWarehouses(products, warehouses) {
72
- return this.call('fetchStocksForProductsAndWarehouses', products, warehouses);
73
- }
74
- }, {
75
- key: "getProductPrice",
76
- value: function getProductPrice(productId, isGross) {
77
- return this.call('getProductPrice', productId, isGross);
78
- }
79
- }, {
80
- key: "fetchPricingForProducts",
81
- value: function fetchPricingForProducts(products) {
82
- return this.call('fetchPricingForProducts', products);
83
- }
84
- }, {
85
- key: "fetchWarehouses",
86
- value: function fetchWarehouses() {
87
- return this.call('fetchWarehouses');
88
- }
89
- }, {
90
- key: "getCategoryById",
91
- value: function getCategoryById(categoryId) {
92
- return this.call('getCategoryById', categoryId);
93
- }
94
- }]);
95
-
96
- return ShopCatalog;
97
- }(_utils.BaseCallClass);
98
-
99
- exports.ShopCatalog = ShopCatalog;
100
-
101
- var ShopWishlist = /*#__PURE__*/function (_BaseCallClass2) {
102
- _inherits(ShopWishlist, _BaseCallClass2);
103
-
104
- var _super2 = _createSuper(ShopWishlist);
105
-
106
- function ShopWishlist() {
107
- var _this2;
108
-
109
- _classCallCheck(this, ShopWishlist);
110
-
111
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
112
- args[_key2] = arguments[_key2];
113
- }
114
-
115
- _this2 = _super2.call.apply(_super2, [this].concat(args));
116
-
117
- _defineProperty(_assertThisInitialized(_this2), "serviceName", 'wishlist');
118
-
119
- return _this2;
120
- }
121
-
122
- _createClass(ShopWishlist, [{
123
- key: "addProductsToWishlist",
124
- value: function addProductsToWishlist(wishlistId, newProduct) {
125
- return this.call('addProductsToWishlist', wishlistId, newProduct);
126
- }
127
- }, {
128
- key: "getWishlists",
129
- value: function getWishlists() {
130
- return this.call('getWishlists');
131
- }
132
- }, {
133
- key: "createWishlist",
134
- value: function createWishlist(name) {
135
- return this.call('createWishlist', name);
136
- }
137
- }]);
138
-
139
- return ShopWishlist;
140
- }(_utils.BaseCallClass);
141
-
142
- exports.ShopWishlist = ShopWishlist;
143
-
144
- var ShopAccount = /*#__PURE__*/function (_BaseCallClass3) {
145
- _inherits(ShopAccount, _BaseCallClass3);
146
-
147
- var _super3 = _createSuper(ShopAccount);
148
-
149
- function ShopAccount() {
150
- var _this3;
151
-
152
- _classCallCheck(this, ShopAccount);
153
-
154
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
155
- args[_key3] = arguments[_key3];
156
- }
157
-
158
- _this3 = _super3.call.apply(_super3, [this].concat(args));
159
-
160
- _defineProperty(_assertThisInitialized(_this3), "serviceName", 'account');
161
-
162
- _defineProperty(_assertThisInitialized(_this3), "client", void 0);
163
-
164
- _defineProperty(_assertThisInitialized(_this3), "isAuthenticated", void 0);
165
-
166
- _defineProperty(_assertThisInitialized(_this3), "user", void 0);
167
-
168
- _defineProperty(_assertThisInitialized(_this3), "manager", void 0);
169
-
170
- return _this3;
171
- }
172
-
173
- _createClass(ShopAccount, [{
174
- key: "hasSegment",
175
- value: function hasSegment(name) {
176
- return this.call('hasSegment', name);
177
- }
178
- }, {
179
- key: "logout",
180
- value: function logout() {// NotImplementedYet
181
- }
182
- }]);
183
-
184
- return ShopAccount;
185
- }(_utils.BaseCallClass);
186
-
187
- exports.ShopAccount = ShopAccount;
188
-
189
- var ShopCart = /*#__PURE__*/function (_BaseCallClass4) {
190
- _inherits(ShopCart, _BaseCallClass4);
191
-
192
- var _super4 = _createSuper(ShopCart);
193
-
194
- function ShopCart() {
195
- var _this4;
196
-
197
- _classCallCheck(this, ShopCart);
198
-
199
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
200
- args[_key4] = arguments[_key4];
201
- }
202
-
203
- _this4 = _super4.call.apply(_super4, [this].concat(args));
204
-
205
- _defineProperty(_assertThisInitialized(_this4), "serviceName", 'cart');
206
-
207
- _defineProperty(_assertThisInitialized(_this4), "carts", void 0);
208
-
209
- _defineProperty(_assertThisInitialized(_this4), "currentCart", void 0);
210
-
211
- _defineProperty(_assertThisInitialized(_this4), "totalCartPrice", void 0);
212
-
213
- return _this4;
214
- }
215
-
216
- _createClass(ShopCart, [{
217
- key: "addToCart",
218
- value: function addToCart(productId, amount, where, cartId) {
219
- return this.call('addToCart', productId, amount, where, cartId);
220
- }
221
- }]);
222
-
223
- return ShopCart;
224
- }(_utils.BaseCallClass);
225
-
226
- exports.ShopCart = ShopCart;
227
-
228
- var ShopAuthorization = /*#__PURE__*/function (_BaseCallClass5) {
229
- _inherits(ShopAuthorization, _BaseCallClass5);
230
-
231
- var _super5 = _createSuper(ShopAuthorization);
232
-
233
- function ShopAuthorization() {
234
- var _this5;
235
-
236
- _classCallCheck(this, ShopAuthorization);
237
-
238
- for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
239
- args[_key5] = arguments[_key5];
240
- }
241
-
242
- _this5 = _super5.call.apply(_super5, [this].concat(args));
243
-
244
- _defineProperty(_assertThisInitialized(_this5), "serviceName", 'authorization');
245
-
246
- return _this5;
247
- }
248
-
249
- _createClass(ShopAuthorization, [{
250
- key: "getAuthToken",
251
- value: function getAuthToken() {
252
- return this.call('getAuthToken');
253
- }
254
- }]);
255
-
256
- return ShopAuthorization;
257
- }(_utils.BaseCallClass);
258
-
259
- exports.ShopAuthorization = ShopAuthorization;
260
-
261
- var ShopUtils = /*#__PURE__*/function (_BaseCallClass6) {
262
- _inherits(ShopUtils, _BaseCallClass6);
263
-
264
- var _super6 = _createSuper(ShopUtils);
265
-
266
- function ShopUtils(call) {
267
- var _this6;
268
-
269
- _classCallCheck(this, ShopUtils);
270
-
271
- _this6 = _super6.call(this, call);
272
-
273
- _defineProperty(_assertThisInitialized(_this6), "serviceName", 'utils');
274
-
275
- _defineProperty(_assertThisInitialized(_this6), "currency", void 0);
276
-
277
- _defineProperty(_assertThisInitialized(_this6), "isAnonymousAndPurchaseDisabled", void 0);
278
-
279
- _defineProperty(_assertThisInitialized(_this6), "isB2B", void 0);
280
-
281
- _defineProperty(_assertThisInitialized(_this6), "isB2BAndPlatformIsNotOpened", void 0);
282
-
283
- _defineProperty(_assertThisInitialized(_this6), "isIndexPage", void 0);
284
-
285
- _defineProperty(_assertThisInitialized(_this6), "isPurchaseEnabledOrAuthenticated", void 0);
286
-
287
- _defineProperty(_assertThisInitialized(_this6), "routes", void 0);
288
-
289
- _this6.routes = {
290
- getCategoryPath: _this6.getCategoryPath,
291
- getManufacturerSearchUrl: _this6.getManufacturerSearchUrl,
292
- getProductUrl: _this6.getProductUrl,
293
- isExternalUrl: _this6.isExternalUrl
294
- };
295
- return _this6;
296
- }
297
-
298
- _createClass(ShopUtils, [{
299
- key: "notify",
300
- value: function notify(options) {
301
- return this.call('notify', options);
302
- }
303
- }, {
304
- key: "getCategoryPath",
305
- value: function getCategoryPath(id) {
306
- return this.call('getCategoryPath', id);
307
- }
308
- }, {
309
- key: "getManufacturerSearchUrl",
310
- value: function getManufacturerSearchUrl(manufacturer) {
311
- return this.call('getManufacturerSearchUrl', manufacturer);
312
- }
313
- }, {
314
- key: "getProductUrl",
315
- value: function getProductUrl(product) {
316
- return this.call('getProductUrl', product);
317
- }
318
- }, {
319
- key: "isExternalUrl",
320
- value: function isExternalUrl(url) {
321
- return this.call('isExternalUrl', url);
322
- }
323
- }]);
324
-
325
- return ShopUtils;
326
- }(_utils.BaseCallClass);
327
-
328
- exports.ShopUtils = ShopUtils;
329
-
330
- var ShopConfig = /*#__PURE__*/function (_BaseCallClass7) {
331
- _inherits(ShopConfig, _BaseCallClass7);
332
-
333
- var _super7 = _createSuper(ShopConfig);
334
-
335
- function ShopConfig() {
336
- var _this7;
337
-
338
- _classCallCheck(this, ShopConfig);
339
-
340
- for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
341
- args[_key6] = arguments[_key6];
342
- }
343
-
344
- _this7 = _super7.call.apply(_super7, [this].concat(args));
345
-
346
- _defineProperty(_assertThisInitialized(_this7), "serviceName", 'config');
347
-
348
- _defineProperty(_assertThisInitialized(_this7), "accessMode", void 0);
349
-
350
- _defineProperty(_assertThisInitialized(_this7), "isB2CRegistrationEnabled", void 0);
351
-
352
- _defineProperty(_assertThisInitialized(_this7), "isCatalogOpened", void 0);
353
-
354
- _defineProperty(_assertThisInitialized(_this7), "isGrossSelected", void 0);
355
-
356
- _defineProperty(_assertThisInitialized(_this7), "isPlatformClosed", void 0);
357
-
358
- _defineProperty(_assertThisInitialized(_this7), "isPlatformOpened", void 0);
359
-
360
- _defineProperty(_assertThisInitialized(_this7), "isPurchaseEnabled", void 0);
361
-
362
- _defineProperty(_assertThisInitialized(_this7), "isRegistrationEnabled", void 0);
363
-
364
- _defineProperty(_assertThisInitialized(_this7), "currency", void 0);
365
-
366
- return _this7;
367
- }
368
-
369
- return _createClass(ShopConfig);
370
- }(_utils.BaseCallClass);
371
-
372
- exports.ShopConfig = ShopConfig;
373
-
374
- var ShopTenant = /*#__PURE__*/function (_BaseCallClass8) {
375
- _inherits(ShopTenant, _BaseCallClass8);
376
-
377
- var _super8 = _createSuper(ShopTenant);
378
-
379
- function ShopTenant() {
380
- var _this8;
381
-
382
- _classCallCheck(this, ShopTenant);
383
-
384
- for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
385
- args[_key7] = arguments[_key7];
386
- }
387
-
388
- _this8 = _super8.call.apply(_super8, [this].concat(args));
389
-
390
- _defineProperty(_assertThisInitialized(_this8), "serviceName", 'tenant');
391
-
392
- _defineProperty(_assertThisInitialized(_this8), "tenantKey", void 0);
393
-
394
- _defineProperty(_assertThisInitialized(_this8), "language", void 0);
395
-
396
- return _this8;
397
- }
398
-
399
- return _createClass(ShopTenant);
400
- }(_utils.BaseCallClass);
401
-
402
- exports.ShopTenant = ShopTenant;
403
-
404
- var ShopPlugin = /*#__PURE__*/function (_BaseCallClass9) {
405
- _inherits(ShopPlugin, _BaseCallClass9);
406
-
407
- var _super9 = _createSuper(ShopPlugin);
408
-
409
- function ShopPlugin() {
410
- var _this9;
411
-
412
- _classCallCheck(this, ShopPlugin);
413
-
414
- for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
415
- args[_key8] = arguments[_key8];
416
- }
417
-
418
- _this9 = _super9.call.apply(_super9, [this].concat(args));
419
-
420
- _defineProperty(_assertThisInitialized(_this9), "serviceName", 'plugin');
421
-
422
- _defineProperty(_assertThisInitialized(_this9), "id", void 0);
423
-
424
- _defineProperty(_assertThisInitialized(_this9), "srcUrl", void 0);
425
-
426
- _defineProperty(_assertThisInitialized(_this9), "name", void 0);
427
-
428
- return _this9;
429
- }
430
-
431
- return _createClass(ShopPlugin);
432
- }(_utils.BaseCallClass);
433
-
434
- exports.ShopPlugin = ShopPlugin;
435
- //# sourceMappingURL=services.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/shop/services.ts"],"names":["ShopCatalog","productId","call","page","products","warehouses","isGross","categoryId","BaseCallClass","ShopWishlist","wishlistId","newProduct","name","ShopAccount","ShopCart","amount","where","cartId","ShopAuthorization","ShopUtils","routes","getCategoryPath","getManufacturerSearchUrl","getProductUrl","isExternalUrl","options","id","manufacturer","product","url","ShopConfig","ShopTenant","ShopPlugin"],"mappings":";;;;;;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;IAEaA,W;;;;;;;;;;;;;;;;kEACG,S;;;;;;;;;;;WAId,sBAAaC,SAAb,EAA8C;AAC5C,aAAO,KAAKC,IAAL,CAAU,cAAV,EAA0BD,SAA1B,CAAP;AACD;;;WAED,uBAAcE,IAAd,EAA+C;AAC7C,aAAO,KAAKD,IAAL,CAAU,eAAV,EAA2BC,IAA3B,CAAP;AACD;;;WAED,6CAAoCC,QAApC,EAA6DC,UAA7D,EAA0G;AACxG,aAAO,KAAKH,IAAL,CAAU,qCAAV,EAAiDE,QAAjD,EAA2DC,UAA3D,CAAP;AACD;;;WAED,yBAAgBJ,SAAhB,EAAmCK,OAAnC,EAAuE;AACrE,aAAO,KAAKJ,IAAL,CAAU,iBAAV,EAA6BD,SAA7B,EAAwCK,OAAxC,CAAP;AACD;;;WAED,iCAAwBF,QAAxB,EAGsB;AACpB,aAAO,KAAKF,IAAL,CAAU,yBAAV,EAAqCE,QAArC,CAAP;AACD;;;WAED,2BAAoC;AAClC,aAAO,KAAKF,IAAL,CAAU,iBAAV,CAAP;AACD;;;WAED,yBAAgBK,UAAhB,EAAkD;AAChD,aAAO,KAAKL,IAAL,CAAU,iBAAV,EAA6BK,UAA7B,CAAP;AACD;;;;EAlC8BC,oB;;;;IAoCpBC,Y;;;;;;;;;;;;;;;;mEACG,U;;;;;;;WAEd,+BAAsBC,UAAtB,EAA0CC,UAA1C,EAA0E;AACxE,aAAO,KAAKT,IAAL,CAAU,uBAAV,EAAmCQ,UAAnC,EAA+CC,UAA/C,CAAP;AACD;;;WAED,wBAA6B;AAC3B,aAAO,KAAKT,IAAL,CAAU,cAAV,CAAP;AACD;;;WAED,wBAAeU,IAAf,EAA2C;AACzC,aAAO,KAAKV,IAAL,CAAU,gBAAV,EAA4BU,IAA5B,CAAP;AACD;;;;EAb+BJ,oB;;;;IAerBK,W;;;;;;;;;;;;;;;;mEACG,S;;;;;;;;;;;;;;;WA0Dd,oBAAWD,IAAX,EAA2C;AACzC,aAAO,KAAKV,IAAL,CAAU,YAAV,EAAwBU,IAAxB,CAAP;AACD;;;WAWD,kBAAe,CACb;AACD;;;;EA1E8BJ,oB;;;;IA6EpBM,Q;;;;;;;;;;;;;;;;mEACG,M;;;;;;;;;;;;;WAKd,mBAAUb,SAAV,EAA6Bc,MAA7B,EAA6CC,KAA7C,EAA4DC,MAA5D,EAA4F;AAC1F,aAAO,KAAKf,IAAL,CAAU,WAAV,EAAuBD,SAAvB,EAAkCc,MAAlC,EAA0CC,KAA1C,EAAiDC,MAAjD,CAAP;AACD;;;;EAR2BT,oB;;;;IAWjBU,iB;;;;;;;;;;;;;;;;mEACG,e;;;;;;;WAEd,wBAAgC;AAC9B,aAAO,KAAKhB,IAAL,CAAU,cAAV,CAAP;AACD;;;;EALoCM,oB;;;;IAQ1BW,S;;;;;AAYX,qBAAYjB,IAAZ,EAA+E;AAAA;;AAAA;;AAC7E,gCAAMA,IAAN;;AAD6E,mEAXjE,OAWiE;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAE7E,WAAKkB,MAAL,GAAc;AACZC,MAAAA,eAAe,EAAE,OAAKA,eADV;AAEZC,MAAAA,wBAAwB,EAAE,OAAKA,wBAFnB;AAGZC,MAAAA,aAAa,EAAE,OAAKA,aAHR;AAIZC,MAAAA,aAAa,EAAE,OAAKA;AAJR,KAAd;AAF6E;AAQ9E;;;;WAZD,gBAAOC,OAAP,EAA6D;AAC3D,aAAO,KAAKvB,IAAL,CAAU,QAAV,EAAoBuB,OAApB,CAAP;AACD;;;WAYD,yBAAgBC,EAAhB,EAAqD;AACnD,aAAO,KAAKxB,IAAL,CAAU,iBAAV,EAA6BwB,EAA7B,CAAP;AACD;;;WAED,kCAAyBC,YAAzB,EAAgE;AAC9D,aAAO,KAAKzB,IAAL,CAAU,0BAAV,EAAsCyB,YAAtC,CAAP;AACD;;;WAED,uBAAcC,OAAd,EAAoD;AAClD,aAAO,KAAK1B,IAAL,CAAU,eAAV,EAA2B0B,OAA3B,CAAP;AACD;;;WAED,uBAAcC,GAAd,EAA6C;AAC3C,aAAO,KAAK3B,IAAL,CAAU,eAAV,EAA2B2B,GAA3B,CAAP;AACD;;;;EApC4BrB,oB;;;;IA0DlBsB,U;;;;;;;;;;;;;;;;mEACG,Q;;;;;;;;;;;;;;;;;;;;;;;;EADgBtB,oB;;;;IAanBuB,U;;;;;;;;;;;;;;;;mEACG,Q;;;;;;;;;;EADgBvB,oB;;;;IAMnBwB,U;;;;;;;;;;;;;;;;mEACG,Q;;;;;;;;;;;;EADgBxB,oB","sourcesContent":["import { Shop } from \"@one-commerce/sdk-shared\";\n\nimport { BaseCallClass } from \"../utils\";\n\nexport class ShopCatalog extends BaseCallClass implements Shop.Catalog {\n serviceName = 'catalog'\n categories!: Array<any>;\n selectedCategoryId!: string | null;\n\n fetchProduct(productId: string): Promise<any> {\n return this.call('fetchProduct', productId)\n }\n\n fetchProducts(page: unknown): Promise<unknown> {\n return this.call('fetchProducts', page)\n }\n\n fetchStocksForProductsAndWarehouses(products: Array<string>, warehouses: Array<string>): Promise<unknown> {\n return this.call('fetchStocksForProductsAndWarehouses', products, warehouses)\n }\n\n getProductPrice(productId: string, isGross: boolean): Promise<unknown> {\n return this.call('getProductPrice', productId, isGross)\n }\n\n fetchPricingForProducts(products: Array<{\n productId: string\n quantity?: number\n }>): Promise<unknown> {\n return this.call('fetchPricingForProducts', products)\n }\n\n fetchWarehouses(): Promise<unknown> {\n return this.call('fetchWarehouses')\n }\n\n getCategoryById(categoryId: string): Promise<any> {\n return this.call('getCategoryById', categoryId)\n }\n}\nexport class ShopWishlist extends BaseCallClass implements Shop.Wishlist {\n serviceName = 'wishlist'\n\n addProductsToWishlist(wishlistId: string, newProduct: any): Promise<void> {\n return this.call('addProductsToWishlist', wishlistId, newProduct)\n }\n\n getWishlists(): Promise<any> {\n return this.call('getWishlists')\n }\n\n createWishlist(name: string): Promise<any> {\n return this.call('createWishlist', name)\n }\n}\nexport class ShopAccount extends BaseCallClass implements Shop.Account {\n serviceName = 'account'\n client!: {\n id: string;\n name: string;\n externalId?: string;\n tin?: string;\n phone?: string;\n segmentId?: string;\n segments: {\n additionalSegments?: Array<{\n id: string;\n name: string;\n externalId?: string;\n parentSegmentId?: string;\n }>;\n mainSegment: {\n id: string;\n name: string;\n externalId?: string;\n parentSegmentId?: string;\n };\n };\n warehouseId?: string;\n termPayment?: {\n id: string;\n label?: string;\n paymentDaysPeriod?: number;\n };\n isTaxPayer?: boolean;\n billingAddress?: {\n city: string;\n country: string;\n id: string;\n isDefault: boolean;\n name: string;\n phone: string;\n street: string;\n type: string;\n zipCode: string\n }\n };\n isAuthenticated!: boolean;\n user!: {\n id?: string,\n clientId?: string,\n email?: string;\n name?: string;\n phone?: string;\n rol?: {\n name: string;\n id: string;\n }\n /**\n * @deprecated Use non-nested function instead\n */\n hasSegment(name: string): Promise<boolean>\n };\n\n hasSegment(name: string): Promise<boolean> {\n return this.call('hasSegment', name)\n }\n\n manager!: {\n additionalEmail?: string;\n email: string; id: string;\n landlinePhone?: string;\n mobilePhone?: string;\n name: string;\n photo?: string\n };\n\n logout(): void {\n // NotImplementedYet\n }\n}\n\nexport class ShopCart extends BaseCallClass implements Shop.Cart {\n serviceName = 'cart'\n carts!: Array<any>;\n currentCart!: any;\n totalCartPrice!: number;\n\n addToCart(productId: string, amount: number, where: string, cartId?: string): Promise<void> {\n return this.call('addToCart', productId, amount, where, cartId)\n }\n}\n\nexport class ShopAuthorization extends BaseCallClass implements Shop.Authorization {\n serviceName = 'authorization'\n\n getAuthToken(): Promise<string> {\n return this.call('getAuthToken')\n }\n}\n\nexport class ShopUtils extends BaseCallClass implements Shop.Utils {\n serviceName = 'utils'\n currency!: any;\n isAnonymousAndPurchaseDisabled!: boolean;\n isB2B!: boolean;\n isB2BAndPlatformIsNotOpened!: boolean;\n isIndexPage!: boolean;\n isPurchaseEnabledOrAuthenticated!: boolean;\n notify(options: NotificationOptions | string): Promise<void> {\n return this.call('notify', options)\n }\n\n constructor(call: (service: string, fun: string, ...arg: any) => Promise<any>) {\n super(call)\n this.routes = {\n getCategoryPath: this.getCategoryPath,\n getManufacturerSearchUrl: this.getManufacturerSearchUrl,\n getProductUrl: this.getProductUrl,\n isExternalUrl: this.isExternalUrl\n }\n }\n\n getCategoryPath(id?: string): Promise<string | null> {\n return this.call('getCategoryPath', id)\n }\n\n getManufacturerSearchUrl(manufacturer: string): Promise<string> {\n return this.call('getManufacturerSearchUrl', manufacturer)\n }\n\n getProductUrl(product: any): Promise<string | null> {\n return this.call('getProductUrl', product)\n }\n\n isExternalUrl(url: string): Promise<boolean> {\n return this.call('isExternalUrl', url)\n }\n\n routes: {\n /**\n * @deprecated Use non-nested function instead\n */\n getCategoryPath(id?: string): (Promise<string | null> | string | null);\n /**\n * @deprecated Use non-nested function instead\n */\n getManufacturerSearchUrl(manufacturer: string): (Promise<string> | string);\n /**\n * @deprecated Use non-nested function instead\n */\n getProductUrl(product: any): (Promise<string | null> | string | null);\n /**\n * @deprecated Use non-nested function instead\n */\n isExternalUrl(url: string): (Promise<boolean> | boolean)\n };\n}\n\nexport class ShopConfig extends BaseCallClass implements Shop.Config {\n serviceName = 'config'\n accessMode!: string;\n isB2CRegistrationEnabled!: boolean;\n isCatalogOpened!: boolean;\n isGrossSelected!: boolean;\n isPlatformClosed!: boolean;\n isPlatformOpened!: boolean;\n isPurchaseEnabled!: boolean;\n isRegistrationEnabled!: boolean;\n currency: any;\n}\n\nexport class ShopTenant extends BaseCallClass implements Shop.Tenant {\n serviceName = 'tenant'\n tenantKey: string | null;\n language: string;\n}\n\nexport class ShopPlugin extends BaseCallClass implements Shop.Plugin {\n serviceName = 'plugin'\n id: string;\n srcUrl?: string;\n name?: string;\n}\n"],"file":"services.js"}
package/lib/cjs/utils.js DELETED
@@ -1,111 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.ContextCallClass = exports.BaseCallClass = void 0;
9
- exports.generateCallId = generateCallId;
10
-
11
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
12
-
13
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14
-
15
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
16
-
17
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
18
-
19
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
20
-
21
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
22
-
23
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
24
-
25
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
26
-
27
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
28
-
29
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
30
-
31
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
32
-
33
- var dec2hex = function dec2hex(dec) {
34
- return dec.toString(16).padStart(2, "0");
35
- }; // generateId :: Integer -> String
36
-
37
-
38
- function generateCallId() {
39
- var arr = new Uint8Array((10 || 40) / 2);
40
- window.crypto.getRandomValues(arr);
41
- return Array.from(arr, dec2hex).join('');
42
- }
43
-
44
- var BaseCallClass = /*#__PURE__*/function () {
45
- function BaseCallClass(call) {
46
- var _this = this;
47
-
48
- _classCallCheck(this, BaseCallClass);
49
-
50
- _defineProperty(this, "serviceName", '');
51
-
52
- _defineProperty(this, "call", void 0);
53
-
54
- this.call = function (fun) {
55
- for (var _len = arguments.length, arg = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
56
- arg[_key - 1] = arguments[_key];
57
- }
58
-
59
- return call.apply(void 0, [_this.serviceName, fun].concat(arg));
60
- };
61
- }
62
-
63
- _createClass(BaseCallClass, [{
64
- key: "update",
65
- value: function update(payload) {
66
- var attributes = payload[this.serviceName];
67
-
68
- if (attributes) {
69
- BaseCallClass.update(this, attributes);
70
- }
71
- }
72
- }], [{
73
- key: "update",
74
- value: function update(target, payload) {
75
- Object.keys(payload).forEach(function (key) {
76
- target[key] = payload[key];
77
- });
78
- }
79
- }]);
80
-
81
- return BaseCallClass;
82
- }();
83
-
84
- exports.BaseCallClass = BaseCallClass;
85
-
86
- var ContextCallClass = /*#__PURE__*/function (_BaseCallClass) {
87
- _inherits(ContextCallClass, _BaseCallClass);
88
-
89
- var _super = _createSuper(ContextCallClass);
90
-
91
- function ContextCallClass() {
92
- var _this2;
93
-
94
- _classCallCheck(this, ContextCallClass);
95
-
96
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
97
- args[_key2] = arguments[_key2];
98
- }
99
-
100
- _this2 = _super.call.apply(_super, [this].concat(args));
101
-
102
- _defineProperty(_assertThisInitialized(_this2), "serviceName", 'context');
103
-
104
- return _this2;
105
- }
106
-
107
- return _createClass(ContextCallClass);
108
- }(BaseCallClass);
109
-
110
- exports.ContextCallClass = ContextCallClass;
111
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils.ts"],"names":["dec2hex","dec","toString","padStart","generateCallId","arr","Uint8Array","window","crypto","getRandomValues","Array","from","join","BaseCallClass","call","fun","arg","serviceName","payload","attributes","update","target","Object","keys","forEach","key","ContextCallClass"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,OAAO,GAAI,SAAXA,OAAW,CAACC,GAAD,EAAyB;AACxC,SAAOA,GAAG,CAACC,QAAJ,CAAa,EAAb,EAAiBC,QAAjB,CAA0B,CAA1B,EAA6B,GAA7B,CAAP;AACD,CAFD,C,CAIA;;;AACO,SAASC,cAAT,GAA2B;AAChC,MAAMC,GAAG,GAAG,IAAIC,UAAJ,CAAe,CAAC,MAAM,EAAP,IAAa,CAA5B,CAAZ;AACAC,EAAAA,MAAM,CAACC,MAAP,CAAcC,eAAd,CAA8BJ,GAA9B;AACA,SAAOK,KAAK,CAACC,IAAN,CAAWN,GAAX,EAAgBL,OAAhB,EAAyBY,IAAzB,CAA8B,EAA9B,CAAP;AACD;;IAEYC,a;AAGX,yBAAYC,IAAZ,EAA+E;AAAA;;AAAA;;AAAA,yCAFjE,EAEiE;;AAAA;;AAC7E,SAAKA,IAAL,GAAY,UAACC,GAAD,EAA8B;AAAA,wCAAbC,GAAa;AAAbA,QAAAA,GAAa;AAAA;;AACxC,aAAOF,IAAI,MAAJ,UAAK,KAAI,CAACG,WAAV,EAAuBF,GAAvB,SAA+BC,GAA/B,EAAP;AACD,KAFD;AAGD;;;;WAMD,gBAAOE,OAAP,EAAqB;AACnB,UAAMC,UAAe,GAAGD,OAAO,CAAC,KAAKD,WAAN,CAA/B;;AACA,UAAIE,UAAJ,EAAgB;AACdN,QAAAA,aAAa,CAACO,MAAd,CAAqB,IAArB,EAA2BD,UAA3B;AACD;AACF;;;WAVD,gBAAcE,MAAd,EAA2CH,OAA3C,EAAyE;AACvEI,MAAAA,MAAM,CAACC,IAAP,CAAYL,OAAZ,EAAqBM,OAArB,CAA6B,UAACC,GAAD,EAAiB;AAC5CJ,QAAAA,MAAM,CAACI,GAAD,CAAN,GAAcP,OAAO,CAACO,GAAD,CAArB;AACD,OAFD;AAGD;;;;;;;;IAQUC,gB;;;;;;;;;;;;;;;;mEACG,S;;;;;;EADsBb,a","sourcesContent":["const dec2hex = (dec: number): string => {\n return dec.toString(16).padStart(2, \"0\")\n}\n\n// generateId :: Integer -> String\nexport function generateCallId () {\n const arr = new Uint8Array((10 || 40) / 2)\n window.crypto.getRandomValues(arr)\n return Array.from(arr, dec2hex).join('')\n}\n\nexport class BaseCallClass {\n serviceName = ''\n call: (fun: string, ...arg: any[]) => Promise<any>;\n constructor(call: (service: string, fun: string, ...arg: any) => Promise<any>) {\n this.call = (fun: string, ...arg: any) => {\n return call(this.serviceName, fun, ...arg)\n }\n }\n static update(target: Record<string, any>, payload: Record<string, any>) {\n Object.keys(payload).forEach((key: string) => {\n target[key] = payload[key]\n })\n }\n update(payload: any) {\n const attributes: any = payload[this.serviceName]\n if (attributes) {\n BaseCallClass.update(this, attributes)\n }\n }\n}\nexport class ContextCallClass extends BaseCallClass {\n serviceName = 'context'\n}\n"],"file":"utils.js"}
@@ -1,100 +0,0 @@
1
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
3
- import { ContextCallClass } from "../utils";
4
- export class AddToCartContext extends ContextCallClass {
5
- constructor(...args) {
6
- super(...args);
7
-
8
- _defineProperty(this, "productId", void 0);
9
-
10
- _defineProperty(this, "cartId", void 0);
11
-
12
- _defineProperty(this, "offerId", void 0);
13
-
14
- _defineProperty(this, "warehouses", void 0);
15
-
16
- _defineProperty(this, "warehouseId", void 0);
17
-
18
- _defineProperty(this, "meta", void 0);
19
-
20
- _defineProperty(this, "pluginProductLines", void 0);
21
-
22
- _defineProperty(this, "productLines", void 0);
23
-
24
- _defineProperty(this, "productAmount", void 0);
25
- }
26
-
27
- closePlugin() {
28
- return this.call('closePlugin');
29
- }
30
-
31
- closePluginAndAddToCart() {
32
- return this.call('closePluginAndAddToCart');
33
- }
34
-
35
- closePluginAndRefreshCart() {
36
- return this.call('closePluginAndRefreshCart');
37
- }
38
-
39
- }
40
- export class DocumentsContext extends ContextCallClass {
41
- constructor(...args) {
42
- super(...args);
43
-
44
- _defineProperty(this, "orderDetails", void 0);
45
-
46
- _defineProperty(this, "invoiceDetails", void 0);
47
-
48
- _defineProperty(this, "selectedInvoices", void 0);
49
-
50
- _defineProperty(this, "clientContextId", void 0);
51
-
52
- _defineProperty(this, "operatorId", void 0);
53
-
54
- _defineProperty(this, "meta", void 0);
55
- }
56
-
57
- closePlugin() {
58
- return this.call('closePlugin');
59
- }
60
-
61
- closePluginAndRefreshView() {
62
- return this.call('closePluginAndRefreshView');
63
- }
64
-
65
- }
66
- export class EditProductLinesOnCartContext extends ContextCallClass {
67
- constructor(...args) {
68
- super(...args);
69
-
70
- _defineProperty(this, "productId", void 0);
71
-
72
- _defineProperty(this, "cartId", void 0);
73
-
74
- _defineProperty(this, "offerId", void 0);
75
-
76
- _defineProperty(this, "warehouses", void 0);
77
-
78
- _defineProperty(this, "warehouseId", void 0);
79
-
80
- _defineProperty(this, "meta", void 0);
81
-
82
- _defineProperty(this, "productLineId", void 0);
83
-
84
- _defineProperty(this, "productLines", void 0);
85
-
86
- _defineProperty(this, "pluginProductLines", void 0);
87
-
88
- _defineProperty(this, "productAmount", void 0);
89
- }
90
-
91
- closePlugin() {
92
- return this.call('closePlugin');
93
- }
94
-
95
- closePluginAndRefreshCart() {
96
- return this.call('closePluginAndRefreshCart');
97
- }
98
-
99
- }
100
- //# sourceMappingURL=context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/backoffice/context.ts"],"names":["ContextCallClass","AddToCartContext","closePlugin","call","closePluginAndAddToCart","closePluginAndRefreshCart","DocumentsContext","closePluginAndRefreshView","EditProductLinesOnCartContext"],"mappings":";;AAEA,SAAQA,gBAAR,QAA+B,UAA/B;AAEA,OAAO,MAAMC,gBAAN,SAA+BD,gBAA/B,CAAwF;AAAA;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;AAAA;;AAU7FE,EAAAA,WAAW,GAAkB;AAC3B,WAAO,KAAKC,IAAL,CAAU,aAAV,CAAP;AACD;;AACDC,EAAAA,uBAAuB,GAAkB;AACvC,WAAO,KAAKD,IAAL,CAAU,yBAAV,CAAP;AACD;;AACDE,EAAAA,yBAAyB,GAAkB;AACzC,WAAO,KAAKF,IAAL,CAAU,2BAAV,CAAP;AACD;;AAlB4F;AAqB/F,OAAO,MAAMG,gBAAN,SAA+BN,gBAA/B,CAAwF;AAAA;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;AAAA;;AA6B7FE,EAAAA,WAAW,GAAkB;AAC3B,WAAO,KAAKC,IAAL,CAAU,aAAV,CAAP;AACD;;AACDI,EAAAA,yBAAyB,GAAkB;AACzC,WAAO,KAAKJ,IAAL,CAAU,2BAAV,CAAP;AACD;;AAlC4F;AAqC/F,OAAO,MAAMK,6BAAN,SAA4CR,gBAA5C,CAAkH;AAAA;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;AAAA;;AAWvHE,EAAAA,WAAW,GAAkB;AAC3B,WAAO,KAAKC,IAAL,CAAU,aAAV,CAAP;AACD;;AACDE,EAAAA,yBAAyB,GAAkB;AACzC,WAAO,KAAKF,IAAL,CAAU,2BAAV,CAAP;AACD;;AAhBsH","sourcesContent":["import {Backoffice} from \"@one-commerce/sdk-shared\";\n\nimport {ContextCallClass} from \"../utils\";\n\nexport class AddToCartContext extends ContextCallClass implements Backoffice.Context.AddToCart {\n productId: string;\n cartId: string | null;\n offerId: string | null;\n warehouses: Array<any>;\n warehouseId: string;\n meta: unknown;\n pluginProductLines: Array<any>;\n productLines: Array<any>;\n productAmount: number;\n closePlugin(): Promise<void> {\n return this.call('closePlugin')\n }\n closePluginAndAddToCart(): Promise<void> {\n return this.call('closePluginAndAddToCart')\n }\n closePluginAndRefreshCart(): Promise<void> {\n return this.call('closePluginAndRefreshCart')\n }\n}\n\nexport class DocumentsContext extends ContextCallClass implements Backoffice.Context.Documents {\n orderDetails?: {\n orderId: string | number,\n orderNumber: string | number,\n paymentMethodId: string | number,\n paymentStatus: string,\n clientId: string | number,\n shipments: Array<any>,\n price: any,\n };\n invoiceDetails?: {\n number: string | number,\n isPaid: boolean,\n leftToPay: number,\n amountPay: number,\n clientId: string | number,\n totalPrices: any\n };\n selectedInvoices?: [{\n number: string | number,\n isPaid: boolean,\n leftToPay: number,\n amountPay: number,\n clientId: string | number,\n totalPrices: any,\n }];\n clientContextId?: string | number;\n operatorId?: string | number;\n meta: unknown;\n closePlugin(): Promise<void> {\n return this.call('closePlugin')\n }\n closePluginAndRefreshView(): Promise<void> {\n return this.call('closePluginAndRefreshView')\n }\n}\n\nexport class EditProductLinesOnCartContext extends ContextCallClass implements Backoffice.Context.EditProductLinesOnCart {\n productId: string;\n cartId: string | null;\n offerId: string | null;\n warehouses: Array<any>;\n warehouseId: string;\n meta: unknown;\n productLineId: string;\n productLines: Array<any>;\n pluginProductLines: Array<any>;\n productAmount: number;\n closePlugin(): Promise<void> {\n return this.call('closePlugin')\n }\n closePluginAndRefreshCart(): Promise<void> {\n return this.call('closePluginAndRefreshCart')\n }\n}\n\nexport type BackofficeAvailableContext = AddToCartContext | EditProductLinesOnCartContext\n"],"file":"context.js"}