Built motion from commit 3e059bc2.|2.5.32
[motion2.git] / server / api / mailQueue / mailQueue.rpc.js
index 117c0b6..6a1e3f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ffa=['raw','where','attributes','limit','include','map','model','then','info','GetMailQueue','debug','ShowMailQueue','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','./mailQueue.socket','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailQueue','findAll','options'];(function(_0x89d3a6,_0x3dd79c){var _0x2c3193=function(_0x2abad3){while(--_0x2abad3){_0x89d3a6['push'](_0x89d3a6['shift']());}};_0x2c3193(++_0x3dd79c);}(_0x9ffa,0x1d4));var _0xa9ff=function(_0x25be59,_0x6c2be8){_0x25be59=_0x25be59-0x0;var _0x452fe1=_0x9ffa[_0x25be59];return _0x452fe1;};'use strict';var _=require(_0xa9ff('0x0'));var util=require(_0xa9ff('0x1'));var moment=require(_0xa9ff('0x2'));var BPromise=require(_0xa9ff('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9ff('0x4'))['db'];var utils=require(_0xa9ff('0x5'));var logger=require(_0xa9ff('0x6'))(_0xa9ff('0x7'));var config=require(_0xa9ff('0x8'));var jayson=require(_0xa9ff('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xa9ff('0xa')]=_[_0xa9ff('0xb')](config[_0xa9ff('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa9ff('0xa')]));require(_0xa9ff('0xc'))[_0xa9ff('0xd')](socket);function respondWithRpcPromise(_0xc904fa,_0x56776f,_0x4cb3c9){return new BPromise(function(_0x52346e,_0x3c2583){return client[_0xa9ff('0xe')](_0xc904fa,_0x4cb3c9)['then'](function(_0x1e47bb){logger['info'](_0xa9ff('0xf'),_0x56776f,_0xa9ff('0x10'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x56776f,_0xa9ff('0x10'),JSON[_0xa9ff('0x11')](_0x1e47bb));if(_0x1e47bb[_0xa9ff('0x12')]){if(_0x1e47bb['error'][_0xa9ff('0x13')]===0x1f4){logger[_0xa9ff('0x12')](_0xa9ff('0xf'),_0x56776f,_0x1e47bb[_0xa9ff('0x12')][_0xa9ff('0x14')]);return _0x3c2583(_0x1e47bb[_0xa9ff('0x12')][_0xa9ff('0x14')]);}logger[_0xa9ff('0x12')](_0xa9ff('0xf'),_0x56776f,_0x1e47bb[_0xa9ff('0x12')][_0xa9ff('0x14')]);return _0x52346e(_0x1e47bb[_0xa9ff('0x12')][_0xa9ff('0x14')]);}else{logger['info'](_0xa9ff('0xf'),_0x56776f,'request\x20sent');_0x52346e(_0x1e47bb[_0xa9ff('0x15')][_0xa9ff('0x14')]);}})[_0xa9ff('0x16')](function(_0x44d0a0){logger[_0xa9ff('0x12')](_0xa9ff('0xf'),_0x56776f,_0x44d0a0);_0x3c2583(_0x44d0a0);});});}exports['GetMailQueue']=function(_0x2f3f7e){var _0x343062=this;return new Promise(function(_0x282c53,_0x1ee0b3){return db[_0xa9ff('0x17')][_0xa9ff('0x18')]({'raw':_0x2f3f7e[_0xa9ff('0x19')]?_0x2f3f7e[_0xa9ff('0x19')][_0xa9ff('0x1a')]===undefined?!![]:![]:!![],'where':_0x2f3f7e[_0xa9ff('0x19')]?_0x2f3f7e['options'][_0xa9ff('0x1b')]||null:null,'attributes':_0x2f3f7e[_0xa9ff('0x19')]?_0x2f3f7e[_0xa9ff('0x19')][_0xa9ff('0x1c')]||null:null,'limit':_0x2f3f7e['options']?_0x2f3f7e[_0xa9ff('0x19')][_0xa9ff('0x1d')]||null:null,'include':_0x2f3f7e[_0xa9ff('0x19')]?_0x2f3f7e[_0xa9ff('0x19')][_0xa9ff('0x1e')]?_[_0xa9ff('0x1f')](_0x2f3f7e['options'][_0xa9ff('0x1e')],function(_0x4fbbe2){return{'model':db[_0x4fbbe2['model']],'as':_0x4fbbe2['as'],'attributes':_0x4fbbe2[_0xa9ff('0x1c')],'include':_0x4fbbe2[_0xa9ff('0x1e')]?_['map'](_0x4fbbe2[_0xa9ff('0x1e')],function(_0x3b0bdc){return{'model':db[_0x3b0bdc[_0xa9ff('0x20')]],'as':_0x3b0bdc['as'],'attributes':_0x3b0bdc[_0xa9ff('0x1c')],'include':_0x3b0bdc[_0xa9ff('0x1e')]?_[_0xa9ff('0x1f')](_0x3b0bdc[_0xa9ff('0x1e')],function(_0x23b4c5){return{'model':db[_0x23b4c5['model']],'as':_0x23b4c5['as'],'attributes':_0x23b4c5['attributes']};}):[]};}):[]};}):[]:[]})[_0xa9ff('0x21')](function(_0x5bcf50){logger[_0xa9ff('0x22')](_0xa9ff('0x23'),_0x2f3f7e);logger[_0xa9ff('0x24')](_0xa9ff('0x23'),_0x2f3f7e,JSON[_0xa9ff('0x11')](_0x5bcf50));_0x282c53(_0x5bcf50);})[_0xa9ff('0x16')](function(_0x3de7cc){logger[_0xa9ff('0x12')](_0xa9ff('0x23'),_0x3de7cc[_0xa9ff('0x14')],_0x2f3f7e);_0x1ee0b3(_0x343062['error'](0x1f4,_0x3de7cc[_0xa9ff('0x14')]));});});};exports[_0xa9ff('0x25')]=function(_0x2a94d5){var _0x106b50=this;return new Promise(function(_0x47b81b,_0x569422){return db[_0xa9ff('0x17')]['find']({'raw':_0x2a94d5[_0xa9ff('0x19')]?_0x2a94d5[_0xa9ff('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2a94d5[_0xa9ff('0x19')]?_0x2a94d5[_0xa9ff('0x19')]['where']||null:null,'attributes':_0x2a94d5['options']?_0x2a94d5[_0xa9ff('0x19')][_0xa9ff('0x1c')]||null:null,'include':_0x2a94d5[_0xa9ff('0x19')]?_0x2a94d5[_0xa9ff('0x19')][_0xa9ff('0x1e')]?_['map'](_0x2a94d5['options'][_0xa9ff('0x1e')],function(_0x16cfda){return{'model':db[_0x16cfda['model']],'as':_0x16cfda['as'],'attributes':_0x16cfda['attributes'],'include':_0x16cfda[_0xa9ff('0x1e')]?_[_0xa9ff('0x1f')](_0x16cfda[_0xa9ff('0x1e')],function(_0x1a8b4f){return{'model':db[_0x1a8b4f['model']],'as':_0x1a8b4f['as'],'attributes':_0x1a8b4f[_0xa9ff('0x1c')],'include':_0x1a8b4f[_0xa9ff('0x1e')]?_[_0xa9ff('0x1f')](_0x1a8b4f[_0xa9ff('0x1e')],function(_0x37510e){return{'model':db[_0x37510e[_0xa9ff('0x20')]],'as':_0x37510e['as'],'attributes':_0x37510e[_0xa9ff('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a2bdc){logger[_0xa9ff('0x22')](_0xa9ff('0x25'),_0x2a94d5);logger['debug']('ShowMailQueue',_0x2a94d5,JSON['stringify'](_0x3a2bdc));_0x47b81b(_0x3a2bdc);})['catch'](function(_0x3197a8){logger['error'](_0xa9ff('0x25'),_0x3197a8['message'],_0x2a94d5);_0x569422(_0x106b50['error'](0x1f4,_0x3197a8[_0xa9ff('0x14')]));});});};
\ No newline at end of file
+var _0xcf01=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetMailQueue','MailQueue','findAll','options','where','attributes','limit','include','map','model','catch','ShowMailQueue','find','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x856969,_0x5c7b5c){var _0x4404b2=function(_0x3b0482){while(--_0x3b0482){_0x856969['push'](_0x856969['shift']());}};_0x4404b2(++_0x5c7b5c);}(_0xcf01,0x16b));var _0x1cf0=function(_0x5d1aea,_0x2a2fb8){_0x5d1aea=_0x5d1aea-0x0;var _0x1a91b6=_0xcf01[_0x5d1aea];return _0x1a91b6;};'use strict';var _=require(_0x1cf0('0x0'));var util=require(_0x1cf0('0x1'));var moment=require('moment');var BPromise=require(_0x1cf0('0x2'));var rs=require(_0x1cf0('0x3'));var fs=require('fs');var Redis=require(_0x1cf0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cf0('0x5'));var logger=require(_0x1cf0('0x6'))('rpc');var config=require(_0x1cf0('0x7'));var jayson=require(_0x1cf0('0x8'));var client=jayson[_0x1cf0('0x9')][_0x1cf0('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1cf0('0xb')],{'host':_0x1cf0('0xc'),'port':0x18eb});var socket=require(_0x1cf0('0xd'))(new Redis(config[_0x1cf0('0xb')]));require(_0x1cf0('0xe'))[_0x1cf0('0xf')](socket);function respondWithRpcPromise(_0x39582f,_0x851caa,_0x153e33){return new BPromise(function(_0x3a31b7,_0x4d4550){return client[_0x1cf0('0x10')](_0x39582f,_0x153e33)[_0x1cf0('0x11')](function(_0x58d32e){logger[_0x1cf0('0x12')](_0x1cf0('0x13'),_0x851caa,_0x1cf0('0x14'));logger[_0x1cf0('0x15')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x851caa,_0x1cf0('0x14'),JSON[_0x1cf0('0x16')](_0x58d32e));if(_0x58d32e[_0x1cf0('0x17')]){if(_0x58d32e['error'][_0x1cf0('0x18')]===0x1f4){logger['error'](_0x1cf0('0x13'),_0x851caa,_0x58d32e[_0x1cf0('0x17')][_0x1cf0('0x19')]);return _0x4d4550(_0x58d32e['error']['message']);}logger['error'](_0x1cf0('0x13'),_0x851caa,_0x58d32e['error'][_0x1cf0('0x19')]);return _0x3a31b7(_0x58d32e[_0x1cf0('0x17')][_0x1cf0('0x19')]);}else{logger[_0x1cf0('0x12')](_0x1cf0('0x13'),_0x851caa,_0x1cf0('0x14'));_0x3a31b7(_0x58d32e[_0x1cf0('0x1a')][_0x1cf0('0x19')]);}})['catch'](function(_0x15e70e){logger['error'](_0x1cf0('0x13'),_0x851caa,_0x15e70e);_0x4d4550(_0x15e70e);});});}exports[_0x1cf0('0x1b')]=function(_0xfd99a3){var _0x3e54e5=this;return new Promise(function(_0x11a13c,_0x25bb06){return db[_0x1cf0('0x1c')][_0x1cf0('0x1d')]({'raw':_0xfd99a3[_0x1cf0('0x1e')]?_0xfd99a3[_0x1cf0('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xfd99a3[_0x1cf0('0x1e')]?_0xfd99a3[_0x1cf0('0x1e')][_0x1cf0('0x1f')]||null:null,'attributes':_0xfd99a3[_0x1cf0('0x1e')]?_0xfd99a3['options'][_0x1cf0('0x20')]||null:null,'limit':_0xfd99a3[_0x1cf0('0x1e')]?_0xfd99a3[_0x1cf0('0x1e')][_0x1cf0('0x21')]||null:null,'include':_0xfd99a3[_0x1cf0('0x1e')]?_0xfd99a3['options'][_0x1cf0('0x22')]?_[_0x1cf0('0x23')](_0xfd99a3['options'][_0x1cf0('0x22')],function(_0x23fc8d){return{'model':db[_0x23fc8d[_0x1cf0('0x24')]],'as':_0x23fc8d['as'],'attributes':_0x23fc8d[_0x1cf0('0x20')],'include':_0x23fc8d['include']?_[_0x1cf0('0x23')](_0x23fc8d[_0x1cf0('0x22')],function(_0x517c8c){return{'model':db[_0x517c8c['model']],'as':_0x517c8c['as'],'attributes':_0x517c8c[_0x1cf0('0x20')],'include':_0x517c8c[_0x1cf0('0x22')]?_[_0x1cf0('0x23')](_0x517c8c['include'],function(_0x32cd1d){return{'model':db[_0x32cd1d[_0x1cf0('0x24')]],'as':_0x32cd1d['as'],'attributes':_0x32cd1d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c95c6){logger[_0x1cf0('0x12')](_0x1cf0('0x1b'),_0xfd99a3);logger[_0x1cf0('0x15')](_0x1cf0('0x1b'),_0xfd99a3,JSON['stringify'](_0x1c95c6));_0x11a13c(_0x1c95c6);})[_0x1cf0('0x25')](function(_0x180b9e){logger['error']('GetMailQueue',_0x180b9e[_0x1cf0('0x19')],_0xfd99a3);_0x25bb06(_0x3e54e5[_0x1cf0('0x17')](0x1f4,_0x180b9e['message']));});});};exports[_0x1cf0('0x26')]=function(_0x130585){var _0xb13081=this;return new Promise(function(_0x399cbd,_0x21813a){return db[_0x1cf0('0x1c')][_0x1cf0('0x27')]({'raw':_0x130585['options']?_0x130585['options'][_0x1cf0('0x28')]===undefined?!![]:![]:!![],'where':_0x130585['options']?_0x130585['options'][_0x1cf0('0x1f')]||null:null,'attributes':_0x130585['options']?_0x130585[_0x1cf0('0x1e')][_0x1cf0('0x20')]||null:null,'include':_0x130585['options']?_0x130585[_0x1cf0('0x1e')]['include']?_[_0x1cf0('0x23')](_0x130585[_0x1cf0('0x1e')]['include'],function(_0x1eb6be){return{'model':db[_0x1eb6be['model']],'as':_0x1eb6be['as'],'attributes':_0x1eb6be[_0x1cf0('0x20')],'include':_0x1eb6be[_0x1cf0('0x22')]?_[_0x1cf0('0x23')](_0x1eb6be[_0x1cf0('0x22')],function(_0xb801ae){return{'model':db[_0xb801ae[_0x1cf0('0x24')]],'as':_0xb801ae['as'],'attributes':_0xb801ae[_0x1cf0('0x20')],'include':_0xb801ae[_0x1cf0('0x22')]?_['map'](_0xb801ae[_0x1cf0('0x22')],function(_0x38ba47){return{'model':db[_0x38ba47['model']],'as':_0x38ba47['as'],'attributes':_0x38ba47[_0x1cf0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1cf0('0x11')](function(_0x14b024){logger['info']('ShowMailQueue',_0x130585);logger['debug']('ShowMailQueue',_0x130585,JSON[_0x1cf0('0x16')](_0x14b024));_0x399cbd(_0x14b024);})[_0x1cf0('0x25')](function(_0x3e25e7){logger['error']('ShowMailQueue',_0x3e25e7[_0x1cf0('0x19')],_0x130585);_0x21813a(_0xb13081[_0x1cf0('0x17')](0x1f4,_0x3e25e7[_0x1cf0('0x19')]));});});};
\ No newline at end of file