Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / api / intVtigerAccount / intVtigerAccount.rpc.js
index ea6db34..bb702cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe86f=['rpc','../../config/environment','jayson/promise','http','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','info','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','then','ShowVtigerAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5411f7,_0x5b0970){var _0x451592=function(_0x3cd342){while(--_0x3cd342){_0x5411f7['push'](_0x5411f7['shift']());}};_0x451592(++_0x5b0970);}(_0xe86f,0x1c0));var _0xfe86=function(_0x588375,_0xa0c226){_0x588375=_0x588375-0x0;var _0x46c100=_0xe86f[_0x588375];return _0x46c100;};'use strict';var _=require('lodash');var util=require(_0xfe86('0x0'));var moment=require(_0xfe86('0x1'));var BPromise=require(_0xfe86('0x2'));var rs=require(_0xfe86('0x3'));var fs=require('fs');var Redis=require(_0xfe86('0x4'));var db=require(_0xfe86('0x5'))['db'];var utils=require(_0xfe86('0x6'));var logger=require('../../config/logger')(_0xfe86('0x7'));var config=require(_0xfe86('0x8'));var jayson=require(_0xfe86('0x9'));var client=jayson['client'][_0xfe86('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1985e7,_0x8d724b,_0x1042c1){return new BPromise(function(_0x138706,_0x1d2ecf){return client['request'](_0x1985e7,_0x1042c1)['then'](function(_0x4ceade){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x8d724b,'request\x20sent');logger[_0xfe86('0xb')](_0xfe86('0xc'),_0x8d724b,_0xfe86('0xd'),JSON[_0xfe86('0xe')](_0x4ceade));if(_0x4ceade[_0xfe86('0xf')]){if(_0x4ceade['error'][_0xfe86('0x10')]===0x1f4){logger['error'](_0xfe86('0x11'),_0x8d724b,_0x4ceade[_0xfe86('0xf')][_0xfe86('0x12')]);return _0x1d2ecf(_0x4ceade[_0xfe86('0xf')][_0xfe86('0x12')]);}logger[_0xfe86('0xf')](_0xfe86('0x11'),_0x8d724b,_0x4ceade[_0xfe86('0xf')][_0xfe86('0x12')]);return _0x138706(_0x4ceade[_0xfe86('0xf')][_0xfe86('0x12')]);}else{logger[_0xfe86('0x13')](_0xfe86('0x11'),_0x8d724b,_0xfe86('0xd'));_0x138706(_0x4ceade['result'][_0xfe86('0x12')]);}})[_0xfe86('0x14')](function(_0x3c0e95){logger[_0xfe86('0xf')](_0xfe86('0x11'),_0x8d724b,_0x3c0e95);_0x1d2ecf(_0x3c0e95);});});}exports[_0xfe86('0x15')]=function(_0x38ed81){var _0x34ab76=this;return new Promise(function(_0x46d01a,_0x4551f6){return db[_0xfe86('0x16')][_0xfe86('0x17')]({'raw':_0x38ed81[_0xfe86('0x18')]?_0x38ed81[_0xfe86('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x38ed81[_0xfe86('0x18')]?_0x38ed81[_0xfe86('0x18')][_0xfe86('0x19')]||null:null,'attributes':_0x38ed81[_0xfe86('0x18')]?_0x38ed81[_0xfe86('0x18')][_0xfe86('0x1a')]||null:null,'limit':_0x38ed81[_0xfe86('0x18')]?_0x38ed81['options'][_0xfe86('0x1b')]||null:null,'include':_0x38ed81[_0xfe86('0x18')]?_0x38ed81[_0xfe86('0x18')][_0xfe86('0x1c')]?_[_0xfe86('0x1d')](_0x38ed81['options'][_0xfe86('0x1c')],function(_0x1f432b){return{'model':db[_0x1f432b[_0xfe86('0x1e')]],'as':_0x1f432b['as'],'attributes':_0x1f432b[_0xfe86('0x1a')],'include':_0x1f432b[_0xfe86('0x1c')]?_[_0xfe86('0x1d')](_0x1f432b[_0xfe86('0x1c')],function(_0x2fbe65){return{'model':db[_0x2fbe65['model']],'as':_0x2fbe65['as'],'attributes':_0x2fbe65[_0xfe86('0x1a')],'include':_0x2fbe65[_0xfe86('0x1c')]?_[_0xfe86('0x1d')](_0x2fbe65['include'],function(_0x3faa51){return{'model':db[_0x3faa51[_0xfe86('0x1e')]],'as':_0x3faa51['as'],'attributes':_0x3faa51[_0xfe86('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfe86('0x1f')](function(_0x184317){logger[_0xfe86('0x13')]('GetVtigerAccount',_0x38ed81);logger['debug'](_0xfe86('0x15'),_0x38ed81,JSON[_0xfe86('0xe')](_0x184317));_0x46d01a(_0x184317);})[_0xfe86('0x14')](function(_0x4e2288){logger[_0xfe86('0xf')](_0xfe86('0x15'),_0x4e2288[_0xfe86('0x12')],_0x38ed81);_0x4551f6(_0x34ab76['error'](0x1f4,_0x4e2288['message']));});});};exports[_0xfe86('0x20')]=function(_0x147e67){var _0x1308aa=this;return new Promise(function(_0x46d1dd,_0x43d6f2){return db[_0xfe86('0x16')][_0xfe86('0x21')]({'raw':_0x147e67[_0xfe86('0x18')]?_0x147e67[_0xfe86('0x18')][_0xfe86('0x22')]===undefined?!![]:![]:!![],'where':_0x147e67['options']?_0x147e67[_0xfe86('0x18')][_0xfe86('0x19')]||null:null,'attributes':_0x147e67[_0xfe86('0x18')]?_0x147e67[_0xfe86('0x18')][_0xfe86('0x1a')]||null:null,'include':_0x147e67[_0xfe86('0x18')]?_0x147e67[_0xfe86('0x18')][_0xfe86('0x1c')]?_['map'](_0x147e67[_0xfe86('0x18')][_0xfe86('0x1c')],function(_0x2ccc3b){return{'model':db[_0x2ccc3b[_0xfe86('0x1e')]],'as':_0x2ccc3b['as'],'attributes':_0x2ccc3b[_0xfe86('0x1a')],'include':_0x2ccc3b[_0xfe86('0x1c')]?_[_0xfe86('0x1d')](_0x2ccc3b[_0xfe86('0x1c')],function(_0x3e0f58){return{'model':db[_0x3e0f58[_0xfe86('0x1e')]],'as':_0x3e0f58['as'],'attributes':_0x3e0f58[_0xfe86('0x1a')],'include':_0x3e0f58[_0xfe86('0x1c')]?_[_0xfe86('0x1d')](_0x3e0f58['include'],function(_0x4f0c40){return{'model':db[_0x4f0c40[_0xfe86('0x1e')]],'as':_0x4f0c40['as'],'attributes':_0x4f0c40[_0xfe86('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x513770){logger[_0xfe86('0x13')]('ShowVtigerAccount',_0x147e67);logger[_0xfe86('0xb')](_0xfe86('0x20'),_0x147e67,JSON[_0xfe86('0xe')](_0x513770));_0x46d1dd(_0x513770);})['catch'](function(_0x5aa60a){logger[_0xfe86('0xf')]('ShowVtigerAccount',_0x5aa60a[_0xfe86('0x12')],_0x147e67);_0x43d6f2(_0x1308aa['error'](0x1f4,_0x5aa60a[_0xfe86('0x12')]));});});};
\ No newline at end of file
+var _0xe88c=['then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','findAll','options','raw','attributes','include','map','model','GetVtigerAccount','ShowVtigerAccount','VtigerAccount','find','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x3d6135,_0x256136){var _0x16f3c1=function(_0x5e7576){while(--_0x5e7576){_0x3d6135['push'](_0x3d6135['shift']());}};_0x16f3c1(++_0x256136);}(_0xe88c,0x13d));var _0xce88=function(_0xa20086,_0x3978a9){_0xa20086=_0xa20086-0x0;var _0x121c6e=_0xe88c[_0xa20086];return _0x121c6e;};'use strict';var _=require(_0xce88('0x0'));var util=require(_0xce88('0x1'));var moment=require(_0xce88('0x2'));var BPromise=require(_0xce88('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce88('0x4'));var db=require(_0xce88('0x5'))['db'];var utils=require(_0xce88('0x6'));var logger=require(_0xce88('0x7'))(_0xce88('0x8'));var config=require(_0xce88('0x9'));var jayson=require(_0xce88('0xa'));var client=jayson[_0xce88('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ed13d,_0x4166c2,_0x35a945){return new BPromise(function(_0x4418ae,_0x310e34){return client[_0xce88('0xc')](_0x2ed13d,_0x35a945)[_0xce88('0xd')](function(_0x85430e){logger[_0xce88('0xe')](_0xce88('0xf'),_0x4166c2,_0xce88('0x10'));logger[_0xce88('0x11')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4166c2,_0xce88('0x10'),JSON['stringify'](_0x85430e));if(_0x85430e[_0xce88('0x12')]){if(_0x85430e[_0xce88('0x12')]['code']===0x1f4){logger[_0xce88('0x12')](_0xce88('0xf'),_0x4166c2,_0x85430e[_0xce88('0x12')][_0xce88('0x13')]);return _0x310e34(_0x85430e[_0xce88('0x12')][_0xce88('0x13')]);}logger[_0xce88('0x12')](_0xce88('0xf'),_0x4166c2,_0x85430e['error'][_0xce88('0x13')]);return _0x4418ae(_0x85430e['error'][_0xce88('0x13')]);}else{logger[_0xce88('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x4166c2,_0xce88('0x10'));_0x4418ae(_0x85430e['result'][_0xce88('0x13')]);}})[_0xce88('0x14')](function(_0x42d452){logger[_0xce88('0x12')](_0xce88('0xf'),_0x4166c2,_0x42d452);_0x310e34(_0x42d452);});});}exports['GetVtigerAccount']=function(_0x18948c){var _0x1eeac9=this;return new Promise(function(_0x43f99f,_0x2e6a9c){return db['VtigerAccount'][_0xce88('0x15')]({'raw':_0x18948c[_0xce88('0x16')]?_0x18948c['options'][_0xce88('0x17')]===undefined?!![]:![]:!![],'where':_0x18948c[_0xce88('0x16')]?_0x18948c[_0xce88('0x16')]['where']||null:null,'attributes':_0x18948c[_0xce88('0x16')]?_0x18948c[_0xce88('0x16')][_0xce88('0x18')]||null:null,'limit':_0x18948c['options']?_0x18948c[_0xce88('0x16')]['limit']||null:null,'include':_0x18948c[_0xce88('0x16')]?_0x18948c['options'][_0xce88('0x19')]?_[_0xce88('0x1a')](_0x18948c['options']['include'],function(_0x1673f0){return{'model':db[_0x1673f0[_0xce88('0x1b')]],'as':_0x1673f0['as'],'attributes':_0x1673f0[_0xce88('0x18')],'include':_0x1673f0[_0xce88('0x19')]?_[_0xce88('0x1a')](_0x1673f0[_0xce88('0x19')],function(_0x4b8985){return{'model':db[_0x4b8985[_0xce88('0x1b')]],'as':_0x4b8985['as'],'attributes':_0x4b8985[_0xce88('0x18')],'include':_0x4b8985[_0xce88('0x19')]?_[_0xce88('0x1a')](_0x4b8985[_0xce88('0x19')],function(_0x3c5404){return{'model':db[_0x3c5404[_0xce88('0x1b')]],'as':_0x3c5404['as'],'attributes':_0x3c5404[_0xce88('0x18')]};}):[]};}):[]};}):[]:[]})[_0xce88('0xd')](function(_0x545f13){logger[_0xce88('0xe')](_0xce88('0x1c'),_0x18948c);logger[_0xce88('0x11')](_0xce88('0x1c'),_0x18948c,JSON['stringify'](_0x545f13));_0x43f99f(_0x545f13);})[_0xce88('0x14')](function(_0xabd889){logger[_0xce88('0x12')](_0xce88('0x1c'),_0xabd889[_0xce88('0x13')],_0x18948c);_0x2e6a9c(_0x1eeac9['error'](0x1f4,_0xabd889['message']));});});};exports[_0xce88('0x1d')]=function(_0x483180){var _0x276ad4=this;return new Promise(function(_0x208941,_0x1bf732){return db[_0xce88('0x1e')][_0xce88('0x1f')]({'raw':_0x483180[_0xce88('0x16')]?_0x483180[_0xce88('0x16')][_0xce88('0x17')]===undefined?!![]:![]:!![],'where':_0x483180['options']?_0x483180[_0xce88('0x16')]['where']||null:null,'attributes':_0x483180[_0xce88('0x16')]?_0x483180[_0xce88('0x16')][_0xce88('0x18')]||null:null,'include':_0x483180['options']?_0x483180['options'][_0xce88('0x19')]?_[_0xce88('0x1a')](_0x483180['options'][_0xce88('0x19')],function(_0xb3b23b){return{'model':db[_0xb3b23b[_0xce88('0x1b')]],'as':_0xb3b23b['as'],'attributes':_0xb3b23b[_0xce88('0x18')],'include':_0xb3b23b[_0xce88('0x19')]?_[_0xce88('0x1a')](_0xb3b23b['include'],function(_0x57ee81){return{'model':db[_0x57ee81[_0xce88('0x1b')]],'as':_0x57ee81['as'],'attributes':_0x57ee81['attributes'],'include':_0x57ee81[_0xce88('0x19')]?_[_0xce88('0x1a')](_0x57ee81[_0xce88('0x19')],function(_0x36960b){return{'model':db[_0x36960b[_0xce88('0x1b')]],'as':_0x36960b['as'],'attributes':_0x36960b['attributes']};}):[]};}):[]};}):[]:[]})[_0xce88('0xd')](function(_0x531b0d){logger['info'](_0xce88('0x1d'),_0x483180);logger[_0xce88('0x11')](_0xce88('0x1d'),_0x483180,JSON[_0xce88('0x20')](_0x531b0d));_0x208941(_0x531b0d);})[_0xce88('0x14')](function(_0x2ed8fb){logger['error'](_0xce88('0x1d'),_0x2ed8fb[_0xce88('0x13')],_0x483180);_0x1bf732(_0x276ad4[_0xce88('0x12')](0x1f4,_0x2ed8fb[_0xce88('0x13')]));});});};
\ No newline at end of file