Built motion from commit (unavailable).|2.5.0
[motion2.git] / server / api / integration / integration.rpc.js
index dfd5cc1..0ff21ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf3e=['debug','stringify','error','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','Integration,\x20%s,\x20%s','request\x20sent'];(function(_0x440e50,_0x1313b2){var _0x33e75d=function(_0x13b482){while(--_0x13b482){_0x440e50['push'](_0x440e50['shift']());}};_0x33e75d(++_0x1313b2);}(_0xaf3e,0xcf));var _0xeaf3=function(_0x2e3107,_0x25f970){_0x2e3107=_0x2e3107-0x0;var _0x833d69=_0xaf3e[_0x2e3107];return _0x833d69;};'use strict';var _=require(_0xeaf3('0x0'));var util=require(_0xeaf3('0x1'));var moment=require('moment');var BPromise=require(_0xeaf3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeaf3('0x3'));var db=require(_0xeaf3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xeaf3('0x5'))(_0xeaf3('0x6'));var config=require(_0xeaf3('0x7'));var jayson=require(_0xeaf3('0x8'));var client=jayson[_0xeaf3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33071f,_0x1725b7,_0xa51f56){return new BPromise(function(_0x120b24,_0x3d599a){return client[_0xeaf3('0xa')](_0x33071f,_0xa51f56)['then'](function(_0x3e666b){logger['info'](_0xeaf3('0xb'),_0x1725b7,_0xeaf3('0xc'));logger[_0xeaf3('0xd')]('Integration,\x20%s,\x20%s,\x20%s',_0x1725b7,_0xeaf3('0xc'),JSON[_0xeaf3('0xe')](_0x3e666b));if(_0x3e666b['error']){if(_0x3e666b[_0xeaf3('0xf')]['code']===0x1f4){logger[_0xeaf3('0xf')](_0xeaf3('0xb'),_0x1725b7,_0x3e666b[_0xeaf3('0xf')][_0xeaf3('0x10')]);return _0x3d599a(_0x3e666b['error'][_0xeaf3('0x10')]);}logger[_0xeaf3('0xf')](_0xeaf3('0xb'),_0x1725b7,_0x3e666b[_0xeaf3('0xf')]['message']);return _0x120b24(_0x3e666b[_0xeaf3('0xf')]['message']);}else{logger[_0xeaf3('0x11')]('Integration,\x20%s,\x20%s',_0x1725b7,'request\x20sent');_0x120b24(_0x3e666b[_0xeaf3('0x12')][_0xeaf3('0x10')]);}})[_0xeaf3('0x13')](function(_0x2aea53){logger[_0xeaf3('0xf')](_0xeaf3('0xb'),_0x1725b7,_0x2aea53);_0x3d599a(_0x2aea53);});});}
\ No newline at end of file
+var _0x75a2=['debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Integration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','then'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x75a2,0x187));var _0x275a=function(_0x58695b,_0x34d32f){_0x58695b=_0x58695b-0x0;var _0x3fa86d=_0x75a2[_0x58695b];return _0x3fa86d;};'use strict';var _=require(_0x275a('0x0'));var util=require(_0x275a('0x1'));var moment=require(_0x275a('0x2'));var BPromise=require('bluebird');var rs=require(_0x275a('0x3'));var fs=require('fs');var Redis=require(_0x275a('0x4'));var db=require(_0x275a('0x5'))['db'];var utils=require(_0x275a('0x6'));var logger=require('../../config/logger')(_0x275a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x32f0cb,_0x12cad9,_0x17ad5e){return new BPromise(function(_0x38b303,_0x525950){return client['request'](_0x32f0cb,_0x17ad5e)[_0x275a('0x8')](function(_0x46f9c7){logger['info']('Integration,\x20%s,\x20%s',_0x12cad9,'request\x20sent');logger[_0x275a('0x9')](_0x275a('0xa'),_0x12cad9,_0x275a('0xb'),JSON[_0x275a('0xc')](_0x46f9c7));if(_0x46f9c7[_0x275a('0xd')]){if(_0x46f9c7[_0x275a('0xd')][_0x275a('0xe')]===0x1f4){logger[_0x275a('0xd')](_0x275a('0xf'),_0x12cad9,_0x46f9c7[_0x275a('0xd')][_0x275a('0x10')]);return _0x525950(_0x46f9c7['error'][_0x275a('0x10')]);}logger[_0x275a('0xd')]('Integration,\x20%s,\x20%s',_0x12cad9,_0x46f9c7['error'][_0x275a('0x10')]);return _0x38b303(_0x46f9c7[_0x275a('0xd')][_0x275a('0x10')]);}else{logger[_0x275a('0x11')](_0x275a('0xf'),_0x12cad9,_0x275a('0xb'));_0x38b303(_0x46f9c7[_0x275a('0x12')][_0x275a('0x10')]);}})[_0x275a('0x13')](function(_0x58e54d){logger['error'](_0x275a('0xf'),_0x12cad9,_0x58e54d);_0x525950(_0x58e54d);});});}
\ No newline at end of file