Built motion from commit 4e7c323b.|2.5.34
[motion2.git] / server / api / mailInteraction / mailInteraction.rpc.js
index cf7603d..03f2040 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ab9=['options','where','attributes','limit','info','AddTagsToMailInteraction','find','addTags','ids','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailInteraction','body'];(function(_0x230284,_0x1e5b98){var _0x379935=function(_0x17872a){while(--_0x17872a){_0x230284['push'](_0x230284['shift']());}};_0x379935(++_0x1e5b98);}(_0x6ab9,0x19a));var _0x96ab=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x6ab9[_0x5cb1af];return _0x8d7940;};'use strict';var _=require(_0x96ab('0x0'));var util=require(_0x96ab('0x1'));var moment=require('moment');var BPromise=require(_0x96ab('0x2'));var rs=require(_0x96ab('0x3'));var fs=require('fs');var Redis=require(_0x96ab('0x4'));var db=require(_0x96ab('0x5'))['db'];var utils=require(_0x96ab('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x96ab('0x7'));var jayson=require(_0x96ab('0x8'));var client=jayson[_0x96ab('0x9')]['http']({'port':0x232a});config[_0x96ab('0xa')]=_[_0x96ab('0xb')](config['redis'],{'host':_0x96ab('0xc'),'port':0x18eb});var socket=require(_0x96ab('0xd'))(new Redis(config[_0x96ab('0xa')]));require(_0x96ab('0xe'))[_0x96ab('0xf')](socket);function respondWithRpcPromise(_0x2dfc50,_0xdc00cb,_0x84fd1e){return new BPromise(function(_0x3ef79e,_0x9a19d7){return client[_0x96ab('0x10')](_0x2dfc50,_0x84fd1e)[_0x96ab('0x11')](function(_0x43658c){logger['info'](_0x96ab('0x12'),_0xdc00cb,'request\x20sent');logger[_0x96ab('0x13')](_0x96ab('0x14'),_0xdc00cb,_0x96ab('0x15'),JSON[_0x96ab('0x16')](_0x43658c));if(_0x43658c[_0x96ab('0x17')]){if(_0x43658c[_0x96ab('0x17')][_0x96ab('0x18')]===0x1f4){logger[_0x96ab('0x17')](_0x96ab('0x12'),_0xdc00cb,_0x43658c[_0x96ab('0x17')][_0x96ab('0x19')]);return _0x9a19d7(_0x43658c['error']['message']);}logger[_0x96ab('0x17')](_0x96ab('0x12'),_0xdc00cb,_0x43658c[_0x96ab('0x17')]['message']);return _0x3ef79e(_0x43658c[_0x96ab('0x17')][_0x96ab('0x19')]);}else{logger['info'](_0x96ab('0x12'),_0xdc00cb,'request\x20sent');_0x3ef79e(_0x43658c[_0x96ab('0x1a')][_0x96ab('0x19')]);}})[_0x96ab('0x1b')](function(_0x23f826){logger[_0x96ab('0x17')](_0x96ab('0x12'),_0xdc00cb,_0x23f826);_0x9a19d7(_0x23f826);});});}exports[_0x96ab('0x1c')]=function(_0x16ebd7){var _0xb746c7=this;return new Promise(function(_0xb0ab91,_0x2aa3c4){return db['MailInteraction']['update'](_0x16ebd7[_0x96ab('0x1d')],{'raw':_0x16ebd7[_0x96ab('0x1e')]?_0x16ebd7[_0x96ab('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16ebd7[_0x96ab('0x1e')]?_0x16ebd7['options'][_0x96ab('0x1f')]||null:null,'attributes':_0x16ebd7['options']?_0x16ebd7[_0x96ab('0x1e')][_0x96ab('0x20')]||null:null,'limit':_0x16ebd7['options']?_0x16ebd7[_0x96ab('0x1e')][_0x96ab('0x21')]||null:null})[_0x96ab('0x11')](function(_0x42d20c){logger[_0x96ab('0x22')](_0x96ab('0x1c'),_0x16ebd7);logger[_0x96ab('0x13')](_0x96ab('0x1c'),_0x16ebd7,JSON[_0x96ab('0x16')](_0x42d20c));_0xb0ab91(_0x42d20c);})['catch'](function(_0x215f09){logger['error'](_0x96ab('0x1c'),_0x215f09[_0x96ab('0x19')],_0x16ebd7);_0x2aa3c4(_0xb746c7[_0x96ab('0x17')](0x1f4,_0x215f09[_0x96ab('0x19')]));});});};exports[_0x96ab('0x23')]=function(_0x11db77){return new Promise(function(_0x31568f,_0x435613){return db['MailInteraction'][_0x96ab('0x24')]({'where':_0x11db77[_0x96ab('0x1e')]?_0x11db77[_0x96ab('0x1e')]['where']||null:null})[_0x96ab('0x11')](function(_0x27275d){if(_0x27275d){return _0x27275d[_0x96ab('0x25')](_0x11db77[_0x96ab('0x1d')][_0x96ab('0x26')],_['omit'](_0x11db77[_0x96ab('0x1d')],[_0x96ab('0x26'),'id'])||{});}})['spread'](function(_0x235567){logger['info']('AddTags',_0x11db77);logger['debug']('AddTags',_0x11db77,JSON[_0x96ab('0x16')](_0x235567));_0x31568f(_0x235567);})['catch'](function(_0x284bb7){logger[_0x96ab('0x17')](_0x96ab('0x27'),_0x284bb7[_0x96ab('0x19')],_0x11db77);_0x435613(_this[_0x96ab('0x17')](0x1f4,_0x284bb7['message']));});});};
\ No newline at end of file
+var _0xf379=['options','raw','AddTagsToMailInteraction','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','localhost','./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','result','catch','UpdateMailInteraction','MailInteraction','update','body'];(function(_0x50b09c,_0x576d80){var _0x135a85=function(_0x224506){while(--_0x224506){_0x50b09c['push'](_0x50b09c['shift']());}};_0x135a85(++_0x576d80);}(_0xf379,0x7a));var _0x9f37=function(_0x28fccb,_0x3b58d4){_0x28fccb=_0x28fccb-0x0;var _0x550739=_0xf379[_0x28fccb];return _0x550739;};'use strict';var _=require(_0x9f37('0x0'));var util=require(_0x9f37('0x1'));var moment=require('moment');var BPromise=require(_0x9f37('0x2'));var rs=require(_0x9f37('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f37('0x4'))['db'];var utils=require(_0x9f37('0x5'));var logger=require(_0x9f37('0x6'))(_0x9f37('0x7'));var config=require(_0x9f37('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x9f37('0x9')]=_['defaults'](config[_0x9f37('0x9')],{'host':_0x9f37('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f37('0x9')]));require(_0x9f37('0xb'))[_0x9f37('0xc')](socket);function respondWithRpcPromise(_0xde78,_0x4c0c4b,_0x3a2fc3){return new BPromise(function(_0xea9025,_0x17edce){return client[_0x9f37('0xd')](_0xde78,_0x3a2fc3)[_0x9f37('0xe')](function(_0x5d864f){logger[_0x9f37('0xf')](_0x9f37('0x10'),_0x4c0c4b,_0x9f37('0x11'));logger[_0x9f37('0x12')](_0x9f37('0x13'),_0x4c0c4b,_0x9f37('0x11'),JSON[_0x9f37('0x14')](_0x5d864f));if(_0x5d864f['error']){if(_0x5d864f[_0x9f37('0x15')][_0x9f37('0x16')]===0x1f4){logger['error'](_0x9f37('0x10'),_0x4c0c4b,_0x5d864f[_0x9f37('0x15')]['message']);return _0x17edce(_0x5d864f[_0x9f37('0x15')][_0x9f37('0x17')]);}logger['error'](_0x9f37('0x10'),_0x4c0c4b,_0x5d864f[_0x9f37('0x15')][_0x9f37('0x17')]);return _0xea9025(_0x5d864f['error']['message']);}else{logger[_0x9f37('0xf')](_0x9f37('0x10'),_0x4c0c4b,_0x9f37('0x11'));_0xea9025(_0x5d864f[_0x9f37('0x18')][_0x9f37('0x17')]);}})[_0x9f37('0x19')](function(_0x2e32a8){logger[_0x9f37('0x15')]('MailInteraction,\x20%s,\x20%s',_0x4c0c4b,_0x2e32a8);_0x17edce(_0x2e32a8);});});}exports[_0x9f37('0x1a')]=function(_0x3a0379){var _0x327833=this;return new Promise(function(_0x1162db,_0x4c06a5){return db[_0x9f37('0x1b')][_0x9f37('0x1c')](_0x3a0379[_0x9f37('0x1d')],{'raw':_0x3a0379[_0x9f37('0x1e')]?_0x3a0379['options'][_0x9f37('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a0379[_0x9f37('0x1e')]?_0x3a0379['options']['where']||null:null,'attributes':_0x3a0379[_0x9f37('0x1e')]?_0x3a0379[_0x9f37('0x1e')]['attributes']||null:null,'limit':_0x3a0379[_0x9f37('0x1e')]?_0x3a0379['options']['limit']||null:null})[_0x9f37('0xe')](function(_0x340cc0){logger[_0x9f37('0xf')]('UpdateMailInteraction',_0x3a0379);logger[_0x9f37('0x12')]('UpdateMailInteraction',_0x3a0379,JSON['stringify'](_0x340cc0));_0x1162db(_0x340cc0);})[_0x9f37('0x19')](function(_0x5c28b3){logger['error'](_0x9f37('0x1a'),_0x5c28b3[_0x9f37('0x17')],_0x3a0379);_0x4c06a5(_0x327833[_0x9f37('0x15')](0x1f4,_0x5c28b3['message']));});});};exports[_0x9f37('0x20')]=function(_0x4acce9){return new Promise(function(_0x11d0b7,_0x46637b){return db[_0x9f37('0x1b')]['find']({'where':_0x4acce9[_0x9f37('0x1e')]?_0x4acce9['options']['where']||null:null})[_0x9f37('0xe')](function(_0x326088){if(_0x326088){return _0x326088[_0x9f37('0x21')](_0x4acce9['body'][_0x9f37('0x22')],_[_0x9f37('0x23')](_0x4acce9[_0x9f37('0x1d')],[_0x9f37('0x22'),'id'])||{});}})[_0x9f37('0x24')](function(_0x387888){logger[_0x9f37('0xf')](_0x9f37('0x25'),_0x4acce9);logger[_0x9f37('0x12')]('AddTags',_0x4acce9,JSON[_0x9f37('0x14')](_0x387888));_0x11d0b7(_0x387888);})['catch'](function(_0x28755c){logger[_0x9f37('0x15')]('AddTags',_0x28755c['message'],_0x4acce9);_0x46637b(_this['error'](0x1f4,_0x28755c[_0x9f37('0x17')]));});});};
\ No newline at end of file