Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / api / mailInteraction / mailInteraction.rpc.js
index f2b67ba..1b98e07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf431=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateMailInteraction','body','options','where','attributes','limit','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment'];(function(_0x35d45d,_0x4b71fe){var _0x2543bc=function(_0x1e75b5){while(--_0x1e75b5){_0x35d45d['push'](_0x35d45d['shift']());}};_0x2543bc(++_0x4b71fe);}(_0xf431,0xc5));var _0x1f43=function(_0x4496d4,_0x35a23c){_0x4496d4=_0x4496d4-0x0;var _0x549149=_0xf431[_0x4496d4];return _0x549149;};'use strict';var _=require(_0x1f43('0x0'));var util=require(_0x1f43('0x1'));var moment=require(_0x1f43('0x2'));var BPromise=require(_0x1f43('0x3'));var rs=require(_0x1f43('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f43('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1f43('0x6'));var config=require(_0x1f43('0x7'));var jayson=require(_0x1f43('0x8'));var client=jayson[_0x1f43('0x9')][_0x1f43('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1f43('0xb')],{'host':_0x1f43('0xc'),'port':0x18eb});var socket=require(_0x1f43('0xd'))(new Redis(config['redis']));require(_0x1f43('0xe'))[_0x1f43('0xf')](socket);function respondWithRpcPromise(_0x4563e0,_0x255f7c,_0x3dd6a5){return new BPromise(function(_0x1ca41c,_0x18f247){return client[_0x1f43('0x10')](_0x4563e0,_0x3dd6a5)[_0x1f43('0x11')](function(_0x4bf5c3){logger[_0x1f43('0x12')](_0x1f43('0x13'),_0x255f7c,_0x1f43('0x14'));logger[_0x1f43('0x15')](_0x1f43('0x16'),_0x255f7c,_0x1f43('0x14'),JSON[_0x1f43('0x17')](_0x4bf5c3));if(_0x4bf5c3[_0x1f43('0x18')]){if(_0x4bf5c3[_0x1f43('0x18')][_0x1f43('0x19')]===0x1f4){logger['error'](_0x1f43('0x13'),_0x255f7c,_0x4bf5c3[_0x1f43('0x18')][_0x1f43('0x1a')]);return _0x18f247(_0x4bf5c3[_0x1f43('0x18')][_0x1f43('0x1a')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x255f7c,_0x4bf5c3[_0x1f43('0x18')]['message']);return _0x1ca41c(_0x4bf5c3['error']['message']);}else{logger[_0x1f43('0x12')]('MailInteraction,\x20%s,\x20%s',_0x255f7c,_0x1f43('0x14'));_0x1ca41c(_0x4bf5c3['result'][_0x1f43('0x1a')]);}})[_0x1f43('0x1b')](function(_0x5de53f){logger[_0x1f43('0x18')](_0x1f43('0x13'),_0x255f7c,_0x5de53f);_0x18f247(_0x5de53f);});});}exports[_0x1f43('0x1c')]=function(_0x2314e7){var _0x49e379=this;return new Promise(function(_0x10640f,_0x493908){return db['MailInteraction']['update'](_0x2314e7[_0x1f43('0x1d')],{'raw':_0x2314e7[_0x1f43('0x1e')]?_0x2314e7[_0x1f43('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2314e7['options']?_0x2314e7[_0x1f43('0x1e')][_0x1f43('0x1f')]||null:null,'attributes':_0x2314e7['options']?_0x2314e7[_0x1f43('0x1e')][_0x1f43('0x20')]||null:null,'limit':_0x2314e7[_0x1f43('0x1e')]?_0x2314e7['options'][_0x1f43('0x21')]||null:null})['then'](function(_0x4735ae){logger[_0x1f43('0x12')](_0x1f43('0x1c'),_0x2314e7);logger[_0x1f43('0x15')](_0x1f43('0x1c'),_0x2314e7,JSON[_0x1f43('0x17')](_0x4735ae));_0x10640f(_0x4735ae);})[_0x1f43('0x1b')](function(_0x5e3bfc){logger['error'](_0x1f43('0x1c'),_0x5e3bfc[_0x1f43('0x1a')],_0x2314e7);_0x493908(_0x49e379[_0x1f43('0x18')](0x1f4,_0x5e3bfc['message']));});});};exports[_0x1f43('0x22')]=function(_0x28cc88){return new Promise(function(_0x387993,_0x5f54a4){return db['MailInteraction'][_0x1f43('0x23')]({'where':_0x28cc88[_0x1f43('0x1e')]?_0x28cc88['options'][_0x1f43('0x1f')]||null:null})[_0x1f43('0x11')](function(_0x6b42a){if(_0x6b42a){return _0x6b42a[_0x1f43('0x24')](_0x28cc88[_0x1f43('0x1d')][_0x1f43('0x25')],_[_0x1f43('0x26')](_0x28cc88['body'],[_0x1f43('0x25'),'id'])||{});}})[_0x1f43('0x27')](function(_0x24ed31){logger['info'](_0x1f43('0x28'),_0x28cc88);logger[_0x1f43('0x15')]('AddTags',_0x28cc88,JSON[_0x1f43('0x17')](_0x24ed31));_0x387993(_0x24ed31);})[_0x1f43('0x1b')](function(_0x2200da){logger[_0x1f43('0x18')](_0x1f43('0x28'),_0x2200da[_0x1f43('0x1a')],_0x28cc88);_0x5f54a4(_this[_0x1f43('0x18')](0x1f4,_0x2200da[_0x1f43('0x1a')]));});});};
\ No newline at end of file
+var _0x6a52=['MailInteraction,\x20%s,\x20%s','info','result','catch','UpdateMailInteraction','MailInteraction','options','attributes','AddTagsToMailInteraction','where','body','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6a52,0x189));var _0x26a5=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0x6a52[_0x5ce15c];return _0x36e4f5;};'use strict';var _=require(_0x26a5('0x0'));var util=require(_0x26a5('0x1'));var moment=require(_0x26a5('0x2'));var BPromise=require(_0x26a5('0x3'));var rs=require(_0x26a5('0x4'));var fs=require('fs');var Redis=require(_0x26a5('0x5'));var db=require(_0x26a5('0x6'))['db'];var utils=require(_0x26a5('0x7'));var logger=require(_0x26a5('0x8'))(_0x26a5('0x9'));var config=require('../../config/environment');var jayson=require(_0x26a5('0xa'));var client=jayson[_0x26a5('0xb')][_0x26a5('0xc')]({'port':0x232a});config[_0x26a5('0xd')]=_[_0x26a5('0xe')](config['redis'],{'host':_0x26a5('0xf'),'port':0x18eb});var socket=require(_0x26a5('0x10'))(new Redis(config[_0x26a5('0xd')]));require('./mailInteraction.socket')[_0x26a5('0x11')](socket);function respondWithRpcPromise(_0xd52fa9,_0x52cd47,_0x527f51){return new BPromise(function(_0x13f14d,_0x4aab48){return client[_0x26a5('0x12')](_0xd52fa9,_0x527f51)[_0x26a5('0x13')](function(_0x23fcbb){logger['info']('MailInteraction,\x20%s,\x20%s',_0x52cd47,_0x26a5('0x14'));logger[_0x26a5('0x15')](_0x26a5('0x16'),_0x52cd47,_0x26a5('0x14'),JSON[_0x26a5('0x17')](_0x23fcbb));if(_0x23fcbb['error']){if(_0x23fcbb[_0x26a5('0x18')][_0x26a5('0x19')]===0x1f4){logger[_0x26a5('0x18')]('MailInteraction,\x20%s,\x20%s',_0x52cd47,_0x23fcbb['error'][_0x26a5('0x1a')]);return _0x4aab48(_0x23fcbb['error'][_0x26a5('0x1a')]);}logger[_0x26a5('0x18')](_0x26a5('0x1b'),_0x52cd47,_0x23fcbb[_0x26a5('0x18')][_0x26a5('0x1a')]);return _0x13f14d(_0x23fcbb[_0x26a5('0x18')][_0x26a5('0x1a')]);}else{logger[_0x26a5('0x1c')](_0x26a5('0x1b'),_0x52cd47,_0x26a5('0x14'));_0x13f14d(_0x23fcbb[_0x26a5('0x1d')][_0x26a5('0x1a')]);}})[_0x26a5('0x1e')](function(_0x28b9ee){logger['error'](_0x26a5('0x1b'),_0x52cd47,_0x28b9ee);_0x4aab48(_0x28b9ee);});});}exports[_0x26a5('0x1f')]=function(_0x59912f){var _0x160012=this;return new Promise(function(_0x78a972,_0x25b585){return db[_0x26a5('0x20')]['update'](_0x59912f['body'],{'raw':_0x59912f[_0x26a5('0x21')]?_0x59912f[_0x26a5('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59912f['options']?_0x59912f[_0x26a5('0x21')]['where']||null:null,'attributes':_0x59912f[_0x26a5('0x21')]?_0x59912f[_0x26a5('0x21')][_0x26a5('0x22')]||null:null,'limit':_0x59912f[_0x26a5('0x21')]?_0x59912f[_0x26a5('0x21')]['limit']||null:null})[_0x26a5('0x13')](function(_0x5220bd){logger[_0x26a5('0x1c')](_0x26a5('0x1f'),_0x59912f);logger[_0x26a5('0x15')](_0x26a5('0x1f'),_0x59912f,JSON[_0x26a5('0x17')](_0x5220bd));_0x78a972(_0x5220bd);})[_0x26a5('0x1e')](function(_0x1d2a27){logger[_0x26a5('0x18')](_0x26a5('0x1f'),_0x1d2a27['message'],_0x59912f);_0x25b585(_0x160012[_0x26a5('0x18')](0x1f4,_0x1d2a27['message']));});});};exports[_0x26a5('0x23')]=function(_0x490431){return new Promise(function(_0x3d5aaa,_0x165654){return db[_0x26a5('0x20')]['find']({'where':_0x490431['options']?_0x490431[_0x26a5('0x21')][_0x26a5('0x24')]||null:null})[_0x26a5('0x13')](function(_0x1d6dc7){if(_0x1d6dc7){return _0x1d6dc7['addTags'](_0x490431[_0x26a5('0x25')]['ids'],_[_0x26a5('0x26')](_0x490431[_0x26a5('0x25')],[_0x26a5('0x27'),'id'])||{});}})[_0x26a5('0x28')](function(_0x4dab80){logger[_0x26a5('0x1c')]('AddTags',_0x490431);logger[_0x26a5('0x15')](_0x26a5('0x29'),_0x490431,JSON['stringify'](_0x4dab80));_0x3d5aaa(_0x4dab80);})['catch'](function(_0x46f6c7){logger[_0x26a5('0x18')](_0x26a5('0x29'),_0x46f6c7[_0x26a5('0x1a')],_0x490431);_0x165654(_this['error'](0x1f4,_0x46f6c7['message']));});});};
\ No newline at end of file