Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / api / plugin / plugin.rpc.js
index 9db99a9..9859300 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x091a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreatePlugin','Plugin','create','body','options','raw','util','moment','randomstring'];(function(_0x9c9e32,_0xe6cc6d){var _0x54fe51=function(_0x2780c9){while(--_0x2780c9){_0x9c9e32['push'](_0x9c9e32['shift']());}};_0x54fe51(++_0xe6cc6d);}(_0x091a,0xc3));var _0xa091=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x091a[_0x279d37];return _0x530173;};'use strict';var _=require('lodash');var util=require(_0xa091('0x0'));var moment=require(_0xa091('0x1'));var BPromise=require('bluebird');var rs=require(_0xa091('0x2'));var fs=require('fs');var Redis=require(_0xa091('0x3'));var db=require(_0xa091('0x4'))['db'];var utils=require(_0xa091('0x5'));var logger=require(_0xa091('0x6'))('rpc');var config=require(_0xa091('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa091('0x8')]['http']({'port':0x232a});config[_0xa091('0x9')]=_[_0xa091('0xa')](config['redis'],{'host':_0xa091('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa091('0xc'))[_0xa091('0xd')](socket);function respondWithRpcPromise(_0x4553e1,_0x42c6f6,_0x23afeb){return new BPromise(function(_0x146500,_0x39bcf7){return client[_0xa091('0xe')](_0x4553e1,_0x23afeb)[_0xa091('0xf')](function(_0x42002d){logger['info'](_0xa091('0x10'),_0x42c6f6,_0xa091('0x11'));logger[_0xa091('0x12')](_0xa091('0x13'),_0x42c6f6,_0xa091('0x11'),JSON[_0xa091('0x14')](_0x42002d));if(_0x42002d[_0xa091('0x15')]){if(_0x42002d['error'][_0xa091('0x16')]===0x1f4){logger[_0xa091('0x15')](_0xa091('0x10'),_0x42c6f6,_0x42002d[_0xa091('0x15')][_0xa091('0x17')]);return _0x39bcf7(_0x42002d[_0xa091('0x15')]['message']);}logger[_0xa091('0x15')]('Plugin,\x20%s,\x20%s',_0x42c6f6,_0x42002d[_0xa091('0x15')][_0xa091('0x17')]);return _0x146500(_0x42002d['error'][_0xa091('0x17')]);}else{logger[_0xa091('0x18')](_0xa091('0x10'),_0x42c6f6,_0xa091('0x11'));_0x146500(_0x42002d[_0xa091('0x19')][_0xa091('0x17')]);}})[_0xa091('0x1a')](function(_0x1b612a){logger[_0xa091('0x15')]('Plugin,\x20%s,\x20%s',_0x42c6f6,_0x1b612a);_0x39bcf7(_0x1b612a);});});}exports[_0xa091('0x1b')]=function(_0x2a6e81){var _0x4f3958=this;return new Promise(function(_0x5f0f13,_0x3bd377){return db[_0xa091('0x1c')][_0xa091('0x1d')](_0x2a6e81[_0xa091('0x1e')],{'raw':_0x2a6e81[_0xa091('0x1f')]?_0x2a6e81['options'][_0xa091('0x20')]===undefined?!![]:![]:!![]})[_0xa091('0xf')](function(_0x29d9da){logger[_0xa091('0x18')]('CreatePlugin',_0x2a6e81);logger['debug']('CreatePlugin',_0x2a6e81,JSON[_0xa091('0x14')](_0x29d9da));_0x5f0f13(_0x29d9da);})[_0xa091('0x1a')](function(_0x51df85){logger[_0xa091('0x15')](_0xa091('0x1b'),_0x51df85[_0xa091('0x17')],_0x2a6e81);_0x3bd377(_0x4f3958['error'](0x1f4,_0x51df85[_0xa091('0x17')]));});});};
\ 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