Built motion from commit 3e059bc2.|2.5.32
[motion2.git] / server / api / intSugarcrmField / intSugarcrmField.rpc.js
index eca7c4a..95a3273 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['client','http','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x311666,_0x17b07d){var _0x2bc692=function(_0x200073){while(--_0x200073){_0x311666['push'](_0x311666['shift']());}};_0x2bc692(++_0x17b07d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}
\ No newline at end of file
+var _0x4697=['SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x1cbfcc,_0x343b18){var _0x530657=function(_0x27362c){while(--_0x27362c){_0x1cbfcc['push'](_0x1cbfcc['shift']());}};_0x530657(++_0x343b18);}(_0x4697,0x113));var _0x7469=function(_0x5e378a,_0x47d455){_0x5e378a=_0x5e378a-0x0;var _0x596d31=_0x4697[_0x5e378a];return _0x596d31;};'use strict';var _=require('lodash');var util=require(_0x7469('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7469('0x1'));var fs=require('fs');var Redis=require(_0x7469('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7469('0x3'));var config=require(_0x7469('0x4'));var jayson=require(_0x7469('0x5'));var client=jayson[_0x7469('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x508368,_0x60220,_0x3d3765){return new BPromise(function(_0xc6279c,_0x425483){return client[_0x7469('0x7')](_0x508368,_0x3d3765)[_0x7469('0x8')](function(_0x16a102){logger[_0x7469('0x9')](_0x7469('0xa'),_0x60220,_0x7469('0xb'));logger['debug'](_0x7469('0xc'),_0x60220,_0x7469('0xb'),JSON[_0x7469('0xd')](_0x16a102));if(_0x16a102['error']){if(_0x16a102[_0x7469('0xe')][_0x7469('0xf')]===0x1f4){logger[_0x7469('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x60220,_0x16a102['error'][_0x7469('0x10')]);return _0x425483(_0x16a102[_0x7469('0xe')][_0x7469('0x10')]);}logger[_0x7469('0xe')](_0x7469('0xa'),_0x60220,_0x16a102['error'][_0x7469('0x10')]);return _0xc6279c(_0x16a102[_0x7469('0xe')][_0x7469('0x10')]);}else{logger[_0x7469('0x9')](_0x7469('0xa'),_0x60220,_0x7469('0xb'));_0xc6279c(_0x16a102[_0x7469('0x11')]['message']);}})[_0x7469('0x12')](function(_0x3dbb7d){logger['error'](_0x7469('0xa'),_0x60220,_0x3dbb7d);_0x425483(_0x3dbb7d);});});}
\ No newline at end of file