Built motion from commit 775e2a94.|2.6.3
[motion2.git] / server / api / whatsappInteraction / whatsappInteraction.rpc.js
index 443a7f8..5ee61cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x998c=['update','body','options','raw','where','attributes','AddTagsToWhatsappInteraction','WhatsappInteraction','find','addTags','ids','omit','spread','AddTags','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateWhatsappInteraction'];(function(_0x553956,_0x57a991){var _0x2e4172=function(_0x2b5dda){while(--_0x2b5dda){_0x553956['push'](_0x553956['shift']());}};_0x2e4172(++_0x57a991);}(_0x998c,0x1bb));var _0xc998=function(_0x356c85,_0x22b9c7){_0x356c85=_0x356c85-0x0;var _0x4d6fa1=_0x998c[_0x356c85];return _0x4d6fa1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc998('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc998('0x1'));var db=require(_0xc998('0x2'))['db'];var utils=require(_0xc998('0x3'));var logger=require(_0xc998('0x4'))(_0xc998('0x5'));var config=require('../../config/environment');var jayson=require(_0xc998('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xc998('0x7')]=_[_0xc998('0x8')](config[_0xc998('0x7')],{'host':_0xc998('0x9'),'port':0x18eb});var socket=require(_0xc998('0xa'))(new Redis(config['redis']));require(_0xc998('0xb'))['register'](socket);function respondWithRpcPromise(_0x3fb255,_0x4ea3eb,_0xa9abeb){return new BPromise(function(_0x247262,_0x4ee77d){return client[_0xc998('0xc')](_0x3fb255,_0xa9abeb)[_0xc998('0xd')](function(_0x5b481b){logger[_0xc998('0xe')](_0xc998('0xf'),_0x4ea3eb,_0xc998('0x10'));logger[_0xc998('0x11')](_0xc998('0x12'),_0x4ea3eb,_0xc998('0x10'),JSON[_0xc998('0x13')](_0x5b481b));if(_0x5b481b[_0xc998('0x14')]){if(_0x5b481b[_0xc998('0x14')][_0xc998('0x15')]===0x1f4){logger[_0xc998('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x4ea3eb,_0x5b481b[_0xc998('0x14')]['message']);return _0x4ee77d(_0x5b481b['error'][_0xc998('0x16')]);}logger[_0xc998('0x14')](_0xc998('0xf'),_0x4ea3eb,_0x5b481b[_0xc998('0x14')][_0xc998('0x16')]);return _0x247262(_0x5b481b[_0xc998('0x14')]['message']);}else{logger[_0xc998('0xe')](_0xc998('0xf'),_0x4ea3eb,_0xc998('0x10'));_0x247262(_0x5b481b[_0xc998('0x17')]['message']);}})['catch'](function(_0x115a77){logger['error'](_0xc998('0xf'),_0x4ea3eb,_0x115a77);_0x4ee77d(_0x115a77);});});}exports[_0xc998('0x18')]=function(_0x436732){var _0x2c741f=this;return new Promise(function(_0x39f1da,_0x48c347){return db['WhatsappInteraction'][_0xc998('0x19')](_0x436732[_0xc998('0x1a')],{'raw':_0x436732[_0xc998('0x1b')]?_0x436732['options'][_0xc998('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x436732[_0xc998('0x1b')]?_0x436732[_0xc998('0x1b')][_0xc998('0x1d')]||null:null,'attributes':_0x436732[_0xc998('0x1b')]?_0x436732[_0xc998('0x1b')][_0xc998('0x1e')]||null:null,'limit':_0x436732[_0xc998('0x1b')]?_0x436732['options']['limit']||null:null})['then'](function(_0x27a16f){logger[_0xc998('0xe')]('UpdateWhatsappInteraction',_0x436732);logger[_0xc998('0x11')](_0xc998('0x18'),_0x436732,JSON[_0xc998('0x13')](_0x27a16f));_0x39f1da(_0x27a16f);})['catch'](function(_0x2c79d9){logger[_0xc998('0x14')](_0xc998('0x18'),_0x2c79d9[_0xc998('0x16')],_0x436732);_0x48c347(_0x2c741f[_0xc998('0x14')](0x1f4,_0x2c79d9['message']));});});};exports[_0xc998('0x1f')]=function(_0x59c9ab){return new Promise(function(_0x576a46,_0x733da8){return db[_0xc998('0x20')][_0xc998('0x21')]({'where':_0x59c9ab[_0xc998('0x1b')]?_0x59c9ab[_0xc998('0x1b')]['where']||null:null})[_0xc998('0xd')](function(_0x2e31ff){if(_0x2e31ff){return _0x2e31ff[_0xc998('0x22')](_0x59c9ab[_0xc998('0x1a')][_0xc998('0x23')],_[_0xc998('0x24')](_0x59c9ab['body'],[_0xc998('0x23'),'id'])||{});}})[_0xc998('0x25')](function(_0x153f6d){logger[_0xc998('0xe')](_0xc998('0x26'),_0x59c9ab);logger[_0xc998('0x11')](_0xc998('0x26'),_0x59c9ab,JSON[_0xc998('0x13')](_0x153f6d));_0x576a46(_0x153f6d);})['catch'](function(_0x4882bb){logger[_0xc998('0x14')]('AddTags',_0x4882bb['message'],_0x59c9ab);_0x733da8(_this[_0xc998('0x14')](0x1f4,_0x4882bb[_0xc998('0x16')]));});});};
\ No newline at end of file
+var _0xdefc=['result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','raw','options','where','attributes','limit','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3df223,_0x1740fc){var _0x562d11=function(_0x343009){while(--_0x343009){_0x3df223['push'](_0x3df223['shift']());}};_0x562d11(++_0x1740fc);}(_0xdefc,0x1b6));var _0xcdef=function(_0x5c4de8,_0x5a248d){_0x5c4de8=_0x5c4de8-0x0;var _0x402aea=_0xdefc[_0x5c4de8];return _0x402aea;};'use strict';var _=require(_0xcdef('0x0'));var util=require(_0xcdef('0x1'));var moment=require('moment');var BPromise=require(_0xcdef('0x2'));var rs=require(_0xcdef('0x3'));var fs=require('fs');var Redis=require(_0xcdef('0x4'));var db=require(_0xcdef('0x5'))['db'];var utils=require(_0xcdef('0x6'));var logger=require(_0xcdef('0x7'))('rpc');var config=require(_0xcdef('0x8'));var jayson=require(_0xcdef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xcdef('0xa')]=_['defaults'](config[_0xcdef('0xa')],{'host':_0xcdef('0xb'),'port':0x18eb});var socket=require(_0xcdef('0xc'))(new Redis(config[_0xcdef('0xa')]));require(_0xcdef('0xd'))[_0xcdef('0xe')](socket);function respondWithRpcPromise(_0x5b5f96,_0x1ec924,_0x3bee53){return new BPromise(function(_0xe9660f,_0x42a167){return client[_0xcdef('0xf')](_0x5b5f96,_0x3bee53)['then'](function(_0x18eea8){logger[_0xcdef('0x10')](_0xcdef('0x11'),_0x1ec924,_0xcdef('0x12'));logger[_0xcdef('0x13')](_0xcdef('0x14'),_0x1ec924,'request\x20sent',JSON[_0xcdef('0x15')](_0x18eea8));if(_0x18eea8[_0xcdef('0x16')]){if(_0x18eea8[_0xcdef('0x16')]['code']===0x1f4){logger['error'](_0xcdef('0x11'),_0x1ec924,_0x18eea8['error'][_0xcdef('0x17')]);return _0x42a167(_0x18eea8[_0xcdef('0x16')]['message']);}logger['error'](_0xcdef('0x11'),_0x1ec924,_0x18eea8['error'][_0xcdef('0x17')]);return _0xe9660f(_0x18eea8[_0xcdef('0x16')][_0xcdef('0x17')]);}else{logger['info'](_0xcdef('0x11'),_0x1ec924,'request\x20sent');_0xe9660f(_0x18eea8[_0xcdef('0x18')]['message']);}})[_0xcdef('0x19')](function(_0x151e64){logger[_0xcdef('0x16')](_0xcdef('0x11'),_0x1ec924,_0x151e64);_0x42a167(_0x151e64);});});}exports[_0xcdef('0x1a')]=function(_0xd93856){var _0x3fe72e=this;return new Promise(function(_0x3fc583,_0x1b8e82){return db[_0xcdef('0x1b')][_0xcdef('0x1c')](_0xd93856[_0xcdef('0x1d')],{'raw':_0xd93856['options']?_0xd93856['options'][_0xcdef('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd93856[_0xcdef('0x1f')]?_0xd93856['options'][_0xcdef('0x20')]||null:null,'attributes':_0xd93856[_0xcdef('0x1f')]?_0xd93856[_0xcdef('0x1f')][_0xcdef('0x21')]||null:null,'limit':_0xd93856[_0xcdef('0x1f')]?_0xd93856[_0xcdef('0x1f')][_0xcdef('0x22')]||null:null})['then'](function(_0x1cb0eb){logger[_0xcdef('0x10')](_0xcdef('0x1a'),_0xd93856);logger[_0xcdef('0x13')]('UpdateWhatsappInteraction',_0xd93856,JSON[_0xcdef('0x15')](_0x1cb0eb));_0x3fc583(_0x1cb0eb);})[_0xcdef('0x19')](function(_0x4939fe){logger['error'](_0xcdef('0x1a'),_0x4939fe['message'],_0xd93856);_0x1b8e82(_0x3fe72e[_0xcdef('0x16')](0x1f4,_0x4939fe[_0xcdef('0x17')]));});});};exports[_0xcdef('0x23')]=function(_0x588321){return new Promise(function(_0x2c2c87,_0x37c09f){return db[_0xcdef('0x1b')][_0xcdef('0x24')]({'where':_0x588321[_0xcdef('0x1f')]?_0x588321[_0xcdef('0x1f')][_0xcdef('0x20')]||null:null})['then'](function(_0x26910f){if(_0x26910f){return _0x26910f[_0xcdef('0x25')](_0x588321[_0xcdef('0x1d')][_0xcdef('0x26')],_[_0xcdef('0x27')](_0x588321[_0xcdef('0x1d')],['ids','id'])||{});}})[_0xcdef('0x28')](function(_0x184cc6){logger[_0xcdef('0x10')](_0xcdef('0x29'),_0x588321);logger['debug'](_0xcdef('0x29'),_0x588321,JSON[_0xcdef('0x15')](_0x184cc6));_0x2c2c87(_0x184cc6);})[_0xcdef('0x19')](function(_0x1f6c05){logger[_0xcdef('0x16')]('AddTags',_0x1f6c05['message'],_0x588321);_0x37c09f(_this[_0xcdef('0x16')](0x1f4,_0x1f6c05[_0xcdef('0x17')]));});});};
\ No newline at end of file