Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / api / chatInteraction / chatInteraction.rpc.js
index f50d206..4411b23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45f0=['redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','ChatInteraction','update','body','options','raw','where','attributes','limit','then','UpdateChatInteraction','AddTagsToChatInteraction','addTags','omit','ids','spread','AddTags','stringify','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x45f0,0x116));var _0x045f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x45f0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x045f('0x0'));var BPromise=require(_0x045f('0x1'));var rs=require(_0x045f('0x2'));var fs=require('fs');var Redis=require(_0x045f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x045f('0x4'))(_0x045f('0x5'));var config=require(_0x045f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x045f('0x7')][_0x045f('0x8')]({'port':0x232a});config[_0x045f('0x9')]=_[_0x045f('0xa')](config[_0x045f('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x045f('0xb'))(new Redis(config['redis']));require(_0x045f('0xc'))[_0x045f('0xd')](socket);function respondWithRpcPromise(_0xaa7e57,_0x911bd8,_0x25e8e9){return new BPromise(function(_0x299522,_0x124234){return client[_0x045f('0xe')](_0xaa7e57,_0x25e8e9)['then'](function(_0x3571a1){logger[_0x045f('0xf')](_0x045f('0x10'),_0x911bd8,_0x045f('0x11'));logger[_0x045f('0x12')](_0x045f('0x13'),_0x911bd8,_0x045f('0x11'),JSON['stringify'](_0x3571a1));if(_0x3571a1[_0x045f('0x14')]){if(_0x3571a1['error'][_0x045f('0x15')]===0x1f4){logger[_0x045f('0x14')](_0x045f('0x10'),_0x911bd8,_0x3571a1[_0x045f('0x14')][_0x045f('0x16')]);return _0x124234(_0x3571a1[_0x045f('0x14')][_0x045f('0x16')]);}logger['error'](_0x045f('0x10'),_0x911bd8,_0x3571a1['error'][_0x045f('0x16')]);return _0x299522(_0x3571a1[_0x045f('0x14')]['message']);}else{logger[_0x045f('0xf')](_0x045f('0x10'),_0x911bd8,_0x045f('0x11'));_0x299522(_0x3571a1['result'][_0x045f('0x16')]);}})[_0x045f('0x17')](function(_0x1b8413){logger[_0x045f('0x14')](_0x045f('0x10'),_0x911bd8,_0x1b8413);_0x124234(_0x1b8413);});});}exports['UpdateChatInteraction']=function(_0x3e90c7){var _0x58e8f1=this;return new Promise(function(_0x29f2e3,_0x28bddd){return db[_0x045f('0x18')][_0x045f('0x19')](_0x3e90c7[_0x045f('0x1a')],{'raw':_0x3e90c7['options']?_0x3e90c7[_0x045f('0x1b')][_0x045f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e90c7[_0x045f('0x1b')]?_0x3e90c7[_0x045f('0x1b')][_0x045f('0x1d')]||null:null,'attributes':_0x3e90c7[_0x045f('0x1b')]?_0x3e90c7[_0x045f('0x1b')][_0x045f('0x1e')]||null:null,'limit':_0x3e90c7['options']?_0x3e90c7[_0x045f('0x1b')][_0x045f('0x1f')]||null:null})[_0x045f('0x20')](function(_0x3707fb){logger[_0x045f('0xf')]('UpdateChatInteraction',_0x3e90c7);logger[_0x045f('0x12')](_0x045f('0x21'),_0x3e90c7,JSON['stringify'](_0x3707fb));_0x29f2e3(_0x3707fb);})['catch'](function(_0x14c214){logger['error'](_0x045f('0x21'),_0x14c214[_0x045f('0x16')],_0x3e90c7);_0x28bddd(_0x58e8f1[_0x045f('0x14')](0x1f4,_0x14c214['message']));});});};exports[_0x045f('0x22')]=function(_0x9cb8e8){return new Promise(function(_0x30ac89,_0x51d552){return db['ChatInteraction']['find']({'where':_0x9cb8e8[_0x045f('0x1b')]?_0x9cb8e8[_0x045f('0x1b')][_0x045f('0x1d')]||null:null})['then'](function(_0x18a7be){if(_0x18a7be){return _0x18a7be[_0x045f('0x23')](_0x9cb8e8[_0x045f('0x1a')]['ids'],_[_0x045f('0x24')](_0x9cb8e8[_0x045f('0x1a')],[_0x045f('0x25'),'id'])||{});}})[_0x045f('0x26')](function(_0x3fb800){logger[_0x045f('0xf')]('AddTags',_0x9cb8e8);logger[_0x045f('0x12')](_0x045f('0x27'),_0x9cb8e8,JSON[_0x045f('0x28')](_0x3fb800));_0x30ac89(_0x3fb800);})['catch'](function(_0x3891c0){logger[_0x045f('0x14')](_0x045f('0x27'),_0x3891c0['message'],_0x9cb8e8);_0x51d552(_this[_0x045f('0x14')](0x1f4,_0x3891c0[_0x045f('0x16')]));});});};
\ No newline at end of file
+var _0x1a38=['../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','./chatInteraction.socket','register','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','AddTagsToChatInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x148721,_0x1713ad){var _0x414045=function(_0x5bab20){while(--_0x5bab20){_0x148721['push'](_0x148721['shift']());}};_0x414045(++_0x1713ad);}(_0x1a38,0x1a5));var _0x81a3=function(_0x5d30b4,_0x199248){_0x5d30b4=_0x5d30b4-0x0;var _0x1acfb8=_0x1a38[_0x5d30b4];return _0x1acfb8;};'use strict';var _=require(_0x81a3('0x0'));var util=require(_0x81a3('0x1'));var moment=require(_0x81a3('0x2'));var BPromise=require(_0x81a3('0x3'));var rs=require(_0x81a3('0x4'));var fs=require('fs');var Redis=require(_0x81a3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x81a3('0x6'));var logger=require(_0x81a3('0x7'))(_0x81a3('0x8'));var config=require(_0x81a3('0x9'));var jayson=require(_0x81a3('0xa'));var client=jayson[_0x81a3('0xb')][_0x81a3('0xc')]({'port':0x232a});config['redis']=_[_0x81a3('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x81a3('0xe'))(new Redis(config[_0x81a3('0xf')]));require(_0x81a3('0x10'))[_0x81a3('0x11')](socket);function respondWithRpcPromise(_0x1bd2ad,_0x7f8c4f,_0x18c609){return new BPromise(function(_0x2b20e7,_0x106ec1){return client['request'](_0x1bd2ad,_0x18c609)[_0x81a3('0x12')](function(_0x583147){logger['info'](_0x81a3('0x13'),_0x7f8c4f,'request\x20sent');logger[_0x81a3('0x14')](_0x81a3('0x15'),_0x7f8c4f,_0x81a3('0x16'),JSON[_0x81a3('0x17')](_0x583147));if(_0x583147[_0x81a3('0x18')]){if(_0x583147['error']['code']===0x1f4){logger[_0x81a3('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x7f8c4f,_0x583147[_0x81a3('0x18')][_0x81a3('0x19')]);return _0x106ec1(_0x583147[_0x81a3('0x18')][_0x81a3('0x19')]);}logger[_0x81a3('0x18')](_0x81a3('0x13'),_0x7f8c4f,_0x583147['error'][_0x81a3('0x19')]);return _0x2b20e7(_0x583147[_0x81a3('0x18')]['message']);}else{logger[_0x81a3('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x7f8c4f,_0x81a3('0x16'));_0x2b20e7(_0x583147[_0x81a3('0x1b')][_0x81a3('0x19')]);}})[_0x81a3('0x1c')](function(_0x1ec024){logger[_0x81a3('0x18')](_0x81a3('0x13'),_0x7f8c4f,_0x1ec024);_0x106ec1(_0x1ec024);});});}exports[_0x81a3('0x1d')]=function(_0x5e6be8){var _0x638da=this;return new Promise(function(_0x53cfe1,_0x2e9257){return db[_0x81a3('0x1e')][_0x81a3('0x1f')](_0x5e6be8[_0x81a3('0x20')],{'raw':_0x5e6be8['options']?_0x5e6be8[_0x81a3('0x21')][_0x81a3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e6be8[_0x81a3('0x21')]?_0x5e6be8['options'][_0x81a3('0x23')]||null:null,'attributes':_0x5e6be8[_0x81a3('0x21')]?_0x5e6be8[_0x81a3('0x21')][_0x81a3('0x24')]||null:null,'limit':_0x5e6be8[_0x81a3('0x21')]?_0x5e6be8[_0x81a3('0x21')]['limit']||null:null})[_0x81a3('0x12')](function(_0x5c539b){logger['info'](_0x81a3('0x1d'),_0x5e6be8);logger[_0x81a3('0x14')](_0x81a3('0x1d'),_0x5e6be8,JSON[_0x81a3('0x17')](_0x5c539b));_0x53cfe1(_0x5c539b);})['catch'](function(_0x24878f){logger[_0x81a3('0x18')]('UpdateChatInteraction',_0x24878f['message'],_0x5e6be8);_0x2e9257(_0x638da['error'](0x1f4,_0x24878f[_0x81a3('0x19')]));});});};exports[_0x81a3('0x25')]=function(_0x57dbea){return new Promise(function(_0x133eff,_0x21839a){return db[_0x81a3('0x1e')]['find']({'where':_0x57dbea['options']?_0x57dbea[_0x81a3('0x21')][_0x81a3('0x23')]||null:null})['then'](function(_0x81b7fd){if(_0x81b7fd){return _0x81b7fd[_0x81a3('0x26')](_0x57dbea[_0x81a3('0x20')][_0x81a3('0x27')],_[_0x81a3('0x28')](_0x57dbea[_0x81a3('0x20')],[_0x81a3('0x27'),'id'])||{});}})[_0x81a3('0x29')](function(_0xf241fd){logger['info'](_0x81a3('0x2a'),_0x57dbea);logger[_0x81a3('0x14')](_0x81a3('0x2a'),_0x57dbea,JSON[_0x81a3('0x17')](_0xf241fd));_0x133eff(_0xf241fd);})[_0x81a3('0x1c')](function(_0x389f24){logger[_0x81a3('0x18')]('AddTags',_0x389f24['message'],_0x57dbea);_0x21839a(_this[_0x81a3('0x18')](0x1f4,_0x389f24['message']));});});};
\ No newline at end of file