Built motion from commit 753c950e.|2.5.42
[motion2.git] / server / api / automation / automation.rpc.js
index 77abf7d..8ff50ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb344=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','moment','bluebird','randomstring','ioredis'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xb344,0x150));var _0x4b34=function(_0x3bfdde,_0x306be4){_0x3bfdde=_0x3bfdde-0x0;var _0x3f752a=_0xb344[_0x3bfdde];return _0x3f752a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4b34('0x0'));var BPromise=require(_0x4b34('0x1'));var rs=require(_0x4b34('0x2'));var fs=require('fs');var Redis=require(_0x4b34('0x3'));var db=require(_0x4b34('0x4'))['db'];var utils=require(_0x4b34('0x5'));var logger=require(_0x4b34('0x6'))('rpc');var config=require(_0x4b34('0x7'));var jayson=require(_0x4b34('0x8'));var client=jayson[_0x4b34('0x9')][_0x4b34('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e953c,_0x1a04a8,_0x51005f){return new BPromise(function(_0x66d348,_0x235d58){return client['request'](_0x5e953c,_0x51005f)['then'](function(_0x5e1c6b){logger[_0x4b34('0xb')](_0x4b34('0xc'),_0x1a04a8,'request\x20sent');logger[_0x4b34('0xd')](_0x4b34('0xe'),_0x1a04a8,_0x4b34('0xf'),JSON[_0x4b34('0x10')](_0x5e1c6b));if(_0x5e1c6b[_0x4b34('0x11')]){if(_0x5e1c6b[_0x4b34('0x11')][_0x4b34('0x12')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x1a04a8,_0x5e1c6b[_0x4b34('0x11')][_0x4b34('0x13')]);return _0x235d58(_0x5e1c6b[_0x4b34('0x11')][_0x4b34('0x13')]);}logger[_0x4b34('0x11')]('Automation,\x20%s,\x20%s',_0x1a04a8,_0x5e1c6b[_0x4b34('0x11')][_0x4b34('0x13')]);return _0x66d348(_0x5e1c6b[_0x4b34('0x11')][_0x4b34('0x13')]);}else{logger[_0x4b34('0xb')](_0x4b34('0xc'),_0x1a04a8,_0x4b34('0xf'));_0x66d348(_0x5e1c6b['result'][_0x4b34('0x13')]);}})['catch'](function(_0x37d60e){logger[_0x4b34('0x11')](_0x4b34('0xc'),_0x1a04a8,_0x37d60e);_0x235d58(_0x37d60e);});});}
\ No newline at end of file
+var _0x0833=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3a6972,_0x5cb15d){var _0x52c610=function(_0x2ad5d8){while(--_0x2ad5d8){_0x3a6972['push'](_0x3a6972['shift']());}};_0x52c610(++_0x5cb15d);}(_0x0833,0x1bd));var _0x3083=function(_0x5f4493,_0x218802){_0x5f4493=_0x5f4493-0x0;var _0x57dab7=_0x0833[_0x5f4493];return _0x57dab7;};'use strict';var _=require(_0x3083('0x0'));var util=require(_0x3083('0x1'));var moment=require(_0x3083('0x2'));var BPromise=require(_0x3083('0x3'));var rs=require(_0x3083('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3083('0x5'))('rpc');var config=require(_0x3083('0x6'));var jayson=require(_0x3083('0x7'));var client=jayson[_0x3083('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f9c3a,_0x1378a5,_0x529df1){return new BPromise(function(_0x5591b0,_0x4f51da){return client[_0x3083('0x9')](_0x2f9c3a,_0x529df1)['then'](function(_0x5cce3c){logger[_0x3083('0xa')](_0x3083('0xb'),_0x1378a5,_0x3083('0xc'));logger[_0x3083('0xd')](_0x3083('0xe'),_0x1378a5,_0x3083('0xc'),JSON[_0x3083('0xf')](_0x5cce3c));if(_0x5cce3c[_0x3083('0x10')]){if(_0x5cce3c[_0x3083('0x10')][_0x3083('0x11')]===0x1f4){logger[_0x3083('0x10')](_0x3083('0xb'),_0x1378a5,_0x5cce3c[_0x3083('0x10')][_0x3083('0x12')]);return _0x4f51da(_0x5cce3c[_0x3083('0x10')]['message']);}logger[_0x3083('0x10')](_0x3083('0xb'),_0x1378a5,_0x5cce3c['error'][_0x3083('0x12')]);return _0x5591b0(_0x5cce3c[_0x3083('0x10')]['message']);}else{logger[_0x3083('0xa')](_0x3083('0xb'),_0x1378a5,_0x3083('0xc'));_0x5591b0(_0x5cce3c[_0x3083('0x13')][_0x3083('0x12')]);}})[_0x3083('0x14')](function(_0xecb368){logger['error']('Automation,\x20%s,\x20%s',_0x1378a5,_0xecb368);_0x4f51da(_0xecb368);});});}
\ No newline at end of file