@commercetools/sync-actions 7.1.3 → 7.3.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.
@@ -636,7 +636,7 @@ function buildReferenceActions(_ref4) {
636
636
  });
637
637
  }
638
638
 
639
- var baseActionsList$l = [{
639
+ var baseActionsList$o = [{
640
640
  action: 'changeName',
641
641
  key: 'name'
642
642
  }, {
@@ -674,10 +674,10 @@ var referenceActionsList$3 = [{
674
674
  * SYNC FUNCTIONS
675
675
  */
676
676
 
677
- function actionsMapBase$l(diff, oldObj, newObj) {
677
+ function actionsMapBase$o(diff, oldObj, newObj) {
678
678
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
679
679
  return buildBaseAttributesActions({
680
- actions: baseActionsList$l,
680
+ actions: baseActionsList$o,
681
681
  diff: diff,
682
682
  oldObj: oldObj,
683
683
  newObj: newObj,
@@ -774,7 +774,7 @@ function createCategoryMapActions(mapActionGroup, syncActionConfig) {
774
774
  return function doMapActions(diff, newObj, oldObj) {
775
775
  var allActions = [];
776
776
  allActions.push(mapActionGroup('base', function () {
777
- return actionsMapBase$l(diff, oldObj, newObj, syncActionConfig);
777
+ return actionsMapBase$o(diff, oldObj, newObj, syncActionConfig);
778
778
  }));
779
779
  allActions.push(mapActionGroup('references', function () {
780
780
  return actionsMapReferences$3(diff, oldObj, newObj);
@@ -812,7 +812,7 @@ var categories = (function (actionGroupList, syncActionConfig) {
812
812
  });
813
813
 
814
814
  var isEmptyValue = createIsEmptyValue([undefined, null, '']);
815
- var baseActionsList$k = [{
815
+ var baseActionsList$n = [{
816
816
  action: 'setSalutation',
817
817
  key: 'salutation'
818
818
  }, {
@@ -878,10 +878,10 @@ var authenticationModeActionsList = [{
878
878
  * SYNC FUNCTIONS
879
879
  */
880
880
 
881
- function actionsMapBase$k(diff, oldObj, newObj) {
881
+ function actionsMapBase$n(diff, oldObj, newObj) {
882
882
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
883
883
  return buildBaseAttributesActions({
884
- actions: baseActionsList$k,
884
+ actions: baseActionsList$n,
885
885
  diff: diff,
886
886
  oldObj: oldObj,
887
887
  newObj: newObj,
@@ -1018,11 +1018,11 @@ function buildAuthenticationModeActions(_ref) {
1018
1018
  });
1019
1019
  }
1020
1020
 
1021
- function createCustomerMapActions(mapActionGroup, syncActionConfig) {
1021
+ function createCustomerMapActions$1(mapActionGroup, syncActionConfig) {
1022
1022
  return function doMapActions(diff, newObj, oldObj) {
1023
1023
  var allActions = [];
1024
1024
  allActions.push(mapActionGroup('base', function () {
1025
- return actionsMapBase$k(diff, oldObj, newObj, syncActionConfig);
1025
+ return actionsMapBase$n(diff, oldObj, newObj, syncActionConfig);
1026
1026
  }));
1027
1027
  allActions.push(mapActionGroup('references', function () {
1028
1028
  return actionsMapReferences$2(diff, oldObj, newObj);
@@ -1061,14 +1061,14 @@ var customers = (function (actionGroupList, syncActionConfig) {
1061
1061
  // for allowed action groups and return the return value of the callback
1062
1062
  // It will return an empty array for ignored action groups
1063
1063
  var mapActionGroup = createMapActionGroup(actionGroupList);
1064
- var doMapActions = createCustomerMapActions(mapActionGroup, syncActionConfig);
1064
+ var doMapActions = createCustomerMapActions$1(mapActionGroup, syncActionConfig);
1065
1065
  var buildActions = createBuildActions(diff, doMapActions, copyEmptyArrayProps);
1066
1066
  return {
1067
1067
  buildActions: buildActions
1068
1068
  };
1069
1069
  });
1070
1070
 
1071
- var baseActionsList$j = [{
1071
+ var baseActionsList$m = [{
1072
1072
  action: 'changeQuantity',
1073
1073
  key: 'quantityOnStock',
1074
1074
  actionKey: 'quantity'
@@ -1088,10 +1088,10 @@ var referenceActionsList$1 = [{
1088
1088
  * SYNC FUNCTIONS
1089
1089
  */
1090
1090
 
1091
- function actionsMapBase$j(diff, oldObj, newObj) {
1091
+ function actionsMapBase$m(diff, oldObj, newObj) {
1092
1092
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1093
1093
  return buildBaseAttributesActions({
1094
- actions: baseActionsList$j,
1094
+ actions: baseActionsList$m,
1095
1095
  diff: diff,
1096
1096
  oldObj: oldObj,
1097
1097
  newObj: newObj,
@@ -1113,7 +1113,7 @@ function createInventoryMapActions(mapActionGroup, syncActionConfig) {
1113
1113
  return function doMapActions(diff, newObj, oldObj) {
1114
1114
  var allActions = [];
1115
1115
  allActions.push(mapActionGroup('base', function () {
1116
- return actionsMapBase$j(diff, oldObj, newObj, syncActionConfig);
1116
+ return actionsMapBase$m(diff, oldObj, newObj, syncActionConfig);
1117
1117
  }));
1118
1118
  allActions.push(mapActionGroup('references', function () {
1119
1119
  return actionsMapReferences$1(diff, oldObj, newObj);
@@ -1203,7 +1203,7 @@ function findMatchingPairs(diff) {
1203
1203
 
1204
1204
  var REGEX_NUMBER$2 = new RegExp(/^\d+$/);
1205
1205
  var REGEX_UNDERSCORE_NUMBER$2 = new RegExp(/^_\d+$/);
1206
- var baseActionsList$i = [{
1206
+ var baseActionsList$l = [{
1207
1207
  action: 'changeName',
1208
1208
  key: 'name'
1209
1209
  }, {
@@ -1297,14 +1297,45 @@ function _buildKeyActions(variantDiff, oldVariant) {
1297
1297
  }
1298
1298
  return null;
1299
1299
  }
1300
- function _buildNewSetAttributeAction(id, el, sameForAllAttributeNames) {
1301
- var attributeName = el && el.name;
1300
+ function _buildAttributeValue(diffedValue, oldAttributeValue, newAttributeValue) {
1301
+ var value;
1302
+ if (Array.isArray(diffedValue)) value = getDeltaValue(diffedValue, oldAttributeValue);else if (typeof diffedValue === 'string')
1303
+ // LText: value: {en: "", de: ""}
1304
+ // Enum: value: {key: "foo", label: "Foo"}
1305
+ // LEnum: value: {key: "foo", label: {en: "Foo", de: "Foo"}}
1306
+ // Money: value: {centAmount: 123, currencyCode: ""}
1307
+ // *: value: ""
1308
+
1309
+ // normal
1310
+ value = getDeltaValue(diffedValue, oldAttributeValue);else if (diffedValue.centAmount || diffedValue.currencyCode)
1311
+ // Money
1312
+ value = {
1313
+ centAmount: diffedValue.centAmount ? getDeltaValue(diffedValue.centAmount) : newAttributeValue.centAmount,
1314
+ currencyCode: diffedValue.currencyCode ? getDeltaValue(diffedValue.currencyCode) : newAttributeValue.currencyCode
1315
+ };else if (diffedValue.key)
1316
+ // Enum / LEnum (use only the key)
1317
+ value = getDeltaValue(diffedValue.key);else if (_typeof(diffedValue) === 'object') if ({}.hasOwnProperty.call(diffedValue, '_t') && diffedValue._t === 'a') {
1318
+ // set-typed attribute
1319
+ value = newAttributeValue;
1320
+ } else {
1321
+ // LText
1322
+
1323
+ var updatedValue = Object.keys(diffedValue).reduce(function (acc, lang) {
1324
+ var patchedValue = getDeltaValue(diffedValue[lang], acc[lang]);
1325
+ return Object.assign(acc, _defineProperty({}, lang, patchedValue));
1326
+ }, _objectSpread2({}, oldAttributeValue));
1327
+ value = updatedValue;
1328
+ }
1329
+ return value;
1330
+ }
1331
+ function _buildNewSetAttributeAction(variantId, attr, sameForAllAttributeNames) {
1332
+ var attributeName = attr && attr.name;
1302
1333
  if (!attributeName) return undefined;
1303
1334
  var action = {
1304
1335
  action: 'setAttribute',
1305
- variantId: id,
1336
+ variantId: variantId,
1306
1337
  name: attributeName,
1307
- value: el.value
1338
+ value: attr.value
1308
1339
  };
1309
1340
  if (sameForAllAttributeNames.indexOf(attributeName) !== -1) {
1310
1341
  action = _objectSpread2(_objectSpread2({}, action), {}, {
@@ -1332,35 +1363,31 @@ function _buildSetAttributeAction(diffedValue, oldVariant, attribute, sameForAll
1332
1363
  });
1333
1364
  delete action.variantId;
1334
1365
  }
1335
- if (Array.isArray(diffedValue)) action.value = getDeltaValue(diffedValue, oldAttribute.value);else if (typeof diffedValue === 'string')
1336
- // LText: value: {en: "", de: ""}
1337
- // Enum: value: {key: "foo", label: "Foo"}
1338
- // LEnum: value: {key: "foo", label: {en: "Foo", de: "Foo"}}
1339
- // Money: value: {centAmount: 123, currencyCode: ""}
1340
- // *: value: ""
1341
-
1342
- // normal
1343
- action.value = getDeltaValue(diffedValue, oldAttribute.value);else if (diffedValue.centAmount || diffedValue.currencyCode)
1344
- // Money
1345
- action.value = {
1346
- centAmount: diffedValue.centAmount ? getDeltaValue(diffedValue.centAmount) : attribute.value.centAmount,
1347
- currencyCode: diffedValue.currencyCode ? getDeltaValue(diffedValue.currencyCode) : attribute.value.currencyCode
1348
- };else if (diffedValue.key)
1349
- // Enum / LEnum (use only the key)
1350
- action.value = getDeltaValue(diffedValue.key);else if (_typeof(diffedValue) === 'object') if ({}.hasOwnProperty.call(diffedValue, '_t') && diffedValue._t === 'a') {
1351
- // set-typed attribute
1352
- action = _objectSpread2(_objectSpread2({}, action), {}, {
1353
- value: attribute.value
1354
- });
1355
- } else {
1356
- // LText
1366
+ action.value = _buildAttributeValue(diffedValue, oldAttribute.value, attribute.value);
1367
+ return action;
1368
+ }
1369
+ function _buildNewSetProductAttributeAction(attr) {
1370
+ var attributeName = attr && attr.name;
1371
+ if (!attributeName) return undefined;
1372
+ var action = {
1373
+ action: 'setProductAttribute',
1374
+ name: attributeName,
1375
+ value: attr.value
1376
+ };
1377
+ return action;
1378
+ }
1379
+ function _buildSetProductAttributeAction(diffedValue, oldProductData, newAttribute) {
1380
+ if (!newAttribute) return undefined;
1381
+ var action = {
1382
+ action: 'setProductAttribute',
1383
+ name: newAttribute.name
1384
+ };
1357
1385
 
1358
- var updatedValue = Object.keys(diffedValue).reduce(function (acc, lang) {
1359
- var patchedValue = getDeltaValue(diffedValue[lang], acc[lang]);
1360
- return Object.assign(acc, _defineProperty({}, lang, patchedValue));
1361
- }, _objectSpread2({}, oldAttribute.value));
1362
- action.value = updatedValue;
1363
- }
1386
+ // Used as original object for patching long diff text
1387
+ var oldAttribute = oldProductData.attributes.find(function (a) {
1388
+ return a.name === newAttribute.name;
1389
+ }) || {};
1390
+ action.value = _buildAttributeValue(diffedValue, oldAttribute.value, newAttribute.value);
1364
1391
  return action;
1365
1392
  }
1366
1393
  function _buildVariantImagesAction(diffedImages) {
@@ -1471,6 +1498,41 @@ function _buildVariantPricesAction(diffedPrices) {
1471
1498
  });
1472
1499
  return [addPriceActions, changePriceActions, removePriceActions];
1473
1500
  }
1501
+ function _buildProductAttributesActions(diffedAttributes, oldProductData, newProductData) {
1502
+ var actions = [];
1503
+ if (!diffedAttributes) return actions;
1504
+ forEach(diffedAttributes, function (value, key) {
1505
+ if (REGEX_NUMBER$2.test(key)) {
1506
+ if (Array.isArray(value)) {
1507
+ var setAction = _buildNewSetProductAttributeAction(getDeltaValue(value));
1508
+ if (setAction) actions.push(setAction);
1509
+ } else if (newProductData.attributes) {
1510
+ var _setAction = _buildSetProductAttributeAction(value.value, oldProductData, newProductData.attributes[key]);
1511
+ if (_setAction) actions.push(_setAction);
1512
+ }
1513
+ } else if (REGEX_UNDERSCORE_NUMBER$2.test(key)) {
1514
+ if (Array.isArray(value)) {
1515
+ // Ignore pure array moves!
1516
+ if (value.length === 3 && value[2] === 3) return;
1517
+ var deltaValue = getDeltaValue(value);
1518
+ if (!deltaValue) if (value[0] && value[0].name)
1519
+ // unset attribute if
1520
+ deltaValue = {
1521
+ name: value[0].name
1522
+ };else deltaValue = undefined;
1523
+ var _setAction2 = _buildNewSetProductAttributeAction(deltaValue);
1524
+ if (_setAction2) actions.push(_setAction2);
1525
+ } else {
1526
+ var index = key.substring(1);
1527
+ if (newProductData.attributes) {
1528
+ var _setAction3 = _buildSetProductAttributeAction(value.value, oldProductData, newProductData.attributes[index]);
1529
+ if (_setAction3) actions.push(_setAction3);
1530
+ }
1531
+ }
1532
+ }
1533
+ });
1534
+ return actions;
1535
+ }
1474
1536
  function _buildVariantAttributesActions(attributes, oldVariant, newVariant, sameForAllAttributeNames) {
1475
1537
  var actions = [];
1476
1538
  if (!attributes) return actions;
@@ -1482,8 +1544,8 @@ function _buildVariantAttributesActions(attributes, oldVariant, newVariant, same
1482
1544
  var setAction = _buildNewSetAttributeAction(id, deltaValue, sameForAllAttributeNames);
1483
1545
  if (setAction) actions.push(setAction);
1484
1546
  } else if (newVariant.attributes) {
1485
- var _setAction = _buildSetAttributeAction(value.value, oldVariant, newVariant.attributes[key], sameForAllAttributeNames);
1486
- if (_setAction) actions.push(_setAction);
1547
+ var _setAction4 = _buildSetAttributeAction(value.value, oldVariant, newVariant.attributes[key], sameForAllAttributeNames);
1548
+ if (_setAction4) actions.push(_setAction4);
1487
1549
  }
1488
1550
  } else if (REGEX_UNDERSCORE_NUMBER$2.test(key)) if (Array.isArray(value)) {
1489
1551
  // Ignore pure array moves!
@@ -1495,13 +1557,13 @@ function _buildVariantAttributesActions(attributes, oldVariant, newVariant, same
1495
1557
  _deltaValue = {
1496
1558
  name: value[0].name
1497
1559
  };else _deltaValue = undefined;
1498
- var _setAction2 = _buildNewSetAttributeAction(_id, _deltaValue, sameForAllAttributeNames);
1499
- if (_setAction2) actions.push(_setAction2);
1560
+ var _setAction5 = _buildNewSetAttributeAction(_id, _deltaValue, sameForAllAttributeNames);
1561
+ if (_setAction5) actions.push(_setAction5);
1500
1562
  } else {
1501
1563
  var index = key.substring(1);
1502
1564
  if (newVariant.attributes) {
1503
- var _setAction3 = _buildSetAttributeAction(value.value, oldVariant, newVariant.attributes[index], sameForAllAttributeNames);
1504
- if (_setAction3) actions.push(_setAction3);
1565
+ var _setAction6 = _buildSetAttributeAction(value.value, oldVariant, newVariant.attributes[index], sameForAllAttributeNames);
1566
+ if (_setAction6) actions.push(_setAction6);
1505
1567
  }
1506
1568
  }
1507
1569
  });
@@ -1607,10 +1669,10 @@ function _buildVariantAssetsActions(diffAssets, oldVariant, newVariant) {
1607
1669
  * SYNC FUNCTIONS
1608
1670
  */
1609
1671
 
1610
- function actionsMapBase$i(diff, oldObj, newObj) {
1672
+ function actionsMapBase$l(diff, oldObj, newObj) {
1611
1673
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1612
1674
  return buildBaseAttributesActions({
1613
- actions: baseActionsList$i,
1675
+ actions: baseActionsList$l,
1614
1676
  diff: diff,
1615
1677
  oldObj: oldObj,
1616
1678
  newObj: newObj,
@@ -1716,6 +1778,9 @@ function actionsMapAssets(diff, oldObj, newObj, variantHashMap) {
1716
1778
  });
1717
1779
  return allAssetsActions;
1718
1780
  }
1781
+ function actionsMapProductAttributes(diffedProductData, oldProductData, newProductData) {
1782
+ return _buildProductAttributesActions(diffedProductData.attributes, oldProductData, newProductData);
1783
+ }
1719
1784
  function actionsMapAttributes$1(diff, oldObj, newObj) {
1720
1785
  var sameForAllAttributeNames = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
1721
1786
  var variantHashMap = arguments.length > 4 ? arguments[4] : undefined;
@@ -1836,6 +1901,9 @@ function createProductMapActions(mapActionGroup, syncActionConfig) {
1836
1901
  var publish = newObj.publish,
1837
1902
  staged = newObj.staged;
1838
1903
  var variantHashMap = findMatchingPairs(diff.variants, oldObj.variants, newObj.variants);
1904
+ allActions.push(mapActionGroup('productAttributes', function () {
1905
+ return actionsMapProductAttributes(diff, oldObj, newObj);
1906
+ }));
1839
1907
  allActions.push(mapActionGroup('attributes', function () {
1840
1908
  return actionsMapAttributes$1(diff, oldObj, newObj, sameForAllAttributeNames || [], variantHashMap);
1841
1909
  }));
@@ -1847,7 +1915,7 @@ function createProductMapActions(mapActionGroup, syncActionConfig) {
1847
1915
  return actionsMapRemoveVariants(diff, oldObj, newObj);
1848
1916
  }));
1849
1917
  allActions.push(mapActionGroup('base', function () {
1850
- return actionsMapBase$i(diff, oldObj, newObj, syncActionConfig);
1918
+ return actionsMapBase$l(diff, oldObj, newObj, syncActionConfig);
1851
1919
  }));
1852
1920
  allActions.push(mapActionGroup('meta', function () {
1853
1921
  return actionsMapMeta(diff, oldObj, newObj);
@@ -1914,7 +1982,7 @@ var isAddAction = function isAddAction(key, resource) {
1914
1982
  var isRemoveAction = function isRemoveAction(key, resource) {
1915
1983
  return REGEX_UNDERSCORE_NUMBER$1.test(key) && Number(resource[2]) === 0;
1916
1984
  };
1917
- var baseActionsList$h = [{
1985
+ var baseActionsList$k = [{
1918
1986
  action: 'changeOrderState',
1919
1987
  key: 'orderState'
1920
1988
  }, {
@@ -1929,10 +1997,10 @@ var baseActionsList$h = [{
1929
1997
  * SYNC FUNCTIONS
1930
1998
  */
1931
1999
 
1932
- function actionsMapBase$h(diff, oldObj, newObj) {
2000
+ function actionsMapBase$k(diff, oldObj, newObj) {
1933
2001
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1934
2002
  return buildBaseAttributesActions({
1935
- actions: baseActionsList$h,
2003
+ actions: baseActionsList$k,
1936
2004
  diff: diff,
1937
2005
  oldObj: oldObj,
1938
2006
  newObj: newObj,
@@ -2082,7 +2150,7 @@ function createOrderMapActions(mapActionGroup, syncActionConfig) {
2082
2150
  deliveryHashMap = findMatchingPairs(diff.shippingInfo.deliveries, oldObj.shippingInfo.deliveries, newObj.shippingInfo.deliveries);
2083
2151
  }
2084
2152
  allActions.push(mapActionGroup('base', function () {
2085
- return actionsMapBase$h(diff, oldObj, newObj, syncActionConfig);
2153
+ return actionsMapBase$k(diff, oldObj, newObj, syncActionConfig);
2086
2154
  }));
2087
2155
  allActions.push(mapActionGroup('deliveries', function () {
2088
2156
  return actionsMapDeliveries(diff, oldObj, newObj);
@@ -2122,7 +2190,7 @@ var orders = (function (actionGroupList, syncActionConfig) {
2122
2190
  };
2123
2191
  });
2124
2192
 
2125
- var baseActionsList$g = [{
2193
+ var baseActionsList$j = [{
2126
2194
  action: 'setKey',
2127
2195
  key: 'key'
2128
2196
  }, {
@@ -2132,10 +2200,10 @@ var baseActionsList$g = [{
2132
2200
  action: 'transitionState',
2133
2201
  key: 'state'
2134
2202
  }];
2135
- function actionsMapBase$g(diff, oldObj, newObj) {
2203
+ function actionsMapBase$j(diff, oldObj, newObj) {
2136
2204
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2137
2205
  return buildBaseAttributesActions({
2138
- actions: baseActionsList$g,
2206
+ actions: baseActionsList$j,
2139
2207
  diff: diff,
2140
2208
  oldObj: oldObj,
2141
2209
  newObj: newObj,
@@ -2149,7 +2217,7 @@ function createRecurringOrdersMapActions(mapActionGroup, syncActionConfig) {
2149
2217
  return function doMapActions(diff, newObj, oldObj) {
2150
2218
  var allActions = [];
2151
2219
  allActions.push(mapActionGroup('base', function () {
2152
- return actionsMapBase$g(diff, oldObj, newObj, syncActionConfig);
2220
+ return actionsMapBase$j(diff, oldObj, newObj, syncActionConfig);
2153
2221
  }));
2154
2222
  allActions.push(mapActionGroup('custom', function () {
2155
2223
  return actionsMapCustom(diff, newObj, oldObj);
@@ -2166,7 +2234,7 @@ var recurringOrders = (function (actionGroupList, syncActionConfig) {
2166
2234
  };
2167
2235
  });
2168
2236
 
2169
- var baseActionsList$f = [{
2237
+ var baseActionsList$i = [{
2170
2238
  action: 'changeIsActive',
2171
2239
  key: 'isActive'
2172
2240
  }, {
@@ -2194,10 +2262,10 @@ var baseActionsList$f = [{
2194
2262
  action: 'setKey',
2195
2263
  key: 'key'
2196
2264
  }];
2197
- function actionsMapBase$f(diff, oldObj, newObj) {
2265
+ function actionsMapBase$i(diff, oldObj, newObj) {
2198
2266
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2199
2267
  return buildBaseAttributesActions({
2200
- actions: baseActionsList$f,
2268
+ actions: baseActionsList$i,
2201
2269
  diff: diff,
2202
2270
  oldObj: oldObj,
2203
2271
  newObj: newObj,
@@ -2235,7 +2303,7 @@ function createProductDiscountsMapActions(mapActionGroup, syncActionConfig) {
2235
2303
  return function doMapActions(diff, newObj, oldObj) {
2236
2304
  var allActions = [];
2237
2305
  allActions.push(mapActionGroup('base', function () {
2238
- return actionsMapBase$f(diff, oldObj, newObj, syncActionConfig);
2306
+ return actionsMapBase$i(diff, oldObj, newObj, syncActionConfig);
2239
2307
  }));
2240
2308
  return combineValidityActions(flatten(allActions));
2241
2309
  };
@@ -2250,7 +2318,7 @@ var productDiscounts = (function (actionGroupList) {
2250
2318
  };
2251
2319
  });
2252
2320
 
2253
- var baseActionsList$e = [{
2321
+ var baseActionsList$h = [{
2254
2322
  action: 'changeIsActive',
2255
2323
  key: 'isActive'
2256
2324
  }, {
@@ -2284,10 +2352,10 @@ var baseActionsList$e = [{
2284
2352
  action: 'changeGroups',
2285
2353
  key: 'groups'
2286
2354
  }];
2287
- function actionsMapBase$e(diff, oldObj, newObj) {
2355
+ function actionsMapBase$h(diff, oldObj, newObj) {
2288
2356
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2289
2357
  return buildBaseAttributesActions({
2290
- actions: baseActionsList$e,
2358
+ actions: baseActionsList$h,
2291
2359
  diff: diff,
2292
2360
  oldObj: oldObj,
2293
2361
  newObj: newObj,
@@ -2301,7 +2369,7 @@ function createDiscountCodesMapActions(mapActionGroup, syncActionConfig) {
2301
2369
  return function doMapActions(diff, newObj, oldObj) {
2302
2370
  var allActions = [];
2303
2371
  allActions.push(mapActionGroup('base', function () {
2304
- return actionsMapBase$e(diff, oldObj, newObj, syncActionConfig);
2372
+ return actionsMapBase$h(diff, oldObj, newObj, syncActionConfig);
2305
2373
  }));
2306
2374
  allActions.push(mapActionGroup('custom', function () {
2307
2375
  return actionsMapCustom(diff, newObj, oldObj);
@@ -2330,17 +2398,17 @@ var discountCodes = (function (actionGroupList) {
2330
2398
  };
2331
2399
  });
2332
2400
 
2333
- var baseActionsList$d = [{
2401
+ var baseActionsList$g = [{
2334
2402
  action: 'changeName',
2335
2403
  key: 'name'
2336
2404
  }, {
2337
2405
  action: 'setKey',
2338
2406
  key: 'key'
2339
2407
  }];
2340
- function actionsMapBase$d(diff, oldObj, newObj) {
2408
+ function actionsMapBase$g(diff, oldObj, newObj) {
2341
2409
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2342
2410
  return buildBaseAttributesActions({
2343
- actions: baseActionsList$d,
2411
+ actions: baseActionsList$g,
2344
2412
  diff: diff,
2345
2413
  oldObj: oldObj,
2346
2414
  newObj: newObj,
@@ -2354,7 +2422,7 @@ function createCustomerGroupMapActions(mapActionGroup, syncActionConfig) {
2354
2422
  return function doMapActions(diff, newObj, oldObj) {
2355
2423
  var allActions = [];
2356
2424
  allActions.push(mapActionGroup('base', function () {
2357
- return actionsMapBase$d(diff, oldObj, newObj, syncActionConfig);
2425
+ return actionsMapBase$g(diff, oldObj, newObj, syncActionConfig);
2358
2426
  }));
2359
2427
  allActions.push(mapActionGroup('custom', function () {
2360
2428
  return actionsMapCustom(diff, newObj, oldObj);
@@ -2372,7 +2440,7 @@ var customerGroup = (function (actionGroupList) {
2372
2440
  };
2373
2441
  });
2374
2442
 
2375
- var baseActionsList$c = [{
2443
+ var baseActionsList$f = [{
2376
2444
  action: 'changeIsActive',
2377
2445
  key: 'isActive'
2378
2446
  }, {
@@ -2409,10 +2477,10 @@ var baseActionsList$c = [{
2409
2477
  action: 'setKey',
2410
2478
  key: 'key'
2411
2479
  }];
2412
- function actionsMapBase$c(diff, oldObj, newObj) {
2480
+ function actionsMapBase$f(diff, oldObj, newObj) {
2413
2481
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2414
2482
  return buildBaseAttributesActions({
2415
- actions: baseActionsList$c,
2483
+ actions: baseActionsList$f,
2416
2484
  diff: diff,
2417
2485
  oldObj: oldObj,
2418
2486
  newObj: newObj,
@@ -2426,7 +2494,7 @@ function createCartDiscountsMapActions(mapActionGroup, syncActionConfig) {
2426
2494
  return function doMapActions(diff, newObj, oldObj) {
2427
2495
  var allActions = [];
2428
2496
  allActions.push(mapActionGroup('base', function () {
2429
- return actionsMapBase$c(diff, oldObj, newObj, syncActionConfig);
2497
+ return actionsMapBase$f(diff, oldObj, newObj, syncActionConfig);
2430
2498
  }));
2431
2499
  allActions.push(mapActionGroup('custom', function () {
2432
2500
  return actionsMapCustom(diff, newObj, oldObj);
@@ -2451,7 +2519,7 @@ function removeTypename(obj) {
2451
2519
  return objWithoutTypename;
2452
2520
  }
2453
2521
 
2454
- var baseActionsList$b = [{
2522
+ var baseActionsList$e = [{
2455
2523
  action: 'changeName',
2456
2524
  key: 'name'
2457
2525
  }, {
@@ -2461,10 +2529,10 @@ var baseActionsList$b = [{
2461
2529
  action: 'setDescription',
2462
2530
  key: 'description'
2463
2531
  }];
2464
- function actionsMapBase$b(diff, oldObj, newObj) {
2532
+ function actionsMapBase$e(diff, oldObj, newObj) {
2465
2533
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2466
2534
  return buildBaseAttributesActions({
2467
- actions: baseActionsList$b,
2535
+ actions: baseActionsList$e,
2468
2536
  diff: diff,
2469
2537
  oldObj: oldObj,
2470
2538
  newObj: newObj,
@@ -2508,7 +2576,7 @@ function createTaxCategoriesMapActions(mapActionGroup, syncActionConfig) {
2508
2576
  return function doMapActions(diff, newObj, oldObj) {
2509
2577
  var allActions = [];
2510
2578
  allActions.push(mapActionGroup('base', function () {
2511
- return actionsMapBase$b(diff, oldObj, newObj, syncActionConfig);
2579
+ return actionsMapBase$e(diff, oldObj, newObj, syncActionConfig);
2512
2580
  }));
2513
2581
  allActions.push(mapActionGroup('rates', function () {
2514
2582
  return actionsMapRates(diff, oldObj, newObj);
@@ -2536,7 +2604,7 @@ var taxCategories = (function (actionGroupList, syncActionConfig) {
2536
2604
  };
2537
2605
  });
2538
2606
 
2539
- var baseActionsList$a = [{
2607
+ var baseActionsList$d = [{
2540
2608
  action: 'changeName',
2541
2609
  key: 'name'
2542
2610
  }, {
@@ -2551,10 +2619,10 @@ var hasLocation = function hasLocation(locations, otherLocation) {
2551
2619
  return location.country === otherLocation.country;
2552
2620
  });
2553
2621
  };
2554
- function actionsMapBase$a(diff, oldObj, newObj) {
2622
+ function actionsMapBase$d(diff, oldObj, newObj) {
2555
2623
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2556
2624
  return buildBaseAttributesActions({
2557
- actions: baseActionsList$a,
2625
+ actions: baseActionsList$d,
2558
2626
  diff: diff,
2559
2627
  oldObj: oldObj,
2560
2628
  newObj: newObj,
@@ -2602,7 +2670,7 @@ function createZonesMapActions(mapActionGroup, syncActionConfig) {
2602
2670
  return function doMapActions(diff, newObj, oldObj) {
2603
2671
  var allActions = [];
2604
2672
  allActions.push(mapActionGroup('base', function () {
2605
- return actionsMapBase$a(diff, oldObj, newObj, syncActionConfig);
2673
+ return actionsMapBase$d(diff, oldObj, newObj, syncActionConfig);
2606
2674
  }));
2607
2675
  allActions.push(flatten(mapActionGroup('locations', function () {
2608
2676
  return actionsMapLocations(diff, oldObj, newObj);
@@ -2630,7 +2698,7 @@ var zones = (function (actionGroupList, syncActionConfig) {
2630
2698
  };
2631
2699
  });
2632
2700
 
2633
- var baseActionsList$9 = [{
2701
+ var baseActionsList$c = [{
2634
2702
  action: 'setKey',
2635
2703
  key: 'key'
2636
2704
  }, {
@@ -2658,10 +2726,10 @@ var baseActionsList$9 = [{
2658
2726
  action: 'changeActive',
2659
2727
  key: 'active'
2660
2728
  }];
2661
- function actionsMapBase$9(diff, oldObj, newObj) {
2729
+ function actionsMapBase$c(diff, oldObj, newObj) {
2662
2730
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2663
2731
  return buildBaseAttributesActions({
2664
- actions: baseActionsList$9,
2732
+ actions: baseActionsList$c,
2665
2733
  diff: diff,
2666
2734
  oldObj: oldObj,
2667
2735
  newObj: newObj,
@@ -2738,7 +2806,7 @@ function createShippingMethodsMapActions(mapActionGroup, syncActionConfig) {
2738
2806
  return function doMapActions(diff, newObj, oldObj) {
2739
2807
  var allActions = [];
2740
2808
  allActions.push(mapActionGroup('base', function () {
2741
- return actionsMapBase$9(diff, oldObj, newObj, syncActionConfig);
2809
+ return actionsMapBase$c(diff, oldObj, newObj, syncActionConfig);
2742
2810
  }));
2743
2811
  allActions.push(flatten(mapActionGroup('zoneRates', function () {
2744
2812
  return actionsMapZoneRates(diff, oldObj, newObj);
@@ -2769,7 +2837,7 @@ var shippingMethods = (function (actionGroupList, syncActionConfig) {
2769
2837
  };
2770
2838
  });
2771
2839
 
2772
- var baseActionsList$8 = [{
2840
+ var baseActionsList$b = [{
2773
2841
  action: 'changeName',
2774
2842
  key: 'name'
2775
2843
  }, {
@@ -2779,7 +2847,7 @@ var baseActionsList$8 = [{
2779
2847
  action: 'changeDescription',
2780
2848
  key: 'description'
2781
2849
  }];
2782
- function actionsMapBase$8(diff, previous, next) {
2850
+ function actionsMapBase$b(diff, previous, next) {
2783
2851
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2784
2852
  // when `diff` is undefined, then the underlying `buildActions` has returned any diff
2785
2853
  // which given in product-types would mean that `buildActions` has run with `nestedValuesChanges` applied
@@ -2787,7 +2855,7 @@ function actionsMapBase$8(diff, previous, next) {
2787
2855
  if (!diff) return [];
2788
2856
  return buildBaseAttributesActions({
2789
2857
  diff: diff,
2790
- actions: baseActionsList$8,
2858
+ actions: baseActionsList$b,
2791
2859
  oldObj: previous,
2792
2860
  newObj: next,
2793
2861
  shouldOmitEmptyString: config.shouldOmitEmptyString,
@@ -3006,7 +3074,7 @@ function createProductTypeMapActions(mapActionGroup, syncActionConfig) {
3006
3074
  // we support only base fields for the product type,
3007
3075
  // for attributes, applying hints would be recommended
3008
3076
  mapActionGroup('base', function () {
3009
- return actionsMapBase$8(diff, previous, next, syncActionConfig);
3077
+ return actionsMapBase$b(diff, previous, next, syncActionConfig);
3010
3078
  }), actionsMapForHints(options.nestedValuesChanges, previous, next)]);
3011
3079
  };
3012
3080
  }
@@ -3022,7 +3090,7 @@ var productTypes = (function (actionGroupList, syncActionConfig) {
3022
3090
  };
3023
3091
  });
3024
3092
 
3025
- var baseActionsList$7 = [{
3093
+ var baseActionsList$a = [{
3026
3094
  action: 'changeKey',
3027
3095
  key: 'key'
3028
3096
  }, {
@@ -3041,10 +3109,10 @@ var baseActionsList$7 = [{
3041
3109
  action: 'setTransitions',
3042
3110
  key: 'transitions'
3043
3111
  }];
3044
- function actionsMapBase$7(diff, oldObj, newObj) {
3112
+ function actionsMapBase$a(diff, oldObj, newObj) {
3045
3113
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3046
3114
  return buildBaseAttributesActions({
3047
- actions: baseActionsList$7,
3115
+ actions: baseActionsList$a,
3048
3116
  diff: diff,
3049
3117
  oldObj: oldObj,
3050
3118
  newObj: newObj,
@@ -3093,7 +3161,7 @@ function createStatesMapActions(mapActionGroup, syncActionConfig) {
3093
3161
  var baseActions = [];
3094
3162
  var roleActions = [];
3095
3163
  baseActions.push(mapActionGroup('base', function () {
3096
- return actionsMapBase$7(diff, oldObj, newObj, syncActionConfig);
3164
+ return actionsMapBase$a(diff, oldObj, newObj, syncActionConfig);
3097
3165
  }));
3098
3166
  roleActions.push(mapActionGroup('roles', function () {
3099
3167
  return actionsMapRoles(diff, oldObj, newObj);
@@ -3110,7 +3178,7 @@ var states = (function (actionGroupList, syncActionConfig) {
3110
3178
  };
3111
3179
  });
3112
3180
 
3113
- var baseActionsList$6 = [{
3181
+ var baseActionsList$9 = [{
3114
3182
  action: 'changeKey',
3115
3183
  key: 'key'
3116
3184
  }, {
@@ -3129,10 +3197,10 @@ var baseActionsList$6 = [{
3129
3197
  action: 'setRoles',
3130
3198
  key: 'roles'
3131
3199
  }];
3132
- function actionsMapBase$6(diff, oldObj, newObj) {
3200
+ function actionsMapBase$9(diff, oldObj, newObj) {
3133
3201
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3134
3202
  return buildBaseAttributesActions({
3135
- actions: baseActionsList$6,
3203
+ actions: baseActionsList$9,
3136
3204
  diff: diff,
3137
3205
  oldObj: oldObj,
3138
3206
  newObj: newObj,
@@ -3146,7 +3214,7 @@ function createChannelsMapActions$1(mapActionGroup, syncActionConfig) {
3146
3214
  return function doMapActions(diff, newObj, oldObj) {
3147
3215
  var allActions = [];
3148
3216
  allActions.push(mapActionGroup('base', function () {
3149
- return actionsMapBase$6(diff, oldObj, newObj, syncActionConfig);
3217
+ return actionsMapBase$9(diff, oldObj, newObj, syncActionConfig);
3150
3218
  }));
3151
3219
  allActions.push(mapActionGroup('custom', function () {
3152
3220
  return actionsMapCustom(diff, newObj, oldObj);
@@ -3172,7 +3240,7 @@ var getIsChangedOperation = function getIsChangedOperation(key) {
3172
3240
  var getIsRemovedOperation = function getIsRemovedOperation(key) {
3173
3241
  return REGEX_UNDERSCORE_NUMBER.test(key);
3174
3242
  };
3175
- var baseActionsList$5 = [{
3243
+ var baseActionsList$8 = [{
3176
3244
  action: 'changeKey',
3177
3245
  key: 'key'
3178
3246
  }, {
@@ -3182,10 +3250,10 @@ var baseActionsList$5 = [{
3182
3250
  action: 'setDescription',
3183
3251
  key: 'description'
3184
3252
  }];
3185
- function actionsMapBase$5(diff, oldObj, newObj) {
3253
+ function actionsMapBase$8(diff, oldObj, newObj) {
3186
3254
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3187
3255
  return buildBaseAttributesActions({
3188
- actions: baseActionsList$5,
3256
+ actions: baseActionsList$8,
3189
3257
  diff: diff,
3190
3258
  oldObj: oldObj,
3191
3259
  newObj: newObj,
@@ -3327,7 +3395,7 @@ function createTypeMapActions(mapActionGroup, syncActionConfig) {
3327
3395
  return function doMapActions(diff, next, previous) {
3328
3396
  var allActions = [];
3329
3397
  allActions.push(mapActionGroup('base', function () {
3330
- return actionsMapBase$5(diff, previous, next, syncActionConfig);
3398
+ return actionsMapBase$8(diff, previous, next, syncActionConfig);
3331
3399
  }), mapActionGroup('fieldDefinitions', function () {
3332
3400
  return actionsMapFieldDefinitions(diff.fieldDefinitions, previous.fieldDefinitions, next.fieldDefinitions, findMatchingPairs(diff.fieldDefinitions, previous.fieldDefinitions, next.fieldDefinitions, 'name'));
3333
3401
  }));
@@ -3343,7 +3411,7 @@ var types = (function (actionGroupList, syncActionConfig) {
3343
3411
  };
3344
3412
  });
3345
3413
 
3346
- var baseActionsList$4 = [{
3414
+ var baseActionsList$7 = [{
3347
3415
  action: 'changeName',
3348
3416
  key: 'name'
3349
3417
  }, {
@@ -3379,10 +3447,10 @@ var businessUnitSearchActionsList = [{
3379
3447
  action: 'changeBusinessUnitSearchStatus',
3380
3448
  key: 'status'
3381
3449
  }];
3382
- function actionsMapBase$4(diff, oldObj, newObj) {
3450
+ function actionsMapBase$7(diff, oldObj, newObj) {
3383
3451
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3384
3452
  return buildBaseAttributesActions({
3385
- actions: baseActionsList$4,
3453
+ actions: baseActionsList$7,
3386
3454
  diff: diff,
3387
3455
  oldObj: oldObj,
3388
3456
  newObj: newObj,
@@ -3440,7 +3508,7 @@ function createChannelsMapActions(mapActionGroup, syncActionConfig) {
3440
3508
  return function doMapActions(diff, newObj, oldObj) {
3441
3509
  var allActions = [];
3442
3510
  allActions.push(mapActionGroup('base', function () {
3443
- return actionsMapBase$4(diff, oldObj, newObj, syncActionConfig);
3511
+ return actionsMapBase$7(diff, oldObj, newObj, syncActionConfig);
3444
3512
  }));
3445
3513
  allActions.push(mapActionGroup('businessUnit', function () {
3446
3514
  return actionsMapBusinessUnit(diff, oldObj, newObj);
@@ -3461,7 +3529,7 @@ var projects = (function (actionGroupList) {
3461
3529
  };
3462
3530
  });
3463
3531
 
3464
- var baseActionsList$3 = [{
3532
+ var baseActionsList$6 = [{
3465
3533
  action: 'setName',
3466
3534
  key: 'name'
3467
3535
  }, {
@@ -3474,10 +3542,10 @@ var baseActionsList$3 = [{
3474
3542
  action: 'setSupplyChannels',
3475
3543
  key: 'supplyChannels'
3476
3544
  }];
3477
- function actionsMapBase$3(diff, oldObj, newObj) {
3545
+ function actionsMapBase$6(diff, oldObj, newObj) {
3478
3546
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3479
3547
  return buildBaseAttributesActions({
3480
- actions: baseActionsList$3,
3548
+ actions: baseActionsList$6,
3481
3549
  diff: diff,
3482
3550
  oldObj: oldObj,
3483
3551
  newObj: newObj,
@@ -3491,7 +3559,7 @@ function createStoresMapActions(mapActionGroup) {
3491
3559
  return function doMapActions(diff, next, previous) {
3492
3560
  var allActions = [];
3493
3561
  allActions.push(mapActionGroup('base', function () {
3494
- return actionsMapBase$3(diff, previous, next);
3562
+ return actionsMapBase$6(diff, previous, next);
3495
3563
  }));
3496
3564
  allActions.push(mapActionGroup('custom', function () {
3497
3565
  return actionsMapCustom(diff, next, previous);
@@ -3510,17 +3578,17 @@ var stores = (function (actionGroupList) {
3510
3578
  };
3511
3579
  });
3512
3580
 
3513
- var baseActionsList$2 = [{
3581
+ var baseActionsList$5 = [{
3514
3582
  action: 'changeName',
3515
3583
  key: 'name'
3516
3584
  }, {
3517
3585
  action: 'setKey',
3518
3586
  key: 'key'
3519
3587
  }];
3520
- function actionsMapBase$2(diff, oldObj, newObj) {
3588
+ function actionsMapBase$5(diff, oldObj, newObj) {
3521
3589
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3522
3590
  return buildBaseAttributesActions({
3523
- actions: baseActionsList$2,
3591
+ actions: baseActionsList$5,
3524
3592
  diff: diff,
3525
3593
  oldObj: oldObj,
3526
3594
  newObj: newObj,
@@ -3534,7 +3602,7 @@ function createProductSelectionsMapActions(mapActionGroup) {
3534
3602
  return function doMapActions(diff, next, previous) {
3535
3603
  var allActions = [];
3536
3604
  allActions.push(mapActionGroup('base', function () {
3537
- return actionsMapBase$2(diff, previous, next);
3605
+ return actionsMapBase$5(diff, previous, next);
3538
3606
  }));
3539
3607
  allActions.push(mapActionGroup('custom', function () {
3540
3608
  return actionsMapCustom(diff, next, previous);
@@ -3552,7 +3620,7 @@ var productSelections = (function (actionGroupList) {
3552
3620
  };
3553
3621
  });
3554
3622
 
3555
- var baseActionsList$1 = [{
3623
+ var baseActionsList$4 = [{
3556
3624
  action: 'changeValue',
3557
3625
  key: 'value'
3558
3626
  }, {
@@ -3576,10 +3644,10 @@ var baseActionsList$1 = [{
3576
3644
  action: 'changeActive',
3577
3645
  key: 'active'
3578
3646
  }];
3579
- function actionsMapBase$1(diff, oldObj, newObj) {
3647
+ function actionsMapBase$4(diff, oldObj, newObj) {
3580
3648
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3581
3649
  return buildBaseAttributesActions({
3582
- actions: baseActionsList$1,
3650
+ actions: baseActionsList$4,
3583
3651
  diff: diff,
3584
3652
  oldObj: oldObj,
3585
3653
  newObj: newObj,
@@ -3592,7 +3660,7 @@ function actionsMapBase$1(diff, oldObj, newObj) {
3592
3660
  function createPriceMapActions(mapActionGroup, syncActionConfig) {
3593
3661
  return function doMapActions(diff, newObj, oldObj) {
3594
3662
  var baseActions = mapActionGroup('base', function () {
3595
- return actionsMapBase$1(diff, oldObj, newObj, syncActionConfig);
3663
+ return actionsMapBase$4(diff, oldObj, newObj, syncActionConfig);
3596
3664
  });
3597
3665
  var customActions = mapActionGroup('custom', function () {
3598
3666
  return actionsMapCustom(diff, newObj, oldObj);
@@ -3614,7 +3682,7 @@ var hasAttribute = function hasAttribute(attributes, newValue) {
3614
3682
  return attribute.key === newValue.key;
3615
3683
  });
3616
3684
  };
3617
- var baseActionsList = [{
3685
+ var baseActionsList$3 = [{
3618
3686
  action: 'changeName',
3619
3687
  key: 'name'
3620
3688
  }, {
@@ -3624,10 +3692,10 @@ var baseActionsList = [{
3624
3692
  action: 'setDescription',
3625
3693
  key: 'description'
3626
3694
  }];
3627
- function actionsMapBase(diff, oldObj, newObj) {
3695
+ function actionsMapBase$3(diff, oldObj, newObj) {
3628
3696
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3629
3697
  return buildBaseAttributesActions({
3630
- actions: baseActionsList,
3698
+ actions: baseActionsList$3,
3631
3699
  diff: diff,
3632
3700
  oldObj: oldObj,
3633
3701
  newObj: newObj,
@@ -3672,7 +3740,7 @@ function createAttributeGroupsMapActions(mapActionGroup, syncActionConfig) {
3672
3740
  return function doMapActions(diff, newObj, oldObj) {
3673
3741
  var allActions = [];
3674
3742
  allActions.push(mapActionGroup('base', function () {
3675
- return actionsMapBase(diff, oldObj, newObj, syncActionConfig);
3743
+ return actionsMapBase$3(diff, oldObj, newObj, syncActionConfig);
3676
3744
  }));
3677
3745
  allActions.push(flatten(mapActionGroup('attributes', function () {
3678
3746
  return actionsMapAttributes(diff, oldObj, newObj);
@@ -3689,4 +3757,182 @@ var attributeGroups = (function (actionGroupList, syncActionConfig) {
3689
3757
  };
3690
3758
  });
3691
3759
 
3692
- export { attributeGroups as createSyncAttributeGroups, cartDiscounts as createSyncCartDiscounts, categories as createSyncCategories, channels as createSyncChannels, customerGroup as createSyncCustomerGroup, customers as createSyncCustomers, discountCodes as createSyncDiscountCodes, inventories as createSyncInventories, orders as createSyncOrders, productDiscounts as createSyncProductDiscounts, productSelections as createSyncProductSelections, productTypes as createSyncProductTypes, products as createSyncProducts, projects as createSyncProjects, recurringOrders as createSyncRecurringOrders, shippingMethods as createSyncShippingMethods, prices as createSyncStandalonePrices, states as createSyncStates, stores as createSyncStores, taxCategories as createSyncTaxCategories, types as createSyncTypes, zones as createSyncZones };
3760
+ var baseActionsList$2 = [{
3761
+ action: 'setKey',
3762
+ key: 'key'
3763
+ }, {
3764
+ action: 'changeTriggers',
3765
+ key: 'triggers'
3766
+ }, {
3767
+ action: 'setTimeoutInMs',
3768
+ key: 'timeoutInMs'
3769
+ }, {
3770
+ action: 'changeDestination',
3771
+ key: 'destination'
3772
+ }];
3773
+ var actionsMapBase$2 = function actionsMapBase(diff, oldObj, newObj, config) {
3774
+ return buildBaseAttributesActions({
3775
+ actions: baseActionsList$2,
3776
+ diff: diff,
3777
+ oldObj: oldObj,
3778
+ newObj: newObj,
3779
+ shouldOmitEmptyString: config === null || config === void 0 ? void 0 : config.shouldOmitEmptyString
3780
+ });
3781
+ };
3782
+
3783
+ var createApiExtensionsMapActions = function createApiExtensionsMapActions(mapActionGroup, syncActionConfig) {
3784
+ return function doMapActions(diff, newObj, oldObj) {
3785
+ var allActions = [];
3786
+ allActions.push(mapActionGroup('base', function () {
3787
+ return actionsMapBase$2(diff, oldObj, newObj, syncActionConfig);
3788
+ }));
3789
+ return flatten(allActions);
3790
+ };
3791
+ };
3792
+ var apiExtensions = (function (actionGroupList, syncActionConfig) {
3793
+ var mapActionGroup = createMapActionGroup(actionGroupList);
3794
+ var doMapActions = createApiExtensionsMapActions(mapActionGroup, syncActionConfig);
3795
+ var buildActions = createBuildActions(diff, doMapActions);
3796
+ return {
3797
+ buildActions: buildActions
3798
+ };
3799
+ });
3800
+
3801
+ var baseActionsList$1 = [{
3802
+ action: 'setStores',
3803
+ key: 'stores'
3804
+ }, {
3805
+ action: 'changeAssociateMode',
3806
+ key: 'associateMode'
3807
+ }, {
3808
+ action: 'changeApprovalRuleMode',
3809
+ key: 'approvalRuleMode'
3810
+ }, {
3811
+ action: 'changeName',
3812
+ key: 'name'
3813
+ }, {
3814
+ action: 'changeParentUnit',
3815
+ key: 'parentUnit'
3816
+ }, {
3817
+ action: 'changeStatus',
3818
+ key: 'status'
3819
+ }, {
3820
+ action: 'setContactEmail',
3821
+ key: 'contactEmail'
3822
+ }, {
3823
+ action: 'setStoreMode',
3824
+ key: 'storeMode'
3825
+ }];
3826
+ var actionsMapAssociates = function actionsMapAssociates(diff, oldObj, newObj) {
3827
+ var handler = createBuildArrayActions('associates', _defineProperty(_defineProperty(_defineProperty({}, ADD_ACTIONS, function (newObject) {
3828
+ return {
3829
+ action: 'addAssociate',
3830
+ associate: newObject
3831
+ };
3832
+ }), REMOVE_ACTIONS, function (objectToRemove) {
3833
+ return {
3834
+ action: 'removeAssociate',
3835
+ customer: {
3836
+ typeId: 'customer',
3837
+ id: objectToRemove.customer.id
3838
+ }
3839
+ };
3840
+ }), CHANGE_ACTIONS, function (oldObject, updatedObject) {
3841
+ return {
3842
+ action: 'changeAssociate',
3843
+ associate: updatedObject
3844
+ };
3845
+ }));
3846
+ return handler(diff, oldObj, newObj);
3847
+ };
3848
+ var actionsMapBase$1 = function actionsMapBase(diff, oldObj, newObj, config) {
3849
+ return buildBaseAttributesActions({
3850
+ actions: baseActionsList$1,
3851
+ diff: diff,
3852
+ oldObj: oldObj,
3853
+ newObj: newObj,
3854
+ shouldOmitEmptyString: config === null || config === void 0 ? void 0 : config.shouldOmitEmptyString
3855
+ });
3856
+ };
3857
+
3858
+ var createCustomerMapActions = function createCustomerMapActions(mapActionGroup, syncActionConfig) {
3859
+ return function doMapActions(diff, newObj, oldObj) {
3860
+ var allActions = [];
3861
+ allActions.push(mapActionGroup('base', function () {
3862
+ return actionsMapBase$1(diff, oldObj, newObj, syncActionConfig);
3863
+ }));
3864
+ allActions.push(mapActionGroup('addresses', function () {
3865
+ return actionsMapAddresses(diff, oldObj, newObj);
3866
+ }));
3867
+ allActions.push(mapActionGroup('base', function () {
3868
+ return actionsMapSetDefaultBase(diff, oldObj, newObj, syncActionConfig);
3869
+ }));
3870
+ allActions.push(mapActionGroup('billingAddressIds', function () {
3871
+ return actionsMapBillingAddresses(diff, oldObj, newObj);
3872
+ }));
3873
+ allActions.push(mapActionGroup('shippingAddressIds', function () {
3874
+ return actionsMapShippingAddresses(diff, oldObj, newObj);
3875
+ }));
3876
+ allActions.push(mapActionGroup('associates', function () {
3877
+ return actionsMapAssociates(diff, oldObj, newObj);
3878
+ }));
3879
+ allActions.push(mapActionGroup('custom', function () {
3880
+ return actionsMapCustom(diff, newObj, oldObj);
3881
+ }));
3882
+ return flatten(allActions);
3883
+ };
3884
+ };
3885
+ var businessUnits = (function (actionGroupList, syncActionConfig) {
3886
+ var mapActionGroup = createMapActionGroup(actionGroupList);
3887
+ var doMapActions = createCustomerMapActions(mapActionGroup, syncActionConfig);
3888
+ var buildActions = createBuildActions(diff, doMapActions);
3889
+ return {
3890
+ buildActions: buildActions
3891
+ };
3892
+ });
3893
+
3894
+ var baseActionsList = [{
3895
+ action: 'setKey',
3896
+ key: 'key'
3897
+ }, {
3898
+ action: 'setMessages',
3899
+ key: 'messages'
3900
+ }, {
3901
+ action: 'setChanges',
3902
+ key: 'changes'
3903
+ }, {
3904
+ action: 'changeDestination',
3905
+ key: 'destination'
3906
+ }];
3907
+ var actionsMapBase = function actionsMapBase(diff, oldObj, newObj, config) {
3908
+ return buildBaseAttributesActions({
3909
+ actions: baseActionsList,
3910
+ diff: diff,
3911
+ oldObj: oldObj,
3912
+ newObj: newObj,
3913
+ shouldOmitEmptyString: config === null || config === void 0 ? void 0 : config.shouldOmitEmptyString
3914
+ });
3915
+ };
3916
+
3917
+ var createSubscriptionsMapActions = function createSubscriptionsMapActions(mapActionGroup, syncActionConfig) {
3918
+ return function doMapActions(diff, newObj, oldObj) {
3919
+ var allActions = [];
3920
+ allActions.push(mapActionGroup('base', function () {
3921
+ return actionsMapBase(diff, oldObj, newObj, syncActionConfig);
3922
+ }));
3923
+ allActions.push(mapActionGroup('custom', function () {
3924
+ return actionsMapCustom(diff, newObj, oldObj);
3925
+ }));
3926
+ return allActions.flat();
3927
+ };
3928
+ };
3929
+ var subscriptions = (function (actionGroupList, syncActionConfig) {
3930
+ var mapActionGroup = createMapActionGroup(actionGroupList);
3931
+ var doMapActions = createSubscriptionsMapActions(mapActionGroup, syncActionConfig);
3932
+ var buildActions = createBuildActions(diff, doMapActions);
3933
+ return {
3934
+ buildActions: buildActions
3935
+ };
3936
+ });
3937
+
3938
+ export { apiExtensions as createSyncApiExtensions, attributeGroups as createSyncAttributeGroups, businessUnits as createSyncBusinessUnits, cartDiscounts as createSyncCartDiscounts, categories as createSyncCategories, channels as createSyncChannels, customerGroup as createSyncCustomerGroup, customers as createSyncCustomers, discountCodes as createSyncDiscountCodes, inventories as createSyncInventories, orders as createSyncOrders, productDiscounts as createSyncProductDiscounts, productSelections as createSyncProductSelections, productTypes as createSyncProductTypes, products as createSyncProducts, projects as createSyncProjects, recurringOrders as createSyncRecurringOrders, shippingMethods as createSyncShippingMethods, prices as createSyncStandalonePrices, states as createSyncStates, stores as createSyncStores, subscriptions as createSyncSubscriptions, taxCategories as createSyncTaxCategories, types as createSyncTypes, zones as createSyncZones };