Built motion from commit a679711e.|2.6.15
[motion2.git] / server / api / automation / automation.rpc.js
index 4ed18d8..a1f74d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x288a=['jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment'];(function(_0x17c90f,_0x43864d){var _0x5df760=function(_0x1ef7e7){while(--_0x1ef7e7){_0x17c90f['push'](_0x17c90f['shift']());}};_0x5df760(++_0x43864d);}(_0x288a,0x188));var _0xa288=function(_0x1549ce,_0x1c2651){_0x1549ce=_0x1549ce-0x0;var _0x1f7881=_0x288a[_0x1549ce];return _0x1f7881;};'use strict';var _=require('lodash');var util=require(_0xa288('0x0'));var moment=require(_0xa288('0x1'));var BPromise=require(_0xa288('0x2'));var rs=require(_0xa288('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa288('0x4'));var logger=require('../../config/logger')(_0xa288('0x5'));var config=require(_0xa288('0x6'));var jayson=require(_0xa288('0x7'));var client=jayson['client'][_0xa288('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xaee90c,_0x156720,_0x57f445){return new BPromise(function(_0x14e4a6,_0x1e8412){return client[_0xa288('0x9')](_0xaee90c,_0x57f445)[_0xa288('0xa')](function(_0x1a0c06){logger[_0xa288('0xb')](_0xa288('0xc'),_0x156720,_0xa288('0xd'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x156720,'request\x20sent',JSON[_0xa288('0xe')](_0x1a0c06));if(_0x1a0c06[_0xa288('0xf')]){if(_0x1a0c06['error'][_0xa288('0x10')]===0x1f4){logger[_0xa288('0xf')](_0xa288('0xc'),_0x156720,_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);return _0x1e8412(_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);}logger[_0xa288('0xf')](_0xa288('0xc'),_0x156720,_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);return _0x14e4a6(_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);}else{logger[_0xa288('0xb')](_0xa288('0xc'),_0x156720,_0xa288('0xd'));_0x14e4a6(_0x1a0c06['result'][_0xa288('0x11')]);}})[_0xa288('0x12')](function(_0x299ede){logger[_0xa288('0xf')](_0xa288('0xc'),_0x156720,_0x299ede);_0x1e8412(_0x299ede);});});}
\ No newline at end of file
+var _0x4888=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x182ae,_0x42fc8d){var _0x1be768=function(_0x202bb5){while(--_0x202bb5){_0x182ae['push'](_0x182ae['shift']());}};_0x1be768(++_0x42fc8d);}(_0x4888,0x198));var _0x8488=function(_0x374ada,_0x27b3a5){_0x374ada=_0x374ada-0x0;var _0x449ed8=_0x4888[_0x374ada];return _0x449ed8;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var moment=require(_0x8488('0x1'));var BPromise=require(_0x8488('0x2'));var rs=require(_0x8488('0x3'));var fs=require('fs');var Redis=require(_0x8488('0x4'));var db=require(_0x8488('0x5'))['db'];var utils=require(_0x8488('0x6'));var logger=require('../../config/logger')(_0x8488('0x7'));var config=require(_0x8488('0x8'));var jayson=require(_0x8488('0x9'));var client=jayson[_0x8488('0xa')][_0x8488('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19e508,_0x5250a1,_0x5b30a7){return new BPromise(function(_0x56aad0,_0x568a82){return client[_0x8488('0xc')](_0x19e508,_0x5b30a7)[_0x8488('0xd')](function(_0x542bd8){logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));logger[_0x8488('0x11')]('Automation,\x20%s,\x20%s,\x20%s',_0x5250a1,_0x8488('0x10'),JSON[_0x8488('0x12')](_0x542bd8));if(_0x542bd8[_0x8488('0x13')]){if(_0x542bd8[_0x8488('0x13')][_0x8488('0x14')]===0x1f4){logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8[_0x8488('0x13')]['message']);return _0x568a82(_0x542bd8['error'][_0x8488('0x15')]);}logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8['error']['message']);return _0x56aad0(_0x542bd8[_0x8488('0x13')][_0x8488('0x15')]);}else{logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));_0x56aad0(_0x542bd8[_0x8488('0x16')][_0x8488('0x15')]);}})['catch'](function(_0x3dad45){logger[_0x8488('0x13')](_0x8488('0xf'),_0x5250a1,_0x3dad45);_0x568a82(_0x3dad45);});});}
\ No newline at end of file