Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / variable / variable.rpc.js
index 7e67c0b..4f4788f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf81f=['options','raw','where','attributes','include','model','map','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowVariable','Variable'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf81f,0x128));var _0xff81=function(_0x15aec1,_0x527e84){_0x15aec1=_0x15aec1-0x0;var _0x37a89d=_0xf81f[_0x15aec1];return _0x37a89d;};'use strict';var _=require('lodash');var util=require(_0xff81('0x0'));var moment=require(_0xff81('0x1'));var BPromise=require(_0xff81('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff81('0x3'));var db=require(_0xff81('0x4'))['db'];var utils=require(_0xff81('0x5'));var logger=require(_0xff81('0x6'))(_0xff81('0x7'));var config=require(_0xff81('0x8'));var jayson=require(_0xff81('0x9'));var client=jayson[_0xff81('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d4090,_0x42ea89,_0x5763a7){return new BPromise(function(_0x31f2cc,_0x30738f){return client[_0xff81('0xb')](_0x1d4090,_0x5763a7)[_0xff81('0xc')](function(_0x482ef3){logger[_0xff81('0xd')](_0xff81('0xe'),_0x42ea89,'request\x20sent');logger[_0xff81('0xf')](_0xff81('0x10'),_0x42ea89,_0xff81('0x11'),JSON[_0xff81('0x12')](_0x482ef3));if(_0x482ef3[_0xff81('0x13')]){if(_0x482ef3['error']['code']===0x1f4){logger[_0xff81('0x13')]('Variable,\x20%s,\x20%s',_0x42ea89,_0x482ef3[_0xff81('0x13')][_0xff81('0x14')]);return _0x30738f(_0x482ef3[_0xff81('0x13')][_0xff81('0x14')]);}logger[_0xff81('0x13')](_0xff81('0xe'),_0x42ea89,_0x482ef3['error'][_0xff81('0x14')]);return _0x31f2cc(_0x482ef3[_0xff81('0x13')][_0xff81('0x14')]);}else{logger[_0xff81('0xd')]('Variable,\x20%s,\x20%s',_0x42ea89,_0xff81('0x11'));_0x31f2cc(_0x482ef3[_0xff81('0x15')][_0xff81('0x14')]);}})['catch'](function(_0x2e9e6f){logger[_0xff81('0x13')]('Variable,\x20%s,\x20%s',_0x42ea89,_0x2e9e6f);_0x30738f(_0x2e9e6f);});});}exports[_0xff81('0x16')]=function(_0x39ffdd){var _0x39e54a=this;return new Promise(function(_0x39e4a2,_0x1a6968){return db[_0xff81('0x17')]['find']({'raw':_0x39ffdd[_0xff81('0x18')]?_0x39ffdd[_0xff81('0x18')][_0xff81('0x19')]===undefined?!![]:![]:!![],'where':_0x39ffdd[_0xff81('0x18')]?_0x39ffdd[_0xff81('0x18')][_0xff81('0x1a')]||null:null,'attributes':_0x39ffdd['options']?_0x39ffdd[_0xff81('0x18')][_0xff81('0x1b')]||null:null,'include':_0x39ffdd[_0xff81('0x18')]?_0x39ffdd['options'][_0xff81('0x1c')]?_['map'](_0x39ffdd[_0xff81('0x18')][_0xff81('0x1c')],function(_0x1e48d7){return{'model':db[_0x1e48d7[_0xff81('0x1d')]],'as':_0x1e48d7['as'],'attributes':_0x1e48d7['attributes'],'include':_0x1e48d7[_0xff81('0x1c')]?_[_0xff81('0x1e')](_0x1e48d7[_0xff81('0x1c')],function(_0x114b74){return{'model':db[_0x114b74[_0xff81('0x1d')]],'as':_0x114b74['as'],'attributes':_0x114b74[_0xff81('0x1b')],'include':_0x114b74[_0xff81('0x1c')]?_['map'](_0x114b74[_0xff81('0x1c')],function(_0xc45fc0){return{'model':db[_0xc45fc0[_0xff81('0x1d')]],'as':_0xc45fc0['as'],'attributes':_0xc45fc0[_0xff81('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x135600){logger[_0xff81('0xd')](_0xff81('0x16'),_0x39ffdd);logger['debug'](_0xff81('0x16'),_0x39ffdd,JSON[_0xff81('0x12')](_0x135600));_0x39e4a2(_0x135600);})[_0xff81('0x1f')](function(_0x5a6c10){logger[_0xff81('0x13')](_0xff81('0x16'),_0x5a6c10[_0xff81('0x14')],_0x39ffdd);_0x1a6968(_0x39e54a['error'](0x1f4,_0x5a6c10[_0xff81('0x14')]));});});};
\ No newline at end of file
+var _0x9475=['result','ShowVariable','Variable','options','raw','where','attributes','include','map','model','then','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Variable,\x20%s,\x20%s'];(function(_0x39887a,_0x5835ca){var _0x1f8468=function(_0x43032f){while(--_0x43032f){_0x39887a['push'](_0x39887a['shift']());}};_0x1f8468(++_0x5835ca);}(_0x9475,0x1da));var _0x5947=function(_0x515c6f,_0x27d76f){_0x515c6f=_0x515c6f-0x0;var _0x5b5fa0=_0x9475[_0x515c6f];return _0x5b5fa0;};'use strict';var _=require(_0x5947('0x0'));var util=require(_0x5947('0x1'));var moment=require(_0x5947('0x2'));var BPromise=require('bluebird');var rs=require(_0x5947('0x3'));var fs=require('fs');var Redis=require(_0x5947('0x4'));var db=require(_0x5947('0x5'))['db'];var utils=require(_0x5947('0x6'));var logger=require('../../config/logger')(_0x5947('0x7'));var config=require(_0x5947('0x8'));var jayson=require(_0x5947('0x9'));var client=jayson[_0x5947('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a6762,_0x4deee3,_0x3d6677){return new BPromise(function(_0x3d3121,_0x47cbbc){return client[_0x5947('0xb')](_0x5a6762,_0x3d6677)['then'](function(_0x1a5b1d){logger[_0x5947('0xc')]('Variable,\x20%s,\x20%s',_0x4deee3,'request\x20sent');logger[_0x5947('0xd')](_0x5947('0xe'),_0x4deee3,_0x5947('0xf'),JSON[_0x5947('0x10')](_0x1a5b1d));if(_0x1a5b1d[_0x5947('0x11')]){if(_0x1a5b1d[_0x5947('0x11')][_0x5947('0x12')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x4deee3,_0x1a5b1d[_0x5947('0x11')][_0x5947('0x13')]);return _0x47cbbc(_0x1a5b1d[_0x5947('0x11')][_0x5947('0x13')]);}logger['error'](_0x5947('0x14'),_0x4deee3,_0x1a5b1d[_0x5947('0x11')][_0x5947('0x13')]);return _0x3d3121(_0x1a5b1d[_0x5947('0x11')][_0x5947('0x13')]);}else{logger[_0x5947('0xc')](_0x5947('0x14'),_0x4deee3,'request\x20sent');_0x3d3121(_0x1a5b1d[_0x5947('0x15')]['message']);}})['catch'](function(_0x1adf35){logger[_0x5947('0x11')](_0x5947('0x14'),_0x4deee3,_0x1adf35);_0x47cbbc(_0x1adf35);});});}exports[_0x5947('0x16')]=function(_0x558f59){var _0x4568fe=this;return new Promise(function(_0x52e489,_0x17522b){return db[_0x5947('0x17')]['find']({'raw':_0x558f59[_0x5947('0x18')]?_0x558f59[_0x5947('0x18')][_0x5947('0x19')]===undefined?!![]:![]:!![],'where':_0x558f59[_0x5947('0x18')]?_0x558f59[_0x5947('0x18')][_0x5947('0x1a')]||null:null,'attributes':_0x558f59['options']?_0x558f59['options'][_0x5947('0x1b')]||null:null,'include':_0x558f59[_0x5947('0x18')]?_0x558f59['options'][_0x5947('0x1c')]?_[_0x5947('0x1d')](_0x558f59['options'][_0x5947('0x1c')],function(_0x42a13e){return{'model':db[_0x42a13e[_0x5947('0x1e')]],'as':_0x42a13e['as'],'attributes':_0x42a13e['attributes'],'include':_0x42a13e['include']?_['map'](_0x42a13e['include'],function(_0x15f926){return{'model':db[_0x15f926[_0x5947('0x1e')]],'as':_0x15f926['as'],'attributes':_0x15f926['attributes'],'include':_0x15f926[_0x5947('0x1c')]?_[_0x5947('0x1d')](_0x15f926[_0x5947('0x1c')],function(_0x349694){return{'model':db[_0x349694[_0x5947('0x1e')]],'as':_0x349694['as'],'attributes':_0x349694[_0x5947('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5947('0x1f')](function(_0x487334){logger[_0x5947('0xc')](_0x5947('0x16'),_0x558f59);logger[_0x5947('0xd')](_0x5947('0x16'),_0x558f59,JSON[_0x5947('0x10')](_0x487334));_0x52e489(_0x487334);})[_0x5947('0x20')](function(_0x477b09){logger['error'](_0x5947('0x16'),_0x477b09['message'],_0x558f59);_0x17522b(_0x4568fe[_0x5947('0x11')](0x1f4,_0x477b09[_0x5947('0x13')]));});});};
\ No newline at end of file