nl_tokens: Action to sync from one service to another .
pl_tokens: async function sync ( { payload , meta = { } } , { dispatch } ) { debug ( 'Action: SYNC' ) const fromParams = await generateFromParams ( payload , meta , dispatch ) const toParams = generateToParams ( payload , fromParams ) const lastSyncedAt = <mask> Date ( ) const results = await Promise . all ( fromParams . map ( getFromService ( dispatch , payload . type , meta ) ) ) if ( results . some ( ( result ) => result . status !== 'ok' ) ) { return ( results . length === 1 ) ? results [ 0 ] : createError ( makeErrorString ( results ) ) } const data = flatten ( results . map ( ( result ) => result . data ) ) . filter ( Boolean ) if ( data . length === 0 && payload . syncNoData !== true ) { return createError ( ` ${ fromParams [ 0 ] . service } ` , 'noaction' ) } return Promise . all ( [ ... createSetMetas ( fromParams , lastSyncedAt , meta . ident , dispatch ) , dispatch ( action ( 'SET' , { data , ... toParams } , { ... meta , queue : true } ) ) ] ) . then ( ( responses ) => { return { status : 'ok' , data : responses } } ) }