nl_tokens: / * function push that send a message inside the socket connection to the warehouse server
pl_tokens: function pushConstraints ( constraints , param = config ) { let emitterConstraints = <mask> EventEmitter ( ) ; portSocket = param . portSocket ; addressWarehouse = param . warehouseAddress ; urlSocket = ` ${ addressWarehouse } ${ portSocket } ` ; handshake ( param ) . then ( ( ) => { let socket = io . connect ( urlSocket ) ; let msg = messageBuilder ( constraints , 'pushConstraints' ) ; socket . on ( 'connect' , function ( ) { socket . emit ( 'pushConstraints' , msg ) ; } ) . on ( 'resultsConstraints' , ( messageResults ) => { if ( messageResults . value === 'found' ) { logger_1 . logger . log ( 'info' , ` ` ) ; logger_1 . logger . log ( 'debug' , ` \n ${ JSON . stringify ( messageResults ) } ` ) ; let workPath = messageResults . data [ 0 ] . workDir ; fStdout_fSterr_Check ( workPath ) . on ( 'checkOK' , ( nameOut , nameErr ) => { logger_1 . logger . log ( 'success' , ` ${ messageResults . data . length } ` ) ; emitterConstraints . emit ( 'foundDocs' , nameOut , nameErr , workPath ) ; } ) . on ( 'checkNotOK' , ( ) => { emitterConstraints . emit ( 'notFoundDocs' ) ; } ) ; } ; if ( messageResults . value === 'notFound' ) { logger_1 . logger . log ( 'info' , ` ` ) ; logger_1 . logger . log ( 'debug' , ` \n ${ JSON . stringify ( messageResults ) } ` ) ; emitterConstraints . emit ( 'notFoundDocs' , messageResults ) ; } if ( messageResults . value === 'errorConstraints' ) emitterConstraints . emit ( 'errorDocs' , messageResults ) ; } ) ; } ) . catch ( ( ) => { emitterConstraints . emit ( 'cantConnect' ) ; } ) ; return emitterConstraints ; }