X-Git-Url: http://repos.xcallymotion.com/?a=blobdiff_plain;f=server%2Fapi%2Fautomation%2Fautomation.rpc.js;h=d80a29e3515dcb1e9154752c069fa970e2a4f7db;hb=032eef5eb1c414450ccc959e49effc8ff508851b;hp=15b8698e633b154a7cabfd56958a907281d545a7;hpb=9c8616cfa647d703a1bff4c288be65133e777d2a;p=motion2.git diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 15b8698..d80a29e 100644 --- a/server/api/automation/automation.rpc.js +++ b/server/api/automation/automation.rpc.js @@ -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 _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