Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / automation / automation.rpc.js
index 990ee7b..aeb64c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf603=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xf603,0xeb));var _0x3f60=function(_0x34890c,_0x3ca746){_0x34890c=_0x34890c-0x0;var _0x129ef6=_0xf603[_0x34890c];return _0x129ef6;};'use strict';var _=require(_0x3f60('0x0'));var util=require(_0x3f60('0x1'));var moment=require(_0x3f60('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f60('0x3'));var fs=require('fs');var Redis=require(_0x3f60('0x4'));var db=require(_0x3f60('0x5'))['db'];var utils=require(_0x3f60('0x6'));var logger=require(_0x3f60('0x7'))('rpc');var config=require(_0x3f60('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3f60('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ec43c,_0x375f1e,_0x17659b){return new BPromise(function(_0x434249,_0x9282dd){return client['request'](_0x1ec43c,_0x17659b)[_0x3f60('0xa')](function(_0x33dcc8){logger[_0x3f60('0xb')](_0x3f60('0xc'),_0x375f1e,'request\x20sent');logger['debug'](_0x3f60('0xd'),_0x375f1e,_0x3f60('0xe'),JSON[_0x3f60('0xf')](_0x33dcc8));if(_0x33dcc8['error']){if(_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x11')]===0x1f4){logger[_0x3f60('0x10')]('Automation,\x20%s,\x20%s',_0x375f1e,_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x12')]);return _0x9282dd(_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x12')]);}logger[_0x3f60('0x10')](_0x3f60('0xc'),_0x375f1e,_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x12')]);return _0x434249(_0x33dcc8['error']['message']);}else{logger['info'](_0x3f60('0xc'),_0x375f1e,_0x3f60('0xe'));_0x434249(_0x33dcc8[_0x3f60('0x13')][_0x3f60('0x12')]);}})[_0x3f60('0x14')](function(_0x224982){logger[_0x3f60('0x10')](_0x3f60('0xc'),_0x375f1e,_0x224982);_0x9282dd(_0x224982);});});}
\ No newline at end of file
+var _0xb6fa=['then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2820f0,_0x3ff9bc){var _0x50a3f3=function(_0x20cf86){while(--_0x20cf86){_0x2820f0['push'](_0x2820f0['shift']());}};_0x50a3f3(++_0x3ff9bc);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x237f8b,_0xc5eddb){_0x237f8b=_0x237f8b-0x0;var _0x423f94=_0xb6fa[_0x237f8b];return _0x423f94;};'use strict';var _=require(_0xab6f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xab6f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab6f('0x2'))['db'];var utils=require(_0xab6f('0x3'));var logger=require('../../config/logger')(_0xab6f('0x4'));var config=require(_0xab6f('0x5'));var jayson=require(_0xab6f('0x6'));var client=jayson[_0xab6f('0x7')][_0xab6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x895acc,_0x16b84e,_0x1b4da9){return new BPromise(function(_0x46b0f6,_0x85cb19){return client[_0xab6f('0x9')](_0x895acc,_0x1b4da9)[_0xab6f('0xa')](function(_0x199f2d){logger[_0xab6f('0xb')](_0xab6f('0xc'),_0x16b84e,_0xab6f('0xd'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x16b84e,_0xab6f('0xd'),JSON[_0xab6f('0xe')](_0x199f2d));if(_0x199f2d['error']){if(_0x199f2d[_0xab6f('0xf')][_0xab6f('0x10')]===0x1f4){logger[_0xab6f('0xf')](_0xab6f('0xc'),_0x16b84e,_0x199f2d[_0xab6f('0xf')][_0xab6f('0x11')]);return _0x85cb19(_0x199f2d[_0xab6f('0xf')]['message']);}logger[_0xab6f('0xf')](_0xab6f('0xc'),_0x16b84e,_0x199f2d[_0xab6f('0xf')]['message']);return _0x46b0f6(_0x199f2d[_0xab6f('0xf')]['message']);}else{logger['info'](_0xab6f('0xc'),_0x16b84e,'request\x20sent');_0x46b0f6(_0x199f2d[_0xab6f('0x12')][_0xab6f('0x11')]);}})[_0xab6f('0x13')](function(_0x59b934){logger[_0xab6f('0xf')]('Automation,\x20%s,\x20%s',_0x16b84e,_0x59b934);_0x85cb19(_0x59b934);});});}
\ No newline at end of file