Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / variable / variable.rpc.js
index 0309500..88f851f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82a1=['raw','include','map','model','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowVariable','Variable','options'];(function(_0x288ff8,_0x15d6d6){var _0x5c5b9d=function(_0x4e7e40){while(--_0x4e7e40){_0x288ff8['push'](_0x288ff8['shift']());}};_0x5c5b9d(++_0x15d6d6);}(_0x82a1,0x81));var _0x182a=function(_0x3a5db7,_0x47c35a){_0x3a5db7=_0x3a5db7-0x0;var _0x5aa8c9=_0x82a1[_0x3a5db7];return _0x5aa8c9;};'use strict';var _=require('lodash');var util=require(_0x182a('0x0'));var moment=require(_0x182a('0x1'));var BPromise=require(_0x182a('0x2'));var rs=require(_0x182a('0x3'));var fs=require('fs');var Redis=require(_0x182a('0x4'));var db=require(_0x182a('0x5'))['db'];var utils=require(_0x182a('0x6'));var logger=require(_0x182a('0x7'))(_0x182a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x182a('0x9')][_0x182a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x274a0c,_0x46b8e5,_0x38152d){return new BPromise(function(_0x5bff89,_0x35e945){return client['request'](_0x274a0c,_0x38152d)[_0x182a('0xb')](function(_0x54bc5d){logger[_0x182a('0xc')](_0x182a('0xd'),_0x46b8e5,'request\x20sent');logger[_0x182a('0xe')](_0x182a('0xf'),_0x46b8e5,_0x182a('0x10'),JSON[_0x182a('0x11')](_0x54bc5d));if(_0x54bc5d[_0x182a('0x12')]){if(_0x54bc5d['error'][_0x182a('0x13')]===0x1f4){logger[_0x182a('0x12')](_0x182a('0xd'),_0x46b8e5,_0x54bc5d[_0x182a('0x12')]['message']);return _0x35e945(_0x54bc5d[_0x182a('0x12')][_0x182a('0x14')]);}logger[_0x182a('0x12')](_0x182a('0xd'),_0x46b8e5,_0x54bc5d['error']['message']);return _0x5bff89(_0x54bc5d['error'][_0x182a('0x14')]);}else{logger[_0x182a('0xc')](_0x182a('0xd'),_0x46b8e5,_0x182a('0x10'));_0x5bff89(_0x54bc5d[_0x182a('0x15')][_0x182a('0x14')]);}})[_0x182a('0x16')](function(_0x29b307){logger[_0x182a('0x12')]('Variable,\x20%s,\x20%s',_0x46b8e5,_0x29b307);_0x35e945(_0x29b307);});});}exports[_0x182a('0x17')]=function(_0x23e191){var _0x3d90e9=this;return new Promise(function(_0x36a120,_0x3c8e8a){return db[_0x182a('0x18')]['find']({'raw':_0x23e191[_0x182a('0x19')]?_0x23e191['options'][_0x182a('0x1a')]===undefined?!![]:![]:!![],'where':_0x23e191['options']?_0x23e191['options']['where']||null:null,'attributes':_0x23e191[_0x182a('0x19')]?_0x23e191['options']['attributes']||null:null,'include':_0x23e191[_0x182a('0x19')]?_0x23e191['options'][_0x182a('0x1b')]?_[_0x182a('0x1c')](_0x23e191['options'][_0x182a('0x1b')],function(_0x257c59){return{'model':db[_0x257c59[_0x182a('0x1d')]],'as':_0x257c59['as'],'attributes':_0x257c59[_0x182a('0x1e')],'include':_0x257c59[_0x182a('0x1b')]?_['map'](_0x257c59[_0x182a('0x1b')],function(_0x1c3004){return{'model':db[_0x1c3004[_0x182a('0x1d')]],'as':_0x1c3004['as'],'attributes':_0x1c3004[_0x182a('0x1e')],'include':_0x1c3004[_0x182a('0x1b')]?_[_0x182a('0x1c')](_0x1c3004[_0x182a('0x1b')],function(_0x40b0c7){return{'model':db[_0x40b0c7[_0x182a('0x1d')]],'as':_0x40b0c7['as'],'attributes':_0x40b0c7['attributes']};}):[]};}):[]};}):[]:[]})[_0x182a('0xb')](function(_0x314d0d){logger[_0x182a('0xc')](_0x182a('0x17'),_0x23e191);logger[_0x182a('0xe')](_0x182a('0x17'),_0x23e191,JSON[_0x182a('0x11')](_0x314d0d));_0x36a120(_0x314d0d);})[_0x182a('0x16')](function(_0x342418){logger[_0x182a('0x12')]('ShowVariable',_0x342418[_0x182a('0x14')],_0x23e191);_0x3c8e8a(_0x3d90e9[_0x182a('0x12')](0x1f4,_0x342418['message']));});});};
\ No newline at end of file
+var _0x6de4=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','Variable','find','options','where','attributes','map','include','model','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x10a109,_0x32ef1c){var _0x10e632=function(_0x31f3ee){while(--_0x31f3ee){_0x10a109['push'](_0x10a109['shift']());}};_0x10e632(++_0x32ef1c);}(_0x6de4,0x9e));var _0x46de=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x6de4[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x46de('0x0'));var util=require(_0x46de('0x1'));var moment=require(_0x46de('0x2'));var BPromise=require(_0x46de('0x3'));var rs=require(_0x46de('0x4'));var fs=require('fs');var Redis=require(_0x46de('0x5'));var db=require(_0x46de('0x6'))['db'];var utils=require(_0x46de('0x7'));var logger=require(_0x46de('0x8'))(_0x46de('0x9'));var config=require(_0x46de('0xa'));var jayson=require(_0x46de('0xb'));var client=jayson[_0x46de('0xc')][_0x46de('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x40f6c1,_0x518381,_0x5dcd71){return new BPromise(function(_0x35040b,_0x1134f1){return client[_0x46de('0xe')](_0x40f6c1,_0x5dcd71)[_0x46de('0xf')](function(_0x482939){logger[_0x46de('0x10')](_0x46de('0x11'),_0x518381,_0x46de('0x12'));logger['debug']('Variable,\x20%s,\x20%s,\x20%s',_0x518381,_0x46de('0x12'),JSON[_0x46de('0x13')](_0x482939));if(_0x482939['error']){if(_0x482939[_0x46de('0x14')][_0x46de('0x15')]===0x1f4){logger[_0x46de('0x14')](_0x46de('0x11'),_0x518381,_0x482939[_0x46de('0x14')][_0x46de('0x16')]);return _0x1134f1(_0x482939['error'][_0x46de('0x16')]);}logger[_0x46de('0x14')](_0x46de('0x11'),_0x518381,_0x482939[_0x46de('0x14')][_0x46de('0x16')]);return _0x35040b(_0x482939[_0x46de('0x14')][_0x46de('0x16')]);}else{logger[_0x46de('0x10')](_0x46de('0x11'),_0x518381,'request\x20sent');_0x35040b(_0x482939['result'][_0x46de('0x16')]);}})[_0x46de('0x17')](function(_0xaa77b6){logger['error'](_0x46de('0x11'),_0x518381,_0xaa77b6);_0x1134f1(_0xaa77b6);});});}exports['ShowVariable']=function(_0x21c264){var _0x28223a=this;return new Promise(function(_0x224f46,_0x1cc22b){return db[_0x46de('0x18')][_0x46de('0x19')]({'raw':_0x21c264['options']?_0x21c264[_0x46de('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x21c264[_0x46de('0x1a')]?_0x21c264[_0x46de('0x1a')][_0x46de('0x1b')]||null:null,'attributes':_0x21c264['options']?_0x21c264[_0x46de('0x1a')][_0x46de('0x1c')]||null:null,'include':_0x21c264[_0x46de('0x1a')]?_0x21c264[_0x46de('0x1a')]['include']?_[_0x46de('0x1d')](_0x21c264[_0x46de('0x1a')][_0x46de('0x1e')],function(_0x4340d6){return{'model':db[_0x4340d6[_0x46de('0x1f')]],'as':_0x4340d6['as'],'attributes':_0x4340d6[_0x46de('0x1c')],'include':_0x4340d6[_0x46de('0x1e')]?_[_0x46de('0x1d')](_0x4340d6[_0x46de('0x1e')],function(_0x5b38ed){return{'model':db[_0x5b38ed[_0x46de('0x1f')]],'as':_0x5b38ed['as'],'attributes':_0x5b38ed[_0x46de('0x1c')],'include':_0x5b38ed[_0x46de('0x1e')]?_[_0x46de('0x1d')](_0x5b38ed[_0x46de('0x1e')],function(_0x57ad55){return{'model':db[_0x57ad55[_0x46de('0x1f')]],'as':_0x57ad55['as'],'attributes':_0x57ad55[_0x46de('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x46de('0xf')](function(_0x288f06){logger[_0x46de('0x10')](_0x46de('0x20'),_0x21c264);logger['debug'](_0x46de('0x20'),_0x21c264,JSON[_0x46de('0x13')](_0x288f06));_0x224f46(_0x288f06);})[_0x46de('0x17')](function(_0x4c1b67){logger[_0x46de('0x14')](_0x46de('0x20'),_0x4c1b67[_0x46de('0x16')],_0x21c264);_0x1cc22b(_0x28223a[_0x46de('0x14')](0x1f4,_0x4c1b67[_0x46de('0x16')]));});});};
\ No newline at end of file