Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / api / plugin / plugin.rpc.js
index 0512530..cb66617 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadea=['Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','info'];(function(_0x30d62d,_0x5092fa){var _0x2a53b9=function(_0x1bff11){while(--_0x1bff11){_0x30d62d['push'](_0x30d62d['shift']());}};_0x2a53b9(++_0x5092fa);}(_0xadea,0x163));var _0xaade=function(_0x41a3af,_0x5b49fb){_0x41a3af=_0x41a3af-0x0;var _0x5698f0=_0xadea[_0x41a3af];return _0x5698f0;};'use strict';var _=require('lodash');var util=require(_0xaade('0x0'));var moment=require(_0xaade('0x1'));var BPromise=require(_0xaade('0x2'));var rs=require(_0xaade('0x3'));var fs=require('fs');var Redis=require(_0xaade('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaade('0x5'))(_0xaade('0x6'));var config=require(_0xaade('0x7'));var jayson=require(_0xaade('0x8'));var client=jayson[_0xaade('0x9')][_0xaade('0xa')]({'port':0x232a});config[_0xaade('0xb')]=_[_0xaade('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xaade('0xd'))(new Redis(config['redis']));require(_0xaade('0xe'))[_0xaade('0xf')](socket);function respondWithRpcPromise(_0x14ea8f,_0x34aa1a,_0x569147){return new BPromise(function(_0x5168c4,_0x351ad7){return client[_0xaade('0x10')](_0x14ea8f,_0x569147)[_0xaade('0x11')](function(_0x494fc7){logger[_0xaade('0x12')](_0xaade('0x13'),_0x34aa1a,_0xaade('0x14'));logger[_0xaade('0x15')]('Plugin,\x20%s,\x20%s,\x20%s',_0x34aa1a,_0xaade('0x14'),JSON[_0xaade('0x16')](_0x494fc7));if(_0x494fc7[_0xaade('0x17')]){if(_0x494fc7['error'][_0xaade('0x18')]===0x1f4){logger[_0xaade('0x17')]('Plugin,\x20%s,\x20%s',_0x34aa1a,_0x494fc7[_0xaade('0x17')][_0xaade('0x19')]);return _0x351ad7(_0x494fc7['error'][_0xaade('0x19')]);}logger[_0xaade('0x17')]('Plugin,\x20%s,\x20%s',_0x34aa1a,_0x494fc7[_0xaade('0x17')][_0xaade('0x19')]);return _0x5168c4(_0x494fc7[_0xaade('0x17')][_0xaade('0x19')]);}else{logger[_0xaade('0x12')](_0xaade('0x13'),_0x34aa1a,'request\x20sent');_0x5168c4(_0x494fc7[_0xaade('0x1a')]['message']);}})[_0xaade('0x1b')](function(_0x133584){logger[_0xaade('0x17')]('Plugin,\x20%s,\x20%s',_0x34aa1a,_0x133584);_0x351ad7(_0x133584);});});}exports[_0xaade('0x1c')]=function(_0x5513b3){var _0x26d81c=this;return new Promise(function(_0xf243a9,_0x1fd5fe){return db[_0xaade('0x1d')][_0xaade('0x1e')](_0x5513b3[_0xaade('0x1f')],{'raw':_0x5513b3['options']?_0x5513b3[_0xaade('0x20')][_0xaade('0x21')]===undefined?!![]:![]:!![]})[_0xaade('0x11')](function(_0x5587f2){logger[_0xaade('0x12')](_0xaade('0x1c'),_0x5513b3);logger[_0xaade('0x15')](_0xaade('0x1c'),_0x5513b3,JSON['stringify'](_0x5587f2));_0xf243a9(_0x5587f2);})[_0xaade('0x1b')](function(_0x301119){logger['error'](_0xaade('0x1c'),_0x301119['message'],_0x5513b3);_0x1fd5fe(_0x26d81c[_0xaade('0x17')](0x1f4,_0x301119[_0xaade('0x19')]));});});};
\ No newline at end of file
+var _0xa42e=['create','body','options','stringify','lodash','moment','bluebird','../../config/utils','rpc','../../config/environment','client','defaults','socket.io-emitter','redis','./plugin.socket','register','then','info','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','error','Plugin,\x20%s,\x20%s','message','catch','CreatePlugin','Plugin'];(function(_0x45ddfb,_0x233aa1){var _0xf4bcd2=function(_0x2e0667){while(--_0x2e0667){_0x45ddfb['push'](_0x45ddfb['shift']());}};_0xf4bcd2(++_0x233aa1);}(_0xa42e,0xba));var _0xea42=function(_0xdb78b4,_0x47c871){_0xdb78b4=_0xdb78b4-0x0;var _0x32df72=_0xa42e[_0xdb78b4];return _0x32df72;};'use strict';var _=require(_0xea42('0x0'));var util=require('util');var moment=require(_0xea42('0x1'));var BPromise=require(_0xea42('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xea42('0x3'));var logger=require('../../config/logger')(_0xea42('0x4'));var config=require(_0xea42('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xea42('0x6')]['http']({'port':0x232a});config['redis']=_[_0xea42('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xea42('0x8'))(new Redis(config[_0xea42('0x9')]));require(_0xea42('0xa'))[_0xea42('0xb')](socket);function respondWithRpcPromise(_0x3720be,_0x52afe9,_0x445901){return new BPromise(function(_0x34fec0,_0x1c3ff2){return client['request'](_0x3720be,_0x445901)[_0xea42('0xc')](function(_0x3383c9){logger[_0xea42('0xd')]('Plugin,\x20%s,\x20%s',_0x52afe9,_0xea42('0xe'));logger['debug'](_0xea42('0xf'),_0x52afe9,'request\x20sent',JSON['stringify'](_0x3383c9));if(_0x3383c9['error']){if(_0x3383c9[_0xea42('0x10')]['code']===0x1f4){logger['error'](_0xea42('0x11'),_0x52afe9,_0x3383c9[_0xea42('0x10')][_0xea42('0x12')]);return _0x1c3ff2(_0x3383c9[_0xea42('0x10')][_0xea42('0x12')]);}logger['error'](_0xea42('0x11'),_0x52afe9,_0x3383c9[_0xea42('0x10')]['message']);return _0x34fec0(_0x3383c9[_0xea42('0x10')][_0xea42('0x12')]);}else{logger[_0xea42('0xd')]('Plugin,\x20%s,\x20%s',_0x52afe9,_0xea42('0xe'));_0x34fec0(_0x3383c9['result'][_0xea42('0x12')]);}})[_0xea42('0x13')](function(_0x4087a2){logger[_0xea42('0x10')](_0xea42('0x11'),_0x52afe9,_0x4087a2);_0x1c3ff2(_0x4087a2);});});}exports[_0xea42('0x14')]=function(_0x142609){var _0x3ae084=this;return new Promise(function(_0x1debc1,_0xd9d429){return db[_0xea42('0x15')][_0xea42('0x16')](_0x142609[_0xea42('0x17')],{'raw':_0x142609['options']?_0x142609[_0xea42('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xea42('0xc')](function(_0x2462fe){logger[_0xea42('0xd')]('CreatePlugin',_0x142609);logger['debug'](_0xea42('0x14'),_0x142609,JSON[_0xea42('0x19')](_0x2462fe));_0x1debc1(_0x2462fe);})['catch'](function(_0x5370b5){logger[_0xea42('0x10')]('CreatePlugin',_0x5370b5[_0xea42('0x12')],_0x142609);_0xd9d429(_0x3ae084[_0xea42('0x10')](0x1f4,_0x5370b5['message']));});});};
\ No newline at end of file