Built motion from commit (unavailable).|2.3.4
[motion2.git] / server / api / intVtigerAccount / intVtigerAccount.rpc.js
index 0fefab3..7d353df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a75=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','VtigerAccount','findAll','options','raw','where','attributes','limit','map','include','model','info','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','moment'];(function(_0x15ae7e,_0x55f4ea){var _0x21386c=function(_0x31cf16){while(--_0x31cf16){_0x15ae7e['push'](_0x15ae7e['shift']());}};_0x21386c(++_0x55f4ea);}(_0x5a75,0xeb));var _0x55a7=function(_0x2e68db,_0x275d04){_0x2e68db=_0x2e68db-0x0;var _0x12df4c=_0x5a75[_0x2e68db];return _0x12df4c;};'use strict';var _=require(_0x55a7('0x0'));var util=require(_0x55a7('0x1'));var moment=require(_0x55a7('0x2'));var BPromise=require('bluebird');var rs=require(_0x55a7('0x3'));var fs=require('fs');var Redis=require(_0x55a7('0x4'));var db=require(_0x55a7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x55a7('0x6'))(_0x55a7('0x7'));var config=require('../../config/environment');var jayson=require(_0x55a7('0x8'));var client=jayson[_0x55a7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19157c,_0x32d176,_0x2ff1b0){return new BPromise(function(_0x4c9303,_0x407000){return client[_0x55a7('0xa')](_0x19157c,_0x2ff1b0)[_0x55a7('0xb')](function(_0x48acc0){logger['info'](_0x55a7('0xc'),_0x32d176,_0x55a7('0xd'));logger[_0x55a7('0xe')](_0x55a7('0xf'),_0x32d176,'request\x20sent',JSON['stringify'](_0x48acc0));if(_0x48acc0[_0x55a7('0x10')]){if(_0x48acc0[_0x55a7('0x10')][_0x55a7('0x11')]===0x1f4){logger['error'](_0x55a7('0xc'),_0x32d176,_0x48acc0[_0x55a7('0x10')][_0x55a7('0x12')]);return _0x407000(_0x48acc0[_0x55a7('0x10')][_0x55a7('0x12')]);}logger[_0x55a7('0x10')](_0x55a7('0xc'),_0x32d176,_0x48acc0['error'][_0x55a7('0x12')]);return _0x4c9303(_0x48acc0['error'][_0x55a7('0x12')]);}else{logger['info'](_0x55a7('0xc'),_0x32d176,'request\x20sent');_0x4c9303(_0x48acc0['result'][_0x55a7('0x12')]);}})[_0x55a7('0x13')](function(_0x8f5061){logger[_0x55a7('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x32d176,_0x8f5061);_0x407000(_0x8f5061);});});}exports['GetVtigerAccount']=function(_0x597802){var _0xfc39fc=this;return new Promise(function(_0x549f71,_0x56e9c2){return db[_0x55a7('0x14')][_0x55a7('0x15')]({'raw':_0x597802['options']?_0x597802[_0x55a7('0x16')][_0x55a7('0x17')]===undefined?!![]:![]:!![],'where':_0x597802['options']?_0x597802[_0x55a7('0x16')][_0x55a7('0x18')]||null:null,'attributes':_0x597802[_0x55a7('0x16')]?_0x597802[_0x55a7('0x16')][_0x55a7('0x19')]||null:null,'limit':_0x597802[_0x55a7('0x16')]?_0x597802[_0x55a7('0x16')][_0x55a7('0x1a')]||null:null,'include':_0x597802[_0x55a7('0x16')]?_0x597802[_0x55a7('0x16')]['include']?_[_0x55a7('0x1b')](_0x597802[_0x55a7('0x16')][_0x55a7('0x1c')],function(_0x8755e){return{'model':db[_0x8755e[_0x55a7('0x1d')]],'as':_0x8755e['as'],'attributes':_0x8755e[_0x55a7('0x19')],'include':_0x8755e['include']?_[_0x55a7('0x1b')](_0x8755e['include'],function(_0x4ae990){return{'model':db[_0x4ae990['model']],'as':_0x4ae990['as'],'attributes':_0x4ae990[_0x55a7('0x19')],'include':_0x4ae990['include']?_[_0x55a7('0x1b')](_0x4ae990[_0x55a7('0x1c')],function(_0x4c5ca0){return{'model':db[_0x4c5ca0[_0x55a7('0x1d')]],'as':_0x4c5ca0['as'],'attributes':_0x4c5ca0['attributes']};}):[]};}):[]};}):[]:[]})[_0x55a7('0xb')](function(_0x1a359b){logger[_0x55a7('0x1e')](_0x55a7('0x1f'),_0x597802);logger[_0x55a7('0xe')](_0x55a7('0x1f'),_0x597802,JSON['stringify'](_0x1a359b));_0x549f71(_0x1a359b);})[_0x55a7('0x13')](function(_0x28e355){logger[_0x55a7('0x10')](_0x55a7('0x1f'),_0x28e355[_0x55a7('0x12')],_0x597802);_0x56e9c2(_0xfc39fc['error'](0x1f4,_0x28e355[_0x55a7('0x12')]));});});};exports[_0x55a7('0x20')]=function(_0x295cc8){var _0x33dd27=this;return new Promise(function(_0x401a42,_0x8ee4c){return db[_0x55a7('0x14')][_0x55a7('0x21')]({'raw':_0x295cc8[_0x55a7('0x16')]?_0x295cc8['options']['raw']===undefined?!![]:![]:!![],'where':_0x295cc8[_0x55a7('0x16')]?_0x295cc8[_0x55a7('0x16')][_0x55a7('0x18')]||null:null,'attributes':_0x295cc8[_0x55a7('0x16')]?_0x295cc8[_0x55a7('0x16')]['attributes']||null:null,'include':_0x295cc8[_0x55a7('0x16')]?_0x295cc8[_0x55a7('0x16')]['include']?_[_0x55a7('0x1b')](_0x295cc8[_0x55a7('0x16')][_0x55a7('0x1c')],function(_0x7ee4d7){return{'model':db[_0x7ee4d7[_0x55a7('0x1d')]],'as':_0x7ee4d7['as'],'attributes':_0x7ee4d7['attributes'],'include':_0x7ee4d7['include']?_[_0x55a7('0x1b')](_0x7ee4d7[_0x55a7('0x1c')],function(_0x5403bf){return{'model':db[_0x5403bf[_0x55a7('0x1d')]],'as':_0x5403bf['as'],'attributes':_0x5403bf[_0x55a7('0x19')],'include':_0x5403bf['include']?_['map'](_0x5403bf[_0x55a7('0x1c')],function(_0x5df80b){return{'model':db[_0x5df80b['model']],'as':_0x5df80b['as'],'attributes':_0x5df80b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x576c2b){logger[_0x55a7('0x1e')](_0x55a7('0x20'),_0x295cc8);logger['debug'](_0x55a7('0x20'),_0x295cc8,JSON['stringify'](_0x576c2b));_0x401a42(_0x576c2b);})[_0x55a7('0x13')](function(_0x19adaa){logger[_0x55a7('0x10')]('ShowVtigerAccount',_0x19adaa[_0x55a7('0x12')],_0x295cc8);_0x8ee4c(_0x33dd27[_0x55a7('0x10')](0x1f4,_0x19adaa['message']));});});};
\ No newline at end of file
+var _0x7232=['options','raw','attributes','include','map','model','GetVtigerAccount','where','ShowVtigerAccount','lodash','util','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','VtigerAccount','findAll'];(function(_0x11c402,_0x14258c){var _0x1db251=function(_0x30e017){while(--_0x30e017){_0x11c402['push'](_0x11c402['shift']());}};_0x1db251(++_0x14258c);}(_0x7232,0x195));var _0x2723=function(_0x159828,_0x332273){_0x159828=_0x159828-0x0;var _0x4d61ca=_0x7232[_0x159828];return _0x4d61ca;};'use strict';var _=require(_0x2723('0x0'));var util=require(_0x2723('0x1'));var moment=require('moment');var BPromise=require(_0x2723('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2723('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2723('0x4'));var config=require(_0x2723('0x5'));var jayson=require(_0x2723('0x6'));var client=jayson[_0x2723('0x7')][_0x2723('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1907ad,_0x1f269f,_0x4afbb9){return new BPromise(function(_0x321f19,_0x599cd1){return client[_0x2723('0x9')](_0x1907ad,_0x4afbb9)[_0x2723('0xa')](function(_0x1717fe){logger[_0x2723('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x1f269f,_0x2723('0xc'));logger[_0x2723('0xd')](_0x2723('0xe'),_0x1f269f,'request\x20sent',JSON[_0x2723('0xf')](_0x1717fe));if(_0x1717fe[_0x2723('0x10')]){if(_0x1717fe[_0x2723('0x10')][_0x2723('0x11')]===0x1f4){logger[_0x2723('0x10')](_0x2723('0x12'),_0x1f269f,_0x1717fe[_0x2723('0x10')][_0x2723('0x13')]);return _0x599cd1(_0x1717fe[_0x2723('0x10')][_0x2723('0x13')]);}logger['error'](_0x2723('0x12'),_0x1f269f,_0x1717fe['error'][_0x2723('0x13')]);return _0x321f19(_0x1717fe['error'][_0x2723('0x13')]);}else{logger['info'](_0x2723('0x12'),_0x1f269f,_0x2723('0xc'));_0x321f19(_0x1717fe[_0x2723('0x14')]['message']);}})[_0x2723('0x15')](function(_0x1f19c9){logger[_0x2723('0x10')](_0x2723('0x12'),_0x1f269f,_0x1f19c9);_0x599cd1(_0x1f19c9);});});}exports['GetVtigerAccount']=function(_0x3fb2ac){var _0x4504c2=this;return new Promise(function(_0x15c0db,_0x21787d){return db[_0x2723('0x16')][_0x2723('0x17')]({'raw':_0x3fb2ac[_0x2723('0x18')]?_0x3fb2ac[_0x2723('0x18')][_0x2723('0x19')]===undefined?!![]:![]:!![],'where':_0x3fb2ac[_0x2723('0x18')]?_0x3fb2ac[_0x2723('0x18')]['where']||null:null,'attributes':_0x3fb2ac[_0x2723('0x18')]?_0x3fb2ac['options'][_0x2723('0x1a')]||null:null,'limit':_0x3fb2ac[_0x2723('0x18')]?_0x3fb2ac[_0x2723('0x18')]['limit']||null:null,'include':_0x3fb2ac[_0x2723('0x18')]?_0x3fb2ac[_0x2723('0x18')][_0x2723('0x1b')]?_[_0x2723('0x1c')](_0x3fb2ac[_0x2723('0x18')]['include'],function(_0x53b08f){return{'model':db[_0x53b08f[_0x2723('0x1d')]],'as':_0x53b08f['as'],'attributes':_0x53b08f[_0x2723('0x1a')],'include':_0x53b08f[_0x2723('0x1b')]?_[_0x2723('0x1c')](_0x53b08f[_0x2723('0x1b')],function(_0x5ef592){return{'model':db[_0x5ef592[_0x2723('0x1d')]],'as':_0x5ef592['as'],'attributes':_0x5ef592[_0x2723('0x1a')],'include':_0x5ef592[_0x2723('0x1b')]?_[_0x2723('0x1c')](_0x5ef592[_0x2723('0x1b')],function(_0x30dcec){return{'model':db[_0x30dcec[_0x2723('0x1d')]],'as':_0x30dcec['as'],'attributes':_0x30dcec[_0x2723('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2723('0xa')](function(_0x353c5b){logger[_0x2723('0xb')]('GetVtigerAccount',_0x3fb2ac);logger[_0x2723('0xd')]('GetVtigerAccount',_0x3fb2ac,JSON[_0x2723('0xf')](_0x353c5b));_0x15c0db(_0x353c5b);})['catch'](function(_0x373cb5){logger[_0x2723('0x10')](_0x2723('0x1e'),_0x373cb5[_0x2723('0x13')],_0x3fb2ac);_0x21787d(_0x4504c2[_0x2723('0x10')](0x1f4,_0x373cb5[_0x2723('0x13')]));});});};exports['ShowVtigerAccount']=function(_0x25b2fd){var _0x176b66=this;return new Promise(function(_0x2af2bb,_0x3d5bb8){return db[_0x2723('0x16')]['find']({'raw':_0x25b2fd[_0x2723('0x18')]?_0x25b2fd['options'][_0x2723('0x19')]===undefined?!![]:![]:!![],'where':_0x25b2fd[_0x2723('0x18')]?_0x25b2fd['options'][_0x2723('0x1f')]||null:null,'attributes':_0x25b2fd['options']?_0x25b2fd[_0x2723('0x18')][_0x2723('0x1a')]||null:null,'include':_0x25b2fd[_0x2723('0x18')]?_0x25b2fd['options'][_0x2723('0x1b')]?_[_0x2723('0x1c')](_0x25b2fd[_0x2723('0x18')][_0x2723('0x1b')],function(_0x5a9f36){return{'model':db[_0x5a9f36[_0x2723('0x1d')]],'as':_0x5a9f36['as'],'attributes':_0x5a9f36['attributes'],'include':_0x5a9f36[_0x2723('0x1b')]?_[_0x2723('0x1c')](_0x5a9f36[_0x2723('0x1b')],function(_0xb47c0d){return{'model':db[_0xb47c0d[_0x2723('0x1d')]],'as':_0xb47c0d['as'],'attributes':_0xb47c0d[_0x2723('0x1a')],'include':_0xb47c0d['include']?_[_0x2723('0x1c')](_0xb47c0d[_0x2723('0x1b')],function(_0x4c277d){return{'model':db[_0x4c277d['model']],'as':_0x4c277d['as'],'attributes':_0x4c277d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x31ba56){logger['info']('ShowVtigerAccount',_0x25b2fd);logger[_0x2723('0xd')](_0x2723('0x20'),_0x25b2fd,JSON['stringify'](_0x31ba56));_0x2af2bb(_0x31ba56);})[_0x2723('0x15')](function(_0x182cb2){logger[_0x2723('0x10')](_0x2723('0x20'),_0x182cb2[_0x2723('0x13')],_0x25b2fd);_0x3d5bb8(_0x176b66['error'](0x1f4,_0x182cb2['message']));});});};
\ No newline at end of file