Built motion from commit c116dc8b.|2.6.30
[motion2.git] / server / api / intVtigerAccount / intVtigerAccount.rpc.js
index 294fdf2..a11e88e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf66=['raw','where','attributes','limit','include','map','model','info','ShowVtigerAccount','find','debug','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','options'];(function(_0x4fd4c9,_0x48092a){var _0x5b73b6=function(_0x3c664d){while(--_0x3c664d){_0x4fd4c9['push'](_0x4fd4c9['shift']());}};_0x5b73b6(++_0x48092a);}(_0xcf66,0x71));var _0x6cf6=function(_0x1e5cfd,_0x15607a){_0x1e5cfd=_0x1e5cfd-0x0;var _0x1a025e=_0xcf66[_0x1e5cfd];return _0x1a025e;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cf6('0x3'));var fs=require('fs');var Redis=require(_0x6cf6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cf6('0x5'))(_0x6cf6('0x6'));var config=require('../../config/environment');var jayson=require(_0x6cf6('0x7'));var client=jayson[_0x6cf6('0x8')][_0x6cf6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb082,_0x94c6a9,_0x308d0d){return new BPromise(function(_0x36b892,_0x748c93){return client[_0x6cf6('0xa')](_0x5eb082,_0x308d0d)[_0x6cf6('0xb')](function(_0x5b3827){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x94c6a9,_0x6cf6('0xc'));logger['debug'](_0x6cf6('0xd'),_0x94c6a9,_0x6cf6('0xc'),JSON[_0x6cf6('0xe')](_0x5b3827));if(_0x5b3827[_0x6cf6('0xf')]){if(_0x5b3827['error']['code']===0x1f4){logger['error'](_0x6cf6('0x10'),_0x94c6a9,_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);return _0x748c93(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}logger[_0x6cf6('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x94c6a9,_0x5b3827[_0x6cf6('0xf')]['message']);return _0x36b892(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}else{logger['info'](_0x6cf6('0x10'),_0x94c6a9,_0x6cf6('0xc'));_0x36b892(_0x5b3827[_0x6cf6('0x12')][_0x6cf6('0x11')]);}})[_0x6cf6('0x13')](function(_0x2bdb12){logger[_0x6cf6('0xf')](_0x6cf6('0x10'),_0x94c6a9,_0x2bdb12);_0x748c93(_0x2bdb12);});});}exports[_0x6cf6('0x14')]=function(_0x2ca2b1){var _0x5e8b11=this;return new Promise(function(_0x11d994,_0x22915c){return db[_0x6cf6('0x15')]['findAll']({'raw':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x17')]===undefined?!![]:![]:!![],'where':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x18')]||null:null,'attributes':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1['options'][_0x6cf6('0x19')]||null:null,'limit':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x1a')]||null:null,'include':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x2ca2b1['options']['include'],function(_0x276225){return{'model':db[_0x276225['model']],'as':_0x276225['as'],'attributes':_0x276225[_0x6cf6('0x19')],'include':_0x276225[_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x276225[_0x6cf6('0x1b')],function(_0x3f9871){return{'model':db[_0x3f9871[_0x6cf6('0x1d')]],'as':_0x3f9871['as'],'attributes':_0x3f9871[_0x6cf6('0x19')],'include':_0x3f9871['include']?_[_0x6cf6('0x1c')](_0x3f9871[_0x6cf6('0x1b')],function(_0x3eaa31){return{'model':db[_0x3eaa31['model']],'as':_0x3eaa31['as'],'attributes':_0x3eaa31[_0x6cf6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6cf6('0xb')](function(_0x2224db){logger[_0x6cf6('0x1e')]('GetVtigerAccount',_0x2ca2b1);logger['debug'](_0x6cf6('0x14'),_0x2ca2b1,JSON[_0x6cf6('0xe')](_0x2224db));_0x11d994(_0x2224db);})[_0x6cf6('0x13')](function(_0x5869e9){logger['error'](_0x6cf6('0x14'),_0x5869e9['message'],_0x2ca2b1);_0x22915c(_0x5e8b11['error'](0x1f4,_0x5869e9['message']));});});};exports[_0x6cf6('0x1f')]=function(_0x65433){var _0x33d308=this;return new Promise(function(_0x42f488,_0x11c848){return db['VtigerAccount'][_0x6cf6('0x20')]({'raw':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')][_0x6cf6('0x18')]||null:null,'attributes':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')][_0x6cf6('0x19')]||null:null,'include':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')][_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x65433[_0x6cf6('0x16')][_0x6cf6('0x1b')],function(_0x4620b6){return{'model':db[_0x4620b6[_0x6cf6('0x1d')]],'as':_0x4620b6['as'],'attributes':_0x4620b6[_0x6cf6('0x19')],'include':_0x4620b6[_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x4620b6[_0x6cf6('0x1b')],function(_0x5cc6cd){return{'model':db[_0x5cc6cd[_0x6cf6('0x1d')]],'as':_0x5cc6cd['as'],'attributes':_0x5cc6cd[_0x6cf6('0x19')],'include':_0x5cc6cd[_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x5cc6cd[_0x6cf6('0x1b')],function(_0x2cf3a3){return{'model':db[_0x2cf3a3[_0x6cf6('0x1d')]],'as':_0x2cf3a3['as'],'attributes':_0x2cf3a3[_0x6cf6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6cf6('0xb')](function(_0x3718a1){logger[_0x6cf6('0x1e')]('ShowVtigerAccount',_0x65433);logger[_0x6cf6('0x21')](_0x6cf6('0x1f'),_0x65433,JSON[_0x6cf6('0xe')](_0x3718a1));_0x42f488(_0x3718a1);})[_0x6cf6('0x13')](function(_0x31c822){logger[_0x6cf6('0xf')](_0x6cf6('0x1f'),_0x31c822[_0x6cf6('0x11')],_0x65433);_0x11c848(_0x33d308[_0x6cf6('0xf')](0x1f4,_0x31c822['message']));});});};
\ No newline at end of file
+var _0x0565=['request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','code','message','error','GetVtigerAccount','options','raw','where','attributes','limit','map','model','include','debug','catch','ShowVtigerAccount','VtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s'];(function(_0x451c1c,_0x21a5b){var _0x49eb25=function(_0x402fde){while(--_0x402fde){_0x451c1c['push'](_0x451c1c['shift']());}};_0x49eb25(++_0x21a5b);}(_0x0565,0xf2));var _0x5056=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x0565[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var moment=require(_0x5056('0x2'));var BPromise=require(_0x5056('0x3'));var rs=require(_0x5056('0x4'));var fs=require('fs');var Redis=require(_0x5056('0x5'));var db=require(_0x5056('0x6'))['db'];var utils=require(_0x5056('0x7'));var logger=require(_0x5056('0x8'))(_0x5056('0x9'));var config=require('../../config/environment');var jayson=require(_0x5056('0xa'));var client=jayson[_0x5056('0xb')][_0x5056('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22afb7,_0x4b8280,_0x52b01f){return new BPromise(function(_0x38f74,_0x223c92){return client[_0x5056('0xd')](_0x22afb7,_0x52b01f)[_0x5056('0xe')](function(_0x2144a9){logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));logger['debug'](_0x5056('0x12'),_0x4b8280,_0x5056('0x11'),JSON[_0x5056('0x13')](_0x2144a9));if(_0x2144a9['error']){if(_0x2144a9['error'][_0x5056('0x14')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x223c92(_0x2144a9['error'][_0x5056('0x15')]);}logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x38f74(_0x2144a9[_0x5056('0x16')][_0x5056('0x15')]);}else{logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));_0x38f74(_0x2144a9['result'][_0x5056('0x15')]);}})['catch'](function(_0x43db77){logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x43db77);_0x223c92(_0x43db77);});});}exports[_0x5056('0x17')]=function(_0x4056ce){var _0x51b21e=this;return new Promise(function(_0x9ea88,_0x56537e){return db['VtigerAccount']['findAll']({'raw':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')][_0x5056('0x19')]===undefined?!![]:![]:!![],'where':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')][_0x5056('0x1a')]||null:null,'attributes':_0x4056ce[_0x5056('0x18')]?_0x4056ce['options'][_0x5056('0x1b')]||null:null,'limit':_0x4056ce[_0x5056('0x18')]?_0x4056ce['options'][_0x5056('0x1c')]||null:null,'include':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')]['include']?_[_0x5056('0x1d')](_0x4056ce[_0x5056('0x18')]['include'],function(_0x4a64be){return{'model':db[_0x4a64be[_0x5056('0x1e')]],'as':_0x4a64be['as'],'attributes':_0x4a64be[_0x5056('0x1b')],'include':_0x4a64be[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x4a64be['include'],function(_0x267048){return{'model':db[_0x267048[_0x5056('0x1e')]],'as':_0x267048['as'],'attributes':_0x267048['attributes'],'include':_0x267048[_0x5056('0x1f')]?_['map'](_0x267048[_0x5056('0x1f')],function(_0x39d539){return{'model':db[_0x39d539[_0x5056('0x1e')]],'as':_0x39d539['as'],'attributes':_0x39d539[_0x5056('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5056('0xe')](function(_0x50f2a8){logger[_0x5056('0xf')](_0x5056('0x17'),_0x4056ce);logger[_0x5056('0x20')](_0x5056('0x17'),_0x4056ce,JSON['stringify'](_0x50f2a8));_0x9ea88(_0x50f2a8);})[_0x5056('0x21')](function(_0x5b0270){logger[_0x5056('0x16')]('GetVtigerAccount',_0x5b0270['message'],_0x4056ce);_0x56537e(_0x51b21e['error'](0x1f4,_0x5b0270[_0x5056('0x15')]));});});};exports[_0x5056('0x22')]=function(_0x482939){var _0x27f4be=this;return new Promise(function(_0x2c5728,_0x9e2986){return db[_0x5056('0x23')][_0x5056('0x24')]({'raw':_0x482939[_0x5056('0x18')]?_0x482939[_0x5056('0x18')][_0x5056('0x19')]===undefined?!![]:![]:!![],'where':_0x482939[_0x5056('0x18')]?_0x482939[_0x5056('0x18')][_0x5056('0x1a')]||null:null,'attributes':_0x482939['options']?_0x482939['options'][_0x5056('0x1b')]||null:null,'include':_0x482939[_0x5056('0x18')]?_0x482939['options'][_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x482939['options'][_0x5056('0x1f')],function(_0x378b33){return{'model':db[_0x378b33[_0x5056('0x1e')]],'as':_0x378b33['as'],'attributes':_0x378b33[_0x5056('0x1b')],'include':_0x378b33[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x378b33[_0x5056('0x1f')],function(_0x2f1d27){return{'model':db[_0x2f1d27[_0x5056('0x1e')]],'as':_0x2f1d27['as'],'attributes':_0x2f1d27[_0x5056('0x1b')],'include':_0x2f1d27[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x2f1d27[_0x5056('0x1f')],function(_0x3d7d78){return{'model':db[_0x3d7d78[_0x5056('0x1e')]],'as':_0x3d7d78['as'],'attributes':_0x3d7d78['attributes']};}):[]};}):[]};}):[]:[]})[_0x5056('0xe')](function(_0x483d1e){logger[_0x5056('0xf')](_0x5056('0x22'),_0x482939);logger[_0x5056('0x20')](_0x5056('0x22'),_0x482939,JSON['stringify'](_0x483d1e));_0x2c5728(_0x483d1e);})[_0x5056('0x21')](function(_0x32fecc){logger['error'](_0x5056('0x22'),_0x32fecc['message'],_0x482939);_0x9e2986(_0x27f4be[_0x5056('0x16')](0x1f4,_0x32fecc[_0x5056('0x15')]));});});};
\ No newline at end of file