Built motion from commit (unavailable).|2.5.30
[motion2.git] / server / api / mailMessage / mailMessage.rpc.js
index 777ee38..0985b04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe42c=['raw','then','info','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateMailMessage','body','options'];(function(_0x242391,_0xab826){var _0x1734f0=function(_0x16c72e){while(--_0x16c72e){_0x242391['push'](_0x242391['shift']());}};_0x1734f0(++_0xab826);}(_0xe42c,0x149));var _0xce42=function(_0x20b06c,_0x48d7ed){_0x20b06c=_0x20b06c-0x0;var _0x3ed917=_0xe42c[_0x20b06c];return _0x3ed917;};'use strict';var _=require(_0xce42('0x0'));var util=require(_0xce42('0x1'));var moment=require(_0xce42('0x2'));var BPromise=require(_0xce42('0x3'));var rs=require(_0xce42('0x4'));var fs=require('fs');var Redis=require(_0xce42('0x5'));var db=require(_0xce42('0x6'))['db'];var utils=require(_0xce42('0x7'));var logger=require(_0xce42('0x8'))('rpc');var config=require(_0xce42('0x9'));var jayson=require(_0xce42('0xa'));var client=jayson[_0xce42('0xb')][_0xce42('0xc')]({'port':0x232a});config[_0xce42('0xd')]=_[_0xce42('0xe')](config[_0xce42('0xd')],{'host':_0xce42('0xf'),'port':0x18eb});var socket=require(_0xce42('0x10'))(new Redis(config[_0xce42('0xd')]));require(_0xce42('0x11'))[_0xce42('0x12')](socket);function respondWithRpcPromise(_0x237fbb,_0x987215,_0x1dacc9){return new BPromise(function(_0x41d2e1,_0x4eeae7){return client[_0xce42('0x13')](_0x237fbb,_0x1dacc9)['then'](function(_0x20395b){logger['info'](_0xce42('0x14'),_0x987215,_0xce42('0x15'));logger['debug'](_0xce42('0x16'),_0x987215,_0xce42('0x15'),JSON['stringify'](_0x20395b));if(_0x20395b[_0xce42('0x17')]){if(_0x20395b[_0xce42('0x17')][_0xce42('0x18')]===0x1f4){logger[_0xce42('0x17')](_0xce42('0x14'),_0x987215,_0x20395b['error'][_0xce42('0x19')]);return _0x4eeae7(_0x20395b[_0xce42('0x17')]['message']);}logger['error']('MailMessage,\x20%s,\x20%s',_0x987215,_0x20395b[_0xce42('0x17')]['message']);return _0x41d2e1(_0x20395b[_0xce42('0x17')][_0xce42('0x19')]);}else{logger['info'](_0xce42('0x14'),_0x987215,_0xce42('0x15'));_0x41d2e1(_0x20395b[_0xce42('0x1a')][_0xce42('0x19')]);}})[_0xce42('0x1b')](function(_0x211c6e){logger[_0xce42('0x17')](_0xce42('0x14'),_0x987215,_0x211c6e);_0x4eeae7(_0x211c6e);});});}exports[_0xce42('0x1c')]=function(_0x1c3815){var _0x2184c5=this;return new Promise(function(_0x33be88,_0xecf25c){return db['MailMessage']['create'](_0x1c3815[_0xce42('0x1d')],{'raw':_0x1c3815[_0xce42('0x1e')]?_0x1c3815[_0xce42('0x1e')][_0xce42('0x1f')]===undefined?!![]:![]:!![]})[_0xce42('0x20')](function(_0x24253f){logger[_0xce42('0x21')](_0xce42('0x1c'),_0x1c3815);logger[_0xce42('0x22')](_0xce42('0x1c'),_0x1c3815,JSON[_0xce42('0x23')](_0x24253f));_0x33be88(_0x24253f);})['catch'](function(_0x1a6be6){logger[_0xce42('0x17')](_0xce42('0x1c'),_0x1a6be6['message'],_0x1c3815);_0xecf25c(_0x2184c5[_0xce42('0x17')](0x1f4,_0x1a6be6[_0xce42('0x19')]));});});};
\ No newline at end of file
+var _0x117c=['defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','create','body','options','raw','CreateMailMessage','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x568b6a,_0x302921){var _0x9de80c=function(_0x5a5fc4){while(--_0x5a5fc4){_0x568b6a['push'](_0x568b6a['shift']());}};_0x9de80c(++_0x302921);}(_0x117c,0x8f));var _0xc117=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0x117c[_0x35b18a];return _0x4db1bd;};'use strict';var _=require('lodash');var util=require(_0xc117('0x0'));var moment=require('moment');var BPromise=require(_0xc117('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc117('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc117('0x3'));var logger=require(_0xc117('0x4'))('rpc');var config=require(_0xc117('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xc117('0x6')]['http']({'port':0x232a});config['redis']=_[_0xc117('0x7')](config[_0xc117('0x8')],{'host':_0xc117('0x9'),'port':0x18eb});var socket=require(_0xc117('0xa'))(new Redis(config[_0xc117('0x8')]));require(_0xc117('0xb'))[_0xc117('0xc')](socket);function respondWithRpcPromise(_0x42b816,_0x8686e1,_0x16dc29){return new BPromise(function(_0x17cea2,_0x4c4fb4){return client[_0xc117('0xd')](_0x42b816,_0x16dc29)[_0xc117('0xe')](function(_0x34e4b1){logger['info'](_0xc117('0xf'),_0x8686e1,_0xc117('0x10'));logger[_0xc117('0x11')](_0xc117('0x12'),_0x8686e1,'request\x20sent',JSON[_0xc117('0x13')](_0x34e4b1));if(_0x34e4b1[_0xc117('0x14')]){if(_0x34e4b1['error']['code']===0x1f4){logger[_0xc117('0x14')]('MailMessage,\x20%s,\x20%s',_0x8686e1,_0x34e4b1[_0xc117('0x14')][_0xc117('0x15')]);return _0x4c4fb4(_0x34e4b1[_0xc117('0x14')][_0xc117('0x15')]);}logger[_0xc117('0x14')](_0xc117('0xf'),_0x8686e1,_0x34e4b1[_0xc117('0x14')][_0xc117('0x15')]);return _0x17cea2(_0x34e4b1[_0xc117('0x14')]['message']);}else{logger[_0xc117('0x16')](_0xc117('0xf'),_0x8686e1,'request\x20sent');_0x17cea2(_0x34e4b1[_0xc117('0x17')][_0xc117('0x15')]);}})[_0xc117('0x18')](function(_0x443ecd){logger[_0xc117('0x14')]('MailMessage,\x20%s,\x20%s',_0x8686e1,_0x443ecd);_0x4c4fb4(_0x443ecd);});});}exports['CreateMailMessage']=function(_0x1d5c0e){var _0x30815f=this;return new Promise(function(_0x1836ad,_0x1c9819){return db['MailMessage'][_0xc117('0x19')](_0x1d5c0e[_0xc117('0x1a')],{'raw':_0x1d5c0e[_0xc117('0x1b')]?_0x1d5c0e[_0xc117('0x1b')][_0xc117('0x1c')]===undefined?!![]:![]:!![]})[_0xc117('0xe')](function(_0x50feef){logger[_0xc117('0x16')]('CreateMailMessage',_0x1d5c0e);logger[_0xc117('0x11')](_0xc117('0x1d'),_0x1d5c0e,JSON['stringify'](_0x50feef));_0x1836ad(_0x50feef);})['catch'](function(_0x1bb093){logger[_0xc117('0x14')]('CreateMailMessage',_0x1bb093[_0xc117('0x15')],_0x1d5c0e);_0x1c9819(_0x30815f['error'](0x1f4,_0x1bb093[_0xc117('0x15')]));});});};
\ No newline at end of file