Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / api / automation / automation.rpc.js
index 9278ba4..f84ad72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7b5=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','info','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4a4062,_0x45c9b2){var _0x2def78=function(_0x2b5eff){while(--_0x2b5eff){_0x4a4062['push'](_0x4a4062['shift']());}};_0x2def78(++_0x45c9b2);}(_0xa7b5,0x15a));var _0x5a7b=function(_0x56ad8c,_0x1772d1){_0x56ad8c=_0x56ad8c-0x0;var _0x2e2c11=_0xa7b5[_0x56ad8c];return _0x2e2c11;};'use strict';var _=require(_0x5a7b('0x0'));var util=require('util');var moment=require(_0x5a7b('0x1'));var BPromise=require('bluebird');var rs=require(_0x5a7b('0x2'));var fs=require('fs');var Redis=require(_0x5a7b('0x3'));var db=require(_0x5a7b('0x4'))['db'];var utils=require(_0x5a7b('0x5'));var logger=require(_0x5a7b('0x6'))(_0x5a7b('0x7'));var config=require(_0x5a7b('0x8'));var jayson=require(_0x5a7b('0x9'));var client=jayson[_0x5a7b('0xa')][_0x5a7b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f8f95,_0x493ae6,_0x2cd623){return new BPromise(function(_0x24b80c,_0x7a3ae){return client[_0x5a7b('0xc')](_0x1f8f95,_0x2cd623)[_0x5a7b('0xd')](function(_0x4070ee){logger['info']('Automation,\x20%s,\x20%s',_0x493ae6,_0x5a7b('0xe'));logger['debug'](_0x5a7b('0xf'),_0x493ae6,_0x5a7b('0xe'),JSON[_0x5a7b('0x10')](_0x4070ee));if(_0x4070ee[_0x5a7b('0x11')]){if(_0x4070ee[_0x5a7b('0x11')][_0x5a7b('0x12')]===0x1f4){logger[_0x5a7b('0x11')](_0x5a7b('0x13'),_0x493ae6,_0x4070ee[_0x5a7b('0x11')][_0x5a7b('0x14')]);return _0x7a3ae(_0x4070ee[_0x5a7b('0x11')]['message']);}logger[_0x5a7b('0x11')](_0x5a7b('0x13'),_0x493ae6,_0x4070ee[_0x5a7b('0x11')][_0x5a7b('0x14')]);return _0x24b80c(_0x4070ee['error'][_0x5a7b('0x14')]);}else{logger[_0x5a7b('0x15')]('Automation,\x20%s,\x20%s',_0x493ae6,_0x5a7b('0xe'));_0x24b80c(_0x4070ee['result'][_0x5a7b('0x14')]);}})['catch'](function(_0x340241){logger[_0x5a7b('0x11')](_0x5a7b('0x13'),_0x493ae6,_0x340241);_0x7a3ae(_0x340241);});});}
\ No newline at end of file
+var _0x7524=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis'];(function(_0x4cadfd,_0x889708){var _0x4985f6=function(_0x518760){while(--_0x518760){_0x4cadfd['push'](_0x4cadfd['shift']());}};_0x4985f6(++_0x889708);}(_0x7524,0xce));var _0x4752=function(_0x1a5770,_0x5d5983){_0x1a5770=_0x1a5770-0x0;var _0x59ccdf=_0x7524[_0x1a5770];return _0x59ccdf;};'use strict';var _=require('lodash');var util=require(_0x4752('0x0'));var moment=require(_0x4752('0x1'));var BPromise=require('bluebird');var rs=require(_0x4752('0x2'));var fs=require('fs');var Redis=require(_0x4752('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4752('0x4'))('rpc');var config=require(_0x4752('0x5'));var jayson=require(_0x4752('0x6'));var client=jayson[_0x4752('0x7')][_0x4752('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x104962,_0x5b98c0,_0x1e76cf){return new BPromise(function(_0x1cbf34,_0x59477c){return client['request'](_0x104962,_0x1e76cf)[_0x4752('0x9')](function(_0x45e0ff){logger[_0x4752('0xa')](_0x4752('0xb'),_0x5b98c0,'request\x20sent');logger[_0x4752('0xc')](_0x4752('0xd'),_0x5b98c0,_0x4752('0xe'),JSON[_0x4752('0xf')](_0x45e0ff));if(_0x45e0ff[_0x4752('0x10')]){if(_0x45e0ff['error'][_0x4752('0x11')]===0x1f4){logger[_0x4752('0x10')](_0x4752('0xb'),_0x5b98c0,_0x45e0ff[_0x4752('0x10')][_0x4752('0x12')]);return _0x59477c(_0x45e0ff[_0x4752('0x10')][_0x4752('0x12')]);}logger['error'](_0x4752('0xb'),_0x5b98c0,_0x45e0ff['error'][_0x4752('0x12')]);return _0x1cbf34(_0x45e0ff[_0x4752('0x10')][_0x4752('0x12')]);}else{logger[_0x4752('0xa')](_0x4752('0xb'),_0x5b98c0,_0x4752('0xe'));_0x1cbf34(_0x45e0ff[_0x4752('0x13')]['message']);}})[_0x4752('0x14')](function(_0x1dad7c){logger['error'](_0x4752('0xb'),_0x5b98c0,_0x1dad7c);_0x59477c(_0x1dad7c);});});}
\ No newline at end of file