Built motion from commit fade34fd.|2.5.41
[motion2.git] / server / api / whatsappAccount / whatsappAccount.rpc.js
index dd96c75..c45f41f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99dc=['options','where','attributes','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','localhost','redis','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find'];(function(_0x5505b0,_0x5493e2){var _0x3e469f=function(_0x208030){while(--_0x208030){_0x5505b0['push'](_0x5505b0['shift']());}};_0x3e469f(++_0x5493e2);}(_0x99dc,0xa2));var _0xc99d=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x99dc[_0x1d9aa0];return _0x226868;};'use strict';var _=require(_0xc99d('0x0'));var util=require(_0xc99d('0x1'));var moment=require(_0xc99d('0x2'));var BPromise=require(_0xc99d('0x3'));var rs=require(_0xc99d('0x4'));var fs=require('fs');var Redis=require(_0xc99d('0x5'));var db=require(_0xc99d('0x6'))['db'];var utils=require(_0xc99d('0x7'));var logger=require('../../config/logger')(_0xc99d('0x8'));var config=require(_0xc99d('0x9'));var jayson=require(_0xc99d('0xa'));var client=jayson[_0xc99d('0xb')][_0xc99d('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xc99d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc99d('0xe')]));require(_0xc99d('0xf'))[_0xc99d('0x10')](socket);function respondWithRpcPromise(_0x2e73a3,_0x3cc80b,_0x3ae439){return new BPromise(function(_0x5633b8,_0x509bcb){return client[_0xc99d('0x11')](_0x2e73a3,_0x3ae439)[_0xc99d('0x12')](function(_0x1f5494){logger[_0xc99d('0x13')](_0xc99d('0x14'),_0x3cc80b,_0xc99d('0x15'));logger[_0xc99d('0x16')](_0xc99d('0x17'),_0x3cc80b,_0xc99d('0x15'),JSON[_0xc99d('0x18')](_0x1f5494));if(_0x1f5494[_0xc99d('0x19')]){if(_0x1f5494['error'][_0xc99d('0x1a')]===0x1f4){logger[_0xc99d('0x19')](_0xc99d('0x14'),_0x3cc80b,_0x1f5494['error'][_0xc99d('0x1b')]);return _0x509bcb(_0x1f5494[_0xc99d('0x19')]['message']);}logger[_0xc99d('0x19')](_0xc99d('0x14'),_0x3cc80b,_0x1f5494['error'][_0xc99d('0x1b')]);return _0x5633b8(_0x1f5494[_0xc99d('0x19')][_0xc99d('0x1b')]);}else{logger[_0xc99d('0x13')](_0xc99d('0x14'),_0x3cc80b,_0xc99d('0x15'));_0x5633b8(_0x1f5494[_0xc99d('0x1c')][_0xc99d('0x1b')]);}})[_0xc99d('0x1d')](function(_0x56d3e8){logger[_0xc99d('0x19')]('WhatsappAccount,\x20%s,\x20%s',_0x3cc80b,_0x56d3e8);_0x509bcb(_0x56d3e8);});});}exports[_0xc99d('0x1e')]=function(_0x56ecd7){var _0x56b36b=this;return new Promise(function(_0x492041,_0x5f2453){return db[_0xc99d('0x1f')][_0xc99d('0x20')]({'raw':_0x56ecd7[_0xc99d('0x21')]?_0x56ecd7[_0xc99d('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x56ecd7[_0xc99d('0x21')]?_0x56ecd7[_0xc99d('0x21')][_0xc99d('0x22')]||null:null,'attributes':_0x56ecd7[_0xc99d('0x21')]?_0x56ecd7[_0xc99d('0x21')][_0xc99d('0x23')]||null:null,'include':_0x56ecd7[_0xc99d('0x21')]?_0x56ecd7['options'][_0xc99d('0x24')]?_['map'](_0x56ecd7[_0xc99d('0x21')][_0xc99d('0x24')],function(_0x5cdb20){return{'model':db[_0x5cdb20[_0xc99d('0x25')]],'as':_0x5cdb20['as'],'attributes':_0x5cdb20[_0xc99d('0x23')],'include':_0x5cdb20[_0xc99d('0x24')]?_[_0xc99d('0x26')](_0x5cdb20[_0xc99d('0x24')],function(_0x6c74c2){return{'model':db[_0x6c74c2[_0xc99d('0x25')]],'as':_0x6c74c2['as'],'attributes':_0x6c74c2['attributes'],'include':_0x6c74c2[_0xc99d('0x24')]?_[_0xc99d('0x26')](_0x6c74c2[_0xc99d('0x24')],function(_0x56e5b8){return{'model':db[_0x56e5b8[_0xc99d('0x25')]],'as':_0x56e5b8['as'],'attributes':_0x56e5b8[_0xc99d('0x23')]};}):[]};}):[]};}):[]:[]})[_0xc99d('0x12')](function(_0x42c62f){logger[_0xc99d('0x13')](_0xc99d('0x1e'),_0x56ecd7);logger['debug']('ShowWhatsappAccount',_0x56ecd7,JSON[_0xc99d('0x18')](_0x42c62f));_0x492041(_0x42c62f);})[_0xc99d('0x1d')](function(_0x4c1781){logger['error'](_0xc99d('0x1e'),_0x4c1781[_0xc99d('0x1b')],_0x56ecd7);_0x5f2453(_0x56b36b[_0xc99d('0x19')](0x1f4,_0x4c1781[_0xc99d('0x1b')]));});});};
\ No newline at end of file
+var _0x6ace=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowWhatsappAccount','WhatsappAccount','options','raw','where','include','map','model','attributes','info','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ace,0x17c));var _0xe6ac=function(_0x11e496,_0x550762){_0x11e496=_0x11e496-0x0;var _0x4b2c4b=_0x6ace[_0x11e496];return _0x4b2c4b;};'use strict';var _=require('lodash');var util=require(_0xe6ac('0x0'));var moment=require(_0xe6ac('0x1'));var BPromise=require(_0xe6ac('0x2'));var rs=require(_0xe6ac('0x3'));var fs=require('fs');var Redis=require(_0xe6ac('0x4'));var db=require(_0xe6ac('0x5'))['db'];var utils=require(_0xe6ac('0x6'));var logger=require(_0xe6ac('0x7'))(_0xe6ac('0x8'));var config=require(_0xe6ac('0x9'));var jayson=require(_0xe6ac('0xa'));var client=jayson[_0xe6ac('0xb')][_0xe6ac('0xc')]({'port':0x232a});config[_0xe6ac('0xd')]=_[_0xe6ac('0xe')](config[_0xe6ac('0xd')],{'host':_0xe6ac('0xf'),'port':0x18eb});var socket=require(_0xe6ac('0x10'))(new Redis(config[_0xe6ac('0xd')]));require(_0xe6ac('0x11'))['register'](socket);function respondWithRpcPromise(_0x484e55,_0x52b380,_0x96f1fd){return new BPromise(function(_0x4ae17e,_0x519597){return client[_0xe6ac('0x12')](_0x484e55,_0x96f1fd)[_0xe6ac('0x13')](function(_0x5905cb){logger['info'](_0xe6ac('0x14'),_0x52b380,'request\x20sent');logger['debug'](_0xe6ac('0x15'),_0x52b380,_0xe6ac('0x16'),JSON[_0xe6ac('0x17')](_0x5905cb));if(_0x5905cb['error']){if(_0x5905cb['error']['code']===0x1f4){logger[_0xe6ac('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x52b380,_0x5905cb['error'][_0xe6ac('0x19')]);return _0x519597(_0x5905cb[_0xe6ac('0x18')][_0xe6ac('0x19')]);}logger[_0xe6ac('0x18')](_0xe6ac('0x14'),_0x52b380,_0x5905cb[_0xe6ac('0x18')]['message']);return _0x4ae17e(_0x5905cb['error'][_0xe6ac('0x19')]);}else{logger['info'](_0xe6ac('0x14'),_0x52b380,_0xe6ac('0x16'));_0x4ae17e(_0x5905cb[_0xe6ac('0x1a')][_0xe6ac('0x19')]);}})['catch'](function(_0x4dfd8f){logger[_0xe6ac('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x52b380,_0x4dfd8f);_0x519597(_0x4dfd8f);});});}exports[_0xe6ac('0x1b')]=function(_0x1a94b4){var _0x5187a8=this;return new Promise(function(_0x4f0fae,_0x33c14e){return db[_0xe6ac('0x1c')]['find']({'raw':_0x1a94b4['options']?_0x1a94b4[_0xe6ac('0x1d')][_0xe6ac('0x1e')]===undefined?!![]:![]:!![],'where':_0x1a94b4[_0xe6ac('0x1d')]?_0x1a94b4[_0xe6ac('0x1d')][_0xe6ac('0x1f')]||null:null,'attributes':_0x1a94b4['options']?_0x1a94b4['options']['attributes']||null:null,'include':_0x1a94b4['options']?_0x1a94b4[_0xe6ac('0x1d')][_0xe6ac('0x20')]?_[_0xe6ac('0x21')](_0x1a94b4[_0xe6ac('0x1d')]['include'],function(_0x219f7c){return{'model':db[_0x219f7c[_0xe6ac('0x22')]],'as':_0x219f7c['as'],'attributes':_0x219f7c[_0xe6ac('0x23')],'include':_0x219f7c[_0xe6ac('0x20')]?_[_0xe6ac('0x21')](_0x219f7c[_0xe6ac('0x20')],function(_0x4bc5cc){return{'model':db[_0x4bc5cc[_0xe6ac('0x22')]],'as':_0x4bc5cc['as'],'attributes':_0x4bc5cc[_0xe6ac('0x23')],'include':_0x4bc5cc[_0xe6ac('0x20')]?_[_0xe6ac('0x21')](_0x4bc5cc[_0xe6ac('0x20')],function(_0x42c912){return{'model':db[_0x42c912[_0xe6ac('0x22')]],'as':_0x42c912['as'],'attributes':_0x42c912[_0xe6ac('0x23')]};}):[]};}):[]};}):[]:[]})[_0xe6ac('0x13')](function(_0x4ba8b9){logger[_0xe6ac('0x24')](_0xe6ac('0x1b'),_0x1a94b4);logger[_0xe6ac('0x25')](_0xe6ac('0x1b'),_0x1a94b4,JSON[_0xe6ac('0x17')](_0x4ba8b9));_0x4f0fae(_0x4ba8b9);})['catch'](function(_0x2addf8){logger[_0xe6ac('0x18')](_0xe6ac('0x1b'),_0x2addf8[_0xe6ac('0x19')],_0x1a94b4);_0x33c14e(_0x5187a8[_0xe6ac('0x18')](0x1f4,_0x2addf8[_0xe6ac('0x19')]));});});};
\ No newline at end of file