Built motion from commit (unavailable).|2.5.10
[motion2.git] / server / api / whatsappQueue / whatsappQueue.rpc.js
index 790eb3a..dcdff14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x036f=['error','code','message','info','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','include','map','model','then','ShowWhatsappQueue','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x036f,0x1b7));var _0xf036=function(_0x44c5c1,_0x4d9d55){_0x44c5c1=_0x44c5c1-0x0;var _0x467172=_0x036f[_0x44c5c1];return _0x467172;};'use strict';var _=require(_0xf036('0x0'));var util=require(_0xf036('0x1'));var moment=require(_0xf036('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf036('0x3'));var db=require(_0xf036('0x4'))['db'];var utils=require(_0xf036('0x5'));var logger=require(_0xf036('0x6'))(_0xf036('0x7'));var config=require(_0xf036('0x8'));var jayson=require(_0xf036('0x9'));var client=jayson[_0xf036('0xa')][_0xf036('0xb')]({'port':0x232a});config[_0xf036('0xc')]=_[_0xf036('0xd')](config[_0xf036('0xc')],{'host':_0xf036('0xe'),'port':0x18eb});var socket=require(_0xf036('0xf'))(new Redis(config[_0xf036('0xc')]));require('./whatsappQueue.socket')[_0xf036('0x10')](socket);function respondWithRpcPromise(_0x522b19,_0x39779d,_0x48d7ea){return new BPromise(function(_0x5b4e3d,_0x143bfb){return client[_0xf036('0x11')](_0x522b19,_0x48d7ea)['then'](function(_0x1a4d5b){logger['info'](_0xf036('0x12'),_0x39779d,_0xf036('0x13'));logger[_0xf036('0x14')](_0xf036('0x15'),_0x39779d,_0xf036('0x13'),JSON[_0xf036('0x16')](_0x1a4d5b));if(_0x1a4d5b[_0xf036('0x17')]){if(_0x1a4d5b[_0xf036('0x17')][_0xf036('0x18')]===0x1f4){logger[_0xf036('0x17')](_0xf036('0x12'),_0x39779d,_0x1a4d5b[_0xf036('0x17')][_0xf036('0x19')]);return _0x143bfb(_0x1a4d5b[_0xf036('0x17')]['message']);}logger[_0xf036('0x17')](_0xf036('0x12'),_0x39779d,_0x1a4d5b[_0xf036('0x17')]['message']);return _0x5b4e3d(_0x1a4d5b['error'][_0xf036('0x19')]);}else{logger[_0xf036('0x1a')](_0xf036('0x12'),_0x39779d,_0xf036('0x13'));_0x5b4e3d(_0x1a4d5b[_0xf036('0x1b')][_0xf036('0x19')]);}})[_0xf036('0x1c')](function(_0x1caeee){logger[_0xf036('0x17')](_0xf036('0x12'),_0x39779d,_0x1caeee);_0x143bfb(_0x1caeee);});});}exports[_0xf036('0x1d')]=function(_0x315a7d){var _0x11493e=this;return new Promise(function(_0x58cef4,_0x815f0d){return db[_0xf036('0x1e')][_0xf036('0x1f')]({'raw':_0x315a7d[_0xf036('0x20')]?_0x315a7d[_0xf036('0x20')][_0xf036('0x21')]===undefined?!![]:![]:!![],'where':_0x315a7d[_0xf036('0x20')]?_0x315a7d[_0xf036('0x20')][_0xf036('0x22')]||null:null,'attributes':_0x315a7d['options']?_0x315a7d[_0xf036('0x20')][_0xf036('0x23')]||null:null,'limit':_0x315a7d['options']?_0x315a7d['options']['limit']||null:null,'include':_0x315a7d[_0xf036('0x20')]?_0x315a7d[_0xf036('0x20')][_0xf036('0x24')]?_[_0xf036('0x25')](_0x315a7d[_0xf036('0x20')][_0xf036('0x24')],function(_0x5cd320){return{'model':db[_0x5cd320[_0xf036('0x26')]],'as':_0x5cd320['as'],'attributes':_0x5cd320[_0xf036('0x23')],'include':_0x5cd320[_0xf036('0x24')]?_[_0xf036('0x25')](_0x5cd320[_0xf036('0x24')],function(_0x1a7da0){return{'model':db[_0x1a7da0[_0xf036('0x26')]],'as':_0x1a7da0['as'],'attributes':_0x1a7da0['attributes'],'include':_0x1a7da0[_0xf036('0x24')]?_[_0xf036('0x25')](_0x1a7da0[_0xf036('0x24')],function(_0x5511bd){return{'model':db[_0x5511bd[_0xf036('0x26')]],'as':_0x5511bd['as'],'attributes':_0x5511bd['attributes']};}):[]};}):[]};}):[]:[]})[_0xf036('0x27')](function(_0x12d5ea){logger[_0xf036('0x1a')](_0xf036('0x1d'),_0x315a7d);logger[_0xf036('0x14')](_0xf036('0x1d'),_0x315a7d,JSON[_0xf036('0x16')](_0x12d5ea));_0x58cef4(_0x12d5ea);})[_0xf036('0x1c')](function(_0x4815c7){logger['error'](_0xf036('0x1d'),_0x4815c7[_0xf036('0x19')],_0x315a7d);_0x815f0d(_0x11493e[_0xf036('0x17')](0x1f4,_0x4815c7[_0xf036('0x19')]));});});};exports[_0xf036('0x28')]=function(_0x55aa42){var _0x4921ec=this;return new Promise(function(_0x506a57,_0x53be77){return db['WhatsappQueue'][_0xf036('0x29')]({'raw':_0x55aa42['options']?_0x55aa42[_0xf036('0x20')][_0xf036('0x21')]===undefined?!![]:![]:!![],'where':_0x55aa42[_0xf036('0x20')]?_0x55aa42[_0xf036('0x20')][_0xf036('0x22')]||null:null,'attributes':_0x55aa42[_0xf036('0x20')]?_0x55aa42[_0xf036('0x20')]['attributes']||null:null,'include':_0x55aa42[_0xf036('0x20')]?_0x55aa42[_0xf036('0x20')][_0xf036('0x24')]?_['map'](_0x55aa42['options'][_0xf036('0x24')],function(_0x572b69){return{'model':db[_0x572b69[_0xf036('0x26')]],'as':_0x572b69['as'],'attributes':_0x572b69[_0xf036('0x23')],'include':_0x572b69[_0xf036('0x24')]?_['map'](_0x572b69[_0xf036('0x24')],function(_0x5823c3){return{'model':db[_0x5823c3[_0xf036('0x26')]],'as':_0x5823c3['as'],'attributes':_0x5823c3[_0xf036('0x23')],'include':_0x5823c3[_0xf036('0x24')]?_[_0xf036('0x25')](_0x5823c3[_0xf036('0x24')],function(_0x5bbd74){return{'model':db[_0x5bbd74[_0xf036('0x26')]],'as':_0x5bbd74['as'],'attributes':_0x5bbd74[_0xf036('0x23')]};}):[]};}):[]};}):[]:[]})[_0xf036('0x27')](function(_0x164a3c){logger['info']('ShowWhatsappQueue',_0x55aa42);logger[_0xf036('0x14')](_0xf036('0x28'),_0x55aa42,JSON[_0xf036('0x16')](_0x164a3c));_0x506a57(_0x164a3c);})[_0xf036('0x1c')](function(_0x1e1f47){logger[_0xf036('0x17')](_0xf036('0x28'),_0x1e1f47[_0xf036('0x19')],_0x55aa42);_0x53be77(_0x4921ec[_0xf036('0x17')](0x1f4,_0x1e1f47[_0xf036('0x19')]));});});};
\ No newline at end of file
+var _0x1589=['then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','options','raw','attributes','limit','map','include','model','GetWhatsappQueue','WhatsappQueue','find','ShowWhatsappQueue','stringify','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request'];(function(_0x4824db,_0x2b934f){var _0x467e8f=function(_0x36b4ea){while(--_0x36b4ea){_0x4824db['push'](_0x4824db['shift']());}};_0x467e8f(++_0x2b934f);}(_0x1589,0xdd));var _0x9158=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x1589[_0xc8a931];return _0x28bd27;};'use strict';var _=require(_0x9158('0x0'));var util=require('util');var moment=require(_0x9158('0x1'));var BPromise=require(_0x9158('0x2'));var rs=require(_0x9158('0x3'));var fs=require('fs');var Redis=require(_0x9158('0x4'));var db=require(_0x9158('0x5'))['db'];var utils=require(_0x9158('0x6'));var logger=require(_0x9158('0x7'))(_0x9158('0x8'));var config=require(_0x9158('0x9'));var jayson=require(_0x9158('0xa'));var client=jayson[_0x9158('0xb')]['http']({'port':0x232a});config[_0x9158('0xc')]=_[_0x9158('0xd')](config[_0x9158('0xc')],{'host':_0x9158('0xe'),'port':0x18eb});var socket=require(_0x9158('0xf'))(new Redis(config[_0x9158('0xc')]));require(_0x9158('0x10'))[_0x9158('0x11')](socket);function respondWithRpcPromise(_0x13a8cf,_0x53e855,_0x147d40){return new BPromise(function(_0x4ebff0,_0x4c533f){return client[_0x9158('0x12')](_0x13a8cf,_0x147d40)[_0x9158('0x13')](function(_0x12804a){logger[_0x9158('0x14')](_0x9158('0x15'),_0x53e855,'request\x20sent');logger[_0x9158('0x16')](_0x9158('0x17'),_0x53e855,_0x9158('0x18'),JSON['stringify'](_0x12804a));if(_0x12804a[_0x9158('0x19')]){if(_0x12804a[_0x9158('0x19')]['code']===0x1f4){logger[_0x9158('0x19')](_0x9158('0x15'),_0x53e855,_0x12804a[_0x9158('0x19')][_0x9158('0x1a')]);return _0x4c533f(_0x12804a[_0x9158('0x19')][_0x9158('0x1a')]);}logger['error'](_0x9158('0x15'),_0x53e855,_0x12804a[_0x9158('0x19')][_0x9158('0x1a')]);return _0x4ebff0(_0x12804a[_0x9158('0x19')]['message']);}else{logger['info'](_0x9158('0x15'),_0x53e855,_0x9158('0x18'));_0x4ebff0(_0x12804a['result'][_0x9158('0x1a')]);}})['catch'](function(_0x1d2df3){logger[_0x9158('0x19')]('WhatsappQueue,\x20%s,\x20%s',_0x53e855,_0x1d2df3);_0x4c533f(_0x1d2df3);});});}exports['GetWhatsappQueue']=function(_0xc9b6d2){var _0x2952d8=this;return new Promise(function(_0x5046a8,_0x22e437){return db['WhatsappQueue']['findAll']({'raw':_0xc9b6d2[_0x9158('0x1b')]?_0xc9b6d2[_0x9158('0x1b')][_0x9158('0x1c')]===undefined?!![]:![]:!![],'where':_0xc9b6d2['options']?_0xc9b6d2[_0x9158('0x1b')]['where']||null:null,'attributes':_0xc9b6d2[_0x9158('0x1b')]?_0xc9b6d2[_0x9158('0x1b')][_0x9158('0x1d')]||null:null,'limit':_0xc9b6d2[_0x9158('0x1b')]?_0xc9b6d2['options'][_0x9158('0x1e')]||null:null,'include':_0xc9b6d2[_0x9158('0x1b')]?_0xc9b6d2[_0x9158('0x1b')]['include']?_[_0x9158('0x1f')](_0xc9b6d2[_0x9158('0x1b')][_0x9158('0x20')],function(_0x1ebf7f){return{'model':db[_0x1ebf7f['model']],'as':_0x1ebf7f['as'],'attributes':_0x1ebf7f[_0x9158('0x1d')],'include':_0x1ebf7f[_0x9158('0x20')]?_[_0x9158('0x1f')](_0x1ebf7f[_0x9158('0x20')],function(_0xb1a1e3){return{'model':db[_0xb1a1e3[_0x9158('0x21')]],'as':_0xb1a1e3['as'],'attributes':_0xb1a1e3[_0x9158('0x1d')],'include':_0xb1a1e3[_0x9158('0x20')]?_[_0x9158('0x1f')](_0xb1a1e3[_0x9158('0x20')],function(_0x34d66d){return{'model':db[_0x34d66d[_0x9158('0x21')]],'as':_0x34d66d['as'],'attributes':_0x34d66d['attributes']};}):[]};}):[]};}):[]:[]})[_0x9158('0x13')](function(_0xc752d1){logger[_0x9158('0x14')](_0x9158('0x22'),_0xc9b6d2);logger[_0x9158('0x16')](_0x9158('0x22'),_0xc9b6d2,JSON['stringify'](_0xc752d1));_0x5046a8(_0xc752d1);})['catch'](function(_0x197bb7){logger['error']('GetWhatsappQueue',_0x197bb7[_0x9158('0x1a')],_0xc9b6d2);_0x22e437(_0x2952d8[_0x9158('0x19')](0x1f4,_0x197bb7[_0x9158('0x1a')]));});});};exports['ShowWhatsappQueue']=function(_0x52be35){var _0x484067=this;return new Promise(function(_0x5913cb,_0x448c79){return db[_0x9158('0x23')][_0x9158('0x24')]({'raw':_0x52be35['options']?_0x52be35[_0x9158('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x52be35['options']?_0x52be35['options']['where']||null:null,'attributes':_0x52be35[_0x9158('0x1b')]?_0x52be35[_0x9158('0x1b')][_0x9158('0x1d')]||null:null,'include':_0x52be35[_0x9158('0x1b')]?_0x52be35[_0x9158('0x1b')]['include']?_[_0x9158('0x1f')](_0x52be35[_0x9158('0x1b')][_0x9158('0x20')],function(_0x3faba9){return{'model':db[_0x3faba9[_0x9158('0x21')]],'as':_0x3faba9['as'],'attributes':_0x3faba9[_0x9158('0x1d')],'include':_0x3faba9[_0x9158('0x20')]?_[_0x9158('0x1f')](_0x3faba9[_0x9158('0x20')],function(_0x5af6f9){return{'model':db[_0x5af6f9['model']],'as':_0x5af6f9['as'],'attributes':_0x5af6f9[_0x9158('0x1d')],'include':_0x5af6f9['include']?_[_0x9158('0x1f')](_0x5af6f9['include'],function(_0x81faeb){return{'model':db[_0x81faeb[_0x9158('0x21')]],'as':_0x81faeb['as'],'attributes':_0x81faeb['attributes']};}):[]};}):[]};}):[]:[]})[_0x9158('0x13')](function(_0x5f0213){logger[_0x9158('0x14')](_0x9158('0x25'),_0x52be35);logger[_0x9158('0x16')]('ShowWhatsappQueue',_0x52be35,JSON[_0x9158('0x26')](_0x5f0213));_0x5913cb(_0x5f0213);})[_0x9158('0x27')](function(_0x4adc78){logger[_0x9158('0x19')](_0x9158('0x25'),_0x4adc78[_0x9158('0x1a')],_0x52be35);_0x448c79(_0x484067['error'](0x1f4,_0x4adc78['message']));});});};
\ No newline at end of file