Built motion from commit 092f8824.|2.5.49
[motion2.git] / server / api / variable / variable.rpc.js
index 2dd512e..ea5d447 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17e4=['http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','attributes','map','include','model','debug','stringify','lodash','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise'];(function(_0x59ab6e,_0x493ff4){var _0x13994a=function(_0x59fc7a){while(--_0x59fc7a){_0x59ab6e['push'](_0x59ab6e['shift']());}};_0x13994a(++_0x493ff4);}(_0x17e4,0x1b4));var _0x417e=function(_0x52264e,_0x5b9432){_0x52264e=_0x52264e-0x0;var _0x12d8fc=_0x17e4[_0x52264e];return _0x12d8fc;};'use strict';var _=require(_0x417e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x417e('0x1'));var rs=require(_0x417e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x417e('0x3'))('rpc');var config=require(_0x417e('0x4'));var jayson=require(_0x417e('0x5'));var client=jayson['client'][_0x417e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2d838c,_0x248728,_0x49598c){return new BPromise(function(_0x277fd8,_0xda9013){return client[_0x417e('0x7')](_0x2d838c,_0x49598c)[_0x417e('0x8')](function(_0x3efe6a){logger[_0x417e('0x9')](_0x417e('0xa'),_0x248728,_0x417e('0xb'));logger['debug'](_0x417e('0xc'),_0x248728,_0x417e('0xb'),JSON['stringify'](_0x3efe6a));if(_0x3efe6a['error']){if(_0x3efe6a[_0x417e('0xd')][_0x417e('0xe')]===0x1f4){logger[_0x417e('0xd')](_0x417e('0xa'),_0x248728,_0x3efe6a[_0x417e('0xd')][_0x417e('0xf')]);return _0xda9013(_0x3efe6a['error'][_0x417e('0xf')]);}logger[_0x417e('0xd')]('Variable,\x20%s,\x20%s',_0x248728,_0x3efe6a[_0x417e('0xd')][_0x417e('0xf')]);return _0x277fd8(_0x3efe6a['error'][_0x417e('0xf')]);}else{logger['info'](_0x417e('0xa'),_0x248728,'request\x20sent');_0x277fd8(_0x3efe6a[_0x417e('0x10')][_0x417e('0xf')]);}})[_0x417e('0x11')](function(_0xa7dbb4){logger[_0x417e('0xd')]('Variable,\x20%s,\x20%s',_0x248728,_0xa7dbb4);_0xda9013(_0xa7dbb4);});});}exports[_0x417e('0x12')]=function(_0x52b028){var _0x41c4a3=this;return new Promise(function(_0x3c4705,_0x398a33){return db['Variable']['find']({'raw':_0x52b028[_0x417e('0x13')]?_0x52b028['options']['raw']===undefined?!![]:![]:!![],'where':_0x52b028[_0x417e('0x13')]?_0x52b028[_0x417e('0x13')]['where']||null:null,'attributes':_0x52b028[_0x417e('0x13')]?_0x52b028['options'][_0x417e('0x14')]||null:null,'include':_0x52b028['options']?_0x52b028[_0x417e('0x13')]['include']?_[_0x417e('0x15')](_0x52b028['options'][_0x417e('0x16')],function(_0x83a954){return{'model':db[_0x83a954[_0x417e('0x17')]],'as':_0x83a954['as'],'attributes':_0x83a954['attributes'],'include':_0x83a954[_0x417e('0x16')]?_['map'](_0x83a954['include'],function(_0x3512d0){return{'model':db[_0x3512d0[_0x417e('0x17')]],'as':_0x3512d0['as'],'attributes':_0x3512d0[_0x417e('0x14')],'include':_0x3512d0['include']?_['map'](_0x3512d0[_0x417e('0x16')],function(_0x90645a){return{'model':db[_0x90645a[_0x417e('0x17')]],'as':_0x90645a['as'],'attributes':_0x90645a['attributes']};}):[]};}):[]};}):[]:[]})[_0x417e('0x8')](function(_0x484800){logger[_0x417e('0x9')](_0x417e('0x12'),_0x52b028);logger[_0x417e('0x18')]('ShowVariable',_0x52b028,JSON[_0x417e('0x19')](_0x484800));_0x3c4705(_0x484800);})[_0x417e('0x11')](function(_0x51bbef){logger[_0x417e('0xd')]('ShowVariable',_0x51bbef[_0x417e('0xf')],_0x52b028);_0x398a33(_0x41c4a3[_0x417e('0xd')](0x1f4,_0x51bbef[_0x417e('0xf')]));});});};
\ No newline at end of file
+var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x33e9ca,_0x50b4f8){var _0x45cfcc=function(_0x3be367){while(--_0x3be367){_0x33e9ca['push'](_0x33e9ca['shift']());}};_0x45cfcc(++_0x50b4f8);}(_0x6aa7,0x178));var _0x76aa=function(_0x5e12f9,_0x4fa29f){_0x5e12f9=_0x5e12f9-0x0;var _0x1d386c=_0x6aa7[_0x5e12f9];return _0x1d386c;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});};
\ No newline at end of file