Built motion from commit (unavailable).|2.5.13
[motion2.git] / server / api / whatsappAccount / whatsappAccount.rpc.js
index 40c9164..e548b4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5761=['WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','WhatsappAccount','find','options','raw','where','attributes','include','map','model','ShowWhatsappAccount','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./whatsappAccount.socket','request','then','WhatsappAccount,\x20%s,\x20%s','debug'];(function(_0x1f7996,_0x299a14){var _0x584609=function(_0x14c34a){while(--_0x14c34a){_0x1f7996['push'](_0x1f7996['shift']());}};_0x584609(++_0x299a14);}(_0x5761,0x107));var _0x1576=function(_0x48d899,_0x1d6488){_0x48d899=_0x48d899-0x0;var _0x3188e1=_0x5761[_0x48d899];return _0x3188e1;};'use strict';var _=require(_0x1576('0x0'));var util=require(_0x1576('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1576('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1576('0x3'))['db'];var utils=require(_0x1576('0x4'));var logger=require(_0x1576('0x5'))(_0x1576('0x6'));var config=require(_0x1576('0x7'));var jayson=require(_0x1576('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x1576('0x9')]=_[_0x1576('0xa')](config[_0x1576('0x9')],{'host':_0x1576('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1576('0x9')]));require(_0x1576('0xc'))['register'](socket);function respondWithRpcPromise(_0xcd49df,_0x4aed5d,_0x522022){return new BPromise(function(_0xb449db,_0x2381da){return client[_0x1576('0xd')](_0xcd49df,_0x522022)[_0x1576('0xe')](function(_0x11acb5){logger['info'](_0x1576('0xf'),_0x4aed5d,'request\x20sent');logger[_0x1576('0x10')](_0x1576('0x11'),_0x4aed5d,_0x1576('0x12'),JSON[_0x1576('0x13')](_0x11acb5));if(_0x11acb5[_0x1576('0x14')]){if(_0x11acb5[_0x1576('0x14')][_0x1576('0x15')]===0x1f4){logger[_0x1576('0x14')](_0x1576('0xf'),_0x4aed5d,_0x11acb5['error'][_0x1576('0x16')]);return _0x2381da(_0x11acb5['error'][_0x1576('0x16')]);}logger[_0x1576('0x14')](_0x1576('0xf'),_0x4aed5d,_0x11acb5[_0x1576('0x14')][_0x1576('0x16')]);return _0xb449db(_0x11acb5[_0x1576('0x14')]['message']);}else{logger[_0x1576('0x17')](_0x1576('0xf'),_0x4aed5d,_0x1576('0x12'));_0xb449db(_0x11acb5['result'][_0x1576('0x16')]);}})[_0x1576('0x18')](function(_0x3b5408){logger[_0x1576('0x14')](_0x1576('0xf'),_0x4aed5d,_0x3b5408);_0x2381da(_0x3b5408);});});}exports['ShowWhatsappAccount']=function(_0x3e5fa4){var _0x3fd6f6=this;return new Promise(function(_0x3e2c11,_0x33eaf2){return db[_0x1576('0x19')][_0x1576('0x1a')]({'raw':_0x3e5fa4[_0x1576('0x1b')]?_0x3e5fa4[_0x1576('0x1b')][_0x1576('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e5fa4[_0x1576('0x1b')]?_0x3e5fa4['options'][_0x1576('0x1d')]||null:null,'attributes':_0x3e5fa4['options']?_0x3e5fa4['options'][_0x1576('0x1e')]||null:null,'include':_0x3e5fa4[_0x1576('0x1b')]?_0x3e5fa4[_0x1576('0x1b')][_0x1576('0x1f')]?_[_0x1576('0x20')](_0x3e5fa4[_0x1576('0x1b')][_0x1576('0x1f')],function(_0x250dbf){return{'model':db[_0x250dbf[_0x1576('0x21')]],'as':_0x250dbf['as'],'attributes':_0x250dbf[_0x1576('0x1e')],'include':_0x250dbf[_0x1576('0x1f')]?_[_0x1576('0x20')](_0x250dbf['include'],function(_0xa885bb){return{'model':db[_0xa885bb[_0x1576('0x21')]],'as':_0xa885bb['as'],'attributes':_0xa885bb['attributes'],'include':_0xa885bb[_0x1576('0x1f')]?_[_0x1576('0x20')](_0xa885bb['include'],function(_0x4372b6){return{'model':db[_0x4372b6[_0x1576('0x21')]],'as':_0x4372b6['as'],'attributes':_0x4372b6[_0x1576('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x953a76){logger['info'](_0x1576('0x22'),_0x3e5fa4);logger['debug'](_0x1576('0x22'),_0x3e5fa4,JSON[_0x1576('0x13')](_0x953a76));_0x3e2c11(_0x953a76);})['catch'](function(_0x3e587d){logger[_0x1576('0x14')](_0x1576('0x22'),_0x3e587d['message'],_0x3e5fa4);_0x33eaf2(_0x3fd6f6[_0x1576('0x14')](0x1f4,_0x3e587d['message']));});});};
\ No newline at end of file
+var _0x7fff=['http','redis','localhost','socket.io-emitter','register','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','WhatsappAccount,\x20%s,\x20%s','message','result','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','map','model','attributes','include','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x435e67,_0x2aa856){var _0x544f0c=function(_0x416cdb){while(--_0x416cdb){_0x435e67['push'](_0x435e67['shift']());}};_0x544f0c(++_0x2aa856);}(_0x7fff,0x1a6));var _0xf7ff=function(_0x486476,_0x5c400a){_0x486476=_0x486476-0x0;var _0x49b14a=_0x7fff[_0x486476];return _0x49b14a;};'use strict';var _=require(_0xf7ff('0x0'));var util=require(_0xf7ff('0x1'));var moment=require('moment');var BPromise=require(_0xf7ff('0x2'));var rs=require(_0xf7ff('0x3'));var fs=require('fs');var Redis=require(_0xf7ff('0x4'));var db=require(_0xf7ff('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf7ff('0x6'))(_0xf7ff('0x7'));var config=require(_0xf7ff('0x8'));var jayson=require(_0xf7ff('0x9'));var client=jayson['client'][_0xf7ff('0xa')]({'port':0x232a});config[_0xf7ff('0xb')]=_['defaults'](config['redis'],{'host':_0xf7ff('0xc'),'port':0x18eb});var socket=require(_0xf7ff('0xd'))(new Redis(config[_0xf7ff('0xb')]));require('./whatsappAccount.socket')[_0xf7ff('0xe')](socket);function respondWithRpcPromise(_0x2399e3,_0x1cfeae,_0x2882c6){return new BPromise(function(_0x574dd7,_0x2f7b85){return client['request'](_0x2399e3,_0x2882c6)[_0xf7ff('0xf')](function(_0x15a0c0){logger[_0xf7ff('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x1cfeae,'request\x20sent');logger[_0xf7ff('0x11')](_0xf7ff('0x12'),_0x1cfeae,_0xf7ff('0x13'),JSON[_0xf7ff('0x14')](_0x15a0c0));if(_0x15a0c0['error']){if(_0x15a0c0['error'][_0xf7ff('0x15')]===0x1f4){logger[_0xf7ff('0x16')](_0xf7ff('0x17'),_0x1cfeae,_0x15a0c0[_0xf7ff('0x16')]['message']);return _0x2f7b85(_0x15a0c0[_0xf7ff('0x16')]['message']);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x1cfeae,_0x15a0c0[_0xf7ff('0x16')][_0xf7ff('0x18')]);return _0x574dd7(_0x15a0c0[_0xf7ff('0x16')]['message']);}else{logger[_0xf7ff('0x10')](_0xf7ff('0x17'),_0x1cfeae,_0xf7ff('0x13'));_0x574dd7(_0x15a0c0[_0xf7ff('0x19')][_0xf7ff('0x18')]);}})['catch'](function(_0x144fd0){logger['error'](_0xf7ff('0x17'),_0x1cfeae,_0x144fd0);_0x2f7b85(_0x144fd0);});});}exports[_0xf7ff('0x1a')]=function(_0x13366b){var _0x2333bf=this;return new Promise(function(_0x15a9b0,_0x2a4c66){return db[_0xf7ff('0x1b')][_0xf7ff('0x1c')]({'raw':_0x13366b[_0xf7ff('0x1d')]?_0x13366b[_0xf7ff('0x1d')][_0xf7ff('0x1e')]===undefined?!![]:![]:!![],'where':_0x13366b[_0xf7ff('0x1d')]?_0x13366b[_0xf7ff('0x1d')][_0xf7ff('0x1f')]||null:null,'attributes':_0x13366b['options']?_0x13366b[_0xf7ff('0x1d')]['attributes']||null:null,'include':_0x13366b['options']?_0x13366b[_0xf7ff('0x1d')]['include']?_[_0xf7ff('0x20')](_0x13366b[_0xf7ff('0x1d')]['include'],function(_0x17f2d4){return{'model':db[_0x17f2d4[_0xf7ff('0x21')]],'as':_0x17f2d4['as'],'attributes':_0x17f2d4[_0xf7ff('0x22')],'include':_0x17f2d4[_0xf7ff('0x23')]?_[_0xf7ff('0x20')](_0x17f2d4[_0xf7ff('0x23')],function(_0x147109){return{'model':db[_0x147109[_0xf7ff('0x21')]],'as':_0x147109['as'],'attributes':_0x147109['attributes'],'include':_0x147109['include']?_[_0xf7ff('0x20')](_0x147109[_0xf7ff('0x23')],function(_0x2b1eea){return{'model':db[_0x2b1eea[_0xf7ff('0x21')]],'as':_0x2b1eea['as'],'attributes':_0x2b1eea[_0xf7ff('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb583d3){logger[_0xf7ff('0x10')](_0xf7ff('0x1a'),_0x13366b);logger['debug'](_0xf7ff('0x1a'),_0x13366b,JSON[_0xf7ff('0x14')](_0xb583d3));_0x15a9b0(_0xb583d3);})['catch'](function(_0xdb7b00){logger['error']('ShowWhatsappAccount',_0xdb7b00[_0xf7ff('0x18')],_0x13366b);_0x2a4c66(_0x2333bf['error'](0x1f4,_0xdb7b00[_0xf7ff('0x18')]));});});};
\ No newline at end of file