Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / api / plugin / plugin.rpc.js
index 3e0304c..9859300 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cbc=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','create','body','options','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x3cbc,0xc9));var _0xc3cb=function(_0x4f35f8,_0xf40d60){_0x4f35f8=_0x4f35f8-0x0;var _0x47f700=_0x3cbc[_0x4f35f8];return _0x47f700;};'use strict';var _=require(_0xc3cb('0x0'));var util=require(_0xc3cb('0x1'));var moment=require(_0xc3cb('0x2'));var BPromise=require(_0xc3cb('0x3'));var rs=require(_0xc3cb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3cb('0x5'))['db'];var utils=require(_0xc3cb('0x6'));var logger=require(_0xc3cb('0x7'))(_0xc3cb('0x8'));var config=require(_0xc3cb('0x9'));var jayson=require(_0xc3cb('0xa'));var client=jayson[_0xc3cb('0xb')][_0xc3cb('0xc')]({'port':0x232a});config[_0xc3cb('0xd')]=_[_0xc3cb('0xe')](config[_0xc3cb('0xd')],{'host':_0xc3cb('0xf'),'port':0x18eb});var socket=require(_0xc3cb('0x10'))(new Redis(config['redis']));require(_0xc3cb('0x11'))[_0xc3cb('0x12')](socket);function respondWithRpcPromise(_0xb50867,_0x23b165,_0x3bf68d){return new BPromise(function(_0x49c536,_0x4ab6e5){return client['request'](_0xb50867,_0x3bf68d)[_0xc3cb('0x13')](function(_0x501327){logger[_0xc3cb('0x14')](_0xc3cb('0x15'),_0x23b165,_0xc3cb('0x16'));logger['debug'](_0xc3cb('0x17'),_0x23b165,'request\x20sent',JSON[_0xc3cb('0x18')](_0x501327));if(_0x501327[_0xc3cb('0x19')]){if(_0x501327['error'][_0xc3cb('0x1a')]===0x1f4){logger[_0xc3cb('0x19')]('Plugin,\x20%s,\x20%s',_0x23b165,_0x501327['error'][_0xc3cb('0x1b')]);return _0x4ab6e5(_0x501327[_0xc3cb('0x19')][_0xc3cb('0x1b')]);}logger[_0xc3cb('0x19')]('Plugin,\x20%s,\x20%s',_0x23b165,_0x501327[_0xc3cb('0x19')][_0xc3cb('0x1b')]);return _0x49c536(_0x501327[_0xc3cb('0x19')][_0xc3cb('0x1b')]);}else{logger['info'](_0xc3cb('0x15'),_0x23b165,'request\x20sent');_0x49c536(_0x501327[_0xc3cb('0x1c')][_0xc3cb('0x1b')]);}})[_0xc3cb('0x1d')](function(_0x24ec36){logger['error'](_0xc3cb('0x15'),_0x23b165,_0x24ec36);_0x4ab6e5(_0x24ec36);});});}exports[_0xc3cb('0x1e')]=function(_0x3c6d03){var _0xec5f97=this;return new Promise(function(_0x5e43db,_0x47e43c){return db['Plugin'][_0xc3cb('0x1f')](_0x3c6d03[_0xc3cb('0x20')],{'raw':_0x3c6d03[_0xc3cb('0x21')]?_0x3c6d03[_0xc3cb('0x21')]['raw']===undefined?!![]:![]:!![]})[_0xc3cb('0x13')](function(_0x36ecbd){logger[_0xc3cb('0x14')](_0xc3cb('0x1e'),_0x3c6d03);logger[_0xc3cb('0x22')](_0xc3cb('0x1e'),_0x3c6d03,JSON['stringify'](_0x36ecbd));_0x5e43db(_0x36ecbd);})['catch'](function(_0x40202b){logger['error']('CreatePlugin',_0x40202b['message'],_0x3c6d03);_0x47e43c(_0xec5f97[_0xc3cb('0x19')](0x1f4,_0x40202b[_0xc3cb('0x1b')]));});});};
\ No newline at end of file
+var _0x15ba=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','localhost','socket.io-emitter','./plugin.socket','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreatePlugin','Plugin','create','body','raw','then','catch','lodash','util','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x15ba,0x1bd));var _0xa15b=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x15ba[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0xa15b('0x0'));var util=require(_0xa15b('0x1'));var moment=require(_0xa15b('0x2'));var BPromise=require(_0xa15b('0x3'));var rs=require(_0xa15b('0x4'));var fs=require('fs');var Redis=require(_0xa15b('0x5'));var db=require(_0xa15b('0x6'))['db'];var utils=require(_0xa15b('0x7'));var logger=require(_0xa15b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa15b('0x9')][_0xa15b('0xa')]({'port':0x232a});config[_0xa15b('0xb')]=_['defaults'](config[_0xa15b('0xb')],{'host':_0xa15b('0xc'),'port':0x18eb});var socket=require(_0xa15b('0xd'))(new Redis(config[_0xa15b('0xb')]));require(_0xa15b('0xe'))['register'](socket);function respondWithRpcPromise(_0x2be7bd,_0x2ba842,_0x2da36d){return new BPromise(function(_0x452d01,_0x479150){return client[_0xa15b('0xf')](_0x2be7bd,_0x2da36d)['then'](function(_0x56b57e){logger[_0xa15b('0x10')](_0xa15b('0x11'),_0x2ba842,_0xa15b('0x12'));logger[_0xa15b('0x13')](_0xa15b('0x14'),_0x2ba842,_0xa15b('0x12'),JSON[_0xa15b('0x15')](_0x56b57e));if(_0x56b57e[_0xa15b('0x16')]){if(_0x56b57e[_0xa15b('0x16')][_0xa15b('0x17')]===0x1f4){logger[_0xa15b('0x16')]('Plugin,\x20%s,\x20%s',_0x2ba842,_0x56b57e[_0xa15b('0x16')][_0xa15b('0x18')]);return _0x479150(_0x56b57e[_0xa15b('0x16')][_0xa15b('0x18')]);}logger[_0xa15b('0x16')]('Plugin,\x20%s,\x20%s',_0x2ba842,_0x56b57e[_0xa15b('0x16')][_0xa15b('0x18')]);return _0x452d01(_0x56b57e[_0xa15b('0x16')][_0xa15b('0x18')]);}else{logger[_0xa15b('0x10')](_0xa15b('0x11'),_0x2ba842,_0xa15b('0x12'));_0x452d01(_0x56b57e['result'][_0xa15b('0x18')]);}})['catch'](function(_0x10f3eb){logger[_0xa15b('0x16')](_0xa15b('0x11'),_0x2ba842,_0x10f3eb);_0x479150(_0x10f3eb);});});}exports[_0xa15b('0x19')]=function(_0x5bdd86){var _0x2c4585=this;return new Promise(function(_0x80125c,_0x1f8c51){return db[_0xa15b('0x1a')][_0xa15b('0x1b')](_0x5bdd86[_0xa15b('0x1c')],{'raw':_0x5bdd86['options']?_0x5bdd86['options'][_0xa15b('0x1d')]===undefined?!![]:![]:!![]})[_0xa15b('0x1e')](function(_0x2f7714){logger['info'](_0xa15b('0x19'),_0x5bdd86);logger[_0xa15b('0x13')](_0xa15b('0x19'),_0x5bdd86,JSON[_0xa15b('0x15')](_0x2f7714));_0x80125c(_0x2f7714);})[_0xa15b('0x1f')](function(_0x553267){logger[_0xa15b('0x16')](_0xa15b('0x19'),_0x553267[_0xa15b('0x18')],_0x5bdd86);_0x1f8c51(_0x2c4585[_0xa15b('0x16')](0x1f4,_0x553267[_0xa15b('0x18')]));});});};
\ No newline at end of file