Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / automation / automation.rpc.js
index 15b8698..a26637a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefca=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error','code','Automation,\x20%s,\x20%s','message','result','catch'];(function(_0x233d92,_0x2b3694){var _0x33e488=function(_0x3e492f){while(--_0x3e492f){_0x233d92['push'](_0x233d92['shift']());}};_0x33e488(++_0x2b3694);}(_0xefca,0xe7));var _0xaefc=function(_0x1e91eb,_0x5829a3){_0x1e91eb=_0x1e91eb-0x0;var _0x2af75a=_0xefca[_0x1e91eb];return _0x2af75a;};'use strict';var _=require('lodash');var util=require(_0xaefc('0x0'));var moment=require(_0xaefc('0x1'));var BPromise=require(_0xaefc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaefc('0x3'));var db=require(_0xaefc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaefc('0x5'))(_0xaefc('0x6'));var config=require(_0xaefc('0x7'));var jayson=require(_0xaefc('0x8'));var client=jayson[_0xaefc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x590411,_0x50dc09,_0x4b0c33){return new BPromise(function(_0x1013cb,_0x50c0fd){return client[_0xaefc('0xa')](_0x590411,_0x4b0c33)[_0xaefc('0xb')](function(_0x351a34){logger[_0xaefc('0xc')]('Automation,\x20%s,\x20%s',_0x50dc09,_0xaefc('0xd'));logger['debug'](_0xaefc('0xe'),_0x50dc09,_0xaefc('0xd'),JSON['stringify'](_0x351a34));if(_0x351a34[_0xaefc('0xf')]){if(_0x351a34[_0xaefc('0xf')][_0xaefc('0x10')]===0x1f4){logger['error'](_0xaefc('0x11'),_0x50dc09,_0x351a34[_0xaefc('0xf')][_0xaefc('0x12')]);return _0x50c0fd(_0x351a34['error'][_0xaefc('0x12')]);}logger['error'](_0xaefc('0x11'),_0x50dc09,_0x351a34[_0xaefc('0xf')][_0xaefc('0x12')]);return _0x1013cb(_0x351a34['error']['message']);}else{logger[_0xaefc('0xc')]('Automation,\x20%s,\x20%s',_0x50dc09,_0xaefc('0xd'));_0x1013cb(_0x351a34[_0xaefc('0x13')][_0xaefc('0x12')]);}})[_0xaefc('0x14')](function(_0x4671f5){logger[_0xaefc('0xf')]('Automation,\x20%s,\x20%s',_0x50dc09,_0x4671f5);_0x50c0fd(_0x4671f5);});});}
\ No newline at end of file
+var _0xb94c=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0xb94c,0x176));var _0xcb94=function(_0x43e101,_0x5f51f3){_0x43e101=_0x43e101-0x0;var _0x2d8e7f=_0xb94c[_0x43e101];return _0x2d8e7f;};'use strict';var _=require(_0xcb94('0x0'));var util=require(_0xcb94('0x1'));var moment=require('moment');var BPromise=require(_0xcb94('0x2'));var rs=require(_0xcb94('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb94('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb94('0x5'))(_0xcb94('0x6'));var config=require(_0xcb94('0x7'));var jayson=require(_0xcb94('0x8'));var client=jayson[_0xcb94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ab328,_0x27441c,_0x20f879){return new BPromise(function(_0x22cac1,_0x16288f){return client['request'](_0x3ab328,_0x20f879)[_0xcb94('0xa')](function(_0x3305c9){logger[_0xcb94('0xb')](_0xcb94('0xc'),_0x27441c,'request\x20sent');logger[_0xcb94('0xd')](_0xcb94('0xe'),_0x27441c,_0xcb94('0xf'),JSON[_0xcb94('0x10')](_0x3305c9));if(_0x3305c9[_0xcb94('0x11')]){if(_0x3305c9[_0xcb94('0x11')][_0xcb94('0x12')]===0x1f4){logger[_0xcb94('0x11')](_0xcb94('0xc'),_0x27441c,_0x3305c9[_0xcb94('0x11')]['message']);return _0x16288f(_0x3305c9[_0xcb94('0x11')][_0xcb94('0x13')]);}logger['error']('Automation,\x20%s,\x20%s',_0x27441c,_0x3305c9['error']['message']);return _0x22cac1(_0x3305c9[_0xcb94('0x11')][_0xcb94('0x13')]);}else{logger[_0xcb94('0xb')]('Automation,\x20%s,\x20%s',_0x27441c,_0xcb94('0xf'));_0x22cac1(_0x3305c9['result'][_0xcb94('0x13')]);}})[_0xcb94('0x14')](function(_0x3dbfbb){logger[_0xcb94('0x11')](_0xcb94('0xc'),_0x27441c,_0x3dbfbb);_0x16288f(_0x3dbfbb);});});}
\ No newline at end of file