Built motion from commit 53172ac8.|2.6.30
[motion2.git] / server / api / plugin / plugin.rpc.js
index 3e5c00e..b733dec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59b6=['message','catch','CreatePlugin','create','body','options','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','info','Plugin,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x574701,_0x3da128){var _0x1c8080=function(_0x378dd6){while(--_0x378dd6){_0x574701['push'](_0x574701['shift']());}};_0x1c8080(++_0x3da128);}(_0x59b6,0x1aa));var _0x659b=function(_0x23e80a,_0x12b7be){_0x23e80a=_0x23e80a-0x0;var _0x11b1df=_0x59b6[_0x23e80a];return _0x11b1df;};'use strict';var _=require(_0x659b('0x0'));var util=require(_0x659b('0x1'));var moment=require(_0x659b('0x2'));var BPromise=require(_0x659b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x659b('0x4'));var db=require(_0x659b('0x5'))['db'];var utils=require(_0x659b('0x6'));var logger=require(_0x659b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x659b('0x8'));var client=jayson[_0x659b('0x9')][_0x659b('0xa')]({'port':0x232a});config[_0x659b('0xb')]=_[_0x659b('0xc')](config[_0x659b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x659b('0xd'))(new Redis(config[_0x659b('0xb')]));require(_0x659b('0xe'))['register'](socket);function respondWithRpcPromise(_0xae37e1,_0x2a4e40,_0x125f37){return new BPromise(function(_0x456c12,_0x20ada9){return client['request'](_0xae37e1,_0x125f37)['then'](function(_0x181c8e){logger[_0x659b('0xf')](_0x659b('0x10'),_0x2a4e40,'request\x20sent');logger[_0x659b('0x11')]('Plugin,\x20%s,\x20%s,\x20%s',_0x2a4e40,_0x659b('0x12'),JSON[_0x659b('0x13')](_0x181c8e));if(_0x181c8e[_0x659b('0x14')]){if(_0x181c8e[_0x659b('0x14')][_0x659b('0x15')]===0x1f4){logger[_0x659b('0x14')](_0x659b('0x10'),_0x2a4e40,_0x181c8e['error']['message']);return _0x20ada9(_0x181c8e['error'][_0x659b('0x16')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x2a4e40,_0x181c8e[_0x659b('0x14')]['message']);return _0x456c12(_0x181c8e['error']['message']);}else{logger[_0x659b('0xf')](_0x659b('0x10'),_0x2a4e40,_0x659b('0x12'));_0x456c12(_0x181c8e['result'][_0x659b('0x16')]);}})[_0x659b('0x17')](function(_0xbce26e){logger[_0x659b('0x14')](_0x659b('0x10'),_0x2a4e40,_0xbce26e);_0x20ada9(_0xbce26e);});});}exports[_0x659b('0x18')]=function(_0x3f126a){var _0x4cc6b2=this;return new Promise(function(_0x398bee,_0x1c7fd2){return db['Plugin'][_0x659b('0x19')](_0x3f126a[_0x659b('0x1a')],{'raw':_0x3f126a[_0x659b('0x1b')]?_0x3f126a[_0x659b('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x410a29){logger['info'](_0x659b('0x18'),_0x3f126a);logger[_0x659b('0x11')](_0x659b('0x18'),_0x3f126a,JSON[_0x659b('0x13')](_0x410a29));_0x398bee(_0x410a29);})[_0x659b('0x17')](function(_0x45cf21){logger['error']('CreatePlugin',_0x45cf21[_0x659b('0x16')],_0x3f126a);_0x1c7fd2(_0x4cc6b2[_0x659b('0x14')](0x1f4,_0x45cf21[_0x659b('0x16')]));});});};
\ No newline at end of file
+var _0x8bc8=['socket.io-emitter','./plugin.socket','register','request','Plugin,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','CreatePlugin','create','body','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x199091,_0x38892e){var _0x409197=function(_0x15ea87){while(--_0x15ea87){_0x199091['push'](_0x199091['shift']());}};_0x409197(++_0x38892e);}(_0x8bc8,0x1c0));var _0x88bc=function(_0x324d77,_0x307ef7){_0x324d77=_0x324d77-0x0;var _0x2a77a7=_0x8bc8[_0x324d77];return _0x2a77a7;};'use strict';var _=require('lodash');var util=require(_0x88bc('0x0'));var moment=require(_0x88bc('0x1'));var BPromise=require(_0x88bc('0x2'));var rs=require(_0x88bc('0x3'));var fs=require('fs');var Redis=require(_0x88bc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x88bc('0x5'));var logger=require(_0x88bc('0x6'))(_0x88bc('0x7'));var config=require(_0x88bc('0x8'));var jayson=require(_0x88bc('0x9'));var client=jayson[_0x88bc('0xa')][_0x88bc('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x88bc('0xc')],{'host':_0x88bc('0xd'),'port':0x18eb});var socket=require(_0x88bc('0xe'))(new Redis(config['redis']));require(_0x88bc('0xf'))[_0x88bc('0x10')](socket);function respondWithRpcPromise(_0xbfa2af,_0x1ed625,_0x3fa726){return new BPromise(function(_0x2618a3,_0x45adf5){return client[_0x88bc('0x11')](_0xbfa2af,_0x3fa726)['then'](function(_0x65c809){logger['info'](_0x88bc('0x12'),_0x1ed625,'request\x20sent');logger[_0x88bc('0x13')]('Plugin,\x20%s,\x20%s,\x20%s',_0x1ed625,_0x88bc('0x14'),JSON[_0x88bc('0x15')](_0x65c809));if(_0x65c809[_0x88bc('0x16')]){if(_0x65c809[_0x88bc('0x16')][_0x88bc('0x17')]===0x1f4){logger['error'](_0x88bc('0x12'),_0x1ed625,_0x65c809[_0x88bc('0x16')][_0x88bc('0x18')]);return _0x45adf5(_0x65c809[_0x88bc('0x16')]['message']);}logger[_0x88bc('0x16')](_0x88bc('0x12'),_0x1ed625,_0x65c809[_0x88bc('0x16')][_0x88bc('0x18')]);return _0x2618a3(_0x65c809[_0x88bc('0x16')]['message']);}else{logger[_0x88bc('0x19')](_0x88bc('0x12'),_0x1ed625,'request\x20sent');_0x2618a3(_0x65c809[_0x88bc('0x1a')][_0x88bc('0x18')]);}})['catch'](function(_0x22185b){logger[_0x88bc('0x16')](_0x88bc('0x12'),_0x1ed625,_0x22185b);_0x45adf5(_0x22185b);});});}exports[_0x88bc('0x1b')]=function(_0x51746d){var _0x325599=this;return new Promise(function(_0x44035f,_0x515662){return db['Plugin'][_0x88bc('0x1c')](_0x51746d[_0x88bc('0x1d')],{'raw':_0x51746d['options']?_0x51746d[_0x88bc('0x1e')][_0x88bc('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x24c4e4){logger[_0x88bc('0x19')](_0x88bc('0x1b'),_0x51746d);logger['debug'](_0x88bc('0x1b'),_0x51746d,JSON[_0x88bc('0x15')](_0x24c4e4));_0x44035f(_0x24c4e4);})[_0x88bc('0x20')](function(_0x24899c){logger[_0x88bc('0x16')](_0x88bc('0x1b'),_0x24899c[_0x88bc('0x18')],_0x51746d);_0x515662(_0x325599['error'](0x1f4,_0x24899c[_0x88bc('0x18')]));});});};
\ No newline at end of file