Built motion from commit 639a1a7f.|2.6.19
[motion2.git] / server / api / whatsappAccount / whatsappAccount.rpc.js
index a85c801..26282b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96bd=['socket.io-emitter','./whatsappAccount.socket','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','ShowWhatsappAccount','options','raw','where','attributes','map','model','include','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0x96bd,0x112));var _0xd96b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x96bd[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xd96b('0x0'));var util=require('util');var moment=require(_0xd96b('0x1'));var BPromise=require(_0xd96b('0x2'));var rs=require(_0xd96b('0x3'));var fs=require('fs');var Redis=require(_0xd96b('0x4'));var db=require(_0xd96b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd96b('0x6'))('rpc');var config=require(_0xd96b('0x7'));var jayson=require(_0xd96b('0x8'));var client=jayson[_0xd96b('0x9')][_0xd96b('0xa')]({'port':0x232a});config[_0xd96b('0xb')]=_[_0xd96b('0xc')](config[_0xd96b('0xb')],{'host':_0xd96b('0xd'),'port':0x18eb});var socket=require(_0xd96b('0xe'))(new Redis(config[_0xd96b('0xb')]));require(_0xd96b('0xf'))['register'](socket);function respondWithRpcPromise(_0x5d558b,_0x765734,_0x3b2790){return new BPromise(function(_0x5db303,_0x5b461d){return client[_0xd96b('0x10')](_0x5d558b,_0x3b2790)[_0xd96b('0x11')](function(_0x16a7ee){logger[_0xd96b('0x12')](_0xd96b('0x13'),_0x765734,'request\x20sent');logger[_0xd96b('0x14')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x765734,_0xd96b('0x15'),JSON[_0xd96b('0x16')](_0x16a7ee));if(_0x16a7ee[_0xd96b('0x17')]){if(_0x16a7ee[_0xd96b('0x17')][_0xd96b('0x18')]===0x1f4){logger[_0xd96b('0x17')](_0xd96b('0x13'),_0x765734,_0x16a7ee[_0xd96b('0x17')]['message']);return _0x5b461d(_0x16a7ee[_0xd96b('0x17')]['message']);}logger[_0xd96b('0x17')](_0xd96b('0x13'),_0x765734,_0x16a7ee[_0xd96b('0x17')][_0xd96b('0x19')]);return _0x5db303(_0x16a7ee[_0xd96b('0x17')][_0xd96b('0x19')]);}else{logger[_0xd96b('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x765734,_0xd96b('0x15'));_0x5db303(_0x16a7ee[_0xd96b('0x1a')][_0xd96b('0x19')]);}})[_0xd96b('0x1b')](function(_0x5b182b){logger[_0xd96b('0x17')](_0xd96b('0x13'),_0x765734,_0x5b182b);_0x5b461d(_0x5b182b);});});}exports[_0xd96b('0x1c')]=function(_0x23bbef){var _0x5dd184=this;return new Promise(function(_0x476872,_0x4262f5){return db['WhatsappAccount']['find']({'raw':_0x23bbef[_0xd96b('0x1d')]?_0x23bbef[_0xd96b('0x1d')][_0xd96b('0x1e')]===undefined?!![]:![]:!![],'where':_0x23bbef['options']?_0x23bbef[_0xd96b('0x1d')][_0xd96b('0x1f')]||null:null,'attributes':_0x23bbef[_0xd96b('0x1d')]?_0x23bbef[_0xd96b('0x1d')][_0xd96b('0x20')]||null:null,'include':_0x23bbef[_0xd96b('0x1d')]?_0x23bbef[_0xd96b('0x1d')]['include']?_[_0xd96b('0x21')](_0x23bbef[_0xd96b('0x1d')]['include'],function(_0x35a921){return{'model':db[_0x35a921[_0xd96b('0x22')]],'as':_0x35a921['as'],'attributes':_0x35a921[_0xd96b('0x20')],'include':_0x35a921[_0xd96b('0x23')]?_[_0xd96b('0x21')](_0x35a921[_0xd96b('0x23')],function(_0x5bfbd7){return{'model':db[_0x5bfbd7[_0xd96b('0x22')]],'as':_0x5bfbd7['as'],'attributes':_0x5bfbd7[_0xd96b('0x20')],'include':_0x5bfbd7[_0xd96b('0x23')]?_[_0xd96b('0x21')](_0x5bfbd7[_0xd96b('0x23')],function(_0xf481fd){return{'model':db[_0xf481fd[_0xd96b('0x22')]],'as':_0xf481fd['as'],'attributes':_0xf481fd[_0xd96b('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd96b('0x11')](function(_0x5c67dc){logger[_0xd96b('0x12')]('ShowWhatsappAccount',_0x23bbef);logger[_0xd96b('0x14')](_0xd96b('0x1c'),_0x23bbef,JSON[_0xd96b('0x16')](_0x5c67dc));_0x476872(_0x5c67dc);})[_0xd96b('0x1b')](function(_0x5189ae){logger[_0xd96b('0x17')](_0xd96b('0x1c'),_0x5189ae['message'],_0x23bbef);_0x4262f5(_0x5dd184[_0xd96b('0x17')](0x1f4,_0x5189ae[_0xd96b('0x19')]));});});};
\ No newline at end of file
+var _0x36d4=['defaults','localhost','socket.io-emitter','redis','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','attributes','map','include','model','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x413b62,_0x740bd3){var _0x19bad0=function(_0x419a1b){while(--_0x419a1b){_0x413b62['push'](_0x413b62['shift']());}};_0x19bad0(++_0x740bd3);}(_0x36d4,0x171));var _0x436d=function(_0x402565,_0x431efa){_0x402565=_0x402565-0x0;var _0x2ed987=_0x36d4[_0x402565];return _0x2ed987;};'use strict';var _=require('lodash');var util=require(_0x436d('0x0'));var moment=require(_0x436d('0x1'));var BPromise=require(_0x436d('0x2'));var rs=require(_0x436d('0x3'));var fs=require('fs');var Redis=require(_0x436d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x436d('0x5'));var logger=require('../../config/logger')(_0x436d('0x6'));var config=require(_0x436d('0x7'));var jayson=require(_0x436d('0x8'));var client=jayson[_0x436d('0x9')][_0x436d('0xa')]({'port':0x232a});config['redis']=_[_0x436d('0xb')](config['redis'],{'host':_0x436d('0xc'),'port':0x18eb});var socket=require(_0x436d('0xd'))(new Redis(config[_0x436d('0xe')]));require(_0x436d('0xf'))[_0x436d('0x10')](socket);function respondWithRpcPromise(_0x2479b4,_0x143942,_0x566755){return new BPromise(function(_0x8deef3,_0x3392dc){return client[_0x436d('0x11')](_0x2479b4,_0x566755)[_0x436d('0x12')](function(_0x219eae){logger['info'](_0x436d('0x13'),_0x143942,_0x436d('0x14'));logger[_0x436d('0x15')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x143942,'request\x20sent',JSON[_0x436d('0x16')](_0x219eae));if(_0x219eae['error']){if(_0x219eae['error'][_0x436d('0x17')]===0x1f4){logger['error'](_0x436d('0x13'),_0x143942,_0x219eae[_0x436d('0x18')][_0x436d('0x19')]);return _0x3392dc(_0x219eae[_0x436d('0x18')][_0x436d('0x19')]);}logger[_0x436d('0x18')](_0x436d('0x13'),_0x143942,_0x219eae[_0x436d('0x18')]['message']);return _0x8deef3(_0x219eae[_0x436d('0x18')][_0x436d('0x19')]);}else{logger[_0x436d('0x1a')](_0x436d('0x13'),_0x143942,_0x436d('0x14'));_0x8deef3(_0x219eae[_0x436d('0x1b')][_0x436d('0x19')]);}})[_0x436d('0x1c')](function(_0x224954){logger[_0x436d('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x143942,_0x224954);_0x3392dc(_0x224954);});});}exports[_0x436d('0x1d')]=function(_0x19b39c){var _0x20eea9=this;return new Promise(function(_0x1c39a6,_0x381b73){return db[_0x436d('0x1e')]['find']({'raw':_0x19b39c[_0x436d('0x1f')]?_0x19b39c[_0x436d('0x1f')][_0x436d('0x20')]===undefined?!![]:![]:!![],'where':_0x19b39c[_0x436d('0x1f')]?_0x19b39c[_0x436d('0x1f')][_0x436d('0x21')]||null:null,'attributes':_0x19b39c['options']?_0x19b39c[_0x436d('0x1f')][_0x436d('0x22')]||null:null,'include':_0x19b39c['options']?_0x19b39c[_0x436d('0x1f')]['include']?_[_0x436d('0x23')](_0x19b39c[_0x436d('0x1f')][_0x436d('0x24')],function(_0x184941){return{'model':db[_0x184941[_0x436d('0x25')]],'as':_0x184941['as'],'attributes':_0x184941['attributes'],'include':_0x184941[_0x436d('0x24')]?_[_0x436d('0x23')](_0x184941[_0x436d('0x24')],function(_0x1206f5){return{'model':db[_0x1206f5[_0x436d('0x25')]],'as':_0x1206f5['as'],'attributes':_0x1206f5[_0x436d('0x22')],'include':_0x1206f5[_0x436d('0x24')]?_[_0x436d('0x23')](_0x1206f5[_0x436d('0x24')],function(_0x56d540){return{'model':db[_0x56d540['model']],'as':_0x56d540['as'],'attributes':_0x56d540[_0x436d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x436d('0x12')](function(_0x58fba4){logger[_0x436d('0x1a')](_0x436d('0x1d'),_0x19b39c);logger['debug']('ShowWhatsappAccount',_0x19b39c,JSON['stringify'](_0x58fba4));_0x1c39a6(_0x58fba4);})['catch'](function(_0x1c7ccc){logger[_0x436d('0x18')](_0x436d('0x1d'),_0x1c7ccc['message'],_0x19b39c);_0x381b73(_0x20eea9[_0x436d('0x18')](0x1f4,_0x1c7ccc[_0x436d('0x19')]));});});};
\ No newline at end of file