@commercetools/sync-actions 4.9.5 → 4.10.1

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.
@@ -18,45 +18,18 @@ var forEach__default = /*#__PURE__*/_interopDefaultLegacy(forEach);
18
18
  var uniqWith__default = /*#__PURE__*/_interopDefaultLegacy(uniqWith);
19
19
  var sortBy__default = /*#__PURE__*/_interopDefaultLegacy(sortBy);
20
20
 
21
- function _typeof(obj) {
22
- "@babel/helpers - typeof";
23
-
24
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
25
- _typeof = function (obj) {
26
- return typeof obj;
27
- };
28
- } else {
29
- _typeof = function (obj) {
30
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
31
- };
32
- }
33
-
34
- return _typeof(obj);
35
- }
36
-
37
- function _defineProperty(obj, key, value) {
38
- if (key in obj) {
39
- Object.defineProperty(obj, key, {
40
- value: value,
41
- enumerable: true,
42
- configurable: true,
43
- writable: true
44
- });
45
- } else {
46
- obj[key] = value;
47
- }
48
-
49
- return obj;
50
- }
51
-
52
21
  function ownKeys(object, enumerableOnly) {
53
22
  var keys = Object.keys(object);
54
23
 
55
24
  if (Object.getOwnPropertySymbols) {
56
25
  var symbols = Object.getOwnPropertySymbols(object);
57
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
58
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
59
- });
26
+
27
+ if (enumerableOnly) {
28
+ symbols = symbols.filter(function (sym) {
29
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
30
+ });
31
+ }
32
+
60
33
  keys.push.apply(keys, symbols);
61
34
  }
62
35
 
@@ -83,6 +56,37 @@ function _objectSpread2(target) {
83
56
  return target;
84
57
  }
85
58
 
