Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / intSugarcrmField / intSugarcrmField.rpc.js
index 8e012f9..bfbf11c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb8=['info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3d3d02,_0x56f516){var _0x56154e=function(_0x30ff78){while(--_0x30ff78){_0x3d3d02['push'](_0x3d3d02['shift']());}};_0x56154e(++_0x56f516);}(_0x5eb8,0xb0));var _0x85eb=function(_0x1faaa1,_0x1568dd){_0x1faaa1=_0x1faaa1-0x0;var _0x994ec=_0x5eb8[_0x1faaa1];return _0x994ec;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}
\ No newline at end of file
+var _0x0f67=['http','request','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','error','SugarcrmField,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','rpc','jayson/promise'];(function(_0x5d0818,_0x188411){var _0x37fcdb=function(_0x10c95a){while(--_0x10c95a){_0x5d0818['push'](_0x5d0818['shift']());}};_0x37fcdb(++_0x188411);}(_0x0f67,0x1d5));var _0x70f6=function(_0x34081f,_0x4d7dff){_0x34081f=_0x34081f-0x0;var _0x2dd7b8=_0x0f67[_0x34081f];return _0x2dd7b8;};'use strict';var _=require(_0x70f6('0x0'));var util=require(_0x70f6('0x1'));var moment=require(_0x70f6('0x2'));var BPromise=require(_0x70f6('0x3'));var rs=require(_0x70f6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x70f6('0x5'));var config=require('../../config/environment');var jayson=require(_0x70f6('0x6'));var client=jayson['client'][_0x70f6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2757a7,_0x50796a,_0x5e8ca9){return new BPromise(function(_0x595d57,_0x24454b){return client[_0x70f6('0x8')](_0x2757a7,_0x5e8ca9)['then'](function(_0x1487b6){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x50796a,_0x70f6('0x9'));logger['debug'](_0x70f6('0xa'),_0x50796a,_0x70f6('0x9'),JSON['stringify'](_0x1487b6));if(_0x1487b6['error']){if(_0x1487b6[_0x70f6('0xb')]['code']===0x1f4){logger[_0x70f6('0xb')](_0x70f6('0xc'),_0x50796a,_0x1487b6[_0x70f6('0xb')][_0x70f6('0xd')]);return _0x24454b(_0x1487b6[_0x70f6('0xb')][_0x70f6('0xd')]);}logger[_0x70f6('0xb')](_0x70f6('0xc'),_0x50796a,_0x1487b6[_0x70f6('0xb')][_0x70f6('0xd')]);return _0x595d57(_0x1487b6['error'][_0x70f6('0xd')]);}else{logger[_0x70f6('0xe')](_0x70f6('0xc'),_0x50796a,_0x70f6('0x9'));_0x595d57(_0x1487b6[_0x70f6('0xf')][_0x70f6('0xd')]);}})[_0x70f6('0x10')](function(_0x61b2d2){logger[_0x70f6('0xb')](_0x70f6('0xc'),_0x50796a,_0x61b2d2);_0x24454b(_0x61b2d2);});});}
\ No newline at end of file