Built motion from commit 1cfc41f6.|2.5.41
[motion2.git] / server / api / mailQueue / mailQueue.rpc.js
index 2260ef8..3456c5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x584b=['MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue'];(function(_0x213295,_0x465d81){var _0x43a797=function(_0x3bb580){while(--_0x3bb580){_0x213295['push'](_0x213295['shift']());}};_0x43a797(++_0x465d81);}(_0x584b,0x140));var _0xb584=function(_0x23e6bb,_0x5c2d69){_0x23e6bb=_0x23e6bb-0x0;var _0x1e3b4c=_0x584b[_0x23e6bb];return _0x1e3b4c;};'use strict';var _=require(_0xb584('0x0'));var util=require(_0xb584('0x1'));var moment=require(_0xb584('0x2'));var BPromise=require(_0xb584('0x3'));var rs=require(_0xb584('0x4'));var fs=require('fs');var Redis=require(_0xb584('0x5'));var db=require(_0xb584('0x6'))['db'];var utils=require(_0xb584('0x7'));var logger=require(_0xb584('0x8'))(_0xb584('0x9'));var config=require(_0xb584('0xa'));var jayson=require(_0xb584('0xb'));var client=jayson['client'][_0xb584('0xc')]({'port':0x232a});config[_0xb584('0xd')]=_[_0xb584('0xe')](config[_0xb584('0xd')],{'host':_0xb584('0xf'),'port':0x18eb});var socket=require(_0xb584('0x10'))(new Redis(config['redis']));require(_0xb584('0x11'))[_0xb584('0x12')](socket);function respondWithRpcPromise(_0x4bbbf2,_0x56ff53,_0x190058){return new BPromise(function(_0x184f85,_0x32650e){return client[_0xb584('0x13')](_0x4bbbf2,_0x190058)[_0xb584('0x14')](function(_0x1b2ac9){logger[_0xb584('0x15')](_0xb584('0x16'),_0x56ff53,'request\x20sent');logger[_0xb584('0x17')](_0xb584('0x18'),_0x56ff53,'request\x20sent',JSON[_0xb584('0x19')](_0x1b2ac9));if(_0x1b2ac9['error']){if(_0x1b2ac9[_0xb584('0x1a')][_0xb584('0x1b')]===0x1f4){logger[_0xb584('0x1a')](_0xb584('0x16'),_0x56ff53,_0x1b2ac9[_0xb584('0x1a')]['message']);return _0x32650e(_0x1b2ac9[_0xb584('0x1a')][_0xb584('0x1c')]);}logger[_0xb584('0x1a')]('MailQueue,\x20%s,\x20%s',_0x56ff53,_0x1b2ac9['error'][_0xb584('0x1c')]);return _0x184f85(_0x1b2ac9['error'][_0xb584('0x1c')]);}else{logger[_0xb584('0x15')](_0xb584('0x16'),_0x56ff53,'request\x20sent');_0x184f85(_0x1b2ac9[_0xb584('0x1d')][_0xb584('0x1c')]);}})[_0xb584('0x1e')](function(_0x42788d){logger[_0xb584('0x1a')]('MailQueue,\x20%s,\x20%s',_0x56ff53,_0x42788d);_0x32650e(_0x42788d);});});}exports[_0xb584('0x1f')]=function(_0x12b6b9){var _0x4b381f=this;return new Promise(function(_0xff7927,_0xd530ab){return db[_0xb584('0x20')][_0xb584('0x21')]({'raw':_0x12b6b9[_0xb584('0x22')]?_0x12b6b9[_0xb584('0x22')][_0xb584('0x23')]===undefined?!![]:![]:!![],'where':_0x12b6b9[_0xb584('0x22')]?_0x12b6b9[_0xb584('0x22')][_0xb584('0x24')]||null:null,'attributes':_0x12b6b9[_0xb584('0x22')]?_0x12b6b9[_0xb584('0x22')][_0xb584('0x25')]||null:null,'limit':_0x12b6b9[_0xb584('0x22')]?_0x12b6b9[_0xb584('0x22')][_0xb584('0x26')]||null:null,'include':_0x12b6b9[_0xb584('0x22')]?_0x12b6b9[_0xb584('0x22')][_0xb584('0x27')]?_['map'](_0x12b6b9[_0xb584('0x22')][_0xb584('0x27')],function(_0x978937){return{'model':db[_0x978937['model']],'as':_0x978937['as'],'attributes':_0x978937['attributes'],'include':_0x978937[_0xb584('0x27')]?_[_0xb584('0x28')](_0x978937['include'],function(_0x369948){return{'model':db[_0x369948[_0xb584('0x29')]],'as':_0x369948['as'],'attributes':_0x369948[_0xb584('0x25')],'include':_0x369948['include']?_[_0xb584('0x28')](_0x369948[_0xb584('0x27')],function(_0x2daf97){return{'model':db[_0x2daf97[_0xb584('0x29')]],'as':_0x2daf97['as'],'attributes':_0x2daf97[_0xb584('0x25')]};}):[]};}):[]};}):[]:[]})[_0xb584('0x14')](function(_0x4222c6){logger[_0xb584('0x15')](_0xb584('0x1f'),_0x12b6b9);logger[_0xb584('0x17')]('GetMailQueue',_0x12b6b9,JSON['stringify'](_0x4222c6));_0xff7927(_0x4222c6);})[_0xb584('0x1e')](function(_0x7e8190){logger['error'](_0xb584('0x1f'),_0x7e8190[_0xb584('0x1c')],_0x12b6b9);_0xd530ab(_0x4b381f['error'](0x1f4,_0x7e8190[_0xb584('0x1c')]));});});};exports[_0xb584('0x2a')]=function(_0x37791f){var _0x188947=this;return new Promise(function(_0x381e30,_0x18ad76){return db['MailQueue'][_0xb584('0x2b')]({'raw':_0x37791f[_0xb584('0x22')]?_0x37791f['options'][_0xb584('0x23')]===undefined?!![]:![]:!![],'where':_0x37791f[_0xb584('0x22')]?_0x37791f['options'][_0xb584('0x24')]||null:null,'attributes':_0x37791f[_0xb584('0x22')]?_0x37791f[_0xb584('0x22')]['attributes']||null:null,'include':_0x37791f[_0xb584('0x22')]?_0x37791f['options'][_0xb584('0x27')]?_['map'](_0x37791f[_0xb584('0x22')][_0xb584('0x27')],function(_0x156c33){return{'model':db[_0x156c33[_0xb584('0x29')]],'as':_0x156c33['as'],'attributes':_0x156c33[_0xb584('0x25')],'include':_0x156c33[_0xb584('0x27')]?_[_0xb584('0x28')](_0x156c33[_0xb584('0x27')],function(_0x22c0bc){return{'model':db[_0x22c0bc[_0xb584('0x29')]],'as':_0x22c0bc['as'],'attributes':_0x22c0bc[_0xb584('0x25')],'include':_0x22c0bc['include']?_['map'](_0x22c0bc[_0xb584('0x27')],function(_0x114823){return{'model':db[_0x114823[_0xb584('0x29')]],'as':_0x114823['as'],'attributes':_0x114823['attributes']};}):[]};}):[]};}):[]:[]})[_0xb584('0x14')](function(_0x429a6d){logger[_0xb584('0x15')](_0xb584('0x2a'),_0x37791f);logger[_0xb584('0x17')](_0xb584('0x2a'),_0x37791f,JSON['stringify'](_0x429a6d));_0x381e30(_0x429a6d);})[_0xb584('0x1e')](function(_0x878204){logger[_0xb584('0x1a')]('ShowMailQueue',_0x878204[_0xb584('0x1c')],_0x37791f);_0x18ad76(_0x188947[_0xb584('0x1a')](0x1f4,_0x878204[_0xb584('0x1c')]));});});};
\ No newline at end of file
+var _0x102f=['where','attributes','limit','include','model','map','stringify','find','raw','ShowMailQueue','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','GetMailQueue','MailQueue','findAll','options'];(function(_0x4481c4,_0x4495d6){var _0x533bd1=function(_0x1fd3fe){while(--_0x1fd3fe){_0x4481c4['push'](_0x4481c4['shift']());}};_0x533bd1(++_0x4495d6);}(_0x102f,0x1d2));var _0xf102=function(_0x2e3dfc,_0x454d6c){_0x2e3dfc=_0x2e3dfc-0x0;var _0x4b1245=_0x102f[_0x2e3dfc];return _0x4b1245;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf102('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf102('0x1'))['db'];var utils=require(_0xf102('0x2'));var logger=require(_0xf102('0x3'))(_0xf102('0x4'));var config=require('../../config/environment');var jayson=require(_0xf102('0x5'));var client=jayson[_0xf102('0x6')]['http']({'port':0x232a});config[_0xf102('0x7')]=_[_0xf102('0x8')](config[_0xf102('0x7')],{'host':_0xf102('0x9'),'port':0x18eb});var socket=require(_0xf102('0xa'))(new Redis(config[_0xf102('0x7')]));require(_0xf102('0xb'))[_0xf102('0xc')](socket);function respondWithRpcPromise(_0x556981,_0x4def0b,_0x4c3e1e){return new BPromise(function(_0x21e885,_0x9ab031){return client['request'](_0x556981,_0x4c3e1e)[_0xf102('0xd')](function(_0x5bfb0d){logger['info'](_0xf102('0xe'),_0x4def0b,_0xf102('0xf'));logger[_0xf102('0x10')](_0xf102('0x11'),_0x4def0b,'request\x20sent',JSON['stringify'](_0x5bfb0d));if(_0x5bfb0d['error']){if(_0x5bfb0d['error'][_0xf102('0x12')]===0x1f4){logger[_0xf102('0x13')](_0xf102('0xe'),_0x4def0b,_0x5bfb0d['error'][_0xf102('0x14')]);return _0x9ab031(_0x5bfb0d[_0xf102('0x13')][_0xf102('0x14')]);}logger[_0xf102('0x13')](_0xf102('0xe'),_0x4def0b,_0x5bfb0d[_0xf102('0x13')][_0xf102('0x14')]);return _0x21e885(_0x5bfb0d['error'][_0xf102('0x14')]);}else{logger[_0xf102('0x15')](_0xf102('0xe'),_0x4def0b,_0xf102('0xf'));_0x21e885(_0x5bfb0d[_0xf102('0x16')][_0xf102('0x14')]);}})[_0xf102('0x17')](function(_0x4eee2d){logger['error']('MailQueue,\x20%s,\x20%s',_0x4def0b,_0x4eee2d);_0x9ab031(_0x4eee2d);});});}exports[_0xf102('0x18')]=function(_0x1efbaa){var _0x1d53e1=this;return new Promise(function(_0x58e333,_0x4a5b69){return db[_0xf102('0x19')][_0xf102('0x1a')]({'raw':_0x1efbaa['options']?_0x1efbaa[_0xf102('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1efbaa[_0xf102('0x1b')]?_0x1efbaa['options'][_0xf102('0x1c')]||null:null,'attributes':_0x1efbaa[_0xf102('0x1b')]?_0x1efbaa[_0xf102('0x1b')][_0xf102('0x1d')]||null:null,'limit':_0x1efbaa[_0xf102('0x1b')]?_0x1efbaa['options'][_0xf102('0x1e')]||null:null,'include':_0x1efbaa[_0xf102('0x1b')]?_0x1efbaa[_0xf102('0x1b')][_0xf102('0x1f')]?_['map'](_0x1efbaa[_0xf102('0x1b')]['include'],function(_0x2d8116){return{'model':db[_0x2d8116[_0xf102('0x20')]],'as':_0x2d8116['as'],'attributes':_0x2d8116['attributes'],'include':_0x2d8116[_0xf102('0x1f')]?_[_0xf102('0x21')](_0x2d8116[_0xf102('0x1f')],function(_0x9db4c1){return{'model':db[_0x9db4c1['model']],'as':_0x9db4c1['as'],'attributes':_0x9db4c1[_0xf102('0x1d')],'include':_0x9db4c1[_0xf102('0x1f')]?_[_0xf102('0x21')](_0x9db4c1[_0xf102('0x1f')],function(_0x29dbd1){return{'model':db[_0x29dbd1[_0xf102('0x20')]],'as':_0x29dbd1['as'],'attributes':_0x29dbd1[_0xf102('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf102('0xd')](function(_0x43e67c){logger[_0xf102('0x15')]('GetMailQueue',_0x1efbaa);logger[_0xf102('0x10')](_0xf102('0x18'),_0x1efbaa,JSON[_0xf102('0x22')](_0x43e67c));_0x58e333(_0x43e67c);})[_0xf102('0x17')](function(_0x560005){logger[_0xf102('0x13')](_0xf102('0x18'),_0x560005[_0xf102('0x14')],_0x1efbaa);_0x4a5b69(_0x1d53e1[_0xf102('0x13')](0x1f4,_0x560005[_0xf102('0x14')]));});});};exports['ShowMailQueue']=function(_0x557893){var _0x40f2f0=this;return new Promise(function(_0x347b90,_0x464454){return db['MailQueue'][_0xf102('0x23')]({'raw':_0x557893['options']?_0x557893['options'][_0xf102('0x24')]===undefined?!![]:![]:!![],'where':_0x557893[_0xf102('0x1b')]?_0x557893[_0xf102('0x1b')][_0xf102('0x1c')]||null:null,'attributes':_0x557893['options']?_0x557893[_0xf102('0x1b')][_0xf102('0x1d')]||null:null,'include':_0x557893[_0xf102('0x1b')]?_0x557893['options'][_0xf102('0x1f')]?_[_0xf102('0x21')](_0x557893[_0xf102('0x1b')]['include'],function(_0x48b26e){return{'model':db[_0x48b26e['model']],'as':_0x48b26e['as'],'attributes':_0x48b26e['attributes'],'include':_0x48b26e[_0xf102('0x1f')]?_[_0xf102('0x21')](_0x48b26e[_0xf102('0x1f')],function(_0x4547a1){return{'model':db[_0x4547a1[_0xf102('0x20')]],'as':_0x4547a1['as'],'attributes':_0x4547a1[_0xf102('0x1d')],'include':_0x4547a1['include']?_[_0xf102('0x21')](_0x4547a1[_0xf102('0x1f')],function(_0x37236){return{'model':db[_0x37236[_0xf102('0x20')]],'as':_0x37236['as'],'attributes':_0x37236[_0xf102('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5306ce){logger[_0xf102('0x15')](_0xf102('0x25'),_0x557893);logger[_0xf102('0x10')](_0xf102('0x25'),_0x557893,JSON['stringify'](_0x5306ce));_0x347b90(_0x5306ce);})[_0xf102('0x17')](function(_0x4de6fc){logger[_0xf102('0x13')](_0xf102('0x25'),_0x4de6fc[_0xf102('0x14')],_0x557893);_0x464454(_0x40f2f0[_0xf102('0x13')](0x1f4,_0x4de6fc[_0xf102('0x14')]));});});};
\ No newline at end of file