Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / plugin / plugin.rpc.js
index a2ca23f..705f79f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76b7=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreatePlugin','Plugin','body','options','raw','debug','stringify','util','moment','bluebird','ioredis'];(function(_0x2c0c40,_0x29f6da){var _0x16b689=function(_0x15e592){while(--_0x15e592){_0x2c0c40['push'](_0x2c0c40['shift']());}};_0x16b689(++_0x29f6da);}(_0x76b7,0x80));var _0x776b=function(_0x442e0d,_0x4c325d){_0x442e0d=_0x442e0d-0x0;var _0xa809b6=_0x76b7[_0x442e0d];return _0xa809b6;};'use strict';var _=require('lodash');var util=require(_0x776b('0x0'));var moment=require(_0x776b('0x1'));var BPromise=require(_0x776b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x776b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x776b('0x4'));var logger=require(_0x776b('0x5'))(_0x776b('0x6'));var config=require(_0x776b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x776b('0x8')][_0x776b('0x9')]({'port':0x232a});config['redis']=_[_0x776b('0xa')](config['redis'],{'host':_0x776b('0xb'),'port':0x18eb});var socket=require(_0x776b('0xc'))(new Redis(config[_0x776b('0xd')]));require(_0x776b('0xe'))[_0x776b('0xf')](socket);function respondWithRpcPromise(_0x5bfd9b,_0x5c2487,_0x1d156a){return new BPromise(function(_0x419498,_0x48a4bf){return client['request'](_0x5bfd9b,_0x1d156a)[_0x776b('0x10')](function(_0x5a01a6){logger[_0x776b('0x11')](_0x776b('0x12'),_0x5c2487,'request\x20sent');logger['debug'](_0x776b('0x13'),_0x5c2487,_0x776b('0x14'),JSON['stringify'](_0x5a01a6));if(_0x5a01a6[_0x776b('0x15')]){if(_0x5a01a6['error'][_0x776b('0x16')]===0x1f4){logger[_0x776b('0x15')]('Plugin,\x20%s,\x20%s',_0x5c2487,_0x5a01a6[_0x776b('0x15')][_0x776b('0x17')]);return _0x48a4bf(_0x5a01a6[_0x776b('0x15')][_0x776b('0x17')]);}logger['error'](_0x776b('0x12'),_0x5c2487,_0x5a01a6[_0x776b('0x15')][_0x776b('0x17')]);return _0x419498(_0x5a01a6[_0x776b('0x15')][_0x776b('0x17')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x5c2487,_0x776b('0x14'));_0x419498(_0x5a01a6[_0x776b('0x18')][_0x776b('0x17')]);}})[_0x776b('0x19')](function(_0x2f3dab){logger['error'](_0x776b('0x12'),_0x5c2487,_0x2f3dab);_0x48a4bf(_0x2f3dab);});});}exports[_0x776b('0x1a')]=function(_0x535486){var _0x414355=this;return new Promise(function(_0x1fb8ea,_0x315f67){return db[_0x776b('0x1b')]['create'](_0x535486[_0x776b('0x1c')],{'raw':_0x535486[_0x776b('0x1d')]?_0x535486[_0x776b('0x1d')][_0x776b('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x163c33){logger[_0x776b('0x11')](_0x776b('0x1a'),_0x535486);logger[_0x776b('0x1f')](_0x776b('0x1a'),_0x535486,JSON[_0x776b('0x20')](_0x163c33));_0x1fb8ea(_0x163c33);})['catch'](function(_0x2a03ff){logger['error'](_0x776b('0x1a'),_0x2a03ff[_0x776b('0x17')],_0x535486);_0x315f67(_0x414355[_0x776b('0x15')](0x1f4,_0x2a03ff[_0x776b('0x17')]));});});};
\ No newline at end of file
+var _0x4380=['stringify','error','message','catch','CreatePlugin','body','options','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4380,0x93));var _0x0438=function(_0x50b78f,_0x4d08dd){_0x50b78f=_0x50b78f-0x0;var _0x4b98a3=_0x4380[_0x50b78f];return _0x4b98a3;};'use strict';var _=require(_0x0438('0x0'));var util=require(_0x0438('0x1'));var moment=require(_0x0438('0x2'));var BPromise=require('bluebird');var rs=require(_0x0438('0x3'));var fs=require('fs');var Redis=require(_0x0438('0x4'));var db=require(_0x0438('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0438('0x6'));var config=require(_0x0438('0x7'));var jayson=require(_0x0438('0x8'));var client=jayson[_0x0438('0x9')]['http']({'port':0x232a});config[_0x0438('0xa')]=_[_0x0438('0xb')](config[_0x0438('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0438('0xc'))(new Redis(config['redis']));require(_0x0438('0xd'))[_0x0438('0xe')](socket);function respondWithRpcPromise(_0x313ed4,_0x2ed9f0,_0x4d0225){return new BPromise(function(_0x54d517,_0x6cc500){return client[_0x0438('0xf')](_0x313ed4,_0x4d0225)[_0x0438('0x10')](function(_0x3a898b){logger[_0x0438('0x11')](_0x0438('0x12'),_0x2ed9f0,_0x0438('0x13'));logger[_0x0438('0x14')]('Plugin,\x20%s,\x20%s,\x20%s',_0x2ed9f0,_0x0438('0x13'),JSON[_0x0438('0x15')](_0x3a898b));if(_0x3a898b[_0x0438('0x16')]){if(_0x3a898b[_0x0438('0x16')]['code']===0x1f4){logger[_0x0438('0x16')](_0x0438('0x12'),_0x2ed9f0,_0x3a898b['error'][_0x0438('0x17')]);return _0x6cc500(_0x3a898b[_0x0438('0x16')]['message']);}logger['error']('Plugin,\x20%s,\x20%s',_0x2ed9f0,_0x3a898b[_0x0438('0x16')][_0x0438('0x17')]);return _0x54d517(_0x3a898b[_0x0438('0x16')][_0x0438('0x17')]);}else{logger[_0x0438('0x11')](_0x0438('0x12'),_0x2ed9f0,'request\x20sent');_0x54d517(_0x3a898b['result'][_0x0438('0x17')]);}})[_0x0438('0x18')](function(_0x59ba67){logger[_0x0438('0x16')]('Plugin,\x20%s,\x20%s',_0x2ed9f0,_0x59ba67);_0x6cc500(_0x59ba67);});});}exports[_0x0438('0x19')]=function(_0x544422){var _0x4c3914=this;return new Promise(function(_0x15cd53,_0x398ace){return db['Plugin']['create'](_0x544422[_0x0438('0x1a')],{'raw':_0x544422[_0x0438('0x1b')]?_0x544422['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3d6fe6){logger[_0x0438('0x11')](_0x0438('0x19'),_0x544422);logger[_0x0438('0x14')]('CreatePlugin',_0x544422,JSON[_0x0438('0x15')](_0x3d6fe6));_0x15cd53(_0x3d6fe6);})[_0x0438('0x18')](function(_0xe78e7){logger['error'](_0x0438('0x19'),_0xe78e7['message'],_0x544422);_0x398ace(_0x4c3914[_0x0438('0x16')](0x1f4,_0xe78e7[_0x0438('0x17')]));});});};
\ No newline at end of file