Built motion from commit d13fb11b.|2.6.34
[motion2.git] / server / api / intSugarcrmAccount / intSugarcrmAccount.rpc.js
index 41951e0..a39a354 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f83=['message','catch','findAll','options','raw','where','attributes','limit','include','map','model','then','GetSugarcrmAccount','ShowSugarcrmAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x23758f,_0x23c4f0){var _0x5534f0=function(_0x40c011){while(--_0x40c011){_0x23758f['push'](_0x23758f['shift']());}};_0x5534f0(++_0x23c4f0);}(_0x9f83,0x12e));var _0x39f8=function(_0x3eb6d5,_0x130a5e){_0x3eb6d5=_0x3eb6d5-0x0;var _0x4ca11a=_0x9f83[_0x3eb6d5];return _0x4ca11a;};'use strict';var _=require(_0x39f8('0x0'));var util=require(_0x39f8('0x1'));var moment=require(_0x39f8('0x2'));var BPromise=require(_0x39f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39f8('0x4'));var db=require(_0x39f8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x39f8('0x6'));var config=require(_0x39f8('0x7'));var jayson=require(_0x39f8('0x8'));var client=jayson[_0x39f8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27f4a9,_0x490dde,_0x1314e6){return new BPromise(function(_0x40280b,_0x5beff1){return client[_0x39f8('0xa')](_0x27f4a9,_0x1314e6)['then'](function(_0x1351d2){logger[_0x39f8('0xb')](_0x39f8('0xc'),_0x490dde,'request\x20sent');logger[_0x39f8('0xd')](_0x39f8('0xe'),_0x490dde,_0x39f8('0xf'),JSON[_0x39f8('0x10')](_0x1351d2));if(_0x1351d2[_0x39f8('0x11')]){if(_0x1351d2['error']['code']===0x1f4){logger[_0x39f8('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x490dde,_0x1351d2[_0x39f8('0x11')][_0x39f8('0x12')]);return _0x5beff1(_0x1351d2[_0x39f8('0x11')][_0x39f8('0x12')]);}logger[_0x39f8('0x11')](_0x39f8('0xc'),_0x490dde,_0x1351d2[_0x39f8('0x11')][_0x39f8('0x12')]);return _0x40280b(_0x1351d2[_0x39f8('0x11')][_0x39f8('0x12')]);}else{logger[_0x39f8('0xb')](_0x39f8('0xc'),_0x490dde,'request\x20sent');_0x40280b(_0x1351d2['result']['message']);}})[_0x39f8('0x13')](function(_0x457fdd){logger['error'](_0x39f8('0xc'),_0x490dde,_0x457fdd);_0x5beff1(_0x457fdd);});});}exports['GetSugarcrmAccount']=function(_0x2adb9d){var _0x113ad0=this;return new Promise(function(_0x4f18be,_0x1b47b9){return db['SugarcrmAccount'][_0x39f8('0x14')]({'raw':_0x2adb9d[_0x39f8('0x15')]?_0x2adb9d[_0x39f8('0x15')][_0x39f8('0x16')]===undefined?!![]:![]:!![],'where':_0x2adb9d[_0x39f8('0x15')]?_0x2adb9d[_0x39f8('0x15')][_0x39f8('0x17')]||null:null,'attributes':_0x2adb9d[_0x39f8('0x15')]?_0x2adb9d[_0x39f8('0x15')][_0x39f8('0x18')]||null:null,'limit':_0x2adb9d['options']?_0x2adb9d[_0x39f8('0x15')][_0x39f8('0x19')]||null:null,'include':_0x2adb9d[_0x39f8('0x15')]?_0x2adb9d[_0x39f8('0x15')][_0x39f8('0x1a')]?_[_0x39f8('0x1b')](_0x2adb9d['options']['include'],function(_0x1b1f67){return{'model':db[_0x1b1f67[_0x39f8('0x1c')]],'as':_0x1b1f67['as'],'attributes':_0x1b1f67['attributes'],'include':_0x1b1f67[_0x39f8('0x1a')]?_['map'](_0x1b1f67[_0x39f8('0x1a')],function(_0x375b64){return{'model':db[_0x375b64[_0x39f8('0x1c')]],'as':_0x375b64['as'],'attributes':_0x375b64[_0x39f8('0x18')],'include':_0x375b64[_0x39f8('0x1a')]?_['map'](_0x375b64[_0x39f8('0x1a')],function(_0x4dbdae){return{'model':db[_0x4dbdae[_0x39f8('0x1c')]],'as':_0x4dbdae['as'],'attributes':_0x4dbdae[_0x39f8('0x18')]};}):[]};}):[]};}):[]:[]})[_0x39f8('0x1d')](function(_0xcd71f){logger[_0x39f8('0xb')](_0x39f8('0x1e'),_0x2adb9d);logger[_0x39f8('0xd')]('GetSugarcrmAccount',_0x2adb9d,JSON['stringify'](_0xcd71f));_0x4f18be(_0xcd71f);})[_0x39f8('0x13')](function(_0x2df12c){logger[_0x39f8('0x11')]('GetSugarcrmAccount',_0x2df12c['message'],_0x2adb9d);_0x1b47b9(_0x113ad0[_0x39f8('0x11')](0x1f4,_0x2df12c[_0x39f8('0x12')]));});});};exports[_0x39f8('0x1f')]=function(_0x304c13){var _0xdbf8e7=this;return new Promise(function(_0x58b1ea,_0x158784){return db['SugarcrmAccount']['find']({'raw':_0x304c13[_0x39f8('0x15')]?_0x304c13[_0x39f8('0x15')][_0x39f8('0x16')]===undefined?!![]:![]:!![],'where':_0x304c13[_0x39f8('0x15')]?_0x304c13[_0x39f8('0x15')]['where']||null:null,'attributes':_0x304c13['options']?_0x304c13[_0x39f8('0x15')][_0x39f8('0x18')]||null:null,'include':_0x304c13[_0x39f8('0x15')]?_0x304c13[_0x39f8('0x15')][_0x39f8('0x1a')]?_[_0x39f8('0x1b')](_0x304c13[_0x39f8('0x15')]['include'],function(_0x20e9f3){return{'model':db[_0x20e9f3[_0x39f8('0x1c')]],'as':_0x20e9f3['as'],'attributes':_0x20e9f3['attributes'],'include':_0x20e9f3[_0x39f8('0x1a')]?_[_0x39f8('0x1b')](_0x20e9f3[_0x39f8('0x1a')],function(_0x2a2da3){return{'model':db[_0x2a2da3[_0x39f8('0x1c')]],'as':_0x2a2da3['as'],'attributes':_0x2a2da3[_0x39f8('0x18')],'include':_0x2a2da3[_0x39f8('0x1a')]?_[_0x39f8('0x1b')](_0x2a2da3[_0x39f8('0x1a')],function(_0x3dd6bd){return{'model':db[_0x3dd6bd[_0x39f8('0x1c')]],'as':_0x3dd6bd['as'],'attributes':_0x3dd6bd[_0x39f8('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42d8c0){logger[_0x39f8('0xb')]('ShowSugarcrmAccount',_0x304c13);logger[_0x39f8('0xd')](_0x39f8('0x1f'),_0x304c13,JSON[_0x39f8('0x10')](_0x42d8c0));_0x58b1ea(_0x42d8c0);})[_0x39f8('0x13')](function(_0x5f23fc){logger['error'](_0x39f8('0x1f'),_0x5f23fc['message'],_0x304c13);_0x158784(_0xdbf8e7[_0x39f8('0x11')](0x1f4,_0x5f23fc['message']));});});};
\ No newline at end of file
+var _0x4324=['model','map','ShowSugarcrmAccount','where','debug','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','attributes','limit','include'];(function(_0x3c97e3,_0x321677){var _0x9bb0ed=function(_0x3a0cb6){while(--_0x3a0cb6){_0x3c97e3['push'](_0x3c97e3['shift']());}};_0x9bb0ed(++_0x321677);}(_0x4324,0x7d));var _0x4432=function(_0x36f47c,_0x38ef4d){_0x36f47c=_0x36f47c-0x0;var _0x296c55=_0x4324[_0x36f47c];return _0x296c55;};'use strict';var _=require(_0x4432('0x0'));var util=require('util');var moment=require(_0x4432('0x1'));var BPromise=require(_0x4432('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4432('0x3'));var db=require(_0x4432('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4432('0x5'));var config=require(_0x4432('0x6'));var jayson=require(_0x4432('0x7'));var client=jayson['client'][_0x4432('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14b9dc,_0x40b5f1,_0x31be2a){return new BPromise(function(_0x4fde27,_0x23d165){return client[_0x4432('0x9')](_0x14b9dc,_0x31be2a)[_0x4432('0xa')](function(_0x2b6388){logger[_0x4432('0xb')](_0x4432('0xc'),_0x40b5f1,_0x4432('0xd'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x40b5f1,_0x4432('0xd'),JSON[_0x4432('0xe')](_0x2b6388));if(_0x2b6388[_0x4432('0xf')]){if(_0x2b6388[_0x4432('0xf')]['code']===0x1f4){logger[_0x4432('0xf')](_0x4432('0xc'),_0x40b5f1,_0x2b6388['error'][_0x4432('0x10')]);return _0x23d165(_0x2b6388[_0x4432('0xf')]['message']);}logger[_0x4432('0xf')](_0x4432('0xc'),_0x40b5f1,_0x2b6388[_0x4432('0xf')][_0x4432('0x10')]);return _0x4fde27(_0x2b6388['error'][_0x4432('0x10')]);}else{logger[_0x4432('0xb')](_0x4432('0xc'),_0x40b5f1,_0x4432('0xd'));_0x4fde27(_0x2b6388['result']['message']);}})[_0x4432('0x11')](function(_0x581be7){logger[_0x4432('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x40b5f1,_0x581be7);_0x23d165(_0x581be7);});});}exports[_0x4432('0x12')]=function(_0x31e078){var _0x26648e=this;return new Promise(function(_0x386caf,_0x4f8ed7){return db[_0x4432('0x13')]['findAll']({'raw':_0x31e078[_0x4432('0x14')]?_0x31e078[_0x4432('0x14')][_0x4432('0x15')]===undefined?!![]:![]:!![],'where':_0x31e078['options']?_0x31e078[_0x4432('0x14')]['where']||null:null,'attributes':_0x31e078[_0x4432('0x14')]?_0x31e078['options'][_0x4432('0x16')]||null:null,'limit':_0x31e078[_0x4432('0x14')]?_0x31e078[_0x4432('0x14')][_0x4432('0x17')]||null:null,'include':_0x31e078[_0x4432('0x14')]?_0x31e078[_0x4432('0x14')][_0x4432('0x18')]?_['map'](_0x31e078[_0x4432('0x14')][_0x4432('0x18')],function(_0x4eebe9){return{'model':db[_0x4eebe9[_0x4432('0x19')]],'as':_0x4eebe9['as'],'attributes':_0x4eebe9['attributes'],'include':_0x4eebe9[_0x4432('0x18')]?_[_0x4432('0x1a')](_0x4eebe9['include'],function(_0x16c0f2){return{'model':db[_0x16c0f2[_0x4432('0x19')]],'as':_0x16c0f2['as'],'attributes':_0x16c0f2['attributes'],'include':_0x16c0f2['include']?_[_0x4432('0x1a')](_0x16c0f2[_0x4432('0x18')],function(_0x1d2653){return{'model':db[_0x1d2653[_0x4432('0x19')]],'as':_0x1d2653['as'],'attributes':_0x1d2653[_0x4432('0x16')]};}):[]};}):[]};}):[]:[]})[_0x4432('0xa')](function(_0xa8e301){logger[_0x4432('0xb')](_0x4432('0x12'),_0x31e078);logger['debug']('GetSugarcrmAccount',_0x31e078,JSON[_0x4432('0xe')](_0xa8e301));_0x386caf(_0xa8e301);})[_0x4432('0x11')](function(_0x17362d){logger[_0x4432('0xf')]('GetSugarcrmAccount',_0x17362d[_0x4432('0x10')],_0x31e078);_0x4f8ed7(_0x26648e[_0x4432('0xf')](0x1f4,_0x17362d[_0x4432('0x10')]));});});};exports[_0x4432('0x1b')]=function(_0x4857dc){var _0x553f8c=this;return new Promise(function(_0x1ed979,_0x53a891){return db[_0x4432('0x13')]['find']({'raw':_0x4857dc[_0x4432('0x14')]?_0x4857dc[_0x4432('0x14')][_0x4432('0x15')]===undefined?!![]:![]:!![],'where':_0x4857dc[_0x4432('0x14')]?_0x4857dc[_0x4432('0x14')][_0x4432('0x1c')]||null:null,'attributes':_0x4857dc[_0x4432('0x14')]?_0x4857dc['options'][_0x4432('0x16')]||null:null,'include':_0x4857dc['options']?_0x4857dc[_0x4432('0x14')]['include']?_['map'](_0x4857dc[_0x4432('0x14')][_0x4432('0x18')],function(_0x17b18e){return{'model':db[_0x17b18e[_0x4432('0x19')]],'as':_0x17b18e['as'],'attributes':_0x17b18e[_0x4432('0x16')],'include':_0x17b18e[_0x4432('0x18')]?_[_0x4432('0x1a')](_0x17b18e[_0x4432('0x18')],function(_0x1ae5c9){return{'model':db[_0x1ae5c9['model']],'as':_0x1ae5c9['as'],'attributes':_0x1ae5c9[_0x4432('0x16')],'include':_0x1ae5c9[_0x4432('0x18')]?_[_0x4432('0x1a')](_0x1ae5c9[_0x4432('0x18')],function(_0x4392ae){return{'model':db[_0x4392ae['model']],'as':_0x4392ae['as'],'attributes':_0x4392ae[_0x4432('0x16')]};}):[]};}):[]};}):[]:[]})[_0x4432('0xa')](function(_0x200e32){logger['info'](_0x4432('0x1b'),_0x4857dc);logger[_0x4432('0x1d')](_0x4432('0x1b'),_0x4857dc,JSON[_0x4432('0xe')](_0x200e32));_0x1ed979(_0x200e32);})[_0x4432('0x11')](function(_0x476e6b){logger['error'](_0x4432('0x1b'),_0x476e6b['message'],_0x4857dc);_0x53a891(_0x553f8c[_0x4432('0xf')](0x1f4,_0x476e6b[_0x4432('0x10')]));});});};
\ No newline at end of file