Built motion from commit 10af8726.|2.6.34
[motion2.git] / server / api / mailInteraction / mailInteraction.rpc.js
index 96a2351..ce8a89d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaee=['omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','./mailInteraction.socket','register','request','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','attributes','limit','then','AddTagsToMailInteraction','find','where','addTags','ids'];(function(_0x1ddf1b,_0x2774a8){var _0x104c1f=function(_0xa7530){while(--_0xa7530){_0x1ddf1b['push'](_0x1ddf1b['shift']());}};_0x104c1f(++_0x2774a8);}(_0xbaee,0x186));var _0xebae=function(_0x3929a8,_0x3c35b3){_0x3929a8=_0x3929a8-0x0;var _0xcd7475=_0xbaee[_0x3929a8];return _0xcd7475;};'use strict';var _=require(_0xebae('0x0'));var util=require(_0xebae('0x1'));var moment=require(_0xebae('0x2'));var BPromise=require(_0xebae('0x3'));var rs=require(_0xebae('0x4'));var fs=require('fs');var Redis=require(_0xebae('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xebae('0x6'));var logger=require(_0xebae('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xebae('0x8'));var client=jayson['client'][_0xebae('0x9')]({'port':0x232a});config[_0xebae('0xa')]=_[_0xebae('0xb')](config['redis'],{'host':_0xebae('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xebae('0xd'))[_0xebae('0xe')](socket);function respondWithRpcPromise(_0x55bd84,_0x265ee4,_0x24a76a){return new BPromise(function(_0xc65748,_0x538bf0){return client[_0xebae('0xf')](_0x55bd84,_0x24a76a)['then'](function(_0x1d783b){logger['info'](_0xebae('0x10'),_0x265ee4,_0xebae('0x11'));logger[_0xebae('0x12')](_0xebae('0x13'),_0x265ee4,_0xebae('0x11'),JSON[_0xebae('0x14')](_0x1d783b));if(_0x1d783b[_0xebae('0x15')]){if(_0x1d783b[_0xebae('0x15')][_0xebae('0x16')]===0x1f4){logger['error'](_0xebae('0x10'),_0x265ee4,_0x1d783b['error'][_0xebae('0x17')]);return _0x538bf0(_0x1d783b['error']['message']);}logger[_0xebae('0x15')](_0xebae('0x10'),_0x265ee4,_0x1d783b['error']['message']);return _0xc65748(_0x1d783b[_0xebae('0x15')][_0xebae('0x17')]);}else{logger[_0xebae('0x18')](_0xebae('0x10'),_0x265ee4,_0xebae('0x11'));_0xc65748(_0x1d783b[_0xebae('0x19')][_0xebae('0x17')]);}})[_0xebae('0x1a')](function(_0x73cbb2){logger[_0xebae('0x15')](_0xebae('0x10'),_0x265ee4,_0x73cbb2);_0x538bf0(_0x73cbb2);});});}exports[_0xebae('0x1b')]=function(_0x27af4b){var _0x11afdb=this;return new Promise(function(_0x18db4c,_0x5a710c){return db[_0xebae('0x1c')][_0xebae('0x1d')](_0x27af4b[_0xebae('0x1e')],{'raw':_0x27af4b[_0xebae('0x1f')]?_0x27af4b['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27af4b[_0xebae('0x1f')]?_0x27af4b[_0xebae('0x1f')]['where']||null:null,'attributes':_0x27af4b['options']?_0x27af4b[_0xebae('0x1f')][_0xebae('0x20')]||null:null,'limit':_0x27af4b['options']?_0x27af4b[_0xebae('0x1f')][_0xebae('0x21')]||null:null})[_0xebae('0x22')](function(_0x249def){logger[_0xebae('0x18')](_0xebae('0x1b'),_0x27af4b);logger[_0xebae('0x12')]('UpdateMailInteraction',_0x27af4b,JSON[_0xebae('0x14')](_0x249def));_0x18db4c(_0x249def);})[_0xebae('0x1a')](function(_0x3572fa){logger[_0xebae('0x15')](_0xebae('0x1b'),_0x3572fa[_0xebae('0x17')],_0x27af4b);_0x5a710c(_0x11afdb[_0xebae('0x15')](0x1f4,_0x3572fa[_0xebae('0x17')]));});});};exports[_0xebae('0x23')]=function(_0x57887c){return new Promise(function(_0x9d4fcc,_0x55b386){return db['MailInteraction'][_0xebae('0x24')]({'where':_0x57887c['options']?_0x57887c['options'][_0xebae('0x25')]||null:null})['then'](function(_0x469e18){if(_0x469e18){return _0x469e18[_0xebae('0x26')](_0x57887c['body'][_0xebae('0x27')],_[_0xebae('0x28')](_0x57887c[_0xebae('0x1e')],[_0xebae('0x27'),'id'])||{});}})[_0xebae('0x29')](function(_0x2fbf8b){logger[_0xebae('0x18')](_0xebae('0x2a'),_0x57887c);logger[_0xebae('0x12')](_0xebae('0x2a'),_0x57887c,JSON[_0xebae('0x14')](_0x2fbf8b));_0x9d4fcc(_0x2fbf8b);})[_0xebae('0x1a')](function(_0x4a75c8){logger[_0xebae('0x15')](_0xebae('0x2a'),_0x4a75c8['message'],_0x57887c);_0x55b386(_this[_0xebae('0x15')](0x1f4,_0x4a75c8[_0xebae('0x17')]));});});};
\ No newline at end of file
+var _0xfcbe=['ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','redis','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','MailInteraction','update','body','options','raw','where','attributes','UpdateMailInteraction','AddTagsToMailInteraction','find','addTags'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xfcbe,0x1b1));var _0xefcb=function(_0x39b070,_0x1855a3){_0x39b070=_0x39b070-0x0;var _0x25517d=_0xfcbe[_0x39b070];return _0x25517d;};'use strict';var _=require('lodash');var util=require(_0xefcb('0x0'));var moment=require(_0xefcb('0x1'));var BPromise=require(_0xefcb('0x2'));var rs=require(_0xefcb('0x3'));var fs=require('fs');var Redis=require(_0xefcb('0x4'));var db=require(_0xefcb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xefcb('0x6'))(_0xefcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xefcb('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0xefcb('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xefcb('0xa'))(new Redis(config[_0xefcb('0x9')]));require(_0xefcb('0xb'))['register'](socket);function respondWithRpcPromise(_0x35630e,_0x35f070,_0x527170){return new BPromise(function(_0x533ee5,_0x326270){return client[_0xefcb('0xc')](_0x35630e,_0x527170)[_0xefcb('0xd')](function(_0x3f9204){logger[_0xefcb('0xe')](_0xefcb('0xf'),_0x35f070,'request\x20sent');logger[_0xefcb('0x10')](_0xefcb('0x11'),_0x35f070,_0xefcb('0x12'),JSON[_0xefcb('0x13')](_0x3f9204));if(_0x3f9204[_0xefcb('0x14')]){if(_0x3f9204['error']['code']===0x1f4){logger[_0xefcb('0x14')](_0xefcb('0xf'),_0x35f070,_0x3f9204['error'][_0xefcb('0x15')]);return _0x326270(_0x3f9204['error'][_0xefcb('0x15')]);}logger['error'](_0xefcb('0xf'),_0x35f070,_0x3f9204[_0xefcb('0x14')][_0xefcb('0x15')]);return _0x533ee5(_0x3f9204[_0xefcb('0x14')][_0xefcb('0x15')]);}else{logger[_0xefcb('0xe')]('MailInteraction,\x20%s,\x20%s',_0x35f070,_0xefcb('0x12'));_0x533ee5(_0x3f9204[_0xefcb('0x16')][_0xefcb('0x15')]);}})[_0xefcb('0x17')](function(_0x1bd57c){logger[_0xefcb('0x14')](_0xefcb('0xf'),_0x35f070,_0x1bd57c);_0x326270(_0x1bd57c);});});}exports['UpdateMailInteraction']=function(_0x39ab04){var _0x3b7509=this;return new Promise(function(_0x5695b4,_0x12a93f){return db[_0xefcb('0x18')][_0xefcb('0x19')](_0x39ab04[_0xefcb('0x1a')],{'raw':_0x39ab04[_0xefcb('0x1b')]?_0x39ab04['options'][_0xefcb('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39ab04[_0xefcb('0x1b')]?_0x39ab04[_0xefcb('0x1b')][_0xefcb('0x1d')]||null:null,'attributes':_0x39ab04[_0xefcb('0x1b')]?_0x39ab04[_0xefcb('0x1b')][_0xefcb('0x1e')]||null:null,'limit':_0x39ab04[_0xefcb('0x1b')]?_0x39ab04['options']['limit']||null:null})['then'](function(_0x104212){logger[_0xefcb('0xe')](_0xefcb('0x1f'),_0x39ab04);logger[_0xefcb('0x10')](_0xefcb('0x1f'),_0x39ab04,JSON[_0xefcb('0x13')](_0x104212));_0x5695b4(_0x104212);})[_0xefcb('0x17')](function(_0x52ce86){logger[_0xefcb('0x14')](_0xefcb('0x1f'),_0x52ce86[_0xefcb('0x15')],_0x39ab04);_0x12a93f(_0x3b7509[_0xefcb('0x14')](0x1f4,_0x52ce86[_0xefcb('0x15')]));});});};exports[_0xefcb('0x20')]=function(_0x16757b){return new Promise(function(_0x36521c,_0x1c7ee1){return db[_0xefcb('0x18')][_0xefcb('0x21')]({'where':_0x16757b[_0xefcb('0x1b')]?_0x16757b[_0xefcb('0x1b')][_0xefcb('0x1d')]||null:null})[_0xefcb('0xd')](function(_0x518447){if(_0x518447){return _0x518447[_0xefcb('0x22')](_0x16757b[_0xefcb('0x1a')][_0xefcb('0x23')],_[_0xefcb('0x24')](_0x16757b[_0xefcb('0x1a')],[_0xefcb('0x23'),'id'])||{});}})[_0xefcb('0x25')](function(_0x5a436c){logger['info'](_0xefcb('0x26'),_0x16757b);logger[_0xefcb('0x10')]('AddTags',_0x16757b,JSON[_0xefcb('0x13')](_0x5a436c));_0x36521c(_0x5a436c);})[_0xefcb('0x17')](function(_0x3e7da7){logger['error'](_0xefcb('0x26'),_0x3e7da7[_0xefcb('0x15')],_0x16757b);_0x1c7ee1(_this[_0xefcb('0x14')](0x1f4,_0x3e7da7['message']));});});};
\ No newline at end of file