Built motion from commit (unavailable).|2.5.20
[motion2.git] / server / api / plugin / plugin.rpc.js
index 3898410..30fb1de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7794=['CreatePlugin','Plugin','create','options','raw','stringify','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x2d3c09,_0x1c9541){var _0x156749=function(_0x491894){while(--_0x491894){_0x2d3c09['push'](_0x2d3c09['shift']());}};_0x156749(++_0x1c9541);}(_0x7794,0xe6));var _0x4779=function(_0x3d749c,_0x22096e){_0x3d749c=_0x3d749c-0x0;var _0x1ae9dd=_0x7794[_0x3d749c];return _0x1ae9dd;};'use strict';var _=require('lodash');var util=require(_0x4779('0x0'));var moment=require(_0x4779('0x1'));var BPromise=require(_0x4779('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4779('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4779('0x4'));var logger=require(_0x4779('0x5'))('rpc');var config=require(_0x4779('0x6'));var jayson=require(_0x4779('0x7'));var client=jayson[_0x4779('0x8')][_0x4779('0x9')]({'port':0x232a});config['redis']=_[_0x4779('0xa')](config[_0x4779('0xb')],{'host':_0x4779('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4779('0xb')]));require('./plugin.socket')[_0x4779('0xd')](socket);function respondWithRpcPromise(_0x1dd704,_0x32363d,_0x3c75e2){return new BPromise(function(_0x2a1556,_0x594b86){return client[_0x4779('0xe')](_0x1dd704,_0x3c75e2)[_0x4779('0xf')](function(_0x32c3bd){logger[_0x4779('0x10')](_0x4779('0x11'),_0x32363d,_0x4779('0x12'));logger[_0x4779('0x13')](_0x4779('0x14'),_0x32363d,_0x4779('0x12'),JSON['stringify'](_0x32c3bd));if(_0x32c3bd[_0x4779('0x15')]){if(_0x32c3bd[_0x4779('0x15')][_0x4779('0x16')]===0x1f4){logger[_0x4779('0x15')](_0x4779('0x11'),_0x32363d,_0x32c3bd[_0x4779('0x15')][_0x4779('0x17')]);return _0x594b86(_0x32c3bd[_0x4779('0x15')][_0x4779('0x17')]);}logger[_0x4779('0x15')](_0x4779('0x11'),_0x32363d,_0x32c3bd[_0x4779('0x15')]['message']);return _0x2a1556(_0x32c3bd[_0x4779('0x15')][_0x4779('0x17')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x32363d,'request\x20sent');_0x2a1556(_0x32c3bd[_0x4779('0x18')][_0x4779('0x17')]);}})[_0x4779('0x19')](function(_0x3cc4e9){logger[_0x4779('0x15')](_0x4779('0x11'),_0x32363d,_0x3cc4e9);_0x594b86(_0x3cc4e9);});});}exports[_0x4779('0x1a')]=function(_0x5205c6){var _0x4984e3=this;return new Promise(function(_0x11b02a,_0x87b42a){return db[_0x4779('0x1b')][_0x4779('0x1c')](_0x5205c6['body'],{'raw':_0x5205c6[_0x4779('0x1d')]?_0x5205c6[_0x4779('0x1d')][_0x4779('0x1e')]===undefined?!![]:![]:!![]})[_0x4779('0xf')](function(_0x43cc37){logger['info'](_0x4779('0x1a'),_0x5205c6);logger[_0x4779('0x13')](_0x4779('0x1a'),_0x5205c6,JSON[_0x4779('0x1f')](_0x43cc37));_0x11b02a(_0x43cc37);})[_0x4779('0x19')](function(_0x514c8e){logger['error'](_0x4779('0x1a'),_0x514c8e[_0x4779('0x17')],_0x5205c6);_0x87b42a(_0x4984e3[_0x4779('0x15')](0x1f4,_0x514c8e['message']));});});};
\ No newline at end of file
+var _0xb75b=['randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./plugin.socket','request','info','request\x20sent','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin','create','body','debug','stringify','lodash','util','moment','bluebird'];(function(_0x1c22b2,_0x283e3c){var _0x1c8864=function(_0x347fed){while(--_0x347fed){_0x1c22b2['push'](_0x1c22b2['shift']());}};_0x1c8864(++_0x283e3c);}(_0xb75b,0x101));var _0xbb75=function(_0x5916c3,_0x323d36){_0x5916c3=_0x5916c3-0x0;var _0x10bdb1=_0xb75b[_0x5916c3];return _0x10bdb1;};'use strict';var _=require(_0xbb75('0x0'));var util=require(_0xbb75('0x1'));var moment=require(_0xbb75('0x2'));var BPromise=require(_0xbb75('0x3'));var rs=require(_0xbb75('0x4'));var fs=require('fs');var Redis=require(_0xbb75('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb75('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xbb75('0x7'));var jayson=require(_0xbb75('0x8'));var client=jayson['client'][_0xbb75('0x9')]({'port':0x232a});config[_0xbb75('0xa')]=_[_0xbb75('0xb')](config[_0xbb75('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xbb75('0xc'))(new Redis(config[_0xbb75('0xa')]));require(_0xbb75('0xd'))['register'](socket);function respondWithRpcPromise(_0x423636,_0x1c6b50,_0x4c4e9f){return new BPromise(function(_0xd37b0e,_0x5b58b5){return client[_0xbb75('0xe')](_0x423636,_0x4c4e9f)['then'](function(_0xfb1cdd){logger[_0xbb75('0xf')]('Plugin,\x20%s,\x20%s',_0x1c6b50,_0xbb75('0x10'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x1c6b50,_0xbb75('0x10'),JSON['stringify'](_0xfb1cdd));if(_0xfb1cdd[_0xbb75('0x11')]){if(_0xfb1cdd[_0xbb75('0x11')][_0xbb75('0x12')]===0x1f4){logger[_0xbb75('0x11')](_0xbb75('0x13'),_0x1c6b50,_0xfb1cdd[_0xbb75('0x11')][_0xbb75('0x14')]);return _0x5b58b5(_0xfb1cdd['error'][_0xbb75('0x14')]);}logger[_0xbb75('0x11')](_0xbb75('0x13'),_0x1c6b50,_0xfb1cdd[_0xbb75('0x11')][_0xbb75('0x14')]);return _0xd37b0e(_0xfb1cdd[_0xbb75('0x11')][_0xbb75('0x14')]);}else{logger['info'](_0xbb75('0x13'),_0x1c6b50,'request\x20sent');_0xd37b0e(_0xfb1cdd[_0xbb75('0x15')]['message']);}})[_0xbb75('0x16')](function(_0x2ed6cb){logger['error']('Plugin,\x20%s,\x20%s',_0x1c6b50,_0x2ed6cb);_0x5b58b5(_0x2ed6cb);});});}exports[_0xbb75('0x17')]=function(_0x206adb){var _0x60aa17=this;return new Promise(function(_0x29eb4e,_0xde270c){return db[_0xbb75('0x18')][_0xbb75('0x19')](_0x206adb[_0xbb75('0x1a')],{'raw':_0x206adb['options']?_0x206adb['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x30da56){logger['info'](_0xbb75('0x17'),_0x206adb);logger[_0xbb75('0x1b')]('CreatePlugin',_0x206adb,JSON[_0xbb75('0x1c')](_0x30da56));_0x29eb4e(_0x30da56);})['catch'](function(_0x56951e){logger[_0xbb75('0x11')](_0xbb75('0x17'),_0x56951e[_0xbb75('0x14')],_0x206adb);_0xde270c(_0x60aa17[_0xbb75('0x11')](0x1f4,_0x56951e[_0xbb75('0x14')]));});});};
\ No newline at end of file