Built motion from commit 26d08302.|2.6.31
[motion2.git] / server / api / intSugarcrmAccount / intSugarcrmAccount.rpc.js
index d85bb30..8d3fb54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c89=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SugarcrmAccount','findAll','options','raw','attributes','limit','include','map','model','then','GetSugarcrmAccount','debug','stringify','ShowSugarcrmAccount','find','where'];(function(_0x27f69e,_0x3efb52){var _0x19b1f7=function(_0x3ac39e){while(--_0x3ac39e){_0x27f69e['push'](_0x27f69e['shift']());}};_0x19b1f7(++_0x3efb52);}(_0x2c89,0x66));var _0x92c8=function(_0x5a84e1,_0x185db1){_0x5a84e1=_0x5a84e1-0x0;var _0x36b99a=_0x2c89[_0x5a84e1];return _0x36b99a;};'use strict';var _=require(_0x92c8('0x0'));var util=require(_0x92c8('0x1'));var moment=require(_0x92c8('0x2'));var BPromise=require(_0x92c8('0x3'));var rs=require(_0x92c8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92c8('0x5'))['db'];var utils=require(_0x92c8('0x6'));var logger=require(_0x92c8('0x7'))(_0x92c8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3eba72,_0x160f46,_0x338489){return new BPromise(function(_0x5b1bf1,_0x1502ce){return client['request'](_0x3eba72,_0x338489)['then'](function(_0x25cf30){logger[_0x92c8('0x9')](_0x92c8('0xa'),_0x160f46,_0x92c8('0xb'));logger['debug'](_0x92c8('0xc'),_0x160f46,_0x92c8('0xb'),JSON['stringify'](_0x25cf30));if(_0x25cf30[_0x92c8('0xd')]){if(_0x25cf30[_0x92c8('0xd')][_0x92c8('0xe')]===0x1f4){logger[_0x92c8('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x160f46,_0x25cf30['error'][_0x92c8('0xf')]);return _0x1502ce(_0x25cf30['error'][_0x92c8('0xf')]);}logger['error'](_0x92c8('0xa'),_0x160f46,_0x25cf30[_0x92c8('0xd')][_0x92c8('0xf')]);return _0x5b1bf1(_0x25cf30[_0x92c8('0xd')][_0x92c8('0xf')]);}else{logger[_0x92c8('0x9')](_0x92c8('0xa'),_0x160f46,_0x92c8('0xb'));_0x5b1bf1(_0x25cf30[_0x92c8('0x10')][_0x92c8('0xf')]);}})[_0x92c8('0x11')](function(_0x27c24f){logger[_0x92c8('0xd')](_0x92c8('0xa'),_0x160f46,_0x27c24f);_0x1502ce(_0x27c24f);});});}exports['GetSugarcrmAccount']=function(_0x4b8820){var _0x986d14=this;return new Promise(function(_0x5a7679,_0x46268f){return db[_0x92c8('0x12')][_0x92c8('0x13')]({'raw':_0x4b8820[_0x92c8('0x14')]?_0x4b8820[_0x92c8('0x14')][_0x92c8('0x15')]===undefined?!![]:![]:!![],'where':_0x4b8820[_0x92c8('0x14')]?_0x4b8820['options']['where']||null:null,'attributes':_0x4b8820[_0x92c8('0x14')]?_0x4b8820['options'][_0x92c8('0x16')]||null:null,'limit':_0x4b8820[_0x92c8('0x14')]?_0x4b8820[_0x92c8('0x14')][_0x92c8('0x17')]||null:null,'include':_0x4b8820[_0x92c8('0x14')]?_0x4b8820['options'][_0x92c8('0x18')]?_['map'](_0x4b8820[_0x92c8('0x14')][_0x92c8('0x18')],function(_0x253f6d){return{'model':db[_0x253f6d['model']],'as':_0x253f6d['as'],'attributes':_0x253f6d['attributes'],'include':_0x253f6d[_0x92c8('0x18')]?_[_0x92c8('0x19')](_0x253f6d[_0x92c8('0x18')],function(_0x42e3ef){return{'model':db[_0x42e3ef[_0x92c8('0x1a')]],'as':_0x42e3ef['as'],'attributes':_0x42e3ef['attributes'],'include':_0x42e3ef[_0x92c8('0x18')]?_[_0x92c8('0x19')](_0x42e3ef[_0x92c8('0x18')],function(_0x16439d){return{'model':db[_0x16439d[_0x92c8('0x1a')]],'as':_0x16439d['as'],'attributes':_0x16439d['attributes']};}):[]};}):[]};}):[]:[]})[_0x92c8('0x1b')](function(_0x274b9a){logger[_0x92c8('0x9')](_0x92c8('0x1c'),_0x4b8820);logger[_0x92c8('0x1d')](_0x92c8('0x1c'),_0x4b8820,JSON[_0x92c8('0x1e')](_0x274b9a));_0x5a7679(_0x274b9a);})[_0x92c8('0x11')](function(_0x23f599){logger[_0x92c8('0xd')](_0x92c8('0x1c'),_0x23f599[_0x92c8('0xf')],_0x4b8820);_0x46268f(_0x986d14['error'](0x1f4,_0x23f599['message']));});});};exports[_0x92c8('0x1f')]=function(_0x3ee754){var _0x1cfac2=this;return new Promise(function(_0x18d1e7,_0x196037){return db[_0x92c8('0x12')][_0x92c8('0x20')]({'raw':_0x3ee754[_0x92c8('0x14')]?_0x3ee754['options']['raw']===undefined?!![]:![]:!![],'where':_0x3ee754[_0x92c8('0x14')]?_0x3ee754[_0x92c8('0x14')][_0x92c8('0x21')]||null:null,'attributes':_0x3ee754[_0x92c8('0x14')]?_0x3ee754[_0x92c8('0x14')][_0x92c8('0x16')]||null:null,'include':_0x3ee754[_0x92c8('0x14')]?_0x3ee754['options'][_0x92c8('0x18')]?_[_0x92c8('0x19')](_0x3ee754[_0x92c8('0x14')][_0x92c8('0x18')],function(_0x435e9b){return{'model':db[_0x435e9b['model']],'as':_0x435e9b['as'],'attributes':_0x435e9b[_0x92c8('0x16')],'include':_0x435e9b['include']?_[_0x92c8('0x19')](_0x435e9b[_0x92c8('0x18')],function(_0x14cc1f){return{'model':db[_0x14cc1f[_0x92c8('0x1a')]],'as':_0x14cc1f['as'],'attributes':_0x14cc1f[_0x92c8('0x16')],'include':_0x14cc1f[_0x92c8('0x18')]?_[_0x92c8('0x19')](_0x14cc1f['include'],function(_0x24bea1){return{'model':db[_0x24bea1[_0x92c8('0x1a')]],'as':_0x24bea1['as'],'attributes':_0x24bea1[_0x92c8('0x16')]};}):[]};}):[]};}):[]:[]})[_0x92c8('0x1b')](function(_0x190d7c){logger[_0x92c8('0x9')](_0x92c8('0x1f'),_0x3ee754);logger[_0x92c8('0x1d')]('ShowSugarcrmAccount',_0x3ee754,JSON['stringify'](_0x190d7c));_0x18d1e7(_0x190d7c);})['catch'](function(_0x15c351){logger['error']('ShowSugarcrmAccount',_0x15c351[_0x92c8('0xf')],_0x3ee754);_0x196037(_0x1cfac2[_0x92c8('0xd')](0x1f4,_0x15c351['message']));});});};
\ No newline at end of file
+var _0x13c7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSugarcrmAccount','findAll','options','raw','where','attributes','limit','include','model','ShowSugarcrmAccount','find','map','then','lodash','util','moment','randomstring'];(function(_0x38d7c9,_0x19ba65){var _0x5ac6eb=function(_0x1f51cc){while(--_0x1f51cc){_0x38d7c9['push'](_0x38d7c9['shift']());}};_0x5ac6eb(++_0x19ba65);}(_0x13c7,0xb0));var _0x713c=function(_0x283c77,_0x197b2c){_0x283c77=_0x283c77-0x0;var _0x5450af=_0x13c7[_0x283c77];return _0x5450af;};'use strict';var _=require(_0x713c('0x0'));var util=require(_0x713c('0x1'));var moment=require(_0x713c('0x2'));var BPromise=require('bluebird');var rs=require(_0x713c('0x3'));var fs=require('fs');var Redis=require(_0x713c('0x4'));var db=require(_0x713c('0x5'))['db'];var utils=require(_0x713c('0x6'));var logger=require(_0x713c('0x7'))(_0x713c('0x8'));var config=require(_0x713c('0x9'));var jayson=require(_0x713c('0xa'));var client=jayson['client'][_0x713c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f8d29,_0x37542f,_0x3a91f0){return new BPromise(function(_0x2f944f,_0x2eba94){return client[_0x713c('0xc')](_0x3f8d29,_0x3a91f0)['then'](function(_0x4aedd6){logger[_0x713c('0xd')](_0x713c('0xe'),_0x37542f,_0x713c('0xf'));logger[_0x713c('0x10')](_0x713c('0x11'),_0x37542f,_0x713c('0xf'),JSON[_0x713c('0x12')](_0x4aedd6));if(_0x4aedd6['error']){if(_0x4aedd6['error']['code']===0x1f4){logger[_0x713c('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x37542f,_0x4aedd6[_0x713c('0x13')]['message']);return _0x2eba94(_0x4aedd6[_0x713c('0x13')][_0x713c('0x14')]);}logger[_0x713c('0x13')](_0x713c('0xe'),_0x37542f,_0x4aedd6[_0x713c('0x13')][_0x713c('0x14')]);return _0x2f944f(_0x4aedd6[_0x713c('0x13')][_0x713c('0x14')]);}else{logger[_0x713c('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x37542f,_0x713c('0xf'));_0x2f944f(_0x4aedd6[_0x713c('0x15')][_0x713c('0x14')]);}})[_0x713c('0x16')](function(_0xc7b160){logger[_0x713c('0x13')](_0x713c('0xe'),_0x37542f,_0xc7b160);_0x2eba94(_0xc7b160);});});}exports[_0x713c('0x17')]=function(_0x43ced8){var _0x231297=this;return new Promise(function(_0x4019ea,_0x59ac7a){return db['SugarcrmAccount'][_0x713c('0x18')]({'raw':_0x43ced8[_0x713c('0x19')]?_0x43ced8[_0x713c('0x19')][_0x713c('0x1a')]===undefined?!![]:![]:!![],'where':_0x43ced8['options']?_0x43ced8[_0x713c('0x19')][_0x713c('0x1b')]||null:null,'attributes':_0x43ced8[_0x713c('0x19')]?_0x43ced8[_0x713c('0x19')][_0x713c('0x1c')]||null:null,'limit':_0x43ced8[_0x713c('0x19')]?_0x43ced8[_0x713c('0x19')][_0x713c('0x1d')]||null:null,'include':_0x43ced8['options']?_0x43ced8[_0x713c('0x19')][_0x713c('0x1e')]?_['map'](_0x43ced8[_0x713c('0x19')][_0x713c('0x1e')],function(_0x15a6ec){return{'model':db[_0x15a6ec[_0x713c('0x1f')]],'as':_0x15a6ec['as'],'attributes':_0x15a6ec[_0x713c('0x1c')],'include':_0x15a6ec[_0x713c('0x1e')]?_['map'](_0x15a6ec[_0x713c('0x1e')],function(_0x844fea){return{'model':db[_0x844fea[_0x713c('0x1f')]],'as':_0x844fea['as'],'attributes':_0x844fea[_0x713c('0x1c')],'include':_0x844fea[_0x713c('0x1e')]?_['map'](_0x844fea['include'],function(_0x140a58){return{'model':db[_0x140a58[_0x713c('0x1f')]],'as':_0x140a58['as'],'attributes':_0x140a58['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x396263){logger[_0x713c('0xd')](_0x713c('0x17'),_0x43ced8);logger['debug'](_0x713c('0x17'),_0x43ced8,JSON[_0x713c('0x12')](_0x396263));_0x4019ea(_0x396263);})['catch'](function(_0x552cb4){logger[_0x713c('0x13')](_0x713c('0x17'),_0x552cb4[_0x713c('0x14')],_0x43ced8);_0x59ac7a(_0x231297[_0x713c('0x13')](0x1f4,_0x552cb4['message']));});});};exports[_0x713c('0x20')]=function(_0x58e38d){var _0x392b42=this;return new Promise(function(_0x305024,_0x5cfac0){return db['SugarcrmAccount'][_0x713c('0x21')]({'raw':_0x58e38d[_0x713c('0x19')]?_0x58e38d['options'][_0x713c('0x1a')]===undefined?!![]:![]:!![],'where':_0x58e38d[_0x713c('0x19')]?_0x58e38d['options'][_0x713c('0x1b')]||null:null,'attributes':_0x58e38d[_0x713c('0x19')]?_0x58e38d[_0x713c('0x19')][_0x713c('0x1c')]||null:null,'include':_0x58e38d[_0x713c('0x19')]?_0x58e38d[_0x713c('0x19')][_0x713c('0x1e')]?_['map'](_0x58e38d[_0x713c('0x19')]['include'],function(_0x2fc7fb){return{'model':db[_0x2fc7fb[_0x713c('0x1f')]],'as':_0x2fc7fb['as'],'attributes':_0x2fc7fb['attributes'],'include':_0x2fc7fb[_0x713c('0x1e')]?_[_0x713c('0x22')](_0x2fc7fb[_0x713c('0x1e')],function(_0x472ed8){return{'model':db[_0x472ed8[_0x713c('0x1f')]],'as':_0x472ed8['as'],'attributes':_0x472ed8[_0x713c('0x1c')],'include':_0x472ed8[_0x713c('0x1e')]?_['map'](_0x472ed8[_0x713c('0x1e')],function(_0x210736){return{'model':db[_0x210736['model']],'as':_0x210736['as'],'attributes':_0x210736['attributes']};}):[]};}):[]};}):[]:[]})[_0x713c('0x23')](function(_0x3f5283){logger['info'](_0x713c('0x20'),_0x58e38d);logger['debug'](_0x713c('0x20'),_0x58e38d,JSON[_0x713c('0x12')](_0x3f5283));_0x305024(_0x3f5283);})[_0x713c('0x16')](function(_0x3d5fb0){logger['error'](_0x713c('0x20'),_0x3d5fb0[_0x713c('0x14')],_0x58e38d);_0x5cfac0(_0x392b42['error'](0x1f4,_0x3d5fb0[_0x713c('0x14')]));});});};
\ No newline at end of file