@commercetools/sync-actions 5.13.0 → 5.15.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.
- package/CHANGELOG.md +12 -0
- package/dist/sync-actions.cjs.js +204 -83
- package/dist/sync-actions.es.js +202 -84
- package/dist/sync-actions.umd.js +206 -87
- package/dist/sync-actions.umd.min.js +1 -1
- package/package.json +4 -2
package/dist/sync-actions.es.js
CHANGED
|
@@ -3,6 +3,8 @@ import isEqual from 'lodash.isequal';
|
|
|
3
3
|
import isNil from 'lodash.isnil';
|
|
4
4
|
import forEach from 'lodash.foreach';
|
|
5
5
|
import uniqWith from 'lodash.uniqwith';
|
|
6
|
+
import intersection from 'lodash.intersection';
|
|
7
|
+
import without from 'lodash.without';
|
|
6
8
|
import sortBy from 'lodash.sortby';
|
|
7
9
|
|
|
8
10
|
function ownKeys(object, enumerableOnly) {
|
|
@@ -672,7 +674,7 @@ function buildReferenceActions(_ref4) {
|
|
|
672
674
|
});
|
|
673
675
|
}
|
|
674
676
|
|
|
675
|
-
var baseActionsList$
|
|
677
|
+
var baseActionsList$k = [{
|
|
676
678
|
action: 'changeName',
|
|
677
679
|
key: 'name'
|
|
678
680
|
}, {
|
|
@@ -709,10 +711,10 @@ var referenceActionsList$3 = [{
|
|
|
709
711
|
* SYNC FUNCTIONS
|
|
710
712
|
*/
|
|
711
713
|
|
|
712
|
-
function actionsMapBase$
|
|
714
|
+
function actionsMapBase$k(diff, oldObj, newObj) {
|
|
713
715
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
714
716
|
return buildBaseAttributesActions({
|
|
715
|
-
actions: baseActionsList$
|
|
717
|
+
actions: baseActionsList$k,
|
|
716
718
|
diff: diff,
|
|
717
719
|
oldObj: oldObj,
|
|
718
720
|
newObj: newObj,
|
|
@@ -820,7 +822,7 @@ function createCategoryMapActions(mapActionGroup, syncActionConfig) {
|
|
|
820
822
|
return function doMapActions(diff, newObj, oldObj) {
|
|
821
823
|
var allActions = [];
|
|
822
824
|
allActions.push(mapActionGroup('base', function () {
|
|
823
|
-
return actionsMapBase$
|
|
825
|
+
return actionsMapBase$k(diff, oldObj, newObj, syncActionConfig);
|
|
824
826
|
}));
|
|
825
827
|
allActions.push(mapActionGroup('references', function () {
|
|
826
828
|
return actionsMapReferences$3(diff, oldObj, newObj);
|
|
@@ -857,7 +859,7 @@ var categories = (function (actionGroupList, syncActionConfig) {
|
|
|
857
859
|
});
|
|
858
860
|
|
|
859
861
|
var isEmptyValue = createIsEmptyValue([undefined, null, '']);
|
|
860
|
-
var baseActionsList$
|
|
862
|
+
var baseActionsList$j = [{
|
|
861
863
|
action: 'setSalutation',
|
|
862
864
|
key: 'salutation'
|
|
863
865
|
}, {
|
|
@@ -922,10 +924,10 @@ var authenticationModeActionsList = [{
|
|
|
922
924
|
* SYNC FUNCTIONS
|
|
923
925
|
*/
|
|
924
926
|
|
|
925
|
-
function actionsMapBase$
|
|
927
|
+
function actionsMapBase$j(diff, oldObj, newObj) {
|
|
926
928
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
927
929
|
return buildBaseAttributesActions({
|
|
928
|
-
actions: baseActionsList$
|
|
930
|
+
actions: baseActionsList$j,
|
|
929
931
|
diff: diff,
|
|
930
932
|
oldObj: oldObj,
|
|
931
933
|
newObj: newObj,
|
|
@@ -1069,7 +1071,7 @@ function createCustomerMapActions(mapActionGroup, syncActionConfig) {
|
|
|
1069
1071
|
return function doMapActions(diff, newObj, oldObj) {
|
|
1070
1072
|
var allActions = [];
|
|
1071
1073
|
allActions.push(mapActionGroup('base', function () {
|
|
1072
|
-
return actionsMapBase$
|
|
1074
|
+
return actionsMapBase$j(diff, oldObj, newObj, syncActionConfig);
|
|
1073
1075
|
}));
|
|
1074
1076
|
allActions.push(mapActionGroup('references', function () {
|
|
1075
1077
|
return actionsMapReferences$2(diff, oldObj, newObj);
|
|
@@ -1114,7 +1116,7 @@ var customers = (function (actionGroupList, syncActionConfig) {
|
|
|
1114
1116
|
};
|
|
1115
1117
|
});
|
|
1116
1118
|
|
|
1117
|
-
var baseActionsList$
|
|
1119
|
+
var baseActionsList$i = [{
|
|
1118
1120
|
action: 'changeQuantity',
|
|
1119
1121
|
key: 'quantityOnStock',
|
|
1120
1122
|
actionKey: 'quantity'
|
|
@@ -1133,10 +1135,10 @@ var referenceActionsList$1 = [{
|
|
|
1133
1135
|
* SYNC FUNCTIONS
|
|
1134
1136
|
*/
|
|
1135
1137
|
|
|
1136
|
-
function actionsMapBase$
|
|
1138
|
+
function actionsMapBase$i(diff, oldObj, newObj) {
|
|
1137
1139
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
1138
1140
|
return buildBaseAttributesActions({
|
|
1139
|
-
actions: baseActionsList$
|
|
1141
|
+
actions: baseActionsList$i,
|
|
1140
1142
|
diff: diff,
|
|
1141
1143
|
oldObj: oldObj,
|
|
1142
1144
|
newObj: newObj,
|
|
@@ -1156,7 +1158,7 @@ function createInventoryMapActions(mapActionGroup, syncActionConfig) {
|
|
|
1156
1158
|
return function doMapActions(diff, newObj, oldObj) {
|
|
1157
1159
|
var allActions = [];
|
|
1158
1160
|
allActions.push(mapActionGroup('base', function () {
|
|
1159
|
-
return actionsMapBase$
|
|
1161
|
+
return actionsMapBase$i(diff, oldObj, newObj, syncActionConfig);
|
|
1160
1162
|
}));
|
|
1161
1163
|
allActions.push(mapActionGroup('references', function () {
|
|
1162
1164
|
return actionsMapReferences$1(diff, oldObj, newObj);
|
|
@@ -1251,7 +1253,7 @@ function findMatchingPairs(diff) {
|
|
|
1251
1253
|
|
|
1252
1254
|
var REGEX_NUMBER$2 = new RegExp(/^\d+$/);
|
|
1253
1255
|
var REGEX_UNDERSCORE_NUMBER$2 = new RegExp(/^_\d+$/);
|
|
1254
|
-
var baseActionsList$
|
|
1256
|
+
var baseActionsList$h = [{
|
|
1255
1257
|
action: 'changeName',
|
|
1256
1258
|
key: 'name'
|
|
1257
1259
|
}, {
|
|
@@ -1320,6 +1322,10 @@ var getIsRemoveAction = function getIsRemoveAction(key, resource) {
|
|
|
1320
1322
|
return REGEX_UNDERSCORE_NUMBER$2.test(key) && Number(resource[2]) === 0;
|
|
1321
1323
|
};
|
|
1322
1324
|
|
|
1325
|
+
var getIsItemMovedAction = function getIsItemMovedAction(key, resource) {
|
|
1326
|
+
return REGEX_UNDERSCORE_NUMBER$2.test(key) && Number(resource[2]) === 3;
|
|
1327
|
+
};
|
|
1328
|
+
|
|
1323
1329
|
function _buildSkuActions(variantDiff, oldVariant) {
|
|
1324
1330
|
if ({}.hasOwnProperty.call(variantDiff, 'sku')) {
|
|
1325
1331
|
var newValue = getDeltaValue(variantDiff.sku);
|
|
@@ -1594,6 +1600,34 @@ function toVariantIdentifier(variant) {
|
|
|
1594
1600
|
};
|
|
1595
1601
|
}
|
|
1596
1602
|
|
|
1603
|
+
function _buildVariantChangeAssetOrderAction(diffAssets, oldVariant, newVariant) {
|
|
1604
|
+
var isAssetOrderChanged = Object.entries(diffAssets).find(function (entry) {
|
|
1605
|
+
return getIsItemMovedAction(entry[0], entry[1]);
|
|
1606
|
+
});
|
|
1607
|
+
|
|
1608
|
+
if (!isAssetOrderChanged) {
|
|
1609
|
+
return [];
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
var assetIdsBefore = oldVariant.assets.map(function (_) {
|
|
1613
|
+
return _.id;
|
|
1614
|
+
});
|
|
1615
|
+
var assetIdsCurrent = newVariant.assets.map(function (_) {
|
|
1616
|
+
return _.id;
|
|
1617
|
+
}).filter(function (_) {
|
|
1618
|
+
return _ !== undefined;
|
|
1619
|
+
});
|
|
1620
|
+
var assetIdsToKeep = intersection(assetIdsCurrent, assetIdsBefore);
|
|
1621
|
+
var assetIdsToRemove = without.apply(void 0, [assetIdsBefore].concat(_toConsumableArray(assetIdsToKeep)));
|
|
1622
|
+
|
|
1623
|
+
var changeAssetOrderAction = _objectSpread2({
|
|
1624
|
+
action: 'changeAssetOrder',
|
|
1625
|
+
assetOrder: assetIdsToKeep.concat(assetIdsToRemove)
|
|
1626
|
+
}, toVariantIdentifier(oldVariant));
|
|
1627
|
+
|
|
1628
|
+
return [changeAssetOrderAction];
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1597
1631
|
function _buildVariantAssetsActions(diffAssets, oldVariant, newVariant) {
|
|
1598
1632
|
var assetActions = []; // generate a hashMap to be able to reference the right asset from both ends
|
|
1599
1633
|
|
|
@@ -1651,17 +1685,20 @@ function _buildVariantAssetsActions(diffAssets, oldVariant, newVariant) {
|
|
|
1651
1685
|
}, toAssetIdentifier(oldAsset)), toVariantIdentifier(oldVariant)));
|
|
1652
1686
|
}
|
|
1653
1687
|
});
|
|
1654
|
-
|
|
1688
|
+
|
|
1689
|
+
var changedAssetOrderAction = _buildVariantChangeAssetOrderAction(diffAssets, oldVariant, newVariant);
|
|
1690
|
+
|
|
1691
|
+
return [].concat(_toConsumableArray(changedAssetOrderAction), assetActions);
|
|
1655
1692
|
}
|
|
1656
1693
|
/**
|
|
1657
1694
|
* SYNC FUNCTIONS
|
|
1658
1695
|
*/
|
|
1659
1696
|
|
|
1660
1697
|
|
|
1661
|
-
function actionsMapBase$
|
|
1698
|
+
function actionsMapBase$h(diff, oldObj, newObj) {
|
|
1662
1699
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
1663
1700
|
return buildBaseAttributesActions({
|
|
1664
|
-
actions: baseActionsList$
|
|
1701
|
+
actions: baseActionsList$h,
|
|
1665
1702
|
diff: diff,
|
|
1666
1703
|
oldObj: oldObj,
|
|
1667
1704
|
newObj: newObj,
|
|
@@ -1761,7 +1798,7 @@ function actionsMapAssets(diff, oldObj, newObj, variantHashMap) {
|
|
|
1761
1798
|
});
|
|
1762
1799
|
return allAssetsActions;
|
|
1763
1800
|
}
|
|
1764
|
-
function actionsMapAttributes(diff, oldObj, newObj) {
|
|
1801
|
+
function actionsMapAttributes$1(diff, oldObj, newObj) {
|
|
1765
1802
|
var sameForAllAttributeNames = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
1766
1803
|
var variantHashMap = arguments.length > 4 ? arguments[4] : undefined;
|
|
1767
1804
|
var actions = [];
|
|
@@ -1892,7 +1929,7 @@ function createProductMapActions(mapActionGroup, syncActionConfig) {
|
|
|
1892
1929
|
staged = newObj.staged;
|
|
1893
1930
|
var variantHashMap = findMatchingPairs(diff.variants, oldObj.variants, newObj.variants);
|
|
1894
1931
|
allActions.push(mapActionGroup('attributes', function () {
|
|
1895
|
-
return actionsMapAttributes(diff, oldObj, newObj, sameForAllAttributeNames || [], variantHashMap);
|
|
1932
|
+
return actionsMapAttributes$1(diff, oldObj, newObj, sameForAllAttributeNames || [], variantHashMap);
|
|
1896
1933
|
}));
|
|
1897
1934
|
allActions.push(mapActionGroup('variants', function () {
|
|
1898
1935
|
return actionsMapAddVariants(diff, oldObj, newObj);
|
|
@@ -1902,7 +1939,7 @@ function createProductMapActions(mapActionGroup, syncActionConfig) {
|
|
|
1902
1939
|
return actionsMapRemoveVariants(diff, oldObj, newObj);
|
|
1903
1940
|
}));
|
|
1904
1941
|
allActions.push(mapActionGroup('base', function () {
|
|
1905
|
-
return actionsMapBase$
|
|
1942
|
+
return actionsMapBase$h(diff, oldObj, newObj, syncActionConfig);
|
|
1906
1943
|
}));
|
|
1907
1944
|
allActions.push(mapActionGroup('meta', function () {
|
|
1908
1945
|
return actionsMapMeta(diff, oldObj, newObj);
|
|
@@ -1977,7 +2014,7 @@ var isRemoveAction = function isRemoveAction(key, resource) {
|
|
|
1977
2014
|
return REGEX_UNDERSCORE_NUMBER$1.test(key) && Number(resource[2]) === 0;
|
|
1978
2015
|
};
|
|
1979
2016
|
|
|
1980
|
-
var baseActionsList$
|
|
2017
|
+
var baseActionsList$g = [{
|
|
1981
2018
|
action: 'changeOrderState',
|
|
1982
2019
|
key: 'orderState'
|
|
1983
2020
|
}, {
|
|
@@ -1991,10 +2028,10 @@ var baseActionsList$f = [{
|
|
|
1991
2028
|
* SYNC FUNCTIONS
|
|
1992
2029
|
*/
|
|
1993
2030
|
|
|
1994
|
-
function actionsMapBase$
|
|
2031
|
+
function actionsMapBase$g(diff, oldObj, newObj) {
|
|
1995
2032
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
1996
2033
|
return buildBaseAttributesActions({
|
|
1997
|
-
actions: baseActionsList$
|
|
2034
|
+
actions: baseActionsList$g,
|
|
1998
2035
|
diff: diff,
|
|
1999
2036
|
oldObj: oldObj,
|
|
2000
2037
|
newObj: newObj,
|
|
@@ -2161,7 +2198,7 @@ function createOrderMapActions(mapActionGroup, syncActionConfig) {
|
|
|
2161
2198
|
}
|
|
2162
2199
|
|
|
2163
2200
|
allActions.push(mapActionGroup('base', function () {
|
|
2164
|
-
return actionsMapBase$
|
|
2201
|
+
return actionsMapBase$g(diff, oldObj, newObj, syncActionConfig);
|
|
2165
2202
|
}));
|
|
2166
2203
|
allActions.push(mapActionGroup('deliveries', function () {
|
|
2167
2204
|
return actionsMapDeliveries(diff, oldObj, newObj);
|
|
@@ -2200,7 +2237,7 @@ var orders = (function (actionGroupList, syncActionConfig) {
|
|
|
2200
2237
|
};
|
|
2201
2238
|
});
|
|
2202
2239
|
|
|
2203
|
-
var baseActionsList$
|
|
2240
|
+
var baseActionsList$f = [{
|
|
2204
2241
|
action: 'changeIsActive',
|
|
2205
2242
|
key: 'isActive'
|
|
2206
2243
|
}, {
|
|
@@ -2228,10 +2265,10 @@ var baseActionsList$e = [{
|
|
|
2228
2265
|
action: 'setKey',
|
|
2229
2266
|
key: 'key'
|
|
2230
2267
|
}];
|
|
2231
|
-
function actionsMapBase$
|
|
2268
|
+
function actionsMapBase$f(diff, oldObj, newObj) {
|
|
2232
2269
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
2233
2270
|
return buildBaseAttributesActions({
|
|
2234
|
-
actions: baseActionsList$
|
|
2271
|
+
actions: baseActionsList$f,
|
|
2235
2272
|
diff: diff,
|
|
2236
2273
|
oldObj: oldObj,
|
|
2237
2274
|
newObj: newObj,
|
|
@@ -2272,7 +2309,7 @@ function createProductDiscountsMapActions(mapActionGroup, syncActionConfig) {
|
|
|
2272
2309
|
return function doMapActions(diff, newObj, oldObj) {
|
|
2273
2310
|
var allActions = [];
|
|
2274
2311
|
allActions.push(mapActionGroup('base', function () {
|
|
2275
|
-
return actionsMapBase$
|
|
2312
|
+
return actionsMapBase$f(diff, oldObj, newObj, syncActionConfig);
|
|
2276
2313
|
}));
|
|
2277
2314
|
return combineValidityActions(flatten(allActions));
|
|
2278
2315
|
};
|
|
@@ -2288,7 +2325,7 @@ var productDiscounts = (function (actionGroupList) {
|
|
|
2288
2325
|
};
|
|
2289
2326
|
});
|
|
2290
2327
|
|
|
2291
|
-
var baseActionsList$
|
|
2328
|
+
var baseActionsList$e = [{
|
|
2292
2329
|
action: 'changeIsActive',
|
|
2293
2330
|
key: 'isActive'
|
|
2294
2331
|
}, {
|
|
@@ -2319,10 +2356,10 @@ var baseActionsList$d = [{
|
|
|
2319
2356
|
action: 'changeGroups',
|
|
2320
2357
|
key: 'groups'
|
|
2321
2358
|
}];
|
|
2322
|
-
function actionsMapBase$
|
|
2359
|
+
function actionsMapBase$e(diff, oldObj, newObj) {
|
|
2323
2360
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
2324
2361
|
return buildBaseAttributesActions({
|
|
2325
|
-
actions: baseActionsList$
|
|
2362
|
+
actions: baseActionsList$e,
|
|
2326
2363
|
diff: diff,
|
|
2327
2364
|
oldObj: oldObj,
|
|
2328
2365
|
newObj: newObj,
|
|
@@ -2334,7 +2371,7 @@ function createDiscountCodesMapActions(mapActionGroup, syncActionConfig) {
|
|
|
2334
2371
|
return function doMapActions(diff, newObj, oldObj) {
|
|
2335
2372
|
var allActions = [];
|
|
2336
2373
|
allActions.push(mapActionGroup('base', function () {
|
|
2337
|
-
return actionsMapBase$
|
|
2374
|
+
return actionsMapBase$e(diff, oldObj, newObj, syncActionConfig);
|
|
2338
2375
|
}));
|
|
2339
2376
|
allActions.push(mapActionGroup('custom', function () {
|
|
2340
2377
|
return actionsMapCustom(diff, newObj, oldObj);
|
|
@@ -2362,17 +2399,17 @@ var discountCodes = (function (actionGroupList) {
|
|
|
2362
2399
|
};
|
|
2363
2400
|
});
|
|
2364
2401
|
|
|
2365
|
-
var baseActionsList$
|
|
2402
|
+
var baseActionsList$d = [{
|
|
2366
2403
|
action: 'changeName',
|
|
2367
2404
|
key: 'name'
|
|
2368
2405
|
}, {
|
|
2369
2406
|
action: 'setKey',
|
|
2370
2407
|
key: 'key'
|
|
2371
2408
|
}];
|
|
2372
|
-
function actionsMapBase$
|
|
2409
|
+
function actionsMapBase$d(diff, oldObj, newObj) {
|
|
2373
2410
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
2374
2411
|
return buildBaseAttributesActions({
|
|
2375
|
-
actions: baseActionsList$
|
|
2412
|
+
actions: baseActionsList$d,
|
|
2376
2413
|
diff: diff,
|
|
2377
2414
|
oldObj: oldObj,
|
|
2378
2415
|
newObj: newObj,
|
|
@@ -2384,7 +2421,7 @@ function createCustomerGroupMapActions(mapActionGroup, syncActionConfig) {
|
|
|
2384
2421
|
return function doMapActions(diff, newObj, oldObj) {
|
|
2385
2422
|
var allActions = [];
|
|
2386
2423
|
allActions.push(mapActionGroup('base', function () {
|
|
2387
|
-
return actionsMapBase$
|
|
2424
|
+
return actionsMapBase$d(diff, oldObj, newObj, syncActionConfig);
|
|
2388
2425
|
}));
|
|
2389
2426
|
allActions.push(mapActionGroup('custom', function () {
|
|
2390
2427
|
return actionsMapCustom(diff, newObj, oldObj);
|
|
@@ -2403,7 +2440,7 @@ var customerGroup = (function (actionGroupList) {
|
|
|
2403
2440
|
};
|
|
2404
2441
|
});
|
|
2405
2442
|
|
|
2406
|
-
var baseActionsList$
|
|
2443
|
+
var baseActionsList$c = [{
|
|
2407
2444
|
action: 'changeIsActive',
|
|
2408
2445
|
key: 'isActive'
|
|
2409
2446
|
}, {
|
|
@@ -2440,10 +2477,10 @@ var baseActionsList$b = [{
|
|
|
2440
2477
|
action: 'setKey',
|
|
2441
2478
|
key: 'key'
|
|
2442
2479
|
}];
|
|
2443
|
-
function actionsMapBase$
|
|
2480
|
+
function actionsMapBase$c(diff, oldObj, newObj) {
|
|
2444
2481
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
2445
2482
|
return buildBaseAttributesActions({
|
|
2446
|
-
actions: baseActionsList$
|
|
2483
|
+
actions: baseActionsList$c,
|
|
2447
2484
|
diff: diff,
|
|
2448
2485
|
oldObj: oldObj,
|
|
2449
2486
|
newObj: newObj,
|
|
@@ -2455,7 +2492,7 @@ function createCartDiscountsMapActions(mapActionGroup, syncActionConfig) {
|
|
|
2455
2492
|
return function doMapActions(diff, newObj, oldObj) {
|
|
2456
2493
|
var allActions = [];
|
|
2457
2494
|
allActions.push(mapActionGroup('base', function () {
|
|
2458
|
-
return actionsMapBase$
|
|
2495
|
+
return actionsMapBase$c(diff, oldObj, newObj, syncActionConfig);
|
|
2459
2496
|
}));
|
|
2460
2497
|
allActions.push(mapActionGroup('custom', function () {
|
|
2461
2498
|
return actionsMapCustom(diff, newObj, oldObj);
|
|
@@ -2474,7 +2511,7 @@ var cartDiscounts = (function (actionGroupList) {
|
|
|
2474
2511
|
};
|
|
2475
2512
|
});
|
|
2476
2513
|
|
|
2477
|
-
var baseActionsList$
|
|
2514
|
+
var baseActionsList$b = [{
|
|
2478
2515
|
action: 'changeName',
|
|
2479
2516
|
key: 'name'
|
|
2480
2517
|
}, {
|
|
@@ -2484,10 +2521,10 @@ var baseActionsList$a = [{
|
|
|
2484
2521
|
action: 'setDescription',
|
|
2485
2522
|
key: 'description'
|
|
2486
2523
|
}];
|
|
2487
|
-
function actionsMapBase$
|
|
2524
|
+
function actionsMapBase$b(diff, oldObj, newObj) {
|
|
2488
2525
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
2489
2526
|
return buildBaseAttributesActions({
|
|
2490
|
-
actions: baseActionsList$
|
|
2527
|
+
actions: baseActionsList$b,
|
|
2491
2528
|
diff: diff,
|
|
2492
2529
|
oldObj: oldObj,
|
|
2493
2530
|
newObj: newObj,
|
|
@@ -2521,7 +2558,7 @@ function createTaxCategoriesMapActions(mapActionGroup, syncActionConfig) {
|
|
|
2521
2558
|
return function doMapActions(diff, newObj, oldObj) {
|
|
2522
2559
|
var allActions = [];
|
|
2523
2560
|
allActions.push(mapActionGroup('base', function () {
|
|
2524
|
-
return actionsMapBase$
|
|
2561
|
+
return actionsMapBase$b(diff, oldObj, newObj, syncActionConfig);
|
|
2525
2562
|
}));
|
|
2526
2563
|
allActions.push(mapActionGroup('rates', function () {
|
|
2527
2564
|
return actionsMapRates(diff, oldObj, newObj);
|
|
@@ -2548,7 +2585,7 @@ var taxCategories = (function (actionGroupList, syncActionConfig) {
|
|
|
2548
2585
|
};
|
|
2549
2586
|
});
|
|
2550
2587
|
|
|
2551
|
-
var baseActionsList$
|
|
2588
|
+
var baseActionsList$a = [{
|
|
2552
2589
|
action: 'changeName',
|
|
2553
2590
|
key: 'name'
|
|
2554
2591
|
}, {
|
|
@@ -2565,10 +2602,10 @@ var hasLocation = function hasLocation(locations, otherLocation) {
|
|
|
2565
2602
|
});
|
|
2566
2603
|
};
|
|
2567
2604
|
|
|
2568
|
-
function actionsMapBase$
|
|
2605
|
+
function actionsMapBase$a(diff, oldObj, newObj) {
|
|
2569
2606
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
2570
2607
|
return buildBaseAttributesActions({
|
|
2571
|
-
actions: baseActionsList$
|
|
2608
|
+
actions: baseActionsList$a,
|
|
2572
2609
|
diff: diff,
|
|
2573
2610
|
oldObj: oldObj,
|
|
2574
2611
|
newObj: newObj,
|
|
@@ -2613,7 +2650,7 @@ function createZonesMapActions(mapActionGroup, syncActionConfig) {
|
|
|
2613
2650
|
return function doMapActions(diff, newObj, oldObj) {
|
|
2614
2651
|
var allActions = [];
|
|
2615
2652
|
allActions.push(mapActionGroup('base', function () {
|
|
2616
|
-
return actionsMapBase$
|
|
2653
|
+
return actionsMapBase$a(diff, oldObj, newObj, syncActionConfig);
|
|
2617
2654
|
}));
|
|
2618
2655
|
allActions.push(flatten(mapActionGroup('locations', function () {
|
|
2619
2656
|
return actionsMapLocations(diff, oldObj, newObj);
|
|
@@ -2640,7 +2677,7 @@ var zones = (function (actionGroupList, syncActionConfig) {
|
|
|
2640
2677
|
};
|
|
2641
2678
|
});
|
|
2642
2679
|
|
|
2643
|
-
var baseActionsList$
|
|
2680
|
+
var baseActionsList$9 = [{
|
|
2644
2681
|
action: 'setKey',
|
|
2645
2682
|
key: 'key'
|
|
2646
2683
|
}, {
|
|
@@ -2665,10 +2702,10 @@ var baseActionsList$8 = [{
|
|
|
2665
2702
|
action: 'changeTaxCategory',
|
|
2666
2703
|
key: 'taxCategory'
|
|
2667
2704
|
}];
|
|
2668
|
-
function actionsMapBase$
|
|
2705
|
+
function actionsMapBase$9(diff, oldObj, newObj) {
|
|
2669
2706
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
2670
2707
|
return buildBaseAttributesActions({
|
|
2671
|
-
actions: baseActionsList$
|
|
2708
|
+
actions: baseActionsList$9,
|
|
2672
2709
|
diff: diff,
|
|
2673
2710
|
oldObj: oldObj,
|
|
2674
2711
|
newObj: newObj,
|
|
@@ -2750,7 +2787,7 @@ function createShippingMethodsMapActions(mapActionGroup, syncActionConfig) {
|
|
|
2750
2787
|
return function doMapActions(diff, newObj, oldObj) {
|
|
2751
2788
|
var allActions = [];
|
|
2752
2789
|
allActions.push(mapActionGroup('base', function () {
|
|
2753
|
-
return actionsMapBase$
|
|
2790
|
+
return actionsMapBase$9(diff, oldObj, newObj, syncActionConfig);
|
|
2754
2791
|
}));
|
|
2755
2792
|
allActions.push(flatten(mapActionGroup('zoneRates', function () {
|
|
2756
2793
|
return actionsMapZoneRates(diff, oldObj, newObj);
|
|
@@ -3148,7 +3185,7 @@ createComparator(function () {
|
|
|
3148
3185
|
createComparator(createCircularEqualCreator());
|
|
3149
3186
|
createComparator(createCircularEqualCreator(sameValueZeroEqual));
|
|
3150
3187
|
|
|
3151
|
-
var baseActionsList$
|
|
3188
|
+
var baseActionsList$8 = [{
|
|
3152
3189
|
action: 'changeName',
|
|
3153
3190
|
key: 'name'
|
|
3154
3191
|
}, {
|
|
@@ -3158,7 +3195,7 @@ var baseActionsList$7 = [{
|
|
|
3158
3195
|
action: 'changeDescription',
|
|
3159
3196
|
key: 'description'
|
|
3160
3197
|
}];
|
|
3161
|
-
function actionsMapBase$
|
|
3198
|
+
function actionsMapBase$8(diff, previous, next) {
|
|
3162
3199
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
3163
3200
|
// when `diff` is undefined, then the underlying `buildActions` has returned any diff
|
|
3164
3201
|
// which given in product-types would mean that `buildActions` has run with `nestedValuesChanges` applied
|
|
@@ -3166,7 +3203,7 @@ function actionsMapBase$7(diff, previous, next) {
|
|
|
3166
3203
|
if (!diff) return [];
|
|
3167
3204
|
return buildBaseAttributesActions({
|
|
3168
3205
|
diff: diff,
|
|
3169
|
-
actions: baseActionsList$
|
|
3206
|
+
actions: baseActionsList$8,
|
|
3170
3207
|
oldObj: previous,
|
|
3171
3208
|
newObj: next,
|
|
3172
3209
|
shouldOmitEmptyString: config.shouldOmitEmptyString
|
|
@@ -3392,7 +3429,7 @@ function createProductTypeMapActions(mapActionGroup, syncActionConfig) {
|
|
|
3392
3429
|
return flatten([// we support only base fields for the product type,
|
|
3393
3430
|
// for attributes, applying hints would be recommended
|
|
3394
3431
|
mapActionGroup('base', function () {
|
|
3395
|
-
return actionsMapBase$
|
|
3432
|
+
return actionsMapBase$8(diff, previous, next, syncActionConfig);
|
|
3396
3433
|
}), actionsMapForHints(options.nestedValuesChanges, previous, next)]);
|
|
3397
3434
|
};
|
|
3398
3435
|
}
|
|
@@ -3409,7 +3446,7 @@ var productTypes = (function (actionGroupList, syncActionConfig) {
|
|
|
3409
3446
|
};
|
|
3410
3447
|
});
|
|
3411
3448
|
|
|
3412
|
-
var baseActionsList$
|
|
3449
|
+
var baseActionsList$7 = [{
|
|
3413
3450
|
action: 'changeKey',
|
|
3414
3451
|
key: 'key'
|
|
3415
3452
|
}, {
|
|
@@ -3428,10 +3465,10 @@ var baseActionsList$6 = [{
|
|
|
3428
3465
|
action: 'setTransitions',
|
|
3429
3466
|
key: 'transitions'
|
|
3430
3467
|
}];
|
|
3431
|
-
function actionsMapBase$
|
|
3468
|
+
function actionsMapBase$7(diff, oldObj, newObj) {
|
|
3432
3469
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
3433
3470
|
return buildBaseAttributesActions({
|
|
3434
|
-
actions: baseActionsList$
|
|
3471
|
+
actions: baseActionsList$7,
|
|
3435
3472
|
diff: diff,
|
|
3436
3473
|
oldObj: oldObj,
|
|
3437
3474
|
newObj: newObj,
|
|
@@ -3481,7 +3518,7 @@ function createStatesMapActions(mapActionGroup, syncActionConfig) {
|
|
|
3481
3518
|
var baseActions = [];
|
|
3482
3519
|
var roleActions = [];
|
|
3483
3520
|
baseActions.push(mapActionGroup('base', function () {
|
|
3484
|
-
return actionsMapBase$
|
|
3521
|
+
return actionsMapBase$7(diff, oldObj, newObj, syncActionConfig);
|
|
3485
3522
|
}));
|
|
3486
3523
|
roleActions.push(mapActionGroup('roles', function () {
|
|
3487
3524
|
return actionsMapRoles(diff, oldObj, newObj);
|
|
@@ -3499,7 +3536,7 @@ var states = (function (actionGroupList, syncActionConfig) {
|
|
|
3499
3536
|
};
|
|
3500
3537
|
});
|
|
3501
3538
|
|
|
3502
|
-
var baseActionsList$
|
|
3539
|
+
var baseActionsList$6 = [{
|
|
3503
3540
|
action: 'changeKey',
|
|
3504
3541
|
key: 'key'
|
|
3505
3542
|
}, {
|
|
@@ -3518,10 +3555,10 @@ var baseActionsList$5 = [{
|
|
|
3518
3555
|
action: 'setRoles',
|
|
3519
3556
|
key: 'roles'
|
|
3520
3557
|
}];
|
|
3521
|
-
function actionsMapBase$
|
|
3558
|
+
function actionsMapBase$6(diff, oldObj, newObj) {
|
|
3522
3559
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
3523
3560
|
return buildBaseAttributesActions({
|
|
3524
|
-
actions: baseActionsList$
|
|
3561
|
+
actions: baseActionsList$6,
|
|
3525
3562
|
diff: diff,
|
|
3526
3563
|
oldObj: oldObj,
|
|
3527
3564
|
newObj: newObj,
|
|
@@ -3533,7 +3570,7 @@ function createChannelsMapActions$1(mapActionGroup, syncActionConfig) {
|
|
|
3533
3570
|
return function doMapActions(diff, newObj, oldObj) {
|
|
3534
3571
|
var allActions = [];
|
|
3535
3572
|
allActions.push(mapActionGroup('base', function () {
|
|
3536
|
-
return actionsMapBase$
|
|
3573
|
+
return actionsMapBase$6(diff, oldObj, newObj, syncActionConfig);
|
|
3537
3574
|
}));
|
|
3538
3575
|
allActions.push(mapActionGroup('custom', function () {
|
|
3539
3576
|
return actionsMapCustom(diff, newObj, oldObj);
|
|
@@ -3563,7 +3600,7 @@ var getIsRemovedOperation = function getIsRemovedOperation(key) {
|
|
|
3563
3600
|
return REGEX_UNDERSCORE_NUMBER.test(key);
|
|
3564
3601
|
};
|
|
3565
3602
|
|
|
3566
|
-
var baseActionsList$
|
|
3603
|
+
var baseActionsList$5 = [{
|
|
3567
3604
|
action: 'changeKey',
|
|
3568
3605
|
key: 'key'
|
|
3569
3606
|
}, {
|
|
@@ -3573,10 +3610,10 @@ var baseActionsList$4 = [{
|
|
|
3573
3610
|
action: 'setDescription',
|
|
3574
3611
|
key: 'description'
|
|
3575
3612
|
}];
|
|
3576
|
-
function actionsMapBase$
|
|
3613
|
+
function actionsMapBase$5(diff, oldObj, newObj) {
|
|
3577
3614
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
3578
3615
|
return buildBaseAttributesActions({
|
|
3579
|
-
actions: baseActionsList$
|
|
3616
|
+
actions: baseActionsList$5,
|
|
3580
3617
|
diff: diff,
|
|
3581
3618
|
oldObj: oldObj,
|
|
3582
3619
|
newObj: newObj,
|
|
@@ -3725,7 +3762,7 @@ function createTypeMapActions(mapActionGroup, syncActionConfig) {
|
|
|
3725
3762
|
return function doMapActions(diff, next, previous) {
|
|
3726
3763
|
var allActions = [];
|
|
3727
3764
|
allActions.push(mapActionGroup('base', function () {
|
|
3728
|
-
return actionsMapBase$
|
|
3765
|
+
return actionsMapBase$5(diff, previous, next, syncActionConfig);
|
|
3729
3766
|
}), mapActionGroup('fieldDefinitions', function () {
|
|
3730
3767
|
return actionsMapFieldDefinitions(diff.fieldDefinitions, previous.fieldDefinitions, next.fieldDefinitions, findMatchingPairs(diff.fieldDefinitions, previous.fieldDefinitions, next.fieldDefinitions, 'name'));
|
|
3731
3768
|
}));
|
|
@@ -3742,7 +3779,7 @@ var types = (function (actionGroupList, syncActionConfig) {
|
|
|
3742
3779
|
};
|
|
3743
3780
|
});
|
|
3744
3781
|
|
|
3745
|
-
var baseActionsList$
|
|
3782
|
+
var baseActionsList$4 = [{
|
|
3746
3783
|
action: 'changeName',
|
|
3747
3784
|
key: 'name'
|
|
3748
3785
|
}, {
|
|
@@ -3761,10 +3798,10 @@ var baseActionsList$3 = [{
|
|
|
3761
3798
|
action: 'setShippingRateInputType',
|
|
3762
3799
|
key: 'shippingRateInputType'
|
|
3763
3800
|
}];
|
|
3764
|
-
function actionsMapBase$
|
|
3801
|
+
function actionsMapBase$4(diff, oldObj, newObj) {
|
|
3765
3802
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
3766
3803
|
return buildBaseAttributesActions({
|
|
3767
|
-
actions: baseActionsList$
|
|
3804
|
+
actions: baseActionsList$4,
|
|
3768
3805
|
diff: diff,
|
|
3769
3806
|
oldObj: oldObj,
|
|
3770
3807
|
newObj: newObj,
|
|
@@ -3776,7 +3813,7 @@ function createChannelsMapActions(mapActionGroup, syncActionConfig) {
|
|
|
3776
3813
|
return function doMapActions(diff, newObj, oldObj) {
|
|
3777
3814
|
var allActions = [];
|
|
3778
3815
|
allActions.push(mapActionGroup('base', function () {
|
|
3779
|
-
return actionsMapBase$
|
|
3816
|
+
return actionsMapBase$4(diff, oldObj, newObj, syncActionConfig);
|
|
3780
3817
|
}));
|
|
3781
3818
|
return flatten(allActions);
|
|
3782
3819
|
};
|
|
@@ -3792,7 +3829,7 @@ var projects = (function (actionGroupList) {
|
|
|
3792
3829
|
};
|
|
3793
3830
|
});
|
|
3794
3831
|
|
|
3795
|
-
var baseActionsList$
|
|
3832
|
+
var baseActionsList$3 = [{
|
|
3796
3833
|
action: 'setName',
|
|
3797
3834
|
key: 'name'
|
|
3798
3835
|
}, {
|
|
@@ -3805,9 +3842,9 @@ var baseActionsList$2 = [{
|
|
|
3805
3842
|
action: 'setSupplyChannels',
|
|
3806
3843
|
key: 'supplyChannels'
|
|
3807
3844
|
}];
|
|
3808
|
-
function actionsMapBase$
|
|
3845
|
+
function actionsMapBase$3(diff, oldObj, newObj) {
|
|
3809
3846
|
return buildBaseAttributesActions({
|
|
3810
|
-
actions: baseActionsList$
|
|
3847
|
+
actions: baseActionsList$3,
|
|
3811
3848
|
diff: diff,
|
|
3812
3849
|
oldObj: oldObj,
|
|
3813
3850
|
newObj: newObj
|
|
@@ -3818,7 +3855,7 @@ function createStoresMapActions(mapActionGroup) {
|
|
|
3818
3855
|
return function doMapActions(diff, next, previous) {
|
|
3819
3856
|
var allActions = [];
|
|
3820
3857
|
allActions.push(mapActionGroup('base', function () {
|
|
3821
|
-
return actionsMapBase$
|
|
3858
|
+
return actionsMapBase$3(diff, previous, next);
|
|
3822
3859
|
}));
|
|
3823
3860
|
allActions.push(mapActionGroup('custom', function () {
|
|
3824
3861
|
return actionsMapCustom(diff, next, previous);
|
|
@@ -3837,16 +3874,16 @@ var stores = (function (actionGroupList) {
|
|
|
3837
3874
|
};
|
|
3838
3875
|
});
|
|
3839
3876
|
|
|
3840
|
-
var baseActionsList$
|
|
3877
|
+
var baseActionsList$2 = [{
|
|
3841
3878
|
action: 'changeName',
|
|
3842
3879
|
key: 'name'
|
|
3843
3880
|
}, {
|
|
3844
3881
|
action: 'setKey',
|
|
3845
3882
|
key: 'key'
|
|
3846
3883
|
}];
|
|
3847
|
-
function actionsMapBase$
|
|
3884
|
+
function actionsMapBase$2(diff, oldObj, newObj) {
|
|
3848
3885
|
return buildBaseAttributesActions({
|
|
3849
|
-
actions: baseActionsList$
|
|
3886
|
+
actions: baseActionsList$2,
|
|
3850
3887
|
diff: diff,
|
|
3851
3888
|
oldObj: oldObj,
|
|
3852
3889
|
newObj: newObj
|
|
@@ -3857,7 +3894,7 @@ function createProductSelectionsMapActions(mapActionGroup) {
|
|
|
3857
3894
|
return function doMapActions(diff, next, previous) {
|
|
3858
3895
|
var allActions = [];
|
|
3859
3896
|
allActions.push(mapActionGroup('base', function () {
|
|
3860
|
-
return actionsMapBase$
|
|
3897
|
+
return actionsMapBase$2(diff, previous, next);
|
|
3861
3898
|
}));
|
|
3862
3899
|
allActions.push(mapActionGroup('custom', function () {
|
|
3863
3900
|
return actionsMapCustom(diff, next, previous);
|
|
@@ -3876,7 +3913,7 @@ var productSelections = (function (actionGroupList) {
|
|
|
3876
3913
|
};
|
|
3877
3914
|
});
|
|
3878
3915
|
|
|
3879
|
-
var baseActionsList = [{
|
|
3916
|
+
var baseActionsList$1 = [{
|
|
3880
3917
|
action: 'changeValue',
|
|
3881
3918
|
key: 'value'
|
|
3882
3919
|
}, {
|
|
@@ -3899,10 +3936,10 @@ var baseActionsList = [{
|
|
|
3899
3936
|
action: 'changeActive',
|
|
3900
3937
|
key: 'active'
|
|
3901
3938
|
}];
|
|
3902
|
-
function actionsMapBase(diff, oldObj, newObj) {
|
|
3939
|
+
function actionsMapBase$1(diff, oldObj, newObj) {
|
|
3903
3940
|
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
3904
3941
|
return buildBaseAttributesActions({
|
|
3905
|
-
actions: baseActionsList,
|
|
3942
|
+
actions: baseActionsList$1,
|
|
3906
3943
|
diff: diff,
|
|
3907
3944
|
oldObj: oldObj,
|
|
3908
3945
|
newObj: newObj,
|
|
@@ -3913,7 +3950,7 @@ function actionsMapBase(diff, oldObj, newObj) {
|
|
|
3913
3950
|
function createPriceMapActions(mapActionGroup, syncActionConfig) {
|
|
3914
3951
|
return function doMapActions(diff, newObj, oldObj) {
|
|
3915
3952
|
var baseActions = mapActionGroup('base', function () {
|
|
3916
|
-
return actionsMapBase(diff, oldObj, newObj, syncActionConfig);
|
|
3953
|
+
return actionsMapBase$1(diff, oldObj, newObj, syncActionConfig);
|
|
3917
3954
|
});
|
|
3918
3955
|
var customActions = mapActionGroup('custom', function () {
|
|
3919
3956
|
return actionsMapCustom(diff, newObj, oldObj);
|
|
@@ -3931,4 +3968,85 @@ var prices = (function (actionGroupList, syncActionConfig) {
|
|
|
3931
3968
|
};
|
|
3932
3969
|
});
|
|
3933
3970
|
|
|
3934
|
-
|
|
3971
|
+
var hasAttribute = function hasAttribute(attributes, newValue) {
|
|
3972
|
+
return attributes.some(function (attribute) {
|
|
3973
|
+
return attribute.key === newValue.key;
|
|
3974
|
+
});
|
|
3975
|
+
};
|
|
3976
|
+
|
|
3977
|
+
var baseActionsList = [{
|
|
3978
|
+
action: 'changeName',
|
|
3979
|
+
key: 'name'
|
|
3980
|
+
}, {
|
|
3981
|
+
action: 'setKey',
|
|
3982
|
+
key: 'key'
|
|
3983
|
+
}, {
|
|
3984
|
+
action: 'setDescription',
|
|
3985
|
+
key: 'description'
|
|
3986
|
+
}];
|
|
3987
|
+
function actionsMapBase(diff, oldObj, newObj) {
|
|
3988
|
+
var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
3989
|
+
return buildBaseAttributesActions({
|
|
3990
|
+
actions: baseActionsList,
|
|
3991
|
+
diff: diff,
|
|
3992
|
+
oldObj: oldObj,
|
|
3993
|
+
newObj: newObj,
|
|
3994
|
+
shouldOmitEmptyString: config.shouldOmitEmptyString
|
|
3995
|
+
});
|
|
3996
|
+
}
|
|
3997
|
+
function actionsMapAttributes(diff, oldObj, newObj) {
|
|
3998
|
+
var _createBuildArrayActi;
|
|
3999
|
+
|
|
4000
|
+
var handler = createBuildArrayActions('attributes', (_createBuildArrayActi = {}, _defineProperty(_createBuildArrayActi, ADD_ACTIONS, function (newAttribute) {
|
|
4001
|
+
return {
|
|
4002
|
+
action: 'addAttribute',
|
|
4003
|
+
attribute: newAttribute
|
|
4004
|
+
};
|
|
4005
|
+
}), _defineProperty(_createBuildArrayActi, REMOVE_ACTIONS, function (oldAttribute) {
|
|
4006
|
+
// We only add the action if the attribute is not included in the new object.
|
|
4007
|
+
return !hasAttribute(newObj.attributes, oldAttribute) ? {
|
|
4008
|
+
action: 'removeAttribute',
|
|
4009
|
+
attribute: oldAttribute
|
|
4010
|
+
} : null;
|
|
4011
|
+
}), _defineProperty(_createBuildArrayActi, CHANGE_ACTIONS, function (oldAttribute, newAttribute) {
|
|
4012
|
+
var result = []; // We only remove the attribute in case that the oldAttribute is not
|
|
4013
|
+
// included in the new object
|
|
4014
|
+
|
|
4015
|
+
if (!hasAttribute(newObj.attributes, oldAttribute)) result.push({
|
|
4016
|
+
action: 'removeAttribute',
|
|
4017
|
+
attribute: oldAttribute
|
|
4018
|
+
}); // We only add the attribute in case that the newAttribute was not
|
|
4019
|
+
// included in the old object
|
|
4020
|
+
|
|
4021
|
+
if (!hasAttribute(oldObj.attributes, newAttribute)) result.push({
|
|
4022
|
+
action: 'addAttribute',
|
|
4023
|
+
attribute: newAttribute
|
|
4024
|
+
});
|
|
4025
|
+
return result;
|
|
4026
|
+
}), _createBuildArrayActi));
|
|
4027
|
+
return handler(diff, oldObj, newObj);
|
|
4028
|
+
}
|
|
4029
|
+
|
|
4030
|
+
function createAttributeGroupsMapActions(mapActionGroup, syncActionConfig) {
|
|
4031
|
+
return function doMapActions(diff, newObj, oldObj) {
|
|
4032
|
+
var allActions = [];
|
|
4033
|
+
allActions.push(mapActionGroup('base', function () {
|
|
4034
|
+
return actionsMapBase(diff, oldObj, newObj, syncActionConfig);
|
|
4035
|
+
}));
|
|
4036
|
+
allActions.push(flatten(mapActionGroup('attributes', function () {
|
|
4037
|
+
return actionsMapAttributes(diff, oldObj, newObj);
|
|
4038
|
+
})));
|
|
4039
|
+
return flatten(allActions);
|
|
4040
|
+
};
|
|
4041
|
+
}
|
|
4042
|
+
|
|
4043
|
+
var attributeGroups = (function (actionGroupList, syncActionConfig) {
|
|
4044
|
+
var mapActionGroup = createMapActionGroup(actionGroupList);
|
|
4045
|
+
var doMapActions = createAttributeGroupsMapActions(mapActionGroup, syncActionConfig);
|
|
4046
|
+
var buildActions = createBuildActions(diff, doMapActions);
|
|
4047
|
+
return {
|
|
4048
|
+
buildActions: buildActions
|
|
4049
|
+
};
|
|
4050
|
+
});
|
|
4051
|
+
|
|
4052
|
+
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, shippingMethods as createSyncShippingMethods, prices as createSyncStandalonePrices, states as createSyncStates, stores as createSyncStores, taxCategories as createSyncTaxCategories, types as createSyncTypes, zones as createSyncZones };
|