@commercetools/sync-actions 4.10.0 → 4.12.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 CHANGED
@@ -1,10 +1,28 @@
1
1
  # @commercetools/sync-actions
2
2
 
3
- ## 4.10.0
3
+ ## 4.12.0
4
+
4
5
  ### Minor Changes
5
6
 
7
+ - [#1796](https://github.com/commercetools/nodejs/pull/1796) [`7aaf91cd`](https://github.com/commercetools/nodejs/commit/7aaf91cdecb7c844943369fc137a5356becdba36) Thanks [@VineetKumarKushwaha](https://github.com/VineetKumarKushwaha)! - Fix custom types sync actions to detect addEnumValue action correctly
8
+
9
+ ## 4.11.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#1788](https://github.com/commercetools/nodejs/pull/1788) [`f1acfb67`](https://github.com/commercetools/nodejs/commit/f1acfb67708d8253f551481fd65097add48c6686) Thanks [@nicolasnieto92](https://github.com/nicolasnieto92)! - Add setPriceMode sync action for commercetools-importer project
14
+
15
+ ## 4.10.1
6
16
 
17
+ ### Patch Changes
18
+
19
+ - [#1770](https://github.com/commercetools/nodejs/pull/1770) [`381d1e1f`](https://github.com/commercetools/nodejs/commit/381d1e1f07cc2705962973e3a48934bf7884e309) Thanks [@mohib0306](https://github.com/mohib0306)! - Fix product selection's name update action. `setName` => `changeName`
20
+ Expose `createSyncProductSelections` from `sync-actions` package
21
+
22
+ ## 4.10.0
23
+
24
+ ### Minor Changes
7
25
 
8
26
  - [#1767](https://github.com/commercetools/nodejs/pull/1767) [`1aef3423`](https://github.com/commercetools/nodejs/commit/1aef3423e96da7f5df20fd5f66ec29146cacee83) Thanks [@mohib0306](https://github.com/mohib0306)! - feat(sync-actions/product-selections): add sync action support for product selections
9
-
27
+
10
28
  As product selections are available via the API, the sync-actions package is updated to support generating update actions for product selections.
@@ -700,7 +700,7 @@ function buildReferenceActions(_ref4) {
700
700
  });
701
701
  }
702
702
 
703
- var baseActionsList$h = [{
703
+ var baseActionsList$i = [{
704
704
  action: 'changeName',
705
705
  key: 'name'
706
706
  }, {
@@ -737,10 +737,10 @@ var referenceActionsList$3 = [{
737
737
  * SYNC FUNCTIONS
738
738
  */
739
739
 
740
- function actionsMapBase$h(diff, oldObj, newObj) {
740
+ function actionsMapBase$i(diff, oldObj, newObj) {
741
741
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
742
742
  return buildBaseAttributesActions({
743
- actions: baseActionsList$h,
743
+ actions: baseActionsList$i,
744
744
  diff: diff,
745
745
  oldObj: oldObj,
746
746
  newObj: newObj,
@@ -844,7 +844,7 @@ function createCategoryMapActions(mapActionGroup, syncActionConfig) {
844
844
  return function doMapActions(diff, newObj, oldObj) {
845
845
  var allActions = [];
846
846
  allActions.push(mapActionGroup('base', function () {
847
- return actionsMapBase$h(diff, oldObj, newObj, syncActionConfig);
847
+ return actionsMapBase$i(diff, oldObj, newObj, syncActionConfig);
848
848
  }));
849
849
  allActions.push(mapActionGroup('references', function () {
850
850
  return actionsMapReferences$3(diff, oldObj, newObj);
@@ -880,7 +880,7 @@ var categories = (function (actionGroupList, syncActionConfig) {
880
880
  };
881
881
  });
882
882
 
883
- var baseActionsList$g = [{
883
+ var baseActionsList$h = [{
884
884
  action: 'setSalutation',
885
885
  key: 'salutation'
886
886
  }, {
@@ -940,10 +940,10 @@ var referenceActionsList$2 = [{
940
940
  * SYNC FUNCTIONS
941
941
  */
942
942
 
943
- function actionsMapBase$g(diff, oldObj, newObj) {
943
+ function actionsMapBase$h(diff, oldObj, newObj) {
944
944
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
945
945
  return buildBaseAttributesActions({
946
- actions: baseActionsList$g,
946
+ actions: baseActionsList$h,
947
947
  diff: diff,
948
948
  oldObj: oldObj,
949
949
  newObj: newObj,
@@ -1027,7 +1027,7 @@ function createCustomerMapActions(mapActionGroup, syncActionConfig) {
1027
1027
  return function doMapActions(diff, newObj, oldObj) {
1028
1028
  var allActions = [];
1029
1029
  allActions.push(mapActionGroup('base', function () {
1030
- return actionsMapBase$g(diff, oldObj, newObj, syncActionConfig);
1030
+ return actionsMapBase$h(diff, oldObj, newObj, syncActionConfig);
1031
1031
  }));
1032
1032
  allActions.push(mapActionGroup('references', function () {
1033
1033
  return actionsMapReferences$2(diff, oldObj, newObj);
@@ -1069,7 +1069,7 @@ var customers = (function (actionGroupList, syncActionConfig) {
1069
1069
  };
1070
1070
  });
1071
1071
 
1072
- var baseActionsList$f = [{
1072
+ var baseActionsList$g = [{
1073
1073
  action: 'changeQuantity',
1074
1074
  key: 'quantityOnStock',
1075
1075
  actionKey: 'quantity'
@@ -1088,10 +1088,10 @@ var referenceActionsList$1 = [{
1088
1088
  * SYNC FUNCTIONS
1089
1089
  */
1090
1090
 
1091
- function actionsMapBase$f(diff, oldObj, newObj) {
1091
+ function actionsMapBase$g(diff, oldObj, newObj) {
1092
1092
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1093
1093
  return buildBaseAttributesActions({
1094
- actions: baseActionsList$f,
1094
+ actions: baseActionsList$g,
1095
1095
  diff: diff,
1096
1096
  oldObj: oldObj,
1097
1097
  newObj: newObj,
@@ -1111,7 +1111,7 @@ function createInventoryMapActions(mapActionGroup, syncActionConfig) {
1111
1111
  return function doMapActions(diff, newObj, oldObj) {
1112
1112
  var allActions = [];
1113
1113
  allActions.push(mapActionGroup('base', function () {
1114
- return actionsMapBase$f(diff, oldObj, newObj, syncActionConfig);
1114
+ return actionsMapBase$g(diff, oldObj, newObj, syncActionConfig);
1115
1115
  }));
1116
1116
  allActions.push(mapActionGroup('references', function () {
1117
1117
  return actionsMapReferences$1(diff, oldObj, newObj);
@@ -1206,7 +1206,7 @@ function findMatchingPairs(diff) {
1206
1206
 
1207
1207
  var REGEX_NUMBER$2 = new RegExp(/^\d+$/);
1208
1208
  var REGEX_UNDERSCORE_NUMBER$2 = new RegExp(/^_\d+$/);
1209
- var baseActionsList$e = [{
1209
+ var baseActionsList$f = [{
1210
1210
  action: 'changeName',
1211
1211
  key: 'name'
1212
1212
  }, {
@@ -1221,6 +1221,9 @@ var baseActionsList$e = [{
1221
1221
  }, {
1222
1222
  action: 'setKey',
1223
1223
  key: 'key'
1224
+ }, {
1225
+ action: 'setPriceMode',
1226
+ key: 'priceMode'
1224
1227
  }];
1225
1228
  var baseAssetActionsList = [{
1226
1229
  action: 'setAssetKey',
@@ -1610,10 +1613,10 @@ function _buildVariantAssetsActions(diffAssets, oldVariant, newVariant) {
1610
1613
  */
1611
1614
 
1612
1615
 
1613
- function actionsMapBase$e(diff, oldObj, newObj) {
1616
+ function actionsMapBase$f(diff, oldObj, newObj) {
1614
1617
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1615
1618
  return buildBaseAttributesActions({
1616
- actions: baseActionsList$e,
1619
+ actions: baseActionsList$f,
1617
1620
  diff: diff,
1618
1621
  oldObj: oldObj,
1619
1622
  newObj: newObj,
@@ -1854,7 +1857,7 @@ function createProductMapActions(mapActionGroup, syncActionConfig) {
1854
1857
  return actionsMapRemoveVariants(diff, oldObj, newObj);
1855
1858
  }));
1856
1859
  allActions.push(mapActionGroup('base', function () {
1857
- return actionsMapBase$e(diff, oldObj, newObj, syncActionConfig);
1860
+ return actionsMapBase$f(diff, oldObj, newObj, syncActionConfig);
1858
1861
  }));
1859
1862
  allActions.push(mapActionGroup('meta', function () {
1860
1863
  return actionsMapMeta(diff, oldObj, newObj);
@@ -1929,7 +1932,7 @@ var isRemoveAction = function isRemoveAction(key, resource) {
1929
1932
  return REGEX_UNDERSCORE_NUMBER$1.test(key) && Number(resource[2]) === 0;
1930
1933
  };
1931
1934
 
1932
- var baseActionsList$d = [{
1935
+ var baseActionsList$e = [{
1933
1936
  action: 'changeOrderState',
1934
1937
  key: 'orderState'
1935
1938
  }, {
@@ -1943,10 +1946,10 @@ var baseActionsList$d = [{
1943
1946
  * SYNC FUNCTIONS
1944
1947
  */
1945
1948
 
1946
- function actionsMapBase$d(diff, oldObj, newObj) {
1949
+ function actionsMapBase$e(diff, oldObj, newObj) {
1947
1950
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1948
1951
  return buildBaseAttributesActions({
1949
- actions: baseActionsList$d,
1952
+ actions: baseActionsList$e,
1950
1953
  diff: diff,
1951
1954
  oldObj: oldObj,
1952
1955
  newObj: newObj,
@@ -2079,7 +2082,7 @@ function createOrderMapActions(mapActionGroup, syncActionConfig) {
2079
2082
  }
2080
2083
 
2081
2084
  allActions.push(mapActionGroup('base', function () {
2082
- return actionsMapBase$d(diff, oldObj, newObj, syncActionConfig);
2085
+ return actionsMapBase$e(diff, oldObj, newObj, syncActionConfig);
2083
2086
  }));
2084
2087
  allActions.push(mapActionGroup('deliveries', function () {
2085
2088
  return actionsMapDeliveries(diff, oldObj, newObj);
@@ -2115,7 +2118,7 @@ var orders = (function (actionGroupList, syncActionConfig) {
2115
2118
  };
2116
2119
  });
2117
2120
 
2118
- var baseActionsList$c = [{
2121
+ var baseActionsList$d = [{
2119
2122
  action: 'changeIsActive',
2120
2123
  key: 'isActive'
2121
2124
  }, {
@@ -2143,10 +2146,10 @@ var baseActionsList$c = [{
2143
2146
  action: 'setKey',
2144
2147
  key: 'key'
2145
2148
  }];
2146
- function actionsMapBase$c(diff, oldObj, newObj) {
2149
+ function actionsMapBase$d(diff, oldObj, newObj) {
2147
2150
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2148
2151
  return buildBaseAttributesActions({
2149
- actions: baseActionsList$c,
2152
+ actions: baseActionsList$d,
2150
2153
  diff: diff,
2151
2154
  oldObj: oldObj,
2152
2155
  newObj: newObj,
@@ -2187,7 +2190,7 @@ function createProductDiscountsMapActions(mapActionGroup, syncActionConfig) {
2187
2190
  return function doMapActions(diff, newObj, oldObj) {
2188
2191
  var allActions = [];
2189
2192
  allActions.push(mapActionGroup('base', function () {
2190
- return actionsMapBase$c(diff, oldObj, newObj, syncActionConfig);
2193
+ return actionsMapBase$d(diff, oldObj, newObj, syncActionConfig);
2191
2194
  }));
2192
2195
  return combineValidityActions(flatten__default["default"](allActions));
2193
2196
  };
@@ -2203,7 +2206,7 @@ var productDiscounts = (function (actionGroupList) {
2203
2206
  };
2204
2207
  });
2205
2208
 
2206
- var baseActionsList$b = [{
2209
+ var baseActionsList$c = [{
2207
2210
  action: 'changeIsActive',
2208
2211
  key: 'isActive'
2209
2212
  }, {
@@ -2234,10 +2237,10 @@ var baseActionsList$b = [{
2234
2237
  action: 'changeGroups',
2235
2238
  key: 'groups'
2236
2239
  }];
2237
- function actionsMapBase$b(diff, oldObj, newObj) {
2240
+ function actionsMapBase$c(diff, oldObj, newObj) {
2238
2241
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2239
2242
  return buildBaseAttributesActions({
2240
- actions: baseActionsList$b,
2243
+ actions: baseActionsList$c,
2241
2244
  diff: diff,
2242
2245
  oldObj: oldObj,
2243
2246
  newObj: newObj,
@@ -2249,7 +2252,7 @@ function createDiscountCodesMapActions(mapActionGroup, syncActionConfig) {
2249
2252
  return function doMapActions(diff, newObj, oldObj) {
2250
2253
  var allActions = [];
2251
2254
  allActions.push(mapActionGroup('base', function () {
2252
- return actionsMapBase$b(diff, oldObj, newObj, syncActionConfig);
2255
+ return actionsMapBase$c(diff, oldObj, newObj, syncActionConfig);
2253
2256
  }));
2254
2257
  allActions.push(mapActionGroup('custom', function () {
2255
2258
  return actionsMapCustom(diff, newObj, oldObj);
@@ -2277,17 +2280,17 @@ var discountCodes = (function (actionGroupList) {
2277
2280
  };
2278
2281
  });
2279
2282
 
2280
- var baseActionsList$a = [{
2283
+ var baseActionsList$b = [{
2281
2284
  action: 'changeName',
2282
2285
  key: 'name'
2283
2286
  }, {
2284
2287
  action: 'setKey',
2285
2288
  key: 'key'
2286
2289
  }];
2287
- function actionsMapBase$a(diff, oldObj, newObj) {
2290
+ function actionsMapBase$b(diff, oldObj, newObj) {
2288
2291
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2289
2292
  return buildBaseAttributesActions({
2290
- actions: baseActionsList$a,
2293
+ actions: baseActionsList$b,
2291
2294
  diff: diff,
2292
2295
  oldObj: oldObj,
2293
2296
  newObj: newObj,
@@ -2299,7 +2302,7 @@ function createCustomerGroupMapActions(mapActionGroup, syncActionConfig) {
2299
2302
  return function doMapActions(diff, newObj, oldObj) {
2300
2303
  var allActions = [];
2301
2304
  allActions.push(mapActionGroup('base', function () {
2302
- return actionsMapBase$a(diff, oldObj, newObj, syncActionConfig);
2305
+ return actionsMapBase$b(diff, oldObj, newObj, syncActionConfig);
2303
2306
  }));
2304
2307
  allActions.push(mapActionGroup('custom', function () {
2305
2308
  return actionsMapCustom(diff, newObj, oldObj);
@@ -2318,7 +2321,7 @@ var customerGroup = (function (actionGroupList) {
2318
2321
  };
2319
2322
  });
2320
2323
 
2321
- var baseActionsList$9 = [{
2324
+ var baseActionsList$a = [{
2322
2325
  action: 'changeIsActive',
2323
2326
  key: 'isActive'
2324
2327
  }, {
@@ -2355,10 +2358,10 @@ var baseActionsList$9 = [{
2355
2358
  action: 'setKey',
2356
2359
  key: 'key'
2357
2360
  }];
2358
- function actionsMapBase$9(diff, oldObj, newObj) {
2361
+ function actionsMapBase$a(diff, oldObj, newObj) {
2359
2362
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2360
2363
  return buildBaseAttributesActions({
2361
- actions: baseActionsList$9,
2364
+ actions: baseActionsList$a,
2362
2365
  diff: diff,
2363
2366
  oldObj: oldObj,
2364
2367
  newObj: newObj,
@@ -2370,7 +2373,7 @@ function createCartDiscountsMapActions(mapActionGroup, syncActionConfig) {
2370
2373
  return function doMapActions(diff, newObj, oldObj) {
2371
2374
  var allActions = [];
2372
2375
  allActions.push(mapActionGroup('base', function () {
2373
- return actionsMapBase$9(diff, oldObj, newObj, syncActionConfig);
2376
+ return actionsMapBase$a(diff, oldObj, newObj, syncActionConfig);
2374
2377
  }));
2375
2378
  allActions.push(mapActionGroup('custom', function () {
2376
2379
  return actionsMapCustom(diff, newObj, oldObj);
@@ -2389,7 +2392,7 @@ var cartDiscounts = (function (actionGroupList) {
2389
2392
  };
2390
2393
  });
2391
2394
 
2392
- var baseActionsList$8 = [{
2395
+ var baseActionsList$9 = [{
2393
2396
  action: 'changeName',
2394
2397
  key: 'name'
2395
2398
  }, {
@@ -2399,10 +2402,10 @@ var baseActionsList$8 = [{
2399
2402
  action: 'setDescription',
2400
2403
  key: 'description'
2401
2404
  }];
2402
- function actionsMapBase$8(diff, oldObj, newObj) {
2405
+ function actionsMapBase$9(diff, oldObj, newObj) {
2403
2406
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2404
2407
  return buildBaseAttributesActions({
2405
- actions: baseActionsList$8,
2408
+ actions: baseActionsList$9,
2406
2409
  diff: diff,
2407
2410
  oldObj: oldObj,
2408
2411
  newObj: newObj,
@@ -2436,7 +2439,7 @@ function createTaxCategoriesMapActions(mapActionGroup, syncActionConfig) {
2436
2439
  return function doMapActions(diff, newObj, oldObj) {
2437
2440
  var allActions = [];
2438
2441
  allActions.push(mapActionGroup('base', function () {
2439
- return actionsMapBase$8(diff, oldObj, newObj, syncActionConfig);
2442
+ return actionsMapBase$9(diff, oldObj, newObj, syncActionConfig);
2440
2443
  }));
2441
2444
  allActions.push(mapActionGroup('rates', function () {
2442
2445
  return actionsMapRates(diff, oldObj, newObj);
@@ -2463,7 +2466,7 @@ var taxCategories = (function (actionGroupList, syncActionConfig) {
2463
2466
  };
2464
2467
  });
2465
2468
 
2466
- var baseActionsList$7 = [{
2469
+ var baseActionsList$8 = [{
2467
2470
  action: 'changeName',
2468
2471
  key: 'name'
2469
2472
  }, {
@@ -2480,10 +2483,10 @@ var hasLocation = function hasLocation(locations, otherLocation) {
2480
2483
  });
2481
2484
  };
2482
2485
 
2483
- function actionsMapBase$7(diff, oldObj, newObj) {
2486
+ function actionsMapBase$8(diff, oldObj, newObj) {
2484
2487
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2485
2488
  return buildBaseAttributesActions({
2486
- actions: baseActionsList$7,
2489
+ actions: baseActionsList$8,
2487
2490
  diff: diff,
2488
2491
  oldObj: oldObj,
2489
2492
  newObj: newObj,
@@ -2528,7 +2531,7 @@ function createZonesMapActions(mapActionGroup, syncActionConfig) {
2528
2531
  return function doMapActions(diff, newObj, oldObj) {
2529
2532
  var allActions = [];
2530
2533
  allActions.push(mapActionGroup('base', function () {
2531
- return actionsMapBase$7(diff, oldObj, newObj, syncActionConfig);
2534
+ return actionsMapBase$8(diff, oldObj, newObj, syncActionConfig);
2532
2535
  }));
2533
2536
  allActions.push(flatten__default["default"](mapActionGroup('locations', function () {
2534
2537
  return actionsMapLocations(diff, oldObj, newObj);
@@ -2555,7 +2558,7 @@ var zones = (function (actionGroupList, syncActionConfig) {
2555
2558
  };
2556
2559
  });
2557
2560
 
2558
- var baseActionsList$6 = [{
2561
+ var baseActionsList$7 = [{
2559
2562
  action: 'setKey',
2560
2563
  key: 'key'
2561
2564
  }, {
@@ -2577,10 +2580,10 @@ var baseActionsList$6 = [{
2577
2580
  action: 'changeTaxCategory',
2578
2581
  key: 'taxCategory'
2579
2582
  }];
2580
- function actionsMapBase$6(diff, oldObj, newObj) {
2583
+ function actionsMapBase$7(diff, oldObj, newObj) {
2581
2584
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2582
2585
  return buildBaseAttributesActions({
2583
- actions: baseActionsList$6,
2586
+ actions: baseActionsList$7,
2584
2587
  diff: diff,
2585
2588
  oldObj: oldObj,
2586
2589
  newObj: newObj,
@@ -2662,7 +2665,7 @@ function createShippingMethodsMapActions(mapActionGroup, syncActionConfig) {
2662
2665
  return function doMapActions(diff, newObj, oldObj) {
2663
2666
  var allActions = [];
2664
2667
  allActions.push(mapActionGroup('base', function () {
2665
- return actionsMapBase$6(diff, oldObj, newObj, syncActionConfig);
2668
+ return actionsMapBase$7(diff, oldObj, newObj, syncActionConfig);
2666
2669
  }));
2667
2670
  allActions.push(flatten__default["default"](mapActionGroup('zoneRates', function () {
2668
2671
  return actionsMapZoneRates(diff, oldObj, newObj);
@@ -3173,7 +3176,7 @@ createComparator(function () {
3173
3176
  createComparator(createCircularEqualCreator());
3174
3177
  createComparator(createCircularEqualCreator(sameValueZeroEqual));
3175
3178
 
3176
- var baseActionsList$5 = [{
3179
+ var baseActionsList$6 = [{
3177
3180
  action: 'changeName',
3178
3181
  key: 'name'
3179
3182
  }, {
@@ -3183,7 +3186,7 @@ var baseActionsList$5 = [{
3183
3186
  action: 'changeDescription',
3184
3187
  key: 'description'
3185
3188
  }];
3186
- function actionsMapBase$5(diff, previous, next) {
3189
+ function actionsMapBase$6(diff, previous, next) {
3187
3190
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3188
3191
  // when `diff` is undefined, then the underlying `buildActions` has returned any diff
3189
3192
  // which given in product-types would mean that `buildActions` has run with `nestedValuesChanges` applied
@@ -3191,7 +3194,7 @@ function actionsMapBase$5(diff, previous, next) {
3191
3194
  if (!diff) return [];
3192
3195
  return buildBaseAttributesActions({
3193
3196
  diff: diff,
3194
- actions: baseActionsList$5,
3197
+ actions: baseActionsList$6,
3195
3198
  oldObj: previous,
3196
3199
  newObj: next,
3197
3200
  shouldOmitEmptyString: config.shouldOmitEmptyString
@@ -3417,7 +3420,7 @@ function createProductTypeMapActions(mapActionGroup, syncActionConfig) {
3417
3420
  return flatten__default["default"]([// we support only base fields for the product type,
3418
3421
  // for attributes, applying hints would be recommended
3419
3422
  mapActionGroup('base', function () {
3420
- return actionsMapBase$5(diff, previous, next, syncActionConfig);
3423
+ return actionsMapBase$6(diff, previous, next, syncActionConfig);
3421
3424
  }), actionsMapForHints(options.nestedValuesChanges, previous, next)]);
3422
3425
  };
3423
3426
  }
@@ -3434,7 +3437,7 @@ var productTypes = (function (actionGroupList, syncActionConfig) {
3434
3437
  };
3435
3438
  });
3436
3439
 
3437
- var baseActionsList$4 = [{
3440
+ var baseActionsList$5 = [{
3438
3441
  action: 'changeKey',
3439
3442
  key: 'key'
3440
3443
  }, {
@@ -3453,10 +3456,10 @@ var baseActionsList$4 = [{
3453
3456
  action: 'setTransitions',
3454
3457
  key: 'transitions'
3455
3458
  }];
3456
- function actionsMapBase$4(diff, oldObj, newObj) {
3459
+ function actionsMapBase$5(diff, oldObj, newObj) {
3457
3460
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3458
3461
  return buildBaseAttributesActions({
3459
- actions: baseActionsList$4,
3462
+ actions: baseActionsList$5,
3460
3463
  diff: diff,
3461
3464
  oldObj: oldObj,
3462
3465
  newObj: newObj,
@@ -3506,7 +3509,7 @@ function createStatesMapActions(mapActionGroup, syncActionConfig) {
3506
3509
  var baseActions = [];
3507
3510
  var roleActions = [];
3508
3511
  baseActions.push(mapActionGroup('base', function () {
3509
- return actionsMapBase$4(diff, oldObj, newObj, syncActionConfig);
3512
+ return actionsMapBase$5(diff, oldObj, newObj, syncActionConfig);
3510
3513
  }));
3511
3514
  roleActions.push(mapActionGroup('roles', function () {
3512
3515
  return actionsMapRoles(diff, oldObj, newObj);
@@ -3524,7 +3527,7 @@ var states = (function (actionGroupList, syncActionConfig) {
3524
3527
  };
3525
3528
  });
3526
3529
 
3527
- var baseActionsList$3 = [{
3530
+ var baseActionsList$4 = [{
3528
3531
  action: 'changeKey',
3529
3532
  key: 'key'
3530
3533
  }, {
@@ -3543,10 +3546,10 @@ var baseActionsList$3 = [{
3543
3546
  action: 'setRoles',
3544
3547
  key: 'roles'
3545
3548
  }];
3546
- function actionsMapBase$3(diff, oldObj, newObj) {
3549
+ function actionsMapBase$4(diff, oldObj, newObj) {
3547
3550
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3548
3551
  return buildBaseAttributesActions({
3549
- actions: baseActionsList$3,
3552
+ actions: baseActionsList$4,
3550
3553
  diff: diff,
3551
3554
  oldObj: oldObj,
3552
3555
  newObj: newObj,
@@ -3558,7 +3561,7 @@ function createChannelsMapActions$1(mapActionGroup, syncActionConfig) {
3558
3561
  return function doMapActions(diff, newObj, oldObj) {
3559
3562
  var allActions = [];
3560
3563
  allActions.push(mapActionGroup('base', function () {
3561
- return actionsMapBase$3(diff, oldObj, newObj, syncActionConfig);
3564
+ return actionsMapBase$4(diff, oldObj, newObj, syncActionConfig);
3562
3565
  }));
3563
3566
  allActions.push(mapActionGroup('custom', function () {
3564
3567
  return actionsMapCustom(diff, newObj, oldObj);
@@ -3588,7 +3591,7 @@ var getIsRemovedOperation = function getIsRemovedOperation(key) {
3588
3591
  return REGEX_UNDERSCORE_NUMBER.test(key);
3589
3592
  };
3590
3593
 
3591
- var baseActionsList$2 = [{
3594
+ var baseActionsList$3 = [{
3592
3595
  action: 'changeKey',
3593
3596
  key: 'key'
3594
3597
  }, {
@@ -3598,10 +3601,10 @@ var baseActionsList$2 = [{
3598
3601
  action: 'setDescription',
3599
3602
  key: 'description'
3600
3603
  }];
3601
- function actionsMapBase$2(diff, oldObj, newObj) {
3604
+ function actionsMapBase$3(diff, oldObj, newObj) {
3602
3605
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3603
3606
  return buildBaseAttributesActions({
3604
- actions: baseActionsList$2,
3607
+ actions: baseActionsList$3,
3605
3608
  diff: diff,
3606
3609
  oldObj: oldObj,
3607
3610
  newObj: newObj,
@@ -3609,14 +3612,14 @@ function actionsMapBase$2(diff, oldObj, newObj) {
3609
3612
  });
3610
3613
  }
3611
3614
 
3612
- function actionsMapEnums(attributeType, attributeDiff, previous, next) {
3615
+ function actionsMapEnums(fieldName, attributeType, attributeDiff, previous, next) {
3613
3616
  var _createBuildArrayActi;
3614
3617
 
3615
- var addEnumActionName = attributeType === 'enum' ? 'addEnumValue' : 'addLocalizedEnumValue';
3616
- var changeEnumOrderActionName = attributeType === 'enum' ? 'changeEnumValueOrder' : 'changeLocalizedEnumValueOrder';
3618
+ var addEnumActionName = attributeType === 'Enum' ? 'addEnumValue' : 'addLocalizedEnumValue';
3619
+ var changeEnumOrderActionName = attributeType === 'Enum' ? 'changeEnumValueOrder' : 'changeLocalizedEnumValueOrder';
3617
3620
  var buildArrayActions = createBuildArrayActions('values', (_createBuildArrayActi = {}, _defineProperty(_createBuildArrayActi, ADD_ACTIONS, function (newEnum) {
3618
3621
  return {
3619
- fieldName: next.name,
3622
+ fieldName: fieldName,
3620
3623
  action: addEnumActionName,
3621
3624
  value: newEnum
3622
3625
  };
@@ -3632,13 +3635,13 @@ function actionsMapEnums(attributeType, attributeDiff, previous, next) {
3632
3635
 
3633
3636
  if (oldEnumInNext) {
3634
3637
  changeActions.push({
3635
- fieldName: next.name,
3638
+ fieldName: fieldName,
3636
3639
  action: changeEnumOrderActionName,
3637
3640
  value: newEnum
3638
3641
  });
3639
3642
  } else {
3640
3643
  changeActions.push({
3641
- fieldName: next.name,
3644
+ fieldName: fieldName,
3642
3645
  action: addEnumActionName,
3643
3646
  value: newEnum
3644
3647
  });
@@ -3656,7 +3659,7 @@ function actionsMapEnums(attributeType, attributeDiff, previous, next) {
3656
3659
  } else actions.push(updateAction);
3657
3660
  });
3658
3661
  return [].concat(actions, _toConsumableArray(newEnumValuesOrder.length > 0 ? [{
3659
- fieldName: next.name,
3662
+ fieldName: fieldName,
3660
3663
  action: changeEnumOrderActionName,
3661
3664
  keys: newEnumValuesOrder
3662
3665
  }] : []));
@@ -3684,7 +3687,7 @@ function actionsMapFieldDefinitions(fieldDefinitionsDiff, previous, next, diffPa
3684
3687
  fieldName: extractedPairs.oldObj.name
3685
3688
  });
3686
3689
  } else if (diffValue.type.values) {
3687
- actions.push.apply(actions, _toConsumableArray(actionsMapEnums(extractedPairs.oldObj.type.name, diffValue.type, extractedPairs.oldObj.type, extractedPairs.newObj.type)));
3690
+ actions.push.apply(actions, _toConsumableArray(actionsMapEnums(extractedPairs.oldObj.name, extractedPairs.oldObj.type.name, diffValue.type, extractedPairs.oldObj.type, extractedPairs.newObj.type)));
3688
3691
  }
3689
3692
  } else if (getIsRemovedOperation(diffKey)) {
3690
3693
  if (Array.isArray(diffValue)) {
@@ -3718,7 +3721,7 @@ function createTypeMapActions(mapActionGroup, syncActionConfig) {
3718
3721
  return function doMapActions(diff, next, previous) {
3719
3722
  var allActions = [];
3720
3723
  allActions.push(mapActionGroup('base', function () {
3721
- return actionsMapBase$2(diff, previous, next, syncActionConfig);
3724
+ return actionsMapBase$3(diff, previous, next, syncActionConfig);
3722
3725
  }), mapActionGroup('fieldDefinitions', function () {
3723
3726
  return actionsMapFieldDefinitions(diff.fieldDefinitions, previous.fieldDefinitions, next.fieldDefinitions, findMatchingPairs(diff.fieldDefinitions, previous.fieldDefinitions, next.fieldDefinitions, 'name'));
3724
3727
  }));
@@ -3735,7 +3738,7 @@ var types = (function (actionGroupList, syncActionConfig) {
3735
3738
  };
3736
3739
  });
3737
3740
 
3738
- var baseActionsList$1 = [{
3741
+ var baseActionsList$2 = [{
3739
3742
  action: 'changeName',
3740
3743
  key: 'name'
3741
3744
  }, {
@@ -3754,10 +3757,10 @@ var baseActionsList$1 = [{
3754
3757
  action: 'setShippingRateInputType',
3755
3758
  key: 'shippingRateInputType'
3756
3759
  }];
3757
- function actionsMapBase$1(diff, oldObj, newObj) {
3760
+ function actionsMapBase$2(diff, oldObj, newObj) {
3758
3761
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3759
3762
  return buildBaseAttributesActions({
3760
- actions: baseActionsList$1,
3763
+ actions: baseActionsList$2,
3761
3764
  diff: diff,
3762
3765
  oldObj: oldObj,
3763
3766
  newObj: newObj,
@@ -3769,7 +3772,7 @@ function createChannelsMapActions(mapActionGroup, syncActionConfig) {
3769
3772
  return function doMapActions(diff, newObj, oldObj) {
3770
3773
  var allActions = [];
3771
3774
  allActions.push(mapActionGroup('base', function () {
3772
- return actionsMapBase$1(diff, oldObj, newObj, syncActionConfig);
3775
+ return actionsMapBase$2(diff, oldObj, newObj, syncActionConfig);
3773
3776
  }));
3774
3777
  return flatten__default["default"](allActions);
3775
3778
  };
@@ -3785,7 +3788,7 @@ var projects = (function (actionGroupList) {
3785
3788
  };
3786
3789
  });
3787
3790
 
3788
- var baseActionsList = [{
3791
+ var baseActionsList$1 = [{
3789
3792
  action: 'setName',
3790
3793
  key: 'name'
3791
3794
  }, {
@@ -3798,9 +3801,9 @@ var baseActionsList = [{
3798
3801
  action: 'setSupplyChannels',
3799
3802
  key: 'supplyChannels'
3800
3803
  }];
3801
- function actionsMapBase(diff, oldObj, newObj) {
3804
+ function actionsMapBase$1(diff, oldObj, newObj) {
3802
3805
  return buildBaseAttributesActions({
3803
- actions: baseActionsList,
3806
+ actions: baseActionsList$1,
3804
3807
  diff: diff,
3805
3808
  oldObj: oldObj,
3806
3809
  newObj: newObj
@@ -3811,7 +3814,7 @@ function createStoresMapActions(mapActionGroup) {
3811
3814
  return function doMapActions(diff, next, previous) {
3812
3815
  var allActions = [];
3813
3816
  allActions.push(mapActionGroup('base', function () {
3814
- return actionsMapBase(diff, previous, next);
3817
+ return actionsMapBase$1(diff, previous, next);
3815
3818
  }));
3816
3819
  allActions.push(mapActionGroup('custom', function () {
3817
3820
  return actionsMapCustom(diff, next, previous);
@@ -3830,6 +3833,45 @@ var stores = (function (actionGroupList) {
3830
3833
  };
3831
3834
  });
3832
3835
 
3836
+ var baseActionsList = [{
3837
+ action: 'changeName',
3838
+ key: 'name'
3839
+ }, {
3840
+ action: 'setKey',
3841
+ key: 'key'
3842
+ }];
3843
+ function actionsMapBase(diff, oldObj, newObj) {
3844
+ return buildBaseAttributesActions({
3845
+ actions: baseActionsList,
3846
+ diff: diff,
3847
+ oldObj: oldObj,
3848
+ newObj: newObj
3849
+ });
3850
+ }
3851
+
3852
+ function createProductSelectionsMapActions(mapActionGroup) {
3853
+ return function doMapActions(diff, next, previous) {
3854
+ var allActions = [];
3855
+ allActions.push(mapActionGroup('base', function () {
3856
+ return actionsMapBase(diff, previous, next);
3857
+ }));
3858
+ allActions.push(mapActionGroup('custom', function () {
3859
+ return actionsMapCustom(diff, next, previous);
3860
+ }));
3861
+ return flatten__default["default"](allActions);
3862
+ };
3863
+ }
3864
+
3865
+ var productSelections = (function (actionGroupList) {
3866
+ var mapActionGroup = createMapActionGroup(actionGroupList);
3867
+ var doMapActions = createProductSelectionsMapActions(mapActionGroup);
3868
+ var onBeforeApplyingDiff = null;
3869
+ var buildActions = createBuildActions(diff, doMapActions, onBeforeApplyingDiff);
3870
+ return {
3871
+ buildActions: buildActions
3872
+ };
3873
+ });
3874
+
3833
3875
  exports.createSyncCartDiscounts = cartDiscounts;
3834
3876
  exports.createSyncCategories = categories;
3835
3877
  exports.createSyncChannels = channels;
@@ -3839,6 +3881,7 @@ exports.createSyncDiscountCodes = discountCodes;
3839
3881
  exports.createSyncInventories = inventories;
3840
3882
  exports.createSyncOrders = orders;
3841
3883
  exports.createSyncProductDiscounts = productDiscounts;
3884
+ exports.createSyncProductSelections = productSelections;
3842
3885
  exports.createSyncProductTypes = productTypes;
3843
3886
  exports.createSyncProducts = products;
3844
3887
  exports.createSyncProjects = projects;