Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / api / automation / automation.rpc.js
index d80a29e..49c9ed9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd730=['Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Automation,\x20%s,\x20%s','request\x20sent'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0xd730,0xfd));var _0x0d73=function(_0x46379f,_0x5764bc){_0x46379f=_0x46379f-0x0;var _0x41a7f0=_0xd730[_0x46379f];return _0x41a7f0;};'use strict';var _=require('lodash');var util=require(_0x0d73('0x0'));var moment=require('moment');var BPromise=require(_0x0d73('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d73('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d73('0x3'));var logger=require(_0x0d73('0x4'))(_0x0d73('0x5'));var config=require(_0x0d73('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0d73('0x7')][_0x0d73('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55aba2,_0x1dc342,_0x5b966e){return new BPromise(function(_0x2a7202,_0x4a39f0){return client['request'](_0x55aba2,_0x5b966e)[_0x0d73('0x9')](function(_0x5792d1){logger[_0x0d73('0xa')](_0x0d73('0xb'),_0x1dc342,_0x0d73('0xc'));logger['debug'](_0x0d73('0xd'),_0x1dc342,'request\x20sent',JSON[_0x0d73('0xe')](_0x5792d1));if(_0x5792d1[_0x0d73('0xf')]){if(_0x5792d1[_0x0d73('0xf')][_0x0d73('0x10')]===0x1f4){logger[_0x0d73('0xf')](_0x0d73('0xb'),_0x1dc342,_0x5792d1[_0x0d73('0xf')][_0x0d73('0x11')]);return _0x4a39f0(_0x5792d1[_0x0d73('0xf')][_0x0d73('0x11')]);}logger[_0x0d73('0xf')](_0x0d73('0xb'),_0x1dc342,_0x5792d1[_0x0d73('0xf')]['message']);return _0x2a7202(_0x5792d1[_0x0d73('0xf')][_0x0d73('0x11')]);}else{logger[_0x0d73('0xa')](_0x0d73('0xb'),_0x1dc342,_0x0d73('0xc'));_0x2a7202(_0x5792d1['result'][_0x0d73('0x11')]);}})[_0x0d73('0x12')](function(_0x515c9a){logger['error']('Automation,\x20%s,\x20%s',_0x1dc342,_0x515c9a);_0x4a39f0(_0x515c9a);});});}
\ No newline at end of file
+var _0x2272=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch'];(function(_0x2b72d8,_0x2fd8bf){var _0x1ec104=function(_0x7af0ec){while(--_0x7af0ec){_0x2b72d8['push'](_0x2b72d8['shift']());}};_0x1ec104(++_0x2fd8bf);}(_0x2272,0xd8));var _0x2227=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2272[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('Automation,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});}
\ No newline at end of file