Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / intVtigerAccount / intVtigerAccount.rpc.js
index 5cd0683..1bdf5b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd87e=['stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','map','include','model','attributes','ShowVtigerAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s'];(function(_0x449146,_0x3649da){var _0x2567b3=function(_0x342f01){while(--_0x342f01){_0x449146['push'](_0x449146['shift']());}};_0x2567b3(++_0x3649da);}(_0xd87e,0x1bf));var _0xed87=function(_0x2bcaaa,_0xe79ad0){_0x2bcaaa=_0x2bcaaa-0x0;var _0x273b51=_0xd87e[_0x2bcaaa];return _0x273b51;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var moment=require('moment');var BPromise=require(_0xed87('0x2'));var rs=require(_0xed87('0x3'));var fs=require('fs');var Redis=require(_0xed87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed87('0x5'));var logger=require('../../config/logger')(_0xed87('0x6'));var config=require(_0xed87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5da793,_0xa33c67,_0x42fef6){return new BPromise(function(_0x33e1c1,_0x2f348a){return client['request'](_0x5da793,_0x42fef6)[_0xed87('0x9')](function(_0x3dce4b){logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));logger[_0xed87('0xd')](_0xed87('0xe'),_0xa33c67,'request\x20sent',JSON[_0xed87('0xf')](_0x3dce4b));if(_0x3dce4b[_0xed87('0x10')]){if(_0x3dce4b['error'][_0xed87('0x11')]===0x1f4){logger[_0xed87('0x10')]('VtigerAccount,\x20%s,\x20%s',_0xa33c67,_0x3dce4b['error'][_0xed87('0x12')]);return _0x2f348a(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}logger[_0xed87('0x10')](_0xed87('0xb'),_0xa33c67,_0x3dce4b[_0xed87('0x10')]['message']);return _0x33e1c1(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}else{logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));_0x33e1c1(_0x3dce4b[_0xed87('0x13')][_0xed87('0x12')]);}})[_0xed87('0x14')](function(_0x385859){logger['error'](_0xed87('0xb'),_0xa33c67,_0x385859);_0x2f348a(_0x385859);});});}exports[_0xed87('0x15')]=function(_0x2c386a){var _0xfb8a44=this;return new Promise(function(_0x5f4076,_0x211085){return db[_0xed87('0x16')][_0xed87('0x17')]({'raw':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')][_0xed87('0x19')]===undefined?!![]:![]:!![],'where':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')][_0xed87('0x1a')]||null:null,'attributes':_0x2c386a['options']?_0x2c386a['options']['attributes']||null:null,'limit':_0x2c386a['options']?_0x2c386a[_0xed87('0x18')]['limit']||null:null,'include':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')]['include']?_[_0xed87('0x1b')](_0x2c386a['options'][_0xed87('0x1c')],function(_0x24962e){return{'model':db[_0x24962e[_0xed87('0x1d')]],'as':_0x24962e['as'],'attributes':_0x24962e[_0xed87('0x1e')],'include':_0x24962e[_0xed87('0x1c')]?_['map'](_0x24962e[_0xed87('0x1c')],function(_0x3c22b7){return{'model':db[_0x3c22b7[_0xed87('0x1d')]],'as':_0x3c22b7['as'],'attributes':_0x3c22b7[_0xed87('0x1e')],'include':_0x3c22b7[_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x3c22b7[_0xed87('0x1c')],function(_0x4735b3){return{'model':db[_0x4735b3[_0xed87('0x1d')]],'as':_0x4735b3['as'],'attributes':_0x4735b3[_0xed87('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xed87('0x9')](function(_0x341a35){logger[_0xed87('0xa')](_0xed87('0x15'),_0x2c386a);logger['debug'](_0xed87('0x15'),_0x2c386a,JSON[_0xed87('0xf')](_0x341a35));_0x5f4076(_0x341a35);})['catch'](function(_0x3dff74){logger[_0xed87('0x10')](_0xed87('0x15'),_0x3dff74['message'],_0x2c386a);_0x211085(_0xfb8a44['error'](0x1f4,_0x3dff74[_0xed87('0x12')]));});});};exports[_0xed87('0x1f')]=function(_0x21ab8a){var _0x549a19=this;return new Promise(function(_0x37d45a,_0x3b87e3){return db[_0xed87('0x16')][_0xed87('0x20')]({'raw':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')][_0xed87('0x19')]===undefined?!![]:![]:!![],'where':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')]['where']||null:null,'attributes':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')]['attributes']||null:null,'include':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a['options'][_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x21ab8a[_0xed87('0x18')][_0xed87('0x1c')],function(_0x103b34){return{'model':db[_0x103b34[_0xed87('0x1d')]],'as':_0x103b34['as'],'attributes':_0x103b34[_0xed87('0x1e')],'include':_0x103b34[_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x103b34[_0xed87('0x1c')],function(_0x35c9aa){return{'model':db[_0x35c9aa['model']],'as':_0x35c9aa['as'],'attributes':_0x35c9aa[_0xed87('0x1e')],'include':_0x35c9aa[_0xed87('0x1c')]?_['map'](_0x35c9aa[_0xed87('0x1c')],function(_0x54f6cb){return{'model':db[_0x54f6cb[_0xed87('0x1d')]],'as':_0x54f6cb['as'],'attributes':_0x54f6cb[_0xed87('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x443090){logger[_0xed87('0xa')](_0xed87('0x1f'),_0x21ab8a);logger[_0xed87('0xd')](_0xed87('0x1f'),_0x21ab8a,JSON['stringify'](_0x443090));_0x37d45a(_0x443090);})[_0xed87('0x14')](function(_0x525a11){logger[_0xed87('0x10')]('ShowVtigerAccount',_0x525a11[_0xed87('0x12')],_0x21ab8a);_0x3b87e3(_0x549a19[_0xed87('0x10')](0x1f4,_0x525a11[_0xed87('0x12')]));});});};
\ No newline at end of file
+var _0x5eb8=['where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','catch','VtigerAccount','findAll','options','raw','limit','include','model','attributes','map','then','GetVtigerAccount','stringify','ShowVtigerAccount'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x5eb8,0xb0));var _0x85eb=function(_0x18e52b,_0x1fae35){_0x18e52b=_0x18e52b-0x0;var _0x3d3062=_0x5eb8[_0x18e52b];return _0x3d3062;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}exports['GetVtigerAccount']=function(_0x50d2a8){var _0xe198ca=this;return new Promise(function(_0x39ca96,_0x10cf2f){return db[_0x85eb('0x15')][_0x85eb('0x16')]({'raw':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8['options'][_0x85eb('0x18')]===undefined?!![]:![]:!![],'where':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')]['where']||null:null,'attributes':_0x50d2a8['options']?_0x50d2a8['options']['attributes']||null:null,'limit':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')][_0x85eb('0x19')]||null:null,'include':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')][_0x85eb('0x1a')]?_['map'](_0x50d2a8['options']['include'],function(_0x298e84){return{'model':db[_0x298e84[_0x85eb('0x1b')]],'as':_0x298e84['as'],'attributes':_0x298e84[_0x85eb('0x1c')],'include':_0x298e84[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x298e84[_0x85eb('0x1a')],function(_0x5dfc96){return{'model':db[_0x5dfc96[_0x85eb('0x1b')]],'as':_0x5dfc96['as'],'attributes':_0x5dfc96[_0x85eb('0x1c')],'include':_0x5dfc96[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x5dfc96[_0x85eb('0x1a')],function(_0x57a03c){return{'model':db[_0x57a03c[_0x85eb('0x1b')]],'as':_0x57a03c['as'],'attributes':_0x57a03c[_0x85eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x85eb('0x1e')](function(_0x3e7eb9){logger[_0x85eb('0xd')](_0x85eb('0x1f'),_0x50d2a8);logger['debug']('GetVtigerAccount',_0x50d2a8,JSON[_0x85eb('0x20')](_0x3e7eb9));_0x39ca96(_0x3e7eb9);})['catch'](function(_0xa9b14f){logger['error'](_0x85eb('0x1f'),_0xa9b14f[_0x85eb('0x13')],_0x50d2a8);_0x10cf2f(_0xe198ca[_0x85eb('0x12')](0x1f4,_0xa9b14f[_0x85eb('0x13')]));});});};exports[_0x85eb('0x21')]=function(_0xf4ac13){var _0x41ed76=this;return new Promise(function(_0x5decd5,_0x237f19){return db[_0x85eb('0x15')]['find']({'raw':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13['options']['raw']===undefined?!![]:![]:!![],'where':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x22')]||null:null,'attributes':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x1c')]||null:null,'include':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0xf4ac13['options'][_0x85eb('0x1a')],function(_0x3a5b87){return{'model':db[_0x3a5b87['model']],'as':_0x3a5b87['as'],'attributes':_0x3a5b87['attributes'],'include':_0x3a5b87[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x3a5b87[_0x85eb('0x1a')],function(_0x12cb4c){return{'model':db[_0x12cb4c[_0x85eb('0x1b')]],'as':_0x12cb4c['as'],'attributes':_0x12cb4c[_0x85eb('0x1c')],'include':_0x12cb4c[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x12cb4c[_0x85eb('0x1a')],function(_0x373e5f){return{'model':db[_0x373e5f[_0x85eb('0x1b')]],'as':_0x373e5f['as'],'attributes':_0x373e5f[_0x85eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x85eb('0x1e')](function(_0x33605a){logger['info'](_0x85eb('0x21'),_0xf4ac13);logger[_0x85eb('0x10')]('ShowVtigerAccount',_0xf4ac13,JSON['stringify'](_0x33605a));_0x5decd5(_0x33605a);})[_0x85eb('0x14')](function(_0xe22d16){logger['error'](_0x85eb('0x21'),_0xe22d16['message'],_0xf4ac13);_0x237f19(_0x41ed76[_0x85eb('0x12')](0x1f4,_0xe22d16['message']));});});};
\ No newline at end of file