Built motion from commit (unavailable).|2.4.11
[motion2.git] / server / api / chatInteraction / chatInteraction.rpc.js
index fde3f03..12070f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc838=['then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','update','body','options','where','attributes','limit','AddTagsToChatInteraction','ChatInteraction','find','addTags','ids','AddTags','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc838,0xd7));var _0x8c83=function(_0x4a6b37,_0x37c56f){_0x4a6b37=_0x4a6b37-0x0;var _0x36ee87=_0xc838[_0x4a6b37];return _0x36ee87;};'use strict';var _=require(_0x8c83('0x0'));var util=require(_0x8c83('0x1'));var moment=require('moment');var BPromise=require(_0x8c83('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c83('0x3'))['db'];var utils=require(_0x8c83('0x4'));var logger=require('../../config/logger')(_0x8c83('0x5'));var config=require('../../config/environment');var jayson=require(_0x8c83('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x8c83('0x7')]=_[_0x8c83('0x8')](config['redis'],{'host':_0x8c83('0x9'),'port':0x18eb});var socket=require(_0x8c83('0xa'))(new Redis(config[_0x8c83('0x7')]));require(_0x8c83('0xb'))[_0x8c83('0xc')](socket);function respondWithRpcPromise(_0x38a3b1,_0x2a2ac1,_0x346e38){return new BPromise(function(_0x181d28,_0x521da1){return client['request'](_0x38a3b1,_0x346e38)[_0x8c83('0xd')](function(_0xa1ae5f){logger[_0x8c83('0xe')](_0x8c83('0xf'),_0x2a2ac1,_0x8c83('0x10'));logger[_0x8c83('0x11')](_0x8c83('0x12'),_0x2a2ac1,_0x8c83('0x10'),JSON[_0x8c83('0x13')](_0xa1ae5f));if(_0xa1ae5f[_0x8c83('0x14')]){if(_0xa1ae5f[_0x8c83('0x14')][_0x8c83('0x15')]===0x1f4){logger[_0x8c83('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2a2ac1,_0xa1ae5f['error'][_0x8c83('0x16')]);return _0x521da1(_0xa1ae5f[_0x8c83('0x14')]['message']);}logger[_0x8c83('0x14')](_0x8c83('0xf'),_0x2a2ac1,_0xa1ae5f[_0x8c83('0x14')][_0x8c83('0x16')]);return _0x181d28(_0xa1ae5f[_0x8c83('0x14')]['message']);}else{logger[_0x8c83('0xe')](_0x8c83('0xf'),_0x2a2ac1,_0x8c83('0x10'));_0x181d28(_0xa1ae5f[_0x8c83('0x17')][_0x8c83('0x16')]);}})[_0x8c83('0x18')](function(_0xfa2db2){logger[_0x8c83('0x14')](_0x8c83('0xf'),_0x2a2ac1,_0xfa2db2);_0x521da1(_0xfa2db2);});});}exports[_0x8c83('0x19')]=function(_0x4c0d29){var _0x2ab739=this;return new Promise(function(_0x5d7694,_0x55c059){return db['ChatInteraction'][_0x8c83('0x1a')](_0x4c0d29[_0x8c83('0x1b')],{'raw':_0x4c0d29[_0x8c83('0x1c')]?_0x4c0d29[_0x8c83('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c0d29[_0x8c83('0x1c')]?_0x4c0d29[_0x8c83('0x1c')][_0x8c83('0x1d')]||null:null,'attributes':_0x4c0d29[_0x8c83('0x1c')]?_0x4c0d29[_0x8c83('0x1c')][_0x8c83('0x1e')]||null:null,'limit':_0x4c0d29[_0x8c83('0x1c')]?_0x4c0d29[_0x8c83('0x1c')][_0x8c83('0x1f')]||null:null})[_0x8c83('0xd')](function(_0x2c22f7){logger[_0x8c83('0xe')](_0x8c83('0x19'),_0x4c0d29);logger[_0x8c83('0x11')]('UpdateChatInteraction',_0x4c0d29,JSON[_0x8c83('0x13')](_0x2c22f7));_0x5d7694(_0x2c22f7);})[_0x8c83('0x18')](function(_0x4ab576){logger[_0x8c83('0x14')](_0x8c83('0x19'),_0x4ab576[_0x8c83('0x16')],_0x4c0d29);_0x55c059(_0x2ab739['error'](0x1f4,_0x4ab576[_0x8c83('0x16')]));});});};exports[_0x8c83('0x20')]=function(_0x1f0d0e){return new Promise(function(_0x448332,_0x23b40a){return db[_0x8c83('0x21')][_0x8c83('0x22')]({'where':_0x1f0d0e[_0x8c83('0x1c')]?_0x1f0d0e['options'][_0x8c83('0x1d')]||null:null})[_0x8c83('0xd')](function(_0x4fd79b){if(_0x4fd79b){return _0x4fd79b[_0x8c83('0x23')](_0x1f0d0e['body'][_0x8c83('0x24')],_['omit'](_0x1f0d0e[_0x8c83('0x1b')],[_0x8c83('0x24'),'id'])||{});}})['spread'](function(_0x6626c9){logger[_0x8c83('0xe')](_0x8c83('0x25'),_0x1f0d0e);logger[_0x8c83('0x11')](_0x8c83('0x25'),_0x1f0d0e,JSON[_0x8c83('0x13')](_0x6626c9));_0x448332(_0x6626c9);})['catch'](function(_0x311c9b){logger[_0x8c83('0x14')](_0x8c83('0x25'),_0x311c9b[_0x8c83('0x16')],_0x1f0d0e);_0x23b40a(_this[_0x8c83('0x14')](0x1f4,_0x311c9b[_0x8c83('0x16')]));});});};
\ No newline at end of file
+var _0x25f6=['catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','info','AddTagsToChatInteraction','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x25f6,0x161));var _0x625f=function(_0x13c625,_0xc65b8e){_0x13c625=_0x13c625-0x0;var _0x1f2506=_0x25f6[_0x13c625];return _0x1f2506;};'use strict';var _=require(_0x625f('0x0'));var util=require(_0x625f('0x1'));var moment=require('moment');var BPromise=require(_0x625f('0x2'));var rs=require(_0x625f('0x3'));var fs=require('fs');var Redis=require(_0x625f('0x4'));var db=require(_0x625f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x625f('0x6'))(_0x625f('0x7'));var config=require(_0x625f('0x8'));var jayson=require(_0x625f('0x9'));var client=jayson[_0x625f('0xa')][_0x625f('0xb')]({'port':0x232a});config[_0x625f('0xc')]=_[_0x625f('0xd')](config['redis'],{'host':_0x625f('0xe'),'port':0x18eb});var socket=require(_0x625f('0xf'))(new Redis(config[_0x625f('0xc')]));require('./chatInteraction.socket')[_0x625f('0x10')](socket);function respondWithRpcPromise(_0x568a92,_0x35887d,_0x6d5cb){return new BPromise(function(_0x2e4e8e,_0x4b871d){return client['request'](_0x568a92,_0x6d5cb)[_0x625f('0x11')](function(_0x307e1d){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x35887d,_0x625f('0x12'));logger[_0x625f('0x13')](_0x625f('0x14'),_0x35887d,_0x625f('0x12'),JSON[_0x625f('0x15')](_0x307e1d));if(_0x307e1d['error']){if(_0x307e1d['error']['code']===0x1f4){logger[_0x625f('0x16')](_0x625f('0x17'),_0x35887d,_0x307e1d[_0x625f('0x16')][_0x625f('0x18')]);return _0x4b871d(_0x307e1d[_0x625f('0x16')][_0x625f('0x18')]);}logger['error'](_0x625f('0x17'),_0x35887d,_0x307e1d[_0x625f('0x16')][_0x625f('0x18')]);return _0x2e4e8e(_0x307e1d['error'][_0x625f('0x18')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x35887d,_0x625f('0x12'));_0x2e4e8e(_0x307e1d['result'][_0x625f('0x18')]);}})[_0x625f('0x19')](function(_0x30e887){logger[_0x625f('0x16')](_0x625f('0x17'),_0x35887d,_0x30e887);_0x4b871d(_0x30e887);});});}exports[_0x625f('0x1a')]=function(_0x5cfa02){var _0x44cae0=this;return new Promise(function(_0x44b64d,_0x198f7b){return db[_0x625f('0x1b')][_0x625f('0x1c')](_0x5cfa02[_0x625f('0x1d')],{'raw':_0x5cfa02['options']?_0x5cfa02[_0x625f('0x1e')][_0x625f('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cfa02[_0x625f('0x1e')]?_0x5cfa02[_0x625f('0x1e')][_0x625f('0x20')]||null:null,'attributes':_0x5cfa02[_0x625f('0x1e')]?_0x5cfa02[_0x625f('0x1e')][_0x625f('0x21')]||null:null,'limit':_0x5cfa02['options']?_0x5cfa02[_0x625f('0x1e')][_0x625f('0x22')]||null:null})[_0x625f('0x11')](function(_0xa3c77a){logger[_0x625f('0x23')]('UpdateChatInteraction',_0x5cfa02);logger[_0x625f('0x13')](_0x625f('0x1a'),_0x5cfa02,JSON['stringify'](_0xa3c77a));_0x44b64d(_0xa3c77a);})['catch'](function(_0x39e3f2){logger['error']('UpdateChatInteraction',_0x39e3f2[_0x625f('0x18')],_0x5cfa02);_0x198f7b(_0x44cae0['error'](0x1f4,_0x39e3f2[_0x625f('0x18')]));});});};exports[_0x625f('0x24')]=function(_0x4c742e){return new Promise(function(_0x9d12bb,_0x4d30c5){return db['ChatInteraction']['find']({'where':_0x4c742e[_0x625f('0x1e')]?_0x4c742e[_0x625f('0x1e')][_0x625f('0x20')]||null:null})[_0x625f('0x11')](function(_0x3ee869){if(_0x3ee869){return _0x3ee869[_0x625f('0x25')](_0x4c742e['body'][_0x625f('0x26')],_[_0x625f('0x27')](_0x4c742e[_0x625f('0x1d')],['ids','id'])||{});}})[_0x625f('0x28')](function(_0x3f64cb){logger['info'](_0x625f('0x29'),_0x4c742e);logger['debug'](_0x625f('0x29'),_0x4c742e,JSON[_0x625f('0x15')](_0x3f64cb));_0x9d12bb(_0x3f64cb);})['catch'](function(_0x325771){logger[_0x625f('0x16')]('AddTags',_0x325771['message'],_0x4c742e);_0x4d30c5(_this[_0x625f('0x16')](0x1f4,_0x325771[_0x625f('0x18')]));});});};
\ No newline at end of file