Built motion from commit e6806ed6.|2.6.0
[motion2.git] / server / api / automation / automation.rpc.js
index a68c445..b3a45a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f18=['moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x246698,_0x24f600){var _0x34ab93=function(_0x49c5bf){while(--_0x49c5bf){_0x246698['push'](_0x246698['shift']());}};_0x34ab93(++_0x24f600);}(_0x6f18,0x1b4));var _0x86f1=function(_0x496e32,_0x3b3d8a){_0x496e32=_0x496e32-0x0;var _0x282961=_0x6f18[_0x496e32];return _0x282961;};'use strict';var _=require(_0x86f1('0x0'));var util=require('util');var moment=require(_0x86f1('0x1'));var BPromise=require('bluebird');var rs=require(_0x86f1('0x2'));var fs=require('fs');var Redis=require(_0x86f1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x86f1('0x4'));var logger=require(_0x86f1('0x5'))('rpc');var config=require(_0x86f1('0x6'));var jayson=require(_0x86f1('0x7'));var client=jayson[_0x86f1('0x8')][_0x86f1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x403f48,_0x4c7943,_0x5b0f45){return new BPromise(function(_0x3cc3c5,_0x3223eb){return client[_0x86f1('0xa')](_0x403f48,_0x5b0f45)[_0x86f1('0xb')](function(_0x4f1f6e){logger[_0x86f1('0xc')](_0x86f1('0xd'),_0x4c7943,_0x86f1('0xe'));logger[_0x86f1('0xf')](_0x86f1('0x10'),_0x4c7943,_0x86f1('0xe'),JSON[_0x86f1('0x11')](_0x4f1f6e));if(_0x4f1f6e[_0x86f1('0x12')]){if(_0x4f1f6e['error'][_0x86f1('0x13')]===0x1f4){logger[_0x86f1('0x12')](_0x86f1('0xd'),_0x4c7943,_0x4f1f6e[_0x86f1('0x12')][_0x86f1('0x14')]);return _0x3223eb(_0x4f1f6e[_0x86f1('0x12')]['message']);}logger[_0x86f1('0x12')](_0x86f1('0xd'),_0x4c7943,_0x4f1f6e[_0x86f1('0x12')][_0x86f1('0x14')]);return _0x3cc3c5(_0x4f1f6e[_0x86f1('0x12')][_0x86f1('0x14')]);}else{logger[_0x86f1('0xc')](_0x86f1('0xd'),_0x4c7943,'request\x20sent');_0x3cc3c5(_0x4f1f6e[_0x86f1('0x15')][_0x86f1('0x14')]);}})[_0x86f1('0x16')](function(_0x4452c4){logger[_0x86f1('0x12')](_0x86f1('0xd'),_0x4c7943,_0x4452c4);_0x3223eb(_0x4452c4);});});}
\ No newline at end of file
+var _0x5525=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x5463dc,_0xaf0ea9){var _0x9b3032=function(_0x2641c5){while(--_0x2641c5){_0x5463dc['push'](_0x5463dc['shift']());}};_0x9b3032(++_0xaf0ea9);}(_0x5525,0xd1));var _0x5552=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5525[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x5552('0x0'));var util=require(_0x5552('0x1'));var moment=require(_0x5552('0x2'));var BPromise=require(_0x5552('0x3'));var rs=require(_0x5552('0x4'));var fs=require('fs');var Redis=require(_0x5552('0x5'));var db=require(_0x5552('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5552('0x7'))(_0x5552('0x8'));var config=require('../../config/environment');var jayson=require(_0x5552('0x9'));var client=jayson[_0x5552('0xa')][_0x5552('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ce9f6,_0xb28442,_0x203b88){return new BPromise(function(_0x164626,_0x25a789){return client['request'](_0x1ce9f6,_0x203b88)[_0x5552('0xc')](function(_0x568e10){logger[_0x5552('0xd')]('Automation,\x20%s,\x20%s',_0xb28442,_0x5552('0xe'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0xb28442,_0x5552('0xe'),JSON['stringify'](_0x568e10));if(_0x568e10[_0x5552('0xf')]){if(_0x568e10[_0x5552('0xf')][_0x5552('0x10')]===0x1f4){logger[_0x5552('0xf')](_0x5552('0x11'),_0xb28442,_0x568e10['error'][_0x5552('0x12')]);return _0x25a789(_0x568e10['error']['message']);}logger[_0x5552('0xf')](_0x5552('0x11'),_0xb28442,_0x568e10['error']['message']);return _0x164626(_0x568e10[_0x5552('0xf')][_0x5552('0x12')]);}else{logger[_0x5552('0xd')](_0x5552('0x11'),_0xb28442,_0x5552('0xe'));_0x164626(_0x568e10[_0x5552('0x13')][_0x5552('0x12')]);}})[_0x5552('0x14')](function(_0x1fabec){logger['error'](_0x5552('0x11'),_0xb28442,_0x1fabec);_0x25a789(_0x1fabec);});});}
\ No newline at end of file