Built motion from commit 3a7e82ea.|2.6.29
[motion2.git] / server / api / openchannelInteraction / openchannelInteraction.rpc.js
index 16cfa0d..facaac1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d3f=['redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','OpenchannelInteraction','update','body','options','where','attributes','UpdateOpenchannelInteraction','debug','stringify','find','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d3f,0x120));var _0xf8d3=function(_0x58722d,_0x139d86){_0x58722d=_0x58722d-0x0;var _0x1f8a71=_0x8d3f[_0x58722d];return _0x1f8a71;};'use strict';var _=require(_0xf8d3('0x0'));var util=require(_0xf8d3('0x1'));var moment=require(_0xf8d3('0x2'));var BPromise=require(_0xf8d3('0x3'));var rs=require(_0xf8d3('0x4'));var fs=require('fs');var Redis=require(_0xf8d3('0x5'));var db=require(_0xf8d3('0x6'))['db'];var utils=require(_0xf8d3('0x7'));var logger=require(_0xf8d3('0x8'))(_0xf8d3('0x9'));var config=require('../../config/environment');var jayson=require(_0xf8d3('0xa'));var client=jayson[_0xf8d3('0xb')][_0xf8d3('0xc')]({'port':0x232a});config[_0xf8d3('0xd')]=_[_0xf8d3('0xe')](config[_0xf8d3('0xd')],{'host':_0xf8d3('0xf'),'port':0x18eb});var socket=require(_0xf8d3('0x10'))(new Redis(config[_0xf8d3('0xd')]));require(_0xf8d3('0x11'))[_0xf8d3('0x12')](socket);function respondWithRpcPromise(_0x4ea5f2,_0x2619b4,_0x181205){return new BPromise(function(_0x52d7c2,_0x3d6a44){return client[_0xf8d3('0x13')](_0x4ea5f2,_0x181205)[_0xf8d3('0x14')](function(_0x493ebc){logger[_0xf8d3('0x15')](_0xf8d3('0x16'),_0x2619b4,_0xf8d3('0x17'));logger['debug'](_0xf8d3('0x18'),_0x2619b4,_0xf8d3('0x17'),JSON['stringify'](_0x493ebc));if(_0x493ebc['error']){if(_0x493ebc[_0xf8d3('0x19')][_0xf8d3('0x1a')]===0x1f4){logger[_0xf8d3('0x19')](_0xf8d3('0x16'),_0x2619b4,_0x493ebc[_0xf8d3('0x19')][_0xf8d3('0x1b')]);return _0x3d6a44(_0x493ebc[_0xf8d3('0x19')][_0xf8d3('0x1b')]);}logger['error'](_0xf8d3('0x16'),_0x2619b4,_0x493ebc['error'][_0xf8d3('0x1b')]);return _0x52d7c2(_0x493ebc['error']['message']);}else{logger[_0xf8d3('0x15')](_0xf8d3('0x16'),_0x2619b4,_0xf8d3('0x17'));_0x52d7c2(_0x493ebc[_0xf8d3('0x1c')][_0xf8d3('0x1b')]);}})[_0xf8d3('0x1d')](function(_0x4b22ac){logger[_0xf8d3('0x19')]('OpenchannelInteraction,\x20%s,\x20%s',_0x2619b4,_0x4b22ac);_0x3d6a44(_0x4b22ac);});});}exports['UpdateOpenchannelInteraction']=function(_0xabaada){var _0x4bb875=this;return new Promise(function(_0x44b47a,_0x179253){return db[_0xf8d3('0x1e')][_0xf8d3('0x1f')](_0xabaada[_0xf8d3('0x20')],{'raw':_0xabaada['options']?_0xabaada[_0xf8d3('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xabaada[_0xf8d3('0x21')]?_0xabaada[_0xf8d3('0x21')][_0xf8d3('0x22')]||null:null,'attributes':_0xabaada[_0xf8d3('0x21')]?_0xabaada[_0xf8d3('0x21')][_0xf8d3('0x23')]||null:null,'limit':_0xabaada[_0xf8d3('0x21')]?_0xabaada[_0xf8d3('0x21')]['limit']||null:null})['then'](function(_0x57c6de){logger[_0xf8d3('0x15')](_0xf8d3('0x24'),_0xabaada);logger[_0xf8d3('0x25')](_0xf8d3('0x24'),_0xabaada,JSON[_0xf8d3('0x26')](_0x57c6de));_0x44b47a(_0x57c6de);})[_0xf8d3('0x1d')](function(_0x3d9a2c){logger[_0xf8d3('0x19')](_0xf8d3('0x24'),_0x3d9a2c['message'],_0xabaada);_0x179253(_0x4bb875[_0xf8d3('0x19')](0x1f4,_0x3d9a2c[_0xf8d3('0x1b')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x534b67){return new Promise(function(_0x1dd8f6,_0xf9a4a4){return db[_0xf8d3('0x1e')][_0xf8d3('0x27')]({'where':_0x534b67[_0xf8d3('0x21')]?_0x534b67[_0xf8d3('0x21')][_0xf8d3('0x22')]||null:null})[_0xf8d3('0x14')](function(_0x2c3c8f){if(_0x2c3c8f){return _0x2c3c8f['addTags'](_0x534b67[_0xf8d3('0x20')]['ids'],_[_0xf8d3('0x28')](_0x534b67[_0xf8d3('0x20')],['ids','id'])||{});}})[_0xf8d3('0x29')](function(_0x3e183c){logger[_0xf8d3('0x15')](_0xf8d3('0x2a'),_0x534b67);logger[_0xf8d3('0x25')](_0xf8d3('0x2a'),_0x534b67,JSON[_0xf8d3('0x26')](_0x3e183c));_0x1dd8f6(_0x3e183c);})['catch'](function(_0x6b4744){logger[_0xf8d3('0x19')](_0xf8d3('0x2a'),_0x6b4744[_0xf8d3('0x1b')],_0x534b67);_0xf9a4a4(_this[_0xf8d3('0x19')](0x1f4,_0x6b4744[_0xf8d3('0x1b')]));});});};
\ No newline at end of file
+var _0xea3e=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','OpenchannelInteraction,\x20%s,\x20%s','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','util'];(function(_0x57eab0,_0x5dbe67){var _0x4c6cb2=function(_0x253078){while(--_0x253078){_0x57eab0['push'](_0x57eab0['shift']());}};_0x4c6cb2(++_0x5dbe67);}(_0xea3e,0x117));var _0xeea3=function(_0x11d546,_0x4b441a){_0x11d546=_0x11d546-0x0;var _0x23cafc=_0xea3e[_0x11d546];return _0x23cafc;};'use strict';var _=require('lodash');var util=require(_0xeea3('0x0'));var moment=require(_0xeea3('0x1'));var BPromise=require(_0xeea3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeea3('0x3'));var db=require(_0xeea3('0x4'))['db'];var utils=require(_0xeea3('0x5'));var logger=require('../../config/logger')(_0xeea3('0x6'));var config=require(_0xeea3('0x7'));var jayson=require(_0xeea3('0x8'));var client=jayson[_0xeea3('0x9')][_0xeea3('0xa')]({'port':0x232a});config[_0xeea3('0xb')]=_['defaults'](config['redis'],{'host':_0xeea3('0xc'),'port':0x18eb});var socket=require(_0xeea3('0xd'))(new Redis(config[_0xeea3('0xb')]));require(_0xeea3('0xe'))[_0xeea3('0xf')](socket);function respondWithRpcPromise(_0x5f4cd1,_0x460c92,_0x2d3083){return new BPromise(function(_0x3cc15b,_0xaf2b4){return client['request'](_0x5f4cd1,_0x2d3083)[_0xeea3('0x10')](function(_0x268740){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x460c92,'request\x20sent');logger[_0xeea3('0x11')](_0xeea3('0x12'),_0x460c92,_0xeea3('0x13'),JSON[_0xeea3('0x14')](_0x268740));if(_0x268740[_0xeea3('0x15')]){if(_0x268740[_0xeea3('0x15')][_0xeea3('0x16')]===0x1f4){logger[_0xeea3('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x460c92,_0x268740[_0xeea3('0x15')]['message']);return _0xaf2b4(_0x268740[_0xeea3('0x15')][_0xeea3('0x17')]);}logger[_0xeea3('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x460c92,_0x268740[_0xeea3('0x15')][_0xeea3('0x17')]);return _0x3cc15b(_0x268740[_0xeea3('0x15')][_0xeea3('0x17')]);}else{logger[_0xeea3('0x18')](_0xeea3('0x19'),_0x460c92,_0xeea3('0x13'));_0x3cc15b(_0x268740[_0xeea3('0x1a')][_0xeea3('0x17')]);}})[_0xeea3('0x1b')](function(_0x3caa9f){logger['error'](_0xeea3('0x19'),_0x460c92,_0x3caa9f);_0xaf2b4(_0x3caa9f);});});}exports[_0xeea3('0x1c')]=function(_0x13f412){var _0x41f6c2=this;return new Promise(function(_0x3057fb,_0x3ef600){return db[_0xeea3('0x1d')]['update'](_0x13f412[_0xeea3('0x1e')],{'raw':_0x13f412[_0xeea3('0x1f')]?_0x13f412[_0xeea3('0x1f')][_0xeea3('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13f412[_0xeea3('0x1f')]?_0x13f412[_0xeea3('0x1f')]['where']||null:null,'attributes':_0x13f412['options']?_0x13f412[_0xeea3('0x1f')]['attributes']||null:null,'limit':_0x13f412[_0xeea3('0x1f')]?_0x13f412[_0xeea3('0x1f')]['limit']||null:null})['then'](function(_0x1e3510){logger[_0xeea3('0x18')](_0xeea3('0x1c'),_0x13f412);logger[_0xeea3('0x11')](_0xeea3('0x1c'),_0x13f412,JSON[_0xeea3('0x14')](_0x1e3510));_0x3057fb(_0x1e3510);})[_0xeea3('0x1b')](function(_0x1e8aec){logger[_0xeea3('0x15')](_0xeea3('0x1c'),_0x1e8aec['message'],_0x13f412);_0x3ef600(_0x41f6c2[_0xeea3('0x15')](0x1f4,_0x1e8aec[_0xeea3('0x17')]));});});};exports[_0xeea3('0x21')]=function(_0x4b0925){return new Promise(function(_0x467565,_0x13c016){return db[_0xeea3('0x1d')][_0xeea3('0x22')]({'where':_0x4b0925[_0xeea3('0x1f')]?_0x4b0925[_0xeea3('0x1f')]['where']||null:null})['then'](function(_0x356665){if(_0x356665){return _0x356665[_0xeea3('0x23')](_0x4b0925['body'][_0xeea3('0x24')],_[_0xeea3('0x25')](_0x4b0925['body'],[_0xeea3('0x24'),'id'])||{});}})[_0xeea3('0x26')](function(_0x2ffee0){logger['info']('AddTags',_0x4b0925);logger['debug']('AddTags',_0x4b0925,JSON[_0xeea3('0x14')](_0x2ffee0));_0x467565(_0x2ffee0);})[_0xeea3('0x1b')](function(_0x533e7e){logger[_0xeea3('0x15')](_0xeea3('0x27'),_0x533e7e[_0xeea3('0x17')],_0x4b0925);_0x13c016(_this[_0xeea3('0x15')](0x1f4,_0x533e7e['message']));});});};
\ No newline at end of file