Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / mailQueue / mailQueue.rpc.js
index 7691e55..117c0b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61e1=['catch','GetMailQueue','MailQueue','findAll','options','limit','include','attributes','map','model','info','debug','ShowMailQueue','find','raw','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','request','then','request\x20sent','stringify','error','MailQueue,\x20%s,\x20%s','message','result'];(function(_0x526c89,_0x2653ca){var _0x20bd74=function(_0x5f0d54){while(--_0x5f0d54){_0x526c89['push'](_0x526c89['shift']());}};_0x20bd74(++_0x2653ca);}(_0x61e1,0x178));var _0x161e=function(_0x512121,_0x51855c){_0x512121=_0x512121-0x0;var _0x48c3ec=_0x61e1[_0x512121];return _0x48c3ec;};'use strict';var _=require(_0x161e('0x0'));var util=require(_0x161e('0x1'));var moment=require(_0x161e('0x2'));var BPromise=require('bluebird');var rs=require(_0x161e('0x3'));var fs=require('fs');var Redis=require(_0x161e('0x4'));var db=require(_0x161e('0x5'))['db'];var utils=require(_0x161e('0x6'));var logger=require('../../config/logger')(_0x161e('0x7'));var config=require(_0x161e('0x8'));var jayson=require(_0x161e('0x9'));var client=jayson[_0x161e('0xa')][_0x161e('0xb')]({'port':0x232a});config['redis']=_[_0x161e('0xc')](config[_0x161e('0xd')],{'host':_0x161e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailQueue.socket')[_0x161e('0xf')](socket);function respondWithRpcPromise(_0x13bf66,_0x14d2f8,_0x40fa74){return new BPromise(function(_0xadfcf,_0x250296){return client[_0x161e('0x10')](_0x13bf66,_0x40fa74)[_0x161e('0x11')](function(_0x17b54b){logger['info']('MailQueue,\x20%s,\x20%s',_0x14d2f8,'request\x20sent');logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x14d2f8,_0x161e('0x12'),JSON[_0x161e('0x13')](_0x17b54b));if(_0x17b54b[_0x161e('0x14')]){if(_0x17b54b[_0x161e('0x14')]['code']===0x1f4){logger[_0x161e('0x14')](_0x161e('0x15'),_0x14d2f8,_0x17b54b[_0x161e('0x14')][_0x161e('0x16')]);return _0x250296(_0x17b54b[_0x161e('0x14')][_0x161e('0x16')]);}logger['error'](_0x161e('0x15'),_0x14d2f8,_0x17b54b[_0x161e('0x14')][_0x161e('0x16')]);return _0xadfcf(_0x17b54b[_0x161e('0x14')]['message']);}else{logger['info'](_0x161e('0x15'),_0x14d2f8,'request\x20sent');_0xadfcf(_0x17b54b[_0x161e('0x17')][_0x161e('0x16')]);}})[_0x161e('0x18')](function(_0x271d39){logger[_0x161e('0x14')]('MailQueue,\x20%s,\x20%s',_0x14d2f8,_0x271d39);_0x250296(_0x271d39);});});}exports[_0x161e('0x19')]=function(_0x55d337){var _0x26a892=this;return new Promise(function(_0x1c7890,_0x420a5b){return db[_0x161e('0x1a')][_0x161e('0x1b')]({'raw':_0x55d337[_0x161e('0x1c')]?_0x55d337[_0x161e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x55d337[_0x161e('0x1c')]?_0x55d337[_0x161e('0x1c')]['where']||null:null,'attributes':_0x55d337[_0x161e('0x1c')]?_0x55d337[_0x161e('0x1c')]['attributes']||null:null,'limit':_0x55d337[_0x161e('0x1c')]?_0x55d337[_0x161e('0x1c')][_0x161e('0x1d')]||null:null,'include':_0x55d337['options']?_0x55d337[_0x161e('0x1c')][_0x161e('0x1e')]?_['map'](_0x55d337[_0x161e('0x1c')][_0x161e('0x1e')],function(_0xc7e3ca){return{'model':db[_0xc7e3ca['model']],'as':_0xc7e3ca['as'],'attributes':_0xc7e3ca[_0x161e('0x1f')],'include':_0xc7e3ca[_0x161e('0x1e')]?_[_0x161e('0x20')](_0xc7e3ca[_0x161e('0x1e')],function(_0x2c51b5){return{'model':db[_0x2c51b5[_0x161e('0x21')]],'as':_0x2c51b5['as'],'attributes':_0x2c51b5[_0x161e('0x1f')],'include':_0x2c51b5['include']?_[_0x161e('0x20')](_0x2c51b5[_0x161e('0x1e')],function(_0x37ce3d){return{'model':db[_0x37ce3d['model']],'as':_0x37ce3d['as'],'attributes':_0x37ce3d[_0x161e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x161e('0x11')](function(_0x40c55f){logger[_0x161e('0x22')](_0x161e('0x19'),_0x55d337);logger[_0x161e('0x23')](_0x161e('0x19'),_0x55d337,JSON[_0x161e('0x13')](_0x40c55f));_0x1c7890(_0x40c55f);})['catch'](function(_0x4a2bb8){logger[_0x161e('0x14')](_0x161e('0x19'),_0x4a2bb8[_0x161e('0x16')],_0x55d337);_0x420a5b(_0x26a892['error'](0x1f4,_0x4a2bb8[_0x161e('0x16')]));});});};exports[_0x161e('0x24')]=function(_0x4432f2){var _0xe109f5=this;return new Promise(function(_0xdcfa46,_0x3451e8){return db[_0x161e('0x1a')][_0x161e('0x25')]({'raw':_0x4432f2[_0x161e('0x1c')]?_0x4432f2[_0x161e('0x1c')][_0x161e('0x26')]===undefined?!![]:![]:!![],'where':_0x4432f2[_0x161e('0x1c')]?_0x4432f2[_0x161e('0x1c')][_0x161e('0x27')]||null:null,'attributes':_0x4432f2[_0x161e('0x1c')]?_0x4432f2[_0x161e('0x1c')][_0x161e('0x1f')]||null:null,'include':_0x4432f2[_0x161e('0x1c')]?_0x4432f2[_0x161e('0x1c')][_0x161e('0x1e')]?_[_0x161e('0x20')](_0x4432f2[_0x161e('0x1c')][_0x161e('0x1e')],function(_0x97f2cd){return{'model':db[_0x97f2cd['model']],'as':_0x97f2cd['as'],'attributes':_0x97f2cd[_0x161e('0x1f')],'include':_0x97f2cd[_0x161e('0x1e')]?_[_0x161e('0x20')](_0x97f2cd['include'],function(_0x5abc7d){return{'model':db[_0x5abc7d['model']],'as':_0x5abc7d['as'],'attributes':_0x5abc7d[_0x161e('0x1f')],'include':_0x5abc7d[_0x161e('0x1e')]?_[_0x161e('0x20')](_0x5abc7d[_0x161e('0x1e')],function(_0x4faa41){return{'model':db[_0x4faa41[_0x161e('0x21')]],'as':_0x4faa41['as'],'attributes':_0x4faa41[_0x161e('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c2aa6){logger['info'](_0x161e('0x24'),_0x4432f2);logger[_0x161e('0x23')]('ShowMailQueue',_0x4432f2,JSON[_0x161e('0x13')](_0x2c2aa6));_0xdcfa46(_0x2c2aa6);})[_0x161e('0x18')](function(_0x5e0715){logger['error'](_0x161e('0x24'),_0x5e0715['message'],_0x4432f2);_0x3451e8(_0xe109f5[_0x161e('0x14')](0x1f4,_0x5e0715[_0x161e('0x16')]));});});};
\ No newline at end of file
+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