Built motion from commit cafec4f3.|2.6.31
[motion2.git] / server / api / intSugarcrmAccount / intSugarcrmAccount.rpc.js
index 9b214e5..6917967 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2650=['request\x20sent','stringify','error','message','result','SugarcrmAccount','findAll','options','where','attributes','limit','include','map','model','GetSugarcrmAccount','debug','catch','ShowSugarcrmAccount','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s'];(function(_0x5e6a3e,_0x298659){var _0x530c52=function(_0x27ac64){while(--_0x27ac64){_0x5e6a3e['push'](_0x5e6a3e['shift']());}};_0x530c52(++_0x298659);}(_0x2650,0x117));var _0x0265=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x2650[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x0265('0x0'));var util=require('util');var moment=require(_0x0265('0x1'));var BPromise=require(_0x0265('0x2'));var rs=require(_0x0265('0x3'));var fs=require('fs');var Redis=require(_0x0265('0x4'));var db=require(_0x0265('0x5'))['db'];var utils=require(_0x0265('0x6'));var logger=require(_0x0265('0x7'))(_0x0265('0x8'));var config=require(_0x0265('0x9'));var jayson=require(_0x0265('0xa'));var client=jayson[_0x0265('0xb')][_0x0265('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b37f2,_0x593d18,_0x61b3a9){return new BPromise(function(_0x47bfaf,_0x4276e6){return client[_0x0265('0xd')](_0x5b37f2,_0x61b3a9)[_0x0265('0xe')](function(_0x204253){logger[_0x0265('0xf')](_0x0265('0x10'),_0x593d18,_0x0265('0x11'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x593d18,_0x0265('0x11'),JSON[_0x0265('0x12')](_0x204253));if(_0x204253[_0x0265('0x13')]){if(_0x204253[_0x0265('0x13')]['code']===0x1f4){logger['error'](_0x0265('0x10'),_0x593d18,_0x204253[_0x0265('0x13')][_0x0265('0x14')]);return _0x4276e6(_0x204253[_0x0265('0x13')][_0x0265('0x14')]);}logger[_0x0265('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x593d18,_0x204253[_0x0265('0x13')]['message']);return _0x47bfaf(_0x204253['error'][_0x0265('0x14')]);}else{logger[_0x0265('0xf')](_0x0265('0x10'),_0x593d18,_0x0265('0x11'));_0x47bfaf(_0x204253[_0x0265('0x15')][_0x0265('0x14')]);}})['catch'](function(_0x2f314c){logger[_0x0265('0x13')](_0x0265('0x10'),_0x593d18,_0x2f314c);_0x4276e6(_0x2f314c);});});}exports['GetSugarcrmAccount']=function(_0x401af){var _0x2da7d2=this;return new Promise(function(_0xcd749,_0x24af56){return db[_0x0265('0x16')][_0x0265('0x17')]({'raw':_0x401af[_0x0265('0x18')]?_0x401af['options']['raw']===undefined?!![]:![]:!![],'where':_0x401af['options']?_0x401af[_0x0265('0x18')][_0x0265('0x19')]||null:null,'attributes':_0x401af[_0x0265('0x18')]?_0x401af[_0x0265('0x18')][_0x0265('0x1a')]||null:null,'limit':_0x401af[_0x0265('0x18')]?_0x401af[_0x0265('0x18')][_0x0265('0x1b')]||null:null,'include':_0x401af[_0x0265('0x18')]?_0x401af[_0x0265('0x18')][_0x0265('0x1c')]?_[_0x0265('0x1d')](_0x401af['options']['include'],function(_0x5e1c76){return{'model':db[_0x5e1c76[_0x0265('0x1e')]],'as':_0x5e1c76['as'],'attributes':_0x5e1c76[_0x0265('0x1a')],'include':_0x5e1c76[_0x0265('0x1c')]?_[_0x0265('0x1d')](_0x5e1c76[_0x0265('0x1c')],function(_0x354f17){return{'model':db[_0x354f17[_0x0265('0x1e')]],'as':_0x354f17['as'],'attributes':_0x354f17[_0x0265('0x1a')],'include':_0x354f17[_0x0265('0x1c')]?_['map'](_0x354f17['include'],function(_0x583d41){return{'model':db[_0x583d41['model']],'as':_0x583d41['as'],'attributes':_0x583d41[_0x0265('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0265('0xe')](function(_0x5cdfdd){logger['info'](_0x0265('0x1f'),_0x401af);logger[_0x0265('0x20')]('GetSugarcrmAccount',_0x401af,JSON[_0x0265('0x12')](_0x5cdfdd));_0xcd749(_0x5cdfdd);})[_0x0265('0x21')](function(_0x54266d){logger[_0x0265('0x13')](_0x0265('0x1f'),_0x54266d['message'],_0x401af);_0x24af56(_0x2da7d2[_0x0265('0x13')](0x1f4,_0x54266d[_0x0265('0x14')]));});});};exports[_0x0265('0x22')]=function(_0x28f4bd){var _0xde5a88=this;return new Promise(function(_0x48c3d8,_0x2cb42f){return db[_0x0265('0x16')][_0x0265('0x23')]({'raw':_0x28f4bd[_0x0265('0x18')]?_0x28f4bd['options'][_0x0265('0x24')]===undefined?!![]:![]:!![],'where':_0x28f4bd[_0x0265('0x18')]?_0x28f4bd['options'][_0x0265('0x19')]||null:null,'attributes':_0x28f4bd['options']?_0x28f4bd[_0x0265('0x18')][_0x0265('0x1a')]||null:null,'include':_0x28f4bd[_0x0265('0x18')]?_0x28f4bd[_0x0265('0x18')][_0x0265('0x1c')]?_[_0x0265('0x1d')](_0x28f4bd[_0x0265('0x18')]['include'],function(_0x122d40){return{'model':db[_0x122d40['model']],'as':_0x122d40['as'],'attributes':_0x122d40[_0x0265('0x1a')],'include':_0x122d40[_0x0265('0x1c')]?_[_0x0265('0x1d')](_0x122d40[_0x0265('0x1c')],function(_0x380e10){return{'model':db[_0x380e10[_0x0265('0x1e')]],'as':_0x380e10['as'],'attributes':_0x380e10[_0x0265('0x1a')],'include':_0x380e10['include']?_[_0x0265('0x1d')](_0x380e10[_0x0265('0x1c')],function(_0x323394){return{'model':db[_0x323394[_0x0265('0x1e')]],'as':_0x323394['as'],'attributes':_0x323394[_0x0265('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0265('0xe')](function(_0x6b320e){logger[_0x0265('0xf')](_0x0265('0x22'),_0x28f4bd);logger[_0x0265('0x20')](_0x0265('0x22'),_0x28f4bd,JSON[_0x0265('0x12')](_0x6b320e));_0x48c3d8(_0x6b320e);})[_0x0265('0x21')](function(_0x39e553){logger[_0x0265('0x13')](_0x0265('0x22'),_0x39e553[_0x0265('0x14')],_0x28f4bd);_0x2cb42f(_0xde5a88[_0x0265('0x13')](0x1f4,_0x39e553[_0x0265('0x14')]));});});};
\ No newline at end of file
+var _0x8c9d=['GetSugarcrmAccount','debug','find','ShowSugarcrmAccount','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','SugarcrmAccount','options','raw','where','attributes','limit','include','map','model','then'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8c9d,0xe3));var _0xd8c9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8c9d[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xd8c9('0x0'));var util=require(_0xd8c9('0x1'));var moment=require(_0xd8c9('0x2'));var BPromise=require(_0xd8c9('0x3'));var rs=require(_0xd8c9('0x4'));var fs=require('fs');var Redis=require(_0xd8c9('0x5'));var db=require(_0xd8c9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd8c9('0x7'))(_0xd8c9('0x8'));var config=require(_0xd8c9('0x9'));var jayson=require(_0xd8c9('0xa'));var client=jayson[_0xd8c9('0xb')][_0xd8c9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c5a05,_0x449ca4,_0x37f30d){return new BPromise(function(_0x13d006,_0x3d32fa){return client[_0xd8c9('0xd')](_0x3c5a05,_0x37f30d)['then'](function(_0x47cdbe){logger['info'](_0xd8c9('0xe'),_0x449ca4,_0xd8c9('0xf'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x449ca4,_0xd8c9('0xf'),JSON['stringify'](_0x47cdbe));if(_0x47cdbe['error']){if(_0x47cdbe[_0xd8c9('0x10')][_0xd8c9('0x11')]===0x1f4){logger[_0xd8c9('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x449ca4,_0x47cdbe['error'][_0xd8c9('0x12')]);return _0x3d32fa(_0x47cdbe['error'][_0xd8c9('0x12')]);}logger[_0xd8c9('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x449ca4,_0x47cdbe[_0xd8c9('0x10')][_0xd8c9('0x12')]);return _0x13d006(_0x47cdbe[_0xd8c9('0x10')]['message']);}else{logger[_0xd8c9('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x449ca4,_0xd8c9('0xf'));_0x13d006(_0x47cdbe[_0xd8c9('0x14')]['message']);}})[_0xd8c9('0x15')](function(_0xc24939){logger[_0xd8c9('0x10')](_0xd8c9('0xe'),_0x449ca4,_0xc24939);_0x3d32fa(_0xc24939);});});}exports['GetSugarcrmAccount']=function(_0x446305){var _0x583861=this;return new Promise(function(_0x1db8da,_0x2f968e){return db[_0xd8c9('0x16')]['findAll']({'raw':_0x446305[_0xd8c9('0x17')]?_0x446305[_0xd8c9('0x17')][_0xd8c9('0x18')]===undefined?!![]:![]:!![],'where':_0x446305[_0xd8c9('0x17')]?_0x446305[_0xd8c9('0x17')][_0xd8c9('0x19')]||null:null,'attributes':_0x446305[_0xd8c9('0x17')]?_0x446305[_0xd8c9('0x17')][_0xd8c9('0x1a')]||null:null,'limit':_0x446305['options']?_0x446305[_0xd8c9('0x17')][_0xd8c9('0x1b')]||null:null,'include':_0x446305[_0xd8c9('0x17')]?_0x446305['options'][_0xd8c9('0x1c')]?_[_0xd8c9('0x1d')](_0x446305['options'][_0xd8c9('0x1c')],function(_0x3009e5){return{'model':db[_0x3009e5[_0xd8c9('0x1e')]],'as':_0x3009e5['as'],'attributes':_0x3009e5[_0xd8c9('0x1a')],'include':_0x3009e5['include']?_['map'](_0x3009e5['include'],function(_0x46c73e){return{'model':db[_0x46c73e[_0xd8c9('0x1e')]],'as':_0x46c73e['as'],'attributes':_0x46c73e['attributes'],'include':_0x46c73e[_0xd8c9('0x1c')]?_[_0xd8c9('0x1d')](_0x46c73e[_0xd8c9('0x1c')],function(_0x4cdb10){return{'model':db[_0x4cdb10[_0xd8c9('0x1e')]],'as':_0x4cdb10['as'],'attributes':_0x4cdb10[_0xd8c9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd8c9('0x1f')](function(_0x4600be){logger[_0xd8c9('0x13')](_0xd8c9('0x20'),_0x446305);logger[_0xd8c9('0x21')]('GetSugarcrmAccount',_0x446305,JSON['stringify'](_0x4600be));_0x1db8da(_0x4600be);})[_0xd8c9('0x15')](function(_0x5bbcf2){logger[_0xd8c9('0x10')](_0xd8c9('0x20'),_0x5bbcf2['message'],_0x446305);_0x2f968e(_0x583861[_0xd8c9('0x10')](0x1f4,_0x5bbcf2[_0xd8c9('0x12')]));});});};exports['ShowSugarcrmAccount']=function(_0x59f8b6){var _0x4d406c=this;return new Promise(function(_0x276695,_0x5013e1){return db[_0xd8c9('0x16')][_0xd8c9('0x22')]({'raw':_0x59f8b6[_0xd8c9('0x17')]?_0x59f8b6[_0xd8c9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x59f8b6[_0xd8c9('0x17')]?_0x59f8b6['options'][_0xd8c9('0x19')]||null:null,'attributes':_0x59f8b6['options']?_0x59f8b6[_0xd8c9('0x17')][_0xd8c9('0x1a')]||null:null,'include':_0x59f8b6[_0xd8c9('0x17')]?_0x59f8b6[_0xd8c9('0x17')]['include']?_[_0xd8c9('0x1d')](_0x59f8b6[_0xd8c9('0x17')][_0xd8c9('0x1c')],function(_0x3d355b){return{'model':db[_0x3d355b[_0xd8c9('0x1e')]],'as':_0x3d355b['as'],'attributes':_0x3d355b[_0xd8c9('0x1a')],'include':_0x3d355b['include']?_[_0xd8c9('0x1d')](_0x3d355b[_0xd8c9('0x1c')],function(_0x52addd){return{'model':db[_0x52addd[_0xd8c9('0x1e')]],'as':_0x52addd['as'],'attributes':_0x52addd[_0xd8c9('0x1a')],'include':_0x52addd['include']?_['map'](_0x52addd[_0xd8c9('0x1c')],function(_0x5e189f){return{'model':db[_0x5e189f[_0xd8c9('0x1e')]],'as':_0x5e189f['as'],'attributes':_0x5e189f[_0xd8c9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd8c9('0x1f')](function(_0x79a122){logger[_0xd8c9('0x13')](_0xd8c9('0x23'),_0x59f8b6);logger[_0xd8c9('0x21')](_0xd8c9('0x23'),_0x59f8b6,JSON[_0xd8c9('0x24')](_0x79a122));_0x276695(_0x79a122);})['catch'](function(_0x9d61bd){logger[_0xd8c9('0x10')]('ShowSugarcrmAccount',_0x9d61bd[_0xd8c9('0x12')],_0x59f8b6);_0x5013e1(_0x4d406c[_0xd8c9('0x10')](0x1f4,_0x9d61bd[_0xd8c9('0x12')]));});});};
\ No newline at end of file