Built motion from commit e1760111.|2.6.18
[motion2.git] / server / api / whatsappAccount / whatsappAccount.rpc.js
index 55e93e2..a85c801 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41d0=['WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','options','where','include','map','model','attributes','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request','then','info','debug'];(function(_0x58b9bd,_0x244d5d){var _0x53493c=function(_0x22e107){while(--_0x22e107){_0x58b9bd['push'](_0x58b9bd['shift']());}};_0x53493c(++_0x244d5d);}(_0x41d0,0x191));var _0x041d=function(_0x20f3a3,_0xe879a){_0x20f3a3=_0x20f3a3-0x0;var _0x4ecd05=_0x41d0[_0x20f3a3];return _0x4ecd05;};'use strict';var _=require(_0x041d('0x0'));var util=require(_0x041d('0x1'));var moment=require(_0x041d('0x2'));var BPromise=require('bluebird');var rs=require(_0x041d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x041d('0x4'));var logger=require(_0x041d('0x5'))(_0x041d('0x6'));var config=require(_0x041d('0x7'));var jayson=require(_0x041d('0x8'));var client=jayson[_0x041d('0x9')]['http']({'port':0x232a});config['redis']=_[_0x041d('0xa')](config[_0x041d('0xb')],{'host':_0x041d('0xc'),'port':0x18eb});var socket=require(_0x041d('0xd'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x041d('0xe')](socket);function respondWithRpcPromise(_0x40b501,_0x13d52d,_0x531c2d){return new BPromise(function(_0x3e69d9,_0x59cc3d){return client[_0x041d('0xf')](_0x40b501,_0x531c2d)[_0x041d('0x10')](function(_0x4df595){logger[_0x041d('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x13d52d,'request\x20sent');logger[_0x041d('0x12')](_0x041d('0x13'),_0x13d52d,_0x041d('0x14'),JSON[_0x041d('0x15')](_0x4df595));if(_0x4df595[_0x041d('0x16')]){if(_0x4df595[_0x041d('0x16')][_0x041d('0x17')]===0x1f4){logger[_0x041d('0x16')](_0x041d('0x18'),_0x13d52d,_0x4df595[_0x041d('0x16')][_0x041d('0x19')]);return _0x59cc3d(_0x4df595[_0x041d('0x16')][_0x041d('0x19')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x13d52d,_0x4df595['error'][_0x041d('0x19')]);return _0x3e69d9(_0x4df595['error'][_0x041d('0x19')]);}else{logger[_0x041d('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x13d52d,'request\x20sent');_0x3e69d9(_0x4df595[_0x041d('0x1a')][_0x041d('0x19')]);}})[_0x041d('0x1b')](function(_0x475387){logger[_0x041d('0x16')](_0x041d('0x18'),_0x13d52d,_0x475387);_0x59cc3d(_0x475387);});});}exports[_0x041d('0x1c')]=function(_0x27f8d5){var _0x1b7445=this;return new Promise(function(_0x14124b,_0x2aa596){return db['WhatsappAccount']['find']({'raw':_0x27f8d5['options']?_0x27f8d5[_0x041d('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x27f8d5['options']?_0x27f8d5[_0x041d('0x1d')][_0x041d('0x1e')]||null:null,'attributes':_0x27f8d5[_0x041d('0x1d')]?_0x27f8d5[_0x041d('0x1d')]['attributes']||null:null,'include':_0x27f8d5[_0x041d('0x1d')]?_0x27f8d5[_0x041d('0x1d')][_0x041d('0x1f')]?_[_0x041d('0x20')](_0x27f8d5[_0x041d('0x1d')][_0x041d('0x1f')],function(_0x74d207){return{'model':db[_0x74d207[_0x041d('0x21')]],'as':_0x74d207['as'],'attributes':_0x74d207[_0x041d('0x22')],'include':_0x74d207[_0x041d('0x1f')]?_['map'](_0x74d207[_0x041d('0x1f')],function(_0x49d02b){return{'model':db[_0x49d02b['model']],'as':_0x49d02b['as'],'attributes':_0x49d02b[_0x041d('0x22')],'include':_0x49d02b[_0x041d('0x1f')]?_[_0x041d('0x20')](_0x49d02b[_0x041d('0x1f')],function(_0x472ce8){return{'model':db[_0x472ce8[_0x041d('0x21')]],'as':_0x472ce8['as'],'attributes':_0x472ce8[_0x041d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x041d('0x10')](function(_0x5f1051){logger[_0x041d('0x11')](_0x041d('0x1c'),_0x27f8d5);logger[_0x041d('0x12')](_0x041d('0x1c'),_0x27f8d5,JSON['stringify'](_0x5f1051));_0x14124b(_0x5f1051);})[_0x041d('0x1b')](function(_0xa64a18){logger[_0x041d('0x16')](_0x041d('0x1c'),_0xa64a18[_0x041d('0x19')],_0x27f8d5);_0x2aa596(_0x1b7445['error'](0x1f4,_0xa64a18[_0x041d('0x19')]));});});};
\ No newline at end of file
+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