Built motion from commit (unavailable).|2.2.4
[motion2.git] / server / api / variable / variable.rpc.js
index 3746ef5..1940dae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2711=['then','Variable,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','ShowVariable','Variable','find','options','raw','where','attributes','include','map','model','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0x2711,0x6b));var _0x1271=function(_0x5e84a5,_0x33b638){_0x5e84a5=_0x5e84a5-0x0;var _0xb3a0e5=_0x2711[_0x5e84a5];return _0xb3a0e5;};'use strict';var _=require(_0x1271('0x0'));var util=require(_0x1271('0x1'));var moment=require(_0x1271('0x2'));var BPromise=require('bluebird');var rs=require(_0x1271('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1271('0x4'));var logger=require(_0x1271('0x5'))(_0x1271('0x6'));var config=require(_0x1271('0x7'));var jayson=require(_0x1271('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59902b,_0xd58acb,_0x53109d){return new BPromise(function(_0x149d78,_0x210251){return client['request'](_0x59902b,_0x53109d)[_0x1271('0x9')](function(_0x2f7dd2){logger['info'](_0x1271('0xa'),_0xd58acb,_0x1271('0xb'));logger[_0x1271('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0xd58acb,_0x1271('0xb'),JSON[_0x1271('0xd')](_0x2f7dd2));if(_0x2f7dd2[_0x1271('0xe')]){if(_0x2f7dd2['error'][_0x1271('0xf')]===0x1f4){logger[_0x1271('0xe')](_0x1271('0xa'),_0xd58acb,_0x2f7dd2[_0x1271('0xe')][_0x1271('0x10')]);return _0x210251(_0x2f7dd2['error'][_0x1271('0x10')]);}logger['error'](_0x1271('0xa'),_0xd58acb,_0x2f7dd2[_0x1271('0xe')][_0x1271('0x10')]);return _0x149d78(_0x2f7dd2[_0x1271('0xe')][_0x1271('0x10')]);}else{logger[_0x1271('0x11')]('Variable,\x20%s,\x20%s',_0xd58acb,_0x1271('0xb'));_0x149d78(_0x2f7dd2['result'][_0x1271('0x10')]);}})[_0x1271('0x12')](function(_0x4f7a53){logger[_0x1271('0xe')](_0x1271('0xa'),_0xd58acb,_0x4f7a53);_0x210251(_0x4f7a53);});});}exports[_0x1271('0x13')]=function(_0x5f4951){var _0x26e3d3=this;return new Promise(function(_0x21b4ca,_0x40a6e5){return db[_0x1271('0x14')][_0x1271('0x15')]({'raw':_0x5f4951['options']?_0x5f4951[_0x1271('0x16')][_0x1271('0x17')]===undefined?!![]:![]:!![],'where':_0x5f4951[_0x1271('0x16')]?_0x5f4951[_0x1271('0x16')][_0x1271('0x18')]||null:null,'attributes':_0x5f4951[_0x1271('0x16')]?_0x5f4951['options'][_0x1271('0x19')]||null:null,'include':_0x5f4951[_0x1271('0x16')]?_0x5f4951[_0x1271('0x16')][_0x1271('0x1a')]?_[_0x1271('0x1b')](_0x5f4951[_0x1271('0x16')][_0x1271('0x1a')],function(_0x3c9af8){return{'model':db[_0x3c9af8[_0x1271('0x1c')]],'as':_0x3c9af8['as'],'attributes':_0x3c9af8[_0x1271('0x19')],'include':_0x3c9af8[_0x1271('0x1a')]?_[_0x1271('0x1b')](_0x3c9af8['include'],function(_0x4deb57){return{'model':db[_0x4deb57[_0x1271('0x1c')]],'as':_0x4deb57['as'],'attributes':_0x4deb57[_0x1271('0x19')],'include':_0x4deb57[_0x1271('0x1a')]?_[_0x1271('0x1b')](_0x4deb57['include'],function(_0x275bca){return{'model':db[_0x275bca['model']],'as':_0x275bca['as'],'attributes':_0x275bca[_0x1271('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1271('0x9')](function(_0x4495b1){logger[_0x1271('0x11')]('ShowVariable',_0x5f4951);logger[_0x1271('0xc')](_0x1271('0x13'),_0x5f4951,JSON[_0x1271('0xd')](_0x4495b1));_0x21b4ca(_0x4495b1);})[_0x1271('0x12')](function(_0x17daec){logger['error'](_0x1271('0x13'),_0x17daec['message'],_0x5f4951);_0x40a6e5(_0x26e3d3[_0x1271('0xe')](0x1f4,_0x17daec[_0x1271('0x10')]));});});};
\ No newline at end of file
+var _0x4461=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','include','model','map','lodash','util','moment'];(function(_0x369610,_0x2d0639){var _0x57bf5f=function(_0x5a15b9){while(--_0x5a15b9){_0x369610['push'](_0x369610['shift']());}};_0x57bf5f(++_0x2d0639);}(_0x4461,0x19d));var _0x1446=function(_0x565270,_0x15bb29){_0x565270=_0x565270-0x0;var _0x597b30=_0x4461[_0x565270];return _0x597b30;};'use strict';var _=require(_0x1446('0x0'));var util=require(_0x1446('0x1'));var moment=require(_0x1446('0x2'));var BPromise=require(_0x1446('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1446('0x4'));var db=require(_0x1446('0x5'))['db'];var utils=require(_0x1446('0x6'));var logger=require('../../config/logger')(_0x1446('0x7'));var config=require('../../config/environment');var jayson=require(_0x1446('0x8'));var client=jayson['client'][_0x1446('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x409c03,_0x135858,_0x5e2aa1){return new BPromise(function(_0x11e66d,_0x350481){return client['request'](_0x409c03,_0x5e2aa1)[_0x1446('0xa')](function(_0x30bfe9){logger[_0x1446('0xb')](_0x1446('0xc'),_0x135858,_0x1446('0xd'));logger[_0x1446('0xe')](_0x1446('0xf'),_0x135858,_0x1446('0xd'),JSON[_0x1446('0x10')](_0x30bfe9));if(_0x30bfe9[_0x1446('0x11')]){if(_0x30bfe9[_0x1446('0x11')][_0x1446('0x12')]===0x1f4){logger[_0x1446('0x11')](_0x1446('0xc'),_0x135858,_0x30bfe9[_0x1446('0x11')]['message']);return _0x350481(_0x30bfe9[_0x1446('0x11')][_0x1446('0x13')]);}logger[_0x1446('0x11')](_0x1446('0xc'),_0x135858,_0x30bfe9[_0x1446('0x11')][_0x1446('0x13')]);return _0x11e66d(_0x30bfe9[_0x1446('0x11')][_0x1446('0x13')]);}else{logger[_0x1446('0xb')]('Variable,\x20%s,\x20%s',_0x135858,_0x1446('0xd'));_0x11e66d(_0x30bfe9[_0x1446('0x14')][_0x1446('0x13')]);}})[_0x1446('0x15')](function(_0x51ab74){logger[_0x1446('0x11')](_0x1446('0xc'),_0x135858,_0x51ab74);_0x350481(_0x51ab74);});});}exports[_0x1446('0x16')]=function(_0x5852f6){var _0x19998c=this;return new Promise(function(_0x4c94ae,_0x15edc5){return db[_0x1446('0x17')][_0x1446('0x18')]({'raw':_0x5852f6['options']?_0x5852f6[_0x1446('0x19')][_0x1446('0x1a')]===undefined?!![]:![]:!![],'where':_0x5852f6[_0x1446('0x19')]?_0x5852f6[_0x1446('0x19')][_0x1446('0x1b')]||null:null,'attributes':_0x5852f6[_0x1446('0x19')]?_0x5852f6[_0x1446('0x19')][_0x1446('0x1c')]||null:null,'include':_0x5852f6[_0x1446('0x19')]?_0x5852f6[_0x1446('0x19')][_0x1446('0x1d')]?_['map'](_0x5852f6[_0x1446('0x19')][_0x1446('0x1d')],function(_0x3d33db){return{'model':db[_0x3d33db[_0x1446('0x1e')]],'as':_0x3d33db['as'],'attributes':_0x3d33db[_0x1446('0x1c')],'include':_0x3d33db[_0x1446('0x1d')]?_[_0x1446('0x1f')](_0x3d33db[_0x1446('0x1d')],function(_0x46788e){return{'model':db[_0x46788e[_0x1446('0x1e')]],'as':_0x46788e['as'],'attributes':_0x46788e[_0x1446('0x1c')],'include':_0x46788e[_0x1446('0x1d')]?_[_0x1446('0x1f')](_0x46788e[_0x1446('0x1d')],function(_0x133294){return{'model':db[_0x133294['model']],'as':_0x133294['as'],'attributes':_0x133294[_0x1446('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1446('0xa')](function(_0x386fc7){logger[_0x1446('0xb')]('ShowVariable',_0x5852f6);logger[_0x1446('0xe')](_0x1446('0x16'),_0x5852f6,JSON[_0x1446('0x10')](_0x386fc7));_0x4c94ae(_0x386fc7);})[_0x1446('0x15')](function(_0x444196){logger[_0x1446('0x11')]('ShowVariable',_0x444196[_0x1446('0x13')],_0x5852f6);_0x15edc5(_0x19998c[_0x1446('0x11')](0x1f4,_0x444196['message']));});});};
\ No newline at end of file