Built motion from commit (unavailable).|2.5.0
[motion2.git] / server / api / mailQueue / mailQueue.rpc.js
index 391217f..fd0cdbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2080=['debug','ShowMailQueue','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','options','raw','where','limit','include','map','model','attributes'];(function(_0x1ccba0,_0x23280c){var _0x14ecda=function(_0xbc8e3b){while(--_0xbc8e3b){_0x1ccba0['push'](_0x1ccba0['shift']());}};_0x14ecda(++_0x23280c);}(_0x2080,0x1c6));var _0x0208=function(_0x292fbe,_0x1148ec){_0x292fbe=_0x292fbe-0x0;var _0x53ddce=_0x2080[_0x292fbe];return _0x53ddce;};'use strict';var _=require(_0x0208('0x0'));var util=require(_0x0208('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0208('0x2'));var fs=require('fs');var Redis=require(_0x0208('0x3'));var db=require(_0x0208('0x4'))['db'];var utils=require(_0x0208('0x5'));var logger=require(_0x0208('0x6'))(_0x0208('0x7'));var config=require(_0x0208('0x8'));var jayson=require(_0x0208('0x9'));var client=jayson[_0x0208('0xa')][_0x0208('0xb')]({'port':0x232a});config[_0x0208('0xc')]=_[_0x0208('0xd')](config['redis'],{'host':_0x0208('0xe'),'port':0x18eb});var socket=require(_0x0208('0xf'))(new Redis(config[_0x0208('0xc')]));require('./mailQueue.socket')[_0x0208('0x10')](socket);function respondWithRpcPromise(_0x449780,_0x5143ac,_0x2b914b){return new BPromise(function(_0xdad1fc,_0x539752){return client['request'](_0x449780,_0x2b914b)[_0x0208('0x11')](function(_0x5447eb){logger[_0x0208('0x12')](_0x0208('0x13'),_0x5143ac,_0x0208('0x14'));logger['debug'](_0x0208('0x15'),_0x5143ac,'request\x20sent',JSON[_0x0208('0x16')](_0x5447eb));if(_0x5447eb[_0x0208('0x17')]){if(_0x5447eb['error'][_0x0208('0x18')]===0x1f4){logger[_0x0208('0x17')](_0x0208('0x13'),_0x5143ac,_0x5447eb[_0x0208('0x17')][_0x0208('0x19')]);return _0x539752(_0x5447eb[_0x0208('0x17')][_0x0208('0x19')]);}logger[_0x0208('0x17')](_0x0208('0x13'),_0x5143ac,_0x5447eb[_0x0208('0x17')]['message']);return _0xdad1fc(_0x5447eb['error']['message']);}else{logger['info'](_0x0208('0x13'),_0x5143ac,_0x0208('0x14'));_0xdad1fc(_0x5447eb[_0x0208('0x1a')][_0x0208('0x19')]);}})[_0x0208('0x1b')](function(_0x4f37e6){logger[_0x0208('0x17')](_0x0208('0x13'),_0x5143ac,_0x4f37e6);_0x539752(_0x4f37e6);});});}exports[_0x0208('0x1c')]=function(_0x334136){var _0x4bd983=this;return new Promise(function(_0x4bf0b1,_0x4d1458){return db[_0x0208('0x1d')]['findAll']({'raw':_0x334136[_0x0208('0x1e')]?_0x334136[_0x0208('0x1e')][_0x0208('0x1f')]===undefined?!![]:![]:!![],'where':_0x334136[_0x0208('0x1e')]?_0x334136['options'][_0x0208('0x20')]||null:null,'attributes':_0x334136[_0x0208('0x1e')]?_0x334136[_0x0208('0x1e')]['attributes']||null:null,'limit':_0x334136['options']?_0x334136[_0x0208('0x1e')][_0x0208('0x21')]||null:null,'include':_0x334136[_0x0208('0x1e')]?_0x334136[_0x0208('0x1e')][_0x0208('0x22')]?_[_0x0208('0x23')](_0x334136[_0x0208('0x1e')][_0x0208('0x22')],function(_0x4e2ed5){return{'model':db[_0x4e2ed5[_0x0208('0x24')]],'as':_0x4e2ed5['as'],'attributes':_0x4e2ed5['attributes'],'include':_0x4e2ed5['include']?_[_0x0208('0x23')](_0x4e2ed5[_0x0208('0x22')],function(_0x42f1eb){return{'model':db[_0x42f1eb[_0x0208('0x24')]],'as':_0x42f1eb['as'],'attributes':_0x42f1eb[_0x0208('0x25')],'include':_0x42f1eb['include']?_['map'](_0x42f1eb[_0x0208('0x22')],function(_0x50835f){return{'model':db[_0x50835f[_0x0208('0x24')]],'as':_0x50835f['as'],'attributes':_0x50835f[_0x0208('0x25')]};}):[]};}):[]};}):[]:[]})[_0x0208('0x11')](function(_0xc85954){logger[_0x0208('0x12')](_0x0208('0x1c'),_0x334136);logger[_0x0208('0x26')](_0x0208('0x1c'),_0x334136,JSON[_0x0208('0x16')](_0xc85954));_0x4bf0b1(_0xc85954);})['catch'](function(_0x12ae5f){logger[_0x0208('0x17')]('GetMailQueue',_0x12ae5f[_0x0208('0x19')],_0x334136);_0x4d1458(_0x4bd983['error'](0x1f4,_0x12ae5f[_0x0208('0x19')]));});});};exports[_0x0208('0x27')]=function(_0x55a33b){var _0x292631=this;return new Promise(function(_0x518661,_0x476796){return db['MailQueue'][_0x0208('0x28')]({'raw':_0x55a33b[_0x0208('0x1e')]?_0x55a33b[_0x0208('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x55a33b['options']?_0x55a33b[_0x0208('0x1e')][_0x0208('0x20')]||null:null,'attributes':_0x55a33b[_0x0208('0x1e')]?_0x55a33b['options'][_0x0208('0x25')]||null:null,'include':_0x55a33b['options']?_0x55a33b['options'][_0x0208('0x22')]?_[_0x0208('0x23')](_0x55a33b[_0x0208('0x1e')]['include'],function(_0x45c7a9){return{'model':db[_0x45c7a9[_0x0208('0x24')]],'as':_0x45c7a9['as'],'attributes':_0x45c7a9['attributes'],'include':_0x45c7a9['include']?_[_0x0208('0x23')](_0x45c7a9[_0x0208('0x22')],function(_0x4923e3){return{'model':db[_0x4923e3[_0x0208('0x24')]],'as':_0x4923e3['as'],'attributes':_0x4923e3[_0x0208('0x25')],'include':_0x4923e3[_0x0208('0x22')]?_[_0x0208('0x23')](_0x4923e3[_0x0208('0x22')],function(_0x17c5fa){return{'model':db[_0x17c5fa[_0x0208('0x24')]],'as':_0x17c5fa['as'],'attributes':_0x17c5fa['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ecef9){logger[_0x0208('0x12')](_0x0208('0x27'),_0x55a33b);logger['debug'](_0x0208('0x27'),_0x55a33b,JSON[_0x0208('0x16')](_0x1ecef9));_0x518661(_0x1ecef9);})[_0x0208('0x1b')](function(_0x1290b4){logger['error'](_0x0208('0x27'),_0x1290b4[_0x0208('0x19')],_0x55a33b);_0x476796(_0x292631[_0x0208('0x17')](0x1f4,_0x1290b4[_0x0208('0x19')]));});});};
\ No newline at end of file
+var _0xff57=['request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','map','include','model','then','ShowMailQueue','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','MailQueue,\x20%s,\x20%s'];(function(_0x139f86,_0x48fa6d){var _0x4a5b23=function(_0x2fd40c){while(--_0x2fd40c){_0x139f86['push'](_0x139f86['shift']());}};_0x4a5b23(++_0x48fa6d);}(_0xff57,0x105));var _0x7ff5=function(_0x4c4a43,_0x1a0c4b){_0x4c4a43=_0x4c4a43-0x0;var _0x39e886=_0xff57[_0x4c4a43];return _0x39e886;};'use strict';var _=require('lodash');var util=require(_0x7ff5('0x0'));var moment=require('moment');var BPromise=require(_0x7ff5('0x1'));var rs=require(_0x7ff5('0x2'));var fs=require('fs');var Redis=require(_0x7ff5('0x3'));var db=require(_0x7ff5('0x4'))['db'];var utils=require(_0x7ff5('0x5'));var logger=require(_0x7ff5('0x6'))('rpc');var config=require(_0x7ff5('0x7'));var jayson=require(_0x7ff5('0x8'));var client=jayson[_0x7ff5('0x9')][_0x7ff5('0xa')]({'port':0x232a});config[_0x7ff5('0xb')]=_[_0x7ff5('0xc')](config[_0x7ff5('0xb')],{'host':_0x7ff5('0xd'),'port':0x18eb});var socket=require(_0x7ff5('0xe'))(new Redis(config['redis']));require(_0x7ff5('0xf'))[_0x7ff5('0x10')](socket);function respondWithRpcPromise(_0x99b849,_0x5b7393,_0x1cae2a){return new BPromise(function(_0x479a60,_0x1c051c){return client[_0x7ff5('0x11')](_0x99b849,_0x1cae2a)['then'](function(_0x3a148a){logger['info'](_0x7ff5('0x12'),_0x5b7393,_0x7ff5('0x13'));logger[_0x7ff5('0x14')](_0x7ff5('0x15'),_0x5b7393,'request\x20sent',JSON[_0x7ff5('0x16')](_0x3a148a));if(_0x3a148a[_0x7ff5('0x17')]){if(_0x3a148a[_0x7ff5('0x17')]['code']===0x1f4){logger[_0x7ff5('0x17')](_0x7ff5('0x12'),_0x5b7393,_0x3a148a[_0x7ff5('0x17')][_0x7ff5('0x18')]);return _0x1c051c(_0x3a148a[_0x7ff5('0x17')][_0x7ff5('0x18')]);}logger[_0x7ff5('0x17')](_0x7ff5('0x12'),_0x5b7393,_0x3a148a[_0x7ff5('0x17')]['message']);return _0x479a60(_0x3a148a[_0x7ff5('0x17')][_0x7ff5('0x18')]);}else{logger[_0x7ff5('0x19')](_0x7ff5('0x12'),_0x5b7393,_0x7ff5('0x13'));_0x479a60(_0x3a148a[_0x7ff5('0x1a')][_0x7ff5('0x18')]);}})[_0x7ff5('0x1b')](function(_0x58902e){logger[_0x7ff5('0x17')](_0x7ff5('0x12'),_0x5b7393,_0x58902e);_0x1c051c(_0x58902e);});});}exports[_0x7ff5('0x1c')]=function(_0x20665c){var _0x3bdfbd=this;return new Promise(function(_0x326b48,_0x54f5f4){return db[_0x7ff5('0x1d')]['findAll']({'raw':_0x20665c['options']?_0x20665c[_0x7ff5('0x1e')][_0x7ff5('0x1f')]===undefined?!![]:![]:!![],'where':_0x20665c[_0x7ff5('0x1e')]?_0x20665c[_0x7ff5('0x1e')][_0x7ff5('0x20')]||null:null,'attributes':_0x20665c[_0x7ff5('0x1e')]?_0x20665c['options'][_0x7ff5('0x21')]||null:null,'limit':_0x20665c[_0x7ff5('0x1e')]?_0x20665c[_0x7ff5('0x1e')][_0x7ff5('0x22')]||null:null,'include':_0x20665c[_0x7ff5('0x1e')]?_0x20665c[_0x7ff5('0x1e')]['include']?_[_0x7ff5('0x23')](_0x20665c[_0x7ff5('0x1e')][_0x7ff5('0x24')],function(_0x17a351){return{'model':db[_0x17a351[_0x7ff5('0x25')]],'as':_0x17a351['as'],'attributes':_0x17a351[_0x7ff5('0x21')],'include':_0x17a351['include']?_[_0x7ff5('0x23')](_0x17a351['include'],function(_0x33b1b3){return{'model':db[_0x33b1b3[_0x7ff5('0x25')]],'as':_0x33b1b3['as'],'attributes':_0x33b1b3[_0x7ff5('0x21')],'include':_0x33b1b3['include']?_[_0x7ff5('0x23')](_0x33b1b3[_0x7ff5('0x24')],function(_0x57681f){return{'model':db[_0x57681f[_0x7ff5('0x25')]],'as':_0x57681f['as'],'attributes':_0x57681f[_0x7ff5('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7ff5('0x26')](function(_0x3f48ac){logger[_0x7ff5('0x19')](_0x7ff5('0x1c'),_0x20665c);logger[_0x7ff5('0x14')]('GetMailQueue',_0x20665c,JSON[_0x7ff5('0x16')](_0x3f48ac));_0x326b48(_0x3f48ac);})[_0x7ff5('0x1b')](function(_0x6b98d2){logger[_0x7ff5('0x17')](_0x7ff5('0x1c'),_0x6b98d2[_0x7ff5('0x18')],_0x20665c);_0x54f5f4(_0x3bdfbd[_0x7ff5('0x17')](0x1f4,_0x6b98d2[_0x7ff5('0x18')]));});});};exports[_0x7ff5('0x27')]=function(_0x1f161f){var _0x4034da=this;return new Promise(function(_0x451e25,_0xd9d2e6){return db[_0x7ff5('0x1d')]['find']({'raw':_0x1f161f[_0x7ff5('0x1e')]?_0x1f161f['options'][_0x7ff5('0x1f')]===undefined?!![]:![]:!![],'where':_0x1f161f[_0x7ff5('0x1e')]?_0x1f161f[_0x7ff5('0x1e')]['where']||null:null,'attributes':_0x1f161f['options']?_0x1f161f[_0x7ff5('0x1e')][_0x7ff5('0x21')]||null:null,'include':_0x1f161f[_0x7ff5('0x1e')]?_0x1f161f[_0x7ff5('0x1e')]['include']?_[_0x7ff5('0x23')](_0x1f161f[_0x7ff5('0x1e')][_0x7ff5('0x24')],function(_0xec77af){return{'model':db[_0xec77af[_0x7ff5('0x25')]],'as':_0xec77af['as'],'attributes':_0xec77af[_0x7ff5('0x21')],'include':_0xec77af['include']?_[_0x7ff5('0x23')](_0xec77af['include'],function(_0x405e1b){return{'model':db[_0x405e1b[_0x7ff5('0x25')]],'as':_0x405e1b['as'],'attributes':_0x405e1b[_0x7ff5('0x21')],'include':_0x405e1b[_0x7ff5('0x24')]?_['map'](_0x405e1b[_0x7ff5('0x24')],function(_0x16f470){return{'model':db[_0x16f470[_0x7ff5('0x25')]],'as':_0x16f470['as'],'attributes':_0x16f470[_0x7ff5('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7ff5('0x26')](function(_0x459ac1){logger[_0x7ff5('0x19')](_0x7ff5('0x27'),_0x1f161f);logger['debug'](_0x7ff5('0x27'),_0x1f161f,JSON['stringify'](_0x459ac1));_0x451e25(_0x459ac1);})['catch'](function(_0x454d41){logger['error'](_0x7ff5('0x27'),_0x454d41[_0x7ff5('0x18')],_0x1f161f);_0xd9d2e6(_0x4034da[_0x7ff5('0x17')](0x1f4,_0x454d41[_0x7ff5('0x18')]));});});};
\ No newline at end of file