Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / api / mailInteraction / mailInteraction.rpc.js
index d04339f..c2810e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbfa=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','raw','options','where','attributes','limit','then','AddTagsToMailInteraction','addTags','ids','omit','spread','AddTags','lodash','moment','randomstring'];(function(_0x5a3e6a,_0x2eae21){var _0x54acd7=function(_0x40738a){while(--_0x40738a){_0x5a3e6a['push'](_0x5a3e6a['shift']());}};_0x54acd7(++_0x2eae21);}(_0xbbfa,0x1e9));var _0xabbf=function(_0x42276c,_0x141d47){_0x42276c=_0x42276c-0x0;var _0x1b5009=_0xbbfa[_0x42276c];return _0x1b5009;};'use strict';var _=require(_0xabbf('0x0'));var util=require('util');var moment=require(_0xabbf('0x1'));var BPromise=require('bluebird');var rs=require(_0xabbf('0x2'));var fs=require('fs');var Redis=require(_0xabbf('0x3'));var db=require(_0xabbf('0x4'))['db'];var utils=require(_0xabbf('0x5'));var logger=require(_0xabbf('0x6'))(_0xabbf('0x7'));var config=require(_0xabbf('0x8'));var jayson=require(_0xabbf('0x9'));var client=jayson[_0xabbf('0xa')][_0xabbf('0xb')]({'port':0x232a});config[_0xabbf('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xabbf('0xd'))(new Redis(config[_0xabbf('0xc')]));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x2f1d5d,_0x5a6955,_0x170fe2){return new BPromise(function(_0x4f5cf1,_0x31e77b){return client['request'](_0x2f1d5d,_0x170fe2)['then'](function(_0xb8c3d9){logger[_0xabbf('0xe')](_0xabbf('0xf'),_0x5a6955,_0xabbf('0x10'));logger[_0xabbf('0x11')](_0xabbf('0x12'),_0x5a6955,_0xabbf('0x10'),JSON[_0xabbf('0x13')](_0xb8c3d9));if(_0xb8c3d9[_0xabbf('0x14')]){if(_0xb8c3d9['error'][_0xabbf('0x15')]===0x1f4){logger['error'](_0xabbf('0xf'),_0x5a6955,_0xb8c3d9['error'][_0xabbf('0x16')]);return _0x31e77b(_0xb8c3d9[_0xabbf('0x14')][_0xabbf('0x16')]);}logger[_0xabbf('0x14')]('MailInteraction,\x20%s,\x20%s',_0x5a6955,_0xb8c3d9[_0xabbf('0x14')][_0xabbf('0x16')]);return _0x4f5cf1(_0xb8c3d9[_0xabbf('0x14')][_0xabbf('0x16')]);}else{logger[_0xabbf('0xe')]('MailInteraction,\x20%s,\x20%s',_0x5a6955,_0xabbf('0x10'));_0x4f5cf1(_0xb8c3d9[_0xabbf('0x17')]['message']);}})[_0xabbf('0x18')](function(_0x132296){logger['error'](_0xabbf('0xf'),_0x5a6955,_0x132296);_0x31e77b(_0x132296);});});}exports[_0xabbf('0x19')]=function(_0x3d5528){var _0x5bf568=this;return new Promise(function(_0x540a12,_0xdf7640){return db[_0xabbf('0x1a')][_0xabbf('0x1b')](_0x3d5528[_0xabbf('0x1c')],{'raw':_0x3d5528['options']?_0x3d5528['options'][_0xabbf('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d5528[_0xabbf('0x1e')]?_0x3d5528[_0xabbf('0x1e')][_0xabbf('0x1f')]||null:null,'attributes':_0x3d5528[_0xabbf('0x1e')]?_0x3d5528[_0xabbf('0x1e')][_0xabbf('0x20')]||null:null,'limit':_0x3d5528['options']?_0x3d5528[_0xabbf('0x1e')][_0xabbf('0x21')]||null:null})[_0xabbf('0x22')](function(_0x5b9380){logger[_0xabbf('0xe')](_0xabbf('0x19'),_0x3d5528);logger[_0xabbf('0x11')](_0xabbf('0x19'),_0x3d5528,JSON[_0xabbf('0x13')](_0x5b9380));_0x540a12(_0x5b9380);})['catch'](function(_0x3a0eca){logger['error']('UpdateMailInteraction',_0x3a0eca[_0xabbf('0x16')],_0x3d5528);_0xdf7640(_0x5bf568[_0xabbf('0x14')](0x1f4,_0x3a0eca['message']));});});};exports[_0xabbf('0x23')]=function(_0xa39ccd){return new Promise(function(_0x527838,_0x4f8ed7){return db['MailInteraction']['find']({'where':_0xa39ccd[_0xabbf('0x1e')]?_0xa39ccd[_0xabbf('0x1e')][_0xabbf('0x1f')]||null:null})[_0xabbf('0x22')](function(_0x11243e){if(_0x11243e){return _0x11243e[_0xabbf('0x24')](_0xa39ccd[_0xabbf('0x1c')][_0xabbf('0x25')],_[_0xabbf('0x26')](_0xa39ccd[_0xabbf('0x1c')],['ids','id'])||{});}})[_0xabbf('0x27')](function(_0x56ac46){logger[_0xabbf('0xe')](_0xabbf('0x28'),_0xa39ccd);logger['debug'](_0xabbf('0x28'),_0xa39ccd,JSON[_0xabbf('0x13')](_0x56ac46));_0x527838(_0x56ac46);})[_0xabbf('0x18')](function(_0x44b9b1){logger[_0xabbf('0x14')](_0xabbf('0x28'),_0x44b9b1[_0xabbf('0x16')],_0xa39ccd);_0x4f8ed7(_this['error'](0x1f4,_0x44b9b1['message']));});});};
\ No newline at end of file
+var _0xea1a=['UpdateMailInteraction','MailInteraction','update','body','options','attributes','limit','then','AddTagsToMailInteraction','ids','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailInteraction.socket','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','MailInteraction,\x20%s,\x20%s','message','result','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xea1a,0x158));var _0xaea1=function(_0x1d2f49,_0x562bbf){_0x1d2f49=_0x1d2f49-0x0;var _0xd451e1=_0xea1a[_0x1d2f49];return _0xd451e1;};'use strict';var _=require(_0xaea1('0x0'));var util=require(_0xaea1('0x1'));var moment=require(_0xaea1('0x2'));var BPromise=require(_0xaea1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaea1('0x4'));var db=require(_0xaea1('0x5'))['db'];var utils=require(_0xaea1('0x6'));var logger=require(_0xaea1('0x7'))(_0xaea1('0x8'));var config=require(_0xaea1('0x9'));var jayson=require(_0xaea1('0xa'));var client=jayson[_0xaea1('0xb')]['http']({'port':0x232a});config[_0xaea1('0xc')]=_[_0xaea1('0xd')](config[_0xaea1('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xaea1('0xe'))(new Redis(config['redis']));require(_0xaea1('0xf'))['register'](socket);function respondWithRpcPromise(_0x26fb87,_0x4de4c1,_0x5663f9){return new BPromise(function(_0x541e58,_0x443249){return client['request'](_0x26fb87,_0x5663f9)['then'](function(_0x18a725){logger[_0xaea1('0x10')]('MailInteraction,\x20%s,\x20%s',_0x4de4c1,_0xaea1('0x11'));logger[_0xaea1('0x12')](_0xaea1('0x13'),_0x4de4c1,_0xaea1('0x11'),JSON[_0xaea1('0x14')](_0x18a725));if(_0x18a725[_0xaea1('0x15')]){if(_0x18a725[_0xaea1('0x15')]['code']===0x1f4){logger[_0xaea1('0x15')](_0xaea1('0x16'),_0x4de4c1,_0x18a725[_0xaea1('0x15')][_0xaea1('0x17')]);return _0x443249(_0x18a725[_0xaea1('0x15')][_0xaea1('0x17')]);}logger[_0xaea1('0x15')](_0xaea1('0x16'),_0x4de4c1,_0x18a725[_0xaea1('0x15')][_0xaea1('0x17')]);return _0x541e58(_0x18a725[_0xaea1('0x15')][_0xaea1('0x17')]);}else{logger[_0xaea1('0x10')](_0xaea1('0x16'),_0x4de4c1,_0xaea1('0x11'));_0x541e58(_0x18a725[_0xaea1('0x18')][_0xaea1('0x17')]);}})[_0xaea1('0x19')](function(_0x5b38af){logger[_0xaea1('0x15')]('MailInteraction,\x20%s,\x20%s',_0x4de4c1,_0x5b38af);_0x443249(_0x5b38af);});});}exports[_0xaea1('0x1a')]=function(_0x2125cb){var _0x1b18d0=this;return new Promise(function(_0x448f36,_0x10fa19){return db[_0xaea1('0x1b')][_0xaea1('0x1c')](_0x2125cb[_0xaea1('0x1d')],{'raw':_0x2125cb[_0xaea1('0x1e')]?_0x2125cb[_0xaea1('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2125cb[_0xaea1('0x1e')]?_0x2125cb['options']['where']||null:null,'attributes':_0x2125cb['options']?_0x2125cb['options'][_0xaea1('0x1f')]||null:null,'limit':_0x2125cb['options']?_0x2125cb['options'][_0xaea1('0x20')]||null:null})[_0xaea1('0x21')](function(_0x3b2d67){logger['info']('UpdateMailInteraction',_0x2125cb);logger[_0xaea1('0x12')](_0xaea1('0x1a'),_0x2125cb,JSON[_0xaea1('0x14')](_0x3b2d67));_0x448f36(_0x3b2d67);})[_0xaea1('0x19')](function(_0x38d92f){logger['error'](_0xaea1('0x1a'),_0x38d92f[_0xaea1('0x17')],_0x2125cb);_0x10fa19(_0x1b18d0[_0xaea1('0x15')](0x1f4,_0x38d92f[_0xaea1('0x17')]));});});};exports[_0xaea1('0x22')]=function(_0x2765d0){return new Promise(function(_0x167391,_0x5b5556){return db[_0xaea1('0x1b')]['find']({'where':_0x2765d0[_0xaea1('0x1e')]?_0x2765d0[_0xaea1('0x1e')]['where']||null:null})[_0xaea1('0x21')](function(_0x2f9025){if(_0x2f9025){return _0x2f9025['addTags'](_0x2765d0[_0xaea1('0x1d')]['ids'],_['omit'](_0x2765d0['body'],[_0xaea1('0x23'),'id'])||{});}})['spread'](function(_0x1a5f9a){logger['info'](_0xaea1('0x24'),_0x2765d0);logger['debug'](_0xaea1('0x24'),_0x2765d0,JSON[_0xaea1('0x14')](_0x1a5f9a));_0x167391(_0x1a5f9a);})[_0xaea1('0x19')](function(_0x3dee97){logger[_0xaea1('0x15')]('AddTags',_0x3dee97[_0xaea1('0x17')],_0x2765d0);_0x5b5556(_this[_0xaea1('0x15')](0x1f4,_0x3dee97[_0xaea1('0x17')]));});});};
\ No newline at end of file