Built motion from commit 092f8824.|2.5.49
[motion2.git] / server / api / mailQueue / mailQueue.rpc.js
index a6cc136..ee820c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6d7=['raw','limit','include','model','attributes','map','debug','catch','MailQueue','where','then','ShowMailQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','info','result','GetMailQueue','findAll','options'];(function(_0x4bf5b0,_0x55fdcd){var _0x2f36e3=function(_0x35b91c){while(--_0x35b91c){_0x4bf5b0['push'](_0x4bf5b0['shift']());}};_0x2f36e3(++_0x55fdcd);}(_0xc6d7,0xb0));var _0x7c6d=function(_0xe972f4,_0x5f438a){_0xe972f4=_0xe972f4-0x0;var _0x47e98c=_0xc6d7[_0xe972f4];return _0x47e98c;};'use strict';var _=require(_0x7c6d('0x0'));var util=require(_0x7c6d('0x1'));var moment=require(_0x7c6d('0x2'));var BPromise=require(_0x7c6d('0x3'));var rs=require(_0x7c6d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c6d('0x5'))['db'];var utils=require(_0x7c6d('0x6'));var logger=require(_0x7c6d('0x7'))('rpc');var config=require(_0x7c6d('0x8'));var jayson=require(_0x7c6d('0x9'));var client=jayson['client'][_0x7c6d('0xa')]({'port':0x232a});config[_0x7c6d('0xb')]=_[_0x7c6d('0xc')](config[_0x7c6d('0xb')],{'host':_0x7c6d('0xd'),'port':0x18eb});var socket=require(_0x7c6d('0xe'))(new Redis(config['redis']));require(_0x7c6d('0xf'))[_0x7c6d('0x10')](socket);function respondWithRpcPromise(_0x191e3a,_0x8df540,_0x5badaf){return new BPromise(function(_0x3b96b1,_0xb80b4c){return client['request'](_0x191e3a,_0x5badaf)['then'](function(_0x22e4b8){logger['info']('MailQueue,\x20%s,\x20%s',_0x8df540,_0x7c6d('0x11'));logger['debug'](_0x7c6d('0x12'),_0x8df540,_0x7c6d('0x11'),JSON[_0x7c6d('0x13')](_0x22e4b8));if(_0x22e4b8[_0x7c6d('0x14')]){if(_0x22e4b8[_0x7c6d('0x14')][_0x7c6d('0x15')]===0x1f4){logger['error'](_0x7c6d('0x16'),_0x8df540,_0x22e4b8[_0x7c6d('0x14')][_0x7c6d('0x17')]);return _0xb80b4c(_0x22e4b8['error'][_0x7c6d('0x17')]);}logger[_0x7c6d('0x14')](_0x7c6d('0x16'),_0x8df540,_0x22e4b8[_0x7c6d('0x14')]['message']);return _0x3b96b1(_0x22e4b8[_0x7c6d('0x14')]['message']);}else{logger[_0x7c6d('0x18')](_0x7c6d('0x16'),_0x8df540,_0x7c6d('0x11'));_0x3b96b1(_0x22e4b8[_0x7c6d('0x19')][_0x7c6d('0x17')]);}})['catch'](function(_0x301d02){logger[_0x7c6d('0x14')](_0x7c6d('0x16'),_0x8df540,_0x301d02);_0xb80b4c(_0x301d02);});});}exports[_0x7c6d('0x1a')]=function(_0x1bb3c1){var _0x1b02ca=this;return new Promise(function(_0x428092,_0x3af3e2){return db['MailQueue'][_0x7c6d('0x1b')]({'raw':_0x1bb3c1[_0x7c6d('0x1c')]?_0x1bb3c1['options'][_0x7c6d('0x1d')]===undefined?!![]:![]:!![],'where':_0x1bb3c1['options']?_0x1bb3c1[_0x7c6d('0x1c')]['where']||null:null,'attributes':_0x1bb3c1[_0x7c6d('0x1c')]?_0x1bb3c1[_0x7c6d('0x1c')]['attributes']||null:null,'limit':_0x1bb3c1[_0x7c6d('0x1c')]?_0x1bb3c1[_0x7c6d('0x1c')][_0x7c6d('0x1e')]||null:null,'include':_0x1bb3c1[_0x7c6d('0x1c')]?_0x1bb3c1[_0x7c6d('0x1c')][_0x7c6d('0x1f')]?_['map'](_0x1bb3c1['options'][_0x7c6d('0x1f')],function(_0x122958){return{'model':db[_0x122958[_0x7c6d('0x20')]],'as':_0x122958['as'],'attributes':_0x122958[_0x7c6d('0x21')],'include':_0x122958['include']?_[_0x7c6d('0x22')](_0x122958[_0x7c6d('0x1f')],function(_0x5bd1e8){return{'model':db[_0x5bd1e8[_0x7c6d('0x20')]],'as':_0x5bd1e8['as'],'attributes':_0x5bd1e8['attributes'],'include':_0x5bd1e8[_0x7c6d('0x1f')]?_['map'](_0x5bd1e8['include'],function(_0x2ab7b8){return{'model':db[_0x2ab7b8[_0x7c6d('0x20')]],'as':_0x2ab7b8['as'],'attributes':_0x2ab7b8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fd572){logger[_0x7c6d('0x18')](_0x7c6d('0x1a'),_0x1bb3c1);logger[_0x7c6d('0x23')]('GetMailQueue',_0x1bb3c1,JSON['stringify'](_0x4fd572));_0x428092(_0x4fd572);})[_0x7c6d('0x24')](function(_0xdb3eb5){logger[_0x7c6d('0x14')]('GetMailQueue',_0xdb3eb5[_0x7c6d('0x17')],_0x1bb3c1);_0x3af3e2(_0x1b02ca['error'](0x1f4,_0xdb3eb5['message']));});});};exports['ShowMailQueue']=function(_0xa970a6){var _0x439a4d=this;return new Promise(function(_0xaeb928,_0x4ad1d6){return db[_0x7c6d('0x25')]['find']({'raw':_0xa970a6[_0x7c6d('0x1c')]?_0xa970a6[_0x7c6d('0x1c')][_0x7c6d('0x1d')]===undefined?!![]:![]:!![],'where':_0xa970a6[_0x7c6d('0x1c')]?_0xa970a6[_0x7c6d('0x1c')][_0x7c6d('0x26')]||null:null,'attributes':_0xa970a6[_0x7c6d('0x1c')]?_0xa970a6[_0x7c6d('0x1c')][_0x7c6d('0x21')]||null:null,'include':_0xa970a6[_0x7c6d('0x1c')]?_0xa970a6[_0x7c6d('0x1c')][_0x7c6d('0x1f')]?_[_0x7c6d('0x22')](_0xa970a6[_0x7c6d('0x1c')]['include'],function(_0xc4ec33){return{'model':db[_0xc4ec33[_0x7c6d('0x20')]],'as':_0xc4ec33['as'],'attributes':_0xc4ec33[_0x7c6d('0x21')],'include':_0xc4ec33['include']?_[_0x7c6d('0x22')](_0xc4ec33[_0x7c6d('0x1f')],function(_0x2838e0){return{'model':db[_0x2838e0[_0x7c6d('0x20')]],'as':_0x2838e0['as'],'attributes':_0x2838e0[_0x7c6d('0x21')],'include':_0x2838e0[_0x7c6d('0x1f')]?_[_0x7c6d('0x22')](_0x2838e0[_0x7c6d('0x1f')],function(_0x2d1296){return{'model':db[_0x2d1296[_0x7c6d('0x20')]],'as':_0x2d1296['as'],'attributes':_0x2d1296[_0x7c6d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7c6d('0x27')](function(_0x2ab3b7){logger['info']('ShowMailQueue',_0xa970a6);logger[_0x7c6d('0x23')]('ShowMailQueue',_0xa970a6,JSON['stringify'](_0x2ab3b7));_0xaeb928(_0x2ab3b7);})[_0x7c6d('0x24')](function(_0x5f274f){logger[_0x7c6d('0x14')](_0x7c6d('0x28'),_0x5f274f[_0x7c6d('0x17')],_0xa970a6);_0x4ad1d6(_0x439a4d[_0x7c6d('0x14')](0x1f4,_0x5f274f[_0x7c6d('0x17')]));});});};
\ No newline at end of file
+var _0x30e7=['error','MailQueue,\x20%s,\x20%s','message','info','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailQueue','find','lodash','util','bluebird','randomstring','rpc','jayson/promise','client','http','redis','defaults','localhost','./mailQueue.socket','then','request\x20sent','debug','stringify'];(function(_0x151334,_0x1e11ac){var _0x3d03da=function(_0x2099cf){while(--_0x2099cf){_0x151334['push'](_0x151334['shift']());}};_0x3d03da(++_0x1e11ac);}(_0x30e7,0x144));var _0x730e=function(_0x336b7b,_0x438d62){_0x336b7b=_0x336b7b-0x0;var _0x36cd35=_0x30e7[_0x336b7b];return _0x36cd35;};'use strict';var _=require(_0x730e('0x0'));var util=require(_0x730e('0x1'));var moment=require('moment');var BPromise=require(_0x730e('0x2'));var rs=require(_0x730e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x730e('0x4'));var config=require('../../config/environment');var jayson=require(_0x730e('0x5'));var client=jayson[_0x730e('0x6')][_0x730e('0x7')]({'port':0x232a});config[_0x730e('0x8')]=_[_0x730e('0x9')](config[_0x730e('0x8')],{'host':_0x730e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x730e('0x8')]));require(_0x730e('0xb'))['register'](socket);function respondWithRpcPromise(_0x2433fd,_0x46b1fb,_0x26db83){return new BPromise(function(_0x58c865,_0x2ab6b3){return client['request'](_0x2433fd,_0x26db83)[_0x730e('0xc')](function(_0x4558d1){logger['info']('MailQueue,\x20%s,\x20%s',_0x46b1fb,_0x730e('0xd'));logger[_0x730e('0xe')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x46b1fb,_0x730e('0xd'),JSON[_0x730e('0xf')](_0x4558d1));if(_0x4558d1['error']){if(_0x4558d1[_0x730e('0x10')]['code']===0x1f4){logger[_0x730e('0x10')](_0x730e('0x11'),_0x46b1fb,_0x4558d1[_0x730e('0x10')][_0x730e('0x12')]);return _0x2ab6b3(_0x4558d1[_0x730e('0x10')][_0x730e('0x12')]);}logger[_0x730e('0x10')](_0x730e('0x11'),_0x46b1fb,_0x4558d1[_0x730e('0x10')][_0x730e('0x12')]);return _0x58c865(_0x4558d1[_0x730e('0x10')]['message']);}else{logger[_0x730e('0x13')](_0x730e('0x11'),_0x46b1fb,_0x730e('0xd'));_0x58c865(_0x4558d1['result'][_0x730e('0x12')]);}})[_0x730e('0x14')](function(_0x4c7a3c){logger[_0x730e('0x10')](_0x730e('0x11'),_0x46b1fb,_0x4c7a3c);_0x2ab6b3(_0x4c7a3c);});});}exports[_0x730e('0x15')]=function(_0x784b80){var _0x4b48a5=this;return new Promise(function(_0x8da38,_0x53614a){return db[_0x730e('0x16')][_0x730e('0x17')]({'raw':_0x784b80[_0x730e('0x18')]?_0x784b80['options'][_0x730e('0x19')]===undefined?!![]:![]:!![],'where':_0x784b80['options']?_0x784b80[_0x730e('0x18')][_0x730e('0x1a')]||null:null,'attributes':_0x784b80[_0x730e('0x18')]?_0x784b80[_0x730e('0x18')][_0x730e('0x1b')]||null:null,'limit':_0x784b80['options']?_0x784b80['options'][_0x730e('0x1c')]||null:null,'include':_0x784b80['options']?_0x784b80[_0x730e('0x18')][_0x730e('0x1d')]?_[_0x730e('0x1e')](_0x784b80[_0x730e('0x18')][_0x730e('0x1d')],function(_0x572016){return{'model':db[_0x572016[_0x730e('0x1f')]],'as':_0x572016['as'],'attributes':_0x572016[_0x730e('0x1b')],'include':_0x572016[_0x730e('0x1d')]?_['map'](_0x572016[_0x730e('0x1d')],function(_0x20f54f){return{'model':db[_0x20f54f[_0x730e('0x1f')]],'as':_0x20f54f['as'],'attributes':_0x20f54f['attributes'],'include':_0x20f54f[_0x730e('0x1d')]?_['map'](_0x20f54f[_0x730e('0x1d')],function(_0x372cd9){return{'model':db[_0x372cd9['model']],'as':_0x372cd9['as'],'attributes':_0x372cd9['attributes']};}):[]};}):[]};}):[]:[]})[_0x730e('0xc')](function(_0x9db1bc){logger[_0x730e('0x13')]('GetMailQueue',_0x784b80);logger[_0x730e('0xe')](_0x730e('0x15'),_0x784b80,JSON[_0x730e('0xf')](_0x9db1bc));_0x8da38(_0x9db1bc);})[_0x730e('0x14')](function(_0x43d203){logger['error'](_0x730e('0x15'),_0x43d203['message'],_0x784b80);_0x53614a(_0x4b48a5[_0x730e('0x10')](0x1f4,_0x43d203[_0x730e('0x12')]));});});};exports[_0x730e('0x20')]=function(_0x149654){var _0x595f57=this;return new Promise(function(_0x81ea35,_0x567cf9){return db[_0x730e('0x16')][_0x730e('0x21')]({'raw':_0x149654[_0x730e('0x18')]?_0x149654[_0x730e('0x18')][_0x730e('0x19')]===undefined?!![]:![]:!![],'where':_0x149654['options']?_0x149654[_0x730e('0x18')][_0x730e('0x1a')]||null:null,'attributes':_0x149654[_0x730e('0x18')]?_0x149654['options'][_0x730e('0x1b')]||null:null,'include':_0x149654[_0x730e('0x18')]?_0x149654[_0x730e('0x18')][_0x730e('0x1d')]?_['map'](_0x149654['options'][_0x730e('0x1d')],function(_0x347e65){return{'model':db[_0x347e65[_0x730e('0x1f')]],'as':_0x347e65['as'],'attributes':_0x347e65[_0x730e('0x1b')],'include':_0x347e65[_0x730e('0x1d')]?_[_0x730e('0x1e')](_0x347e65[_0x730e('0x1d')],function(_0x38584e){return{'model':db[_0x38584e[_0x730e('0x1f')]],'as':_0x38584e['as'],'attributes':_0x38584e[_0x730e('0x1b')],'include':_0x38584e[_0x730e('0x1d')]?_['map'](_0x38584e['include'],function(_0x4920ec){return{'model':db[_0x4920ec[_0x730e('0x1f')]],'as':_0x4920ec['as'],'attributes':_0x4920ec[_0x730e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x730e('0xc')](function(_0x56f53e){logger[_0x730e('0x13')](_0x730e('0x20'),_0x149654);logger[_0x730e('0xe')]('ShowMailQueue',_0x149654,JSON[_0x730e('0xf')](_0x56f53e));_0x81ea35(_0x56f53e);})[_0x730e('0x14')](function(_0x256cf0){logger[_0x730e('0x10')](_0x730e('0x20'),_0x256cf0[_0x730e('0x12')],_0x149654);_0x567cf9(_0x595f57[_0x730e('0x10')](0x1f4,_0x256cf0[_0x730e('0x12')]));});});};
\ No newline at end of file