Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / api / automation / automation.rpc.js
index cdaaa68..49c9ed9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x566f=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5b7374,_0x2e869a){var _0x33d85d=function(_0x25c7a4){while(--_0x25c7a4){_0x5b7374['push'](_0x5b7374['shift']());}};_0x33d85d(++_0x2e869a);}(_0x566f,0x124));var _0xf566=function(_0x119f8d,_0x2e792f){_0x119f8d=_0x119f8d-0x0;var _0x10c3f8=_0x566f[_0x119f8d];return _0x10c3f8;};'use strict';var _=require(_0xf566('0x0'));var util=require(_0xf566('0x1'));var moment=require(_0xf566('0x2'));var BPromise=require(_0xf566('0x3'));var rs=require(_0xf566('0x4'));var fs=require('fs');var Redis=require(_0xf566('0x5'));var db=require(_0xf566('0x6'))['db'];var utils=require(_0xf566('0x7'));var logger=require('../../config/logger')(_0xf566('0x8'));var config=require(_0xf566('0x9'));var jayson=require(_0xf566('0xa'));var client=jayson[_0xf566('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xacfc48,_0x354e78,_0x3af552){return new BPromise(function(_0x1e33fa,_0x588e82){return client[_0xf566('0xc')](_0xacfc48,_0x3af552)['then'](function(_0x112610){logger[_0xf566('0xd')](_0xf566('0xe'),_0x354e78,_0xf566('0xf'));logger['debug'](_0xf566('0x10'),_0x354e78,_0xf566('0xf'),JSON[_0xf566('0x11')](_0x112610));if(_0x112610[_0xf566('0x12')]){if(_0x112610[_0xf566('0x12')][_0xf566('0x13')]===0x1f4){logger[_0xf566('0x12')](_0xf566('0xe'),_0x354e78,_0x112610['error'][_0xf566('0x14')]);return _0x588e82(_0x112610[_0xf566('0x12')][_0xf566('0x14')]);}logger[_0xf566('0x12')]('Automation,\x20%s,\x20%s',_0x354e78,_0x112610[_0xf566('0x12')]['message']);return _0x1e33fa(_0x112610['error'][_0xf566('0x14')]);}else{logger[_0xf566('0xd')]('Automation,\x20%s,\x20%s',_0x354e78,_0xf566('0xf'));_0x1e33fa(_0x112610[_0xf566('0x15')]['message']);}})[_0xf566('0x16')](function(_0x5e208d){logger[_0xf566('0x12')]('Automation,\x20%s,\x20%s',_0x354e78,_0x5e208d);_0x588e82(_0x5e208d);});});}
\ 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