@@ -4,7 +4,7 @@ import type {
44 SyncActionConfig ,
55 UpdateAction ,
66} from '@commercetools/sdk-client-v2'
7- import actionsMapAssets from './assets-actions'
7+ import actionsMapAssets from './category- assets-actions'
88import {
99 actionsMapBase ,
1010 actionsMapMeta ,
@@ -14,56 +14,43 @@ import { SyncAction } from './types/update-actions'
1414import actionsMapCustom from './utils/action-map-custom'
1515import copyEmptyArrayProps from './utils/copy-empty-array-props'
1616import createBuildActions from './utils/create-build-actions'
17- import createMapActionGroup from './utils/create-map-action-group'
17+ import createMapActionGroup , {
18+ MapActionGroup ,
19+ MapActionResult ,
20+ } from './utils/create-map-action-group'
1821import { diff } from './utils/diffpatcher'
1922
2023export const actionGroups = [ 'base' , 'references' , 'meta' , 'custom' , 'assets' ]
2124
2225function createCategoryMapActions (
23- mapActionGroup : Function ,
26+ mapActionGroup : MapActionGroup ,
2427 syncActionConfig ?: SyncActionConfig
25- ) : ( diff : any , newObj : any , oldObj : any ) => Array < UpdateAction > {
26- return function doMapActions (
27- diff : any ,
28- newObj : any ,
29- oldObj : any /* , options */
30- ) : Array < UpdateAction > {
31- const allActions = [ ]
28+ ) : MapActionResult {
29+ return function doMapActions ( diff , newObj , oldObj ) {
30+ const allActions : Array < Array < UpdateAction > > = [ ]
3231
3332 allActions . push (
34- mapActionGroup (
35- 'base' ,
36- ( ) : Array < UpdateAction > =>
37- actionsMapBase ( diff , oldObj , newObj , syncActionConfig )
33+ mapActionGroup ( 'base' , ( ) =>
34+ actionsMapBase ( diff , oldObj , newObj , syncActionConfig )
3835 )
3936 )
4037
4138 allActions . push (
42- mapActionGroup (
43- 'references' ,
44- ( ) : Array < UpdateAction > => actionsMapReferences ( diff , oldObj , newObj )
39+ mapActionGroup ( 'references' , ( ) =>
40+ actionsMapReferences ( diff , oldObj , newObj )
4541 )
4642 )
4743
4844 allActions . push (
49- mapActionGroup (
50- 'meta' ,
51- ( ) : Array < UpdateAction > => actionsMapMeta ( diff , oldObj , newObj )
52- )
45+ mapActionGroup ( 'meta' , ( ) => actionsMapMeta ( diff , oldObj , newObj ) )
5346 )
5447
5548 allActions . push (
56- mapActionGroup (
57- 'custom' ,
58- ( ) : Array < UpdateAction > => actionsMapCustom ( diff , newObj , oldObj )
59- )
49+ mapActionGroup ( 'custom' , ( ) => actionsMapCustom ( diff , newObj , oldObj ) )
6050 )
6151
6252 allActions . push (
63- mapActionGroup (
64- 'assets' ,
65- ( ) : Array < UpdateAction > => actionsMapAssets ( diff , oldObj , newObj )
66- )
53+ mapActionGroup ( 'assets' , ( ) => actionsMapAssets ( diff , oldObj , newObj ) )
6754 )
6855
6956 return allActions . flat ( )
0 commit comments