Built motion from commit (unavailable).|2.5.1
[motion2.git] / server / api / intVtigerAccount / intVtigerAccount.rpc.js
index a8a9964..1c1bb13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2f7=['catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','findAll','options','raw','attributes','include','model','GetVtigerAccount','VtigerAccount','where','info','ShowVtigerAccount'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb2f7,0xa6));var _0x7b2f=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xb2f7[_0x12d033];return _0x3b4e80;};'use strict';var _=require('lodash');var util=require(_0x7b2f('0x0'));var moment=require(_0x7b2f('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b2f('0x2'));var fs=require('fs');var Redis=require(_0x7b2f('0x3'));var db=require(_0x7b2f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b2f('0x5'))('rpc');var config=require(_0x7b2f('0x6'));var jayson=require(_0x7b2f('0x7'));var client=jayson[_0x7b2f('0x8')][_0x7b2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ebd4a,_0x287cf4,_0x18824e){return new BPromise(function(_0x58212a,_0x47caa0){return client[_0x7b2f('0xa')](_0x3ebd4a,_0x18824e)[_0x7b2f('0xb')](function(_0x5b41ff){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x287cf4,_0x7b2f('0xc'));logger[_0x7b2f('0xd')](_0x7b2f('0xe'),_0x287cf4,_0x7b2f('0xc'),JSON[_0x7b2f('0xf')](_0x5b41ff));if(_0x5b41ff[_0x7b2f('0x10')]){if(_0x5b41ff[_0x7b2f('0x10')][_0x7b2f('0x11')]===0x1f4){logger[_0x7b2f('0x10')](_0x7b2f('0x12'),_0x287cf4,_0x5b41ff[_0x7b2f('0x10')][_0x7b2f('0x13')]);return _0x47caa0(_0x5b41ff['error'][_0x7b2f('0x13')]);}logger[_0x7b2f('0x10')](_0x7b2f('0x12'),_0x287cf4,_0x5b41ff[_0x7b2f('0x10')][_0x7b2f('0x13')]);return _0x58212a(_0x5b41ff[_0x7b2f('0x10')][_0x7b2f('0x13')]);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x287cf4,_0x7b2f('0xc'));_0x58212a(_0x5b41ff[_0x7b2f('0x14')]['message']);}})['catch'](function(_0x2b98f8){logger[_0x7b2f('0x10')](_0x7b2f('0x12'),_0x287cf4,_0x2b98f8);_0x47caa0(_0x2b98f8);});});}exports['GetVtigerAccount']=function(_0x25e43d){var _0x2ff0b9=this;return new Promise(function(_0x4f381a,_0x11d948){return db['VtigerAccount'][_0x7b2f('0x15')]({'raw':_0x25e43d[_0x7b2f('0x16')]?_0x25e43d[_0x7b2f('0x16')][_0x7b2f('0x17')]===undefined?!![]:![]:!![],'where':_0x25e43d[_0x7b2f('0x16')]?_0x25e43d[_0x7b2f('0x16')]['where']||null:null,'attributes':_0x25e43d['options']?_0x25e43d[_0x7b2f('0x16')][_0x7b2f('0x18')]||null:null,'limit':_0x25e43d[_0x7b2f('0x16')]?_0x25e43d[_0x7b2f('0x16')]['limit']||null:null,'include':_0x25e43d[_0x7b2f('0x16')]?_0x25e43d[_0x7b2f('0x16')][_0x7b2f('0x19')]?_['map'](_0x25e43d[_0x7b2f('0x16')][_0x7b2f('0x19')],function(_0x38036d){return{'model':db[_0x38036d[_0x7b2f('0x1a')]],'as':_0x38036d['as'],'attributes':_0x38036d[_0x7b2f('0x18')],'include':_0x38036d[_0x7b2f('0x19')]?_['map'](_0x38036d[_0x7b2f('0x19')],function(_0x48b03b){return{'model':db[_0x48b03b[_0x7b2f('0x1a')]],'as':_0x48b03b['as'],'attributes':_0x48b03b[_0x7b2f('0x18')],'include':_0x48b03b[_0x7b2f('0x19')]?_['map'](_0x48b03b['include'],function(_0x2df735){return{'model':db[_0x2df735[_0x7b2f('0x1a')]],'as':_0x2df735['as'],'attributes':_0x2df735[_0x7b2f('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7b2f('0xb')](function(_0x33413e){logger['info'](_0x7b2f('0x1b'),_0x25e43d);logger['debug']('GetVtigerAccount',_0x25e43d,JSON[_0x7b2f('0xf')](_0x33413e));_0x4f381a(_0x33413e);})['catch'](function(_0x3d26ef){logger[_0x7b2f('0x10')](_0x7b2f('0x1b'),_0x3d26ef[_0x7b2f('0x13')],_0x25e43d);_0x11d948(_0x2ff0b9[_0x7b2f('0x10')](0x1f4,_0x3d26ef['message']));});});};exports['ShowVtigerAccount']=function(_0x31acc9){var _0x70a618=this;return new Promise(function(_0x528c89,_0x3afb01){return db[_0x7b2f('0x1c')]['find']({'raw':_0x31acc9[_0x7b2f('0x16')]?_0x31acc9[_0x7b2f('0x16')][_0x7b2f('0x17')]===undefined?!![]:![]:!![],'where':_0x31acc9[_0x7b2f('0x16')]?_0x31acc9[_0x7b2f('0x16')][_0x7b2f('0x1d')]||null:null,'attributes':_0x31acc9[_0x7b2f('0x16')]?_0x31acc9['options']['attributes']||null:null,'include':_0x31acc9['options']?_0x31acc9[_0x7b2f('0x16')][_0x7b2f('0x19')]?_['map'](_0x31acc9[_0x7b2f('0x16')][_0x7b2f('0x19')],function(_0x555843){return{'model':db[_0x555843[_0x7b2f('0x1a')]],'as':_0x555843['as'],'attributes':_0x555843[_0x7b2f('0x18')],'include':_0x555843[_0x7b2f('0x19')]?_['map'](_0x555843['include'],function(_0xdae049){return{'model':db[_0xdae049[_0x7b2f('0x1a')]],'as':_0xdae049['as'],'attributes':_0xdae049[_0x7b2f('0x18')],'include':_0xdae049['include']?_['map'](_0xdae049[_0x7b2f('0x19')],function(_0x735049){return{'model':db[_0x735049[_0x7b2f('0x1a')]],'as':_0x735049['as'],'attributes':_0x735049[_0x7b2f('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5382c0){logger[_0x7b2f('0x1e')]('ShowVtigerAccount',_0x31acc9);logger[_0x7b2f('0xd')](_0x7b2f('0x1f'),_0x31acc9,JSON[_0x7b2f('0xf')](_0x5382c0));_0x528c89(_0x5382c0);})[_0x7b2f('0x20')](function(_0x87c5fc){logger['error'](_0x7b2f('0x1f'),_0x87c5fc[_0x7b2f('0x13')],_0x31acc9);_0x3afb01(_0x70a618[_0x7b2f('0x10')](0x1f4,_0x87c5fc[_0x7b2f('0x13')]));});});};
\ No newline at end of file
+var _0x4f83=['options','raw','where','attributes','include','map','model','then','info','catch','ShowVtigerAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VtigerAccount,\x20%s,\x20%s','GetVtigerAccount','VtigerAccount','findAll'];(function(_0x1d000e,_0x1d34b2){var _0x1a9a5d=function(_0x138600){while(--_0x138600){_0x1d000e['push'](_0x1d000e['shift']());}};_0x1a9a5d(++_0x1d34b2);}(_0x4f83,0x124));var _0x34f8=function(_0x4625fc,_0x57c355){_0x4625fc=_0x4625fc-0x0;var _0x149edb=_0x4f83[_0x4625fc];return _0x149edb;};'use strict';var _=require(_0x34f8('0x0'));var util=require(_0x34f8('0x1'));var moment=require(_0x34f8('0x2'));var BPromise=require('bluebird');var rs=require(_0x34f8('0x3'));var fs=require('fs');var Redis=require(_0x34f8('0x4'));var db=require(_0x34f8('0x5'))['db'];var utils=require(_0x34f8('0x6'));var logger=require(_0x34f8('0x7'))(_0x34f8('0x8'));var config=require('../../config/environment');var jayson=require(_0x34f8('0x9'));var client=jayson[_0x34f8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e1f44,_0x1ffff8,_0x374c0f){return new BPromise(function(_0x495eb9,_0x40630f){return client[_0x34f8('0xb')](_0x2e1f44,_0x374c0f)['then'](function(_0x13a2c0){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x1ffff8,_0x34f8('0xc'));logger[_0x34f8('0xd')](_0x34f8('0xe'),_0x1ffff8,_0x34f8('0xc'),JSON[_0x34f8('0xf')](_0x13a2c0));if(_0x13a2c0[_0x34f8('0x10')]){if(_0x13a2c0[_0x34f8('0x10')][_0x34f8('0x11')]===0x1f4){logger[_0x34f8('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x1ffff8,_0x13a2c0[_0x34f8('0x10')][_0x34f8('0x12')]);return _0x40630f(_0x13a2c0['error'][_0x34f8('0x12')]);}logger[_0x34f8('0x10')](_0x34f8('0x13'),_0x1ffff8,_0x13a2c0[_0x34f8('0x10')][_0x34f8('0x12')]);return _0x495eb9(_0x13a2c0[_0x34f8('0x10')][_0x34f8('0x12')]);}else{logger['info'](_0x34f8('0x13'),_0x1ffff8,_0x34f8('0xc'));_0x495eb9(_0x13a2c0['result'][_0x34f8('0x12')]);}})['catch'](function(_0x3ee8b6){logger[_0x34f8('0x10')](_0x34f8('0x13'),_0x1ffff8,_0x3ee8b6);_0x40630f(_0x3ee8b6);});});}exports[_0x34f8('0x14')]=function(_0x5cfe56){var _0x2cba7d=this;return new Promise(function(_0x1fd362,_0x1f2890){return db[_0x34f8('0x15')][_0x34f8('0x16')]({'raw':_0x5cfe56['options']?_0x5cfe56[_0x34f8('0x17')][_0x34f8('0x18')]===undefined?!![]:![]:!![],'where':_0x5cfe56[_0x34f8('0x17')]?_0x5cfe56['options'][_0x34f8('0x19')]||null:null,'attributes':_0x5cfe56[_0x34f8('0x17')]?_0x5cfe56['options'][_0x34f8('0x1a')]||null:null,'limit':_0x5cfe56['options']?_0x5cfe56[_0x34f8('0x17')]['limit']||null:null,'include':_0x5cfe56[_0x34f8('0x17')]?_0x5cfe56[_0x34f8('0x17')][_0x34f8('0x1b')]?_[_0x34f8('0x1c')](_0x5cfe56[_0x34f8('0x17')][_0x34f8('0x1b')],function(_0x3ba35b){return{'model':db[_0x3ba35b[_0x34f8('0x1d')]],'as':_0x3ba35b['as'],'attributes':_0x3ba35b['attributes'],'include':_0x3ba35b['include']?_[_0x34f8('0x1c')](_0x3ba35b[_0x34f8('0x1b')],function(_0x1c84d5){return{'model':db[_0x1c84d5['model']],'as':_0x1c84d5['as'],'attributes':_0x1c84d5[_0x34f8('0x1a')],'include':_0x1c84d5['include']?_[_0x34f8('0x1c')](_0x1c84d5[_0x34f8('0x1b')],function(_0x393eb7){return{'model':db[_0x393eb7[_0x34f8('0x1d')]],'as':_0x393eb7['as'],'attributes':_0x393eb7[_0x34f8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x34f8('0x1e')](function(_0x4f5cc7){logger[_0x34f8('0x1f')](_0x34f8('0x14'),_0x5cfe56);logger[_0x34f8('0xd')](_0x34f8('0x14'),_0x5cfe56,JSON[_0x34f8('0xf')](_0x4f5cc7));_0x1fd362(_0x4f5cc7);})[_0x34f8('0x20')](function(_0x11f6f1){logger['error'](_0x34f8('0x14'),_0x11f6f1[_0x34f8('0x12')],_0x5cfe56);_0x1f2890(_0x2cba7d['error'](0x1f4,_0x11f6f1[_0x34f8('0x12')]));});});};exports[_0x34f8('0x21')]=function(_0x22a128){var _0x4464fc=this;return new Promise(function(_0x434dd2,_0x1203fb){return db[_0x34f8('0x15')][_0x34f8('0x22')]({'raw':_0x22a128[_0x34f8('0x17')]?_0x22a128[_0x34f8('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x22a128[_0x34f8('0x17')]?_0x22a128['options'][_0x34f8('0x19')]||null:null,'attributes':_0x22a128[_0x34f8('0x17')]?_0x22a128[_0x34f8('0x17')][_0x34f8('0x1a')]||null:null,'include':_0x22a128['options']?_0x22a128[_0x34f8('0x17')][_0x34f8('0x1b')]?_['map'](_0x22a128[_0x34f8('0x17')]['include'],function(_0x54ab94){return{'model':db[_0x54ab94[_0x34f8('0x1d')]],'as':_0x54ab94['as'],'attributes':_0x54ab94[_0x34f8('0x1a')],'include':_0x54ab94[_0x34f8('0x1b')]?_[_0x34f8('0x1c')](_0x54ab94[_0x34f8('0x1b')],function(_0x4d9c7d){return{'model':db[_0x4d9c7d['model']],'as':_0x4d9c7d['as'],'attributes':_0x4d9c7d[_0x34f8('0x1a')],'include':_0x4d9c7d[_0x34f8('0x1b')]?_[_0x34f8('0x1c')](_0x4d9c7d[_0x34f8('0x1b')],function(_0x3e667e){return{'model':db[_0x3e667e[_0x34f8('0x1d')]],'as':_0x3e667e['as'],'attributes':_0x3e667e[_0x34f8('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d0485){logger[_0x34f8('0x1f')](_0x34f8('0x21'),_0x22a128);logger[_0x34f8('0xd')](_0x34f8('0x21'),_0x22a128,JSON[_0x34f8('0xf')](_0x1d0485));_0x434dd2(_0x1d0485);})['catch'](function(_0x12fdf4){logger[_0x34f8('0x10')](_0x34f8('0x21'),_0x12fdf4[_0x34f8('0x12')],_0x22a128);_0x1203fb(_0x4464fc['error'](0x1f4,_0x12fdf4[_0x34f8('0x12')]));});});};
\ No newline at end of file