Built motion from commit ff78e754.|2.6.29
[motion2.git] / server / api / intSugarcrmAccount / intSugarcrmAccount.rpc.js
index cfa61ef..6fd2173 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0159=['map','model','ShowSugarcrmAccount','SugarcrmAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SugarcrmAccount,\x20%s,\x20%s','catch','GetSugarcrmAccount','options','raw','where','attributes','limit','include'];(function(_0x173088,_0x250821){var _0x5b35c9=function(_0x34f31b){while(--_0x34f31b){_0x173088['push'](_0x173088['shift']());}};_0x5b35c9(++_0x250821);}(_0x0159,0xe4));var _0x9015=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0159[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9015('0x0'));var util=require(_0x9015('0x1'));var moment=require(_0x9015('0x2'));var BPromise=require(_0x9015('0x3'));var rs=require(_0x9015('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9015('0x5'))['db'];var utils=require(_0x9015('0x6'));var logger=require(_0x9015('0x7'))(_0x9015('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9015('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30dcc1,_0x1ee0e0,_0x5a5d60){return new BPromise(function(_0x4c2f67,_0x1242a9){return client[_0x9015('0xa')](_0x30dcc1,_0x5a5d60)[_0x9015('0xb')](function(_0xbd6a22){logger[_0x9015('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x1ee0e0,_0x9015('0xd'));logger[_0x9015('0xe')](_0x9015('0xf'),_0x1ee0e0,_0x9015('0xd'),JSON[_0x9015('0x10')](_0xbd6a22));if(_0xbd6a22[_0x9015('0x11')]){if(_0xbd6a22[_0x9015('0x11')]['code']===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x1ee0e0,_0xbd6a22[_0x9015('0x11')][_0x9015('0x12')]);return _0x1242a9(_0xbd6a22[_0x9015('0x11')][_0x9015('0x12')]);}logger['error'](_0x9015('0x13'),_0x1ee0e0,_0xbd6a22[_0x9015('0x11')][_0x9015('0x12')]);return _0x4c2f67(_0xbd6a22[_0x9015('0x11')][_0x9015('0x12')]);}else{logger[_0x9015('0xc')](_0x9015('0x13'),_0x1ee0e0,_0x9015('0xd'));_0x4c2f67(_0xbd6a22['result'][_0x9015('0x12')]);}})[_0x9015('0x14')](function(_0x47450a){logger['error'](_0x9015('0x13'),_0x1ee0e0,_0x47450a);_0x1242a9(_0x47450a);});});}exports[_0x9015('0x15')]=function(_0x509103){var _0x362508=this;return new Promise(function(_0x5363eb,_0x12cbc5){return db['SugarcrmAccount']['findAll']({'raw':_0x509103[_0x9015('0x16')]?_0x509103[_0x9015('0x16')][_0x9015('0x17')]===undefined?!![]:![]:!![],'where':_0x509103[_0x9015('0x16')]?_0x509103[_0x9015('0x16')][_0x9015('0x18')]||null:null,'attributes':_0x509103[_0x9015('0x16')]?_0x509103['options'][_0x9015('0x19')]||null:null,'limit':_0x509103[_0x9015('0x16')]?_0x509103[_0x9015('0x16')][_0x9015('0x1a')]||null:null,'include':_0x509103['options']?_0x509103[_0x9015('0x16')][_0x9015('0x1b')]?_[_0x9015('0x1c')](_0x509103[_0x9015('0x16')]['include'],function(_0x10b8b2){return{'model':db[_0x10b8b2[_0x9015('0x1d')]],'as':_0x10b8b2['as'],'attributes':_0x10b8b2['attributes'],'include':_0x10b8b2[_0x9015('0x1b')]?_['map'](_0x10b8b2[_0x9015('0x1b')],function(_0x41f0d5){return{'model':db[_0x41f0d5[_0x9015('0x1d')]],'as':_0x41f0d5['as'],'attributes':_0x41f0d5['attributes'],'include':_0x41f0d5[_0x9015('0x1b')]?_[_0x9015('0x1c')](_0x41f0d5[_0x9015('0x1b')],function(_0xa81cbc){return{'model':db[_0xa81cbc[_0x9015('0x1d')]],'as':_0xa81cbc['as'],'attributes':_0xa81cbc[_0x9015('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9015('0xb')](function(_0x286fd9){logger['info'](_0x9015('0x15'),_0x509103);logger[_0x9015('0xe')](_0x9015('0x15'),_0x509103,JSON[_0x9015('0x10')](_0x286fd9));_0x5363eb(_0x286fd9);})[_0x9015('0x14')](function(_0x365127){logger['error']('GetSugarcrmAccount',_0x365127[_0x9015('0x12')],_0x509103);_0x12cbc5(_0x362508['error'](0x1f4,_0x365127[_0x9015('0x12')]));});});};exports[_0x9015('0x1e')]=function(_0x1d4401){var _0x3f6586=this;return new Promise(function(_0x2ba601,_0x7c66f1){return db[_0x9015('0x1f')]['find']({'raw':_0x1d4401[_0x9015('0x16')]?_0x1d4401['options']['raw']===undefined?!![]:![]:!![],'where':_0x1d4401[_0x9015('0x16')]?_0x1d4401['options'][_0x9015('0x18')]||null:null,'attributes':_0x1d4401['options']?_0x1d4401[_0x9015('0x16')][_0x9015('0x19')]||null:null,'include':_0x1d4401[_0x9015('0x16')]?_0x1d4401[_0x9015('0x16')]['include']?_[_0x9015('0x1c')](_0x1d4401['options']['include'],function(_0x41d76e){return{'model':db[_0x41d76e[_0x9015('0x1d')]],'as':_0x41d76e['as'],'attributes':_0x41d76e[_0x9015('0x19')],'include':_0x41d76e[_0x9015('0x1b')]?_['map'](_0x41d76e['include'],function(_0x14638a){return{'model':db[_0x14638a[_0x9015('0x1d')]],'as':_0x14638a['as'],'attributes':_0x14638a[_0x9015('0x19')],'include':_0x14638a[_0x9015('0x1b')]?_[_0x9015('0x1c')](_0x14638a[_0x9015('0x1b')],function(_0x3c63b2){return{'model':db[_0x3c63b2[_0x9015('0x1d')]],'as':_0x3c63b2['as'],'attributes':_0x3c63b2[_0x9015('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9015('0xb')](function(_0x3dbad6){logger['info']('ShowSugarcrmAccount',_0x1d4401);logger[_0x9015('0xe')](_0x9015('0x1e'),_0x1d4401,JSON[_0x9015('0x10')](_0x3dbad6));_0x2ba601(_0x3dbad6);})[_0x9015('0x14')](function(_0x115245){logger[_0x9015('0x11')](_0x9015('0x1e'),_0x115245['message'],_0x1d4401);_0x7c66f1(_0x3f6586['error'](0x1f4,_0x115245[_0x9015('0x12')]));});});};
\ No newline at end of file
+var _0x5ba0=['code','message','catch','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','info','GetSugarcrmAccount','ShowSugarcrmAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3d039f,_0x2533bd){var _0x1ddddc=function(_0x1def6b){while(--_0x1def6b){_0x3d039f['push'](_0x3d039f['shift']());}};_0x1ddddc(++_0x2533bd);}(_0x5ba0,0xbb));var _0x05ba=function(_0x48dfd2,_0x21c09a){_0x48dfd2=_0x48dfd2-0x0;var _0x38e319=_0x5ba0[_0x48dfd2];return _0x38e319;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x05ba('0x0'));var BPromise=require(_0x05ba('0x1'));var rs=require(_0x05ba('0x2'));var fs=require('fs');var Redis=require(_0x05ba('0x3'));var db=require(_0x05ba('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x05ba('0x5'))(_0x05ba('0x6'));var config=require(_0x05ba('0x7'));var jayson=require(_0x05ba('0x8'));var client=jayson['client'][_0x05ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a6588,_0x3794d3,_0xc80835){return new BPromise(function(_0x3704e3,_0x58a021){return client[_0x05ba('0xa')](_0x5a6588,_0xc80835)['then'](function(_0x162030){logger['info'](_0x05ba('0xb'),_0x3794d3,'request\x20sent');logger[_0x05ba('0xc')](_0x05ba('0xd'),_0x3794d3,_0x05ba('0xe'),JSON[_0x05ba('0xf')](_0x162030));if(_0x162030[_0x05ba('0x10')]){if(_0x162030['error'][_0x05ba('0x11')]===0x1f4){logger[_0x05ba('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x3794d3,_0x162030['error']['message']);return _0x58a021(_0x162030['error']['message']);}logger[_0x05ba('0x10')](_0x05ba('0xb'),_0x3794d3,_0x162030['error'][_0x05ba('0x12')]);return _0x3704e3(_0x162030[_0x05ba('0x10')][_0x05ba('0x12')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x3794d3,_0x05ba('0xe'));_0x3704e3(_0x162030['result'][_0x05ba('0x12')]);}})[_0x05ba('0x13')](function(_0x392aeb){logger[_0x05ba('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x3794d3,_0x392aeb);_0x58a021(_0x392aeb);});});}exports['GetSugarcrmAccount']=function(_0x3ebc74){var _0x2e55e4=this;return new Promise(function(_0x1c2a85,_0x76c8f6){return db[_0x05ba('0x14')][_0x05ba('0x15')]({'raw':_0x3ebc74[_0x05ba('0x16')]?_0x3ebc74['options'][_0x05ba('0x17')]===undefined?!![]:![]:!![],'where':_0x3ebc74[_0x05ba('0x16')]?_0x3ebc74['options'][_0x05ba('0x18')]||null:null,'attributes':_0x3ebc74['options']?_0x3ebc74[_0x05ba('0x16')][_0x05ba('0x19')]||null:null,'limit':_0x3ebc74['options']?_0x3ebc74[_0x05ba('0x16')][_0x05ba('0x1a')]||null:null,'include':_0x3ebc74[_0x05ba('0x16')]?_0x3ebc74['options'][_0x05ba('0x1b')]?_[_0x05ba('0x1c')](_0x3ebc74['options'][_0x05ba('0x1b')],function(_0x4a1a8a){return{'model':db[_0x4a1a8a[_0x05ba('0x1d')]],'as':_0x4a1a8a['as'],'attributes':_0x4a1a8a[_0x05ba('0x19')],'include':_0x4a1a8a[_0x05ba('0x1b')]?_[_0x05ba('0x1c')](_0x4a1a8a[_0x05ba('0x1b')],function(_0x274474){return{'model':db[_0x274474['model']],'as':_0x274474['as'],'attributes':_0x274474[_0x05ba('0x19')],'include':_0x274474[_0x05ba('0x1b')]?_[_0x05ba('0x1c')](_0x274474[_0x05ba('0x1b')],function(_0x32eac7){return{'model':db[_0x32eac7['model']],'as':_0x32eac7['as'],'attributes':_0x32eac7[_0x05ba('0x19')]};}):[]};}):[]};}):[]:[]})[_0x05ba('0x1e')](function(_0x3b6727){logger[_0x05ba('0x1f')](_0x05ba('0x20'),_0x3ebc74);logger[_0x05ba('0xc')](_0x05ba('0x20'),_0x3ebc74,JSON[_0x05ba('0xf')](_0x3b6727));_0x1c2a85(_0x3b6727);})[_0x05ba('0x13')](function(_0x110414){logger['error'](_0x05ba('0x20'),_0x110414['message'],_0x3ebc74);_0x76c8f6(_0x2e55e4[_0x05ba('0x10')](0x1f4,_0x110414[_0x05ba('0x12')]));});});};exports[_0x05ba('0x21')]=function(_0x510db2){var _0x1d9ada=this;return new Promise(function(_0x5ac372,_0x3909c8){return db[_0x05ba('0x14')]['find']({'raw':_0x510db2[_0x05ba('0x16')]?_0x510db2['options'][_0x05ba('0x17')]===undefined?!![]:![]:!![],'where':_0x510db2[_0x05ba('0x16')]?_0x510db2[_0x05ba('0x16')][_0x05ba('0x18')]||null:null,'attributes':_0x510db2[_0x05ba('0x16')]?_0x510db2[_0x05ba('0x16')][_0x05ba('0x19')]||null:null,'include':_0x510db2[_0x05ba('0x16')]?_0x510db2[_0x05ba('0x16')][_0x05ba('0x1b')]?_[_0x05ba('0x1c')](_0x510db2['options'][_0x05ba('0x1b')],function(_0x87fc5b){return{'model':db[_0x87fc5b['model']],'as':_0x87fc5b['as'],'attributes':_0x87fc5b['attributes'],'include':_0x87fc5b[_0x05ba('0x1b')]?_['map'](_0x87fc5b[_0x05ba('0x1b')],function(_0x4469e9){return{'model':db[_0x4469e9['model']],'as':_0x4469e9['as'],'attributes':_0x4469e9['attributes'],'include':_0x4469e9[_0x05ba('0x1b')]?_[_0x05ba('0x1c')](_0x4469e9[_0x05ba('0x1b')],function(_0x5be1c5){return{'model':db[_0x5be1c5[_0x05ba('0x1d')]],'as':_0x5be1c5['as'],'attributes':_0x5be1c5[_0x05ba('0x19')]};}):[]};}):[]};}):[]:[]})[_0x05ba('0x1e')](function(_0x4fccc2){logger[_0x05ba('0x1f')](_0x05ba('0x21'),_0x510db2);logger[_0x05ba('0xc')]('ShowSugarcrmAccount',_0x510db2,JSON[_0x05ba('0xf')](_0x4fccc2));_0x5ac372(_0x4fccc2);})[_0x05ba('0x13')](function(_0x3792d8){logger['error'](_0x05ba('0x21'),_0x3792d8[_0x05ba('0x12')],_0x510db2);_0x3909c8(_0x1d9ada['error'](0x1f4,_0x3792d8['message']));});});};
\ No newline at end of file