services/personality_insights/v3.js
function Node(config) {
    RED.nodes.createNode(this,config);
    var node = this,
      message = '';

    this.on('input', function (msg) {
      node.status({});

      payloadCheck(msg)
      .then(function(){
        return wordcountCheck(msg, config);
      })
      .then(function(){
        return credentialsCheck(node);
      })
      .then(function(){
        return setEndPoint(config);
      })
      .then(function(){
        return prepareParams(msg, config);
      })
      .then(function(params){

        node.status({fill:'blue', shape:'dot', text:'requesting'});
        return executeService(msg, params);
      })
      .then(function(){
        node.status({});
        node.send(msg);
      })
      .catch(function(err){
        payloadutils.reportError(node, msg, err);
        node.send(msg);
      });
    });
  }
function Node(config) {
    RED.nodes.createNode(this,config);
    var node = this,
      message = '';

    this.on('input', function (msg) {
      node.status({});

      payloadCheck(msg)
      .then(function(){
        return wordcountCheck(msg, config);
      })
      .then(function(){
        return credentialsCheck(node);
      })
      .then(function(){
        return setEndPoint(config);
      })
      .then(function(){
        return prepareParams(msg, config);
      })
      .then(function(params){

        node.status({fill:'blue', shape:'dot', text:'requesting'});
        return executeService(msg, params);
      })
      .then(function(){
        node.status({});
        node.send(msg);
      })
      .catch(function(err){
        payloadutils.reportError(node, msg, err);
        node.send(msg);
      });
    });
  }
function Node ( config ) { RED . nodes . createNode ( this , config ) ; var node = this , message = '' ; this . on ( 'input' , function ( msg ) { node . status ( { } ) ; payloadCheck ( msg ) . then ( function ( ) { return wordcountCheck ( msg , config ) ; } ) . then ( function ( ) { return credentialsCheck ( node ) ; } ) . then ( function ( ) { return setEndPoint ( config ) ; } ) . then ( function ( ) { return prepareParams ( msg , config ) ; } ) . then ( function ( params ) { node . status ( { fill : 'blue' , shape : 'dot' , text : 'requesting' } ) ; return executeService ( msg , params ) ; } ) . then ( function ( ) { node . status ( { } ) ; node . send ( msg ) ; } ) . catch ( function ( err ) { payloadutils . reportError ( node , msg , err ) ; node . send ( msg ) ; } ) ; } ) ; }
This is the start of the Node Code. In this case only on input is being processed.
This is the start of the Node Code . In this case only on input is being processed .