@crystaldesign/product-handler 26.5.0-beta.4 → 26.5.0-beta.41
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/build/cjs/index.js +210 -112
- package/build/esm/index.js +206 -113
- package/build/types/product-handler/src/applyProductHeaderOverrides.d.ts +12 -0
- package/build/types/product-handler/src/applyProductHeaderOverrides.d.ts.map +1 -0
- package/build/types/product-handler/src/index.d.ts +2 -0
- package/build/types/product-handler/src/index.d.ts.map +1 -1
- package/build/types/product-handler/src/productMergeFieldRegistry.d.ts +19 -0
- package/build/types/product-handler/src/productMergeFieldRegistry.d.ts.map +1 -0
- package/build/types/product-handler/src/types.d.ts +19 -0
- package/build/types/product-handler/src/types.d.ts.map +1 -1
- package/package.json +2 -2
package/build/cjs/index.js
CHANGED
|
@@ -40,6 +40,81 @@ var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
|
40
40
|
globalThis.process = { env:env };
|
|
41
41
|
})();
|
|
42
42
|
|
|
43
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
44
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
45
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
46
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
47
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
48
|
+
/** Root paths that are materialized from `headerValues` + `overrideValues`. Extend when adding merge rules. */
|
|
49
|
+
var PRODUCT_MERGE_FIELD_KEYS = ['customData'];
|
|
50
|
+
function isPlainObject(value) {
|
|
51
|
+
return value !== null && _typeof__default["default"](value) === 'object' && !Array.isArray(value);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Deep-merge plain objects; nested plain objects merge, scalars and arrays are replaced by the override branch. */
|
|
55
|
+
function deepMergeRecords(base, override) {
|
|
56
|
+
var out = _objectSpread$1({}, base);
|
|
57
|
+
for (var _i = 0, _Object$keys = Object.keys(override); _i < _Object$keys.length; _i++) {
|
|
58
|
+
var key = _Object$keys[_i];
|
|
59
|
+
var b = base[key];
|
|
60
|
+
var o = override[key];
|
|
61
|
+
if (isPlainObject(b) && isPlainObject(o)) {
|
|
62
|
+
out[key] = deepMergeRecords(b, o);
|
|
63
|
+
} else {
|
|
64
|
+
out[key] = o;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
function mergeCustomDataMaterialized(product) {
|
|
70
|
+
var _product$headerValues, _product$headerValues2, _product$overrideValu, _product$overrideValu2;
|
|
71
|
+
var base = (_product$headerValues = (_product$headerValues2 = product.headerValues) === null || _product$headerValues2 === void 0 ? void 0 : _product$headerValues2.customData) !== null && _product$headerValues !== void 0 ? _product$headerValues : {};
|
|
72
|
+
var ov = (_product$overrideValu = (_product$overrideValu2 = product.overrideValues) === null || _product$overrideValu2 === void 0 ? void 0 : _product$overrideValu2.customData) !== null && _product$overrideValu !== void 0 ? _product$overrideValu : {};
|
|
73
|
+
var merged = deepMergeRecords(base, ov);
|
|
74
|
+
return _objectSpread$1(_objectSpread$1({}, product), {}, {
|
|
75
|
+
customData: merged
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
var mergeStrategies = {
|
|
79
|
+
customData: mergeCustomDataMaterialized
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Materializes merge-fähige Root-Felder from `headerValues` (Basis) and `overrideValues` (Overrides).
|
|
84
|
+
* When neither `headerValues` nor `overrideValues` is set, returns the product unchanged (legacy documents).
|
|
85
|
+
*/
|
|
86
|
+
function applyProductHeaderOverrides(product) {
|
|
87
|
+
if (product.headerValues === undefined && product.overrideValues === undefined) {
|
|
88
|
+
return product;
|
|
89
|
+
}
|
|
90
|
+
var next = _objectSpread$1({}, product);
|
|
91
|
+
var _iterator = _createForOfIteratorHelper(PRODUCT_MERGE_FIELD_KEYS),
|
|
92
|
+
_step;
|
|
93
|
+
try {
|
|
94
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
95
|
+
var field = _step.value;
|
|
96
|
+
next = mergeStrategies[field](next);
|
|
97
|
+
}
|
|
98
|
+
} catch (err) {
|
|
99
|
+
_iterator.e(err);
|
|
100
|
+
} finally {
|
|
101
|
+
_iterator.f();
|
|
102
|
+
}
|
|
103
|
+
return next;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Root-JSON-Patch-Prefixe (mit `/`), die auf `overrideValues` umgebogen werden. */
|
|
107
|
+
function getMergeableRootJsonPatchPrefixes() {
|
|
108
|
+
return PRODUCT_MERGE_FIELD_KEYS.map(function (k) {
|
|
109
|
+
return "/".concat(k);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** JSON-Patch-Ziel unter `overrideValues` für ein merge-fähiges Feld (z. B. `customData` → `/overrideValues/customData`). */
|
|
114
|
+
function mergeFieldKeyToOverrideValuesPath(fieldKey) {
|
|
115
|
+
return "/overrideValues/".concat(fieldKey);
|
|
116
|
+
}
|
|
117
|
+
|
|
43
118
|
var _excluded = ["value"];
|
|
44
119
|
var _ProductHandlerAbstract;
|
|
45
120
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -256,7 +331,7 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
256
331
|
_ref3,
|
|
257
332
|
_baseProduct$configur5,
|
|
258
333
|
_baseProduct20;
|
|
259
|
-
var basket, divaNr, catalogData, productData, classificationFields, fieldConfiguration, customBaseFields, classificationConfig, _ref2$availableLangua, availableLanguages, _ref2$currentLang, currentLang, getUniqueNewDivaNr, products, baseProduct, variantProducts, isDifferentHash, _basket$OrderSets$map, _baseProduct$configur, _baseProduct$configur2, basketHashes, productHashes, _baseProduct$configur3, _baseProduct$configur4, _basket$OrderSets$map2, myDivaNr, dataByBasket, oldClassificationData, i, variant, key, oldUniqueHash, configuration, baseData, metaData, metaData_locales, _this$parseMetaDataAn, classificationData, customData, optMap, _ProductHandlerAbstra, shortDescription, shortDescriptionModified, variantData, variantDataModified, addedProducts, removedProducts, optFields, initialSelectedFields, usedVariantIds, newVariantPosition, variantPositions, currentVariantPos, _basket$OrderSets$0$C2, differingOPTs, _variantData$, opts, _i, initializedOptMap;
|
|
334
|
+
var basket, divaNr, catalogData, productData, classificationFields, fieldConfiguration, customBaseFields, classificationConfig, _ref2$availableLangua, availableLanguages, _ref2$currentLang, currentLang, getUniqueNewDivaNr, products, baseProduct, variantProducts, isDifferentHash, _basket$OrderSets$map, _baseProduct$configur, _baseProduct$configur2, basketHashes, productHashes, _baseProduct$configur3, _baseProduct$configur4, _basket$OrderSets$map2, myDivaNr, dataByBasket, oldClassificationData, i, variant, key, oldUniqueHash, configuration, baseData, metaData, metaData_locales, _this$parseMetaDataAn, classificationData, customData, optMap, _ProductHandlerAbstra, shortDescription, shortDescriptionModified, variantData, variantDataModified, addedProducts, removedProducts, optFields, initialSelectedFields, usedVariantIds, newVariantPosition, variantPositions, currentVariantPos, _basket$OrderSets$0$C2, differingOPTs, _variantData$0$config, _variantData$, _sourceConfiguration$, _sourceConfiguration$2, sourceConfiguration, orderLines, variantBasketDatas, opts, _i, initializedOptMap;
|
|
260
335
|
return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
|
|
261
336
|
while (1) switch (_context2.prev = _context2.next) {
|
|
262
337
|
case 0:
|
|
@@ -486,20 +561,27 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
486
561
|
_ref7[1];
|
|
487
562
|
return opt.replace('OPT', '');
|
|
488
563
|
});
|
|
489
|
-
if (variantData) {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
var
|
|
494
|
-
|
|
564
|
+
if (variantData || baseData.configuration) {
|
|
565
|
+
sourceConfiguration = (_variantData$0$config = (_variantData$ = variantData[0]) === null || _variantData$ === void 0 ? void 0 : _variantData$.configuration) !== null && _variantData$0$config !== void 0 ? _variantData$0$config : baseData.configuration;
|
|
566
|
+
orderLines = (_sourceConfiguration$ = sourceConfiguration === null || sourceConfiguration === void 0 || (_sourceConfiguration$2 = sourceConfiguration.OrderSets) === null || _sourceConfiguration$2 === void 0 || (_sourceConfiguration$2 = _sourceConfiguration$2[0]) === null || _sourceConfiguration$2 === void 0 ? void 0 : _sourceConfiguration$2.OrderLines) !== null && _sourceConfiguration$ !== void 0 ? _sourceConfiguration$ : [];
|
|
567
|
+
variantBasketDatas = orderLines.flatMap(function (ol) {
|
|
568
|
+
var _ol$VariantBasketData;
|
|
569
|
+
return ((_ol$VariantBasketData = ol === null || ol === void 0 ? void 0 : ol.VariantBasketDatas) !== null && _ol$VariantBasketData !== void 0 ? _ol$VariantBasketData : []).filter(function (v) {
|
|
570
|
+
var _v$OPT;
|
|
571
|
+
return !((_v$OPT = v.OPT) !== null && _v$OPT !== void 0 && _v$OPT.endsWith('_val'));
|
|
572
|
+
});
|
|
573
|
+
});
|
|
574
|
+
optFields = variantBasketDatas.map(function (vd) {
|
|
575
|
+
var _catalogData, _vd$OptionOCD, _ref8, _option$Name;
|
|
576
|
+
var option = (_catalogData = catalogData) === null || _catalogData === void 0 || (_catalogData = _catalogData[0]) === null || _catalogData === void 0 || (_catalogData = _catalogData.options) === null || _catalogData === void 0 ? void 0 : _catalogData[(_vd$OptionOCD = vd.OptionOCD) !== null && _vd$OptionOCD !== void 0 ? _vd$OptionOCD : 'OPT' + vd.OPT];
|
|
495
577
|
return {
|
|
496
|
-
field: option.OptionOCD ? option.OptionOCD.substring(3) : vd.OPT,
|
|
578
|
+
field: option !== null && option !== void 0 && option.OptionOCD ? option.OptionOCD.substring(3) : vd.OPT,
|
|
497
579
|
type: 'string',
|
|
498
|
-
title: (_option$Name = option === null || option === void 0 ? void 0 : option.Name) !== null && _option$Name !== void 0 ? _option$Name : vd.OPT,
|
|
580
|
+
title: (_ref8 = (_option$Name = option === null || option === void 0 ? void 0 : option.Name) !== null && _option$Name !== void 0 ? _option$Name : vd.OPTName) !== null && _ref8 !== void 0 ? _ref8 : vd.OPT,
|
|
499
581
|
readOnly: true,
|
|
500
582
|
fieldType: 'OPT'
|
|
501
583
|
};
|
|
502
|
-
})
|
|
584
|
+
});
|
|
503
585
|
//remove duplicates
|
|
504
586
|
opts = {};
|
|
505
587
|
for (_i = optFields.length - 1; _i >= 0; _i--) {
|
|
@@ -608,7 +690,7 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
608
690
|
}
|
|
609
691
|
}
|
|
610
692
|
if (fieldConfiguration !== null && fieldConfiguration !== void 0 && fieldConfiguration.delivery) {
|
|
611
|
-
var _baseProduct$delivery, _baseProduct$delivery2, _baseProduct$delivery3, _baseProduct$delivery4, _baseProduct$delivery5, _baseProduct$delivery6, _baseProduct$delivery7, _baseProduct$delivery8, _baseProduct$delivery9, _baseProduct$delivery10,
|
|
693
|
+
var _baseProduct$delivery, _baseProduct$delivery2, _baseProduct$delivery3, _baseProduct$delivery4, _baseProduct$delivery5, _baseProduct$delivery6, _baseProduct$delivery7, _baseProduct$delivery8, _baseProduct$delivery9, _baseProduct$delivery10, _ref9, _baseProduct$delivery11, _baseProduct$delivery12, _fieldConfiguration$d, _ref10, _baseProduct$delivery13, _baseProduct$delivery14, _fieldConfiguration$d2, _ref11, _baseProduct$delivery15, _baseProduct$delivery16, _fieldConfiguration$d3;
|
|
612
694
|
var config = {
|
|
613
695
|
addedPackageWeight: 0,
|
|
614
696
|
addedPackageHeight: 0,
|
|
@@ -655,9 +737,9 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
655
737
|
}).filter(function (f) {
|
|
656
738
|
return f;
|
|
657
739
|
})))),
|
|
658
|
-
deliveryTime: (
|
|
659
|
-
deliveryPrice: (
|
|
660
|
-
installationPrice: (
|
|
740
|
+
deliveryTime: (_ref9 = (_baseProduct$delivery11 = baseProduct === null || baseProduct === void 0 || (_baseProduct$delivery12 = baseProduct.delivery) === null || _baseProduct$delivery12 === void 0 ? void 0 : _baseProduct$delivery12.deliveryTime) !== null && _baseProduct$delivery11 !== void 0 ? _baseProduct$delivery11 : (_fieldConfiguration$d = fieldConfiguration.delivery) === null || _fieldConfiguration$d === void 0 ? void 0 : _fieldConfiguration$d.defaultDeliveryTime) !== null && _ref9 !== void 0 ? _ref9 : 0,
|
|
741
|
+
deliveryPrice: (_ref10 = (_baseProduct$delivery13 = baseProduct === null || baseProduct === void 0 || (_baseProduct$delivery14 = baseProduct.delivery) === null || _baseProduct$delivery14 === void 0 ? void 0 : _baseProduct$delivery14.deliveryPrice) !== null && _baseProduct$delivery13 !== void 0 ? _baseProduct$delivery13 : (_fieldConfiguration$d2 = fieldConfiguration.delivery) === null || _fieldConfiguration$d2 === void 0 ? void 0 : _fieldConfiguration$d2.defaultDeliveryPrice) !== null && _ref10 !== void 0 ? _ref10 : 0,
|
|
742
|
+
installationPrice: (_ref11 = (_baseProduct$delivery15 = baseProduct === null || baseProduct === void 0 || (_baseProduct$delivery16 = baseProduct.delivery) === null || _baseProduct$delivery16 === void 0 ? void 0 : _baseProduct$delivery16.installationPrice) !== null && _baseProduct$delivery15 !== void 0 ? _baseProduct$delivery15 : (_fieldConfiguration$d3 = fieldConfiguration.delivery) === null || _fieldConfiguration$d3 === void 0 ? void 0 : _fieldConfiguration$d3.defaultInstallationPrice) !== null && _ref11 !== void 0 ? _ref11 : 0
|
|
661
743
|
};
|
|
662
744
|
}
|
|
663
745
|
var ismanual = (baseProduct === null || baseProduct === void 0 ? void 0 : baseProduct.calculatedPrice) !== (baseProduct === null || baseProduct === void 0 ? void 0 : baseProduct.addedPrice);
|
|
@@ -806,11 +888,11 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
806
888
|
key: "mapCategory",
|
|
807
889
|
value: function mapCategory(value, translations) {
|
|
808
890
|
var _translations$find2;
|
|
809
|
-
var
|
|
891
|
+
var _ref12 = (_translations$find2 = translations === null || translations === void 0 ? void 0 : translations.find(function (t) {
|
|
810
892
|
return t.value == value;
|
|
811
893
|
})) !== null && _translations$find2 !== void 0 ? _translations$find2 : {};
|
|
812
|
-
|
|
813
|
-
var translation = _objectWithoutProperties__default["default"](
|
|
894
|
+
_ref12.value;
|
|
895
|
+
var translation = _objectWithoutProperties__default["default"](_ref12, _excluded);
|
|
814
896
|
if (Object.keys(translation).length) {
|
|
815
897
|
return translation;
|
|
816
898
|
}
|
|
@@ -839,13 +921,13 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
839
921
|
}, {
|
|
840
922
|
key: "prepareData",
|
|
841
923
|
value: function () {
|
|
842
|
-
var _prepareData = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(
|
|
924
|
+
var _prepareData = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(_ref13) {
|
|
843
925
|
var _this3 = this;
|
|
844
|
-
var basket, baseData, classificationData, variantData, removedProducts, removedMedia, classificationFields, fieldConfiguration, optMap,
|
|
926
|
+
var basket, baseData, classificationData, variantData, removedProducts, removedMedia, classificationFields, fieldConfiguration, optMap, _ref13$oldClassificat, oldClassificationData, originProductId, products, originProduct, mediasToSave, sapEinaLifNr, sapEineEkgrp, _originProduct$custom, _originProduct$custom2, _originProduct$custom3, _originProduct$custom4, result, _this$closeModal, _originProduct$percen, _originProduct$discou, _baseData$variantId, _originProduct$create, _originProduct$create2, _originProduct$create3, baseProduct, j, mediaRef, _this$openModal, _this$t, _j, _this$openModal2, _this$t2, _loop, _j2, mediasForProducts, _loop2, productId;
|
|
845
927
|
return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context5) {
|
|
846
928
|
while (1) switch (_context5.prev = _context5.next) {
|
|
847
929
|
case 0:
|
|
848
|
-
basket =
|
|
930
|
+
basket = _ref13.basket, baseData = _ref13.baseData, classificationData = _ref13.classificationData, variantData = _ref13.variantData, removedProducts = _ref13.removedProducts, removedMedia = _ref13.removedMedia, classificationFields = _ref13.classificationFields, fieldConfiguration = _ref13.fieldConfiguration, optMap = _ref13.optMap, _ref13$oldClassificat = _ref13.oldClassificationData, oldClassificationData = _ref13$oldClassificat === void 0 ? {} : _ref13$oldClassificat, originProductId = _ref13.originProductId;
|
|
849
931
|
products = [];
|
|
850
932
|
originProduct = undefined;
|
|
851
933
|
mediasToSave = [];
|
|
@@ -868,8 +950,8 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
868
950
|
}
|
|
869
951
|
throw new Error('Origin Product not found');
|
|
870
952
|
case 11:
|
|
871
|
-
sapEinaLifNr = originProduct.customData.SAP_EINA_LIFNR.value;
|
|
872
|
-
sapEineEkgrp = originProduct.customData.SAP_EINE_EKGRP.value;
|
|
953
|
+
sapEinaLifNr = (_originProduct$custom = (_originProduct$custom2 = originProduct.customData.SAP) === null || _originProduct$custom2 === void 0 ? void 0 : _originProduct$custom2.SAP_EINA_LIFNR) !== null && _originProduct$custom !== void 0 ? _originProduct$custom : originProduct.customData.SAP_EINA_LIFNR.value;
|
|
954
|
+
sapEineEkgrp = (_originProduct$custom3 = (_originProduct$custom4 = originProduct.customData.SAP) === null || _originProduct$custom4 === void 0 ? void 0 : _originProduct$custom4.SAP_EINE_EKGRP) !== null && _originProduct$custom3 !== void 0 ? _originProduct$custom3 : originProduct.customData.SAP_EINE_EKGRP.value;
|
|
873
955
|
if (!(!sapEinaLifNr || !sapEineEkgrp)) {
|
|
874
956
|
_context5.next = 16;
|
|
875
957
|
break;
|
|
@@ -892,11 +974,11 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
892
974
|
}
|
|
893
975
|
this.trimStrings(baseData);
|
|
894
976
|
//the base product is constructed, based on baseData and classification data
|
|
895
|
-
baseProduct = _objectSpread(_objectSpread(_objectSpread({}, baseData), Object.entries(classificationData || {}).reduce(function (prev,
|
|
977
|
+
baseProduct = _objectSpread(_objectSpread(_objectSpread({}, baseData), Object.entries(classificationData || {}).reduce(function (prev, _ref14) {
|
|
896
978
|
var _fieldConfiguration$c;
|
|
897
|
-
var
|
|
898
|
-
key =
|
|
899
|
-
value =
|
|
979
|
+
var _ref15 = _slicedToArray__default["default"](_ref14, 2),
|
|
980
|
+
key = _ref15[0],
|
|
981
|
+
value = _ref15[1];
|
|
900
982
|
prev["dc_".concat(key)] = _this3.mapClass(value, fieldConfiguration === null || fieldConfiguration === void 0 || (_fieldConfiguration$c = fieldConfiguration.classMap[key]) === null || _fieldConfiguration$c === void 0 ? void 0 : _fieldConfiguration$c.values);
|
|
901
983
|
return prev;
|
|
902
984
|
}, {})), {}, {
|
|
@@ -908,11 +990,11 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
908
990
|
});
|
|
909
991
|
if (!originProduct && baseData.customData) {
|
|
910
992
|
//convert all customData to objects with value and translations, if they exists
|
|
911
|
-
Object.entries(baseData.customData).forEach(function (
|
|
993
|
+
Object.entries(baseData.customData).forEach(function (_ref16) {
|
|
912
994
|
var _baseProduct$customDa;
|
|
913
|
-
var
|
|
914
|
-
key =
|
|
915
|
-
value =
|
|
995
|
+
var _ref17 = _slicedToArray__default["default"](_ref16, 2),
|
|
996
|
+
key = _ref17[0],
|
|
997
|
+
value = _ref17[1];
|
|
916
998
|
if (!((_baseProduct$customDa = baseProduct.customData[key]) !== null && _baseProduct$customDa !== void 0 && _baseProduct$customDa.value)) {
|
|
917
999
|
var _fieldConfiguration$a;
|
|
918
1000
|
baseProduct.customData[key] = _this3.mapClass(value, fieldConfiguration === null || fieldConfiguration === void 0 || (_fieldConfiguration$a = fieldConfiguration.additional) === null || _fieldConfiguration$a === void 0 || (_fieldConfiguration$a = _fieldConfiguration$a[key]) === null || _fieldConfiguration$a === void 0 ? void 0 : _fieldConfiguration$a.values);
|
|
@@ -921,16 +1003,16 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
921
1003
|
}
|
|
922
1004
|
if (optMap) {
|
|
923
1005
|
//save to class fields the information to which opt it maps
|
|
924
|
-
Object.entries(optMap).filter(function (
|
|
925
|
-
var
|
|
926
|
-
|
|
927
|
-
var value =
|
|
1006
|
+
Object.entries(optMap).filter(function (_ref18) {
|
|
1007
|
+
var _ref19 = _slicedToArray__default["default"](_ref18, 2);
|
|
1008
|
+
_ref19[0];
|
|
1009
|
+
var value = _ref19[1];
|
|
928
1010
|
return value;
|
|
929
|
-
}).forEach(function (
|
|
1011
|
+
}).forEach(function (_ref20) {
|
|
930
1012
|
var _baseProduct21;
|
|
931
|
-
var
|
|
932
|
-
key =
|
|
933
|
-
value =
|
|
1013
|
+
var _ref21 = _slicedToArray__default["default"](_ref20, 2),
|
|
1014
|
+
key = _ref21[0],
|
|
1015
|
+
value = _ref21[1];
|
|
934
1016
|
return baseProduct["dc_".concat(key)] = _objectSpread(_objectSpread({}, (_baseProduct21 = baseProduct["dc_".concat(key)]) !== null && _baseProduct21 !== void 0 ? _baseProduct21 : {}), {}, {
|
|
935
1017
|
opt: value.field
|
|
936
1018
|
});
|
|
@@ -1005,11 +1087,11 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
1005
1087
|
case 3:
|
|
1006
1088
|
varinatBase = {};
|
|
1007
1089
|
classData = {};
|
|
1008
|
-
Object.entries(vd).forEach(function (
|
|
1090
|
+
Object.entries(vd).forEach(function (_ref22) {
|
|
1009
1091
|
var _optMap$key;
|
|
1010
|
-
var
|
|
1011
|
-
key =
|
|
1012
|
-
value =
|
|
1092
|
+
var _ref23 = _slicedToArray__default["default"](_ref22, 2),
|
|
1093
|
+
key = _ref23[0],
|
|
1094
|
+
value = _ref23[1];
|
|
1013
1095
|
//save those fields that are specified as class fields
|
|
1014
1096
|
if (classificationFields !== null && classificationFields !== void 0 && classificationFields.includes(key) && (value || optMap !== null && optMap !== void 0 && (_optMap$key = optMap[key]) !== null && _optMap$key !== void 0 && _optMap$key.field)) {
|
|
1015
1097
|
classData["dc_".concat(key)] = _this3.mapClass(value, fieldConfiguration === null || fieldConfiguration === void 0 ? void 0 : fieldConfiguration.classMap[key].values);
|
|
@@ -1023,16 +1105,16 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
1023
1105
|
});
|
|
1024
1106
|
if (optMap) {
|
|
1025
1107
|
//save to class fields the information to which opt it maps
|
|
1026
|
-
Object.entries(optMap).filter(function (
|
|
1027
|
-
var
|
|
1028
|
-
|
|
1029
|
-
var value =
|
|
1108
|
+
Object.entries(optMap).filter(function (_ref24) {
|
|
1109
|
+
var _ref25 = _slicedToArray__default["default"](_ref24, 2);
|
|
1110
|
+
_ref25[0];
|
|
1111
|
+
var value = _ref25[1];
|
|
1030
1112
|
return value;
|
|
1031
|
-
}).forEach(function (
|
|
1113
|
+
}).forEach(function (_ref26) {
|
|
1032
1114
|
var _oldClassificationDat, _oldClassificationDat2, _value$field, _value$field2, _value$field3, _value$field4;
|
|
1033
|
-
var
|
|
1034
|
-
key =
|
|
1035
|
-
value =
|
|
1115
|
+
var _ref27 = _slicedToArray__default["default"](_ref26, 2),
|
|
1116
|
+
key = _ref27[0],
|
|
1117
|
+
value = _ref27[1];
|
|
1036
1118
|
return classData["dc_".concat(key)] = _objectSpread(_objectSpread(_objectSpread({}, (_oldClassificationDat = (_oldClassificationDat2 = oldClassificationData[vd._id]) === null || _oldClassificationDat2 === void 0 ? void 0 : _oldClassificationDat2["dc_".concat(key)]) !== null && _oldClassificationDat !== void 0 ? _oldClassificationDat : {}), classData["dc_".concat(key)]), {}, {
|
|
1037
1119
|
opt: value.field,
|
|
1038
1120
|
opv: (_value$field = vd[value.field]) === null || _value$field === void 0 ? void 0 : _value$field.codex,
|
|
@@ -1048,11 +1130,11 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
1048
1130
|
if (vd.customData) {
|
|
1049
1131
|
customData = {};
|
|
1050
1132
|
//convert all customData to objects with value and translations, if they exists
|
|
1051
|
-
Object.entries(vd.customData).forEach(function (
|
|
1133
|
+
Object.entries(vd.customData).forEach(function (_ref28) {
|
|
1052
1134
|
var _vd$customData, _fieldConfiguration$a2;
|
|
1053
|
-
var
|
|
1054
|
-
key =
|
|
1055
|
-
value =
|
|
1135
|
+
var _ref29 = _slicedToArray__default["default"](_ref28, 2),
|
|
1136
|
+
key = _ref29[0],
|
|
1137
|
+
value = _ref29[1];
|
|
1056
1138
|
if (!((_vd$customData = vd.customData) !== null && _vd$customData !== void 0 && (_vd$customData = _vd$customData[key]) !== null && _vd$customData !== void 0 && _vd$customData.value)) customData[key] = _this3.mapClass(value, fieldConfiguration === null || fieldConfiguration === void 0 || (_fieldConfiguration$a2 = fieldConfiguration.additional) === null || _fieldConfiguration$a2 === void 0 || (_fieldConfiguration$a2 = _fieldConfiguration$a2[key]) === null || _fieldConfiguration$a2 === void 0 ? void 0 : _fieldConfiguration$a2.values);
|
|
1057
1139
|
});
|
|
1058
1140
|
}
|
|
@@ -1086,6 +1168,10 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
1086
1168
|
},
|
|
1087
1169
|
SAP_EINE_EKGRP: {
|
|
1088
1170
|
value: sapEineEkgrp
|
|
1171
|
+
},
|
|
1172
|
+
SAP: {
|
|
1173
|
+
SAP_EINA_LIFNR: sapEinaLifNr,
|
|
1174
|
+
SAP_EINE_EKGRP: sapEineEkgrp
|
|
1089
1175
|
}
|
|
1090
1176
|
}) : customData,
|
|
1091
1177
|
modelInfoPageWeight: baseProduct.modelInfoPageWeight,
|
|
@@ -1230,12 +1316,12 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
1230
1316
|
}, {
|
|
1231
1317
|
key: "saveProducts",
|
|
1232
1318
|
value: function () {
|
|
1233
|
-
var _saveProducts = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee4(
|
|
1319
|
+
var _saveProducts = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee4(_ref30) {
|
|
1234
1320
|
var products, removedProducts, awaitPDF, _this$closeModal2, savedProducts, _this$closeModal3;
|
|
1235
1321
|
return _regeneratorRuntime__default["default"].wrap(function _callee4$(_context6) {
|
|
1236
1322
|
while (1) switch (_context6.prev = _context6.next) {
|
|
1237
1323
|
case 0:
|
|
1238
|
-
products =
|
|
1324
|
+
products = _ref30.products, removedProducts = _ref30.removedProducts, awaitPDF = _ref30.awaitPDF;
|
|
1239
1325
|
if (this.jwt) {
|
|
1240
1326
|
_context6.next = 3;
|
|
1241
1327
|
break;
|
|
@@ -1301,24 +1387,24 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
1301
1387
|
var _basket$OrderSets$0$C3, _variantProduct$confi, _variantProduct$confi2, _variantProduct$order, _classificationFields;
|
|
1302
1388
|
var _this$parseClassifica = this.parseClassificationFields(variantProduct),
|
|
1303
1389
|
parsedProduct = _this$parseClassifica.product;
|
|
1304
|
-
var
|
|
1390
|
+
var _ref31 = (basket === null || basket === void 0 || (_basket$OrderSets$0$C3 = basket.OrderSets[0].ConfigVariants) === null || _basket$OrderSets$0$C3 === void 0 ? void 0 : _basket$OrderSets$0$C3.find(function (vd) {
|
|
1305
1391
|
return vd.VariantID === cv;
|
|
1306
1392
|
})) || {
|
|
1307
1393
|
VariantBasketDatas: ProductHandlerAbstract.getVariantBasketDatasByOrderlines((_variantProduct$confi = variantProduct === null || variantProduct === void 0 || (_variantProduct$confi2 = variantProduct.configuration) === null || _variantProduct$confi2 === void 0 ? void 0 : _variantProduct$confi2.OrderSets[0].OrderLines) !== null && _variantProduct$confi !== void 0 ? _variantProduct$confi : [], catalogData)
|
|
1308
1394
|
},
|
|
1309
|
-
VariantID =
|
|
1310
|
-
SetImage =
|
|
1311
|
-
Set2DImage =
|
|
1312
|
-
SetPrice =
|
|
1313
|
-
VariantBasketDatas =
|
|
1314
|
-
BBox =
|
|
1315
|
-
MetaData =
|
|
1316
|
-
MetaData_locales =
|
|
1317
|
-
Variant =
|
|
1318
|
-
SetHash =
|
|
1319
|
-
Diva3DProject =
|
|
1320
|
-
VariantDescription_locales =
|
|
1321
|
-
VariantDescription =
|
|
1395
|
+
VariantID = _ref31.VariantID,
|
|
1396
|
+
SetImage = _ref31.SetImage,
|
|
1397
|
+
Set2DImage = _ref31.Set2DImage,
|
|
1398
|
+
SetPrice = _ref31.SetPrice,
|
|
1399
|
+
VariantBasketDatas = _ref31.VariantBasketDatas,
|
|
1400
|
+
BBox = _ref31.BBox,
|
|
1401
|
+
MetaData = _ref31.MetaData,
|
|
1402
|
+
MetaData_locales = _ref31.MetaData_locales,
|
|
1403
|
+
Variant = _ref31.Variant,
|
|
1404
|
+
SetHash = _ref31.SetHash,
|
|
1405
|
+
Diva3DProject = _ref31.Diva3DProject,
|
|
1406
|
+
VariantDescription_locales = _ref31.VariantDescription_locales,
|
|
1407
|
+
VariantDescription = _ref31.VariantDescription;
|
|
1322
1408
|
//total and summary price are currently not avialable per varinat,
|
|
1323
1409
|
//most of the time the prices will allways be the same and since we currently not support varinats for multiple sets
|
|
1324
1410
|
//we use the addedPrice of the baseData as long as the calculatedPrice is the same as the SetPrice of the variant
|
|
@@ -1457,10 +1543,10 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
1457
1543
|
key: "initOpvMap",
|
|
1458
1544
|
value: function initOpvMap(optFields, classificationConfig, savedOptMap) {
|
|
1459
1545
|
var optMap = {};
|
|
1460
|
-
Object.entries((classificationConfig === null || classificationConfig === void 0 ? void 0 : classificationConfig.classMap) || {}).forEach(function (
|
|
1461
|
-
var
|
|
1462
|
-
c =
|
|
1463
|
-
optMapping =
|
|
1546
|
+
Object.entries((classificationConfig === null || classificationConfig === void 0 ? void 0 : classificationConfig.classMap) || {}).forEach(function (_ref32) {
|
|
1547
|
+
var _ref33 = _slicedToArray__default["default"](_ref32, 2),
|
|
1548
|
+
c = _ref33[0],
|
|
1549
|
+
optMapping = _ref33[1].optMapping;
|
|
1464
1550
|
var optField;
|
|
1465
1551
|
if (savedOptMap !== null && savedOptMap !== void 0 && savedOptMap[c]) {
|
|
1466
1552
|
optField = optFields.find(function (opt) {
|
|
@@ -1521,16 +1607,16 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
1521
1607
|
var _classificationConfig;
|
|
1522
1608
|
//add metadata defined as classification to classificationdata
|
|
1523
1609
|
var metadataAsClassification = {};
|
|
1524
|
-
Object.entries(metaData !== null && metaData !== void 0 ? metaData : {}).filter(function (
|
|
1525
|
-
var
|
|
1526
|
-
key =
|
|
1610
|
+
Object.entries(metaData !== null && metaData !== void 0 ? metaData : {}).filter(function (_ref34) {
|
|
1611
|
+
var _ref35 = _slicedToArray__default["default"](_ref34, 1),
|
|
1612
|
+
key = _ref35[0];
|
|
1527
1613
|
return classificationConfig === null || classificationConfig === void 0 ? void 0 : classificationConfig.classMap[key];
|
|
1528
1614
|
})
|
|
1529
1615
|
//if it is defiend as multi field, use full array otherwise only first element of array
|
|
1530
|
-
.forEach(function (
|
|
1531
|
-
var
|
|
1532
|
-
key =
|
|
1533
|
-
value =
|
|
1616
|
+
.forEach(function (_ref36) {
|
|
1617
|
+
var _ref37 = _slicedToArray__default["default"](_ref36, 2),
|
|
1618
|
+
key = _ref37[0],
|
|
1619
|
+
value = _ref37[1];
|
|
1534
1620
|
return metadataAsClassification[key] = classificationConfig.classMap[key].multi ? value : value === null || value === void 0 ? void 0 : value[0];
|
|
1535
1621
|
});
|
|
1536
1622
|
|
|
@@ -1540,14 +1626,14 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
1540
1626
|
optMap = _this$parseClassifica2.optMap;
|
|
1541
1627
|
var classificationData = _objectSpread(_objectSpread({}, metadataAsClassification), productClassification);
|
|
1542
1628
|
var customData = {};
|
|
1543
|
-
Object.entries(metaData !== null && metaData !== void 0 ? metaData : {}).filter(function (
|
|
1544
|
-
var
|
|
1545
|
-
key =
|
|
1629
|
+
Object.entries(metaData !== null && metaData !== void 0 ? metaData : {}).filter(function (_ref38) {
|
|
1630
|
+
var _ref39 = _slicedToArray__default["default"](_ref38, 1),
|
|
1631
|
+
key = _ref39[0];
|
|
1546
1632
|
return !(classificationConfig !== null && classificationConfig !== void 0 && classificationConfig.classMap[key]);
|
|
1547
|
-
}).forEach(function (
|
|
1548
|
-
var
|
|
1549
|
-
key =
|
|
1550
|
-
value =
|
|
1633
|
+
}).forEach(function (_ref40) {
|
|
1634
|
+
var _ref41 = _slicedToArray__default["default"](_ref40, 2),
|
|
1635
|
+
key = _ref41[0],
|
|
1636
|
+
value = _ref41[1];
|
|
1551
1637
|
var langs = {};
|
|
1552
1638
|
if (metaData_locales !== null && metaData_locales !== void 0 && metaData_locales[key]) {
|
|
1553
1639
|
for (var i = 0; i < metaData_locales[key].length; i++) {
|
|
@@ -1579,14 +1665,14 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
1579
1665
|
|
|
1580
1666
|
//repare customData
|
|
1581
1667
|
//if it is defiend as multi field, use full array otherwise only first element of array
|
|
1582
|
-
Object.entries((_classificationConfig = classificationConfig === null || classificationConfig === void 0 ? void 0 : classificationConfig.additional) !== null && _classificationConfig !== void 0 ? _classificationConfig : []).filter(function (
|
|
1583
|
-
var
|
|
1584
|
-
key =
|
|
1668
|
+
Object.entries((_classificationConfig = classificationConfig === null || classificationConfig === void 0 ? void 0 : classificationConfig.additional) !== null && _classificationConfig !== void 0 ? _classificationConfig : []).filter(function (_ref42) {
|
|
1669
|
+
var _ref43 = _slicedToArray__default["default"](_ref42, 1),
|
|
1670
|
+
key = _ref43[0];
|
|
1585
1671
|
return customData[key] != undefined;
|
|
1586
|
-
}).forEach(function (
|
|
1587
|
-
var
|
|
1588
|
-
key =
|
|
1589
|
-
value =
|
|
1672
|
+
}).forEach(function (_ref44) {
|
|
1673
|
+
var _ref45 = _slicedToArray__default["default"](_ref44, 2),
|
|
1674
|
+
key = _ref45[0],
|
|
1675
|
+
value = _ref45[1];
|
|
1590
1676
|
if (value.multi && !Array.isArray(customData[key])) {
|
|
1591
1677
|
customData[key] = [customData[key]];
|
|
1592
1678
|
} else if (!value.multi && Array.isArray(customData[key])) {
|
|
@@ -1805,13 +1891,20 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
1805
1891
|
key: "apiGetCatalogDataIDM",
|
|
1806
1892
|
value: function () {
|
|
1807
1893
|
var _apiGetCatalogDataIDM = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee8(serieNo, language, catalogId) {
|
|
1808
|
-
var _cat$Properties, _cat$detailInfos$filt, _cat$detailInfos;
|
|
1809
|
-
var fullUrl, response, cat, actCatalogInfoData;
|
|
1894
|
+
var _this$organization, _cat$Properties, _cat$detailInfos$filt, _cat$detailInfos;
|
|
1895
|
+
var organizationId, fullUrl, response, cat, actCatalogInfoData;
|
|
1810
1896
|
return _regeneratorRuntime__default["default"].wrap(function _callee8$(_context10) {
|
|
1811
1897
|
while (1) switch (_context10.prev = _context10.next) {
|
|
1812
1898
|
case 0:
|
|
1813
|
-
|
|
1814
|
-
|
|
1899
|
+
organizationId = (_this$organization = this.organization) === null || _this$organization === void 0 ? void 0 : _this$organization._id;
|
|
1900
|
+
if (organizationId) {
|
|
1901
|
+
_context10.next = 3;
|
|
1902
|
+
break;
|
|
1903
|
+
}
|
|
1904
|
+
throw new Error('organizationId is required to load IDM catalog data');
|
|
1905
|
+
case 3:
|
|
1906
|
+
fullUrl = this.enricherService + '/live/' + organizationId + '/packages/' + catalogId + '/series/' + serieNo;
|
|
1907
|
+
_context10.next = 6;
|
|
1815
1908
|
return fetch(fullUrl, {
|
|
1816
1909
|
headers: _objectSpread(_objectSpread({}, this.getHeaders()), {}, {
|
|
1817
1910
|
'Content-Type': 'application/json'
|
|
@@ -1822,21 +1915,21 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
1822
1915
|
}
|
|
1823
1916
|
return res.json();
|
|
1824
1917
|
});
|
|
1825
|
-
case
|
|
1918
|
+
case 6:
|
|
1826
1919
|
response = _context10.sent;
|
|
1827
1920
|
if (!response.Error) {
|
|
1828
|
-
_context10.next =
|
|
1921
|
+
_context10.next = 9;
|
|
1829
1922
|
break;
|
|
1830
1923
|
}
|
|
1831
1924
|
throw new Error(response.Error);
|
|
1832
|
-
case
|
|
1925
|
+
case 9:
|
|
1833
1926
|
cat = response;
|
|
1834
1927
|
if (cat) {
|
|
1835
|
-
_context10.next =
|
|
1928
|
+
_context10.next = 12;
|
|
1836
1929
|
break;
|
|
1837
1930
|
}
|
|
1838
1931
|
throw new Error('serieNo: ' + serieNo + ' not found');
|
|
1839
|
-
case
|
|
1932
|
+
case 12:
|
|
1840
1933
|
actCatalogInfoData = {
|
|
1841
1934
|
lang: language,
|
|
1842
1935
|
guid: cat._id,
|
|
@@ -1865,7 +1958,7 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
1865
1958
|
documents: []
|
|
1866
1959
|
};
|
|
1867
1960
|
return _context10.abrupt("return", actCatalogInfoData);
|
|
1868
|
-
case
|
|
1961
|
+
case 14:
|
|
1869
1962
|
case "end":
|
|
1870
1963
|
return _context10.stop();
|
|
1871
1964
|
}
|
|
@@ -2236,12 +2329,12 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
2236
2329
|
}, {
|
|
2237
2330
|
key: "apiLoadProductVariantsGrouped",
|
|
2238
2331
|
value: function () {
|
|
2239
|
-
var _apiLoadProductVariantsGrouped = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee15(
|
|
2240
|
-
var limit, skip, fields,
|
|
2332
|
+
var _apiLoadProductVariantsGrouped = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee15(_ref46) {
|
|
2333
|
+
var limit, skip, fields, _ref46$search, search, sort, favorites, abortController, fullUrl, headers, promise;
|
|
2241
2334
|
return _regeneratorRuntime__default["default"].wrap(function _callee15$(_context17) {
|
|
2242
2335
|
while (1) switch (_context17.prev = _context17.next) {
|
|
2243
2336
|
case 0:
|
|
2244
|
-
limit =
|
|
2337
|
+
limit = _ref46.limit, skip = _ref46.skip, fields = _ref46.fields, _ref46$search = _ref46.search, search = _ref46$search === void 0 ? [] : _ref46$search, sort = _ref46.sort, favorites = _ref46.favorites, abortController = _ref46.abortController;
|
|
2245
2338
|
fullUrl = this.catalogService + '/v1/products/groups' + '?organizationId=' + this.organization._id + (this._organization.parentOrganizationIds ? '&parentOrganizationIds=' + this._organization.parentOrganizationIds.join(',') : '') + (limit ? '&limit=' + limit : '') + (skip ? '&skip=' + skip : '') + (fields ? '&fileds=' + DivaUtils__default["default"].fixedEncodeURIComponent('{' + fields.join(',') + '}') : '') + (search.length ? '&search=' + DivaUtils__default["default"].fixedEncodeURIComponent(this.parseFilter(search)) : '') + (sort ? '&sort=' + DivaUtils__default["default"].fixedEncodeURIComponent(sort) : '') + (favorites ? '&favorites=true' : '');
|
|
2246
2339
|
headers = {
|
|
2247
2340
|
'Content-Type': 'application/json'
|
|
@@ -2625,10 +2718,10 @@ var ProductHandlerAbstract = /*#__PURE__*/function () {
|
|
|
2625
2718
|
return Object.assign.apply(Object, [target].concat(_toConsumableArray__default["default"](sources.filter(function (s) {
|
|
2626
2719
|
return s;
|
|
2627
2720
|
}).map(function (x) {
|
|
2628
|
-
return Object.fromEntries(Object.entries(x).filter(function (
|
|
2629
|
-
var
|
|
2630
|
-
|
|
2631
|
-
var value =
|
|
2721
|
+
return Object.fromEntries(Object.entries(x).filter(function (_ref47) {
|
|
2722
|
+
var _ref48 = _slicedToArray__default["default"](_ref47, 2);
|
|
2723
|
+
_ref48[0];
|
|
2724
|
+
var value = _ref48[1];
|
|
2632
2725
|
return value !== undefined;
|
|
2633
2726
|
}));
|
|
2634
2727
|
}))));
|
|
@@ -2935,5 +3028,10 @@ _defineProperty__default["default"](ProductHandlerAbstract, "standardBaseDataFie
|
|
|
2935
3028
|
}]);
|
|
2936
3029
|
_defineProperty__default["default"](ProductHandlerAbstract, "baseDataFields", _ProductHandlerAbstract.standardBaseDataFields.concat(_ProductHandlerAbstract.generalBaseDataFields));
|
|
2937
3030
|
|
|
3031
|
+
exports.PRODUCT_MERGE_FIELD_KEYS = PRODUCT_MERGE_FIELD_KEYS;
|
|
2938
3032
|
exports.ProductHandlerAbstract = ProductHandlerAbstract;
|
|
2939
3033
|
exports.TRANSLATED_FILEDS = TRANSLATED_FILEDS;
|
|
3034
|
+
exports.applyProductHeaderOverrides = applyProductHeaderOverrides;
|
|
3035
|
+
exports.deepMergeRecords = deepMergeRecords;
|
|
3036
|
+
exports.getMergeableRootJsonPatchPrefixes = getMergeableRootJsonPatchPrefixes;
|
|
3037
|
+
exports.mergeFieldKeyToOverrideValuesPath = mergeFieldKeyToOverrideValuesPath;
|