59
+ function _typeof(obj) {
60
+ "@babel/helpers - typeof";
61
+
62
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
63
+ _typeof = function (obj) {
64
+ return typeof obj;
65
+ };
66
+ } else {
67
+ _typeof = function (obj) {
68
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
69
+ };
70
+ }
71
+
72
+ return _typeof(obj);
73
+ }
74
+
75
+ function _defineProperty(obj, key, value) {
76
+ if (key in obj) {
77
+ Object.defineProperty(obj, key, {
78
+ value: value,
79
+ enumerable: true,
80
+ configurable: true,
81
+ writable: true
82
+ });
83
+ } else {
84
+ obj[key] = value;
85
+ }
86
+
87
+ return obj;
88
+ }
89
+
86
90
  function _objectWithoutPropertiesLoose(source, excluded) {
87
91
  if (source == null) return {};
88
92
  var target = {};
@@ -136,18 +140,21 @@ function _arrayWithHoles(arr) {
136
140
  }
137
141
 
138
142
  function _iterableToArray(iter) {
139
- if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
143
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
140
144
  }
141
145
 
142
146
  function _iterableToArrayLimit(arr, i) {
143
- if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
147
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
148
+
149
+ if (_i == null) return;
144
150
  var _arr = [];
145
151
  var _n = true;
146
152
  var _d = false;
147
- var _e = undefined;
153
+
154
+ var _s, _e;
148
155
 
149
156
  try {
150
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
157
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
151
158
  _arr.push(_s.value);
152
159
 
153
160
  if (i && _arr.length === i) break;
@@ -191,6 +198,8 @@ function _nonIterableRest() {
191
198
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
192
199
  }
193
200
 
201
+ var _excluded$1 = ["prices"];
202
+
194
203
  function applyOnBeforeDiff(before, now, fn) {
195
204
  return fn && typeof fn === 'function' ? fn(before, now) : [before, now];
196
205
  }
@@ -211,7 +220,7 @@ var createPriceComparator = function createPriceComparator(price) {
211
220
  function arePricesStructurallyEqual(oldPrice, newPrice) {
212
221
  var oldPriceComparison = createPriceComparator(oldPrice);
213
222
  var newPriceComparison = createPriceComparator(newPrice);
214
- return isEqual__default['default'](newPriceComparison, oldPriceComparison);
223
+ return isEqual__default["default"](newPriceComparison, oldPriceComparison);
215
224
  }
216
225
 
217
226
  function extractPriceFromPreviousVariant(newPrice, previousVariant) {
@@ -225,11 +234,11 @@ function extractPriceFromPreviousVariant(newPrice, previousVariant) {
225
234
  function injectMissingPriceIds(nextVariants, previousVariants) {
226
235
  return nextVariants.map(function (newVariant) {
227
236
  var prices = newVariant.prices,
228
- restOfVariant = _objectWithoutProperties(newVariant, ["prices"]);
237
+ restOfVariant = _objectWithoutProperties(newVariant, _excluded$1);
229
238
 
230
239
  if (!prices) return restOfVariant;
231
240
  var oldVariant = previousVariants.find(function (previousVariant) {
232
- return !isNil__default['default'](previousVariant.id) && previousVariant.id === newVariant.id || !isNil__default['default'](previousVariant.key) && previousVariant.key === newVariant.key || !isNil__default['default'](previousVariant.sku) && previousVariant.sku === newVariant.sku;
241
+ return !isNil__default["default"](previousVariant.id) && previousVariant.id === newVariant.id || !isNil__default["default"](previousVariant.key) && previousVariant.key === newVariant.key || !isNil__default["default"](previousVariant.sku) && previousVariant.sku === newVariant.sku;
233
242
  });
234
243
  return _objectSpread2(_objectSpread2({}, restOfVariant), {}, {
235
244
  prices: prices.map(function (price) {
@@ -240,8 +249,8 @@ function injectMissingPriceIds(nextVariants, previousVariants) {
240
249
  if (oldPrice) {
241
250
  // copy ID if not provided
242
251
  if (!newPrice.id) newPrice.id = oldPrice.id;
243
- if (isNil__default['default'](newPrice.value.type)) newPrice.value.type = oldPrice.value.type;
244
- if (isNil__default['default'](newPrice.value.fractionDigits)) newPrice.value.fractionDigits = oldPrice.value.fractionDigits;
252
+ if (isNil__default["default"](newPrice.value.type)) newPrice.value.type = oldPrice.value.type;
253
+ if (isNil__default["default"](newPrice.value.fractionDigits)) newPrice.value.fractionDigits = oldPrice.value.fractionDigits;
245
254
  }
246
255
 
247
256
  return newPrice;
@@ -342,6 +351,7 @@ function getDeltaValue(arr, originalObject) {
342
351
  throw new Error("Got unsupported number ".concat(arr[2], " in delta value"));
343
352
  }
344
353
 
354
+ var _excluded = ["actions"];
345
355
  var Actions = {
346
356
  setCustomType: 'setCustomType',
347
357
  setCustomField: 'setCustomField'
@@ -386,7 +396,7 @@ function actionsMapCustom(diff, newObj, oldObj) {
386
396
  var actions = [];
387
397
 
388
398
  var customPropsActions = customProps.actions,
389
- options = _objectWithoutProperties(customProps, ["actions"]);
399
+ options = _objectWithoutProperties(customProps, _excluded);
390
400
 
391
401
  var actionGroup = _objectSpread2(_objectSpread2({}, Actions), customPropsActions);
392
402
 
@@ -435,8 +445,8 @@ function actionsMapCustom(diff, newObj, oldObj) {
435
445
  return actions;
436
446
  }
437
447
 
438
- var REGEX_NUMBER = new RegExp(/^\d+$/);
439
- var REGEX_UNDERSCORE_NUMBER = new RegExp(/^_\d+$/);
448
+ var REGEX_NUMBER$4 = new RegExp(/^\d+$/);
449
+ var REGEX_UNDERSCORE_NUMBER$4 = new RegExp(/^_\d+$/);
440
450
  var ADD_ACTIONS = 'create';
441
451
  var REMOVE_ACTIONS = 'remove';
442
452
  var CHANGE_ACTIONS = 'change';
@@ -454,7 +464,7 @@ var CHANGE_ACTIONS = 'change';
454
464
  */
455
465
 
456
466
  function isCreateAction(obj, key) {
457
- return REGEX_NUMBER.test(key) && Array.isArray(obj[key]) && obj[key].length === 1;
467
+ return REGEX_NUMBER$4.test(key) && Array.isArray(obj[key]) && obj[key].length === 1;
458
468
  }
459
469
  /**
460
470
  * Tests a delta to see if it represents a change action.
@@ -473,7 +483,7 @@ function isCreateAction(obj, key) {
473
483
 
474
484
 
475
485
  function isChangeAction(obj, key) {
476
- return REGEX_NUMBER.test(key) && (_typeof(obj[key]) === 'object' || typeof obj[key] === 'string');
486
+ return REGEX_NUMBER$4.test(key) && (_typeof(obj[key]) === 'object' || typeof obj[key] === 'string');
477
487
  }
478
488
  /**
479
489
  * Tests a delta to see if it represents a remove action.
@@ -489,8 +499,8 @@ function isChangeAction(obj, key) {
489
499
  */
490
500
 
491
501
 
492
- function isRemoveAction(obj, key) {
493
- return REGEX_UNDERSCORE_NUMBER.test(key) && Array.isArray(obj[key]) && obj[key].length === 3 && (_typeof(obj[key][0]) === 'object' || typeof obj[key][0] === 'string') && obj[key][1] === 0 && obj[key][2] === 0;
502
+ function isRemoveAction$1(obj, key) {
503
+ return REGEX_UNDERSCORE_NUMBER$4.test(key) && Array.isArray(obj[key]) && obj[key].length === 3 && (_typeof(obj[key][0]) === 'object' || typeof obj[key][0] === 'string') && obj[key][1] === 0 && obj[key][2] === 0;
494
504
  }
495
505
  /**
496
506
  * Generate + configure a function to build actions for nested objects
@@ -524,7 +534,7 @@ function createBuildArrayActions(key, config) {
524
534
  var _action = _actionGenerator(oldObj[key][index], newObj[key][index], parseInt(index, 10));
525
535
 
526
536
  if (_action) changeActions.push(_action);
527
- } else if (config[REMOVE_ACTIONS] && isRemoveAction(arrayDelta, index)) {
537
+ } else if (config[REMOVE_ACTIONS] && isRemoveAction$1(arrayDelta, index)) {
528
538
  var realIndex = index.replace('_', '');
529
539
  var _actionGenerator2 = config[REMOVE_ACTIONS]; // When removing an existing element you don't need the newObj
530
540
 
@@ -539,7 +549,7 @@ function createBuildArrayActions(key, config) {
539
549
  };
540
550
  }
541
551
 
542
- function toAssetIdentifier(asset) {
552
+ function toAssetIdentifier$1(asset) {
543
553
  var assetIdentifier = asset.id ? {
544
554
  assetId: asset.id
545
555
  } : {
@@ -548,7 +558,7 @@ function toAssetIdentifier(asset) {
548
558
  return assetIdentifier;
549
559
  }
550
560
 
551
- function actionsMapAssets(diff, oldObj, newObj) {
561
+ function actionsMapAssets$1(diff, oldObj, newObj) {
552
562
  var _createBuildArrayActi;
553
563
 
554
564
  var handler = createBuildArrayActions('assets', (_createBuildArrayActi = {}, _defineProperty(_createBuildArrayActi, ADD_ACTIONS, function (newAsset) {
@@ -559,14 +569,14 @@ function actionsMapAssets(diff, oldObj, newObj) {
559
569
  }), _defineProperty(_createBuildArrayActi, REMOVE_ACTIONS, function (oldAsset) {
560
570
  return _objectSpread2({
561
571
  action: 'removeAsset'
562
- }, toAssetIdentifier(oldAsset));
572
+ }, toAssetIdentifier$1(oldAsset));
563
573
  }), _defineProperty(_createBuildArrayActi, CHANGE_ACTIONS, function (oldAsset, newAsset) {
564
574
  return (// here we could use more atomic update actions (e.g. changeAssetName)
565
575
  // but for now we use the simpler approach to first remove and then
566
576
  // re-add the asset - which reduces the code complexity
567
577
  [_objectSpread2({
568
578
  action: 'removeAsset'
569
- }, toAssetIdentifier(oldAsset)), {
579
+ }, toAssetIdentifier$1(oldAsset)), {
570
580
  action: 'addAsset',
571
581
  asset: newAsset
572
582
  }]
@@ -637,7 +647,7 @@ function buildBaseAttributesActions(_ref) {
637
647
  action: item.action
638
648
  }, actionKey, patched);
639
649
  }).filter(function (action) {
640
- return !isNil__default['default'](action);
650
+ return !isNil__default["default"](action);
641
651
  });
642
652
  }
643
653
  /**
@@ -690,7 +700,7 @@ function buildReferenceActions(_ref4) {
690
700
  });
691
701
  }
692
702
 
693
- var baseActionsList = [{
703
+ var baseActionsList$i = [{
694
704
  action: 'changeName',
695
705
  key: 'name'
696
706
  }, {
@@ -709,7 +719,7 @@ var baseActionsList = [{
709
719
  action: 'setKey',
710
720
  key: 'key'
711
721
  }];
712
- var metaActionsList = [{
722
+ var metaActionsList$1 = [{
713
723
  action: 'setMetaTitle',
714
724
  key: 'metaTitle'
715
725
  }, {
@@ -719,7 +729,7 @@ var metaActionsList = [{
719
729
  action: 'setMetaDescription',
720
730
  key: 'metaDescription'
721
731
  }];
722
- var referenceActionsList = [{
732
+ var referenceActionsList$3 = [{
723
733
  action: 'changeParent',
724
734
  key: 'parent'
725
735
  }];
@@ -727,27 +737,27 @@ var referenceActionsList = [{
727
737
  * SYNC FUNCTIONS
728
738
  */
729
739
 
730
- function actionsMapBase(diff, oldObj, newObj) {
740
+ function actionsMapBase$i(diff, oldObj, newObj) {
731
741
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
732
742
  return buildBaseAttributesActions({
733
- actions: baseActionsList,
743
+ actions: baseActionsList$i,
734
744
  diff: diff,
735
745
  oldObj: oldObj,
736
746
  newObj: newObj,
737
747
  shouldOmitEmptyString: config.shouldOmitEmptyString
738
748
  });
739
749
  }
740
- function actionsMapReferences(diff, oldObj, newObj) {
750
+ function actionsMapReferences$3(diff, oldObj, newObj) {
741
751
  return buildReferenceActions({
742
- actions: referenceActionsList,
752
+ actions: referenceActionsList$3,
743
753
  diff: diff,
744
754
  oldObj: oldObj,
745
755
  newObj: newObj
746
756
  });
747
757
  }
748
- function actionsMapMeta(diff, oldObj, newObj) {
758
+ function actionsMapMeta$1(diff, oldObj, newObj) {
749
759
  return buildBaseAttributesActions({
750
- actions: metaActionsList,
760
+ actions: metaActionsList$1,
751
761
  diff: diff,
752
762
  oldObj: oldObj,
753
763
  newObj: newObj
@@ -768,7 +778,7 @@ function copyEmptyArrayProps() {
768
778
  var oldObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
769
779
  var newObj = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
770
780
 
771
- if (!isNil__default['default'](oldObj) && !isNil__default['default'](newObj)) {
781
+ if (!isNil__default["default"](oldObj) && !isNil__default["default"](newObj)) {
772
782
  var nextObjectWithEmptyArray = Object.entries(oldObj).reduce(function (nextObject, _ref) {
773
783
  var _ref2 = _slicedToArray(_ref, 2),
774
784
  key = _ref2[0],
@@ -782,13 +792,13 @@ function copyEmptyArrayProps() {
782
792
 
783
793
  if (Array.isArray(value) && newObj[key] && newObj[key].length >= 1) {
784
794
  var _loop = function _loop(i) {
785
- if (!isNil__default['default'](newObj[key][i]) && _typeof(newObj[key][i]) === 'object' && !isNil__default['default'](newObj[key][i].id)) {
795
+ if (!isNil__default["default"](newObj[key][i]) && _typeof(newObj[key][i]) === 'object' && !isNil__default["default"](newObj[key][i].id)) {
786
796
  // Since its unordered array elements then check if the element on `oldObj` exists by id
787
797
  var foundObject = value.find(function (v) {
788
798
  return Number(v.id) === Number(newObj[key][i].id);
789
799
  });
790
800
 
791
- if (!isNil__default['default'](foundObject)) {
801
+ if (!isNil__default["default"](foundObject)) {
792
802
  var _copyEmptyArrayProps = copyEmptyArrayProps(foundObject, newObj[key][i]),
793
803
  _copyEmptyArrayProps2 = _slicedToArray(_copyEmptyArrayProps, 2),
794
804
  nestedObject = _copyEmptyArrayProps2[1];
@@ -809,10 +819,10 @@ function copyEmptyArrayProps() {
809
819
  }
810
820
 
811
821
  if (Array.isArray(value)) {
812
- return _objectSpread2(_objectSpread2({}, merged), {}, _defineProperty({}, key, isNil__default['default'](newObj[key]) ? [] : newObj[key]));
822
+ return _objectSpread2(_objectSpread2({}, merged), {}, _defineProperty({}, key, isNil__default["default"](newObj[key]) ? [] : newObj[key]));
813
823
  }
814
824
 
815
- if (!isNil__default['default'](newObj[key]) && _typeof(value) === 'object' && // Ignore Date as this will create invalid object since typeof date === 'object' return true
825
+ if (!isNil__default["default"](newObj[key]) && _typeof(value) === 'object' && // Ignore Date as this will create invalid object since typeof date === 'object' return true
816
826
  // ex: {date: new Date()} will result {date: {}}
817
827
  !(value instanceof Date)) {
818
828
  var _copyEmptyArrayProps3 = copyEmptyArrayProps(value, newObj[key]),
@@ -834,21 +844,21 @@ function createCategoryMapActions(mapActionGroup, syncActionConfig) {
834
844
  return function doMapActions(diff, newObj, oldObj) {
835
845
  var allActions = [];
836
846
  allActions.push(mapActionGroup('base', function () {
837
- return actionsMapBase(diff, oldObj, newObj, syncActionConfig);
847
+ return actionsMapBase$i(diff, oldObj, newObj, syncActionConfig);
838
848
  }));
839
849
  allActions.push(mapActionGroup('references', function () {
840
- return actionsMapReferences(diff, oldObj, newObj);
850
+ return actionsMapReferences$3(diff, oldObj, newObj);
841
851
  }));
842
852
  allActions.push(mapActionGroup('meta', function () {
843
- return actionsMapMeta(diff, oldObj, newObj);
853
+ return actionsMapMeta$1(diff, oldObj, newObj);
844
854
  }));
845
855
  allActions.push(mapActionGroup('custom', function () {
846
856
  return actionsMapCustom(diff, newObj, oldObj);
847
857
  }));
848
858
  allActions.push(mapActionGroup('assets', function () {
849
- return actionsMapAssets(diff, oldObj, newObj);
859
+ return actionsMapAssets$1(diff, oldObj, newObj);
850
860
  }));
851
- return flatten__default['default'](allActions);
861
+ return flatten__default["default"](allActions);
852
862
  };
853
863
  }
854
864
 
@@ -870,7 +880,7 @@ var categories = (function (actionGroupList, syncActionConfig) {
870
880
  };
871
881
  });
872
882
 
873
- var baseActionsList$1 = [{
883
+ var baseActionsList$h = [{
874
884
  action: 'setSalutation',
875
885
  key: 'salutation'
876
886
  }, {
@@ -922,7 +932,7 @@ var setDefaultBaseActionsList = [{
922
932
  key: 'defaultShippingAddressId',
923
933
  actionKey: 'addressId'
924
934
  }];
925
- var referenceActionsList$1 = [{
935
+ var referenceActionsList$2 = [{
926
936
  action: 'setCustomerGroup',
927
937
  key: 'customerGroup'
928
938
  }];
@@ -930,10 +940,10 @@ var referenceActionsList$1 = [{
930
940
  * SYNC FUNCTIONS
931
941
  */
932
942
 
933
- function actionsMapBase$1(diff, oldObj, newObj) {
943
+ function actionsMapBase$h(diff, oldObj, newObj) {
934
944
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
935
945
  return buildBaseAttributesActions({
936
- actions: baseActionsList$1,
946
+ actions: baseActionsList$h,
937
947
  diff: diff,
938
948
  oldObj: oldObj,
939
949
  newObj: newObj,
@@ -950,9 +960,9 @@ function actionsMapSetDefaultBase(diff, oldObj, newObj) {
950
960
  shouldOmitEmptyString: config.shouldOmitEmptyString
951
961
  });
952
962
  }
953
- function actionsMapReferences$1(diff, oldObj, newObj) {
963
+ function actionsMapReferences$2(diff, oldObj, newObj) {
954
964
  return buildReferenceActions({
955
- actions: referenceActionsList$1,
965
+ actions: referenceActionsList$2,
956
966
  diff: diff,
957
967
  oldObj: oldObj,
958
968
  newObj: newObj
@@ -1017,10 +1027,10 @@ function createCustomerMapActions(mapActionGroup, syncActionConfig) {
1017
1027
  return function doMapActions(diff, newObj, oldObj) {
1018
1028
  var allActions = [];
1019
1029
  allActions.push(mapActionGroup('base', function () {
1020
- return actionsMapBase$1(diff, oldObj, newObj, syncActionConfig);
1030
+ return actionsMapBase$h(diff, oldObj, newObj, syncActionConfig);
1021
1031
  }));
1022
1032
  allActions.push(mapActionGroup('references', function () {
1023
- return actionsMapReferences$1(diff, oldObj, newObj);
1033
+ return actionsMapReferences$2(diff, oldObj, newObj);
1024
1034
  }));
1025
1035
  allActions.push(mapActionGroup('addresses', function () {
1026
1036
  return actionsMapAddresses(diff, oldObj, newObj);
@@ -1037,7 +1047,7 @@ function createCustomerMapActions(mapActionGroup, syncActionConfig) {
1037
1047
  allActions.push(mapActionGroup('custom', function () {
1038
1048
  return actionsMapCustom(diff, newObj, oldObj);
1039
1049
  }));
1040
- return flatten__default['default'](allActions);
1050
+ return flatten__default["default"](allActions);
1041
1051
  };
1042
1052
  }
1043
1053
 
@@ -1059,7 +1069,7 @@ var customers = (function (actionGroupList, syncActionConfig) {
1059
1069
  };
1060
1070
  });
1061
1071
 
1062
- var baseActionsList$2 = [{
1072
+ var baseActionsList$g = [{
1063
1073
  action: 'changeQuantity',
1064
1074
  key: 'quantityOnStock',
1065
1075
  actionKey: 'quantity'
@@ -1070,7 +1080,7 @@ var baseActionsList$2 = [{
1070
1080
  action: 'setExpectedDelivery',
1071
1081
  key: 'expectedDelivery'
1072
1082
  }];
1073
- var referenceActionsList$2 = [{
1083
+ var referenceActionsList$1 = [{
1074
1084
  action: 'setSupplyChannel',
1075
1085
  key: 'supplyChannel'
1076
1086
  }];
@@ -1078,19 +1088,19 @@ var referenceActionsList$2 = [{
1078
1088
  * SYNC FUNCTIONS
1079
1089
  */
1080
1090
 
1081
- function actionsMapBase$2(diff, oldObj, newObj) {
1091
+ function actionsMapBase$g(diff, oldObj, newObj) {
1082
1092
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1083
1093
  return buildBaseAttributesActions({
1084
- actions: baseActionsList$2,
1094
+ actions: baseActionsList$g,
1085
1095
  diff: diff,
1086
1096
  oldObj: oldObj,
1087
1097
  newObj: newObj,
1088
1098
  shouldOmitEmptyString: config.shouldOmitEmptyString
1089
1099
  });
1090
1100
  }
1091
- function actionsMapReferences$2(diff, oldObj, newObj) {
1101
+ function actionsMapReferences$1(diff, oldObj, newObj) {
1092
1102
  return buildReferenceActions({
1093
- actions: referenceActionsList$2,
1103
+ actions: referenceActionsList$1,
1094
1104
  diff: diff,
1095
1105
  oldObj: oldObj,
1096
1106
  newObj: newObj
@@ -1101,15 +1111,15 @@ function createInventoryMapActions(mapActionGroup, syncActionConfig) {
1101
1111
  return function doMapActions(diff, newObj, oldObj) {
1102
1112
  var allActions = [];
1103
1113
  allActions.push(mapActionGroup('base', function () {
1104
- return actionsMapBase$2(diff, oldObj, newObj, syncActionConfig);
1114
+ return actionsMapBase$g(diff, oldObj, newObj, syncActionConfig);
1105
1115
  }));
1106
1116
  allActions.push(mapActionGroup('references', function () {
1107
- return actionsMapReferences$2(diff, oldObj, newObj);
1117
+ return actionsMapReferences$1(diff, oldObj, newObj);
1108
1118
  }));
1109
1119
  allActions.push(mapActionGroup('custom', function () {
1110
1120
  return actionsMapCustom(diff, newObj, oldObj);
1111
1121
  }));
1112
- return flatten__default['default'](allActions);
1122
+ return flatten__default["default"](allActions);
1113
1123
  };
1114
1124
  }
1115
1125
 
@@ -1150,8 +1160,8 @@ function extractMatchingPairs(hashMap, key, before, now) {
1150
1160
  };
1151
1161
  }
1152
1162
 
1153
- var REGEX_NUMBER$1 = new RegExp(/^\d+$/);
1154
- var REGEX_UNDERSCORE_NUMBER$1 = new RegExp(/^_\d+$/);
1163
+ var REGEX_NUMBER$3 = new RegExp(/^\d+$/);
1164
+ var REGEX_UNDERSCORE_NUMBER$3 = new RegExp(/^_\d+$/);
1155
1165
 
1156
1166
  function preProcessCollection() {
1157
1167
  var collection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
@@ -1181,11 +1191,11 @@ function findMatchingPairs(diff) {
1181
1191
  nowObjRefByIdentifier = _preProcessCollection2.refByIdentifier,
1182
1192
  nowObjRefByIndex = _preProcessCollection2.refByIndex;
1183
1193
 
1184
- forEach__default['default'](diff, function (item, key) {
1185
- if (REGEX_NUMBER$1.test(key)) {
1194
+ forEach__default["default"](diff, function (item, key) {
1195
+ if (REGEX_NUMBER$3.test(key)) {
1186
1196
  var matchingIdentifier = nowObjRefByIndex[key];
1187
1197
  result[key] = [beforeObjRefByIdentifier[matchingIdentifier], key];
1188
- } else if (REGEX_UNDERSCORE_NUMBER$1.test(key)) {
1198
+ } else if (REGEX_UNDERSCORE_NUMBER$3.test(key)) {
1189
1199
  var index = key.substring(1);
1190
1200
  var _matchingIdentifier = beforeObjRefByIndex[index];
1191
1201
  result[key] = [index, nowObjRefByIdentifier[_matchingIdentifier]];
@@ -1196,7 +1206,7 @@ function findMatchingPairs(diff) {
1196
1206
 
1197
1207
  var REGEX_NUMBER$2 = new RegExp(/^\d+$/);
1198
1208
  var REGEX_UNDERSCORE_NUMBER$2 = new RegExp(/^_\d+$/);
1199
- var baseActionsList$3 = [{
1209
+ var baseActionsList$f = [{
1200
1210
  action: 'changeName',
1201
1211
  key: 'name'
1202
1212
  }, {
@@ -1229,7 +1239,7 @@ var baseAssetActionsList = [{
1229
1239
  action: 'setAssetSources',
1230
1240
  key: 'sources'
1231
1241
  }];
1232
- var metaActionsList$1 = [{
1242
+ var metaActionsList = [{
1233
1243
  action: 'setMetaTitle',
1234
1244
  key: 'metaTitle'
1235
1245
  }, {
@@ -1239,7 +1249,7 @@ var metaActionsList$1 = [{
1239
1249
  action: 'setMetaKeywords',
1240
1250
  key: 'metaKeywords'
1241
1251
  }];
1242
- var referenceActionsList$3 = [{
1252
+ var referenceActionsList = [{
1243
1253
  action: 'setTaxCategory',
1244
1254
  key: 'taxCategory'
1245
1255
  }, {
@@ -1362,7 +1372,7 @@ function _buildVariantImagesAction(diffedImages) {
1362
1372
  var actions = []; // generate a hashMap to be able to reference the right image from both ends
1363
1373
 
1364
1374
  var matchingImagePairs = findMatchingPairs(diffedImages, oldVariant.images, newVariant.images, 'url');
1365
- forEach__default['default'](diffedImages, function (image, key) {
1375
+ forEach__default["default"](diffedImages, function (image, key) {
1366
1376
  var _extractMatchingPairs = extractMatchingPairs(matchingImagePairs, key, oldVariant.images, newVariant.images),
1367
1377
  oldObj = _extractMatchingPairs.oldObj,
1368
1378
  newObj = _extractMatchingPairs.newObj;
@@ -1418,7 +1428,7 @@ function _buildVariantPricesAction(diffedPrices) {
1418
1428
  var removePriceActions = []; // generate a hashMap to be able to reference the right image from both ends
1419
1429
 
1420
1430
  var matchingPricePairs = findMatchingPairs(diffedPrices, oldVariant.prices, newVariant.prices);
1421
- forEach__default['default'](diffedPrices, function (price, key) {
1431
+ forEach__default["default"](diffedPrices, function (price, key) {
1422
1432
  var _extractMatchingPairs2 = extractMatchingPairs(matchingPricePairs, key, oldVariant.prices, newVariant.prices),
1423
1433
  oldObj = _extractMatchingPairs2.oldObj,
1424
1434
  newObj = _extractMatchingPairs2.newObj;
@@ -1475,7 +1485,7 @@ function _buildVariantPricesAction(diffedPrices) {
1475
1485
  function _buildVariantAttributesActions(attributes, oldVariant, newVariant, sameForAllAttributeNames) {
1476
1486
  var actions = [];
1477
1487
  if (!attributes) return actions;
1478
- forEach__default['default'](attributes, function (value, key) {
1488
+ forEach__default["default"](attributes, function (value, key) {
1479
1489
  if (REGEX_NUMBER$2.test(key)) {
1480
1490
  if (Array.isArray(value)) {
1481
1491
  var id = oldVariant.id;
@@ -1517,7 +1527,7 @@ function _buildVariantAttributesActions(attributes, oldVariant, newVariant, same
1517
1527
  return actions;
1518
1528
  }
1519
1529
 
1520
- function toAssetIdentifier$1(asset) {
1530
+ function toAssetIdentifier(asset) {
1521
1531
  var assetIdentifier = asset.id ? {
1522
1532
  assetId: asset.id
1523
1533
  } : {
@@ -1540,7 +1550,7 @@ function _buildVariantAssetsActions(diffAssets, oldVariant, newVariant) {
1540
1550
  var assetActions = []; // generate a hashMap to be able to reference the right asset from both ends
1541
1551
 
1542
1552
  var matchingAssetPairs = findMatchingPairs(diffAssets, oldVariant.assets, newVariant.assets);
1543
- forEach__default['default'](diffAssets, function (asset, key) {
1553
+ forEach__default["default"](diffAssets, function (asset, key) {
1544
1554
  var _extractMatchingPairs3 = extractMatchingPairs(matchingAssetPairs, key, oldVariant.assets, newVariant.assets),
1545
1555
  oldAsset = _extractMatchingPairs3.oldObj,
1546
1556
  newAsset = _extractMatchingPairs3.newObj;
@@ -1570,7 +1580,7 @@ function _buildVariantAssetsActions(diffAssets, oldVariant, newVariant) {
1570
1580
  });
1571
1581
  }
1572
1582
 
1573
- return _objectSpread2(_objectSpread2(_objectSpread2({}, action), toVariantIdentifier(oldVariant)), toAssetIdentifier$1(oldAsset));
1583
+ return _objectSpread2(_objectSpread2(_objectSpread2({}, action), toVariantIdentifier(oldVariant)), toAssetIdentifier(oldAsset));
1574
1584
  });
1575
1585
  assetActions.push.apply(assetActions, _toConsumableArray(basicActions));
1576
1586
 
@@ -1580,7 +1590,7 @@ function _buildVariantAssetsActions(diffAssets, oldVariant, newVariant) {
1580
1590
  setCustomType: 'setAssetCustomType',
1581
1591
  setCustomField: 'setAssetCustomField'
1582
1592
  }
1583
- }, toVariantIdentifier(oldVariant)), toAssetIdentifier$1(oldAsset)));
1593
+ }, toVariantIdentifier(oldVariant)), toAssetIdentifier(oldAsset)));
1584
1594
  assetActions.push.apply(assetActions, _toConsumableArray(customActions));
1585
1595
  }
1586
1596
 
@@ -1590,7 +1600,7 @@ function _buildVariantAssetsActions(diffAssets, oldVariant, newVariant) {
1590
1600
  if (getIsRemoveAction(key, asset)) {
1591
1601
  assetActions.push(_objectSpread2(_objectSpread2({
1592
1602
  action: 'removeAsset'
1593
- }, toAssetIdentifier$1(oldAsset)), toVariantIdentifier(oldVariant)));
1603
+ }, toAssetIdentifier(oldAsset)), toVariantIdentifier(oldVariant)));
1594
1604
  }
1595
1605
  });
1596
1606
  return assetActions;
@@ -1600,19 +1610,19 @@ function _buildVariantAssetsActions(diffAssets, oldVariant, newVariant) {
1600
1610
  */
1601
1611
 
1602
1612
 
1603
- function actionsMapBase$3(diff, oldObj, newObj) {
1613
+ function actionsMapBase$f(diff, oldObj, newObj) {
1604
1614
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1605
1615
  return buildBaseAttributesActions({
1606
- actions: baseActionsList$3,
1616
+ actions: baseActionsList$f,
1607
1617
  diff: diff,
1608
1618
  oldObj: oldObj,
1609
1619
  newObj: newObj,
1610
1620
  shouldOmitEmptyString: config.shouldOmitEmptyString
1611
1621
  });
1612
1622
  }
1613
- function actionsMapMeta$1(diff, oldObj, newObj) {
1623
+ function actionsMapMeta(diff, oldObj, newObj) {
1614
1624
  return buildBaseAttributesActions({
1615
- actions: metaActionsList$1,
1625
+ actions: metaActionsList,
1616
1626
  diff: diff,
1617
1627
  oldObj: oldObj,
1618
1628
  newObj: newObj
@@ -1636,9 +1646,9 @@ function actionsMapRemoveVariants(diff, oldObj, newObj) {
1636
1646
  }));
1637
1647
  return handler(diff, oldObj, newObj);
1638
1648
  }
1639
- function actionsMapReferences$3(diff, oldObj, newObj) {
1649
+ function actionsMapReferences(diff, oldObj, newObj) {
1640
1650
  return buildReferenceActions({
1641
- actions: referenceActionsList$3,
1651
+ actions: referenceActionsList,
1642
1652
  diff: diff,
1643
1653
  oldObj: oldObj,
1644
1654
  newObj: newObj
@@ -1649,7 +1659,7 @@ function actionsMapCategories(diff) {
1649
1659
  if (!diff.categories) return actions;
1650
1660
  var addToCategoryActions = [];
1651
1661
  var removeFromCategoryActions = [];
1652
- forEach__default['default'](diff.categories, function (category) {
1662
+ forEach__default["default"](diff.categories, function (category) {
1653
1663
  if (Array.isArray(category)) {
1654
1664
  var action = {
1655
1665
  category: category[0]
@@ -1687,10 +1697,10 @@ function actionsMapCategoryOrderHints(diff) {
1687
1697
  return action;
1688
1698
  });
1689
1699
  }
1690
- function actionsMapAssets$1(diff, oldObj, newObj, variantHashMap) {
1700
+ function actionsMapAssets(diff, oldObj, newObj, variantHashMap) {
1691
1701
  var allAssetsActions = [];
1692
1702
  var variants = diff.variants;
1693
- if (variants) forEach__default['default'](variants, function (variant, key) {
1703
+ if (variants) forEach__default["default"](variants, function (variant, key) {
1694
1704
  var _extractMatchingPairs4 = extractMatchingPairs(variantHashMap, key, oldObj.variants, newObj.variants),
1695
1705
  oldVariant = _extractMatchingPairs4.oldObj,
1696
1706
  newVariant = _extractMatchingPairs4.newObj;
@@ -1708,7 +1718,7 @@ function actionsMapAttributes(diff, oldObj, newObj) {
1708
1718
  var variantHashMap = arguments.length > 4 ? arguments[4] : undefined;
1709
1719
  var actions = [];
1710
1720
  var variants = diff.variants;
1711
- if (variants) forEach__default['default'](variants, function (variant, key) {
1721
+ if (variants) forEach__default["default"](variants, function (variant, key) {
1712
1722
  var _extractMatchingPairs5 = extractMatchingPairs(variantHashMap, key, oldObj.variants, newObj.variants),
1713
1723
  oldVariant = _extractMatchingPairs5.oldObj,
1714
1724
  newVariant = _extractMatchingPairs5.newObj;
@@ -1729,14 +1739,14 @@ function actionsMapAttributes(diff, oldObj, newObj) {
1729
1739
  }); // Ensure that an action is unique.
1730
1740
  // This is especially necessary for SFA attributes.
1731
1741
 
1732
- return uniqWith__default['default'](actions, function (a, b) {
1742
+ return uniqWith__default["default"](actions, function (a, b) {
1733
1743
  return a.action === b.action && a.name === b.name && a.variantId === b.variantId;
1734
1744
  });
1735
1745
  }
1736
1746
  function actionsMapImages(diff, oldObj, newObj, variantHashMap) {
1737
1747
  var actions = [];
1738
1748
  var variants = diff.variants;
1739
- if (variants) forEach__default['default'](variants, function (variant, key) {
1749
+ if (variants) forEach__default["default"](variants, function (variant, key) {
1740
1750
  var _extractMatchingPairs6 = extractMatchingPairs(variantHashMap, key, oldObj.variants, newObj.variants),
1741
1751
  oldVariant = _extractMatchingPairs6.oldObj,
1742
1752
  newVariant = _extractMatchingPairs6.newObj;
@@ -1754,7 +1764,7 @@ function actionsMapPrices(diff, oldObj, newObj, variantHashMap, enableDiscounted
1754
1764
  var changePriceActions = [];
1755
1765
  var removePriceActions = [];
1756
1766
  var variants = diff.variants;
1757
- if (variants) forEach__default['default'](variants, function (variant, key) {
1767
+ if (variants) forEach__default["default"](variants, function (variant, key) {
1758
1768
  var _extractMatchingPairs7 = extractMatchingPairs(variantHashMap, key, oldObj.variants, newObj.variants),
1759
1769
  oldVariant = _extractMatchingPairs7.oldObj,
1760
1770
  newVariant = _extractMatchingPairs7.newObj;
@@ -1777,14 +1787,14 @@ function actionsMapPrices(diff, oldObj, newObj, variantHashMap, enableDiscounted
1777
1787
  function actionsMapPricesCustom(diff, oldObj, newObj, variantHashMap) {
1778
1788
  var actions = [];
1779
1789
  var variants = diff.variants;
1780
- if (variants) forEach__default['default'](variants, function (variant, key) {
1790
+ if (variants) forEach__default["default"](variants, function (variant, key) {
1781
1791
  var _extractMatchingPairs8 = extractMatchingPairs(variantHashMap, key, oldObj.variants, newObj.variants),
1782
1792
  oldVariant = _extractMatchingPairs8.oldObj,
1783
1793
  newVariant = _extractMatchingPairs8.newObj;
1784
1794
 
1785
1795
  if (variant && variant.prices && (REGEX_UNDERSCORE_NUMBER$2.test(key) || REGEX_NUMBER$2.test(key))) {
1786
1796
  var priceHashMap = findMatchingPairs(variant.prices, oldVariant.prices, newVariant.prices);
1787
- forEach__default['default'](variant.prices, function (price, index) {
1797
+ forEach__default["default"](variant.prices, function (price, index) {
1788
1798
  var _extractMatchingPairs9 = extractMatchingPairs(priceHashMap, index, oldVariant.prices, newVariant.prices),
1789
1799
  oldPrice = _extractMatchingPairs9.oldObj,
1790
1800
  newPrice = _extractMatchingPairs9.newObj;
@@ -1830,7 +1840,8 @@ function createProductMapActions(mapActionGroup, syncActionConfig) {
1830
1840
  var allActions = [];
1831
1841
  var sameForAllAttributeNames = options.sameForAllAttributeNames,
1832
1842
  enableDiscounted = options.enableDiscounted;
1833
- var publish = newObj.publish;
1843
+ var publish = newObj.publish,
1844
+ staged = newObj.staged;
1834
1845
  var variantHashMap = findMatchingPairs(diff.variants, oldObj.variants, newObj.variants);
1835
1846
  allActions.push(mapActionGroup('attributes', function () {
1836
1847
  return actionsMapAttributes(diff, oldObj, newObj, sameForAllAttributeNames || [], variantHashMap);
@@ -1843,13 +1854,13 @@ function createProductMapActions(mapActionGroup, syncActionConfig) {
1843
1854
  return actionsMapRemoveVariants(diff, oldObj, newObj);
1844
1855
  }));
1845
1856
  allActions.push(mapActionGroup('base', function () {
1846
- return actionsMapBase$3(diff, oldObj, newObj, syncActionConfig);
1857
+ return actionsMapBase$f(diff, oldObj, newObj, syncActionConfig);
1847
1858
  }));
1848
1859
  allActions.push(mapActionGroup('meta', function () {
1849
- return actionsMapMeta$1(diff, oldObj, newObj);
1860
+ return actionsMapMeta(diff, oldObj, newObj);
1850
1861
  }));
1851
1862
  allActions.push(mapActionGroup('references', function () {
1852
- return actionsMapReferences$3(diff, oldObj, newObj);
1863
+ return actionsMapReferences(diff, oldObj, newObj);
1853
1864
  }));
1854
1865
  allActions.push(mapActionGroup('images', function () {
1855
1866
  return actionsMapImages(diff, oldObj, newObj, variantHashMap);
@@ -1867,14 +1878,14 @@ function createProductMapActions(mapActionGroup, syncActionConfig) {
1867
1878
  return actionsMapCategoryOrderHints(diff);
1868
1879
  }));
1869
1880
  allActions.push(mapActionGroup('assets', function () {
1870
- return actionsMapAssets$1(diff, oldObj, newObj, variantHashMap);
1881
+ return actionsMapAssets(diff, oldObj, newObj, variantHashMap);
1871
1882
  }));
1872
- if (publish === true) return flatten__default['default'](allActions).map(function (action) {
1883
+ if (publish === true || staged === false) return flatten__default["default"](allActions).map(function (action) {
1873
1884
  return _objectSpread2(_objectSpread2({}, action), {}, {
1874
1885
  staged: false
1875
1886
  });
1876
1887
  });
1877
- return flatten__default['default'](allActions);
1888
+ return flatten__default["default"](allActions);
1878
1889
  };
1879
1890
  }
1880
1891
 
@@ -1907,18 +1918,18 @@ var products = (function (actionGroupList, syncActionConfig) {
1907
1918
  };
1908
1919
  });
1909
1920
 
1910
- var REGEX_NUMBER$3 = new RegExp(/^\d+$/);
1911
- var REGEX_UNDERSCORE_NUMBER$3 = new RegExp(/^_\d+$/);
1921
+ var REGEX_NUMBER$1 = new RegExp(/^\d+$/);
1922
+ var REGEX_UNDERSCORE_NUMBER$1 = new RegExp(/^_\d+$/);
1912
1923
 
1913
1924
  var isAddAction = function isAddAction(key, resource) {
1914
- return REGEX_NUMBER$3.test(key) && Array.isArray(resource) && resource.length;
1925
+ return REGEX_NUMBER$1.test(key) && Array.isArray(resource) && resource.length;
1915
1926
  };
1916
1927
 
1917
- var isRemoveAction$1 = function isRemoveAction(key, resource) {
1918
- return REGEX_UNDERSCORE_NUMBER$3.test(key) && Number(resource[2]) === 0;
1928
+ var isRemoveAction = function isRemoveAction(key, resource) {
1929
+ return REGEX_UNDERSCORE_NUMBER$1.test(key) && Number(resource[2]) === 0;
1919
1930
  };
1920
1931
 
1921
- var baseActionsList$4 = [{
1932
+ var baseActionsList$e = [{
1922
1933
  action: 'changeOrderState',
1923
1934
  key: 'orderState'
1924
1935
  }, {
@@ -1932,10 +1943,10 @@ var baseActionsList$4 = [{
1932
1943
  * SYNC FUNCTIONS
1933
1944
  */
1934
1945
 
1935
- function actionsMapBase$4(diff, oldObj, newObj) {
1946
+ function actionsMapBase$e(diff, oldObj, newObj) {
1936
1947
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1937
1948
  return buildBaseAttributesActions({
1938
- actions: baseActionsList$4,
1949
+ actions: baseActionsList$e,
1939
1950
  diff: diff,
1940
1951
  oldObj: oldObj,
1941
1952
  newObj: newObj,
@@ -1962,7 +1973,7 @@ function _buildDeliveryParcelsAction(diffedParcels) {
1962
1973
  var removeParcelActions = []; // generate a hashMap to be able to reference the right image from both ends
1963
1974
 
1964
1975
  var matchingParcelPairs = findMatchingPairs(diffedParcels, oldDelivery.parcels, newDelivery.parcels);
1965
- forEach__default['default'](diffedParcels, function (parcel, key) {
1976
+ forEach__default["default"](diffedParcels, function (parcel, key) {
1966
1977
  var _extractMatchingPairs = extractMatchingPairs(matchingParcelPairs, key, oldDelivery.parcels, newDelivery.parcels),
1967
1978
  oldObj = _extractMatchingPairs.oldObj;
1968
1979
 
@@ -1974,7 +1985,7 @@ function _buildDeliveryParcelsAction(diffedParcels) {
1974
1985
  return;
1975
1986
  }
1976
1987
 
1977
- if (isRemoveAction$1(key, parcel)) {
1988
+ if (isRemoveAction(key, parcel)) {
1978
1989
  removeParcelActions.push({
1979
1990
  action: 'removeParcelFromDelivery',
1980
1991
  parcelId: oldObj.id
@@ -1991,12 +2002,12 @@ function actionsMapParcels(diff, oldObj, newObj, deliveryHashMap) {
1991
2002
  if (!deliveries) return [];
1992
2003
  var addParcelActions = [];
1993
2004
  var removeParcelActions = [];
1994
- if (deliveries) forEach__default['default'](deliveries, function (delivery, key) {
2005
+ if (deliveries) forEach__default["default"](deliveries, function (delivery, key) {
1995
2006
  var _extractMatchingPairs2 = extractMatchingPairs(deliveryHashMap, key, oldObj.shippingInfo.deliveries, newObj.shippingInfo.deliveries),
1996
2007
  oldDelivery = _extractMatchingPairs2.oldObj,
1997
2008
  newDelivery = _extractMatchingPairs2.newObj;
1998
2009
 
1999
- if (REGEX_UNDERSCORE_NUMBER$3.test(key) || REGEX_NUMBER$3.test(key)) {
2010
+ if (REGEX_UNDERSCORE_NUMBER$1.test(key) || REGEX_NUMBER$1.test(key)) {
2000
2011
  var _buildDeliveryParcels = _buildDeliveryParcelsAction(delivery.parcels, oldDelivery, newDelivery),
2001
2012
  _buildDeliveryParcels2 = _slicedToArray(_buildDeliveryParcels, 2),
2002
2013
  addParcelAction = _buildDeliveryParcels2[0],
@@ -2068,7 +2079,7 @@ function createOrderMapActions(mapActionGroup, syncActionConfig) {
2068
2079
  }
2069
2080
 
2070
2081
  allActions.push(mapActionGroup('base', function () {
2071
- return actionsMapBase$4(diff, oldObj, newObj, syncActionConfig);
2082
+ return actionsMapBase$e(diff, oldObj, newObj, syncActionConfig);
2072
2083
  }));
2073
2084
  allActions.push(mapActionGroup('deliveries', function () {
2074
2085
  return actionsMapDeliveries(diff, oldObj, newObj);
@@ -2076,13 +2087,13 @@ function createOrderMapActions(mapActionGroup, syncActionConfig) {
2076
2087
  allActions.push(mapActionGroup('parcels', function () {
2077
2088
  return actionsMapParcels(diff, oldObj, newObj, deliveryHashMap);
2078
2089
  }));
2079
- allActions.push(flatten__default['default'](mapActionGroup('returnInfo', function () {
2090
+ allActions.push(flatten__default["default"](mapActionGroup('returnInfo', function () {
2080
2091
  return actionsMapReturnsInfo(diff, oldObj, newObj);
2081
2092
  })));
2082
2093
  allActions.push(mapActionGroup('custom', function () {
2083
2094
  return actionsMapCustom(diff, newObj, oldObj);
2084
2095
  }));
2085
- return flatten__default['default'](allActions);
2096
+ return flatten__default["default"](allActions);
2086
2097
  };
2087
2098
  }
2088
2099
 
@@ -2104,7 +2115,7 @@ var orders = (function (actionGroupList, syncActionConfig) {
2104
2115
  };
2105
2116
  });
2106
2117
 
2107
- var baseActionsList$5 = [{
2118
+ var baseActionsList$d = [{
2108
2119
  action: 'changeIsActive',
2109
2120
  key: 'isActive'
2110
2121
  }, {
@@ -2132,10 +2143,10 @@ var baseActionsList$5 = [{
2132
2143
  action: 'setKey',
2133
2144
  key: 'key'
2134
2145
  }];
2135
- function actionsMapBase$5(diff, oldObj, newObj) {
2146
+ function actionsMapBase$d(diff, oldObj, newObj) {
2136
2147
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2137
2148
  return buildBaseAttributesActions({
2138
- actions: baseActionsList$5,
2149
+ actions: baseActionsList$d,
2139
2150
  diff: diff,
2140
2151
  oldObj: oldObj,
2141
2152
  newObj: newObj,
@@ -2176,9 +2187,9 @@ function createProductDiscountsMapActions(mapActionGroup, syncActionConfig) {
2176
2187
  return function doMapActions(diff, newObj, oldObj) {
2177
2188
  var allActions = [];
2178
2189
  allActions.push(mapActionGroup('base', function () {
2179
- return actionsMapBase$5(diff, oldObj, newObj, syncActionConfig);
2190
+ return actionsMapBase$d(diff, oldObj, newObj, syncActionConfig);
2180
2191
  }));
2181
- return combineValidityActions(flatten__default['default'](allActions));
2192
+ return combineValidityActions(flatten__default["default"](allActions));
2182
2193
  };
2183
2194
  }
2184
2195
 
@@ -2192,7 +2203,7 @@ var productDiscounts = (function (actionGroupList) {
2192
2203
  };
2193
2204
  });
2194
2205
 
2195
- var baseActionsList$6 = [{
2206
+ var baseActionsList$c = [{
2196
2207
  action: 'changeIsActive',
2197
2208
  key: 'isActive'
2198
2209
  }, {
@@ -2223,10 +2234,10 @@ var baseActionsList$6 = [{
2223
2234
  action: 'changeGroups',
2224
2235
  key: 'groups'
2225
2236
  }];
2226
- function actionsMapBase$6(diff, oldObj, newObj) {
2237
+ function actionsMapBase$c(diff, oldObj, newObj) {
2227
2238
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2228
2239
  return buildBaseAttributesActions({
2229
- actions: baseActionsList$6,
2240
+ actions: baseActionsList$c,
2230
2241
  diff: diff,
2231
2242
  oldObj: oldObj,
2232
2243
  newObj: newObj,
@@ -2238,12 +2249,12 @@ function createDiscountCodesMapActions(mapActionGroup, syncActionConfig) {
2238
2249
  return function doMapActions(diff, newObj, oldObj) {
2239
2250
  var allActions = [];
2240
2251
  allActions.push(mapActionGroup('base', function () {
2241
- return actionsMapBase$6(diff, oldObj, newObj, syncActionConfig);
2252
+ return actionsMapBase$c(diff, oldObj, newObj, syncActionConfig);
2242
2253
  }));
2243
2254
  allActions.push(mapActionGroup('custom', function () {
2244
2255
  return actionsMapCustom(diff, newObj, oldObj);
2245
2256
  }));
2246
- return combineValidityActions(flatten__default['default'](allActions));
2257
+ return combineValidityActions(flatten__default["default"](allActions));
2247
2258
  };
2248
2259
  }
2249
2260
 
@@ -2266,17 +2277,17 @@ var discountCodes = (function (actionGroupList) {
2266
2277
  };
2267
2278
  });
2268
2279
 
2269
- var baseActionsList$7 = [{
2280
+ var baseActionsList$b = [{
2270
2281
  action: 'changeName',
2271
2282
  key: 'name'
2272
2283
  }, {
2273
2284
  action: 'setKey',
2274
2285
  key: 'key'
2275
2286
  }];
2276
- function actionsMapBase$7(diff, oldObj, newObj) {
2287
+ function actionsMapBase$b(diff, oldObj, newObj) {
2277
2288
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2278
2289
  return buildBaseAttributesActions({
2279
- actions: baseActionsList$7,
2290
+ actions: baseActionsList$b,
2280
2291
  diff: diff,
2281
2292
  oldObj: oldObj,
2282
2293
  newObj: newObj,
@@ -2288,12 +2299,12 @@ function createCustomerGroupMapActions(mapActionGroup, syncActionConfig) {
2288
2299
  return function doMapActions(diff, newObj, oldObj) {
2289
2300
  var allActions = [];
2290
2301
  allActions.push(mapActionGroup('base', function () {
2291
- return actionsMapBase$7(diff, oldObj, newObj, syncActionConfig);
2302
+ return actionsMapBase$b(diff, oldObj, newObj, syncActionConfig);
2292
2303
  }));
2293
2304
  allActions.push(mapActionGroup('custom', function () {
2294
2305
  return actionsMapCustom(diff, newObj, oldObj);
2295
2306
  }));
2296
- return flatten__default['default'](allActions);
2307
+ return flatten__default["default"](allActions);
2297
2308
  };
2298
2309
  }
2299
2310
 
@@ -2307,7 +2318,7 @@ var customerGroup = (function (actionGroupList) {
2307
2318
  };
2308
2319
  });
2309
2320
 
2310
- var baseActionsList$8 = [{
2321
+ var baseActionsList$a = [{
2311
2322
  action: 'changeIsActive',
2312
2323
  key: 'isActive'
2313
2324
  }, {
@@ -2344,10 +2355,10 @@ var baseActionsList$8 = [{
2344
2355
  action: 'setKey',
2345
2356
  key: 'key'
2346
2357
  }];
2347
- function actionsMapBase$8(diff, oldObj, newObj) {
2358
+ function actionsMapBase$a(diff, oldObj, newObj) {
2348
2359
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2349
2360
  return buildBaseAttributesActions({
2350
- actions: baseActionsList$8,
2361
+ actions: baseActionsList$a,
2351
2362
  diff: diff,
2352
2363
  oldObj: oldObj,
2353
2364
  newObj: newObj,
@@ -2359,12 +2370,12 @@ function createCartDiscountsMapActions(mapActionGroup, syncActionConfig) {
2359
2370
  return function doMapActions(diff, newObj, oldObj) {
2360
2371
  var allActions = [];
2361
2372
  allActions.push(mapActionGroup('base', function () {
2362
- return actionsMapBase$8(diff, oldObj, newObj, syncActionConfig);
2373
+ return actionsMapBase$a(diff, oldObj, newObj, syncActionConfig);
2363
2374
  }));
2364
2375
  allActions.push(mapActionGroup('custom', function () {
2365
2376
  return actionsMapCustom(diff, newObj, oldObj);
2366
2377
  }));
2367
- return combineValidityActions(flatten__default['default'](allActions));
2378
+ return combineValidityActions(flatten__default["default"](allActions));
2368
2379
  };
2369
2380
  }
2370
2381
 
@@ -2430,7 +2441,7 @@ function createTaxCategoriesMapActions(mapActionGroup, syncActionConfig) {
2430
2441
  allActions.push(mapActionGroup('rates', function () {
2431
2442
  return actionsMapRates(diff, oldObj, newObj);
2432
2443
  }));
2433
- return flatten__default['default'](allActions);
2444
+ return flatten__default["default"](allActions);
2434
2445
  };
2435
2446
  }
2436
2447
 
@@ -2452,7 +2463,7 @@ var taxCategories = (function (actionGroupList, syncActionConfig) {
2452
2463
  };
2453
2464
  });
2454
2465
 
2455
- var baseActionsList$a = [{
2466
+ var baseActionsList$8 = [{
2456
2467
  action: 'changeName',
2457
2468
  key: 'name'
2458
2469
  }, {
@@ -2469,10 +2480,10 @@ var hasLocation = function hasLocation(locations, otherLocation) {
2469
2480
  });
2470
2481
  };
2471
2482
 
2472
- function actionsMapBase$a(diff, oldObj, newObj) {
2483
+ function actionsMapBase$8(diff, oldObj, newObj) {
2473
2484
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2474
2485
  return buildBaseAttributesActions({
2475
- actions: baseActionsList$a,
2486
+ actions: baseActionsList$8,
2476
2487
  diff: diff,
2477
2488
  oldObj: oldObj,
2478
2489
  newObj: newObj,
@@ -2517,12 +2528,12 @@ function createZonesMapActions(mapActionGroup, syncActionConfig) {
2517
2528
  return function doMapActions(diff, newObj, oldObj) {
2518
2529
  var allActions = [];
2519
2530
  allActions.push(mapActionGroup('base', function () {
2520
- return actionsMapBase$a(diff, oldObj, newObj, syncActionConfig);
2531
+ return actionsMapBase$8(diff, oldObj, newObj, syncActionConfig);
2521
2532
  }));
2522
- allActions.push(flatten__default['default'](mapActionGroup('locations', function () {
2533
+ allActions.push(flatten__default["default"](mapActionGroup('locations', function () {
2523
2534
  return actionsMapLocations(diff, oldObj, newObj);
2524
2535
  })));
2525
- return flatten__default['default'](allActions);
2536
+ return flatten__default["default"](allActions);
2526
2537
  };
2527
2538
  }
2528
2539
 
@@ -2544,7 +2555,7 @@ var zones = (function (actionGroupList, syncActionConfig) {
2544
2555
  };
2545
2556
  });
2546
2557
 
2547
- var baseActionsList$b = [{
2558
+ var baseActionsList$7 = [{
2548
2559
  action: 'setKey',
2549
2560
  key: 'key'
2550
2561
  }, {
@@ -2566,10 +2577,10 @@ var baseActionsList$b = [{
2566
2577
  action: 'changeTaxCategory',
2567
2578
  key: 'taxCategory'
2568
2579
  }];
2569
- function actionsMapBase$b(diff, oldObj, newObj) {
2580
+ function actionsMapBase$7(diff, oldObj, newObj) {
2570
2581
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2571
2582
  return buildBaseAttributesActions({
2572
- actions: baseActionsList$b,
2583
+ actions: baseActionsList$7,
2573
2584
  diff: diff,
2574
2585
  oldObj: oldObj,
2575
2586
  newObj: newObj,
@@ -2636,7 +2647,7 @@ function actionsMapZoneRates(diff, oldObj, newObj) {
2636
2647
  if (diff.zoneRates[key].shippingRates) return [].concat(_toConsumableArray(actions), _toConsumableArray(actionsMapZoneRatesShippingRates(diff.zoneRates[key], oldZoneRate, newZoneRate)));
2637
2648
  return actions;
2638
2649
  }, []);
2639
- return flatten__default['default'](hasZoneActions ? [].concat(_toConsumableArray(shippingRateActions), [{
2650
+ return flatten__default["default"](hasZoneActions ? [].concat(_toConsumableArray(shippingRateActions), [{
2640
2651
  action: 'removeZone',
2641
2652
  zone: oldZoneRate.zone
2642
2653
  }, {
@@ -2651,12 +2662,12 @@ function createShippingMethodsMapActions(mapActionGroup, syncActionConfig) {
2651
2662
  return function doMapActions(diff, newObj, oldObj) {
2652
2663
  var allActions = [];
2653
2664
  allActions.push(mapActionGroup('base', function () {
2654
- return actionsMapBase$b(diff, oldObj, newObj, syncActionConfig);
2665
+ return actionsMapBase$7(diff, oldObj, newObj, syncActionConfig);
2655
2666
  }));
2656
- allActions.push(flatten__default['default'](mapActionGroup('zoneRates', function () {
2667
+ allActions.push(flatten__default["default"](mapActionGroup('zoneRates', function () {
2657
2668
  return actionsMapZoneRates(diff, oldObj, newObj);
2658
2669
  })));
2659
- return flatten__default['default'](allActions);
2670
+ return flatten__default["default"](allActions);
2660
2671
  };
2661
2672
  }
2662
2673
 
@@ -3156,13 +3167,13 @@ function createComparator(createIsEqual) {
3156
3167
 
3157
3168
 
3158
3169
  var deepEqual = createComparator();
3159
- var shallowEqual = createComparator(function () {
3170
+ createComparator(function () {
3160
3171
  return sameValueZeroEqual;
3161
3172
  });
3162
- var circularDeepEqual = createComparator(createCircularEqualCreator());
3163
- var circularShallowEqual = createComparator(createCircularEqualCreator(sameValueZeroEqual));
3173
+ createComparator(createCircularEqualCreator());
3174
+ createComparator(createCircularEqualCreator(sameValueZeroEqual));
3164
3175
 
3165
- var baseActionsList$c = [{
3176
+ var baseActionsList$6 = [{
3166
3177
  action: 'changeName',
3167
3178
  key: 'name'
3168
3179
  }, {
@@ -3172,7 +3183,7 @@ var baseActionsList$c = [{
3172
3183
  action: 'changeDescription',
3173
3184
  key: 'description'
3174
3185
  }];
3175
- function actionsMapBase$c(diff, previous, next) {
3186
+ function actionsMapBase$6(diff, previous, next) {
3176
3187
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3177
3188
  // when `diff` is undefined, then the underlying `buildActions` has returned any diff
3178
3189
  // which given in product-types would mean that `buildActions` has run with `nestedValuesChanges` applied
@@ -3180,7 +3191,7 @@ function actionsMapBase$c(diff, previous, next) {
3180
3191
  if (!diff) return [];
3181
3192
  return buildBaseAttributesActions({
3182
3193
  diff: diff,
3183
- actions: baseActionsList$c,
3194
+ actions: baseActionsList$6,
3184
3195
  oldObj: previous,
3185
3196
  newObj: next,
3186
3197
  shouldOmitEmptyString: config.shouldOmitEmptyString
@@ -3274,7 +3285,7 @@ var generateUpdateActionsForAttributeDefinitions = function generateUpdateAction
3274
3285
  action: 'removeAttributeDefinition',
3275
3286
  name: attributeDef.previous.name
3276
3287
  };
3277
- })), _toConsumableArray(flatten__default['default'](updatedAttributeDefinitions.map(function (updatedAttributeDefinition) {
3288
+ })), _toConsumableArray(flatten__default["default"](updatedAttributeDefinitions.map(function (updatedAttributeDefinition) {
3278
3289
  return generateBaseFieldsUpdateActions(updatedAttributeDefinition.previous, updatedAttributeDefinition.next, {
3279
3290
  label: {
3280
3291
  action: 'changeLabel',
@@ -3325,7 +3336,7 @@ var generateUpdateActionsForAttributeEnumValues = function generateUpdateActions
3325
3336
  return _objectSpread2(_objectSpread2({}, nextEnumUpdateActions), {}, _defineProperty({}, removedAttributeEnumValue.hint.attributeName, _objectSpread2(_objectSpread2({}, removedAttributeEnumValueOfSameAttributeName), {}, {
3326
3337
  keys: [].concat(_toConsumableArray(removedAttributeEnumValueOfSameAttributeName.keys), [removedAttributeEnumValue.previous.key])
3327
3338
  })));
3328
- }, {}))), _toConsumableArray(flatten__default['default'](updatedAttributeEnumValues.map(function (updatedAttributeEnumValue) {
3339
+ }, {}))), _toConsumableArray(flatten__default["default"](updatedAttributeEnumValues.map(function (updatedAttributeEnumValue) {
3329
3340
  var updateActions = generateBaseFieldsUpdateActions(updatedAttributeEnumValue.previous, updatedAttributeEnumValue.next, {
3330
3341
  key: {
3331
3342
  action: 'changeEnumKey',
@@ -3403,10 +3414,10 @@ var actionsMapForHints = function actionsMapForHints() {
3403
3414
 
3404
3415
  function createProductTypeMapActions(mapActionGroup, syncActionConfig) {
3405
3416
  return function doMapActions(diff, next, previous, options) {
3406
- return flatten__default['default']([// we support only base fields for the product type,
3417
+ return flatten__default["default"]([// we support only base fields for the product type,
3407
3418
  // for attributes, applying hints would be recommended
3408
3419
  mapActionGroup('base', function () {
3409
- return actionsMapBase$c(diff, previous, next, syncActionConfig);
3420
+ return actionsMapBase$6(diff, previous, next, syncActionConfig);
3410
3421
  }), actionsMapForHints(options.nestedValuesChanges, previous, next)]);
3411
3422
  };
3412
3423
  }
@@ -3423,7 +3434,7 @@ var productTypes = (function (actionGroupList, syncActionConfig) {
3423
3434
  };
3424
3435
  });
3425
3436
 
3426
- var baseActionsList$d = [{
3437
+ var baseActionsList$5 = [{
3427
3438
  action: 'changeKey',
3428
3439
  key: 'key'
3429
3440
  }, {
@@ -3442,10 +3453,10 @@ var baseActionsList$d = [{
3442
3453
  action: 'setTransitions',
3443
3454
  key: 'transitions'
3444
3455
  }];
3445
- function actionsMapBase$d(diff, oldObj, newObj) {
3456
+ function actionsMapBase$5(diff, oldObj, newObj) {
3446
3457
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3447
3458
  return buildBaseAttributesActions({
3448
- actions: baseActionsList$d,
3459
+ actions: baseActionsList$5,
3449
3460
  diff: diff,
3450
3461
  oldObj: oldObj,
3451
3462
  newObj: newObj,
@@ -3495,12 +3506,12 @@ function createStatesMapActions(mapActionGroup, syncActionConfig) {
3495
3506
  var baseActions = [];
3496
3507
  var roleActions = [];
3497
3508
  baseActions.push(mapActionGroup('base', function () {
3498
- return actionsMapBase$d(diff, oldObj, newObj, syncActionConfig);
3509
+ return actionsMapBase$5(diff, oldObj, newObj, syncActionConfig);
3499
3510
  }));
3500
3511
  roleActions.push(mapActionGroup('roles', function () {
3501
3512
  return actionsMapRoles(diff, oldObj, newObj);
3502
3513
  }));
3503
- return flatten__default['default']([].concat(baseActions, _toConsumableArray(groupRoleActions(roleActions))));
3514
+ return flatten__default["default"]([].concat(baseActions, _toConsumableArray(groupRoleActions(roleActions))));
3504
3515
  };
3505
3516
  }
3506
3517
 
@@ -3513,7 +3524,7 @@ var states = (function (actionGroupList, syncActionConfig) {
3513
3524
  };
3514
3525
  });
3515
3526
 
3516
- var baseActionsList$e = [{
3527
+ var baseActionsList$4 = [{
3517
3528
  action: 'changeKey',
3518
3529
  key: 'key'
3519
3530
  }, {
@@ -3532,10 +3543,10 @@ var baseActionsList$e = [{
3532
3543
  action: 'setRoles',
3533
3544
  key: 'roles'
3534
3545
  }];
3535
- function actionsMapBase$e(diff, oldObj, newObj) {
3546
+ function actionsMapBase$4(diff, oldObj, newObj) {
3536
3547
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3537
3548
  return buildBaseAttributesActions({
3538
- actions: baseActionsList$e,
3549
+ actions: baseActionsList$4,
3539
3550
  diff: diff,
3540
3551
  oldObj: oldObj,
3541
3552
  newObj: newObj,
@@ -3543,41 +3554,41 @@ function actionsMapBase$e(diff, oldObj, newObj) {
3543
3554
  });
3544
3555
  }
3545
3556
 
3546
- function createChannelsMapActions(mapActionGroup, syncActionConfig) {
3557
+ function createChannelsMapActions$1(mapActionGroup, syncActionConfig) {
3547
3558
  return function doMapActions(diff, newObj, oldObj) {
3548
3559
  var allActions = [];
3549
3560
  allActions.push(mapActionGroup('base', function () {
3550
- return actionsMapBase$e(diff, oldObj, newObj, syncActionConfig);
3561
+ return actionsMapBase$4(diff, oldObj, newObj, syncActionConfig);
3551
3562
  }));
3552
3563
  allActions.push(mapActionGroup('custom', function () {
3553
3564
  return actionsMapCustom(diff, newObj, oldObj);
3554
3565
  }));
3555
- return flatten__default['default'](allActions);
3566
+ return flatten__default["default"](allActions);
3556
3567
  };
3557
3568
  }
3558
3569
 
3559
3570
  var channels = (function (actionGroupList) {
3560
3571
  var syncActionConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3561
3572
  var mapActionGroup = createMapActionGroup(actionGroupList);
3562
- var doMapActions = createChannelsMapActions(mapActionGroup, syncActionConfig);
3573
+ var doMapActions = createChannelsMapActions$1(mapActionGroup, syncActionConfig);
3563
3574
  var buildActions = createBuildActions(diff, doMapActions);
3564
3575
  return {
3565
3576
  buildActions: buildActions
3566
3577
  };
3567
3578
  });
3568
3579
 
3569
- var REGEX_NUMBER$4 = new RegExp(/^\d+$/);
3570
- var REGEX_UNDERSCORE_NUMBER$4 = new RegExp(/^_\d+$/);
3580
+ var REGEX_NUMBER = new RegExp(/^\d+$/);
3581
+ var REGEX_UNDERSCORE_NUMBER = new RegExp(/^_\d+$/);
3571
3582
 
3572
3583
  var getIsChangedOperation = function getIsChangedOperation(key) {
3573
- return REGEX_NUMBER$4.test(key);
3584
+ return REGEX_NUMBER.test(key);
3574
3585
  };
3575
3586
 
3576
3587
  var getIsRemovedOperation = function getIsRemovedOperation(key) {
3577
- return REGEX_UNDERSCORE_NUMBER$4.test(key);
3588
+ return REGEX_UNDERSCORE_NUMBER.test(key);
3578
3589
  };
3579
3590
 
3580
- var baseActionsList$f = [{
3591
+ var baseActionsList$3 = [{
3581
3592
  action: 'changeKey',
3582
3593
  key: 'key'
3583
3594
  }, {
@@ -3587,10 +3598,10 @@ var baseActionsList$f = [{
3587
3598
  action: 'setDescription',
3588
3599
  key: 'description'
3589
3600
  }];
3590
- function actionsMapBase$f(diff, oldObj, newObj) {
3601
+ function actionsMapBase$3(diff, oldObj, newObj) {
3591
3602
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3592
3603
  return buildBaseAttributesActions({
3593
- actions: baseActionsList$f,
3604
+ actions: baseActionsList$3,
3594
3605
  diff: diff,
3595
3606
  oldObj: oldObj,
3596
3607
  newObj: newObj,
@@ -3639,7 +3650,7 @@ function actionsMapEnums(attributeType, attributeDiff, previous, next) {
3639
3650
  // order of enumValues, we generate one updateAction instead of one at a time.
3640
3651
 
3641
3652
  var newEnumValuesOrder = [];
3642
- flatten__default['default'](buildArrayActions(attributeDiff, previous, next)).forEach(function (updateAction) {
3653
+ flatten__default["default"](buildArrayActions(attributeDiff, previous, next)).forEach(function (updateAction) {
3643
3654
  if (updateAction.action === changeEnumOrderActionName) {
3644
3655
  newEnumValuesOrder.push(updateAction.value);
3645
3656
  } else actions.push(updateAction);
@@ -3653,7 +3664,7 @@ function actionsMapEnums(attributeType, attributeDiff, previous, next) {
3653
3664
 
3654
3665
  function actionsMapFieldDefinitions(fieldDefinitionsDiff, previous, next, diffPaths) {
3655
3666
  var actions = [];
3656
- forEach__default['default'](fieldDefinitionsDiff, function (diffValue, diffKey) {
3667
+ forEach__default["default"](fieldDefinitionsDiff, function (diffValue, diffKey) {
3657
3668
  var extractedPairs = extractMatchingPairs(diffPaths, diffKey, previous, next);
3658
3669
 
3659
3670
  if (getIsChangedOperation(diffKey)) {
@@ -3697,7 +3708,7 @@ function actionsMapFieldDefinitions(fieldDefinitionsDiff, previous, next, diffPa
3697
3708
  // List of `removeActions` can be found here
3698
3709
  // https://docs.commercetools.com/http-api-projects-types.html#change-key
3699
3710
 
3700
- var sortedActions = sortBy__default['default'](actions, function (action) {
3711
+ var sortedActions = sortBy__default["default"](actions, function (action) {
3701
3712
  return action.action !== 'removeFieldDefinition';
3702
3713
  });
3703
3714
  return sortedActions;
@@ -3707,11 +3718,11 @@ function createTypeMapActions(mapActionGroup, syncActionConfig) {
3707
3718
  return function doMapActions(diff, next, previous) {
3708
3719
  var allActions = [];
3709
3720
  allActions.push(mapActionGroup('base', function () {
3710
- return actionsMapBase$f(diff, previous, next, syncActionConfig);
3721
+ return actionsMapBase$3(diff, previous, next, syncActionConfig);
3711
3722
  }), mapActionGroup('fieldDefinitions', function () {
3712
3723
  return actionsMapFieldDefinitions(diff.fieldDefinitions, previous.fieldDefinitions, next.fieldDefinitions, findMatchingPairs(diff.fieldDefinitions, previous.fieldDefinitions, next.fieldDefinitions, 'name'));
3713
3724
  }));
3714
- return flatten__default['default'](allActions);
3725
+ return flatten__default["default"](allActions);
3715
3726
  };
3716
3727
  }
3717
3728
 
@@ -3724,7 +3735,7 @@ var types = (function (actionGroupList, syncActionConfig) {
3724
3735
  };
3725
3736
  });
3726
3737
 
3727
- var baseActionsList$g = [{
3738
+ var baseActionsList$2 = [{
3728
3739
  action: 'changeName',
3729
3740
  key: 'name'
3730
3741
  }, {
@@ -3743,10 +3754,10 @@ var baseActionsList$g = [{
3743
3754
  action: 'setShippingRateInputType',
3744
3755
  key: 'shippingRateInputType'
3745
3756
  }];
3746
- function actionsMapBase$g(diff, oldObj, newObj) {
3757
+ function actionsMapBase$2(diff, oldObj, newObj) {
3747
3758
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3748
3759
  return buildBaseAttributesActions({
3749
- actions: baseActionsList$g,
3760
+ actions: baseActionsList$2,
3750
3761
  diff: diff,
3751
3762
  oldObj: oldObj,
3752
3763
  newObj: newObj,
@@ -3754,27 +3765,27 @@ function actionsMapBase$g(diff, oldObj, newObj) {
3754
3765
  });
3755
3766
  }
3756
3767
 
3757
- function createChannelsMapActions$1(mapActionGroup, syncActionConfig) {
3768
+ function createChannelsMapActions(mapActionGroup, syncActionConfig) {
3758
3769
  return function doMapActions(diff, newObj, oldObj) {
3759
3770
  var allActions = [];
3760
3771
  allActions.push(mapActionGroup('base', function () {
3761
- return actionsMapBase$g(diff, oldObj, newObj, syncActionConfig);
3772
+ return actionsMapBase$2(diff, oldObj, newObj, syncActionConfig);
3762
3773
  }));
3763
- return flatten__default['default'](allActions);
3774
+ return flatten__default["default"](allActions);
3764
3775
  };
3765
3776
  }
3766
3777
 
3767
3778
  var projects = (function (actionGroupList) {
3768
3779
  var syncActionConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3769
3780
  var mapActionGroup = createMapActionGroup(actionGroupList);
3770
- var doMapActions = createChannelsMapActions$1(mapActionGroup, syncActionConfig);
3781
+ var doMapActions = createChannelsMapActions(mapActionGroup, syncActionConfig);
3771
3782
  var buildActions = createBuildActions(diff, doMapActions);
3772
3783
  return {
3773
3784
  buildActions: buildActions
3774
3785
  };
3775
3786
  });
3776
3787
 
3777
- var baseActionsList$h = [{
3788
+ var baseActionsList$1 = [{
3778
3789
  action: 'setName',
3779
3790
  key: 'name'
3780
3791
  }, {
@@ -3787,9 +3798,9 @@ var baseActionsList$h = [{
3787
3798
  action: 'setSupplyChannels',
3788
3799
  key: 'supplyChannels'
3789
3800
  }];
3790
- function actionsMapBase$h(diff, oldObj, newObj) {
3801
+ function actionsMapBase$1(diff, oldObj, newObj) {
3791
3802
  return buildBaseAttributesActions({
3792
- actions: baseActionsList$h,
3803
+ actions: baseActionsList$1,
3793
3804
  diff: diff,
3794
3805
  oldObj: oldObj,
3795
3806
  newObj: newObj
@@ -3800,12 +3811,12 @@ function createStoresMapActions(mapActionGroup) {
3800
3811
  return function doMapActions(diff, next, previous) {
3801
3812
  var allActions = [];
3802
3813
  allActions.push(mapActionGroup('base', function () {
3803
- return actionsMapBase$h(diff, previous, next);
3814
+ return actionsMapBase$1(diff, previous, next);
3804
3815
  }));
3805
3816
  allActions.push(mapActionGroup('custom', function () {
3806
3817
  return actionsMapCustom(diff, next, previous);
3807
3818
  }));
3808
- return flatten__default['default'](allActions);
3819
+ return flatten__default["default"](allActions);
3809
3820
  };
3810
3821
  }
3811
3822
 
@@ -3819,6 +3830,45 @@ var stores = (function (actionGroupList) {
3819
3830
  };
3820
3831
  });
3821
3832
 
3833
+ var baseActionsList = [{
3834
+ action: 'changeName',
3835
+ key: 'name'
3836
+ }, {
3837
+ action: 'setKey',
3838
+ key: 'key'
3839
+ }];
3840
+ function actionsMapBase(diff, oldObj, newObj) {
3841
+ return buildBaseAttributesActions({
3842
+ actions: baseActionsList,
3843
+ diff: diff,
3844
+ oldObj: oldObj,
3845
+ newObj: newObj
3846
+ });
3847
+ }
3848
+
3849
+ function createProductSelectionsMapActions(mapActionGroup) {
3850
+ return function doMapActions(diff, next, previous) {
3851
+ var allActions = [];
3852
+ allActions.push(mapActionGroup('base', function () {
3853
+ return actionsMapBase(diff, previous, next);
3854
+ }));
3855
+ allActions.push(mapActionGroup('custom', function () {
3856
+ return actionsMapCustom(diff, next, previous);
3857
+ }));
3858
+ return flatten__default["default"](allActions);
3859
+ };
3860
+ }
3861
+
3862
+ var productSelections = (function (actionGroupList) {
3863
+ var mapActionGroup = createMapActionGroup(actionGroupList);
3864
+ var doMapActions = createProductSelectionsMapActions(mapActionGroup);
3865
+ var onBeforeApplyingDiff = null;
3866
+ var buildActions = createBuildActions(diff, doMapActions, onBeforeApplyingDiff);
3867
+ return {
3868
+ buildActions: buildActions
3869
+ };
3870
+ });
3871
+
3822
3872
  exports.createSyncCartDiscounts = cartDiscounts;
3823
3873
  exports.createSyncCategories = categories;
3824
3874
  exports.createSyncChannels = channels;
@@ -3828,6 +3878,7 @@ exports.createSyncDiscountCodes = discountCodes;
3828
3878
  exports.createSyncInventories = inventories;
3829
3879
  exports.createSyncOrders = orders;
3830
3880
  exports.createSyncProductDiscounts = productDiscounts;
3881
+ exports.createSyncProductSelections = productSelections;
3831
3882
  exports.createSyncProductTypes = productTypes;
3832
3883
  exports.createSyncProducts = products;
3833
3884
  exports.createSyncProjects = projects;