@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.
@@ -695,7 +695,7 @@
695
695
  });
696
696
  }
697
697
 
698
- var baseActionsList$h = [{
698
+ var baseActionsList$i = [{
699
699
  action: 'changeName',
700
700
  key: 'name'
701
701
  }, {
@@ -732,10 +732,10 @@
732
732
  * SYNC FUNCTIONS
733
733
  */
734
734
 
735
- function actionsMapBase$h(diff, oldObj, newObj) {
735
+ function actionsMapBase$i(diff, oldObj, newObj) {
736
736
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
737
737
  return buildBaseAttributesActions({
738
- actions: baseActionsList$h,
738
+ actions: baseActionsList$i,
739
739
  diff: diff,
740
740
  oldObj: oldObj,
741
741
  newObj: newObj,
@@ -839,7 +839,7 @@
839
839
  return function doMapActions(diff, newObj, oldObj) {
840
840
  var allActions = [];
841
841
  allActions.push(mapActionGroup('base', function () {
842
- return actionsMapBase$h(diff, oldObj, newObj, syncActionConfig);
842
+ return actionsMapBase$i(diff, oldObj, newObj, syncActionConfig);
843
843
  }));
844
844
  allActions.push(mapActionGroup('references', function () {
845
845
  return actionsMapReferences$3(diff, oldObj, newObj);
@@ -875,7 +875,7 @@
875
875
  };
876
876
  });
877
877
 
878
- var baseActionsList$g = [{
878
+ var baseActionsList$h = [{
879
879
  action: 'setSalutation',
880
880
  key: 'salutation'
881
881
  }, {
@@ -935,10 +935,10 @@
935
935
  * SYNC FUNCTIONS
936
936
  */
937
937
 
938
- function actionsMapBase$g(diff, oldObj, newObj) {
938
+ function actionsMapBase$h(diff, oldObj, newObj) {
939
939
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
940
940
  return buildBaseAttributesActions({
941
- actions: baseActionsList$g,
941
+ actions: baseActionsList$h,
942
942
  diff: diff,
943
943
  oldObj: oldObj,
944
944
  newObj: newObj,
@@ -1022,7 +1022,7 @@
1022
1022
  return function doMapActions(diff, newObj, oldObj) {
1023
1023
  var allActions = [];
1024
1024
  allActions.push(mapActionGroup('base', function () {
1025
- return actionsMapBase$g(diff, oldObj, newObj, syncActionConfig);
1025
+ return actionsMapBase$h(diff, oldObj, newObj, syncActionConfig);
1026
1026
  }));
1027
1027
  allActions.push(mapActionGroup('references', function () {
1028
1028
  return actionsMapReferences$2(diff, oldObj, newObj);
@@ -1064,7 +1064,7 @@
1064
1064
  };
1065
1065
  });
1066
1066
 
1067
- var baseActionsList$f = [{
1067
+ var baseActionsList$g = [{
1068
1068
  action: 'changeQuantity',
1069
1069
  key: 'quantityOnStock',
1070
1070
  actionKey: 'quantity'
@@ -1083,10 +1083,10 @@
1083
1083
  * SYNC FUNCTIONS
1084
1084
  */
1085
1085
 
1086
- function actionsMapBase$f(diff, oldObj, newObj) {
1086
+ function actionsMapBase$g(diff, oldObj, newObj) {
1087
1087
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1088
1088
  return buildBaseAttributesActions({
1089
- actions: baseActionsList$f,
1089
+ actions: baseActionsList$g,
1090
1090
  diff: diff,
1091
1091
  oldObj: oldObj,
1092
1092
  newObj: newObj,
@@ -1106,7 +1106,7 @@
1106
1106
  return function doMapActions(diff, newObj, oldObj) {
1107
1107
  var allActions = [];
1108
1108
  allActions.push(mapActionGroup('base', function () {
1109
- return actionsMapBase$f(diff, oldObj, newObj, syncActionConfig);
1109
+ return actionsMapBase$g(diff, oldObj, newObj, syncActionConfig);
1110
1110
  }));
1111
1111
  allActions.push(mapActionGroup('references', function () {
1112
1112
  return actionsMapReferences$1(diff, oldObj, newObj);
@@ -1201,7 +1201,7 @@
1201
1201
 
1202
1202
  var REGEX_NUMBER$2 = new RegExp(/^\d+$/);
1203
1203
  var REGEX_UNDERSCORE_NUMBER$2 = new RegExp(/^_\d+$/);
1204
- var baseActionsList$e = [{
1204
+ var baseActionsList$f = [{
1205
1205
  action: 'changeName',
1206
1206
  key: 'name'
1207
1207
  }, {
@@ -1216,6 +1216,9 @@
1216
1216
  }, {
1217
1217
  action: 'setKey',
1218
1218
  key: 'key'
1219
+ }, {
1220
+ action: 'setPriceMode',
1221
+ key: 'priceMode'
1219
1222
  }];
1220
1223
  var baseAssetActionsList = [{
1221
1224
  action: 'setAssetKey',
@@ -1605,10 +1608,10 @@
1605
1608
  */
1606
1609
 
1607
1610
 
1608
- function actionsMapBase$e(diff, oldObj, newObj) {
1611
+ function actionsMapBase$f(diff, oldObj, newObj) {
1609
1612
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1610
1613
  return buildBaseAttributesActions({
1611
- actions: baseActionsList$e,
1614
+ actions: baseActionsList$f,
1612
1615
  diff: diff,
1613
1616
  oldObj: oldObj,
1614
1617
  newObj: newObj,
@@ -1849,7 +1852,7 @@
1849
1852
  return actionsMapRemoveVariants(diff, oldObj, newObj);
1850
1853
  }));
1851
1854
  allActions.push(mapActionGroup('base', function () {
1852
- return actionsMapBase$e(diff, oldObj, newObj, syncActionConfig);
1855
+ return actionsMapBase$f(diff, oldObj, newObj, syncActionConfig);
1853
1856
  }));
1854
1857
  allActions.push(mapActionGroup('meta', function () {
1855
1858
  return actionsMapMeta(diff, oldObj, newObj);
@@ -1924,7 +1927,7 @@
1924
1927
  return REGEX_UNDERSCORE_NUMBER$1.test(key) && Number(resource[2]) === 0;
1925
1928
  };
1926
1929
 
1927
- var baseActionsList$d = [{
1930
+ var baseActionsList$e = [{
1928
1931
  action: 'changeOrderState',
1929
1932
  key: 'orderState'
1930
1933
  }, {
@@ -1938,10 +1941,10 @@
1938
1941
  * SYNC FUNCTIONS
1939
1942
  */
1940
1943
 
1941
- function actionsMapBase$d(diff, oldObj, newObj) {
1944
+ function actionsMapBase$e(diff, oldObj, newObj) {
1942
1945
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1943
1946
  return buildBaseAttributesActions({
1944
- actions: baseActionsList$d,
1947
+ actions: baseActionsList$e,
1945
1948
  diff: diff,
1946
1949
  oldObj: oldObj,
1947
1950
  newObj: newObj,
@@ -2074,7 +2077,7 @@
2074
2077
  }
2075
2078
 
2076
2079
  allActions.push(mapActionGroup('base', function () {
2077
- return actionsMapBase$d(diff, oldObj, newObj, syncActionConfig);
2080
+ return actionsMapBase$e(diff, oldObj, newObj, syncActionConfig);
2078
2081
  }));
2079
2082
  allActions.push(mapActionGroup('deliveries', function () {
2080
2083
  return actionsMapDeliveries(diff, oldObj, newObj);
@@ -2110,7 +2113,7 @@
2110
2113
  };
2111
2114
  });
2112
2115
 
2113
- var baseActionsList$c = [{
2116
+ var baseActionsList$d = [{
2114
2117
  action: 'changeIsActive',
2115
2118
  key: 'isActive'
2116
2119
  }, {
@@ -2138,10 +2141,10 @@
2138
2141
  action: 'setKey',
2139
2142
  key: 'key'
2140
2143
  }];
2141
- function actionsMapBase$c(diff, oldObj, newObj) {
2144
+ function actionsMapBase$d(diff, oldObj, newObj) {
2142
2145
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2143
2146
  return buildBaseAttributesActions({
2144
- actions: baseActionsList$c,
2147
+ actions: baseActionsList$d,
2145
2148
  diff: diff,
2146
2149
  oldObj: oldObj,
2147
2150
  newObj: newObj,
@@ -2182,7 +2185,7 @@
2182
2185
  return function doMapActions(diff, newObj, oldObj) {
2183
2186
  var allActions = [];
2184
2187
  allActions.push(mapActionGroup('base', function () {
2185
- return actionsMapBase$c(diff, oldObj, newObj, syncActionConfig);
2188
+ return actionsMapBase$d(diff, oldObj, newObj, syncActionConfig);
2186
2189
  }));
2187
2190
  return combineValidityActions(flatten__default["default"](allActions));
2188
2191
  };
@@ -2198,7 +2201,7 @@
2198
2201
  };
2199
2202
  });
2200
2203
 
2201
- var baseActionsList$b = [{
2204
+ var baseActionsList$c = [{
2202
2205
  action: 'changeIsActive',
2203
2206
  key: 'isActive'
2204
2207
  }, {
@@ -2229,10 +2232,10 @@
2229
2232
  action: 'changeGroups',
2230
2233
  key: 'groups'
2231
2234
  }];
2232
- function actionsMapBase$b(diff, oldObj, newObj) {
2235
+ function actionsMapBase$c(diff, oldObj, newObj) {
2233
2236
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2234
2237
  return buildBaseAttributesActions({
2235
- actions: baseActionsList$b,
2238
+ actions: baseActionsList$c,
2236
2239
  diff: diff,
2237
2240
  oldObj: oldObj,
2238
2241
  newObj: newObj,
@@ -2244,7 +2247,7 @@
2244
2247
  return function doMapActions(diff, newObj, oldObj) {
2245
2248
  var allActions = [];
2246
2249
  allActions.push(mapActionGroup('base', function () {
2247
- return actionsMapBase$b(diff, oldObj, newObj, syncActionConfig);
2250
+ return actionsMapBase$c(diff, oldObj, newObj, syncActionConfig);
2248
2251
  }));
2249
2252
  allActions.push(mapActionGroup('custom', function () {
2250
2253
  return actionsMapCustom(diff, newObj, oldObj);
@@ -2272,17 +2275,17 @@
2272
2275
  };
2273
2276
  });
2274
2277
 
2275
- var baseActionsList$a = [{
2278
+ var baseActionsList$b = [{
2276
2279
  action: 'changeName',
2277
2280
  key: 'name'
2278
2281
  }, {
2279
2282
  action: 'setKey',
2280
2283
  key: 'key'
2281
2284
  }];
2282
- function actionsMapBase$a(diff, oldObj, newObj) {
2285
+ function actionsMapBase$b(diff, oldObj, newObj) {
2283
2286
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2284
2287
  return buildBaseAttributesActions({
2285
- actions: baseActionsList$a,
2288
+ actions: baseActionsList$b,
2286
2289
  diff: diff,
2287
2290
  oldObj: oldObj,
2288
2291
  newObj: newObj,
@@ -2294,7 +2297,7 @@
2294
2297
  return function doMapActions(diff, newObj, oldObj) {
2295
2298
  var allActions = [];
2296
2299
  allActions.push(mapActionGroup('base', function () {
2297
- return actionsMapBase$a(diff, oldObj, newObj, syncActionConfig);
2300
+ return actionsMapBase$b(diff, oldObj, newObj, syncActionConfig);
2298
2301
  }));
2299
2302
  allActions.push(mapActionGroup('custom', function () {
2300
2303
  return actionsMapCustom(diff, newObj, oldObj);
@@ -2313,7 +2316,7 @@
2313
2316
  };
2314
2317
  });
2315
2318
 
2316
- var baseActionsList$9 = [{
2319
+ var baseActionsList$a = [{
2317
2320
  action: 'changeIsActive',
2318
2321
  key: 'isActive'
2319
2322
  }, {
@@ -2350,10 +2353,10 @@
2350
2353
  action: 'setKey',
2351
2354
  key: 'key'
2352
2355
  }];
2353
- function actionsMapBase$9(diff, oldObj, newObj) {
2356
+ function actionsMapBase$a(diff, oldObj, newObj) {
2354
2357
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2355
2358
  return buildBaseAttributesActions({
2356
- actions: baseActionsList$9,
2359
+ actions: baseActionsList$a,
2357
2360
  diff: diff,
2358
2361
  oldObj: oldObj,
2359
2362
  newObj: newObj,
@@ -2365,7 +2368,7 @@
2365
2368
  return function doMapActions(diff, newObj, oldObj) {
2366
2369
  var allActions = [];
2367
2370
  allActions.push(mapActionGroup('base', function () {
2368
- return actionsMapBase$9(diff, oldObj, newObj, syncActionConfig);
2371
+ return actionsMapBase$a(diff, oldObj, newObj, syncActionConfig);
2369
2372
  }));
2370
2373
  allActions.push(mapActionGroup('custom', function () {
2371
2374
  return actionsMapCustom(diff, newObj, oldObj);
@@ -2384,7 +2387,7 @@
2384
2387
  };
2385
2388
  });
2386
2389
 
2387
- var baseActionsList$8 = [{
2390
+ var baseActionsList$9 = [{
2388
2391
  action: 'changeName',
2389
2392
  key: 'name'
2390
2393
  }, {
@@ -2394,10 +2397,10 @@
2394
2397
  action: 'setDescription',
2395
2398
  key: 'description'
2396
2399
  }];
2397
- function actionsMapBase$8(diff, oldObj, newObj) {
2400
+ function actionsMapBase$9(diff, oldObj, newObj) {
2398
2401
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2399
2402
  return buildBaseAttributesActions({
2400
- actions: baseActionsList$8,
2403
+ actions: baseActionsList$9,
2401
2404
  diff: diff,
2402
2405
  oldObj: oldObj,
2403
2406
  newObj: newObj,
@@ -2431,7 +2434,7 @@
2431
2434
  return function doMapActions(diff, newObj, oldObj) {
2432
2435
  var allActions = [];
2433
2436
  allActions.push(mapActionGroup('base', function () {
2434
- return actionsMapBase$8(diff, oldObj, newObj, syncActionConfig);
2437
+ return actionsMapBase$9(diff, oldObj, newObj, syncActionConfig);
2435
2438
  }));
2436
2439
  allActions.push(mapActionGroup('rates', function () {
2437
2440
  return actionsMapRates(diff, oldObj, newObj);
@@ -2458,7 +2461,7 @@
2458
2461
  };
2459
2462
  });
2460
2463
 
2461
- var baseActionsList$7 = [{
2464
+ var baseActionsList$8 = [{
2462
2465
  action: 'changeName',
2463
2466
  key: 'name'
2464
2467
  }, {
@@ -2475,10 +2478,10 @@
2475
2478
  });
2476
2479
  };
2477
2480
 
2478
- function actionsMapBase$7(diff, oldObj, newObj) {
2481
+ function actionsMapBase$8(diff, oldObj, newObj) {
2479
2482
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2480
2483
  return buildBaseAttributesActions({
2481
- actions: baseActionsList$7,
2484
+ actions: baseActionsList$8,
2482
2485
  diff: diff,
2483
2486
  oldObj: oldObj,
2484
2487
  newObj: newObj,
@@ -2523,7 +2526,7 @@
2523
2526
  return function doMapActions(diff, newObj, oldObj) {
2524
2527
  var allActions = [];
2525
2528
  allActions.push(mapActionGroup('base', function () {
2526
- return actionsMapBase$7(diff, oldObj, newObj, syncActionConfig);
2529
+ return actionsMapBase$8(diff, oldObj, newObj, syncActionConfig);
2527
2530
  }));
2528
2531
  allActions.push(flatten__default["default"](mapActionGroup('locations', function () {
2529
2532
  return actionsMapLocations(diff, oldObj, newObj);
@@ -2550,7 +2553,7 @@
2550
2553
  };
2551
2554
  });
2552
2555
 
2553
- var baseActionsList$6 = [{
2556
+ var baseActionsList$7 = [{
2554
2557
  action: 'setKey',
2555
2558
  key: 'key'
2556
2559
  }, {
@@ -2572,10 +2575,10 @@
2572
2575
  action: 'changeTaxCategory',
2573
2576
  key: 'taxCategory'
2574
2577
  }];
2575
- function actionsMapBase$6(diff, oldObj, newObj) {
2578
+ function actionsMapBase$7(diff, oldObj, newObj) {
2576
2579
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2577
2580
  return buildBaseAttributesActions({
2578
- actions: baseActionsList$6,
2581
+ actions: baseActionsList$7,
2579
2582
  diff: diff,
2580
2583
  oldObj: oldObj,
2581
2584
  newObj: newObj,
@@ -2657,7 +2660,7 @@
2657
2660
  return function doMapActions(diff, newObj, oldObj) {
2658
2661
  var allActions = [];
2659
2662
  allActions.push(mapActionGroup('base', function () {
2660
- return actionsMapBase$6(diff, oldObj, newObj, syncActionConfig);
2663
+ return actionsMapBase$7(diff, oldObj, newObj, syncActionConfig);
2661
2664
  }));
2662
2665
  allActions.push(flatten__default["default"](mapActionGroup('zoneRates', function () {
2663
2666
  return actionsMapZoneRates(diff, oldObj, newObj);
@@ -3168,7 +3171,7 @@
3168
3171
  createComparator(createCircularEqualCreator());
3169
3172
  createComparator(createCircularEqualCreator(sameValueZeroEqual));
3170
3173
 
3171
- var baseActionsList$5 = [{
3174
+ var baseActionsList$6 = [{
3172
3175
  action: 'changeName',
3173
3176
  key: 'name'
3174
3177
  }, {
@@ -3178,7 +3181,7 @@
3178
3181
  action: 'changeDescription',
3179
3182
  key: 'description'
3180
3183
  }];
3181
- function actionsMapBase$5(diff, previous, next) {
3184
+ function actionsMapBase$6(diff, previous, next) {
3182
3185
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3183
3186
  // when `diff` is undefined, then the underlying `buildActions` has returned any diff
3184
3187
  // which given in product-types would mean that `buildActions` has run with `nestedValuesChanges` applied
@@ -3186,7 +3189,7 @@
3186
3189
  if (!diff) return [];
3187
3190
  return buildBaseAttributesActions({
3188
3191
  diff: diff,
3189
- actions: baseActionsList$5,
3192
+ actions: baseActionsList$6,
3190
3193
  oldObj: previous,
3191
3194
  newObj: next,
3192
3195
  shouldOmitEmptyString: config.shouldOmitEmptyString
@@ -3412,7 +3415,7 @@
3412
3415
  return flatten__default["default"]([// we support only base fields for the product type,
3413
3416
  // for attributes, applying hints would be recommended
3414
3417
  mapActionGroup('base', function () {
3415
- return actionsMapBase$5(diff, previous, next, syncActionConfig);
3418
+ return actionsMapBase$6(diff, previous, next, syncActionConfig);
3416
3419
  }), actionsMapForHints(options.nestedValuesChanges, previous, next)]);
3417
3420
  };
3418
3421
  }
@@ -3429,7 +3432,7 @@
3429
3432
  };
3430
3433
  });
3431
3434
 
3432
- var baseActionsList$4 = [{
3435
+ var baseActionsList$5 = [{
3433
3436
  action: 'changeKey',
3434
3437
  key: 'key'
3435
3438
  }, {
@@ -3448,10 +3451,10 @@
3448
3451
  action: 'setTransitions',
3449
3452
  key: 'transitions'
3450
3453
  }];
3451
- function actionsMapBase$4(diff, oldObj, newObj) {
3454
+ function actionsMapBase$5(diff, oldObj, newObj) {
3452
3455
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3453
3456
  return buildBaseAttributesActions({
3454
- actions: baseActionsList$4,
3457
+ actions: baseActionsList$5,
3455
3458
  diff: diff,
3456
3459
  oldObj: oldObj,
3457
3460
  newObj: newObj,
@@ -3501,7 +3504,7 @@
3501
3504
  var baseActions = [];
3502
3505
  var roleActions = [];
3503
3506
  baseActions.push(mapActionGroup('base', function () {
3504
- return actionsMapBase$4(diff, oldObj, newObj, syncActionConfig);
3507
+ return actionsMapBase$5(diff, oldObj, newObj, syncActionConfig);
3505
3508
  }));
3506
3509
  roleActions.push(mapActionGroup('roles', function () {
3507
3510
  return actionsMapRoles(diff, oldObj, newObj);
@@ -3519,7 +3522,7 @@
3519
3522
  };
3520
3523
  });
3521
3524
 
3522
- var baseActionsList$3 = [{
3525
+ var baseActionsList$4 = [{
3523
3526
  action: 'changeKey',
3524
3527
  key: 'key'
3525
3528
  }, {
@@ -3538,10 +3541,10 @@
3538
3541
  action: 'setRoles',
3539
3542
  key: 'roles'
3540
3543
  }];
3541
- function actionsMapBase$3(diff, oldObj, newObj) {
3544
+ function actionsMapBase$4(diff, oldObj, newObj) {
3542
3545
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3543
3546
  return buildBaseAttributesActions({
3544
- actions: baseActionsList$3,
3547
+ actions: baseActionsList$4,
3545
3548
  diff: diff,
3546
3549
  oldObj: oldObj,
3547
3550
  newObj: newObj,
@@ -3553,7 +3556,7 @@
3553
3556
  return function doMapActions(diff, newObj, oldObj) {
3554
3557
  var allActions = [];
3555
3558
  allActions.push(mapActionGroup('base', function () {
3556
- return actionsMapBase$3(diff, oldObj, newObj, syncActionConfig);
3559
+ return actionsMapBase$4(diff, oldObj, newObj, syncActionConfig);
3557
3560
  }));
3558
3561
  allActions.push(mapActionGroup('custom', function () {
3559
3562
  return actionsMapCustom(diff, newObj, oldObj);
@@ -3583,7 +3586,7 @@
3583
3586
  return REGEX_UNDERSCORE_NUMBER.test(key);
3584
3587
  };
3585
3588
 
3586
- var baseActionsList$2 = [{
3589
+ var baseActionsList$3 = [{
3587
3590
  action: 'changeKey',
3588
3591
  key: 'key'
3589
3592
  }, {
@@ -3593,10 +3596,10 @@
3593
3596
  action: 'setDescription',
3594
3597
  key: 'description'
3595
3598
  }];
3596
- function actionsMapBase$2(diff, oldObj, newObj) {
3599
+ function actionsMapBase$3(diff, oldObj, newObj) {
3597
3600
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3598
3601
  return buildBaseAttributesActions({
3599
- actions: baseActionsList$2,
3602
+ actions: baseActionsList$3,
3600
3603
  diff: diff,
3601
3604
  oldObj: oldObj,
3602
3605
  newObj: newObj,
@@ -3604,14 +3607,14 @@
3604
3607
  });
3605
3608
  }
3606
3609
 
3607
- function actionsMapEnums(attributeType, attributeDiff, previous, next) {
3610
+ function actionsMapEnums(fieldName, attributeType, attributeDiff, previous, next) {
3608
3611
  var _createBuildArrayActi;
3609
3612
 
3610
- var addEnumActionName = attributeType === 'enum' ? 'addEnumValue' : 'addLocalizedEnumValue';
3611
- var changeEnumOrderActionName = attributeType === 'enum' ? 'changeEnumValueOrder' : 'changeLocalizedEnumValueOrder';
3613
+ var addEnumActionName = attributeType === 'Enum' ? 'addEnumValue' : 'addLocalizedEnumValue';
3614
+ var changeEnumOrderActionName = attributeType === 'Enum' ? 'changeEnumValueOrder' : 'changeLocalizedEnumValueOrder';
3612
3615
  var buildArrayActions = createBuildArrayActions('values', (_createBuildArrayActi = {}, _defineProperty(_createBuildArrayActi, ADD_ACTIONS, function (newEnum) {
3613
3616
  return {
3614
- fieldName: next.name,
3617
+ fieldName: fieldName,
3615
3618
  action: addEnumActionName,
3616
3619
  value: newEnum
3617
3620
  };
@@ -3627,13 +3630,13 @@
3627
3630
 
3628
3631
  if (oldEnumInNext) {
3629
3632
  changeActions.push({
3630
- fieldName: next.name,
3633
+ fieldName: fieldName,
3631
3634
  action: changeEnumOrderActionName,
3632
3635
  value: newEnum
3633
3636
  });
3634
3637
  } else {
3635
3638
  changeActions.push({
3636
- fieldName: next.name,
3639
+ fieldName: fieldName,
3637
3640
  action: addEnumActionName,
3638
3641
  value: newEnum
3639
3642
  });
@@ -3651,7 +3654,7 @@
3651
3654
  } else actions.push(updateAction);
3652
3655
  });
3653
3656
  return [].concat(actions, _toConsumableArray(newEnumValuesOrder.length > 0 ? [{
3654
- fieldName: next.name,
3657
+ fieldName: fieldName,
3655
3658
  action: changeEnumOrderActionName,
3656
3659
  keys: newEnumValuesOrder
3657
3660
  }] : []));
@@ -3679,7 +3682,7 @@
3679
3682
  fieldName: extractedPairs.oldObj.name
3680
3683
  });
3681
3684
  } else if (diffValue.type.values) {
3682
- actions.push.apply(actions, _toConsumableArray(actionsMapEnums(extractedPairs.oldObj.type.name, diffValue.type, extractedPairs.oldObj.type, extractedPairs.newObj.type)));
3685
+ actions.push.apply(actions, _toConsumableArray(actionsMapEnums(extractedPairs.oldObj.name, extractedPairs.oldObj.type.name, diffValue.type, extractedPairs.oldObj.type, extractedPairs.newObj.type)));
3683
3686
  }
3684
3687
  } else if (getIsRemovedOperation(diffKey)) {
3685
3688
  if (Array.isArray(diffValue)) {
@@ -3713,7 +3716,7 @@
3713
3716
  return function doMapActions(diff, next, previous) {
3714
3717
  var allActions = [];
3715
3718
  allActions.push(mapActionGroup('base', function () {
3716
- return actionsMapBase$2(diff, previous, next, syncActionConfig);
3719
+ return actionsMapBase$3(diff, previous, next, syncActionConfig);
3717
3720
  }), mapActionGroup('fieldDefinitions', function () {
3718
3721
  return actionsMapFieldDefinitions(diff.fieldDefinitions, previous.fieldDefinitions, next.fieldDefinitions, findMatchingPairs(diff.fieldDefinitions, previous.fieldDefinitions, next.fieldDefinitions, 'name'));
3719
3722
  }));
@@ -3730,7 +3733,7 @@
3730
3733
  };
3731
3734
  });
3732
3735
 
3733
- var baseActionsList$1 = [{
3736
+ var baseActionsList$2 = [{
3734
3737
  action: 'changeName',
3735
3738
  key: 'name'
3736
3739
  }, {
@@ -3749,10 +3752,10 @@
3749
3752
  action: 'setShippingRateInputType',
3750
3753
  key: 'shippingRateInputType'
3751
3754
  }];
3752
- function actionsMapBase$1(diff, oldObj, newObj) {
3755
+ function actionsMapBase$2(diff, oldObj, newObj) {
3753
3756
  var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3754
3757
  return buildBaseAttributesActions({
3755
- actions: baseActionsList$1,
3758
+ actions: baseActionsList$2,
3756
3759
  diff: diff,
3757
3760
  oldObj: oldObj,
3758
3761
  newObj: newObj,
@@ -3764,7 +3767,7 @@
3764
3767
  return function doMapActions(diff, newObj, oldObj) {
3765
3768
  var allActions = [];
3766
3769
  allActions.push(mapActionGroup('base', function () {
3767
- return actionsMapBase$1(diff, oldObj, newObj, syncActionConfig);
3770
+ return actionsMapBase$2(diff, oldObj, newObj, syncActionConfig);
3768
3771
  }));
3769
3772
  return flatten__default["default"](allActions);
3770
3773
  };
@@ -3780,7 +3783,7 @@
3780
3783
  };
3781
3784
  });
3782
3785
 
3783
- var baseActionsList = [{
3786
+ var baseActionsList$1 = [{
3784
3787
  action: 'setName',
3785
3788
  key: 'name'
3786
3789
  }, {
@@ -3793,9 +3796,9 @@
3793
3796
  action: 'setSupplyChannels',
3794
3797
  key: 'supplyChannels'
3795
3798
  }];
3796
- function actionsMapBase(diff, oldObj, newObj) {
3799
+ function actionsMapBase$1(diff, oldObj, newObj) {
3797
3800
  return buildBaseAttributesActions({
3798
- actions: baseActionsList,
3801
+ actions: baseActionsList$1,
3799
3802
  diff: diff,
3800
3803
  oldObj: oldObj,
3801
3804
  newObj: newObj
@@ -3806,7 +3809,7 @@
3806
3809
  return function doMapActions(diff, next, previous) {
3807
3810
  var allActions = [];
3808
3811
  allActions.push(mapActionGroup('base', function () {
3809
- return actionsMapBase(diff, previous, next);
3812
+ return actionsMapBase$1(diff, previous, next);
3810
3813
  }));
3811
3814
  allActions.push(mapActionGroup('custom', function () {
3812
3815
  return actionsMapCustom(diff, next, previous);
@@ -3825,6 +3828,45 @@
3825
3828
  };
3826
3829
  });
3827
3830
 
3831
+ var baseActionsList = [{
3832
+ action: 'changeName',
3833
+ key: 'name'
3834
+ }, {
3835
+ action: 'setKey',
3836
+ key: 'key'
3837
+ }];
3838
+ function actionsMapBase(diff, oldObj, newObj) {
3839
+ return buildBaseAttributesActions({
3840
+ actions: baseActionsList,
3841
+ diff: diff,
3842
+ oldObj: oldObj,
3843
+ newObj: newObj
3844
+ });
3845
+ }
3846
+
3847
+ function createProductSelectionsMapActions(mapActionGroup) {
3848
+ return function doMapActions(diff, next, previous) {
3849
+ var allActions = [];
3850
+ allActions.push(mapActionGroup('base', function () {
3851
+ return actionsMapBase(diff, previous, next);
3852
+ }));
3853
+ allActions.push(mapActionGroup('custom', function () {
3854
+ return actionsMapCustom(diff, next, previous);
3855
+ }));
3856
+ return flatten__default["default"](allActions);
3857
+ };
3858
+ }
3859
+
3860
+ var productSelections = (function (actionGroupList) {
3861
+ var mapActionGroup = createMapActionGroup(actionGroupList);
3862
+ var doMapActions = createProductSelectionsMapActions(mapActionGroup);
3863
+ var onBeforeApplyingDiff = null;
3864
+ var buildActions = createBuildActions(diff, doMapActions, onBeforeApplyingDiff);
3865
+ return {
3866
+ buildActions: buildActions
3867
+ };
3868
+ });
3869
+
3828
3870
  exports.createSyncCartDiscounts = cartDiscounts;
3829
3871
  exports.createSyncCategories = categories;
3830
3872
  exports.createSyncChannels = channels;
@@ -3834,6 +3876,7 @@
3834
3876
  exports.createSyncInventories = inventories;
3835
3877
  exports.createSyncOrders = orders;
3836
3878
  exports.createSyncProductDiscounts = productDiscounts;
3879
+ exports.createSyncProductSelections = productSelections;
3837
3880
  exports.createSyncProductTypes = productTypes;
3838
3881
  exports.createSyncProducts = products;
3839
3882
  exports.createSyncProjects = projects;