Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / mailQueue / mailQueue.rpc.js
index 3bb8c28..48635cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4c6=['then','debug','find','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include','model','map'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xf4c6,0x1b2));var _0x6f4c=function(_0x28b0a4,_0x2ea758){_0x28b0a4=_0x28b0a4-0x0;var _0x105ce6=_0xf4c6[_0x28b0a4];return _0x105ce6;};'use strict';var _=require(_0x6f4c('0x0'));var util=require(_0x6f4c('0x1'));var moment=require(_0x6f4c('0x2'));var BPromise=require(_0x6f4c('0x3'));var rs=require(_0x6f4c('0x4'));var fs=require('fs');var Redis=require(_0x6f4c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f4c('0x6'));var logger=require(_0x6f4c('0x7'))(_0x6f4c('0x8'));var config=require(_0x6f4c('0x9'));var jayson=require(_0x6f4c('0xa'));var client=jayson[_0x6f4c('0xb')]['http']({'port':0x232a});config['redis']=_[_0x6f4c('0xc')](config['redis'],{'host':_0x6f4c('0xd'),'port':0x18eb});var socket=require(_0x6f4c('0xe'))(new Redis(config[_0x6f4c('0xf')]));require(_0x6f4c('0x10'))[_0x6f4c('0x11')](socket);function respondWithRpcPromise(_0x4cb5cf,_0x8a71f8,_0x223f9a){return new BPromise(function(_0x2bbd10,_0x47c9a3){return client[_0x6f4c('0x12')](_0x4cb5cf,_0x223f9a)['then'](function(_0x5ade13){logger[_0x6f4c('0x13')](_0x6f4c('0x14'),_0x8a71f8,'request\x20sent');logger['debug'](_0x6f4c('0x15'),_0x8a71f8,_0x6f4c('0x16'),JSON[_0x6f4c('0x17')](_0x5ade13));if(_0x5ade13[_0x6f4c('0x18')]){if(_0x5ade13[_0x6f4c('0x18')][_0x6f4c('0x19')]===0x1f4){logger[_0x6f4c('0x18')](_0x6f4c('0x14'),_0x8a71f8,_0x5ade13[_0x6f4c('0x18')][_0x6f4c('0x1a')]);return _0x47c9a3(_0x5ade13[_0x6f4c('0x18')]['message']);}logger['error'](_0x6f4c('0x14'),_0x8a71f8,_0x5ade13[_0x6f4c('0x18')][_0x6f4c('0x1a')]);return _0x2bbd10(_0x5ade13[_0x6f4c('0x18')][_0x6f4c('0x1a')]);}else{logger[_0x6f4c('0x13')](_0x6f4c('0x14'),_0x8a71f8,_0x6f4c('0x16'));_0x2bbd10(_0x5ade13[_0x6f4c('0x1b')]['message']);}})[_0x6f4c('0x1c')](function(_0x3fdb34){logger['error'](_0x6f4c('0x14'),_0x8a71f8,_0x3fdb34);_0x47c9a3(_0x3fdb34);});});}exports[_0x6f4c('0x1d')]=function(_0x2e229a){var _0x1b076e=this;return new Promise(function(_0x3c4388,_0x2ca5d0){return db[_0x6f4c('0x1e')]['findAll']({'raw':_0x2e229a[_0x6f4c('0x1f')]?_0x2e229a[_0x6f4c('0x1f')][_0x6f4c('0x20')]===undefined?!![]:![]:!![],'where':_0x2e229a['options']?_0x2e229a[_0x6f4c('0x1f')][_0x6f4c('0x21')]||null:null,'attributes':_0x2e229a[_0x6f4c('0x1f')]?_0x2e229a[_0x6f4c('0x1f')][_0x6f4c('0x22')]||null:null,'limit':_0x2e229a[_0x6f4c('0x1f')]?_0x2e229a[_0x6f4c('0x1f')][_0x6f4c('0x23')]||null:null,'include':_0x2e229a[_0x6f4c('0x1f')]?_0x2e229a[_0x6f4c('0x1f')][_0x6f4c('0x24')]?_['map'](_0x2e229a[_0x6f4c('0x1f')][_0x6f4c('0x24')],function(_0x1c9fd7){return{'model':db[_0x1c9fd7[_0x6f4c('0x25')]],'as':_0x1c9fd7['as'],'attributes':_0x1c9fd7[_0x6f4c('0x22')],'include':_0x1c9fd7['include']?_[_0x6f4c('0x26')](_0x1c9fd7[_0x6f4c('0x24')],function(_0x659de0){return{'model':db[_0x659de0['model']],'as':_0x659de0['as'],'attributes':_0x659de0['attributes'],'include':_0x659de0[_0x6f4c('0x24')]?_[_0x6f4c('0x26')](_0x659de0[_0x6f4c('0x24')],function(_0x5e3097){return{'model':db[_0x5e3097['model']],'as':_0x5e3097['as'],'attributes':_0x5e3097[_0x6f4c('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6f4c('0x27')](function(_0x44b4fd){logger['info'](_0x6f4c('0x1d'),_0x2e229a);logger[_0x6f4c('0x28')]('GetMailQueue',_0x2e229a,JSON[_0x6f4c('0x17')](_0x44b4fd));_0x3c4388(_0x44b4fd);})[_0x6f4c('0x1c')](function(_0x11bec6){logger[_0x6f4c('0x18')](_0x6f4c('0x1d'),_0x11bec6[_0x6f4c('0x1a')],_0x2e229a);_0x2ca5d0(_0x1b076e['error'](0x1f4,_0x11bec6['message']));});});};exports['ShowMailQueue']=function(_0x37843e){var _0x4fc70c=this;return new Promise(function(_0x484f23,_0x7f0f99){return db[_0x6f4c('0x1e')][_0x6f4c('0x29')]({'raw':_0x37843e[_0x6f4c('0x1f')]?_0x37843e[_0x6f4c('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x37843e[_0x6f4c('0x1f')]?_0x37843e[_0x6f4c('0x1f')][_0x6f4c('0x21')]||null:null,'attributes':_0x37843e[_0x6f4c('0x1f')]?_0x37843e[_0x6f4c('0x1f')][_0x6f4c('0x22')]||null:null,'include':_0x37843e['options']?_0x37843e[_0x6f4c('0x1f')][_0x6f4c('0x24')]?_[_0x6f4c('0x26')](_0x37843e['options'][_0x6f4c('0x24')],function(_0x4324db){return{'model':db[_0x4324db[_0x6f4c('0x25')]],'as':_0x4324db['as'],'attributes':_0x4324db[_0x6f4c('0x22')],'include':_0x4324db[_0x6f4c('0x24')]?_['map'](_0x4324db['include'],function(_0x229e7d){return{'model':db[_0x229e7d[_0x6f4c('0x25')]],'as':_0x229e7d['as'],'attributes':_0x229e7d['attributes'],'include':_0x229e7d[_0x6f4c('0x24')]?_[_0x6f4c('0x26')](_0x229e7d['include'],function(_0x5cf511){return{'model':db[_0x5cf511[_0x6f4c('0x25')]],'as':_0x5cf511['as'],'attributes':_0x5cf511[_0x6f4c('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6f4c('0x27')](function(_0x31ff10){logger[_0x6f4c('0x13')](_0x6f4c('0x2a'),_0x37843e);logger[_0x6f4c('0x28')]('ShowMailQueue',_0x37843e,JSON[_0x6f4c('0x17')](_0x31ff10));_0x484f23(_0x31ff10);})[_0x6f4c('0x1c')](function(_0x380057){logger['error'](_0x6f4c('0x2a'),_0x380057[_0x6f4c('0x1a')],_0x37843e);_0x7f0f99(_0x4fc70c[_0x6f4c('0x18')](0x1f4,_0x380057[_0x6f4c('0x1a')]));});});};
\ No newline at end of file
+var _0x2450=['GetMailQueue','MailQueue','findAll','options','raw','where','limit','include','map','model','attributes','info','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','socket.io-emitter','./mailQueue.socket','register','then','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','MailQueue,\x20%s,\x20%s','message','request\x20sent','catch'];(function(_0x9d8eef,_0x3e044e){var _0x410abc=function(_0x3b979a){while(--_0x3b979a){_0x9d8eef['push'](_0x9d8eef['shift']());}};_0x410abc(++_0x3e044e);}(_0x2450,0x117));var _0x0245=function(_0x2d6d7b,_0x183ff8){_0x2d6d7b=_0x2d6d7b-0x0;var _0x4372c5=_0x2450[_0x2d6d7b];return _0x4372c5;};'use strict';var _=require(_0x0245('0x0'));var util=require(_0x0245('0x1'));var moment=require(_0x0245('0x2'));var BPromise=require(_0x0245('0x3'));var rs=require(_0x0245('0x4'));var fs=require('fs');var Redis=require(_0x0245('0x5'));var db=require(_0x0245('0x6'))['db'];var utils=require(_0x0245('0x7'));var logger=require(_0x0245('0x8'))(_0x0245('0x9'));var config=require('../../config/environment');var jayson=require(_0x0245('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x0245('0xb')]=_[_0x0245('0xc')](config[_0x0245('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0245('0xd'))(new Redis(config[_0x0245('0xb')]));require(_0x0245('0xe'))[_0x0245('0xf')](socket);function respondWithRpcPromise(_0x370bda,_0x36244c,_0x315a20){return new BPromise(function(_0x4a68c4,_0x44aecc){return client['request'](_0x370bda,_0x315a20)[_0x0245('0x10')](function(_0x3ab98f){logger['info']('MailQueue,\x20%s,\x20%s',_0x36244c,'request\x20sent');logger[_0x0245('0x11')](_0x0245('0x12'),_0x36244c,'request\x20sent',JSON[_0x0245('0x13')](_0x3ab98f));if(_0x3ab98f[_0x0245('0x14')]){if(_0x3ab98f[_0x0245('0x14')]['code']===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x36244c,_0x3ab98f[_0x0245('0x14')]['message']);return _0x44aecc(_0x3ab98f[_0x0245('0x14')]['message']);}logger[_0x0245('0x14')](_0x0245('0x15'),_0x36244c,_0x3ab98f['error']['message']);return _0x4a68c4(_0x3ab98f[_0x0245('0x14')][_0x0245('0x16')]);}else{logger['info'](_0x0245('0x15'),_0x36244c,_0x0245('0x17'));_0x4a68c4(_0x3ab98f['result'][_0x0245('0x16')]);}})[_0x0245('0x18')](function(_0x4f2e2f){logger[_0x0245('0x14')](_0x0245('0x15'),_0x36244c,_0x4f2e2f);_0x44aecc(_0x4f2e2f);});});}exports[_0x0245('0x19')]=function(_0x300ff4){var _0x542d07=this;return new Promise(function(_0x4c1940,_0x5c0768){return db[_0x0245('0x1a')][_0x0245('0x1b')]({'raw':_0x300ff4[_0x0245('0x1c')]?_0x300ff4[_0x0245('0x1c')][_0x0245('0x1d')]===undefined?!![]:![]:!![],'where':_0x300ff4['options']?_0x300ff4[_0x0245('0x1c')][_0x0245('0x1e')]||null:null,'attributes':_0x300ff4[_0x0245('0x1c')]?_0x300ff4[_0x0245('0x1c')]['attributes']||null:null,'limit':_0x300ff4[_0x0245('0x1c')]?_0x300ff4[_0x0245('0x1c')][_0x0245('0x1f')]||null:null,'include':_0x300ff4['options']?_0x300ff4[_0x0245('0x1c')][_0x0245('0x20')]?_[_0x0245('0x21')](_0x300ff4[_0x0245('0x1c')]['include'],function(_0x2aa36e){return{'model':db[_0x2aa36e[_0x0245('0x22')]],'as':_0x2aa36e['as'],'attributes':_0x2aa36e['attributes'],'include':_0x2aa36e[_0x0245('0x20')]?_[_0x0245('0x21')](_0x2aa36e[_0x0245('0x20')],function(_0x4ca51b){return{'model':db[_0x4ca51b['model']],'as':_0x4ca51b['as'],'attributes':_0x4ca51b[_0x0245('0x23')],'include':_0x4ca51b['include']?_['map'](_0x4ca51b[_0x0245('0x20')],function(_0x4479a2){return{'model':db[_0x4479a2[_0x0245('0x22')]],'as':_0x4479a2['as'],'attributes':_0x4479a2[_0x0245('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0245('0x10')](function(_0x264adf){logger[_0x0245('0x24')](_0x0245('0x19'),_0x300ff4);logger[_0x0245('0x11')]('GetMailQueue',_0x300ff4,JSON[_0x0245('0x13')](_0x264adf));_0x4c1940(_0x264adf);})[_0x0245('0x18')](function(_0x58d88b){logger[_0x0245('0x14')]('GetMailQueue',_0x58d88b[_0x0245('0x16')],_0x300ff4);_0x5c0768(_0x542d07[_0x0245('0x14')](0x1f4,_0x58d88b[_0x0245('0x16')]));});});};exports[_0x0245('0x25')]=function(_0x28fe9f){var _0x2cd6ad=this;return new Promise(function(_0x5174ad,_0x113176){return db[_0x0245('0x1a')]['find']({'raw':_0x28fe9f[_0x0245('0x1c')]?_0x28fe9f[_0x0245('0x1c')][_0x0245('0x1d')]===undefined?!![]:![]:!![],'where':_0x28fe9f[_0x0245('0x1c')]?_0x28fe9f[_0x0245('0x1c')][_0x0245('0x1e')]||null:null,'attributes':_0x28fe9f[_0x0245('0x1c')]?_0x28fe9f[_0x0245('0x1c')][_0x0245('0x23')]||null:null,'include':_0x28fe9f[_0x0245('0x1c')]?_0x28fe9f['options'][_0x0245('0x20')]?_['map'](_0x28fe9f[_0x0245('0x1c')]['include'],function(_0x429053){return{'model':db[_0x429053[_0x0245('0x22')]],'as':_0x429053['as'],'attributes':_0x429053[_0x0245('0x23')],'include':_0x429053[_0x0245('0x20')]?_[_0x0245('0x21')](_0x429053[_0x0245('0x20')],function(_0x2a697d){return{'model':db[_0x2a697d[_0x0245('0x22')]],'as':_0x2a697d['as'],'attributes':_0x2a697d[_0x0245('0x23')],'include':_0x2a697d[_0x0245('0x20')]?_[_0x0245('0x21')](_0x2a697d['include'],function(_0x3a0d31){return{'model':db[_0x3a0d31[_0x0245('0x22')]],'as':_0x3a0d31['as'],'attributes':_0x3a0d31[_0x0245('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0245('0x10')](function(_0x5e4e6d){logger['info']('ShowMailQueue',_0x28fe9f);logger['debug']('ShowMailQueue',_0x28fe9f,JSON['stringify'](_0x5e4e6d));_0x5174ad(_0x5e4e6d);})['catch'](function(_0x4f6dbb){logger[_0x0245('0x14')](_0x0245('0x25'),_0x4f6dbb[_0x0245('0x16')],_0x28fe9f);_0x113176(_0x2cd6ad[_0x0245('0x14')](0x1f4,_0x4f6dbb['message']));});});};
\ No newline at end of file