Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / api / mailQueue / mailQueue.rpc.js
index 990d626..cb7679f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd1a=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailQueue','find','lodash','util','moment'];(function(_0x3cb95f,_0x401148){var _0x386469=function(_0xb305){while(--_0xb305){_0x3cb95f['push'](_0x3cb95f['shift']());}};_0x386469(++_0x401148);}(_0xcd1a,0x115));var _0xacd1=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xcd1a[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0xacd1('0x0'));var util=require(_0xacd1('0x1'));var moment=require(_0xacd1('0x2'));var BPromise=require('bluebird');var rs=require(_0xacd1('0x3'));var fs=require('fs');var Redis=require(_0xacd1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xacd1('0x5'));var logger=require('../../config/logger')(_0xacd1('0x6'));var config=require(_0xacd1('0x7'));var jayson=require(_0xacd1('0x8'));var client=jayson[_0xacd1('0x9')][_0xacd1('0xa')]({'port':0x232a});config['redis']=_[_0xacd1('0xb')](config[_0xacd1('0xc')],{'host':_0xacd1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x562c11,_0x3426f1,_0x118302){return new BPromise(function(_0x25e2ef,_0x47cda7){return client[_0xacd1('0xe')](_0x562c11,_0x118302)[_0xacd1('0xf')](function(_0x316326){logger[_0xacd1('0x10')](_0xacd1('0x11'),_0x3426f1,_0xacd1('0x12'));logger[_0xacd1('0x13')](_0xacd1('0x14'),_0x3426f1,_0xacd1('0x12'),JSON[_0xacd1('0x15')](_0x316326));if(_0x316326[_0xacd1('0x16')]){if(_0x316326['error'][_0xacd1('0x17')]===0x1f4){logger[_0xacd1('0x16')](_0xacd1('0x11'),_0x3426f1,_0x316326[_0xacd1('0x16')]['message']);return _0x47cda7(_0x316326['error'][_0xacd1('0x18')]);}logger[_0xacd1('0x16')](_0xacd1('0x11'),_0x3426f1,_0x316326['error']['message']);return _0x25e2ef(_0x316326['error']['message']);}else{logger['info'](_0xacd1('0x11'),_0x3426f1,_0xacd1('0x12'));_0x25e2ef(_0x316326[_0xacd1('0x19')][_0xacd1('0x18')]);}})[_0xacd1('0x1a')](function(_0x50d696){logger['error']('MailQueue,\x20%s,\x20%s',_0x3426f1,_0x50d696);_0x47cda7(_0x50d696);});});}exports[_0xacd1('0x1b')]=function(_0xf50ce4){var _0x1b18cc=this;return new Promise(function(_0x3c268f,_0x373565){return db[_0xacd1('0x1c')][_0xacd1('0x1d')]({'raw':_0xf50ce4[_0xacd1('0x1e')]?_0xf50ce4[_0xacd1('0x1e')][_0xacd1('0x1f')]===undefined?!![]:![]:!![],'where':_0xf50ce4[_0xacd1('0x1e')]?_0xf50ce4[_0xacd1('0x1e')][_0xacd1('0x20')]||null:null,'attributes':_0xf50ce4['options']?_0xf50ce4[_0xacd1('0x1e')][_0xacd1('0x21')]||null:null,'limit':_0xf50ce4[_0xacd1('0x1e')]?_0xf50ce4['options'][_0xacd1('0x22')]||null:null,'include':_0xf50ce4[_0xacd1('0x1e')]?_0xf50ce4[_0xacd1('0x1e')]['include']?_['map'](_0xf50ce4[_0xacd1('0x1e')]['include'],function(_0x3d6a1f){return{'model':db[_0x3d6a1f['model']],'as':_0x3d6a1f['as'],'attributes':_0x3d6a1f[_0xacd1('0x21')],'include':_0x3d6a1f[_0xacd1('0x23')]?_[_0xacd1('0x24')](_0x3d6a1f[_0xacd1('0x23')],function(_0x3a1a01){return{'model':db[_0x3a1a01[_0xacd1('0x25')]],'as':_0x3a1a01['as'],'attributes':_0x3a1a01[_0xacd1('0x21')],'include':_0x3a1a01['include']?_[_0xacd1('0x24')](_0x3a1a01['include'],function(_0x5379ee){return{'model':db[_0x5379ee[_0xacd1('0x25')]],'as':_0x5379ee['as'],'attributes':_0x5379ee['attributes']};}):[]};}):[]};}):[]:[]})[_0xacd1('0xf')](function(_0x389082){logger[_0xacd1('0x10')](_0xacd1('0x1b'),_0xf50ce4);logger['debug']('GetMailQueue',_0xf50ce4,JSON[_0xacd1('0x15')](_0x389082));_0x3c268f(_0x389082);})[_0xacd1('0x1a')](function(_0x371cbb){logger[_0xacd1('0x16')]('GetMailQueue',_0x371cbb[_0xacd1('0x18')],_0xf50ce4);_0x373565(_0x1b18cc['error'](0x1f4,_0x371cbb[_0xacd1('0x18')]));});});};exports[_0xacd1('0x26')]=function(_0x53db5f){var _0x1003b8=this;return new Promise(function(_0xa502fe,_0x3d6a8c){return db['MailQueue'][_0xacd1('0x27')]({'raw':_0x53db5f[_0xacd1('0x1e')]?_0x53db5f[_0xacd1('0x1e')][_0xacd1('0x1f')]===undefined?!![]:![]:!![],'where':_0x53db5f[_0xacd1('0x1e')]?_0x53db5f['options'][_0xacd1('0x20')]||null:null,'attributes':_0x53db5f[_0xacd1('0x1e')]?_0x53db5f['options']['attributes']||null:null,'include':_0x53db5f['options']?_0x53db5f[_0xacd1('0x1e')][_0xacd1('0x23')]?_[_0xacd1('0x24')](_0x53db5f[_0xacd1('0x1e')][_0xacd1('0x23')],function(_0x2d2c53){return{'model':db[_0x2d2c53[_0xacd1('0x25')]],'as':_0x2d2c53['as'],'attributes':_0x2d2c53[_0xacd1('0x21')],'include':_0x2d2c53['include']?_[_0xacd1('0x24')](_0x2d2c53['include'],function(_0x56eef6){return{'model':db[_0x56eef6[_0xacd1('0x25')]],'as':_0x56eef6['as'],'attributes':_0x56eef6[_0xacd1('0x21')],'include':_0x56eef6[_0xacd1('0x23')]?_[_0xacd1('0x24')](_0x56eef6[_0xacd1('0x23')],function(_0x1f7384){return{'model':db[_0x1f7384[_0xacd1('0x25')]],'as':_0x1f7384['as'],'attributes':_0x1f7384['attributes']};}):[]};}):[]};}):[]:[]})[_0xacd1('0xf')](function(_0x367ae3){logger[_0xacd1('0x10')](_0xacd1('0x26'),_0x53db5f);logger[_0xacd1('0x13')](_0xacd1('0x26'),_0x53db5f,JSON['stringify'](_0x367ae3));_0xa502fe(_0x367ae3);})[_0xacd1('0x1a')](function(_0x42607c){logger[_0xacd1('0x16')]('ShowMailQueue',_0x42607c[_0xacd1('0x18')],_0x53db5f);_0x3d6a8c(_0x1003b8[_0xacd1('0x16')](0x1f4,_0x42607c[_0xacd1('0x18')]));});});};
\ No newline at end of file
+var _0xefd7=['redis','defaults','localhost','socket.io-emitter','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','catch','ShowMailQueue','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x1a63b5,_0xdf7e5){var _0x44ad2d=function(_0x49dff0){while(--_0x49dff0){_0x1a63b5['push'](_0x1a63b5['shift']());}};_0x44ad2d(++_0xdf7e5);}(_0xefd7,0x99));var _0x7efd=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xefd7[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7efd('0x0'));var util=require('util');var moment=require(_0x7efd('0x1'));var BPromise=require(_0x7efd('0x2'));var rs=require(_0x7efd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7efd('0x4'))['db'];var utils=require(_0x7efd('0x5'));var logger=require(_0x7efd('0x6'))(_0x7efd('0x7'));var config=require('../../config/environment');var jayson=require(_0x7efd('0x8'));var client=jayson[_0x7efd('0x9')][_0x7efd('0xa')]({'port':0x232a});config[_0x7efd('0xb')]=_[_0x7efd('0xc')](config[_0x7efd('0xb')],{'host':_0x7efd('0xd'),'port':0x18eb});var socket=require(_0x7efd('0xe'))(new Redis(config[_0x7efd('0xb')]));require('./mailQueue.socket')[_0x7efd('0xf')](socket);function respondWithRpcPromise(_0x297368,_0x511ccc,_0x77b8c0){return new BPromise(function(_0x24d2b0,_0x5a7ee4){return client[_0x7efd('0x10')](_0x297368,_0x77b8c0)[_0x7efd('0x11')](function(_0x5ba66b){logger[_0x7efd('0x12')](_0x7efd('0x13'),_0x511ccc,_0x7efd('0x14'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x511ccc,_0x7efd('0x14'),JSON[_0x7efd('0x15')](_0x5ba66b));if(_0x5ba66b[_0x7efd('0x16')]){if(_0x5ba66b['error'][_0x7efd('0x17')]===0x1f4){logger[_0x7efd('0x16')](_0x7efd('0x13'),_0x511ccc,_0x5ba66b['error'][_0x7efd('0x18')]);return _0x5a7ee4(_0x5ba66b[_0x7efd('0x16')]['message']);}logger[_0x7efd('0x16')]('MailQueue,\x20%s,\x20%s',_0x511ccc,_0x5ba66b[_0x7efd('0x16')][_0x7efd('0x18')]);return _0x24d2b0(_0x5ba66b[_0x7efd('0x16')]['message']);}else{logger[_0x7efd('0x12')](_0x7efd('0x13'),_0x511ccc,_0x7efd('0x14'));_0x24d2b0(_0x5ba66b[_0x7efd('0x19')]['message']);}})['catch'](function(_0x2f4b5a){logger['error']('MailQueue,\x20%s,\x20%s',_0x511ccc,_0x2f4b5a);_0x5a7ee4(_0x2f4b5a);});});}exports[_0x7efd('0x1a')]=function(_0x176600){var _0x297134=this;return new Promise(function(_0x2bb135,_0x5db31e){return db[_0x7efd('0x1b')][_0x7efd('0x1c')]({'raw':_0x176600[_0x7efd('0x1d')]?_0x176600['options'][_0x7efd('0x1e')]===undefined?!![]:![]:!![],'where':_0x176600[_0x7efd('0x1d')]?_0x176600[_0x7efd('0x1d')][_0x7efd('0x1f')]||null:null,'attributes':_0x176600[_0x7efd('0x1d')]?_0x176600['options'][_0x7efd('0x20')]||null:null,'limit':_0x176600[_0x7efd('0x1d')]?_0x176600[_0x7efd('0x1d')][_0x7efd('0x21')]||null:null,'include':_0x176600[_0x7efd('0x1d')]?_0x176600[_0x7efd('0x1d')][_0x7efd('0x22')]?_[_0x7efd('0x23')](_0x176600['options'][_0x7efd('0x22')],function(_0x35ba40){return{'model':db[_0x35ba40[_0x7efd('0x24')]],'as':_0x35ba40['as'],'attributes':_0x35ba40['attributes'],'include':_0x35ba40[_0x7efd('0x22')]?_[_0x7efd('0x23')](_0x35ba40[_0x7efd('0x22')],function(_0x500b6e){return{'model':db[_0x500b6e[_0x7efd('0x24')]],'as':_0x500b6e['as'],'attributes':_0x500b6e['attributes'],'include':_0x500b6e[_0x7efd('0x22')]?_[_0x7efd('0x23')](_0x500b6e[_0x7efd('0x22')],function(_0x4d3c68){return{'model':db[_0x4d3c68[_0x7efd('0x24')]],'as':_0x4d3c68['as'],'attributes':_0x4d3c68['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x318250){logger[_0x7efd('0x12')](_0x7efd('0x1a'),_0x176600);logger[_0x7efd('0x25')](_0x7efd('0x1a'),_0x176600,JSON[_0x7efd('0x15')](_0x318250));_0x2bb135(_0x318250);})[_0x7efd('0x26')](function(_0x2fa66e){logger[_0x7efd('0x16')](_0x7efd('0x1a'),_0x2fa66e['message'],_0x176600);_0x5db31e(_0x297134[_0x7efd('0x16')](0x1f4,_0x2fa66e[_0x7efd('0x18')]));});});};exports[_0x7efd('0x27')]=function(_0x4e7664){var _0x51cfd0=this;return new Promise(function(_0x4abb05,_0x2023a8){return db['MailQueue'][_0x7efd('0x28')]({'raw':_0x4e7664[_0x7efd('0x1d')]?_0x4e7664[_0x7efd('0x1d')][_0x7efd('0x1e')]===undefined?!![]:![]:!![],'where':_0x4e7664[_0x7efd('0x1d')]?_0x4e7664[_0x7efd('0x1d')]['where']||null:null,'attributes':_0x4e7664[_0x7efd('0x1d')]?_0x4e7664['options'][_0x7efd('0x20')]||null:null,'include':_0x4e7664[_0x7efd('0x1d')]?_0x4e7664['options']['include']?_['map'](_0x4e7664['options'][_0x7efd('0x22')],function(_0x4929d5){return{'model':db[_0x4929d5['model']],'as':_0x4929d5['as'],'attributes':_0x4929d5[_0x7efd('0x20')],'include':_0x4929d5[_0x7efd('0x22')]?_[_0x7efd('0x23')](_0x4929d5['include'],function(_0x24f5ff){return{'model':db[_0x24f5ff[_0x7efd('0x24')]],'as':_0x24f5ff['as'],'attributes':_0x24f5ff[_0x7efd('0x20')],'include':_0x24f5ff[_0x7efd('0x22')]?_[_0x7efd('0x23')](_0x24f5ff[_0x7efd('0x22')],function(_0x40fe24){return{'model':db[_0x40fe24[_0x7efd('0x24')]],'as':_0x40fe24['as'],'attributes':_0x40fe24['attributes']};}):[]};}):[]};}):[]:[]})[_0x7efd('0x11')](function(_0x3821b0){logger['info'](_0x7efd('0x27'),_0x4e7664);logger['debug'](_0x7efd('0x27'),_0x4e7664,JSON[_0x7efd('0x15')](_0x3821b0));_0x4abb05(_0x3821b0);})['catch'](function(_0x54457d){logger[_0x7efd('0x16')](_0x7efd('0x27'),_0x54457d['message'],_0x4e7664);_0x2023a8(_0x51cfd0[_0x7efd('0x16')](0x1f4,_0x54457d[_0x7efd('0x18')]));});});};
\ No newline at end of file