Built motion from commit 10af8726.|2.6.34
[motion2.git] / server / api / plugin / plugin.rpc.js
index 8097218..52469d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b9e=['error','code','message','Plugin,\x20%s,\x20%s','catch','CreatePlugin','create','body','options','raw','debug','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x9b9e,0x10c));var _0xe9b9=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9b9e[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xe9b9('0x0'));var util=require(_0xe9b9('0x1'));var moment=require(_0xe9b9('0x2'));var BPromise=require(_0xe9b9('0x3'));var rs=require(_0xe9b9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9b9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9b9('0x6'))('rpc');var config=require(_0xe9b9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe9b9('0x8')][_0xe9b9('0x9')]({'port':0x232a});config[_0xe9b9('0xa')]=_[_0xe9b9('0xb')](config[_0xe9b9('0xa')],{'host':_0xe9b9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe9b9('0xa')]));require(_0xe9b9('0xd'))[_0xe9b9('0xe')](socket);function respondWithRpcPromise(_0x54867e,_0x5be607,_0x3c52a1){return new BPromise(function(_0x4a70bb,_0x350575){return client[_0xe9b9('0xf')](_0x54867e,_0x3c52a1)[_0xe9b9('0x10')](function(_0x520086){logger[_0xe9b9('0x11')]('Plugin,\x20%s,\x20%s',_0x5be607,'request\x20sent');logger['debug'](_0xe9b9('0x12'),_0x5be607,_0xe9b9('0x13'),JSON['stringify'](_0x520086));if(_0x520086['error']){if(_0x520086[_0xe9b9('0x14')][_0xe9b9('0x15')]===0x1f4){logger[_0xe9b9('0x14')]('Plugin,\x20%s,\x20%s',_0x5be607,_0x520086[_0xe9b9('0x14')]['message']);return _0x350575(_0x520086[_0xe9b9('0x14')][_0xe9b9('0x16')]);}logger[_0xe9b9('0x14')]('Plugin,\x20%s,\x20%s',_0x5be607,_0x520086[_0xe9b9('0x14')][_0xe9b9('0x16')]);return _0x4a70bb(_0x520086[_0xe9b9('0x14')][_0xe9b9('0x16')]);}else{logger['info'](_0xe9b9('0x17'),_0x5be607,_0xe9b9('0x13'));_0x4a70bb(_0x520086['result']['message']);}})[_0xe9b9('0x18')](function(_0x2a0043){logger['error'](_0xe9b9('0x17'),_0x5be607,_0x2a0043);_0x350575(_0x2a0043);});});}exports[_0xe9b9('0x19')]=function(_0x2e0a57){var _0x140ee0=this;return new Promise(function(_0x43b0d7,_0x21df1d){return db['Plugin'][_0xe9b9('0x1a')](_0x2e0a57[_0xe9b9('0x1b')],{'raw':_0x2e0a57[_0xe9b9('0x1c')]?_0x2e0a57[_0xe9b9('0x1c')][_0xe9b9('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x649bf8){logger['info'](_0xe9b9('0x19'),_0x2e0a57);logger[_0xe9b9('0x1e')](_0xe9b9('0x19'),_0x2e0a57,JSON[_0xe9b9('0x1f')](_0x649bf8));_0x43b0d7(_0x649bf8);})['catch'](function(_0x213e2e){logger['error'](_0xe9b9('0x19'),_0x213e2e['message'],_0x2e0a57);_0x21df1d(_0x140ee0[_0xe9b9('0x14')](0x1f4,_0x213e2e['message']));});});};
\ No newline at end of file
+var _0x4e3e=['then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Plugin','create','body','options','CreatePlugin','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register'];(function(_0xa3a1ce,_0x3a8fe6){var _0x354cdf=function(_0x54ff2b){while(--_0x54ff2b){_0xa3a1ce['push'](_0xa3a1ce['shift']());}};_0x354cdf(++_0x3a8fe6);}(_0x4e3e,0x1e1));var _0xe4e3=function(_0x4fac58,_0x213b99){_0x4fac58=_0x4fac58-0x0;var _0x10e5d1=_0x4e3e[_0x4fac58];return _0x10e5d1;};'use strict';var _=require(_0xe4e3('0x0'));var util=require(_0xe4e3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4e3('0x2'));var db=require(_0xe4e3('0x3'))['db'];var utils=require(_0xe4e3('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xe4e3('0x5'));var jayson=require(_0xe4e3('0x6'));var client=jayson[_0xe4e3('0x7')]['http']({'port':0x232a});config[_0xe4e3('0x8')]=_['defaults'](config[_0xe4e3('0x8')],{'host':_0xe4e3('0x9'),'port':0x18eb});var socket=require(_0xe4e3('0xa'))(new Redis(config[_0xe4e3('0x8')]));require('./plugin.socket')[_0xe4e3('0xb')](socket);function respondWithRpcPromise(_0x52a0f8,_0x2f46da,_0x338795){return new BPromise(function(_0x54acec,_0x44b095){return client['request'](_0x52a0f8,_0x338795)[_0xe4e3('0xc')](function(_0x566620){logger[_0xe4e3('0xd')](_0xe4e3('0xe'),_0x2f46da,_0xe4e3('0xf'));logger[_0xe4e3('0x10')](_0xe4e3('0x11'),_0x2f46da,_0xe4e3('0xf'),JSON[_0xe4e3('0x12')](_0x566620));if(_0x566620[_0xe4e3('0x13')]){if(_0x566620[_0xe4e3('0x13')][_0xe4e3('0x14')]===0x1f4){logger[_0xe4e3('0x13')]('Plugin,\x20%s,\x20%s',_0x2f46da,_0x566620[_0xe4e3('0x13')][_0xe4e3('0x15')]);return _0x44b095(_0x566620['error'][_0xe4e3('0x15')]);}logger[_0xe4e3('0x13')](_0xe4e3('0xe'),_0x2f46da,_0x566620['error'][_0xe4e3('0x15')]);return _0x54acec(_0x566620[_0xe4e3('0x13')]['message']);}else{logger[_0xe4e3('0xd')](_0xe4e3('0xe'),_0x2f46da,'request\x20sent');_0x54acec(_0x566620[_0xe4e3('0x16')][_0xe4e3('0x15')]);}})[_0xe4e3('0x17')](function(_0x173c34){logger[_0xe4e3('0x13')](_0xe4e3('0xe'),_0x2f46da,_0x173c34);_0x44b095(_0x173c34);});});}exports['CreatePlugin']=function(_0x4fbba2){var _0x313556=this;return new Promise(function(_0x4f9852,_0x3ea6bf){return db[_0xe4e3('0x18')][_0xe4e3('0x19')](_0x4fbba2[_0xe4e3('0x1a')],{'raw':_0x4fbba2['options']?_0x4fbba2[_0xe4e3('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xe4e3('0xc')](function(_0x17925c){logger['info'](_0xe4e3('0x1c'),_0x4fbba2);logger['debug'](_0xe4e3('0x1c'),_0x4fbba2,JSON[_0xe4e3('0x12')](_0x17925c));_0x4f9852(_0x17925c);})[_0xe4e3('0x17')](function(_0x21768a){logger['error']('CreatePlugin',_0x21768a[_0xe4e3('0x15')],_0x4fbba2);_0x3ea6bf(_0x313556['error'](0x1f4,_0x21768a[_0xe4e3('0x15')]));});});};
\ No newline at end of file