Built motion from commit (unavailable).|2.5.1
[motion2.git] / server / api / intSugarcrmAccount / intSugarcrmAccount.rpc.js
index 77f39c6..0c1ad84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35ab=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','limit','include','map','attributes','model','info','debug','ShowSugarcrmAccount','find','then'];(function(_0x26b35d,_0x5036ab){var _0x549d4d=function(_0x467d2e){while(--_0x467d2e){_0x26b35d['push'](_0x26b35d['shift']());}};_0x549d4d(++_0x5036ab);}(_0x35ab,0x168));var _0xb35a=function(_0x44c583,_0xdc4d48){_0x44c583=_0x44c583-0x0;var _0x396a41=_0x35ab[_0x44c583];return _0x396a41;};'use strict';var _=require('lodash');var util=require(_0xb35a('0x0'));var moment=require('moment');var BPromise=require(_0xb35a('0x1'));var rs=require(_0xb35a('0x2'));var fs=require('fs');var Redis=require(_0xb35a('0x3'));var db=require(_0xb35a('0x4'))['db'];var utils=require(_0xb35a('0x5'));var logger=require(_0xb35a('0x6'))(_0xb35a('0x7'));var config=require('../../config/environment');var jayson=require(_0xb35a('0x8'));var client=jayson[_0xb35a('0x9')][_0xb35a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58441d,_0x18970b,_0x5fb009){return new BPromise(function(_0x57f55a,_0x1547f3){return client[_0xb35a('0xb')](_0x58441d,_0x5fb009)['then'](function(_0x277903){logger['info'](_0xb35a('0xc'),_0x18970b,'request\x20sent');logger['debug'](_0xb35a('0xd'),_0x18970b,'request\x20sent',JSON[_0xb35a('0xe')](_0x277903));if(_0x277903['error']){if(_0x277903[_0xb35a('0xf')]['code']===0x1f4){logger[_0xb35a('0xf')](_0xb35a('0xc'),_0x18970b,_0x277903[_0xb35a('0xf')][_0xb35a('0x10')]);return _0x1547f3(_0x277903['error'][_0xb35a('0x10')]);}logger[_0xb35a('0xf')](_0xb35a('0xc'),_0x18970b,_0x277903[_0xb35a('0xf')][_0xb35a('0x10')]);return _0x57f55a(_0x277903[_0xb35a('0xf')]['message']);}else{logger['info'](_0xb35a('0xc'),_0x18970b,_0xb35a('0x11'));_0x57f55a(_0x277903[_0xb35a('0x12')][_0xb35a('0x10')]);}})[_0xb35a('0x13')](function(_0x3dafcb){logger[_0xb35a('0xf')](_0xb35a('0xc'),_0x18970b,_0x3dafcb);_0x1547f3(_0x3dafcb);});});}exports[_0xb35a('0x14')]=function(_0x32a2b0){var _0x45b6ba=this;return new Promise(function(_0x51c1fd,_0x2b0ec8){return db[_0xb35a('0x15')][_0xb35a('0x16')]({'raw':_0x32a2b0[_0xb35a('0x17')]?_0x32a2b0[_0xb35a('0x17')][_0xb35a('0x18')]===undefined?!![]:![]:!![],'where':_0x32a2b0[_0xb35a('0x17')]?_0x32a2b0[_0xb35a('0x17')][_0xb35a('0x19')]||null:null,'attributes':_0x32a2b0[_0xb35a('0x17')]?_0x32a2b0['options']['attributes']||null:null,'limit':_0x32a2b0[_0xb35a('0x17')]?_0x32a2b0[_0xb35a('0x17')][_0xb35a('0x1a')]||null:null,'include':_0x32a2b0['options']?_0x32a2b0[_0xb35a('0x17')][_0xb35a('0x1b')]?_[_0xb35a('0x1c')](_0x32a2b0['options'][_0xb35a('0x1b')],function(_0x583432){return{'model':db[_0x583432['model']],'as':_0x583432['as'],'attributes':_0x583432[_0xb35a('0x1d')],'include':_0x583432[_0xb35a('0x1b')]?_[_0xb35a('0x1c')](_0x583432['include'],function(_0x4b1223){return{'model':db[_0x4b1223[_0xb35a('0x1e')]],'as':_0x4b1223['as'],'attributes':_0x4b1223['attributes'],'include':_0x4b1223[_0xb35a('0x1b')]?_[_0xb35a('0x1c')](_0x4b1223[_0xb35a('0x1b')],function(_0x46775d){return{'model':db[_0x46775d[_0xb35a('0x1e')]],'as':_0x46775d['as'],'attributes':_0x46775d[_0xb35a('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34b87b){logger[_0xb35a('0x1f')](_0xb35a('0x14'),_0x32a2b0);logger[_0xb35a('0x20')]('GetSugarcrmAccount',_0x32a2b0,JSON[_0xb35a('0xe')](_0x34b87b));_0x51c1fd(_0x34b87b);})[_0xb35a('0x13')](function(_0x55583b){logger[_0xb35a('0xf')](_0xb35a('0x14'),_0x55583b[_0xb35a('0x10')],_0x32a2b0);_0x2b0ec8(_0x45b6ba['error'](0x1f4,_0x55583b['message']));});});};exports[_0xb35a('0x21')]=function(_0x4f9813){var _0x29af43=this;return new Promise(function(_0x1cf817,_0x3bf20c){return db[_0xb35a('0x15')][_0xb35a('0x22')]({'raw':_0x4f9813[_0xb35a('0x17')]?_0x4f9813['options'][_0xb35a('0x18')]===undefined?!![]:![]:!![],'where':_0x4f9813[_0xb35a('0x17')]?_0x4f9813[_0xb35a('0x17')][_0xb35a('0x19')]||null:null,'attributes':_0x4f9813[_0xb35a('0x17')]?_0x4f9813[_0xb35a('0x17')][_0xb35a('0x1d')]||null:null,'include':_0x4f9813[_0xb35a('0x17')]?_0x4f9813['options'][_0xb35a('0x1b')]?_['map'](_0x4f9813[_0xb35a('0x17')]['include'],function(_0x11f417){return{'model':db[_0x11f417[_0xb35a('0x1e')]],'as':_0x11f417['as'],'attributes':_0x11f417[_0xb35a('0x1d')],'include':_0x11f417['include']?_['map'](_0x11f417[_0xb35a('0x1b')],function(_0x7053fb){return{'model':db[_0x7053fb[_0xb35a('0x1e')]],'as':_0x7053fb['as'],'attributes':_0x7053fb[_0xb35a('0x1d')],'include':_0x7053fb[_0xb35a('0x1b')]?_['map'](_0x7053fb[_0xb35a('0x1b')],function(_0x182640){return{'model':db[_0x182640[_0xb35a('0x1e')]],'as':_0x182640['as'],'attributes':_0x182640[_0xb35a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb35a('0x23')](function(_0x72eb6b){logger['info'](_0xb35a('0x21'),_0x4f9813);logger[_0xb35a('0x20')](_0xb35a('0x21'),_0x4f9813,JSON[_0xb35a('0xe')](_0x72eb6b));_0x1cf817(_0x72eb6b);})[_0xb35a('0x13')](function(_0x4cbbe9){logger[_0xb35a('0xf')](_0xb35a('0x21'),_0x4cbbe9['message'],_0x4f9813);_0x3bf20c(_0x29af43['error'](0x1f4,_0x4cbbe9[_0xb35a('0x10')]));});});};
\ No newline at end of file
+var _0x7f3e=['where','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','attributes','limit','include','map','model','ShowSugarcrmAccount','raw'];(function(_0x59935e,_0x1ab542){var _0x50832c=function(_0x49594b){while(--_0x49594b){_0x59935e['push'](_0x59935e['shift']());}};_0x50832c(++_0x1ab542);}(_0x7f3e,0xa6));var _0xe7f3=function(_0x3a9940,_0x1de435){_0x3a9940=_0x3a9940-0x0;var _0x28aba5=_0x7f3e[_0x3a9940];return _0x28aba5;};'use strict';var _=require('lodash');var util=require(_0xe7f3('0x0'));var moment=require('moment');var BPromise=require(_0xe7f3('0x1'));var rs=require(_0xe7f3('0x2'));var fs=require('fs');var Redis=require(_0xe7f3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7f3('0x4'));var logger=require('../../config/logger')(_0xe7f3('0x5'));var config=require('../../config/environment');var jayson=require(_0xe7f3('0x6'));var client=jayson[_0xe7f3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ac3ec,_0x5f2643,_0x5820dc){return new BPromise(function(_0x45bdca,_0xe43616){return client[_0xe7f3('0x8')](_0x2ac3ec,_0x5820dc)[_0xe7f3('0x9')](function(_0xda1331){logger[_0xe7f3('0xa')]('SugarcrmAccount,\x20%s,\x20%s',_0x5f2643,_0xe7f3('0xb'));logger[_0xe7f3('0xc')](_0xe7f3('0xd'),_0x5f2643,_0xe7f3('0xb'),JSON[_0xe7f3('0xe')](_0xda1331));if(_0xda1331['error']){if(_0xda1331[_0xe7f3('0xf')][_0xe7f3('0x10')]===0x1f4){logger['error'](_0xe7f3('0x11'),_0x5f2643,_0xda1331[_0xe7f3('0xf')][_0xe7f3('0x12')]);return _0xe43616(_0xda1331['error'][_0xe7f3('0x12')]);}logger[_0xe7f3('0xf')](_0xe7f3('0x11'),_0x5f2643,_0xda1331[_0xe7f3('0xf')][_0xe7f3('0x12')]);return _0x45bdca(_0xda1331['error'][_0xe7f3('0x12')]);}else{logger[_0xe7f3('0xa')](_0xe7f3('0x11'),_0x5f2643,_0xe7f3('0xb'));_0x45bdca(_0xda1331[_0xe7f3('0x13')][_0xe7f3('0x12')]);}})[_0xe7f3('0x14')](function(_0x5b67d8){logger[_0xe7f3('0xf')](_0xe7f3('0x11'),_0x5f2643,_0x5b67d8);_0xe43616(_0x5b67d8);});});}exports[_0xe7f3('0x15')]=function(_0x3082f7){var _0x2abade=this;return new Promise(function(_0x25c6c2,_0x3cbd81){return db[_0xe7f3('0x16')][_0xe7f3('0x17')]({'raw':_0x3082f7[_0xe7f3('0x18')]?_0x3082f7['options']['raw']===undefined?!![]:![]:!![],'where':_0x3082f7['options']?_0x3082f7[_0xe7f3('0x18')]['where']||null:null,'attributes':_0x3082f7[_0xe7f3('0x18')]?_0x3082f7[_0xe7f3('0x18')][_0xe7f3('0x19')]||null:null,'limit':_0x3082f7[_0xe7f3('0x18')]?_0x3082f7['options'][_0xe7f3('0x1a')]||null:null,'include':_0x3082f7[_0xe7f3('0x18')]?_0x3082f7['options'][_0xe7f3('0x1b')]?_[_0xe7f3('0x1c')](_0x3082f7['options'][_0xe7f3('0x1b')],function(_0x1c4c81){return{'model':db[_0x1c4c81[_0xe7f3('0x1d')]],'as':_0x1c4c81['as'],'attributes':_0x1c4c81[_0xe7f3('0x19')],'include':_0x1c4c81['include']?_[_0xe7f3('0x1c')](_0x1c4c81[_0xe7f3('0x1b')],function(_0x3f7101){return{'model':db[_0x3f7101[_0xe7f3('0x1d')]],'as':_0x3f7101['as'],'attributes':_0x3f7101['attributes'],'include':_0x3f7101[_0xe7f3('0x1b')]?_[_0xe7f3('0x1c')](_0x3f7101[_0xe7f3('0x1b')],function(_0x50faa3){return{'model':db[_0x50faa3['model']],'as':_0x50faa3['as'],'attributes':_0x50faa3[_0xe7f3('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ead42){logger[_0xe7f3('0xa')](_0xe7f3('0x15'),_0x3082f7);logger[_0xe7f3('0xc')](_0xe7f3('0x15'),_0x3082f7,JSON['stringify'](_0x2ead42));_0x25c6c2(_0x2ead42);})[_0xe7f3('0x14')](function(_0x58e3e5){logger[_0xe7f3('0xf')](_0xe7f3('0x15'),_0x58e3e5[_0xe7f3('0x12')],_0x3082f7);_0x3cbd81(_0x2abade[_0xe7f3('0xf')](0x1f4,_0x58e3e5[_0xe7f3('0x12')]));});});};exports[_0xe7f3('0x1e')]=function(_0x12c8a0){var _0x59af39=this;return new Promise(function(_0x48e0a1,_0x58ca18){return db['SugarcrmAccount']['find']({'raw':_0x12c8a0[_0xe7f3('0x18')]?_0x12c8a0['options'][_0xe7f3('0x1f')]===undefined?!![]:![]:!![],'where':_0x12c8a0[_0xe7f3('0x18')]?_0x12c8a0['options'][_0xe7f3('0x20')]||null:null,'attributes':_0x12c8a0[_0xe7f3('0x18')]?_0x12c8a0[_0xe7f3('0x18')][_0xe7f3('0x19')]||null:null,'include':_0x12c8a0[_0xe7f3('0x18')]?_0x12c8a0['options'][_0xe7f3('0x1b')]?_[_0xe7f3('0x1c')](_0x12c8a0[_0xe7f3('0x18')]['include'],function(_0x776a8){return{'model':db[_0x776a8['model']],'as':_0x776a8['as'],'attributes':_0x776a8[_0xe7f3('0x19')],'include':_0x776a8[_0xe7f3('0x1b')]?_[_0xe7f3('0x1c')](_0x776a8[_0xe7f3('0x1b')],function(_0x4984f4){return{'model':db[_0x4984f4['model']],'as':_0x4984f4['as'],'attributes':_0x4984f4[_0xe7f3('0x19')],'include':_0x4984f4['include']?_[_0xe7f3('0x1c')](_0x4984f4['include'],function(_0x171aa5){return{'model':db[_0x171aa5[_0xe7f3('0x1d')]],'as':_0x171aa5['as'],'attributes':_0x171aa5['attributes']};}):[]};}):[]};}):[]:[]})[_0xe7f3('0x9')](function(_0x313a6c){logger[_0xe7f3('0xa')]('ShowSugarcrmAccount',_0x12c8a0);logger['debug'](_0xe7f3('0x1e'),_0x12c8a0,JSON['stringify'](_0x313a6c));_0x48e0a1(_0x313a6c);})[_0xe7f3('0x14')](function(_0x1edc5f){logger[_0xe7f3('0xf')](_0xe7f3('0x1e'),_0x1edc5f['message'],_0x12c8a0);_0x58ca18(_0x59af39[_0xe7f3('0xf')](0x1f4,_0x1edc5f[_0xe7f3('0x12')]));});});};
\ No newline at end of file