Built motion from commit 37e1ed56.|2.6.29
[motion2.git] / server / api / plugin / plugin.rpc.js
index 570e401..8bab327 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbad9=['http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','stringify','error','code','Plugin,\x20%s,\x20%s','message','catch','CreatePlugin','Plugin','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xbad9,0x119));var _0x9bad=function(_0x679d6a,_0x5aa7a4){_0x679d6a=_0x679d6a-0x0;var _0x278b98=_0xbad9[_0x679d6a];return _0x278b98;};'use strict';var _=require('lodash');var util=require(_0x9bad('0x0'));var moment=require(_0x9bad('0x1'));var BPromise=require(_0x9bad('0x2'));var rs=require(_0x9bad('0x3'));var fs=require('fs');var Redis=require(_0x9bad('0x4'));var db=require(_0x9bad('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9bad('0x6'))('rpc');var config=require(_0x9bad('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9bad('0x8')][_0x9bad('0x9')]({'port':0x232a});config[_0x9bad('0xa')]=_[_0x9bad('0xb')](config[_0x9bad('0xa')],{'host':_0x9bad('0xc'),'port':0x18eb});var socket=require(_0x9bad('0xd'))(new Redis(config[_0x9bad('0xa')]));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x100abb,_0x45d36b,_0x25b29f){return new BPromise(function(_0x202b10,_0x5f9a39){return client[_0x9bad('0xe')](_0x100abb,_0x25b29f)[_0x9bad('0xf')](function(_0x7af6eb){logger[_0x9bad('0x10')]('Plugin,\x20%s,\x20%s',_0x45d36b,_0x9bad('0x11'));logger[_0x9bad('0x12')]('Plugin,\x20%s,\x20%s,\x20%s',_0x45d36b,'request\x20sent',JSON[_0x9bad('0x13')](_0x7af6eb));if(_0x7af6eb[_0x9bad('0x14')]){if(_0x7af6eb[_0x9bad('0x14')][_0x9bad('0x15')]===0x1f4){logger[_0x9bad('0x14')](_0x9bad('0x16'),_0x45d36b,_0x7af6eb[_0x9bad('0x14')][_0x9bad('0x17')]);return _0x5f9a39(_0x7af6eb[_0x9bad('0x14')][_0x9bad('0x17')]);}logger[_0x9bad('0x14')]('Plugin,\x20%s,\x20%s',_0x45d36b,_0x7af6eb['error'][_0x9bad('0x17')]);return _0x202b10(_0x7af6eb[_0x9bad('0x14')]['message']);}else{logger[_0x9bad('0x10')](_0x9bad('0x16'),_0x45d36b,'request\x20sent');_0x202b10(_0x7af6eb['result'][_0x9bad('0x17')]);}})[_0x9bad('0x18')](function(_0x54044f){logger[_0x9bad('0x14')](_0x9bad('0x16'),_0x45d36b,_0x54044f);_0x5f9a39(_0x54044f);});});}exports[_0x9bad('0x19')]=function(_0x3f1788){var _0x4cb0d0=this;return new Promise(function(_0x1f3ba3,_0x3fb3b9){return db[_0x9bad('0x1a')]['create'](_0x3f1788['body'],{'raw':_0x3f1788[_0x9bad('0x1b')]?_0x3f1788[_0x9bad('0x1b')][_0x9bad('0x1c')]===undefined?!![]:![]:!![]})[_0x9bad('0xf')](function(_0x179486){logger['info'](_0x9bad('0x19'),_0x3f1788);logger[_0x9bad('0x12')](_0x9bad('0x19'),_0x3f1788,JSON[_0x9bad('0x13')](_0x179486));_0x1f3ba3(_0x179486);})['catch'](function(_0x1d5a8a){logger['error'](_0x9bad('0x19'),_0x1d5a8a[_0x9bad('0x17')],_0x3f1788);_0x3fb3b9(_0x4cb0d0[_0x9bad('0x14')](0x1f4,_0x1d5a8a['message']));});});};
\ No newline at end of file
+var _0x2504=['localhost','socket.io-emitter','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreatePlugin','create','options','raw','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x2d4331,_0x4b5829){var _0x55711d=function(_0x9b8727){while(--_0x9b8727){_0x2d4331['push'](_0x2d4331['shift']());}};_0x55711d(++_0x4b5829);}(_0x2504,0x1f1));var _0x4250=function(_0x560475,_0x3e1200){_0x560475=_0x560475-0x0;var _0x629d7d=_0x2504[_0x560475];return _0x629d7d;};'use strict';var _=require('lodash');var util=require(_0x4250('0x0'));var moment=require(_0x4250('0x1'));var BPromise=require(_0x4250('0x2'));var rs=require(_0x4250('0x3'));var fs=require('fs');var Redis=require(_0x4250('0x4'));var db=require(_0x4250('0x5'))['db'];var utils=require(_0x4250('0x6'));var logger=require(_0x4250('0x7'))(_0x4250('0x8'));var config=require(_0x4250('0x9'));var jayson=require(_0x4250('0xa'));var client=jayson[_0x4250('0xb')][_0x4250('0xc')]({'port':0x232a});config[_0x4250('0xd')]=_[_0x4250('0xe')](config[_0x4250('0xd')],{'host':_0x4250('0xf'),'port':0x18eb});var socket=require(_0x4250('0x10'))(new Redis(config[_0x4250('0xd')]));require('./plugin.socket')[_0x4250('0x11')](socket);function respondWithRpcPromise(_0x5cd4d5,_0x552329,_0x4c5d1f){return new BPromise(function(_0x4823ec,_0x9ae560){return client['request'](_0x5cd4d5,_0x4c5d1f)[_0x4250('0x12')](function(_0x2a7b2f){logger[_0x4250('0x13')](_0x4250('0x14'),_0x552329,_0x4250('0x15'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x552329,_0x4250('0x15'),JSON['stringify'](_0x2a7b2f));if(_0x2a7b2f[_0x4250('0x16')]){if(_0x2a7b2f['error'][_0x4250('0x17')]===0x1f4){logger[_0x4250('0x16')](_0x4250('0x14'),_0x552329,_0x2a7b2f[_0x4250('0x16')]['message']);return _0x9ae560(_0x2a7b2f[_0x4250('0x16')][_0x4250('0x18')]);}logger[_0x4250('0x16')]('Plugin,\x20%s,\x20%s',_0x552329,_0x2a7b2f[_0x4250('0x16')]['message']);return _0x4823ec(_0x2a7b2f[_0x4250('0x16')][_0x4250('0x18')]);}else{logger['info'](_0x4250('0x14'),_0x552329,_0x4250('0x15'));_0x4823ec(_0x2a7b2f[_0x4250('0x19')][_0x4250('0x18')]);}})[_0x4250('0x1a')](function(_0x86509c){logger['error'](_0x4250('0x14'),_0x552329,_0x86509c);_0x9ae560(_0x86509c);});});}exports[_0x4250('0x1b')]=function(_0x50c5bd){var _0x25b0f2=this;return new Promise(function(_0xf394b9,_0x151ac7){return db['Plugin'][_0x4250('0x1c')](_0x50c5bd['body'],{'raw':_0x50c5bd['options']?_0x50c5bd[_0x4250('0x1d')][_0x4250('0x1e')]===undefined?!![]:![]:!![]})[_0x4250('0x12')](function(_0x3f84fd){logger[_0x4250('0x13')](_0x4250('0x1b'),_0x50c5bd);logger[_0x4250('0x1f')]('CreatePlugin',_0x50c5bd,JSON['stringify'](_0x3f84fd));_0xf394b9(_0x3f84fd);})[_0x4250('0x1a')](function(_0x112b9b){logger[_0x4250('0x16')]('CreatePlugin',_0x112b9b[_0x4250('0x18')],_0x50c5bd);_0x151ac7(_0x25b0f2['error'](0x1f4,_0x112b9b[_0x4250('0x18')]));});});};
\ No newline at end of file