lib/storage/pipeStorage.js
function outboundPayload( pipe ){
	//Clone first
	var result = JSON.parse(JSON.stringify( pipe ) );
	if ( result.hasOwnProperty("tables")){
		//Filtered down the table object as the info it contains is too big to be transported back and forth
		result.tables = _.map( result.tables, function( table ){
			var ret = { name: table.name, label: table.label, labelPlural: table.labelPlural };
			//Check for field that start with prefix CLIENT_ which means that the connector expects the value to be sent to client
			_.map(table, function(value, key){
				if ( _.startsWith(key, "CLIENT_")){
					ret[key] = value;
				}
			});
			return ret;
		});
	}
	
	if ( result.hasOwnProperty( "sf") ){
		delete result.sf;
	}
	return result;
}
function outboundPayload( pipe ){
	//Clone first
	var result = JSON.parse(JSON.stringify( pipe ) );
	if ( result.hasOwnProperty("tables")){
		//Filtered down the table object as the info it contains is too big to be transported back and forth
		result.tables = _.map( result.tables, function( table ){
			var ret = { name: table.name, label: table.label, labelPlural: table.labelPlural };
			//Check for field that start with prefix CLIENT_ which means that the connector expects the value to be sent to client
			_.map(table, function(value, key){
				if ( _.startsWith(key, "CLIENT_")){
					ret[key] = value;
				}
			});
			return ret;
		});
	}
	
	if ( result.hasOwnProperty( "sf") ){
		delete result.sf;
	}
	return result;
}
function outboundPayload ( pipe ) { //Clone first var result = JSON . parse ( JSON . stringify ( pipe ) ) ; if ( result . hasOwnProperty ( "tables" ) ) { //Filtered down the table object as the info it contains is too big to be transported back and forth result . tables = _ . map ( result . tables , function ( table ) { var ret = { name : table . name , label : table . label , labelPlural : table . labelPlural } ; //Check for field that start with prefix CLIENT_ which means that the connector expects the value to be sent to client _ . map ( table , function ( value , key ) { if ( _ . startsWith ( key , "CLIENT_" ) ) { ret [ key ] = value ; } } ) ; return ret ; } ) ; } if ( result . hasOwnProperty ( "sf" ) ) { delete result . sf ; } return result ; }
Return a filtered down version of the pipe for outbound purposes
@param pipe
Return a filtered down version of the pipe for outbound purposes