Built motion from commit 753c950e.|2.5.42
[motion2.git] / server / api / plugin / plugin.rpc.js
index 1fc3c57..28e26f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x721e=['catch','CreatePlugin','Plugin','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./plugin.socket','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x55e95b,_0x54eef4){var _0x575aaf=function(_0x366669){while(--_0x366669){_0x55e95b['push'](_0x55e95b['shift']());}};_0x575aaf(++_0x54eef4);}(_0x721e,0x188));var _0xe721=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x721e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe721('0x0'));var util=require(_0xe721('0x1'));var moment=require(_0xe721('0x2'));var BPromise=require(_0xe721('0x3'));var rs=require(_0xe721('0x4'));var fs=require('fs');var Redis=require(_0xe721('0x5'));var db=require(_0xe721('0x6'))['db'];var utils=require(_0xe721('0x7'));var logger=require(_0xe721('0x8'))(_0xe721('0x9'));var config=require(_0xe721('0xa'));var jayson=require(_0xe721('0xb'));var client=jayson['client'][_0xe721('0xc')]({'port':0x232a});config[_0xe721('0xd')]=_['defaults'](config[_0xe721('0xd')],{'host':_0xe721('0xe'),'port':0x18eb});var socket=require(_0xe721('0xf'))(new Redis(config['redis']));require(_0xe721('0x10'))['register'](socket);function respondWithRpcPromise(_0xcfe1c6,_0x58add5,_0x36350e){return new BPromise(function(_0x32479d,_0x162d59){return client[_0xe721('0x11')](_0xcfe1c6,_0x36350e)[_0xe721('0x12')](function(_0x129a1e){logger[_0xe721('0x13')](_0xe721('0x14'),_0x58add5,_0xe721('0x15'));logger[_0xe721('0x16')](_0xe721('0x17'),_0x58add5,_0xe721('0x15'),JSON['stringify'](_0x129a1e));if(_0x129a1e[_0xe721('0x18')]){if(_0x129a1e['error'][_0xe721('0x19')]===0x1f4){logger['error'](_0xe721('0x14'),_0x58add5,_0x129a1e[_0xe721('0x18')][_0xe721('0x1a')]);return _0x162d59(_0x129a1e[_0xe721('0x18')]['message']);}logger[_0xe721('0x18')](_0xe721('0x14'),_0x58add5,_0x129a1e[_0xe721('0x18')][_0xe721('0x1a')]);return _0x32479d(_0x129a1e['error'][_0xe721('0x1a')]);}else{logger[_0xe721('0x13')](_0xe721('0x14'),_0x58add5,_0xe721('0x15'));_0x32479d(_0x129a1e[_0xe721('0x1b')][_0xe721('0x1a')]);}})[_0xe721('0x1c')](function(_0x1c33c5){logger[_0xe721('0x18')](_0xe721('0x14'),_0x58add5,_0x1c33c5);_0x162d59(_0x1c33c5);});});}exports[_0xe721('0x1d')]=function(_0x44ffac){var _0x27d1fd=this;return new Promise(function(_0x477310,_0x37f160){return db[_0xe721('0x1e')][_0xe721('0x1f')](_0x44ffac['body'],{'raw':_0x44ffac[_0xe721('0x20')]?_0x44ffac[_0xe721('0x20')][_0xe721('0x21')]===undefined?!![]:![]:!![]})[_0xe721('0x12')](function(_0x15f50f){logger[_0xe721('0x13')]('CreatePlugin',_0x44ffac);logger[_0xe721('0x16')](_0xe721('0x1d'),_0x44ffac,JSON[_0xe721('0x22')](_0x15f50f));_0x477310(_0x15f50f);})['catch'](function(_0x4a3f81){logger[_0xe721('0x18')](_0xe721('0x1d'),_0x4a3f81[_0xe721('0x1a')],_0x44ffac);_0x37f160(_0x27d1fd[_0xe721('0x18')](0x1f4,_0x4a3f81['message']));});});};
\ No newline at end of file
+var _0x9fce=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Plugin','create','body','options','CreatePlugin','catch','util','bluebird','randomstring','../../mysqldb'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0x9fce,0xb6));var _0xe9fc=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0x9fce[_0x334651];return _0x29657c;};'use strict';var _=require('lodash');var util=require(_0xe9fc('0x0'));var moment=require('moment');var BPromise=require(_0xe9fc('0x1'));var rs=require(_0xe9fc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9fc('0x3'))['db'];var utils=require(_0xe9fc('0x4'));var logger=require('../../config/logger')(_0xe9fc('0x5'));var config=require(_0xe9fc('0x6'));var jayson=require(_0xe9fc('0x7'));var client=jayson[_0xe9fc('0x8')][_0xe9fc('0x9')]({'port':0x232a});config[_0xe9fc('0xa')]=_['defaults'](config[_0xe9fc('0xa')],{'host':_0xe9fc('0xb'),'port':0x18eb});var socket=require(_0xe9fc('0xc'))(new Redis(config['redis']));require('./plugin.socket')[_0xe9fc('0xd')](socket);function respondWithRpcPromise(_0x27794c,_0x590f34,_0x2c0a5d){return new BPromise(function(_0x5dca0b,_0x178afb){return client[_0xe9fc('0xe')](_0x27794c,_0x2c0a5d)[_0xe9fc('0xf')](function(_0x497e93){logger[_0xe9fc('0x10')](_0xe9fc('0x11'),_0x590f34,_0xe9fc('0x12'));logger['debug'](_0xe9fc('0x13'),_0x590f34,_0xe9fc('0x12'),JSON[_0xe9fc('0x14')](_0x497e93));if(_0x497e93['error']){if(_0x497e93[_0xe9fc('0x15')][_0xe9fc('0x16')]===0x1f4){logger['error'](_0xe9fc('0x11'),_0x590f34,_0x497e93[_0xe9fc('0x15')][_0xe9fc('0x17')]);return _0x178afb(_0x497e93[_0xe9fc('0x15')][_0xe9fc('0x17')]);}logger[_0xe9fc('0x15')](_0xe9fc('0x11'),_0x590f34,_0x497e93[_0xe9fc('0x15')][_0xe9fc('0x17')]);return _0x5dca0b(_0x497e93[_0xe9fc('0x15')][_0xe9fc('0x17')]);}else{logger[_0xe9fc('0x10')](_0xe9fc('0x11'),_0x590f34,_0xe9fc('0x12'));_0x5dca0b(_0x497e93[_0xe9fc('0x18')][_0xe9fc('0x17')]);}})['catch'](function(_0x397f5){logger['error'](_0xe9fc('0x11'),_0x590f34,_0x397f5);_0x178afb(_0x397f5);});});}exports['CreatePlugin']=function(_0x3f06fb){var _0x1deff9=this;return new Promise(function(_0x53214c,_0x3b5682){return db[_0xe9fc('0x19')][_0xe9fc('0x1a')](_0x3f06fb[_0xe9fc('0x1b')],{'raw':_0x3f06fb[_0xe9fc('0x1c')]?_0x3f06fb[_0xe9fc('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xe9fc('0xf')](function(_0x3441e5){logger[_0xe9fc('0x10')](_0xe9fc('0x1d'),_0x3f06fb);logger['debug']('CreatePlugin',_0x3f06fb,JSON['stringify'](_0x3441e5));_0x53214c(_0x3441e5);})[_0xe9fc('0x1e')](function(_0x34dca2){logger[_0xe9fc('0x15')](_0xe9fc('0x1d'),_0x34dca2[_0xe9fc('0x17')],_0x3f06fb);_0x3b5682(_0x1deff9[_0xe9fc('0x15')](0x1f4,_0x34dca2[_0xe9fc('0x17')]));});});};
\ No newline at end of file