@commercetools/sync-actions 5.0.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -682,7 +682,7 @@ function buildReferenceActions(_ref4) {
682
682
  });
683
683
  }
684
684
 
685
- var baseActionsList$i = [{
685
+ var baseActionsList$j = [{
686
686
  action: 'changeName',
687
687
  key: 'name'
688
688
  }, {
@@ -719,10 +719,10 @@ var referenceActionsList$3 = [{
719
719
  * SYNC FUNCTIONS
720
720
  */
721
721
 
722
- function actionsMapBase$i(diff, oldObj, newObj) {
722
+ function actionsMapBase$j(diff, oldObj, newObj) {
723
723
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
724
724
  return buildBaseAttributesActions({
725
- actions: baseActionsList$i,
725
+ actions: baseActionsList$j,
726
726
  diff: diff,
727
727
  oldObj: oldObj,
728
728
  newObj: newObj,
@@ -761,24 +761,26 @@ function copyEmptyArrayProps() {
761
761
  var newObj = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
762
762
 
763
763
  if (!isNil__default["default"](oldObj) && !isNil__default["default"](newObj)) {
764
- var nextObjectWithEmptyArray = Object.entries(oldObj).reduce(function (nextObject, _ref) {
764
+ var nextObjectWithEmptyArray = Object.entries(oldObj).reduce(function (merged, _ref) {
765
765
  var _ref2 = _slicedToArray(_ref, 2),
766
766
  key = _ref2[0],
767
767
  value = _ref2[1];
768
768
 
769
- var merged = _objectSpread2(_objectSpread2({}, newObj), nextObject); // Ignore CUSTOM key as this object is dynamic and its up to the user to dynamically change it
769
+ // Ignore CUSTOM key as this object is dynamic and its up to the user to dynamically change it
770
770
  // todo, it would be better if we pass it as ignored keys param
771
-
772
-
773
771
  if (key === CUSTOM) return merged;
774
772
 
775
773
  if (Array.isArray(value) && newObj[key] && newObj[key].length >= 1) {
776
- var _loop = function _loop(i) {
774
+ /* eslint-disable no-plusplus */
775
+ var hashMapValue = value.reduce(function (acc, val) {
776
+ acc[val.id] = val;
777
+ return acc;
778
+ }, {});
779
+
780
+ for (var i = 0; i < newObj[key].length; i++) {
777
781
  if (!isNil__default["default"](newObj[key][i]) && _typeof(newObj[key][i]) === 'object' && !isNil__default["default"](newObj[key][i].id)) {
778
782
  // Since its unordered array elements then check if the element on `oldObj` exists by id
779
- var foundObject = value.find(function (v) {
780
- return Number(v.id) === Number(newObj[key][i].id);
781
- });
783
+ var foundObject = hashMapValue[newObj[key][i].id];
782
784
 
783
785
  if (!isNil__default["default"](foundObject)) {
784
786
  var _copyEmptyArrayProps = copyEmptyArrayProps(foundObject, newObj[key][i]),
@@ -787,21 +789,17 @@ function copyEmptyArrayProps() {
787
789
  /* eslint-disable no-param-reassign */
788
790
 
789
791
 
790
- newObj[key][i] = nestedObject;
792
+ merged[key][i] = nestedObject;
791
793
  }
792
794
  }
793
- };
794
-
795
- /* eslint-disable no-plusplus */
796
- for (var i = 0; i < newObj[key].length; i++) {
797
- _loop(i);
798
795
  }
799
796
 
800
797
  return merged;
801
798
  }
802
799
 
803
800
  if (Array.isArray(value)) {
804
- return _objectSpread2(_objectSpread2({}, merged), {}, _defineProperty({}, key, isNil__default["default"](newObj[key]) ? [] : newObj[key]));
801
+ merged[key] = isNil__default["default"](newObj[key]) ? [] : newObj[key];
802
+ return merged;
805
803
  }
806
804
 
807
805
  if (!isNil__default["default"](newObj[key]) && _typeof(value) === 'object' && // Ignore Date as this will create invalid object since typeof date === 'object' return true
@@ -809,9 +807,10 @@ function copyEmptyArrayProps() {
809
807
  !(value instanceof Date)) {
810
808
  var _copyEmptyArrayProps3 = copyEmptyArrayProps(value, newObj[key]),
811
809
  _copyEmptyArrayProps4 = _slicedToArray(_copyEmptyArrayProps3, 2),
812
- nestedObject = _copyEmptyArrayProps4[1];
810
+ _nestedObject = _copyEmptyArrayProps4[1];
813
811
 
814
- return _objectSpread2(_objectSpread2({}, merged), {}, _defineProperty({}, key, nestedObject));
812
+ merged[key] = _nestedObject;
813
+ return merged;
815
814
  }
816
815
 
817
816
  return merged;
@@ -826,7 +825,7 @@ function createCategoryMapActions(mapActionGroup, syncActionConfig) {
826
825
  return function doMapActions(diff, newObj, oldObj) {
827
826
  var allActions = [];
828
827
  allActions.push(mapActionGroup('base', function () {
829
- return actionsMapBase$i(diff, oldObj, newObj, syncActionConfig);
828
+ return actionsMapBase$j(diff, oldObj, newObj, syncActionConfig);
830
829
  }));
831
830
  allActions.push(mapActionGroup('references', function () {
832
831
  return actionsMapReferences$3(diff, oldObj, newObj);
@@ -862,7 +861,7 @@ var categories = (function (actionGroupList, syncActionConfig) {
862
861
  };
863
862
  });
864
863
 
865
- var baseActionsList$h = [{
864
+ var baseActionsList$i = [{
866
865
  action: 'setSalutation',
867
866
  key: 'salutation'
868
867
  }, {
@@ -922,10 +921,10 @@ var referenceActionsList$2 = [{
922
921
  * SYNC FUNCTIONS
923
922
  */
924
923
 
925
- function actionsMapBase$h(diff, oldObj, newObj) {
924
+ function actionsMapBase$i(diff, oldObj, newObj) {
926
925
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
927
926
  return buildBaseAttributesActions({
928
- actions: baseActionsList$h,
927
+ actions: baseActionsList$i,
929
928
  diff: diff,
930
929
  oldObj: oldObj,
931
930
  newObj: newObj,
@@ -1009,7 +1008,7 @@ function createCustomerMapActions(mapActionGroup, syncActionConfig) {
1009
1008
  return function doMapActions(diff, newObj, oldObj) {
1010
1009
  var allActions = [];
1011
1010
  allActions.push(mapActionGroup('base', function () {
1012
- return actionsMapBase$h(diff, oldObj, newObj, syncActionConfig);
1011
+ return actionsMapBase$i(diff, oldObj, newObj, syncActionConfig);
1013
1012
  }));
1014
1013
  allActions.push(mapActionGroup('references', function () {
1015
1014
  return actionsMapReferences$2(diff, oldObj, newObj);
@@ -1051,7 +1050,7 @@ var customers = (function (actionGroupList, syncActionConfig) {
1051
1050
  };
1052
1051
  });
1053
1052
 
1054
- var baseActionsList$g = [{
1053
+ var baseActionsList$h = [{
1055
1054
  action: 'changeQuantity',
1056
1055
  key: 'quantityOnStock',
1057
1056
  actionKey: 'quantity'
@@ -1070,10 +1069,10 @@ var referenceActionsList$1 = [{
1070
1069
  * SYNC FUNCTIONS
1071
1070
  */
1072
1071
 
1073
- function actionsMapBase$g(diff, oldObj, newObj) {
1072
+ function actionsMapBase$h(diff, oldObj, newObj) {
1074
1073
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1075
1074
  return buildBaseAttributesActions({
1076
- actions: baseActionsList$g,
1075
+ actions: baseActionsList$h,
1077
1076
  diff: diff,
1078
1077
  oldObj: oldObj,
1079
1078
  newObj: newObj,
@@ -1093,7 +1092,7 @@ function createInventoryMapActions(mapActionGroup, syncActionConfig) {
1093
1092
  return function doMapActions(diff, newObj, oldObj) {
1094
1093
  var allActions = [];
1095
1094
  allActions.push(mapActionGroup('base', function () {
1096
- return actionsMapBase$g(diff, oldObj, newObj, syncActionConfig);
1095
+ return actionsMapBase$h(diff, oldObj, newObj, syncActionConfig);
1097
1096
  }));
1098
1097
  allActions.push(mapActionGroup('references', function () {
1099
1098
  return actionsMapReferences$1(diff, oldObj, newObj);
@@ -1188,7 +1187,7 @@ function findMatchingPairs(diff) {
1188
1187
 
1189
1188
  var REGEX_NUMBER$2 = new RegExp(/^\d+$/);
1190
1189
  var REGEX_UNDERSCORE_NUMBER$2 = new RegExp(/^_\d+$/);
1191
- var baseActionsList$f = [{
1190
+ var baseActionsList$g = [{
1192
1191
  action: 'changeName',
1193
1192
  key: 'name'
1194
1193
  }, {
@@ -1595,10 +1594,10 @@ function _buildVariantAssetsActions(diffAssets, oldVariant, newVariant) {
1595
1594
  */
1596
1595
 
1597
1596
 
1598
- function actionsMapBase$f(diff, oldObj, newObj) {
1597
+ function actionsMapBase$g(diff, oldObj, newObj) {
1599
1598
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1600
1599
  return buildBaseAttributesActions({
1601
- actions: baseActionsList$f,
1600
+ actions: baseActionsList$g,
1602
1601
  diff: diff,
1603
1602
  oldObj: oldObj,
1604
1603
  newObj: newObj,
@@ -1839,7 +1838,7 @@ function createProductMapActions(mapActionGroup, syncActionConfig) {
1839
1838
  return actionsMapRemoveVariants(diff, oldObj, newObj);
1840
1839
  }));
1841
1840
  allActions.push(mapActionGroup('base', function () {
1842
- return actionsMapBase$f(diff, oldObj, newObj, syncActionConfig);
1841
+ return actionsMapBase$g(diff, oldObj, newObj, syncActionConfig);
1843
1842
  }));
1844
1843
  allActions.push(mapActionGroup('meta', function () {
1845
1844
  return actionsMapMeta(diff, oldObj, newObj);
@@ -1914,7 +1913,7 @@ var isRemoveAction = function isRemoveAction(key, resource) {
1914
1913
  return REGEX_UNDERSCORE_NUMBER$1.test(key) && Number(resource[2]) === 0;
1915
1914
  };
1916
1915
 
1917
- var baseActionsList$e = [{
1916
+ var baseActionsList$f = [{
1918
1917
  action: 'changeOrderState',
1919
1918
  key: 'orderState'
1920
1919
  }, {
@@ -1928,10 +1927,10 @@ var baseActionsList$e = [{
1928
1927
  * SYNC FUNCTIONS
1929
1928
  */
1930
1929
 
1931
- function actionsMapBase$e(diff, oldObj, newObj) {
1930
+ function actionsMapBase$f(diff, oldObj, newObj) {
1932
1931
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1933
1932
  return buildBaseAttributesActions({
1934
- actions: baseActionsList$e,
1933
+ actions: baseActionsList$f,
1935
1934
  diff: diff,
1936
1935
  oldObj: oldObj,
1937
1936
  newObj: newObj,
@@ -2064,7 +2063,7 @@ function createOrderMapActions(mapActionGroup, syncActionConfig) {
2064
2063
  }
2065
2064
 
2066
2065
  allActions.push(mapActionGroup('base', function () {
2067
- return actionsMapBase$e(diff, oldObj, newObj, syncActionConfig);
2066
+ return actionsMapBase$f(diff, oldObj, newObj, syncActionConfig);
2068
2067
  }));
2069
2068
  allActions.push(mapActionGroup('deliveries', function () {
2070
2069
  return actionsMapDeliveries(diff, oldObj, newObj);
@@ -2100,7 +2099,7 @@ var orders = (function (actionGroupList, syncActionConfig) {
2100
2099
  };
2101
2100
  });
2102
2101
 
2103
- var baseActionsList$d = [{
2102
+ var baseActionsList$e = [{
2104
2103
  action: 'changeIsActive',
2105
2104
  key: 'isActive'
2106
2105
  }, {
@@ -2128,10 +2127,10 @@ var baseActionsList$d = [{
2128
2127
  action: 'setKey',
2129
2128
  key: 'key'
2130
2129
  }];
2131
- function actionsMapBase$d(diff, oldObj, newObj) {
2130
+ function actionsMapBase$e(diff, oldObj, newObj) {
2132
2131
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2133
2132
  return buildBaseAttributesActions({
2134
- actions: baseActionsList$d,
2133
+ actions: baseActionsList$e,
2135
2134
  diff: diff,
2136
2135
  oldObj: oldObj,
2137
2136
  newObj: newObj,
@@ -2172,7 +2171,7 @@ function createProductDiscountsMapActions(mapActionGroup, syncActionConfig) {
2172
2171
  return function doMapActions(diff, newObj, oldObj) {
2173
2172
  var allActions = [];
2174
2173
  allActions.push(mapActionGroup('base', function () {
2175
- return actionsMapBase$d(diff, oldObj, newObj, syncActionConfig);
2174
+ return actionsMapBase$e(diff, oldObj, newObj, syncActionConfig);
2176
2175
  }));
2177
2176
  return combineValidityActions(flatten__default["default"](allActions));
2178
2177
  };
@@ -2188,7 +2187,7 @@ var productDiscounts = (function (actionGroupList) {
2188
2187
  };
2189
2188
  });
2190
2189
 
2191
- var baseActionsList$c = [{
2190
+ var baseActionsList$d = [{
2192
2191
  action: 'changeIsActive',
2193
2192
  key: 'isActive'
2194
2193
  }, {
@@ -2219,10 +2218,10 @@ var baseActionsList$c = [{
2219
2218
  action: 'changeGroups',
2220
2219
  key: 'groups'
2221
2220
  }];
2222
- function actionsMapBase$c(diff, oldObj, newObj) {
2221
+ function actionsMapBase$d(diff, oldObj, newObj) {
2223
2222
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2224
2223
  return buildBaseAttributesActions({
2225
- actions: baseActionsList$c,
2224
+ actions: baseActionsList$d,
2226
2225
  diff: diff,
2227
2226
  oldObj: oldObj,
2228
2227
  newObj: newObj,
@@ -2234,7 +2233,7 @@ function createDiscountCodesMapActions(mapActionGroup, syncActionConfig) {
2234
2233
  return function doMapActions(diff, newObj, oldObj) {
2235
2234
  var allActions = [];
2236
2235
  allActions.push(mapActionGroup('base', function () {
2237
- return actionsMapBase$c(diff, oldObj, newObj, syncActionConfig);
2236
+ return actionsMapBase$d(diff, oldObj, newObj, syncActionConfig);
2238
2237
  }));
2239
2238
  allActions.push(mapActionGroup('custom', function () {
2240
2239
  return actionsMapCustom(diff, newObj, oldObj);
@@ -2262,17 +2261,17 @@ var discountCodes = (function (actionGroupList) {
2262
2261
  };
2263
2262
  });
2264
2263
 
2265
- var baseActionsList$b = [{
2264
+ var baseActionsList$c = [{
2266
2265
  action: 'changeName',
2267
2266
  key: 'name'
2268
2267
  }, {
2269
2268
  action: 'setKey',
2270
2269
  key: 'key'
2271
2270
  }];
2272
- function actionsMapBase$b(diff, oldObj, newObj) {
2271
+ function actionsMapBase$c(diff, oldObj, newObj) {
2273
2272
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2274
2273
  return buildBaseAttributesActions({
2275
- actions: baseActionsList$b,
2274
+ actions: baseActionsList$c,
2276
2275
  diff: diff,
2277
2276
  oldObj: oldObj,
2278
2277
  newObj: newObj,
@@ -2284,7 +2283,7 @@ function createCustomerGroupMapActions(mapActionGroup, syncActionConfig) {
2284
2283
  return function doMapActions(diff, newObj, oldObj) {
2285
2284
  var allActions = [];
2286
2285
  allActions.push(mapActionGroup('base', function () {
2287
- return actionsMapBase$b(diff, oldObj, newObj, syncActionConfig);
2286
+ return actionsMapBase$c(diff, oldObj, newObj, syncActionConfig);
2288
2287
  }));
2289
2288
  allActions.push(mapActionGroup('custom', function () {
2290
2289
  return actionsMapCustom(diff, newObj, oldObj);
@@ -2303,7 +2302,7 @@ var customerGroup = (function (actionGroupList) {
2303
2302
  };
2304
2303
  });
2305
2304
 
2306
- var baseActionsList$a = [{
2305
+ var baseActionsList$b = [{
2307
2306
  action: 'changeIsActive',
2308
2307
  key: 'isActive'
2309
2308
  }, {
@@ -2340,10 +2339,10 @@ var baseActionsList$a = [{
2340
2339
  action: 'setKey',
2341
2340
  key: 'key'
2342
2341
  }];
2343
- function actionsMapBase$a(diff, oldObj, newObj) {
2342
+ function actionsMapBase$b(diff, oldObj, newObj) {
2344
2343
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2345
2344
  return buildBaseAttributesActions({
2346
- actions: baseActionsList$a,
2345
+ actions: baseActionsList$b,
2347
2346
  diff: diff,
2348
2347
  oldObj: oldObj,
2349
2348
  newObj: newObj,
@@ -2355,7 +2354,7 @@ function createCartDiscountsMapActions(mapActionGroup, syncActionConfig) {
2355
2354
  return function doMapActions(diff, newObj, oldObj) {
2356
2355
  var allActions = [];
2357
2356
  allActions.push(mapActionGroup('base', function () {
2358
- return actionsMapBase$a(diff, oldObj, newObj, syncActionConfig);
2357
+ return actionsMapBase$b(diff, oldObj, newObj, syncActionConfig);
2359
2358
  }));
2360
2359
  allActions.push(mapActionGroup('custom', function () {
2361
2360
  return actionsMapCustom(diff, newObj, oldObj);
@@ -2374,7 +2373,7 @@ var cartDiscounts = (function (actionGroupList) {
2374
2373
  };
2375
2374
  });
2376
2375
 
2377
- var baseActionsList$9 = [{
2376
+ var baseActionsList$a = [{
2378
2377
  action: 'changeName',
2379
2378
  key: 'name'
2380
2379
  }, {
@@ -2384,10 +2383,10 @@ var baseActionsList$9 = [{
2384
2383
  action: 'setDescription',
2385
2384
  key: 'description'
2386
2385
  }];
2387
- function actionsMapBase$9(diff, oldObj, newObj) {
2386
+ function actionsMapBase$a(diff, oldObj, newObj) {
2388
2387
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2389
2388
  return buildBaseAttributesActions({
2390
- actions: baseActionsList$9,
2389
+ actions: baseActionsList$a,
2391
2390
  diff: diff,
2392
2391
  oldObj: oldObj,
2393
2392
  newObj: newObj,
@@ -2421,7 +2420,7 @@ function createTaxCategoriesMapActions(mapActionGroup, syncActionConfig) {
2421
2420
  return function doMapActions(diff, newObj, oldObj) {
2422
2421
  var allActions = [];
2423
2422
  allActions.push(mapActionGroup('base', function () {
2424
- return actionsMapBase$9(diff, oldObj, newObj, syncActionConfig);
2423
+ return actionsMapBase$a(diff, oldObj, newObj, syncActionConfig);
2425
2424
  }));
2426
2425
  allActions.push(mapActionGroup('rates', function () {
2427
2426
  return actionsMapRates(diff, oldObj, newObj);
@@ -2448,7 +2447,7 @@ var taxCategories = (function (actionGroupList, syncActionConfig) {
2448
2447
  };
2449
2448
  });
2450
2449
 
2451
- var baseActionsList$8 = [{
2450
+ var baseActionsList$9 = [{
2452
2451
  action: 'changeName',
2453
2452
  key: 'name'
2454
2453
  }, {
@@ -2465,10 +2464,10 @@ var hasLocation = function hasLocation(locations, otherLocation) {
2465
2464
  });
2466
2465
  };
2467
2466
 
2468
- function actionsMapBase$8(diff, oldObj, newObj) {
2467
+ function actionsMapBase$9(diff, oldObj, newObj) {
2469
2468
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2470
2469
  return buildBaseAttributesActions({
2471
- actions: baseActionsList$8,
2470
+ actions: baseActionsList$9,
2472
2471
  diff: diff,
2473
2472
  oldObj: oldObj,
2474
2473
  newObj: newObj,
@@ -2513,7 +2512,7 @@ function createZonesMapActions(mapActionGroup, syncActionConfig) {
2513
2512
  return function doMapActions(diff, newObj, oldObj) {
2514
2513
  var allActions = [];
2515
2514
  allActions.push(mapActionGroup('base', function () {
2516
- return actionsMapBase$8(diff, oldObj, newObj, syncActionConfig);
2515
+ return actionsMapBase$9(diff, oldObj, newObj, syncActionConfig);
2517
2516
  }));
2518
2517
  allActions.push(flatten__default["default"](mapActionGroup('locations', function () {
2519
2518
  return actionsMapLocations(diff, oldObj, newObj);
@@ -2540,7 +2539,7 @@ var zones = (function (actionGroupList, syncActionConfig) {
2540
2539
  };
2541
2540
  });
2542
2541
 
2543
- var baseActionsList$7 = [{
2542
+ var baseActionsList$8 = [{
2544
2543
  action: 'setKey',
2545
2544
  key: 'key'
2546
2545
  }, {
@@ -2562,10 +2561,10 @@ var baseActionsList$7 = [{
2562
2561
  action: 'changeTaxCategory',
2563
2562
  key: 'taxCategory'
2564
2563
  }];
2565
- function actionsMapBase$7(diff, oldObj, newObj) {
2564
+ function actionsMapBase$8(diff, oldObj, newObj) {
2566
2565
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2567
2566
  return buildBaseAttributesActions({
2568
- actions: baseActionsList$7,
2567
+ actions: baseActionsList$8,
2569
2568
  diff: diff,
2570
2569
  oldObj: oldObj,
2571
2570
  newObj: newObj,
@@ -2647,7 +2646,7 @@ function createShippingMethodsMapActions(mapActionGroup, syncActionConfig) {
2647
2646
  return function doMapActions(diff, newObj, oldObj) {
2648
2647
  var allActions = [];
2649
2648
  allActions.push(mapActionGroup('base', function () {
2650
- return actionsMapBase$7(diff, oldObj, newObj, syncActionConfig);
2649
+ return actionsMapBase$8(diff, oldObj, newObj, syncActionConfig);
2651
2650
  }));
2652
2651
  allActions.push(flatten__default["default"](mapActionGroup('zoneRates', function () {
2653
2652
  return actionsMapZoneRates(diff, oldObj, newObj);
@@ -3042,7 +3041,7 @@ createComparator(function () {
3042
3041
  createComparator(createCircularEqualCreator());
3043
3042
  createComparator(createCircularEqualCreator(sameValueZeroEqual));
3044
3043
 
3045
- var baseActionsList$6 = [{
3044
+ var baseActionsList$7 = [{
3046
3045
  action: 'changeName',
3047
3046
  key: 'name'
3048
3047
  }, {
@@ -3052,7 +3051,7 @@ var baseActionsList$6 = [{
3052
3051
  action: 'changeDescription',
3053
3052
  key: 'description'
3054
3053
  }];
3055
- function actionsMapBase$6(diff, previous, next) {
3054
+ function actionsMapBase$7(diff, previous, next) {
3056
3055
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3057
3056
  // when `diff` is undefined, then the underlying `buildActions` has returned any diff
3058
3057
  // which given in product-types would mean that `buildActions` has run with `nestedValuesChanges` applied
@@ -3060,7 +3059,7 @@ function actionsMapBase$6(diff, previous, next) {
3060
3059
  if (!diff) return [];
3061
3060
  return buildBaseAttributesActions({
3062
3061
  diff: diff,
3063
- actions: baseActionsList$6,
3062
+ actions: baseActionsList$7,
3064
3063
  oldObj: previous,
3065
3064
  newObj: next,
3066
3065
  shouldOmitEmptyString: config.shouldOmitEmptyString
@@ -3286,7 +3285,7 @@ function createProductTypeMapActions(mapActionGroup, syncActionConfig) {
3286
3285
  return flatten__default["default"]([// we support only base fields for the product type,
3287
3286
  // for attributes, applying hints would be recommended
3288
3287
  mapActionGroup('base', function () {
3289
- return actionsMapBase$6(diff, previous, next, syncActionConfig);
3288
+ return actionsMapBase$7(diff, previous, next, syncActionConfig);
3290
3289
  }), actionsMapForHints(options.nestedValuesChanges, previous, next)]);
3291
3290
  };
3292
3291
  }
@@ -3303,7 +3302,7 @@ var productTypes = (function (actionGroupList, syncActionConfig) {
3303
3302
  };
3304
3303
  });
3305
3304
 
3306
- var baseActionsList$5 = [{
3305
+ var baseActionsList$6 = [{
3307
3306
  action: 'changeKey',
3308
3307
  key: 'key'
3309
3308
  }, {
@@ -3322,10 +3321,10 @@ var baseActionsList$5 = [{
3322
3321
  action: 'setTransitions',
3323
3322
  key: 'transitions'
3324
3323
  }];
3325
- function actionsMapBase$5(diff, oldObj, newObj) {
3324
+ function actionsMapBase$6(diff, oldObj, newObj) {
3326
3325
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3327
3326
  return buildBaseAttributesActions({
3328
- actions: baseActionsList$5,
3327
+ actions: baseActionsList$6,
3329
3328
  diff: diff,
3330
3329
  oldObj: oldObj,
3331
3330
  newObj: newObj,
@@ -3375,7 +3374,7 @@ function createStatesMapActions(mapActionGroup, syncActionConfig) {
3375
3374
  var baseActions = [];
3376
3375
  var roleActions = [];
3377
3376
  baseActions.push(mapActionGroup('base', function () {
3378
- return actionsMapBase$5(diff, oldObj, newObj, syncActionConfig);
3377
+ return actionsMapBase$6(diff, oldObj, newObj, syncActionConfig);
3379
3378
  }));
3380
3379
  roleActions.push(mapActionGroup('roles', function () {
3381
3380
  return actionsMapRoles(diff, oldObj, newObj);
@@ -3393,7 +3392,7 @@ var states = (function (actionGroupList, syncActionConfig) {
3393
3392
  };
3394
3393
  });
3395
3394
 
3396
- var baseActionsList$4 = [{
3395
+ var baseActionsList$5 = [{
3397
3396
  action: 'changeKey',
3398
3397
  key: 'key'
3399
3398
  }, {
@@ -3412,10 +3411,10 @@ var baseActionsList$4 = [{
3412
3411
  action: 'setRoles',
3413
3412
  key: 'roles'
3414
3413
  }];
3415
- function actionsMapBase$4(diff, oldObj, newObj) {
3414
+ function actionsMapBase$5(diff, oldObj, newObj) {
3416
3415
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3417
3416
  return buildBaseAttributesActions({
3418
- actions: baseActionsList$4,
3417
+ actions: baseActionsList$5,
3419
3418
  diff: diff,
3420
3419
  oldObj: oldObj,
3421
3420
  newObj: newObj,
@@ -3427,7 +3426,7 @@ function createChannelsMapActions$1(mapActionGroup, syncActionConfig) {
3427
3426
  return function doMapActions(diff, newObj, oldObj) {
3428
3427
  var allActions = [];
3429
3428
  allActions.push(mapActionGroup('base', function () {
3430
- return actionsMapBase$4(diff, oldObj, newObj, syncActionConfig);
3429
+ return actionsMapBase$5(diff, oldObj, newObj, syncActionConfig);
3431
3430
  }));
3432
3431
  allActions.push(mapActionGroup('custom', function () {
3433
3432
  return actionsMapCustom(diff, newObj, oldObj);
@@ -3457,7 +3456,7 @@ var getIsRemovedOperation = function getIsRemovedOperation(key) {
3457
3456
  return REGEX_UNDERSCORE_NUMBER.test(key);
3458
3457
  };
3459
3458
 
3460
- var baseActionsList$3 = [{
3459
+ var baseActionsList$4 = [{
3461
3460
  action: 'changeKey',
3462
3461
  key: 'key'
3463
3462
  }, {
@@ -3467,10 +3466,10 @@ var baseActionsList$3 = [{
3467
3466
  action: 'setDescription',
3468
3467
  key: 'description'
3469
3468
  }];
3470
- function actionsMapBase$3(diff, oldObj, newObj) {
3469
+ function actionsMapBase$4(diff, oldObj, newObj) {
3471
3470
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3472
3471
  return buildBaseAttributesActions({
3473
- actions: baseActionsList$3,
3472
+ actions: baseActionsList$4,
3474
3473
  diff: diff,
3475
3474
  oldObj: oldObj,
3476
3475
  newObj: newObj,
@@ -3587,7 +3586,7 @@ function createTypeMapActions(mapActionGroup, syncActionConfig) {
3587
3586
  return function doMapActions(diff, next, previous) {
3588
3587
  var allActions = [];
3589
3588
  allActions.push(mapActionGroup('base', function () {
3590
- return actionsMapBase$3(diff, previous, next, syncActionConfig);
3589
+ return actionsMapBase$4(diff, previous, next, syncActionConfig);
3591
3590
  }), mapActionGroup('fieldDefinitions', function () {
3592
3591
  return actionsMapFieldDefinitions(diff.fieldDefinitions, previous.fieldDefinitions, next.fieldDefinitions, findMatchingPairs(diff.fieldDefinitions, previous.fieldDefinitions, next.fieldDefinitions, 'name'));
3593
3592
  }));
@@ -3604,7 +3603,7 @@ var types = (function (actionGroupList, syncActionConfig) {
3604
3603
  };
3605
3604
  });
3606
3605
 
3607
- var baseActionsList$2 = [{
3606
+ var baseActionsList$3 = [{
3608
3607
  action: 'changeName',
3609
3608
  key: 'name'
3610
3609
  }, {
@@ -3623,10 +3622,10 @@ var baseActionsList$2 = [{
3623
3622
  action: 'setShippingRateInputType',
3624
3623
  key: 'shippingRateInputType'
3625
3624
  }];
3626
- function actionsMapBase$2(diff, oldObj, newObj) {
3625
+ function actionsMapBase$3(diff, oldObj, newObj) {
3627
3626
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3628
3627
  return buildBaseAttributesActions({
3629
- actions: baseActionsList$2,
3628
+ actions: baseActionsList$3,
3630
3629
  diff: diff,
3631
3630
  oldObj: oldObj,
3632
3631
  newObj: newObj,
@@ -3638,7 +3637,7 @@ function createChannelsMapActions(mapActionGroup, syncActionConfig) {
3638
3637
  return function doMapActions(diff, newObj, oldObj) {
3639
3638
  var allActions = [];
3640
3639
  allActions.push(mapActionGroup('base', function () {
3641
- return actionsMapBase$2(diff, oldObj, newObj, syncActionConfig);
3640
+ return actionsMapBase$3(diff, oldObj, newObj, syncActionConfig);
3642
3641
  }));
3643
3642
  return flatten__default["default"](allActions);
3644
3643
  };
@@ -3654,7 +3653,7 @@ var projects = (function (actionGroupList) {
3654
3653
  };
3655
3654
  });
3656
3655
 
3657
- var baseActionsList$1 = [{
3656
+ var baseActionsList$2 = [{
3658
3657
  action: 'setName',
3659
3658
  key: 'name'
3660
3659
  }, {
@@ -3667,9 +3666,9 @@ var baseActionsList$1 = [{
3667
3666
  action: 'setSupplyChannels',
3668
3667
  key: 'supplyChannels'
3669
3668
  }];
3670
- function actionsMapBase$1(diff, oldObj, newObj) {
3669
+ function actionsMapBase$2(diff, oldObj, newObj) {
3671
3670
  return buildBaseAttributesActions({
3672
- actions: baseActionsList$1,
3671
+ actions: baseActionsList$2,
3673
3672
  diff: diff,
3674
3673
  oldObj: oldObj,
3675
3674
  newObj: newObj
@@ -3680,7 +3679,7 @@ function createStoresMapActions(mapActionGroup) {
3680
3679
  return function doMapActions(diff, next, previous) {
3681
3680
  var allActions = [];
3682
3681
  allActions.push(mapActionGroup('base', function () {
3683
- return actionsMapBase$1(diff, previous, next);
3682
+ return actionsMapBase$2(diff, previous, next);
3684
3683
  }));
3685
3684
  allActions.push(mapActionGroup('custom', function () {
3686
3685
  return actionsMapCustom(diff, next, previous);
@@ -3699,16 +3698,16 @@ var stores = (function (actionGroupList) {
3699
3698
  };
3700
3699
  });
3701
3700
 
3702
- var baseActionsList = [{
3701
+ var baseActionsList$1 = [{
3703
3702
  action: 'changeName',
3704
3703
  key: 'name'
3705
3704
  }, {
3706
3705
  action: 'setKey',
3707
3706
  key: 'key'
3708
3707
  }];
3709
- function actionsMapBase(diff, oldObj, newObj) {
3708
+ function actionsMapBase$1(diff, oldObj, newObj) {
3710
3709
  return buildBaseAttributesActions({
3711
- actions: baseActionsList,
3710
+ actions: baseActionsList$1,
3712
3711
  diff: diff,
3713
3712
  oldObj: oldObj,
3714
3713
  newObj: newObj
@@ -3719,7 +3718,7 @@ function createProductSelectionsMapActions(mapActionGroup) {
3719
3718
  return function doMapActions(diff, next, previous) {
3720
3719
  var allActions = [];
3721
3720
  allActions.push(mapActionGroup('base', function () {
3722
- return actionsMapBase(diff, previous, next);
3721
+ return actionsMapBase$1(diff, previous, next);
3723
3722
  }));
3724
3723
  allActions.push(mapActionGroup('custom', function () {
3725
3724
  return actionsMapCustom(diff, next, previous);
@@ -3738,6 +3737,47 @@ var productSelections = (function (actionGroupList) {
3738
3737
  };
3739
3738
  });
3740
3739
 
3740
+ /* eslint-disable max-len */
3741
+ var baseActionsList = [{
3742
+ action: 'changeValue',
3743
+ key: 'value'
3744
+ }, {
3745
+ action: 'setDiscountedPrice',
3746
+ key: 'discounted'
3747
+ }];
3748
+ function actionsMapBase(diff, oldObj, newObj) {
3749
+ var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3750
+ return buildBaseAttributesActions({
3751
+ actions: baseActionsList,
3752
+ diff: diff,
3753
+ oldObj: oldObj,
3754
+ newObj: newObj,
3755
+ shouldOmitEmptyString: config.shouldOmitEmptyString
3756
+ });
3757
+ }
3758
+
3759
+ function createPriceMapActions(mapActionGroup, syncActionConfig) {
3760
+ return function doMapActions(diff, newObj, oldObj) {
3761
+ var allActions = [];
3762
+ allActions.push(mapActionGroup('base', function () {
3763
+ return actionsMapBase(diff, oldObj, newObj, syncActionConfig);
3764
+ }));
3765
+ allActions.push(mapActionGroup('custom', function () {
3766
+ return actionsMapCustom(diff, newObj, oldObj);
3767
+ }));
3768
+ return flatten__default["default"](allActions);
3769
+ };
3770
+ }
3771
+
3772
+ var prices = (function (actionGroupList, syncActionConfig) {
3773
+ var mapActionGroup = createMapActionGroup(actionGroupList);
3774
+ var doMapActions = createPriceMapActions(mapActionGroup, syncActionConfig);
3775
+ var buildActions = createBuildActions(diff, doMapActions);
3776
+ return {
3777
+ buildActions: buildActions
3778
+ };
3779
+ });
3780
+
3741
3781
  exports.createSyncCartDiscounts = cartDiscounts;
3742
3782
  exports.createSyncCategories = categories;
3743
3783
  exports.createSyncChannels = channels;
@@ -3752,6 +3792,7 @@ exports.createSyncProductTypes = productTypes;
3752
3792
  exports.createSyncProducts = products;
3753
3793
  exports.createSyncProjects = projects;
3754
3794
  exports.createSyncShippingMethods = shippingMethods;
3795
+ exports.createSyncStandalonePrices = prices;
3755
3796
  exports.createSyncStates = states;
3756
3797
  exports.createSyncStores = stores;
3757
3798
  exports.createSyncTaxCategories = taxCategories;